From d9c933fe2b6095d202fa08b7a72ae5c9932db436 Mon Sep 17 00:00:00 2001 From: Dev Date: Fri, 4 Aug 2023 17:33:45 +0100 Subject: [PATCH] Update types --- .../types/controllers/GameController.d.ts | 16 ++++++++++++++-- .../types/generators/BotGenerator.d.ts | 6 ++++-- .../types/helpers/DialogueHelper.d.ts | 6 ++++++ .../types/helpers/HideoutHelper.d.ts | 16 ++++++---------- .../types/helpers/TraderHelper.d.ts | 8 ++++++++ .../types/loaders/PreAkiModLoader.d.ts | 1 + .../eft/common/tables/IProfileTemplate.d.ts | 2 +- .../types/models/eft/profile/IAkiProfile.d.ts | 2 +- .../types/models/spt/config/IPmcConfig.d.ts | 2 ++ .../types/services/LocalisationService.d.ts | 10 +++++++++- .../types/services/MailSendService.d.ts | 4 +++- .../types/services/ProfileFixerService.d.ts | 6 ++++-- .../types/controllers/GameController.d.ts | 16 ++++++++++++++-- .../types/generators/BotGenerator.d.ts | 6 ++++-- .../types/helpers/DialogueHelper.d.ts | 6 ++++++ .../types/helpers/HideoutHelper.d.ts | 16 ++++++---------- .../types/helpers/TraderHelper.d.ts | 8 ++++++++ .../types/loaders/PreAkiModLoader.d.ts | 1 + .../eft/common/tables/IProfileTemplate.d.ts | 2 +- .../types/models/eft/profile/IAkiProfile.d.ts | 2 +- .../types/models/spt/config/IPmcConfig.d.ts | 2 ++ .../types/services/LocalisationService.d.ts | 10 +++++++++- .../types/services/MailSendService.d.ts | 4 +++- .../types/services/ProfileFixerService.d.ts | 6 ++++-- .../types/controllers/GameController.d.ts | 16 ++++++++++++++-- .../types/generators/BotGenerator.d.ts | 6 ++++-- .../types/helpers/DialogueHelper.d.ts | 6 ++++++ .../types/helpers/HideoutHelper.d.ts | 16 ++++++---------- .../types/helpers/TraderHelper.d.ts | 8 ++++++++ .../types/loaders/PreAkiModLoader.d.ts | 1 + .../eft/common/tables/IProfileTemplate.d.ts | 2 +- .../types/models/eft/profile/IAkiProfile.d.ts | 2 +- .../types/models/spt/config/IPmcConfig.d.ts | 2 ++ .../types/services/LocalisationService.d.ts | 10 +++++++++- .../types/services/MailSendService.d.ts | 4 +++- .../types/services/ProfileFixerService.d.ts | 6 ++++-- .../types/helpers/DialogueHelper.d.ts | 6 ++++++ .../13AddTrader/types/helpers/TraderHelper.d.ts | 8 ++++++++ .../eft/common/tables/IProfileTemplate.d.ts | 2 +- .../types/models/eft/profile/IAkiProfile.d.ts | 2 +- .../types/services/MailSendService.d.ts | 4 +++- .../types/services/ProfileFixerService.d.ts | 6 ++++-- .../types/controllers/GameController.d.ts | 16 ++++++++++++++-- .../types/generators/BotGenerator.d.ts | 6 ++++-- .../types/helpers/DialogueHelper.d.ts | 6 ++++++ .../types/helpers/HideoutHelper.d.ts | 16 ++++++---------- .../types/helpers/TraderHelper.d.ts | 8 ++++++++ .../types/loaders/PreAkiModLoader.d.ts | 1 + .../eft/common/tables/IProfileTemplate.d.ts | 2 +- .../types/models/eft/profile/IAkiProfile.d.ts | 2 +- .../types/models/spt/config/IPmcConfig.d.ts | 2 ++ .../types/services/LocalisationService.d.ts | 10 +++++++++- .../types/services/MailSendService.d.ts | 4 +++- .../types/services/ProfileFixerService.d.ts | 6 ++++-- .../types/controllers/GameController.d.ts | 16 ++++++++++++++-- .../types/generators/BotGenerator.d.ts | 6 ++++-- .../types/helpers/DialogueHelper.d.ts | 6 ++++++ .../types/helpers/HideoutHelper.d.ts | 16 ++++++---------- .../types/helpers/TraderHelper.d.ts | 8 ++++++++ .../types/loaders/PreAkiModLoader.d.ts | 1 + .../eft/common/tables/IProfileTemplate.d.ts | 2 +- .../types/models/eft/profile/IAkiProfile.d.ts | 2 +- .../types/models/spt/config/IPmcConfig.d.ts | 2 ++ .../types/services/LocalisationService.d.ts | 10 +++++++++- .../types/services/MailSendService.d.ts | 4 +++- .../types/services/ProfileFixerService.d.ts | 6 ++++-- .../types/controllers/GameController.d.ts | 16 ++++++++++++++-- .../types/generators/BotGenerator.d.ts | 6 ++++-- .../types/helpers/DialogueHelper.d.ts | 6 ++++++ .../types/helpers/HideoutHelper.d.ts | 16 ++++++---------- .../types/helpers/TraderHelper.d.ts | 8 ++++++++ .../types/loaders/PreAkiModLoader.d.ts | 1 + .../eft/common/tables/IProfileTemplate.d.ts | 2 +- .../types/models/eft/profile/IAkiProfile.d.ts | 2 +- .../types/models/spt/config/IPmcConfig.d.ts | 2 ++ .../types/services/LocalisationService.d.ts | 10 +++++++++- .../types/services/MailSendService.d.ts | 4 +++- .../types/services/ProfileFixerService.d.ts | 6 ++++-- .../types/controllers/GameController.d.ts | 16 ++++++++++++++-- .../types/generators/BotGenerator.d.ts | 6 ++++-- .../types/helpers/DialogueHelper.d.ts | 6 ++++++ .../types/helpers/HideoutHelper.d.ts | 16 ++++++---------- .../types/helpers/TraderHelper.d.ts | 8 ++++++++ .../types/loaders/PreAkiModLoader.d.ts | 1 + .../eft/common/tables/IProfileTemplate.d.ts | 2 +- .../types/models/eft/profile/IAkiProfile.d.ts | 2 +- .../types/models/spt/config/IPmcConfig.d.ts | 2 ++ .../types/services/LocalisationService.d.ts | 10 +++++++++- .../types/services/MailSendService.d.ts | 4 +++- .../types/services/ProfileFixerService.d.ts | 6 ++++-- .../types/controllers/GameController.d.ts | 16 ++++++++++++++-- .../types/generators/BotGenerator.d.ts | 6 ++++-- .../types/helpers/DialogueHelper.d.ts | 6 ++++++ .../types/helpers/HideoutHelper.d.ts | 16 ++++++---------- .../types/helpers/TraderHelper.d.ts | 8 ++++++++ .../types/loaders/PreAkiModLoader.d.ts | 1 + .../eft/common/tables/IProfileTemplate.d.ts | 2 +- .../types/models/eft/profile/IAkiProfile.d.ts | 2 +- .../types/models/spt/config/IPmcConfig.d.ts | 2 ++ .../types/services/LocalisationService.d.ts | 10 +++++++++- .../types/services/MailSendService.d.ts | 4 +++- .../types/services/ProfileFixerService.d.ts | 6 ++++-- .../types/helpers/DialogueHelper.d.ts | 6 ++++++ .../types/helpers/TraderHelper.d.ts | 8 ++++++++ .../eft/common/tables/IProfileTemplate.d.ts | 2 +- .../types/models/eft/profile/IAkiProfile.d.ts | 2 +- .../types/services/MailSendService.d.ts | 4 +++- .../types/services/ProfileFixerService.d.ts | 6 ++++-- .../types/helpers/DialogueHelper.d.ts | 6 ++++++ .../types/helpers/TraderHelper.d.ts | 8 ++++++++ .../eft/common/tables/IProfileTemplate.d.ts | 2 +- .../types/models/eft/profile/IAkiProfile.d.ts | 2 +- .../types/services/MailSendService.d.ts | 4 +++- .../types/services/ProfileFixerService.d.ts | 6 ++++-- .../types/helpers/DialogueHelper.d.ts | 6 ++++++ .../types/helpers/TraderHelper.d.ts | 8 ++++++++ .../eft/common/tables/IProfileTemplate.d.ts | 2 +- .../types/models/eft/profile/IAkiProfile.d.ts | 2 +- .../types/services/MailSendService.d.ts | 4 +++- .../types/services/ProfileFixerService.d.ts | 6 ++++-- .../types/helpers/DialogueHelper.d.ts | 6 ++++++ .../types/helpers/TraderHelper.d.ts | 8 ++++++++ .../eft/common/tables/IProfileTemplate.d.ts | 2 +- .../types/models/eft/profile/IAkiProfile.d.ts | 2 +- .../types/services/MailSendService.d.ts | 4 +++- .../types/services/ProfileFixerService.d.ts | 6 ++++-- .../types/helpers/DialogueHelper.d.ts | 6 ++++++ .../types/helpers/TraderHelper.d.ts | 8 ++++++++ .../eft/common/tables/IProfileTemplate.d.ts | 2 +- .../types/models/eft/profile/IAkiProfile.d.ts | 2 +- .../types/services/MailSendService.d.ts | 4 +++- .../types/services/ProfileFixerService.d.ts | 6 ++++-- .../types/helpers/DialogueHelper.d.ts | 6 ++++++ .../types/helpers/TraderHelper.d.ts | 8 ++++++++ .../eft/common/tables/IProfileTemplate.d.ts | 2 +- .../types/models/eft/profile/IAkiProfile.d.ts | 2 +- .../types/services/MailSendService.d.ts | 4 +++- .../types/services/ProfileFixerService.d.ts | 6 ++++-- .../types/helpers/DialogueHelper.d.ts | 6 ++++++ .../types/helpers/TraderHelper.d.ts | 8 ++++++++ .../eft/common/tables/IProfileTemplate.d.ts | 2 +- .../types/models/eft/profile/IAkiProfile.d.ts | 2 +- .../types/services/MailSendService.d.ts | 4 +++- .../types/services/ProfileFixerService.d.ts | 6 ++++-- .../types/controllers/GameController.d.ts | 16 ++++++++++++++-- .../types/generators/BotGenerator.d.ts | 6 ++++-- .../types/helpers/DialogueHelper.d.ts | 6 ++++++ .../7OnLoadHook/types/helpers/HideoutHelper.d.ts | 16 ++++++---------- .../7OnLoadHook/types/helpers/TraderHelper.d.ts | 8 ++++++++ .../types/loaders/PreAkiModLoader.d.ts | 1 + .../eft/common/tables/IProfileTemplate.d.ts | 2 +- .../types/models/eft/profile/IAkiProfile.d.ts | 2 +- .../types/models/spt/config/IPmcConfig.d.ts | 2 ++ .../types/services/LocalisationService.d.ts | 10 +++++++++- .../types/services/MailSendService.d.ts | 4 +++- .../types/services/ProfileFixerService.d.ts | 6 ++++-- .../types/controllers/GameController.d.ts | 16 ++++++++++++++-- .../types/generators/BotGenerator.d.ts | 6 ++++-- .../types/helpers/DialogueHelper.d.ts | 6 ++++++ .../types/helpers/HideoutHelper.d.ts | 16 ++++++---------- .../types/helpers/TraderHelper.d.ts | 8 ++++++++ .../types/loaders/PreAkiModLoader.d.ts | 1 + .../eft/common/tables/IProfileTemplate.d.ts | 2 +- .../types/models/eft/profile/IAkiProfile.d.ts | 2 +- .../types/models/spt/config/IPmcConfig.d.ts | 2 ++ .../types/services/LocalisationService.d.ts | 10 +++++++++- .../types/services/MailSendService.d.ts | 4 +++- .../types/services/ProfileFixerService.d.ts | 6 ++++-- .../types/controllers/GameController.d.ts | 16 ++++++++++++++-- .../types/generators/BotGenerator.d.ts | 6 ++++-- .../types/helpers/DialogueHelper.d.ts | 6 ++++++ .../types/helpers/HideoutHelper.d.ts | 16 ++++++---------- .../9RouterHooks/types/helpers/TraderHelper.d.ts | 8 ++++++++ .../types/loaders/PreAkiModLoader.d.ts | 1 + .../eft/common/tables/IProfileTemplate.d.ts | 2 +- .../types/models/eft/profile/IAkiProfile.d.ts | 2 +- .../types/models/spt/config/IPmcConfig.d.ts | 2 ++ .../types/services/LocalisationService.d.ts | 10 +++++++++- .../types/services/MailSendService.d.ts | 4 +++- .../types/services/ProfileFixerService.d.ts | 6 ++++-- 180 files changed, 833 insertions(+), 260 deletions(-) diff --git a/TypeScript/10ScopesAndTypes/types/controllers/GameController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/GameController.d.ts index 6d0ce18..d7a7f1a 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/GameController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/GameController.d.ts @@ -11,9 +11,11 @@ import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse"; import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; +import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; +import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -25,6 +27,7 @@ import { ProfileFixerService } from "../services/ProfileFixerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { EncodingUtil } from "../utils/EncodingUtil"; import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class GameController { protected logger: ILogger; @@ -33,6 +36,7 @@ export declare class GameController { protected timeUtil: TimeUtil; protected preAkiModLoader: PreAkiModLoader; protected httpServerHelper: HttpServerHelper; + protected randomUtil: RandomUtil; protected encodingUtil: EncodingUtil; protected hideoutHelper: HideoutHelper; protected profileHelper: ProfileHelper; @@ -48,7 +52,9 @@ export declare class GameController { protected httpConfig: IHttpConfig; protected coreConfig: ICoreConfig; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); + protected ragfairConfig: IRagfairConfig; + protected botConfig: IBotConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); /** * Handle client/game/start */ @@ -84,6 +90,7 @@ export declare class GameController { * @param pmcProfile Player profile */ protected warnOnActiveBotReloadSkill(pmcProfile: IPmcData): void; + protected flagAllItemsInDbAsSellableOnFlea(): void; /** * When player logs in, iterate over all active effects and reduce timer * TODO - add body part HP regen @@ -118,9 +125,14 @@ export declare class GameController { protected validateQuestAssortUnlocksExist(): void; /** * Add the logged in players name to PMC name pool - * @param pmcProfile + * @param pmcProfile Profile of player to get name from */ protected addPlayerToPMCNames(pmcProfile: IPmcData): void; + /** + * Check for a dialog with the key 'undefined', and remove it + * @param fullProfile Profile to check for dialog in + */ + protected checkForAndRemoveUndefinedDialogs(fullProfile: IAkiProfile): void; /** * Blank out the "test" mail message from prapor */ diff --git a/TypeScript/10ScopesAndTypes/types/generators/BotGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/BotGenerator.d.ts index 5236a12..4530517 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/BotGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/BotGenerator.d.ts @@ -10,6 +10,7 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; +import { LocalisationService } from "../services/LocalisationService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; @@ -32,9 +33,10 @@ export declare class BotGenerator { protected botHelper: BotHelper; protected botDifficultyHelper: BotDifficultyHelper; protected seasonalEventService: SeasonalEventService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -71,7 +73,7 @@ export declare class BotGenerator { * @param botRole role of bot e.g. assault * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string, sessionId: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client diff --git a/TypeScript/10ScopesAndTypes/types/helpers/DialogueHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/DialogueHelper.d.ts index 6a8adc5..ea3bae7 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/DialogueHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/DialogueHelper.d.ts @@ -41,4 +41,10 @@ export declare class DialogueHelper { * @returns */ getMessageItemContents(messageID: string, sessionID: string, itemId: string): Item[]; + /** + * Get the dialogs dictionary for a profile, create if doesnt exist + * @param sessionId Session/player id + * @returns Dialog dictionary + */ + getDialogsForProfile(sessionId: string): Record; } diff --git a/TypeScript/10ScopesAndTypes/types/helpers/HideoutHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/HideoutHelper.d.ts index e9d3746..d9119a2 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/HideoutHelper.d.ts @@ -58,16 +58,12 @@ export declare class HideoutHelper { * @returns */ isProductionType(productive: Productive): productive is Production; - applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void; /** - * TODO: - * After looking at the skills there doesnt seem to be a configuration per skill to boost - * the XP gain PER skill. I THINK you should be able to put the variable "SkillProgress" (just like health has it) - * and be able to tune the skill gain PER skill, but I havent tested it and Im not sure! - * @param pmcData - * @param bonus + * Apply bonus to player profile given after completing hideout upgrades + * @param pmcData Profile to add bonus to + * @param bonus Bonus to add to profile */ - protected applySkillXPBoost(pmcData: IPmcData, bonus: StageBonus): void; + applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void; /** * Process a players hideout, update areas that use resources + increment production timers * @param sessionID Session id @@ -83,6 +79,7 @@ export declare class HideoutHelper { isGeneratorOn: boolean; waterCollectorHasFilter: boolean; }; + protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean; /** * Update progress timer for water collector * @param pmcData profile to update @@ -141,9 +138,8 @@ export declare class HideoutHelper { isGeneratorOn: boolean; waterCollectorHasFilter: boolean; }): void; - protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void; - protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean; protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData): void; + protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/10ScopesAndTypes/types/helpers/TraderHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/TraderHelper.d.ts index 4157c1c..7cf764d 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/TraderHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/TraderHelper.d.ts @@ -1,4 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; +import { ProfileTraderTemplate } from "../models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; import { Traders } from "../models/enums/Traders"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; @@ -42,6 +43,7 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -113,4 +115,10 @@ export declare class TraderHelper { * @returns Traders key */ getTraderById(traderId: string): Traders; + /** + * Does the 'Traders' enum has a value that matches the passed in parameter + * @param value Value to check for + * @returns True, values exists in Traders enum as a value + */ + traderEnumHasValue(value: string): boolean; } diff --git a/TypeScript/10ScopesAndTypes/types/loaders/PreAkiModLoader.d.ts b/TypeScript/10ScopesAndTypes/types/loaders/PreAkiModLoader.d.ts index a67f1c9..08059ff 100644 --- a/TypeScript/10ScopesAndTypes/types/loaders/PreAkiModLoader.d.ts +++ b/TypeScript/10ScopesAndTypes/types/loaders/PreAkiModLoader.d.ts @@ -35,6 +35,7 @@ export declare class PreAkiModLoader implements IModLoader { getImportedModDetails(): Record; getModPath(mod: string): string; protected importMods(): Promise; + protected sortMods(prev: string, next: string, missingFromOrderJSON: Record): number; /** * Check for duplicate mods loaded, show error if any * @param modPackageData Dictionary of mod package.json data diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IProfileTemplate.d.ts index 66ebbe8..411fead 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -14,7 +14,7 @@ export interface TemplateSide { character: IPmcData; suits: string[]; dialogues: Record; - weaponbuilds: WeaponBuild[]; + weaponbuilds: Record; trader: ProfileTraderTemplate; } export interface ProfileTraderTemplate { diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/profile/IAkiProfile.d.ts index d08da6e..93b89e2 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/profile/IAkiProfile.d.ts @@ -7,7 +7,7 @@ export interface IAkiProfile { characters: Characters; /** Clothing purchases */ suits: string[]; - weaponbuilds: WeaponBuild[]; + weaponbuilds: Record; dialogues: Record; aki: Aki; vitality: Vitality; diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IPmcConfig.d.ts index a349ac2..339e0c6 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IPmcConfig.d.ts @@ -40,6 +40,8 @@ export interface IPmcConfig { botRelativeLevelDeltaMax: number; /** Force a number of healing items into PMCs secure container to ensure they can heal */ forceHealingItemsIntoSecure: boolean; + addPrefixToSameNamePMCAsPlayerChance: number; + allPMCsHavePlayerNameWithRandomPrefixChance: number; } export interface PmcTypes { usec: string; diff --git a/TypeScript/10ScopesAndTypes/types/services/LocalisationService.d.ts b/TypeScript/10ScopesAndTypes/types/services/LocalisationService.d.ts index 44a4941..ec6eecf 100644 --- a/TypeScript/10ScopesAndTypes/types/services/LocalisationService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/LocalisationService.d.ts @@ -2,17 +2,19 @@ import { I18n } from "i18n"; import { ILocaleConfig } from "../models/spt/config/ILocaleConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { RandomUtil } from "../utils/RandomUtil"; import { LocaleService } from "./LocaleService"; /** * Handles translating server text into different langauges */ export declare class LocalisationService { protected logger: ILogger; + protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; protected localeService: LocaleService; protected localeConfig: ILocaleConfig; protected i18n: I18n; - constructor(logger: ILogger, databaseServer: DatabaseServer, localeService: LocaleService); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, localeService: LocaleService); /** * Get a localised value using the passed in key * @param key Key to loop up locale for @@ -25,4 +27,10 @@ export declare class LocalisationService { * @returns string array of keys */ getKeys(): string[]; + /** + * From the provided partial key, find all keys that start with text and choose a random match + * @param partialKey Key to match locale keys on + * @returns locale text + */ + getRandomTextThatMatchesPartialKey(partialKey: string): string; } diff --git a/TypeScript/10ScopesAndTypes/types/services/MailSendService.d.ts b/TypeScript/10ScopesAndTypes/types/services/MailSendService.d.ts index 70b8e44..8ec5cf8 100644 --- a/TypeScript/10ScopesAndTypes/types/services/MailSendService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/MailSendService.d.ts @@ -1,3 +1,4 @@ +import { DialogueHelper } from "../helpers/DialogueHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; import { NotifierHelper } from "../helpers/NotifierHelper"; @@ -19,11 +20,12 @@ export declare class MailSendService { protected saveServer: SaveServer; protected databaseServer: DatabaseServer; protected notifierHelper: NotifierHelper; + protected dialogueHelper: DialogueHelper; protected notificationSendHelper: NotificationSendHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected readonly systemSenderId = "59e7125688a45068a6249071"; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, dialogueHelper: DialogueHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); /** * Send a message from an NPC (e.g. prapor) to the player with or without items using direct message text, do not look up any locale * @param playerId Players id to send message to diff --git a/TypeScript/10ScopesAndTypes/types/services/ProfileFixerService.d.ts b/TypeScript/10ScopesAndTypes/types/services/ProfileFixerService.d.ts index 418626d..b92c2f0 100644 --- a/TypeScript/10ScopesAndTypes/types/services/ProfileFixerService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/ProfileFixerService.d.ts @@ -1,6 +1,7 @@ import { HideoutHelper } from "../helpers/HideoutHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; @@ -20,6 +21,7 @@ export declare class ProfileFixerService { protected watermark: Watermark; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; + protected traderHelper: TraderHelper; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected timeUtil: TimeUtil; @@ -27,7 +29,7 @@ export declare class ProfileFixerService { protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -105,7 +107,7 @@ export declare class ProfileFixerService { * @param sessionId Session id * @param pmcProfile Profile to check inventory of */ - checkForOrphanedModdedItems(sessionId: string, pmcProfile: IPmcData): void; + checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; /** * Add `Improvements` object to hideout if missing - added in eft 13.0.21469 * @param pmcProfile profile to update diff --git a/TypeScript/11BundleLoadingSample/types/controllers/GameController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/GameController.d.ts index 6d0ce18..d7a7f1a 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/GameController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/GameController.d.ts @@ -11,9 +11,11 @@ import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse"; import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; +import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; +import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -25,6 +27,7 @@ import { ProfileFixerService } from "../services/ProfileFixerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { EncodingUtil } from "../utils/EncodingUtil"; import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class GameController { protected logger: ILogger; @@ -33,6 +36,7 @@ export declare class GameController { protected timeUtil: TimeUtil; protected preAkiModLoader: PreAkiModLoader; protected httpServerHelper: HttpServerHelper; + protected randomUtil: RandomUtil; protected encodingUtil: EncodingUtil; protected hideoutHelper: HideoutHelper; protected profileHelper: ProfileHelper; @@ -48,7 +52,9 @@ export declare class GameController { protected httpConfig: IHttpConfig; protected coreConfig: ICoreConfig; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); + protected ragfairConfig: IRagfairConfig; + protected botConfig: IBotConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); /** * Handle client/game/start */ @@ -84,6 +90,7 @@ export declare class GameController { * @param pmcProfile Player profile */ protected warnOnActiveBotReloadSkill(pmcProfile: IPmcData): void; + protected flagAllItemsInDbAsSellableOnFlea(): void; /** * When player logs in, iterate over all active effects and reduce timer * TODO - add body part HP regen @@ -118,9 +125,14 @@ export declare class GameController { protected validateQuestAssortUnlocksExist(): void; /** * Add the logged in players name to PMC name pool - * @param pmcProfile + * @param pmcProfile Profile of player to get name from */ protected addPlayerToPMCNames(pmcProfile: IPmcData): void; + /** + * Check for a dialog with the key 'undefined', and remove it + * @param fullProfile Profile to check for dialog in + */ + protected checkForAndRemoveUndefinedDialogs(fullProfile: IAkiProfile): void; /** * Blank out the "test" mail message from prapor */ diff --git a/TypeScript/11BundleLoadingSample/types/generators/BotGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/BotGenerator.d.ts index 5236a12..4530517 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/BotGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/BotGenerator.d.ts @@ -10,6 +10,7 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; +import { LocalisationService } from "../services/LocalisationService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; @@ -32,9 +33,10 @@ export declare class BotGenerator { protected botHelper: BotHelper; protected botDifficultyHelper: BotDifficultyHelper; protected seasonalEventService: SeasonalEventService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -71,7 +73,7 @@ export declare class BotGenerator { * @param botRole role of bot e.g. assault * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string, sessionId: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client diff --git a/TypeScript/11BundleLoadingSample/types/helpers/DialogueHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/DialogueHelper.d.ts index 6a8adc5..ea3bae7 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/DialogueHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/DialogueHelper.d.ts @@ -41,4 +41,10 @@ export declare class DialogueHelper { * @returns */ getMessageItemContents(messageID: string, sessionID: string, itemId: string): Item[]; + /** + * Get the dialogs dictionary for a profile, create if doesnt exist + * @param sessionId Session/player id + * @returns Dialog dictionary + */ + getDialogsForProfile(sessionId: string): Record; } diff --git a/TypeScript/11BundleLoadingSample/types/helpers/HideoutHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/HideoutHelper.d.ts index e9d3746..d9119a2 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/HideoutHelper.d.ts @@ -58,16 +58,12 @@ export declare class HideoutHelper { * @returns */ isProductionType(productive: Productive): productive is Production; - applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void; /** - * TODO: - * After looking at the skills there doesnt seem to be a configuration per skill to boost - * the XP gain PER skill. I THINK you should be able to put the variable "SkillProgress" (just like health has it) - * and be able to tune the skill gain PER skill, but I havent tested it and Im not sure! - * @param pmcData - * @param bonus + * Apply bonus to player profile given after completing hideout upgrades + * @param pmcData Profile to add bonus to + * @param bonus Bonus to add to profile */ - protected applySkillXPBoost(pmcData: IPmcData, bonus: StageBonus): void; + applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void; /** * Process a players hideout, update areas that use resources + increment production timers * @param sessionID Session id @@ -83,6 +79,7 @@ export declare class HideoutHelper { isGeneratorOn: boolean; waterCollectorHasFilter: boolean; }; + protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean; /** * Update progress timer for water collector * @param pmcData profile to update @@ -141,9 +138,8 @@ export declare class HideoutHelper { isGeneratorOn: boolean; waterCollectorHasFilter: boolean; }): void; - protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void; - protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean; protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData): void; + protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/11BundleLoadingSample/types/helpers/TraderHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/TraderHelper.d.ts index 4157c1c..7cf764d 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/TraderHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/TraderHelper.d.ts @@ -1,4 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; +import { ProfileTraderTemplate } from "../models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; import { Traders } from "../models/enums/Traders"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; @@ -42,6 +43,7 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -113,4 +115,10 @@ export declare class TraderHelper { * @returns Traders key */ getTraderById(traderId: string): Traders; + /** + * Does the 'Traders' enum has a value that matches the passed in parameter + * @param value Value to check for + * @returns True, values exists in Traders enum as a value + */ + traderEnumHasValue(value: string): boolean; } diff --git a/TypeScript/11BundleLoadingSample/types/loaders/PreAkiModLoader.d.ts b/TypeScript/11BundleLoadingSample/types/loaders/PreAkiModLoader.d.ts index a67f1c9..08059ff 100644 --- a/TypeScript/11BundleLoadingSample/types/loaders/PreAkiModLoader.d.ts +++ b/TypeScript/11BundleLoadingSample/types/loaders/PreAkiModLoader.d.ts @@ -35,6 +35,7 @@ export declare class PreAkiModLoader implements IModLoader { getImportedModDetails(): Record; getModPath(mod: string): string; protected importMods(): Promise; + protected sortMods(prev: string, next: string, missingFromOrderJSON: Record): number; /** * Check for duplicate mods loaded, show error if any * @param modPackageData Dictionary of mod package.json data diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IProfileTemplate.d.ts index 66ebbe8..411fead 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -14,7 +14,7 @@ export interface TemplateSide { character: IPmcData; suits: string[]; dialogues: Record; - weaponbuilds: WeaponBuild[]; + weaponbuilds: Record; trader: ProfileTraderTemplate; } export interface ProfileTraderTemplate { diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/profile/IAkiProfile.d.ts index d08da6e..93b89e2 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/profile/IAkiProfile.d.ts @@ -7,7 +7,7 @@ export interface IAkiProfile { characters: Characters; /** Clothing purchases */ suits: string[]; - weaponbuilds: WeaponBuild[]; + weaponbuilds: Record; dialogues: Record; aki: Aki; vitality: Vitality; diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/IPmcConfig.d.ts index a349ac2..339e0c6 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/IPmcConfig.d.ts @@ -40,6 +40,8 @@ export interface IPmcConfig { botRelativeLevelDeltaMax: number; /** Force a number of healing items into PMCs secure container to ensure they can heal */ forceHealingItemsIntoSecure: boolean; + addPrefixToSameNamePMCAsPlayerChance: number; + allPMCsHavePlayerNameWithRandomPrefixChance: number; } export interface PmcTypes { usec: string; diff --git a/TypeScript/11BundleLoadingSample/types/services/LocalisationService.d.ts b/TypeScript/11BundleLoadingSample/types/services/LocalisationService.d.ts index 44a4941..ec6eecf 100644 --- a/TypeScript/11BundleLoadingSample/types/services/LocalisationService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/LocalisationService.d.ts @@ -2,17 +2,19 @@ import { I18n } from "i18n"; import { ILocaleConfig } from "../models/spt/config/ILocaleConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { RandomUtil } from "../utils/RandomUtil"; import { LocaleService } from "./LocaleService"; /** * Handles translating server text into different langauges */ export declare class LocalisationService { protected logger: ILogger; + protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; protected localeService: LocaleService; protected localeConfig: ILocaleConfig; protected i18n: I18n; - constructor(logger: ILogger, databaseServer: DatabaseServer, localeService: LocaleService); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, localeService: LocaleService); /** * Get a localised value using the passed in key * @param key Key to loop up locale for @@ -25,4 +27,10 @@ export declare class LocalisationService { * @returns string array of keys */ getKeys(): string[]; + /** + * From the provided partial key, find all keys that start with text and choose a random match + * @param partialKey Key to match locale keys on + * @returns locale text + */ + getRandomTextThatMatchesPartialKey(partialKey: string): string; } diff --git a/TypeScript/11BundleLoadingSample/types/services/MailSendService.d.ts b/TypeScript/11BundleLoadingSample/types/services/MailSendService.d.ts index 70b8e44..8ec5cf8 100644 --- a/TypeScript/11BundleLoadingSample/types/services/MailSendService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/MailSendService.d.ts @@ -1,3 +1,4 @@ +import { DialogueHelper } from "../helpers/DialogueHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; import { NotifierHelper } from "../helpers/NotifierHelper"; @@ -19,11 +20,12 @@ export declare class MailSendService { protected saveServer: SaveServer; protected databaseServer: DatabaseServer; protected notifierHelper: NotifierHelper; + protected dialogueHelper: DialogueHelper; protected notificationSendHelper: NotificationSendHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected readonly systemSenderId = "59e7125688a45068a6249071"; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, dialogueHelper: DialogueHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); /** * Send a message from an NPC (e.g. prapor) to the player with or without items using direct message text, do not look up any locale * @param playerId Players id to send message to diff --git a/TypeScript/11BundleLoadingSample/types/services/ProfileFixerService.d.ts b/TypeScript/11BundleLoadingSample/types/services/ProfileFixerService.d.ts index 418626d..b92c2f0 100644 --- a/TypeScript/11BundleLoadingSample/types/services/ProfileFixerService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/ProfileFixerService.d.ts @@ -1,6 +1,7 @@ import { HideoutHelper } from "../helpers/HideoutHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; @@ -20,6 +21,7 @@ export declare class ProfileFixerService { protected watermark: Watermark; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; + protected traderHelper: TraderHelper; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected timeUtil: TimeUtil; @@ -27,7 +29,7 @@ export declare class ProfileFixerService { protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -105,7 +107,7 @@ export declare class ProfileFixerService { * @param sessionId Session id * @param pmcProfile Profile to check inventory of */ - checkForOrphanedModdedItems(sessionId: string, pmcProfile: IPmcData): void; + checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; /** * Add `Improvements` object to hideout if missing - added in eft 13.0.21469 * @param pmcProfile profile to update diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/GameController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/GameController.d.ts index 6d0ce18..d7a7f1a 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/GameController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/GameController.d.ts @@ -11,9 +11,11 @@ import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse"; import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; +import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; +import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -25,6 +27,7 @@ import { ProfileFixerService } from "../services/ProfileFixerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { EncodingUtil } from "../utils/EncodingUtil"; import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class GameController { protected logger: ILogger; @@ -33,6 +36,7 @@ export declare class GameController { protected timeUtil: TimeUtil; protected preAkiModLoader: PreAkiModLoader; protected httpServerHelper: HttpServerHelper; + protected randomUtil: RandomUtil; protected encodingUtil: EncodingUtil; protected hideoutHelper: HideoutHelper; protected profileHelper: ProfileHelper; @@ -48,7 +52,9 @@ export declare class GameController { protected httpConfig: IHttpConfig; protected coreConfig: ICoreConfig; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); + protected ragfairConfig: IRagfairConfig; + protected botConfig: IBotConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); /** * Handle client/game/start */ @@ -84,6 +90,7 @@ export declare class GameController { * @param pmcProfile Player profile */ protected warnOnActiveBotReloadSkill(pmcProfile: IPmcData): void; + protected flagAllItemsInDbAsSellableOnFlea(): void; /** * When player logs in, iterate over all active effects and reduce timer * TODO - add body part HP regen @@ -118,9 +125,14 @@ export declare class GameController { protected validateQuestAssortUnlocksExist(): void; /** * Add the logged in players name to PMC name pool - * @param pmcProfile + * @param pmcProfile Profile of player to get name from */ protected addPlayerToPMCNames(pmcProfile: IPmcData): void; + /** + * Check for a dialog with the key 'undefined', and remove it + * @param fullProfile Profile to check for dialog in + */ + protected checkForAndRemoveUndefinedDialogs(fullProfile: IAkiProfile): void; /** * Blank out the "test" mail message from prapor */ diff --git a/TypeScript/12ClassExtensionOverride/types/generators/BotGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/BotGenerator.d.ts index 5236a12..4530517 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/BotGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/BotGenerator.d.ts @@ -10,6 +10,7 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; +import { LocalisationService } from "../services/LocalisationService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; @@ -32,9 +33,10 @@ export declare class BotGenerator { protected botHelper: BotHelper; protected botDifficultyHelper: BotDifficultyHelper; protected seasonalEventService: SeasonalEventService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -71,7 +73,7 @@ export declare class BotGenerator { * @param botRole role of bot e.g. assault * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string, sessionId: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/DialogueHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/DialogueHelper.d.ts index 6a8adc5..ea3bae7 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/DialogueHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/DialogueHelper.d.ts @@ -41,4 +41,10 @@ export declare class DialogueHelper { * @returns */ getMessageItemContents(messageID: string, sessionID: string, itemId: string): Item[]; + /** + * Get the dialogs dictionary for a profile, create if doesnt exist + * @param sessionId Session/player id + * @returns Dialog dictionary + */ + getDialogsForProfile(sessionId: string): Record; } diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/HideoutHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/HideoutHelper.d.ts index e9d3746..d9119a2 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/HideoutHelper.d.ts @@ -58,16 +58,12 @@ export declare class HideoutHelper { * @returns */ isProductionType(productive: Productive): productive is Production; - applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void; /** - * TODO: - * After looking at the skills there doesnt seem to be a configuration per skill to boost - * the XP gain PER skill. I THINK you should be able to put the variable "SkillProgress" (just like health has it) - * and be able to tune the skill gain PER skill, but I havent tested it and Im not sure! - * @param pmcData - * @param bonus + * Apply bonus to player profile given after completing hideout upgrades + * @param pmcData Profile to add bonus to + * @param bonus Bonus to add to profile */ - protected applySkillXPBoost(pmcData: IPmcData, bonus: StageBonus): void; + applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void; /** * Process a players hideout, update areas that use resources + increment production timers * @param sessionID Session id @@ -83,6 +79,7 @@ export declare class HideoutHelper { isGeneratorOn: boolean; waterCollectorHasFilter: boolean; }; + protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean; /** * Update progress timer for water collector * @param pmcData profile to update @@ -141,9 +138,8 @@ export declare class HideoutHelper { isGeneratorOn: boolean; waterCollectorHasFilter: boolean; }): void; - protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void; - protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean; protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData): void; + protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/TraderHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/TraderHelper.d.ts index 4157c1c..7cf764d 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/TraderHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/TraderHelper.d.ts @@ -1,4 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; +import { ProfileTraderTemplate } from "../models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; import { Traders } from "../models/enums/Traders"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; @@ -42,6 +43,7 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -113,4 +115,10 @@ export declare class TraderHelper { * @returns Traders key */ getTraderById(traderId: string): Traders; + /** + * Does the 'Traders' enum has a value that matches the passed in parameter + * @param value Value to check for + * @returns True, values exists in Traders enum as a value + */ + traderEnumHasValue(value: string): boolean; } diff --git a/TypeScript/12ClassExtensionOverride/types/loaders/PreAkiModLoader.d.ts b/TypeScript/12ClassExtensionOverride/types/loaders/PreAkiModLoader.d.ts index a67f1c9..08059ff 100644 --- a/TypeScript/12ClassExtensionOverride/types/loaders/PreAkiModLoader.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/loaders/PreAkiModLoader.d.ts @@ -35,6 +35,7 @@ export declare class PreAkiModLoader implements IModLoader { getImportedModDetails(): Record; getModPath(mod: string): string; protected importMods(): Promise; + protected sortMods(prev: string, next: string, missingFromOrderJSON: Record): number; /** * Check for duplicate mods loaded, show error if any * @param modPackageData Dictionary of mod package.json data diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IProfileTemplate.d.ts index 66ebbe8..411fead 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -14,7 +14,7 @@ export interface TemplateSide { character: IPmcData; suits: string[]; dialogues: Record; - weaponbuilds: WeaponBuild[]; + weaponbuilds: Record; trader: ProfileTraderTemplate; } export interface ProfileTraderTemplate { diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/profile/IAkiProfile.d.ts index d08da6e..93b89e2 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/profile/IAkiProfile.d.ts @@ -7,7 +7,7 @@ export interface IAkiProfile { characters: Characters; /** Clothing purchases */ suits: string[]; - weaponbuilds: WeaponBuild[]; + weaponbuilds: Record; dialogues: Record; aki: Aki; vitality: Vitality; diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IPmcConfig.d.ts index a349ac2..339e0c6 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IPmcConfig.d.ts @@ -40,6 +40,8 @@ export interface IPmcConfig { botRelativeLevelDeltaMax: number; /** Force a number of healing items into PMCs secure container to ensure they can heal */ forceHealingItemsIntoSecure: boolean; + addPrefixToSameNamePMCAsPlayerChance: number; + allPMCsHavePlayerNameWithRandomPrefixChance: number; } export interface PmcTypes { usec: string; diff --git a/TypeScript/12ClassExtensionOverride/types/services/LocalisationService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/LocalisationService.d.ts index 44a4941..ec6eecf 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/LocalisationService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/LocalisationService.d.ts @@ -2,17 +2,19 @@ import { I18n } from "i18n"; import { ILocaleConfig } from "../models/spt/config/ILocaleConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { RandomUtil } from "../utils/RandomUtil"; import { LocaleService } from "./LocaleService"; /** * Handles translating server text into different langauges */ export declare class LocalisationService { protected logger: ILogger; + protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; protected localeService: LocaleService; protected localeConfig: ILocaleConfig; protected i18n: I18n; - constructor(logger: ILogger, databaseServer: DatabaseServer, localeService: LocaleService); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, localeService: LocaleService); /** * Get a localised value using the passed in key * @param key Key to loop up locale for @@ -25,4 +27,10 @@ export declare class LocalisationService { * @returns string array of keys */ getKeys(): string[]; + /** + * From the provided partial key, find all keys that start with text and choose a random match + * @param partialKey Key to match locale keys on + * @returns locale text + */ + getRandomTextThatMatchesPartialKey(partialKey: string): string; } diff --git a/TypeScript/12ClassExtensionOverride/types/services/MailSendService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/MailSendService.d.ts index 70b8e44..8ec5cf8 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/MailSendService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/MailSendService.d.ts @@ -1,3 +1,4 @@ +import { DialogueHelper } from "../helpers/DialogueHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; import { NotifierHelper } from "../helpers/NotifierHelper"; @@ -19,11 +20,12 @@ export declare class MailSendService { protected saveServer: SaveServer; protected databaseServer: DatabaseServer; protected notifierHelper: NotifierHelper; + protected dialogueHelper: DialogueHelper; protected notificationSendHelper: NotificationSendHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected readonly systemSenderId = "59e7125688a45068a6249071"; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, dialogueHelper: DialogueHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); /** * Send a message from an NPC (e.g. prapor) to the player with or without items using direct message text, do not look up any locale * @param playerId Players id to send message to diff --git a/TypeScript/12ClassExtensionOverride/types/services/ProfileFixerService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/ProfileFixerService.d.ts index 418626d..b92c2f0 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/ProfileFixerService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/ProfileFixerService.d.ts @@ -1,6 +1,7 @@ import { HideoutHelper } from "../helpers/HideoutHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; @@ -20,6 +21,7 @@ export declare class ProfileFixerService { protected watermark: Watermark; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; + protected traderHelper: TraderHelper; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected timeUtil: TimeUtil; @@ -27,7 +29,7 @@ export declare class ProfileFixerService { protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -105,7 +107,7 @@ export declare class ProfileFixerService { * @param sessionId Session id * @param pmcProfile Profile to check inventory of */ - checkForOrphanedModdedItems(sessionId: string, pmcProfile: IPmcData): void; + checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; /** * Add `Improvements` object to hideout if missing - added in eft 13.0.21469 * @param pmcProfile profile to update diff --git a/TypeScript/13AddTrader/types/helpers/DialogueHelper.d.ts b/TypeScript/13AddTrader/types/helpers/DialogueHelper.d.ts index 6a8adc5..ea3bae7 100644 --- a/TypeScript/13AddTrader/types/helpers/DialogueHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/DialogueHelper.d.ts @@ -41,4 +41,10 @@ export declare class DialogueHelper { * @returns */ getMessageItemContents(messageID: string, sessionID: string, itemId: string): Item[]; + /** + * Get the dialogs dictionary for a profile, create if doesnt exist + * @param sessionId Session/player id + * @returns Dialog dictionary + */ + getDialogsForProfile(sessionId: string): Record; } diff --git a/TypeScript/13AddTrader/types/helpers/TraderHelper.d.ts b/TypeScript/13AddTrader/types/helpers/TraderHelper.d.ts index 4157c1c..7cf764d 100644 --- a/TypeScript/13AddTrader/types/helpers/TraderHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/TraderHelper.d.ts @@ -1,4 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; +import { ProfileTraderTemplate } from "../models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; import { Traders } from "../models/enums/Traders"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; @@ -42,6 +43,7 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -113,4 +115,10 @@ export declare class TraderHelper { * @returns Traders key */ getTraderById(traderId: string): Traders; + /** + * Does the 'Traders' enum has a value that matches the passed in parameter + * @param value Value to check for + * @returns True, values exists in Traders enum as a value + */ + traderEnumHasValue(value: string): boolean; } diff --git a/TypeScript/13AddTrader/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/13AddTrader/types/models/eft/common/tables/IProfileTemplate.d.ts index 66ebbe8..411fead 100644 --- a/TypeScript/13AddTrader/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -14,7 +14,7 @@ export interface TemplateSide { character: IPmcData; suits: string[]; dialogues: Record; - weaponbuilds: WeaponBuild[]; + weaponbuilds: Record; trader: ProfileTraderTemplate; } export interface ProfileTraderTemplate { diff --git a/TypeScript/13AddTrader/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/13AddTrader/types/models/eft/profile/IAkiProfile.d.ts index d08da6e..93b89e2 100644 --- a/TypeScript/13AddTrader/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/profile/IAkiProfile.d.ts @@ -7,7 +7,7 @@ export interface IAkiProfile { characters: Characters; /** Clothing purchases */ suits: string[]; - weaponbuilds: WeaponBuild[]; + weaponbuilds: Record; dialogues: Record; aki: Aki; vitality: Vitality; diff --git a/TypeScript/13AddTrader/types/services/MailSendService.d.ts b/TypeScript/13AddTrader/types/services/MailSendService.d.ts index 70b8e44..8ec5cf8 100644 --- a/TypeScript/13AddTrader/types/services/MailSendService.d.ts +++ b/TypeScript/13AddTrader/types/services/MailSendService.d.ts @@ -1,3 +1,4 @@ +import { DialogueHelper } from "../helpers/DialogueHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; import { NotifierHelper } from "../helpers/NotifierHelper"; @@ -19,11 +20,12 @@ export declare class MailSendService { protected saveServer: SaveServer; protected databaseServer: DatabaseServer; protected notifierHelper: NotifierHelper; + protected dialogueHelper: DialogueHelper; protected notificationSendHelper: NotificationSendHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected readonly systemSenderId = "59e7125688a45068a6249071"; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, dialogueHelper: DialogueHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); /** * Send a message from an NPC (e.g. prapor) to the player with or without items using direct message text, do not look up any locale * @param playerId Players id to send message to diff --git a/TypeScript/13AddTrader/types/services/ProfileFixerService.d.ts b/TypeScript/13AddTrader/types/services/ProfileFixerService.d.ts index 418626d..b92c2f0 100644 --- a/TypeScript/13AddTrader/types/services/ProfileFixerService.d.ts +++ b/TypeScript/13AddTrader/types/services/ProfileFixerService.d.ts @@ -1,6 +1,7 @@ import { HideoutHelper } from "../helpers/HideoutHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; @@ -20,6 +21,7 @@ export declare class ProfileFixerService { protected watermark: Watermark; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; + protected traderHelper: TraderHelper; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected timeUtil: TimeUtil; @@ -27,7 +29,7 @@ export declare class ProfileFixerService { protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -105,7 +107,7 @@ export declare class ProfileFixerService { * @param sessionId Session id * @param pmcProfile Profile to check inventory of */ - checkForOrphanedModdedItems(sessionId: string, pmcProfile: IPmcData): void; + checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; /** * Add `Improvements` object to hideout if missing - added in eft 13.0.21469 * @param pmcProfile profile to update diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/GameController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/GameController.d.ts index 6d0ce18..d7a7f1a 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/GameController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/GameController.d.ts @@ -11,9 +11,11 @@ import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse"; import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; +import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; +import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -25,6 +27,7 @@ import { ProfileFixerService } from "../services/ProfileFixerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { EncodingUtil } from "../utils/EncodingUtil"; import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class GameController { protected logger: ILogger; @@ -33,6 +36,7 @@ export declare class GameController { protected timeUtil: TimeUtil; protected preAkiModLoader: PreAkiModLoader; protected httpServerHelper: HttpServerHelper; + protected randomUtil: RandomUtil; protected encodingUtil: EncodingUtil; protected hideoutHelper: HideoutHelper; protected profileHelper: ProfileHelper; @@ -48,7 +52,9 @@ export declare class GameController { protected httpConfig: IHttpConfig; protected coreConfig: ICoreConfig; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); + protected ragfairConfig: IRagfairConfig; + protected botConfig: IBotConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); /** * Handle client/game/start */ @@ -84,6 +90,7 @@ export declare class GameController { * @param pmcProfile Player profile */ protected warnOnActiveBotReloadSkill(pmcProfile: IPmcData): void; + protected flagAllItemsInDbAsSellableOnFlea(): void; /** * When player logs in, iterate over all active effects and reduce timer * TODO - add body part HP regen @@ -118,9 +125,14 @@ export declare class GameController { protected validateQuestAssortUnlocksExist(): void; /** * Add the logged in players name to PMC name pool - * @param pmcProfile + * @param pmcProfile Profile of player to get name from */ protected addPlayerToPMCNames(pmcProfile: IPmcData): void; + /** + * Check for a dialog with the key 'undefined', and remove it + * @param fullProfile Profile to check for dialog in + */ + protected checkForAndRemoveUndefinedDialogs(fullProfile: IAkiProfile): void; /** * Blank out the "test" mail message from prapor */ diff --git a/TypeScript/14AfterDBLoadHook/types/generators/BotGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/BotGenerator.d.ts index 5236a12..4530517 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/BotGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/BotGenerator.d.ts @@ -10,6 +10,7 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; +import { LocalisationService } from "../services/LocalisationService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; @@ -32,9 +33,10 @@ export declare class BotGenerator { protected botHelper: BotHelper; protected botDifficultyHelper: BotDifficultyHelper; protected seasonalEventService: SeasonalEventService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -71,7 +73,7 @@ export declare class BotGenerator { * @param botRole role of bot e.g. assault * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string, sessionId: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/DialogueHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/DialogueHelper.d.ts index 6a8adc5..ea3bae7 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/DialogueHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/DialogueHelper.d.ts @@ -41,4 +41,10 @@ export declare class DialogueHelper { * @returns */ getMessageItemContents(messageID: string, sessionID: string, itemId: string): Item[]; + /** + * Get the dialogs dictionary for a profile, create if doesnt exist + * @param sessionId Session/player id + * @returns Dialog dictionary + */ + getDialogsForProfile(sessionId: string): Record; } diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/HideoutHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/HideoutHelper.d.ts index e9d3746..d9119a2 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/HideoutHelper.d.ts @@ -58,16 +58,12 @@ export declare class HideoutHelper { * @returns */ isProductionType(productive: Productive): productive is Production; - applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void; /** - * TODO: - * After looking at the skills there doesnt seem to be a configuration per skill to boost - * the XP gain PER skill. I THINK you should be able to put the variable "SkillProgress" (just like health has it) - * and be able to tune the skill gain PER skill, but I havent tested it and Im not sure! - * @param pmcData - * @param bonus + * Apply bonus to player profile given after completing hideout upgrades + * @param pmcData Profile to add bonus to + * @param bonus Bonus to add to profile */ - protected applySkillXPBoost(pmcData: IPmcData, bonus: StageBonus): void; + applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void; /** * Process a players hideout, update areas that use resources + increment production timers * @param sessionID Session id @@ -83,6 +79,7 @@ export declare class HideoutHelper { isGeneratorOn: boolean; waterCollectorHasFilter: boolean; }; + protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean; /** * Update progress timer for water collector * @param pmcData profile to update @@ -141,9 +138,8 @@ export declare class HideoutHelper { isGeneratorOn: boolean; waterCollectorHasFilter: boolean; }): void; - protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void; - protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean; protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData): void; + protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/TraderHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/TraderHelper.d.ts index 4157c1c..7cf764d 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/TraderHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/TraderHelper.d.ts @@ -1,4 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; +import { ProfileTraderTemplate } from "../models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; import { Traders } from "../models/enums/Traders"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; @@ -42,6 +43,7 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -113,4 +115,10 @@ export declare class TraderHelper { * @returns Traders key */ getTraderById(traderId: string): Traders; + /** + * Does the 'Traders' enum has a value that matches the passed in parameter + * @param value Value to check for + * @returns True, values exists in Traders enum as a value + */ + traderEnumHasValue(value: string): boolean; } diff --git a/TypeScript/14AfterDBLoadHook/types/loaders/PreAkiModLoader.d.ts b/TypeScript/14AfterDBLoadHook/types/loaders/PreAkiModLoader.d.ts index a67f1c9..08059ff 100644 --- a/TypeScript/14AfterDBLoadHook/types/loaders/PreAkiModLoader.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/loaders/PreAkiModLoader.d.ts @@ -35,6 +35,7 @@ export declare class PreAkiModLoader implements IModLoader { getImportedModDetails(): Record; getModPath(mod: string): string; protected importMods(): Promise; + protected sortMods(prev: string, next: string, missingFromOrderJSON: Record): number; /** * Check for duplicate mods loaded, show error if any * @param modPackageData Dictionary of mod package.json data diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IProfileTemplate.d.ts index 66ebbe8..411fead 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -14,7 +14,7 @@ export interface TemplateSide { character: IPmcData; suits: string[]; dialogues: Record; - weaponbuilds: WeaponBuild[]; + weaponbuilds: Record; trader: ProfileTraderTemplate; } export interface ProfileTraderTemplate { diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/profile/IAkiProfile.d.ts index d08da6e..93b89e2 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/profile/IAkiProfile.d.ts @@ -7,7 +7,7 @@ export interface IAkiProfile { characters: Characters; /** Clothing purchases */ suits: string[]; - weaponbuilds: WeaponBuild[]; + weaponbuilds: Record; dialogues: Record; aki: Aki; vitality: Vitality; diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IPmcConfig.d.ts index a349ac2..339e0c6 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IPmcConfig.d.ts @@ -40,6 +40,8 @@ export interface IPmcConfig { botRelativeLevelDeltaMax: number; /** Force a number of healing items into PMCs secure container to ensure they can heal */ forceHealingItemsIntoSecure: boolean; + addPrefixToSameNamePMCAsPlayerChance: number; + allPMCsHavePlayerNameWithRandomPrefixChance: number; } export interface PmcTypes { usec: string; diff --git a/TypeScript/14AfterDBLoadHook/types/services/LocalisationService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/LocalisationService.d.ts index 44a4941..ec6eecf 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/LocalisationService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/LocalisationService.d.ts @@ -2,17 +2,19 @@ import { I18n } from "i18n"; import { ILocaleConfig } from "../models/spt/config/ILocaleConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { RandomUtil } from "../utils/RandomUtil"; import { LocaleService } from "./LocaleService"; /** * Handles translating server text into different langauges */ export declare class LocalisationService { protected logger: ILogger; + protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; protected localeService: LocaleService; protected localeConfig: ILocaleConfig; protected i18n: I18n; - constructor(logger: ILogger, databaseServer: DatabaseServer, localeService: LocaleService); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, localeService: LocaleService); /** * Get a localised value using the passed in key * @param key Key to loop up locale for @@ -25,4 +27,10 @@ export declare class LocalisationService { * @returns string array of keys */ getKeys(): string[]; + /** + * From the provided partial key, find all keys that start with text and choose a random match + * @param partialKey Key to match locale keys on + * @returns locale text + */ + getRandomTextThatMatchesPartialKey(partialKey: string): string; } diff --git a/TypeScript/14AfterDBLoadHook/types/services/MailSendService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/MailSendService.d.ts index 70b8e44..8ec5cf8 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/MailSendService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/MailSendService.d.ts @@ -1,3 +1,4 @@ +import { DialogueHelper } from "../helpers/DialogueHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; import { NotifierHelper } from "../helpers/NotifierHelper"; @@ -19,11 +20,12 @@ export declare class MailSendService { protected saveServer: SaveServer; protected databaseServer: DatabaseServer; protected notifierHelper: NotifierHelper; + protected dialogueHelper: DialogueHelper; protected notificationSendHelper: NotificationSendHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected readonly systemSenderId = "59e7125688a45068a6249071"; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, dialogueHelper: DialogueHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); /** * Send a message from an NPC (e.g. prapor) to the player with or without items using direct message text, do not look up any locale * @param playerId Players id to send message to diff --git a/TypeScript/14AfterDBLoadHook/types/services/ProfileFixerService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/ProfileFixerService.d.ts index 418626d..b92c2f0 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/ProfileFixerService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/ProfileFixerService.d.ts @@ -1,6 +1,7 @@ import { HideoutHelper } from "../helpers/HideoutHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; @@ -20,6 +21,7 @@ export declare class ProfileFixerService { protected watermark: Watermark; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; + protected traderHelper: TraderHelper; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected timeUtil: TimeUtil; @@ -27,7 +29,7 @@ export declare class ProfileFixerService { protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -105,7 +107,7 @@ export declare class ProfileFixerService { * @param sessionId Session id * @param pmcProfile Profile to check inventory of */ - checkForOrphanedModdedItems(sessionId: string, pmcProfile: IPmcData): void; + checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; /** * Add `Improvements` object to hideout if missing - added in eft 13.0.21469 * @param pmcProfile profile to update diff --git a/TypeScript/15HttpListenerExample/types/controllers/GameController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/GameController.d.ts index 6d0ce18..d7a7f1a 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/GameController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/GameController.d.ts @@ -11,9 +11,11 @@ import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse"; import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; +import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; +import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -25,6 +27,7 @@ import { ProfileFixerService } from "../services/ProfileFixerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { EncodingUtil } from "../utils/EncodingUtil"; import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class GameController { protected logger: ILogger; @@ -33,6 +36,7 @@ export declare class GameController { protected timeUtil: TimeUtil; protected preAkiModLoader: PreAkiModLoader; protected httpServerHelper: HttpServerHelper; + protected randomUtil: RandomUtil; protected encodingUtil: EncodingUtil; protected hideoutHelper: HideoutHelper; protected profileHelper: ProfileHelper; @@ -48,7 +52,9 @@ export declare class GameController { protected httpConfig: IHttpConfig; protected coreConfig: ICoreConfig; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); + protected ragfairConfig: IRagfairConfig; + protected botConfig: IBotConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); /** * Handle client/game/start */ @@ -84,6 +90,7 @@ export declare class GameController { * @param pmcProfile Player profile */ protected warnOnActiveBotReloadSkill(pmcProfile: IPmcData): void; + protected flagAllItemsInDbAsSellableOnFlea(): void; /** * When player logs in, iterate over all active effects and reduce timer * TODO - add body part HP regen @@ -118,9 +125,14 @@ export declare class GameController { protected validateQuestAssortUnlocksExist(): void; /** * Add the logged in players name to PMC name pool - * @param pmcProfile + * @param pmcProfile Profile of player to get name from */ protected addPlayerToPMCNames(pmcProfile: IPmcData): void; + /** + * Check for a dialog with the key 'undefined', and remove it + * @param fullProfile Profile to check for dialog in + */ + protected checkForAndRemoveUndefinedDialogs(fullProfile: IAkiProfile): void; /** * Blank out the "test" mail message from prapor */ diff --git a/TypeScript/15HttpListenerExample/types/generators/BotGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/BotGenerator.d.ts index 5236a12..4530517 100644 --- a/TypeScript/15HttpListenerExample/types/generators/BotGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/BotGenerator.d.ts @@ -10,6 +10,7 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; +import { LocalisationService } from "../services/LocalisationService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; @@ -32,9 +33,10 @@ export declare class BotGenerator { protected botHelper: BotHelper; protected botDifficultyHelper: BotDifficultyHelper; protected seasonalEventService: SeasonalEventService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -71,7 +73,7 @@ export declare class BotGenerator { * @param botRole role of bot e.g. assault * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string, sessionId: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client diff --git a/TypeScript/15HttpListenerExample/types/helpers/DialogueHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/DialogueHelper.d.ts index 6a8adc5..ea3bae7 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/DialogueHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/DialogueHelper.d.ts @@ -41,4 +41,10 @@ export declare class DialogueHelper { * @returns */ getMessageItemContents(messageID: string, sessionID: string, itemId: string): Item[]; + /** + * Get the dialogs dictionary for a profile, create if doesnt exist + * @param sessionId Session/player id + * @returns Dialog dictionary + */ + getDialogsForProfile(sessionId: string): Record; } diff --git a/TypeScript/15HttpListenerExample/types/helpers/HideoutHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/HideoutHelper.d.ts index e9d3746..d9119a2 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/HideoutHelper.d.ts @@ -58,16 +58,12 @@ export declare class HideoutHelper { * @returns */ isProductionType(productive: Productive): productive is Production; - applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void; /** - * TODO: - * After looking at the skills there doesnt seem to be a configuration per skill to boost - * the XP gain PER skill. I THINK you should be able to put the variable "SkillProgress" (just like health has it) - * and be able to tune the skill gain PER skill, but I havent tested it and Im not sure! - * @param pmcData - * @param bonus + * Apply bonus to player profile given after completing hideout upgrades + * @param pmcData Profile to add bonus to + * @param bonus Bonus to add to profile */ - protected applySkillXPBoost(pmcData: IPmcData, bonus: StageBonus): void; + applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void; /** * Process a players hideout, update areas that use resources + increment production timers * @param sessionID Session id @@ -83,6 +79,7 @@ export declare class HideoutHelper { isGeneratorOn: boolean; waterCollectorHasFilter: boolean; }; + protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean; /** * Update progress timer for water collector * @param pmcData profile to update @@ -141,9 +138,8 @@ export declare class HideoutHelper { isGeneratorOn: boolean; waterCollectorHasFilter: boolean; }): void; - protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void; - protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean; protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData): void; + protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/15HttpListenerExample/types/helpers/TraderHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/TraderHelper.d.ts index 4157c1c..7cf764d 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/TraderHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/TraderHelper.d.ts @@ -1,4 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; +import { ProfileTraderTemplate } from "../models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; import { Traders } from "../models/enums/Traders"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; @@ -42,6 +43,7 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -113,4 +115,10 @@ export declare class TraderHelper { * @returns Traders key */ getTraderById(traderId: string): Traders; + /** + * Does the 'Traders' enum has a value that matches the passed in parameter + * @param value Value to check for + * @returns True, values exists in Traders enum as a value + */ + traderEnumHasValue(value: string): boolean; } diff --git a/TypeScript/15HttpListenerExample/types/loaders/PreAkiModLoader.d.ts b/TypeScript/15HttpListenerExample/types/loaders/PreAkiModLoader.d.ts index a67f1c9..08059ff 100644 --- a/TypeScript/15HttpListenerExample/types/loaders/PreAkiModLoader.d.ts +++ b/TypeScript/15HttpListenerExample/types/loaders/PreAkiModLoader.d.ts @@ -35,6 +35,7 @@ export declare class PreAkiModLoader implements IModLoader { getImportedModDetails(): Record; getModPath(mod: string): string; protected importMods(): Promise; + protected sortMods(prev: string, next: string, missingFromOrderJSON: Record): number; /** * Check for duplicate mods loaded, show error if any * @param modPackageData Dictionary of mod package.json data diff --git a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IProfileTemplate.d.ts index 66ebbe8..411fead 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -14,7 +14,7 @@ export interface TemplateSide { character: IPmcData; suits: string[]; dialogues: Record; - weaponbuilds: WeaponBuild[]; + weaponbuilds: Record; trader: ProfileTraderTemplate; } export interface ProfileTraderTemplate { diff --git a/TypeScript/15HttpListenerExample/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/profile/IAkiProfile.d.ts index d08da6e..93b89e2 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/profile/IAkiProfile.d.ts @@ -7,7 +7,7 @@ export interface IAkiProfile { characters: Characters; /** Clothing purchases */ suits: string[]; - weaponbuilds: WeaponBuild[]; + weaponbuilds: Record; dialogues: Record; aki: Aki; vitality: Vitality; diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/IPmcConfig.d.ts index a349ac2..339e0c6 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/IPmcConfig.d.ts @@ -40,6 +40,8 @@ export interface IPmcConfig { botRelativeLevelDeltaMax: number; /** Force a number of healing items into PMCs secure container to ensure they can heal */ forceHealingItemsIntoSecure: boolean; + addPrefixToSameNamePMCAsPlayerChance: number; + allPMCsHavePlayerNameWithRandomPrefixChance: number; } export interface PmcTypes { usec: string; diff --git a/TypeScript/15HttpListenerExample/types/services/LocalisationService.d.ts b/TypeScript/15HttpListenerExample/types/services/LocalisationService.d.ts index 44a4941..ec6eecf 100644 --- a/TypeScript/15HttpListenerExample/types/services/LocalisationService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/LocalisationService.d.ts @@ -2,17 +2,19 @@ import { I18n } from "i18n"; import { ILocaleConfig } from "../models/spt/config/ILocaleConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { RandomUtil } from "../utils/RandomUtil"; import { LocaleService } from "./LocaleService"; /** * Handles translating server text into different langauges */ export declare class LocalisationService { protected logger: ILogger; + protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; protected localeService: LocaleService; protected localeConfig: ILocaleConfig; protected i18n: I18n; - constructor(logger: ILogger, databaseServer: DatabaseServer, localeService: LocaleService); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, localeService: LocaleService); /** * Get a localised value using the passed in key * @param key Key to loop up locale for @@ -25,4 +27,10 @@ export declare class LocalisationService { * @returns string array of keys */ getKeys(): string[]; + /** + * From the provided partial key, find all keys that start with text and choose a random match + * @param partialKey Key to match locale keys on + * @returns locale text + */ + getRandomTextThatMatchesPartialKey(partialKey: string): string; } diff --git a/TypeScript/15HttpListenerExample/types/services/MailSendService.d.ts b/TypeScript/15HttpListenerExample/types/services/MailSendService.d.ts index 70b8e44..8ec5cf8 100644 --- a/TypeScript/15HttpListenerExample/types/services/MailSendService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/MailSendService.d.ts @@ -1,3 +1,4 @@ +import { DialogueHelper } from "../helpers/DialogueHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; import { NotifierHelper } from "../helpers/NotifierHelper"; @@ -19,11 +20,12 @@ export declare class MailSendService { protected saveServer: SaveServer; protected databaseServer: DatabaseServer; protected notifierHelper: NotifierHelper; + protected dialogueHelper: DialogueHelper; protected notificationSendHelper: NotificationSendHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected readonly systemSenderId = "59e7125688a45068a6249071"; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, dialogueHelper: DialogueHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); /** * Send a message from an NPC (e.g. prapor) to the player with or without items using direct message text, do not look up any locale * @param playerId Players id to send message to diff --git a/TypeScript/15HttpListenerExample/types/services/ProfileFixerService.d.ts b/TypeScript/15HttpListenerExample/types/services/ProfileFixerService.d.ts index 418626d..b92c2f0 100644 --- a/TypeScript/15HttpListenerExample/types/services/ProfileFixerService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/ProfileFixerService.d.ts @@ -1,6 +1,7 @@ import { HideoutHelper } from "../helpers/HideoutHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; @@ -20,6 +21,7 @@ export declare class ProfileFixerService { protected watermark: Watermark; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; + protected traderHelper: TraderHelper; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected timeUtil: TimeUtil; @@ -27,7 +29,7 @@ export declare class ProfileFixerService { protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -105,7 +107,7 @@ export declare class ProfileFixerService { * @param sessionId Session id * @param pmcProfile Profile to check inventory of */ - checkForOrphanedModdedItems(sessionId: string, pmcProfile: IPmcData): void; + checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; /** * Add `Improvements` object to hideout if missing - added in eft 13.0.21469 * @param pmcProfile profile to update diff --git a/TypeScript/16ImporterUtil/types/controllers/GameController.d.ts b/TypeScript/16ImporterUtil/types/controllers/GameController.d.ts index 6d0ce18..d7a7f1a 100644 --- a/TypeScript/16ImporterUtil/types/controllers/GameController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/GameController.d.ts @@ -11,9 +11,11 @@ import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse"; import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; +import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; +import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -25,6 +27,7 @@ import { ProfileFixerService } from "../services/ProfileFixerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { EncodingUtil } from "../utils/EncodingUtil"; import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class GameController { protected logger: ILogger; @@ -33,6 +36,7 @@ export declare class GameController { protected timeUtil: TimeUtil; protected preAkiModLoader: PreAkiModLoader; protected httpServerHelper: HttpServerHelper; + protected randomUtil: RandomUtil; protected encodingUtil: EncodingUtil; protected hideoutHelper: HideoutHelper; protected profileHelper: ProfileHelper; @@ -48,7 +52,9 @@ export declare class GameController { protected httpConfig: IHttpConfig; protected coreConfig: ICoreConfig; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); + protected ragfairConfig: IRagfairConfig; + protected botConfig: IBotConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); /** * Handle client/game/start */ @@ -84,6 +90,7 @@ export declare class GameController { * @param pmcProfile Player profile */ protected warnOnActiveBotReloadSkill(pmcProfile: IPmcData): void; + protected flagAllItemsInDbAsSellableOnFlea(): void; /** * When player logs in, iterate over all active effects and reduce timer * TODO - add body part HP regen @@ -118,9 +125,14 @@ export declare class GameController { protected validateQuestAssortUnlocksExist(): void; /** * Add the logged in players name to PMC name pool - * @param pmcProfile + * @param pmcProfile Profile of player to get name from */ protected addPlayerToPMCNames(pmcProfile: IPmcData): void; + /** + * Check for a dialog with the key 'undefined', and remove it + * @param fullProfile Profile to check for dialog in + */ + protected checkForAndRemoveUndefinedDialogs(fullProfile: IAkiProfile): void; /** * Blank out the "test" mail message from prapor */ diff --git a/TypeScript/16ImporterUtil/types/generators/BotGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/BotGenerator.d.ts index 5236a12..4530517 100644 --- a/TypeScript/16ImporterUtil/types/generators/BotGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/BotGenerator.d.ts @@ -10,6 +10,7 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; +import { LocalisationService } from "../services/LocalisationService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; @@ -32,9 +33,10 @@ export declare class BotGenerator { protected botHelper: BotHelper; protected botDifficultyHelper: BotDifficultyHelper; protected seasonalEventService: SeasonalEventService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -71,7 +73,7 @@ export declare class BotGenerator { * @param botRole role of bot e.g. assault * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string, sessionId: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client diff --git a/TypeScript/16ImporterUtil/types/helpers/DialogueHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/DialogueHelper.d.ts index 6a8adc5..ea3bae7 100644 --- a/TypeScript/16ImporterUtil/types/helpers/DialogueHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/DialogueHelper.d.ts @@ -41,4 +41,10 @@ export declare class DialogueHelper { * @returns */ getMessageItemContents(messageID: string, sessionID: string, itemId: string): Item[]; + /** + * Get the dialogs dictionary for a profile, create if doesnt exist + * @param sessionId Session/player id + * @returns Dialog dictionary + */ + getDialogsForProfile(sessionId: string): Record; } diff --git a/TypeScript/16ImporterUtil/types/helpers/HideoutHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/HideoutHelper.d.ts index e9d3746..d9119a2 100644 --- a/TypeScript/16ImporterUtil/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/HideoutHelper.d.ts @@ -58,16 +58,12 @@ export declare class HideoutHelper { * @returns */ isProductionType(productive: Productive): productive is Production; - applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void; /** - * TODO: - * After looking at the skills there doesnt seem to be a configuration per skill to boost - * the XP gain PER skill. I THINK you should be able to put the variable "SkillProgress" (just like health has it) - * and be able to tune the skill gain PER skill, but I havent tested it and Im not sure! - * @param pmcData - * @param bonus + * Apply bonus to player profile given after completing hideout upgrades + * @param pmcData Profile to add bonus to + * @param bonus Bonus to add to profile */ - protected applySkillXPBoost(pmcData: IPmcData, bonus: StageBonus): void; + applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void; /** * Process a players hideout, update areas that use resources + increment production timers * @param sessionID Session id @@ -83,6 +79,7 @@ export declare class HideoutHelper { isGeneratorOn: boolean; waterCollectorHasFilter: boolean; }; + protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean; /** * Update progress timer for water collector * @param pmcData profile to update @@ -141,9 +138,8 @@ export declare class HideoutHelper { isGeneratorOn: boolean; waterCollectorHasFilter: boolean; }): void; - protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void; - protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean; protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData): void; + protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/16ImporterUtil/types/helpers/TraderHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/TraderHelper.d.ts index 4157c1c..7cf764d 100644 --- a/TypeScript/16ImporterUtil/types/helpers/TraderHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/TraderHelper.d.ts @@ -1,4 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; +import { ProfileTraderTemplate } from "../models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; import { Traders } from "../models/enums/Traders"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; @@ -42,6 +43,7 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -113,4 +115,10 @@ export declare class TraderHelper { * @returns Traders key */ getTraderById(traderId: string): Traders; + /** + * Does the 'Traders' enum has a value that matches the passed in parameter + * @param value Value to check for + * @returns True, values exists in Traders enum as a value + */ + traderEnumHasValue(value: string): boolean; } diff --git a/TypeScript/16ImporterUtil/types/loaders/PreAkiModLoader.d.ts b/TypeScript/16ImporterUtil/types/loaders/PreAkiModLoader.d.ts index a67f1c9..08059ff 100644 --- a/TypeScript/16ImporterUtil/types/loaders/PreAkiModLoader.d.ts +++ b/TypeScript/16ImporterUtil/types/loaders/PreAkiModLoader.d.ts @@ -35,6 +35,7 @@ export declare class PreAkiModLoader implements IModLoader { getImportedModDetails(): Record; getModPath(mod: string): string; protected importMods(): Promise; + protected sortMods(prev: string, next: string, missingFromOrderJSON: Record): number; /** * Check for duplicate mods loaded, show error if any * @param modPackageData Dictionary of mod package.json data diff --git a/TypeScript/16ImporterUtil/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/16ImporterUtil/types/models/eft/common/tables/IProfileTemplate.d.ts index 66ebbe8..411fead 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -14,7 +14,7 @@ export interface TemplateSide { character: IPmcData; suits: string[]; dialogues: Record; - weaponbuilds: WeaponBuild[]; + weaponbuilds: Record; trader: ProfileTraderTemplate; } export interface ProfileTraderTemplate { diff --git a/TypeScript/16ImporterUtil/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/16ImporterUtil/types/models/eft/profile/IAkiProfile.d.ts index d08da6e..93b89e2 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/profile/IAkiProfile.d.ts @@ -7,7 +7,7 @@ export interface IAkiProfile { characters: Characters; /** Clothing purchases */ suits: string[]; - weaponbuilds: WeaponBuild[]; + weaponbuilds: Record; dialogues: Record; aki: Aki; vitality: Vitality; diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/IPmcConfig.d.ts index a349ac2..339e0c6 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/IPmcConfig.d.ts @@ -40,6 +40,8 @@ export interface IPmcConfig { botRelativeLevelDeltaMax: number; /** Force a number of healing items into PMCs secure container to ensure they can heal */ forceHealingItemsIntoSecure: boolean; + addPrefixToSameNamePMCAsPlayerChance: number; + allPMCsHavePlayerNameWithRandomPrefixChance: number; } export interface PmcTypes { usec: string; diff --git a/TypeScript/16ImporterUtil/types/services/LocalisationService.d.ts b/TypeScript/16ImporterUtil/types/services/LocalisationService.d.ts index 44a4941..ec6eecf 100644 --- a/TypeScript/16ImporterUtil/types/services/LocalisationService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/LocalisationService.d.ts @@ -2,17 +2,19 @@ import { I18n } from "i18n"; import { ILocaleConfig } from "../models/spt/config/ILocaleConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { RandomUtil } from "../utils/RandomUtil"; import { LocaleService } from "./LocaleService"; /** * Handles translating server text into different langauges */ export declare class LocalisationService { protected logger: ILogger; + protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; protected localeService: LocaleService; protected localeConfig: ILocaleConfig; protected i18n: I18n; - constructor(logger: ILogger, databaseServer: DatabaseServer, localeService: LocaleService); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, localeService: LocaleService); /** * Get a localised value using the passed in key * @param key Key to loop up locale for @@ -25,4 +27,10 @@ export declare class LocalisationService { * @returns string array of keys */ getKeys(): string[]; + /** + * From the provided partial key, find all keys that start with text and choose a random match + * @param partialKey Key to match locale keys on + * @returns locale text + */ + getRandomTextThatMatchesPartialKey(partialKey: string): string; } diff --git a/TypeScript/16ImporterUtil/types/services/MailSendService.d.ts b/TypeScript/16ImporterUtil/types/services/MailSendService.d.ts index 70b8e44..8ec5cf8 100644 --- a/TypeScript/16ImporterUtil/types/services/MailSendService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/MailSendService.d.ts @@ -1,3 +1,4 @@ +import { DialogueHelper } from "../helpers/DialogueHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; import { NotifierHelper } from "../helpers/NotifierHelper"; @@ -19,11 +20,12 @@ export declare class MailSendService { protected saveServer: SaveServer; protected databaseServer: DatabaseServer; protected notifierHelper: NotifierHelper; + protected dialogueHelper: DialogueHelper; protected notificationSendHelper: NotificationSendHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected readonly systemSenderId = "59e7125688a45068a6249071"; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, dialogueHelper: DialogueHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); /** * Send a message from an NPC (e.g. prapor) to the player with or without items using direct message text, do not look up any locale * @param playerId Players id to send message to diff --git a/TypeScript/16ImporterUtil/types/services/ProfileFixerService.d.ts b/TypeScript/16ImporterUtil/types/services/ProfileFixerService.d.ts index 418626d..b92c2f0 100644 --- a/TypeScript/16ImporterUtil/types/services/ProfileFixerService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/ProfileFixerService.d.ts @@ -1,6 +1,7 @@ import { HideoutHelper } from "../helpers/HideoutHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; @@ -20,6 +21,7 @@ export declare class ProfileFixerService { protected watermark: Watermark; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; + protected traderHelper: TraderHelper; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected timeUtil: TimeUtil; @@ -27,7 +29,7 @@ export declare class ProfileFixerService { protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -105,7 +107,7 @@ export declare class ProfileFixerService { * @param sessionId Session id * @param pmcProfile Profile to check inventory of */ - checkForOrphanedModdedItems(sessionId: string, pmcProfile: IPmcData): void; + checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; /** * Add `Improvements` object to hideout if missing - added in eft 13.0.21469 * @param pmcProfile profile to update diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/GameController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/GameController.d.ts index 6d0ce18..d7a7f1a 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/GameController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/GameController.d.ts @@ -11,9 +11,11 @@ import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse"; import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; +import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; +import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -25,6 +27,7 @@ import { ProfileFixerService } from "../services/ProfileFixerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { EncodingUtil } from "../utils/EncodingUtil"; import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class GameController { protected logger: ILogger; @@ -33,6 +36,7 @@ export declare class GameController { protected timeUtil: TimeUtil; protected preAkiModLoader: PreAkiModLoader; protected httpServerHelper: HttpServerHelper; + protected randomUtil: RandomUtil; protected encodingUtil: EncodingUtil; protected hideoutHelper: HideoutHelper; protected profileHelper: ProfileHelper; @@ -48,7 +52,9 @@ export declare class GameController { protected httpConfig: IHttpConfig; protected coreConfig: ICoreConfig; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); + protected ragfairConfig: IRagfairConfig; + protected botConfig: IBotConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); /** * Handle client/game/start */ @@ -84,6 +90,7 @@ export declare class GameController { * @param pmcProfile Player profile */ protected warnOnActiveBotReloadSkill(pmcProfile: IPmcData): void; + protected flagAllItemsInDbAsSellableOnFlea(): void; /** * When player logs in, iterate over all active effects and reduce timer * TODO - add body part HP regen @@ -118,9 +125,14 @@ export declare class GameController { protected validateQuestAssortUnlocksExist(): void; /** * Add the logged in players name to PMC name pool - * @param pmcProfile + * @param pmcProfile Profile of player to get name from */ protected addPlayerToPMCNames(pmcProfile: IPmcData): void; + /** + * Check for a dialog with the key 'undefined', and remove it + * @param fullProfile Profile to check for dialog in + */ + protected checkForAndRemoveUndefinedDialogs(fullProfile: IAkiProfile): void; /** * Blank out the "test" mail message from prapor */ diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotGenerator.d.ts index 5236a12..4530517 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotGenerator.d.ts @@ -10,6 +10,7 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; +import { LocalisationService } from "../services/LocalisationService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; @@ -32,9 +33,10 @@ export declare class BotGenerator { protected botHelper: BotHelper; protected botDifficultyHelper: BotDifficultyHelper; protected seasonalEventService: SeasonalEventService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -71,7 +73,7 @@ export declare class BotGenerator { * @param botRole role of bot e.g. assault * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string, sessionId: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/DialogueHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/DialogueHelper.d.ts index 6a8adc5..ea3bae7 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/DialogueHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/DialogueHelper.d.ts @@ -41,4 +41,10 @@ export declare class DialogueHelper { * @returns */ getMessageItemContents(messageID: string, sessionID: string, itemId: string): Item[]; + /** + * Get the dialogs dictionary for a profile, create if doesnt exist + * @param sessionId Session/player id + * @returns Dialog dictionary + */ + getDialogsForProfile(sessionId: string): Record; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/HideoutHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/HideoutHelper.d.ts index e9d3746..d9119a2 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/HideoutHelper.d.ts @@ -58,16 +58,12 @@ export declare class HideoutHelper { * @returns */ isProductionType(productive: Productive): productive is Production; - applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void; /** - * TODO: - * After looking at the skills there doesnt seem to be a configuration per skill to boost - * the XP gain PER skill. I THINK you should be able to put the variable "SkillProgress" (just like health has it) - * and be able to tune the skill gain PER skill, but I havent tested it and Im not sure! - * @param pmcData - * @param bonus + * Apply bonus to player profile given after completing hideout upgrades + * @param pmcData Profile to add bonus to + * @param bonus Bonus to add to profile */ - protected applySkillXPBoost(pmcData: IPmcData, bonus: StageBonus): void; + applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void; /** * Process a players hideout, update areas that use resources + increment production timers * @param sessionID Session id @@ -83,6 +79,7 @@ export declare class HideoutHelper { isGeneratorOn: boolean; waterCollectorHasFilter: boolean; }; + protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean; /** * Update progress timer for water collector * @param pmcData profile to update @@ -141,9 +138,8 @@ export declare class HideoutHelper { isGeneratorOn: boolean; waterCollectorHasFilter: boolean; }): void; - protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void; - protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean; protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData): void; + protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/TraderHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/TraderHelper.d.ts index 4157c1c..7cf764d 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/TraderHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/TraderHelper.d.ts @@ -1,4 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; +import { ProfileTraderTemplate } from "../models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; import { Traders } from "../models/enums/Traders"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; @@ -42,6 +43,7 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -113,4 +115,10 @@ export declare class TraderHelper { * @returns Traders key */ getTraderById(traderId: string): Traders; + /** + * Does the 'Traders' enum has a value that matches the passed in parameter + * @param value Value to check for + * @returns True, values exists in Traders enum as a value + */ + traderEnumHasValue(value: string): boolean; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/loaders/PreAkiModLoader.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/loaders/PreAkiModLoader.d.ts index a67f1c9..08059ff 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/loaders/PreAkiModLoader.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/loaders/PreAkiModLoader.d.ts @@ -35,6 +35,7 @@ export declare class PreAkiModLoader implements IModLoader { getImportedModDetails(): Record; getModPath(mod: string): string; protected importMods(): Promise; + protected sortMods(prev: string, next: string, missingFromOrderJSON: Record): number; /** * Check for duplicate mods loaded, show error if any * @param modPackageData Dictionary of mod package.json data diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IProfileTemplate.d.ts index 66ebbe8..411fead 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -14,7 +14,7 @@ export interface TemplateSide { character: IPmcData; suits: string[]; dialogues: Record; - weaponbuilds: WeaponBuild[]; + weaponbuilds: Record; trader: ProfileTraderTemplate; } export interface ProfileTraderTemplate { diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/profile/IAkiProfile.d.ts index d08da6e..93b89e2 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/profile/IAkiProfile.d.ts @@ -7,7 +7,7 @@ export interface IAkiProfile { characters: Characters; /** Clothing purchases */ suits: string[]; - weaponbuilds: WeaponBuild[]; + weaponbuilds: Record; dialogues: Record; aki: Aki; vitality: Vitality; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IPmcConfig.d.ts index a349ac2..339e0c6 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IPmcConfig.d.ts @@ -40,6 +40,8 @@ export interface IPmcConfig { botRelativeLevelDeltaMax: number; /** Force a number of healing items into PMCs secure container to ensure they can heal */ forceHealingItemsIntoSecure: boolean; + addPrefixToSameNamePMCAsPlayerChance: number; + allPMCsHavePlayerNameWithRandomPrefixChance: number; } export interface PmcTypes { usec: string; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/LocalisationService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/LocalisationService.d.ts index 44a4941..ec6eecf 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/LocalisationService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/LocalisationService.d.ts @@ -2,17 +2,19 @@ import { I18n } from "i18n"; import { ILocaleConfig } from "../models/spt/config/ILocaleConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { RandomUtil } from "../utils/RandomUtil"; import { LocaleService } from "./LocaleService"; /** * Handles translating server text into different langauges */ export declare class LocalisationService { protected logger: ILogger; + protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; protected localeService: LocaleService; protected localeConfig: ILocaleConfig; protected i18n: I18n; - constructor(logger: ILogger, databaseServer: DatabaseServer, localeService: LocaleService); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, localeService: LocaleService); /** * Get a localised value using the passed in key * @param key Key to loop up locale for @@ -25,4 +27,10 @@ export declare class LocalisationService { * @returns string array of keys */ getKeys(): string[]; + /** + * From the provided partial key, find all keys that start with text and choose a random match + * @param partialKey Key to match locale keys on + * @returns locale text + */ + getRandomTextThatMatchesPartialKey(partialKey: string): string; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/MailSendService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/MailSendService.d.ts index 70b8e44..8ec5cf8 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/MailSendService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/MailSendService.d.ts @@ -1,3 +1,4 @@ +import { DialogueHelper } from "../helpers/DialogueHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; import { NotifierHelper } from "../helpers/NotifierHelper"; @@ -19,11 +20,12 @@ export declare class MailSendService { protected saveServer: SaveServer; protected databaseServer: DatabaseServer; protected notifierHelper: NotifierHelper; + protected dialogueHelper: DialogueHelper; protected notificationSendHelper: NotificationSendHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected readonly systemSenderId = "59e7125688a45068a6249071"; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, dialogueHelper: DialogueHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); /** * Send a message from an NPC (e.g. prapor) to the player with or without items using direct message text, do not look up any locale * @param playerId Players id to send message to diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/ProfileFixerService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/ProfileFixerService.d.ts index 418626d..b92c2f0 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/ProfileFixerService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/ProfileFixerService.d.ts @@ -1,6 +1,7 @@ import { HideoutHelper } from "../helpers/HideoutHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; @@ -20,6 +21,7 @@ export declare class ProfileFixerService { protected watermark: Watermark; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; + protected traderHelper: TraderHelper; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected timeUtil: TimeUtil; @@ -27,7 +29,7 @@ export declare class ProfileFixerService { protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -105,7 +107,7 @@ export declare class ProfileFixerService { * @param sessionId Session id * @param pmcProfile Profile to check inventory of */ - checkForOrphanedModdedItems(sessionId: string, pmcProfile: IPmcData): void; + checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; /** * Add `Improvements` object to hideout if missing - added in eft 13.0.21469 * @param pmcProfile profile to update diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/GameController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/GameController.d.ts index 6d0ce18..d7a7f1a 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/GameController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/GameController.d.ts @@ -11,9 +11,11 @@ import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse"; import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; +import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; +import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -25,6 +27,7 @@ import { ProfileFixerService } from "../services/ProfileFixerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { EncodingUtil } from "../utils/EncodingUtil"; import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class GameController { protected logger: ILogger; @@ -33,6 +36,7 @@ export declare class GameController { protected timeUtil: TimeUtil; protected preAkiModLoader: PreAkiModLoader; protected httpServerHelper: HttpServerHelper; + protected randomUtil: RandomUtil; protected encodingUtil: EncodingUtil; protected hideoutHelper: HideoutHelper; protected profileHelper: ProfileHelper; @@ -48,7 +52,9 @@ export declare class GameController { protected httpConfig: IHttpConfig; protected coreConfig: ICoreConfig; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); + protected ragfairConfig: IRagfairConfig; + protected botConfig: IBotConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); /** * Handle client/game/start */ @@ -84,6 +90,7 @@ export declare class GameController { * @param pmcProfile Player profile */ protected warnOnActiveBotReloadSkill(pmcProfile: IPmcData): void; + protected flagAllItemsInDbAsSellableOnFlea(): void; /** * When player logs in, iterate over all active effects and reduce timer * TODO - add body part HP regen @@ -118,9 +125,14 @@ export declare class GameController { protected validateQuestAssortUnlocksExist(): void; /** * Add the logged in players name to PMC name pool - * @param pmcProfile + * @param pmcProfile Profile of player to get name from */ protected addPlayerToPMCNames(pmcProfile: IPmcData): void; + /** + * Check for a dialog with the key 'undefined', and remove it + * @param fullProfile Profile to check for dialog in + */ + protected checkForAndRemoveUndefinedDialogs(fullProfile: IAkiProfile): void; /** * Blank out the "test" mail message from prapor */ diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotGenerator.d.ts index 5236a12..4530517 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotGenerator.d.ts @@ -10,6 +10,7 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; +import { LocalisationService } from "../services/LocalisationService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; @@ -32,9 +33,10 @@ export declare class BotGenerator { protected botHelper: BotHelper; protected botDifficultyHelper: BotDifficultyHelper; protected seasonalEventService: SeasonalEventService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -71,7 +73,7 @@ export declare class BotGenerator { * @param botRole role of bot e.g. assault * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string, sessionId: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/DialogueHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/DialogueHelper.d.ts index 6a8adc5..ea3bae7 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/DialogueHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/DialogueHelper.d.ts @@ -41,4 +41,10 @@ export declare class DialogueHelper { * @returns */ getMessageItemContents(messageID: string, sessionID: string, itemId: string): Item[]; + /** + * Get the dialogs dictionary for a profile, create if doesnt exist + * @param sessionId Session/player id + * @returns Dialog dictionary + */ + getDialogsForProfile(sessionId: string): Record; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/HideoutHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/HideoutHelper.d.ts index e9d3746..d9119a2 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/HideoutHelper.d.ts @@ -58,16 +58,12 @@ export declare class HideoutHelper { * @returns */ isProductionType(productive: Productive): productive is Production; - applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void; /** - * TODO: - * After looking at the skills there doesnt seem to be a configuration per skill to boost - * the XP gain PER skill. I THINK you should be able to put the variable "SkillProgress" (just like health has it) - * and be able to tune the skill gain PER skill, but I havent tested it and Im not sure! - * @param pmcData - * @param bonus + * Apply bonus to player profile given after completing hideout upgrades + * @param pmcData Profile to add bonus to + * @param bonus Bonus to add to profile */ - protected applySkillXPBoost(pmcData: IPmcData, bonus: StageBonus): void; + applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void; /** * Process a players hideout, update areas that use resources + increment production timers * @param sessionID Session id @@ -83,6 +79,7 @@ export declare class HideoutHelper { isGeneratorOn: boolean; waterCollectorHasFilter: boolean; }; + protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean; /** * Update progress timer for water collector * @param pmcData profile to update @@ -141,9 +138,8 @@ export declare class HideoutHelper { isGeneratorOn: boolean; waterCollectorHasFilter: boolean; }): void; - protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void; - protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean; protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData): void; + protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/TraderHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/TraderHelper.d.ts index 4157c1c..7cf764d 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/TraderHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/TraderHelper.d.ts @@ -1,4 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; +import { ProfileTraderTemplate } from "../models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; import { Traders } from "../models/enums/Traders"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; @@ -42,6 +43,7 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -113,4 +115,10 @@ export declare class TraderHelper { * @returns Traders key */ getTraderById(traderId: string): Traders; + /** + * Does the 'Traders' enum has a value that matches the passed in parameter + * @param value Value to check for + * @returns True, values exists in Traders enum as a value + */ + traderEnumHasValue(value: string): boolean; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/loaders/PreAkiModLoader.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/loaders/PreAkiModLoader.d.ts index a67f1c9..08059ff 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/loaders/PreAkiModLoader.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/loaders/PreAkiModLoader.d.ts @@ -35,6 +35,7 @@ export declare class PreAkiModLoader implements IModLoader { getImportedModDetails(): Record; getModPath(mod: string): string; protected importMods(): Promise; + protected sortMods(prev: string, next: string, missingFromOrderJSON: Record): number; /** * Check for duplicate mods loaded, show error if any * @param modPackageData Dictionary of mod package.json data diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IProfileTemplate.d.ts index 66ebbe8..411fead 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -14,7 +14,7 @@ export interface TemplateSide { character: IPmcData; suits: string[]; dialogues: Record; - weaponbuilds: WeaponBuild[]; + weaponbuilds: Record; trader: ProfileTraderTemplate; } export interface ProfileTraderTemplate { diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/profile/IAkiProfile.d.ts index d08da6e..93b89e2 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/profile/IAkiProfile.d.ts @@ -7,7 +7,7 @@ export interface IAkiProfile { characters: Characters; /** Clothing purchases */ suits: string[]; - weaponbuilds: WeaponBuild[]; + weaponbuilds: Record; dialogues: Record; aki: Aki; vitality: Vitality; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IPmcConfig.d.ts index a349ac2..339e0c6 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IPmcConfig.d.ts @@ -40,6 +40,8 @@ export interface IPmcConfig { botRelativeLevelDeltaMax: number; /** Force a number of healing items into PMCs secure container to ensure they can heal */ forceHealingItemsIntoSecure: boolean; + addPrefixToSameNamePMCAsPlayerChance: number; + allPMCsHavePlayerNameWithRandomPrefixChance: number; } export interface PmcTypes { usec: string; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/LocalisationService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/LocalisationService.d.ts index 44a4941..ec6eecf 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/LocalisationService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/LocalisationService.d.ts @@ -2,17 +2,19 @@ import { I18n } from "i18n"; import { ILocaleConfig } from "../models/spt/config/ILocaleConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { RandomUtil } from "../utils/RandomUtil"; import { LocaleService } from "./LocaleService"; /** * Handles translating server text into different langauges */ export declare class LocalisationService { protected logger: ILogger; + protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; protected localeService: LocaleService; protected localeConfig: ILocaleConfig; protected i18n: I18n; - constructor(logger: ILogger, databaseServer: DatabaseServer, localeService: LocaleService); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, localeService: LocaleService); /** * Get a localised value using the passed in key * @param key Key to loop up locale for @@ -25,4 +27,10 @@ export declare class LocalisationService { * @returns string array of keys */ getKeys(): string[]; + /** + * From the provided partial key, find all keys that start with text and choose a random match + * @param partialKey Key to match locale keys on + * @returns locale text + */ + getRandomTextThatMatchesPartialKey(partialKey: string): string; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/MailSendService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/MailSendService.d.ts index 70b8e44..8ec5cf8 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/MailSendService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/MailSendService.d.ts @@ -1,3 +1,4 @@ +import { DialogueHelper } from "../helpers/DialogueHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; import { NotifierHelper } from "../helpers/NotifierHelper"; @@ -19,11 +20,12 @@ export declare class MailSendService { protected saveServer: SaveServer; protected databaseServer: DatabaseServer; protected notifierHelper: NotifierHelper; + protected dialogueHelper: DialogueHelper; protected notificationSendHelper: NotificationSendHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected readonly systemSenderId = "59e7125688a45068a6249071"; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, dialogueHelper: DialogueHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); /** * Send a message from an NPC (e.g. prapor) to the player with or without items using direct message text, do not look up any locale * @param playerId Players id to send message to diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/ProfileFixerService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/ProfileFixerService.d.ts index 418626d..b92c2f0 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/ProfileFixerService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/ProfileFixerService.d.ts @@ -1,6 +1,7 @@ import { HideoutHelper } from "../helpers/HideoutHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; @@ -20,6 +21,7 @@ export declare class ProfileFixerService { protected watermark: Watermark; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; + protected traderHelper: TraderHelper; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected timeUtil: TimeUtil; @@ -27,7 +29,7 @@ export declare class ProfileFixerService { protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -105,7 +107,7 @@ export declare class ProfileFixerService { * @param sessionId Session id * @param pmcProfile Profile to check inventory of */ - checkForOrphanedModdedItems(sessionId: string, pmcProfile: IPmcData): void; + checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; /** * Add `Improvements` object to hideout if missing - added in eft 13.0.21469 * @param pmcProfile profile to update diff --git a/TypeScript/18CustomItemService/types/helpers/DialogueHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/DialogueHelper.d.ts index 6a8adc5..ea3bae7 100644 --- a/TypeScript/18CustomItemService/types/helpers/DialogueHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/DialogueHelper.d.ts @@ -41,4 +41,10 @@ export declare class DialogueHelper { * @returns */ getMessageItemContents(messageID: string, sessionID: string, itemId: string): Item[]; + /** + * Get the dialogs dictionary for a profile, create if doesnt exist + * @param sessionId Session/player id + * @returns Dialog dictionary + */ + getDialogsForProfile(sessionId: string): Record; } diff --git a/TypeScript/18CustomItemService/types/helpers/TraderHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/TraderHelper.d.ts index 4157c1c..7cf764d 100644 --- a/TypeScript/18CustomItemService/types/helpers/TraderHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/TraderHelper.d.ts @@ -1,4 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; +import { ProfileTraderTemplate } from "../models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; import { Traders } from "../models/enums/Traders"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; @@ -42,6 +43,7 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -113,4 +115,10 @@ export declare class TraderHelper { * @returns Traders key */ getTraderById(traderId: string): Traders; + /** + * Does the 'Traders' enum has a value that matches the passed in parameter + * @param value Value to check for + * @returns True, values exists in Traders enum as a value + */ + traderEnumHasValue(value: string): boolean; } diff --git a/TypeScript/18CustomItemService/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/18CustomItemService/types/models/eft/common/tables/IProfileTemplate.d.ts index 66ebbe8..411fead 100644 --- a/TypeScript/18CustomItemService/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -14,7 +14,7 @@ export interface TemplateSide { character: IPmcData; suits: string[]; dialogues: Record; - weaponbuilds: WeaponBuild[]; + weaponbuilds: Record; trader: ProfileTraderTemplate; } export interface ProfileTraderTemplate { diff --git a/TypeScript/18CustomItemService/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/18CustomItemService/types/models/eft/profile/IAkiProfile.d.ts index d08da6e..93b89e2 100644 --- a/TypeScript/18CustomItemService/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/profile/IAkiProfile.d.ts @@ -7,7 +7,7 @@ export interface IAkiProfile { characters: Characters; /** Clothing purchases */ suits: string[]; - weaponbuilds: WeaponBuild[]; + weaponbuilds: Record; dialogues: Record; aki: Aki; vitality: Vitality; diff --git a/TypeScript/18CustomItemService/types/services/MailSendService.d.ts b/TypeScript/18CustomItemService/types/services/MailSendService.d.ts index 70b8e44..8ec5cf8 100644 --- a/TypeScript/18CustomItemService/types/services/MailSendService.d.ts +++ b/TypeScript/18CustomItemService/types/services/MailSendService.d.ts @@ -1,3 +1,4 @@ +import { DialogueHelper } from "../helpers/DialogueHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; import { NotifierHelper } from "../helpers/NotifierHelper"; @@ -19,11 +20,12 @@ export declare class MailSendService { protected saveServer: SaveServer; protected databaseServer: DatabaseServer; protected notifierHelper: NotifierHelper; + protected dialogueHelper: DialogueHelper; protected notificationSendHelper: NotificationSendHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected readonly systemSenderId = "59e7125688a45068a6249071"; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, dialogueHelper: DialogueHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); /** * Send a message from an NPC (e.g. prapor) to the player with or without items using direct message text, do not look up any locale * @param playerId Players id to send message to diff --git a/TypeScript/18CustomItemService/types/services/ProfileFixerService.d.ts b/TypeScript/18CustomItemService/types/services/ProfileFixerService.d.ts index 418626d..b92c2f0 100644 --- a/TypeScript/18CustomItemService/types/services/ProfileFixerService.d.ts +++ b/TypeScript/18CustomItemService/types/services/ProfileFixerService.d.ts @@ -1,6 +1,7 @@ import { HideoutHelper } from "../helpers/HideoutHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; @@ -20,6 +21,7 @@ export declare class ProfileFixerService { protected watermark: Watermark; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; + protected traderHelper: TraderHelper; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected timeUtil: TimeUtil; @@ -27,7 +29,7 @@ export declare class ProfileFixerService { protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -105,7 +107,7 @@ export declare class ProfileFixerService { * @param sessionId Session id * @param pmcProfile Profile to check inventory of */ - checkForOrphanedModdedItems(sessionId: string, pmcProfile: IPmcData): void; + checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; /** * Add `Improvements` object to hideout if missing - added in eft 13.0.21469 * @param pmcProfile profile to update diff --git a/TypeScript/1LogToConsole/types/helpers/DialogueHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/DialogueHelper.d.ts index 6a8adc5..ea3bae7 100644 --- a/TypeScript/1LogToConsole/types/helpers/DialogueHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/DialogueHelper.d.ts @@ -41,4 +41,10 @@ export declare class DialogueHelper { * @returns */ getMessageItemContents(messageID: string, sessionID: string, itemId: string): Item[]; + /** + * Get the dialogs dictionary for a profile, create if doesnt exist + * @param sessionId Session/player id + * @returns Dialog dictionary + */ + getDialogsForProfile(sessionId: string): Record; } diff --git a/TypeScript/1LogToConsole/types/helpers/TraderHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/TraderHelper.d.ts index 4157c1c..7cf764d 100644 --- a/TypeScript/1LogToConsole/types/helpers/TraderHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/TraderHelper.d.ts @@ -1,4 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; +import { ProfileTraderTemplate } from "../models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; import { Traders } from "../models/enums/Traders"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; @@ -42,6 +43,7 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -113,4 +115,10 @@ export declare class TraderHelper { * @returns Traders key */ getTraderById(traderId: string): Traders; + /** + * Does the 'Traders' enum has a value that matches the passed in parameter + * @param value Value to check for + * @returns True, values exists in Traders enum as a value + */ + traderEnumHasValue(value: string): boolean; } diff --git a/TypeScript/1LogToConsole/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/1LogToConsole/types/models/eft/common/tables/IProfileTemplate.d.ts index 66ebbe8..411fead 100644 --- a/TypeScript/1LogToConsole/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -14,7 +14,7 @@ export interface TemplateSide { character: IPmcData; suits: string[]; dialogues: Record; - weaponbuilds: WeaponBuild[]; + weaponbuilds: Record; trader: ProfileTraderTemplate; } export interface ProfileTraderTemplate { diff --git a/TypeScript/1LogToConsole/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/1LogToConsole/types/models/eft/profile/IAkiProfile.d.ts index d08da6e..93b89e2 100644 --- a/TypeScript/1LogToConsole/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/profile/IAkiProfile.d.ts @@ -7,7 +7,7 @@ export interface IAkiProfile { characters: Characters; /** Clothing purchases */ suits: string[]; - weaponbuilds: WeaponBuild[]; + weaponbuilds: Record; dialogues: Record; aki: Aki; vitality: Vitality; diff --git a/TypeScript/1LogToConsole/types/services/MailSendService.d.ts b/TypeScript/1LogToConsole/types/services/MailSendService.d.ts index 70b8e44..8ec5cf8 100644 --- a/TypeScript/1LogToConsole/types/services/MailSendService.d.ts +++ b/TypeScript/1LogToConsole/types/services/MailSendService.d.ts @@ -1,3 +1,4 @@ +import { DialogueHelper } from "../helpers/DialogueHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; import { NotifierHelper } from "../helpers/NotifierHelper"; @@ -19,11 +20,12 @@ export declare class MailSendService { protected saveServer: SaveServer; protected databaseServer: DatabaseServer; protected notifierHelper: NotifierHelper; + protected dialogueHelper: DialogueHelper; protected notificationSendHelper: NotificationSendHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected readonly systemSenderId = "59e7125688a45068a6249071"; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, dialogueHelper: DialogueHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); /** * Send a message from an NPC (e.g. prapor) to the player with or without items using direct message text, do not look up any locale * @param playerId Players id to send message to diff --git a/TypeScript/1LogToConsole/types/services/ProfileFixerService.d.ts b/TypeScript/1LogToConsole/types/services/ProfileFixerService.d.ts index 418626d..b92c2f0 100644 --- a/TypeScript/1LogToConsole/types/services/ProfileFixerService.d.ts +++ b/TypeScript/1LogToConsole/types/services/ProfileFixerService.d.ts @@ -1,6 +1,7 @@ import { HideoutHelper } from "../helpers/HideoutHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; @@ -20,6 +21,7 @@ export declare class ProfileFixerService { protected watermark: Watermark; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; + protected traderHelper: TraderHelper; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected timeUtil: TimeUtil; @@ -27,7 +29,7 @@ export declare class ProfileFixerService { protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -105,7 +107,7 @@ export declare class ProfileFixerService { * @param sessionId Session id * @param pmcProfile Profile to check inventory of */ - checkForOrphanedModdedItems(sessionId: string, pmcProfile: IPmcData): void; + checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; /** * Add `Improvements` object to hideout if missing - added in eft 13.0.21469 * @param pmcProfile profile to update diff --git a/TypeScript/2EditDatabase/types/helpers/DialogueHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/DialogueHelper.d.ts index 6a8adc5..ea3bae7 100644 --- a/TypeScript/2EditDatabase/types/helpers/DialogueHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/DialogueHelper.d.ts @@ -41,4 +41,10 @@ export declare class DialogueHelper { * @returns */ getMessageItemContents(messageID: string, sessionID: string, itemId: string): Item[]; + /** + * Get the dialogs dictionary for a profile, create if doesnt exist + * @param sessionId Session/player id + * @returns Dialog dictionary + */ + getDialogsForProfile(sessionId: string): Record; } diff --git a/TypeScript/2EditDatabase/types/helpers/TraderHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/TraderHelper.d.ts index 4157c1c..7cf764d 100644 --- a/TypeScript/2EditDatabase/types/helpers/TraderHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/TraderHelper.d.ts @@ -1,4 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; +import { ProfileTraderTemplate } from "../models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; import { Traders } from "../models/enums/Traders"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; @@ -42,6 +43,7 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -113,4 +115,10 @@ export declare class TraderHelper { * @returns Traders key */ getTraderById(traderId: string): Traders; + /** + * Does the 'Traders' enum has a value that matches the passed in parameter + * @param value Value to check for + * @returns True, values exists in Traders enum as a value + */ + traderEnumHasValue(value: string): boolean; } diff --git a/TypeScript/2EditDatabase/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/2EditDatabase/types/models/eft/common/tables/IProfileTemplate.d.ts index 66ebbe8..411fead 100644 --- a/TypeScript/2EditDatabase/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -14,7 +14,7 @@ export interface TemplateSide { character: IPmcData; suits: string[]; dialogues: Record; - weaponbuilds: WeaponBuild[]; + weaponbuilds: Record; trader: ProfileTraderTemplate; } export interface ProfileTraderTemplate { diff --git a/TypeScript/2EditDatabase/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/2EditDatabase/types/models/eft/profile/IAkiProfile.d.ts index d08da6e..93b89e2 100644 --- a/TypeScript/2EditDatabase/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/profile/IAkiProfile.d.ts @@ -7,7 +7,7 @@ export interface IAkiProfile { characters: Characters; /** Clothing purchases */ suits: string[]; - weaponbuilds: WeaponBuild[]; + weaponbuilds: Record; dialogues: Record; aki: Aki; vitality: Vitality; diff --git a/TypeScript/2EditDatabase/types/services/MailSendService.d.ts b/TypeScript/2EditDatabase/types/services/MailSendService.d.ts index 70b8e44..8ec5cf8 100644 --- a/TypeScript/2EditDatabase/types/services/MailSendService.d.ts +++ b/TypeScript/2EditDatabase/types/services/MailSendService.d.ts @@ -1,3 +1,4 @@ +import { DialogueHelper } from "../helpers/DialogueHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; import { NotifierHelper } from "../helpers/NotifierHelper"; @@ -19,11 +20,12 @@ export declare class MailSendService { protected saveServer: SaveServer; protected databaseServer: DatabaseServer; protected notifierHelper: NotifierHelper; + protected dialogueHelper: DialogueHelper; protected notificationSendHelper: NotificationSendHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected readonly systemSenderId = "59e7125688a45068a6249071"; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, dialogueHelper: DialogueHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); /** * Send a message from an NPC (e.g. prapor) to the player with or without items using direct message text, do not look up any locale * @param playerId Players id to send message to diff --git a/TypeScript/2EditDatabase/types/services/ProfileFixerService.d.ts b/TypeScript/2EditDatabase/types/services/ProfileFixerService.d.ts index 418626d..b92c2f0 100644 --- a/TypeScript/2EditDatabase/types/services/ProfileFixerService.d.ts +++ b/TypeScript/2EditDatabase/types/services/ProfileFixerService.d.ts @@ -1,6 +1,7 @@ import { HideoutHelper } from "../helpers/HideoutHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; @@ -20,6 +21,7 @@ export declare class ProfileFixerService { protected watermark: Watermark; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; + protected traderHelper: TraderHelper; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected timeUtil: TimeUtil; @@ -27,7 +29,7 @@ export declare class ProfileFixerService { protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -105,7 +107,7 @@ export declare class ProfileFixerService { * @param sessionId Session id * @param pmcProfile Profile to check inventory of */ - checkForOrphanedModdedItems(sessionId: string, pmcProfile: IPmcData): void; + checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; /** * Add `Improvements` object to hideout if missing - added in eft 13.0.21469 * @param pmcProfile profile to update diff --git a/TypeScript/3GetSptConfigFile/types/helpers/DialogueHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/DialogueHelper.d.ts index 6a8adc5..ea3bae7 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/DialogueHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/DialogueHelper.d.ts @@ -41,4 +41,10 @@ export declare class DialogueHelper { * @returns */ getMessageItemContents(messageID: string, sessionID: string, itemId: string): Item[]; + /** + * Get the dialogs dictionary for a profile, create if doesnt exist + * @param sessionId Session/player id + * @returns Dialog dictionary + */ + getDialogsForProfile(sessionId: string): Record; } diff --git a/TypeScript/3GetSptConfigFile/types/helpers/TraderHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/TraderHelper.d.ts index 4157c1c..7cf764d 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/TraderHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/TraderHelper.d.ts @@ -1,4 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; +import { ProfileTraderTemplate } from "../models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; import { Traders } from "../models/enums/Traders"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; @@ -42,6 +43,7 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -113,4 +115,10 @@ export declare class TraderHelper { * @returns Traders key */ getTraderById(traderId: string): Traders; + /** + * Does the 'Traders' enum has a value that matches the passed in parameter + * @param value Value to check for + * @returns True, values exists in Traders enum as a value + */ + traderEnumHasValue(value: string): boolean; } diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IProfileTemplate.d.ts index 66ebbe8..411fead 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -14,7 +14,7 @@ export interface TemplateSide { character: IPmcData; suits: string[]; dialogues: Record; - weaponbuilds: WeaponBuild[]; + weaponbuilds: Record; trader: ProfileTraderTemplate; } export interface ProfileTraderTemplate { diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/profile/IAkiProfile.d.ts index d08da6e..93b89e2 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/profile/IAkiProfile.d.ts @@ -7,7 +7,7 @@ export interface IAkiProfile { characters: Characters; /** Clothing purchases */ suits: string[]; - weaponbuilds: WeaponBuild[]; + weaponbuilds: Record; dialogues: Record; aki: Aki; vitality: Vitality; diff --git a/TypeScript/3GetSptConfigFile/types/services/MailSendService.d.ts b/TypeScript/3GetSptConfigFile/types/services/MailSendService.d.ts index 70b8e44..8ec5cf8 100644 --- a/TypeScript/3GetSptConfigFile/types/services/MailSendService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/MailSendService.d.ts @@ -1,3 +1,4 @@ +import { DialogueHelper } from "../helpers/DialogueHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; import { NotifierHelper } from "../helpers/NotifierHelper"; @@ -19,11 +20,12 @@ export declare class MailSendService { protected saveServer: SaveServer; protected databaseServer: DatabaseServer; protected notifierHelper: NotifierHelper; + protected dialogueHelper: DialogueHelper; protected notificationSendHelper: NotificationSendHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected readonly systemSenderId = "59e7125688a45068a6249071"; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, dialogueHelper: DialogueHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); /** * Send a message from an NPC (e.g. prapor) to the player with or without items using direct message text, do not look up any locale * @param playerId Players id to send message to diff --git a/TypeScript/3GetSptConfigFile/types/services/ProfileFixerService.d.ts b/TypeScript/3GetSptConfigFile/types/services/ProfileFixerService.d.ts index 418626d..b92c2f0 100644 --- a/TypeScript/3GetSptConfigFile/types/services/ProfileFixerService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/ProfileFixerService.d.ts @@ -1,6 +1,7 @@ import { HideoutHelper } from "../helpers/HideoutHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; @@ -20,6 +21,7 @@ export declare class ProfileFixerService { protected watermark: Watermark; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; + protected traderHelper: TraderHelper; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected timeUtil: TimeUtil; @@ -27,7 +29,7 @@ export declare class ProfileFixerService { protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -105,7 +107,7 @@ export declare class ProfileFixerService { * @param sessionId Session id * @param pmcProfile Profile to check inventory of */ - checkForOrphanedModdedItems(sessionId: string, pmcProfile: IPmcData): void; + checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; /** * Add `Improvements` object to hideout if missing - added in eft 13.0.21469 * @param pmcProfile profile to update diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/DialogueHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/DialogueHelper.d.ts index 6a8adc5..ea3bae7 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/DialogueHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/DialogueHelper.d.ts @@ -41,4 +41,10 @@ export declare class DialogueHelper { * @returns */ getMessageItemContents(messageID: string, sessionID: string, itemId: string): Item[]; + /** + * Get the dialogs dictionary for a profile, create if doesnt exist + * @param sessionId Session/player id + * @returns Dialog dictionary + */ + getDialogsForProfile(sessionId: string): Record; } diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/TraderHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/TraderHelper.d.ts index 4157c1c..7cf764d 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/TraderHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/TraderHelper.d.ts @@ -1,4 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; +import { ProfileTraderTemplate } from "../models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; import { Traders } from "../models/enums/Traders"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; @@ -42,6 +43,7 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -113,4 +115,10 @@ export declare class TraderHelper { * @returns Traders key */ getTraderById(traderId: string): Traders; + /** + * Does the 'Traders' enum has a value that matches the passed in parameter + * @param value Value to check for + * @returns True, values exists in Traders enum as a value + */ + traderEnumHasValue(value: string): boolean; } diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IProfileTemplate.d.ts index 66ebbe8..411fead 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -14,7 +14,7 @@ export interface TemplateSide { character: IPmcData; suits: string[]; dialogues: Record; - weaponbuilds: WeaponBuild[]; + weaponbuilds: Record; trader: ProfileTraderTemplate; } export interface ProfileTraderTemplate { diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/profile/IAkiProfile.d.ts index d08da6e..93b89e2 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/profile/IAkiProfile.d.ts @@ -7,7 +7,7 @@ export interface IAkiProfile { characters: Characters; /** Clothing purchases */ suits: string[]; - weaponbuilds: WeaponBuild[]; + weaponbuilds: Record; dialogues: Record; aki: Aki; vitality: Vitality; diff --git a/TypeScript/4UseACustomConfigFile/types/services/MailSendService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/MailSendService.d.ts index 70b8e44..8ec5cf8 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/MailSendService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/MailSendService.d.ts @@ -1,3 +1,4 @@ +import { DialogueHelper } from "../helpers/DialogueHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; import { NotifierHelper } from "../helpers/NotifierHelper"; @@ -19,11 +20,12 @@ export declare class MailSendService { protected saveServer: SaveServer; protected databaseServer: DatabaseServer; protected notifierHelper: NotifierHelper; + protected dialogueHelper: DialogueHelper; protected notificationSendHelper: NotificationSendHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected readonly systemSenderId = "59e7125688a45068a6249071"; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, dialogueHelper: DialogueHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); /** * Send a message from an NPC (e.g. prapor) to the player with or without items using direct message text, do not look up any locale * @param playerId Players id to send message to diff --git a/TypeScript/4UseACustomConfigFile/types/services/ProfileFixerService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/ProfileFixerService.d.ts index 418626d..b92c2f0 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/ProfileFixerService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/ProfileFixerService.d.ts @@ -1,6 +1,7 @@ import { HideoutHelper } from "../helpers/HideoutHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; @@ -20,6 +21,7 @@ export declare class ProfileFixerService { protected watermark: Watermark; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; + protected traderHelper: TraderHelper; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected timeUtil: TimeUtil; @@ -27,7 +29,7 @@ export declare class ProfileFixerService { protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -105,7 +107,7 @@ export declare class ProfileFixerService { * @param sessionId Session id * @param pmcProfile Profile to check inventory of */ - checkForOrphanedModdedItems(sessionId: string, pmcProfile: IPmcData): void; + checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; /** * Add `Improvements` object to hideout if missing - added in eft 13.0.21469 * @param pmcProfile profile to update diff --git a/TypeScript/5ReplaceMethod/types/helpers/DialogueHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/DialogueHelper.d.ts index 6a8adc5..ea3bae7 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/DialogueHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/DialogueHelper.d.ts @@ -41,4 +41,10 @@ export declare class DialogueHelper { * @returns */ getMessageItemContents(messageID: string, sessionID: string, itemId: string): Item[]; + /** + * Get the dialogs dictionary for a profile, create if doesnt exist + * @param sessionId Session/player id + * @returns Dialog dictionary + */ + getDialogsForProfile(sessionId: string): Record; } diff --git a/TypeScript/5ReplaceMethod/types/helpers/TraderHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/TraderHelper.d.ts index 4157c1c..7cf764d 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/TraderHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/TraderHelper.d.ts @@ -1,4 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; +import { ProfileTraderTemplate } from "../models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; import { Traders } from "../models/enums/Traders"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; @@ -42,6 +43,7 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -113,4 +115,10 @@ export declare class TraderHelper { * @returns Traders key */ getTraderById(traderId: string): Traders; + /** + * Does the 'Traders' enum has a value that matches the passed in parameter + * @param value Value to check for + * @returns True, values exists in Traders enum as a value + */ + traderEnumHasValue(value: string): boolean; } diff --git a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IProfileTemplate.d.ts index 66ebbe8..411fead 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -14,7 +14,7 @@ export interface TemplateSide { character: IPmcData; suits: string[]; dialogues: Record; - weaponbuilds: WeaponBuild[]; + weaponbuilds: Record; trader: ProfileTraderTemplate; } export interface ProfileTraderTemplate { diff --git a/TypeScript/5ReplaceMethod/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/profile/IAkiProfile.d.ts index d08da6e..93b89e2 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/profile/IAkiProfile.d.ts @@ -7,7 +7,7 @@ export interface IAkiProfile { characters: Characters; /** Clothing purchases */ suits: string[]; - weaponbuilds: WeaponBuild[]; + weaponbuilds: Record; dialogues: Record; aki: Aki; vitality: Vitality; diff --git a/TypeScript/5ReplaceMethod/types/services/MailSendService.d.ts b/TypeScript/5ReplaceMethod/types/services/MailSendService.d.ts index 70b8e44..8ec5cf8 100644 --- a/TypeScript/5ReplaceMethod/types/services/MailSendService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/MailSendService.d.ts @@ -1,3 +1,4 @@ +import { DialogueHelper } from "../helpers/DialogueHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; import { NotifierHelper } from "../helpers/NotifierHelper"; @@ -19,11 +20,12 @@ export declare class MailSendService { protected saveServer: SaveServer; protected databaseServer: DatabaseServer; protected notifierHelper: NotifierHelper; + protected dialogueHelper: DialogueHelper; protected notificationSendHelper: NotificationSendHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected readonly systemSenderId = "59e7125688a45068a6249071"; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, dialogueHelper: DialogueHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); /** * Send a message from an NPC (e.g. prapor) to the player with or without items using direct message text, do not look up any locale * @param playerId Players id to send message to diff --git a/TypeScript/5ReplaceMethod/types/services/ProfileFixerService.d.ts b/TypeScript/5ReplaceMethod/types/services/ProfileFixerService.d.ts index 418626d..b92c2f0 100644 --- a/TypeScript/5ReplaceMethod/types/services/ProfileFixerService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/ProfileFixerService.d.ts @@ -1,6 +1,7 @@ import { HideoutHelper } from "../helpers/HideoutHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; @@ -20,6 +21,7 @@ export declare class ProfileFixerService { protected watermark: Watermark; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; + protected traderHelper: TraderHelper; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected timeUtil: TimeUtil; @@ -27,7 +29,7 @@ export declare class ProfileFixerService { protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -105,7 +107,7 @@ export declare class ProfileFixerService { * @param sessionId Session id * @param pmcProfile Profile to check inventory of */ - checkForOrphanedModdedItems(sessionId: string, pmcProfile: IPmcData): void; + checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; /** * Add `Improvements` object to hideout if missing - added in eft 13.0.21469 * @param pmcProfile profile to update diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/DialogueHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/DialogueHelper.d.ts index 6a8adc5..ea3bae7 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/DialogueHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/DialogueHelper.d.ts @@ -41,4 +41,10 @@ export declare class DialogueHelper { * @returns */ getMessageItemContents(messageID: string, sessionID: string, itemId: string): Item[]; + /** + * Get the dialogs dictionary for a profile, create if doesnt exist + * @param sessionId Session/player id + * @returns Dialog dictionary + */ + getDialogsForProfile(sessionId: string): Record; } diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/TraderHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/TraderHelper.d.ts index 4157c1c..7cf764d 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/TraderHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/TraderHelper.d.ts @@ -1,4 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; +import { ProfileTraderTemplate } from "../models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; import { Traders } from "../models/enums/Traders"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; @@ -42,6 +43,7 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -113,4 +115,10 @@ export declare class TraderHelper { * @returns Traders key */ getTraderById(traderId: string): Traders; + /** + * Does the 'Traders' enum has a value that matches the passed in parameter + * @param value Value to check for + * @returns True, values exists in Traders enum as a value + */ + traderEnumHasValue(value: string): boolean; } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IProfileTemplate.d.ts index 66ebbe8..411fead 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -14,7 +14,7 @@ export interface TemplateSide { character: IPmcData; suits: string[]; dialogues: Record; - weaponbuilds: WeaponBuild[]; + weaponbuilds: Record; trader: ProfileTraderTemplate; } export interface ProfileTraderTemplate { diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/IAkiProfile.d.ts index d08da6e..93b89e2 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/IAkiProfile.d.ts @@ -7,7 +7,7 @@ export interface IAkiProfile { characters: Characters; /** Clothing purchases */ suits: string[]; - weaponbuilds: WeaponBuild[]; + weaponbuilds: Record; dialogues: Record; aki: Aki; vitality: Vitality; diff --git a/TypeScript/6ReferenceAnotherClass/types/services/MailSendService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/MailSendService.d.ts index 70b8e44..8ec5cf8 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/MailSendService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/MailSendService.d.ts @@ -1,3 +1,4 @@ +import { DialogueHelper } from "../helpers/DialogueHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; import { NotifierHelper } from "../helpers/NotifierHelper"; @@ -19,11 +20,12 @@ export declare class MailSendService { protected saveServer: SaveServer; protected databaseServer: DatabaseServer; protected notifierHelper: NotifierHelper; + protected dialogueHelper: DialogueHelper; protected notificationSendHelper: NotificationSendHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected readonly systemSenderId = "59e7125688a45068a6249071"; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, dialogueHelper: DialogueHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); /** * Send a message from an NPC (e.g. prapor) to the player with or without items using direct message text, do not look up any locale * @param playerId Players id to send message to diff --git a/TypeScript/6ReferenceAnotherClass/types/services/ProfileFixerService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/ProfileFixerService.d.ts index 418626d..b92c2f0 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/ProfileFixerService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/ProfileFixerService.d.ts @@ -1,6 +1,7 @@ import { HideoutHelper } from "../helpers/HideoutHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; @@ -20,6 +21,7 @@ export declare class ProfileFixerService { protected watermark: Watermark; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; + protected traderHelper: TraderHelper; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected timeUtil: TimeUtil; @@ -27,7 +29,7 @@ export declare class ProfileFixerService { protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -105,7 +107,7 @@ export declare class ProfileFixerService { * @param sessionId Session id * @param pmcProfile Profile to check inventory of */ - checkForOrphanedModdedItems(sessionId: string, pmcProfile: IPmcData): void; + checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; /** * Add `Improvements` object to hideout if missing - added in eft 13.0.21469 * @param pmcProfile profile to update diff --git a/TypeScript/7OnLoadHook/types/controllers/GameController.d.ts b/TypeScript/7OnLoadHook/types/controllers/GameController.d.ts index 6d0ce18..d7a7f1a 100644 --- a/TypeScript/7OnLoadHook/types/controllers/GameController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/GameController.d.ts @@ -11,9 +11,11 @@ import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse"; import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; +import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; +import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -25,6 +27,7 @@ import { ProfileFixerService } from "../services/ProfileFixerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { EncodingUtil } from "../utils/EncodingUtil"; import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class GameController { protected logger: ILogger; @@ -33,6 +36,7 @@ export declare class GameController { protected timeUtil: TimeUtil; protected preAkiModLoader: PreAkiModLoader; protected httpServerHelper: HttpServerHelper; + protected randomUtil: RandomUtil; protected encodingUtil: EncodingUtil; protected hideoutHelper: HideoutHelper; protected profileHelper: ProfileHelper; @@ -48,7 +52,9 @@ export declare class GameController { protected httpConfig: IHttpConfig; protected coreConfig: ICoreConfig; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); + protected ragfairConfig: IRagfairConfig; + protected botConfig: IBotConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); /** * Handle client/game/start */ @@ -84,6 +90,7 @@ export declare class GameController { * @param pmcProfile Player profile */ protected warnOnActiveBotReloadSkill(pmcProfile: IPmcData): void; + protected flagAllItemsInDbAsSellableOnFlea(): void; /** * When player logs in, iterate over all active effects and reduce timer * TODO - add body part HP regen @@ -118,9 +125,14 @@ export declare class GameController { protected validateQuestAssortUnlocksExist(): void; /** * Add the logged in players name to PMC name pool - * @param pmcProfile + * @param pmcProfile Profile of player to get name from */ protected addPlayerToPMCNames(pmcProfile: IPmcData): void; + /** + * Check for a dialog with the key 'undefined', and remove it + * @param fullProfile Profile to check for dialog in + */ + protected checkForAndRemoveUndefinedDialogs(fullProfile: IAkiProfile): void; /** * Blank out the "test" mail message from prapor */ diff --git a/TypeScript/7OnLoadHook/types/generators/BotGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/BotGenerator.d.ts index 5236a12..4530517 100644 --- a/TypeScript/7OnLoadHook/types/generators/BotGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/BotGenerator.d.ts @@ -10,6 +10,7 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; +import { LocalisationService } from "../services/LocalisationService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; @@ -32,9 +33,10 @@ export declare class BotGenerator { protected botHelper: BotHelper; protected botDifficultyHelper: BotDifficultyHelper; protected seasonalEventService: SeasonalEventService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -71,7 +73,7 @@ export declare class BotGenerator { * @param botRole role of bot e.g. assault * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string, sessionId: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client diff --git a/TypeScript/7OnLoadHook/types/helpers/DialogueHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/DialogueHelper.d.ts index 6a8adc5..ea3bae7 100644 --- a/TypeScript/7OnLoadHook/types/helpers/DialogueHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/DialogueHelper.d.ts @@ -41,4 +41,10 @@ export declare class DialogueHelper { * @returns */ getMessageItemContents(messageID: string, sessionID: string, itemId: string): Item[]; + /** + * Get the dialogs dictionary for a profile, create if doesnt exist + * @param sessionId Session/player id + * @returns Dialog dictionary + */ + getDialogsForProfile(sessionId: string): Record; } diff --git a/TypeScript/7OnLoadHook/types/helpers/HideoutHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/HideoutHelper.d.ts index e9d3746..d9119a2 100644 --- a/TypeScript/7OnLoadHook/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/HideoutHelper.d.ts @@ -58,16 +58,12 @@ export declare class HideoutHelper { * @returns */ isProductionType(productive: Productive): productive is Production; - applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void; /** - * TODO: - * After looking at the skills there doesnt seem to be a configuration per skill to boost - * the XP gain PER skill. I THINK you should be able to put the variable "SkillProgress" (just like health has it) - * and be able to tune the skill gain PER skill, but I havent tested it and Im not sure! - * @param pmcData - * @param bonus + * Apply bonus to player profile given after completing hideout upgrades + * @param pmcData Profile to add bonus to + * @param bonus Bonus to add to profile */ - protected applySkillXPBoost(pmcData: IPmcData, bonus: StageBonus): void; + applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void; /** * Process a players hideout, update areas that use resources + increment production timers * @param sessionID Session id @@ -83,6 +79,7 @@ export declare class HideoutHelper { isGeneratorOn: boolean; waterCollectorHasFilter: boolean; }; + protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean; /** * Update progress timer for water collector * @param pmcData profile to update @@ -141,9 +138,8 @@ export declare class HideoutHelper { isGeneratorOn: boolean; waterCollectorHasFilter: boolean; }): void; - protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void; - protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean; protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData): void; + protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/7OnLoadHook/types/helpers/TraderHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/TraderHelper.d.ts index 4157c1c..7cf764d 100644 --- a/TypeScript/7OnLoadHook/types/helpers/TraderHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/TraderHelper.d.ts @@ -1,4 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; +import { ProfileTraderTemplate } from "../models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; import { Traders } from "../models/enums/Traders"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; @@ -42,6 +43,7 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -113,4 +115,10 @@ export declare class TraderHelper { * @returns Traders key */ getTraderById(traderId: string): Traders; + /** + * Does the 'Traders' enum has a value that matches the passed in parameter + * @param value Value to check for + * @returns True, values exists in Traders enum as a value + */ + traderEnumHasValue(value: string): boolean; } diff --git a/TypeScript/7OnLoadHook/types/loaders/PreAkiModLoader.d.ts b/TypeScript/7OnLoadHook/types/loaders/PreAkiModLoader.d.ts index a67f1c9..08059ff 100644 --- a/TypeScript/7OnLoadHook/types/loaders/PreAkiModLoader.d.ts +++ b/TypeScript/7OnLoadHook/types/loaders/PreAkiModLoader.d.ts @@ -35,6 +35,7 @@ export declare class PreAkiModLoader implements IModLoader { getImportedModDetails(): Record; getModPath(mod: string): string; protected importMods(): Promise; + protected sortMods(prev: string, next: string, missingFromOrderJSON: Record): number; /** * Check for duplicate mods loaded, show error if any * @param modPackageData Dictionary of mod package.json data diff --git a/TypeScript/7OnLoadHook/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/7OnLoadHook/types/models/eft/common/tables/IProfileTemplate.d.ts index 66ebbe8..411fead 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -14,7 +14,7 @@ export interface TemplateSide { character: IPmcData; suits: string[]; dialogues: Record; - weaponbuilds: WeaponBuild[]; + weaponbuilds: Record; trader: ProfileTraderTemplate; } export interface ProfileTraderTemplate { diff --git a/TypeScript/7OnLoadHook/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/7OnLoadHook/types/models/eft/profile/IAkiProfile.d.ts index d08da6e..93b89e2 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/profile/IAkiProfile.d.ts @@ -7,7 +7,7 @@ export interface IAkiProfile { characters: Characters; /** Clothing purchases */ suits: string[]; - weaponbuilds: WeaponBuild[]; + weaponbuilds: Record; dialogues: Record; aki: Aki; vitality: Vitality; diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/IPmcConfig.d.ts index a349ac2..339e0c6 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/IPmcConfig.d.ts @@ -40,6 +40,8 @@ export interface IPmcConfig { botRelativeLevelDeltaMax: number; /** Force a number of healing items into PMCs secure container to ensure they can heal */ forceHealingItemsIntoSecure: boolean; + addPrefixToSameNamePMCAsPlayerChance: number; + allPMCsHavePlayerNameWithRandomPrefixChance: number; } export interface PmcTypes { usec: string; diff --git a/TypeScript/7OnLoadHook/types/services/LocalisationService.d.ts b/TypeScript/7OnLoadHook/types/services/LocalisationService.d.ts index 44a4941..ec6eecf 100644 --- a/TypeScript/7OnLoadHook/types/services/LocalisationService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/LocalisationService.d.ts @@ -2,17 +2,19 @@ import { I18n } from "i18n"; import { ILocaleConfig } from "../models/spt/config/ILocaleConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { RandomUtil } from "../utils/RandomUtil"; import { LocaleService } from "./LocaleService"; /** * Handles translating server text into different langauges */ export declare class LocalisationService { protected logger: ILogger; + protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; protected localeService: LocaleService; protected localeConfig: ILocaleConfig; protected i18n: I18n; - constructor(logger: ILogger, databaseServer: DatabaseServer, localeService: LocaleService); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, localeService: LocaleService); /** * Get a localised value using the passed in key * @param key Key to loop up locale for @@ -25,4 +27,10 @@ export declare class LocalisationService { * @returns string array of keys */ getKeys(): string[]; + /** + * From the provided partial key, find all keys that start with text and choose a random match + * @param partialKey Key to match locale keys on + * @returns locale text + */ + getRandomTextThatMatchesPartialKey(partialKey: string): string; } diff --git a/TypeScript/7OnLoadHook/types/services/MailSendService.d.ts b/TypeScript/7OnLoadHook/types/services/MailSendService.d.ts index 70b8e44..8ec5cf8 100644 --- a/TypeScript/7OnLoadHook/types/services/MailSendService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/MailSendService.d.ts @@ -1,3 +1,4 @@ +import { DialogueHelper } from "../helpers/DialogueHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; import { NotifierHelper } from "../helpers/NotifierHelper"; @@ -19,11 +20,12 @@ export declare class MailSendService { protected saveServer: SaveServer; protected databaseServer: DatabaseServer; protected notifierHelper: NotifierHelper; + protected dialogueHelper: DialogueHelper; protected notificationSendHelper: NotificationSendHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected readonly systemSenderId = "59e7125688a45068a6249071"; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, dialogueHelper: DialogueHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); /** * Send a message from an NPC (e.g. prapor) to the player with or without items using direct message text, do not look up any locale * @param playerId Players id to send message to diff --git a/TypeScript/7OnLoadHook/types/services/ProfileFixerService.d.ts b/TypeScript/7OnLoadHook/types/services/ProfileFixerService.d.ts index 418626d..b92c2f0 100644 --- a/TypeScript/7OnLoadHook/types/services/ProfileFixerService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/ProfileFixerService.d.ts @@ -1,6 +1,7 @@ import { HideoutHelper } from "../helpers/HideoutHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; @@ -20,6 +21,7 @@ export declare class ProfileFixerService { protected watermark: Watermark; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; + protected traderHelper: TraderHelper; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected timeUtil: TimeUtil; @@ -27,7 +29,7 @@ export declare class ProfileFixerService { protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -105,7 +107,7 @@ export declare class ProfileFixerService { * @param sessionId Session id * @param pmcProfile Profile to check inventory of */ - checkForOrphanedModdedItems(sessionId: string, pmcProfile: IPmcData): void; + checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; /** * Add `Improvements` object to hideout if missing - added in eft 13.0.21469 * @param pmcProfile profile to update diff --git a/TypeScript/8OnUpdateHook/types/controllers/GameController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/GameController.d.ts index 6d0ce18..d7a7f1a 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/GameController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/GameController.d.ts @@ -11,9 +11,11 @@ import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse"; import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; +import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; +import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -25,6 +27,7 @@ import { ProfileFixerService } from "../services/ProfileFixerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { EncodingUtil } from "../utils/EncodingUtil"; import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class GameController { protected logger: ILogger; @@ -33,6 +36,7 @@ export declare class GameController { protected timeUtil: TimeUtil; protected preAkiModLoader: PreAkiModLoader; protected httpServerHelper: HttpServerHelper; + protected randomUtil: RandomUtil; protected encodingUtil: EncodingUtil; protected hideoutHelper: HideoutHelper; protected profileHelper: ProfileHelper; @@ -48,7 +52,9 @@ export declare class GameController { protected httpConfig: IHttpConfig; protected coreConfig: ICoreConfig; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); + protected ragfairConfig: IRagfairConfig; + protected botConfig: IBotConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); /** * Handle client/game/start */ @@ -84,6 +90,7 @@ export declare class GameController { * @param pmcProfile Player profile */ protected warnOnActiveBotReloadSkill(pmcProfile: IPmcData): void; + protected flagAllItemsInDbAsSellableOnFlea(): void; /** * When player logs in, iterate over all active effects and reduce timer * TODO - add body part HP regen @@ -118,9 +125,14 @@ export declare class GameController { protected validateQuestAssortUnlocksExist(): void; /** * Add the logged in players name to PMC name pool - * @param pmcProfile + * @param pmcProfile Profile of player to get name from */ protected addPlayerToPMCNames(pmcProfile: IPmcData): void; + /** + * Check for a dialog with the key 'undefined', and remove it + * @param fullProfile Profile to check for dialog in + */ + protected checkForAndRemoveUndefinedDialogs(fullProfile: IAkiProfile): void; /** * Blank out the "test" mail message from prapor */ diff --git a/TypeScript/8OnUpdateHook/types/generators/BotGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/BotGenerator.d.ts index 5236a12..4530517 100644 --- a/TypeScript/8OnUpdateHook/types/generators/BotGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/BotGenerator.d.ts @@ -10,6 +10,7 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; +import { LocalisationService } from "../services/LocalisationService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; @@ -32,9 +33,10 @@ export declare class BotGenerator { protected botHelper: BotHelper; protected botDifficultyHelper: BotDifficultyHelper; protected seasonalEventService: SeasonalEventService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -71,7 +73,7 @@ export declare class BotGenerator { * @param botRole role of bot e.g. assault * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string, sessionId: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client diff --git a/TypeScript/8OnUpdateHook/types/helpers/DialogueHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/DialogueHelper.d.ts index 6a8adc5..ea3bae7 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/DialogueHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/DialogueHelper.d.ts @@ -41,4 +41,10 @@ export declare class DialogueHelper { * @returns */ getMessageItemContents(messageID: string, sessionID: string, itemId: string): Item[]; + /** + * Get the dialogs dictionary for a profile, create if doesnt exist + * @param sessionId Session/player id + * @returns Dialog dictionary + */ + getDialogsForProfile(sessionId: string): Record; } diff --git a/TypeScript/8OnUpdateHook/types/helpers/HideoutHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/HideoutHelper.d.ts index e9d3746..d9119a2 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/HideoutHelper.d.ts @@ -58,16 +58,12 @@ export declare class HideoutHelper { * @returns */ isProductionType(productive: Productive): productive is Production; - applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void; /** - * TODO: - * After looking at the skills there doesnt seem to be a configuration per skill to boost - * the XP gain PER skill. I THINK you should be able to put the variable "SkillProgress" (just like health has it) - * and be able to tune the skill gain PER skill, but I havent tested it and Im not sure! - * @param pmcData - * @param bonus + * Apply bonus to player profile given after completing hideout upgrades + * @param pmcData Profile to add bonus to + * @param bonus Bonus to add to profile */ - protected applySkillXPBoost(pmcData: IPmcData, bonus: StageBonus): void; + applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void; /** * Process a players hideout, update areas that use resources + increment production timers * @param sessionID Session id @@ -83,6 +79,7 @@ export declare class HideoutHelper { isGeneratorOn: boolean; waterCollectorHasFilter: boolean; }; + protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean; /** * Update progress timer for water collector * @param pmcData profile to update @@ -141,9 +138,8 @@ export declare class HideoutHelper { isGeneratorOn: boolean; waterCollectorHasFilter: boolean; }): void; - protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void; - protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean; protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData): void; + protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/8OnUpdateHook/types/helpers/TraderHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/TraderHelper.d.ts index 4157c1c..7cf764d 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/TraderHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/TraderHelper.d.ts @@ -1,4 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; +import { ProfileTraderTemplate } from "../models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; import { Traders } from "../models/enums/Traders"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; @@ -42,6 +43,7 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -113,4 +115,10 @@ export declare class TraderHelper { * @returns Traders key */ getTraderById(traderId: string): Traders; + /** + * Does the 'Traders' enum has a value that matches the passed in parameter + * @param value Value to check for + * @returns True, values exists in Traders enum as a value + */ + traderEnumHasValue(value: string): boolean; } diff --git a/TypeScript/8OnUpdateHook/types/loaders/PreAkiModLoader.d.ts b/TypeScript/8OnUpdateHook/types/loaders/PreAkiModLoader.d.ts index a67f1c9..08059ff 100644 --- a/TypeScript/8OnUpdateHook/types/loaders/PreAkiModLoader.d.ts +++ b/TypeScript/8OnUpdateHook/types/loaders/PreAkiModLoader.d.ts @@ -35,6 +35,7 @@ export declare class PreAkiModLoader implements IModLoader { getImportedModDetails(): Record; getModPath(mod: string): string; protected importMods(): Promise; + protected sortMods(prev: string, next: string, missingFromOrderJSON: Record): number; /** * Check for duplicate mods loaded, show error if any * @param modPackageData Dictionary of mod package.json data diff --git a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IProfileTemplate.d.ts index 66ebbe8..411fead 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -14,7 +14,7 @@ export interface TemplateSide { character: IPmcData; suits: string[]; dialogues: Record; - weaponbuilds: WeaponBuild[]; + weaponbuilds: Record; trader: ProfileTraderTemplate; } export interface ProfileTraderTemplate { diff --git a/TypeScript/8OnUpdateHook/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/profile/IAkiProfile.d.ts index d08da6e..93b89e2 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/profile/IAkiProfile.d.ts @@ -7,7 +7,7 @@ export interface IAkiProfile { characters: Characters; /** Clothing purchases */ suits: string[]; - weaponbuilds: WeaponBuild[]; + weaponbuilds: Record; dialogues: Record; aki: Aki; vitality: Vitality; diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/IPmcConfig.d.ts index a349ac2..339e0c6 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/IPmcConfig.d.ts @@ -40,6 +40,8 @@ export interface IPmcConfig { botRelativeLevelDeltaMax: number; /** Force a number of healing items into PMCs secure container to ensure they can heal */ forceHealingItemsIntoSecure: boolean; + addPrefixToSameNamePMCAsPlayerChance: number; + allPMCsHavePlayerNameWithRandomPrefixChance: number; } export interface PmcTypes { usec: string; diff --git a/TypeScript/8OnUpdateHook/types/services/LocalisationService.d.ts b/TypeScript/8OnUpdateHook/types/services/LocalisationService.d.ts index 44a4941..ec6eecf 100644 --- a/TypeScript/8OnUpdateHook/types/services/LocalisationService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/LocalisationService.d.ts @@ -2,17 +2,19 @@ import { I18n } from "i18n"; import { ILocaleConfig } from "../models/spt/config/ILocaleConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { RandomUtil } from "../utils/RandomUtil"; import { LocaleService } from "./LocaleService"; /** * Handles translating server text into different langauges */ export declare class LocalisationService { protected logger: ILogger; + protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; protected localeService: LocaleService; protected localeConfig: ILocaleConfig; protected i18n: I18n; - constructor(logger: ILogger, databaseServer: DatabaseServer, localeService: LocaleService); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, localeService: LocaleService); /** * Get a localised value using the passed in key * @param key Key to loop up locale for @@ -25,4 +27,10 @@ export declare class LocalisationService { * @returns string array of keys */ getKeys(): string[]; + /** + * From the provided partial key, find all keys that start with text and choose a random match + * @param partialKey Key to match locale keys on + * @returns locale text + */ + getRandomTextThatMatchesPartialKey(partialKey: string): string; } diff --git a/TypeScript/8OnUpdateHook/types/services/MailSendService.d.ts b/TypeScript/8OnUpdateHook/types/services/MailSendService.d.ts index 70b8e44..8ec5cf8 100644 --- a/TypeScript/8OnUpdateHook/types/services/MailSendService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/MailSendService.d.ts @@ -1,3 +1,4 @@ +import { DialogueHelper } from "../helpers/DialogueHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; import { NotifierHelper } from "../helpers/NotifierHelper"; @@ -19,11 +20,12 @@ export declare class MailSendService { protected saveServer: SaveServer; protected databaseServer: DatabaseServer; protected notifierHelper: NotifierHelper; + protected dialogueHelper: DialogueHelper; protected notificationSendHelper: NotificationSendHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected readonly systemSenderId = "59e7125688a45068a6249071"; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, dialogueHelper: DialogueHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); /** * Send a message from an NPC (e.g. prapor) to the player with or without items using direct message text, do not look up any locale * @param playerId Players id to send message to diff --git a/TypeScript/8OnUpdateHook/types/services/ProfileFixerService.d.ts b/TypeScript/8OnUpdateHook/types/services/ProfileFixerService.d.ts index 418626d..b92c2f0 100644 --- a/TypeScript/8OnUpdateHook/types/services/ProfileFixerService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/ProfileFixerService.d.ts @@ -1,6 +1,7 @@ import { HideoutHelper } from "../helpers/HideoutHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; @@ -20,6 +21,7 @@ export declare class ProfileFixerService { protected watermark: Watermark; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; + protected traderHelper: TraderHelper; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected timeUtil: TimeUtil; @@ -27,7 +29,7 @@ export declare class ProfileFixerService { protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -105,7 +107,7 @@ export declare class ProfileFixerService { * @param sessionId Session id * @param pmcProfile Profile to check inventory of */ - checkForOrphanedModdedItems(sessionId: string, pmcProfile: IPmcData): void; + checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; /** * Add `Improvements` object to hideout if missing - added in eft 13.0.21469 * @param pmcProfile profile to update diff --git a/TypeScript/9RouterHooks/types/controllers/GameController.d.ts b/TypeScript/9RouterHooks/types/controllers/GameController.d.ts index 6d0ce18..d7a7f1a 100644 --- a/TypeScript/9RouterHooks/types/controllers/GameController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/GameController.d.ts @@ -11,9 +11,11 @@ import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse"; import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; +import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; +import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -25,6 +27,7 @@ import { ProfileFixerService } from "../services/ProfileFixerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { EncodingUtil } from "../utils/EncodingUtil"; import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class GameController { protected logger: ILogger; @@ -33,6 +36,7 @@ export declare class GameController { protected timeUtil: TimeUtil; protected preAkiModLoader: PreAkiModLoader; protected httpServerHelper: HttpServerHelper; + protected randomUtil: RandomUtil; protected encodingUtil: EncodingUtil; protected hideoutHelper: HideoutHelper; protected profileHelper: ProfileHelper; @@ -48,7 +52,9 @@ export declare class GameController { protected httpConfig: IHttpConfig; protected coreConfig: ICoreConfig; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); + protected ragfairConfig: IRagfairConfig; + protected botConfig: IBotConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); /** * Handle client/game/start */ @@ -84,6 +90,7 @@ export declare class GameController { * @param pmcProfile Player profile */ protected warnOnActiveBotReloadSkill(pmcProfile: IPmcData): void; + protected flagAllItemsInDbAsSellableOnFlea(): void; /** * When player logs in, iterate over all active effects and reduce timer * TODO - add body part HP regen @@ -118,9 +125,14 @@ export declare class GameController { protected validateQuestAssortUnlocksExist(): void; /** * Add the logged in players name to PMC name pool - * @param pmcProfile + * @param pmcProfile Profile of player to get name from */ protected addPlayerToPMCNames(pmcProfile: IPmcData): void; + /** + * Check for a dialog with the key 'undefined', and remove it + * @param fullProfile Profile to check for dialog in + */ + protected checkForAndRemoveUndefinedDialogs(fullProfile: IAkiProfile): void; /** * Blank out the "test" mail message from prapor */ diff --git a/TypeScript/9RouterHooks/types/generators/BotGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/BotGenerator.d.ts index 5236a12..4530517 100644 --- a/TypeScript/9RouterHooks/types/generators/BotGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/BotGenerator.d.ts @@ -10,6 +10,7 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; +import { LocalisationService } from "../services/LocalisationService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; @@ -32,9 +33,10 @@ export declare class BotGenerator { protected botHelper: BotHelper; protected botDifficultyHelper: BotDifficultyHelper; protected seasonalEventService: SeasonalEventService; + protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -71,7 +73,7 @@ export declare class BotGenerator { * @param botRole role of bot e.g. assault * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string, sessionId: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client diff --git a/TypeScript/9RouterHooks/types/helpers/DialogueHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/DialogueHelper.d.ts index 6a8adc5..ea3bae7 100644 --- a/TypeScript/9RouterHooks/types/helpers/DialogueHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/DialogueHelper.d.ts @@ -41,4 +41,10 @@ export declare class DialogueHelper { * @returns */ getMessageItemContents(messageID: string, sessionID: string, itemId: string): Item[]; + /** + * Get the dialogs dictionary for a profile, create if doesnt exist + * @param sessionId Session/player id + * @returns Dialog dictionary + */ + getDialogsForProfile(sessionId: string): Record; } diff --git a/TypeScript/9RouterHooks/types/helpers/HideoutHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/HideoutHelper.d.ts index e9d3746..d9119a2 100644 --- a/TypeScript/9RouterHooks/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/HideoutHelper.d.ts @@ -58,16 +58,12 @@ export declare class HideoutHelper { * @returns */ isProductionType(productive: Productive): productive is Production; - applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void; /** - * TODO: - * After looking at the skills there doesnt seem to be a configuration per skill to boost - * the XP gain PER skill. I THINK you should be able to put the variable "SkillProgress" (just like health has it) - * and be able to tune the skill gain PER skill, but I havent tested it and Im not sure! - * @param pmcData - * @param bonus + * Apply bonus to player profile given after completing hideout upgrades + * @param pmcData Profile to add bonus to + * @param bonus Bonus to add to profile */ - protected applySkillXPBoost(pmcData: IPmcData, bonus: StageBonus): void; + applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void; /** * Process a players hideout, update areas that use resources + increment production timers * @param sessionID Session id @@ -83,6 +79,7 @@ export declare class HideoutHelper { isGeneratorOn: boolean; waterCollectorHasFilter: boolean; }; + protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean; /** * Update progress timer for water collector * @param pmcData profile to update @@ -141,9 +138,8 @@ export declare class HideoutHelper { isGeneratorOn: boolean; waterCollectorHasFilter: boolean; }): void; - protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void; - protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean; protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData): void; + protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/9RouterHooks/types/helpers/TraderHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/TraderHelper.d.ts index 4157c1c..7cf764d 100644 --- a/TypeScript/9RouterHooks/types/helpers/TraderHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/TraderHelper.d.ts @@ -1,4 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; +import { ProfileTraderTemplate } from "../models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; import { Traders } from "../models/enums/Traders"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; @@ -42,6 +43,7 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status * @param traderId Trader to alter @@ -113,4 +115,10 @@ export declare class TraderHelper { * @returns Traders key */ getTraderById(traderId: string): Traders; + /** + * Does the 'Traders' enum has a value that matches the passed in parameter + * @param value Value to check for + * @returns True, values exists in Traders enum as a value + */ + traderEnumHasValue(value: string): boolean; } diff --git a/TypeScript/9RouterHooks/types/loaders/PreAkiModLoader.d.ts b/TypeScript/9RouterHooks/types/loaders/PreAkiModLoader.d.ts index a67f1c9..08059ff 100644 --- a/TypeScript/9RouterHooks/types/loaders/PreAkiModLoader.d.ts +++ b/TypeScript/9RouterHooks/types/loaders/PreAkiModLoader.d.ts @@ -35,6 +35,7 @@ export declare class PreAkiModLoader implements IModLoader { getImportedModDetails(): Record; getModPath(mod: string): string; protected importMods(): Promise; + protected sortMods(prev: string, next: string, missingFromOrderJSON: Record): number; /** * Check for duplicate mods loaded, show error if any * @param modPackageData Dictionary of mod package.json data diff --git a/TypeScript/9RouterHooks/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/9RouterHooks/types/models/eft/common/tables/IProfileTemplate.d.ts index 66ebbe8..411fead 100644 --- a/TypeScript/9RouterHooks/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -14,7 +14,7 @@ export interface TemplateSide { character: IPmcData; suits: string[]; dialogues: Record; - weaponbuilds: WeaponBuild[]; + weaponbuilds: Record; trader: ProfileTraderTemplate; } export interface ProfileTraderTemplate { diff --git a/TypeScript/9RouterHooks/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/9RouterHooks/types/models/eft/profile/IAkiProfile.d.ts index d08da6e..93b89e2 100644 --- a/TypeScript/9RouterHooks/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/profile/IAkiProfile.d.ts @@ -7,7 +7,7 @@ export interface IAkiProfile { characters: Characters; /** Clothing purchases */ suits: string[]; - weaponbuilds: WeaponBuild[]; + weaponbuilds: Record; dialogues: Record; aki: Aki; vitality: Vitality; diff --git a/TypeScript/9RouterHooks/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/IPmcConfig.d.ts index a349ac2..339e0c6 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/IPmcConfig.d.ts @@ -40,6 +40,8 @@ export interface IPmcConfig { botRelativeLevelDeltaMax: number; /** Force a number of healing items into PMCs secure container to ensure they can heal */ forceHealingItemsIntoSecure: boolean; + addPrefixToSameNamePMCAsPlayerChance: number; + allPMCsHavePlayerNameWithRandomPrefixChance: number; } export interface PmcTypes { usec: string; diff --git a/TypeScript/9RouterHooks/types/services/LocalisationService.d.ts b/TypeScript/9RouterHooks/types/services/LocalisationService.d.ts index 44a4941..ec6eecf 100644 --- a/TypeScript/9RouterHooks/types/services/LocalisationService.d.ts +++ b/TypeScript/9RouterHooks/types/services/LocalisationService.d.ts @@ -2,17 +2,19 @@ import { I18n } from "i18n"; import { ILocaleConfig } from "../models/spt/config/ILocaleConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { RandomUtil } from "../utils/RandomUtil"; import { LocaleService } from "./LocaleService"; /** * Handles translating server text into different langauges */ export declare class LocalisationService { protected logger: ILogger; + protected randomUtil: RandomUtil; protected databaseServer: DatabaseServer; protected localeService: LocaleService; protected localeConfig: ILocaleConfig; protected i18n: I18n; - constructor(logger: ILogger, databaseServer: DatabaseServer, localeService: LocaleService); + constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, localeService: LocaleService); /** * Get a localised value using the passed in key * @param key Key to loop up locale for @@ -25,4 +27,10 @@ export declare class LocalisationService { * @returns string array of keys */ getKeys(): string[]; + /** + * From the provided partial key, find all keys that start with text and choose a random match + * @param partialKey Key to match locale keys on + * @returns locale text + */ + getRandomTextThatMatchesPartialKey(partialKey: string): string; } diff --git a/TypeScript/9RouterHooks/types/services/MailSendService.d.ts b/TypeScript/9RouterHooks/types/services/MailSendService.d.ts index 70b8e44..8ec5cf8 100644 --- a/TypeScript/9RouterHooks/types/services/MailSendService.d.ts +++ b/TypeScript/9RouterHooks/types/services/MailSendService.d.ts @@ -1,3 +1,4 @@ +import { DialogueHelper } from "../helpers/DialogueHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; import { NotifierHelper } from "../helpers/NotifierHelper"; @@ -19,11 +20,12 @@ export declare class MailSendService { protected saveServer: SaveServer; protected databaseServer: DatabaseServer; protected notifierHelper: NotifierHelper; + protected dialogueHelper: DialogueHelper; protected notificationSendHelper: NotificationSendHelper; protected localisationService: LocalisationService; protected itemHelper: ItemHelper; protected readonly systemSenderId = "59e7125688a45068a6249071"; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, dialogueHelper: DialogueHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper); /** * Send a message from an NPC (e.g. prapor) to the player with or without items using direct message text, do not look up any locale * @param playerId Players id to send message to diff --git a/TypeScript/9RouterHooks/types/services/ProfileFixerService.d.ts b/TypeScript/9RouterHooks/types/services/ProfileFixerService.d.ts index 418626d..b92c2f0 100644 --- a/TypeScript/9RouterHooks/types/services/ProfileFixerService.d.ts +++ b/TypeScript/9RouterHooks/types/services/ProfileFixerService.d.ts @@ -1,6 +1,7 @@ import { HideoutHelper } from "../helpers/HideoutHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; @@ -20,6 +21,7 @@ export declare class ProfileFixerService { protected watermark: Watermark; protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; + protected traderHelper: TraderHelper; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected timeUtil: TimeUtil; @@ -27,7 +29,7 @@ export declare class ProfileFixerService { protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -105,7 +107,7 @@ export declare class ProfileFixerService { * @param sessionId Session id * @param pmcProfile Profile to check inventory of */ - checkForOrphanedModdedItems(sessionId: string, pmcProfile: IPmcData): void; + checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; /** * Add `Improvements` object to hideout if missing - added in eft 13.0.21469 * @param pmcProfile profile to update