diff --git a/TypeScript/10ScopesAndTypes/types/controllers/GameController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/GameController.d.ts index 640a8c1..168071d 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/GameController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/GameController.d.ts @@ -61,6 +61,10 @@ export declare class GameController { * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + /** + * Out of date/incorrectly made trader mods forget this data + */ + protected checkTraderRepairValuesExist(): void; protected addCustomLooseLootPositions(): void; protected adjustLooseLootSpawnProbabilities(): void; protected setHideoutAreasAndCraftsTo40Secs(): void; diff --git a/TypeScript/10ScopesAndTypes/types/controllers/InsuranceController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/InsuranceController.d.ts index b1e8fe6..0ee30ed 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/InsuranceController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/InsuranceController.d.ts @@ -8,7 +8,7 @@ import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGet import { IGetInsuranceCostResponseData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostResponseData"; import { IInsureRequestData } from "@spt-aki/models/eft/insurance/IInsureRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; -import { Insurance, ISystemData } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ISystemData, Insurance } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IInsuranceConfig } from "@spt-aki/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; diff --git a/TypeScript/10ScopesAndTypes/types/controllers/RepeatableQuestController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/RepeatableQuestController.d.ts index b09b540..a3ebc1c 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/RepeatableQuestController.d.ts @@ -13,6 +13,7 @@ import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -21,8 +22,9 @@ import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RepeatableQuestController { - protected timeUtil: TimeUtil; protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; @@ -37,7 +39,7 @@ export declare class RepeatableQuestController { protected questHelper: QuestHelper; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. @@ -64,6 +66,13 @@ export declare class RepeatableQuestController { * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Get the number of quests to generate - takes into account charisma state of player + * @param repeatableConfig Config + * @param pmcData Player profile + * @returns Quest count + */ + protected getQuestCount(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): number; /** * Get repeatable quest data from profile from name (daily/weekly), creates base repeatable quest object if none exists * @param repeatableConfig daily/weekly config diff --git a/TypeScript/10ScopesAndTypes/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/BotEquipmentModGenerator.d.ts index 05266dd..75530c7 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/BotEquipmentModGenerator.d.ts @@ -179,7 +179,7 @@ export declare class BotEquipmentModGenerator { * Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots. * This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine" * @param items The items where the CylinderMagazine's camora are appended to - * @param modPool modPool which should include available cartrigdes + * @param modPool modPool which should include available cartridges * @param parentId The CylinderMagazine's UID * @param parentTemplate The CylinderMagazine's template */ diff --git a/TypeScript/10ScopesAndTypes/types/generators/BotLootGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/BotLootGenerator.d.ts index e937a4d..7a4c521 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/BotLootGenerator.d.ts @@ -83,7 +83,7 @@ export declare class BotLootGenerator { * @param equipmentSlot slot to place the preset in (backpack) * @param templateInventory bots template, assault.json * @param modChances chances for mods to spawn on weapon - * @param botRole bots role, .e.g. pmcBot + * @param botRole bots role .e.g. pmcBot * @param isPmc are we generating for a pmc */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; @@ -120,16 +120,16 @@ export declare class BotLootGenerator { protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; /** * Randomise the stack size of a money object, uses different values for pmc or scavs - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param moneyItem Money stack to randomise + * @param isPmc Is money on a PMC bot + * @param itemTemplate item details from db + * @param moneyItem Money item to randomise */ protected randomiseMoneyStackSize(isPmc: boolean, itemTemplate: ITemplateItem, moneyItem: Item): void; /** * Randomise the size of an ammo stack - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param ammoItem Ammo stack to randomise + * @param isPmc Is ammo on a PMC bot + * @param itemTemplate item details from db + * @param ammoItem Ammo item to randomise */ protected randomiseAmmoStackSize(isPmc: boolean, itemTemplate: ITemplateItem, ammoItem: Item): void; /** diff --git a/TypeScript/10ScopesAndTypes/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/RepeatableQuestGenerator.d.ts index 40a3c16..44c38be 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/RepeatableQuestGenerator.d.ts @@ -8,7 +8,7 @@ import { Exit } from "@spt-aki/models/eft/common/ILocationBase"; import { TraderInfo } from "@spt-aki/models/eft/common/tables/IBotBase"; import { ICompletion, ICompletionAvailableFor, IElimination, IEliminationCondition, IExploration, IExplorationCondition, IPickup, IRepeatableQuest, IReward, IRewards } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; -import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; @@ -155,7 +155,7 @@ export declare class RepeatableQuestGenerator { * @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ - protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig): IRewards; + protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IRewards; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config diff --git a/TypeScript/10ScopesAndTypes/types/helpers/HideoutHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/HideoutHelper.d.ts index 93f8fb1..0cfc649 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/HideoutHelper.d.ts @@ -1,7 +1,7 @@ import { InventoryHelper } from "@spt-aki/helpers/InventoryHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { Common, HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "@spt-aki/models/eft/hideout/IHideoutContinuousProductionStartRequestData"; @@ -201,22 +201,10 @@ export declare class HideoutHelper { * @returns coin slot count */ protected getBTCSlots(pmcData: IPmcData): number; - /** - * Does profile have elite hideout management skill - * @param pmcData Profile to look at - * @returns True if profile has skill - */ - protected hasEliteHideoutManagementSkill(pmcData: IPmcData): boolean; /** * Get a count of bitcoins player miner can hold */ protected getBitcoinMinerContainerSlotSize(): number; - /** - * Get the hideout management skill from player profile - * @param pmcData Profile to look at - * @returns Hideout management skill object - */ - protected getHideoutManagementSkill(pmcData: IPmcData): Common; /** * HideoutManagement skill gives a consumption bonus the higher the level * 0.5% per level per 1-51, (25.5% at max) diff --git a/TypeScript/10ScopesAndTypes/types/helpers/ItemHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/ItemHelper.d.ts index 47823bc..e1c7720 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/ItemHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/ItemHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -24,10 +25,11 @@ declare class ItemHelper { protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; + protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl diff --git a/TypeScript/10ScopesAndTypes/types/helpers/ProfileHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/ProfileHelper.d.ts index 781f980..938c796 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/ProfileHelper.d.ts @@ -1,11 +1,13 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IValidateNicknameRequestData } from "@spt-aki/models/eft/profile/IValidateNicknameRequestData"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; +import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileSnapshotService } from "@spt-aki/services/ProfileSnapshotService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -19,7 +21,8 @@ export declare class ProfileHelper { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected profileSnapshotService: ProfileSnapshotService; - constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); + protected localisationService: LocalisationService; + constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, localisationService: LocalisationService); /** * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id @@ -101,4 +104,21 @@ export declare class ProfileHelper { * @param keyToIncrement Key */ incrementStatCounter(counters: CounterKeyValue[], keyToIncrement: string): void; + /** + * Check if player has a skill at elite level + * @param skillType Skill to check + * @param pmcProfile Profile to find skill in + * @returns True if player has skill at elite level + */ + hasEliteSkillLevel(skillType: SkillTypes, pmcProfile: IPmcData): boolean; + /** + * Add points to a specific skill in player profile + * @param skill Skill to add points to + * @param pointsToAdd Points to add + * @param pmcProfile Player profile with skill + * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code + * @returns + */ + addSkillPointsToPlayer(pmcProfile: IPmcData, skill: SkillTypes, pointsToAdd: number, useSkillProgressRateMultipler?: boolean): void; + getSkillFromProfile(pmcData: IPmcData, skill: SkillTypes): Common; } diff --git a/TypeScript/10ScopesAndTypes/types/helpers/QuestHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/QuestHelper.d.ts index 1e40e53..0dda05b 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/QuestHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/QuestHelper.d.ts @@ -6,7 +6,7 @@ import { QuestConditionHelper } from "@spt-aki/helpers/QuestConditionHelper"; import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "@spt-aki/models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; @@ -66,14 +66,12 @@ export declare class QuestHelper { */ getDeltaQuests(before: IQuest[], after: IQuest[]): IQuest[]; /** - * Increase skill points of a skill on player profile - * Dupe of PlayerService.incrementSkillLevel() - * @param sessionID Session id - * @param pmcData Player profile - * @param skillName Name of skill to increase skill points of - * @param progressAmount Amount of skill points to add to skill + * Adjust skill experience for low skill levels, mimicing the official client + * @param profileSkill the skill experience is being added to + * @param progressAmount the amount of experience being added to the skill + * @returns the adjusted skill progress gain */ - rewardSkillPoints(sessionID: string, pmcData: IPmcData, skillName: string, progressAmount: number): void; + adjustSkillExpForLowLevels(profileSkill: Common, progressAmount: number): number; /** * Get quest name by quest id * @param questId id to get diff --git a/TypeScript/10ScopesAndTypes/types/loaders/PreAkiModLoader.d.ts b/TypeScript/10ScopesAndTypes/types/loaders/PreAkiModLoader.d.ts index 869dfbb..71fd745 100644 --- a/TypeScript/10ScopesAndTypes/types/loaders/PreAkiModLoader.d.ts +++ b/TypeScript/10ScopesAndTypes/types/loaders/PreAkiModLoader.d.ts @@ -29,7 +29,7 @@ export declare class PreAkiModLoader implements IModLoader { protected imported: Record; protected akiConfig: ICoreConfig; protected serverDependencies: Record; - protected skippedMods: string[]; + protected skippedMods: Set; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, bundleLoader: BundleLoader, localisationService: LocalisationService, configServer: ConfigServer, modLoadOrder: ModLoadOrder, modTypeCheck: ModTypeCheck); load(container: DependencyContainer): Promise; /** @@ -44,27 +44,22 @@ export declare class PreAkiModLoader implements IModLoader { 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 + * @param modPackageData map of mod package.json data */ - protected checkForDuplicateMods(modPackageData: Record): void; + protected checkForDuplicateMods(modPackageData: Map): void; /** - * Check for and return duplicate strings inside an array - * @param stringArray Array to check for duplicates - * @returns string array of duplicates, empty if none found - */ - protected getDuplicates(stringArray: string[]): string[]; - /** - * Get an array of mods with errors that prevent them from working with SPT + * Returns an array of valid mods. + * * @param mods mods to validate - * @returns Mod names as array + * @returns array of mod folder names */ - protected getBrokenMods(mods: string[]): string[]; + protected getValidMods(mods: string[]): string[]; /** * Get packageJson data for mods * @param mods mods to get packageJson for - * @returns dictionary + * @returns map */ - protected getModsPackageData(mods: string[]): Record; + protected getModsPackageData(mods: string[]): Map; /** * Is the passed in mod compatible with the running server version * @param mod Mod to check compatibiltiy with AKI @@ -86,10 +81,17 @@ export declare class PreAkiModLoader implements IModLoader { * Compile mod and add into class property "imported" * @param mod Name of mod to compile/add */ - protected addModAsync(mod: string): Promise; + protected addModAsync(mod: string, pkg: IPackageJsonData): Promise; + /** + * Checks if a given mod should be loaded or skipped. + * + * @param pkg mod package.json data + * @returns + */ + protected shouldSkipMod(pkg: IPackageJsonData): boolean; protected autoInstallDependencies(modPath: string, pkg: IPackageJsonData): void; - protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Record): boolean; - protected isModCompatible(mod: IPackageJsonData, loadedMods: Record): boolean; + protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Map): boolean; + protected isModCompatible(mod: IPackageJsonData, loadedMods: Map): boolean; /** * Validate a mod passes a number of checks * @param modName name of mod in /mods/ to validate diff --git a/TypeScript/10ScopesAndTypes/types/models/enums/SkillTypes.d.ts b/TypeScript/10ScopesAndTypes/types/models/enums/SkillTypes.d.ts index 4eb90af..dc059a8 100644 --- a/TypeScript/10ScopesAndTypes/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/enums/SkillTypes.d.ts @@ -1,4 +1,6 @@ export declare enum SkillTypes { + BOT_RELOAD = "BotReload", + BOT_SOUND = "BotSound", HIDEOUT_MANAGEMENT = "HideoutManagement", CRAFTING = "Crafting", METABOLISM = "Metabolism", @@ -19,6 +21,7 @@ export declare enum SkillTypes { ATTENTION = "Attention", CHARISMA = "Charisma", MEMORY = "Memory", + MELEE = "Melee", SURGERY = "Surgery", AIM_DRILLS = "AimDrills", TROUBLESHOOTING = "TroubleShooting", @@ -31,6 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", + /** Also called Weapon Maintenance*/ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts index c76eda7..24c8c19 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts @@ -102,6 +102,8 @@ export interface EquipmentFilters { weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; /** Same as weightingAdjustments but based on player level instead of bot level */ weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; + /** Should the stock mod be forced to spawn on bot */ + forceStock: boolean; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IQuestConfig.d.ts index 3e3b2be..8a71eb9 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IQuestConfig.d.ts @@ -55,6 +55,8 @@ export interface IRewardScaling { items: number[]; reputation: number[]; rewardSpread: number; + skillRewardChance: number[]; + skillPointReward: number[]; } export interface ITraderWhitelist { traderId: string; @@ -66,7 +68,7 @@ export interface IRepeatableQuestTypesConfig { Pickup: IPickup; Elimination: IEliminationConfig[]; } -export interface IExploration { +export interface IExploration extends IBaseQuestConfig { maxExtracts: number; specificExits: ISpecificExits; } @@ -74,7 +76,7 @@ export interface ISpecificExits { probability: number; passageRequirementWhitelist: string[]; } -export interface ICompletion { +export interface ICompletion extends IBaseQuestConfig { minRequestedAmount: number; maxRequestedAmount: number; minRequestedBulletAmount: number; @@ -82,7 +84,7 @@ export interface ICompletion { useWhitelist: boolean; useBlacklist: boolean; } -export interface IPickup { +export interface IPickup extends IBaseQuestConfig { ItemTypeToFetchWithMaxCount: IPickupTypeWithMaxCount[]; } export interface IPickupTypeWithMaxCount { @@ -90,7 +92,7 @@ export interface IPickupTypeWithMaxCount { maxPickupCount: number; minPickupCount: number; } -export interface IEliminationConfig { +export interface IEliminationConfig extends IBaseQuestConfig { levelRange: MinMax; targets: ITarget[]; bodyPartProb: number; @@ -111,6 +113,9 @@ export interface IEliminationConfig { weaponRequirementProb: number; weaponRequirements: IWeaponRequirement[]; } +export interface IBaseQuestConfig { + possibleSkillRewards: string[]; +} export interface ITarget extends IProbabilityObject { data: IBossInfo; } diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IRepairConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IRepairConfig.d.ts index 1ae082d..9e23cc4 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IRepairConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IRepairConfig.d.ts @@ -9,6 +9,7 @@ export interface IRepairConfig extends IBaseConfig { /** INT gain multiplier per repaired item type */ repairKitIntellectGainMultiplier: IIntellectGainValues; maxIntellectGainPerRepair: IMaxIntellectGainValues; + weaponTreatment: IWeaponTreatmentRepairValues; repairKit: RepairKit; } export interface IIntellectGainValues { @@ -19,6 +20,16 @@ export interface IMaxIntellectGainValues { kit: number; trader: number; } +export interface IWeaponTreatmentRepairValues { + /** The chance to gain more weapon maintenance skill */ + critSuccessChance: number; + critSuccessAmount: number; + /** The chance to gain less weapon maintenance skill */ + critFailureChance: number; + critFailureAmount: number; + /** The multiplier used for calculating weapon maintenance XP */ + pointGainMultiplier: number; +} export interface RepairKit { armor: BonusSettings; weapon: BonusSettings; diff --git a/TypeScript/10ScopesAndTypes/types/services/PlayerService.d.ts b/TypeScript/10ScopesAndTypes/types/services/PlayerService.d.ts index edf269e..f24e0dc 100644 --- a/TypeScript/10ScopesAndTypes/types/services/PlayerService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/PlayerService.d.ts @@ -9,15 +9,6 @@ export declare class PlayerService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, databaseServer: DatabaseServer); - /** - * Dupe of QuestHelper.rewardsSkillPoints() - * Add xp to a player skill - * @param pmcData Player profile - * @param skillName Name of skill to increment - * @param amount Amount of skill points to add to skill - * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code - */ - incrementSkillLevel(pmcData: IPmcData, skillName: string, amount: number, useSkillProgressRateMultipler?: boolean): void; /** * Get level of player * @param pmcData Player profile diff --git a/TypeScript/10ScopesAndTypes/types/services/RepairService.d.ts b/TypeScript/10ScopesAndTypes/types/services/RepairService.d.ts index b8ffbaa..8f9e7e9 100644 --- a/TypeScript/10ScopesAndTypes/types/services/RepairService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/RepairService.d.ts @@ -1,5 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { QuestHelper } from "@spt-aki/helpers/QuestHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { RepairHelper } from "@spt-aki/helpers/RepairHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; @@ -9,6 +9,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { RepairKitsInfo } from "@spt-aki/models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "@spt-aki/models/eft/repair/ITraderRepairActionDataRequest"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { BonusSettings, IRepairConfig } from "@spt-aki/models/spt/config/IRepairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -19,7 +20,7 @@ import { RandomUtil } from "@spt-aki/utils/RandomUtil"; export declare class RepairService { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected questHelper: QuestHelper; + protected profileHelper: ProfileHelper; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; @@ -29,7 +30,7 @@ export declare class RepairService { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id @@ -56,6 +57,12 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + /** + * Return an appromixation of the amount of skill points live would return for the given repairDetails + * @param repairDetails the repair details to calculate skill points for + * @returns the number of skill points to reward the user + */ + protected getWeaponRepairSkillPoints(repairDetails: RepairDetails): number; /** * * @param sessionId Session id @@ -81,6 +88,13 @@ export declare class RepairService { * @returns Multiplier value */ protected getBonusMultiplierValue(skillBonusName: string, pmcData: IPmcData): number; + /** + * Should a repair kit apply total durability loss on repair + * @param pmcData Player profile + * @param applyRandomizeDurabilityLoss Value from repair config + * @returns True if loss should be applied + */ + protected shouldRepairKitApplyDurabilityLoss(pmcData: IPmcData, applyRandomizeDurabilityLoss: boolean): boolean; /** * Update repair kits Resource object if it doesn't exist * @param repairKitDetails Repair kit details from db @@ -112,7 +126,7 @@ export declare class RepairService { * @param itemTemplate Item to check for skill * @returns Skill name */ - protected getItemSkillType(itemTemplate: ITemplateItem): string; + protected getItemSkillType(itemTemplate: ITemplateItem): SkillTypes; /** * Ensure multiplier is between 1 and 0.01 * @param receiveDurabilityMaxPercent Max durabiltiy percent @@ -123,6 +137,7 @@ export declare class RepairService { } export declare class RepairDetails { repairCost?: number; + repairPoints?: number; repairedItem: Item; repairedItemIsArmor: boolean; repairAmount: number; diff --git a/TypeScript/10ScopesAndTypes/types/utils/App.d.ts b/TypeScript/10ScopesAndTypes/types/utils/App.d.ts index 1839695..64800ce 100644 --- a/TypeScript/10ScopesAndTypes/types/utils/App.d.ts +++ b/TypeScript/10ScopesAndTypes/types/utils/App.d.ts @@ -1,6 +1,8 @@ import { OnLoad } from "@spt-aki/di/OnLoad"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -8,11 +10,13 @@ export declare class App { protected logger: ILogger; protected timeUtil: TimeUtil; protected localisationService: LocalisationService; + protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/11BundleLoadingSample/types/controllers/GameController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/GameController.d.ts index 640a8c1..168071d 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/GameController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/GameController.d.ts @@ -61,6 +61,10 @@ export declare class GameController { * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + /** + * Out of date/incorrectly made trader mods forget this data + */ + protected checkTraderRepairValuesExist(): void; protected addCustomLooseLootPositions(): void; protected adjustLooseLootSpawnProbabilities(): void; protected setHideoutAreasAndCraftsTo40Secs(): void; diff --git a/TypeScript/11BundleLoadingSample/types/controllers/InsuranceController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/InsuranceController.d.ts index b1e8fe6..0ee30ed 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/InsuranceController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/InsuranceController.d.ts @@ -8,7 +8,7 @@ import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGet import { IGetInsuranceCostResponseData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostResponseData"; import { IInsureRequestData } from "@spt-aki/models/eft/insurance/IInsureRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; -import { Insurance, ISystemData } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ISystemData, Insurance } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IInsuranceConfig } from "@spt-aki/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; diff --git a/TypeScript/11BundleLoadingSample/types/controllers/RepeatableQuestController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/RepeatableQuestController.d.ts index b09b540..a3ebc1c 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/RepeatableQuestController.d.ts @@ -13,6 +13,7 @@ import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -21,8 +22,9 @@ import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RepeatableQuestController { - protected timeUtil: TimeUtil; protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; @@ -37,7 +39,7 @@ export declare class RepeatableQuestController { protected questHelper: QuestHelper; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. @@ -64,6 +66,13 @@ export declare class RepeatableQuestController { * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Get the number of quests to generate - takes into account charisma state of player + * @param repeatableConfig Config + * @param pmcData Player profile + * @returns Quest count + */ + protected getQuestCount(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): number; /** * Get repeatable quest data from profile from name (daily/weekly), creates base repeatable quest object if none exists * @param repeatableConfig daily/weekly config diff --git a/TypeScript/11BundleLoadingSample/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/BotEquipmentModGenerator.d.ts index 05266dd..75530c7 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/BotEquipmentModGenerator.d.ts @@ -179,7 +179,7 @@ export declare class BotEquipmentModGenerator { * Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots. * This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine" * @param items The items where the CylinderMagazine's camora are appended to - * @param modPool modPool which should include available cartrigdes + * @param modPool modPool which should include available cartridges * @param parentId The CylinderMagazine's UID * @param parentTemplate The CylinderMagazine's template */ diff --git a/TypeScript/11BundleLoadingSample/types/generators/BotLootGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/BotLootGenerator.d.ts index e937a4d..7a4c521 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/BotLootGenerator.d.ts @@ -83,7 +83,7 @@ export declare class BotLootGenerator { * @param equipmentSlot slot to place the preset in (backpack) * @param templateInventory bots template, assault.json * @param modChances chances for mods to spawn on weapon - * @param botRole bots role, .e.g. pmcBot + * @param botRole bots role .e.g. pmcBot * @param isPmc are we generating for a pmc */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; @@ -120,16 +120,16 @@ export declare class BotLootGenerator { protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; /** * Randomise the stack size of a money object, uses different values for pmc or scavs - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param moneyItem Money stack to randomise + * @param isPmc Is money on a PMC bot + * @param itemTemplate item details from db + * @param moneyItem Money item to randomise */ protected randomiseMoneyStackSize(isPmc: boolean, itemTemplate: ITemplateItem, moneyItem: Item): void; /** * Randomise the size of an ammo stack - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param ammoItem Ammo stack to randomise + * @param isPmc Is ammo on a PMC bot + * @param itemTemplate item details from db + * @param ammoItem Ammo item to randomise */ protected randomiseAmmoStackSize(isPmc: boolean, itemTemplate: ITemplateItem, ammoItem: Item): void; /** diff --git a/TypeScript/11BundleLoadingSample/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/RepeatableQuestGenerator.d.ts index 40a3c16..44c38be 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/RepeatableQuestGenerator.d.ts @@ -8,7 +8,7 @@ import { Exit } from "@spt-aki/models/eft/common/ILocationBase"; import { TraderInfo } from "@spt-aki/models/eft/common/tables/IBotBase"; import { ICompletion, ICompletionAvailableFor, IElimination, IEliminationCondition, IExploration, IExplorationCondition, IPickup, IRepeatableQuest, IReward, IRewards } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; -import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; @@ -155,7 +155,7 @@ export declare class RepeatableQuestGenerator { * @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ - protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig): IRewards; + protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IRewards; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config diff --git a/TypeScript/11BundleLoadingSample/types/helpers/HideoutHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/HideoutHelper.d.ts index 93f8fb1..0cfc649 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/HideoutHelper.d.ts @@ -1,7 +1,7 @@ import { InventoryHelper } from "@spt-aki/helpers/InventoryHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { Common, HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "@spt-aki/models/eft/hideout/IHideoutContinuousProductionStartRequestData"; @@ -201,22 +201,10 @@ export declare class HideoutHelper { * @returns coin slot count */ protected getBTCSlots(pmcData: IPmcData): number; - /** - * Does profile have elite hideout management skill - * @param pmcData Profile to look at - * @returns True if profile has skill - */ - protected hasEliteHideoutManagementSkill(pmcData: IPmcData): boolean; /** * Get a count of bitcoins player miner can hold */ protected getBitcoinMinerContainerSlotSize(): number; - /** - * Get the hideout management skill from player profile - * @param pmcData Profile to look at - * @returns Hideout management skill object - */ - protected getHideoutManagementSkill(pmcData: IPmcData): Common; /** * HideoutManagement skill gives a consumption bonus the higher the level * 0.5% per level per 1-51, (25.5% at max) diff --git a/TypeScript/11BundleLoadingSample/types/helpers/ItemHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/ItemHelper.d.ts index 47823bc..e1c7720 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/ItemHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/ItemHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -24,10 +25,11 @@ declare class ItemHelper { protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; + protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl diff --git a/TypeScript/11BundleLoadingSample/types/helpers/ProfileHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/ProfileHelper.d.ts index 781f980..938c796 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/ProfileHelper.d.ts @@ -1,11 +1,13 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IValidateNicknameRequestData } from "@spt-aki/models/eft/profile/IValidateNicknameRequestData"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; +import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileSnapshotService } from "@spt-aki/services/ProfileSnapshotService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -19,7 +21,8 @@ export declare class ProfileHelper { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected profileSnapshotService: ProfileSnapshotService; - constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); + protected localisationService: LocalisationService; + constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, localisationService: LocalisationService); /** * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id @@ -101,4 +104,21 @@ export declare class ProfileHelper { * @param keyToIncrement Key */ incrementStatCounter(counters: CounterKeyValue[], keyToIncrement: string): void; + /** + * Check if player has a skill at elite level + * @param skillType Skill to check + * @param pmcProfile Profile to find skill in + * @returns True if player has skill at elite level + */ + hasEliteSkillLevel(skillType: SkillTypes, pmcProfile: IPmcData): boolean; + /** + * Add points to a specific skill in player profile + * @param skill Skill to add points to + * @param pointsToAdd Points to add + * @param pmcProfile Player profile with skill + * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code + * @returns + */ + addSkillPointsToPlayer(pmcProfile: IPmcData, skill: SkillTypes, pointsToAdd: number, useSkillProgressRateMultipler?: boolean): void; + getSkillFromProfile(pmcData: IPmcData, skill: SkillTypes): Common; } diff --git a/TypeScript/11BundleLoadingSample/types/helpers/QuestHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/QuestHelper.d.ts index 1e40e53..0dda05b 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/QuestHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/QuestHelper.d.ts @@ -6,7 +6,7 @@ import { QuestConditionHelper } from "@spt-aki/helpers/QuestConditionHelper"; import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "@spt-aki/models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; @@ -66,14 +66,12 @@ export declare class QuestHelper { */ getDeltaQuests(before: IQuest[], after: IQuest[]): IQuest[]; /** - * Increase skill points of a skill on player profile - * Dupe of PlayerService.incrementSkillLevel() - * @param sessionID Session id - * @param pmcData Player profile - * @param skillName Name of skill to increase skill points of - * @param progressAmount Amount of skill points to add to skill + * Adjust skill experience for low skill levels, mimicing the official client + * @param profileSkill the skill experience is being added to + * @param progressAmount the amount of experience being added to the skill + * @returns the adjusted skill progress gain */ - rewardSkillPoints(sessionID: string, pmcData: IPmcData, skillName: string, progressAmount: number): void; + adjustSkillExpForLowLevels(profileSkill: Common, progressAmount: number): number; /** * Get quest name by quest id * @param questId id to get diff --git a/TypeScript/11BundleLoadingSample/types/loaders/PreAkiModLoader.d.ts b/TypeScript/11BundleLoadingSample/types/loaders/PreAkiModLoader.d.ts index 869dfbb..71fd745 100644 --- a/TypeScript/11BundleLoadingSample/types/loaders/PreAkiModLoader.d.ts +++ b/TypeScript/11BundleLoadingSample/types/loaders/PreAkiModLoader.d.ts @@ -29,7 +29,7 @@ export declare class PreAkiModLoader implements IModLoader { protected imported: Record; protected akiConfig: ICoreConfig; protected serverDependencies: Record; - protected skippedMods: string[]; + protected skippedMods: Set; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, bundleLoader: BundleLoader, localisationService: LocalisationService, configServer: ConfigServer, modLoadOrder: ModLoadOrder, modTypeCheck: ModTypeCheck); load(container: DependencyContainer): Promise; /** @@ -44,27 +44,22 @@ export declare class PreAkiModLoader implements IModLoader { 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 + * @param modPackageData map of mod package.json data */ - protected checkForDuplicateMods(modPackageData: Record): void; + protected checkForDuplicateMods(modPackageData: Map): void; /** - * Check for and return duplicate strings inside an array - * @param stringArray Array to check for duplicates - * @returns string array of duplicates, empty if none found - */ - protected getDuplicates(stringArray: string[]): string[]; - /** - * Get an array of mods with errors that prevent them from working with SPT + * Returns an array of valid mods. + * * @param mods mods to validate - * @returns Mod names as array + * @returns array of mod folder names */ - protected getBrokenMods(mods: string[]): string[]; + protected getValidMods(mods: string[]): string[]; /** * Get packageJson data for mods * @param mods mods to get packageJson for - * @returns dictionary + * @returns map */ - protected getModsPackageData(mods: string[]): Record; + protected getModsPackageData(mods: string[]): Map; /** * Is the passed in mod compatible with the running server version * @param mod Mod to check compatibiltiy with AKI @@ -86,10 +81,17 @@ export declare class PreAkiModLoader implements IModLoader { * Compile mod and add into class property "imported" * @param mod Name of mod to compile/add */ - protected addModAsync(mod: string): Promise; + protected addModAsync(mod: string, pkg: IPackageJsonData): Promise; + /** + * Checks if a given mod should be loaded or skipped. + * + * @param pkg mod package.json data + * @returns + */ + protected shouldSkipMod(pkg: IPackageJsonData): boolean; protected autoInstallDependencies(modPath: string, pkg: IPackageJsonData): void; - protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Record): boolean; - protected isModCompatible(mod: IPackageJsonData, loadedMods: Record): boolean; + protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Map): boolean; + protected isModCompatible(mod: IPackageJsonData, loadedMods: Map): boolean; /** * Validate a mod passes a number of checks * @param modName name of mod in /mods/ to validate diff --git a/TypeScript/11BundleLoadingSample/types/models/enums/SkillTypes.d.ts b/TypeScript/11BundleLoadingSample/types/models/enums/SkillTypes.d.ts index 4eb90af..dc059a8 100644 --- a/TypeScript/11BundleLoadingSample/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/enums/SkillTypes.d.ts @@ -1,4 +1,6 @@ export declare enum SkillTypes { + BOT_RELOAD = "BotReload", + BOT_SOUND = "BotSound", HIDEOUT_MANAGEMENT = "HideoutManagement", CRAFTING = "Crafting", METABOLISM = "Metabolism", @@ -19,6 +21,7 @@ export declare enum SkillTypes { ATTENTION = "Attention", CHARISMA = "Charisma", MEMORY = "Memory", + MELEE = "Melee", SURGERY = "Surgery", AIM_DRILLS = "AimDrills", TROUBLESHOOTING = "TroubleShooting", @@ -31,6 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", + /** Also called Weapon Maintenance*/ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts index c76eda7..24c8c19 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts @@ -102,6 +102,8 @@ export interface EquipmentFilters { weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; /** Same as weightingAdjustments but based on player level instead of bot level */ weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; + /** Should the stock mod be forced to spawn on bot */ + forceStock: boolean; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/IQuestConfig.d.ts index 3e3b2be..8a71eb9 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/IQuestConfig.d.ts @@ -55,6 +55,8 @@ export interface IRewardScaling { items: number[]; reputation: number[]; rewardSpread: number; + skillRewardChance: number[]; + skillPointReward: number[]; } export interface ITraderWhitelist { traderId: string; @@ -66,7 +68,7 @@ export interface IRepeatableQuestTypesConfig { Pickup: IPickup; Elimination: IEliminationConfig[]; } -export interface IExploration { +export interface IExploration extends IBaseQuestConfig { maxExtracts: number; specificExits: ISpecificExits; } @@ -74,7 +76,7 @@ export interface ISpecificExits { probability: number; passageRequirementWhitelist: string[]; } -export interface ICompletion { +export interface ICompletion extends IBaseQuestConfig { minRequestedAmount: number; maxRequestedAmount: number; minRequestedBulletAmount: number; @@ -82,7 +84,7 @@ export interface ICompletion { useWhitelist: boolean; useBlacklist: boolean; } -export interface IPickup { +export interface IPickup extends IBaseQuestConfig { ItemTypeToFetchWithMaxCount: IPickupTypeWithMaxCount[]; } export interface IPickupTypeWithMaxCount { @@ -90,7 +92,7 @@ export interface IPickupTypeWithMaxCount { maxPickupCount: number; minPickupCount: number; } -export interface IEliminationConfig { +export interface IEliminationConfig extends IBaseQuestConfig { levelRange: MinMax; targets: ITarget[]; bodyPartProb: number; @@ -111,6 +113,9 @@ export interface IEliminationConfig { weaponRequirementProb: number; weaponRequirements: IWeaponRequirement[]; } +export interface IBaseQuestConfig { + possibleSkillRewards: string[]; +} export interface ITarget extends IProbabilityObject { data: IBossInfo; } diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/IRepairConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/IRepairConfig.d.ts index 1ae082d..9e23cc4 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/IRepairConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/IRepairConfig.d.ts @@ -9,6 +9,7 @@ export interface IRepairConfig extends IBaseConfig { /** INT gain multiplier per repaired item type */ repairKitIntellectGainMultiplier: IIntellectGainValues; maxIntellectGainPerRepair: IMaxIntellectGainValues; + weaponTreatment: IWeaponTreatmentRepairValues; repairKit: RepairKit; } export interface IIntellectGainValues { @@ -19,6 +20,16 @@ export interface IMaxIntellectGainValues { kit: number; trader: number; } +export interface IWeaponTreatmentRepairValues { + /** The chance to gain more weapon maintenance skill */ + critSuccessChance: number; + critSuccessAmount: number; + /** The chance to gain less weapon maintenance skill */ + critFailureChance: number; + critFailureAmount: number; + /** The multiplier used for calculating weapon maintenance XP */ + pointGainMultiplier: number; +} export interface RepairKit { armor: BonusSettings; weapon: BonusSettings; diff --git a/TypeScript/11BundleLoadingSample/types/services/PlayerService.d.ts b/TypeScript/11BundleLoadingSample/types/services/PlayerService.d.ts index edf269e..f24e0dc 100644 --- a/TypeScript/11BundleLoadingSample/types/services/PlayerService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/PlayerService.d.ts @@ -9,15 +9,6 @@ export declare class PlayerService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, databaseServer: DatabaseServer); - /** - * Dupe of QuestHelper.rewardsSkillPoints() - * Add xp to a player skill - * @param pmcData Player profile - * @param skillName Name of skill to increment - * @param amount Amount of skill points to add to skill - * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code - */ - incrementSkillLevel(pmcData: IPmcData, skillName: string, amount: number, useSkillProgressRateMultipler?: boolean): void; /** * Get level of player * @param pmcData Player profile diff --git a/TypeScript/11BundleLoadingSample/types/services/RepairService.d.ts b/TypeScript/11BundleLoadingSample/types/services/RepairService.d.ts index b8ffbaa..8f9e7e9 100644 --- a/TypeScript/11BundleLoadingSample/types/services/RepairService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/RepairService.d.ts @@ -1,5 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { QuestHelper } from "@spt-aki/helpers/QuestHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { RepairHelper } from "@spt-aki/helpers/RepairHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; @@ -9,6 +9,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { RepairKitsInfo } from "@spt-aki/models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "@spt-aki/models/eft/repair/ITraderRepairActionDataRequest"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { BonusSettings, IRepairConfig } from "@spt-aki/models/spt/config/IRepairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -19,7 +20,7 @@ import { RandomUtil } from "@spt-aki/utils/RandomUtil"; export declare class RepairService { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected questHelper: QuestHelper; + protected profileHelper: ProfileHelper; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; @@ -29,7 +30,7 @@ export declare class RepairService { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id @@ -56,6 +57,12 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + /** + * Return an appromixation of the amount of skill points live would return for the given repairDetails + * @param repairDetails the repair details to calculate skill points for + * @returns the number of skill points to reward the user + */ + protected getWeaponRepairSkillPoints(repairDetails: RepairDetails): number; /** * * @param sessionId Session id @@ -81,6 +88,13 @@ export declare class RepairService { * @returns Multiplier value */ protected getBonusMultiplierValue(skillBonusName: string, pmcData: IPmcData): number; + /** + * Should a repair kit apply total durability loss on repair + * @param pmcData Player profile + * @param applyRandomizeDurabilityLoss Value from repair config + * @returns True if loss should be applied + */ + protected shouldRepairKitApplyDurabilityLoss(pmcData: IPmcData, applyRandomizeDurabilityLoss: boolean): boolean; /** * Update repair kits Resource object if it doesn't exist * @param repairKitDetails Repair kit details from db @@ -112,7 +126,7 @@ export declare class RepairService { * @param itemTemplate Item to check for skill * @returns Skill name */ - protected getItemSkillType(itemTemplate: ITemplateItem): string; + protected getItemSkillType(itemTemplate: ITemplateItem): SkillTypes; /** * Ensure multiplier is between 1 and 0.01 * @param receiveDurabilityMaxPercent Max durabiltiy percent @@ -123,6 +137,7 @@ export declare class RepairService { } export declare class RepairDetails { repairCost?: number; + repairPoints?: number; repairedItem: Item; repairedItemIsArmor: boolean; repairAmount: number; diff --git a/TypeScript/11BundleLoadingSample/types/utils/App.d.ts b/TypeScript/11BundleLoadingSample/types/utils/App.d.ts index 1839695..64800ce 100644 --- a/TypeScript/11BundleLoadingSample/types/utils/App.d.ts +++ b/TypeScript/11BundleLoadingSample/types/utils/App.d.ts @@ -1,6 +1,8 @@ import { OnLoad } from "@spt-aki/di/OnLoad"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -8,11 +10,13 @@ export declare class App { protected logger: ILogger; protected timeUtil: TimeUtil; protected localisationService: LocalisationService; + protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/GameController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/GameController.d.ts index 640a8c1..168071d 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/GameController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/GameController.d.ts @@ -61,6 +61,10 @@ export declare class GameController { * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + /** + * Out of date/incorrectly made trader mods forget this data + */ + protected checkTraderRepairValuesExist(): void; protected addCustomLooseLootPositions(): void; protected adjustLooseLootSpawnProbabilities(): void; protected setHideoutAreasAndCraftsTo40Secs(): void; diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/InsuranceController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/InsuranceController.d.ts index b1e8fe6..0ee30ed 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/InsuranceController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/InsuranceController.d.ts @@ -8,7 +8,7 @@ import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGet import { IGetInsuranceCostResponseData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostResponseData"; import { IInsureRequestData } from "@spt-aki/models/eft/insurance/IInsureRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; -import { Insurance, ISystemData } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ISystemData, Insurance } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IInsuranceConfig } from "@spt-aki/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/RepeatableQuestController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/RepeatableQuestController.d.ts index b09b540..a3ebc1c 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/RepeatableQuestController.d.ts @@ -13,6 +13,7 @@ import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -21,8 +22,9 @@ import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RepeatableQuestController { - protected timeUtil: TimeUtil; protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; @@ -37,7 +39,7 @@ export declare class RepeatableQuestController { protected questHelper: QuestHelper; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. @@ -64,6 +66,13 @@ export declare class RepeatableQuestController { * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Get the number of quests to generate - takes into account charisma state of player + * @param repeatableConfig Config + * @param pmcData Player profile + * @returns Quest count + */ + protected getQuestCount(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): number; /** * Get repeatable quest data from profile from name (daily/weekly), creates base repeatable quest object if none exists * @param repeatableConfig daily/weekly config diff --git a/TypeScript/12ClassExtensionOverride/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/BotEquipmentModGenerator.d.ts index 05266dd..75530c7 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/BotEquipmentModGenerator.d.ts @@ -179,7 +179,7 @@ export declare class BotEquipmentModGenerator { * Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots. * This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine" * @param items The items where the CylinderMagazine's camora are appended to - * @param modPool modPool which should include available cartrigdes + * @param modPool modPool which should include available cartridges * @param parentId The CylinderMagazine's UID * @param parentTemplate The CylinderMagazine's template */ diff --git a/TypeScript/12ClassExtensionOverride/types/generators/BotLootGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/BotLootGenerator.d.ts index e937a4d..7a4c521 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/BotLootGenerator.d.ts @@ -83,7 +83,7 @@ export declare class BotLootGenerator { * @param equipmentSlot slot to place the preset in (backpack) * @param templateInventory bots template, assault.json * @param modChances chances for mods to spawn on weapon - * @param botRole bots role, .e.g. pmcBot + * @param botRole bots role .e.g. pmcBot * @param isPmc are we generating for a pmc */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; @@ -120,16 +120,16 @@ export declare class BotLootGenerator { protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; /** * Randomise the stack size of a money object, uses different values for pmc or scavs - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param moneyItem Money stack to randomise + * @param isPmc Is money on a PMC bot + * @param itemTemplate item details from db + * @param moneyItem Money item to randomise */ protected randomiseMoneyStackSize(isPmc: boolean, itemTemplate: ITemplateItem, moneyItem: Item): void; /** * Randomise the size of an ammo stack - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param ammoItem Ammo stack to randomise + * @param isPmc Is ammo on a PMC bot + * @param itemTemplate item details from db + * @param ammoItem Ammo item to randomise */ protected randomiseAmmoStackSize(isPmc: boolean, itemTemplate: ITemplateItem, ammoItem: Item): void; /** diff --git a/TypeScript/12ClassExtensionOverride/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/RepeatableQuestGenerator.d.ts index 40a3c16..44c38be 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/RepeatableQuestGenerator.d.ts @@ -8,7 +8,7 @@ import { Exit } from "@spt-aki/models/eft/common/ILocationBase"; import { TraderInfo } from "@spt-aki/models/eft/common/tables/IBotBase"; import { ICompletion, ICompletionAvailableFor, IElimination, IEliminationCondition, IExploration, IExplorationCondition, IPickup, IRepeatableQuest, IReward, IRewards } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; -import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; @@ -155,7 +155,7 @@ export declare class RepeatableQuestGenerator { * @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ - protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig): IRewards; + protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IRewards; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/HideoutHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/HideoutHelper.d.ts index 93f8fb1..0cfc649 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/HideoutHelper.d.ts @@ -1,7 +1,7 @@ import { InventoryHelper } from "@spt-aki/helpers/InventoryHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { Common, HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "@spt-aki/models/eft/hideout/IHideoutContinuousProductionStartRequestData"; @@ -201,22 +201,10 @@ export declare class HideoutHelper { * @returns coin slot count */ protected getBTCSlots(pmcData: IPmcData): number; - /** - * Does profile have elite hideout management skill - * @param pmcData Profile to look at - * @returns True if profile has skill - */ - protected hasEliteHideoutManagementSkill(pmcData: IPmcData): boolean; /** * Get a count of bitcoins player miner can hold */ protected getBitcoinMinerContainerSlotSize(): number; - /** - * Get the hideout management skill from player profile - * @param pmcData Profile to look at - * @returns Hideout management skill object - */ - protected getHideoutManagementSkill(pmcData: IPmcData): Common; /** * HideoutManagement skill gives a consumption bonus the higher the level * 0.5% per level per 1-51, (25.5% at max) diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/ItemHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/ItemHelper.d.ts index 47823bc..e1c7720 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/ItemHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/ItemHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -24,10 +25,11 @@ declare class ItemHelper { protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; + protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/ProfileHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/ProfileHelper.d.ts index 781f980..938c796 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/ProfileHelper.d.ts @@ -1,11 +1,13 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IValidateNicknameRequestData } from "@spt-aki/models/eft/profile/IValidateNicknameRequestData"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; +import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileSnapshotService } from "@spt-aki/services/ProfileSnapshotService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -19,7 +21,8 @@ export declare class ProfileHelper { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected profileSnapshotService: ProfileSnapshotService; - constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); + protected localisationService: LocalisationService; + constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, localisationService: LocalisationService); /** * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id @@ -101,4 +104,21 @@ export declare class ProfileHelper { * @param keyToIncrement Key */ incrementStatCounter(counters: CounterKeyValue[], keyToIncrement: string): void; + /** + * Check if player has a skill at elite level + * @param skillType Skill to check + * @param pmcProfile Profile to find skill in + * @returns True if player has skill at elite level + */ + hasEliteSkillLevel(skillType: SkillTypes, pmcProfile: IPmcData): boolean; + /** + * Add points to a specific skill in player profile + * @param skill Skill to add points to + * @param pointsToAdd Points to add + * @param pmcProfile Player profile with skill + * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code + * @returns + */ + addSkillPointsToPlayer(pmcProfile: IPmcData, skill: SkillTypes, pointsToAdd: number, useSkillProgressRateMultipler?: boolean): void; + getSkillFromProfile(pmcData: IPmcData, skill: SkillTypes): Common; } diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/QuestHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/QuestHelper.d.ts index 1e40e53..0dda05b 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/QuestHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/QuestHelper.d.ts @@ -6,7 +6,7 @@ import { QuestConditionHelper } from "@spt-aki/helpers/QuestConditionHelper"; import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "@spt-aki/models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; @@ -66,14 +66,12 @@ export declare class QuestHelper { */ getDeltaQuests(before: IQuest[], after: IQuest[]): IQuest[]; /** - * Increase skill points of a skill on player profile - * Dupe of PlayerService.incrementSkillLevel() - * @param sessionID Session id - * @param pmcData Player profile - * @param skillName Name of skill to increase skill points of - * @param progressAmount Amount of skill points to add to skill + * Adjust skill experience for low skill levels, mimicing the official client + * @param profileSkill the skill experience is being added to + * @param progressAmount the amount of experience being added to the skill + * @returns the adjusted skill progress gain */ - rewardSkillPoints(sessionID: string, pmcData: IPmcData, skillName: string, progressAmount: number): void; + adjustSkillExpForLowLevels(profileSkill: Common, progressAmount: number): number; /** * Get quest name by quest id * @param questId id to get diff --git a/TypeScript/12ClassExtensionOverride/types/loaders/PreAkiModLoader.d.ts b/TypeScript/12ClassExtensionOverride/types/loaders/PreAkiModLoader.d.ts index 869dfbb..71fd745 100644 --- a/TypeScript/12ClassExtensionOverride/types/loaders/PreAkiModLoader.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/loaders/PreAkiModLoader.d.ts @@ -29,7 +29,7 @@ export declare class PreAkiModLoader implements IModLoader { protected imported: Record; protected akiConfig: ICoreConfig; protected serverDependencies: Record; - protected skippedMods: string[]; + protected skippedMods: Set; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, bundleLoader: BundleLoader, localisationService: LocalisationService, configServer: ConfigServer, modLoadOrder: ModLoadOrder, modTypeCheck: ModTypeCheck); load(container: DependencyContainer): Promise; /** @@ -44,27 +44,22 @@ export declare class PreAkiModLoader implements IModLoader { 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 + * @param modPackageData map of mod package.json data */ - protected checkForDuplicateMods(modPackageData: Record): void; + protected checkForDuplicateMods(modPackageData: Map): void; /** - * Check for and return duplicate strings inside an array - * @param stringArray Array to check for duplicates - * @returns string array of duplicates, empty if none found - */ - protected getDuplicates(stringArray: string[]): string[]; - /** - * Get an array of mods with errors that prevent them from working with SPT + * Returns an array of valid mods. + * * @param mods mods to validate - * @returns Mod names as array + * @returns array of mod folder names */ - protected getBrokenMods(mods: string[]): string[]; + protected getValidMods(mods: string[]): string[]; /** * Get packageJson data for mods * @param mods mods to get packageJson for - * @returns dictionary + * @returns map */ - protected getModsPackageData(mods: string[]): Record; + protected getModsPackageData(mods: string[]): Map; /** * Is the passed in mod compatible with the running server version * @param mod Mod to check compatibiltiy with AKI @@ -86,10 +81,17 @@ export declare class PreAkiModLoader implements IModLoader { * Compile mod and add into class property "imported" * @param mod Name of mod to compile/add */ - protected addModAsync(mod: string): Promise; + protected addModAsync(mod: string, pkg: IPackageJsonData): Promise; + /** + * Checks if a given mod should be loaded or skipped. + * + * @param pkg mod package.json data + * @returns + */ + protected shouldSkipMod(pkg: IPackageJsonData): boolean; protected autoInstallDependencies(modPath: string, pkg: IPackageJsonData): void; - protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Record): boolean; - protected isModCompatible(mod: IPackageJsonData, loadedMods: Record): boolean; + protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Map): boolean; + protected isModCompatible(mod: IPackageJsonData, loadedMods: Map): boolean; /** * Validate a mod passes a number of checks * @param modName name of mod in /mods/ to validate diff --git a/TypeScript/12ClassExtensionOverride/types/models/enums/SkillTypes.d.ts b/TypeScript/12ClassExtensionOverride/types/models/enums/SkillTypes.d.ts index 4eb90af..dc059a8 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/enums/SkillTypes.d.ts @@ -1,4 +1,6 @@ export declare enum SkillTypes { + BOT_RELOAD = "BotReload", + BOT_SOUND = "BotSound", HIDEOUT_MANAGEMENT = "HideoutManagement", CRAFTING = "Crafting", METABOLISM = "Metabolism", @@ -19,6 +21,7 @@ export declare enum SkillTypes { ATTENTION = "Attention", CHARISMA = "Charisma", MEMORY = "Memory", + MELEE = "Melee", SURGERY = "Surgery", AIM_DRILLS = "AimDrills", TROUBLESHOOTING = "TroubleShooting", @@ -31,6 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", + /** Also called Weapon Maintenance*/ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts index c76eda7..24c8c19 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts @@ -102,6 +102,8 @@ export interface EquipmentFilters { weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; /** Same as weightingAdjustments but based on player level instead of bot level */ weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; + /** Should the stock mod be forced to spawn on bot */ + forceStock: boolean; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IQuestConfig.d.ts index 3e3b2be..8a71eb9 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IQuestConfig.d.ts @@ -55,6 +55,8 @@ export interface IRewardScaling { items: number[]; reputation: number[]; rewardSpread: number; + skillRewardChance: number[]; + skillPointReward: number[]; } export interface ITraderWhitelist { traderId: string; @@ -66,7 +68,7 @@ export interface IRepeatableQuestTypesConfig { Pickup: IPickup; Elimination: IEliminationConfig[]; } -export interface IExploration { +export interface IExploration extends IBaseQuestConfig { maxExtracts: number; specificExits: ISpecificExits; } @@ -74,7 +76,7 @@ export interface ISpecificExits { probability: number; passageRequirementWhitelist: string[]; } -export interface ICompletion { +export interface ICompletion extends IBaseQuestConfig { minRequestedAmount: number; maxRequestedAmount: number; minRequestedBulletAmount: number; @@ -82,7 +84,7 @@ export interface ICompletion { useWhitelist: boolean; useBlacklist: boolean; } -export interface IPickup { +export interface IPickup extends IBaseQuestConfig { ItemTypeToFetchWithMaxCount: IPickupTypeWithMaxCount[]; } export interface IPickupTypeWithMaxCount { @@ -90,7 +92,7 @@ export interface IPickupTypeWithMaxCount { maxPickupCount: number; minPickupCount: number; } -export interface IEliminationConfig { +export interface IEliminationConfig extends IBaseQuestConfig { levelRange: MinMax; targets: ITarget[]; bodyPartProb: number; @@ -111,6 +113,9 @@ export interface IEliminationConfig { weaponRequirementProb: number; weaponRequirements: IWeaponRequirement[]; } +export interface IBaseQuestConfig { + possibleSkillRewards: string[]; +} export interface ITarget extends IProbabilityObject { data: IBossInfo; } diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IRepairConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IRepairConfig.d.ts index 1ae082d..9e23cc4 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IRepairConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IRepairConfig.d.ts @@ -9,6 +9,7 @@ export interface IRepairConfig extends IBaseConfig { /** INT gain multiplier per repaired item type */ repairKitIntellectGainMultiplier: IIntellectGainValues; maxIntellectGainPerRepair: IMaxIntellectGainValues; + weaponTreatment: IWeaponTreatmentRepairValues; repairKit: RepairKit; } export interface IIntellectGainValues { @@ -19,6 +20,16 @@ export interface IMaxIntellectGainValues { kit: number; trader: number; } +export interface IWeaponTreatmentRepairValues { + /** The chance to gain more weapon maintenance skill */ + critSuccessChance: number; + critSuccessAmount: number; + /** The chance to gain less weapon maintenance skill */ + critFailureChance: number; + critFailureAmount: number; + /** The multiplier used for calculating weapon maintenance XP */ + pointGainMultiplier: number; +} export interface RepairKit { armor: BonusSettings; weapon: BonusSettings; diff --git a/TypeScript/12ClassExtensionOverride/types/services/PlayerService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/PlayerService.d.ts index edf269e..f24e0dc 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/PlayerService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/PlayerService.d.ts @@ -9,15 +9,6 @@ export declare class PlayerService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, databaseServer: DatabaseServer); - /** - * Dupe of QuestHelper.rewardsSkillPoints() - * Add xp to a player skill - * @param pmcData Player profile - * @param skillName Name of skill to increment - * @param amount Amount of skill points to add to skill - * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code - */ - incrementSkillLevel(pmcData: IPmcData, skillName: string, amount: number, useSkillProgressRateMultipler?: boolean): void; /** * Get level of player * @param pmcData Player profile diff --git a/TypeScript/12ClassExtensionOverride/types/services/RepairService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/RepairService.d.ts index b8ffbaa..8f9e7e9 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/RepairService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/RepairService.d.ts @@ -1,5 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { QuestHelper } from "@spt-aki/helpers/QuestHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { RepairHelper } from "@spt-aki/helpers/RepairHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; @@ -9,6 +9,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { RepairKitsInfo } from "@spt-aki/models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "@spt-aki/models/eft/repair/ITraderRepairActionDataRequest"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { BonusSettings, IRepairConfig } from "@spt-aki/models/spt/config/IRepairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -19,7 +20,7 @@ import { RandomUtil } from "@spt-aki/utils/RandomUtil"; export declare class RepairService { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected questHelper: QuestHelper; + protected profileHelper: ProfileHelper; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; @@ -29,7 +30,7 @@ export declare class RepairService { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id @@ -56,6 +57,12 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + /** + * Return an appromixation of the amount of skill points live would return for the given repairDetails + * @param repairDetails the repair details to calculate skill points for + * @returns the number of skill points to reward the user + */ + protected getWeaponRepairSkillPoints(repairDetails: RepairDetails): number; /** * * @param sessionId Session id @@ -81,6 +88,13 @@ export declare class RepairService { * @returns Multiplier value */ protected getBonusMultiplierValue(skillBonusName: string, pmcData: IPmcData): number; + /** + * Should a repair kit apply total durability loss on repair + * @param pmcData Player profile + * @param applyRandomizeDurabilityLoss Value from repair config + * @returns True if loss should be applied + */ + protected shouldRepairKitApplyDurabilityLoss(pmcData: IPmcData, applyRandomizeDurabilityLoss: boolean): boolean; /** * Update repair kits Resource object if it doesn't exist * @param repairKitDetails Repair kit details from db @@ -112,7 +126,7 @@ export declare class RepairService { * @param itemTemplate Item to check for skill * @returns Skill name */ - protected getItemSkillType(itemTemplate: ITemplateItem): string; + protected getItemSkillType(itemTemplate: ITemplateItem): SkillTypes; /** * Ensure multiplier is between 1 and 0.01 * @param receiveDurabilityMaxPercent Max durabiltiy percent @@ -123,6 +137,7 @@ export declare class RepairService { } export declare class RepairDetails { repairCost?: number; + repairPoints?: number; repairedItem: Item; repairedItemIsArmor: boolean; repairAmount: number; diff --git a/TypeScript/12ClassExtensionOverride/types/utils/App.d.ts b/TypeScript/12ClassExtensionOverride/types/utils/App.d.ts index 1839695..64800ce 100644 --- a/TypeScript/12ClassExtensionOverride/types/utils/App.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/utils/App.d.ts @@ -1,6 +1,8 @@ import { OnLoad } from "@spt-aki/di/OnLoad"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -8,11 +10,13 @@ export declare class App { protected logger: ILogger; protected timeUtil: TimeUtil; protected localisationService: LocalisationService; + protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/13AddTrader/types/controllers/GameController.d.ts b/TypeScript/13AddTrader/types/controllers/GameController.d.ts index 640a8c1..168071d 100644 --- a/TypeScript/13AddTrader/types/controllers/GameController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/GameController.d.ts @@ -61,6 +61,10 @@ export declare class GameController { * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + /** + * Out of date/incorrectly made trader mods forget this data + */ + protected checkTraderRepairValuesExist(): void; protected addCustomLooseLootPositions(): void; protected adjustLooseLootSpawnProbabilities(): void; protected setHideoutAreasAndCraftsTo40Secs(): void; diff --git a/TypeScript/13AddTrader/types/controllers/InsuranceController.d.ts b/TypeScript/13AddTrader/types/controllers/InsuranceController.d.ts index b1e8fe6..0ee30ed 100644 --- a/TypeScript/13AddTrader/types/controllers/InsuranceController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/InsuranceController.d.ts @@ -8,7 +8,7 @@ import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGet import { IGetInsuranceCostResponseData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostResponseData"; import { IInsureRequestData } from "@spt-aki/models/eft/insurance/IInsureRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; -import { Insurance, ISystemData } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ISystemData, Insurance } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IInsuranceConfig } from "@spt-aki/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; diff --git a/TypeScript/13AddTrader/types/controllers/RepeatableQuestController.d.ts b/TypeScript/13AddTrader/types/controllers/RepeatableQuestController.d.ts index b09b540..a3ebc1c 100644 --- a/TypeScript/13AddTrader/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/RepeatableQuestController.d.ts @@ -13,6 +13,7 @@ import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -21,8 +22,9 @@ import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RepeatableQuestController { - protected timeUtil: TimeUtil; protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; @@ -37,7 +39,7 @@ export declare class RepeatableQuestController { protected questHelper: QuestHelper; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. @@ -64,6 +66,13 @@ export declare class RepeatableQuestController { * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Get the number of quests to generate - takes into account charisma state of player + * @param repeatableConfig Config + * @param pmcData Player profile + * @returns Quest count + */ + protected getQuestCount(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): number; /** * Get repeatable quest data from profile from name (daily/weekly), creates base repeatable quest object if none exists * @param repeatableConfig daily/weekly config diff --git a/TypeScript/13AddTrader/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/13AddTrader/types/generators/BotEquipmentModGenerator.d.ts index 05266dd..75530c7 100644 --- a/TypeScript/13AddTrader/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/BotEquipmentModGenerator.d.ts @@ -179,7 +179,7 @@ export declare class BotEquipmentModGenerator { * Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots. * This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine" * @param items The items where the CylinderMagazine's camora are appended to - * @param modPool modPool which should include available cartrigdes + * @param modPool modPool which should include available cartridges * @param parentId The CylinderMagazine's UID * @param parentTemplate The CylinderMagazine's template */ diff --git a/TypeScript/13AddTrader/types/generators/BotLootGenerator.d.ts b/TypeScript/13AddTrader/types/generators/BotLootGenerator.d.ts index e937a4d..7a4c521 100644 --- a/TypeScript/13AddTrader/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/BotLootGenerator.d.ts @@ -83,7 +83,7 @@ export declare class BotLootGenerator { * @param equipmentSlot slot to place the preset in (backpack) * @param templateInventory bots template, assault.json * @param modChances chances for mods to spawn on weapon - * @param botRole bots role, .e.g. pmcBot + * @param botRole bots role .e.g. pmcBot * @param isPmc are we generating for a pmc */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; @@ -120,16 +120,16 @@ export declare class BotLootGenerator { protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; /** * Randomise the stack size of a money object, uses different values for pmc or scavs - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param moneyItem Money stack to randomise + * @param isPmc Is money on a PMC bot + * @param itemTemplate item details from db + * @param moneyItem Money item to randomise */ protected randomiseMoneyStackSize(isPmc: boolean, itemTemplate: ITemplateItem, moneyItem: Item): void; /** * Randomise the size of an ammo stack - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param ammoItem Ammo stack to randomise + * @param isPmc Is ammo on a PMC bot + * @param itemTemplate item details from db + * @param ammoItem Ammo item to randomise */ protected randomiseAmmoStackSize(isPmc: boolean, itemTemplate: ITemplateItem, ammoItem: Item): void; /** diff --git a/TypeScript/13AddTrader/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/13AddTrader/types/generators/RepeatableQuestGenerator.d.ts index 40a3c16..44c38be 100644 --- a/TypeScript/13AddTrader/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/RepeatableQuestGenerator.d.ts @@ -8,7 +8,7 @@ import { Exit } from "@spt-aki/models/eft/common/ILocationBase"; import { TraderInfo } from "@spt-aki/models/eft/common/tables/IBotBase"; import { ICompletion, ICompletionAvailableFor, IElimination, IEliminationCondition, IExploration, IExplorationCondition, IPickup, IRepeatableQuest, IReward, IRewards } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; -import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; @@ -155,7 +155,7 @@ export declare class RepeatableQuestGenerator { * @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ - protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig): IRewards; + protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IRewards; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config diff --git a/TypeScript/13AddTrader/types/helpers/HideoutHelper.d.ts b/TypeScript/13AddTrader/types/helpers/HideoutHelper.d.ts index 93f8fb1..0cfc649 100644 --- a/TypeScript/13AddTrader/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/HideoutHelper.d.ts @@ -1,7 +1,7 @@ import { InventoryHelper } from "@spt-aki/helpers/InventoryHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { Common, HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "@spt-aki/models/eft/hideout/IHideoutContinuousProductionStartRequestData"; @@ -201,22 +201,10 @@ export declare class HideoutHelper { * @returns coin slot count */ protected getBTCSlots(pmcData: IPmcData): number; - /** - * Does profile have elite hideout management skill - * @param pmcData Profile to look at - * @returns True if profile has skill - */ - protected hasEliteHideoutManagementSkill(pmcData: IPmcData): boolean; /** * Get a count of bitcoins player miner can hold */ protected getBitcoinMinerContainerSlotSize(): number; - /** - * Get the hideout management skill from player profile - * @param pmcData Profile to look at - * @returns Hideout management skill object - */ - protected getHideoutManagementSkill(pmcData: IPmcData): Common; /** * HideoutManagement skill gives a consumption bonus the higher the level * 0.5% per level per 1-51, (25.5% at max) diff --git a/TypeScript/13AddTrader/types/helpers/ItemHelper.d.ts b/TypeScript/13AddTrader/types/helpers/ItemHelper.d.ts index 47823bc..e1c7720 100644 --- a/TypeScript/13AddTrader/types/helpers/ItemHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/ItemHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -24,10 +25,11 @@ declare class ItemHelper { protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; + protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl diff --git a/TypeScript/13AddTrader/types/helpers/ProfileHelper.d.ts b/TypeScript/13AddTrader/types/helpers/ProfileHelper.d.ts index 781f980..938c796 100644 --- a/TypeScript/13AddTrader/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/ProfileHelper.d.ts @@ -1,11 +1,13 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IValidateNicknameRequestData } from "@spt-aki/models/eft/profile/IValidateNicknameRequestData"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; +import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileSnapshotService } from "@spt-aki/services/ProfileSnapshotService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -19,7 +21,8 @@ export declare class ProfileHelper { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected profileSnapshotService: ProfileSnapshotService; - constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); + protected localisationService: LocalisationService; + constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, localisationService: LocalisationService); /** * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id @@ -101,4 +104,21 @@ export declare class ProfileHelper { * @param keyToIncrement Key */ incrementStatCounter(counters: CounterKeyValue[], keyToIncrement: string): void; + /** + * Check if player has a skill at elite level + * @param skillType Skill to check + * @param pmcProfile Profile to find skill in + * @returns True if player has skill at elite level + */ + hasEliteSkillLevel(skillType: SkillTypes, pmcProfile: IPmcData): boolean; + /** + * Add points to a specific skill in player profile + * @param skill Skill to add points to + * @param pointsToAdd Points to add + * @param pmcProfile Player profile with skill + * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code + * @returns + */ + addSkillPointsToPlayer(pmcProfile: IPmcData, skill: SkillTypes, pointsToAdd: number, useSkillProgressRateMultipler?: boolean): void; + getSkillFromProfile(pmcData: IPmcData, skill: SkillTypes): Common; } diff --git a/TypeScript/13AddTrader/types/helpers/QuestHelper.d.ts b/TypeScript/13AddTrader/types/helpers/QuestHelper.d.ts index 1e40e53..0dda05b 100644 --- a/TypeScript/13AddTrader/types/helpers/QuestHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/QuestHelper.d.ts @@ -6,7 +6,7 @@ import { QuestConditionHelper } from "@spt-aki/helpers/QuestConditionHelper"; import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "@spt-aki/models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; @@ -66,14 +66,12 @@ export declare class QuestHelper { */ getDeltaQuests(before: IQuest[], after: IQuest[]): IQuest[]; /** - * Increase skill points of a skill on player profile - * Dupe of PlayerService.incrementSkillLevel() - * @param sessionID Session id - * @param pmcData Player profile - * @param skillName Name of skill to increase skill points of - * @param progressAmount Amount of skill points to add to skill + * Adjust skill experience for low skill levels, mimicing the official client + * @param profileSkill the skill experience is being added to + * @param progressAmount the amount of experience being added to the skill + * @returns the adjusted skill progress gain */ - rewardSkillPoints(sessionID: string, pmcData: IPmcData, skillName: string, progressAmount: number): void; + adjustSkillExpForLowLevels(profileSkill: Common, progressAmount: number): number; /** * Get quest name by quest id * @param questId id to get diff --git a/TypeScript/13AddTrader/types/loaders/PreAkiModLoader.d.ts b/TypeScript/13AddTrader/types/loaders/PreAkiModLoader.d.ts index 869dfbb..71fd745 100644 --- a/TypeScript/13AddTrader/types/loaders/PreAkiModLoader.d.ts +++ b/TypeScript/13AddTrader/types/loaders/PreAkiModLoader.d.ts @@ -29,7 +29,7 @@ export declare class PreAkiModLoader implements IModLoader { protected imported: Record; protected akiConfig: ICoreConfig; protected serverDependencies: Record; - protected skippedMods: string[]; + protected skippedMods: Set; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, bundleLoader: BundleLoader, localisationService: LocalisationService, configServer: ConfigServer, modLoadOrder: ModLoadOrder, modTypeCheck: ModTypeCheck); load(container: DependencyContainer): Promise; /** @@ -44,27 +44,22 @@ export declare class PreAkiModLoader implements IModLoader { 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 + * @param modPackageData map of mod package.json data */ - protected checkForDuplicateMods(modPackageData: Record): void; + protected checkForDuplicateMods(modPackageData: Map): void; /** - * Check for and return duplicate strings inside an array - * @param stringArray Array to check for duplicates - * @returns string array of duplicates, empty if none found - */ - protected getDuplicates(stringArray: string[]): string[]; - /** - * Get an array of mods with errors that prevent them from working with SPT + * Returns an array of valid mods. + * * @param mods mods to validate - * @returns Mod names as array + * @returns array of mod folder names */ - protected getBrokenMods(mods: string[]): string[]; + protected getValidMods(mods: string[]): string[]; /** * Get packageJson data for mods * @param mods mods to get packageJson for - * @returns dictionary + * @returns map */ - protected getModsPackageData(mods: string[]): Record; + protected getModsPackageData(mods: string[]): Map; /** * Is the passed in mod compatible with the running server version * @param mod Mod to check compatibiltiy with AKI @@ -86,10 +81,17 @@ export declare class PreAkiModLoader implements IModLoader { * Compile mod and add into class property "imported" * @param mod Name of mod to compile/add */ - protected addModAsync(mod: string): Promise; + protected addModAsync(mod: string, pkg: IPackageJsonData): Promise; + /** + * Checks if a given mod should be loaded or skipped. + * + * @param pkg mod package.json data + * @returns + */ + protected shouldSkipMod(pkg: IPackageJsonData): boolean; protected autoInstallDependencies(modPath: string, pkg: IPackageJsonData): void; - protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Record): boolean; - protected isModCompatible(mod: IPackageJsonData, loadedMods: Record): boolean; + protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Map): boolean; + protected isModCompatible(mod: IPackageJsonData, loadedMods: Map): boolean; /** * Validate a mod passes a number of checks * @param modName name of mod in /mods/ to validate diff --git a/TypeScript/13AddTrader/types/models/enums/SkillTypes.d.ts b/TypeScript/13AddTrader/types/models/enums/SkillTypes.d.ts index 4eb90af..dc059a8 100644 --- a/TypeScript/13AddTrader/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/13AddTrader/types/models/enums/SkillTypes.d.ts @@ -1,4 +1,6 @@ export declare enum SkillTypes { + BOT_RELOAD = "BotReload", + BOT_SOUND = "BotSound", HIDEOUT_MANAGEMENT = "HideoutManagement", CRAFTING = "Crafting", METABOLISM = "Metabolism", @@ -19,6 +21,7 @@ export declare enum SkillTypes { ATTENTION = "Attention", CHARISMA = "Charisma", MEMORY = "Memory", + MELEE = "Melee", SURGERY = "Surgery", AIM_DRILLS = "AimDrills", TROUBLESHOOTING = "TroubleShooting", @@ -31,6 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", + /** Also called Weapon Maintenance*/ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts index c76eda7..24c8c19 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts @@ -102,6 +102,8 @@ export interface EquipmentFilters { weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; /** Same as weightingAdjustments but based on player level instead of bot level */ weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; + /** Should the stock mod be forced to spawn on bot */ + forceStock: boolean; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/13AddTrader/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/IQuestConfig.d.ts index 3e3b2be..8a71eb9 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/IQuestConfig.d.ts @@ -55,6 +55,8 @@ export interface IRewardScaling { items: number[]; reputation: number[]; rewardSpread: number; + skillRewardChance: number[]; + skillPointReward: number[]; } export interface ITraderWhitelist { traderId: string; @@ -66,7 +68,7 @@ export interface IRepeatableQuestTypesConfig { Pickup: IPickup; Elimination: IEliminationConfig[]; } -export interface IExploration { +export interface IExploration extends IBaseQuestConfig { maxExtracts: number; specificExits: ISpecificExits; } @@ -74,7 +76,7 @@ export interface ISpecificExits { probability: number; passageRequirementWhitelist: string[]; } -export interface ICompletion { +export interface ICompletion extends IBaseQuestConfig { minRequestedAmount: number; maxRequestedAmount: number; minRequestedBulletAmount: number; @@ -82,7 +84,7 @@ export interface ICompletion { useWhitelist: boolean; useBlacklist: boolean; } -export interface IPickup { +export interface IPickup extends IBaseQuestConfig { ItemTypeToFetchWithMaxCount: IPickupTypeWithMaxCount[]; } export interface IPickupTypeWithMaxCount { @@ -90,7 +92,7 @@ export interface IPickupTypeWithMaxCount { maxPickupCount: number; minPickupCount: number; } -export interface IEliminationConfig { +export interface IEliminationConfig extends IBaseQuestConfig { levelRange: MinMax; targets: ITarget[]; bodyPartProb: number; @@ -111,6 +113,9 @@ export interface IEliminationConfig { weaponRequirementProb: number; weaponRequirements: IWeaponRequirement[]; } +export interface IBaseQuestConfig { + possibleSkillRewards: string[]; +} export interface ITarget extends IProbabilityObject { data: IBossInfo; } diff --git a/TypeScript/13AddTrader/types/models/spt/config/IRepairConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/IRepairConfig.d.ts index 1ae082d..9e23cc4 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/IRepairConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/IRepairConfig.d.ts @@ -9,6 +9,7 @@ export interface IRepairConfig extends IBaseConfig { /** INT gain multiplier per repaired item type */ repairKitIntellectGainMultiplier: IIntellectGainValues; maxIntellectGainPerRepair: IMaxIntellectGainValues; + weaponTreatment: IWeaponTreatmentRepairValues; repairKit: RepairKit; } export interface IIntellectGainValues { @@ -19,6 +20,16 @@ export interface IMaxIntellectGainValues { kit: number; trader: number; } +export interface IWeaponTreatmentRepairValues { + /** The chance to gain more weapon maintenance skill */ + critSuccessChance: number; + critSuccessAmount: number; + /** The chance to gain less weapon maintenance skill */ + critFailureChance: number; + critFailureAmount: number; + /** The multiplier used for calculating weapon maintenance XP */ + pointGainMultiplier: number; +} export interface RepairKit { armor: BonusSettings; weapon: BonusSettings; diff --git a/TypeScript/13AddTrader/types/services/PlayerService.d.ts b/TypeScript/13AddTrader/types/services/PlayerService.d.ts index edf269e..f24e0dc 100644 --- a/TypeScript/13AddTrader/types/services/PlayerService.d.ts +++ b/TypeScript/13AddTrader/types/services/PlayerService.d.ts @@ -9,15 +9,6 @@ export declare class PlayerService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, databaseServer: DatabaseServer); - /** - * Dupe of QuestHelper.rewardsSkillPoints() - * Add xp to a player skill - * @param pmcData Player profile - * @param skillName Name of skill to increment - * @param amount Amount of skill points to add to skill - * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code - */ - incrementSkillLevel(pmcData: IPmcData, skillName: string, amount: number, useSkillProgressRateMultipler?: boolean): void; /** * Get level of player * @param pmcData Player profile diff --git a/TypeScript/13AddTrader/types/services/RepairService.d.ts b/TypeScript/13AddTrader/types/services/RepairService.d.ts index b8ffbaa..8f9e7e9 100644 --- a/TypeScript/13AddTrader/types/services/RepairService.d.ts +++ b/TypeScript/13AddTrader/types/services/RepairService.d.ts @@ -1,5 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { QuestHelper } from "@spt-aki/helpers/QuestHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { RepairHelper } from "@spt-aki/helpers/RepairHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; @@ -9,6 +9,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { RepairKitsInfo } from "@spt-aki/models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "@spt-aki/models/eft/repair/ITraderRepairActionDataRequest"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { BonusSettings, IRepairConfig } from "@spt-aki/models/spt/config/IRepairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -19,7 +20,7 @@ import { RandomUtil } from "@spt-aki/utils/RandomUtil"; export declare class RepairService { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected questHelper: QuestHelper; + protected profileHelper: ProfileHelper; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; @@ -29,7 +30,7 @@ export declare class RepairService { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id @@ -56,6 +57,12 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + /** + * Return an appromixation of the amount of skill points live would return for the given repairDetails + * @param repairDetails the repair details to calculate skill points for + * @returns the number of skill points to reward the user + */ + protected getWeaponRepairSkillPoints(repairDetails: RepairDetails): number; /** * * @param sessionId Session id @@ -81,6 +88,13 @@ export declare class RepairService { * @returns Multiplier value */ protected getBonusMultiplierValue(skillBonusName: string, pmcData: IPmcData): number; + /** + * Should a repair kit apply total durability loss on repair + * @param pmcData Player profile + * @param applyRandomizeDurabilityLoss Value from repair config + * @returns True if loss should be applied + */ + protected shouldRepairKitApplyDurabilityLoss(pmcData: IPmcData, applyRandomizeDurabilityLoss: boolean): boolean; /** * Update repair kits Resource object if it doesn't exist * @param repairKitDetails Repair kit details from db @@ -112,7 +126,7 @@ export declare class RepairService { * @param itemTemplate Item to check for skill * @returns Skill name */ - protected getItemSkillType(itemTemplate: ITemplateItem): string; + protected getItemSkillType(itemTemplate: ITemplateItem): SkillTypes; /** * Ensure multiplier is between 1 and 0.01 * @param receiveDurabilityMaxPercent Max durabiltiy percent @@ -123,6 +137,7 @@ export declare class RepairService { } export declare class RepairDetails { repairCost?: number; + repairPoints?: number; repairedItem: Item; repairedItemIsArmor: boolean; repairAmount: number; diff --git a/TypeScript/13AddTrader/types/utils/App.d.ts b/TypeScript/13AddTrader/types/utils/App.d.ts index 1839695..64800ce 100644 --- a/TypeScript/13AddTrader/types/utils/App.d.ts +++ b/TypeScript/13AddTrader/types/utils/App.d.ts @@ -1,6 +1,8 @@ import { OnLoad } from "@spt-aki/di/OnLoad"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -8,11 +10,13 @@ export declare class App { protected logger: ILogger; protected timeUtil: TimeUtil; protected localisationService: LocalisationService; + protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/GameController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/GameController.d.ts index 640a8c1..168071d 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/GameController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/GameController.d.ts @@ -61,6 +61,10 @@ export declare class GameController { * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + /** + * Out of date/incorrectly made trader mods forget this data + */ + protected checkTraderRepairValuesExist(): void; protected addCustomLooseLootPositions(): void; protected adjustLooseLootSpawnProbabilities(): void; protected setHideoutAreasAndCraftsTo40Secs(): void; diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/InsuranceController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/InsuranceController.d.ts index b1e8fe6..0ee30ed 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/InsuranceController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/InsuranceController.d.ts @@ -8,7 +8,7 @@ import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGet import { IGetInsuranceCostResponseData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostResponseData"; import { IInsureRequestData } from "@spt-aki/models/eft/insurance/IInsureRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; -import { Insurance, ISystemData } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ISystemData, Insurance } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IInsuranceConfig } from "@spt-aki/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/RepeatableQuestController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/RepeatableQuestController.d.ts index b09b540..a3ebc1c 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/RepeatableQuestController.d.ts @@ -13,6 +13,7 @@ import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -21,8 +22,9 @@ import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RepeatableQuestController { - protected timeUtil: TimeUtil; protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; @@ -37,7 +39,7 @@ export declare class RepeatableQuestController { protected questHelper: QuestHelper; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. @@ -64,6 +66,13 @@ export declare class RepeatableQuestController { * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Get the number of quests to generate - takes into account charisma state of player + * @param repeatableConfig Config + * @param pmcData Player profile + * @returns Quest count + */ + protected getQuestCount(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): number; /** * Get repeatable quest data from profile from name (daily/weekly), creates base repeatable quest object if none exists * @param repeatableConfig daily/weekly config diff --git a/TypeScript/14AfterDBLoadHook/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/BotEquipmentModGenerator.d.ts index 05266dd..75530c7 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/BotEquipmentModGenerator.d.ts @@ -179,7 +179,7 @@ export declare class BotEquipmentModGenerator { * Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots. * This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine" * @param items The items where the CylinderMagazine's camora are appended to - * @param modPool modPool which should include available cartrigdes + * @param modPool modPool which should include available cartridges * @param parentId The CylinderMagazine's UID * @param parentTemplate The CylinderMagazine's template */ diff --git a/TypeScript/14AfterDBLoadHook/types/generators/BotLootGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/BotLootGenerator.d.ts index e937a4d..7a4c521 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/BotLootGenerator.d.ts @@ -83,7 +83,7 @@ export declare class BotLootGenerator { * @param equipmentSlot slot to place the preset in (backpack) * @param templateInventory bots template, assault.json * @param modChances chances for mods to spawn on weapon - * @param botRole bots role, .e.g. pmcBot + * @param botRole bots role .e.g. pmcBot * @param isPmc are we generating for a pmc */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; @@ -120,16 +120,16 @@ export declare class BotLootGenerator { protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; /** * Randomise the stack size of a money object, uses different values for pmc or scavs - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param moneyItem Money stack to randomise + * @param isPmc Is money on a PMC bot + * @param itemTemplate item details from db + * @param moneyItem Money item to randomise */ protected randomiseMoneyStackSize(isPmc: boolean, itemTemplate: ITemplateItem, moneyItem: Item): void; /** * Randomise the size of an ammo stack - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param ammoItem Ammo stack to randomise + * @param isPmc Is ammo on a PMC bot + * @param itemTemplate item details from db + * @param ammoItem Ammo item to randomise */ protected randomiseAmmoStackSize(isPmc: boolean, itemTemplate: ITemplateItem, ammoItem: Item): void; /** diff --git a/TypeScript/14AfterDBLoadHook/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/RepeatableQuestGenerator.d.ts index 40a3c16..44c38be 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/RepeatableQuestGenerator.d.ts @@ -8,7 +8,7 @@ import { Exit } from "@spt-aki/models/eft/common/ILocationBase"; import { TraderInfo } from "@spt-aki/models/eft/common/tables/IBotBase"; import { ICompletion, ICompletionAvailableFor, IElimination, IEliminationCondition, IExploration, IExplorationCondition, IPickup, IRepeatableQuest, IReward, IRewards } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; -import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; @@ -155,7 +155,7 @@ export declare class RepeatableQuestGenerator { * @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ - protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig): IRewards; + protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IRewards; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/HideoutHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/HideoutHelper.d.ts index 93f8fb1..0cfc649 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/HideoutHelper.d.ts @@ -1,7 +1,7 @@ import { InventoryHelper } from "@spt-aki/helpers/InventoryHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { Common, HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "@spt-aki/models/eft/hideout/IHideoutContinuousProductionStartRequestData"; @@ -201,22 +201,10 @@ export declare class HideoutHelper { * @returns coin slot count */ protected getBTCSlots(pmcData: IPmcData): number; - /** - * Does profile have elite hideout management skill - * @param pmcData Profile to look at - * @returns True if profile has skill - */ - protected hasEliteHideoutManagementSkill(pmcData: IPmcData): boolean; /** * Get a count of bitcoins player miner can hold */ protected getBitcoinMinerContainerSlotSize(): number; - /** - * Get the hideout management skill from player profile - * @param pmcData Profile to look at - * @returns Hideout management skill object - */ - protected getHideoutManagementSkill(pmcData: IPmcData): Common; /** * HideoutManagement skill gives a consumption bonus the higher the level * 0.5% per level per 1-51, (25.5% at max) diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/ItemHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/ItemHelper.d.ts index 47823bc..e1c7720 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/ItemHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/ItemHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -24,10 +25,11 @@ declare class ItemHelper { protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; + protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/ProfileHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/ProfileHelper.d.ts index 781f980..938c796 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/ProfileHelper.d.ts @@ -1,11 +1,13 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IValidateNicknameRequestData } from "@spt-aki/models/eft/profile/IValidateNicknameRequestData"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; +import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileSnapshotService } from "@spt-aki/services/ProfileSnapshotService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -19,7 +21,8 @@ export declare class ProfileHelper { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected profileSnapshotService: ProfileSnapshotService; - constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); + protected localisationService: LocalisationService; + constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, localisationService: LocalisationService); /** * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id @@ -101,4 +104,21 @@ export declare class ProfileHelper { * @param keyToIncrement Key */ incrementStatCounter(counters: CounterKeyValue[], keyToIncrement: string): void; + /** + * Check if player has a skill at elite level + * @param skillType Skill to check + * @param pmcProfile Profile to find skill in + * @returns True if player has skill at elite level + */ + hasEliteSkillLevel(skillType: SkillTypes, pmcProfile: IPmcData): boolean; + /** + * Add points to a specific skill in player profile + * @param skill Skill to add points to + * @param pointsToAdd Points to add + * @param pmcProfile Player profile with skill + * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code + * @returns + */ + addSkillPointsToPlayer(pmcProfile: IPmcData, skill: SkillTypes, pointsToAdd: number, useSkillProgressRateMultipler?: boolean): void; + getSkillFromProfile(pmcData: IPmcData, skill: SkillTypes): Common; } diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/QuestHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/QuestHelper.d.ts index 1e40e53..0dda05b 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/QuestHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/QuestHelper.d.ts @@ -6,7 +6,7 @@ import { QuestConditionHelper } from "@spt-aki/helpers/QuestConditionHelper"; import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "@spt-aki/models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; @@ -66,14 +66,12 @@ export declare class QuestHelper { */ getDeltaQuests(before: IQuest[], after: IQuest[]): IQuest[]; /** - * Increase skill points of a skill on player profile - * Dupe of PlayerService.incrementSkillLevel() - * @param sessionID Session id - * @param pmcData Player profile - * @param skillName Name of skill to increase skill points of - * @param progressAmount Amount of skill points to add to skill + * Adjust skill experience for low skill levels, mimicing the official client + * @param profileSkill the skill experience is being added to + * @param progressAmount the amount of experience being added to the skill + * @returns the adjusted skill progress gain */ - rewardSkillPoints(sessionID: string, pmcData: IPmcData, skillName: string, progressAmount: number): void; + adjustSkillExpForLowLevels(profileSkill: Common, progressAmount: number): number; /** * Get quest name by quest id * @param questId id to get diff --git a/TypeScript/14AfterDBLoadHook/types/loaders/PreAkiModLoader.d.ts b/TypeScript/14AfterDBLoadHook/types/loaders/PreAkiModLoader.d.ts index 869dfbb..71fd745 100644 --- a/TypeScript/14AfterDBLoadHook/types/loaders/PreAkiModLoader.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/loaders/PreAkiModLoader.d.ts @@ -29,7 +29,7 @@ export declare class PreAkiModLoader implements IModLoader { protected imported: Record; protected akiConfig: ICoreConfig; protected serverDependencies: Record; - protected skippedMods: string[]; + protected skippedMods: Set; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, bundleLoader: BundleLoader, localisationService: LocalisationService, configServer: ConfigServer, modLoadOrder: ModLoadOrder, modTypeCheck: ModTypeCheck); load(container: DependencyContainer): Promise; /** @@ -44,27 +44,22 @@ export declare class PreAkiModLoader implements IModLoader { 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 + * @param modPackageData map of mod package.json data */ - protected checkForDuplicateMods(modPackageData: Record): void; + protected checkForDuplicateMods(modPackageData: Map): void; /** - * Check for and return duplicate strings inside an array - * @param stringArray Array to check for duplicates - * @returns string array of duplicates, empty if none found - */ - protected getDuplicates(stringArray: string[]): string[]; - /** - * Get an array of mods with errors that prevent them from working with SPT + * Returns an array of valid mods. + * * @param mods mods to validate - * @returns Mod names as array + * @returns array of mod folder names */ - protected getBrokenMods(mods: string[]): string[]; + protected getValidMods(mods: string[]): string[]; /** * Get packageJson data for mods * @param mods mods to get packageJson for - * @returns dictionary + * @returns map */ - protected getModsPackageData(mods: string[]): Record; + protected getModsPackageData(mods: string[]): Map; /** * Is the passed in mod compatible with the running server version * @param mod Mod to check compatibiltiy with AKI @@ -86,10 +81,17 @@ export declare class PreAkiModLoader implements IModLoader { * Compile mod and add into class property "imported" * @param mod Name of mod to compile/add */ - protected addModAsync(mod: string): Promise; + protected addModAsync(mod: string, pkg: IPackageJsonData): Promise; + /** + * Checks if a given mod should be loaded or skipped. + * + * @param pkg mod package.json data + * @returns + */ + protected shouldSkipMod(pkg: IPackageJsonData): boolean; protected autoInstallDependencies(modPath: string, pkg: IPackageJsonData): void; - protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Record): boolean; - protected isModCompatible(mod: IPackageJsonData, loadedMods: Record): boolean; + protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Map): boolean; + protected isModCompatible(mod: IPackageJsonData, loadedMods: Map): boolean; /** * Validate a mod passes a number of checks * @param modName name of mod in /mods/ to validate diff --git a/TypeScript/14AfterDBLoadHook/types/models/enums/SkillTypes.d.ts b/TypeScript/14AfterDBLoadHook/types/models/enums/SkillTypes.d.ts index 4eb90af..dc059a8 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/enums/SkillTypes.d.ts @@ -1,4 +1,6 @@ export declare enum SkillTypes { + BOT_RELOAD = "BotReload", + BOT_SOUND = "BotSound", HIDEOUT_MANAGEMENT = "HideoutManagement", CRAFTING = "Crafting", METABOLISM = "Metabolism", @@ -19,6 +21,7 @@ export declare enum SkillTypes { ATTENTION = "Attention", CHARISMA = "Charisma", MEMORY = "Memory", + MELEE = "Melee", SURGERY = "Surgery", AIM_DRILLS = "AimDrills", TROUBLESHOOTING = "TroubleShooting", @@ -31,6 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", + /** Also called Weapon Maintenance*/ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts index c76eda7..24c8c19 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts @@ -102,6 +102,8 @@ export interface EquipmentFilters { weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; /** Same as weightingAdjustments but based on player level instead of bot level */ weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; + /** Should the stock mod be forced to spawn on bot */ + forceStock: boolean; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IQuestConfig.d.ts index 3e3b2be..8a71eb9 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IQuestConfig.d.ts @@ -55,6 +55,8 @@ export interface IRewardScaling { items: number[]; reputation: number[]; rewardSpread: number; + skillRewardChance: number[]; + skillPointReward: number[]; } export interface ITraderWhitelist { traderId: string; @@ -66,7 +68,7 @@ export interface IRepeatableQuestTypesConfig { Pickup: IPickup; Elimination: IEliminationConfig[]; } -export interface IExploration { +export interface IExploration extends IBaseQuestConfig { maxExtracts: number; specificExits: ISpecificExits; } @@ -74,7 +76,7 @@ export interface ISpecificExits { probability: number; passageRequirementWhitelist: string[]; } -export interface ICompletion { +export interface ICompletion extends IBaseQuestConfig { minRequestedAmount: number; maxRequestedAmount: number; minRequestedBulletAmount: number; @@ -82,7 +84,7 @@ export interface ICompletion { useWhitelist: boolean; useBlacklist: boolean; } -export interface IPickup { +export interface IPickup extends IBaseQuestConfig { ItemTypeToFetchWithMaxCount: IPickupTypeWithMaxCount[]; } export interface IPickupTypeWithMaxCount { @@ -90,7 +92,7 @@ export interface IPickupTypeWithMaxCount { maxPickupCount: number; minPickupCount: number; } -export interface IEliminationConfig { +export interface IEliminationConfig extends IBaseQuestConfig { levelRange: MinMax; targets: ITarget[]; bodyPartProb: number; @@ -111,6 +113,9 @@ export interface IEliminationConfig { weaponRequirementProb: number; weaponRequirements: IWeaponRequirement[]; } +export interface IBaseQuestConfig { + possibleSkillRewards: string[]; +} export interface ITarget extends IProbabilityObject { data: IBossInfo; } diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IRepairConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IRepairConfig.d.ts index 1ae082d..9e23cc4 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IRepairConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IRepairConfig.d.ts @@ -9,6 +9,7 @@ export interface IRepairConfig extends IBaseConfig { /** INT gain multiplier per repaired item type */ repairKitIntellectGainMultiplier: IIntellectGainValues; maxIntellectGainPerRepair: IMaxIntellectGainValues; + weaponTreatment: IWeaponTreatmentRepairValues; repairKit: RepairKit; } export interface IIntellectGainValues { @@ -19,6 +20,16 @@ export interface IMaxIntellectGainValues { kit: number; trader: number; } +export interface IWeaponTreatmentRepairValues { + /** The chance to gain more weapon maintenance skill */ + critSuccessChance: number; + critSuccessAmount: number; + /** The chance to gain less weapon maintenance skill */ + critFailureChance: number; + critFailureAmount: number; + /** The multiplier used for calculating weapon maintenance XP */ + pointGainMultiplier: number; +} export interface RepairKit { armor: BonusSettings; weapon: BonusSettings; diff --git a/TypeScript/14AfterDBLoadHook/types/services/PlayerService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/PlayerService.d.ts index edf269e..f24e0dc 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/PlayerService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/PlayerService.d.ts @@ -9,15 +9,6 @@ export declare class PlayerService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, databaseServer: DatabaseServer); - /** - * Dupe of QuestHelper.rewardsSkillPoints() - * Add xp to a player skill - * @param pmcData Player profile - * @param skillName Name of skill to increment - * @param amount Amount of skill points to add to skill - * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code - */ - incrementSkillLevel(pmcData: IPmcData, skillName: string, amount: number, useSkillProgressRateMultipler?: boolean): void; /** * Get level of player * @param pmcData Player profile diff --git a/TypeScript/14AfterDBLoadHook/types/services/RepairService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/RepairService.d.ts index b8ffbaa..8f9e7e9 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/RepairService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/RepairService.d.ts @@ -1,5 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { QuestHelper } from "@spt-aki/helpers/QuestHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { RepairHelper } from "@spt-aki/helpers/RepairHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; @@ -9,6 +9,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { RepairKitsInfo } from "@spt-aki/models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "@spt-aki/models/eft/repair/ITraderRepairActionDataRequest"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { BonusSettings, IRepairConfig } from "@spt-aki/models/spt/config/IRepairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -19,7 +20,7 @@ import { RandomUtil } from "@spt-aki/utils/RandomUtil"; export declare class RepairService { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected questHelper: QuestHelper; + protected profileHelper: ProfileHelper; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; @@ -29,7 +30,7 @@ export declare class RepairService { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id @@ -56,6 +57,12 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + /** + * Return an appromixation of the amount of skill points live would return for the given repairDetails + * @param repairDetails the repair details to calculate skill points for + * @returns the number of skill points to reward the user + */ + protected getWeaponRepairSkillPoints(repairDetails: RepairDetails): number; /** * * @param sessionId Session id @@ -81,6 +88,13 @@ export declare class RepairService { * @returns Multiplier value */ protected getBonusMultiplierValue(skillBonusName: string, pmcData: IPmcData): number; + /** + * Should a repair kit apply total durability loss on repair + * @param pmcData Player profile + * @param applyRandomizeDurabilityLoss Value from repair config + * @returns True if loss should be applied + */ + protected shouldRepairKitApplyDurabilityLoss(pmcData: IPmcData, applyRandomizeDurabilityLoss: boolean): boolean; /** * Update repair kits Resource object if it doesn't exist * @param repairKitDetails Repair kit details from db @@ -112,7 +126,7 @@ export declare class RepairService { * @param itemTemplate Item to check for skill * @returns Skill name */ - protected getItemSkillType(itemTemplate: ITemplateItem): string; + protected getItemSkillType(itemTemplate: ITemplateItem): SkillTypes; /** * Ensure multiplier is between 1 and 0.01 * @param receiveDurabilityMaxPercent Max durabiltiy percent @@ -123,6 +137,7 @@ export declare class RepairService { } export declare class RepairDetails { repairCost?: number; + repairPoints?: number; repairedItem: Item; repairedItemIsArmor: boolean; repairAmount: number; diff --git a/TypeScript/14AfterDBLoadHook/types/utils/App.d.ts b/TypeScript/14AfterDBLoadHook/types/utils/App.d.ts index 1839695..64800ce 100644 --- a/TypeScript/14AfterDBLoadHook/types/utils/App.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/utils/App.d.ts @@ -1,6 +1,8 @@ import { OnLoad } from "@spt-aki/di/OnLoad"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -8,11 +10,13 @@ export declare class App { protected logger: ILogger; protected timeUtil: TimeUtil; protected localisationService: LocalisationService; + protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/15HttpListenerExample/types/controllers/GameController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/GameController.d.ts index 640a8c1..168071d 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/GameController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/GameController.d.ts @@ -61,6 +61,10 @@ export declare class GameController { * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + /** + * Out of date/incorrectly made trader mods forget this data + */ + protected checkTraderRepairValuesExist(): void; protected addCustomLooseLootPositions(): void; protected adjustLooseLootSpawnProbabilities(): void; protected setHideoutAreasAndCraftsTo40Secs(): void; diff --git a/TypeScript/15HttpListenerExample/types/controllers/InsuranceController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/InsuranceController.d.ts index b1e8fe6..0ee30ed 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/InsuranceController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/InsuranceController.d.ts @@ -8,7 +8,7 @@ import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGet import { IGetInsuranceCostResponseData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostResponseData"; import { IInsureRequestData } from "@spt-aki/models/eft/insurance/IInsureRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; -import { Insurance, ISystemData } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ISystemData, Insurance } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IInsuranceConfig } from "@spt-aki/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; diff --git a/TypeScript/15HttpListenerExample/types/controllers/RepeatableQuestController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/RepeatableQuestController.d.ts index b09b540..a3ebc1c 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/RepeatableQuestController.d.ts @@ -13,6 +13,7 @@ import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -21,8 +22,9 @@ import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RepeatableQuestController { - protected timeUtil: TimeUtil; protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; @@ -37,7 +39,7 @@ export declare class RepeatableQuestController { protected questHelper: QuestHelper; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. @@ -64,6 +66,13 @@ export declare class RepeatableQuestController { * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Get the number of quests to generate - takes into account charisma state of player + * @param repeatableConfig Config + * @param pmcData Player profile + * @returns Quest count + */ + protected getQuestCount(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): number; /** * Get repeatable quest data from profile from name (daily/weekly), creates base repeatable quest object if none exists * @param repeatableConfig daily/weekly config diff --git a/TypeScript/15HttpListenerExample/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/BotEquipmentModGenerator.d.ts index 05266dd..75530c7 100644 --- a/TypeScript/15HttpListenerExample/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/BotEquipmentModGenerator.d.ts @@ -179,7 +179,7 @@ export declare class BotEquipmentModGenerator { * Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots. * This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine" * @param items The items where the CylinderMagazine's camora are appended to - * @param modPool modPool which should include available cartrigdes + * @param modPool modPool which should include available cartridges * @param parentId The CylinderMagazine's UID * @param parentTemplate The CylinderMagazine's template */ diff --git a/TypeScript/15HttpListenerExample/types/generators/BotLootGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/BotLootGenerator.d.ts index e937a4d..7a4c521 100644 --- a/TypeScript/15HttpListenerExample/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/BotLootGenerator.d.ts @@ -83,7 +83,7 @@ export declare class BotLootGenerator { * @param equipmentSlot slot to place the preset in (backpack) * @param templateInventory bots template, assault.json * @param modChances chances for mods to spawn on weapon - * @param botRole bots role, .e.g. pmcBot + * @param botRole bots role .e.g. pmcBot * @param isPmc are we generating for a pmc */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; @@ -120,16 +120,16 @@ export declare class BotLootGenerator { protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; /** * Randomise the stack size of a money object, uses different values for pmc or scavs - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param moneyItem Money stack to randomise + * @param isPmc Is money on a PMC bot + * @param itemTemplate item details from db + * @param moneyItem Money item to randomise */ protected randomiseMoneyStackSize(isPmc: boolean, itemTemplate: ITemplateItem, moneyItem: Item): void; /** * Randomise the size of an ammo stack - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param ammoItem Ammo stack to randomise + * @param isPmc Is ammo on a PMC bot + * @param itemTemplate item details from db + * @param ammoItem Ammo item to randomise */ protected randomiseAmmoStackSize(isPmc: boolean, itemTemplate: ITemplateItem, ammoItem: Item): void; /** diff --git a/TypeScript/15HttpListenerExample/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/RepeatableQuestGenerator.d.ts index 40a3c16..44c38be 100644 --- a/TypeScript/15HttpListenerExample/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/RepeatableQuestGenerator.d.ts @@ -8,7 +8,7 @@ import { Exit } from "@spt-aki/models/eft/common/ILocationBase"; import { TraderInfo } from "@spt-aki/models/eft/common/tables/IBotBase"; import { ICompletion, ICompletionAvailableFor, IElimination, IEliminationCondition, IExploration, IExplorationCondition, IPickup, IRepeatableQuest, IReward, IRewards } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; -import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; @@ -155,7 +155,7 @@ export declare class RepeatableQuestGenerator { * @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ - protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig): IRewards; + protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IRewards; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config diff --git a/TypeScript/15HttpListenerExample/types/helpers/HideoutHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/HideoutHelper.d.ts index 93f8fb1..0cfc649 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/HideoutHelper.d.ts @@ -1,7 +1,7 @@ import { InventoryHelper } from "@spt-aki/helpers/InventoryHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { Common, HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "@spt-aki/models/eft/hideout/IHideoutContinuousProductionStartRequestData"; @@ -201,22 +201,10 @@ export declare class HideoutHelper { * @returns coin slot count */ protected getBTCSlots(pmcData: IPmcData): number; - /** - * Does profile have elite hideout management skill - * @param pmcData Profile to look at - * @returns True if profile has skill - */ - protected hasEliteHideoutManagementSkill(pmcData: IPmcData): boolean; /** * Get a count of bitcoins player miner can hold */ protected getBitcoinMinerContainerSlotSize(): number; - /** - * Get the hideout management skill from player profile - * @param pmcData Profile to look at - * @returns Hideout management skill object - */ - protected getHideoutManagementSkill(pmcData: IPmcData): Common; /** * HideoutManagement skill gives a consumption bonus the higher the level * 0.5% per level per 1-51, (25.5% at max) diff --git a/TypeScript/15HttpListenerExample/types/helpers/ItemHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/ItemHelper.d.ts index 47823bc..e1c7720 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/ItemHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/ItemHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -24,10 +25,11 @@ declare class ItemHelper { protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; + protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl diff --git a/TypeScript/15HttpListenerExample/types/helpers/ProfileHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/ProfileHelper.d.ts index 781f980..938c796 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/ProfileHelper.d.ts @@ -1,11 +1,13 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IValidateNicknameRequestData } from "@spt-aki/models/eft/profile/IValidateNicknameRequestData"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; +import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileSnapshotService } from "@spt-aki/services/ProfileSnapshotService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -19,7 +21,8 @@ export declare class ProfileHelper { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected profileSnapshotService: ProfileSnapshotService; - constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); + protected localisationService: LocalisationService; + constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, localisationService: LocalisationService); /** * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id @@ -101,4 +104,21 @@ export declare class ProfileHelper { * @param keyToIncrement Key */ incrementStatCounter(counters: CounterKeyValue[], keyToIncrement: string): void; + /** + * Check if player has a skill at elite level + * @param skillType Skill to check + * @param pmcProfile Profile to find skill in + * @returns True if player has skill at elite level + */ + hasEliteSkillLevel(skillType: SkillTypes, pmcProfile: IPmcData): boolean; + /** + * Add points to a specific skill in player profile + * @param skill Skill to add points to + * @param pointsToAdd Points to add + * @param pmcProfile Player profile with skill + * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code + * @returns + */ + addSkillPointsToPlayer(pmcProfile: IPmcData, skill: SkillTypes, pointsToAdd: number, useSkillProgressRateMultipler?: boolean): void; + getSkillFromProfile(pmcData: IPmcData, skill: SkillTypes): Common; } diff --git a/TypeScript/15HttpListenerExample/types/helpers/QuestHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/QuestHelper.d.ts index 1e40e53..0dda05b 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/QuestHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/QuestHelper.d.ts @@ -6,7 +6,7 @@ import { QuestConditionHelper } from "@spt-aki/helpers/QuestConditionHelper"; import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "@spt-aki/models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; @@ -66,14 +66,12 @@ export declare class QuestHelper { */ getDeltaQuests(before: IQuest[], after: IQuest[]): IQuest[]; /** - * Increase skill points of a skill on player profile - * Dupe of PlayerService.incrementSkillLevel() - * @param sessionID Session id - * @param pmcData Player profile - * @param skillName Name of skill to increase skill points of - * @param progressAmount Amount of skill points to add to skill + * Adjust skill experience for low skill levels, mimicing the official client + * @param profileSkill the skill experience is being added to + * @param progressAmount the amount of experience being added to the skill + * @returns the adjusted skill progress gain */ - rewardSkillPoints(sessionID: string, pmcData: IPmcData, skillName: string, progressAmount: number): void; + adjustSkillExpForLowLevels(profileSkill: Common, progressAmount: number): number; /** * Get quest name by quest id * @param questId id to get diff --git a/TypeScript/15HttpListenerExample/types/loaders/PreAkiModLoader.d.ts b/TypeScript/15HttpListenerExample/types/loaders/PreAkiModLoader.d.ts index 869dfbb..71fd745 100644 --- a/TypeScript/15HttpListenerExample/types/loaders/PreAkiModLoader.d.ts +++ b/TypeScript/15HttpListenerExample/types/loaders/PreAkiModLoader.d.ts @@ -29,7 +29,7 @@ export declare class PreAkiModLoader implements IModLoader { protected imported: Record; protected akiConfig: ICoreConfig; protected serverDependencies: Record; - protected skippedMods: string[]; + protected skippedMods: Set; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, bundleLoader: BundleLoader, localisationService: LocalisationService, configServer: ConfigServer, modLoadOrder: ModLoadOrder, modTypeCheck: ModTypeCheck); load(container: DependencyContainer): Promise; /** @@ -44,27 +44,22 @@ export declare class PreAkiModLoader implements IModLoader { 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 + * @param modPackageData map of mod package.json data */ - protected checkForDuplicateMods(modPackageData: Record): void; + protected checkForDuplicateMods(modPackageData: Map): void; /** - * Check for and return duplicate strings inside an array - * @param stringArray Array to check for duplicates - * @returns string array of duplicates, empty if none found - */ - protected getDuplicates(stringArray: string[]): string[]; - /** - * Get an array of mods with errors that prevent them from working with SPT + * Returns an array of valid mods. + * * @param mods mods to validate - * @returns Mod names as array + * @returns array of mod folder names */ - protected getBrokenMods(mods: string[]): string[]; + protected getValidMods(mods: string[]): string[]; /** * Get packageJson data for mods * @param mods mods to get packageJson for - * @returns dictionary + * @returns map */ - protected getModsPackageData(mods: string[]): Record; + protected getModsPackageData(mods: string[]): Map; /** * Is the passed in mod compatible with the running server version * @param mod Mod to check compatibiltiy with AKI @@ -86,10 +81,17 @@ export declare class PreAkiModLoader implements IModLoader { * Compile mod and add into class property "imported" * @param mod Name of mod to compile/add */ - protected addModAsync(mod: string): Promise; + protected addModAsync(mod: string, pkg: IPackageJsonData): Promise; + /** + * Checks if a given mod should be loaded or skipped. + * + * @param pkg mod package.json data + * @returns + */ + protected shouldSkipMod(pkg: IPackageJsonData): boolean; protected autoInstallDependencies(modPath: string, pkg: IPackageJsonData): void; - protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Record): boolean; - protected isModCompatible(mod: IPackageJsonData, loadedMods: Record): boolean; + protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Map): boolean; + protected isModCompatible(mod: IPackageJsonData, loadedMods: Map): boolean; /** * Validate a mod passes a number of checks * @param modName name of mod in /mods/ to validate diff --git a/TypeScript/15HttpListenerExample/types/models/enums/SkillTypes.d.ts b/TypeScript/15HttpListenerExample/types/models/enums/SkillTypes.d.ts index 4eb90af..dc059a8 100644 --- a/TypeScript/15HttpListenerExample/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/enums/SkillTypes.d.ts @@ -1,4 +1,6 @@ export declare enum SkillTypes { + BOT_RELOAD = "BotReload", + BOT_SOUND = "BotSound", HIDEOUT_MANAGEMENT = "HideoutManagement", CRAFTING = "Crafting", METABOLISM = "Metabolism", @@ -19,6 +21,7 @@ export declare enum SkillTypes { ATTENTION = "Attention", CHARISMA = "Charisma", MEMORY = "Memory", + MELEE = "Melee", SURGERY = "Surgery", AIM_DRILLS = "AimDrills", TROUBLESHOOTING = "TroubleShooting", @@ -31,6 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", + /** Also called Weapon Maintenance*/ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/IBotConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/IBotConfig.d.ts index c76eda7..24c8c19 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/IBotConfig.d.ts @@ -102,6 +102,8 @@ export interface EquipmentFilters { weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; /** Same as weightingAdjustments but based on player level instead of bot level */ weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; + /** Should the stock mod be forced to spawn on bot */ + forceStock: boolean; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/IQuestConfig.d.ts index 3e3b2be..8a71eb9 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/IQuestConfig.d.ts @@ -55,6 +55,8 @@ export interface IRewardScaling { items: number[]; reputation: number[]; rewardSpread: number; + skillRewardChance: number[]; + skillPointReward: number[]; } export interface ITraderWhitelist { traderId: string; @@ -66,7 +68,7 @@ export interface IRepeatableQuestTypesConfig { Pickup: IPickup; Elimination: IEliminationConfig[]; } -export interface IExploration { +export interface IExploration extends IBaseQuestConfig { maxExtracts: number; specificExits: ISpecificExits; } @@ -74,7 +76,7 @@ export interface ISpecificExits { probability: number; passageRequirementWhitelist: string[]; } -export interface ICompletion { +export interface ICompletion extends IBaseQuestConfig { minRequestedAmount: number; maxRequestedAmount: number; minRequestedBulletAmount: number; @@ -82,7 +84,7 @@ export interface ICompletion { useWhitelist: boolean; useBlacklist: boolean; } -export interface IPickup { +export interface IPickup extends IBaseQuestConfig { ItemTypeToFetchWithMaxCount: IPickupTypeWithMaxCount[]; } export interface IPickupTypeWithMaxCount { @@ -90,7 +92,7 @@ export interface IPickupTypeWithMaxCount { maxPickupCount: number; minPickupCount: number; } -export interface IEliminationConfig { +export interface IEliminationConfig extends IBaseQuestConfig { levelRange: MinMax; targets: ITarget[]; bodyPartProb: number; @@ -111,6 +113,9 @@ export interface IEliminationConfig { weaponRequirementProb: number; weaponRequirements: IWeaponRequirement[]; } +export interface IBaseQuestConfig { + possibleSkillRewards: string[]; +} export interface ITarget extends IProbabilityObject { data: IBossInfo; } diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/IRepairConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/IRepairConfig.d.ts index 1ae082d..9e23cc4 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/IRepairConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/IRepairConfig.d.ts @@ -9,6 +9,7 @@ export interface IRepairConfig extends IBaseConfig { /** INT gain multiplier per repaired item type */ repairKitIntellectGainMultiplier: IIntellectGainValues; maxIntellectGainPerRepair: IMaxIntellectGainValues; + weaponTreatment: IWeaponTreatmentRepairValues; repairKit: RepairKit; } export interface IIntellectGainValues { @@ -19,6 +20,16 @@ export interface IMaxIntellectGainValues { kit: number; trader: number; } +export interface IWeaponTreatmentRepairValues { + /** The chance to gain more weapon maintenance skill */ + critSuccessChance: number; + critSuccessAmount: number; + /** The chance to gain less weapon maintenance skill */ + critFailureChance: number; + critFailureAmount: number; + /** The multiplier used for calculating weapon maintenance XP */ + pointGainMultiplier: number; +} export interface RepairKit { armor: BonusSettings; weapon: BonusSettings; diff --git a/TypeScript/15HttpListenerExample/types/services/PlayerService.d.ts b/TypeScript/15HttpListenerExample/types/services/PlayerService.d.ts index edf269e..f24e0dc 100644 --- a/TypeScript/15HttpListenerExample/types/services/PlayerService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/PlayerService.d.ts @@ -9,15 +9,6 @@ export declare class PlayerService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, databaseServer: DatabaseServer); - /** - * Dupe of QuestHelper.rewardsSkillPoints() - * Add xp to a player skill - * @param pmcData Player profile - * @param skillName Name of skill to increment - * @param amount Amount of skill points to add to skill - * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code - */ - incrementSkillLevel(pmcData: IPmcData, skillName: string, amount: number, useSkillProgressRateMultipler?: boolean): void; /** * Get level of player * @param pmcData Player profile diff --git a/TypeScript/15HttpListenerExample/types/services/RepairService.d.ts b/TypeScript/15HttpListenerExample/types/services/RepairService.d.ts index b8ffbaa..8f9e7e9 100644 --- a/TypeScript/15HttpListenerExample/types/services/RepairService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/RepairService.d.ts @@ -1,5 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { QuestHelper } from "@spt-aki/helpers/QuestHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { RepairHelper } from "@spt-aki/helpers/RepairHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; @@ -9,6 +9,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { RepairKitsInfo } from "@spt-aki/models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "@spt-aki/models/eft/repair/ITraderRepairActionDataRequest"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { BonusSettings, IRepairConfig } from "@spt-aki/models/spt/config/IRepairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -19,7 +20,7 @@ import { RandomUtil } from "@spt-aki/utils/RandomUtil"; export declare class RepairService { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected questHelper: QuestHelper; + protected profileHelper: ProfileHelper; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; @@ -29,7 +30,7 @@ export declare class RepairService { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id @@ -56,6 +57,12 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + /** + * Return an appromixation of the amount of skill points live would return for the given repairDetails + * @param repairDetails the repair details to calculate skill points for + * @returns the number of skill points to reward the user + */ + protected getWeaponRepairSkillPoints(repairDetails: RepairDetails): number; /** * * @param sessionId Session id @@ -81,6 +88,13 @@ export declare class RepairService { * @returns Multiplier value */ protected getBonusMultiplierValue(skillBonusName: string, pmcData: IPmcData): number; + /** + * Should a repair kit apply total durability loss on repair + * @param pmcData Player profile + * @param applyRandomizeDurabilityLoss Value from repair config + * @returns True if loss should be applied + */ + protected shouldRepairKitApplyDurabilityLoss(pmcData: IPmcData, applyRandomizeDurabilityLoss: boolean): boolean; /** * Update repair kits Resource object if it doesn't exist * @param repairKitDetails Repair kit details from db @@ -112,7 +126,7 @@ export declare class RepairService { * @param itemTemplate Item to check for skill * @returns Skill name */ - protected getItemSkillType(itemTemplate: ITemplateItem): string; + protected getItemSkillType(itemTemplate: ITemplateItem): SkillTypes; /** * Ensure multiplier is between 1 and 0.01 * @param receiveDurabilityMaxPercent Max durabiltiy percent @@ -123,6 +137,7 @@ export declare class RepairService { } export declare class RepairDetails { repairCost?: number; + repairPoints?: number; repairedItem: Item; repairedItemIsArmor: boolean; repairAmount: number; diff --git a/TypeScript/15HttpListenerExample/types/utils/App.d.ts b/TypeScript/15HttpListenerExample/types/utils/App.d.ts index 1839695..64800ce 100644 --- a/TypeScript/15HttpListenerExample/types/utils/App.d.ts +++ b/TypeScript/15HttpListenerExample/types/utils/App.d.ts @@ -1,6 +1,8 @@ import { OnLoad } from "@spt-aki/di/OnLoad"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -8,11 +10,13 @@ export declare class App { protected logger: ILogger; protected timeUtil: TimeUtil; protected localisationService: LocalisationService; + protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/16ImporterUtil/types/controllers/GameController.d.ts b/TypeScript/16ImporterUtil/types/controllers/GameController.d.ts index 640a8c1..168071d 100644 --- a/TypeScript/16ImporterUtil/types/controllers/GameController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/GameController.d.ts @@ -61,6 +61,10 @@ export declare class GameController { * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + /** + * Out of date/incorrectly made trader mods forget this data + */ + protected checkTraderRepairValuesExist(): void; protected addCustomLooseLootPositions(): void; protected adjustLooseLootSpawnProbabilities(): void; protected setHideoutAreasAndCraftsTo40Secs(): void; diff --git a/TypeScript/16ImporterUtil/types/controllers/InsuranceController.d.ts b/TypeScript/16ImporterUtil/types/controllers/InsuranceController.d.ts index b1e8fe6..0ee30ed 100644 --- a/TypeScript/16ImporterUtil/types/controllers/InsuranceController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/InsuranceController.d.ts @@ -8,7 +8,7 @@ import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGet import { IGetInsuranceCostResponseData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostResponseData"; import { IInsureRequestData } from "@spt-aki/models/eft/insurance/IInsureRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; -import { Insurance, ISystemData } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ISystemData, Insurance } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IInsuranceConfig } from "@spt-aki/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; diff --git a/TypeScript/16ImporterUtil/types/controllers/RepeatableQuestController.d.ts b/TypeScript/16ImporterUtil/types/controllers/RepeatableQuestController.d.ts index b09b540..a3ebc1c 100644 --- a/TypeScript/16ImporterUtil/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/RepeatableQuestController.d.ts @@ -13,6 +13,7 @@ import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -21,8 +22,9 @@ import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RepeatableQuestController { - protected timeUtil: TimeUtil; protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; @@ -37,7 +39,7 @@ export declare class RepeatableQuestController { protected questHelper: QuestHelper; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. @@ -64,6 +66,13 @@ export declare class RepeatableQuestController { * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Get the number of quests to generate - takes into account charisma state of player + * @param repeatableConfig Config + * @param pmcData Player profile + * @returns Quest count + */ + protected getQuestCount(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): number; /** * Get repeatable quest data from profile from name (daily/weekly), creates base repeatable quest object if none exists * @param repeatableConfig daily/weekly config diff --git a/TypeScript/16ImporterUtil/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/BotEquipmentModGenerator.d.ts index 05266dd..75530c7 100644 --- a/TypeScript/16ImporterUtil/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/BotEquipmentModGenerator.d.ts @@ -179,7 +179,7 @@ export declare class BotEquipmentModGenerator { * Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots. * This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine" * @param items The items where the CylinderMagazine's camora are appended to - * @param modPool modPool which should include available cartrigdes + * @param modPool modPool which should include available cartridges * @param parentId The CylinderMagazine's UID * @param parentTemplate The CylinderMagazine's template */ diff --git a/TypeScript/16ImporterUtil/types/generators/BotLootGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/BotLootGenerator.d.ts index e937a4d..7a4c521 100644 --- a/TypeScript/16ImporterUtil/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/BotLootGenerator.d.ts @@ -83,7 +83,7 @@ export declare class BotLootGenerator { * @param equipmentSlot slot to place the preset in (backpack) * @param templateInventory bots template, assault.json * @param modChances chances for mods to spawn on weapon - * @param botRole bots role, .e.g. pmcBot + * @param botRole bots role .e.g. pmcBot * @param isPmc are we generating for a pmc */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; @@ -120,16 +120,16 @@ export declare class BotLootGenerator { protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; /** * Randomise the stack size of a money object, uses different values for pmc or scavs - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param moneyItem Money stack to randomise + * @param isPmc Is money on a PMC bot + * @param itemTemplate item details from db + * @param moneyItem Money item to randomise */ protected randomiseMoneyStackSize(isPmc: boolean, itemTemplate: ITemplateItem, moneyItem: Item): void; /** * Randomise the size of an ammo stack - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param ammoItem Ammo stack to randomise + * @param isPmc Is ammo on a PMC bot + * @param itemTemplate item details from db + * @param ammoItem Ammo item to randomise */ protected randomiseAmmoStackSize(isPmc: boolean, itemTemplate: ITemplateItem, ammoItem: Item): void; /** diff --git a/TypeScript/16ImporterUtil/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/RepeatableQuestGenerator.d.ts index 40a3c16..44c38be 100644 --- a/TypeScript/16ImporterUtil/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/RepeatableQuestGenerator.d.ts @@ -8,7 +8,7 @@ import { Exit } from "@spt-aki/models/eft/common/ILocationBase"; import { TraderInfo } from "@spt-aki/models/eft/common/tables/IBotBase"; import { ICompletion, ICompletionAvailableFor, IElimination, IEliminationCondition, IExploration, IExplorationCondition, IPickup, IRepeatableQuest, IReward, IRewards } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; -import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; @@ -155,7 +155,7 @@ export declare class RepeatableQuestGenerator { * @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ - protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig): IRewards; + protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IRewards; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config diff --git a/TypeScript/16ImporterUtil/types/helpers/HideoutHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/HideoutHelper.d.ts index 93f8fb1..0cfc649 100644 --- a/TypeScript/16ImporterUtil/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/HideoutHelper.d.ts @@ -1,7 +1,7 @@ import { InventoryHelper } from "@spt-aki/helpers/InventoryHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { Common, HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "@spt-aki/models/eft/hideout/IHideoutContinuousProductionStartRequestData"; @@ -201,22 +201,10 @@ export declare class HideoutHelper { * @returns coin slot count */ protected getBTCSlots(pmcData: IPmcData): number; - /** - * Does profile have elite hideout management skill - * @param pmcData Profile to look at - * @returns True if profile has skill - */ - protected hasEliteHideoutManagementSkill(pmcData: IPmcData): boolean; /** * Get a count of bitcoins player miner can hold */ protected getBitcoinMinerContainerSlotSize(): number; - /** - * Get the hideout management skill from player profile - * @param pmcData Profile to look at - * @returns Hideout management skill object - */ - protected getHideoutManagementSkill(pmcData: IPmcData): Common; /** * HideoutManagement skill gives a consumption bonus the higher the level * 0.5% per level per 1-51, (25.5% at max) diff --git a/TypeScript/16ImporterUtil/types/helpers/ItemHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/ItemHelper.d.ts index 47823bc..e1c7720 100644 --- a/TypeScript/16ImporterUtil/types/helpers/ItemHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/ItemHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -24,10 +25,11 @@ declare class ItemHelper { protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; + protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl diff --git a/TypeScript/16ImporterUtil/types/helpers/ProfileHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/ProfileHelper.d.ts index 781f980..938c796 100644 --- a/TypeScript/16ImporterUtil/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/ProfileHelper.d.ts @@ -1,11 +1,13 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IValidateNicknameRequestData } from "@spt-aki/models/eft/profile/IValidateNicknameRequestData"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; +import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileSnapshotService } from "@spt-aki/services/ProfileSnapshotService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -19,7 +21,8 @@ export declare class ProfileHelper { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected profileSnapshotService: ProfileSnapshotService; - constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); + protected localisationService: LocalisationService; + constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, localisationService: LocalisationService); /** * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id @@ -101,4 +104,21 @@ export declare class ProfileHelper { * @param keyToIncrement Key */ incrementStatCounter(counters: CounterKeyValue[], keyToIncrement: string): void; + /** + * Check if player has a skill at elite level + * @param skillType Skill to check + * @param pmcProfile Profile to find skill in + * @returns True if player has skill at elite level + */ + hasEliteSkillLevel(skillType: SkillTypes, pmcProfile: IPmcData): boolean; + /** + * Add points to a specific skill in player profile + * @param skill Skill to add points to + * @param pointsToAdd Points to add + * @param pmcProfile Player profile with skill + * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code + * @returns + */ + addSkillPointsToPlayer(pmcProfile: IPmcData, skill: SkillTypes, pointsToAdd: number, useSkillProgressRateMultipler?: boolean): void; + getSkillFromProfile(pmcData: IPmcData, skill: SkillTypes): Common; } diff --git a/TypeScript/16ImporterUtil/types/helpers/QuestHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/QuestHelper.d.ts index 1e40e53..0dda05b 100644 --- a/TypeScript/16ImporterUtil/types/helpers/QuestHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/QuestHelper.d.ts @@ -6,7 +6,7 @@ import { QuestConditionHelper } from "@spt-aki/helpers/QuestConditionHelper"; import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "@spt-aki/models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; @@ -66,14 +66,12 @@ export declare class QuestHelper { */ getDeltaQuests(before: IQuest[], after: IQuest[]): IQuest[]; /** - * Increase skill points of a skill on player profile - * Dupe of PlayerService.incrementSkillLevel() - * @param sessionID Session id - * @param pmcData Player profile - * @param skillName Name of skill to increase skill points of - * @param progressAmount Amount of skill points to add to skill + * Adjust skill experience for low skill levels, mimicing the official client + * @param profileSkill the skill experience is being added to + * @param progressAmount the amount of experience being added to the skill + * @returns the adjusted skill progress gain */ - rewardSkillPoints(sessionID: string, pmcData: IPmcData, skillName: string, progressAmount: number): void; + adjustSkillExpForLowLevels(profileSkill: Common, progressAmount: number): number; /** * Get quest name by quest id * @param questId id to get diff --git a/TypeScript/16ImporterUtil/types/loaders/PreAkiModLoader.d.ts b/TypeScript/16ImporterUtil/types/loaders/PreAkiModLoader.d.ts index 869dfbb..71fd745 100644 --- a/TypeScript/16ImporterUtil/types/loaders/PreAkiModLoader.d.ts +++ b/TypeScript/16ImporterUtil/types/loaders/PreAkiModLoader.d.ts @@ -29,7 +29,7 @@ export declare class PreAkiModLoader implements IModLoader { protected imported: Record; protected akiConfig: ICoreConfig; protected serverDependencies: Record; - protected skippedMods: string[]; + protected skippedMods: Set; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, bundleLoader: BundleLoader, localisationService: LocalisationService, configServer: ConfigServer, modLoadOrder: ModLoadOrder, modTypeCheck: ModTypeCheck); load(container: DependencyContainer): Promise; /** @@ -44,27 +44,22 @@ export declare class PreAkiModLoader implements IModLoader { 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 + * @param modPackageData map of mod package.json data */ - protected checkForDuplicateMods(modPackageData: Record): void; + protected checkForDuplicateMods(modPackageData: Map): void; /** - * Check for and return duplicate strings inside an array - * @param stringArray Array to check for duplicates - * @returns string array of duplicates, empty if none found - */ - protected getDuplicates(stringArray: string[]): string[]; - /** - * Get an array of mods with errors that prevent them from working with SPT + * Returns an array of valid mods. + * * @param mods mods to validate - * @returns Mod names as array + * @returns array of mod folder names */ - protected getBrokenMods(mods: string[]): string[]; + protected getValidMods(mods: string[]): string[]; /** * Get packageJson data for mods * @param mods mods to get packageJson for - * @returns dictionary + * @returns map */ - protected getModsPackageData(mods: string[]): Record; + protected getModsPackageData(mods: string[]): Map; /** * Is the passed in mod compatible with the running server version * @param mod Mod to check compatibiltiy with AKI @@ -86,10 +81,17 @@ export declare class PreAkiModLoader implements IModLoader { * Compile mod and add into class property "imported" * @param mod Name of mod to compile/add */ - protected addModAsync(mod: string): Promise; + protected addModAsync(mod: string, pkg: IPackageJsonData): Promise; + /** + * Checks if a given mod should be loaded or skipped. + * + * @param pkg mod package.json data + * @returns + */ + protected shouldSkipMod(pkg: IPackageJsonData): boolean; protected autoInstallDependencies(modPath: string, pkg: IPackageJsonData): void; - protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Record): boolean; - protected isModCompatible(mod: IPackageJsonData, loadedMods: Record): boolean; + protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Map): boolean; + protected isModCompatible(mod: IPackageJsonData, loadedMods: Map): boolean; /** * Validate a mod passes a number of checks * @param modName name of mod in /mods/ to validate diff --git a/TypeScript/16ImporterUtil/types/models/enums/SkillTypes.d.ts b/TypeScript/16ImporterUtil/types/models/enums/SkillTypes.d.ts index 4eb90af..dc059a8 100644 --- a/TypeScript/16ImporterUtil/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/16ImporterUtil/types/models/enums/SkillTypes.d.ts @@ -1,4 +1,6 @@ export declare enum SkillTypes { + BOT_RELOAD = "BotReload", + BOT_SOUND = "BotSound", HIDEOUT_MANAGEMENT = "HideoutManagement", CRAFTING = "Crafting", METABOLISM = "Metabolism", @@ -19,6 +21,7 @@ export declare enum SkillTypes { ATTENTION = "Attention", CHARISMA = "Charisma", MEMORY = "Memory", + MELEE = "Melee", SURGERY = "Surgery", AIM_DRILLS = "AimDrills", TROUBLESHOOTING = "TroubleShooting", @@ -31,6 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", + /** Also called Weapon Maintenance*/ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/IBotConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/IBotConfig.d.ts index c76eda7..24c8c19 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/IBotConfig.d.ts @@ -102,6 +102,8 @@ export interface EquipmentFilters { weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; /** Same as weightingAdjustments but based on player level instead of bot level */ weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; + /** Should the stock mod be forced to spawn on bot */ + forceStock: boolean; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/IQuestConfig.d.ts index 3e3b2be..8a71eb9 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/IQuestConfig.d.ts @@ -55,6 +55,8 @@ export interface IRewardScaling { items: number[]; reputation: number[]; rewardSpread: number; + skillRewardChance: number[]; + skillPointReward: number[]; } export interface ITraderWhitelist { traderId: string; @@ -66,7 +68,7 @@ export interface IRepeatableQuestTypesConfig { Pickup: IPickup; Elimination: IEliminationConfig[]; } -export interface IExploration { +export interface IExploration extends IBaseQuestConfig { maxExtracts: number; specificExits: ISpecificExits; } @@ -74,7 +76,7 @@ export interface ISpecificExits { probability: number; passageRequirementWhitelist: string[]; } -export interface ICompletion { +export interface ICompletion extends IBaseQuestConfig { minRequestedAmount: number; maxRequestedAmount: number; minRequestedBulletAmount: number; @@ -82,7 +84,7 @@ export interface ICompletion { useWhitelist: boolean; useBlacklist: boolean; } -export interface IPickup { +export interface IPickup extends IBaseQuestConfig { ItemTypeToFetchWithMaxCount: IPickupTypeWithMaxCount[]; } export interface IPickupTypeWithMaxCount { @@ -90,7 +92,7 @@ export interface IPickupTypeWithMaxCount { maxPickupCount: number; minPickupCount: number; } -export interface IEliminationConfig { +export interface IEliminationConfig extends IBaseQuestConfig { levelRange: MinMax; targets: ITarget[]; bodyPartProb: number; @@ -111,6 +113,9 @@ export interface IEliminationConfig { weaponRequirementProb: number; weaponRequirements: IWeaponRequirement[]; } +export interface IBaseQuestConfig { + possibleSkillRewards: string[]; +} export interface ITarget extends IProbabilityObject { data: IBossInfo; } diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/IRepairConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/IRepairConfig.d.ts index 1ae082d..9e23cc4 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/IRepairConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/IRepairConfig.d.ts @@ -9,6 +9,7 @@ export interface IRepairConfig extends IBaseConfig { /** INT gain multiplier per repaired item type */ repairKitIntellectGainMultiplier: IIntellectGainValues; maxIntellectGainPerRepair: IMaxIntellectGainValues; + weaponTreatment: IWeaponTreatmentRepairValues; repairKit: RepairKit; } export interface IIntellectGainValues { @@ -19,6 +20,16 @@ export interface IMaxIntellectGainValues { kit: number; trader: number; } +export interface IWeaponTreatmentRepairValues { + /** The chance to gain more weapon maintenance skill */ + critSuccessChance: number; + critSuccessAmount: number; + /** The chance to gain less weapon maintenance skill */ + critFailureChance: number; + critFailureAmount: number; + /** The multiplier used for calculating weapon maintenance XP */ + pointGainMultiplier: number; +} export interface RepairKit { armor: BonusSettings; weapon: BonusSettings; diff --git a/TypeScript/16ImporterUtil/types/services/PlayerService.d.ts b/TypeScript/16ImporterUtil/types/services/PlayerService.d.ts index edf269e..f24e0dc 100644 --- a/TypeScript/16ImporterUtil/types/services/PlayerService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/PlayerService.d.ts @@ -9,15 +9,6 @@ export declare class PlayerService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, databaseServer: DatabaseServer); - /** - * Dupe of QuestHelper.rewardsSkillPoints() - * Add xp to a player skill - * @param pmcData Player profile - * @param skillName Name of skill to increment - * @param amount Amount of skill points to add to skill - * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code - */ - incrementSkillLevel(pmcData: IPmcData, skillName: string, amount: number, useSkillProgressRateMultipler?: boolean): void; /** * Get level of player * @param pmcData Player profile diff --git a/TypeScript/16ImporterUtil/types/services/RepairService.d.ts b/TypeScript/16ImporterUtil/types/services/RepairService.d.ts index b8ffbaa..8f9e7e9 100644 --- a/TypeScript/16ImporterUtil/types/services/RepairService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/RepairService.d.ts @@ -1,5 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { QuestHelper } from "@spt-aki/helpers/QuestHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { RepairHelper } from "@spt-aki/helpers/RepairHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; @@ -9,6 +9,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { RepairKitsInfo } from "@spt-aki/models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "@spt-aki/models/eft/repair/ITraderRepairActionDataRequest"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { BonusSettings, IRepairConfig } from "@spt-aki/models/spt/config/IRepairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -19,7 +20,7 @@ import { RandomUtil } from "@spt-aki/utils/RandomUtil"; export declare class RepairService { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected questHelper: QuestHelper; + protected profileHelper: ProfileHelper; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; @@ -29,7 +30,7 @@ export declare class RepairService { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id @@ -56,6 +57,12 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + /** + * Return an appromixation of the amount of skill points live would return for the given repairDetails + * @param repairDetails the repair details to calculate skill points for + * @returns the number of skill points to reward the user + */ + protected getWeaponRepairSkillPoints(repairDetails: RepairDetails): number; /** * * @param sessionId Session id @@ -81,6 +88,13 @@ export declare class RepairService { * @returns Multiplier value */ protected getBonusMultiplierValue(skillBonusName: string, pmcData: IPmcData): number; + /** + * Should a repair kit apply total durability loss on repair + * @param pmcData Player profile + * @param applyRandomizeDurabilityLoss Value from repair config + * @returns True if loss should be applied + */ + protected shouldRepairKitApplyDurabilityLoss(pmcData: IPmcData, applyRandomizeDurabilityLoss: boolean): boolean; /** * Update repair kits Resource object if it doesn't exist * @param repairKitDetails Repair kit details from db @@ -112,7 +126,7 @@ export declare class RepairService { * @param itemTemplate Item to check for skill * @returns Skill name */ - protected getItemSkillType(itemTemplate: ITemplateItem): string; + protected getItemSkillType(itemTemplate: ITemplateItem): SkillTypes; /** * Ensure multiplier is between 1 and 0.01 * @param receiveDurabilityMaxPercent Max durabiltiy percent @@ -123,6 +137,7 @@ export declare class RepairService { } export declare class RepairDetails { repairCost?: number; + repairPoints?: number; repairedItem: Item; repairedItemIsArmor: boolean; repairAmount: number; diff --git a/TypeScript/16ImporterUtil/types/utils/App.d.ts b/TypeScript/16ImporterUtil/types/utils/App.d.ts index 1839695..64800ce 100644 --- a/TypeScript/16ImporterUtil/types/utils/App.d.ts +++ b/TypeScript/16ImporterUtil/types/utils/App.d.ts @@ -1,6 +1,8 @@ import { OnLoad } from "@spt-aki/di/OnLoad"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -8,11 +10,13 @@ export declare class App { protected logger: ILogger; protected timeUtil: TimeUtil; protected localisationService: LocalisationService; + protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/GameController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/GameController.d.ts index 640a8c1..168071d 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/GameController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/GameController.d.ts @@ -61,6 +61,10 @@ export declare class GameController { * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + /** + * Out of date/incorrectly made trader mods forget this data + */ + protected checkTraderRepairValuesExist(): void; protected addCustomLooseLootPositions(): void; protected adjustLooseLootSpawnProbabilities(): void; protected setHideoutAreasAndCraftsTo40Secs(): void; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/InsuranceController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/InsuranceController.d.ts index b1e8fe6..0ee30ed 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/InsuranceController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/InsuranceController.d.ts @@ -8,7 +8,7 @@ import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGet import { IGetInsuranceCostResponseData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostResponseData"; import { IInsureRequestData } from "@spt-aki/models/eft/insurance/IInsureRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; -import { Insurance, ISystemData } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ISystemData, Insurance } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IInsuranceConfig } from "@spt-aki/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/RepeatableQuestController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/RepeatableQuestController.d.ts index b09b540..a3ebc1c 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/RepeatableQuestController.d.ts @@ -13,6 +13,7 @@ import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -21,8 +22,9 @@ import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RepeatableQuestController { - protected timeUtil: TimeUtil; protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; @@ -37,7 +39,7 @@ export declare class RepeatableQuestController { protected questHelper: QuestHelper; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. @@ -64,6 +66,13 @@ export declare class RepeatableQuestController { * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Get the number of quests to generate - takes into account charisma state of player + * @param repeatableConfig Config + * @param pmcData Player profile + * @returns Quest count + */ + protected getQuestCount(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): number; /** * Get repeatable quest data from profile from name (daily/weekly), creates base repeatable quest object if none exists * @param repeatableConfig daily/weekly config diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotEquipmentModGenerator.d.ts index 05266dd..75530c7 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotEquipmentModGenerator.d.ts @@ -179,7 +179,7 @@ export declare class BotEquipmentModGenerator { * Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots. * This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine" * @param items The items where the CylinderMagazine's camora are appended to - * @param modPool modPool which should include available cartrigdes + * @param modPool modPool which should include available cartridges * @param parentId The CylinderMagazine's UID * @param parentTemplate The CylinderMagazine's template */ diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotLootGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotLootGenerator.d.ts index e937a4d..7a4c521 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotLootGenerator.d.ts @@ -83,7 +83,7 @@ export declare class BotLootGenerator { * @param equipmentSlot slot to place the preset in (backpack) * @param templateInventory bots template, assault.json * @param modChances chances for mods to spawn on weapon - * @param botRole bots role, .e.g. pmcBot + * @param botRole bots role .e.g. pmcBot * @param isPmc are we generating for a pmc */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; @@ -120,16 +120,16 @@ export declare class BotLootGenerator { protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; /** * Randomise the stack size of a money object, uses different values for pmc or scavs - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param moneyItem Money stack to randomise + * @param isPmc Is money on a PMC bot + * @param itemTemplate item details from db + * @param moneyItem Money item to randomise */ protected randomiseMoneyStackSize(isPmc: boolean, itemTemplate: ITemplateItem, moneyItem: Item): void; /** * Randomise the size of an ammo stack - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param ammoItem Ammo stack to randomise + * @param isPmc Is ammo on a PMC bot + * @param itemTemplate item details from db + * @param ammoItem Ammo item to randomise */ protected randomiseAmmoStackSize(isPmc: boolean, itemTemplate: ITemplateItem, ammoItem: Item): void; /** diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/RepeatableQuestGenerator.d.ts index 40a3c16..44c38be 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/RepeatableQuestGenerator.d.ts @@ -8,7 +8,7 @@ import { Exit } from "@spt-aki/models/eft/common/ILocationBase"; import { TraderInfo } from "@spt-aki/models/eft/common/tables/IBotBase"; import { ICompletion, ICompletionAvailableFor, IElimination, IEliminationCondition, IExploration, IExplorationCondition, IPickup, IRepeatableQuest, IReward, IRewards } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; -import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; @@ -155,7 +155,7 @@ export declare class RepeatableQuestGenerator { * @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ - protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig): IRewards; + protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IRewards; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/HideoutHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/HideoutHelper.d.ts index 93f8fb1..0cfc649 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/HideoutHelper.d.ts @@ -1,7 +1,7 @@ import { InventoryHelper } from "@spt-aki/helpers/InventoryHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { Common, HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "@spt-aki/models/eft/hideout/IHideoutContinuousProductionStartRequestData"; @@ -201,22 +201,10 @@ export declare class HideoutHelper { * @returns coin slot count */ protected getBTCSlots(pmcData: IPmcData): number; - /** - * Does profile have elite hideout management skill - * @param pmcData Profile to look at - * @returns True if profile has skill - */ - protected hasEliteHideoutManagementSkill(pmcData: IPmcData): boolean; /** * Get a count of bitcoins player miner can hold */ protected getBitcoinMinerContainerSlotSize(): number; - /** - * Get the hideout management skill from player profile - * @param pmcData Profile to look at - * @returns Hideout management skill object - */ - protected getHideoutManagementSkill(pmcData: IPmcData): Common; /** * HideoutManagement skill gives a consumption bonus the higher the level * 0.5% per level per 1-51, (25.5% at max) diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/ItemHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/ItemHelper.d.ts index 47823bc..e1c7720 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/ItemHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/ItemHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -24,10 +25,11 @@ declare class ItemHelper { protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; + protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/ProfileHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/ProfileHelper.d.ts index 781f980..938c796 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/ProfileHelper.d.ts @@ -1,11 +1,13 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IValidateNicknameRequestData } from "@spt-aki/models/eft/profile/IValidateNicknameRequestData"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; +import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileSnapshotService } from "@spt-aki/services/ProfileSnapshotService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -19,7 +21,8 @@ export declare class ProfileHelper { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected profileSnapshotService: ProfileSnapshotService; - constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); + protected localisationService: LocalisationService; + constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, localisationService: LocalisationService); /** * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id @@ -101,4 +104,21 @@ export declare class ProfileHelper { * @param keyToIncrement Key */ incrementStatCounter(counters: CounterKeyValue[], keyToIncrement: string): void; + /** + * Check if player has a skill at elite level + * @param skillType Skill to check + * @param pmcProfile Profile to find skill in + * @returns True if player has skill at elite level + */ + hasEliteSkillLevel(skillType: SkillTypes, pmcProfile: IPmcData): boolean; + /** + * Add points to a specific skill in player profile + * @param skill Skill to add points to + * @param pointsToAdd Points to add + * @param pmcProfile Player profile with skill + * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code + * @returns + */ + addSkillPointsToPlayer(pmcProfile: IPmcData, skill: SkillTypes, pointsToAdd: number, useSkillProgressRateMultipler?: boolean): void; + getSkillFromProfile(pmcData: IPmcData, skill: SkillTypes): Common; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/QuestHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/QuestHelper.d.ts index 1e40e53..0dda05b 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/QuestHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/QuestHelper.d.ts @@ -6,7 +6,7 @@ import { QuestConditionHelper } from "@spt-aki/helpers/QuestConditionHelper"; import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "@spt-aki/models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; @@ -66,14 +66,12 @@ export declare class QuestHelper { */ getDeltaQuests(before: IQuest[], after: IQuest[]): IQuest[]; /** - * Increase skill points of a skill on player profile - * Dupe of PlayerService.incrementSkillLevel() - * @param sessionID Session id - * @param pmcData Player profile - * @param skillName Name of skill to increase skill points of - * @param progressAmount Amount of skill points to add to skill + * Adjust skill experience for low skill levels, mimicing the official client + * @param profileSkill the skill experience is being added to + * @param progressAmount the amount of experience being added to the skill + * @returns the adjusted skill progress gain */ - rewardSkillPoints(sessionID: string, pmcData: IPmcData, skillName: string, progressAmount: number): void; + adjustSkillExpForLowLevels(profileSkill: Common, progressAmount: number): number; /** * Get quest name by quest id * @param questId id to get diff --git a/TypeScript/17AsyncImporterWithDependency1/types/loaders/PreAkiModLoader.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/loaders/PreAkiModLoader.d.ts index 869dfbb..71fd745 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/loaders/PreAkiModLoader.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/loaders/PreAkiModLoader.d.ts @@ -29,7 +29,7 @@ export declare class PreAkiModLoader implements IModLoader { protected imported: Record; protected akiConfig: ICoreConfig; protected serverDependencies: Record; - protected skippedMods: string[]; + protected skippedMods: Set; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, bundleLoader: BundleLoader, localisationService: LocalisationService, configServer: ConfigServer, modLoadOrder: ModLoadOrder, modTypeCheck: ModTypeCheck); load(container: DependencyContainer): Promise; /** @@ -44,27 +44,22 @@ export declare class PreAkiModLoader implements IModLoader { 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 + * @param modPackageData map of mod package.json data */ - protected checkForDuplicateMods(modPackageData: Record): void; + protected checkForDuplicateMods(modPackageData: Map): void; /** - * Check for and return duplicate strings inside an array - * @param stringArray Array to check for duplicates - * @returns string array of duplicates, empty if none found - */ - protected getDuplicates(stringArray: string[]): string[]; - /** - * Get an array of mods with errors that prevent them from working with SPT + * Returns an array of valid mods. + * * @param mods mods to validate - * @returns Mod names as array + * @returns array of mod folder names */ - protected getBrokenMods(mods: string[]): string[]; + protected getValidMods(mods: string[]): string[]; /** * Get packageJson data for mods * @param mods mods to get packageJson for - * @returns dictionary + * @returns map */ - protected getModsPackageData(mods: string[]): Record; + protected getModsPackageData(mods: string[]): Map; /** * Is the passed in mod compatible with the running server version * @param mod Mod to check compatibiltiy with AKI @@ -86,10 +81,17 @@ export declare class PreAkiModLoader implements IModLoader { * Compile mod and add into class property "imported" * @param mod Name of mod to compile/add */ - protected addModAsync(mod: string): Promise; + protected addModAsync(mod: string, pkg: IPackageJsonData): Promise; + /** + * Checks if a given mod should be loaded or skipped. + * + * @param pkg mod package.json data + * @returns + */ + protected shouldSkipMod(pkg: IPackageJsonData): boolean; protected autoInstallDependencies(modPath: string, pkg: IPackageJsonData): void; - protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Record): boolean; - protected isModCompatible(mod: IPackageJsonData, loadedMods: Record): boolean; + protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Map): boolean; + protected isModCompatible(mod: IPackageJsonData, loadedMods: Map): boolean; /** * Validate a mod passes a number of checks * @param modName name of mod in /mods/ to validate diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/enums/SkillTypes.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/SkillTypes.d.ts index 4eb90af..dc059a8 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/SkillTypes.d.ts @@ -1,4 +1,6 @@ export declare enum SkillTypes { + BOT_RELOAD = "BotReload", + BOT_SOUND = "BotSound", HIDEOUT_MANAGEMENT = "HideoutManagement", CRAFTING = "Crafting", METABOLISM = "Metabolism", @@ -19,6 +21,7 @@ export declare enum SkillTypes { ATTENTION = "Attention", CHARISMA = "Charisma", MEMORY = "Memory", + MELEE = "Melee", SURGERY = "Surgery", AIM_DRILLS = "AimDrills", TROUBLESHOOTING = "TroubleShooting", @@ -31,6 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", + /** Also called Weapon Maintenance*/ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IBotConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IBotConfig.d.ts index c76eda7..24c8c19 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IBotConfig.d.ts @@ -102,6 +102,8 @@ export interface EquipmentFilters { weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; /** Same as weightingAdjustments but based on player level instead of bot level */ weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; + /** Should the stock mod be forced to spawn on bot */ + forceStock: boolean; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IQuestConfig.d.ts index 3e3b2be..8a71eb9 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IQuestConfig.d.ts @@ -55,6 +55,8 @@ export interface IRewardScaling { items: number[]; reputation: number[]; rewardSpread: number; + skillRewardChance: number[]; + skillPointReward: number[]; } export interface ITraderWhitelist { traderId: string; @@ -66,7 +68,7 @@ export interface IRepeatableQuestTypesConfig { Pickup: IPickup; Elimination: IEliminationConfig[]; } -export interface IExploration { +export interface IExploration extends IBaseQuestConfig { maxExtracts: number; specificExits: ISpecificExits; } @@ -74,7 +76,7 @@ export interface ISpecificExits { probability: number; passageRequirementWhitelist: string[]; } -export interface ICompletion { +export interface ICompletion extends IBaseQuestConfig { minRequestedAmount: number; maxRequestedAmount: number; minRequestedBulletAmount: number; @@ -82,7 +84,7 @@ export interface ICompletion { useWhitelist: boolean; useBlacklist: boolean; } -export interface IPickup { +export interface IPickup extends IBaseQuestConfig { ItemTypeToFetchWithMaxCount: IPickupTypeWithMaxCount[]; } export interface IPickupTypeWithMaxCount { @@ -90,7 +92,7 @@ export interface IPickupTypeWithMaxCount { maxPickupCount: number; minPickupCount: number; } -export interface IEliminationConfig { +export interface IEliminationConfig extends IBaseQuestConfig { levelRange: MinMax; targets: ITarget[]; bodyPartProb: number; @@ -111,6 +113,9 @@ export interface IEliminationConfig { weaponRequirementProb: number; weaponRequirements: IWeaponRequirement[]; } +export interface IBaseQuestConfig { + possibleSkillRewards: string[]; +} export interface ITarget extends IProbabilityObject { data: IBossInfo; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IRepairConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IRepairConfig.d.ts index 1ae082d..9e23cc4 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IRepairConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IRepairConfig.d.ts @@ -9,6 +9,7 @@ export interface IRepairConfig extends IBaseConfig { /** INT gain multiplier per repaired item type */ repairKitIntellectGainMultiplier: IIntellectGainValues; maxIntellectGainPerRepair: IMaxIntellectGainValues; + weaponTreatment: IWeaponTreatmentRepairValues; repairKit: RepairKit; } export interface IIntellectGainValues { @@ -19,6 +20,16 @@ export interface IMaxIntellectGainValues { kit: number; trader: number; } +export interface IWeaponTreatmentRepairValues { + /** The chance to gain more weapon maintenance skill */ + critSuccessChance: number; + critSuccessAmount: number; + /** The chance to gain less weapon maintenance skill */ + critFailureChance: number; + critFailureAmount: number; + /** The multiplier used for calculating weapon maintenance XP */ + pointGainMultiplier: number; +} export interface RepairKit { armor: BonusSettings; weapon: BonusSettings; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/PlayerService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/PlayerService.d.ts index edf269e..f24e0dc 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/PlayerService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/PlayerService.d.ts @@ -9,15 +9,6 @@ export declare class PlayerService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, databaseServer: DatabaseServer); - /** - * Dupe of QuestHelper.rewardsSkillPoints() - * Add xp to a player skill - * @param pmcData Player profile - * @param skillName Name of skill to increment - * @param amount Amount of skill points to add to skill - * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code - */ - incrementSkillLevel(pmcData: IPmcData, skillName: string, amount: number, useSkillProgressRateMultipler?: boolean): void; /** * Get level of player * @param pmcData Player profile diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/RepairService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/RepairService.d.ts index b8ffbaa..8f9e7e9 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/RepairService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/RepairService.d.ts @@ -1,5 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { QuestHelper } from "@spt-aki/helpers/QuestHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { RepairHelper } from "@spt-aki/helpers/RepairHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; @@ -9,6 +9,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { RepairKitsInfo } from "@spt-aki/models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "@spt-aki/models/eft/repair/ITraderRepairActionDataRequest"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { BonusSettings, IRepairConfig } from "@spt-aki/models/spt/config/IRepairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -19,7 +20,7 @@ import { RandomUtil } from "@spt-aki/utils/RandomUtil"; export declare class RepairService { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected questHelper: QuestHelper; + protected profileHelper: ProfileHelper; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; @@ -29,7 +30,7 @@ export declare class RepairService { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id @@ -56,6 +57,12 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + /** + * Return an appromixation of the amount of skill points live would return for the given repairDetails + * @param repairDetails the repair details to calculate skill points for + * @returns the number of skill points to reward the user + */ + protected getWeaponRepairSkillPoints(repairDetails: RepairDetails): number; /** * * @param sessionId Session id @@ -81,6 +88,13 @@ export declare class RepairService { * @returns Multiplier value */ protected getBonusMultiplierValue(skillBonusName: string, pmcData: IPmcData): number; + /** + * Should a repair kit apply total durability loss on repair + * @param pmcData Player profile + * @param applyRandomizeDurabilityLoss Value from repair config + * @returns True if loss should be applied + */ + protected shouldRepairKitApplyDurabilityLoss(pmcData: IPmcData, applyRandomizeDurabilityLoss: boolean): boolean; /** * Update repair kits Resource object if it doesn't exist * @param repairKitDetails Repair kit details from db @@ -112,7 +126,7 @@ export declare class RepairService { * @param itemTemplate Item to check for skill * @returns Skill name */ - protected getItemSkillType(itemTemplate: ITemplateItem): string; + protected getItemSkillType(itemTemplate: ITemplateItem): SkillTypes; /** * Ensure multiplier is between 1 and 0.01 * @param receiveDurabilityMaxPercent Max durabiltiy percent @@ -123,6 +137,7 @@ export declare class RepairService { } export declare class RepairDetails { repairCost?: number; + repairPoints?: number; repairedItem: Item; repairedItemIsArmor: boolean; repairAmount: number; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/utils/App.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/utils/App.d.ts index 1839695..64800ce 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/utils/App.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/utils/App.d.ts @@ -1,6 +1,8 @@ import { OnLoad } from "@spt-aki/di/OnLoad"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -8,11 +10,13 @@ export declare class App { protected logger: ILogger; protected timeUtil: TimeUtil; protected localisationService: LocalisationService; + protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/GameController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/GameController.d.ts index 640a8c1..168071d 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/GameController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/GameController.d.ts @@ -61,6 +61,10 @@ export declare class GameController { * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + /** + * Out of date/incorrectly made trader mods forget this data + */ + protected checkTraderRepairValuesExist(): void; protected addCustomLooseLootPositions(): void; protected adjustLooseLootSpawnProbabilities(): void; protected setHideoutAreasAndCraftsTo40Secs(): void; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/InsuranceController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/InsuranceController.d.ts index b1e8fe6..0ee30ed 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/InsuranceController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/InsuranceController.d.ts @@ -8,7 +8,7 @@ import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGet import { IGetInsuranceCostResponseData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostResponseData"; import { IInsureRequestData } from "@spt-aki/models/eft/insurance/IInsureRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; -import { Insurance, ISystemData } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ISystemData, Insurance } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IInsuranceConfig } from "@spt-aki/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/RepeatableQuestController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/RepeatableQuestController.d.ts index b09b540..a3ebc1c 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/RepeatableQuestController.d.ts @@ -13,6 +13,7 @@ import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -21,8 +22,9 @@ import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RepeatableQuestController { - protected timeUtil: TimeUtil; protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; @@ -37,7 +39,7 @@ export declare class RepeatableQuestController { protected questHelper: QuestHelper; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. @@ -64,6 +66,13 @@ export declare class RepeatableQuestController { * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Get the number of quests to generate - takes into account charisma state of player + * @param repeatableConfig Config + * @param pmcData Player profile + * @returns Quest count + */ + protected getQuestCount(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): number; /** * Get repeatable quest data from profile from name (daily/weekly), creates base repeatable quest object if none exists * @param repeatableConfig daily/weekly config diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotEquipmentModGenerator.d.ts index 05266dd..75530c7 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotEquipmentModGenerator.d.ts @@ -179,7 +179,7 @@ export declare class BotEquipmentModGenerator { * Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots. * This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine" * @param items The items where the CylinderMagazine's camora are appended to - * @param modPool modPool which should include available cartrigdes + * @param modPool modPool which should include available cartridges * @param parentId The CylinderMagazine's UID * @param parentTemplate The CylinderMagazine's template */ diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotLootGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotLootGenerator.d.ts index e937a4d..7a4c521 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotLootGenerator.d.ts @@ -83,7 +83,7 @@ export declare class BotLootGenerator { * @param equipmentSlot slot to place the preset in (backpack) * @param templateInventory bots template, assault.json * @param modChances chances for mods to spawn on weapon - * @param botRole bots role, .e.g. pmcBot + * @param botRole bots role .e.g. pmcBot * @param isPmc are we generating for a pmc */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; @@ -120,16 +120,16 @@ export declare class BotLootGenerator { protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; /** * Randomise the stack size of a money object, uses different values for pmc or scavs - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param moneyItem Money stack to randomise + * @param isPmc Is money on a PMC bot + * @param itemTemplate item details from db + * @param moneyItem Money item to randomise */ protected randomiseMoneyStackSize(isPmc: boolean, itemTemplate: ITemplateItem, moneyItem: Item): void; /** * Randomise the size of an ammo stack - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param ammoItem Ammo stack to randomise + * @param isPmc Is ammo on a PMC bot + * @param itemTemplate item details from db + * @param ammoItem Ammo item to randomise */ protected randomiseAmmoStackSize(isPmc: boolean, itemTemplate: ITemplateItem, ammoItem: Item): void; /** diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/RepeatableQuestGenerator.d.ts index 40a3c16..44c38be 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/RepeatableQuestGenerator.d.ts @@ -8,7 +8,7 @@ import { Exit } from "@spt-aki/models/eft/common/ILocationBase"; import { TraderInfo } from "@spt-aki/models/eft/common/tables/IBotBase"; import { ICompletion, ICompletionAvailableFor, IElimination, IEliminationCondition, IExploration, IExplorationCondition, IPickup, IRepeatableQuest, IReward, IRewards } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; -import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; @@ -155,7 +155,7 @@ export declare class RepeatableQuestGenerator { * @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ - protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig): IRewards; + protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IRewards; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/HideoutHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/HideoutHelper.d.ts index 93f8fb1..0cfc649 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/HideoutHelper.d.ts @@ -1,7 +1,7 @@ import { InventoryHelper } from "@spt-aki/helpers/InventoryHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { Common, HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "@spt-aki/models/eft/hideout/IHideoutContinuousProductionStartRequestData"; @@ -201,22 +201,10 @@ export declare class HideoutHelper { * @returns coin slot count */ protected getBTCSlots(pmcData: IPmcData): number; - /** - * Does profile have elite hideout management skill - * @param pmcData Profile to look at - * @returns True if profile has skill - */ - protected hasEliteHideoutManagementSkill(pmcData: IPmcData): boolean; /** * Get a count of bitcoins player miner can hold */ protected getBitcoinMinerContainerSlotSize(): number; - /** - * Get the hideout management skill from player profile - * @param pmcData Profile to look at - * @returns Hideout management skill object - */ - protected getHideoutManagementSkill(pmcData: IPmcData): Common; /** * HideoutManagement skill gives a consumption bonus the higher the level * 0.5% per level per 1-51, (25.5% at max) diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/ItemHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/ItemHelper.d.ts index 47823bc..e1c7720 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/ItemHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/ItemHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -24,10 +25,11 @@ declare class ItemHelper { protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; + protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/ProfileHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/ProfileHelper.d.ts index 781f980..938c796 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/ProfileHelper.d.ts @@ -1,11 +1,13 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IValidateNicknameRequestData } from "@spt-aki/models/eft/profile/IValidateNicknameRequestData"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; +import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileSnapshotService } from "@spt-aki/services/ProfileSnapshotService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -19,7 +21,8 @@ export declare class ProfileHelper { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected profileSnapshotService: ProfileSnapshotService; - constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); + protected localisationService: LocalisationService; + constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, localisationService: LocalisationService); /** * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id @@ -101,4 +104,21 @@ export declare class ProfileHelper { * @param keyToIncrement Key */ incrementStatCounter(counters: CounterKeyValue[], keyToIncrement: string): void; + /** + * Check if player has a skill at elite level + * @param skillType Skill to check + * @param pmcProfile Profile to find skill in + * @returns True if player has skill at elite level + */ + hasEliteSkillLevel(skillType: SkillTypes, pmcProfile: IPmcData): boolean; + /** + * Add points to a specific skill in player profile + * @param skill Skill to add points to + * @param pointsToAdd Points to add + * @param pmcProfile Player profile with skill + * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code + * @returns + */ + addSkillPointsToPlayer(pmcProfile: IPmcData, skill: SkillTypes, pointsToAdd: number, useSkillProgressRateMultipler?: boolean): void; + getSkillFromProfile(pmcData: IPmcData, skill: SkillTypes): Common; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/QuestHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/QuestHelper.d.ts index 1e40e53..0dda05b 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/QuestHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/QuestHelper.d.ts @@ -6,7 +6,7 @@ import { QuestConditionHelper } from "@spt-aki/helpers/QuestConditionHelper"; import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "@spt-aki/models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; @@ -66,14 +66,12 @@ export declare class QuestHelper { */ getDeltaQuests(before: IQuest[], after: IQuest[]): IQuest[]; /** - * Increase skill points of a skill on player profile - * Dupe of PlayerService.incrementSkillLevel() - * @param sessionID Session id - * @param pmcData Player profile - * @param skillName Name of skill to increase skill points of - * @param progressAmount Amount of skill points to add to skill + * Adjust skill experience for low skill levels, mimicing the official client + * @param profileSkill the skill experience is being added to + * @param progressAmount the amount of experience being added to the skill + * @returns the adjusted skill progress gain */ - rewardSkillPoints(sessionID: string, pmcData: IPmcData, skillName: string, progressAmount: number): void; + adjustSkillExpForLowLevels(profileSkill: Common, progressAmount: number): number; /** * Get quest name by quest id * @param questId id to get diff --git a/TypeScript/17AsyncImporterWithDependency2/types/loaders/PreAkiModLoader.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/loaders/PreAkiModLoader.d.ts index 869dfbb..71fd745 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/loaders/PreAkiModLoader.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/loaders/PreAkiModLoader.d.ts @@ -29,7 +29,7 @@ export declare class PreAkiModLoader implements IModLoader { protected imported: Record; protected akiConfig: ICoreConfig; protected serverDependencies: Record; - protected skippedMods: string[]; + protected skippedMods: Set; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, bundleLoader: BundleLoader, localisationService: LocalisationService, configServer: ConfigServer, modLoadOrder: ModLoadOrder, modTypeCheck: ModTypeCheck); load(container: DependencyContainer): Promise; /** @@ -44,27 +44,22 @@ export declare class PreAkiModLoader implements IModLoader { 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 + * @param modPackageData map of mod package.json data */ - protected checkForDuplicateMods(modPackageData: Record): void; + protected checkForDuplicateMods(modPackageData: Map): void; /** - * Check for and return duplicate strings inside an array - * @param stringArray Array to check for duplicates - * @returns string array of duplicates, empty if none found - */ - protected getDuplicates(stringArray: string[]): string[]; - /** - * Get an array of mods with errors that prevent them from working with SPT + * Returns an array of valid mods. + * * @param mods mods to validate - * @returns Mod names as array + * @returns array of mod folder names */ - protected getBrokenMods(mods: string[]): string[]; + protected getValidMods(mods: string[]): string[]; /** * Get packageJson data for mods * @param mods mods to get packageJson for - * @returns dictionary + * @returns map */ - protected getModsPackageData(mods: string[]): Record; + protected getModsPackageData(mods: string[]): Map; /** * Is the passed in mod compatible with the running server version * @param mod Mod to check compatibiltiy with AKI @@ -86,10 +81,17 @@ export declare class PreAkiModLoader implements IModLoader { * Compile mod and add into class property "imported" * @param mod Name of mod to compile/add */ - protected addModAsync(mod: string): Promise; + protected addModAsync(mod: string, pkg: IPackageJsonData): Promise; + /** + * Checks if a given mod should be loaded or skipped. + * + * @param pkg mod package.json data + * @returns + */ + protected shouldSkipMod(pkg: IPackageJsonData): boolean; protected autoInstallDependencies(modPath: string, pkg: IPackageJsonData): void; - protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Record): boolean; - protected isModCompatible(mod: IPackageJsonData, loadedMods: Record): boolean; + protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Map): boolean; + protected isModCompatible(mod: IPackageJsonData, loadedMods: Map): boolean; /** * Validate a mod passes a number of checks * @param modName name of mod in /mods/ to validate diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/enums/SkillTypes.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/SkillTypes.d.ts index 4eb90af..dc059a8 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/SkillTypes.d.ts @@ -1,4 +1,6 @@ export declare enum SkillTypes { + BOT_RELOAD = "BotReload", + BOT_SOUND = "BotSound", HIDEOUT_MANAGEMENT = "HideoutManagement", CRAFTING = "Crafting", METABOLISM = "Metabolism", @@ -19,6 +21,7 @@ export declare enum SkillTypes { ATTENTION = "Attention", CHARISMA = "Charisma", MEMORY = "Memory", + MELEE = "Melee", SURGERY = "Surgery", AIM_DRILLS = "AimDrills", TROUBLESHOOTING = "TroubleShooting", @@ -31,6 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", + /** Also called Weapon Maintenance*/ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IBotConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IBotConfig.d.ts index c76eda7..24c8c19 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IBotConfig.d.ts @@ -102,6 +102,8 @@ export interface EquipmentFilters { weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; /** Same as weightingAdjustments but based on player level instead of bot level */ weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; + /** Should the stock mod be forced to spawn on bot */ + forceStock: boolean; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IQuestConfig.d.ts index 3e3b2be..8a71eb9 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IQuestConfig.d.ts @@ -55,6 +55,8 @@ export interface IRewardScaling { items: number[]; reputation: number[]; rewardSpread: number; + skillRewardChance: number[]; + skillPointReward: number[]; } export interface ITraderWhitelist { traderId: string; @@ -66,7 +68,7 @@ export interface IRepeatableQuestTypesConfig { Pickup: IPickup; Elimination: IEliminationConfig[]; } -export interface IExploration { +export interface IExploration extends IBaseQuestConfig { maxExtracts: number; specificExits: ISpecificExits; } @@ -74,7 +76,7 @@ export interface ISpecificExits { probability: number; passageRequirementWhitelist: string[]; } -export interface ICompletion { +export interface ICompletion extends IBaseQuestConfig { minRequestedAmount: number; maxRequestedAmount: number; minRequestedBulletAmount: number; @@ -82,7 +84,7 @@ export interface ICompletion { useWhitelist: boolean; useBlacklist: boolean; } -export interface IPickup { +export interface IPickup extends IBaseQuestConfig { ItemTypeToFetchWithMaxCount: IPickupTypeWithMaxCount[]; } export interface IPickupTypeWithMaxCount { @@ -90,7 +92,7 @@ export interface IPickupTypeWithMaxCount { maxPickupCount: number; minPickupCount: number; } -export interface IEliminationConfig { +export interface IEliminationConfig extends IBaseQuestConfig { levelRange: MinMax; targets: ITarget[]; bodyPartProb: number; @@ -111,6 +113,9 @@ export interface IEliminationConfig { weaponRequirementProb: number; weaponRequirements: IWeaponRequirement[]; } +export interface IBaseQuestConfig { + possibleSkillRewards: string[]; +} export interface ITarget extends IProbabilityObject { data: IBossInfo; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IRepairConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IRepairConfig.d.ts index 1ae082d..9e23cc4 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IRepairConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IRepairConfig.d.ts @@ -9,6 +9,7 @@ export interface IRepairConfig extends IBaseConfig { /** INT gain multiplier per repaired item type */ repairKitIntellectGainMultiplier: IIntellectGainValues; maxIntellectGainPerRepair: IMaxIntellectGainValues; + weaponTreatment: IWeaponTreatmentRepairValues; repairKit: RepairKit; } export interface IIntellectGainValues { @@ -19,6 +20,16 @@ export interface IMaxIntellectGainValues { kit: number; trader: number; } +export interface IWeaponTreatmentRepairValues { + /** The chance to gain more weapon maintenance skill */ + critSuccessChance: number; + critSuccessAmount: number; + /** The chance to gain less weapon maintenance skill */ + critFailureChance: number; + critFailureAmount: number; + /** The multiplier used for calculating weapon maintenance XP */ + pointGainMultiplier: number; +} export interface RepairKit { armor: BonusSettings; weapon: BonusSettings; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/PlayerService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/PlayerService.d.ts index edf269e..f24e0dc 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/PlayerService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/PlayerService.d.ts @@ -9,15 +9,6 @@ export declare class PlayerService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, databaseServer: DatabaseServer); - /** - * Dupe of QuestHelper.rewardsSkillPoints() - * Add xp to a player skill - * @param pmcData Player profile - * @param skillName Name of skill to increment - * @param amount Amount of skill points to add to skill - * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code - */ - incrementSkillLevel(pmcData: IPmcData, skillName: string, amount: number, useSkillProgressRateMultipler?: boolean): void; /** * Get level of player * @param pmcData Player profile diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/RepairService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/RepairService.d.ts index b8ffbaa..8f9e7e9 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/RepairService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/RepairService.d.ts @@ -1,5 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { QuestHelper } from "@spt-aki/helpers/QuestHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { RepairHelper } from "@spt-aki/helpers/RepairHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; @@ -9,6 +9,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { RepairKitsInfo } from "@spt-aki/models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "@spt-aki/models/eft/repair/ITraderRepairActionDataRequest"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { BonusSettings, IRepairConfig } from "@spt-aki/models/spt/config/IRepairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -19,7 +20,7 @@ import { RandomUtil } from "@spt-aki/utils/RandomUtil"; export declare class RepairService { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected questHelper: QuestHelper; + protected profileHelper: ProfileHelper; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; @@ -29,7 +30,7 @@ export declare class RepairService { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id @@ -56,6 +57,12 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + /** + * Return an appromixation of the amount of skill points live would return for the given repairDetails + * @param repairDetails the repair details to calculate skill points for + * @returns the number of skill points to reward the user + */ + protected getWeaponRepairSkillPoints(repairDetails: RepairDetails): number; /** * * @param sessionId Session id @@ -81,6 +88,13 @@ export declare class RepairService { * @returns Multiplier value */ protected getBonusMultiplierValue(skillBonusName: string, pmcData: IPmcData): number; + /** + * Should a repair kit apply total durability loss on repair + * @param pmcData Player profile + * @param applyRandomizeDurabilityLoss Value from repair config + * @returns True if loss should be applied + */ + protected shouldRepairKitApplyDurabilityLoss(pmcData: IPmcData, applyRandomizeDurabilityLoss: boolean): boolean; /** * Update repair kits Resource object if it doesn't exist * @param repairKitDetails Repair kit details from db @@ -112,7 +126,7 @@ export declare class RepairService { * @param itemTemplate Item to check for skill * @returns Skill name */ - protected getItemSkillType(itemTemplate: ITemplateItem): string; + protected getItemSkillType(itemTemplate: ITemplateItem): SkillTypes; /** * Ensure multiplier is between 1 and 0.01 * @param receiveDurabilityMaxPercent Max durabiltiy percent @@ -123,6 +137,7 @@ export declare class RepairService { } export declare class RepairDetails { repairCost?: number; + repairPoints?: number; repairedItem: Item; repairedItemIsArmor: boolean; repairAmount: number; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/utils/App.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/utils/App.d.ts index 1839695..64800ce 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/utils/App.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/utils/App.d.ts @@ -1,6 +1,8 @@ import { OnLoad } from "@spt-aki/di/OnLoad"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -8,11 +10,13 @@ export declare class App { protected logger: ILogger; protected timeUtil: TimeUtil; protected localisationService: LocalisationService; + protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/18CustomItemService/types/controllers/GameController.d.ts b/TypeScript/18CustomItemService/types/controllers/GameController.d.ts index 640a8c1..168071d 100644 --- a/TypeScript/18CustomItemService/types/controllers/GameController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/GameController.d.ts @@ -61,6 +61,10 @@ export declare class GameController { * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + /** + * Out of date/incorrectly made trader mods forget this data + */ + protected checkTraderRepairValuesExist(): void; protected addCustomLooseLootPositions(): void; protected adjustLooseLootSpawnProbabilities(): void; protected setHideoutAreasAndCraftsTo40Secs(): void; diff --git a/TypeScript/18CustomItemService/types/controllers/InsuranceController.d.ts b/TypeScript/18CustomItemService/types/controllers/InsuranceController.d.ts index b1e8fe6..0ee30ed 100644 --- a/TypeScript/18CustomItemService/types/controllers/InsuranceController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/InsuranceController.d.ts @@ -8,7 +8,7 @@ import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGet import { IGetInsuranceCostResponseData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostResponseData"; import { IInsureRequestData } from "@spt-aki/models/eft/insurance/IInsureRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; -import { Insurance, ISystemData } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ISystemData, Insurance } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IInsuranceConfig } from "@spt-aki/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; diff --git a/TypeScript/18CustomItemService/types/controllers/RepeatableQuestController.d.ts b/TypeScript/18CustomItemService/types/controllers/RepeatableQuestController.d.ts index b09b540..a3ebc1c 100644 --- a/TypeScript/18CustomItemService/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/RepeatableQuestController.d.ts @@ -13,6 +13,7 @@ import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -21,8 +22,9 @@ import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RepeatableQuestController { - protected timeUtil: TimeUtil; protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; @@ -37,7 +39,7 @@ export declare class RepeatableQuestController { protected questHelper: QuestHelper; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. @@ -64,6 +66,13 @@ export declare class RepeatableQuestController { * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Get the number of quests to generate - takes into account charisma state of player + * @param repeatableConfig Config + * @param pmcData Player profile + * @returns Quest count + */ + protected getQuestCount(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): number; /** * Get repeatable quest data from profile from name (daily/weekly), creates base repeatable quest object if none exists * @param repeatableConfig daily/weekly config diff --git a/TypeScript/18CustomItemService/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/BotEquipmentModGenerator.d.ts index 05266dd..75530c7 100644 --- a/TypeScript/18CustomItemService/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/BotEquipmentModGenerator.d.ts @@ -179,7 +179,7 @@ export declare class BotEquipmentModGenerator { * Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots. * This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine" * @param items The items where the CylinderMagazine's camora are appended to - * @param modPool modPool which should include available cartrigdes + * @param modPool modPool which should include available cartridges * @param parentId The CylinderMagazine's UID * @param parentTemplate The CylinderMagazine's template */ diff --git a/TypeScript/18CustomItemService/types/generators/BotLootGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/BotLootGenerator.d.ts index e937a4d..7a4c521 100644 --- a/TypeScript/18CustomItemService/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/BotLootGenerator.d.ts @@ -83,7 +83,7 @@ export declare class BotLootGenerator { * @param equipmentSlot slot to place the preset in (backpack) * @param templateInventory bots template, assault.json * @param modChances chances for mods to spawn on weapon - * @param botRole bots role, .e.g. pmcBot + * @param botRole bots role .e.g. pmcBot * @param isPmc are we generating for a pmc */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; @@ -120,16 +120,16 @@ export declare class BotLootGenerator { protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; /** * Randomise the stack size of a money object, uses different values for pmc or scavs - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param moneyItem Money stack to randomise + * @param isPmc Is money on a PMC bot + * @param itemTemplate item details from db + * @param moneyItem Money item to randomise */ protected randomiseMoneyStackSize(isPmc: boolean, itemTemplate: ITemplateItem, moneyItem: Item): void; /** * Randomise the size of an ammo stack - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param ammoItem Ammo stack to randomise + * @param isPmc Is ammo on a PMC bot + * @param itemTemplate item details from db + * @param ammoItem Ammo item to randomise */ protected randomiseAmmoStackSize(isPmc: boolean, itemTemplate: ITemplateItem, ammoItem: Item): void; /** diff --git a/TypeScript/18CustomItemService/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/RepeatableQuestGenerator.d.ts index 40a3c16..44c38be 100644 --- a/TypeScript/18CustomItemService/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/RepeatableQuestGenerator.d.ts @@ -8,7 +8,7 @@ import { Exit } from "@spt-aki/models/eft/common/ILocationBase"; import { TraderInfo } from "@spt-aki/models/eft/common/tables/IBotBase"; import { ICompletion, ICompletionAvailableFor, IElimination, IEliminationCondition, IExploration, IExplorationCondition, IPickup, IRepeatableQuest, IReward, IRewards } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; -import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; @@ -155,7 +155,7 @@ export declare class RepeatableQuestGenerator { * @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ - protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig): IRewards; + protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IRewards; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config diff --git a/TypeScript/18CustomItemService/types/helpers/HideoutHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/HideoutHelper.d.ts index 93f8fb1..0cfc649 100644 --- a/TypeScript/18CustomItemService/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/HideoutHelper.d.ts @@ -1,7 +1,7 @@ import { InventoryHelper } from "@spt-aki/helpers/InventoryHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { Common, HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "@spt-aki/models/eft/hideout/IHideoutContinuousProductionStartRequestData"; @@ -201,22 +201,10 @@ export declare class HideoutHelper { * @returns coin slot count */ protected getBTCSlots(pmcData: IPmcData): number; - /** - * Does profile have elite hideout management skill - * @param pmcData Profile to look at - * @returns True if profile has skill - */ - protected hasEliteHideoutManagementSkill(pmcData: IPmcData): boolean; /** * Get a count of bitcoins player miner can hold */ protected getBitcoinMinerContainerSlotSize(): number; - /** - * Get the hideout management skill from player profile - * @param pmcData Profile to look at - * @returns Hideout management skill object - */ - protected getHideoutManagementSkill(pmcData: IPmcData): Common; /** * HideoutManagement skill gives a consumption bonus the higher the level * 0.5% per level per 1-51, (25.5% at max) diff --git a/TypeScript/18CustomItemService/types/helpers/ItemHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/ItemHelper.d.ts index 47823bc..e1c7720 100644 --- a/TypeScript/18CustomItemService/types/helpers/ItemHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/ItemHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -24,10 +25,11 @@ declare class ItemHelper { protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; + protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl diff --git a/TypeScript/18CustomItemService/types/helpers/ProfileHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/ProfileHelper.d.ts index 781f980..938c796 100644 --- a/TypeScript/18CustomItemService/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/ProfileHelper.d.ts @@ -1,11 +1,13 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IValidateNicknameRequestData } from "@spt-aki/models/eft/profile/IValidateNicknameRequestData"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; +import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileSnapshotService } from "@spt-aki/services/ProfileSnapshotService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -19,7 +21,8 @@ export declare class ProfileHelper { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected profileSnapshotService: ProfileSnapshotService; - constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); + protected localisationService: LocalisationService; + constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, localisationService: LocalisationService); /** * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id @@ -101,4 +104,21 @@ export declare class ProfileHelper { * @param keyToIncrement Key */ incrementStatCounter(counters: CounterKeyValue[], keyToIncrement: string): void; + /** + * Check if player has a skill at elite level + * @param skillType Skill to check + * @param pmcProfile Profile to find skill in + * @returns True if player has skill at elite level + */ + hasEliteSkillLevel(skillType: SkillTypes, pmcProfile: IPmcData): boolean; + /** + * Add points to a specific skill in player profile + * @param skill Skill to add points to + * @param pointsToAdd Points to add + * @param pmcProfile Player profile with skill + * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code + * @returns + */ + addSkillPointsToPlayer(pmcProfile: IPmcData, skill: SkillTypes, pointsToAdd: number, useSkillProgressRateMultipler?: boolean): void; + getSkillFromProfile(pmcData: IPmcData, skill: SkillTypes): Common; } diff --git a/TypeScript/18CustomItemService/types/helpers/QuestHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/QuestHelper.d.ts index 1e40e53..0dda05b 100644 --- a/TypeScript/18CustomItemService/types/helpers/QuestHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/QuestHelper.d.ts @@ -6,7 +6,7 @@ import { QuestConditionHelper } from "@spt-aki/helpers/QuestConditionHelper"; import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "@spt-aki/models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; @@ -66,14 +66,12 @@ export declare class QuestHelper { */ getDeltaQuests(before: IQuest[], after: IQuest[]): IQuest[]; /** - * Increase skill points of a skill on player profile - * Dupe of PlayerService.incrementSkillLevel() - * @param sessionID Session id - * @param pmcData Player profile - * @param skillName Name of skill to increase skill points of - * @param progressAmount Amount of skill points to add to skill + * Adjust skill experience for low skill levels, mimicing the official client + * @param profileSkill the skill experience is being added to + * @param progressAmount the amount of experience being added to the skill + * @returns the adjusted skill progress gain */ - rewardSkillPoints(sessionID: string, pmcData: IPmcData, skillName: string, progressAmount: number): void; + adjustSkillExpForLowLevels(profileSkill: Common, progressAmount: number): number; /** * Get quest name by quest id * @param questId id to get diff --git a/TypeScript/18CustomItemService/types/loaders/PreAkiModLoader.d.ts b/TypeScript/18CustomItemService/types/loaders/PreAkiModLoader.d.ts index 869dfbb..71fd745 100644 --- a/TypeScript/18CustomItemService/types/loaders/PreAkiModLoader.d.ts +++ b/TypeScript/18CustomItemService/types/loaders/PreAkiModLoader.d.ts @@ -29,7 +29,7 @@ export declare class PreAkiModLoader implements IModLoader { protected imported: Record; protected akiConfig: ICoreConfig; protected serverDependencies: Record; - protected skippedMods: string[]; + protected skippedMods: Set; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, bundleLoader: BundleLoader, localisationService: LocalisationService, configServer: ConfigServer, modLoadOrder: ModLoadOrder, modTypeCheck: ModTypeCheck); load(container: DependencyContainer): Promise; /** @@ -44,27 +44,22 @@ export declare class PreAkiModLoader implements IModLoader { 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 + * @param modPackageData map of mod package.json data */ - protected checkForDuplicateMods(modPackageData: Record): void; + protected checkForDuplicateMods(modPackageData: Map): void; /** - * Check for and return duplicate strings inside an array - * @param stringArray Array to check for duplicates - * @returns string array of duplicates, empty if none found - */ - protected getDuplicates(stringArray: string[]): string[]; - /** - * Get an array of mods with errors that prevent them from working with SPT + * Returns an array of valid mods. + * * @param mods mods to validate - * @returns Mod names as array + * @returns array of mod folder names */ - protected getBrokenMods(mods: string[]): string[]; + protected getValidMods(mods: string[]): string[]; /** * Get packageJson data for mods * @param mods mods to get packageJson for - * @returns dictionary + * @returns map */ - protected getModsPackageData(mods: string[]): Record; + protected getModsPackageData(mods: string[]): Map; /** * Is the passed in mod compatible with the running server version * @param mod Mod to check compatibiltiy with AKI @@ -86,10 +81,17 @@ export declare class PreAkiModLoader implements IModLoader { * Compile mod and add into class property "imported" * @param mod Name of mod to compile/add */ - protected addModAsync(mod: string): Promise; + protected addModAsync(mod: string, pkg: IPackageJsonData): Promise; + /** + * Checks if a given mod should be loaded or skipped. + * + * @param pkg mod package.json data + * @returns + */ + protected shouldSkipMod(pkg: IPackageJsonData): boolean; protected autoInstallDependencies(modPath: string, pkg: IPackageJsonData): void; - protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Record): boolean; - protected isModCompatible(mod: IPackageJsonData, loadedMods: Record): boolean; + protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Map): boolean; + protected isModCompatible(mod: IPackageJsonData, loadedMods: Map): boolean; /** * Validate a mod passes a number of checks * @param modName name of mod in /mods/ to validate diff --git a/TypeScript/18CustomItemService/types/models/enums/SkillTypes.d.ts b/TypeScript/18CustomItemService/types/models/enums/SkillTypes.d.ts index 4eb90af..dc059a8 100644 --- a/TypeScript/18CustomItemService/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/18CustomItemService/types/models/enums/SkillTypes.d.ts @@ -1,4 +1,6 @@ export declare enum SkillTypes { + BOT_RELOAD = "BotReload", + BOT_SOUND = "BotSound", HIDEOUT_MANAGEMENT = "HideoutManagement", CRAFTING = "Crafting", METABOLISM = "Metabolism", @@ -19,6 +21,7 @@ export declare enum SkillTypes { ATTENTION = "Attention", CHARISMA = "Charisma", MEMORY = "Memory", + MELEE = "Melee", SURGERY = "Surgery", AIM_DRILLS = "AimDrills", TROUBLESHOOTING = "TroubleShooting", @@ -31,6 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", + /** Also called Weapon Maintenance*/ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/18CustomItemService/types/models/spt/config/IBotConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/IBotConfig.d.ts index c76eda7..24c8c19 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/IBotConfig.d.ts @@ -102,6 +102,8 @@ export interface EquipmentFilters { weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; /** Same as weightingAdjustments but based on player level instead of bot level */ weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; + /** Should the stock mod be forced to spawn on bot */ + forceStock: boolean; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/18CustomItemService/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/IQuestConfig.d.ts index 3e3b2be..8a71eb9 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/IQuestConfig.d.ts @@ -55,6 +55,8 @@ export interface IRewardScaling { items: number[]; reputation: number[]; rewardSpread: number; + skillRewardChance: number[]; + skillPointReward: number[]; } export interface ITraderWhitelist { traderId: string; @@ -66,7 +68,7 @@ export interface IRepeatableQuestTypesConfig { Pickup: IPickup; Elimination: IEliminationConfig[]; } -export interface IExploration { +export interface IExploration extends IBaseQuestConfig { maxExtracts: number; specificExits: ISpecificExits; } @@ -74,7 +76,7 @@ export interface ISpecificExits { probability: number; passageRequirementWhitelist: string[]; } -export interface ICompletion { +export interface ICompletion extends IBaseQuestConfig { minRequestedAmount: number; maxRequestedAmount: number; minRequestedBulletAmount: number; @@ -82,7 +84,7 @@ export interface ICompletion { useWhitelist: boolean; useBlacklist: boolean; } -export interface IPickup { +export interface IPickup extends IBaseQuestConfig { ItemTypeToFetchWithMaxCount: IPickupTypeWithMaxCount[]; } export interface IPickupTypeWithMaxCount { @@ -90,7 +92,7 @@ export interface IPickupTypeWithMaxCount { maxPickupCount: number; minPickupCount: number; } -export interface IEliminationConfig { +export interface IEliminationConfig extends IBaseQuestConfig { levelRange: MinMax; targets: ITarget[]; bodyPartProb: number; @@ -111,6 +113,9 @@ export interface IEliminationConfig { weaponRequirementProb: number; weaponRequirements: IWeaponRequirement[]; } +export interface IBaseQuestConfig { + possibleSkillRewards: string[]; +} export interface ITarget extends IProbabilityObject { data: IBossInfo; } diff --git a/TypeScript/18CustomItemService/types/models/spt/config/IRepairConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/IRepairConfig.d.ts index 1ae082d..9e23cc4 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/IRepairConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/IRepairConfig.d.ts @@ -9,6 +9,7 @@ export interface IRepairConfig extends IBaseConfig { /** INT gain multiplier per repaired item type */ repairKitIntellectGainMultiplier: IIntellectGainValues; maxIntellectGainPerRepair: IMaxIntellectGainValues; + weaponTreatment: IWeaponTreatmentRepairValues; repairKit: RepairKit; } export interface IIntellectGainValues { @@ -19,6 +20,16 @@ export interface IMaxIntellectGainValues { kit: number; trader: number; } +export interface IWeaponTreatmentRepairValues { + /** The chance to gain more weapon maintenance skill */ + critSuccessChance: number; + critSuccessAmount: number; + /** The chance to gain less weapon maintenance skill */ + critFailureChance: number; + critFailureAmount: number; + /** The multiplier used for calculating weapon maintenance XP */ + pointGainMultiplier: number; +} export interface RepairKit { armor: BonusSettings; weapon: BonusSettings; diff --git a/TypeScript/18CustomItemService/types/services/PlayerService.d.ts b/TypeScript/18CustomItemService/types/services/PlayerService.d.ts index edf269e..f24e0dc 100644 --- a/TypeScript/18CustomItemService/types/services/PlayerService.d.ts +++ b/TypeScript/18CustomItemService/types/services/PlayerService.d.ts @@ -9,15 +9,6 @@ export declare class PlayerService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, databaseServer: DatabaseServer); - /** - * Dupe of QuestHelper.rewardsSkillPoints() - * Add xp to a player skill - * @param pmcData Player profile - * @param skillName Name of skill to increment - * @param amount Amount of skill points to add to skill - * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code - */ - incrementSkillLevel(pmcData: IPmcData, skillName: string, amount: number, useSkillProgressRateMultipler?: boolean): void; /** * Get level of player * @param pmcData Player profile diff --git a/TypeScript/18CustomItemService/types/services/RepairService.d.ts b/TypeScript/18CustomItemService/types/services/RepairService.d.ts index b8ffbaa..8f9e7e9 100644 --- a/TypeScript/18CustomItemService/types/services/RepairService.d.ts +++ b/TypeScript/18CustomItemService/types/services/RepairService.d.ts @@ -1,5 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { QuestHelper } from "@spt-aki/helpers/QuestHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { RepairHelper } from "@spt-aki/helpers/RepairHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; @@ -9,6 +9,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { RepairKitsInfo } from "@spt-aki/models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "@spt-aki/models/eft/repair/ITraderRepairActionDataRequest"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { BonusSettings, IRepairConfig } from "@spt-aki/models/spt/config/IRepairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -19,7 +20,7 @@ import { RandomUtil } from "@spt-aki/utils/RandomUtil"; export declare class RepairService { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected questHelper: QuestHelper; + protected profileHelper: ProfileHelper; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; @@ -29,7 +30,7 @@ export declare class RepairService { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id @@ -56,6 +57,12 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + /** + * Return an appromixation of the amount of skill points live would return for the given repairDetails + * @param repairDetails the repair details to calculate skill points for + * @returns the number of skill points to reward the user + */ + protected getWeaponRepairSkillPoints(repairDetails: RepairDetails): number; /** * * @param sessionId Session id @@ -81,6 +88,13 @@ export declare class RepairService { * @returns Multiplier value */ protected getBonusMultiplierValue(skillBonusName: string, pmcData: IPmcData): number; + /** + * Should a repair kit apply total durability loss on repair + * @param pmcData Player profile + * @param applyRandomizeDurabilityLoss Value from repair config + * @returns True if loss should be applied + */ + protected shouldRepairKitApplyDurabilityLoss(pmcData: IPmcData, applyRandomizeDurabilityLoss: boolean): boolean; /** * Update repair kits Resource object if it doesn't exist * @param repairKitDetails Repair kit details from db @@ -112,7 +126,7 @@ export declare class RepairService { * @param itemTemplate Item to check for skill * @returns Skill name */ - protected getItemSkillType(itemTemplate: ITemplateItem): string; + protected getItemSkillType(itemTemplate: ITemplateItem): SkillTypes; /** * Ensure multiplier is between 1 and 0.01 * @param receiveDurabilityMaxPercent Max durabiltiy percent @@ -123,6 +137,7 @@ export declare class RepairService { } export declare class RepairDetails { repairCost?: number; + repairPoints?: number; repairedItem: Item; repairedItemIsArmor: boolean; repairAmount: number; diff --git a/TypeScript/18CustomItemService/types/utils/App.d.ts b/TypeScript/18CustomItemService/types/utils/App.d.ts index 1839695..64800ce 100644 --- a/TypeScript/18CustomItemService/types/utils/App.d.ts +++ b/TypeScript/18CustomItemService/types/utils/App.d.ts @@ -1,6 +1,8 @@ import { OnLoad } from "@spt-aki/di/OnLoad"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -8,11 +10,13 @@ export declare class App { protected logger: ILogger; protected timeUtil: TimeUtil; protected localisationService: LocalisationService; + protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/19UseExternalLibraries/types/controllers/GameController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/GameController.d.ts index 640a8c1..168071d 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/GameController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/GameController.d.ts @@ -61,6 +61,10 @@ export declare class GameController { * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + /** + * Out of date/incorrectly made trader mods forget this data + */ + protected checkTraderRepairValuesExist(): void; protected addCustomLooseLootPositions(): void; protected adjustLooseLootSpawnProbabilities(): void; protected setHideoutAreasAndCraftsTo40Secs(): void; diff --git a/TypeScript/19UseExternalLibraries/types/controllers/InsuranceController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/InsuranceController.d.ts index b1e8fe6..0ee30ed 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/InsuranceController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/InsuranceController.d.ts @@ -8,7 +8,7 @@ import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGet import { IGetInsuranceCostResponseData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostResponseData"; import { IInsureRequestData } from "@spt-aki/models/eft/insurance/IInsureRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; -import { Insurance, ISystemData } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ISystemData, Insurance } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IInsuranceConfig } from "@spt-aki/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; diff --git a/TypeScript/19UseExternalLibraries/types/controllers/RepeatableQuestController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/RepeatableQuestController.d.ts index b09b540..a3ebc1c 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/RepeatableQuestController.d.ts @@ -13,6 +13,7 @@ import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -21,8 +22,9 @@ import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RepeatableQuestController { - protected timeUtil: TimeUtil; protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; @@ -37,7 +39,7 @@ export declare class RepeatableQuestController { protected questHelper: QuestHelper; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. @@ -64,6 +66,13 @@ export declare class RepeatableQuestController { * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Get the number of quests to generate - takes into account charisma state of player + * @param repeatableConfig Config + * @param pmcData Player profile + * @returns Quest count + */ + protected getQuestCount(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): number; /** * Get repeatable quest data from profile from name (daily/weekly), creates base repeatable quest object if none exists * @param repeatableConfig daily/weekly config diff --git a/TypeScript/19UseExternalLibraries/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/19UseExternalLibraries/types/generators/BotEquipmentModGenerator.d.ts index 05266dd..75530c7 100644 --- a/TypeScript/19UseExternalLibraries/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/19UseExternalLibraries/types/generators/BotEquipmentModGenerator.d.ts @@ -179,7 +179,7 @@ export declare class BotEquipmentModGenerator { * Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots. * This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine" * @param items The items where the CylinderMagazine's camora are appended to - * @param modPool modPool which should include available cartrigdes + * @param modPool modPool which should include available cartridges * @param parentId The CylinderMagazine's UID * @param parentTemplate The CylinderMagazine's template */ diff --git a/TypeScript/19UseExternalLibraries/types/generators/BotLootGenerator.d.ts b/TypeScript/19UseExternalLibraries/types/generators/BotLootGenerator.d.ts index e937a4d..7a4c521 100644 --- a/TypeScript/19UseExternalLibraries/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/19UseExternalLibraries/types/generators/BotLootGenerator.d.ts @@ -83,7 +83,7 @@ export declare class BotLootGenerator { * @param equipmentSlot slot to place the preset in (backpack) * @param templateInventory bots template, assault.json * @param modChances chances for mods to spawn on weapon - * @param botRole bots role, .e.g. pmcBot + * @param botRole bots role .e.g. pmcBot * @param isPmc are we generating for a pmc */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; @@ -120,16 +120,16 @@ export declare class BotLootGenerator { protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; /** * Randomise the stack size of a money object, uses different values for pmc or scavs - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param moneyItem Money stack to randomise + * @param isPmc Is money on a PMC bot + * @param itemTemplate item details from db + * @param moneyItem Money item to randomise */ protected randomiseMoneyStackSize(isPmc: boolean, itemTemplate: ITemplateItem, moneyItem: Item): void; /** * Randomise the size of an ammo stack - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param ammoItem Ammo stack to randomise + * @param isPmc Is ammo on a PMC bot + * @param itemTemplate item details from db + * @param ammoItem Ammo item to randomise */ protected randomiseAmmoStackSize(isPmc: boolean, itemTemplate: ITemplateItem, ammoItem: Item): void; /** diff --git a/TypeScript/19UseExternalLibraries/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/19UseExternalLibraries/types/generators/RepeatableQuestGenerator.d.ts index 40a3c16..44c38be 100644 --- a/TypeScript/19UseExternalLibraries/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/19UseExternalLibraries/types/generators/RepeatableQuestGenerator.d.ts @@ -8,7 +8,7 @@ import { Exit } from "@spt-aki/models/eft/common/ILocationBase"; import { TraderInfo } from "@spt-aki/models/eft/common/tables/IBotBase"; import { ICompletion, ICompletionAvailableFor, IElimination, IEliminationCondition, IExploration, IExplorationCondition, IPickup, IRepeatableQuest, IReward, IRewards } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; -import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; @@ -155,7 +155,7 @@ export declare class RepeatableQuestGenerator { * @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ - protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig): IRewards; + protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IRewards; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config diff --git a/TypeScript/19UseExternalLibraries/types/helpers/HideoutHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/HideoutHelper.d.ts index 93f8fb1..0cfc649 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/HideoutHelper.d.ts @@ -1,7 +1,7 @@ import { InventoryHelper } from "@spt-aki/helpers/InventoryHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { Common, HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "@spt-aki/models/eft/hideout/IHideoutContinuousProductionStartRequestData"; @@ -201,22 +201,10 @@ export declare class HideoutHelper { * @returns coin slot count */ protected getBTCSlots(pmcData: IPmcData): number; - /** - * Does profile have elite hideout management skill - * @param pmcData Profile to look at - * @returns True if profile has skill - */ - protected hasEliteHideoutManagementSkill(pmcData: IPmcData): boolean; /** * Get a count of bitcoins player miner can hold */ protected getBitcoinMinerContainerSlotSize(): number; - /** - * Get the hideout management skill from player profile - * @param pmcData Profile to look at - * @returns Hideout management skill object - */ - protected getHideoutManagementSkill(pmcData: IPmcData): Common; /** * HideoutManagement skill gives a consumption bonus the higher the level * 0.5% per level per 1-51, (25.5% at max) diff --git a/TypeScript/19UseExternalLibraries/types/helpers/ItemHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/ItemHelper.d.ts index 47823bc..e1c7720 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/ItemHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/ItemHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -24,10 +25,11 @@ declare class ItemHelper { protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; + protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl diff --git a/TypeScript/19UseExternalLibraries/types/helpers/ProfileHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/ProfileHelper.d.ts index 781f980..938c796 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/ProfileHelper.d.ts @@ -1,11 +1,13 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IValidateNicknameRequestData } from "@spt-aki/models/eft/profile/IValidateNicknameRequestData"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; +import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileSnapshotService } from "@spt-aki/services/ProfileSnapshotService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -19,7 +21,8 @@ export declare class ProfileHelper { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected profileSnapshotService: ProfileSnapshotService; - constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); + protected localisationService: LocalisationService; + constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, localisationService: LocalisationService); /** * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id @@ -101,4 +104,21 @@ export declare class ProfileHelper { * @param keyToIncrement Key */ incrementStatCounter(counters: CounterKeyValue[], keyToIncrement: string): void; + /** + * Check if player has a skill at elite level + * @param skillType Skill to check + * @param pmcProfile Profile to find skill in + * @returns True if player has skill at elite level + */ + hasEliteSkillLevel(skillType: SkillTypes, pmcProfile: IPmcData): boolean; + /** + * Add points to a specific skill in player profile + * @param skill Skill to add points to + * @param pointsToAdd Points to add + * @param pmcProfile Player profile with skill + * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code + * @returns + */ + addSkillPointsToPlayer(pmcProfile: IPmcData, skill: SkillTypes, pointsToAdd: number, useSkillProgressRateMultipler?: boolean): void; + getSkillFromProfile(pmcData: IPmcData, skill: SkillTypes): Common; } diff --git a/TypeScript/19UseExternalLibraries/types/helpers/QuestHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/QuestHelper.d.ts index 1e40e53..0dda05b 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/QuestHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/QuestHelper.d.ts @@ -6,7 +6,7 @@ import { QuestConditionHelper } from "@spt-aki/helpers/QuestConditionHelper"; import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "@spt-aki/models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; @@ -66,14 +66,12 @@ export declare class QuestHelper { */ getDeltaQuests(before: IQuest[], after: IQuest[]): IQuest[]; /** - * Increase skill points of a skill on player profile - * Dupe of PlayerService.incrementSkillLevel() - * @param sessionID Session id - * @param pmcData Player profile - * @param skillName Name of skill to increase skill points of - * @param progressAmount Amount of skill points to add to skill + * Adjust skill experience for low skill levels, mimicing the official client + * @param profileSkill the skill experience is being added to + * @param progressAmount the amount of experience being added to the skill + * @returns the adjusted skill progress gain */ - rewardSkillPoints(sessionID: string, pmcData: IPmcData, skillName: string, progressAmount: number): void; + adjustSkillExpForLowLevels(profileSkill: Common, progressAmount: number): number; /** * Get quest name by quest id * @param questId id to get diff --git a/TypeScript/19UseExternalLibraries/types/loaders/PreAkiModLoader.d.ts b/TypeScript/19UseExternalLibraries/types/loaders/PreAkiModLoader.d.ts index 869dfbb..71fd745 100644 --- a/TypeScript/19UseExternalLibraries/types/loaders/PreAkiModLoader.d.ts +++ b/TypeScript/19UseExternalLibraries/types/loaders/PreAkiModLoader.d.ts @@ -29,7 +29,7 @@ export declare class PreAkiModLoader implements IModLoader { protected imported: Record; protected akiConfig: ICoreConfig; protected serverDependencies: Record; - protected skippedMods: string[]; + protected skippedMods: Set; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, bundleLoader: BundleLoader, localisationService: LocalisationService, configServer: ConfigServer, modLoadOrder: ModLoadOrder, modTypeCheck: ModTypeCheck); load(container: DependencyContainer): Promise; /** @@ -44,27 +44,22 @@ export declare class PreAkiModLoader implements IModLoader { 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 + * @param modPackageData map of mod package.json data */ - protected checkForDuplicateMods(modPackageData: Record): void; + protected checkForDuplicateMods(modPackageData: Map): void; /** - * Check for and return duplicate strings inside an array - * @param stringArray Array to check for duplicates - * @returns string array of duplicates, empty if none found - */ - protected getDuplicates(stringArray: string[]): string[]; - /** - * Get an array of mods with errors that prevent them from working with SPT + * Returns an array of valid mods. + * * @param mods mods to validate - * @returns Mod names as array + * @returns array of mod folder names */ - protected getBrokenMods(mods: string[]): string[]; + protected getValidMods(mods: string[]): string[]; /** * Get packageJson data for mods * @param mods mods to get packageJson for - * @returns dictionary + * @returns map */ - protected getModsPackageData(mods: string[]): Record; + protected getModsPackageData(mods: string[]): Map; /** * Is the passed in mod compatible with the running server version * @param mod Mod to check compatibiltiy with AKI @@ -86,10 +81,17 @@ export declare class PreAkiModLoader implements IModLoader { * Compile mod and add into class property "imported" * @param mod Name of mod to compile/add */ - protected addModAsync(mod: string): Promise; + protected addModAsync(mod: string, pkg: IPackageJsonData): Promise; + /** + * Checks if a given mod should be loaded or skipped. + * + * @param pkg mod package.json data + * @returns + */ + protected shouldSkipMod(pkg: IPackageJsonData): boolean; protected autoInstallDependencies(modPath: string, pkg: IPackageJsonData): void; - protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Record): boolean; - protected isModCompatible(mod: IPackageJsonData, loadedMods: Record): boolean; + protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Map): boolean; + protected isModCompatible(mod: IPackageJsonData, loadedMods: Map): boolean; /** * Validate a mod passes a number of checks * @param modName name of mod in /mods/ to validate diff --git a/TypeScript/19UseExternalLibraries/types/models/enums/SkillTypes.d.ts b/TypeScript/19UseExternalLibraries/types/models/enums/SkillTypes.d.ts index 4eb90af..dc059a8 100644 --- a/TypeScript/19UseExternalLibraries/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/enums/SkillTypes.d.ts @@ -1,4 +1,6 @@ export declare enum SkillTypes { + BOT_RELOAD = "BotReload", + BOT_SOUND = "BotSound", HIDEOUT_MANAGEMENT = "HideoutManagement", CRAFTING = "Crafting", METABOLISM = "Metabolism", @@ -19,6 +21,7 @@ export declare enum SkillTypes { ATTENTION = "Attention", CHARISMA = "Charisma", MEMORY = "Memory", + MELEE = "Melee", SURGERY = "Surgery", AIM_DRILLS = "AimDrills", TROUBLESHOOTING = "TroubleShooting", @@ -31,6 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", + /** Also called Weapon Maintenance*/ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/config/IBotConfig.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/config/IBotConfig.d.ts index c76eda7..24c8c19 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/config/IBotConfig.d.ts @@ -102,6 +102,8 @@ export interface EquipmentFilters { weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; /** Same as weightingAdjustments but based on player level instead of bot level */ weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; + /** Should the stock mod be forced to spawn on bot */ + forceStock: boolean; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/config/IQuestConfig.d.ts index 3e3b2be..8a71eb9 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/config/IQuestConfig.d.ts @@ -55,6 +55,8 @@ export interface IRewardScaling { items: number[]; reputation: number[]; rewardSpread: number; + skillRewardChance: number[]; + skillPointReward: number[]; } export interface ITraderWhitelist { traderId: string; @@ -66,7 +68,7 @@ export interface IRepeatableQuestTypesConfig { Pickup: IPickup; Elimination: IEliminationConfig[]; } -export interface IExploration { +export interface IExploration extends IBaseQuestConfig { maxExtracts: number; specificExits: ISpecificExits; } @@ -74,7 +76,7 @@ export interface ISpecificExits { probability: number; passageRequirementWhitelist: string[]; } -export interface ICompletion { +export interface ICompletion extends IBaseQuestConfig { minRequestedAmount: number; maxRequestedAmount: number; minRequestedBulletAmount: number; @@ -82,7 +84,7 @@ export interface ICompletion { useWhitelist: boolean; useBlacklist: boolean; } -export interface IPickup { +export interface IPickup extends IBaseQuestConfig { ItemTypeToFetchWithMaxCount: IPickupTypeWithMaxCount[]; } export interface IPickupTypeWithMaxCount { @@ -90,7 +92,7 @@ export interface IPickupTypeWithMaxCount { maxPickupCount: number; minPickupCount: number; } -export interface IEliminationConfig { +export interface IEliminationConfig extends IBaseQuestConfig { levelRange: MinMax; targets: ITarget[]; bodyPartProb: number; @@ -111,6 +113,9 @@ export interface IEliminationConfig { weaponRequirementProb: number; weaponRequirements: IWeaponRequirement[]; } +export interface IBaseQuestConfig { + possibleSkillRewards: string[]; +} export interface ITarget extends IProbabilityObject { data: IBossInfo; } diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/config/IRepairConfig.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/config/IRepairConfig.d.ts index 1ae082d..9e23cc4 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/config/IRepairConfig.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/config/IRepairConfig.d.ts @@ -9,6 +9,7 @@ export interface IRepairConfig extends IBaseConfig { /** INT gain multiplier per repaired item type */ repairKitIntellectGainMultiplier: IIntellectGainValues; maxIntellectGainPerRepair: IMaxIntellectGainValues; + weaponTreatment: IWeaponTreatmentRepairValues; repairKit: RepairKit; } export interface IIntellectGainValues { @@ -19,6 +20,16 @@ export interface IMaxIntellectGainValues { kit: number; trader: number; } +export interface IWeaponTreatmentRepairValues { + /** The chance to gain more weapon maintenance skill */ + critSuccessChance: number; + critSuccessAmount: number; + /** The chance to gain less weapon maintenance skill */ + critFailureChance: number; + critFailureAmount: number; + /** The multiplier used for calculating weapon maintenance XP */ + pointGainMultiplier: number; +} export interface RepairKit { armor: BonusSettings; weapon: BonusSettings; diff --git a/TypeScript/19UseExternalLibraries/types/services/PlayerService.d.ts b/TypeScript/19UseExternalLibraries/types/services/PlayerService.d.ts index edf269e..f24e0dc 100644 --- a/TypeScript/19UseExternalLibraries/types/services/PlayerService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/PlayerService.d.ts @@ -9,15 +9,6 @@ export declare class PlayerService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, databaseServer: DatabaseServer); - /** - * Dupe of QuestHelper.rewardsSkillPoints() - * Add xp to a player skill - * @param pmcData Player profile - * @param skillName Name of skill to increment - * @param amount Amount of skill points to add to skill - * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code - */ - incrementSkillLevel(pmcData: IPmcData, skillName: string, amount: number, useSkillProgressRateMultipler?: boolean): void; /** * Get level of player * @param pmcData Player profile diff --git a/TypeScript/19UseExternalLibraries/types/services/RepairService.d.ts b/TypeScript/19UseExternalLibraries/types/services/RepairService.d.ts index b8ffbaa..8f9e7e9 100644 --- a/TypeScript/19UseExternalLibraries/types/services/RepairService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/RepairService.d.ts @@ -1,5 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { QuestHelper } from "@spt-aki/helpers/QuestHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { RepairHelper } from "@spt-aki/helpers/RepairHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; @@ -9,6 +9,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { RepairKitsInfo } from "@spt-aki/models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "@spt-aki/models/eft/repair/ITraderRepairActionDataRequest"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { BonusSettings, IRepairConfig } from "@spt-aki/models/spt/config/IRepairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -19,7 +20,7 @@ import { RandomUtil } from "@spt-aki/utils/RandomUtil"; export declare class RepairService { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected questHelper: QuestHelper; + protected profileHelper: ProfileHelper; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; @@ -29,7 +30,7 @@ export declare class RepairService { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id @@ -56,6 +57,12 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + /** + * Return an appromixation of the amount of skill points live would return for the given repairDetails + * @param repairDetails the repair details to calculate skill points for + * @returns the number of skill points to reward the user + */ + protected getWeaponRepairSkillPoints(repairDetails: RepairDetails): number; /** * * @param sessionId Session id @@ -81,6 +88,13 @@ export declare class RepairService { * @returns Multiplier value */ protected getBonusMultiplierValue(skillBonusName: string, pmcData: IPmcData): number; + /** + * Should a repair kit apply total durability loss on repair + * @param pmcData Player profile + * @param applyRandomizeDurabilityLoss Value from repair config + * @returns True if loss should be applied + */ + protected shouldRepairKitApplyDurabilityLoss(pmcData: IPmcData, applyRandomizeDurabilityLoss: boolean): boolean; /** * Update repair kits Resource object if it doesn't exist * @param repairKitDetails Repair kit details from db @@ -112,7 +126,7 @@ export declare class RepairService { * @param itemTemplate Item to check for skill * @returns Skill name */ - protected getItemSkillType(itemTemplate: ITemplateItem): string; + protected getItemSkillType(itemTemplate: ITemplateItem): SkillTypes; /** * Ensure multiplier is between 1 and 0.01 * @param receiveDurabilityMaxPercent Max durabiltiy percent @@ -123,6 +137,7 @@ export declare class RepairService { } export declare class RepairDetails { repairCost?: number; + repairPoints?: number; repairedItem: Item; repairedItemIsArmor: boolean; repairAmount: number; diff --git a/TypeScript/19UseExternalLibraries/types/utils/App.d.ts b/TypeScript/19UseExternalLibraries/types/utils/App.d.ts index 1839695..64800ce 100644 --- a/TypeScript/19UseExternalLibraries/types/utils/App.d.ts +++ b/TypeScript/19UseExternalLibraries/types/utils/App.d.ts @@ -1,6 +1,8 @@ import { OnLoad } from "@spt-aki/di/OnLoad"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -8,11 +10,13 @@ export declare class App { protected logger: ILogger; protected timeUtil: TimeUtil; protected localisationService: LocalisationService; + protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/1LogToConsole/types/controllers/GameController.d.ts b/TypeScript/1LogToConsole/types/controllers/GameController.d.ts index 640a8c1..168071d 100644 --- a/TypeScript/1LogToConsole/types/controllers/GameController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/GameController.d.ts @@ -61,6 +61,10 @@ export declare class GameController { * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + /** + * Out of date/incorrectly made trader mods forget this data + */ + protected checkTraderRepairValuesExist(): void; protected addCustomLooseLootPositions(): void; protected adjustLooseLootSpawnProbabilities(): void; protected setHideoutAreasAndCraftsTo40Secs(): void; diff --git a/TypeScript/1LogToConsole/types/controllers/InsuranceController.d.ts b/TypeScript/1LogToConsole/types/controllers/InsuranceController.d.ts index b1e8fe6..0ee30ed 100644 --- a/TypeScript/1LogToConsole/types/controllers/InsuranceController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/InsuranceController.d.ts @@ -8,7 +8,7 @@ import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGet import { IGetInsuranceCostResponseData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostResponseData"; import { IInsureRequestData } from "@spt-aki/models/eft/insurance/IInsureRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; -import { Insurance, ISystemData } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ISystemData, Insurance } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IInsuranceConfig } from "@spt-aki/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; diff --git a/TypeScript/1LogToConsole/types/controllers/RepeatableQuestController.d.ts b/TypeScript/1LogToConsole/types/controllers/RepeatableQuestController.d.ts index b09b540..a3ebc1c 100644 --- a/TypeScript/1LogToConsole/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/RepeatableQuestController.d.ts @@ -13,6 +13,7 @@ import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -21,8 +22,9 @@ import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RepeatableQuestController { - protected timeUtil: TimeUtil; protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; @@ -37,7 +39,7 @@ export declare class RepeatableQuestController { protected questHelper: QuestHelper; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. @@ -64,6 +66,13 @@ export declare class RepeatableQuestController { * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Get the number of quests to generate - takes into account charisma state of player + * @param repeatableConfig Config + * @param pmcData Player profile + * @returns Quest count + */ + protected getQuestCount(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): number; /** * Get repeatable quest data from profile from name (daily/weekly), creates base repeatable quest object if none exists * @param repeatableConfig daily/weekly config diff --git a/TypeScript/1LogToConsole/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/BotEquipmentModGenerator.d.ts index 05266dd..75530c7 100644 --- a/TypeScript/1LogToConsole/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/BotEquipmentModGenerator.d.ts @@ -179,7 +179,7 @@ export declare class BotEquipmentModGenerator { * Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots. * This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine" * @param items The items where the CylinderMagazine's camora are appended to - * @param modPool modPool which should include available cartrigdes + * @param modPool modPool which should include available cartridges * @param parentId The CylinderMagazine's UID * @param parentTemplate The CylinderMagazine's template */ diff --git a/TypeScript/1LogToConsole/types/generators/BotLootGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/BotLootGenerator.d.ts index e937a4d..7a4c521 100644 --- a/TypeScript/1LogToConsole/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/BotLootGenerator.d.ts @@ -83,7 +83,7 @@ export declare class BotLootGenerator { * @param equipmentSlot slot to place the preset in (backpack) * @param templateInventory bots template, assault.json * @param modChances chances for mods to spawn on weapon - * @param botRole bots role, .e.g. pmcBot + * @param botRole bots role .e.g. pmcBot * @param isPmc are we generating for a pmc */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; @@ -120,16 +120,16 @@ export declare class BotLootGenerator { protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; /** * Randomise the stack size of a money object, uses different values for pmc or scavs - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param moneyItem Money stack to randomise + * @param isPmc Is money on a PMC bot + * @param itemTemplate item details from db + * @param moneyItem Money item to randomise */ protected randomiseMoneyStackSize(isPmc: boolean, itemTemplate: ITemplateItem, moneyItem: Item): void; /** * Randomise the size of an ammo stack - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param ammoItem Ammo stack to randomise + * @param isPmc Is ammo on a PMC bot + * @param itemTemplate item details from db + * @param ammoItem Ammo item to randomise */ protected randomiseAmmoStackSize(isPmc: boolean, itemTemplate: ITemplateItem, ammoItem: Item): void; /** diff --git a/TypeScript/1LogToConsole/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/RepeatableQuestGenerator.d.ts index 40a3c16..44c38be 100644 --- a/TypeScript/1LogToConsole/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/RepeatableQuestGenerator.d.ts @@ -8,7 +8,7 @@ import { Exit } from "@spt-aki/models/eft/common/ILocationBase"; import { TraderInfo } from "@spt-aki/models/eft/common/tables/IBotBase"; import { ICompletion, ICompletionAvailableFor, IElimination, IEliminationCondition, IExploration, IExplorationCondition, IPickup, IRepeatableQuest, IReward, IRewards } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; -import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; @@ -155,7 +155,7 @@ export declare class RepeatableQuestGenerator { * @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ - protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig): IRewards; + protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IRewards; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config diff --git a/TypeScript/1LogToConsole/types/helpers/HideoutHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/HideoutHelper.d.ts index 93f8fb1..0cfc649 100644 --- a/TypeScript/1LogToConsole/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/HideoutHelper.d.ts @@ -1,7 +1,7 @@ import { InventoryHelper } from "@spt-aki/helpers/InventoryHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { Common, HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "@spt-aki/models/eft/hideout/IHideoutContinuousProductionStartRequestData"; @@ -201,22 +201,10 @@ export declare class HideoutHelper { * @returns coin slot count */ protected getBTCSlots(pmcData: IPmcData): number; - /** - * Does profile have elite hideout management skill - * @param pmcData Profile to look at - * @returns True if profile has skill - */ - protected hasEliteHideoutManagementSkill(pmcData: IPmcData): boolean; /** * Get a count of bitcoins player miner can hold */ protected getBitcoinMinerContainerSlotSize(): number; - /** - * Get the hideout management skill from player profile - * @param pmcData Profile to look at - * @returns Hideout management skill object - */ - protected getHideoutManagementSkill(pmcData: IPmcData): Common; /** * HideoutManagement skill gives a consumption bonus the higher the level * 0.5% per level per 1-51, (25.5% at max) diff --git a/TypeScript/1LogToConsole/types/helpers/ItemHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/ItemHelper.d.ts index 47823bc..e1c7720 100644 --- a/TypeScript/1LogToConsole/types/helpers/ItemHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/ItemHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -24,10 +25,11 @@ declare class ItemHelper { protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; + protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl diff --git a/TypeScript/1LogToConsole/types/helpers/ProfileHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/ProfileHelper.d.ts index 781f980..938c796 100644 --- a/TypeScript/1LogToConsole/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/ProfileHelper.d.ts @@ -1,11 +1,13 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IValidateNicknameRequestData } from "@spt-aki/models/eft/profile/IValidateNicknameRequestData"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; +import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileSnapshotService } from "@spt-aki/services/ProfileSnapshotService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -19,7 +21,8 @@ export declare class ProfileHelper { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected profileSnapshotService: ProfileSnapshotService; - constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); + protected localisationService: LocalisationService; + constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, localisationService: LocalisationService); /** * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id @@ -101,4 +104,21 @@ export declare class ProfileHelper { * @param keyToIncrement Key */ incrementStatCounter(counters: CounterKeyValue[], keyToIncrement: string): void; + /** + * Check if player has a skill at elite level + * @param skillType Skill to check + * @param pmcProfile Profile to find skill in + * @returns True if player has skill at elite level + */ + hasEliteSkillLevel(skillType: SkillTypes, pmcProfile: IPmcData): boolean; + /** + * Add points to a specific skill in player profile + * @param skill Skill to add points to + * @param pointsToAdd Points to add + * @param pmcProfile Player profile with skill + * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code + * @returns + */ + addSkillPointsToPlayer(pmcProfile: IPmcData, skill: SkillTypes, pointsToAdd: number, useSkillProgressRateMultipler?: boolean): void; + getSkillFromProfile(pmcData: IPmcData, skill: SkillTypes): Common; } diff --git a/TypeScript/1LogToConsole/types/helpers/QuestHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/QuestHelper.d.ts index 1e40e53..0dda05b 100644 --- a/TypeScript/1LogToConsole/types/helpers/QuestHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/QuestHelper.d.ts @@ -6,7 +6,7 @@ import { QuestConditionHelper } from "@spt-aki/helpers/QuestConditionHelper"; import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "@spt-aki/models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; @@ -66,14 +66,12 @@ export declare class QuestHelper { */ getDeltaQuests(before: IQuest[], after: IQuest[]): IQuest[]; /** - * Increase skill points of a skill on player profile - * Dupe of PlayerService.incrementSkillLevel() - * @param sessionID Session id - * @param pmcData Player profile - * @param skillName Name of skill to increase skill points of - * @param progressAmount Amount of skill points to add to skill + * Adjust skill experience for low skill levels, mimicing the official client + * @param profileSkill the skill experience is being added to + * @param progressAmount the amount of experience being added to the skill + * @returns the adjusted skill progress gain */ - rewardSkillPoints(sessionID: string, pmcData: IPmcData, skillName: string, progressAmount: number): void; + adjustSkillExpForLowLevels(profileSkill: Common, progressAmount: number): number; /** * Get quest name by quest id * @param questId id to get diff --git a/TypeScript/1LogToConsole/types/loaders/PreAkiModLoader.d.ts b/TypeScript/1LogToConsole/types/loaders/PreAkiModLoader.d.ts index 869dfbb..71fd745 100644 --- a/TypeScript/1LogToConsole/types/loaders/PreAkiModLoader.d.ts +++ b/TypeScript/1LogToConsole/types/loaders/PreAkiModLoader.d.ts @@ -29,7 +29,7 @@ export declare class PreAkiModLoader implements IModLoader { protected imported: Record; protected akiConfig: ICoreConfig; protected serverDependencies: Record; - protected skippedMods: string[]; + protected skippedMods: Set; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, bundleLoader: BundleLoader, localisationService: LocalisationService, configServer: ConfigServer, modLoadOrder: ModLoadOrder, modTypeCheck: ModTypeCheck); load(container: DependencyContainer): Promise; /** @@ -44,27 +44,22 @@ export declare class PreAkiModLoader implements IModLoader { 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 + * @param modPackageData map of mod package.json data */ - protected checkForDuplicateMods(modPackageData: Record): void; + protected checkForDuplicateMods(modPackageData: Map): void; /** - * Check for and return duplicate strings inside an array - * @param stringArray Array to check for duplicates - * @returns string array of duplicates, empty if none found - */ - protected getDuplicates(stringArray: string[]): string[]; - /** - * Get an array of mods with errors that prevent them from working with SPT + * Returns an array of valid mods. + * * @param mods mods to validate - * @returns Mod names as array + * @returns array of mod folder names */ - protected getBrokenMods(mods: string[]): string[]; + protected getValidMods(mods: string[]): string[]; /** * Get packageJson data for mods * @param mods mods to get packageJson for - * @returns dictionary + * @returns map */ - protected getModsPackageData(mods: string[]): Record; + protected getModsPackageData(mods: string[]): Map; /** * Is the passed in mod compatible with the running server version * @param mod Mod to check compatibiltiy with AKI @@ -86,10 +81,17 @@ export declare class PreAkiModLoader implements IModLoader { * Compile mod and add into class property "imported" * @param mod Name of mod to compile/add */ - protected addModAsync(mod: string): Promise; + protected addModAsync(mod: string, pkg: IPackageJsonData): Promise; + /** + * Checks if a given mod should be loaded or skipped. + * + * @param pkg mod package.json data + * @returns + */ + protected shouldSkipMod(pkg: IPackageJsonData): boolean; protected autoInstallDependencies(modPath: string, pkg: IPackageJsonData): void; - protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Record): boolean; - protected isModCompatible(mod: IPackageJsonData, loadedMods: Record): boolean; + protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Map): boolean; + protected isModCompatible(mod: IPackageJsonData, loadedMods: Map): boolean; /** * Validate a mod passes a number of checks * @param modName name of mod in /mods/ to validate diff --git a/TypeScript/1LogToConsole/types/models/enums/SkillTypes.d.ts b/TypeScript/1LogToConsole/types/models/enums/SkillTypes.d.ts index 4eb90af..dc059a8 100644 --- a/TypeScript/1LogToConsole/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/1LogToConsole/types/models/enums/SkillTypes.d.ts @@ -1,4 +1,6 @@ export declare enum SkillTypes { + BOT_RELOAD = "BotReload", + BOT_SOUND = "BotSound", HIDEOUT_MANAGEMENT = "HideoutManagement", CRAFTING = "Crafting", METABOLISM = "Metabolism", @@ -19,6 +21,7 @@ export declare enum SkillTypes { ATTENTION = "Attention", CHARISMA = "Charisma", MEMORY = "Memory", + MELEE = "Melee", SURGERY = "Surgery", AIM_DRILLS = "AimDrills", TROUBLESHOOTING = "TroubleShooting", @@ -31,6 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", + /** Also called Weapon Maintenance*/ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts index c76eda7..24c8c19 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts @@ -102,6 +102,8 @@ export interface EquipmentFilters { weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; /** Same as weightingAdjustments but based on player level instead of bot level */ weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; + /** Should the stock mod be forced to spawn on bot */ + forceStock: boolean; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IQuestConfig.d.ts index 3e3b2be..8a71eb9 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IQuestConfig.d.ts @@ -55,6 +55,8 @@ export interface IRewardScaling { items: number[]; reputation: number[]; rewardSpread: number; + skillRewardChance: number[]; + skillPointReward: number[]; } export interface ITraderWhitelist { traderId: string; @@ -66,7 +68,7 @@ export interface IRepeatableQuestTypesConfig { Pickup: IPickup; Elimination: IEliminationConfig[]; } -export interface IExploration { +export interface IExploration extends IBaseQuestConfig { maxExtracts: number; specificExits: ISpecificExits; } @@ -74,7 +76,7 @@ export interface ISpecificExits { probability: number; passageRequirementWhitelist: string[]; } -export interface ICompletion { +export interface ICompletion extends IBaseQuestConfig { minRequestedAmount: number; maxRequestedAmount: number; minRequestedBulletAmount: number; @@ -82,7 +84,7 @@ export interface ICompletion { useWhitelist: boolean; useBlacklist: boolean; } -export interface IPickup { +export interface IPickup extends IBaseQuestConfig { ItemTypeToFetchWithMaxCount: IPickupTypeWithMaxCount[]; } export interface IPickupTypeWithMaxCount { @@ -90,7 +92,7 @@ export interface IPickupTypeWithMaxCount { maxPickupCount: number; minPickupCount: number; } -export interface IEliminationConfig { +export interface IEliminationConfig extends IBaseQuestConfig { levelRange: MinMax; targets: ITarget[]; bodyPartProb: number; @@ -111,6 +113,9 @@ export interface IEliminationConfig { weaponRequirementProb: number; weaponRequirements: IWeaponRequirement[]; } +export interface IBaseQuestConfig { + possibleSkillRewards: string[]; +} export interface ITarget extends IProbabilityObject { data: IBossInfo; } diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IRepairConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IRepairConfig.d.ts index 1ae082d..9e23cc4 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IRepairConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IRepairConfig.d.ts @@ -9,6 +9,7 @@ export interface IRepairConfig extends IBaseConfig { /** INT gain multiplier per repaired item type */ repairKitIntellectGainMultiplier: IIntellectGainValues; maxIntellectGainPerRepair: IMaxIntellectGainValues; + weaponTreatment: IWeaponTreatmentRepairValues; repairKit: RepairKit; } export interface IIntellectGainValues { @@ -19,6 +20,16 @@ export interface IMaxIntellectGainValues { kit: number; trader: number; } +export interface IWeaponTreatmentRepairValues { + /** The chance to gain more weapon maintenance skill */ + critSuccessChance: number; + critSuccessAmount: number; + /** The chance to gain less weapon maintenance skill */ + critFailureChance: number; + critFailureAmount: number; + /** The multiplier used for calculating weapon maintenance XP */ + pointGainMultiplier: number; +} export interface RepairKit { armor: BonusSettings; weapon: BonusSettings; diff --git a/TypeScript/1LogToConsole/types/services/PlayerService.d.ts b/TypeScript/1LogToConsole/types/services/PlayerService.d.ts index edf269e..f24e0dc 100644 --- a/TypeScript/1LogToConsole/types/services/PlayerService.d.ts +++ b/TypeScript/1LogToConsole/types/services/PlayerService.d.ts @@ -9,15 +9,6 @@ export declare class PlayerService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, databaseServer: DatabaseServer); - /** - * Dupe of QuestHelper.rewardsSkillPoints() - * Add xp to a player skill - * @param pmcData Player profile - * @param skillName Name of skill to increment - * @param amount Amount of skill points to add to skill - * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code - */ - incrementSkillLevel(pmcData: IPmcData, skillName: string, amount: number, useSkillProgressRateMultipler?: boolean): void; /** * Get level of player * @param pmcData Player profile diff --git a/TypeScript/1LogToConsole/types/services/RepairService.d.ts b/TypeScript/1LogToConsole/types/services/RepairService.d.ts index b8ffbaa..8f9e7e9 100644 --- a/TypeScript/1LogToConsole/types/services/RepairService.d.ts +++ b/TypeScript/1LogToConsole/types/services/RepairService.d.ts @@ -1,5 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { QuestHelper } from "@spt-aki/helpers/QuestHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { RepairHelper } from "@spt-aki/helpers/RepairHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; @@ -9,6 +9,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { RepairKitsInfo } from "@spt-aki/models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "@spt-aki/models/eft/repair/ITraderRepairActionDataRequest"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { BonusSettings, IRepairConfig } from "@spt-aki/models/spt/config/IRepairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -19,7 +20,7 @@ import { RandomUtil } from "@spt-aki/utils/RandomUtil"; export declare class RepairService { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected questHelper: QuestHelper; + protected profileHelper: ProfileHelper; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; @@ -29,7 +30,7 @@ export declare class RepairService { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id @@ -56,6 +57,12 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + /** + * Return an appromixation of the amount of skill points live would return for the given repairDetails + * @param repairDetails the repair details to calculate skill points for + * @returns the number of skill points to reward the user + */ + protected getWeaponRepairSkillPoints(repairDetails: RepairDetails): number; /** * * @param sessionId Session id @@ -81,6 +88,13 @@ export declare class RepairService { * @returns Multiplier value */ protected getBonusMultiplierValue(skillBonusName: string, pmcData: IPmcData): number; + /** + * Should a repair kit apply total durability loss on repair + * @param pmcData Player profile + * @param applyRandomizeDurabilityLoss Value from repair config + * @returns True if loss should be applied + */ + protected shouldRepairKitApplyDurabilityLoss(pmcData: IPmcData, applyRandomizeDurabilityLoss: boolean): boolean; /** * Update repair kits Resource object if it doesn't exist * @param repairKitDetails Repair kit details from db @@ -112,7 +126,7 @@ export declare class RepairService { * @param itemTemplate Item to check for skill * @returns Skill name */ - protected getItemSkillType(itemTemplate: ITemplateItem): string; + protected getItemSkillType(itemTemplate: ITemplateItem): SkillTypes; /** * Ensure multiplier is between 1 and 0.01 * @param receiveDurabilityMaxPercent Max durabiltiy percent @@ -123,6 +137,7 @@ export declare class RepairService { } export declare class RepairDetails { repairCost?: number; + repairPoints?: number; repairedItem: Item; repairedItemIsArmor: boolean; repairAmount: number; diff --git a/TypeScript/1LogToConsole/types/utils/App.d.ts b/TypeScript/1LogToConsole/types/utils/App.d.ts index 1839695..64800ce 100644 --- a/TypeScript/1LogToConsole/types/utils/App.d.ts +++ b/TypeScript/1LogToConsole/types/utils/App.d.ts @@ -1,6 +1,8 @@ import { OnLoad } from "@spt-aki/di/OnLoad"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -8,11 +10,13 @@ export declare class App { protected logger: ILogger; protected timeUtil: TimeUtil; protected localisationService: LocalisationService; + protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/2EditDatabase/types/controllers/GameController.d.ts b/TypeScript/2EditDatabase/types/controllers/GameController.d.ts index 640a8c1..168071d 100644 --- a/TypeScript/2EditDatabase/types/controllers/GameController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/GameController.d.ts @@ -61,6 +61,10 @@ export declare class GameController { * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + /** + * Out of date/incorrectly made trader mods forget this data + */ + protected checkTraderRepairValuesExist(): void; protected addCustomLooseLootPositions(): void; protected adjustLooseLootSpawnProbabilities(): void; protected setHideoutAreasAndCraftsTo40Secs(): void; diff --git a/TypeScript/2EditDatabase/types/controllers/InsuranceController.d.ts b/TypeScript/2EditDatabase/types/controllers/InsuranceController.d.ts index b1e8fe6..0ee30ed 100644 --- a/TypeScript/2EditDatabase/types/controllers/InsuranceController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/InsuranceController.d.ts @@ -8,7 +8,7 @@ import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGet import { IGetInsuranceCostResponseData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostResponseData"; import { IInsureRequestData } from "@spt-aki/models/eft/insurance/IInsureRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; -import { Insurance, ISystemData } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ISystemData, Insurance } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IInsuranceConfig } from "@spt-aki/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; diff --git a/TypeScript/2EditDatabase/types/controllers/RepeatableQuestController.d.ts b/TypeScript/2EditDatabase/types/controllers/RepeatableQuestController.d.ts index b09b540..a3ebc1c 100644 --- a/TypeScript/2EditDatabase/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/RepeatableQuestController.d.ts @@ -13,6 +13,7 @@ import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -21,8 +22,9 @@ import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RepeatableQuestController { - protected timeUtil: TimeUtil; protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; @@ -37,7 +39,7 @@ export declare class RepeatableQuestController { protected questHelper: QuestHelper; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. @@ -64,6 +66,13 @@ export declare class RepeatableQuestController { * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Get the number of quests to generate - takes into account charisma state of player + * @param repeatableConfig Config + * @param pmcData Player profile + * @returns Quest count + */ + protected getQuestCount(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): number; /** * Get repeatable quest data from profile from name (daily/weekly), creates base repeatable quest object if none exists * @param repeatableConfig daily/weekly config diff --git a/TypeScript/2EditDatabase/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/BotEquipmentModGenerator.d.ts index 05266dd..75530c7 100644 --- a/TypeScript/2EditDatabase/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/BotEquipmentModGenerator.d.ts @@ -179,7 +179,7 @@ export declare class BotEquipmentModGenerator { * Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots. * This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine" * @param items The items where the CylinderMagazine's camora are appended to - * @param modPool modPool which should include available cartrigdes + * @param modPool modPool which should include available cartridges * @param parentId The CylinderMagazine's UID * @param parentTemplate The CylinderMagazine's template */ diff --git a/TypeScript/2EditDatabase/types/generators/BotLootGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/BotLootGenerator.d.ts index e937a4d..7a4c521 100644 --- a/TypeScript/2EditDatabase/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/BotLootGenerator.d.ts @@ -83,7 +83,7 @@ export declare class BotLootGenerator { * @param equipmentSlot slot to place the preset in (backpack) * @param templateInventory bots template, assault.json * @param modChances chances for mods to spawn on weapon - * @param botRole bots role, .e.g. pmcBot + * @param botRole bots role .e.g. pmcBot * @param isPmc are we generating for a pmc */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; @@ -120,16 +120,16 @@ export declare class BotLootGenerator { protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; /** * Randomise the stack size of a money object, uses different values for pmc or scavs - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param moneyItem Money stack to randomise + * @param isPmc Is money on a PMC bot + * @param itemTemplate item details from db + * @param moneyItem Money item to randomise */ protected randomiseMoneyStackSize(isPmc: boolean, itemTemplate: ITemplateItem, moneyItem: Item): void; /** * Randomise the size of an ammo stack - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param ammoItem Ammo stack to randomise + * @param isPmc Is ammo on a PMC bot + * @param itemTemplate item details from db + * @param ammoItem Ammo item to randomise */ protected randomiseAmmoStackSize(isPmc: boolean, itemTemplate: ITemplateItem, ammoItem: Item): void; /** diff --git a/TypeScript/2EditDatabase/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/RepeatableQuestGenerator.d.ts index 40a3c16..44c38be 100644 --- a/TypeScript/2EditDatabase/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/RepeatableQuestGenerator.d.ts @@ -8,7 +8,7 @@ import { Exit } from "@spt-aki/models/eft/common/ILocationBase"; import { TraderInfo } from "@spt-aki/models/eft/common/tables/IBotBase"; import { ICompletion, ICompletionAvailableFor, IElimination, IEliminationCondition, IExploration, IExplorationCondition, IPickup, IRepeatableQuest, IReward, IRewards } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; -import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; @@ -155,7 +155,7 @@ export declare class RepeatableQuestGenerator { * @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ - protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig): IRewards; + protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IRewards; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config diff --git a/TypeScript/2EditDatabase/types/helpers/HideoutHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/HideoutHelper.d.ts index 93f8fb1..0cfc649 100644 --- a/TypeScript/2EditDatabase/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/HideoutHelper.d.ts @@ -1,7 +1,7 @@ import { InventoryHelper } from "@spt-aki/helpers/InventoryHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { Common, HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "@spt-aki/models/eft/hideout/IHideoutContinuousProductionStartRequestData"; @@ -201,22 +201,10 @@ export declare class HideoutHelper { * @returns coin slot count */ protected getBTCSlots(pmcData: IPmcData): number; - /** - * Does profile have elite hideout management skill - * @param pmcData Profile to look at - * @returns True if profile has skill - */ - protected hasEliteHideoutManagementSkill(pmcData: IPmcData): boolean; /** * Get a count of bitcoins player miner can hold */ protected getBitcoinMinerContainerSlotSize(): number; - /** - * Get the hideout management skill from player profile - * @param pmcData Profile to look at - * @returns Hideout management skill object - */ - protected getHideoutManagementSkill(pmcData: IPmcData): Common; /** * HideoutManagement skill gives a consumption bonus the higher the level * 0.5% per level per 1-51, (25.5% at max) diff --git a/TypeScript/2EditDatabase/types/helpers/ItemHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/ItemHelper.d.ts index 47823bc..e1c7720 100644 --- a/TypeScript/2EditDatabase/types/helpers/ItemHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/ItemHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -24,10 +25,11 @@ declare class ItemHelper { protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; + protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl diff --git a/TypeScript/2EditDatabase/types/helpers/ProfileHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/ProfileHelper.d.ts index 781f980..938c796 100644 --- a/TypeScript/2EditDatabase/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/ProfileHelper.d.ts @@ -1,11 +1,13 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IValidateNicknameRequestData } from "@spt-aki/models/eft/profile/IValidateNicknameRequestData"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; +import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileSnapshotService } from "@spt-aki/services/ProfileSnapshotService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -19,7 +21,8 @@ export declare class ProfileHelper { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected profileSnapshotService: ProfileSnapshotService; - constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); + protected localisationService: LocalisationService; + constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, localisationService: LocalisationService); /** * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id @@ -101,4 +104,21 @@ export declare class ProfileHelper { * @param keyToIncrement Key */ incrementStatCounter(counters: CounterKeyValue[], keyToIncrement: string): void; + /** + * Check if player has a skill at elite level + * @param skillType Skill to check + * @param pmcProfile Profile to find skill in + * @returns True if player has skill at elite level + */ + hasEliteSkillLevel(skillType: SkillTypes, pmcProfile: IPmcData): boolean; + /** + * Add points to a specific skill in player profile + * @param skill Skill to add points to + * @param pointsToAdd Points to add + * @param pmcProfile Player profile with skill + * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code + * @returns + */ + addSkillPointsToPlayer(pmcProfile: IPmcData, skill: SkillTypes, pointsToAdd: number, useSkillProgressRateMultipler?: boolean): void; + getSkillFromProfile(pmcData: IPmcData, skill: SkillTypes): Common; } diff --git a/TypeScript/2EditDatabase/types/helpers/QuestHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/QuestHelper.d.ts index 1e40e53..0dda05b 100644 --- a/TypeScript/2EditDatabase/types/helpers/QuestHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/QuestHelper.d.ts @@ -6,7 +6,7 @@ import { QuestConditionHelper } from "@spt-aki/helpers/QuestConditionHelper"; import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "@spt-aki/models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; @@ -66,14 +66,12 @@ export declare class QuestHelper { */ getDeltaQuests(before: IQuest[], after: IQuest[]): IQuest[]; /** - * Increase skill points of a skill on player profile - * Dupe of PlayerService.incrementSkillLevel() - * @param sessionID Session id - * @param pmcData Player profile - * @param skillName Name of skill to increase skill points of - * @param progressAmount Amount of skill points to add to skill + * Adjust skill experience for low skill levels, mimicing the official client + * @param profileSkill the skill experience is being added to + * @param progressAmount the amount of experience being added to the skill + * @returns the adjusted skill progress gain */ - rewardSkillPoints(sessionID: string, pmcData: IPmcData, skillName: string, progressAmount: number): void; + adjustSkillExpForLowLevels(profileSkill: Common, progressAmount: number): number; /** * Get quest name by quest id * @param questId id to get diff --git a/TypeScript/2EditDatabase/types/loaders/PreAkiModLoader.d.ts b/TypeScript/2EditDatabase/types/loaders/PreAkiModLoader.d.ts index 869dfbb..71fd745 100644 --- a/TypeScript/2EditDatabase/types/loaders/PreAkiModLoader.d.ts +++ b/TypeScript/2EditDatabase/types/loaders/PreAkiModLoader.d.ts @@ -29,7 +29,7 @@ export declare class PreAkiModLoader implements IModLoader { protected imported: Record; protected akiConfig: ICoreConfig; protected serverDependencies: Record; - protected skippedMods: string[]; + protected skippedMods: Set; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, bundleLoader: BundleLoader, localisationService: LocalisationService, configServer: ConfigServer, modLoadOrder: ModLoadOrder, modTypeCheck: ModTypeCheck); load(container: DependencyContainer): Promise; /** @@ -44,27 +44,22 @@ export declare class PreAkiModLoader implements IModLoader { 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 + * @param modPackageData map of mod package.json data */ - protected checkForDuplicateMods(modPackageData: Record): void; + protected checkForDuplicateMods(modPackageData: Map): void; /** - * Check for and return duplicate strings inside an array - * @param stringArray Array to check for duplicates - * @returns string array of duplicates, empty if none found - */ - protected getDuplicates(stringArray: string[]): string[]; - /** - * Get an array of mods with errors that prevent them from working with SPT + * Returns an array of valid mods. + * * @param mods mods to validate - * @returns Mod names as array + * @returns array of mod folder names */ - protected getBrokenMods(mods: string[]): string[]; + protected getValidMods(mods: string[]): string[]; /** * Get packageJson data for mods * @param mods mods to get packageJson for - * @returns dictionary + * @returns map */ - protected getModsPackageData(mods: string[]): Record; + protected getModsPackageData(mods: string[]): Map; /** * Is the passed in mod compatible with the running server version * @param mod Mod to check compatibiltiy with AKI @@ -86,10 +81,17 @@ export declare class PreAkiModLoader implements IModLoader { * Compile mod and add into class property "imported" * @param mod Name of mod to compile/add */ - protected addModAsync(mod: string): Promise; + protected addModAsync(mod: string, pkg: IPackageJsonData): Promise; + /** + * Checks if a given mod should be loaded or skipped. + * + * @param pkg mod package.json data + * @returns + */ + protected shouldSkipMod(pkg: IPackageJsonData): boolean; protected autoInstallDependencies(modPath: string, pkg: IPackageJsonData): void; - protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Record): boolean; - protected isModCompatible(mod: IPackageJsonData, loadedMods: Record): boolean; + protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Map): boolean; + protected isModCompatible(mod: IPackageJsonData, loadedMods: Map): boolean; /** * Validate a mod passes a number of checks * @param modName name of mod in /mods/ to validate diff --git a/TypeScript/2EditDatabase/types/models/enums/SkillTypes.d.ts b/TypeScript/2EditDatabase/types/models/enums/SkillTypes.d.ts index 4eb90af..dc059a8 100644 --- a/TypeScript/2EditDatabase/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/2EditDatabase/types/models/enums/SkillTypes.d.ts @@ -1,4 +1,6 @@ export declare enum SkillTypes { + BOT_RELOAD = "BotReload", + BOT_SOUND = "BotSound", HIDEOUT_MANAGEMENT = "HideoutManagement", CRAFTING = "Crafting", METABOLISM = "Metabolism", @@ -19,6 +21,7 @@ export declare enum SkillTypes { ATTENTION = "Attention", CHARISMA = "Charisma", MEMORY = "Memory", + MELEE = "Melee", SURGERY = "Surgery", AIM_DRILLS = "AimDrills", TROUBLESHOOTING = "TroubleShooting", @@ -31,6 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", + /** Also called Weapon Maintenance*/ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts index c76eda7..24c8c19 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts @@ -102,6 +102,8 @@ export interface EquipmentFilters { weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; /** Same as weightingAdjustments but based on player level instead of bot level */ weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; + /** Should the stock mod be forced to spawn on bot */ + forceStock: boolean; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/2EditDatabase/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/IQuestConfig.d.ts index 3e3b2be..8a71eb9 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/IQuestConfig.d.ts @@ -55,6 +55,8 @@ export interface IRewardScaling { items: number[]; reputation: number[]; rewardSpread: number; + skillRewardChance: number[]; + skillPointReward: number[]; } export interface ITraderWhitelist { traderId: string; @@ -66,7 +68,7 @@ export interface IRepeatableQuestTypesConfig { Pickup: IPickup; Elimination: IEliminationConfig[]; } -export interface IExploration { +export interface IExploration extends IBaseQuestConfig { maxExtracts: number; specificExits: ISpecificExits; } @@ -74,7 +76,7 @@ export interface ISpecificExits { probability: number; passageRequirementWhitelist: string[]; } -export interface ICompletion { +export interface ICompletion extends IBaseQuestConfig { minRequestedAmount: number; maxRequestedAmount: number; minRequestedBulletAmount: number; @@ -82,7 +84,7 @@ export interface ICompletion { useWhitelist: boolean; useBlacklist: boolean; } -export interface IPickup { +export interface IPickup extends IBaseQuestConfig { ItemTypeToFetchWithMaxCount: IPickupTypeWithMaxCount[]; } export interface IPickupTypeWithMaxCount { @@ -90,7 +92,7 @@ export interface IPickupTypeWithMaxCount { maxPickupCount: number; minPickupCount: number; } -export interface IEliminationConfig { +export interface IEliminationConfig extends IBaseQuestConfig { levelRange: MinMax; targets: ITarget[]; bodyPartProb: number; @@ -111,6 +113,9 @@ export interface IEliminationConfig { weaponRequirementProb: number; weaponRequirements: IWeaponRequirement[]; } +export interface IBaseQuestConfig { + possibleSkillRewards: string[]; +} export interface ITarget extends IProbabilityObject { data: IBossInfo; } diff --git a/TypeScript/2EditDatabase/types/models/spt/config/IRepairConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/IRepairConfig.d.ts index 1ae082d..9e23cc4 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/IRepairConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/IRepairConfig.d.ts @@ -9,6 +9,7 @@ export interface IRepairConfig extends IBaseConfig { /** INT gain multiplier per repaired item type */ repairKitIntellectGainMultiplier: IIntellectGainValues; maxIntellectGainPerRepair: IMaxIntellectGainValues; + weaponTreatment: IWeaponTreatmentRepairValues; repairKit: RepairKit; } export interface IIntellectGainValues { @@ -19,6 +20,16 @@ export interface IMaxIntellectGainValues { kit: number; trader: number; } +export interface IWeaponTreatmentRepairValues { + /** The chance to gain more weapon maintenance skill */ + critSuccessChance: number; + critSuccessAmount: number; + /** The chance to gain less weapon maintenance skill */ + critFailureChance: number; + critFailureAmount: number; + /** The multiplier used for calculating weapon maintenance XP */ + pointGainMultiplier: number; +} export interface RepairKit { armor: BonusSettings; weapon: BonusSettings; diff --git a/TypeScript/2EditDatabase/types/services/PlayerService.d.ts b/TypeScript/2EditDatabase/types/services/PlayerService.d.ts index edf269e..f24e0dc 100644 --- a/TypeScript/2EditDatabase/types/services/PlayerService.d.ts +++ b/TypeScript/2EditDatabase/types/services/PlayerService.d.ts @@ -9,15 +9,6 @@ export declare class PlayerService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, databaseServer: DatabaseServer); - /** - * Dupe of QuestHelper.rewardsSkillPoints() - * Add xp to a player skill - * @param pmcData Player profile - * @param skillName Name of skill to increment - * @param amount Amount of skill points to add to skill - * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code - */ - incrementSkillLevel(pmcData: IPmcData, skillName: string, amount: number, useSkillProgressRateMultipler?: boolean): void; /** * Get level of player * @param pmcData Player profile diff --git a/TypeScript/2EditDatabase/types/services/RepairService.d.ts b/TypeScript/2EditDatabase/types/services/RepairService.d.ts index b8ffbaa..8f9e7e9 100644 --- a/TypeScript/2EditDatabase/types/services/RepairService.d.ts +++ b/TypeScript/2EditDatabase/types/services/RepairService.d.ts @@ -1,5 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { QuestHelper } from "@spt-aki/helpers/QuestHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { RepairHelper } from "@spt-aki/helpers/RepairHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; @@ -9,6 +9,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { RepairKitsInfo } from "@spt-aki/models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "@spt-aki/models/eft/repair/ITraderRepairActionDataRequest"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { BonusSettings, IRepairConfig } from "@spt-aki/models/spt/config/IRepairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -19,7 +20,7 @@ import { RandomUtil } from "@spt-aki/utils/RandomUtil"; export declare class RepairService { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected questHelper: QuestHelper; + protected profileHelper: ProfileHelper; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; @@ -29,7 +30,7 @@ export declare class RepairService { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id @@ -56,6 +57,12 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + /** + * Return an appromixation of the amount of skill points live would return for the given repairDetails + * @param repairDetails the repair details to calculate skill points for + * @returns the number of skill points to reward the user + */ + protected getWeaponRepairSkillPoints(repairDetails: RepairDetails): number; /** * * @param sessionId Session id @@ -81,6 +88,13 @@ export declare class RepairService { * @returns Multiplier value */ protected getBonusMultiplierValue(skillBonusName: string, pmcData: IPmcData): number; + /** + * Should a repair kit apply total durability loss on repair + * @param pmcData Player profile + * @param applyRandomizeDurabilityLoss Value from repair config + * @returns True if loss should be applied + */ + protected shouldRepairKitApplyDurabilityLoss(pmcData: IPmcData, applyRandomizeDurabilityLoss: boolean): boolean; /** * Update repair kits Resource object if it doesn't exist * @param repairKitDetails Repair kit details from db @@ -112,7 +126,7 @@ export declare class RepairService { * @param itemTemplate Item to check for skill * @returns Skill name */ - protected getItemSkillType(itemTemplate: ITemplateItem): string; + protected getItemSkillType(itemTemplate: ITemplateItem): SkillTypes; /** * Ensure multiplier is between 1 and 0.01 * @param receiveDurabilityMaxPercent Max durabiltiy percent @@ -123,6 +137,7 @@ export declare class RepairService { } export declare class RepairDetails { repairCost?: number; + repairPoints?: number; repairedItem: Item; repairedItemIsArmor: boolean; repairAmount: number; diff --git a/TypeScript/2EditDatabase/types/utils/App.d.ts b/TypeScript/2EditDatabase/types/utils/App.d.ts index 1839695..64800ce 100644 --- a/TypeScript/2EditDatabase/types/utils/App.d.ts +++ b/TypeScript/2EditDatabase/types/utils/App.d.ts @@ -1,6 +1,8 @@ import { OnLoad } from "@spt-aki/di/OnLoad"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -8,11 +10,13 @@ export declare class App { protected logger: ILogger; protected timeUtil: TimeUtil; protected localisationService: LocalisationService; + protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/3GetSptConfigFile/types/controllers/GameController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/GameController.d.ts index 640a8c1..168071d 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/GameController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/GameController.d.ts @@ -61,6 +61,10 @@ export declare class GameController { * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + /** + * Out of date/incorrectly made trader mods forget this data + */ + protected checkTraderRepairValuesExist(): void; protected addCustomLooseLootPositions(): void; protected adjustLooseLootSpawnProbabilities(): void; protected setHideoutAreasAndCraftsTo40Secs(): void; diff --git a/TypeScript/3GetSptConfigFile/types/controllers/InsuranceController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/InsuranceController.d.ts index b1e8fe6..0ee30ed 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/InsuranceController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/InsuranceController.d.ts @@ -8,7 +8,7 @@ import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGet import { IGetInsuranceCostResponseData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostResponseData"; import { IInsureRequestData } from "@spt-aki/models/eft/insurance/IInsureRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; -import { Insurance, ISystemData } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ISystemData, Insurance } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IInsuranceConfig } from "@spt-aki/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; diff --git a/TypeScript/3GetSptConfigFile/types/controllers/RepeatableQuestController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/RepeatableQuestController.d.ts index b09b540..a3ebc1c 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/RepeatableQuestController.d.ts @@ -13,6 +13,7 @@ import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -21,8 +22,9 @@ import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RepeatableQuestController { - protected timeUtil: TimeUtil; protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; @@ -37,7 +39,7 @@ export declare class RepeatableQuestController { protected questHelper: QuestHelper; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. @@ -64,6 +66,13 @@ export declare class RepeatableQuestController { * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Get the number of quests to generate - takes into account charisma state of player + * @param repeatableConfig Config + * @param pmcData Player profile + * @returns Quest count + */ + protected getQuestCount(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): number; /** * Get repeatable quest data from profile from name (daily/weekly), creates base repeatable quest object if none exists * @param repeatableConfig daily/weekly config diff --git a/TypeScript/3GetSptConfigFile/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/BotEquipmentModGenerator.d.ts index 05266dd..75530c7 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/BotEquipmentModGenerator.d.ts @@ -179,7 +179,7 @@ export declare class BotEquipmentModGenerator { * Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots. * This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine" * @param items The items where the CylinderMagazine's camora are appended to - * @param modPool modPool which should include available cartrigdes + * @param modPool modPool which should include available cartridges * @param parentId The CylinderMagazine's UID * @param parentTemplate The CylinderMagazine's template */ diff --git a/TypeScript/3GetSptConfigFile/types/generators/BotLootGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/BotLootGenerator.d.ts index e937a4d..7a4c521 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/BotLootGenerator.d.ts @@ -83,7 +83,7 @@ export declare class BotLootGenerator { * @param equipmentSlot slot to place the preset in (backpack) * @param templateInventory bots template, assault.json * @param modChances chances for mods to spawn on weapon - * @param botRole bots role, .e.g. pmcBot + * @param botRole bots role .e.g. pmcBot * @param isPmc are we generating for a pmc */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; @@ -120,16 +120,16 @@ export declare class BotLootGenerator { protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; /** * Randomise the stack size of a money object, uses different values for pmc or scavs - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param moneyItem Money stack to randomise + * @param isPmc Is money on a PMC bot + * @param itemTemplate item details from db + * @param moneyItem Money item to randomise */ protected randomiseMoneyStackSize(isPmc: boolean, itemTemplate: ITemplateItem, moneyItem: Item): void; /** * Randomise the size of an ammo stack - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param ammoItem Ammo stack to randomise + * @param isPmc Is ammo on a PMC bot + * @param itemTemplate item details from db + * @param ammoItem Ammo item to randomise */ protected randomiseAmmoStackSize(isPmc: boolean, itemTemplate: ITemplateItem, ammoItem: Item): void; /** diff --git a/TypeScript/3GetSptConfigFile/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/RepeatableQuestGenerator.d.ts index 40a3c16..44c38be 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/RepeatableQuestGenerator.d.ts @@ -8,7 +8,7 @@ import { Exit } from "@spt-aki/models/eft/common/ILocationBase"; import { TraderInfo } from "@spt-aki/models/eft/common/tables/IBotBase"; import { ICompletion, ICompletionAvailableFor, IElimination, IEliminationCondition, IExploration, IExplorationCondition, IPickup, IRepeatableQuest, IReward, IRewards } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; -import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; @@ -155,7 +155,7 @@ export declare class RepeatableQuestGenerator { * @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ - protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig): IRewards; + protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IRewards; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config diff --git a/TypeScript/3GetSptConfigFile/types/helpers/HideoutHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/HideoutHelper.d.ts index 93f8fb1..0cfc649 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/HideoutHelper.d.ts @@ -1,7 +1,7 @@ import { InventoryHelper } from "@spt-aki/helpers/InventoryHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { Common, HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "@spt-aki/models/eft/hideout/IHideoutContinuousProductionStartRequestData"; @@ -201,22 +201,10 @@ export declare class HideoutHelper { * @returns coin slot count */ protected getBTCSlots(pmcData: IPmcData): number; - /** - * Does profile have elite hideout management skill - * @param pmcData Profile to look at - * @returns True if profile has skill - */ - protected hasEliteHideoutManagementSkill(pmcData: IPmcData): boolean; /** * Get a count of bitcoins player miner can hold */ protected getBitcoinMinerContainerSlotSize(): number; - /** - * Get the hideout management skill from player profile - * @param pmcData Profile to look at - * @returns Hideout management skill object - */ - protected getHideoutManagementSkill(pmcData: IPmcData): Common; /** * HideoutManagement skill gives a consumption bonus the higher the level * 0.5% per level per 1-51, (25.5% at max) diff --git a/TypeScript/3GetSptConfigFile/types/helpers/ItemHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/ItemHelper.d.ts index 47823bc..e1c7720 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/ItemHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/ItemHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -24,10 +25,11 @@ declare class ItemHelper { protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; + protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl diff --git a/TypeScript/3GetSptConfigFile/types/helpers/ProfileHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/ProfileHelper.d.ts index 781f980..938c796 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/ProfileHelper.d.ts @@ -1,11 +1,13 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IValidateNicknameRequestData } from "@spt-aki/models/eft/profile/IValidateNicknameRequestData"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; +import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileSnapshotService } from "@spt-aki/services/ProfileSnapshotService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -19,7 +21,8 @@ export declare class ProfileHelper { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected profileSnapshotService: ProfileSnapshotService; - constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); + protected localisationService: LocalisationService; + constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, localisationService: LocalisationService); /** * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id @@ -101,4 +104,21 @@ export declare class ProfileHelper { * @param keyToIncrement Key */ incrementStatCounter(counters: CounterKeyValue[], keyToIncrement: string): void; + /** + * Check if player has a skill at elite level + * @param skillType Skill to check + * @param pmcProfile Profile to find skill in + * @returns True if player has skill at elite level + */ + hasEliteSkillLevel(skillType: SkillTypes, pmcProfile: IPmcData): boolean; + /** + * Add points to a specific skill in player profile + * @param skill Skill to add points to + * @param pointsToAdd Points to add + * @param pmcProfile Player profile with skill + * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code + * @returns + */ + addSkillPointsToPlayer(pmcProfile: IPmcData, skill: SkillTypes, pointsToAdd: number, useSkillProgressRateMultipler?: boolean): void; + getSkillFromProfile(pmcData: IPmcData, skill: SkillTypes): Common; } diff --git a/TypeScript/3GetSptConfigFile/types/helpers/QuestHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/QuestHelper.d.ts index 1e40e53..0dda05b 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/QuestHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/QuestHelper.d.ts @@ -6,7 +6,7 @@ import { QuestConditionHelper } from "@spt-aki/helpers/QuestConditionHelper"; import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "@spt-aki/models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; @@ -66,14 +66,12 @@ export declare class QuestHelper { */ getDeltaQuests(before: IQuest[], after: IQuest[]): IQuest[]; /** - * Increase skill points of a skill on player profile - * Dupe of PlayerService.incrementSkillLevel() - * @param sessionID Session id - * @param pmcData Player profile - * @param skillName Name of skill to increase skill points of - * @param progressAmount Amount of skill points to add to skill + * Adjust skill experience for low skill levels, mimicing the official client + * @param profileSkill the skill experience is being added to + * @param progressAmount the amount of experience being added to the skill + * @returns the adjusted skill progress gain */ - rewardSkillPoints(sessionID: string, pmcData: IPmcData, skillName: string, progressAmount: number): void; + adjustSkillExpForLowLevels(profileSkill: Common, progressAmount: number): number; /** * Get quest name by quest id * @param questId id to get diff --git a/TypeScript/3GetSptConfigFile/types/loaders/PreAkiModLoader.d.ts b/TypeScript/3GetSptConfigFile/types/loaders/PreAkiModLoader.d.ts index 869dfbb..71fd745 100644 --- a/TypeScript/3GetSptConfigFile/types/loaders/PreAkiModLoader.d.ts +++ b/TypeScript/3GetSptConfigFile/types/loaders/PreAkiModLoader.d.ts @@ -29,7 +29,7 @@ export declare class PreAkiModLoader implements IModLoader { protected imported: Record; protected akiConfig: ICoreConfig; protected serverDependencies: Record; - protected skippedMods: string[]; + protected skippedMods: Set; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, bundleLoader: BundleLoader, localisationService: LocalisationService, configServer: ConfigServer, modLoadOrder: ModLoadOrder, modTypeCheck: ModTypeCheck); load(container: DependencyContainer): Promise; /** @@ -44,27 +44,22 @@ export declare class PreAkiModLoader implements IModLoader { 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 + * @param modPackageData map of mod package.json data */ - protected checkForDuplicateMods(modPackageData: Record): void; + protected checkForDuplicateMods(modPackageData: Map): void; /** - * Check for and return duplicate strings inside an array - * @param stringArray Array to check for duplicates - * @returns string array of duplicates, empty if none found - */ - protected getDuplicates(stringArray: string[]): string[]; - /** - * Get an array of mods with errors that prevent them from working with SPT + * Returns an array of valid mods. + * * @param mods mods to validate - * @returns Mod names as array + * @returns array of mod folder names */ - protected getBrokenMods(mods: string[]): string[]; + protected getValidMods(mods: string[]): string[]; /** * Get packageJson data for mods * @param mods mods to get packageJson for - * @returns dictionary + * @returns map */ - protected getModsPackageData(mods: string[]): Record; + protected getModsPackageData(mods: string[]): Map; /** * Is the passed in mod compatible with the running server version * @param mod Mod to check compatibiltiy with AKI @@ -86,10 +81,17 @@ export declare class PreAkiModLoader implements IModLoader { * Compile mod and add into class property "imported" * @param mod Name of mod to compile/add */ - protected addModAsync(mod: string): Promise; + protected addModAsync(mod: string, pkg: IPackageJsonData): Promise; + /** + * Checks if a given mod should be loaded or skipped. + * + * @param pkg mod package.json data + * @returns + */ + protected shouldSkipMod(pkg: IPackageJsonData): boolean; protected autoInstallDependencies(modPath: string, pkg: IPackageJsonData): void; - protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Record): boolean; - protected isModCompatible(mod: IPackageJsonData, loadedMods: Record): boolean; + protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Map): boolean; + protected isModCompatible(mod: IPackageJsonData, loadedMods: Map): boolean; /** * Validate a mod passes a number of checks * @param modName name of mod in /mods/ to validate diff --git a/TypeScript/3GetSptConfigFile/types/models/enums/SkillTypes.d.ts b/TypeScript/3GetSptConfigFile/types/models/enums/SkillTypes.d.ts index 4eb90af..dc059a8 100644 --- a/TypeScript/3GetSptConfigFile/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/enums/SkillTypes.d.ts @@ -1,4 +1,6 @@ export declare enum SkillTypes { + BOT_RELOAD = "BotReload", + BOT_SOUND = "BotSound", HIDEOUT_MANAGEMENT = "HideoutManagement", CRAFTING = "Crafting", METABOLISM = "Metabolism", @@ -19,6 +21,7 @@ export declare enum SkillTypes { ATTENTION = "Attention", CHARISMA = "Charisma", MEMORY = "Memory", + MELEE = "Melee", SURGERY = "Surgery", AIM_DRILLS = "AimDrills", TROUBLESHOOTING = "TroubleShooting", @@ -31,6 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", + /** Also called Weapon Maintenance*/ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts index c76eda7..24c8c19 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts @@ -102,6 +102,8 @@ export interface EquipmentFilters { weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; /** Same as weightingAdjustments but based on player level instead of bot level */ weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; + /** Should the stock mod be forced to spawn on bot */ + forceStock: boolean; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/IQuestConfig.d.ts index 3e3b2be..8a71eb9 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/IQuestConfig.d.ts @@ -55,6 +55,8 @@ export interface IRewardScaling { items: number[]; reputation: number[]; rewardSpread: number; + skillRewardChance: number[]; + skillPointReward: number[]; } export interface ITraderWhitelist { traderId: string; @@ -66,7 +68,7 @@ export interface IRepeatableQuestTypesConfig { Pickup: IPickup; Elimination: IEliminationConfig[]; } -export interface IExploration { +export interface IExploration extends IBaseQuestConfig { maxExtracts: number; specificExits: ISpecificExits; } @@ -74,7 +76,7 @@ export interface ISpecificExits { probability: number; passageRequirementWhitelist: string[]; } -export interface ICompletion { +export interface ICompletion extends IBaseQuestConfig { minRequestedAmount: number; maxRequestedAmount: number; minRequestedBulletAmount: number; @@ -82,7 +84,7 @@ export interface ICompletion { useWhitelist: boolean; useBlacklist: boolean; } -export interface IPickup { +export interface IPickup extends IBaseQuestConfig { ItemTypeToFetchWithMaxCount: IPickupTypeWithMaxCount[]; } export interface IPickupTypeWithMaxCount { @@ -90,7 +92,7 @@ export interface IPickupTypeWithMaxCount { maxPickupCount: number; minPickupCount: number; } -export interface IEliminationConfig { +export interface IEliminationConfig extends IBaseQuestConfig { levelRange: MinMax; targets: ITarget[]; bodyPartProb: number; @@ -111,6 +113,9 @@ export interface IEliminationConfig { weaponRequirementProb: number; weaponRequirements: IWeaponRequirement[]; } +export interface IBaseQuestConfig { + possibleSkillRewards: string[]; +} export interface ITarget extends IProbabilityObject { data: IBossInfo; } diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/IRepairConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/IRepairConfig.d.ts index 1ae082d..9e23cc4 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/IRepairConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/IRepairConfig.d.ts @@ -9,6 +9,7 @@ export interface IRepairConfig extends IBaseConfig { /** INT gain multiplier per repaired item type */ repairKitIntellectGainMultiplier: IIntellectGainValues; maxIntellectGainPerRepair: IMaxIntellectGainValues; + weaponTreatment: IWeaponTreatmentRepairValues; repairKit: RepairKit; } export interface IIntellectGainValues { @@ -19,6 +20,16 @@ export interface IMaxIntellectGainValues { kit: number; trader: number; } +export interface IWeaponTreatmentRepairValues { + /** The chance to gain more weapon maintenance skill */ + critSuccessChance: number; + critSuccessAmount: number; + /** The chance to gain less weapon maintenance skill */ + critFailureChance: number; + critFailureAmount: number; + /** The multiplier used for calculating weapon maintenance XP */ + pointGainMultiplier: number; +} export interface RepairKit { armor: BonusSettings; weapon: BonusSettings; diff --git a/TypeScript/3GetSptConfigFile/types/services/PlayerService.d.ts b/TypeScript/3GetSptConfigFile/types/services/PlayerService.d.ts index edf269e..f24e0dc 100644 --- a/TypeScript/3GetSptConfigFile/types/services/PlayerService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/PlayerService.d.ts @@ -9,15 +9,6 @@ export declare class PlayerService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, databaseServer: DatabaseServer); - /** - * Dupe of QuestHelper.rewardsSkillPoints() - * Add xp to a player skill - * @param pmcData Player profile - * @param skillName Name of skill to increment - * @param amount Amount of skill points to add to skill - * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code - */ - incrementSkillLevel(pmcData: IPmcData, skillName: string, amount: number, useSkillProgressRateMultipler?: boolean): void; /** * Get level of player * @param pmcData Player profile diff --git a/TypeScript/3GetSptConfigFile/types/services/RepairService.d.ts b/TypeScript/3GetSptConfigFile/types/services/RepairService.d.ts index b8ffbaa..8f9e7e9 100644 --- a/TypeScript/3GetSptConfigFile/types/services/RepairService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/RepairService.d.ts @@ -1,5 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { QuestHelper } from "@spt-aki/helpers/QuestHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { RepairHelper } from "@spt-aki/helpers/RepairHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; @@ -9,6 +9,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { RepairKitsInfo } from "@spt-aki/models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "@spt-aki/models/eft/repair/ITraderRepairActionDataRequest"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { BonusSettings, IRepairConfig } from "@spt-aki/models/spt/config/IRepairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -19,7 +20,7 @@ import { RandomUtil } from "@spt-aki/utils/RandomUtil"; export declare class RepairService { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected questHelper: QuestHelper; + protected profileHelper: ProfileHelper; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; @@ -29,7 +30,7 @@ export declare class RepairService { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id @@ -56,6 +57,12 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + /** + * Return an appromixation of the amount of skill points live would return for the given repairDetails + * @param repairDetails the repair details to calculate skill points for + * @returns the number of skill points to reward the user + */ + protected getWeaponRepairSkillPoints(repairDetails: RepairDetails): number; /** * * @param sessionId Session id @@ -81,6 +88,13 @@ export declare class RepairService { * @returns Multiplier value */ protected getBonusMultiplierValue(skillBonusName: string, pmcData: IPmcData): number; + /** + * Should a repair kit apply total durability loss on repair + * @param pmcData Player profile + * @param applyRandomizeDurabilityLoss Value from repair config + * @returns True if loss should be applied + */ + protected shouldRepairKitApplyDurabilityLoss(pmcData: IPmcData, applyRandomizeDurabilityLoss: boolean): boolean; /** * Update repair kits Resource object if it doesn't exist * @param repairKitDetails Repair kit details from db @@ -112,7 +126,7 @@ export declare class RepairService { * @param itemTemplate Item to check for skill * @returns Skill name */ - protected getItemSkillType(itemTemplate: ITemplateItem): string; + protected getItemSkillType(itemTemplate: ITemplateItem): SkillTypes; /** * Ensure multiplier is between 1 and 0.01 * @param receiveDurabilityMaxPercent Max durabiltiy percent @@ -123,6 +137,7 @@ export declare class RepairService { } export declare class RepairDetails { repairCost?: number; + repairPoints?: number; repairedItem: Item; repairedItemIsArmor: boolean; repairAmount: number; diff --git a/TypeScript/3GetSptConfigFile/types/utils/App.d.ts b/TypeScript/3GetSptConfigFile/types/utils/App.d.ts index 1839695..64800ce 100644 --- a/TypeScript/3GetSptConfigFile/types/utils/App.d.ts +++ b/TypeScript/3GetSptConfigFile/types/utils/App.d.ts @@ -1,6 +1,8 @@ import { OnLoad } from "@spt-aki/di/OnLoad"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -8,11 +10,13 @@ export declare class App { protected logger: ILogger; protected timeUtil: TimeUtil; protected localisationService: LocalisationService; + protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/GameController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/GameController.d.ts index 640a8c1..168071d 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/GameController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/GameController.d.ts @@ -61,6 +61,10 @@ export declare class GameController { * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + /** + * Out of date/incorrectly made trader mods forget this data + */ + protected checkTraderRepairValuesExist(): void; protected addCustomLooseLootPositions(): void; protected adjustLooseLootSpawnProbabilities(): void; protected setHideoutAreasAndCraftsTo40Secs(): void; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/InsuranceController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/InsuranceController.d.ts index b1e8fe6..0ee30ed 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/InsuranceController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/InsuranceController.d.ts @@ -8,7 +8,7 @@ import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGet import { IGetInsuranceCostResponseData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostResponseData"; import { IInsureRequestData } from "@spt-aki/models/eft/insurance/IInsureRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; -import { Insurance, ISystemData } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ISystemData, Insurance } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IInsuranceConfig } from "@spt-aki/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RepeatableQuestController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RepeatableQuestController.d.ts index b09b540..a3ebc1c 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RepeatableQuestController.d.ts @@ -13,6 +13,7 @@ import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -21,8 +22,9 @@ import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RepeatableQuestController { - protected timeUtil: TimeUtil; protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; @@ -37,7 +39,7 @@ export declare class RepeatableQuestController { protected questHelper: QuestHelper; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. @@ -64,6 +66,13 @@ export declare class RepeatableQuestController { * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Get the number of quests to generate - takes into account charisma state of player + * @param repeatableConfig Config + * @param pmcData Player profile + * @returns Quest count + */ + protected getQuestCount(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): number; /** * Get repeatable quest data from profile from name (daily/weekly), creates base repeatable quest object if none exists * @param repeatableConfig daily/weekly config diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotEquipmentModGenerator.d.ts index 05266dd..75530c7 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotEquipmentModGenerator.d.ts @@ -179,7 +179,7 @@ export declare class BotEquipmentModGenerator { * Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots. * This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine" * @param items The items where the CylinderMagazine's camora are appended to - * @param modPool modPool which should include available cartrigdes + * @param modPool modPool which should include available cartridges * @param parentId The CylinderMagazine's UID * @param parentTemplate The CylinderMagazine's template */ diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotLootGenerator.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotLootGenerator.d.ts index e937a4d..7a4c521 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotLootGenerator.d.ts @@ -83,7 +83,7 @@ export declare class BotLootGenerator { * @param equipmentSlot slot to place the preset in (backpack) * @param templateInventory bots template, assault.json * @param modChances chances for mods to spawn on weapon - * @param botRole bots role, .e.g. pmcBot + * @param botRole bots role .e.g. pmcBot * @param isPmc are we generating for a pmc */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; @@ -120,16 +120,16 @@ export declare class BotLootGenerator { protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; /** * Randomise the stack size of a money object, uses different values for pmc or scavs - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param moneyItem Money stack to randomise + * @param isPmc Is money on a PMC bot + * @param itemTemplate item details from db + * @param moneyItem Money item to randomise */ protected randomiseMoneyStackSize(isPmc: boolean, itemTemplate: ITemplateItem, moneyItem: Item): void; /** * Randomise the size of an ammo stack - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param ammoItem Ammo stack to randomise + * @param isPmc Is ammo on a PMC bot + * @param itemTemplate item details from db + * @param ammoItem Ammo item to randomise */ protected randomiseAmmoStackSize(isPmc: boolean, itemTemplate: ITemplateItem, ammoItem: Item): void; /** diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RepeatableQuestGenerator.d.ts index 40a3c16..44c38be 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RepeatableQuestGenerator.d.ts @@ -8,7 +8,7 @@ import { Exit } from "@spt-aki/models/eft/common/ILocationBase"; import { TraderInfo } from "@spt-aki/models/eft/common/tables/IBotBase"; import { ICompletion, ICompletionAvailableFor, IElimination, IEliminationCondition, IExploration, IExplorationCondition, IPickup, IRepeatableQuest, IReward, IRewards } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; -import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; @@ -155,7 +155,7 @@ export declare class RepeatableQuestGenerator { * @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ - protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig): IRewards; + protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IRewards; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/HideoutHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/HideoutHelper.d.ts index 93f8fb1..0cfc649 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/HideoutHelper.d.ts @@ -1,7 +1,7 @@ import { InventoryHelper } from "@spt-aki/helpers/InventoryHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { Common, HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "@spt-aki/models/eft/hideout/IHideoutContinuousProductionStartRequestData"; @@ -201,22 +201,10 @@ export declare class HideoutHelper { * @returns coin slot count */ protected getBTCSlots(pmcData: IPmcData): number; - /** - * Does profile have elite hideout management skill - * @param pmcData Profile to look at - * @returns True if profile has skill - */ - protected hasEliteHideoutManagementSkill(pmcData: IPmcData): boolean; /** * Get a count of bitcoins player miner can hold */ protected getBitcoinMinerContainerSlotSize(): number; - /** - * Get the hideout management skill from player profile - * @param pmcData Profile to look at - * @returns Hideout management skill object - */ - protected getHideoutManagementSkill(pmcData: IPmcData): Common; /** * HideoutManagement skill gives a consumption bonus the higher the level * 0.5% per level per 1-51, (25.5% at max) diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/ItemHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/ItemHelper.d.ts index 47823bc..e1c7720 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/ItemHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/ItemHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -24,10 +25,11 @@ declare class ItemHelper { protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; + protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/ProfileHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/ProfileHelper.d.ts index 781f980..938c796 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/ProfileHelper.d.ts @@ -1,11 +1,13 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IValidateNicknameRequestData } from "@spt-aki/models/eft/profile/IValidateNicknameRequestData"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; +import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileSnapshotService } from "@spt-aki/services/ProfileSnapshotService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -19,7 +21,8 @@ export declare class ProfileHelper { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected profileSnapshotService: ProfileSnapshotService; - constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); + protected localisationService: LocalisationService; + constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, localisationService: LocalisationService); /** * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id @@ -101,4 +104,21 @@ export declare class ProfileHelper { * @param keyToIncrement Key */ incrementStatCounter(counters: CounterKeyValue[], keyToIncrement: string): void; + /** + * Check if player has a skill at elite level + * @param skillType Skill to check + * @param pmcProfile Profile to find skill in + * @returns True if player has skill at elite level + */ + hasEliteSkillLevel(skillType: SkillTypes, pmcProfile: IPmcData): boolean; + /** + * Add points to a specific skill in player profile + * @param skill Skill to add points to + * @param pointsToAdd Points to add + * @param pmcProfile Player profile with skill + * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code + * @returns + */ + addSkillPointsToPlayer(pmcProfile: IPmcData, skill: SkillTypes, pointsToAdd: number, useSkillProgressRateMultipler?: boolean): void; + getSkillFromProfile(pmcData: IPmcData, skill: SkillTypes): Common; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/QuestHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/QuestHelper.d.ts index 1e40e53..0dda05b 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/QuestHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/QuestHelper.d.ts @@ -6,7 +6,7 @@ import { QuestConditionHelper } from "@spt-aki/helpers/QuestConditionHelper"; import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "@spt-aki/models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; @@ -66,14 +66,12 @@ export declare class QuestHelper { */ getDeltaQuests(before: IQuest[], after: IQuest[]): IQuest[]; /** - * Increase skill points of a skill on player profile - * Dupe of PlayerService.incrementSkillLevel() - * @param sessionID Session id - * @param pmcData Player profile - * @param skillName Name of skill to increase skill points of - * @param progressAmount Amount of skill points to add to skill + * Adjust skill experience for low skill levels, mimicing the official client + * @param profileSkill the skill experience is being added to + * @param progressAmount the amount of experience being added to the skill + * @returns the adjusted skill progress gain */ - rewardSkillPoints(sessionID: string, pmcData: IPmcData, skillName: string, progressAmount: number): void; + adjustSkillExpForLowLevels(profileSkill: Common, progressAmount: number): number; /** * Get quest name by quest id * @param questId id to get diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/loaders/PreAkiModLoader.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/loaders/PreAkiModLoader.d.ts index 869dfbb..71fd745 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/loaders/PreAkiModLoader.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/loaders/PreAkiModLoader.d.ts @@ -29,7 +29,7 @@ export declare class PreAkiModLoader implements IModLoader { protected imported: Record; protected akiConfig: ICoreConfig; protected serverDependencies: Record; - protected skippedMods: string[]; + protected skippedMods: Set; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, bundleLoader: BundleLoader, localisationService: LocalisationService, configServer: ConfigServer, modLoadOrder: ModLoadOrder, modTypeCheck: ModTypeCheck); load(container: DependencyContainer): Promise; /** @@ -44,27 +44,22 @@ export declare class PreAkiModLoader implements IModLoader { 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 + * @param modPackageData map of mod package.json data */ - protected checkForDuplicateMods(modPackageData: Record): void; + protected checkForDuplicateMods(modPackageData: Map): void; /** - * Check for and return duplicate strings inside an array - * @param stringArray Array to check for duplicates - * @returns string array of duplicates, empty if none found - */ - protected getDuplicates(stringArray: string[]): string[]; - /** - * Get an array of mods with errors that prevent them from working with SPT + * Returns an array of valid mods. + * * @param mods mods to validate - * @returns Mod names as array + * @returns array of mod folder names */ - protected getBrokenMods(mods: string[]): string[]; + protected getValidMods(mods: string[]): string[]; /** * Get packageJson data for mods * @param mods mods to get packageJson for - * @returns dictionary + * @returns map */ - protected getModsPackageData(mods: string[]): Record; + protected getModsPackageData(mods: string[]): Map; /** * Is the passed in mod compatible with the running server version * @param mod Mod to check compatibiltiy with AKI @@ -86,10 +81,17 @@ export declare class PreAkiModLoader implements IModLoader { * Compile mod and add into class property "imported" * @param mod Name of mod to compile/add */ - protected addModAsync(mod: string): Promise; + protected addModAsync(mod: string, pkg: IPackageJsonData): Promise; + /** + * Checks if a given mod should be loaded or skipped. + * + * @param pkg mod package.json data + * @returns + */ + protected shouldSkipMod(pkg: IPackageJsonData): boolean; protected autoInstallDependencies(modPath: string, pkg: IPackageJsonData): void; - protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Record): boolean; - protected isModCompatible(mod: IPackageJsonData, loadedMods: Record): boolean; + protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Map): boolean; + protected isModCompatible(mod: IPackageJsonData, loadedMods: Map): boolean; /** * Validate a mod passes a number of checks * @param modName name of mod in /mods/ to validate diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/SkillTypes.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/SkillTypes.d.ts index 4eb90af..dc059a8 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/SkillTypes.d.ts @@ -1,4 +1,6 @@ export declare enum SkillTypes { + BOT_RELOAD = "BotReload", + BOT_SOUND = "BotSound", HIDEOUT_MANAGEMENT = "HideoutManagement", CRAFTING = "Crafting", METABOLISM = "Metabolism", @@ -19,6 +21,7 @@ export declare enum SkillTypes { ATTENTION = "Attention", CHARISMA = "Charisma", MEMORY = "Memory", + MELEE = "Melee", SURGERY = "Surgery", AIM_DRILLS = "AimDrills", TROUBLESHOOTING = "TroubleShooting", @@ -31,6 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", + /** Also called Weapon Maintenance*/ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IBotConfig.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IBotConfig.d.ts index c76eda7..24c8c19 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IBotConfig.d.ts @@ -102,6 +102,8 @@ export interface EquipmentFilters { weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; /** Same as weightingAdjustments but based on player level instead of bot level */ weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; + /** Should the stock mod be forced to spawn on bot */ + forceStock: boolean; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IQuestConfig.d.ts index 3e3b2be..8a71eb9 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IQuestConfig.d.ts @@ -55,6 +55,8 @@ export interface IRewardScaling { items: number[]; reputation: number[]; rewardSpread: number; + skillRewardChance: number[]; + skillPointReward: number[]; } export interface ITraderWhitelist { traderId: string; @@ -66,7 +68,7 @@ export interface IRepeatableQuestTypesConfig { Pickup: IPickup; Elimination: IEliminationConfig[]; } -export interface IExploration { +export interface IExploration extends IBaseQuestConfig { maxExtracts: number; specificExits: ISpecificExits; } @@ -74,7 +76,7 @@ export interface ISpecificExits { probability: number; passageRequirementWhitelist: string[]; } -export interface ICompletion { +export interface ICompletion extends IBaseQuestConfig { minRequestedAmount: number; maxRequestedAmount: number; minRequestedBulletAmount: number; @@ -82,7 +84,7 @@ export interface ICompletion { useWhitelist: boolean; useBlacklist: boolean; } -export interface IPickup { +export interface IPickup extends IBaseQuestConfig { ItemTypeToFetchWithMaxCount: IPickupTypeWithMaxCount[]; } export interface IPickupTypeWithMaxCount { @@ -90,7 +92,7 @@ export interface IPickupTypeWithMaxCount { maxPickupCount: number; minPickupCount: number; } -export interface IEliminationConfig { +export interface IEliminationConfig extends IBaseQuestConfig { levelRange: MinMax; targets: ITarget[]; bodyPartProb: number; @@ -111,6 +113,9 @@ export interface IEliminationConfig { weaponRequirementProb: number; weaponRequirements: IWeaponRequirement[]; } +export interface IBaseQuestConfig { + possibleSkillRewards: string[]; +} export interface ITarget extends IProbabilityObject { data: IBossInfo; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IRepairConfig.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IRepairConfig.d.ts index 1ae082d..9e23cc4 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IRepairConfig.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IRepairConfig.d.ts @@ -9,6 +9,7 @@ export interface IRepairConfig extends IBaseConfig { /** INT gain multiplier per repaired item type */ repairKitIntellectGainMultiplier: IIntellectGainValues; maxIntellectGainPerRepair: IMaxIntellectGainValues; + weaponTreatment: IWeaponTreatmentRepairValues; repairKit: RepairKit; } export interface IIntellectGainValues { @@ -19,6 +20,16 @@ export interface IMaxIntellectGainValues { kit: number; trader: number; } +export interface IWeaponTreatmentRepairValues { + /** The chance to gain more weapon maintenance skill */ + critSuccessChance: number; + critSuccessAmount: number; + /** The chance to gain less weapon maintenance skill */ + critFailureChance: number; + critFailureAmount: number; + /** The multiplier used for calculating weapon maintenance XP */ + pointGainMultiplier: number; +} export interface RepairKit { armor: BonusSettings; weapon: BonusSettings; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/PlayerService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/PlayerService.d.ts index edf269e..f24e0dc 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/PlayerService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/PlayerService.d.ts @@ -9,15 +9,6 @@ export declare class PlayerService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, databaseServer: DatabaseServer); - /** - * Dupe of QuestHelper.rewardsSkillPoints() - * Add xp to a player skill - * @param pmcData Player profile - * @param skillName Name of skill to increment - * @param amount Amount of skill points to add to skill - * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code - */ - incrementSkillLevel(pmcData: IPmcData, skillName: string, amount: number, useSkillProgressRateMultipler?: boolean): void; /** * Get level of player * @param pmcData Player profile diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RepairService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RepairService.d.ts index b8ffbaa..8f9e7e9 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RepairService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RepairService.d.ts @@ -1,5 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { QuestHelper } from "@spt-aki/helpers/QuestHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { RepairHelper } from "@spt-aki/helpers/RepairHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; @@ -9,6 +9,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { RepairKitsInfo } from "@spt-aki/models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "@spt-aki/models/eft/repair/ITraderRepairActionDataRequest"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { BonusSettings, IRepairConfig } from "@spt-aki/models/spt/config/IRepairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -19,7 +20,7 @@ import { RandomUtil } from "@spt-aki/utils/RandomUtil"; export declare class RepairService { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected questHelper: QuestHelper; + protected profileHelper: ProfileHelper; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; @@ -29,7 +30,7 @@ export declare class RepairService { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id @@ -56,6 +57,12 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + /** + * Return an appromixation of the amount of skill points live would return for the given repairDetails + * @param repairDetails the repair details to calculate skill points for + * @returns the number of skill points to reward the user + */ + protected getWeaponRepairSkillPoints(repairDetails: RepairDetails): number; /** * * @param sessionId Session id @@ -81,6 +88,13 @@ export declare class RepairService { * @returns Multiplier value */ protected getBonusMultiplierValue(skillBonusName: string, pmcData: IPmcData): number; + /** + * Should a repair kit apply total durability loss on repair + * @param pmcData Player profile + * @param applyRandomizeDurabilityLoss Value from repair config + * @returns True if loss should be applied + */ + protected shouldRepairKitApplyDurabilityLoss(pmcData: IPmcData, applyRandomizeDurabilityLoss: boolean): boolean; /** * Update repair kits Resource object if it doesn't exist * @param repairKitDetails Repair kit details from db @@ -112,7 +126,7 @@ export declare class RepairService { * @param itemTemplate Item to check for skill * @returns Skill name */ - protected getItemSkillType(itemTemplate: ITemplateItem): string; + protected getItemSkillType(itemTemplate: ITemplateItem): SkillTypes; /** * Ensure multiplier is between 1 and 0.01 * @param receiveDurabilityMaxPercent Max durabiltiy percent @@ -123,6 +137,7 @@ export declare class RepairService { } export declare class RepairDetails { repairCost?: number; + repairPoints?: number; repairedItem: Item; repairedItemIsArmor: boolean; repairAmount: number; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/App.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/App.d.ts index 1839695..64800ce 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/App.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/App.d.ts @@ -1,6 +1,8 @@ import { OnLoad } from "@spt-aki/di/OnLoad"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -8,11 +10,13 @@ export declare class App { protected logger: ILogger; protected timeUtil: TimeUtil; protected localisationService: LocalisationService; + protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/GameController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/GameController.d.ts index 640a8c1..168071d 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/GameController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/GameController.d.ts @@ -61,6 +61,10 @@ export declare class GameController { * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + /** + * Out of date/incorrectly made trader mods forget this data + */ + protected checkTraderRepairValuesExist(): void; protected addCustomLooseLootPositions(): void; protected adjustLooseLootSpawnProbabilities(): void; protected setHideoutAreasAndCraftsTo40Secs(): void; diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/InsuranceController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/InsuranceController.d.ts index b1e8fe6..0ee30ed 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/InsuranceController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/InsuranceController.d.ts @@ -8,7 +8,7 @@ import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGet import { IGetInsuranceCostResponseData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostResponseData"; import { IInsureRequestData } from "@spt-aki/models/eft/insurance/IInsureRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; -import { Insurance, ISystemData } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ISystemData, Insurance } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IInsuranceConfig } from "@spt-aki/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/RepeatableQuestController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/RepeatableQuestController.d.ts index b09b540..a3ebc1c 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/RepeatableQuestController.d.ts @@ -13,6 +13,7 @@ import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -21,8 +22,9 @@ import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RepeatableQuestController { - protected timeUtil: TimeUtil; protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; @@ -37,7 +39,7 @@ export declare class RepeatableQuestController { protected questHelper: QuestHelper; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. @@ -64,6 +66,13 @@ export declare class RepeatableQuestController { * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Get the number of quests to generate - takes into account charisma state of player + * @param repeatableConfig Config + * @param pmcData Player profile + * @returns Quest count + */ + protected getQuestCount(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): number; /** * Get repeatable quest data from profile from name (daily/weekly), creates base repeatable quest object if none exists * @param repeatableConfig daily/weekly config diff --git a/TypeScript/4UseACustomConfigFile/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/BotEquipmentModGenerator.d.ts index 05266dd..75530c7 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/BotEquipmentModGenerator.d.ts @@ -179,7 +179,7 @@ export declare class BotEquipmentModGenerator { * Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots. * This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine" * @param items The items where the CylinderMagazine's camora are appended to - * @param modPool modPool which should include available cartrigdes + * @param modPool modPool which should include available cartridges * @param parentId The CylinderMagazine's UID * @param parentTemplate The CylinderMagazine's template */ diff --git a/TypeScript/4UseACustomConfigFile/types/generators/BotLootGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/BotLootGenerator.d.ts index e937a4d..7a4c521 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/BotLootGenerator.d.ts @@ -83,7 +83,7 @@ export declare class BotLootGenerator { * @param equipmentSlot slot to place the preset in (backpack) * @param templateInventory bots template, assault.json * @param modChances chances for mods to spawn on weapon - * @param botRole bots role, .e.g. pmcBot + * @param botRole bots role .e.g. pmcBot * @param isPmc are we generating for a pmc */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; @@ -120,16 +120,16 @@ export declare class BotLootGenerator { protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; /** * Randomise the stack size of a money object, uses different values for pmc or scavs - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param moneyItem Money stack to randomise + * @param isPmc Is money on a PMC bot + * @param itemTemplate item details from db + * @param moneyItem Money item to randomise */ protected randomiseMoneyStackSize(isPmc: boolean, itemTemplate: ITemplateItem, moneyItem: Item): void; /** * Randomise the size of an ammo stack - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param ammoItem Ammo stack to randomise + * @param isPmc Is ammo on a PMC bot + * @param itemTemplate item details from db + * @param ammoItem Ammo item to randomise */ protected randomiseAmmoStackSize(isPmc: boolean, itemTemplate: ITemplateItem, ammoItem: Item): void; /** diff --git a/TypeScript/4UseACustomConfigFile/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/RepeatableQuestGenerator.d.ts index 40a3c16..44c38be 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/RepeatableQuestGenerator.d.ts @@ -8,7 +8,7 @@ import { Exit } from "@spt-aki/models/eft/common/ILocationBase"; import { TraderInfo } from "@spt-aki/models/eft/common/tables/IBotBase"; import { ICompletion, ICompletionAvailableFor, IElimination, IEliminationCondition, IExploration, IExplorationCondition, IPickup, IRepeatableQuest, IReward, IRewards } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; -import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; @@ -155,7 +155,7 @@ export declare class RepeatableQuestGenerator { * @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ - protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig): IRewards; + protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IRewards; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/HideoutHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/HideoutHelper.d.ts index 93f8fb1..0cfc649 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/HideoutHelper.d.ts @@ -1,7 +1,7 @@ import { InventoryHelper } from "@spt-aki/helpers/InventoryHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { Common, HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "@spt-aki/models/eft/hideout/IHideoutContinuousProductionStartRequestData"; @@ -201,22 +201,10 @@ export declare class HideoutHelper { * @returns coin slot count */ protected getBTCSlots(pmcData: IPmcData): number; - /** - * Does profile have elite hideout management skill - * @param pmcData Profile to look at - * @returns True if profile has skill - */ - protected hasEliteHideoutManagementSkill(pmcData: IPmcData): boolean; /** * Get a count of bitcoins player miner can hold */ protected getBitcoinMinerContainerSlotSize(): number; - /** - * Get the hideout management skill from player profile - * @param pmcData Profile to look at - * @returns Hideout management skill object - */ - protected getHideoutManagementSkill(pmcData: IPmcData): Common; /** * HideoutManagement skill gives a consumption bonus the higher the level * 0.5% per level per 1-51, (25.5% at max) diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/ItemHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/ItemHelper.d.ts index 47823bc..e1c7720 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/ItemHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/ItemHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -24,10 +25,11 @@ declare class ItemHelper { protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; + protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/ProfileHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/ProfileHelper.d.ts index 781f980..938c796 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/ProfileHelper.d.ts @@ -1,11 +1,13 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IValidateNicknameRequestData } from "@spt-aki/models/eft/profile/IValidateNicknameRequestData"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; +import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileSnapshotService } from "@spt-aki/services/ProfileSnapshotService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -19,7 +21,8 @@ export declare class ProfileHelper { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected profileSnapshotService: ProfileSnapshotService; - constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); + protected localisationService: LocalisationService; + constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, localisationService: LocalisationService); /** * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id @@ -101,4 +104,21 @@ export declare class ProfileHelper { * @param keyToIncrement Key */ incrementStatCounter(counters: CounterKeyValue[], keyToIncrement: string): void; + /** + * Check if player has a skill at elite level + * @param skillType Skill to check + * @param pmcProfile Profile to find skill in + * @returns True if player has skill at elite level + */ + hasEliteSkillLevel(skillType: SkillTypes, pmcProfile: IPmcData): boolean; + /** + * Add points to a specific skill in player profile + * @param skill Skill to add points to + * @param pointsToAdd Points to add + * @param pmcProfile Player profile with skill + * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code + * @returns + */ + addSkillPointsToPlayer(pmcProfile: IPmcData, skill: SkillTypes, pointsToAdd: number, useSkillProgressRateMultipler?: boolean): void; + getSkillFromProfile(pmcData: IPmcData, skill: SkillTypes): Common; } diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/QuestHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/QuestHelper.d.ts index 1e40e53..0dda05b 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/QuestHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/QuestHelper.d.ts @@ -6,7 +6,7 @@ import { QuestConditionHelper } from "@spt-aki/helpers/QuestConditionHelper"; import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "@spt-aki/models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; @@ -66,14 +66,12 @@ export declare class QuestHelper { */ getDeltaQuests(before: IQuest[], after: IQuest[]): IQuest[]; /** - * Increase skill points of a skill on player profile - * Dupe of PlayerService.incrementSkillLevel() - * @param sessionID Session id - * @param pmcData Player profile - * @param skillName Name of skill to increase skill points of - * @param progressAmount Amount of skill points to add to skill + * Adjust skill experience for low skill levels, mimicing the official client + * @param profileSkill the skill experience is being added to + * @param progressAmount the amount of experience being added to the skill + * @returns the adjusted skill progress gain */ - rewardSkillPoints(sessionID: string, pmcData: IPmcData, skillName: string, progressAmount: number): void; + adjustSkillExpForLowLevels(profileSkill: Common, progressAmount: number): number; /** * Get quest name by quest id * @param questId id to get diff --git a/TypeScript/4UseACustomConfigFile/types/loaders/PreAkiModLoader.d.ts b/TypeScript/4UseACustomConfigFile/types/loaders/PreAkiModLoader.d.ts index 869dfbb..71fd745 100644 --- a/TypeScript/4UseACustomConfigFile/types/loaders/PreAkiModLoader.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/loaders/PreAkiModLoader.d.ts @@ -29,7 +29,7 @@ export declare class PreAkiModLoader implements IModLoader { protected imported: Record; protected akiConfig: ICoreConfig; protected serverDependencies: Record; - protected skippedMods: string[]; + protected skippedMods: Set; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, bundleLoader: BundleLoader, localisationService: LocalisationService, configServer: ConfigServer, modLoadOrder: ModLoadOrder, modTypeCheck: ModTypeCheck); load(container: DependencyContainer): Promise; /** @@ -44,27 +44,22 @@ export declare class PreAkiModLoader implements IModLoader { 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 + * @param modPackageData map of mod package.json data */ - protected checkForDuplicateMods(modPackageData: Record): void; + protected checkForDuplicateMods(modPackageData: Map): void; /** - * Check for and return duplicate strings inside an array - * @param stringArray Array to check for duplicates - * @returns string array of duplicates, empty if none found - */ - protected getDuplicates(stringArray: string[]): string[]; - /** - * Get an array of mods with errors that prevent them from working with SPT + * Returns an array of valid mods. + * * @param mods mods to validate - * @returns Mod names as array + * @returns array of mod folder names */ - protected getBrokenMods(mods: string[]): string[]; + protected getValidMods(mods: string[]): string[]; /** * Get packageJson data for mods * @param mods mods to get packageJson for - * @returns dictionary + * @returns map */ - protected getModsPackageData(mods: string[]): Record; + protected getModsPackageData(mods: string[]): Map; /** * Is the passed in mod compatible with the running server version * @param mod Mod to check compatibiltiy with AKI @@ -86,10 +81,17 @@ export declare class PreAkiModLoader implements IModLoader { * Compile mod and add into class property "imported" * @param mod Name of mod to compile/add */ - protected addModAsync(mod: string): Promise; + protected addModAsync(mod: string, pkg: IPackageJsonData): Promise; + /** + * Checks if a given mod should be loaded or skipped. + * + * @param pkg mod package.json data + * @returns + */ + protected shouldSkipMod(pkg: IPackageJsonData): boolean; protected autoInstallDependencies(modPath: string, pkg: IPackageJsonData): void; - protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Record): boolean; - protected isModCompatible(mod: IPackageJsonData, loadedMods: Record): boolean; + protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Map): boolean; + protected isModCompatible(mod: IPackageJsonData, loadedMods: Map): boolean; /** * Validate a mod passes a number of checks * @param modName name of mod in /mods/ to validate diff --git a/TypeScript/4UseACustomConfigFile/types/models/enums/SkillTypes.d.ts b/TypeScript/4UseACustomConfigFile/types/models/enums/SkillTypes.d.ts index 4eb90af..dc059a8 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/enums/SkillTypes.d.ts @@ -1,4 +1,6 @@ export declare enum SkillTypes { + BOT_RELOAD = "BotReload", + BOT_SOUND = "BotSound", HIDEOUT_MANAGEMENT = "HideoutManagement", CRAFTING = "Crafting", METABOLISM = "Metabolism", @@ -19,6 +21,7 @@ export declare enum SkillTypes { ATTENTION = "Attention", CHARISMA = "Charisma", MEMORY = "Memory", + MELEE = "Melee", SURGERY = "Surgery", AIM_DRILLS = "AimDrills", TROUBLESHOOTING = "TroubleShooting", @@ -31,6 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", + /** Also called Weapon Maintenance*/ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts index c76eda7..24c8c19 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts @@ -102,6 +102,8 @@ export interface EquipmentFilters { weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; /** Same as weightingAdjustments but based on player level instead of bot level */ weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; + /** Should the stock mod be forced to spawn on bot */ + forceStock: boolean; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IQuestConfig.d.ts index 3e3b2be..8a71eb9 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IQuestConfig.d.ts @@ -55,6 +55,8 @@ export interface IRewardScaling { items: number[]; reputation: number[]; rewardSpread: number; + skillRewardChance: number[]; + skillPointReward: number[]; } export interface ITraderWhitelist { traderId: string; @@ -66,7 +68,7 @@ export interface IRepeatableQuestTypesConfig { Pickup: IPickup; Elimination: IEliminationConfig[]; } -export interface IExploration { +export interface IExploration extends IBaseQuestConfig { maxExtracts: number; specificExits: ISpecificExits; } @@ -74,7 +76,7 @@ export interface ISpecificExits { probability: number; passageRequirementWhitelist: string[]; } -export interface ICompletion { +export interface ICompletion extends IBaseQuestConfig { minRequestedAmount: number; maxRequestedAmount: number; minRequestedBulletAmount: number; @@ -82,7 +84,7 @@ export interface ICompletion { useWhitelist: boolean; useBlacklist: boolean; } -export interface IPickup { +export interface IPickup extends IBaseQuestConfig { ItemTypeToFetchWithMaxCount: IPickupTypeWithMaxCount[]; } export interface IPickupTypeWithMaxCount { @@ -90,7 +92,7 @@ export interface IPickupTypeWithMaxCount { maxPickupCount: number; minPickupCount: number; } -export interface IEliminationConfig { +export interface IEliminationConfig extends IBaseQuestConfig { levelRange: MinMax; targets: ITarget[]; bodyPartProb: number; @@ -111,6 +113,9 @@ export interface IEliminationConfig { weaponRequirementProb: number; weaponRequirements: IWeaponRequirement[]; } +export interface IBaseQuestConfig { + possibleSkillRewards: string[]; +} export interface ITarget extends IProbabilityObject { data: IBossInfo; } diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IRepairConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IRepairConfig.d.ts index 1ae082d..9e23cc4 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IRepairConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IRepairConfig.d.ts @@ -9,6 +9,7 @@ export interface IRepairConfig extends IBaseConfig { /** INT gain multiplier per repaired item type */ repairKitIntellectGainMultiplier: IIntellectGainValues; maxIntellectGainPerRepair: IMaxIntellectGainValues; + weaponTreatment: IWeaponTreatmentRepairValues; repairKit: RepairKit; } export interface IIntellectGainValues { @@ -19,6 +20,16 @@ export interface IMaxIntellectGainValues { kit: number; trader: number; } +export interface IWeaponTreatmentRepairValues { + /** The chance to gain more weapon maintenance skill */ + critSuccessChance: number; + critSuccessAmount: number; + /** The chance to gain less weapon maintenance skill */ + critFailureChance: number; + critFailureAmount: number; + /** The multiplier used for calculating weapon maintenance XP */ + pointGainMultiplier: number; +} export interface RepairKit { armor: BonusSettings; weapon: BonusSettings; diff --git a/TypeScript/4UseACustomConfigFile/types/services/PlayerService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/PlayerService.d.ts index edf269e..f24e0dc 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/PlayerService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/PlayerService.d.ts @@ -9,15 +9,6 @@ export declare class PlayerService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, databaseServer: DatabaseServer); - /** - * Dupe of QuestHelper.rewardsSkillPoints() - * Add xp to a player skill - * @param pmcData Player profile - * @param skillName Name of skill to increment - * @param amount Amount of skill points to add to skill - * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code - */ - incrementSkillLevel(pmcData: IPmcData, skillName: string, amount: number, useSkillProgressRateMultipler?: boolean): void; /** * Get level of player * @param pmcData Player profile diff --git a/TypeScript/4UseACustomConfigFile/types/services/RepairService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/RepairService.d.ts index b8ffbaa..8f9e7e9 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/RepairService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/RepairService.d.ts @@ -1,5 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { QuestHelper } from "@spt-aki/helpers/QuestHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { RepairHelper } from "@spt-aki/helpers/RepairHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; @@ -9,6 +9,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { RepairKitsInfo } from "@spt-aki/models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "@spt-aki/models/eft/repair/ITraderRepairActionDataRequest"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { BonusSettings, IRepairConfig } from "@spt-aki/models/spt/config/IRepairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -19,7 +20,7 @@ import { RandomUtil } from "@spt-aki/utils/RandomUtil"; export declare class RepairService { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected questHelper: QuestHelper; + protected profileHelper: ProfileHelper; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; @@ -29,7 +30,7 @@ export declare class RepairService { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id @@ -56,6 +57,12 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + /** + * Return an appromixation of the amount of skill points live would return for the given repairDetails + * @param repairDetails the repair details to calculate skill points for + * @returns the number of skill points to reward the user + */ + protected getWeaponRepairSkillPoints(repairDetails: RepairDetails): number; /** * * @param sessionId Session id @@ -81,6 +88,13 @@ export declare class RepairService { * @returns Multiplier value */ protected getBonusMultiplierValue(skillBonusName: string, pmcData: IPmcData): number; + /** + * Should a repair kit apply total durability loss on repair + * @param pmcData Player profile + * @param applyRandomizeDurabilityLoss Value from repair config + * @returns True if loss should be applied + */ + protected shouldRepairKitApplyDurabilityLoss(pmcData: IPmcData, applyRandomizeDurabilityLoss: boolean): boolean; /** * Update repair kits Resource object if it doesn't exist * @param repairKitDetails Repair kit details from db @@ -112,7 +126,7 @@ export declare class RepairService { * @param itemTemplate Item to check for skill * @returns Skill name */ - protected getItemSkillType(itemTemplate: ITemplateItem): string; + protected getItemSkillType(itemTemplate: ITemplateItem): SkillTypes; /** * Ensure multiplier is between 1 and 0.01 * @param receiveDurabilityMaxPercent Max durabiltiy percent @@ -123,6 +137,7 @@ export declare class RepairService { } export declare class RepairDetails { repairCost?: number; + repairPoints?: number; repairedItem: Item; repairedItemIsArmor: boolean; repairAmount: number; diff --git a/TypeScript/4UseACustomConfigFile/types/utils/App.d.ts b/TypeScript/4UseACustomConfigFile/types/utils/App.d.ts index 1839695..64800ce 100644 --- a/TypeScript/4UseACustomConfigFile/types/utils/App.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/utils/App.d.ts @@ -1,6 +1,8 @@ import { OnLoad } from "@spt-aki/di/OnLoad"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -8,11 +10,13 @@ export declare class App { protected logger: ILogger; protected timeUtil: TimeUtil; protected localisationService: LocalisationService; + protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/5ReplaceMethod/types/controllers/GameController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/GameController.d.ts index 640a8c1..168071d 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/GameController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/GameController.d.ts @@ -61,6 +61,10 @@ export declare class GameController { * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + /** + * Out of date/incorrectly made trader mods forget this data + */ + protected checkTraderRepairValuesExist(): void; protected addCustomLooseLootPositions(): void; protected adjustLooseLootSpawnProbabilities(): void; protected setHideoutAreasAndCraftsTo40Secs(): void; diff --git a/TypeScript/5ReplaceMethod/types/controllers/InsuranceController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/InsuranceController.d.ts index b1e8fe6..0ee30ed 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/InsuranceController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/InsuranceController.d.ts @@ -8,7 +8,7 @@ import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGet import { IGetInsuranceCostResponseData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostResponseData"; import { IInsureRequestData } from "@spt-aki/models/eft/insurance/IInsureRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; -import { Insurance, ISystemData } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ISystemData, Insurance } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IInsuranceConfig } from "@spt-aki/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; diff --git a/TypeScript/5ReplaceMethod/types/controllers/RepeatableQuestController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/RepeatableQuestController.d.ts index b09b540..a3ebc1c 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/RepeatableQuestController.d.ts @@ -13,6 +13,7 @@ import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -21,8 +22,9 @@ import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RepeatableQuestController { - protected timeUtil: TimeUtil; protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; @@ -37,7 +39,7 @@ export declare class RepeatableQuestController { protected questHelper: QuestHelper; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. @@ -64,6 +66,13 @@ export declare class RepeatableQuestController { * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Get the number of quests to generate - takes into account charisma state of player + * @param repeatableConfig Config + * @param pmcData Player profile + * @returns Quest count + */ + protected getQuestCount(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): number; /** * Get repeatable quest data from profile from name (daily/weekly), creates base repeatable quest object if none exists * @param repeatableConfig daily/weekly config diff --git a/TypeScript/5ReplaceMethod/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/BotEquipmentModGenerator.d.ts index 05266dd..75530c7 100644 --- a/TypeScript/5ReplaceMethod/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/BotEquipmentModGenerator.d.ts @@ -179,7 +179,7 @@ export declare class BotEquipmentModGenerator { * Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots. * This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine" * @param items The items where the CylinderMagazine's camora are appended to - * @param modPool modPool which should include available cartrigdes + * @param modPool modPool which should include available cartridges * @param parentId The CylinderMagazine's UID * @param parentTemplate The CylinderMagazine's template */ diff --git a/TypeScript/5ReplaceMethod/types/generators/BotLootGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/BotLootGenerator.d.ts index e937a4d..7a4c521 100644 --- a/TypeScript/5ReplaceMethod/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/BotLootGenerator.d.ts @@ -83,7 +83,7 @@ export declare class BotLootGenerator { * @param equipmentSlot slot to place the preset in (backpack) * @param templateInventory bots template, assault.json * @param modChances chances for mods to spawn on weapon - * @param botRole bots role, .e.g. pmcBot + * @param botRole bots role .e.g. pmcBot * @param isPmc are we generating for a pmc */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; @@ -120,16 +120,16 @@ export declare class BotLootGenerator { protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; /** * Randomise the stack size of a money object, uses different values for pmc or scavs - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param moneyItem Money stack to randomise + * @param isPmc Is money on a PMC bot + * @param itemTemplate item details from db + * @param moneyItem Money item to randomise */ protected randomiseMoneyStackSize(isPmc: boolean, itemTemplate: ITemplateItem, moneyItem: Item): void; /** * Randomise the size of an ammo stack - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param ammoItem Ammo stack to randomise + * @param isPmc Is ammo on a PMC bot + * @param itemTemplate item details from db + * @param ammoItem Ammo item to randomise */ protected randomiseAmmoStackSize(isPmc: boolean, itemTemplate: ITemplateItem, ammoItem: Item): void; /** diff --git a/TypeScript/5ReplaceMethod/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/RepeatableQuestGenerator.d.ts index 40a3c16..44c38be 100644 --- a/TypeScript/5ReplaceMethod/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/RepeatableQuestGenerator.d.ts @@ -8,7 +8,7 @@ import { Exit } from "@spt-aki/models/eft/common/ILocationBase"; import { TraderInfo } from "@spt-aki/models/eft/common/tables/IBotBase"; import { ICompletion, ICompletionAvailableFor, IElimination, IEliminationCondition, IExploration, IExplorationCondition, IPickup, IRepeatableQuest, IReward, IRewards } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; -import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; @@ -155,7 +155,7 @@ export declare class RepeatableQuestGenerator { * @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ - protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig): IRewards; + protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IRewards; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config diff --git a/TypeScript/5ReplaceMethod/types/helpers/HideoutHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/HideoutHelper.d.ts index 93f8fb1..0cfc649 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/HideoutHelper.d.ts @@ -1,7 +1,7 @@ import { InventoryHelper } from "@spt-aki/helpers/InventoryHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { Common, HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "@spt-aki/models/eft/hideout/IHideoutContinuousProductionStartRequestData"; @@ -201,22 +201,10 @@ export declare class HideoutHelper { * @returns coin slot count */ protected getBTCSlots(pmcData: IPmcData): number; - /** - * Does profile have elite hideout management skill - * @param pmcData Profile to look at - * @returns True if profile has skill - */ - protected hasEliteHideoutManagementSkill(pmcData: IPmcData): boolean; /** * Get a count of bitcoins player miner can hold */ protected getBitcoinMinerContainerSlotSize(): number; - /** - * Get the hideout management skill from player profile - * @param pmcData Profile to look at - * @returns Hideout management skill object - */ - protected getHideoutManagementSkill(pmcData: IPmcData): Common; /** * HideoutManagement skill gives a consumption bonus the higher the level * 0.5% per level per 1-51, (25.5% at max) diff --git a/TypeScript/5ReplaceMethod/types/helpers/ItemHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/ItemHelper.d.ts index 47823bc..e1c7720 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/ItemHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/ItemHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -24,10 +25,11 @@ declare class ItemHelper { protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; + protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl diff --git a/TypeScript/5ReplaceMethod/types/helpers/ProfileHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/ProfileHelper.d.ts index 781f980..938c796 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/ProfileHelper.d.ts @@ -1,11 +1,13 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IValidateNicknameRequestData } from "@spt-aki/models/eft/profile/IValidateNicknameRequestData"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; +import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileSnapshotService } from "@spt-aki/services/ProfileSnapshotService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -19,7 +21,8 @@ export declare class ProfileHelper { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected profileSnapshotService: ProfileSnapshotService; - constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); + protected localisationService: LocalisationService; + constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, localisationService: LocalisationService); /** * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id @@ -101,4 +104,21 @@ export declare class ProfileHelper { * @param keyToIncrement Key */ incrementStatCounter(counters: CounterKeyValue[], keyToIncrement: string): void; + /** + * Check if player has a skill at elite level + * @param skillType Skill to check + * @param pmcProfile Profile to find skill in + * @returns True if player has skill at elite level + */ + hasEliteSkillLevel(skillType: SkillTypes, pmcProfile: IPmcData): boolean; + /** + * Add points to a specific skill in player profile + * @param skill Skill to add points to + * @param pointsToAdd Points to add + * @param pmcProfile Player profile with skill + * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code + * @returns + */ + addSkillPointsToPlayer(pmcProfile: IPmcData, skill: SkillTypes, pointsToAdd: number, useSkillProgressRateMultipler?: boolean): void; + getSkillFromProfile(pmcData: IPmcData, skill: SkillTypes): Common; } diff --git a/TypeScript/5ReplaceMethod/types/helpers/QuestHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/QuestHelper.d.ts index 1e40e53..0dda05b 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/QuestHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/QuestHelper.d.ts @@ -6,7 +6,7 @@ import { QuestConditionHelper } from "@spt-aki/helpers/QuestConditionHelper"; import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "@spt-aki/models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; @@ -66,14 +66,12 @@ export declare class QuestHelper { */ getDeltaQuests(before: IQuest[], after: IQuest[]): IQuest[]; /** - * Increase skill points of a skill on player profile - * Dupe of PlayerService.incrementSkillLevel() - * @param sessionID Session id - * @param pmcData Player profile - * @param skillName Name of skill to increase skill points of - * @param progressAmount Amount of skill points to add to skill + * Adjust skill experience for low skill levels, mimicing the official client + * @param profileSkill the skill experience is being added to + * @param progressAmount the amount of experience being added to the skill + * @returns the adjusted skill progress gain */ - rewardSkillPoints(sessionID: string, pmcData: IPmcData, skillName: string, progressAmount: number): void; + adjustSkillExpForLowLevels(profileSkill: Common, progressAmount: number): number; /** * Get quest name by quest id * @param questId id to get diff --git a/TypeScript/5ReplaceMethod/types/loaders/PreAkiModLoader.d.ts b/TypeScript/5ReplaceMethod/types/loaders/PreAkiModLoader.d.ts index 869dfbb..71fd745 100644 --- a/TypeScript/5ReplaceMethod/types/loaders/PreAkiModLoader.d.ts +++ b/TypeScript/5ReplaceMethod/types/loaders/PreAkiModLoader.d.ts @@ -29,7 +29,7 @@ export declare class PreAkiModLoader implements IModLoader { protected imported: Record; protected akiConfig: ICoreConfig; protected serverDependencies: Record; - protected skippedMods: string[]; + protected skippedMods: Set; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, bundleLoader: BundleLoader, localisationService: LocalisationService, configServer: ConfigServer, modLoadOrder: ModLoadOrder, modTypeCheck: ModTypeCheck); load(container: DependencyContainer): Promise; /** @@ -44,27 +44,22 @@ export declare class PreAkiModLoader implements IModLoader { 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 + * @param modPackageData map of mod package.json data */ - protected checkForDuplicateMods(modPackageData: Record): void; + protected checkForDuplicateMods(modPackageData: Map): void; /** - * Check for and return duplicate strings inside an array - * @param stringArray Array to check for duplicates - * @returns string array of duplicates, empty if none found - */ - protected getDuplicates(stringArray: string[]): string[]; - /** - * Get an array of mods with errors that prevent them from working with SPT + * Returns an array of valid mods. + * * @param mods mods to validate - * @returns Mod names as array + * @returns array of mod folder names */ - protected getBrokenMods(mods: string[]): string[]; + protected getValidMods(mods: string[]): string[]; /** * Get packageJson data for mods * @param mods mods to get packageJson for - * @returns dictionary + * @returns map */ - protected getModsPackageData(mods: string[]): Record; + protected getModsPackageData(mods: string[]): Map; /** * Is the passed in mod compatible with the running server version * @param mod Mod to check compatibiltiy with AKI @@ -86,10 +81,17 @@ export declare class PreAkiModLoader implements IModLoader { * Compile mod and add into class property "imported" * @param mod Name of mod to compile/add */ - protected addModAsync(mod: string): Promise; + protected addModAsync(mod: string, pkg: IPackageJsonData): Promise; + /** + * Checks if a given mod should be loaded or skipped. + * + * @param pkg mod package.json data + * @returns + */ + protected shouldSkipMod(pkg: IPackageJsonData): boolean; protected autoInstallDependencies(modPath: string, pkg: IPackageJsonData): void; - protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Record): boolean; - protected isModCompatible(mod: IPackageJsonData, loadedMods: Record): boolean; + protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Map): boolean; + protected isModCompatible(mod: IPackageJsonData, loadedMods: Map): boolean; /** * Validate a mod passes a number of checks * @param modName name of mod in /mods/ to validate diff --git a/TypeScript/5ReplaceMethod/types/models/enums/SkillTypes.d.ts b/TypeScript/5ReplaceMethod/types/models/enums/SkillTypes.d.ts index 4eb90af..dc059a8 100644 --- a/TypeScript/5ReplaceMethod/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/enums/SkillTypes.d.ts @@ -1,4 +1,6 @@ export declare enum SkillTypes { + BOT_RELOAD = "BotReload", + BOT_SOUND = "BotSound", HIDEOUT_MANAGEMENT = "HideoutManagement", CRAFTING = "Crafting", METABOLISM = "Metabolism", @@ -19,6 +21,7 @@ export declare enum SkillTypes { ATTENTION = "Attention", CHARISMA = "Charisma", MEMORY = "Memory", + MELEE = "Melee", SURGERY = "Surgery", AIM_DRILLS = "AimDrills", TROUBLESHOOTING = "TroubleShooting", @@ -31,6 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", + /** Also called Weapon Maintenance*/ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts index c76eda7..24c8c19 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts @@ -102,6 +102,8 @@ export interface EquipmentFilters { weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; /** Same as weightingAdjustments but based on player level instead of bot level */ weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; + /** Should the stock mod be forced to spawn on bot */ + forceStock: boolean; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/IQuestConfig.d.ts index 3e3b2be..8a71eb9 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/IQuestConfig.d.ts @@ -55,6 +55,8 @@ export interface IRewardScaling { items: number[]; reputation: number[]; rewardSpread: number; + skillRewardChance: number[]; + skillPointReward: number[]; } export interface ITraderWhitelist { traderId: string; @@ -66,7 +68,7 @@ export interface IRepeatableQuestTypesConfig { Pickup: IPickup; Elimination: IEliminationConfig[]; } -export interface IExploration { +export interface IExploration extends IBaseQuestConfig { maxExtracts: number; specificExits: ISpecificExits; } @@ -74,7 +76,7 @@ export interface ISpecificExits { probability: number; passageRequirementWhitelist: string[]; } -export interface ICompletion { +export interface ICompletion extends IBaseQuestConfig { minRequestedAmount: number; maxRequestedAmount: number; minRequestedBulletAmount: number; @@ -82,7 +84,7 @@ export interface ICompletion { useWhitelist: boolean; useBlacklist: boolean; } -export interface IPickup { +export interface IPickup extends IBaseQuestConfig { ItemTypeToFetchWithMaxCount: IPickupTypeWithMaxCount[]; } export interface IPickupTypeWithMaxCount { @@ -90,7 +92,7 @@ export interface IPickupTypeWithMaxCount { maxPickupCount: number; minPickupCount: number; } -export interface IEliminationConfig { +export interface IEliminationConfig extends IBaseQuestConfig { levelRange: MinMax; targets: ITarget[]; bodyPartProb: number; @@ -111,6 +113,9 @@ export interface IEliminationConfig { weaponRequirementProb: number; weaponRequirements: IWeaponRequirement[]; } +export interface IBaseQuestConfig { + possibleSkillRewards: string[]; +} export interface ITarget extends IProbabilityObject { data: IBossInfo; } diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/IRepairConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/IRepairConfig.d.ts index 1ae082d..9e23cc4 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/IRepairConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/IRepairConfig.d.ts @@ -9,6 +9,7 @@ export interface IRepairConfig extends IBaseConfig { /** INT gain multiplier per repaired item type */ repairKitIntellectGainMultiplier: IIntellectGainValues; maxIntellectGainPerRepair: IMaxIntellectGainValues; + weaponTreatment: IWeaponTreatmentRepairValues; repairKit: RepairKit; } export interface IIntellectGainValues { @@ -19,6 +20,16 @@ export interface IMaxIntellectGainValues { kit: number; trader: number; } +export interface IWeaponTreatmentRepairValues { + /** The chance to gain more weapon maintenance skill */ + critSuccessChance: number; + critSuccessAmount: number; + /** The chance to gain less weapon maintenance skill */ + critFailureChance: number; + critFailureAmount: number; + /** The multiplier used for calculating weapon maintenance XP */ + pointGainMultiplier: number; +} export interface RepairKit { armor: BonusSettings; weapon: BonusSettings; diff --git a/TypeScript/5ReplaceMethod/types/services/PlayerService.d.ts b/TypeScript/5ReplaceMethod/types/services/PlayerService.d.ts index edf269e..f24e0dc 100644 --- a/TypeScript/5ReplaceMethod/types/services/PlayerService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/PlayerService.d.ts @@ -9,15 +9,6 @@ export declare class PlayerService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, databaseServer: DatabaseServer); - /** - * Dupe of QuestHelper.rewardsSkillPoints() - * Add xp to a player skill - * @param pmcData Player profile - * @param skillName Name of skill to increment - * @param amount Amount of skill points to add to skill - * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code - */ - incrementSkillLevel(pmcData: IPmcData, skillName: string, amount: number, useSkillProgressRateMultipler?: boolean): void; /** * Get level of player * @param pmcData Player profile diff --git a/TypeScript/5ReplaceMethod/types/services/RepairService.d.ts b/TypeScript/5ReplaceMethod/types/services/RepairService.d.ts index b8ffbaa..8f9e7e9 100644 --- a/TypeScript/5ReplaceMethod/types/services/RepairService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/RepairService.d.ts @@ -1,5 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { QuestHelper } from "@spt-aki/helpers/QuestHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { RepairHelper } from "@spt-aki/helpers/RepairHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; @@ -9,6 +9,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { RepairKitsInfo } from "@spt-aki/models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "@spt-aki/models/eft/repair/ITraderRepairActionDataRequest"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { BonusSettings, IRepairConfig } from "@spt-aki/models/spt/config/IRepairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -19,7 +20,7 @@ import { RandomUtil } from "@spt-aki/utils/RandomUtil"; export declare class RepairService { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected questHelper: QuestHelper; + protected profileHelper: ProfileHelper; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; @@ -29,7 +30,7 @@ export declare class RepairService { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id @@ -56,6 +57,12 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + /** + * Return an appromixation of the amount of skill points live would return for the given repairDetails + * @param repairDetails the repair details to calculate skill points for + * @returns the number of skill points to reward the user + */ + protected getWeaponRepairSkillPoints(repairDetails: RepairDetails): number; /** * * @param sessionId Session id @@ -81,6 +88,13 @@ export declare class RepairService { * @returns Multiplier value */ protected getBonusMultiplierValue(skillBonusName: string, pmcData: IPmcData): number; + /** + * Should a repair kit apply total durability loss on repair + * @param pmcData Player profile + * @param applyRandomizeDurabilityLoss Value from repair config + * @returns True if loss should be applied + */ + protected shouldRepairKitApplyDurabilityLoss(pmcData: IPmcData, applyRandomizeDurabilityLoss: boolean): boolean; /** * Update repair kits Resource object if it doesn't exist * @param repairKitDetails Repair kit details from db @@ -112,7 +126,7 @@ export declare class RepairService { * @param itemTemplate Item to check for skill * @returns Skill name */ - protected getItemSkillType(itemTemplate: ITemplateItem): string; + protected getItemSkillType(itemTemplate: ITemplateItem): SkillTypes; /** * Ensure multiplier is between 1 and 0.01 * @param receiveDurabilityMaxPercent Max durabiltiy percent @@ -123,6 +137,7 @@ export declare class RepairService { } export declare class RepairDetails { repairCost?: number; + repairPoints?: number; repairedItem: Item; repairedItemIsArmor: boolean; repairAmount: number; diff --git a/TypeScript/5ReplaceMethod/types/utils/App.d.ts b/TypeScript/5ReplaceMethod/types/utils/App.d.ts index 1839695..64800ce 100644 --- a/TypeScript/5ReplaceMethod/types/utils/App.d.ts +++ b/TypeScript/5ReplaceMethod/types/utils/App.d.ts @@ -1,6 +1,8 @@ import { OnLoad } from "@spt-aki/di/OnLoad"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -8,11 +10,13 @@ export declare class App { protected logger: ILogger; protected timeUtil: TimeUtil; protected localisationService: LocalisationService; + protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/GameController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/GameController.d.ts index 640a8c1..168071d 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/GameController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/GameController.d.ts @@ -61,6 +61,10 @@ export declare class GameController { * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + /** + * Out of date/incorrectly made trader mods forget this data + */ + protected checkTraderRepairValuesExist(): void; protected addCustomLooseLootPositions(): void; protected adjustLooseLootSpawnProbabilities(): void; protected setHideoutAreasAndCraftsTo40Secs(): void; diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/InsuranceController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/InsuranceController.d.ts index b1e8fe6..0ee30ed 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/InsuranceController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/InsuranceController.d.ts @@ -8,7 +8,7 @@ import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGet import { IGetInsuranceCostResponseData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostResponseData"; import { IInsureRequestData } from "@spt-aki/models/eft/insurance/IInsureRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; -import { Insurance, ISystemData } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ISystemData, Insurance } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IInsuranceConfig } from "@spt-aki/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/RepeatableQuestController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/RepeatableQuestController.d.ts index b09b540..a3ebc1c 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/RepeatableQuestController.d.ts @@ -13,6 +13,7 @@ import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -21,8 +22,9 @@ import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RepeatableQuestController { - protected timeUtil: TimeUtil; protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; @@ -37,7 +39,7 @@ export declare class RepeatableQuestController { protected questHelper: QuestHelper; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. @@ -64,6 +66,13 @@ export declare class RepeatableQuestController { * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Get the number of quests to generate - takes into account charisma state of player + * @param repeatableConfig Config + * @param pmcData Player profile + * @returns Quest count + */ + protected getQuestCount(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): number; /** * Get repeatable quest data from profile from name (daily/weekly), creates base repeatable quest object if none exists * @param repeatableConfig daily/weekly config diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/BotEquipmentModGenerator.d.ts index 05266dd..75530c7 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/BotEquipmentModGenerator.d.ts @@ -179,7 +179,7 @@ export declare class BotEquipmentModGenerator { * Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots. * This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine" * @param items The items where the CylinderMagazine's camora are appended to - * @param modPool modPool which should include available cartrigdes + * @param modPool modPool which should include available cartridges * @param parentId The CylinderMagazine's UID * @param parentTemplate The CylinderMagazine's template */ diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/BotLootGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/BotLootGenerator.d.ts index e937a4d..7a4c521 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/BotLootGenerator.d.ts @@ -83,7 +83,7 @@ export declare class BotLootGenerator { * @param equipmentSlot slot to place the preset in (backpack) * @param templateInventory bots template, assault.json * @param modChances chances for mods to spawn on weapon - * @param botRole bots role, .e.g. pmcBot + * @param botRole bots role .e.g. pmcBot * @param isPmc are we generating for a pmc */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; @@ -120,16 +120,16 @@ export declare class BotLootGenerator { protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; /** * Randomise the stack size of a money object, uses different values for pmc or scavs - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param moneyItem Money stack to randomise + * @param isPmc Is money on a PMC bot + * @param itemTemplate item details from db + * @param moneyItem Money item to randomise */ protected randomiseMoneyStackSize(isPmc: boolean, itemTemplate: ITemplateItem, moneyItem: Item): void; /** * Randomise the size of an ammo stack - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param ammoItem Ammo stack to randomise + * @param isPmc Is ammo on a PMC bot + * @param itemTemplate item details from db + * @param ammoItem Ammo item to randomise */ protected randomiseAmmoStackSize(isPmc: boolean, itemTemplate: ITemplateItem, ammoItem: Item): void; /** diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/RepeatableQuestGenerator.d.ts index 40a3c16..44c38be 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/RepeatableQuestGenerator.d.ts @@ -8,7 +8,7 @@ import { Exit } from "@spt-aki/models/eft/common/ILocationBase"; import { TraderInfo } from "@spt-aki/models/eft/common/tables/IBotBase"; import { ICompletion, ICompletionAvailableFor, IElimination, IEliminationCondition, IExploration, IExplorationCondition, IPickup, IRepeatableQuest, IReward, IRewards } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; -import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; @@ -155,7 +155,7 @@ export declare class RepeatableQuestGenerator { * @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ - protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig): IRewards; + protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IRewards; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/HideoutHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/HideoutHelper.d.ts index 93f8fb1..0cfc649 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/HideoutHelper.d.ts @@ -1,7 +1,7 @@ import { InventoryHelper } from "@spt-aki/helpers/InventoryHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { Common, HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "@spt-aki/models/eft/hideout/IHideoutContinuousProductionStartRequestData"; @@ -201,22 +201,10 @@ export declare class HideoutHelper { * @returns coin slot count */ protected getBTCSlots(pmcData: IPmcData): number; - /** - * Does profile have elite hideout management skill - * @param pmcData Profile to look at - * @returns True if profile has skill - */ - protected hasEliteHideoutManagementSkill(pmcData: IPmcData): boolean; /** * Get a count of bitcoins player miner can hold */ protected getBitcoinMinerContainerSlotSize(): number; - /** - * Get the hideout management skill from player profile - * @param pmcData Profile to look at - * @returns Hideout management skill object - */ - protected getHideoutManagementSkill(pmcData: IPmcData): Common; /** * HideoutManagement skill gives a consumption bonus the higher the level * 0.5% per level per 1-51, (25.5% at max) diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/ItemHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/ItemHelper.d.ts index 47823bc..e1c7720 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/ItemHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/ItemHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -24,10 +25,11 @@ declare class ItemHelper { protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; + protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/ProfileHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/ProfileHelper.d.ts index 781f980..938c796 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/ProfileHelper.d.ts @@ -1,11 +1,13 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IValidateNicknameRequestData } from "@spt-aki/models/eft/profile/IValidateNicknameRequestData"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; +import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileSnapshotService } from "@spt-aki/services/ProfileSnapshotService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -19,7 +21,8 @@ export declare class ProfileHelper { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected profileSnapshotService: ProfileSnapshotService; - constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); + protected localisationService: LocalisationService; + constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, localisationService: LocalisationService); /** * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id @@ -101,4 +104,21 @@ export declare class ProfileHelper { * @param keyToIncrement Key */ incrementStatCounter(counters: CounterKeyValue[], keyToIncrement: string): void; + /** + * Check if player has a skill at elite level + * @param skillType Skill to check + * @param pmcProfile Profile to find skill in + * @returns True if player has skill at elite level + */ + hasEliteSkillLevel(skillType: SkillTypes, pmcProfile: IPmcData): boolean; + /** + * Add points to a specific skill in player profile + * @param skill Skill to add points to + * @param pointsToAdd Points to add + * @param pmcProfile Player profile with skill + * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code + * @returns + */ + addSkillPointsToPlayer(pmcProfile: IPmcData, skill: SkillTypes, pointsToAdd: number, useSkillProgressRateMultipler?: boolean): void; + getSkillFromProfile(pmcData: IPmcData, skill: SkillTypes): Common; } diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/QuestHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/QuestHelper.d.ts index 1e40e53..0dda05b 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/QuestHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/QuestHelper.d.ts @@ -6,7 +6,7 @@ import { QuestConditionHelper } from "@spt-aki/helpers/QuestConditionHelper"; import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "@spt-aki/models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; @@ -66,14 +66,12 @@ export declare class QuestHelper { */ getDeltaQuests(before: IQuest[], after: IQuest[]): IQuest[]; /** - * Increase skill points of a skill on player profile - * Dupe of PlayerService.incrementSkillLevel() - * @param sessionID Session id - * @param pmcData Player profile - * @param skillName Name of skill to increase skill points of - * @param progressAmount Amount of skill points to add to skill + * Adjust skill experience for low skill levels, mimicing the official client + * @param profileSkill the skill experience is being added to + * @param progressAmount the amount of experience being added to the skill + * @returns the adjusted skill progress gain */ - rewardSkillPoints(sessionID: string, pmcData: IPmcData, skillName: string, progressAmount: number): void; + adjustSkillExpForLowLevels(profileSkill: Common, progressAmount: number): number; /** * Get quest name by quest id * @param questId id to get diff --git a/TypeScript/6ReferenceAnotherClass/types/loaders/PreAkiModLoader.d.ts b/TypeScript/6ReferenceAnotherClass/types/loaders/PreAkiModLoader.d.ts index 869dfbb..71fd745 100644 --- a/TypeScript/6ReferenceAnotherClass/types/loaders/PreAkiModLoader.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/loaders/PreAkiModLoader.d.ts @@ -29,7 +29,7 @@ export declare class PreAkiModLoader implements IModLoader { protected imported: Record; protected akiConfig: ICoreConfig; protected serverDependencies: Record; - protected skippedMods: string[]; + protected skippedMods: Set; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, bundleLoader: BundleLoader, localisationService: LocalisationService, configServer: ConfigServer, modLoadOrder: ModLoadOrder, modTypeCheck: ModTypeCheck); load(container: DependencyContainer): Promise; /** @@ -44,27 +44,22 @@ export declare class PreAkiModLoader implements IModLoader { 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 + * @param modPackageData map of mod package.json data */ - protected checkForDuplicateMods(modPackageData: Record): void; + protected checkForDuplicateMods(modPackageData: Map): void; /** - * Check for and return duplicate strings inside an array - * @param stringArray Array to check for duplicates - * @returns string array of duplicates, empty if none found - */ - protected getDuplicates(stringArray: string[]): string[]; - /** - * Get an array of mods with errors that prevent them from working with SPT + * Returns an array of valid mods. + * * @param mods mods to validate - * @returns Mod names as array + * @returns array of mod folder names */ - protected getBrokenMods(mods: string[]): string[]; + protected getValidMods(mods: string[]): string[]; /** * Get packageJson data for mods * @param mods mods to get packageJson for - * @returns dictionary + * @returns map */ - protected getModsPackageData(mods: string[]): Record; + protected getModsPackageData(mods: string[]): Map; /** * Is the passed in mod compatible with the running server version * @param mod Mod to check compatibiltiy with AKI @@ -86,10 +81,17 @@ export declare class PreAkiModLoader implements IModLoader { * Compile mod and add into class property "imported" * @param mod Name of mod to compile/add */ - protected addModAsync(mod: string): Promise; + protected addModAsync(mod: string, pkg: IPackageJsonData): Promise; + /** + * Checks if a given mod should be loaded or skipped. + * + * @param pkg mod package.json data + * @returns + */ + protected shouldSkipMod(pkg: IPackageJsonData): boolean; protected autoInstallDependencies(modPath: string, pkg: IPackageJsonData): void; - protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Record): boolean; - protected isModCompatible(mod: IPackageJsonData, loadedMods: Record): boolean; + protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Map): boolean; + protected isModCompatible(mod: IPackageJsonData, loadedMods: Map): boolean; /** * Validate a mod passes a number of checks * @param modName name of mod in /mods/ to validate diff --git a/TypeScript/6ReferenceAnotherClass/types/models/enums/SkillTypes.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/enums/SkillTypes.d.ts index 4eb90af..dc059a8 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/enums/SkillTypes.d.ts @@ -1,4 +1,6 @@ export declare enum SkillTypes { + BOT_RELOAD = "BotReload", + BOT_SOUND = "BotSound", HIDEOUT_MANAGEMENT = "HideoutManagement", CRAFTING = "Crafting", METABOLISM = "Metabolism", @@ -19,6 +21,7 @@ export declare enum SkillTypes { ATTENTION = "Attention", CHARISMA = "Charisma", MEMORY = "Memory", + MELEE = "Melee", SURGERY = "Surgery", AIM_DRILLS = "AimDrills", TROUBLESHOOTING = "TroubleShooting", @@ -31,6 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", + /** Also called Weapon Maintenance*/ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts index c76eda7..24c8c19 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts @@ -102,6 +102,8 @@ export interface EquipmentFilters { weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; /** Same as weightingAdjustments but based on player level instead of bot level */ weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; + /** Should the stock mod be forced to spawn on bot */ + forceStock: boolean; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IQuestConfig.d.ts index 3e3b2be..8a71eb9 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IQuestConfig.d.ts @@ -55,6 +55,8 @@ export interface IRewardScaling { items: number[]; reputation: number[]; rewardSpread: number; + skillRewardChance: number[]; + skillPointReward: number[]; } export interface ITraderWhitelist { traderId: string; @@ -66,7 +68,7 @@ export interface IRepeatableQuestTypesConfig { Pickup: IPickup; Elimination: IEliminationConfig[]; } -export interface IExploration { +export interface IExploration extends IBaseQuestConfig { maxExtracts: number; specificExits: ISpecificExits; } @@ -74,7 +76,7 @@ export interface ISpecificExits { probability: number; passageRequirementWhitelist: string[]; } -export interface ICompletion { +export interface ICompletion extends IBaseQuestConfig { minRequestedAmount: number; maxRequestedAmount: number; minRequestedBulletAmount: number; @@ -82,7 +84,7 @@ export interface ICompletion { useWhitelist: boolean; useBlacklist: boolean; } -export interface IPickup { +export interface IPickup extends IBaseQuestConfig { ItemTypeToFetchWithMaxCount: IPickupTypeWithMaxCount[]; } export interface IPickupTypeWithMaxCount { @@ -90,7 +92,7 @@ export interface IPickupTypeWithMaxCount { maxPickupCount: number; minPickupCount: number; } -export interface IEliminationConfig { +export interface IEliminationConfig extends IBaseQuestConfig { levelRange: MinMax; targets: ITarget[]; bodyPartProb: number; @@ -111,6 +113,9 @@ export interface IEliminationConfig { weaponRequirementProb: number; weaponRequirements: IWeaponRequirement[]; } +export interface IBaseQuestConfig { + possibleSkillRewards: string[]; +} export interface ITarget extends IProbabilityObject { data: IBossInfo; } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IRepairConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IRepairConfig.d.ts index 1ae082d..9e23cc4 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IRepairConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IRepairConfig.d.ts @@ -9,6 +9,7 @@ export interface IRepairConfig extends IBaseConfig { /** INT gain multiplier per repaired item type */ repairKitIntellectGainMultiplier: IIntellectGainValues; maxIntellectGainPerRepair: IMaxIntellectGainValues; + weaponTreatment: IWeaponTreatmentRepairValues; repairKit: RepairKit; } export interface IIntellectGainValues { @@ -19,6 +20,16 @@ export interface IMaxIntellectGainValues { kit: number; trader: number; } +export interface IWeaponTreatmentRepairValues { + /** The chance to gain more weapon maintenance skill */ + critSuccessChance: number; + critSuccessAmount: number; + /** The chance to gain less weapon maintenance skill */ + critFailureChance: number; + critFailureAmount: number; + /** The multiplier used for calculating weapon maintenance XP */ + pointGainMultiplier: number; +} export interface RepairKit { armor: BonusSettings; weapon: BonusSettings; diff --git a/TypeScript/6ReferenceAnotherClass/types/services/PlayerService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/PlayerService.d.ts index edf269e..f24e0dc 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/PlayerService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/PlayerService.d.ts @@ -9,15 +9,6 @@ export declare class PlayerService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, databaseServer: DatabaseServer); - /** - * Dupe of QuestHelper.rewardsSkillPoints() - * Add xp to a player skill - * @param pmcData Player profile - * @param skillName Name of skill to increment - * @param amount Amount of skill points to add to skill - * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code - */ - incrementSkillLevel(pmcData: IPmcData, skillName: string, amount: number, useSkillProgressRateMultipler?: boolean): void; /** * Get level of player * @param pmcData Player profile diff --git a/TypeScript/6ReferenceAnotherClass/types/services/RepairService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/RepairService.d.ts index b8ffbaa..8f9e7e9 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/RepairService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/RepairService.d.ts @@ -1,5 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { QuestHelper } from "@spt-aki/helpers/QuestHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { RepairHelper } from "@spt-aki/helpers/RepairHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; @@ -9,6 +9,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { RepairKitsInfo } from "@spt-aki/models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "@spt-aki/models/eft/repair/ITraderRepairActionDataRequest"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { BonusSettings, IRepairConfig } from "@spt-aki/models/spt/config/IRepairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -19,7 +20,7 @@ import { RandomUtil } from "@spt-aki/utils/RandomUtil"; export declare class RepairService { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected questHelper: QuestHelper; + protected profileHelper: ProfileHelper; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; @@ -29,7 +30,7 @@ export declare class RepairService { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id @@ -56,6 +57,12 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + /** + * Return an appromixation of the amount of skill points live would return for the given repairDetails + * @param repairDetails the repair details to calculate skill points for + * @returns the number of skill points to reward the user + */ + protected getWeaponRepairSkillPoints(repairDetails: RepairDetails): number; /** * * @param sessionId Session id @@ -81,6 +88,13 @@ export declare class RepairService { * @returns Multiplier value */ protected getBonusMultiplierValue(skillBonusName: string, pmcData: IPmcData): number; + /** + * Should a repair kit apply total durability loss on repair + * @param pmcData Player profile + * @param applyRandomizeDurabilityLoss Value from repair config + * @returns True if loss should be applied + */ + protected shouldRepairKitApplyDurabilityLoss(pmcData: IPmcData, applyRandomizeDurabilityLoss: boolean): boolean; /** * Update repair kits Resource object if it doesn't exist * @param repairKitDetails Repair kit details from db @@ -112,7 +126,7 @@ export declare class RepairService { * @param itemTemplate Item to check for skill * @returns Skill name */ - protected getItemSkillType(itemTemplate: ITemplateItem): string; + protected getItemSkillType(itemTemplate: ITemplateItem): SkillTypes; /** * Ensure multiplier is between 1 and 0.01 * @param receiveDurabilityMaxPercent Max durabiltiy percent @@ -123,6 +137,7 @@ export declare class RepairService { } export declare class RepairDetails { repairCost?: number; + repairPoints?: number; repairedItem: Item; repairedItemIsArmor: boolean; repairAmount: number; diff --git a/TypeScript/6ReferenceAnotherClass/types/utils/App.d.ts b/TypeScript/6ReferenceAnotherClass/types/utils/App.d.ts index 1839695..64800ce 100644 --- a/TypeScript/6ReferenceAnotherClass/types/utils/App.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/utils/App.d.ts @@ -1,6 +1,8 @@ import { OnLoad } from "@spt-aki/di/OnLoad"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -8,11 +10,13 @@ export declare class App { protected logger: ILogger; protected timeUtil: TimeUtil; protected localisationService: LocalisationService; + protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/7OnLoadHook/types/controllers/GameController.d.ts b/TypeScript/7OnLoadHook/types/controllers/GameController.d.ts index 640a8c1..168071d 100644 --- a/TypeScript/7OnLoadHook/types/controllers/GameController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/GameController.d.ts @@ -61,6 +61,10 @@ export declare class GameController { * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + /** + * Out of date/incorrectly made trader mods forget this data + */ + protected checkTraderRepairValuesExist(): void; protected addCustomLooseLootPositions(): void; protected adjustLooseLootSpawnProbabilities(): void; protected setHideoutAreasAndCraftsTo40Secs(): void; diff --git a/TypeScript/7OnLoadHook/types/controllers/InsuranceController.d.ts b/TypeScript/7OnLoadHook/types/controllers/InsuranceController.d.ts index b1e8fe6..0ee30ed 100644 --- a/TypeScript/7OnLoadHook/types/controllers/InsuranceController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/InsuranceController.d.ts @@ -8,7 +8,7 @@ import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGet import { IGetInsuranceCostResponseData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostResponseData"; import { IInsureRequestData } from "@spt-aki/models/eft/insurance/IInsureRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; -import { Insurance, ISystemData } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ISystemData, Insurance } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IInsuranceConfig } from "@spt-aki/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; diff --git a/TypeScript/7OnLoadHook/types/controllers/RepeatableQuestController.d.ts b/TypeScript/7OnLoadHook/types/controllers/RepeatableQuestController.d.ts index b09b540..a3ebc1c 100644 --- a/TypeScript/7OnLoadHook/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/RepeatableQuestController.d.ts @@ -13,6 +13,7 @@ import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -21,8 +22,9 @@ import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RepeatableQuestController { - protected timeUtil: TimeUtil; protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; @@ -37,7 +39,7 @@ export declare class RepeatableQuestController { protected questHelper: QuestHelper; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. @@ -64,6 +66,13 @@ export declare class RepeatableQuestController { * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Get the number of quests to generate - takes into account charisma state of player + * @param repeatableConfig Config + * @param pmcData Player profile + * @returns Quest count + */ + protected getQuestCount(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): number; /** * Get repeatable quest data from profile from name (daily/weekly), creates base repeatable quest object if none exists * @param repeatableConfig daily/weekly config diff --git a/TypeScript/7OnLoadHook/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/BotEquipmentModGenerator.d.ts index 05266dd..75530c7 100644 --- a/TypeScript/7OnLoadHook/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/BotEquipmentModGenerator.d.ts @@ -179,7 +179,7 @@ export declare class BotEquipmentModGenerator { * Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots. * This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine" * @param items The items where the CylinderMagazine's camora are appended to - * @param modPool modPool which should include available cartrigdes + * @param modPool modPool which should include available cartridges * @param parentId The CylinderMagazine's UID * @param parentTemplate The CylinderMagazine's template */ diff --git a/TypeScript/7OnLoadHook/types/generators/BotLootGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/BotLootGenerator.d.ts index e937a4d..7a4c521 100644 --- a/TypeScript/7OnLoadHook/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/BotLootGenerator.d.ts @@ -83,7 +83,7 @@ export declare class BotLootGenerator { * @param equipmentSlot slot to place the preset in (backpack) * @param templateInventory bots template, assault.json * @param modChances chances for mods to spawn on weapon - * @param botRole bots role, .e.g. pmcBot + * @param botRole bots role .e.g. pmcBot * @param isPmc are we generating for a pmc */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; @@ -120,16 +120,16 @@ export declare class BotLootGenerator { protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; /** * Randomise the stack size of a money object, uses different values for pmc or scavs - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param moneyItem Money stack to randomise + * @param isPmc Is money on a PMC bot + * @param itemTemplate item details from db + * @param moneyItem Money item to randomise */ protected randomiseMoneyStackSize(isPmc: boolean, itemTemplate: ITemplateItem, moneyItem: Item): void; /** * Randomise the size of an ammo stack - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param ammoItem Ammo stack to randomise + * @param isPmc Is ammo on a PMC bot + * @param itemTemplate item details from db + * @param ammoItem Ammo item to randomise */ protected randomiseAmmoStackSize(isPmc: boolean, itemTemplate: ITemplateItem, ammoItem: Item): void; /** diff --git a/TypeScript/7OnLoadHook/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/RepeatableQuestGenerator.d.ts index 40a3c16..44c38be 100644 --- a/TypeScript/7OnLoadHook/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/RepeatableQuestGenerator.d.ts @@ -8,7 +8,7 @@ import { Exit } from "@spt-aki/models/eft/common/ILocationBase"; import { TraderInfo } from "@spt-aki/models/eft/common/tables/IBotBase"; import { ICompletion, ICompletionAvailableFor, IElimination, IEliminationCondition, IExploration, IExplorationCondition, IPickup, IRepeatableQuest, IReward, IRewards } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; -import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; @@ -155,7 +155,7 @@ export declare class RepeatableQuestGenerator { * @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ - protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig): IRewards; + protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IRewards; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config diff --git a/TypeScript/7OnLoadHook/types/helpers/HideoutHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/HideoutHelper.d.ts index 93f8fb1..0cfc649 100644 --- a/TypeScript/7OnLoadHook/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/HideoutHelper.d.ts @@ -1,7 +1,7 @@ import { InventoryHelper } from "@spt-aki/helpers/InventoryHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { Common, HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "@spt-aki/models/eft/hideout/IHideoutContinuousProductionStartRequestData"; @@ -201,22 +201,10 @@ export declare class HideoutHelper { * @returns coin slot count */ protected getBTCSlots(pmcData: IPmcData): number; - /** - * Does profile have elite hideout management skill - * @param pmcData Profile to look at - * @returns True if profile has skill - */ - protected hasEliteHideoutManagementSkill(pmcData: IPmcData): boolean; /** * Get a count of bitcoins player miner can hold */ protected getBitcoinMinerContainerSlotSize(): number; - /** - * Get the hideout management skill from player profile - * @param pmcData Profile to look at - * @returns Hideout management skill object - */ - protected getHideoutManagementSkill(pmcData: IPmcData): Common; /** * HideoutManagement skill gives a consumption bonus the higher the level * 0.5% per level per 1-51, (25.5% at max) diff --git a/TypeScript/7OnLoadHook/types/helpers/ItemHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/ItemHelper.d.ts index 47823bc..e1c7720 100644 --- a/TypeScript/7OnLoadHook/types/helpers/ItemHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/ItemHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -24,10 +25,11 @@ declare class ItemHelper { protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; + protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl diff --git a/TypeScript/7OnLoadHook/types/helpers/ProfileHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/ProfileHelper.d.ts index 781f980..938c796 100644 --- a/TypeScript/7OnLoadHook/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/ProfileHelper.d.ts @@ -1,11 +1,13 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IValidateNicknameRequestData } from "@spt-aki/models/eft/profile/IValidateNicknameRequestData"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; +import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileSnapshotService } from "@spt-aki/services/ProfileSnapshotService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -19,7 +21,8 @@ export declare class ProfileHelper { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected profileSnapshotService: ProfileSnapshotService; - constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); + protected localisationService: LocalisationService; + constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, localisationService: LocalisationService); /** * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id @@ -101,4 +104,21 @@ export declare class ProfileHelper { * @param keyToIncrement Key */ incrementStatCounter(counters: CounterKeyValue[], keyToIncrement: string): void; + /** + * Check if player has a skill at elite level + * @param skillType Skill to check + * @param pmcProfile Profile to find skill in + * @returns True if player has skill at elite level + */ + hasEliteSkillLevel(skillType: SkillTypes, pmcProfile: IPmcData): boolean; + /** + * Add points to a specific skill in player profile + * @param skill Skill to add points to + * @param pointsToAdd Points to add + * @param pmcProfile Player profile with skill + * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code + * @returns + */ + addSkillPointsToPlayer(pmcProfile: IPmcData, skill: SkillTypes, pointsToAdd: number, useSkillProgressRateMultipler?: boolean): void; + getSkillFromProfile(pmcData: IPmcData, skill: SkillTypes): Common; } diff --git a/TypeScript/7OnLoadHook/types/helpers/QuestHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/QuestHelper.d.ts index 1e40e53..0dda05b 100644 --- a/TypeScript/7OnLoadHook/types/helpers/QuestHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/QuestHelper.d.ts @@ -6,7 +6,7 @@ import { QuestConditionHelper } from "@spt-aki/helpers/QuestConditionHelper"; import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "@spt-aki/models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; @@ -66,14 +66,12 @@ export declare class QuestHelper { */ getDeltaQuests(before: IQuest[], after: IQuest[]): IQuest[]; /** - * Increase skill points of a skill on player profile - * Dupe of PlayerService.incrementSkillLevel() - * @param sessionID Session id - * @param pmcData Player profile - * @param skillName Name of skill to increase skill points of - * @param progressAmount Amount of skill points to add to skill + * Adjust skill experience for low skill levels, mimicing the official client + * @param profileSkill the skill experience is being added to + * @param progressAmount the amount of experience being added to the skill + * @returns the adjusted skill progress gain */ - rewardSkillPoints(sessionID: string, pmcData: IPmcData, skillName: string, progressAmount: number): void; + adjustSkillExpForLowLevels(profileSkill: Common, progressAmount: number): number; /** * Get quest name by quest id * @param questId id to get diff --git a/TypeScript/7OnLoadHook/types/loaders/PreAkiModLoader.d.ts b/TypeScript/7OnLoadHook/types/loaders/PreAkiModLoader.d.ts index 869dfbb..71fd745 100644 --- a/TypeScript/7OnLoadHook/types/loaders/PreAkiModLoader.d.ts +++ b/TypeScript/7OnLoadHook/types/loaders/PreAkiModLoader.d.ts @@ -29,7 +29,7 @@ export declare class PreAkiModLoader implements IModLoader { protected imported: Record; protected akiConfig: ICoreConfig; protected serverDependencies: Record; - protected skippedMods: string[]; + protected skippedMods: Set; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, bundleLoader: BundleLoader, localisationService: LocalisationService, configServer: ConfigServer, modLoadOrder: ModLoadOrder, modTypeCheck: ModTypeCheck); load(container: DependencyContainer): Promise; /** @@ -44,27 +44,22 @@ export declare class PreAkiModLoader implements IModLoader { 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 + * @param modPackageData map of mod package.json data */ - protected checkForDuplicateMods(modPackageData: Record): void; + protected checkForDuplicateMods(modPackageData: Map): void; /** - * Check for and return duplicate strings inside an array - * @param stringArray Array to check for duplicates - * @returns string array of duplicates, empty if none found - */ - protected getDuplicates(stringArray: string[]): string[]; - /** - * Get an array of mods with errors that prevent them from working with SPT + * Returns an array of valid mods. + * * @param mods mods to validate - * @returns Mod names as array + * @returns array of mod folder names */ - protected getBrokenMods(mods: string[]): string[]; + protected getValidMods(mods: string[]): string[]; /** * Get packageJson data for mods * @param mods mods to get packageJson for - * @returns dictionary + * @returns map */ - protected getModsPackageData(mods: string[]): Record; + protected getModsPackageData(mods: string[]): Map; /** * Is the passed in mod compatible with the running server version * @param mod Mod to check compatibiltiy with AKI @@ -86,10 +81,17 @@ export declare class PreAkiModLoader implements IModLoader { * Compile mod and add into class property "imported" * @param mod Name of mod to compile/add */ - protected addModAsync(mod: string): Promise; + protected addModAsync(mod: string, pkg: IPackageJsonData): Promise; + /** + * Checks if a given mod should be loaded or skipped. + * + * @param pkg mod package.json data + * @returns + */ + protected shouldSkipMod(pkg: IPackageJsonData): boolean; protected autoInstallDependencies(modPath: string, pkg: IPackageJsonData): void; - protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Record): boolean; - protected isModCompatible(mod: IPackageJsonData, loadedMods: Record): boolean; + protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Map): boolean; + protected isModCompatible(mod: IPackageJsonData, loadedMods: Map): boolean; /** * Validate a mod passes a number of checks * @param modName name of mod in /mods/ to validate diff --git a/TypeScript/7OnLoadHook/types/models/enums/SkillTypes.d.ts b/TypeScript/7OnLoadHook/types/models/enums/SkillTypes.d.ts index 4eb90af..dc059a8 100644 --- a/TypeScript/7OnLoadHook/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/7OnLoadHook/types/models/enums/SkillTypes.d.ts @@ -1,4 +1,6 @@ export declare enum SkillTypes { + BOT_RELOAD = "BotReload", + BOT_SOUND = "BotSound", HIDEOUT_MANAGEMENT = "HideoutManagement", CRAFTING = "Crafting", METABOLISM = "Metabolism", @@ -19,6 +21,7 @@ export declare enum SkillTypes { ATTENTION = "Attention", CHARISMA = "Charisma", MEMORY = "Memory", + MELEE = "Melee", SURGERY = "Surgery", AIM_DRILLS = "AimDrills", TROUBLESHOOTING = "TroubleShooting", @@ -31,6 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", + /** Also called Weapon Maintenance*/ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts index c76eda7..24c8c19 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts @@ -102,6 +102,8 @@ export interface EquipmentFilters { weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; /** Same as weightingAdjustments but based on player level instead of bot level */ weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; + /** Should the stock mod be forced to spawn on bot */ + forceStock: boolean; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/IQuestConfig.d.ts index 3e3b2be..8a71eb9 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/IQuestConfig.d.ts @@ -55,6 +55,8 @@ export interface IRewardScaling { items: number[]; reputation: number[]; rewardSpread: number; + skillRewardChance: number[]; + skillPointReward: number[]; } export interface ITraderWhitelist { traderId: string; @@ -66,7 +68,7 @@ export interface IRepeatableQuestTypesConfig { Pickup: IPickup; Elimination: IEliminationConfig[]; } -export interface IExploration { +export interface IExploration extends IBaseQuestConfig { maxExtracts: number; specificExits: ISpecificExits; } @@ -74,7 +76,7 @@ export interface ISpecificExits { probability: number; passageRequirementWhitelist: string[]; } -export interface ICompletion { +export interface ICompletion extends IBaseQuestConfig { minRequestedAmount: number; maxRequestedAmount: number; minRequestedBulletAmount: number; @@ -82,7 +84,7 @@ export interface ICompletion { useWhitelist: boolean; useBlacklist: boolean; } -export interface IPickup { +export interface IPickup extends IBaseQuestConfig { ItemTypeToFetchWithMaxCount: IPickupTypeWithMaxCount[]; } export interface IPickupTypeWithMaxCount { @@ -90,7 +92,7 @@ export interface IPickupTypeWithMaxCount { maxPickupCount: number; minPickupCount: number; } -export interface IEliminationConfig { +export interface IEliminationConfig extends IBaseQuestConfig { levelRange: MinMax; targets: ITarget[]; bodyPartProb: number; @@ -111,6 +113,9 @@ export interface IEliminationConfig { weaponRequirementProb: number; weaponRequirements: IWeaponRequirement[]; } +export interface IBaseQuestConfig { + possibleSkillRewards: string[]; +} export interface ITarget extends IProbabilityObject { data: IBossInfo; } diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/IRepairConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/IRepairConfig.d.ts index 1ae082d..9e23cc4 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/IRepairConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/IRepairConfig.d.ts @@ -9,6 +9,7 @@ export interface IRepairConfig extends IBaseConfig { /** INT gain multiplier per repaired item type */ repairKitIntellectGainMultiplier: IIntellectGainValues; maxIntellectGainPerRepair: IMaxIntellectGainValues; + weaponTreatment: IWeaponTreatmentRepairValues; repairKit: RepairKit; } export interface IIntellectGainValues { @@ -19,6 +20,16 @@ export interface IMaxIntellectGainValues { kit: number; trader: number; } +export interface IWeaponTreatmentRepairValues { + /** The chance to gain more weapon maintenance skill */ + critSuccessChance: number; + critSuccessAmount: number; + /** The chance to gain less weapon maintenance skill */ + critFailureChance: number; + critFailureAmount: number; + /** The multiplier used for calculating weapon maintenance XP */ + pointGainMultiplier: number; +} export interface RepairKit { armor: BonusSettings; weapon: BonusSettings; diff --git a/TypeScript/7OnLoadHook/types/services/PlayerService.d.ts b/TypeScript/7OnLoadHook/types/services/PlayerService.d.ts index edf269e..f24e0dc 100644 --- a/TypeScript/7OnLoadHook/types/services/PlayerService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/PlayerService.d.ts @@ -9,15 +9,6 @@ export declare class PlayerService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, databaseServer: DatabaseServer); - /** - * Dupe of QuestHelper.rewardsSkillPoints() - * Add xp to a player skill - * @param pmcData Player profile - * @param skillName Name of skill to increment - * @param amount Amount of skill points to add to skill - * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code - */ - incrementSkillLevel(pmcData: IPmcData, skillName: string, amount: number, useSkillProgressRateMultipler?: boolean): void; /** * Get level of player * @param pmcData Player profile diff --git a/TypeScript/7OnLoadHook/types/services/RepairService.d.ts b/TypeScript/7OnLoadHook/types/services/RepairService.d.ts index b8ffbaa..8f9e7e9 100644 --- a/TypeScript/7OnLoadHook/types/services/RepairService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/RepairService.d.ts @@ -1,5 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { QuestHelper } from "@spt-aki/helpers/QuestHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { RepairHelper } from "@spt-aki/helpers/RepairHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; @@ -9,6 +9,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { RepairKitsInfo } from "@spt-aki/models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "@spt-aki/models/eft/repair/ITraderRepairActionDataRequest"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { BonusSettings, IRepairConfig } from "@spt-aki/models/spt/config/IRepairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -19,7 +20,7 @@ import { RandomUtil } from "@spt-aki/utils/RandomUtil"; export declare class RepairService { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected questHelper: QuestHelper; + protected profileHelper: ProfileHelper; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; @@ -29,7 +30,7 @@ export declare class RepairService { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id @@ -56,6 +57,12 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + /** + * Return an appromixation of the amount of skill points live would return for the given repairDetails + * @param repairDetails the repair details to calculate skill points for + * @returns the number of skill points to reward the user + */ + protected getWeaponRepairSkillPoints(repairDetails: RepairDetails): number; /** * * @param sessionId Session id @@ -81,6 +88,13 @@ export declare class RepairService { * @returns Multiplier value */ protected getBonusMultiplierValue(skillBonusName: string, pmcData: IPmcData): number; + /** + * Should a repair kit apply total durability loss on repair + * @param pmcData Player profile + * @param applyRandomizeDurabilityLoss Value from repair config + * @returns True if loss should be applied + */ + protected shouldRepairKitApplyDurabilityLoss(pmcData: IPmcData, applyRandomizeDurabilityLoss: boolean): boolean; /** * Update repair kits Resource object if it doesn't exist * @param repairKitDetails Repair kit details from db @@ -112,7 +126,7 @@ export declare class RepairService { * @param itemTemplate Item to check for skill * @returns Skill name */ - protected getItemSkillType(itemTemplate: ITemplateItem): string; + protected getItemSkillType(itemTemplate: ITemplateItem): SkillTypes; /** * Ensure multiplier is between 1 and 0.01 * @param receiveDurabilityMaxPercent Max durabiltiy percent @@ -123,6 +137,7 @@ export declare class RepairService { } export declare class RepairDetails { repairCost?: number; + repairPoints?: number; repairedItem: Item; repairedItemIsArmor: boolean; repairAmount: number; diff --git a/TypeScript/7OnLoadHook/types/utils/App.d.ts b/TypeScript/7OnLoadHook/types/utils/App.d.ts index 1839695..64800ce 100644 --- a/TypeScript/7OnLoadHook/types/utils/App.d.ts +++ b/TypeScript/7OnLoadHook/types/utils/App.d.ts @@ -1,6 +1,8 @@ import { OnLoad } from "@spt-aki/di/OnLoad"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -8,11 +10,13 @@ export declare class App { protected logger: ILogger; protected timeUtil: TimeUtil; protected localisationService: LocalisationService; + protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/8OnUpdateHook/types/controllers/GameController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/GameController.d.ts index 640a8c1..168071d 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/GameController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/GameController.d.ts @@ -61,6 +61,10 @@ export declare class GameController { * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + /** + * Out of date/incorrectly made trader mods forget this data + */ + protected checkTraderRepairValuesExist(): void; protected addCustomLooseLootPositions(): void; protected adjustLooseLootSpawnProbabilities(): void; protected setHideoutAreasAndCraftsTo40Secs(): void; diff --git a/TypeScript/8OnUpdateHook/types/controllers/InsuranceController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/InsuranceController.d.ts index b1e8fe6..0ee30ed 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/InsuranceController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/InsuranceController.d.ts @@ -8,7 +8,7 @@ import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGet import { IGetInsuranceCostResponseData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostResponseData"; import { IInsureRequestData } from "@spt-aki/models/eft/insurance/IInsureRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; -import { Insurance, ISystemData } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ISystemData, Insurance } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IInsuranceConfig } from "@spt-aki/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; diff --git a/TypeScript/8OnUpdateHook/types/controllers/RepeatableQuestController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/RepeatableQuestController.d.ts index b09b540..a3ebc1c 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/RepeatableQuestController.d.ts @@ -13,6 +13,7 @@ import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -21,8 +22,9 @@ import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RepeatableQuestController { - protected timeUtil: TimeUtil; protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; @@ -37,7 +39,7 @@ export declare class RepeatableQuestController { protected questHelper: QuestHelper; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. @@ -64,6 +66,13 @@ export declare class RepeatableQuestController { * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Get the number of quests to generate - takes into account charisma state of player + * @param repeatableConfig Config + * @param pmcData Player profile + * @returns Quest count + */ + protected getQuestCount(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): number; /** * Get repeatable quest data from profile from name (daily/weekly), creates base repeatable quest object if none exists * @param repeatableConfig daily/weekly config diff --git a/TypeScript/8OnUpdateHook/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/BotEquipmentModGenerator.d.ts index 05266dd..75530c7 100644 --- a/TypeScript/8OnUpdateHook/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/BotEquipmentModGenerator.d.ts @@ -179,7 +179,7 @@ export declare class BotEquipmentModGenerator { * Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots. * This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine" * @param items The items where the CylinderMagazine's camora are appended to - * @param modPool modPool which should include available cartrigdes + * @param modPool modPool which should include available cartridges * @param parentId The CylinderMagazine's UID * @param parentTemplate The CylinderMagazine's template */ diff --git a/TypeScript/8OnUpdateHook/types/generators/BotLootGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/BotLootGenerator.d.ts index e937a4d..7a4c521 100644 --- a/TypeScript/8OnUpdateHook/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/BotLootGenerator.d.ts @@ -83,7 +83,7 @@ export declare class BotLootGenerator { * @param equipmentSlot slot to place the preset in (backpack) * @param templateInventory bots template, assault.json * @param modChances chances for mods to spawn on weapon - * @param botRole bots role, .e.g. pmcBot + * @param botRole bots role .e.g. pmcBot * @param isPmc are we generating for a pmc */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; @@ -120,16 +120,16 @@ export declare class BotLootGenerator { protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; /** * Randomise the stack size of a money object, uses different values for pmc or scavs - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param moneyItem Money stack to randomise + * @param isPmc Is money on a PMC bot + * @param itemTemplate item details from db + * @param moneyItem Money item to randomise */ protected randomiseMoneyStackSize(isPmc: boolean, itemTemplate: ITemplateItem, moneyItem: Item): void; /** * Randomise the size of an ammo stack - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param ammoItem Ammo stack to randomise + * @param isPmc Is ammo on a PMC bot + * @param itemTemplate item details from db + * @param ammoItem Ammo item to randomise */ protected randomiseAmmoStackSize(isPmc: boolean, itemTemplate: ITemplateItem, ammoItem: Item): void; /** diff --git a/TypeScript/8OnUpdateHook/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/RepeatableQuestGenerator.d.ts index 40a3c16..44c38be 100644 --- a/TypeScript/8OnUpdateHook/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/RepeatableQuestGenerator.d.ts @@ -8,7 +8,7 @@ import { Exit } from "@spt-aki/models/eft/common/ILocationBase"; import { TraderInfo } from "@spt-aki/models/eft/common/tables/IBotBase"; import { ICompletion, ICompletionAvailableFor, IElimination, IEliminationCondition, IExploration, IExplorationCondition, IPickup, IRepeatableQuest, IReward, IRewards } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; -import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; @@ -155,7 +155,7 @@ export declare class RepeatableQuestGenerator { * @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ - protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig): IRewards; + protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IRewards; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config diff --git a/TypeScript/8OnUpdateHook/types/helpers/HideoutHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/HideoutHelper.d.ts index 93f8fb1..0cfc649 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/HideoutHelper.d.ts @@ -1,7 +1,7 @@ import { InventoryHelper } from "@spt-aki/helpers/InventoryHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { Common, HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "@spt-aki/models/eft/hideout/IHideoutContinuousProductionStartRequestData"; @@ -201,22 +201,10 @@ export declare class HideoutHelper { * @returns coin slot count */ protected getBTCSlots(pmcData: IPmcData): number; - /** - * Does profile have elite hideout management skill - * @param pmcData Profile to look at - * @returns True if profile has skill - */ - protected hasEliteHideoutManagementSkill(pmcData: IPmcData): boolean; /** * Get a count of bitcoins player miner can hold */ protected getBitcoinMinerContainerSlotSize(): number; - /** - * Get the hideout management skill from player profile - * @param pmcData Profile to look at - * @returns Hideout management skill object - */ - protected getHideoutManagementSkill(pmcData: IPmcData): Common; /** * HideoutManagement skill gives a consumption bonus the higher the level * 0.5% per level per 1-51, (25.5% at max) diff --git a/TypeScript/8OnUpdateHook/types/helpers/ItemHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/ItemHelper.d.ts index 47823bc..e1c7720 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/ItemHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/ItemHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -24,10 +25,11 @@ declare class ItemHelper { protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; + protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl diff --git a/TypeScript/8OnUpdateHook/types/helpers/ProfileHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/ProfileHelper.d.ts index 781f980..938c796 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/ProfileHelper.d.ts @@ -1,11 +1,13 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IValidateNicknameRequestData } from "@spt-aki/models/eft/profile/IValidateNicknameRequestData"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; +import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileSnapshotService } from "@spt-aki/services/ProfileSnapshotService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -19,7 +21,8 @@ export declare class ProfileHelper { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected profileSnapshotService: ProfileSnapshotService; - constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); + protected localisationService: LocalisationService; + constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, localisationService: LocalisationService); /** * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id @@ -101,4 +104,21 @@ export declare class ProfileHelper { * @param keyToIncrement Key */ incrementStatCounter(counters: CounterKeyValue[], keyToIncrement: string): void; + /** + * Check if player has a skill at elite level + * @param skillType Skill to check + * @param pmcProfile Profile to find skill in + * @returns True if player has skill at elite level + */ + hasEliteSkillLevel(skillType: SkillTypes, pmcProfile: IPmcData): boolean; + /** + * Add points to a specific skill in player profile + * @param skill Skill to add points to + * @param pointsToAdd Points to add + * @param pmcProfile Player profile with skill + * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code + * @returns + */ + addSkillPointsToPlayer(pmcProfile: IPmcData, skill: SkillTypes, pointsToAdd: number, useSkillProgressRateMultipler?: boolean): void; + getSkillFromProfile(pmcData: IPmcData, skill: SkillTypes): Common; } diff --git a/TypeScript/8OnUpdateHook/types/helpers/QuestHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/QuestHelper.d.ts index 1e40e53..0dda05b 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/QuestHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/QuestHelper.d.ts @@ -6,7 +6,7 @@ import { QuestConditionHelper } from "@spt-aki/helpers/QuestConditionHelper"; import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "@spt-aki/models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; @@ -66,14 +66,12 @@ export declare class QuestHelper { */ getDeltaQuests(before: IQuest[], after: IQuest[]): IQuest[]; /** - * Increase skill points of a skill on player profile - * Dupe of PlayerService.incrementSkillLevel() - * @param sessionID Session id - * @param pmcData Player profile - * @param skillName Name of skill to increase skill points of - * @param progressAmount Amount of skill points to add to skill + * Adjust skill experience for low skill levels, mimicing the official client + * @param profileSkill the skill experience is being added to + * @param progressAmount the amount of experience being added to the skill + * @returns the adjusted skill progress gain */ - rewardSkillPoints(sessionID: string, pmcData: IPmcData, skillName: string, progressAmount: number): void; + adjustSkillExpForLowLevels(profileSkill: Common, progressAmount: number): number; /** * Get quest name by quest id * @param questId id to get diff --git a/TypeScript/8OnUpdateHook/types/loaders/PreAkiModLoader.d.ts b/TypeScript/8OnUpdateHook/types/loaders/PreAkiModLoader.d.ts index 869dfbb..71fd745 100644 --- a/TypeScript/8OnUpdateHook/types/loaders/PreAkiModLoader.d.ts +++ b/TypeScript/8OnUpdateHook/types/loaders/PreAkiModLoader.d.ts @@ -29,7 +29,7 @@ export declare class PreAkiModLoader implements IModLoader { protected imported: Record; protected akiConfig: ICoreConfig; protected serverDependencies: Record; - protected skippedMods: string[]; + protected skippedMods: Set; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, bundleLoader: BundleLoader, localisationService: LocalisationService, configServer: ConfigServer, modLoadOrder: ModLoadOrder, modTypeCheck: ModTypeCheck); load(container: DependencyContainer): Promise; /** @@ -44,27 +44,22 @@ export declare class PreAkiModLoader implements IModLoader { 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 + * @param modPackageData map of mod package.json data */ - protected checkForDuplicateMods(modPackageData: Record): void; + protected checkForDuplicateMods(modPackageData: Map): void; /** - * Check for and return duplicate strings inside an array - * @param stringArray Array to check for duplicates - * @returns string array of duplicates, empty if none found - */ - protected getDuplicates(stringArray: string[]): string[]; - /** - * Get an array of mods with errors that prevent them from working with SPT + * Returns an array of valid mods. + * * @param mods mods to validate - * @returns Mod names as array + * @returns array of mod folder names */ - protected getBrokenMods(mods: string[]): string[]; + protected getValidMods(mods: string[]): string[]; /** * Get packageJson data for mods * @param mods mods to get packageJson for - * @returns dictionary + * @returns map */ - protected getModsPackageData(mods: string[]): Record; + protected getModsPackageData(mods: string[]): Map; /** * Is the passed in mod compatible with the running server version * @param mod Mod to check compatibiltiy with AKI @@ -86,10 +81,17 @@ export declare class PreAkiModLoader implements IModLoader { * Compile mod and add into class property "imported" * @param mod Name of mod to compile/add */ - protected addModAsync(mod: string): Promise; + protected addModAsync(mod: string, pkg: IPackageJsonData): Promise; + /** + * Checks if a given mod should be loaded or skipped. + * + * @param pkg mod package.json data + * @returns + */ + protected shouldSkipMod(pkg: IPackageJsonData): boolean; protected autoInstallDependencies(modPath: string, pkg: IPackageJsonData): void; - protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Record): boolean; - protected isModCompatible(mod: IPackageJsonData, loadedMods: Record): boolean; + protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Map): boolean; + protected isModCompatible(mod: IPackageJsonData, loadedMods: Map): boolean; /** * Validate a mod passes a number of checks * @param modName name of mod in /mods/ to validate diff --git a/TypeScript/8OnUpdateHook/types/models/enums/SkillTypes.d.ts b/TypeScript/8OnUpdateHook/types/models/enums/SkillTypes.d.ts index 4eb90af..dc059a8 100644 --- a/TypeScript/8OnUpdateHook/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/enums/SkillTypes.d.ts @@ -1,4 +1,6 @@ export declare enum SkillTypes { + BOT_RELOAD = "BotReload", + BOT_SOUND = "BotSound", HIDEOUT_MANAGEMENT = "HideoutManagement", CRAFTING = "Crafting", METABOLISM = "Metabolism", @@ -19,6 +21,7 @@ export declare enum SkillTypes { ATTENTION = "Attention", CHARISMA = "Charisma", MEMORY = "Memory", + MELEE = "Melee", SURGERY = "Surgery", AIM_DRILLS = "AimDrills", TROUBLESHOOTING = "TroubleShooting", @@ -31,6 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", + /** Also called Weapon Maintenance*/ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts index c76eda7..24c8c19 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts @@ -102,6 +102,8 @@ export interface EquipmentFilters { weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; /** Same as weightingAdjustments but based on player level instead of bot level */ weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; + /** Should the stock mod be forced to spawn on bot */ + forceStock: boolean; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/IQuestConfig.d.ts index 3e3b2be..8a71eb9 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/IQuestConfig.d.ts @@ -55,6 +55,8 @@ export interface IRewardScaling { items: number[]; reputation: number[]; rewardSpread: number; + skillRewardChance: number[]; + skillPointReward: number[]; } export interface ITraderWhitelist { traderId: string; @@ -66,7 +68,7 @@ export interface IRepeatableQuestTypesConfig { Pickup: IPickup; Elimination: IEliminationConfig[]; } -export interface IExploration { +export interface IExploration extends IBaseQuestConfig { maxExtracts: number; specificExits: ISpecificExits; } @@ -74,7 +76,7 @@ export interface ISpecificExits { probability: number; passageRequirementWhitelist: string[]; } -export interface ICompletion { +export interface ICompletion extends IBaseQuestConfig { minRequestedAmount: number; maxRequestedAmount: number; minRequestedBulletAmount: number; @@ -82,7 +84,7 @@ export interface ICompletion { useWhitelist: boolean; useBlacklist: boolean; } -export interface IPickup { +export interface IPickup extends IBaseQuestConfig { ItemTypeToFetchWithMaxCount: IPickupTypeWithMaxCount[]; } export interface IPickupTypeWithMaxCount { @@ -90,7 +92,7 @@ export interface IPickupTypeWithMaxCount { maxPickupCount: number; minPickupCount: number; } -export interface IEliminationConfig { +export interface IEliminationConfig extends IBaseQuestConfig { levelRange: MinMax; targets: ITarget[]; bodyPartProb: number; @@ -111,6 +113,9 @@ export interface IEliminationConfig { weaponRequirementProb: number; weaponRequirements: IWeaponRequirement[]; } +export interface IBaseQuestConfig { + possibleSkillRewards: string[]; +} export interface ITarget extends IProbabilityObject { data: IBossInfo; } diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/IRepairConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/IRepairConfig.d.ts index 1ae082d..9e23cc4 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/IRepairConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/IRepairConfig.d.ts @@ -9,6 +9,7 @@ export interface IRepairConfig extends IBaseConfig { /** INT gain multiplier per repaired item type */ repairKitIntellectGainMultiplier: IIntellectGainValues; maxIntellectGainPerRepair: IMaxIntellectGainValues; + weaponTreatment: IWeaponTreatmentRepairValues; repairKit: RepairKit; } export interface IIntellectGainValues { @@ -19,6 +20,16 @@ export interface IMaxIntellectGainValues { kit: number; trader: number; } +export interface IWeaponTreatmentRepairValues { + /** The chance to gain more weapon maintenance skill */ + critSuccessChance: number; + critSuccessAmount: number; + /** The chance to gain less weapon maintenance skill */ + critFailureChance: number; + critFailureAmount: number; + /** The multiplier used for calculating weapon maintenance XP */ + pointGainMultiplier: number; +} export interface RepairKit { armor: BonusSettings; weapon: BonusSettings; diff --git a/TypeScript/8OnUpdateHook/types/services/PlayerService.d.ts b/TypeScript/8OnUpdateHook/types/services/PlayerService.d.ts index edf269e..f24e0dc 100644 --- a/TypeScript/8OnUpdateHook/types/services/PlayerService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/PlayerService.d.ts @@ -9,15 +9,6 @@ export declare class PlayerService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, databaseServer: DatabaseServer); - /** - * Dupe of QuestHelper.rewardsSkillPoints() - * Add xp to a player skill - * @param pmcData Player profile - * @param skillName Name of skill to increment - * @param amount Amount of skill points to add to skill - * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code - */ - incrementSkillLevel(pmcData: IPmcData, skillName: string, amount: number, useSkillProgressRateMultipler?: boolean): void; /** * Get level of player * @param pmcData Player profile diff --git a/TypeScript/8OnUpdateHook/types/services/RepairService.d.ts b/TypeScript/8OnUpdateHook/types/services/RepairService.d.ts index b8ffbaa..8f9e7e9 100644 --- a/TypeScript/8OnUpdateHook/types/services/RepairService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/RepairService.d.ts @@ -1,5 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { QuestHelper } from "@spt-aki/helpers/QuestHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { RepairHelper } from "@spt-aki/helpers/RepairHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; @@ -9,6 +9,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { RepairKitsInfo } from "@spt-aki/models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "@spt-aki/models/eft/repair/ITraderRepairActionDataRequest"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { BonusSettings, IRepairConfig } from "@spt-aki/models/spt/config/IRepairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -19,7 +20,7 @@ import { RandomUtil } from "@spt-aki/utils/RandomUtil"; export declare class RepairService { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected questHelper: QuestHelper; + protected profileHelper: ProfileHelper; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; @@ -29,7 +30,7 @@ export declare class RepairService { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id @@ -56,6 +57,12 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + /** + * Return an appromixation of the amount of skill points live would return for the given repairDetails + * @param repairDetails the repair details to calculate skill points for + * @returns the number of skill points to reward the user + */ + protected getWeaponRepairSkillPoints(repairDetails: RepairDetails): number; /** * * @param sessionId Session id @@ -81,6 +88,13 @@ export declare class RepairService { * @returns Multiplier value */ protected getBonusMultiplierValue(skillBonusName: string, pmcData: IPmcData): number; + /** + * Should a repair kit apply total durability loss on repair + * @param pmcData Player profile + * @param applyRandomizeDurabilityLoss Value from repair config + * @returns True if loss should be applied + */ + protected shouldRepairKitApplyDurabilityLoss(pmcData: IPmcData, applyRandomizeDurabilityLoss: boolean): boolean; /** * Update repair kits Resource object if it doesn't exist * @param repairKitDetails Repair kit details from db @@ -112,7 +126,7 @@ export declare class RepairService { * @param itemTemplate Item to check for skill * @returns Skill name */ - protected getItemSkillType(itemTemplate: ITemplateItem): string; + protected getItemSkillType(itemTemplate: ITemplateItem): SkillTypes; /** * Ensure multiplier is between 1 and 0.01 * @param receiveDurabilityMaxPercent Max durabiltiy percent @@ -123,6 +137,7 @@ export declare class RepairService { } export declare class RepairDetails { repairCost?: number; + repairPoints?: number; repairedItem: Item; repairedItemIsArmor: boolean; repairAmount: number; diff --git a/TypeScript/8OnUpdateHook/types/utils/App.d.ts b/TypeScript/8OnUpdateHook/types/utils/App.d.ts index 1839695..64800ce 100644 --- a/TypeScript/8OnUpdateHook/types/utils/App.d.ts +++ b/TypeScript/8OnUpdateHook/types/utils/App.d.ts @@ -1,6 +1,8 @@ import { OnLoad } from "@spt-aki/di/OnLoad"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -8,11 +10,13 @@ export declare class App { protected logger: ILogger; protected timeUtil: TimeUtil; protected localisationService: LocalisationService; + protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/9RouterHooks/types/controllers/GameController.d.ts b/TypeScript/9RouterHooks/types/controllers/GameController.d.ts index 640a8c1..168071d 100644 --- a/TypeScript/9RouterHooks/types/controllers/GameController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/GameController.d.ts @@ -61,6 +61,10 @@ export declare class GameController { * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + /** + * Out of date/incorrectly made trader mods forget this data + */ + protected checkTraderRepairValuesExist(): void; protected addCustomLooseLootPositions(): void; protected adjustLooseLootSpawnProbabilities(): void; protected setHideoutAreasAndCraftsTo40Secs(): void; diff --git a/TypeScript/9RouterHooks/types/controllers/InsuranceController.d.ts b/TypeScript/9RouterHooks/types/controllers/InsuranceController.d.ts index b1e8fe6..0ee30ed 100644 --- a/TypeScript/9RouterHooks/types/controllers/InsuranceController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/InsuranceController.d.ts @@ -8,7 +8,7 @@ import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGet import { IGetInsuranceCostResponseData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostResponseData"; import { IInsureRequestData } from "@spt-aki/models/eft/insurance/IInsureRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; -import { Insurance, ISystemData } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ISystemData, Insurance } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IInsuranceConfig } from "@spt-aki/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; diff --git a/TypeScript/9RouterHooks/types/controllers/RepeatableQuestController.d.ts b/TypeScript/9RouterHooks/types/controllers/RepeatableQuestController.d.ts index b09b540..a3ebc1c 100644 --- a/TypeScript/9RouterHooks/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/RepeatableQuestController.d.ts @@ -13,6 +13,7 @@ import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -21,8 +22,9 @@ import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RepeatableQuestController { - protected timeUtil: TimeUtil; protected logger: ILogger; + protected databaseServer: DatabaseServer; + protected timeUtil: TimeUtil; protected randomUtil: RandomUtil; protected httpResponse: HttpResponseUtil; protected jsonUtil: JsonUtil; @@ -37,7 +39,7 @@ export declare class RepeatableQuestController { protected questHelper: QuestHelper; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); /** * Handle client/repeatalbeQuests/activityPeriods * Returns an array of objects in the format of repeatable quests to the client. @@ -64,6 +66,13 @@ export declare class RepeatableQuestController { * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Get the number of quests to generate - takes into account charisma state of player + * @param repeatableConfig Config + * @param pmcData Player profile + * @returns Quest count + */ + protected getQuestCount(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): number; /** * Get repeatable quest data from profile from name (daily/weekly), creates base repeatable quest object if none exists * @param repeatableConfig daily/weekly config diff --git a/TypeScript/9RouterHooks/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/BotEquipmentModGenerator.d.ts index 05266dd..75530c7 100644 --- a/TypeScript/9RouterHooks/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/BotEquipmentModGenerator.d.ts @@ -179,7 +179,7 @@ export declare class BotEquipmentModGenerator { * Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots. * This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine" * @param items The items where the CylinderMagazine's camora are appended to - * @param modPool modPool which should include available cartrigdes + * @param modPool modPool which should include available cartridges * @param parentId The CylinderMagazine's UID * @param parentTemplate The CylinderMagazine's template */ diff --git a/TypeScript/9RouterHooks/types/generators/BotLootGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/BotLootGenerator.d.ts index e937a4d..7a4c521 100644 --- a/TypeScript/9RouterHooks/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/BotLootGenerator.d.ts @@ -83,7 +83,7 @@ export declare class BotLootGenerator { * @param equipmentSlot slot to place the preset in (backpack) * @param templateInventory bots template, assault.json * @param modChances chances for mods to spawn on weapon - * @param botRole bots role, .e.g. pmcBot + * @param botRole bots role .e.g. pmcBot * @param isPmc are we generating for a pmc */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; @@ -120,16 +120,16 @@ export declare class BotLootGenerator { protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; /** * Randomise the stack size of a money object, uses different values for pmc or scavs - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param moneyItem Money stack to randomise + * @param isPmc Is money on a PMC bot + * @param itemTemplate item details from db + * @param moneyItem Money item to randomise */ protected randomiseMoneyStackSize(isPmc: boolean, itemTemplate: ITemplateItem, moneyItem: Item): void; /** * Randomise the size of an ammo stack - * @param isPmc is this a PMC - * @param itemTemplate item details - * @param ammoItem Ammo stack to randomise + * @param isPmc Is ammo on a PMC bot + * @param itemTemplate item details from db + * @param ammoItem Ammo item to randomise */ protected randomiseAmmoStackSize(isPmc: boolean, itemTemplate: ITemplateItem, ammoItem: Item): void; /** diff --git a/TypeScript/9RouterHooks/types/generators/RepeatableQuestGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/RepeatableQuestGenerator.d.ts index 40a3c16..44c38be 100644 --- a/TypeScript/9RouterHooks/types/generators/RepeatableQuestGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/RepeatableQuestGenerator.d.ts @@ -8,7 +8,7 @@ import { Exit } from "@spt-aki/models/eft/common/ILocationBase"; import { TraderInfo } from "@spt-aki/models/eft/common/tables/IBotBase"; import { ICompletion, ICompletionAvailableFor, IElimination, IEliminationCondition, IExploration, IExplorationCondition, IPickup, IRepeatableQuest, IReward, IRewards } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; -import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; @@ -155,7 +155,7 @@ export declare class RepeatableQuestGenerator { * @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ - protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig): IRewards; + protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IRewards; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config diff --git a/TypeScript/9RouterHooks/types/helpers/HideoutHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/HideoutHelper.d.ts index 93f8fb1..0cfc649 100644 --- a/TypeScript/9RouterHooks/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/HideoutHelper.d.ts @@ -1,7 +1,7 @@ import { InventoryHelper } from "@spt-aki/helpers/InventoryHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { Common, HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { HideoutArea, IHideoutImprovement, Production, Productive } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "@spt-aki/models/eft/hideout/IHideoutContinuousProductionStartRequestData"; @@ -201,22 +201,10 @@ export declare class HideoutHelper { * @returns coin slot count */ protected getBTCSlots(pmcData: IPmcData): number; - /** - * Does profile have elite hideout management skill - * @param pmcData Profile to look at - * @returns True if profile has skill - */ - protected hasEliteHideoutManagementSkill(pmcData: IPmcData): boolean; /** * Get a count of bitcoins player miner can hold */ protected getBitcoinMinerContainerSlotSize(): number; - /** - * Get the hideout management skill from player profile - * @param pmcData Profile to look at - * @returns Hideout management skill object - */ - protected getHideoutManagementSkill(pmcData: IPmcData): Common; /** * HideoutManagement skill gives a consumption bonus the higher the level * 0.5% per level per 1-51, (25.5% at max) diff --git a/TypeScript/9RouterHooks/types/helpers/ItemHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/ItemHelper.d.ts index 47823bc..e1c7720 100644 --- a/TypeScript/9RouterHooks/types/helpers/ItemHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/ItemHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -24,10 +25,11 @@ declare class ItemHelper { protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected itemBaseClassService: ItemBaseClassService; + protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl diff --git a/TypeScript/9RouterHooks/types/helpers/ProfileHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/ProfileHelper.d.ts index 781f980..938c796 100644 --- a/TypeScript/9RouterHooks/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/ProfileHelper.d.ts @@ -1,11 +1,13 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IValidateNicknameRequestData } from "@spt-aki/models/eft/profile/IValidateNicknameRequestData"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; +import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileSnapshotService } from "@spt-aki/services/ProfileSnapshotService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -19,7 +21,8 @@ export declare class ProfileHelper { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected profileSnapshotService: ProfileSnapshotService; - constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); + protected localisationService: LocalisationService; + constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, localisationService: LocalisationService); /** * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id @@ -101,4 +104,21 @@ export declare class ProfileHelper { * @param keyToIncrement Key */ incrementStatCounter(counters: CounterKeyValue[], keyToIncrement: string): void; + /** + * Check if player has a skill at elite level + * @param skillType Skill to check + * @param pmcProfile Profile to find skill in + * @returns True if player has skill at elite level + */ + hasEliteSkillLevel(skillType: SkillTypes, pmcProfile: IPmcData): boolean; + /** + * Add points to a specific skill in player profile + * @param skill Skill to add points to + * @param pointsToAdd Points to add + * @param pmcProfile Player profile with skill + * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code + * @returns + */ + addSkillPointsToPlayer(pmcProfile: IPmcData, skill: SkillTypes, pointsToAdd: number, useSkillProgressRateMultipler?: boolean): void; + getSkillFromProfile(pmcData: IPmcData, skill: SkillTypes): Common; } diff --git a/TypeScript/9RouterHooks/types/helpers/QuestHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/QuestHelper.d.ts index 1e40e53..0dda05b 100644 --- a/TypeScript/9RouterHooks/types/helpers/QuestHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/QuestHelper.d.ts @@ -6,7 +6,7 @@ import { QuestConditionHelper } from "@spt-aki/helpers/QuestConditionHelper"; import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; -import { IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Common, IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "@spt-aki/models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; @@ -66,14 +66,12 @@ export declare class QuestHelper { */ getDeltaQuests(before: IQuest[], after: IQuest[]): IQuest[]; /** - * Increase skill points of a skill on player profile - * Dupe of PlayerService.incrementSkillLevel() - * @param sessionID Session id - * @param pmcData Player profile - * @param skillName Name of skill to increase skill points of - * @param progressAmount Amount of skill points to add to skill + * Adjust skill experience for low skill levels, mimicing the official client + * @param profileSkill the skill experience is being added to + * @param progressAmount the amount of experience being added to the skill + * @returns the adjusted skill progress gain */ - rewardSkillPoints(sessionID: string, pmcData: IPmcData, skillName: string, progressAmount: number): void; + adjustSkillExpForLowLevels(profileSkill: Common, progressAmount: number): number; /** * Get quest name by quest id * @param questId id to get diff --git a/TypeScript/9RouterHooks/types/loaders/PreAkiModLoader.d.ts b/TypeScript/9RouterHooks/types/loaders/PreAkiModLoader.d.ts index 869dfbb..71fd745 100644 --- a/TypeScript/9RouterHooks/types/loaders/PreAkiModLoader.d.ts +++ b/TypeScript/9RouterHooks/types/loaders/PreAkiModLoader.d.ts @@ -29,7 +29,7 @@ export declare class PreAkiModLoader implements IModLoader { protected imported: Record; protected akiConfig: ICoreConfig; protected serverDependencies: Record; - protected skippedMods: string[]; + protected skippedMods: Set; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, bundleLoader: BundleLoader, localisationService: LocalisationService, configServer: ConfigServer, modLoadOrder: ModLoadOrder, modTypeCheck: ModTypeCheck); load(container: DependencyContainer): Promise; /** @@ -44,27 +44,22 @@ export declare class PreAkiModLoader implements IModLoader { 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 + * @param modPackageData map of mod package.json data */ - protected checkForDuplicateMods(modPackageData: Record): void; + protected checkForDuplicateMods(modPackageData: Map): void; /** - * Check for and return duplicate strings inside an array - * @param stringArray Array to check for duplicates - * @returns string array of duplicates, empty if none found - */ - protected getDuplicates(stringArray: string[]): string[]; - /** - * Get an array of mods with errors that prevent them from working with SPT + * Returns an array of valid mods. + * * @param mods mods to validate - * @returns Mod names as array + * @returns array of mod folder names */ - protected getBrokenMods(mods: string[]): string[]; + protected getValidMods(mods: string[]): string[]; /** * Get packageJson data for mods * @param mods mods to get packageJson for - * @returns dictionary + * @returns map */ - protected getModsPackageData(mods: string[]): Record; + protected getModsPackageData(mods: string[]): Map; /** * Is the passed in mod compatible with the running server version * @param mod Mod to check compatibiltiy with AKI @@ -86,10 +81,17 @@ export declare class PreAkiModLoader implements IModLoader { * Compile mod and add into class property "imported" * @param mod Name of mod to compile/add */ - protected addModAsync(mod: string): Promise; + protected addModAsync(mod: string, pkg: IPackageJsonData): Promise; + /** + * Checks if a given mod should be loaded or skipped. + * + * @param pkg mod package.json data + * @returns + */ + protected shouldSkipMod(pkg: IPackageJsonData): boolean; protected autoInstallDependencies(modPath: string, pkg: IPackageJsonData): void; - protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Record): boolean; - protected isModCompatible(mod: IPackageJsonData, loadedMods: Record): boolean; + protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Map): boolean; + protected isModCompatible(mod: IPackageJsonData, loadedMods: Map): boolean; /** * Validate a mod passes a number of checks * @param modName name of mod in /mods/ to validate diff --git a/TypeScript/9RouterHooks/types/models/enums/SkillTypes.d.ts b/TypeScript/9RouterHooks/types/models/enums/SkillTypes.d.ts index 4eb90af..dc059a8 100644 --- a/TypeScript/9RouterHooks/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/9RouterHooks/types/models/enums/SkillTypes.d.ts @@ -1,4 +1,6 @@ export declare enum SkillTypes { + BOT_RELOAD = "BotReload", + BOT_SOUND = "BotSound", HIDEOUT_MANAGEMENT = "HideoutManagement", CRAFTING = "Crafting", METABOLISM = "Metabolism", @@ -19,6 +21,7 @@ export declare enum SkillTypes { ATTENTION = "Attention", CHARISMA = "Charisma", MEMORY = "Memory", + MELEE = "Melee", SURGERY = "Surgery", AIM_DRILLS = "AimDrills", TROUBLESHOOTING = "TroubleShooting", @@ -31,6 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", + /** Also called Weapon Maintenance*/ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts index c76eda7..24c8c19 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts @@ -102,6 +102,8 @@ export interface EquipmentFilters { weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; /** Same as weightingAdjustments but based on player level instead of bot level */ weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; + /** Should the stock mod be forced to spawn on bot */ + forceStock: boolean; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/9RouterHooks/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/IQuestConfig.d.ts index 3e3b2be..8a71eb9 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/IQuestConfig.d.ts @@ -55,6 +55,8 @@ export interface IRewardScaling { items: number[]; reputation: number[]; rewardSpread: number; + skillRewardChance: number[]; + skillPointReward: number[]; } export interface ITraderWhitelist { traderId: string; @@ -66,7 +68,7 @@ export interface IRepeatableQuestTypesConfig { Pickup: IPickup; Elimination: IEliminationConfig[]; } -export interface IExploration { +export interface IExploration extends IBaseQuestConfig { maxExtracts: number; specificExits: ISpecificExits; } @@ -74,7 +76,7 @@ export interface ISpecificExits { probability: number; passageRequirementWhitelist: string[]; } -export interface ICompletion { +export interface ICompletion extends IBaseQuestConfig { minRequestedAmount: number; maxRequestedAmount: number; minRequestedBulletAmount: number; @@ -82,7 +84,7 @@ export interface ICompletion { useWhitelist: boolean; useBlacklist: boolean; } -export interface IPickup { +export interface IPickup extends IBaseQuestConfig { ItemTypeToFetchWithMaxCount: IPickupTypeWithMaxCount[]; } export interface IPickupTypeWithMaxCount { @@ -90,7 +92,7 @@ export interface IPickupTypeWithMaxCount { maxPickupCount: number; minPickupCount: number; } -export interface IEliminationConfig { +export interface IEliminationConfig extends IBaseQuestConfig { levelRange: MinMax; targets: ITarget[]; bodyPartProb: number; @@ -111,6 +113,9 @@ export interface IEliminationConfig { weaponRequirementProb: number; weaponRequirements: IWeaponRequirement[]; } +export interface IBaseQuestConfig { + possibleSkillRewards: string[]; +} export interface ITarget extends IProbabilityObject { data: IBossInfo; } diff --git a/TypeScript/9RouterHooks/types/models/spt/config/IRepairConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/IRepairConfig.d.ts index 1ae082d..9e23cc4 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/IRepairConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/IRepairConfig.d.ts @@ -9,6 +9,7 @@ export interface IRepairConfig extends IBaseConfig { /** INT gain multiplier per repaired item type */ repairKitIntellectGainMultiplier: IIntellectGainValues; maxIntellectGainPerRepair: IMaxIntellectGainValues; + weaponTreatment: IWeaponTreatmentRepairValues; repairKit: RepairKit; } export interface IIntellectGainValues { @@ -19,6 +20,16 @@ export interface IMaxIntellectGainValues { kit: number; trader: number; } +export interface IWeaponTreatmentRepairValues { + /** The chance to gain more weapon maintenance skill */ + critSuccessChance: number; + critSuccessAmount: number; + /** The chance to gain less weapon maintenance skill */ + critFailureChance: number; + critFailureAmount: number; + /** The multiplier used for calculating weapon maintenance XP */ + pointGainMultiplier: number; +} export interface RepairKit { armor: BonusSettings; weapon: BonusSettings; diff --git a/TypeScript/9RouterHooks/types/services/PlayerService.d.ts b/TypeScript/9RouterHooks/types/services/PlayerService.d.ts index edf269e..f24e0dc 100644 --- a/TypeScript/9RouterHooks/types/services/PlayerService.d.ts +++ b/TypeScript/9RouterHooks/types/services/PlayerService.d.ts @@ -9,15 +9,6 @@ export declare class PlayerService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, databaseServer: DatabaseServer); - /** - * Dupe of QuestHelper.rewardsSkillPoints() - * Add xp to a player skill - * @param pmcData Player profile - * @param skillName Name of skill to increment - * @param amount Amount of skill points to add to skill - * @param useSkillProgressRateMultipler Skills are multiplied by a value in globals, default is off to maintain compatibility with legacy code - */ - incrementSkillLevel(pmcData: IPmcData, skillName: string, amount: number, useSkillProgressRateMultipler?: boolean): void; /** * Get level of player * @param pmcData Player profile diff --git a/TypeScript/9RouterHooks/types/services/RepairService.d.ts b/TypeScript/9RouterHooks/types/services/RepairService.d.ts index b8ffbaa..8f9e7e9 100644 --- a/TypeScript/9RouterHooks/types/services/RepairService.d.ts +++ b/TypeScript/9RouterHooks/types/services/RepairService.d.ts @@ -1,5 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { QuestHelper } from "@spt-aki/helpers/QuestHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { RepairHelper } from "@spt-aki/helpers/RepairHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; @@ -9,6 +9,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { RepairKitsInfo } from "@spt-aki/models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "@spt-aki/models/eft/repair/ITraderRepairActionDataRequest"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { BonusSettings, IRepairConfig } from "@spt-aki/models/spt/config/IRepairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -19,7 +20,7 @@ import { RandomUtil } from "@spt-aki/utils/RandomUtil"; export declare class RepairService { protected logger: ILogger; protected databaseServer: DatabaseServer; - protected questHelper: QuestHelper; + protected profileHelper: ProfileHelper; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; @@ -29,7 +30,7 @@ export declare class RepairService { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected repairConfig: IRepairConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, profileHelper: ProfileHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id @@ -56,6 +57,12 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + /** + * Return an appromixation of the amount of skill points live would return for the given repairDetails + * @param repairDetails the repair details to calculate skill points for + * @returns the number of skill points to reward the user + */ + protected getWeaponRepairSkillPoints(repairDetails: RepairDetails): number; /** * * @param sessionId Session id @@ -81,6 +88,13 @@ export declare class RepairService { * @returns Multiplier value */ protected getBonusMultiplierValue(skillBonusName: string, pmcData: IPmcData): number; + /** + * Should a repair kit apply total durability loss on repair + * @param pmcData Player profile + * @param applyRandomizeDurabilityLoss Value from repair config + * @returns True if loss should be applied + */ + protected shouldRepairKitApplyDurabilityLoss(pmcData: IPmcData, applyRandomizeDurabilityLoss: boolean): boolean; /** * Update repair kits Resource object if it doesn't exist * @param repairKitDetails Repair kit details from db @@ -112,7 +126,7 @@ export declare class RepairService { * @param itemTemplate Item to check for skill * @returns Skill name */ - protected getItemSkillType(itemTemplate: ITemplateItem): string; + protected getItemSkillType(itemTemplate: ITemplateItem): SkillTypes; /** * Ensure multiplier is between 1 and 0.01 * @param receiveDurabilityMaxPercent Max durabiltiy percent @@ -123,6 +137,7 @@ export declare class RepairService { } export declare class RepairDetails { repairCost?: number; + repairPoints?: number; repairedItem: Item; repairedItemIsArmor: boolean; repairAmount: number; diff --git a/TypeScript/9RouterHooks/types/utils/App.d.ts b/TypeScript/9RouterHooks/types/utils/App.d.ts index 1839695..64800ce 100644 --- a/TypeScript/9RouterHooks/types/utils/App.d.ts +++ b/TypeScript/9RouterHooks/types/utils/App.d.ts @@ -1,6 +1,8 @@ import { OnLoad } from "@spt-aki/di/OnLoad"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -8,11 +10,13 @@ export declare class App { protected logger: ILogger; protected timeUtil: TimeUtil; protected localisationService: LocalisationService; + protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void;