Update types

This commit is contained in:
Dev 2023-11-10 16:01:14 +00:00
parent 7687be6681
commit 385a4f0c19
378 changed files with 2667 additions and 1512 deletions

View File

@ -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;

View File

@ -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";

View File

@ -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

View File

@ -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
*/

View File

@ -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<string, number>, itemSpawnLimits: Record<string, number>): 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;
/**

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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;
}

View File

@ -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

View File

@ -29,7 +29,7 @@ export declare class PreAkiModLoader implements IModLoader {
protected imported: Record<string, IPackageJsonData>;
protected akiConfig: ICoreConfig;
protected serverDependencies: Record<string, string>;
protected skippedMods: string[];
protected skippedMods: Set<string>;
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, bundleLoader: BundleLoader, localisationService: LocalisationService, configServer: ConfigServer, modLoadOrder: ModLoadOrder, modTypeCheck: ModTypeCheck);
load(container: DependencyContainer): Promise<void>;
/**
@ -44,27 +44,22 @@ export declare class PreAkiModLoader implements IModLoader {
protected sortMods(prev: string, next: string, missingFromOrderJSON: Record<string, boolean>): 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<string, IPackageJsonData>): void;
protected checkForDuplicateMods(modPackageData: Map<string, IPackageJsonData>): 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 <modName - package.json>
* @returns map <modFolderName - package.json>
*/
protected getModsPackageData(mods: string[]): Record<string, IPackageJsonData>;
protected getModsPackageData(mods: string[]): Map<string, IPackageJsonData>;
/**
* 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<void>;
protected addModAsync(mod: string, pkg: IPackageJsonData): Promise<void>;
/**
* 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<string, IPackageJsonData>): boolean;
protected isModCompatible(mod: IPackageJsonData, loadedMods: Record<string, IPackageJsonData>): boolean;
protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Map<string, IPackageJsonData>): boolean;
protected isModCompatible(mod: IPackageJsonData, loadedMods: Map<string, IPackageJsonData>): boolean;
/**
* Validate a mod passes a number of checks
* @param modName name of mod in /mods/ to validate

View File

@ -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",

View File

@ -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 */

View File

@ -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;
}

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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<void>;
protected update(onUpdateComponents: OnUpdate[]): Promise<void>;
protected logUpdateException(err: any, updateable: OnUpdate): void;

View File

@ -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;

View File

@ -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";

View File

@ -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

View File

@ -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
*/

View File

@ -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<string, number>, itemSpawnLimits: Record<string, number>): 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;
/**

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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;
}

View File

@ -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

View File

@ -29,7 +29,7 @@ export declare class PreAkiModLoader implements IModLoader {
protected imported: Record<string, IPackageJsonData>;
protected akiConfig: ICoreConfig;
protected serverDependencies: Record<string, string>;
protected skippedMods: string[];
protected skippedMods: Set<string>;
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, bundleLoader: BundleLoader, localisationService: LocalisationService, configServer: ConfigServer, modLoadOrder: ModLoadOrder, modTypeCheck: ModTypeCheck);
load(container: DependencyContainer): Promise<void>;
/**
@ -44,27 +44,22 @@ export declare class PreAkiModLoader implements IModLoader {
protected sortMods(prev: string, next: string, missingFromOrderJSON: Record<string, boolean>): 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<string, IPackageJsonData>): void;
protected checkForDuplicateMods(modPackageData: Map<string, IPackageJsonData>): 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 <modName - package.json>
* @returns map <modFolderName - package.json>
*/
protected getModsPackageData(mods: string[]): Record<string, IPackageJsonData>;
protected getModsPackageData(mods: string[]): Map<string, IPackageJsonData>;
/**
* 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<void>;
protected addModAsync(mod: string, pkg: IPackageJsonData): Promise<void>;
/**
* 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<string, IPackageJsonData>): boolean;
protected isModCompatible(mod: IPackageJsonData, loadedMods: Record<string, IPackageJsonData>): boolean;
protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Map<string, IPackageJsonData>): boolean;
protected isModCompatible(mod: IPackageJsonData, loadedMods: Map<string, IPackageJsonData>): boolean;
/**
* Validate a mod passes a number of checks
* @param modName name of mod in /mods/ to validate

View File

@ -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",

View File

@ -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 */

View File

@ -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;
}

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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<void>;
protected update(onUpdateComponents: OnUpdate[]): Promise<void>;
protected logUpdateException(err: any, updateable: OnUpdate): void;

View File

@ -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;

View File

@ -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";

View File

@ -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

View File

@ -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
*/

View File

@ -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<string, number>, itemSpawnLimits: Record<string, number>): 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;
/**

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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;
}

View File

@ -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

View File

@ -29,7 +29,7 @@ export declare class PreAkiModLoader implements IModLoader {
protected imported: Record<string, IPackageJsonData>;
protected akiConfig: ICoreConfig;
protected serverDependencies: Record<string, string>;
protected skippedMods: string[];
protected skippedMods: Set<string>;
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, bundleLoader: BundleLoader, localisationService: LocalisationService, configServer: ConfigServer, modLoadOrder: ModLoadOrder, modTypeCheck: ModTypeCheck);
load(container: DependencyContainer): Promise<void>;
/**
@ -44,27 +44,22 @@ export declare class PreAkiModLoader implements IModLoader {
protected sortMods(prev: string, next: string, missingFromOrderJSON: Record<string, boolean>): 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<string, IPackageJsonData>): void;
protected checkForDuplicateMods(modPackageData: Map<string, IPackageJsonData>): 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 <modName - package.json>
* @returns map <modFolderName - package.json>
*/
protected getModsPackageData(mods: string[]): Record<string, IPackageJsonData>;
protected getModsPackageData(mods: string[]): Map<string, IPackageJsonData>;
/**
* 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<void>;
protected addModAsync(mod: string, pkg: IPackageJsonData): Promise<void>;
/**
* 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<string, IPackageJsonData>): boolean;
protected isModCompatible(mod: IPackageJsonData, loadedMods: Record<string, IPackageJsonData>): boolean;
protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Map<string, IPackageJsonData>): boolean;
protected isModCompatible(mod: IPackageJsonData, loadedMods: Map<string, IPackageJsonData>): boolean;
/**
* Validate a mod passes a number of checks
* @param modName name of mod in /mods/ to validate

View File

@ -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",

View File

@ -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 */

View File

@ -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;
}

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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<void>;
protected update(onUpdateComponents: OnUpdate[]): Promise<void>;
protected logUpdateException(err: any, updateable: OnUpdate): void;

View File

@ -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;

View File

@ -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";

View File

@ -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

View File

@ -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
*/

View File

@ -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<string, number>, itemSpawnLimits: Record<string, number>): 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;
/**

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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;
}

View File

@ -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

View File

@ -29,7 +29,7 @@ export declare class PreAkiModLoader implements IModLoader {
protected imported: Record<string, IPackageJsonData>;
protected akiConfig: ICoreConfig;
protected serverDependencies: Record<string, string>;
protected skippedMods: string[];
protected skippedMods: Set<string>;
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, bundleLoader: BundleLoader, localisationService: LocalisationService, configServer: ConfigServer, modLoadOrder: ModLoadOrder, modTypeCheck: ModTypeCheck);
load(container: DependencyContainer): Promise<void>;
/**
@ -44,27 +44,22 @@ export declare class PreAkiModLoader implements IModLoader {
protected sortMods(prev: string, next: string, missingFromOrderJSON: Record<string, boolean>): 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<string, IPackageJsonData>): void;
protected checkForDuplicateMods(modPackageData: Map<string, IPackageJsonData>): 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 <modName - package.json>
* @returns map <modFolderName - package.json>
*/
protected getModsPackageData(mods: string[]): Record<string, IPackageJsonData>;
protected getModsPackageData(mods: string[]): Map<string, IPackageJsonData>;
/**
* 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<void>;
protected addModAsync(mod: string, pkg: IPackageJsonData): Promise<void>;
/**
* 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<string, IPackageJsonData>): boolean;
protected isModCompatible(mod: IPackageJsonData, loadedMods: Record<string, IPackageJsonData>): boolean;
protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Map<string, IPackageJsonData>): boolean;
protected isModCompatible(mod: IPackageJsonData, loadedMods: Map<string, IPackageJsonData>): boolean;
/**
* Validate a mod passes a number of checks
* @param modName name of mod in /mods/ to validate

View File

@ -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",

View File

@ -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 */

View File

@ -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;
}

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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<void>;
protected update(onUpdateComponents: OnUpdate[]): Promise<void>;
protected logUpdateException(err: any, updateable: OnUpdate): void;

View File

@ -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;

View File

@ -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";

View File

@ -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

View File

@ -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
*/

View File

@ -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<string, number>, itemSpawnLimits: Record<string, number>): 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;
/**

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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;
}

View File

@ -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

View File

@ -29,7 +29,7 @@ export declare class PreAkiModLoader implements IModLoader {
protected imported: Record<string, IPackageJsonData>;
protected akiConfig: ICoreConfig;
protected serverDependencies: Record<string, string>;
protected skippedMods: string[];
protected skippedMods: Set<string>;
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, bundleLoader: BundleLoader, localisationService: LocalisationService, configServer: ConfigServer, modLoadOrder: ModLoadOrder, modTypeCheck: ModTypeCheck);
load(container: DependencyContainer): Promise<void>;
/**
@ -44,27 +44,22 @@ export declare class PreAkiModLoader implements IModLoader {
protected sortMods(prev: string, next: string, missingFromOrderJSON: Record<string, boolean>): 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<string, IPackageJsonData>): void;
protected checkForDuplicateMods(modPackageData: Map<string, IPackageJsonData>): 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 <modName - package.json>
* @returns map <modFolderName - package.json>
*/
protected getModsPackageData(mods: string[]): Record<string, IPackageJsonData>;
protected getModsPackageData(mods: string[]): Map<string, IPackageJsonData>;
/**
* 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<void>;
protected addModAsync(mod: string, pkg: IPackageJsonData): Promise<void>;
/**
* 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<string, IPackageJsonData>): boolean;
protected isModCompatible(mod: IPackageJsonData, loadedMods: Record<string, IPackageJsonData>): boolean;
protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Map<string, IPackageJsonData>): boolean;
protected isModCompatible(mod: IPackageJsonData, loadedMods: Map<string, IPackageJsonData>): boolean;
/**
* Validate a mod passes a number of checks
* @param modName name of mod in /mods/ to validate

View File

@ -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",

View File

@ -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 */

View File

@ -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;
}

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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<void>;
protected update(onUpdateComponents: OnUpdate[]): Promise<void>;
protected logUpdateException(err: any, updateable: OnUpdate): void;

View File

@ -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;

View File

@ -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";

View File

@ -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

View File

@ -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
*/

View File

@ -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<string, number>, itemSpawnLimits: Record<string, number>): 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;
/**

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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;
}

View File

@ -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

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