Initial changes for 3.6.0

This commit is contained in:
Dev 2023-07-14 12:31:38 +01:00
parent 561e30f57c
commit c4cfcdc367
25 changed files with 142 additions and 42 deletions

View File

@ -47,6 +47,8 @@ export declare class GameController {
protected locationConfig: ILocationConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, applicationContext: ApplicationContext, configServer: ConfigServer);
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void;
/** Check for any missing assorts inside each traders assort.json data, checking against traders qeustassort.json */
protected validateQuestAssortUnlocksExist(): void;
/**
* BSG have two values for shotgun dispersion, we make sure both have the same value
*/

View File

@ -4,6 +4,7 @@ import { ItemHelper } from "../helpers/ItemHelper";
import { PaymentHelper } from "../helpers/PaymentHelper";
import { PresetHelper } from "../helpers/PresetHelper";
import { ProfileHelper } from "../helpers/ProfileHelper";
import { QuestHelper } from "../helpers/QuestHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { IAddItemRequestData } from "../models/eft/inventory/IAddItemRequestData";
import { IInventoryBindRequestData } from "../models/eft/inventory/IInventoryBindRequestData";
@ -44,6 +45,7 @@ export declare class InventoryController {
protected fenceService: FenceService;
protected presetHelper: PresetHelper;
protected inventoryHelper: InventoryHelper;
protected questHelper: QuestHelper;
protected ragfairOfferService: RagfairOfferService;
protected profileHelper: ProfileHelper;
protected paymentHelper: PaymentHelper;
@ -51,7 +53,7 @@ export declare class InventoryController {
protected lootGenerator: LootGenerator;
protected eventOutputHolder: EventOutputHolder;
protected httpResponseUtil: HttpResponseUtil;
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil);
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil);
/**
* Move Item
* change location of item with parentId and slotId

View File

@ -3,9 +3,9 @@ import { LootGenerator } from "../generators/LootGenerator";
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { ILocationBase } from "../models/eft/common/ILocationBase";
import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSourceDestinationBase";
import { IAirdropLootResult } from "../models/eft/location/IAirdropLootResult";
import { AirdropTypeEnum } from "../models/enums/AirdropType";
import { IAirdropConfig } from "../models/spt/config/IAirdropConfig";
import { LootItem } from "../models/spt/services/LootItem";
import { LootRequest } from "../models/spt/services/LootRequest";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
@ -39,7 +39,7 @@ export declare class LocationController {
* Generates it randomly based on config/airdrop.json values
* @returns Array of LootItem objects
*/
getAirdropLoot(): LootItem[];
getAirdropLoot(): IAirdropLootResult;
/**
* Randomly pick a type of airdrop loot using weighted values from config
* @returns airdrop type value

View File

@ -19,6 +19,7 @@ import { DatabaseServer } from "../servers/DatabaseServer";
import { LocaleService } from "../services/LocaleService";
import { LocalisationService } from "../services/LocalisationService";
import { PlayerService } from "../services/PlayerService";
import { SeasonalEventService } from "../services/SeasonalEventService";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { TimeUtil } from "../utils/TimeUtil";
export declare class QuestController {
@ -34,10 +35,11 @@ export declare class QuestController {
protected questConditionHelper: QuestConditionHelper;
protected playerService: PlayerService;
protected localeService: LocaleService;
protected seasonalEventService: SeasonalEventService;
protected localisationService: LocalisationService;
protected configServer: ConfigServer;
protected questConfig: IQuestConfig;
constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, localisationService: LocalisationService, configServer: ConfigServer);
constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer);
/**
* Get all quests visible to player
* Exclude quests with incomplete preconditions (level/loyalty)
@ -45,6 +47,19 @@ export declare class QuestController {
* @returns array of IQuest
*/
getClientQuests(sessionID: string): IQuest[];
/**
* Does a provided quest have a level requirement equal to or below defined level
* @param quest Quest to check
* @param playerLevel level of player to test against quest
* @returns true if quest can be seen/accepted by player of defined level
*/
protected playerLevelFulfillsQuestRequrement(quest: IQuest, playerLevel: number): boolean;
/**
* Should a quest be shown to the player in trader quest screen
* @param questId Quest to check
* @returns true = show to player
*/
protected showEventQuestToPlayer(questId: string): boolean;
/**
* Is the quest for the opposite side the player is on
* @param playerSide Player side (usec/bear)

View File

@ -14,12 +14,12 @@ export declare class AssortHelper {
protected questHelper: QuestHelper;
constructor(logger: ILogger, itemHelper: ItemHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, questHelper: QuestHelper);
/**
* Remove assorts from a trader that have not been unlocked yet
* @param pmcProfile player profile
* @param traderId traders id the assort belongs to
* Remove assorts from a trader that have not been unlocked yet (via player completing corrisponding quest)
* @param pmcProfile Player profile
* @param traderId Traders id the assort belongs to
* @param traderAssorts All assort items from same trader
* @param mergedQuestAssorts Dict of quest assort to quest id unlocks for all traders
* @returns assort items minus locked quest assorts
* @param mergedQuestAssorts Dict of quest assort to quest id unlocks for all traders (key = started/failed/complete)
* @returns Assort items minus locked quest assorts
*/
stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, traderAssorts: ITraderAssort, mergedQuestAssorts: Record<string, Record<string, string>>, flea?: boolean): ITraderAssort;
/**

View File

@ -189,16 +189,16 @@ export declare class HideoutHelper {
* @returns coin slot count
*/
protected getBTCSlots(pmcData: IPmcData): number;
/**
* Get a count of bitcoins player miner can hold
*/
protected getManagementSkillsSlots(): 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
@ -206,12 +206,6 @@ export declare class HideoutHelper {
*/
protected getHideoutManagementSkill(pmcData: IPmcData): Common;
protected getHideoutManagementConsumptionBonus(pmcData: IPmcData): number;
/**
* Get the crafting skill details from player profile
* @param pmcData Player profile
* @returns crafting skill, null if not found
*/
protected getCraftingSkill(pmcData: IPmcData): Common;
/**
* Adjust craft time based on crafting skill level found in player profile
* @param pmcData Player profile

View File

@ -186,14 +186,14 @@ declare class ItemHelper {
*/
findBarterItems(by: "tpl" | "id", pmcData: IPmcData, barterItemId: string): Item[];
/**
*
* @param pmcData
* @param items
* Regenerate all guids with new ids, exceptions are for items that cannot be altered (e.g. stash/sorting table)
* @param pmcData Player profile
* @param items Items to adjust ID values of
* @param insuredItems insured items to not replace ids for
* @param fastPanel
* @returns
* @returns Item[]
*/
replaceIDs(pmcData: IPmcData, items: Item[], insuredItems?: InsuredItem[], fastPanel?: any): any[];
replaceIDs(pmcData: IPmcData, items: Item[], insuredItems?: InsuredItem[], fastPanel?: any): Item[];
/**
* WARNING, SLOW. Recursively loop down through an items hierarchy to see if any of the ids match the supplied list, return true if any do
* @param {string} tpl Items tpl to check parents of

View File

@ -63,6 +63,7 @@ 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

View File

@ -1,10 +1,10 @@
import { IPmcData } from "../models/eft/common/IPmcData";
import { Item } from "../models/eft/common/tables/IItem";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
import { RagfairPriceService } from "../services/RagfairPriceService";
import { ItemHelper } from "./ItemHelper";
import { ILogger } from "../models/spt/utils/ILogger";
export declare class RagfairTaxHelper {
protected logger: ILogger;
protected databaseServer: DatabaseServer;

View File

@ -3,6 +3,7 @@ export interface IGlobals {
time: number;
config: Config;
bot_presets: BotPreset[];
AudioSettings: IAudioSettings;
BotWeaponScatterings: BotWeaponScattering[];
ItemPresets: Record<string, Preset>;
}
@ -1299,6 +1300,20 @@ export interface BotPreset {
FIRST_CONTACT_ADD_SEC: number;
COEF_IF_MOVE: number;
}
export interface IAudioSettings {
AudioGroupPresets: IAudioGroupPreset[];
}
export interface IAudioGroupPreset {
AngleToAllowBinaural: number;
DisabledBinauralByDistance: boolean;
DistanceToAllowBinaural: number;
GroupType: number;
HeightToAllowBinaural: number;
Name: string;
OcclusionEnabled: boolean;
OcclusionIntensity: number;
OverallVolume: number;
}
export interface BotWeaponScattering {
Name: string;
PriorityScatter1meter: number;

View File

@ -40,6 +40,7 @@ export interface Info {
Nickname: string;
LowerNickname: string;
Side: string;
SquadInviteRestriction: boolean;
Voice: string;
Level: number;
Experience: number;

View File

@ -36,6 +36,7 @@ export interface Props {
IsUnremovable?: boolean;
IsLockedafterEquip?: boolean;
IsSpecialSlotOnly?: boolean;
IsStationaryWeapon?: boolean;
QuestItem?: boolean;
QuestStashMaxCount?: number;
LootExperience?: number;
@ -257,6 +258,7 @@ export interface Props {
CutoffFreq?: number;
Resonance?: number;
RolloffMultiplier?: number;
ReverbVolume: number;
CompressorVolume?: number;
AmbientVolume?: number;
DryVolume?: number;

View File

@ -1,4 +1,5 @@
export interface IAddItemRequestData {
/** Trader id */
tid: string;
items: AddItem[];
}

View File

@ -0,0 +1,5 @@
import { LootItem } from "../../../models/spt/services/LootItem";
export interface IAirdropLootResult {
dropType: string;
loot: LootItem[];
}

View File

@ -0,0 +1,5 @@
export declare enum SeasonalEventType {
NONE = "None",
CHRISTMAS = "Christmas",
HALLOWEEN = "Halloween"
}

View File

@ -30,5 +30,6 @@ export declare enum WildSpawnTypeNumber {
FOLLOWERBIRDEYE = 28,
BOSSZRYACHIY = 29,
FOLLOWERZRYACHIY = 30,
ARENAFIGHTEREVENT = 31
ARENAFIGHTER = 31,
ARENAFIGHTEREVENT = 32
}

View File

@ -10,6 +10,7 @@ export interface IAirdropConfig extends IBaseConfig {
planeVolume: number;
planeSpeed: number;
crateFallSpeed: number;
containerIds: Record<string, string>;
airdropMinStartTimeSeconds: number;
airdropMaxStartTimeSeconds: number;
loot: Record<string, AirdropLoot>;

View File

@ -4,4 +4,5 @@ export interface IHideoutConfig extends IBaseConfig {
runIntervalSeconds: number;
hoursForSkillCrafting: number;
hideoutWallAppearTimeSeconds: number;
expCraftAmount: number;
}

View File

@ -1,7 +1,15 @@
import { MemberCategory } from "../../../models/enums/MemberCategory";
import { MinMax } from "../../common/MinMax";
export interface IPmcConfig {
/** What game version should the PMC have */
gameVersionWeight: Record<string, number>;
/** What account type should the PMC have */
accountTypeWeight: Record<MemberCategory, number>;
/** Global whitelist/blacklist of vest loot for PMCs */
vestLoot: SlotLootSettings;
/** Global whitelist/blacklist of pocket loot for PMCs */
pocketLoot: SlotLootSettings;
/** Global whitelist/blacklist of backpack loot for PMCs */
backpackLoot: SlotLootSettings;
dynamicLoot: DynamicLoot;
useDifficultyOverride: boolean;

View File

@ -1,10 +1,14 @@
import { MinMax } from "../../../models/common/MinMax";
import { SeasonalEventType } from "../../../models/enums/SeasonalEventType";
import { ELocationName } from "../../enums/ELocationName";
import { IBaseConfig } from "./IBaseConfig";
export interface IQuestConfig extends IBaseConfig {
kind: "aki-quest";
redeemTime: number;
questTemplateIds: IPlayerTypeQuestIds;
/** Show non-seasonal quests be shown to player */
showNonSeasonalEventQuests: boolean;
eventQuests: Record<string, IEventQuestData>;
repeatableQuests: IRepeatableQuestConfig[];
locationIdMap: Record<string, string>;
bearOnlyQuests: string[];
@ -19,6 +23,13 @@ export interface IQuestTypeIds {
Completion: string;
Exploration: string;
}
export interface IEventQuestData {
name: string;
season: SeasonalEventType;
startTimestamp: number;
endTimestamp: number;
yearly: boolean;
}
export interface IRepeatableQuestConfig {
name: string;
side: string;

View File

@ -1,3 +1,4 @@
import { SeasonalEventType } from "../../../models/enums/SeasonalEventType";
import { IBaseConfig } from "./IBaseConfig";
export interface ISeasonalEventConfig extends IBaseConfig {
kind: "aki-seasonalevents";
@ -9,6 +10,7 @@ export interface ISeasonalEventConfig extends IBaseConfig {
}
export interface ISeasonalEvent {
name: string;
type: SeasonalEventType;
startDay: number;
startMonth: number;
endDay: number;

View File

@ -27,6 +27,7 @@ export interface Config {
TurnOffLogging: boolean;
WeaponOverlapDistanceCulling: number;
WebDiagnosticsEnabled: boolean;
NetworkStateView: INetworkStateView;
}
export interface FramerateLimit {
MaxFramerateGameLimit: number;
@ -46,3 +47,7 @@ export interface ReleaseProfiler {
MaxRecords: number;
RecordTriggerValue: number;
}
export interface INetworkStateView {
LossThreshold: number;
RttThreshold: number;
}

View File

@ -1,22 +1,27 @@
import { IPmcData } from "../models/eft/common/IPmcData";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
import { TimeUtil } from "../utils/TimeUtil";
import { LocalisationService } from "./LocalisationService";
export declare class PlayerService {
protected logger: ILogger;
protected timeUtil: TimeUtil;
protected localisationService: LocalisationService;
protected databaseServer: DatabaseServer;
constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer);
constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, databaseServer: DatabaseServer);
/**
* increases the profile skill and updates any output
* @param {Object} pmcData
* @param {String} skillName
* @param {Number} amount
* 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): void;
incrementSkillLevel(pmcData: IPmcData, skillName: string, amount: number, useSkillProgressRateMultipler?: boolean): void;
/**
* @param {Object} pmcData
* @returns number
* Get level of player
* @param pmcData Player profile
* @returns Level of player
*/
calculateLevel(pmcData: IPmcData): number;
}

View File

@ -1,20 +1,26 @@
import { BotHelper } from "../helpers/BotHelper";
import { Config } from "../models/eft/common/IGlobals";
import { Inventory } from "../models/eft/common/tables/IBotType";
import { SeasonalEventType } from "../models/enums/SeasonalEventType";
import { IHttpConfig } from "../models/spt/config/IHttpConfig";
import { IQuestConfig } from "../models/spt/config/IQuestConfig";
import { ISeasonalEvent, ISeasonalEventConfig } from "../models/spt/config/ISeasonalEventConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { DatabaseImporter } from "../utils/DatabaseImporter";
import { LocalisationService } from "./LocalisationService";
export declare class SeasonalEventService {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
protected databaseImporter: DatabaseImporter;
protected localisationService: LocalisationService;
protected botHelper: BotHelper;
protected configServer: ConfigServer;
protected seasonalEventConfig: ISeasonalEventConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer);
protected get events(): Record<string, string>;
protected questConfig: IQuestConfig;
protected httpConfig: IHttpConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, databaseImporter: DatabaseImporter, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer);
protected get christmasEventItems(): string[];
protected get halloweenEventItems(): string[];
/**
@ -52,12 +58,12 @@ export declare class SeasonalEventService {
*/
seasonalEventEnabled(): boolean;
/**
* is christmas event active
* Is christmas event active (Globals eventtype array contains even name)
* @returns true if active
*/
christmasEventEnabled(): boolean;
/**
* is christmas event active
* is halloween event active (Globals eventtype array contains even name)
* @returns true if active
*/
halloweenEventEnabled(): boolean;
@ -71,12 +77,19 @@ export declare class SeasonalEventService {
* @param eventName Name of event to get gear changes for
* @returns bots with equipment changes
*/
protected getEventBotGear(eventName: string): Record<string, Record<string, Record<string, number>>>;
protected getEventBotGear(eventType: SeasonalEventType): Record<string, Record<string, Record<string, number>>>;
/**
* Get the dates each seasonal event starts and ends at
* @returns Record with event name + start/end date
*/
getEventDetails(): ISeasonalEvent[];
/**
* Look up quest in configs/quest.json
* @param questId Quest to look up
* @param event event type (Christmas/Halloween/None)
* @returns true if related
*/
isQuestRelatedToEvent(questId: string, event: SeasonalEventType): boolean;
/**
* Check if current date falls inside any of the seasons events pased in, if so, handle them
*/
@ -92,7 +105,12 @@ export declare class SeasonalEventService {
* @param globalConfig globals.json
* @param eventName Name of the event to enable. e.g. Christmas
*/
protected updateGlobalEvents(globalConfig: Config, eventName: string): void;
protected updateGlobalEvents(globalConfig: Config, eventType: SeasonalEventType): void;
/**
* Change trader icons to be more event themed (Halloween only so far)
* @param eventType What event is active
*/
protected adjustTraderIcons(eventType: SeasonalEventType): void;
/**
* Add lootble items from backpack into patrol.ITEMS_TO_DROP difficulty property
*/
@ -101,7 +119,7 @@ export declare class SeasonalEventService {
* Read in data from seasonalEvents.json and add found equipment items to bots
* @param eventName Name of the event to read equipment in from config
*/
protected addEventGearToBots(eventName: string): void;
protected addEventGearToBots(eventType: SeasonalEventType): void;
protected addPumpkinsToScavBackpacks(): void;
/**
* Set Khorovod(dancing tree) chance to 100% on all maps that support it

View File

@ -26,6 +26,11 @@ export declare class DatabaseImporter implements OnLoad {
private filepath;
protected httpConfig: IHttpConfig;
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, localisationService: LocalisationService, databaseServer: DatabaseServer, imageRouter: ImageRouter, encodingUtil: EncodingUtil, hashUtil: HashUtil, importerUtil: ImporterUtil, configServer: ConfigServer);
/**
* Get path to aki data
* @returns path to data
*/
getSptDataPath(): string;
onLoad(): Promise<void>;
/**
* Read all json files in database folder and map into a json object
@ -39,7 +44,7 @@ export declare class DatabaseImporter implements OnLoad {
* Find and map files with image router inside a designated path
* @param filepath Path to find files in
*/
loadImages(filepath: string, routes: string[]): void;
loadImages(filepath: string, directories: string[], routes: string[]): void;
/**
* Check for a path override in the http json config file
* @param imagePath Key