diff --git a/TypeScript/10ScopesAndTypes/package.json b/TypeScript/10ScopesAndTypes/package.json index f582ee5..1731a9b 100644 --- a/TypeScript/10ScopesAndTypes/package.json +++ b/TypeScript/10ScopesAndTypes/package.json @@ -4,7 +4,7 @@ "main": "src/mod.js", "license": "MIT", "author": "Chomp", - "akiVersion": "~3.6", + "akiVersion": "~3.7", "scripts": { "setup": "npm i", "build": "node ./packageBuild.ts" diff --git a/TypeScript/10ScopesAndTypes/types/controllers/BotController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/BotController.d.ts index d8f8331..c343f95 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/BotController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/BotController.d.ts @@ -72,5 +72,5 @@ export declare class BotController { * @returns cap number */ getBotCap(): number; - getPmcBotTypes(): Record>>; + getAiBotBrainTypes(): any; } diff --git a/TypeScript/10ScopesAndTypes/types/controllers/HideoutController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/HideoutController.d.ts index 19d341d..877c076 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/HideoutController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/HideoutController.d.ts @@ -207,7 +207,7 @@ export declare class HideoutController { */ protected handleRecipe(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; /** - * Handles giving rewards stored in player profile to player after clicking 'get rewards' + * Handles generating case rewards and sending to player inventory * @param sessionID Session id * @param pmcData Player profile * @param request Get rewards from scavcase craft request diff --git a/TypeScript/10ScopesAndTypes/types/controllers/QuestController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/QuestController.d.ts index 3e8b7dd..7d494a6 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/QuestController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/QuestController.d.ts @@ -5,6 +5,7 @@ import { QuestConditionHelper } from "../helpers/QuestConditionHelper"; import { QuestHelper } from "../helpers/QuestHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { IQuestStatus } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; @@ -23,10 +24,12 @@ import { MailSendService } from "../services/MailSendService"; import { PlayerService } from "../services/PlayerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class QuestController { protected logger: ILogger; protected timeUtil: TimeUtil; + protected jsonUtil: JsonUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; @@ -43,7 +46,7 @@ export declare class QuestController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, jsonUtil: JsonUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Handle client/quest/list * Get all quests visible to player @@ -110,6 +113,13 @@ export declare class QuestController { * @returns ItemEvent client response */ completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Return quests that have different statuses + * @param preQuestStatusus Quests before + * @param postQuestStatuses Quests after + * @returns QuestStatusChange array + */ + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; /** * Send a popup to player on successful completion of a quest * @param sessionID session id @@ -137,8 +147,9 @@ export declare class QuestController { * @param sessionID session id * @param pmcData player profile * @param questsToFail quests to fail + * @param output Client output */ - protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void; + protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[], output: IItemEventRouterResponse): void; /** * Handle QuestHandover event * @param pmcData Player profile diff --git a/TypeScript/10ScopesAndTypes/types/helpers/InRaidHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/InRaidHelper.d.ts index a0987bc..bf584c2 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/InRaidHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; -import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; +import { IQuestStatus, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; @@ -72,7 +72,7 @@ export declare class InRaidHelper { * @param preRaidQuests Quests prior to starting raid * @param postRaidQuests Quest after raid */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: Quest[], postRaidQuests: Quest[]): void; + protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidQuests: IQuestStatus[]): void; protected resetSkillPointsEarnedDuringRaid(profile: IPmcData): void; /** * Take body part effects from client profile and apply to server profile diff --git a/TypeScript/10ScopesAndTypes/types/helpers/ProfileHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/ProfileHelper.d.ts index a2fb099..3c33ae7 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/ProfileHelper.d.ts @@ -21,11 +21,11 @@ export declare class ProfileHelper { protected profileSnapshotService: ProfileSnapshotService; constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); /** - * Remove/reset started quest condtions in player profile + * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id - * @param conditionIds Condition ids that need to be reset/removed + * @param questConditionId Quest with condition to remove */ - resetProfileQuestCondition(sessionID: string, conditionIds: string[]): void; + removeCompletedQuestConditionFromProfile(pmcData: IPmcData, questConditionId: Record): void; /** * Get all profiles from server * @returns Dictionary of profiles diff --git a/TypeScript/10ScopesAndTypes/types/helpers/QuestConditionHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/QuestConditionHelper.d.ts index 90ee560..a84bc81 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/QuestConditionHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/QuestConditionHelper.d.ts @@ -3,5 +3,6 @@ export declare class QuestConditionHelper { getQuestConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLevelConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLoyaltyConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; + getStandingConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; protected filterConditions(q: AvailableForConditions[], questType: string, furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; } diff --git a/TypeScript/10ScopesAndTypes/types/helpers/QuestHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/QuestHelper.d.ts index d89efeb..e04b6e0 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/QuestHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/QuestHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; -import { Quest } from "../models/eft/common/tables/IBotBase"; +import { IQuestStatus } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; @@ -84,7 +84,15 @@ export declare class QuestHelper { * @param profile Player profile * @returns true if loyalty is high enough to fulfill quest requirement */ + traderLoyaltyLevelRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; + /** + * Check if trader has sufficient standing to fulfill quest requirement + * @param questProperties Quest props + * @param profile Player profile + * @returns true if standing is high enough to fulfill quest requirement + */ traderStandingRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; + protected compareAvailableForValues(current: number, required: number, compareMethod: string): boolean; /** * take reward item from quest and set FiR status + fix stack sizes + fix mod Ids * @param reward Reward item to fix @@ -104,7 +112,7 @@ export declare class QuestHelper { * @param newState State the new quest should be in when returned * @param acceptedQuest Details of accepted quest from client */ - getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): Quest; + getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): IQuestStatus; /** * Get quests that can be shown to player after starting a quest * @param startedQuestId Quest started by player @@ -161,9 +169,10 @@ export declare class QuestHelper { * @param pmcData Player profile * @param failRequest Fail quest request data * @param sessionID Session id + * @param output Client output * @returns Item event router response */ - failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string): IItemEventRouterResponse; + failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; /** * Get List of All Quests from db * NOT CLONED @@ -224,11 +233,12 @@ export declare class QuestHelper { */ protected getIntelCenterRewardBonus(pmcData: IPmcData): number; /** - * Find quest with 'findItem' requirement that needs the item tpl be handed in + * Find quest with 'findItem' condition that needs the item tpl be handed in * @param itemTpl item tpl to look for - * @returns 'FindItem' condition id + * @param questIds Quests to search through for the findItem condition + * @returns quest id with 'FindItem' condition id */ - getFindItemIdForQuestHandIn(itemTpl: string): string[]; + getFindItemConditionByQuestItem(itemTpl: string, questIds: string[], allQuests: IQuest[]): Record; /** * Add all quests to a profile with the provided statuses * @param pmcProfile profile to update diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IBotBase.d.ts index 29fd630..ee40958 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IBotBase.d.ts @@ -21,7 +21,7 @@ export interface IBotBase { BackendCounters: Record; InsuredItems: InsuredItem[]; Hideout: Hideout; - Quests: Quest[]; + Quests: IQuestStatus[]; TradersInfo: Record; UnlockedInfo: IUnlockedInfo; RagfairInfo: RagfairInfo; @@ -355,7 +355,7 @@ export declare enum SurvivorClass { PARAMEDIC = 3, SURVIVOR = 4 } -export interface Quest { +export interface IQuestStatus { qid: string; startTime: number; status: QuestStatus; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IQuest.d.ts index c6005ca..300a027 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IQuest.d.ts @@ -32,6 +32,8 @@ export interface IQuest { changeQuestMessageText: string; /** "Pmc" or "Scav" */ side: string; + /** Status of quest to player */ + sptStatus?: QuestStatus; } export interface Conditions { Started: AvailableForConditions[]; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index fd7801e..8591294 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,6 +1,5 @@ import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; -import { QuestStatus } from "../../../models/enums/QuestStatus"; -import { Health, Productive, Skills, TraderData } from "../common/tables/IBotBase"; +import { Health, IQuestStatus, Productive, Skills, TraderData } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; import { IQuest } from "../common/tables/IQuest"; import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests"; @@ -33,20 +32,12 @@ export interface ProfileChange { repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; changedHideoutStashes?: Record; - questsStatus: QuestStatusChange[]; + questsStatus: IQuestStatus[]; } export interface IHideoutStashItem { Id: string; Tpl: string; } -export interface QuestStatusChange { - qid: string; - startTime: number; - status: QuestStatus; - statusTimers: Record; - completedConditions: string[]; - availableAfter: number; -} export interface IWeaponBuildChange { id: string; name: string; diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts index b5a406b..65aaa97 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts @@ -23,6 +23,8 @@ export interface IBotConfig extends IBaseConfig { equipment: Record; /** Show a bots botType value after their name */ showTypeInNickname: boolean; + /** What ai brain should a normal scav use per map */ + assaultBrainType: Record>; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; /** Chance scav has fake pscav name e.g. Scav name (player name) */ diff --git a/TypeScript/10ScopesAndTypes/types/services/ProfileFixerService.d.ts b/TypeScript/10ScopesAndTypes/types/services/ProfileFixerService.d.ts index e066e56..c8232fc 100644 --- a/TypeScript/10ScopesAndTypes/types/services/ProfileFixerService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/ProfileFixerService.d.ts @@ -1,6 +1,7 @@ import { HideoutHelper } from "../helpers/HideoutHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; @@ -22,6 +23,7 @@ export declare class ProfileFixerService { protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; + protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected timeUtil: TimeUtil; @@ -29,7 +31,7 @@ export declare class ProfileFixerService { protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix diff --git a/TypeScript/11BundleLoadingSample/package.json b/TypeScript/11BundleLoadingSample/package.json index 457ca01..4a3a26f 100644 --- a/TypeScript/11BundleLoadingSample/package.json +++ b/TypeScript/11BundleLoadingSample/package.json @@ -5,7 +5,7 @@ "license": "MIT", "main": "src/mod.js", "isBundleMod": true, - "akiVersion": "~3.6", + "akiVersion": "~3.7", "scripts": { "setup": "npm i", "build": "node ./packageBuild.ts" diff --git a/TypeScript/11BundleLoadingSample/types/controllers/BotController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/BotController.d.ts index d8f8331..c343f95 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/BotController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/BotController.d.ts @@ -72,5 +72,5 @@ export declare class BotController { * @returns cap number */ getBotCap(): number; - getPmcBotTypes(): Record>>; + getAiBotBrainTypes(): any; } diff --git a/TypeScript/11BundleLoadingSample/types/controllers/HideoutController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/HideoutController.d.ts index 19d341d..877c076 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/HideoutController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/HideoutController.d.ts @@ -207,7 +207,7 @@ export declare class HideoutController { */ protected handleRecipe(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; /** - * Handles giving rewards stored in player profile to player after clicking 'get rewards' + * Handles generating case rewards and sending to player inventory * @param sessionID Session id * @param pmcData Player profile * @param request Get rewards from scavcase craft request diff --git a/TypeScript/11BundleLoadingSample/types/controllers/QuestController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/QuestController.d.ts index 3e8b7dd..7d494a6 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/QuestController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/QuestController.d.ts @@ -5,6 +5,7 @@ import { QuestConditionHelper } from "../helpers/QuestConditionHelper"; import { QuestHelper } from "../helpers/QuestHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { IQuestStatus } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; @@ -23,10 +24,12 @@ import { MailSendService } from "../services/MailSendService"; import { PlayerService } from "../services/PlayerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class QuestController { protected logger: ILogger; protected timeUtil: TimeUtil; + protected jsonUtil: JsonUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; @@ -43,7 +46,7 @@ export declare class QuestController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, jsonUtil: JsonUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Handle client/quest/list * Get all quests visible to player @@ -110,6 +113,13 @@ export declare class QuestController { * @returns ItemEvent client response */ completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Return quests that have different statuses + * @param preQuestStatusus Quests before + * @param postQuestStatuses Quests after + * @returns QuestStatusChange array + */ + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; /** * Send a popup to player on successful completion of a quest * @param sessionID session id @@ -137,8 +147,9 @@ export declare class QuestController { * @param sessionID session id * @param pmcData player profile * @param questsToFail quests to fail + * @param output Client output */ - protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void; + protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[], output: IItemEventRouterResponse): void; /** * Handle QuestHandover event * @param pmcData Player profile diff --git a/TypeScript/11BundleLoadingSample/types/helpers/InRaidHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/InRaidHelper.d.ts index a0987bc..bf584c2 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/InRaidHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; -import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; +import { IQuestStatus, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; @@ -72,7 +72,7 @@ export declare class InRaidHelper { * @param preRaidQuests Quests prior to starting raid * @param postRaidQuests Quest after raid */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: Quest[], postRaidQuests: Quest[]): void; + protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidQuests: IQuestStatus[]): void; protected resetSkillPointsEarnedDuringRaid(profile: IPmcData): void; /** * Take body part effects from client profile and apply to server profile diff --git a/TypeScript/11BundleLoadingSample/types/helpers/ProfileHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/ProfileHelper.d.ts index a2fb099..3c33ae7 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/ProfileHelper.d.ts @@ -21,11 +21,11 @@ export declare class ProfileHelper { protected profileSnapshotService: ProfileSnapshotService; constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); /** - * Remove/reset started quest condtions in player profile + * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id - * @param conditionIds Condition ids that need to be reset/removed + * @param questConditionId Quest with condition to remove */ - resetProfileQuestCondition(sessionID: string, conditionIds: string[]): void; + removeCompletedQuestConditionFromProfile(pmcData: IPmcData, questConditionId: Record): void; /** * Get all profiles from server * @returns Dictionary of profiles diff --git a/TypeScript/11BundleLoadingSample/types/helpers/QuestConditionHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/QuestConditionHelper.d.ts index 90ee560..a84bc81 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/QuestConditionHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/QuestConditionHelper.d.ts @@ -3,5 +3,6 @@ export declare class QuestConditionHelper { getQuestConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLevelConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLoyaltyConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; + getStandingConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; protected filterConditions(q: AvailableForConditions[], questType: string, furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; } diff --git a/TypeScript/11BundleLoadingSample/types/helpers/QuestHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/QuestHelper.d.ts index d89efeb..e04b6e0 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/QuestHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/QuestHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; -import { Quest } from "../models/eft/common/tables/IBotBase"; +import { IQuestStatus } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; @@ -84,7 +84,15 @@ export declare class QuestHelper { * @param profile Player profile * @returns true if loyalty is high enough to fulfill quest requirement */ + traderLoyaltyLevelRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; + /** + * Check if trader has sufficient standing to fulfill quest requirement + * @param questProperties Quest props + * @param profile Player profile + * @returns true if standing is high enough to fulfill quest requirement + */ traderStandingRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; + protected compareAvailableForValues(current: number, required: number, compareMethod: string): boolean; /** * take reward item from quest and set FiR status + fix stack sizes + fix mod Ids * @param reward Reward item to fix @@ -104,7 +112,7 @@ export declare class QuestHelper { * @param newState State the new quest should be in when returned * @param acceptedQuest Details of accepted quest from client */ - getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): Quest; + getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): IQuestStatus; /** * Get quests that can be shown to player after starting a quest * @param startedQuestId Quest started by player @@ -161,9 +169,10 @@ export declare class QuestHelper { * @param pmcData Player profile * @param failRequest Fail quest request data * @param sessionID Session id + * @param output Client output * @returns Item event router response */ - failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string): IItemEventRouterResponse; + failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; /** * Get List of All Quests from db * NOT CLONED @@ -224,11 +233,12 @@ export declare class QuestHelper { */ protected getIntelCenterRewardBonus(pmcData: IPmcData): number; /** - * Find quest with 'findItem' requirement that needs the item tpl be handed in + * Find quest with 'findItem' condition that needs the item tpl be handed in * @param itemTpl item tpl to look for - * @returns 'FindItem' condition id + * @param questIds Quests to search through for the findItem condition + * @returns quest id with 'FindItem' condition id */ - getFindItemIdForQuestHandIn(itemTpl: string): string[]; + getFindItemConditionByQuestItem(itemTpl: string, questIds: string[], allQuests: IQuest[]): Record; /** * Add all quests to a profile with the provided statuses * @param pmcProfile profile to update diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IBotBase.d.ts index 29fd630..ee40958 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IBotBase.d.ts @@ -21,7 +21,7 @@ export interface IBotBase { BackendCounters: Record; InsuredItems: InsuredItem[]; Hideout: Hideout; - Quests: Quest[]; + Quests: IQuestStatus[]; TradersInfo: Record; UnlockedInfo: IUnlockedInfo; RagfairInfo: RagfairInfo; @@ -355,7 +355,7 @@ export declare enum SurvivorClass { PARAMEDIC = 3, SURVIVOR = 4 } -export interface Quest { +export interface IQuestStatus { qid: string; startTime: number; status: QuestStatus; diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IQuest.d.ts index c6005ca..300a027 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IQuest.d.ts @@ -32,6 +32,8 @@ export interface IQuest { changeQuestMessageText: string; /** "Pmc" or "Scav" */ side: string; + /** Status of quest to player */ + sptStatus?: QuestStatus; } export interface Conditions { Started: AvailableForConditions[]; diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index fd7801e..8591294 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,6 +1,5 @@ import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; -import { QuestStatus } from "../../../models/enums/QuestStatus"; -import { Health, Productive, Skills, TraderData } from "../common/tables/IBotBase"; +import { Health, IQuestStatus, Productive, Skills, TraderData } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; import { IQuest } from "../common/tables/IQuest"; import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests"; @@ -33,20 +32,12 @@ export interface ProfileChange { repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; changedHideoutStashes?: Record; - questsStatus: QuestStatusChange[]; + questsStatus: IQuestStatus[]; } export interface IHideoutStashItem { Id: string; Tpl: string; } -export interface QuestStatusChange { - qid: string; - startTime: number; - status: QuestStatus; - statusTimers: Record; - completedConditions: string[]; - availableAfter: number; -} export interface IWeaponBuildChange { id: string; name: string; diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts index b5a406b..65aaa97 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts @@ -23,6 +23,8 @@ export interface IBotConfig extends IBaseConfig { equipment: Record; /** Show a bots botType value after their name */ showTypeInNickname: boolean; + /** What ai brain should a normal scav use per map */ + assaultBrainType: Record>; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; /** Chance scav has fake pscav name e.g. Scav name (player name) */ diff --git a/TypeScript/11BundleLoadingSample/types/services/ProfileFixerService.d.ts b/TypeScript/11BundleLoadingSample/types/services/ProfileFixerService.d.ts index e066e56..c8232fc 100644 --- a/TypeScript/11BundleLoadingSample/types/services/ProfileFixerService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/ProfileFixerService.d.ts @@ -1,6 +1,7 @@ import { HideoutHelper } from "../helpers/HideoutHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; @@ -22,6 +23,7 @@ export declare class ProfileFixerService { protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; + protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected timeUtil: TimeUtil; @@ -29,7 +31,7 @@ export declare class ProfileFixerService { protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix diff --git a/TypeScript/12ClassExtensionOverride/package.json b/TypeScript/12ClassExtensionOverride/package.json index f7c9a2b..adfd723 100644 --- a/TypeScript/12ClassExtensionOverride/package.json +++ b/TypeScript/12ClassExtensionOverride/package.json @@ -4,7 +4,7 @@ "main": "src/mod.js", "license": "MIT", "author": "Chomp", - "akiVersion": "~3.6", + "akiVersion": "~3.7", "scripts": { "setup": "npm i", "build": "node ./packageBuild.ts" diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/BotController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/BotController.d.ts index d8f8331..c343f95 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/BotController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/BotController.d.ts @@ -72,5 +72,5 @@ export declare class BotController { * @returns cap number */ getBotCap(): number; - getPmcBotTypes(): Record>>; + getAiBotBrainTypes(): any; } diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/HideoutController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/HideoutController.d.ts index 19d341d..877c076 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/HideoutController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/HideoutController.d.ts @@ -207,7 +207,7 @@ export declare class HideoutController { */ protected handleRecipe(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; /** - * Handles giving rewards stored in player profile to player after clicking 'get rewards' + * Handles generating case rewards and sending to player inventory * @param sessionID Session id * @param pmcData Player profile * @param request Get rewards from scavcase craft request diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/QuestController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/QuestController.d.ts index 3e8b7dd..7d494a6 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/QuestController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/QuestController.d.ts @@ -5,6 +5,7 @@ import { QuestConditionHelper } from "../helpers/QuestConditionHelper"; import { QuestHelper } from "../helpers/QuestHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { IQuestStatus } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; @@ -23,10 +24,12 @@ import { MailSendService } from "../services/MailSendService"; import { PlayerService } from "../services/PlayerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class QuestController { protected logger: ILogger; protected timeUtil: TimeUtil; + protected jsonUtil: JsonUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; @@ -43,7 +46,7 @@ export declare class QuestController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, jsonUtil: JsonUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Handle client/quest/list * Get all quests visible to player @@ -110,6 +113,13 @@ export declare class QuestController { * @returns ItemEvent client response */ completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Return quests that have different statuses + * @param preQuestStatusus Quests before + * @param postQuestStatuses Quests after + * @returns QuestStatusChange array + */ + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; /** * Send a popup to player on successful completion of a quest * @param sessionID session id @@ -137,8 +147,9 @@ export declare class QuestController { * @param sessionID session id * @param pmcData player profile * @param questsToFail quests to fail + * @param output Client output */ - protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void; + protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[], output: IItemEventRouterResponse): void; /** * Handle QuestHandover event * @param pmcData Player profile diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/InRaidHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/InRaidHelper.d.ts index a0987bc..bf584c2 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/InRaidHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; -import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; +import { IQuestStatus, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; @@ -72,7 +72,7 @@ export declare class InRaidHelper { * @param preRaidQuests Quests prior to starting raid * @param postRaidQuests Quest after raid */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: Quest[], postRaidQuests: Quest[]): void; + protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidQuests: IQuestStatus[]): void; protected resetSkillPointsEarnedDuringRaid(profile: IPmcData): void; /** * Take body part effects from client profile and apply to server profile diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/ProfileHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/ProfileHelper.d.ts index a2fb099..3c33ae7 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/ProfileHelper.d.ts @@ -21,11 +21,11 @@ export declare class ProfileHelper { protected profileSnapshotService: ProfileSnapshotService; constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); /** - * Remove/reset started quest condtions in player profile + * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id - * @param conditionIds Condition ids that need to be reset/removed + * @param questConditionId Quest with condition to remove */ - resetProfileQuestCondition(sessionID: string, conditionIds: string[]): void; + removeCompletedQuestConditionFromProfile(pmcData: IPmcData, questConditionId: Record): void; /** * Get all profiles from server * @returns Dictionary of profiles diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/QuestConditionHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/QuestConditionHelper.d.ts index 90ee560..a84bc81 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/QuestConditionHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/QuestConditionHelper.d.ts @@ -3,5 +3,6 @@ export declare class QuestConditionHelper { getQuestConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLevelConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLoyaltyConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; + getStandingConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; protected filterConditions(q: AvailableForConditions[], questType: string, furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; } diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/QuestHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/QuestHelper.d.ts index d89efeb..e04b6e0 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/QuestHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/QuestHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; -import { Quest } from "../models/eft/common/tables/IBotBase"; +import { IQuestStatus } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; @@ -84,7 +84,15 @@ export declare class QuestHelper { * @param profile Player profile * @returns true if loyalty is high enough to fulfill quest requirement */ + traderLoyaltyLevelRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; + /** + * Check if trader has sufficient standing to fulfill quest requirement + * @param questProperties Quest props + * @param profile Player profile + * @returns true if standing is high enough to fulfill quest requirement + */ traderStandingRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; + protected compareAvailableForValues(current: number, required: number, compareMethod: string): boolean; /** * take reward item from quest and set FiR status + fix stack sizes + fix mod Ids * @param reward Reward item to fix @@ -104,7 +112,7 @@ export declare class QuestHelper { * @param newState State the new quest should be in when returned * @param acceptedQuest Details of accepted quest from client */ - getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): Quest; + getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): IQuestStatus; /** * Get quests that can be shown to player after starting a quest * @param startedQuestId Quest started by player @@ -161,9 +169,10 @@ export declare class QuestHelper { * @param pmcData Player profile * @param failRequest Fail quest request data * @param sessionID Session id + * @param output Client output * @returns Item event router response */ - failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string): IItemEventRouterResponse; + failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; /** * Get List of All Quests from db * NOT CLONED @@ -224,11 +233,12 @@ export declare class QuestHelper { */ protected getIntelCenterRewardBonus(pmcData: IPmcData): number; /** - * Find quest with 'findItem' requirement that needs the item tpl be handed in + * Find quest with 'findItem' condition that needs the item tpl be handed in * @param itemTpl item tpl to look for - * @returns 'FindItem' condition id + * @param questIds Quests to search through for the findItem condition + * @returns quest id with 'FindItem' condition id */ - getFindItemIdForQuestHandIn(itemTpl: string): string[]; + getFindItemConditionByQuestItem(itemTpl: string, questIds: string[], allQuests: IQuest[]): Record; /** * Add all quests to a profile with the provided statuses * @param pmcProfile profile to update diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IBotBase.d.ts index 29fd630..ee40958 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IBotBase.d.ts @@ -21,7 +21,7 @@ export interface IBotBase { BackendCounters: Record; InsuredItems: InsuredItem[]; Hideout: Hideout; - Quests: Quest[]; + Quests: IQuestStatus[]; TradersInfo: Record; UnlockedInfo: IUnlockedInfo; RagfairInfo: RagfairInfo; @@ -355,7 +355,7 @@ export declare enum SurvivorClass { PARAMEDIC = 3, SURVIVOR = 4 } -export interface Quest { +export interface IQuestStatus { qid: string; startTime: number; status: QuestStatus; diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IQuest.d.ts index c6005ca..300a027 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IQuest.d.ts @@ -32,6 +32,8 @@ export interface IQuest { changeQuestMessageText: string; /** "Pmc" or "Scav" */ side: string; + /** Status of quest to player */ + sptStatus?: QuestStatus; } export interface Conditions { Started: AvailableForConditions[]; diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index fd7801e..8591294 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,6 +1,5 @@ import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; -import { QuestStatus } from "../../../models/enums/QuestStatus"; -import { Health, Productive, Skills, TraderData } from "../common/tables/IBotBase"; +import { Health, IQuestStatus, Productive, Skills, TraderData } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; import { IQuest } from "../common/tables/IQuest"; import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests"; @@ -33,20 +32,12 @@ export interface ProfileChange { repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; changedHideoutStashes?: Record; - questsStatus: QuestStatusChange[]; + questsStatus: IQuestStatus[]; } export interface IHideoutStashItem { Id: string; Tpl: string; } -export interface QuestStatusChange { - qid: string; - startTime: number; - status: QuestStatus; - statusTimers: Record; - completedConditions: string[]; - availableAfter: number; -} export interface IWeaponBuildChange { id: string; name: string; diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts index b5a406b..65aaa97 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts @@ -23,6 +23,8 @@ export interface IBotConfig extends IBaseConfig { equipment: Record; /** Show a bots botType value after their name */ showTypeInNickname: boolean; + /** What ai brain should a normal scav use per map */ + assaultBrainType: Record>; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; /** Chance scav has fake pscav name e.g. Scav name (player name) */ diff --git a/TypeScript/12ClassExtensionOverride/types/services/ProfileFixerService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/ProfileFixerService.d.ts index e066e56..c8232fc 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/ProfileFixerService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/ProfileFixerService.d.ts @@ -1,6 +1,7 @@ import { HideoutHelper } from "../helpers/HideoutHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; @@ -22,6 +23,7 @@ export declare class ProfileFixerService { protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; + protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected timeUtil: TimeUtil; @@ -29,7 +31,7 @@ export declare class ProfileFixerService { protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix diff --git a/TypeScript/13AddTrader/package.json b/TypeScript/13AddTrader/package.json index 82c5e09..50da204 100644 --- a/TypeScript/13AddTrader/package.json +++ b/TypeScript/13AddTrader/package.json @@ -4,7 +4,7 @@ "main": "src/mod.js", "license": "MIT", "author": "Shirito", - "akiVersion": "~3.6", + "akiVersion": "~3.7", "scripts": { "setup": "npm i", "build": "node ./packageBuild.ts" diff --git a/TypeScript/13AddTrader/types/controllers/BotController.d.ts b/TypeScript/13AddTrader/types/controllers/BotController.d.ts index d8f8331..c343f95 100644 --- a/TypeScript/13AddTrader/types/controllers/BotController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/BotController.d.ts @@ -72,5 +72,5 @@ export declare class BotController { * @returns cap number */ getBotCap(): number; - getPmcBotTypes(): Record>>; + getAiBotBrainTypes(): any; } diff --git a/TypeScript/13AddTrader/types/controllers/HideoutController.d.ts b/TypeScript/13AddTrader/types/controllers/HideoutController.d.ts index 19d341d..877c076 100644 --- a/TypeScript/13AddTrader/types/controllers/HideoutController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/HideoutController.d.ts @@ -207,7 +207,7 @@ export declare class HideoutController { */ protected handleRecipe(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; /** - * Handles giving rewards stored in player profile to player after clicking 'get rewards' + * Handles generating case rewards and sending to player inventory * @param sessionID Session id * @param pmcData Player profile * @param request Get rewards from scavcase craft request diff --git a/TypeScript/13AddTrader/types/controllers/QuestController.d.ts b/TypeScript/13AddTrader/types/controllers/QuestController.d.ts index 3e8b7dd..7d494a6 100644 --- a/TypeScript/13AddTrader/types/controllers/QuestController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/QuestController.d.ts @@ -5,6 +5,7 @@ import { QuestConditionHelper } from "../helpers/QuestConditionHelper"; import { QuestHelper } from "../helpers/QuestHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { IQuestStatus } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; @@ -23,10 +24,12 @@ import { MailSendService } from "../services/MailSendService"; import { PlayerService } from "../services/PlayerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class QuestController { protected logger: ILogger; protected timeUtil: TimeUtil; + protected jsonUtil: JsonUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; @@ -43,7 +46,7 @@ export declare class QuestController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, jsonUtil: JsonUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Handle client/quest/list * Get all quests visible to player @@ -110,6 +113,13 @@ export declare class QuestController { * @returns ItemEvent client response */ completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Return quests that have different statuses + * @param preQuestStatusus Quests before + * @param postQuestStatuses Quests after + * @returns QuestStatusChange array + */ + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; /** * Send a popup to player on successful completion of a quest * @param sessionID session id @@ -137,8 +147,9 @@ export declare class QuestController { * @param sessionID session id * @param pmcData player profile * @param questsToFail quests to fail + * @param output Client output */ - protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void; + protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[], output: IItemEventRouterResponse): void; /** * Handle QuestHandover event * @param pmcData Player profile diff --git a/TypeScript/13AddTrader/types/helpers/InRaidHelper.d.ts b/TypeScript/13AddTrader/types/helpers/InRaidHelper.d.ts index a0987bc..bf584c2 100644 --- a/TypeScript/13AddTrader/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/InRaidHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; -import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; +import { IQuestStatus, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; @@ -72,7 +72,7 @@ export declare class InRaidHelper { * @param preRaidQuests Quests prior to starting raid * @param postRaidQuests Quest after raid */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: Quest[], postRaidQuests: Quest[]): void; + protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidQuests: IQuestStatus[]): void; protected resetSkillPointsEarnedDuringRaid(profile: IPmcData): void; /** * Take body part effects from client profile and apply to server profile diff --git a/TypeScript/13AddTrader/types/helpers/ProfileHelper.d.ts b/TypeScript/13AddTrader/types/helpers/ProfileHelper.d.ts index a2fb099..3c33ae7 100644 --- a/TypeScript/13AddTrader/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/ProfileHelper.d.ts @@ -21,11 +21,11 @@ export declare class ProfileHelper { protected profileSnapshotService: ProfileSnapshotService; constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); /** - * Remove/reset started quest condtions in player profile + * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id - * @param conditionIds Condition ids that need to be reset/removed + * @param questConditionId Quest with condition to remove */ - resetProfileQuestCondition(sessionID: string, conditionIds: string[]): void; + removeCompletedQuestConditionFromProfile(pmcData: IPmcData, questConditionId: Record): void; /** * Get all profiles from server * @returns Dictionary of profiles diff --git a/TypeScript/13AddTrader/types/helpers/QuestConditionHelper.d.ts b/TypeScript/13AddTrader/types/helpers/QuestConditionHelper.d.ts index 90ee560..a84bc81 100644 --- a/TypeScript/13AddTrader/types/helpers/QuestConditionHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/QuestConditionHelper.d.ts @@ -3,5 +3,6 @@ export declare class QuestConditionHelper { getQuestConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLevelConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLoyaltyConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; + getStandingConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; protected filterConditions(q: AvailableForConditions[], questType: string, furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; } diff --git a/TypeScript/13AddTrader/types/helpers/QuestHelper.d.ts b/TypeScript/13AddTrader/types/helpers/QuestHelper.d.ts index d89efeb..e04b6e0 100644 --- a/TypeScript/13AddTrader/types/helpers/QuestHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/QuestHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; -import { Quest } from "../models/eft/common/tables/IBotBase"; +import { IQuestStatus } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; @@ -84,7 +84,15 @@ export declare class QuestHelper { * @param profile Player profile * @returns true if loyalty is high enough to fulfill quest requirement */ + traderLoyaltyLevelRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; + /** + * Check if trader has sufficient standing to fulfill quest requirement + * @param questProperties Quest props + * @param profile Player profile + * @returns true if standing is high enough to fulfill quest requirement + */ traderStandingRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; + protected compareAvailableForValues(current: number, required: number, compareMethod: string): boolean; /** * take reward item from quest and set FiR status + fix stack sizes + fix mod Ids * @param reward Reward item to fix @@ -104,7 +112,7 @@ export declare class QuestHelper { * @param newState State the new quest should be in when returned * @param acceptedQuest Details of accepted quest from client */ - getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): Quest; + getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): IQuestStatus; /** * Get quests that can be shown to player after starting a quest * @param startedQuestId Quest started by player @@ -161,9 +169,10 @@ export declare class QuestHelper { * @param pmcData Player profile * @param failRequest Fail quest request data * @param sessionID Session id + * @param output Client output * @returns Item event router response */ - failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string): IItemEventRouterResponse; + failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; /** * Get List of All Quests from db * NOT CLONED @@ -224,11 +233,12 @@ export declare class QuestHelper { */ protected getIntelCenterRewardBonus(pmcData: IPmcData): number; /** - * Find quest with 'findItem' requirement that needs the item tpl be handed in + * Find quest with 'findItem' condition that needs the item tpl be handed in * @param itemTpl item tpl to look for - * @returns 'FindItem' condition id + * @param questIds Quests to search through for the findItem condition + * @returns quest id with 'FindItem' condition id */ - getFindItemIdForQuestHandIn(itemTpl: string): string[]; + getFindItemConditionByQuestItem(itemTpl: string, questIds: string[], allQuests: IQuest[]): Record; /** * Add all quests to a profile with the provided statuses * @param pmcProfile profile to update diff --git a/TypeScript/13AddTrader/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/13AddTrader/types/models/eft/common/tables/IBotBase.d.ts index 29fd630..ee40958 100644 --- a/TypeScript/13AddTrader/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/common/tables/IBotBase.d.ts @@ -21,7 +21,7 @@ export interface IBotBase { BackendCounters: Record; InsuredItems: InsuredItem[]; Hideout: Hideout; - Quests: Quest[]; + Quests: IQuestStatus[]; TradersInfo: Record; UnlockedInfo: IUnlockedInfo; RagfairInfo: RagfairInfo; @@ -355,7 +355,7 @@ export declare enum SurvivorClass { PARAMEDIC = 3, SURVIVOR = 4 } -export interface Quest { +export interface IQuestStatus { qid: string; startTime: number; status: QuestStatus; diff --git a/TypeScript/13AddTrader/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/13AddTrader/types/models/eft/common/tables/IQuest.d.ts index c6005ca..300a027 100644 --- a/TypeScript/13AddTrader/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/common/tables/IQuest.d.ts @@ -32,6 +32,8 @@ export interface IQuest { changeQuestMessageText: string; /** "Pmc" or "Scav" */ side: string; + /** Status of quest to player */ + sptStatus?: QuestStatus; } export interface Conditions { Started: AvailableForConditions[]; diff --git a/TypeScript/13AddTrader/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/13AddTrader/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index fd7801e..8591294 100644 --- a/TypeScript/13AddTrader/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,6 +1,5 @@ import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; -import { QuestStatus } from "../../../models/enums/QuestStatus"; -import { Health, Productive, Skills, TraderData } from "../common/tables/IBotBase"; +import { Health, IQuestStatus, Productive, Skills, TraderData } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; import { IQuest } from "../common/tables/IQuest"; import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests"; @@ -33,20 +32,12 @@ export interface ProfileChange { repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; changedHideoutStashes?: Record; - questsStatus: QuestStatusChange[]; + questsStatus: IQuestStatus[]; } export interface IHideoutStashItem { Id: string; Tpl: string; } -export interface QuestStatusChange { - qid: string; - startTime: number; - status: QuestStatus; - statusTimers: Record; - completedConditions: string[]; - availableAfter: number; -} export interface IWeaponBuildChange { id: string; name: string; diff --git a/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts index b5a406b..65aaa97 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts @@ -23,6 +23,8 @@ export interface IBotConfig extends IBaseConfig { equipment: Record; /** Show a bots botType value after their name */ showTypeInNickname: boolean; + /** What ai brain should a normal scav use per map */ + assaultBrainType: Record>; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; /** Chance scav has fake pscav name e.g. Scav name (player name) */ diff --git a/TypeScript/13AddTrader/types/services/ProfileFixerService.d.ts b/TypeScript/13AddTrader/types/services/ProfileFixerService.d.ts index e066e56..c8232fc 100644 --- a/TypeScript/13AddTrader/types/services/ProfileFixerService.d.ts +++ b/TypeScript/13AddTrader/types/services/ProfileFixerService.d.ts @@ -1,6 +1,7 @@ import { HideoutHelper } from "../helpers/HideoutHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; @@ -22,6 +23,7 @@ export declare class ProfileFixerService { protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; + protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected timeUtil: TimeUtil; @@ -29,7 +31,7 @@ export declare class ProfileFixerService { protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix diff --git a/TypeScript/14AfterDBLoadHook/package.json b/TypeScript/14AfterDBLoadHook/package.json index 6444cec..ad486dd 100644 --- a/TypeScript/14AfterDBLoadHook/package.json +++ b/TypeScript/14AfterDBLoadHook/package.json @@ -4,7 +4,7 @@ "main": "src/mod.js", "license": "MIT", "author": "Chomp", - "akiVersion": "~3.6", + "akiVersion": "~3.7", "scripts": { "setup": "npm i", "build": "node ./packageBuild.ts" diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/BotController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/BotController.d.ts index d8f8331..c343f95 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/BotController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/BotController.d.ts @@ -72,5 +72,5 @@ export declare class BotController { * @returns cap number */ getBotCap(): number; - getPmcBotTypes(): Record>>; + getAiBotBrainTypes(): any; } diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/HideoutController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/HideoutController.d.ts index 19d341d..877c076 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/HideoutController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/HideoutController.d.ts @@ -207,7 +207,7 @@ export declare class HideoutController { */ protected handleRecipe(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; /** - * Handles giving rewards stored in player profile to player after clicking 'get rewards' + * Handles generating case rewards and sending to player inventory * @param sessionID Session id * @param pmcData Player profile * @param request Get rewards from scavcase craft request diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/QuestController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/QuestController.d.ts index 3e8b7dd..7d494a6 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/QuestController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/QuestController.d.ts @@ -5,6 +5,7 @@ import { QuestConditionHelper } from "../helpers/QuestConditionHelper"; import { QuestHelper } from "../helpers/QuestHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { IQuestStatus } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; @@ -23,10 +24,12 @@ import { MailSendService } from "../services/MailSendService"; import { PlayerService } from "../services/PlayerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class QuestController { protected logger: ILogger; protected timeUtil: TimeUtil; + protected jsonUtil: JsonUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; @@ -43,7 +46,7 @@ export declare class QuestController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, jsonUtil: JsonUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Handle client/quest/list * Get all quests visible to player @@ -110,6 +113,13 @@ export declare class QuestController { * @returns ItemEvent client response */ completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Return quests that have different statuses + * @param preQuestStatusus Quests before + * @param postQuestStatuses Quests after + * @returns QuestStatusChange array + */ + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; /** * Send a popup to player on successful completion of a quest * @param sessionID session id @@ -137,8 +147,9 @@ export declare class QuestController { * @param sessionID session id * @param pmcData player profile * @param questsToFail quests to fail + * @param output Client output */ - protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void; + protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[], output: IItemEventRouterResponse): void; /** * Handle QuestHandover event * @param pmcData Player profile diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/InRaidHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/InRaidHelper.d.ts index a0987bc..bf584c2 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/InRaidHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; -import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; +import { IQuestStatus, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; @@ -72,7 +72,7 @@ export declare class InRaidHelper { * @param preRaidQuests Quests prior to starting raid * @param postRaidQuests Quest after raid */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: Quest[], postRaidQuests: Quest[]): void; + protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidQuests: IQuestStatus[]): void; protected resetSkillPointsEarnedDuringRaid(profile: IPmcData): void; /** * Take body part effects from client profile and apply to server profile diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/ProfileHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/ProfileHelper.d.ts index a2fb099..3c33ae7 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/ProfileHelper.d.ts @@ -21,11 +21,11 @@ export declare class ProfileHelper { protected profileSnapshotService: ProfileSnapshotService; constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); /** - * Remove/reset started quest condtions in player profile + * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id - * @param conditionIds Condition ids that need to be reset/removed + * @param questConditionId Quest with condition to remove */ - resetProfileQuestCondition(sessionID: string, conditionIds: string[]): void; + removeCompletedQuestConditionFromProfile(pmcData: IPmcData, questConditionId: Record): void; /** * Get all profiles from server * @returns Dictionary of profiles diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/QuestConditionHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/QuestConditionHelper.d.ts index 90ee560..a84bc81 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/QuestConditionHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/QuestConditionHelper.d.ts @@ -3,5 +3,6 @@ export declare class QuestConditionHelper { getQuestConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLevelConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLoyaltyConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; + getStandingConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; protected filterConditions(q: AvailableForConditions[], questType: string, furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; } diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/QuestHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/QuestHelper.d.ts index d89efeb..e04b6e0 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/QuestHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/QuestHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; -import { Quest } from "../models/eft/common/tables/IBotBase"; +import { IQuestStatus } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; @@ -84,7 +84,15 @@ export declare class QuestHelper { * @param profile Player profile * @returns true if loyalty is high enough to fulfill quest requirement */ + traderLoyaltyLevelRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; + /** + * Check if trader has sufficient standing to fulfill quest requirement + * @param questProperties Quest props + * @param profile Player profile + * @returns true if standing is high enough to fulfill quest requirement + */ traderStandingRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; + protected compareAvailableForValues(current: number, required: number, compareMethod: string): boolean; /** * take reward item from quest and set FiR status + fix stack sizes + fix mod Ids * @param reward Reward item to fix @@ -104,7 +112,7 @@ export declare class QuestHelper { * @param newState State the new quest should be in when returned * @param acceptedQuest Details of accepted quest from client */ - getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): Quest; + getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): IQuestStatus; /** * Get quests that can be shown to player after starting a quest * @param startedQuestId Quest started by player @@ -161,9 +169,10 @@ export declare class QuestHelper { * @param pmcData Player profile * @param failRequest Fail quest request data * @param sessionID Session id + * @param output Client output * @returns Item event router response */ - failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string): IItemEventRouterResponse; + failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; /** * Get List of All Quests from db * NOT CLONED @@ -224,11 +233,12 @@ export declare class QuestHelper { */ protected getIntelCenterRewardBonus(pmcData: IPmcData): number; /** - * Find quest with 'findItem' requirement that needs the item tpl be handed in + * Find quest with 'findItem' condition that needs the item tpl be handed in * @param itemTpl item tpl to look for - * @returns 'FindItem' condition id + * @param questIds Quests to search through for the findItem condition + * @returns quest id with 'FindItem' condition id */ - getFindItemIdForQuestHandIn(itemTpl: string): string[]; + getFindItemConditionByQuestItem(itemTpl: string, questIds: string[], allQuests: IQuest[]): Record; /** * Add all quests to a profile with the provided statuses * @param pmcProfile profile to update diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IBotBase.d.ts index 29fd630..ee40958 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IBotBase.d.ts @@ -21,7 +21,7 @@ export interface IBotBase { BackendCounters: Record; InsuredItems: InsuredItem[]; Hideout: Hideout; - Quests: Quest[]; + Quests: IQuestStatus[]; TradersInfo: Record; UnlockedInfo: IUnlockedInfo; RagfairInfo: RagfairInfo; @@ -355,7 +355,7 @@ export declare enum SurvivorClass { PARAMEDIC = 3, SURVIVOR = 4 } -export interface Quest { +export interface IQuestStatus { qid: string; startTime: number; status: QuestStatus; diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IQuest.d.ts index c6005ca..300a027 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IQuest.d.ts @@ -32,6 +32,8 @@ export interface IQuest { changeQuestMessageText: string; /** "Pmc" or "Scav" */ side: string; + /** Status of quest to player */ + sptStatus?: QuestStatus; } export interface Conditions { Started: AvailableForConditions[]; diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index fd7801e..8591294 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,6 +1,5 @@ import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; -import { QuestStatus } from "../../../models/enums/QuestStatus"; -import { Health, Productive, Skills, TraderData } from "../common/tables/IBotBase"; +import { Health, IQuestStatus, Productive, Skills, TraderData } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; import { IQuest } from "../common/tables/IQuest"; import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests"; @@ -33,20 +32,12 @@ export interface ProfileChange { repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; changedHideoutStashes?: Record; - questsStatus: QuestStatusChange[]; + questsStatus: IQuestStatus[]; } export interface IHideoutStashItem { Id: string; Tpl: string; } -export interface QuestStatusChange { - qid: string; - startTime: number; - status: QuestStatus; - statusTimers: Record; - completedConditions: string[]; - availableAfter: number; -} export interface IWeaponBuildChange { id: string; name: string; diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts index b5a406b..65aaa97 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts @@ -23,6 +23,8 @@ export interface IBotConfig extends IBaseConfig { equipment: Record; /** Show a bots botType value after their name */ showTypeInNickname: boolean; + /** What ai brain should a normal scav use per map */ + assaultBrainType: Record>; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; /** Chance scav has fake pscav name e.g. Scav name (player name) */ diff --git a/TypeScript/14AfterDBLoadHook/types/services/ProfileFixerService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/ProfileFixerService.d.ts index e066e56..c8232fc 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/ProfileFixerService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/ProfileFixerService.d.ts @@ -1,6 +1,7 @@ import { HideoutHelper } from "../helpers/HideoutHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; @@ -22,6 +23,7 @@ export declare class ProfileFixerService { protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; + protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected timeUtil: TimeUtil; @@ -29,7 +31,7 @@ export declare class ProfileFixerService { protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix diff --git a/TypeScript/15HttpListenerExample/package.json b/TypeScript/15HttpListenerExample/package.json index 2c8ff3a..69d17f5 100644 --- a/TypeScript/15HttpListenerExample/package.json +++ b/TypeScript/15HttpListenerExample/package.json @@ -4,7 +4,7 @@ "main": "src/mod.js", "license": "MIT", "author": "Alex", - "akiVersion": "~3.6", + "akiVersion": "~3.7", "scripts": { "setup": "npm i", "build": "node ./packageBuild.ts" diff --git a/TypeScript/15HttpListenerExample/types/controllers/BotController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/BotController.d.ts index d8f8331..c343f95 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/BotController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/BotController.d.ts @@ -72,5 +72,5 @@ export declare class BotController { * @returns cap number */ getBotCap(): number; - getPmcBotTypes(): Record>>; + getAiBotBrainTypes(): any; } diff --git a/TypeScript/15HttpListenerExample/types/controllers/HideoutController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/HideoutController.d.ts index 19d341d..877c076 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/HideoutController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/HideoutController.d.ts @@ -207,7 +207,7 @@ export declare class HideoutController { */ protected handleRecipe(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; /** - * Handles giving rewards stored in player profile to player after clicking 'get rewards' + * Handles generating case rewards and sending to player inventory * @param sessionID Session id * @param pmcData Player profile * @param request Get rewards from scavcase craft request diff --git a/TypeScript/15HttpListenerExample/types/controllers/QuestController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/QuestController.d.ts index 3e8b7dd..7d494a6 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/QuestController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/QuestController.d.ts @@ -5,6 +5,7 @@ import { QuestConditionHelper } from "../helpers/QuestConditionHelper"; import { QuestHelper } from "../helpers/QuestHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { IQuestStatus } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; @@ -23,10 +24,12 @@ import { MailSendService } from "../services/MailSendService"; import { PlayerService } from "../services/PlayerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class QuestController { protected logger: ILogger; protected timeUtil: TimeUtil; + protected jsonUtil: JsonUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; @@ -43,7 +46,7 @@ export declare class QuestController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, jsonUtil: JsonUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Handle client/quest/list * Get all quests visible to player @@ -110,6 +113,13 @@ export declare class QuestController { * @returns ItemEvent client response */ completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Return quests that have different statuses + * @param preQuestStatusus Quests before + * @param postQuestStatuses Quests after + * @returns QuestStatusChange array + */ + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; /** * Send a popup to player on successful completion of a quest * @param sessionID session id @@ -137,8 +147,9 @@ export declare class QuestController { * @param sessionID session id * @param pmcData player profile * @param questsToFail quests to fail + * @param output Client output */ - protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void; + protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[], output: IItemEventRouterResponse): void; /** * Handle QuestHandover event * @param pmcData Player profile diff --git a/TypeScript/15HttpListenerExample/types/helpers/InRaidHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/InRaidHelper.d.ts index a0987bc..bf584c2 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/InRaidHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; -import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; +import { IQuestStatus, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; @@ -72,7 +72,7 @@ export declare class InRaidHelper { * @param preRaidQuests Quests prior to starting raid * @param postRaidQuests Quest after raid */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: Quest[], postRaidQuests: Quest[]): void; + protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidQuests: IQuestStatus[]): void; protected resetSkillPointsEarnedDuringRaid(profile: IPmcData): void; /** * Take body part effects from client profile and apply to server profile diff --git a/TypeScript/15HttpListenerExample/types/helpers/ProfileHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/ProfileHelper.d.ts index a2fb099..3c33ae7 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/ProfileHelper.d.ts @@ -21,11 +21,11 @@ export declare class ProfileHelper { protected profileSnapshotService: ProfileSnapshotService; constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); /** - * Remove/reset started quest condtions in player profile + * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id - * @param conditionIds Condition ids that need to be reset/removed + * @param questConditionId Quest with condition to remove */ - resetProfileQuestCondition(sessionID: string, conditionIds: string[]): void; + removeCompletedQuestConditionFromProfile(pmcData: IPmcData, questConditionId: Record): void; /** * Get all profiles from server * @returns Dictionary of profiles diff --git a/TypeScript/15HttpListenerExample/types/helpers/QuestConditionHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/QuestConditionHelper.d.ts index 90ee560..a84bc81 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/QuestConditionHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/QuestConditionHelper.d.ts @@ -3,5 +3,6 @@ export declare class QuestConditionHelper { getQuestConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLevelConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLoyaltyConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; + getStandingConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; protected filterConditions(q: AvailableForConditions[], questType: string, furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; } diff --git a/TypeScript/15HttpListenerExample/types/helpers/QuestHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/QuestHelper.d.ts index d89efeb..e04b6e0 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/QuestHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/QuestHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; -import { Quest } from "../models/eft/common/tables/IBotBase"; +import { IQuestStatus } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; @@ -84,7 +84,15 @@ export declare class QuestHelper { * @param profile Player profile * @returns true if loyalty is high enough to fulfill quest requirement */ + traderLoyaltyLevelRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; + /** + * Check if trader has sufficient standing to fulfill quest requirement + * @param questProperties Quest props + * @param profile Player profile + * @returns true if standing is high enough to fulfill quest requirement + */ traderStandingRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; + protected compareAvailableForValues(current: number, required: number, compareMethod: string): boolean; /** * take reward item from quest and set FiR status + fix stack sizes + fix mod Ids * @param reward Reward item to fix @@ -104,7 +112,7 @@ export declare class QuestHelper { * @param newState State the new quest should be in when returned * @param acceptedQuest Details of accepted quest from client */ - getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): Quest; + getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): IQuestStatus; /** * Get quests that can be shown to player after starting a quest * @param startedQuestId Quest started by player @@ -161,9 +169,10 @@ export declare class QuestHelper { * @param pmcData Player profile * @param failRequest Fail quest request data * @param sessionID Session id + * @param output Client output * @returns Item event router response */ - failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string): IItemEventRouterResponse; + failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; /** * Get List of All Quests from db * NOT CLONED @@ -224,11 +233,12 @@ export declare class QuestHelper { */ protected getIntelCenterRewardBonus(pmcData: IPmcData): number; /** - * Find quest with 'findItem' requirement that needs the item tpl be handed in + * Find quest with 'findItem' condition that needs the item tpl be handed in * @param itemTpl item tpl to look for - * @returns 'FindItem' condition id + * @param questIds Quests to search through for the findItem condition + * @returns quest id with 'FindItem' condition id */ - getFindItemIdForQuestHandIn(itemTpl: string): string[]; + getFindItemConditionByQuestItem(itemTpl: string, questIds: string[], allQuests: IQuest[]): Record; /** * Add all quests to a profile with the provided statuses * @param pmcProfile profile to update diff --git a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IBotBase.d.ts index 29fd630..ee40958 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IBotBase.d.ts @@ -21,7 +21,7 @@ export interface IBotBase { BackendCounters: Record; InsuredItems: InsuredItem[]; Hideout: Hideout; - Quests: Quest[]; + Quests: IQuestStatus[]; TradersInfo: Record; UnlockedInfo: IUnlockedInfo; RagfairInfo: RagfairInfo; @@ -355,7 +355,7 @@ export declare enum SurvivorClass { PARAMEDIC = 3, SURVIVOR = 4 } -export interface Quest { +export interface IQuestStatus { qid: string; startTime: number; status: QuestStatus; diff --git a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IQuest.d.ts index c6005ca..300a027 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IQuest.d.ts @@ -32,6 +32,8 @@ export interface IQuest { changeQuestMessageText: string; /** "Pmc" or "Scav" */ side: string; + /** Status of quest to player */ + sptStatus?: QuestStatus; } export interface Conditions { Started: AvailableForConditions[]; diff --git a/TypeScript/15HttpListenerExample/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index fd7801e..8591294 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,6 +1,5 @@ import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; -import { QuestStatus } from "../../../models/enums/QuestStatus"; -import { Health, Productive, Skills, TraderData } from "../common/tables/IBotBase"; +import { Health, IQuestStatus, Productive, Skills, TraderData } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; import { IQuest } from "../common/tables/IQuest"; import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests"; @@ -33,20 +32,12 @@ export interface ProfileChange { repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; changedHideoutStashes?: Record; - questsStatus: QuestStatusChange[]; + questsStatus: IQuestStatus[]; } export interface IHideoutStashItem { Id: string; Tpl: string; } -export interface QuestStatusChange { - qid: string; - startTime: number; - status: QuestStatus; - statusTimers: Record; - completedConditions: string[]; - availableAfter: number; -} export interface IWeaponBuildChange { id: string; name: string; diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/IBotConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/IBotConfig.d.ts index b5a406b..65aaa97 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/IBotConfig.d.ts @@ -23,6 +23,8 @@ export interface IBotConfig extends IBaseConfig { equipment: Record; /** Show a bots botType value after their name */ showTypeInNickname: boolean; + /** What ai brain should a normal scav use per map */ + assaultBrainType: Record>; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; /** Chance scav has fake pscav name e.g. Scav name (player name) */ diff --git a/TypeScript/15HttpListenerExample/types/services/ProfileFixerService.d.ts b/TypeScript/15HttpListenerExample/types/services/ProfileFixerService.d.ts index e066e56..c8232fc 100644 --- a/TypeScript/15HttpListenerExample/types/services/ProfileFixerService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/ProfileFixerService.d.ts @@ -1,6 +1,7 @@ import { HideoutHelper } from "../helpers/HideoutHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; @@ -22,6 +23,7 @@ export declare class ProfileFixerService { protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; + protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected timeUtil: TimeUtil; @@ -29,7 +31,7 @@ export declare class ProfileFixerService { protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix diff --git a/TypeScript/16ImporterUtil/package.json b/TypeScript/16ImporterUtil/package.json index aa55a17..11200aa 100644 --- a/TypeScript/16ImporterUtil/package.json +++ b/TypeScript/16ImporterUtil/package.json @@ -4,7 +4,7 @@ "main": "src/mod.js", "license": "MIT", "author": "Chomp", - "akiVersion": "~3.6", + "akiVersion": "~3.7", "scripts": { "setup": "npm i", "build": "node ./packageBuild.ts" diff --git a/TypeScript/16ImporterUtil/types/controllers/BotController.d.ts b/TypeScript/16ImporterUtil/types/controllers/BotController.d.ts index d8f8331..c343f95 100644 --- a/TypeScript/16ImporterUtil/types/controllers/BotController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/BotController.d.ts @@ -72,5 +72,5 @@ export declare class BotController { * @returns cap number */ getBotCap(): number; - getPmcBotTypes(): Record>>; + getAiBotBrainTypes(): any; } diff --git a/TypeScript/16ImporterUtil/types/controllers/HideoutController.d.ts b/TypeScript/16ImporterUtil/types/controllers/HideoutController.d.ts index 19d341d..877c076 100644 --- a/TypeScript/16ImporterUtil/types/controllers/HideoutController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/HideoutController.d.ts @@ -207,7 +207,7 @@ export declare class HideoutController { */ protected handleRecipe(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; /** - * Handles giving rewards stored in player profile to player after clicking 'get rewards' + * Handles generating case rewards and sending to player inventory * @param sessionID Session id * @param pmcData Player profile * @param request Get rewards from scavcase craft request diff --git a/TypeScript/16ImporterUtil/types/controllers/QuestController.d.ts b/TypeScript/16ImporterUtil/types/controllers/QuestController.d.ts index 3e8b7dd..7d494a6 100644 --- a/TypeScript/16ImporterUtil/types/controllers/QuestController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/QuestController.d.ts @@ -5,6 +5,7 @@ import { QuestConditionHelper } from "../helpers/QuestConditionHelper"; import { QuestHelper } from "../helpers/QuestHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { IQuestStatus } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; @@ -23,10 +24,12 @@ import { MailSendService } from "../services/MailSendService"; import { PlayerService } from "../services/PlayerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class QuestController { protected logger: ILogger; protected timeUtil: TimeUtil; + protected jsonUtil: JsonUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; @@ -43,7 +46,7 @@ export declare class QuestController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, jsonUtil: JsonUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Handle client/quest/list * Get all quests visible to player @@ -110,6 +113,13 @@ export declare class QuestController { * @returns ItemEvent client response */ completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Return quests that have different statuses + * @param preQuestStatusus Quests before + * @param postQuestStatuses Quests after + * @returns QuestStatusChange array + */ + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; /** * Send a popup to player on successful completion of a quest * @param sessionID session id @@ -137,8 +147,9 @@ export declare class QuestController { * @param sessionID session id * @param pmcData player profile * @param questsToFail quests to fail + * @param output Client output */ - protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void; + protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[], output: IItemEventRouterResponse): void; /** * Handle QuestHandover event * @param pmcData Player profile diff --git a/TypeScript/16ImporterUtil/types/helpers/InRaidHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/InRaidHelper.d.ts index a0987bc..bf584c2 100644 --- a/TypeScript/16ImporterUtil/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/InRaidHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; -import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; +import { IQuestStatus, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; @@ -72,7 +72,7 @@ export declare class InRaidHelper { * @param preRaidQuests Quests prior to starting raid * @param postRaidQuests Quest after raid */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: Quest[], postRaidQuests: Quest[]): void; + protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidQuests: IQuestStatus[]): void; protected resetSkillPointsEarnedDuringRaid(profile: IPmcData): void; /** * Take body part effects from client profile and apply to server profile diff --git a/TypeScript/16ImporterUtil/types/helpers/ProfileHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/ProfileHelper.d.ts index a2fb099..3c33ae7 100644 --- a/TypeScript/16ImporterUtil/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/ProfileHelper.d.ts @@ -21,11 +21,11 @@ export declare class ProfileHelper { protected profileSnapshotService: ProfileSnapshotService; constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); /** - * Remove/reset started quest condtions in player profile + * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id - * @param conditionIds Condition ids that need to be reset/removed + * @param questConditionId Quest with condition to remove */ - resetProfileQuestCondition(sessionID: string, conditionIds: string[]): void; + removeCompletedQuestConditionFromProfile(pmcData: IPmcData, questConditionId: Record): void; /** * Get all profiles from server * @returns Dictionary of profiles diff --git a/TypeScript/16ImporterUtil/types/helpers/QuestConditionHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/QuestConditionHelper.d.ts index 90ee560..a84bc81 100644 --- a/TypeScript/16ImporterUtil/types/helpers/QuestConditionHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/QuestConditionHelper.d.ts @@ -3,5 +3,6 @@ export declare class QuestConditionHelper { getQuestConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLevelConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLoyaltyConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; + getStandingConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; protected filterConditions(q: AvailableForConditions[], questType: string, furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; } diff --git a/TypeScript/16ImporterUtil/types/helpers/QuestHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/QuestHelper.d.ts index d89efeb..e04b6e0 100644 --- a/TypeScript/16ImporterUtil/types/helpers/QuestHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/QuestHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; -import { Quest } from "../models/eft/common/tables/IBotBase"; +import { IQuestStatus } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; @@ -84,7 +84,15 @@ export declare class QuestHelper { * @param profile Player profile * @returns true if loyalty is high enough to fulfill quest requirement */ + traderLoyaltyLevelRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; + /** + * Check if trader has sufficient standing to fulfill quest requirement + * @param questProperties Quest props + * @param profile Player profile + * @returns true if standing is high enough to fulfill quest requirement + */ traderStandingRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; + protected compareAvailableForValues(current: number, required: number, compareMethod: string): boolean; /** * take reward item from quest and set FiR status + fix stack sizes + fix mod Ids * @param reward Reward item to fix @@ -104,7 +112,7 @@ export declare class QuestHelper { * @param newState State the new quest should be in when returned * @param acceptedQuest Details of accepted quest from client */ - getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): Quest; + getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): IQuestStatus; /** * Get quests that can be shown to player after starting a quest * @param startedQuestId Quest started by player @@ -161,9 +169,10 @@ export declare class QuestHelper { * @param pmcData Player profile * @param failRequest Fail quest request data * @param sessionID Session id + * @param output Client output * @returns Item event router response */ - failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string): IItemEventRouterResponse; + failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; /** * Get List of All Quests from db * NOT CLONED @@ -224,11 +233,12 @@ export declare class QuestHelper { */ protected getIntelCenterRewardBonus(pmcData: IPmcData): number; /** - * Find quest with 'findItem' requirement that needs the item tpl be handed in + * Find quest with 'findItem' condition that needs the item tpl be handed in * @param itemTpl item tpl to look for - * @returns 'FindItem' condition id + * @param questIds Quests to search through for the findItem condition + * @returns quest id with 'FindItem' condition id */ - getFindItemIdForQuestHandIn(itemTpl: string): string[]; + getFindItemConditionByQuestItem(itemTpl: string, questIds: string[], allQuests: IQuest[]): Record; /** * Add all quests to a profile with the provided statuses * @param pmcProfile profile to update diff --git a/TypeScript/16ImporterUtil/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/16ImporterUtil/types/models/eft/common/tables/IBotBase.d.ts index 29fd630..ee40958 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/common/tables/IBotBase.d.ts @@ -21,7 +21,7 @@ export interface IBotBase { BackendCounters: Record; InsuredItems: InsuredItem[]; Hideout: Hideout; - Quests: Quest[]; + Quests: IQuestStatus[]; TradersInfo: Record; UnlockedInfo: IUnlockedInfo; RagfairInfo: RagfairInfo; @@ -355,7 +355,7 @@ export declare enum SurvivorClass { PARAMEDIC = 3, SURVIVOR = 4 } -export interface Quest { +export interface IQuestStatus { qid: string; startTime: number; status: QuestStatus; diff --git a/TypeScript/16ImporterUtil/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/16ImporterUtil/types/models/eft/common/tables/IQuest.d.ts index c6005ca..300a027 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/common/tables/IQuest.d.ts @@ -32,6 +32,8 @@ export interface IQuest { changeQuestMessageText: string; /** "Pmc" or "Scav" */ side: string; + /** Status of quest to player */ + sptStatus?: QuestStatus; } export interface Conditions { Started: AvailableForConditions[]; diff --git a/TypeScript/16ImporterUtil/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/16ImporterUtil/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index fd7801e..8591294 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,6 +1,5 @@ import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; -import { QuestStatus } from "../../../models/enums/QuestStatus"; -import { Health, Productive, Skills, TraderData } from "../common/tables/IBotBase"; +import { Health, IQuestStatus, Productive, Skills, TraderData } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; import { IQuest } from "../common/tables/IQuest"; import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests"; @@ -33,20 +32,12 @@ export interface ProfileChange { repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; changedHideoutStashes?: Record; - questsStatus: QuestStatusChange[]; + questsStatus: IQuestStatus[]; } export interface IHideoutStashItem { Id: string; Tpl: string; } -export interface QuestStatusChange { - qid: string; - startTime: number; - status: QuestStatus; - statusTimers: Record; - completedConditions: string[]; - availableAfter: number; -} export interface IWeaponBuildChange { id: string; name: string; diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/IBotConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/IBotConfig.d.ts index b5a406b..65aaa97 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/IBotConfig.d.ts @@ -23,6 +23,8 @@ export interface IBotConfig extends IBaseConfig { equipment: Record; /** Show a bots botType value after their name */ showTypeInNickname: boolean; + /** What ai brain should a normal scav use per map */ + assaultBrainType: Record>; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; /** Chance scav has fake pscav name e.g. Scav name (player name) */ diff --git a/TypeScript/16ImporterUtil/types/services/ProfileFixerService.d.ts b/TypeScript/16ImporterUtil/types/services/ProfileFixerService.d.ts index e066e56..c8232fc 100644 --- a/TypeScript/16ImporterUtil/types/services/ProfileFixerService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/ProfileFixerService.d.ts @@ -1,6 +1,7 @@ import { HideoutHelper } from "../helpers/HideoutHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; @@ -22,6 +23,7 @@ export declare class ProfileFixerService { protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; + protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected timeUtil: TimeUtil; @@ -29,7 +31,7 @@ export declare class ProfileFixerService { protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix diff --git a/TypeScript/17AsyncImporterWithDependency1/package.json b/TypeScript/17AsyncImporterWithDependency1/package.json index 62bd051..8db4c99 100644 --- a/TypeScript/17AsyncImporterWithDependency1/package.json +++ b/TypeScript/17AsyncImporterWithDependency1/package.json @@ -4,7 +4,7 @@ "main": "src/mod.js", "license": "MIT", "author": "Chomp", - "akiVersion": "~3.6", + "akiVersion": "~3.7", "modDependencies": { "17AsyncImporterWithDependency2": "~1" }, diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/BotController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/BotController.d.ts index d8f8331..c343f95 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/BotController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/BotController.d.ts @@ -72,5 +72,5 @@ export declare class BotController { * @returns cap number */ getBotCap(): number; - getPmcBotTypes(): Record>>; + getAiBotBrainTypes(): any; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/HideoutController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/HideoutController.d.ts index 19d341d..877c076 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/HideoutController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/HideoutController.d.ts @@ -207,7 +207,7 @@ export declare class HideoutController { */ protected handleRecipe(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; /** - * Handles giving rewards stored in player profile to player after clicking 'get rewards' + * Handles generating case rewards and sending to player inventory * @param sessionID Session id * @param pmcData Player profile * @param request Get rewards from scavcase craft request diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/QuestController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/QuestController.d.ts index 3e8b7dd..7d494a6 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/QuestController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/QuestController.d.ts @@ -5,6 +5,7 @@ import { QuestConditionHelper } from "../helpers/QuestConditionHelper"; import { QuestHelper } from "../helpers/QuestHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { IQuestStatus } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; @@ -23,10 +24,12 @@ import { MailSendService } from "../services/MailSendService"; import { PlayerService } from "../services/PlayerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class QuestController { protected logger: ILogger; protected timeUtil: TimeUtil; + protected jsonUtil: JsonUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; @@ -43,7 +46,7 @@ export declare class QuestController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, jsonUtil: JsonUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Handle client/quest/list * Get all quests visible to player @@ -110,6 +113,13 @@ export declare class QuestController { * @returns ItemEvent client response */ completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Return quests that have different statuses + * @param preQuestStatusus Quests before + * @param postQuestStatuses Quests after + * @returns QuestStatusChange array + */ + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; /** * Send a popup to player on successful completion of a quest * @param sessionID session id @@ -137,8 +147,9 @@ export declare class QuestController { * @param sessionID session id * @param pmcData player profile * @param questsToFail quests to fail + * @param output Client output */ - protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void; + protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[], output: IItemEventRouterResponse): void; /** * Handle QuestHandover event * @param pmcData Player profile diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/InRaidHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/InRaidHelper.d.ts index a0987bc..bf584c2 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/InRaidHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; -import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; +import { IQuestStatus, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; @@ -72,7 +72,7 @@ export declare class InRaidHelper { * @param preRaidQuests Quests prior to starting raid * @param postRaidQuests Quest after raid */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: Quest[], postRaidQuests: Quest[]): void; + protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidQuests: IQuestStatus[]): void; protected resetSkillPointsEarnedDuringRaid(profile: IPmcData): void; /** * Take body part effects from client profile and apply to server profile diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/ProfileHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/ProfileHelper.d.ts index a2fb099..3c33ae7 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/ProfileHelper.d.ts @@ -21,11 +21,11 @@ export declare class ProfileHelper { protected profileSnapshotService: ProfileSnapshotService; constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); /** - * Remove/reset started quest condtions in player profile + * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id - * @param conditionIds Condition ids that need to be reset/removed + * @param questConditionId Quest with condition to remove */ - resetProfileQuestCondition(sessionID: string, conditionIds: string[]): void; + removeCompletedQuestConditionFromProfile(pmcData: IPmcData, questConditionId: Record): void; /** * Get all profiles from server * @returns Dictionary of profiles diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/QuestConditionHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/QuestConditionHelper.d.ts index 90ee560..a84bc81 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/QuestConditionHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/QuestConditionHelper.d.ts @@ -3,5 +3,6 @@ export declare class QuestConditionHelper { getQuestConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLevelConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLoyaltyConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; + getStandingConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; protected filterConditions(q: AvailableForConditions[], questType: string, furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/QuestHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/QuestHelper.d.ts index d89efeb..e04b6e0 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/QuestHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/QuestHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; -import { Quest } from "../models/eft/common/tables/IBotBase"; +import { IQuestStatus } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; @@ -84,7 +84,15 @@ export declare class QuestHelper { * @param profile Player profile * @returns true if loyalty is high enough to fulfill quest requirement */ + traderLoyaltyLevelRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; + /** + * Check if trader has sufficient standing to fulfill quest requirement + * @param questProperties Quest props + * @param profile Player profile + * @returns true if standing is high enough to fulfill quest requirement + */ traderStandingRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; + protected compareAvailableForValues(current: number, required: number, compareMethod: string): boolean; /** * take reward item from quest and set FiR status + fix stack sizes + fix mod Ids * @param reward Reward item to fix @@ -104,7 +112,7 @@ export declare class QuestHelper { * @param newState State the new quest should be in when returned * @param acceptedQuest Details of accepted quest from client */ - getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): Quest; + getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): IQuestStatus; /** * Get quests that can be shown to player after starting a quest * @param startedQuestId Quest started by player @@ -161,9 +169,10 @@ export declare class QuestHelper { * @param pmcData Player profile * @param failRequest Fail quest request data * @param sessionID Session id + * @param output Client output * @returns Item event router response */ - failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string): IItemEventRouterResponse; + failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; /** * Get List of All Quests from db * NOT CLONED @@ -224,11 +233,12 @@ export declare class QuestHelper { */ protected getIntelCenterRewardBonus(pmcData: IPmcData): number; /** - * Find quest with 'findItem' requirement that needs the item tpl be handed in + * Find quest with 'findItem' condition that needs the item tpl be handed in * @param itemTpl item tpl to look for - * @returns 'FindItem' condition id + * @param questIds Quests to search through for the findItem condition + * @returns quest id with 'FindItem' condition id */ - getFindItemIdForQuestHandIn(itemTpl: string): string[]; + getFindItemConditionByQuestItem(itemTpl: string, questIds: string[], allQuests: IQuest[]): Record; /** * Add all quests to a profile with the provided statuses * @param pmcProfile profile to update diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IBotBase.d.ts index 29fd630..ee40958 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IBotBase.d.ts @@ -21,7 +21,7 @@ export interface IBotBase { BackendCounters: Record; InsuredItems: InsuredItem[]; Hideout: Hideout; - Quests: Quest[]; + Quests: IQuestStatus[]; TradersInfo: Record; UnlockedInfo: IUnlockedInfo; RagfairInfo: RagfairInfo; @@ -355,7 +355,7 @@ export declare enum SurvivorClass { PARAMEDIC = 3, SURVIVOR = 4 } -export interface Quest { +export interface IQuestStatus { qid: string; startTime: number; status: QuestStatus; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IQuest.d.ts index c6005ca..300a027 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IQuest.d.ts @@ -32,6 +32,8 @@ export interface IQuest { changeQuestMessageText: string; /** "Pmc" or "Scav" */ side: string; + /** Status of quest to player */ + sptStatus?: QuestStatus; } export interface Conditions { Started: AvailableForConditions[]; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index fd7801e..8591294 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,6 +1,5 @@ import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; -import { QuestStatus } from "../../../models/enums/QuestStatus"; -import { Health, Productive, Skills, TraderData } from "../common/tables/IBotBase"; +import { Health, IQuestStatus, Productive, Skills, TraderData } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; import { IQuest } from "../common/tables/IQuest"; import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests"; @@ -33,20 +32,12 @@ export interface ProfileChange { repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; changedHideoutStashes?: Record; - questsStatus: QuestStatusChange[]; + questsStatus: IQuestStatus[]; } export interface IHideoutStashItem { Id: string; Tpl: string; } -export interface QuestStatusChange { - qid: string; - startTime: number; - status: QuestStatus; - statusTimers: Record; - completedConditions: string[]; - availableAfter: number; -} export interface IWeaponBuildChange { id: string; name: string; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IBotConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IBotConfig.d.ts index b5a406b..65aaa97 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IBotConfig.d.ts @@ -23,6 +23,8 @@ export interface IBotConfig extends IBaseConfig { equipment: Record; /** Show a bots botType value after their name */ showTypeInNickname: boolean; + /** What ai brain should a normal scav use per map */ + assaultBrainType: Record>; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; /** Chance scav has fake pscav name e.g. Scav name (player name) */ diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/ProfileFixerService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/ProfileFixerService.d.ts index e066e56..c8232fc 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/ProfileFixerService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/ProfileFixerService.d.ts @@ -1,6 +1,7 @@ import { HideoutHelper } from "../helpers/HideoutHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; @@ -22,6 +23,7 @@ export declare class ProfileFixerService { protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; + protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected timeUtil: TimeUtil; @@ -29,7 +31,7 @@ export declare class ProfileFixerService { protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix diff --git a/TypeScript/17AsyncImporterWithDependency2/package.json b/TypeScript/17AsyncImporterWithDependency2/package.json index 0a397f3..873272d 100644 --- a/TypeScript/17AsyncImporterWithDependency2/package.json +++ b/TypeScript/17AsyncImporterWithDependency2/package.json @@ -4,7 +4,7 @@ "main": "src/mod.js", "license": "MIT", "author": "Chomp", - "akiVersion": "~3.6", + "akiVersion": "~3.7", "scripts": { "setup": "npm i", "build": "node ./packageBuild.ts" diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/BotController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/BotController.d.ts index d8f8331..c343f95 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/BotController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/BotController.d.ts @@ -72,5 +72,5 @@ export declare class BotController { * @returns cap number */ getBotCap(): number; - getPmcBotTypes(): Record>>; + getAiBotBrainTypes(): any; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/HideoutController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/HideoutController.d.ts index 19d341d..877c076 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/HideoutController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/HideoutController.d.ts @@ -207,7 +207,7 @@ export declare class HideoutController { */ protected handleRecipe(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; /** - * Handles giving rewards stored in player profile to player after clicking 'get rewards' + * Handles generating case rewards and sending to player inventory * @param sessionID Session id * @param pmcData Player profile * @param request Get rewards from scavcase craft request diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/QuestController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/QuestController.d.ts index 3e8b7dd..7d494a6 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/QuestController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/QuestController.d.ts @@ -5,6 +5,7 @@ import { QuestConditionHelper } from "../helpers/QuestConditionHelper"; import { QuestHelper } from "../helpers/QuestHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { IQuestStatus } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; @@ -23,10 +24,12 @@ import { MailSendService } from "../services/MailSendService"; import { PlayerService } from "../services/PlayerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class QuestController { protected logger: ILogger; protected timeUtil: TimeUtil; + protected jsonUtil: JsonUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; @@ -43,7 +46,7 @@ export declare class QuestController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, jsonUtil: JsonUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Handle client/quest/list * Get all quests visible to player @@ -110,6 +113,13 @@ export declare class QuestController { * @returns ItemEvent client response */ completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Return quests that have different statuses + * @param preQuestStatusus Quests before + * @param postQuestStatuses Quests after + * @returns QuestStatusChange array + */ + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; /** * Send a popup to player on successful completion of a quest * @param sessionID session id @@ -137,8 +147,9 @@ export declare class QuestController { * @param sessionID session id * @param pmcData player profile * @param questsToFail quests to fail + * @param output Client output */ - protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void; + protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[], output: IItemEventRouterResponse): void; /** * Handle QuestHandover event * @param pmcData Player profile diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/InRaidHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/InRaidHelper.d.ts index a0987bc..bf584c2 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/InRaidHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; -import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; +import { IQuestStatus, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; @@ -72,7 +72,7 @@ export declare class InRaidHelper { * @param preRaidQuests Quests prior to starting raid * @param postRaidQuests Quest after raid */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: Quest[], postRaidQuests: Quest[]): void; + protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidQuests: IQuestStatus[]): void; protected resetSkillPointsEarnedDuringRaid(profile: IPmcData): void; /** * Take body part effects from client profile and apply to server profile diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/ProfileHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/ProfileHelper.d.ts index a2fb099..3c33ae7 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/ProfileHelper.d.ts @@ -21,11 +21,11 @@ export declare class ProfileHelper { protected profileSnapshotService: ProfileSnapshotService; constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); /** - * Remove/reset started quest condtions in player profile + * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id - * @param conditionIds Condition ids that need to be reset/removed + * @param questConditionId Quest with condition to remove */ - resetProfileQuestCondition(sessionID: string, conditionIds: string[]): void; + removeCompletedQuestConditionFromProfile(pmcData: IPmcData, questConditionId: Record): void; /** * Get all profiles from server * @returns Dictionary of profiles diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/QuestConditionHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/QuestConditionHelper.d.ts index 90ee560..a84bc81 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/QuestConditionHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/QuestConditionHelper.d.ts @@ -3,5 +3,6 @@ export declare class QuestConditionHelper { getQuestConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLevelConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLoyaltyConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; + getStandingConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; protected filterConditions(q: AvailableForConditions[], questType: string, furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/QuestHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/QuestHelper.d.ts index d89efeb..e04b6e0 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/QuestHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/QuestHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; -import { Quest } from "../models/eft/common/tables/IBotBase"; +import { IQuestStatus } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; @@ -84,7 +84,15 @@ export declare class QuestHelper { * @param profile Player profile * @returns true if loyalty is high enough to fulfill quest requirement */ + traderLoyaltyLevelRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; + /** + * Check if trader has sufficient standing to fulfill quest requirement + * @param questProperties Quest props + * @param profile Player profile + * @returns true if standing is high enough to fulfill quest requirement + */ traderStandingRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; + protected compareAvailableForValues(current: number, required: number, compareMethod: string): boolean; /** * take reward item from quest and set FiR status + fix stack sizes + fix mod Ids * @param reward Reward item to fix @@ -104,7 +112,7 @@ export declare class QuestHelper { * @param newState State the new quest should be in when returned * @param acceptedQuest Details of accepted quest from client */ - getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): Quest; + getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): IQuestStatus; /** * Get quests that can be shown to player after starting a quest * @param startedQuestId Quest started by player @@ -161,9 +169,10 @@ export declare class QuestHelper { * @param pmcData Player profile * @param failRequest Fail quest request data * @param sessionID Session id + * @param output Client output * @returns Item event router response */ - failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string): IItemEventRouterResponse; + failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; /** * Get List of All Quests from db * NOT CLONED @@ -224,11 +233,12 @@ export declare class QuestHelper { */ protected getIntelCenterRewardBonus(pmcData: IPmcData): number; /** - * Find quest with 'findItem' requirement that needs the item tpl be handed in + * Find quest with 'findItem' condition that needs the item tpl be handed in * @param itemTpl item tpl to look for - * @returns 'FindItem' condition id + * @param questIds Quests to search through for the findItem condition + * @returns quest id with 'FindItem' condition id */ - getFindItemIdForQuestHandIn(itemTpl: string): string[]; + getFindItemConditionByQuestItem(itemTpl: string, questIds: string[], allQuests: IQuest[]): Record; /** * Add all quests to a profile with the provided statuses * @param pmcProfile profile to update diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IBotBase.d.ts index 29fd630..ee40958 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IBotBase.d.ts @@ -21,7 +21,7 @@ export interface IBotBase { BackendCounters: Record; InsuredItems: InsuredItem[]; Hideout: Hideout; - Quests: Quest[]; + Quests: IQuestStatus[]; TradersInfo: Record; UnlockedInfo: IUnlockedInfo; RagfairInfo: RagfairInfo; @@ -355,7 +355,7 @@ export declare enum SurvivorClass { PARAMEDIC = 3, SURVIVOR = 4 } -export interface Quest { +export interface IQuestStatus { qid: string; startTime: number; status: QuestStatus; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IQuest.d.ts index c6005ca..300a027 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IQuest.d.ts @@ -32,6 +32,8 @@ export interface IQuest { changeQuestMessageText: string; /** "Pmc" or "Scav" */ side: string; + /** Status of quest to player */ + sptStatus?: QuestStatus; } export interface Conditions { Started: AvailableForConditions[]; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index fd7801e..8591294 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,6 +1,5 @@ import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; -import { QuestStatus } from "../../../models/enums/QuestStatus"; -import { Health, Productive, Skills, TraderData } from "../common/tables/IBotBase"; +import { Health, IQuestStatus, Productive, Skills, TraderData } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; import { IQuest } from "../common/tables/IQuest"; import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests"; @@ -33,20 +32,12 @@ export interface ProfileChange { repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; changedHideoutStashes?: Record; - questsStatus: QuestStatusChange[]; + questsStatus: IQuestStatus[]; } export interface IHideoutStashItem { Id: string; Tpl: string; } -export interface QuestStatusChange { - qid: string; - startTime: number; - status: QuestStatus; - statusTimers: Record; - completedConditions: string[]; - availableAfter: number; -} export interface IWeaponBuildChange { id: string; name: string; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IBotConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IBotConfig.d.ts index b5a406b..65aaa97 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IBotConfig.d.ts @@ -23,6 +23,8 @@ export interface IBotConfig extends IBaseConfig { equipment: Record; /** Show a bots botType value after their name */ showTypeInNickname: boolean; + /** What ai brain should a normal scav use per map */ + assaultBrainType: Record>; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; /** Chance scav has fake pscav name e.g. Scav name (player name) */ diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/ProfileFixerService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/ProfileFixerService.d.ts index e066e56..c8232fc 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/ProfileFixerService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/ProfileFixerService.d.ts @@ -1,6 +1,7 @@ import { HideoutHelper } from "../helpers/HideoutHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; @@ -22,6 +23,7 @@ export declare class ProfileFixerService { protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; + protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected timeUtil: TimeUtil; @@ -29,7 +31,7 @@ export declare class ProfileFixerService { protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix diff --git a/TypeScript/18CustomItemService/package.json b/TypeScript/18CustomItemService/package.json index c06efb8..45145a8 100644 --- a/TypeScript/18CustomItemService/package.json +++ b/TypeScript/18CustomItemService/package.json @@ -4,7 +4,7 @@ "main": "src/mod.js", "license": "MIT", "author": "Choccy", - "akiVersion": "~3.6", + "akiVersion": "~3.7", "scripts": { "setup": "npm i", "build": "node ./packageBuild.ts" diff --git a/TypeScript/18CustomItemService/types/controllers/BotController.d.ts b/TypeScript/18CustomItemService/types/controllers/BotController.d.ts index d8f8331..c343f95 100644 --- a/TypeScript/18CustomItemService/types/controllers/BotController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/BotController.d.ts @@ -72,5 +72,5 @@ export declare class BotController { * @returns cap number */ getBotCap(): number; - getPmcBotTypes(): Record>>; + getAiBotBrainTypes(): any; } diff --git a/TypeScript/18CustomItemService/types/controllers/HideoutController.d.ts b/TypeScript/18CustomItemService/types/controllers/HideoutController.d.ts index 19d341d..877c076 100644 --- a/TypeScript/18CustomItemService/types/controllers/HideoutController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/HideoutController.d.ts @@ -207,7 +207,7 @@ export declare class HideoutController { */ protected handleRecipe(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; /** - * Handles giving rewards stored in player profile to player after clicking 'get rewards' + * Handles generating case rewards and sending to player inventory * @param sessionID Session id * @param pmcData Player profile * @param request Get rewards from scavcase craft request diff --git a/TypeScript/18CustomItemService/types/controllers/QuestController.d.ts b/TypeScript/18CustomItemService/types/controllers/QuestController.d.ts index 3e8b7dd..7d494a6 100644 --- a/TypeScript/18CustomItemService/types/controllers/QuestController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/QuestController.d.ts @@ -5,6 +5,7 @@ import { QuestConditionHelper } from "../helpers/QuestConditionHelper"; import { QuestHelper } from "../helpers/QuestHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { IQuestStatus } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; @@ -23,10 +24,12 @@ import { MailSendService } from "../services/MailSendService"; import { PlayerService } from "../services/PlayerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class QuestController { protected logger: ILogger; protected timeUtil: TimeUtil; + protected jsonUtil: JsonUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; @@ -43,7 +46,7 @@ export declare class QuestController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, jsonUtil: JsonUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Handle client/quest/list * Get all quests visible to player @@ -110,6 +113,13 @@ export declare class QuestController { * @returns ItemEvent client response */ completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Return quests that have different statuses + * @param preQuestStatusus Quests before + * @param postQuestStatuses Quests after + * @returns QuestStatusChange array + */ + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; /** * Send a popup to player on successful completion of a quest * @param sessionID session id @@ -137,8 +147,9 @@ export declare class QuestController { * @param sessionID session id * @param pmcData player profile * @param questsToFail quests to fail + * @param output Client output */ - protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void; + protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[], output: IItemEventRouterResponse): void; /** * Handle QuestHandover event * @param pmcData Player profile diff --git a/TypeScript/18CustomItemService/types/helpers/InRaidHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/InRaidHelper.d.ts index a0987bc..bf584c2 100644 --- a/TypeScript/18CustomItemService/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/InRaidHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; -import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; +import { IQuestStatus, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; @@ -72,7 +72,7 @@ export declare class InRaidHelper { * @param preRaidQuests Quests prior to starting raid * @param postRaidQuests Quest after raid */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: Quest[], postRaidQuests: Quest[]): void; + protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidQuests: IQuestStatus[]): void; protected resetSkillPointsEarnedDuringRaid(profile: IPmcData): void; /** * Take body part effects from client profile and apply to server profile diff --git a/TypeScript/18CustomItemService/types/helpers/ProfileHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/ProfileHelper.d.ts index a2fb099..3c33ae7 100644 --- a/TypeScript/18CustomItemService/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/ProfileHelper.d.ts @@ -21,11 +21,11 @@ export declare class ProfileHelper { protected profileSnapshotService: ProfileSnapshotService; constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); /** - * Remove/reset started quest condtions in player profile + * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id - * @param conditionIds Condition ids that need to be reset/removed + * @param questConditionId Quest with condition to remove */ - resetProfileQuestCondition(sessionID: string, conditionIds: string[]): void; + removeCompletedQuestConditionFromProfile(pmcData: IPmcData, questConditionId: Record): void; /** * Get all profiles from server * @returns Dictionary of profiles diff --git a/TypeScript/18CustomItemService/types/helpers/QuestConditionHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/QuestConditionHelper.d.ts index 90ee560..a84bc81 100644 --- a/TypeScript/18CustomItemService/types/helpers/QuestConditionHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/QuestConditionHelper.d.ts @@ -3,5 +3,6 @@ export declare class QuestConditionHelper { getQuestConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLevelConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLoyaltyConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; + getStandingConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; protected filterConditions(q: AvailableForConditions[], questType: string, furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; } diff --git a/TypeScript/18CustomItemService/types/helpers/QuestHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/QuestHelper.d.ts index d89efeb..e04b6e0 100644 --- a/TypeScript/18CustomItemService/types/helpers/QuestHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/QuestHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; -import { Quest } from "../models/eft/common/tables/IBotBase"; +import { IQuestStatus } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; @@ -84,7 +84,15 @@ export declare class QuestHelper { * @param profile Player profile * @returns true if loyalty is high enough to fulfill quest requirement */ + traderLoyaltyLevelRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; + /** + * Check if trader has sufficient standing to fulfill quest requirement + * @param questProperties Quest props + * @param profile Player profile + * @returns true if standing is high enough to fulfill quest requirement + */ traderStandingRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; + protected compareAvailableForValues(current: number, required: number, compareMethod: string): boolean; /** * take reward item from quest and set FiR status + fix stack sizes + fix mod Ids * @param reward Reward item to fix @@ -104,7 +112,7 @@ export declare class QuestHelper { * @param newState State the new quest should be in when returned * @param acceptedQuest Details of accepted quest from client */ - getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): Quest; + getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): IQuestStatus; /** * Get quests that can be shown to player after starting a quest * @param startedQuestId Quest started by player @@ -161,9 +169,10 @@ export declare class QuestHelper { * @param pmcData Player profile * @param failRequest Fail quest request data * @param sessionID Session id + * @param output Client output * @returns Item event router response */ - failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string): IItemEventRouterResponse; + failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; /** * Get List of All Quests from db * NOT CLONED @@ -224,11 +233,12 @@ export declare class QuestHelper { */ protected getIntelCenterRewardBonus(pmcData: IPmcData): number; /** - * Find quest with 'findItem' requirement that needs the item tpl be handed in + * Find quest with 'findItem' condition that needs the item tpl be handed in * @param itemTpl item tpl to look for - * @returns 'FindItem' condition id + * @param questIds Quests to search through for the findItem condition + * @returns quest id with 'FindItem' condition id */ - getFindItemIdForQuestHandIn(itemTpl: string): string[]; + getFindItemConditionByQuestItem(itemTpl: string, questIds: string[], allQuests: IQuest[]): Record; /** * Add all quests to a profile with the provided statuses * @param pmcProfile profile to update diff --git a/TypeScript/18CustomItemService/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/18CustomItemService/types/models/eft/common/tables/IBotBase.d.ts index 29fd630..ee40958 100644 --- a/TypeScript/18CustomItemService/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/common/tables/IBotBase.d.ts @@ -21,7 +21,7 @@ export interface IBotBase { BackendCounters: Record; InsuredItems: InsuredItem[]; Hideout: Hideout; - Quests: Quest[]; + Quests: IQuestStatus[]; TradersInfo: Record; UnlockedInfo: IUnlockedInfo; RagfairInfo: RagfairInfo; @@ -355,7 +355,7 @@ export declare enum SurvivorClass { PARAMEDIC = 3, SURVIVOR = 4 } -export interface Quest { +export interface IQuestStatus { qid: string; startTime: number; status: QuestStatus; diff --git a/TypeScript/18CustomItemService/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/18CustomItemService/types/models/eft/common/tables/IQuest.d.ts index c6005ca..300a027 100644 --- a/TypeScript/18CustomItemService/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/common/tables/IQuest.d.ts @@ -32,6 +32,8 @@ export interface IQuest { changeQuestMessageText: string; /** "Pmc" or "Scav" */ side: string; + /** Status of quest to player */ + sptStatus?: QuestStatus; } export interface Conditions { Started: AvailableForConditions[]; diff --git a/TypeScript/18CustomItemService/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/18CustomItemService/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index fd7801e..8591294 100644 --- a/TypeScript/18CustomItemService/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,6 +1,5 @@ import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; -import { QuestStatus } from "../../../models/enums/QuestStatus"; -import { Health, Productive, Skills, TraderData } from "../common/tables/IBotBase"; +import { Health, IQuestStatus, Productive, Skills, TraderData } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; import { IQuest } from "../common/tables/IQuest"; import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests"; @@ -33,20 +32,12 @@ export interface ProfileChange { repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; changedHideoutStashes?: Record; - questsStatus: QuestStatusChange[]; + questsStatus: IQuestStatus[]; } export interface IHideoutStashItem { Id: string; Tpl: string; } -export interface QuestStatusChange { - qid: string; - startTime: number; - status: QuestStatus; - statusTimers: Record; - completedConditions: string[]; - availableAfter: number; -} export interface IWeaponBuildChange { id: string; name: string; diff --git a/TypeScript/18CustomItemService/types/models/spt/config/IBotConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/IBotConfig.d.ts index b5a406b..65aaa97 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/IBotConfig.d.ts @@ -23,6 +23,8 @@ export interface IBotConfig extends IBaseConfig { equipment: Record; /** Show a bots botType value after their name */ showTypeInNickname: boolean; + /** What ai brain should a normal scav use per map */ + assaultBrainType: Record>; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; /** Chance scav has fake pscav name e.g. Scav name (player name) */ diff --git a/TypeScript/18CustomItemService/types/services/ProfileFixerService.d.ts b/TypeScript/18CustomItemService/types/services/ProfileFixerService.d.ts index e066e56..c8232fc 100644 --- a/TypeScript/18CustomItemService/types/services/ProfileFixerService.d.ts +++ b/TypeScript/18CustomItemService/types/services/ProfileFixerService.d.ts @@ -1,6 +1,7 @@ import { HideoutHelper } from "../helpers/HideoutHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; @@ -22,6 +23,7 @@ export declare class ProfileFixerService { protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; + protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected timeUtil: TimeUtil; @@ -29,7 +31,7 @@ export declare class ProfileFixerService { protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix diff --git a/TypeScript/1LogToConsole/package.json b/TypeScript/1LogToConsole/package.json index a2d919e..d2b2248 100644 --- a/TypeScript/1LogToConsole/package.json +++ b/TypeScript/1LogToConsole/package.json @@ -4,7 +4,7 @@ "main": "src/mod.js", "license": "MIT", "author": "Chomp", - "akiVersion": "~3.6", + "akiVersion": "~3.7", "scripts": { "setup": "npm i", "build": "node ./packageBuild.ts" diff --git a/TypeScript/1LogToConsole/types/controllers/BotController.d.ts b/TypeScript/1LogToConsole/types/controllers/BotController.d.ts index d8f8331..c343f95 100644 --- a/TypeScript/1LogToConsole/types/controllers/BotController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/BotController.d.ts @@ -72,5 +72,5 @@ export declare class BotController { * @returns cap number */ getBotCap(): number; - getPmcBotTypes(): Record>>; + getAiBotBrainTypes(): any; } diff --git a/TypeScript/1LogToConsole/types/controllers/HideoutController.d.ts b/TypeScript/1LogToConsole/types/controllers/HideoutController.d.ts index 19d341d..877c076 100644 --- a/TypeScript/1LogToConsole/types/controllers/HideoutController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/HideoutController.d.ts @@ -207,7 +207,7 @@ export declare class HideoutController { */ protected handleRecipe(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; /** - * Handles giving rewards stored in player profile to player after clicking 'get rewards' + * Handles generating case rewards and sending to player inventory * @param sessionID Session id * @param pmcData Player profile * @param request Get rewards from scavcase craft request diff --git a/TypeScript/1LogToConsole/types/controllers/QuestController.d.ts b/TypeScript/1LogToConsole/types/controllers/QuestController.d.ts index 3e8b7dd..7d494a6 100644 --- a/TypeScript/1LogToConsole/types/controllers/QuestController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/QuestController.d.ts @@ -5,6 +5,7 @@ import { QuestConditionHelper } from "../helpers/QuestConditionHelper"; import { QuestHelper } from "../helpers/QuestHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { IQuestStatus } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; @@ -23,10 +24,12 @@ import { MailSendService } from "../services/MailSendService"; import { PlayerService } from "../services/PlayerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class QuestController { protected logger: ILogger; protected timeUtil: TimeUtil; + protected jsonUtil: JsonUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; @@ -43,7 +46,7 @@ export declare class QuestController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, jsonUtil: JsonUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Handle client/quest/list * Get all quests visible to player @@ -110,6 +113,13 @@ export declare class QuestController { * @returns ItemEvent client response */ completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Return quests that have different statuses + * @param preQuestStatusus Quests before + * @param postQuestStatuses Quests after + * @returns QuestStatusChange array + */ + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; /** * Send a popup to player on successful completion of a quest * @param sessionID session id @@ -137,8 +147,9 @@ export declare class QuestController { * @param sessionID session id * @param pmcData player profile * @param questsToFail quests to fail + * @param output Client output */ - protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void; + protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[], output: IItemEventRouterResponse): void; /** * Handle QuestHandover event * @param pmcData Player profile diff --git a/TypeScript/1LogToConsole/types/helpers/InRaidHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/InRaidHelper.d.ts index a0987bc..bf584c2 100644 --- a/TypeScript/1LogToConsole/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/InRaidHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; -import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; +import { IQuestStatus, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; @@ -72,7 +72,7 @@ export declare class InRaidHelper { * @param preRaidQuests Quests prior to starting raid * @param postRaidQuests Quest after raid */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: Quest[], postRaidQuests: Quest[]): void; + protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidQuests: IQuestStatus[]): void; protected resetSkillPointsEarnedDuringRaid(profile: IPmcData): void; /** * Take body part effects from client profile and apply to server profile diff --git a/TypeScript/1LogToConsole/types/helpers/ProfileHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/ProfileHelper.d.ts index a2fb099..3c33ae7 100644 --- a/TypeScript/1LogToConsole/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/ProfileHelper.d.ts @@ -21,11 +21,11 @@ export declare class ProfileHelper { protected profileSnapshotService: ProfileSnapshotService; constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); /** - * Remove/reset started quest condtions in player profile + * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id - * @param conditionIds Condition ids that need to be reset/removed + * @param questConditionId Quest with condition to remove */ - resetProfileQuestCondition(sessionID: string, conditionIds: string[]): void; + removeCompletedQuestConditionFromProfile(pmcData: IPmcData, questConditionId: Record): void; /** * Get all profiles from server * @returns Dictionary of profiles diff --git a/TypeScript/1LogToConsole/types/helpers/QuestConditionHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/QuestConditionHelper.d.ts index 90ee560..a84bc81 100644 --- a/TypeScript/1LogToConsole/types/helpers/QuestConditionHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/QuestConditionHelper.d.ts @@ -3,5 +3,6 @@ export declare class QuestConditionHelper { getQuestConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLevelConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLoyaltyConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; + getStandingConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; protected filterConditions(q: AvailableForConditions[], questType: string, furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; } diff --git a/TypeScript/1LogToConsole/types/helpers/QuestHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/QuestHelper.d.ts index d89efeb..e04b6e0 100644 --- a/TypeScript/1LogToConsole/types/helpers/QuestHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/QuestHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; -import { Quest } from "../models/eft/common/tables/IBotBase"; +import { IQuestStatus } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; @@ -84,7 +84,15 @@ export declare class QuestHelper { * @param profile Player profile * @returns true if loyalty is high enough to fulfill quest requirement */ + traderLoyaltyLevelRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; + /** + * Check if trader has sufficient standing to fulfill quest requirement + * @param questProperties Quest props + * @param profile Player profile + * @returns true if standing is high enough to fulfill quest requirement + */ traderStandingRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; + protected compareAvailableForValues(current: number, required: number, compareMethod: string): boolean; /** * take reward item from quest and set FiR status + fix stack sizes + fix mod Ids * @param reward Reward item to fix @@ -104,7 +112,7 @@ export declare class QuestHelper { * @param newState State the new quest should be in when returned * @param acceptedQuest Details of accepted quest from client */ - getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): Quest; + getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): IQuestStatus; /** * Get quests that can be shown to player after starting a quest * @param startedQuestId Quest started by player @@ -161,9 +169,10 @@ export declare class QuestHelper { * @param pmcData Player profile * @param failRequest Fail quest request data * @param sessionID Session id + * @param output Client output * @returns Item event router response */ - failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string): IItemEventRouterResponse; + failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; /** * Get List of All Quests from db * NOT CLONED @@ -224,11 +233,12 @@ export declare class QuestHelper { */ protected getIntelCenterRewardBonus(pmcData: IPmcData): number; /** - * Find quest with 'findItem' requirement that needs the item tpl be handed in + * Find quest with 'findItem' condition that needs the item tpl be handed in * @param itemTpl item tpl to look for - * @returns 'FindItem' condition id + * @param questIds Quests to search through for the findItem condition + * @returns quest id with 'FindItem' condition id */ - getFindItemIdForQuestHandIn(itemTpl: string): string[]; + getFindItemConditionByQuestItem(itemTpl: string, questIds: string[], allQuests: IQuest[]): Record; /** * Add all quests to a profile with the provided statuses * @param pmcProfile profile to update diff --git a/TypeScript/1LogToConsole/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/1LogToConsole/types/models/eft/common/tables/IBotBase.d.ts index 29fd630..ee40958 100644 --- a/TypeScript/1LogToConsole/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/common/tables/IBotBase.d.ts @@ -21,7 +21,7 @@ export interface IBotBase { BackendCounters: Record; InsuredItems: InsuredItem[]; Hideout: Hideout; - Quests: Quest[]; + Quests: IQuestStatus[]; TradersInfo: Record; UnlockedInfo: IUnlockedInfo; RagfairInfo: RagfairInfo; @@ -355,7 +355,7 @@ export declare enum SurvivorClass { PARAMEDIC = 3, SURVIVOR = 4 } -export interface Quest { +export interface IQuestStatus { qid: string; startTime: number; status: QuestStatus; diff --git a/TypeScript/1LogToConsole/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/1LogToConsole/types/models/eft/common/tables/IQuest.d.ts index c6005ca..300a027 100644 --- a/TypeScript/1LogToConsole/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/common/tables/IQuest.d.ts @@ -32,6 +32,8 @@ export interface IQuest { changeQuestMessageText: string; /** "Pmc" or "Scav" */ side: string; + /** Status of quest to player */ + sptStatus?: QuestStatus; } export interface Conditions { Started: AvailableForConditions[]; diff --git a/TypeScript/1LogToConsole/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/1LogToConsole/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index fd7801e..8591294 100644 --- a/TypeScript/1LogToConsole/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,6 +1,5 @@ import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; -import { QuestStatus } from "../../../models/enums/QuestStatus"; -import { Health, Productive, Skills, TraderData } from "../common/tables/IBotBase"; +import { Health, IQuestStatus, Productive, Skills, TraderData } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; import { IQuest } from "../common/tables/IQuest"; import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests"; @@ -33,20 +32,12 @@ export interface ProfileChange { repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; changedHideoutStashes?: Record; - questsStatus: QuestStatusChange[]; + questsStatus: IQuestStatus[]; } export interface IHideoutStashItem { Id: string; Tpl: string; } -export interface QuestStatusChange { - qid: string; - startTime: number; - status: QuestStatus; - statusTimers: Record; - completedConditions: string[]; - availableAfter: number; -} export interface IWeaponBuildChange { id: string; name: string; diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts index b5a406b..65aaa97 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts @@ -23,6 +23,8 @@ export interface IBotConfig extends IBaseConfig { equipment: Record; /** Show a bots botType value after their name */ showTypeInNickname: boolean; + /** What ai brain should a normal scav use per map */ + assaultBrainType: Record>; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; /** Chance scav has fake pscav name e.g. Scav name (player name) */ diff --git a/TypeScript/1LogToConsole/types/services/ProfileFixerService.d.ts b/TypeScript/1LogToConsole/types/services/ProfileFixerService.d.ts index e066e56..c8232fc 100644 --- a/TypeScript/1LogToConsole/types/services/ProfileFixerService.d.ts +++ b/TypeScript/1LogToConsole/types/services/ProfileFixerService.d.ts @@ -1,6 +1,7 @@ import { HideoutHelper } from "../helpers/HideoutHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; @@ -22,6 +23,7 @@ export declare class ProfileFixerService { protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; + protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected timeUtil: TimeUtil; @@ -29,7 +31,7 @@ export declare class ProfileFixerService { protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix diff --git a/TypeScript/2EditDatabase/package.json b/TypeScript/2EditDatabase/package.json index 7bf98fd..18c5e98 100644 --- a/TypeScript/2EditDatabase/package.json +++ b/TypeScript/2EditDatabase/package.json @@ -4,7 +4,7 @@ "main": "src/mod.js", "license": "MIT", "author": "Chomp", - "akiVersion": "~3.6", + "akiVersion": "~3.7", "scripts": { "setup": "npm i", "build": "node ./packageBuild.ts" diff --git a/TypeScript/2EditDatabase/types/controllers/BotController.d.ts b/TypeScript/2EditDatabase/types/controllers/BotController.d.ts index d8f8331..c343f95 100644 --- a/TypeScript/2EditDatabase/types/controllers/BotController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/BotController.d.ts @@ -72,5 +72,5 @@ export declare class BotController { * @returns cap number */ getBotCap(): number; - getPmcBotTypes(): Record>>; + getAiBotBrainTypes(): any; } diff --git a/TypeScript/2EditDatabase/types/controllers/HideoutController.d.ts b/TypeScript/2EditDatabase/types/controllers/HideoutController.d.ts index 19d341d..877c076 100644 --- a/TypeScript/2EditDatabase/types/controllers/HideoutController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/HideoutController.d.ts @@ -207,7 +207,7 @@ export declare class HideoutController { */ protected handleRecipe(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; /** - * Handles giving rewards stored in player profile to player after clicking 'get rewards' + * Handles generating case rewards and sending to player inventory * @param sessionID Session id * @param pmcData Player profile * @param request Get rewards from scavcase craft request diff --git a/TypeScript/2EditDatabase/types/controllers/QuestController.d.ts b/TypeScript/2EditDatabase/types/controllers/QuestController.d.ts index 3e8b7dd..7d494a6 100644 --- a/TypeScript/2EditDatabase/types/controllers/QuestController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/QuestController.d.ts @@ -5,6 +5,7 @@ import { QuestConditionHelper } from "../helpers/QuestConditionHelper"; import { QuestHelper } from "../helpers/QuestHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { IQuestStatus } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; @@ -23,10 +24,12 @@ import { MailSendService } from "../services/MailSendService"; import { PlayerService } from "../services/PlayerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class QuestController { protected logger: ILogger; protected timeUtil: TimeUtil; + protected jsonUtil: JsonUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; @@ -43,7 +46,7 @@ export declare class QuestController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, jsonUtil: JsonUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Handle client/quest/list * Get all quests visible to player @@ -110,6 +113,13 @@ export declare class QuestController { * @returns ItemEvent client response */ completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Return quests that have different statuses + * @param preQuestStatusus Quests before + * @param postQuestStatuses Quests after + * @returns QuestStatusChange array + */ + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; /** * Send a popup to player on successful completion of a quest * @param sessionID session id @@ -137,8 +147,9 @@ export declare class QuestController { * @param sessionID session id * @param pmcData player profile * @param questsToFail quests to fail + * @param output Client output */ - protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void; + protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[], output: IItemEventRouterResponse): void; /** * Handle QuestHandover event * @param pmcData Player profile diff --git a/TypeScript/2EditDatabase/types/helpers/InRaidHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/InRaidHelper.d.ts index a0987bc..bf584c2 100644 --- a/TypeScript/2EditDatabase/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/InRaidHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; -import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; +import { IQuestStatus, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; @@ -72,7 +72,7 @@ export declare class InRaidHelper { * @param preRaidQuests Quests prior to starting raid * @param postRaidQuests Quest after raid */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: Quest[], postRaidQuests: Quest[]): void; + protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidQuests: IQuestStatus[]): void; protected resetSkillPointsEarnedDuringRaid(profile: IPmcData): void; /** * Take body part effects from client profile and apply to server profile diff --git a/TypeScript/2EditDatabase/types/helpers/ProfileHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/ProfileHelper.d.ts index a2fb099..3c33ae7 100644 --- a/TypeScript/2EditDatabase/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/ProfileHelper.d.ts @@ -21,11 +21,11 @@ export declare class ProfileHelper { protected profileSnapshotService: ProfileSnapshotService; constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); /** - * Remove/reset started quest condtions in player profile + * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id - * @param conditionIds Condition ids that need to be reset/removed + * @param questConditionId Quest with condition to remove */ - resetProfileQuestCondition(sessionID: string, conditionIds: string[]): void; + removeCompletedQuestConditionFromProfile(pmcData: IPmcData, questConditionId: Record): void; /** * Get all profiles from server * @returns Dictionary of profiles diff --git a/TypeScript/2EditDatabase/types/helpers/QuestConditionHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/QuestConditionHelper.d.ts index 90ee560..a84bc81 100644 --- a/TypeScript/2EditDatabase/types/helpers/QuestConditionHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/QuestConditionHelper.d.ts @@ -3,5 +3,6 @@ export declare class QuestConditionHelper { getQuestConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLevelConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLoyaltyConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; + getStandingConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; protected filterConditions(q: AvailableForConditions[], questType: string, furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; } diff --git a/TypeScript/2EditDatabase/types/helpers/QuestHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/QuestHelper.d.ts index d89efeb..e04b6e0 100644 --- a/TypeScript/2EditDatabase/types/helpers/QuestHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/QuestHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; -import { Quest } from "../models/eft/common/tables/IBotBase"; +import { IQuestStatus } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; @@ -84,7 +84,15 @@ export declare class QuestHelper { * @param profile Player profile * @returns true if loyalty is high enough to fulfill quest requirement */ + traderLoyaltyLevelRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; + /** + * Check if trader has sufficient standing to fulfill quest requirement + * @param questProperties Quest props + * @param profile Player profile + * @returns true if standing is high enough to fulfill quest requirement + */ traderStandingRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; + protected compareAvailableForValues(current: number, required: number, compareMethod: string): boolean; /** * take reward item from quest and set FiR status + fix stack sizes + fix mod Ids * @param reward Reward item to fix @@ -104,7 +112,7 @@ export declare class QuestHelper { * @param newState State the new quest should be in when returned * @param acceptedQuest Details of accepted quest from client */ - getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): Quest; + getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): IQuestStatus; /** * Get quests that can be shown to player after starting a quest * @param startedQuestId Quest started by player @@ -161,9 +169,10 @@ export declare class QuestHelper { * @param pmcData Player profile * @param failRequest Fail quest request data * @param sessionID Session id + * @param output Client output * @returns Item event router response */ - failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string): IItemEventRouterResponse; + failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; /** * Get List of All Quests from db * NOT CLONED @@ -224,11 +233,12 @@ export declare class QuestHelper { */ protected getIntelCenterRewardBonus(pmcData: IPmcData): number; /** - * Find quest with 'findItem' requirement that needs the item tpl be handed in + * Find quest with 'findItem' condition that needs the item tpl be handed in * @param itemTpl item tpl to look for - * @returns 'FindItem' condition id + * @param questIds Quests to search through for the findItem condition + * @returns quest id with 'FindItem' condition id */ - getFindItemIdForQuestHandIn(itemTpl: string): string[]; + getFindItemConditionByQuestItem(itemTpl: string, questIds: string[], allQuests: IQuest[]): Record; /** * Add all quests to a profile with the provided statuses * @param pmcProfile profile to update diff --git a/TypeScript/2EditDatabase/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/2EditDatabase/types/models/eft/common/tables/IBotBase.d.ts index 29fd630..ee40958 100644 --- a/TypeScript/2EditDatabase/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/common/tables/IBotBase.d.ts @@ -21,7 +21,7 @@ export interface IBotBase { BackendCounters: Record; InsuredItems: InsuredItem[]; Hideout: Hideout; - Quests: Quest[]; + Quests: IQuestStatus[]; TradersInfo: Record; UnlockedInfo: IUnlockedInfo; RagfairInfo: RagfairInfo; @@ -355,7 +355,7 @@ export declare enum SurvivorClass { PARAMEDIC = 3, SURVIVOR = 4 } -export interface Quest { +export interface IQuestStatus { qid: string; startTime: number; status: QuestStatus; diff --git a/TypeScript/2EditDatabase/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/2EditDatabase/types/models/eft/common/tables/IQuest.d.ts index c6005ca..300a027 100644 --- a/TypeScript/2EditDatabase/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/common/tables/IQuest.d.ts @@ -32,6 +32,8 @@ export interface IQuest { changeQuestMessageText: string; /** "Pmc" or "Scav" */ side: string; + /** Status of quest to player */ + sptStatus?: QuestStatus; } export interface Conditions { Started: AvailableForConditions[]; diff --git a/TypeScript/2EditDatabase/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/2EditDatabase/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index fd7801e..8591294 100644 --- a/TypeScript/2EditDatabase/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,6 +1,5 @@ import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; -import { QuestStatus } from "../../../models/enums/QuestStatus"; -import { Health, Productive, Skills, TraderData } from "../common/tables/IBotBase"; +import { Health, IQuestStatus, Productive, Skills, TraderData } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; import { IQuest } from "../common/tables/IQuest"; import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests"; @@ -33,20 +32,12 @@ export interface ProfileChange { repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; changedHideoutStashes?: Record; - questsStatus: QuestStatusChange[]; + questsStatus: IQuestStatus[]; } export interface IHideoutStashItem { Id: string; Tpl: string; } -export interface QuestStatusChange { - qid: string; - startTime: number; - status: QuestStatus; - statusTimers: Record; - completedConditions: string[]; - availableAfter: number; -} export interface IWeaponBuildChange { id: string; name: string; diff --git a/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts index b5a406b..65aaa97 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts @@ -23,6 +23,8 @@ export interface IBotConfig extends IBaseConfig { equipment: Record; /** Show a bots botType value after their name */ showTypeInNickname: boolean; + /** What ai brain should a normal scav use per map */ + assaultBrainType: Record>; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; /** Chance scav has fake pscav name e.g. Scav name (player name) */ diff --git a/TypeScript/2EditDatabase/types/services/ProfileFixerService.d.ts b/TypeScript/2EditDatabase/types/services/ProfileFixerService.d.ts index e066e56..c8232fc 100644 --- a/TypeScript/2EditDatabase/types/services/ProfileFixerService.d.ts +++ b/TypeScript/2EditDatabase/types/services/ProfileFixerService.d.ts @@ -1,6 +1,7 @@ import { HideoutHelper } from "../helpers/HideoutHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; @@ -22,6 +23,7 @@ export declare class ProfileFixerService { protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; + protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected timeUtil: TimeUtil; @@ -29,7 +31,7 @@ export declare class ProfileFixerService { protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix diff --git a/TypeScript/3GetSptConfigFile/package.json b/TypeScript/3GetSptConfigFile/package.json index 8cc83f1..eec7753 100644 --- a/TypeScript/3GetSptConfigFile/package.json +++ b/TypeScript/3GetSptConfigFile/package.json @@ -4,7 +4,7 @@ "main": "src/mod.js", "license": "MIT", "author": "Chomp", - "akiVersion": "~3.6", + "akiVersion": "~3.7", "scripts": { "setup": "npm i", "build": "node ./packageBuild.ts" diff --git a/TypeScript/3GetSptConfigFile/types/controllers/BotController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/BotController.d.ts index d8f8331..c343f95 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/BotController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/BotController.d.ts @@ -72,5 +72,5 @@ export declare class BotController { * @returns cap number */ getBotCap(): number; - getPmcBotTypes(): Record>>; + getAiBotBrainTypes(): any; } diff --git a/TypeScript/3GetSptConfigFile/types/controllers/HideoutController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/HideoutController.d.ts index 19d341d..877c076 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/HideoutController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/HideoutController.d.ts @@ -207,7 +207,7 @@ export declare class HideoutController { */ protected handleRecipe(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; /** - * Handles giving rewards stored in player profile to player after clicking 'get rewards' + * Handles generating case rewards and sending to player inventory * @param sessionID Session id * @param pmcData Player profile * @param request Get rewards from scavcase craft request diff --git a/TypeScript/3GetSptConfigFile/types/controllers/QuestController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/QuestController.d.ts index 3e8b7dd..7d494a6 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/QuestController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/QuestController.d.ts @@ -5,6 +5,7 @@ import { QuestConditionHelper } from "../helpers/QuestConditionHelper"; import { QuestHelper } from "../helpers/QuestHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { IQuestStatus } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; @@ -23,10 +24,12 @@ import { MailSendService } from "../services/MailSendService"; import { PlayerService } from "../services/PlayerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class QuestController { protected logger: ILogger; protected timeUtil: TimeUtil; + protected jsonUtil: JsonUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; @@ -43,7 +46,7 @@ export declare class QuestController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, jsonUtil: JsonUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Handle client/quest/list * Get all quests visible to player @@ -110,6 +113,13 @@ export declare class QuestController { * @returns ItemEvent client response */ completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Return quests that have different statuses + * @param preQuestStatusus Quests before + * @param postQuestStatuses Quests after + * @returns QuestStatusChange array + */ + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; /** * Send a popup to player on successful completion of a quest * @param sessionID session id @@ -137,8 +147,9 @@ export declare class QuestController { * @param sessionID session id * @param pmcData player profile * @param questsToFail quests to fail + * @param output Client output */ - protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void; + protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[], output: IItemEventRouterResponse): void; /** * Handle QuestHandover event * @param pmcData Player profile diff --git a/TypeScript/3GetSptConfigFile/types/helpers/InRaidHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/InRaidHelper.d.ts index a0987bc..bf584c2 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/InRaidHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; -import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; +import { IQuestStatus, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; @@ -72,7 +72,7 @@ export declare class InRaidHelper { * @param preRaidQuests Quests prior to starting raid * @param postRaidQuests Quest after raid */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: Quest[], postRaidQuests: Quest[]): void; + protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidQuests: IQuestStatus[]): void; protected resetSkillPointsEarnedDuringRaid(profile: IPmcData): void; /** * Take body part effects from client profile and apply to server profile diff --git a/TypeScript/3GetSptConfigFile/types/helpers/ProfileHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/ProfileHelper.d.ts index a2fb099..3c33ae7 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/ProfileHelper.d.ts @@ -21,11 +21,11 @@ export declare class ProfileHelper { protected profileSnapshotService: ProfileSnapshotService; constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); /** - * Remove/reset started quest condtions in player profile + * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id - * @param conditionIds Condition ids that need to be reset/removed + * @param questConditionId Quest with condition to remove */ - resetProfileQuestCondition(sessionID: string, conditionIds: string[]): void; + removeCompletedQuestConditionFromProfile(pmcData: IPmcData, questConditionId: Record): void; /** * Get all profiles from server * @returns Dictionary of profiles diff --git a/TypeScript/3GetSptConfigFile/types/helpers/QuestConditionHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/QuestConditionHelper.d.ts index 90ee560..a84bc81 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/QuestConditionHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/QuestConditionHelper.d.ts @@ -3,5 +3,6 @@ export declare class QuestConditionHelper { getQuestConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLevelConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLoyaltyConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; + getStandingConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; protected filterConditions(q: AvailableForConditions[], questType: string, furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; } diff --git a/TypeScript/3GetSptConfigFile/types/helpers/QuestHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/QuestHelper.d.ts index d89efeb..e04b6e0 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/QuestHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/QuestHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; -import { Quest } from "../models/eft/common/tables/IBotBase"; +import { IQuestStatus } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; @@ -84,7 +84,15 @@ export declare class QuestHelper { * @param profile Player profile * @returns true if loyalty is high enough to fulfill quest requirement */ + traderLoyaltyLevelRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; + /** + * Check if trader has sufficient standing to fulfill quest requirement + * @param questProperties Quest props + * @param profile Player profile + * @returns true if standing is high enough to fulfill quest requirement + */ traderStandingRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; + protected compareAvailableForValues(current: number, required: number, compareMethod: string): boolean; /** * take reward item from quest and set FiR status + fix stack sizes + fix mod Ids * @param reward Reward item to fix @@ -104,7 +112,7 @@ export declare class QuestHelper { * @param newState State the new quest should be in when returned * @param acceptedQuest Details of accepted quest from client */ - getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): Quest; + getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): IQuestStatus; /** * Get quests that can be shown to player after starting a quest * @param startedQuestId Quest started by player @@ -161,9 +169,10 @@ export declare class QuestHelper { * @param pmcData Player profile * @param failRequest Fail quest request data * @param sessionID Session id + * @param output Client output * @returns Item event router response */ - failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string): IItemEventRouterResponse; + failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; /** * Get List of All Quests from db * NOT CLONED @@ -224,11 +233,12 @@ export declare class QuestHelper { */ protected getIntelCenterRewardBonus(pmcData: IPmcData): number; /** - * Find quest with 'findItem' requirement that needs the item tpl be handed in + * Find quest with 'findItem' condition that needs the item tpl be handed in * @param itemTpl item tpl to look for - * @returns 'FindItem' condition id + * @param questIds Quests to search through for the findItem condition + * @returns quest id with 'FindItem' condition id */ - getFindItemIdForQuestHandIn(itemTpl: string): string[]; + getFindItemConditionByQuestItem(itemTpl: string, questIds: string[], allQuests: IQuest[]): Record; /** * Add all quests to a profile with the provided statuses * @param pmcProfile profile to update diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IBotBase.d.ts index 29fd630..ee40958 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IBotBase.d.ts @@ -21,7 +21,7 @@ export interface IBotBase { BackendCounters: Record; InsuredItems: InsuredItem[]; Hideout: Hideout; - Quests: Quest[]; + Quests: IQuestStatus[]; TradersInfo: Record; UnlockedInfo: IUnlockedInfo; RagfairInfo: RagfairInfo; @@ -355,7 +355,7 @@ export declare enum SurvivorClass { PARAMEDIC = 3, SURVIVOR = 4 } -export interface Quest { +export interface IQuestStatus { qid: string; startTime: number; status: QuestStatus; diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IQuest.d.ts index c6005ca..300a027 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IQuest.d.ts @@ -32,6 +32,8 @@ export interface IQuest { changeQuestMessageText: string; /** "Pmc" or "Scav" */ side: string; + /** Status of quest to player */ + sptStatus?: QuestStatus; } export interface Conditions { Started: AvailableForConditions[]; diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index fd7801e..8591294 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,6 +1,5 @@ import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; -import { QuestStatus } from "../../../models/enums/QuestStatus"; -import { Health, Productive, Skills, TraderData } from "../common/tables/IBotBase"; +import { Health, IQuestStatus, Productive, Skills, TraderData } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; import { IQuest } from "../common/tables/IQuest"; import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests"; @@ -33,20 +32,12 @@ export interface ProfileChange { repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; changedHideoutStashes?: Record; - questsStatus: QuestStatusChange[]; + questsStatus: IQuestStatus[]; } export interface IHideoutStashItem { Id: string; Tpl: string; } -export interface QuestStatusChange { - qid: string; - startTime: number; - status: QuestStatus; - statusTimers: Record; - completedConditions: string[]; - availableAfter: number; -} export interface IWeaponBuildChange { id: string; name: string; diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts index b5a406b..65aaa97 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts @@ -23,6 +23,8 @@ export interface IBotConfig extends IBaseConfig { equipment: Record; /** Show a bots botType value after their name */ showTypeInNickname: boolean; + /** What ai brain should a normal scav use per map */ + assaultBrainType: Record>; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; /** Chance scav has fake pscav name e.g. Scav name (player name) */ diff --git a/TypeScript/3GetSptConfigFile/types/services/ProfileFixerService.d.ts b/TypeScript/3GetSptConfigFile/types/services/ProfileFixerService.d.ts index e066e56..c8232fc 100644 --- a/TypeScript/3GetSptConfigFile/types/services/ProfileFixerService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/ProfileFixerService.d.ts @@ -1,6 +1,7 @@ import { HideoutHelper } from "../helpers/HideoutHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; @@ -22,6 +23,7 @@ export declare class ProfileFixerService { protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; + protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected timeUtil: TimeUtil; @@ -29,7 +31,7 @@ export declare class ProfileFixerService { protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix diff --git a/TypeScript/4UseACustomConfigFile/package.json b/TypeScript/4UseACustomConfigFile/package.json index 591b163..9bbe33a 100644 --- a/TypeScript/4UseACustomConfigFile/package.json +++ b/TypeScript/4UseACustomConfigFile/package.json @@ -4,7 +4,7 @@ "main": "src/mod.js", "license": "MIT", "author": "Chomp", - "akiVersion": "~3.6", + "akiVersion": "~3.7", "scripts": { "setup": "npm i", "build": "node ./packageBuild.ts" diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/BotController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/BotController.d.ts index d8f8331..c343f95 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/BotController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/BotController.d.ts @@ -72,5 +72,5 @@ export declare class BotController { * @returns cap number */ getBotCap(): number; - getPmcBotTypes(): Record>>; + getAiBotBrainTypes(): any; } diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/HideoutController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/HideoutController.d.ts index 19d341d..877c076 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/HideoutController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/HideoutController.d.ts @@ -207,7 +207,7 @@ export declare class HideoutController { */ protected handleRecipe(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; /** - * Handles giving rewards stored in player profile to player after clicking 'get rewards' + * Handles generating case rewards and sending to player inventory * @param sessionID Session id * @param pmcData Player profile * @param request Get rewards from scavcase craft request diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/QuestController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/QuestController.d.ts index 3e8b7dd..7d494a6 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/QuestController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/QuestController.d.ts @@ -5,6 +5,7 @@ import { QuestConditionHelper } from "../helpers/QuestConditionHelper"; import { QuestHelper } from "../helpers/QuestHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { IQuestStatus } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; @@ -23,10 +24,12 @@ import { MailSendService } from "../services/MailSendService"; import { PlayerService } from "../services/PlayerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class QuestController { protected logger: ILogger; protected timeUtil: TimeUtil; + protected jsonUtil: JsonUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; @@ -43,7 +46,7 @@ export declare class QuestController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, jsonUtil: JsonUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Handle client/quest/list * Get all quests visible to player @@ -110,6 +113,13 @@ export declare class QuestController { * @returns ItemEvent client response */ completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Return quests that have different statuses + * @param preQuestStatusus Quests before + * @param postQuestStatuses Quests after + * @returns QuestStatusChange array + */ + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; /** * Send a popup to player on successful completion of a quest * @param sessionID session id @@ -137,8 +147,9 @@ export declare class QuestController { * @param sessionID session id * @param pmcData player profile * @param questsToFail quests to fail + * @param output Client output */ - protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void; + protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[], output: IItemEventRouterResponse): void; /** * Handle QuestHandover event * @param pmcData Player profile diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/InRaidHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/InRaidHelper.d.ts index a0987bc..bf584c2 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/InRaidHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; -import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; +import { IQuestStatus, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; @@ -72,7 +72,7 @@ export declare class InRaidHelper { * @param preRaidQuests Quests prior to starting raid * @param postRaidQuests Quest after raid */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: Quest[], postRaidQuests: Quest[]): void; + protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidQuests: IQuestStatus[]): void; protected resetSkillPointsEarnedDuringRaid(profile: IPmcData): void; /** * Take body part effects from client profile and apply to server profile diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/ProfileHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/ProfileHelper.d.ts index a2fb099..3c33ae7 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/ProfileHelper.d.ts @@ -21,11 +21,11 @@ export declare class ProfileHelper { protected profileSnapshotService: ProfileSnapshotService; constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); /** - * Remove/reset started quest condtions in player profile + * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id - * @param conditionIds Condition ids that need to be reset/removed + * @param questConditionId Quest with condition to remove */ - resetProfileQuestCondition(sessionID: string, conditionIds: string[]): void; + removeCompletedQuestConditionFromProfile(pmcData: IPmcData, questConditionId: Record): void; /** * Get all profiles from server * @returns Dictionary of profiles diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/QuestConditionHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/QuestConditionHelper.d.ts index 90ee560..a84bc81 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/QuestConditionHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/QuestConditionHelper.d.ts @@ -3,5 +3,6 @@ export declare class QuestConditionHelper { getQuestConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLevelConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLoyaltyConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; + getStandingConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; protected filterConditions(q: AvailableForConditions[], questType: string, furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; } diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/QuestHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/QuestHelper.d.ts index d89efeb..e04b6e0 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/QuestHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/QuestHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; -import { Quest } from "../models/eft/common/tables/IBotBase"; +import { IQuestStatus } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; @@ -84,7 +84,15 @@ export declare class QuestHelper { * @param profile Player profile * @returns true if loyalty is high enough to fulfill quest requirement */ + traderLoyaltyLevelRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; + /** + * Check if trader has sufficient standing to fulfill quest requirement + * @param questProperties Quest props + * @param profile Player profile + * @returns true if standing is high enough to fulfill quest requirement + */ traderStandingRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; + protected compareAvailableForValues(current: number, required: number, compareMethod: string): boolean; /** * take reward item from quest and set FiR status + fix stack sizes + fix mod Ids * @param reward Reward item to fix @@ -104,7 +112,7 @@ export declare class QuestHelper { * @param newState State the new quest should be in when returned * @param acceptedQuest Details of accepted quest from client */ - getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): Quest; + getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): IQuestStatus; /** * Get quests that can be shown to player after starting a quest * @param startedQuestId Quest started by player @@ -161,9 +169,10 @@ export declare class QuestHelper { * @param pmcData Player profile * @param failRequest Fail quest request data * @param sessionID Session id + * @param output Client output * @returns Item event router response */ - failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string): IItemEventRouterResponse; + failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; /** * Get List of All Quests from db * NOT CLONED @@ -224,11 +233,12 @@ export declare class QuestHelper { */ protected getIntelCenterRewardBonus(pmcData: IPmcData): number; /** - * Find quest with 'findItem' requirement that needs the item tpl be handed in + * Find quest with 'findItem' condition that needs the item tpl be handed in * @param itemTpl item tpl to look for - * @returns 'FindItem' condition id + * @param questIds Quests to search through for the findItem condition + * @returns quest id with 'FindItem' condition id */ - getFindItemIdForQuestHandIn(itemTpl: string): string[]; + getFindItemConditionByQuestItem(itemTpl: string, questIds: string[], allQuests: IQuest[]): Record; /** * Add all quests to a profile with the provided statuses * @param pmcProfile profile to update diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IBotBase.d.ts index 29fd630..ee40958 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IBotBase.d.ts @@ -21,7 +21,7 @@ export interface IBotBase { BackendCounters: Record; InsuredItems: InsuredItem[]; Hideout: Hideout; - Quests: Quest[]; + Quests: IQuestStatus[]; TradersInfo: Record; UnlockedInfo: IUnlockedInfo; RagfairInfo: RagfairInfo; @@ -355,7 +355,7 @@ export declare enum SurvivorClass { PARAMEDIC = 3, SURVIVOR = 4 } -export interface Quest { +export interface IQuestStatus { qid: string; startTime: number; status: QuestStatus; diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IQuest.d.ts index c6005ca..300a027 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IQuest.d.ts @@ -32,6 +32,8 @@ export interface IQuest { changeQuestMessageText: string; /** "Pmc" or "Scav" */ side: string; + /** Status of quest to player */ + sptStatus?: QuestStatus; } export interface Conditions { Started: AvailableForConditions[]; diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index fd7801e..8591294 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,6 +1,5 @@ import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; -import { QuestStatus } from "../../../models/enums/QuestStatus"; -import { Health, Productive, Skills, TraderData } from "../common/tables/IBotBase"; +import { Health, IQuestStatus, Productive, Skills, TraderData } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; import { IQuest } from "../common/tables/IQuest"; import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests"; @@ -33,20 +32,12 @@ export interface ProfileChange { repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; changedHideoutStashes?: Record; - questsStatus: QuestStatusChange[]; + questsStatus: IQuestStatus[]; } export interface IHideoutStashItem { Id: string; Tpl: string; } -export interface QuestStatusChange { - qid: string; - startTime: number; - status: QuestStatus; - statusTimers: Record; - completedConditions: string[]; - availableAfter: number; -} export interface IWeaponBuildChange { id: string; name: string; diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts index b5a406b..65aaa97 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts @@ -23,6 +23,8 @@ export interface IBotConfig extends IBaseConfig { equipment: Record; /** Show a bots botType value after their name */ showTypeInNickname: boolean; + /** What ai brain should a normal scav use per map */ + assaultBrainType: Record>; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; /** Chance scav has fake pscav name e.g. Scav name (player name) */ diff --git a/TypeScript/4UseACustomConfigFile/types/services/ProfileFixerService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/ProfileFixerService.d.ts index e066e56..c8232fc 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/ProfileFixerService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/ProfileFixerService.d.ts @@ -1,6 +1,7 @@ import { HideoutHelper } from "../helpers/HideoutHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; @@ -22,6 +23,7 @@ export declare class ProfileFixerService { protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; + protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected timeUtil: TimeUtil; @@ -29,7 +31,7 @@ export declare class ProfileFixerService { protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix diff --git a/TypeScript/5ReplaceMethod/package.json b/TypeScript/5ReplaceMethod/package.json index b62a7b3..b241352 100644 --- a/TypeScript/5ReplaceMethod/package.json +++ b/TypeScript/5ReplaceMethod/package.json @@ -4,7 +4,7 @@ "main": "src/mod.js", "license": "MIT", "author": "Chomp", - "akiVersion": "~3.6", + "akiVersion": "~3.7", "scripts": { "setup": "npm i", "build": "node ./packageBuild.ts" diff --git a/TypeScript/5ReplaceMethod/types/controllers/BotController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/BotController.d.ts index d8f8331..c343f95 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/BotController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/BotController.d.ts @@ -72,5 +72,5 @@ export declare class BotController { * @returns cap number */ getBotCap(): number; - getPmcBotTypes(): Record>>; + getAiBotBrainTypes(): any; } diff --git a/TypeScript/5ReplaceMethod/types/controllers/HideoutController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/HideoutController.d.ts index 19d341d..877c076 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/HideoutController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/HideoutController.d.ts @@ -207,7 +207,7 @@ export declare class HideoutController { */ protected handleRecipe(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; /** - * Handles giving rewards stored in player profile to player after clicking 'get rewards' + * Handles generating case rewards and sending to player inventory * @param sessionID Session id * @param pmcData Player profile * @param request Get rewards from scavcase craft request diff --git a/TypeScript/5ReplaceMethod/types/controllers/QuestController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/QuestController.d.ts index 3e8b7dd..7d494a6 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/QuestController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/QuestController.d.ts @@ -5,6 +5,7 @@ import { QuestConditionHelper } from "../helpers/QuestConditionHelper"; import { QuestHelper } from "../helpers/QuestHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { IQuestStatus } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; @@ -23,10 +24,12 @@ import { MailSendService } from "../services/MailSendService"; import { PlayerService } from "../services/PlayerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class QuestController { protected logger: ILogger; protected timeUtil: TimeUtil; + protected jsonUtil: JsonUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; @@ -43,7 +46,7 @@ export declare class QuestController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, jsonUtil: JsonUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Handle client/quest/list * Get all quests visible to player @@ -110,6 +113,13 @@ export declare class QuestController { * @returns ItemEvent client response */ completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Return quests that have different statuses + * @param preQuestStatusus Quests before + * @param postQuestStatuses Quests after + * @returns QuestStatusChange array + */ + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; /** * Send a popup to player on successful completion of a quest * @param sessionID session id @@ -137,8 +147,9 @@ export declare class QuestController { * @param sessionID session id * @param pmcData player profile * @param questsToFail quests to fail + * @param output Client output */ - protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void; + protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[], output: IItemEventRouterResponse): void; /** * Handle QuestHandover event * @param pmcData Player profile diff --git a/TypeScript/5ReplaceMethod/types/helpers/InRaidHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/InRaidHelper.d.ts index a0987bc..bf584c2 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/InRaidHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; -import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; +import { IQuestStatus, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; @@ -72,7 +72,7 @@ export declare class InRaidHelper { * @param preRaidQuests Quests prior to starting raid * @param postRaidQuests Quest after raid */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: Quest[], postRaidQuests: Quest[]): void; + protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidQuests: IQuestStatus[]): void; protected resetSkillPointsEarnedDuringRaid(profile: IPmcData): void; /** * Take body part effects from client profile and apply to server profile diff --git a/TypeScript/5ReplaceMethod/types/helpers/ProfileHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/ProfileHelper.d.ts index a2fb099..3c33ae7 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/ProfileHelper.d.ts @@ -21,11 +21,11 @@ export declare class ProfileHelper { protected profileSnapshotService: ProfileSnapshotService; constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); /** - * Remove/reset started quest condtions in player profile + * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id - * @param conditionIds Condition ids that need to be reset/removed + * @param questConditionId Quest with condition to remove */ - resetProfileQuestCondition(sessionID: string, conditionIds: string[]): void; + removeCompletedQuestConditionFromProfile(pmcData: IPmcData, questConditionId: Record): void; /** * Get all profiles from server * @returns Dictionary of profiles diff --git a/TypeScript/5ReplaceMethod/types/helpers/QuestConditionHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/QuestConditionHelper.d.ts index 90ee560..a84bc81 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/QuestConditionHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/QuestConditionHelper.d.ts @@ -3,5 +3,6 @@ export declare class QuestConditionHelper { getQuestConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLevelConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLoyaltyConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; + getStandingConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; protected filterConditions(q: AvailableForConditions[], questType: string, furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; } diff --git a/TypeScript/5ReplaceMethod/types/helpers/QuestHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/QuestHelper.d.ts index d89efeb..e04b6e0 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/QuestHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/QuestHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; -import { Quest } from "../models/eft/common/tables/IBotBase"; +import { IQuestStatus } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; @@ -84,7 +84,15 @@ export declare class QuestHelper { * @param profile Player profile * @returns true if loyalty is high enough to fulfill quest requirement */ + traderLoyaltyLevelRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; + /** + * Check if trader has sufficient standing to fulfill quest requirement + * @param questProperties Quest props + * @param profile Player profile + * @returns true if standing is high enough to fulfill quest requirement + */ traderStandingRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; + protected compareAvailableForValues(current: number, required: number, compareMethod: string): boolean; /** * take reward item from quest and set FiR status + fix stack sizes + fix mod Ids * @param reward Reward item to fix @@ -104,7 +112,7 @@ export declare class QuestHelper { * @param newState State the new quest should be in when returned * @param acceptedQuest Details of accepted quest from client */ - getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): Quest; + getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): IQuestStatus; /** * Get quests that can be shown to player after starting a quest * @param startedQuestId Quest started by player @@ -161,9 +169,10 @@ export declare class QuestHelper { * @param pmcData Player profile * @param failRequest Fail quest request data * @param sessionID Session id + * @param output Client output * @returns Item event router response */ - failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string): IItemEventRouterResponse; + failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; /** * Get List of All Quests from db * NOT CLONED @@ -224,11 +233,12 @@ export declare class QuestHelper { */ protected getIntelCenterRewardBonus(pmcData: IPmcData): number; /** - * Find quest with 'findItem' requirement that needs the item tpl be handed in + * Find quest with 'findItem' condition that needs the item tpl be handed in * @param itemTpl item tpl to look for - * @returns 'FindItem' condition id + * @param questIds Quests to search through for the findItem condition + * @returns quest id with 'FindItem' condition id */ - getFindItemIdForQuestHandIn(itemTpl: string): string[]; + getFindItemConditionByQuestItem(itemTpl: string, questIds: string[], allQuests: IQuest[]): Record; /** * Add all quests to a profile with the provided statuses * @param pmcProfile profile to update diff --git a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IBotBase.d.ts index 29fd630..ee40958 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IBotBase.d.ts @@ -21,7 +21,7 @@ export interface IBotBase { BackendCounters: Record; InsuredItems: InsuredItem[]; Hideout: Hideout; - Quests: Quest[]; + Quests: IQuestStatus[]; TradersInfo: Record; UnlockedInfo: IUnlockedInfo; RagfairInfo: RagfairInfo; @@ -355,7 +355,7 @@ export declare enum SurvivorClass { PARAMEDIC = 3, SURVIVOR = 4 } -export interface Quest { +export interface IQuestStatus { qid: string; startTime: number; status: QuestStatus; diff --git a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IQuest.d.ts index c6005ca..300a027 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IQuest.d.ts @@ -32,6 +32,8 @@ export interface IQuest { changeQuestMessageText: string; /** "Pmc" or "Scav" */ side: string; + /** Status of quest to player */ + sptStatus?: QuestStatus; } export interface Conditions { Started: AvailableForConditions[]; diff --git a/TypeScript/5ReplaceMethod/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index fd7801e..8591294 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,6 +1,5 @@ import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; -import { QuestStatus } from "../../../models/enums/QuestStatus"; -import { Health, Productive, Skills, TraderData } from "../common/tables/IBotBase"; +import { Health, IQuestStatus, Productive, Skills, TraderData } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; import { IQuest } from "../common/tables/IQuest"; import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests"; @@ -33,20 +32,12 @@ export interface ProfileChange { repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; changedHideoutStashes?: Record; - questsStatus: QuestStatusChange[]; + questsStatus: IQuestStatus[]; } export interface IHideoutStashItem { Id: string; Tpl: string; } -export interface QuestStatusChange { - qid: string; - startTime: number; - status: QuestStatus; - statusTimers: Record; - completedConditions: string[]; - availableAfter: number; -} export interface IWeaponBuildChange { id: string; name: string; diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts index b5a406b..65aaa97 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts @@ -23,6 +23,8 @@ export interface IBotConfig extends IBaseConfig { equipment: Record; /** Show a bots botType value after their name */ showTypeInNickname: boolean; + /** What ai brain should a normal scav use per map */ + assaultBrainType: Record>; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; /** Chance scav has fake pscav name e.g. Scav name (player name) */ diff --git a/TypeScript/5ReplaceMethod/types/services/ProfileFixerService.d.ts b/TypeScript/5ReplaceMethod/types/services/ProfileFixerService.d.ts index e066e56..c8232fc 100644 --- a/TypeScript/5ReplaceMethod/types/services/ProfileFixerService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/ProfileFixerService.d.ts @@ -1,6 +1,7 @@ import { HideoutHelper } from "../helpers/HideoutHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; @@ -22,6 +23,7 @@ export declare class ProfileFixerService { protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; + protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected timeUtil: TimeUtil; @@ -29,7 +31,7 @@ export declare class ProfileFixerService { protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix diff --git a/TypeScript/6ReferenceAnotherClass/package.json b/TypeScript/6ReferenceAnotherClass/package.json index 3af2d02..8e0ca6b 100644 --- a/TypeScript/6ReferenceAnotherClass/package.json +++ b/TypeScript/6ReferenceAnotherClass/package.json @@ -4,7 +4,7 @@ "main": "src/mod.js", "license": "MIT", "author": "Chomp", - "akiVersion": "~3.6", + "akiVersion": "~3.7", "scripts": { "setup": "npm i", "build": "node ./packageBuild.ts" diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/BotController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/BotController.d.ts index d8f8331..c343f95 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/BotController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/BotController.d.ts @@ -72,5 +72,5 @@ export declare class BotController { * @returns cap number */ getBotCap(): number; - getPmcBotTypes(): Record>>; + getAiBotBrainTypes(): any; } diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/HideoutController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/HideoutController.d.ts index 19d341d..877c076 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/HideoutController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/HideoutController.d.ts @@ -207,7 +207,7 @@ export declare class HideoutController { */ protected handleRecipe(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; /** - * Handles giving rewards stored in player profile to player after clicking 'get rewards' + * Handles generating case rewards and sending to player inventory * @param sessionID Session id * @param pmcData Player profile * @param request Get rewards from scavcase craft request diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/QuestController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/QuestController.d.ts index 3e8b7dd..7d494a6 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/QuestController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/QuestController.d.ts @@ -5,6 +5,7 @@ import { QuestConditionHelper } from "../helpers/QuestConditionHelper"; import { QuestHelper } from "../helpers/QuestHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { IQuestStatus } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; @@ -23,10 +24,12 @@ import { MailSendService } from "../services/MailSendService"; import { PlayerService } from "../services/PlayerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class QuestController { protected logger: ILogger; protected timeUtil: TimeUtil; + protected jsonUtil: JsonUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; @@ -43,7 +46,7 @@ export declare class QuestController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, jsonUtil: JsonUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Handle client/quest/list * Get all quests visible to player @@ -110,6 +113,13 @@ export declare class QuestController { * @returns ItemEvent client response */ completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Return quests that have different statuses + * @param preQuestStatusus Quests before + * @param postQuestStatuses Quests after + * @returns QuestStatusChange array + */ + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; /** * Send a popup to player on successful completion of a quest * @param sessionID session id @@ -137,8 +147,9 @@ export declare class QuestController { * @param sessionID session id * @param pmcData player profile * @param questsToFail quests to fail + * @param output Client output */ - protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void; + protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[], output: IItemEventRouterResponse): void; /** * Handle QuestHandover event * @param pmcData Player profile diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/InRaidHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/InRaidHelper.d.ts index a0987bc..bf584c2 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/InRaidHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; -import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; +import { IQuestStatus, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; @@ -72,7 +72,7 @@ export declare class InRaidHelper { * @param preRaidQuests Quests prior to starting raid * @param postRaidQuests Quest after raid */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: Quest[], postRaidQuests: Quest[]): void; + protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidQuests: IQuestStatus[]): void; protected resetSkillPointsEarnedDuringRaid(profile: IPmcData): void; /** * Take body part effects from client profile and apply to server profile diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/ProfileHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/ProfileHelper.d.ts index a2fb099..3c33ae7 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/ProfileHelper.d.ts @@ -21,11 +21,11 @@ export declare class ProfileHelper { protected profileSnapshotService: ProfileSnapshotService; constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); /** - * Remove/reset started quest condtions in player profile + * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id - * @param conditionIds Condition ids that need to be reset/removed + * @param questConditionId Quest with condition to remove */ - resetProfileQuestCondition(sessionID: string, conditionIds: string[]): void; + removeCompletedQuestConditionFromProfile(pmcData: IPmcData, questConditionId: Record): void; /** * Get all profiles from server * @returns Dictionary of profiles diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/QuestConditionHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/QuestConditionHelper.d.ts index 90ee560..a84bc81 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/QuestConditionHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/QuestConditionHelper.d.ts @@ -3,5 +3,6 @@ export declare class QuestConditionHelper { getQuestConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLevelConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLoyaltyConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; + getStandingConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; protected filterConditions(q: AvailableForConditions[], questType: string, furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; } diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/QuestHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/QuestHelper.d.ts index d89efeb..e04b6e0 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/QuestHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/QuestHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; -import { Quest } from "../models/eft/common/tables/IBotBase"; +import { IQuestStatus } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; @@ -84,7 +84,15 @@ export declare class QuestHelper { * @param profile Player profile * @returns true if loyalty is high enough to fulfill quest requirement */ + traderLoyaltyLevelRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; + /** + * Check if trader has sufficient standing to fulfill quest requirement + * @param questProperties Quest props + * @param profile Player profile + * @returns true if standing is high enough to fulfill quest requirement + */ traderStandingRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; + protected compareAvailableForValues(current: number, required: number, compareMethod: string): boolean; /** * take reward item from quest and set FiR status + fix stack sizes + fix mod Ids * @param reward Reward item to fix @@ -104,7 +112,7 @@ export declare class QuestHelper { * @param newState State the new quest should be in when returned * @param acceptedQuest Details of accepted quest from client */ - getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): Quest; + getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): IQuestStatus; /** * Get quests that can be shown to player after starting a quest * @param startedQuestId Quest started by player @@ -161,9 +169,10 @@ export declare class QuestHelper { * @param pmcData Player profile * @param failRequest Fail quest request data * @param sessionID Session id + * @param output Client output * @returns Item event router response */ - failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string): IItemEventRouterResponse; + failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; /** * Get List of All Quests from db * NOT CLONED @@ -224,11 +233,12 @@ export declare class QuestHelper { */ protected getIntelCenterRewardBonus(pmcData: IPmcData): number; /** - * Find quest with 'findItem' requirement that needs the item tpl be handed in + * Find quest with 'findItem' condition that needs the item tpl be handed in * @param itemTpl item tpl to look for - * @returns 'FindItem' condition id + * @param questIds Quests to search through for the findItem condition + * @returns quest id with 'FindItem' condition id */ - getFindItemIdForQuestHandIn(itemTpl: string): string[]; + getFindItemConditionByQuestItem(itemTpl: string, questIds: string[], allQuests: IQuest[]): Record; /** * Add all quests to a profile with the provided statuses * @param pmcProfile profile to update diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IBotBase.d.ts index 29fd630..ee40958 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IBotBase.d.ts @@ -21,7 +21,7 @@ export interface IBotBase { BackendCounters: Record; InsuredItems: InsuredItem[]; Hideout: Hideout; - Quests: Quest[]; + Quests: IQuestStatus[]; TradersInfo: Record; UnlockedInfo: IUnlockedInfo; RagfairInfo: RagfairInfo; @@ -355,7 +355,7 @@ export declare enum SurvivorClass { PARAMEDIC = 3, SURVIVOR = 4 } -export interface Quest { +export interface IQuestStatus { qid: string; startTime: number; status: QuestStatus; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IQuest.d.ts index c6005ca..300a027 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IQuest.d.ts @@ -32,6 +32,8 @@ export interface IQuest { changeQuestMessageText: string; /** "Pmc" or "Scav" */ side: string; + /** Status of quest to player */ + sptStatus?: QuestStatus; } export interface Conditions { Started: AvailableForConditions[]; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index fd7801e..8591294 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,6 +1,5 @@ import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; -import { QuestStatus } from "../../../models/enums/QuestStatus"; -import { Health, Productive, Skills, TraderData } from "../common/tables/IBotBase"; +import { Health, IQuestStatus, Productive, Skills, TraderData } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; import { IQuest } from "../common/tables/IQuest"; import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests"; @@ -33,20 +32,12 @@ export interface ProfileChange { repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; changedHideoutStashes?: Record; - questsStatus: QuestStatusChange[]; + questsStatus: IQuestStatus[]; } export interface IHideoutStashItem { Id: string; Tpl: string; } -export interface QuestStatusChange { - qid: string; - startTime: number; - status: QuestStatus; - statusTimers: Record; - completedConditions: string[]; - availableAfter: number; -} export interface IWeaponBuildChange { id: string; name: string; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts index b5a406b..65aaa97 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts @@ -23,6 +23,8 @@ export interface IBotConfig extends IBaseConfig { equipment: Record; /** Show a bots botType value after their name */ showTypeInNickname: boolean; + /** What ai brain should a normal scav use per map */ + assaultBrainType: Record>; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; /** Chance scav has fake pscav name e.g. Scav name (player name) */ diff --git a/TypeScript/6ReferenceAnotherClass/types/services/ProfileFixerService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/ProfileFixerService.d.ts index e066e56..c8232fc 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/ProfileFixerService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/ProfileFixerService.d.ts @@ -1,6 +1,7 @@ import { HideoutHelper } from "../helpers/HideoutHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; @@ -22,6 +23,7 @@ export declare class ProfileFixerService { protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; + protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected timeUtil: TimeUtil; @@ -29,7 +31,7 @@ export declare class ProfileFixerService { protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix diff --git a/TypeScript/7OnLoadHook/package.json b/TypeScript/7OnLoadHook/package.json index 8a2f923..afeb108 100644 --- a/TypeScript/7OnLoadHook/package.json +++ b/TypeScript/7OnLoadHook/package.json @@ -4,7 +4,7 @@ "main": "src/mod.js", "license": "MIT", "author": "Chomp", - "akiVersion": "~3.6", + "akiVersion": "~3.7", "scripts": { "setup": "npm i", "build": "node ./packageBuild.ts" diff --git a/TypeScript/7OnLoadHook/types/controllers/BotController.d.ts b/TypeScript/7OnLoadHook/types/controllers/BotController.d.ts index d8f8331..c343f95 100644 --- a/TypeScript/7OnLoadHook/types/controllers/BotController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/BotController.d.ts @@ -72,5 +72,5 @@ export declare class BotController { * @returns cap number */ getBotCap(): number; - getPmcBotTypes(): Record>>; + getAiBotBrainTypes(): any; } diff --git a/TypeScript/7OnLoadHook/types/controllers/HideoutController.d.ts b/TypeScript/7OnLoadHook/types/controllers/HideoutController.d.ts index 19d341d..877c076 100644 --- a/TypeScript/7OnLoadHook/types/controllers/HideoutController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/HideoutController.d.ts @@ -207,7 +207,7 @@ export declare class HideoutController { */ protected handleRecipe(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; /** - * Handles giving rewards stored in player profile to player after clicking 'get rewards' + * Handles generating case rewards and sending to player inventory * @param sessionID Session id * @param pmcData Player profile * @param request Get rewards from scavcase craft request diff --git a/TypeScript/7OnLoadHook/types/controllers/QuestController.d.ts b/TypeScript/7OnLoadHook/types/controllers/QuestController.d.ts index 3e8b7dd..7d494a6 100644 --- a/TypeScript/7OnLoadHook/types/controllers/QuestController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/QuestController.d.ts @@ -5,6 +5,7 @@ import { QuestConditionHelper } from "../helpers/QuestConditionHelper"; import { QuestHelper } from "../helpers/QuestHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { IQuestStatus } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; @@ -23,10 +24,12 @@ import { MailSendService } from "../services/MailSendService"; import { PlayerService } from "../services/PlayerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class QuestController { protected logger: ILogger; protected timeUtil: TimeUtil; + protected jsonUtil: JsonUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; @@ -43,7 +46,7 @@ export declare class QuestController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, jsonUtil: JsonUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Handle client/quest/list * Get all quests visible to player @@ -110,6 +113,13 @@ export declare class QuestController { * @returns ItemEvent client response */ completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Return quests that have different statuses + * @param preQuestStatusus Quests before + * @param postQuestStatuses Quests after + * @returns QuestStatusChange array + */ + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; /** * Send a popup to player on successful completion of a quest * @param sessionID session id @@ -137,8 +147,9 @@ export declare class QuestController { * @param sessionID session id * @param pmcData player profile * @param questsToFail quests to fail + * @param output Client output */ - protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void; + protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[], output: IItemEventRouterResponse): void; /** * Handle QuestHandover event * @param pmcData Player profile diff --git a/TypeScript/7OnLoadHook/types/helpers/InRaidHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/InRaidHelper.d.ts index a0987bc..bf584c2 100644 --- a/TypeScript/7OnLoadHook/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/InRaidHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; -import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; +import { IQuestStatus, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; @@ -72,7 +72,7 @@ export declare class InRaidHelper { * @param preRaidQuests Quests prior to starting raid * @param postRaidQuests Quest after raid */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: Quest[], postRaidQuests: Quest[]): void; + protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidQuests: IQuestStatus[]): void; protected resetSkillPointsEarnedDuringRaid(profile: IPmcData): void; /** * Take body part effects from client profile and apply to server profile diff --git a/TypeScript/7OnLoadHook/types/helpers/ProfileHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/ProfileHelper.d.ts index a2fb099..3c33ae7 100644 --- a/TypeScript/7OnLoadHook/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/ProfileHelper.d.ts @@ -21,11 +21,11 @@ export declare class ProfileHelper { protected profileSnapshotService: ProfileSnapshotService; constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); /** - * Remove/reset started quest condtions in player profile + * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id - * @param conditionIds Condition ids that need to be reset/removed + * @param questConditionId Quest with condition to remove */ - resetProfileQuestCondition(sessionID: string, conditionIds: string[]): void; + removeCompletedQuestConditionFromProfile(pmcData: IPmcData, questConditionId: Record): void; /** * Get all profiles from server * @returns Dictionary of profiles diff --git a/TypeScript/7OnLoadHook/types/helpers/QuestConditionHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/QuestConditionHelper.d.ts index 90ee560..a84bc81 100644 --- a/TypeScript/7OnLoadHook/types/helpers/QuestConditionHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/QuestConditionHelper.d.ts @@ -3,5 +3,6 @@ export declare class QuestConditionHelper { getQuestConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLevelConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLoyaltyConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; + getStandingConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; protected filterConditions(q: AvailableForConditions[], questType: string, furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; } diff --git a/TypeScript/7OnLoadHook/types/helpers/QuestHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/QuestHelper.d.ts index d89efeb..e04b6e0 100644 --- a/TypeScript/7OnLoadHook/types/helpers/QuestHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/QuestHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; -import { Quest } from "../models/eft/common/tables/IBotBase"; +import { IQuestStatus } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; @@ -84,7 +84,15 @@ export declare class QuestHelper { * @param profile Player profile * @returns true if loyalty is high enough to fulfill quest requirement */ + traderLoyaltyLevelRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; + /** + * Check if trader has sufficient standing to fulfill quest requirement + * @param questProperties Quest props + * @param profile Player profile + * @returns true if standing is high enough to fulfill quest requirement + */ traderStandingRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; + protected compareAvailableForValues(current: number, required: number, compareMethod: string): boolean; /** * take reward item from quest and set FiR status + fix stack sizes + fix mod Ids * @param reward Reward item to fix @@ -104,7 +112,7 @@ export declare class QuestHelper { * @param newState State the new quest should be in when returned * @param acceptedQuest Details of accepted quest from client */ - getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): Quest; + getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): IQuestStatus; /** * Get quests that can be shown to player after starting a quest * @param startedQuestId Quest started by player @@ -161,9 +169,10 @@ export declare class QuestHelper { * @param pmcData Player profile * @param failRequest Fail quest request data * @param sessionID Session id + * @param output Client output * @returns Item event router response */ - failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string): IItemEventRouterResponse; + failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; /** * Get List of All Quests from db * NOT CLONED @@ -224,11 +233,12 @@ export declare class QuestHelper { */ protected getIntelCenterRewardBonus(pmcData: IPmcData): number; /** - * Find quest with 'findItem' requirement that needs the item tpl be handed in + * Find quest with 'findItem' condition that needs the item tpl be handed in * @param itemTpl item tpl to look for - * @returns 'FindItem' condition id + * @param questIds Quests to search through for the findItem condition + * @returns quest id with 'FindItem' condition id */ - getFindItemIdForQuestHandIn(itemTpl: string): string[]; + getFindItemConditionByQuestItem(itemTpl: string, questIds: string[], allQuests: IQuest[]): Record; /** * Add all quests to a profile with the provided statuses * @param pmcProfile profile to update diff --git a/TypeScript/7OnLoadHook/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/7OnLoadHook/types/models/eft/common/tables/IBotBase.d.ts index 29fd630..ee40958 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/common/tables/IBotBase.d.ts @@ -21,7 +21,7 @@ export interface IBotBase { BackendCounters: Record; InsuredItems: InsuredItem[]; Hideout: Hideout; - Quests: Quest[]; + Quests: IQuestStatus[]; TradersInfo: Record; UnlockedInfo: IUnlockedInfo; RagfairInfo: RagfairInfo; @@ -355,7 +355,7 @@ export declare enum SurvivorClass { PARAMEDIC = 3, SURVIVOR = 4 } -export interface Quest { +export interface IQuestStatus { qid: string; startTime: number; status: QuestStatus; diff --git a/TypeScript/7OnLoadHook/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/7OnLoadHook/types/models/eft/common/tables/IQuest.d.ts index c6005ca..300a027 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/common/tables/IQuest.d.ts @@ -32,6 +32,8 @@ export interface IQuest { changeQuestMessageText: string; /** "Pmc" or "Scav" */ side: string; + /** Status of quest to player */ + sptStatus?: QuestStatus; } export interface Conditions { Started: AvailableForConditions[]; diff --git a/TypeScript/7OnLoadHook/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/7OnLoadHook/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index fd7801e..8591294 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,6 +1,5 @@ import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; -import { QuestStatus } from "../../../models/enums/QuestStatus"; -import { Health, Productive, Skills, TraderData } from "../common/tables/IBotBase"; +import { Health, IQuestStatus, Productive, Skills, TraderData } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; import { IQuest } from "../common/tables/IQuest"; import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests"; @@ -33,20 +32,12 @@ export interface ProfileChange { repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; changedHideoutStashes?: Record; - questsStatus: QuestStatusChange[]; + questsStatus: IQuestStatus[]; } export interface IHideoutStashItem { Id: string; Tpl: string; } -export interface QuestStatusChange { - qid: string; - startTime: number; - status: QuestStatus; - statusTimers: Record; - completedConditions: string[]; - availableAfter: number; -} export interface IWeaponBuildChange { id: string; name: string; diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts index b5a406b..65aaa97 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts @@ -23,6 +23,8 @@ export interface IBotConfig extends IBaseConfig { equipment: Record; /** Show a bots botType value after their name */ showTypeInNickname: boolean; + /** What ai brain should a normal scav use per map */ + assaultBrainType: Record>; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; /** Chance scav has fake pscav name e.g. Scav name (player name) */ diff --git a/TypeScript/7OnLoadHook/types/services/ProfileFixerService.d.ts b/TypeScript/7OnLoadHook/types/services/ProfileFixerService.d.ts index e066e56..c8232fc 100644 --- a/TypeScript/7OnLoadHook/types/services/ProfileFixerService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/ProfileFixerService.d.ts @@ -1,6 +1,7 @@ import { HideoutHelper } from "../helpers/HideoutHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; @@ -22,6 +23,7 @@ export declare class ProfileFixerService { protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; + protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected timeUtil: TimeUtil; @@ -29,7 +31,7 @@ export declare class ProfileFixerService { protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix diff --git a/TypeScript/8OnUpdateHook/package.json b/TypeScript/8OnUpdateHook/package.json index 15d62e7..30421ee 100644 --- a/TypeScript/8OnUpdateHook/package.json +++ b/TypeScript/8OnUpdateHook/package.json @@ -4,7 +4,7 @@ "main": "src/mod.js", "license": "MIT", "author": "Chomp", - "akiVersion": "~3.6", + "akiVersion": "~3.7", "scripts": { "setup": "npm i", "build": "node ./packageBuild.ts" diff --git a/TypeScript/8OnUpdateHook/types/controllers/BotController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/BotController.d.ts index d8f8331..c343f95 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/BotController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/BotController.d.ts @@ -72,5 +72,5 @@ export declare class BotController { * @returns cap number */ getBotCap(): number; - getPmcBotTypes(): Record>>; + getAiBotBrainTypes(): any; } diff --git a/TypeScript/8OnUpdateHook/types/controllers/HideoutController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/HideoutController.d.ts index 19d341d..877c076 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/HideoutController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/HideoutController.d.ts @@ -207,7 +207,7 @@ export declare class HideoutController { */ protected handleRecipe(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; /** - * Handles giving rewards stored in player profile to player after clicking 'get rewards' + * Handles generating case rewards and sending to player inventory * @param sessionID Session id * @param pmcData Player profile * @param request Get rewards from scavcase craft request diff --git a/TypeScript/8OnUpdateHook/types/controllers/QuestController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/QuestController.d.ts index 3e8b7dd..7d494a6 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/QuestController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/QuestController.d.ts @@ -5,6 +5,7 @@ import { QuestConditionHelper } from "../helpers/QuestConditionHelper"; import { QuestHelper } from "../helpers/QuestHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { IQuestStatus } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; @@ -23,10 +24,12 @@ import { MailSendService } from "../services/MailSendService"; import { PlayerService } from "../services/PlayerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class QuestController { protected logger: ILogger; protected timeUtil: TimeUtil; + protected jsonUtil: JsonUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; @@ -43,7 +46,7 @@ export declare class QuestController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, jsonUtil: JsonUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Handle client/quest/list * Get all quests visible to player @@ -110,6 +113,13 @@ export declare class QuestController { * @returns ItemEvent client response */ completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Return quests that have different statuses + * @param preQuestStatusus Quests before + * @param postQuestStatuses Quests after + * @returns QuestStatusChange array + */ + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; /** * Send a popup to player on successful completion of a quest * @param sessionID session id @@ -137,8 +147,9 @@ export declare class QuestController { * @param sessionID session id * @param pmcData player profile * @param questsToFail quests to fail + * @param output Client output */ - protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void; + protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[], output: IItemEventRouterResponse): void; /** * Handle QuestHandover event * @param pmcData Player profile diff --git a/TypeScript/8OnUpdateHook/types/helpers/InRaidHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/InRaidHelper.d.ts index a0987bc..bf584c2 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/InRaidHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; -import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; +import { IQuestStatus, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; @@ -72,7 +72,7 @@ export declare class InRaidHelper { * @param preRaidQuests Quests prior to starting raid * @param postRaidQuests Quest after raid */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: Quest[], postRaidQuests: Quest[]): void; + protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidQuests: IQuestStatus[]): void; protected resetSkillPointsEarnedDuringRaid(profile: IPmcData): void; /** * Take body part effects from client profile and apply to server profile diff --git a/TypeScript/8OnUpdateHook/types/helpers/ProfileHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/ProfileHelper.d.ts index a2fb099..3c33ae7 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/ProfileHelper.d.ts @@ -21,11 +21,11 @@ export declare class ProfileHelper { protected profileSnapshotService: ProfileSnapshotService; constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); /** - * Remove/reset started quest condtions in player profile + * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id - * @param conditionIds Condition ids that need to be reset/removed + * @param questConditionId Quest with condition to remove */ - resetProfileQuestCondition(sessionID: string, conditionIds: string[]): void; + removeCompletedQuestConditionFromProfile(pmcData: IPmcData, questConditionId: Record): void; /** * Get all profiles from server * @returns Dictionary of profiles diff --git a/TypeScript/8OnUpdateHook/types/helpers/QuestConditionHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/QuestConditionHelper.d.ts index 90ee560..a84bc81 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/QuestConditionHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/QuestConditionHelper.d.ts @@ -3,5 +3,6 @@ export declare class QuestConditionHelper { getQuestConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLevelConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLoyaltyConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; + getStandingConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; protected filterConditions(q: AvailableForConditions[], questType: string, furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; } diff --git a/TypeScript/8OnUpdateHook/types/helpers/QuestHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/QuestHelper.d.ts index d89efeb..e04b6e0 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/QuestHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/QuestHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; -import { Quest } from "../models/eft/common/tables/IBotBase"; +import { IQuestStatus } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; @@ -84,7 +84,15 @@ export declare class QuestHelper { * @param profile Player profile * @returns true if loyalty is high enough to fulfill quest requirement */ + traderLoyaltyLevelRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; + /** + * Check if trader has sufficient standing to fulfill quest requirement + * @param questProperties Quest props + * @param profile Player profile + * @returns true if standing is high enough to fulfill quest requirement + */ traderStandingRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; + protected compareAvailableForValues(current: number, required: number, compareMethod: string): boolean; /** * take reward item from quest and set FiR status + fix stack sizes + fix mod Ids * @param reward Reward item to fix @@ -104,7 +112,7 @@ export declare class QuestHelper { * @param newState State the new quest should be in when returned * @param acceptedQuest Details of accepted quest from client */ - getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): Quest; + getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): IQuestStatus; /** * Get quests that can be shown to player after starting a quest * @param startedQuestId Quest started by player @@ -161,9 +169,10 @@ export declare class QuestHelper { * @param pmcData Player profile * @param failRequest Fail quest request data * @param sessionID Session id + * @param output Client output * @returns Item event router response */ - failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string): IItemEventRouterResponse; + failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; /** * Get List of All Quests from db * NOT CLONED @@ -224,11 +233,12 @@ export declare class QuestHelper { */ protected getIntelCenterRewardBonus(pmcData: IPmcData): number; /** - * Find quest with 'findItem' requirement that needs the item tpl be handed in + * Find quest with 'findItem' condition that needs the item tpl be handed in * @param itemTpl item tpl to look for - * @returns 'FindItem' condition id + * @param questIds Quests to search through for the findItem condition + * @returns quest id with 'FindItem' condition id */ - getFindItemIdForQuestHandIn(itemTpl: string): string[]; + getFindItemConditionByQuestItem(itemTpl: string, questIds: string[], allQuests: IQuest[]): Record; /** * Add all quests to a profile with the provided statuses * @param pmcProfile profile to update diff --git a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IBotBase.d.ts index 29fd630..ee40958 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IBotBase.d.ts @@ -21,7 +21,7 @@ export interface IBotBase { BackendCounters: Record; InsuredItems: InsuredItem[]; Hideout: Hideout; - Quests: Quest[]; + Quests: IQuestStatus[]; TradersInfo: Record; UnlockedInfo: IUnlockedInfo; RagfairInfo: RagfairInfo; @@ -355,7 +355,7 @@ export declare enum SurvivorClass { PARAMEDIC = 3, SURVIVOR = 4 } -export interface Quest { +export interface IQuestStatus { qid: string; startTime: number; status: QuestStatus; diff --git a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IQuest.d.ts index c6005ca..300a027 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IQuest.d.ts @@ -32,6 +32,8 @@ export interface IQuest { changeQuestMessageText: string; /** "Pmc" or "Scav" */ side: string; + /** Status of quest to player */ + sptStatus?: QuestStatus; } export interface Conditions { Started: AvailableForConditions[]; diff --git a/TypeScript/8OnUpdateHook/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index fd7801e..8591294 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,6 +1,5 @@ import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; -import { QuestStatus } from "../../../models/enums/QuestStatus"; -import { Health, Productive, Skills, TraderData } from "../common/tables/IBotBase"; +import { Health, IQuestStatus, Productive, Skills, TraderData } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; import { IQuest } from "../common/tables/IQuest"; import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests"; @@ -33,20 +32,12 @@ export interface ProfileChange { repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; changedHideoutStashes?: Record; - questsStatus: QuestStatusChange[]; + questsStatus: IQuestStatus[]; } export interface IHideoutStashItem { Id: string; Tpl: string; } -export interface QuestStatusChange { - qid: string; - startTime: number; - status: QuestStatus; - statusTimers: Record; - completedConditions: string[]; - availableAfter: number; -} export interface IWeaponBuildChange { id: string; name: string; diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts index b5a406b..65aaa97 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts @@ -23,6 +23,8 @@ export interface IBotConfig extends IBaseConfig { equipment: Record; /** Show a bots botType value after their name */ showTypeInNickname: boolean; + /** What ai brain should a normal scav use per map */ + assaultBrainType: Record>; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; /** Chance scav has fake pscav name e.g. Scav name (player name) */ diff --git a/TypeScript/8OnUpdateHook/types/services/ProfileFixerService.d.ts b/TypeScript/8OnUpdateHook/types/services/ProfileFixerService.d.ts index e066e56..c8232fc 100644 --- a/TypeScript/8OnUpdateHook/types/services/ProfileFixerService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/ProfileFixerService.d.ts @@ -1,6 +1,7 @@ import { HideoutHelper } from "../helpers/HideoutHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; @@ -22,6 +23,7 @@ export declare class ProfileFixerService { protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; + protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected timeUtil: TimeUtil; @@ -29,7 +31,7 @@ export declare class ProfileFixerService { protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix diff --git a/TypeScript/9RouterHooks/package.json b/TypeScript/9RouterHooks/package.json index f13845e..8514193 100644 --- a/TypeScript/9RouterHooks/package.json +++ b/TypeScript/9RouterHooks/package.json @@ -4,7 +4,7 @@ "main": "src/mod.js", "license": "MIT", "author": "Chomp", - "akiVersion": "~3.6", + "akiVersion": "~3.7", "scripts": { "setup": "npm i", "build": "node ./packageBuild.ts" diff --git a/TypeScript/9RouterHooks/types/controllers/BotController.d.ts b/TypeScript/9RouterHooks/types/controllers/BotController.d.ts index d8f8331..c343f95 100644 --- a/TypeScript/9RouterHooks/types/controllers/BotController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/BotController.d.ts @@ -72,5 +72,5 @@ export declare class BotController { * @returns cap number */ getBotCap(): number; - getPmcBotTypes(): Record>>; + getAiBotBrainTypes(): any; } diff --git a/TypeScript/9RouterHooks/types/controllers/HideoutController.d.ts b/TypeScript/9RouterHooks/types/controllers/HideoutController.d.ts index 19d341d..877c076 100644 --- a/TypeScript/9RouterHooks/types/controllers/HideoutController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/HideoutController.d.ts @@ -207,7 +207,7 @@ export declare class HideoutController { */ protected handleRecipe(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; /** - * Handles giving rewards stored in player profile to player after clicking 'get rewards' + * Handles generating case rewards and sending to player inventory * @param sessionID Session id * @param pmcData Player profile * @param request Get rewards from scavcase craft request diff --git a/TypeScript/9RouterHooks/types/controllers/QuestController.d.ts b/TypeScript/9RouterHooks/types/controllers/QuestController.d.ts index 3e8b7dd..7d494a6 100644 --- a/TypeScript/9RouterHooks/types/controllers/QuestController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/QuestController.d.ts @@ -5,6 +5,7 @@ import { QuestConditionHelper } from "../helpers/QuestConditionHelper"; import { QuestHelper } from "../helpers/QuestHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { IQuestStatus } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; @@ -23,10 +24,12 @@ import { MailSendService } from "../services/MailSendService"; import { PlayerService } from "../services/PlayerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class QuestController { protected logger: ILogger; protected timeUtil: TimeUtil; + protected jsonUtil: JsonUtil; protected httpResponseUtil: HttpResponseUtil; protected eventOutputHolder: EventOutputHolder; protected databaseServer: DatabaseServer; @@ -43,7 +46,7 @@ export declare class QuestController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, jsonUtil: JsonUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Handle client/quest/list * Get all quests visible to player @@ -110,6 +113,13 @@ export declare class QuestController { * @returns ItemEvent client response */ completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Return quests that have different statuses + * @param preQuestStatusus Quests before + * @param postQuestStatuses Quests after + * @returns QuestStatusChange array + */ + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[]; /** * Send a popup to player on successful completion of a quest * @param sessionID session id @@ -137,8 +147,9 @@ export declare class QuestController { * @param sessionID session id * @param pmcData player profile * @param questsToFail quests to fail + * @param output Client output */ - protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void; + protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[], output: IItemEventRouterResponse): void; /** * Handle QuestHandover event * @param pmcData Player profile diff --git a/TypeScript/9RouterHooks/types/helpers/InRaidHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/InRaidHelper.d.ts index a0987bc..bf584c2 100644 --- a/TypeScript/9RouterHooks/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/InRaidHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; -import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; +import { IQuestStatus, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; @@ -72,7 +72,7 @@ export declare class InRaidHelper { * @param preRaidQuests Quests prior to starting raid * @param postRaidQuests Quest after raid */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: Quest[], postRaidQuests: Quest[]): void; + protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidQuests: IQuestStatus[]): void; protected resetSkillPointsEarnedDuringRaid(profile: IPmcData): void; /** * Take body part effects from client profile and apply to server profile diff --git a/TypeScript/9RouterHooks/types/helpers/ProfileHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/ProfileHelper.d.ts index a2fb099..3c33ae7 100644 --- a/TypeScript/9RouterHooks/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/ProfileHelper.d.ts @@ -21,11 +21,11 @@ export declare class ProfileHelper { protected profileSnapshotService: ProfileSnapshotService; constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService); /** - * Remove/reset started quest condtions in player profile + * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id - * @param conditionIds Condition ids that need to be reset/removed + * @param questConditionId Quest with condition to remove */ - resetProfileQuestCondition(sessionID: string, conditionIds: string[]): void; + removeCompletedQuestConditionFromProfile(pmcData: IPmcData, questConditionId: Record): void; /** * Get all profiles from server * @returns Dictionary of profiles diff --git a/TypeScript/9RouterHooks/types/helpers/QuestConditionHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/QuestConditionHelper.d.ts index 90ee560..a84bc81 100644 --- a/TypeScript/9RouterHooks/types/helpers/QuestConditionHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/QuestConditionHelper.d.ts @@ -3,5 +3,6 @@ export declare class QuestConditionHelper { getQuestConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLevelConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLoyaltyConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; + getStandingConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; protected filterConditions(q: AvailableForConditions[], questType: string, furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; } diff --git a/TypeScript/9RouterHooks/types/helpers/QuestHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/QuestHelper.d.ts index d89efeb..e04b6e0 100644 --- a/TypeScript/9RouterHooks/types/helpers/QuestHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/QuestHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; -import { Quest } from "../models/eft/common/tables/IBotBase"; +import { IQuestStatus } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; @@ -84,7 +84,15 @@ export declare class QuestHelper { * @param profile Player profile * @returns true if loyalty is high enough to fulfill quest requirement */ + traderLoyaltyLevelRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; + /** + * Check if trader has sufficient standing to fulfill quest requirement + * @param questProperties Quest props + * @param profile Player profile + * @returns true if standing is high enough to fulfill quest requirement + */ traderStandingRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean; + protected compareAvailableForValues(current: number, required: number, compareMethod: string): boolean; /** * take reward item from quest and set FiR status + fix stack sizes + fix mod Ids * @param reward Reward item to fix @@ -104,7 +112,7 @@ export declare class QuestHelper { * @param newState State the new quest should be in when returned * @param acceptedQuest Details of accepted quest from client */ - getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): Quest; + getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): IQuestStatus; /** * Get quests that can be shown to player after starting a quest * @param startedQuestId Quest started by player @@ -161,9 +169,10 @@ export declare class QuestHelper { * @param pmcData Player profile * @param failRequest Fail quest request data * @param sessionID Session id + * @param output Client output * @returns Item event router response */ - failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string): IItemEventRouterResponse; + failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; /** * Get List of All Quests from db * NOT CLONED @@ -224,11 +233,12 @@ export declare class QuestHelper { */ protected getIntelCenterRewardBonus(pmcData: IPmcData): number; /** - * Find quest with 'findItem' requirement that needs the item tpl be handed in + * Find quest with 'findItem' condition that needs the item tpl be handed in * @param itemTpl item tpl to look for - * @returns 'FindItem' condition id + * @param questIds Quests to search through for the findItem condition + * @returns quest id with 'FindItem' condition id */ - getFindItemIdForQuestHandIn(itemTpl: string): string[]; + getFindItemConditionByQuestItem(itemTpl: string, questIds: string[], allQuests: IQuest[]): Record; /** * Add all quests to a profile with the provided statuses * @param pmcProfile profile to update diff --git a/TypeScript/9RouterHooks/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/9RouterHooks/types/models/eft/common/tables/IBotBase.d.ts index 29fd630..ee40958 100644 --- a/TypeScript/9RouterHooks/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/common/tables/IBotBase.d.ts @@ -21,7 +21,7 @@ export interface IBotBase { BackendCounters: Record; InsuredItems: InsuredItem[]; Hideout: Hideout; - Quests: Quest[]; + Quests: IQuestStatus[]; TradersInfo: Record; UnlockedInfo: IUnlockedInfo; RagfairInfo: RagfairInfo; @@ -355,7 +355,7 @@ export declare enum SurvivorClass { PARAMEDIC = 3, SURVIVOR = 4 } -export interface Quest { +export interface IQuestStatus { qid: string; startTime: number; status: QuestStatus; diff --git a/TypeScript/9RouterHooks/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/9RouterHooks/types/models/eft/common/tables/IQuest.d.ts index c6005ca..300a027 100644 --- a/TypeScript/9RouterHooks/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/common/tables/IQuest.d.ts @@ -32,6 +32,8 @@ export interface IQuest { changeQuestMessageText: string; /** "Pmc" or "Scav" */ side: string; + /** Status of quest to player */ + sptStatus?: QuestStatus; } export interface Conditions { Started: AvailableForConditions[]; diff --git a/TypeScript/9RouterHooks/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/9RouterHooks/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index fd7801e..8591294 100644 --- a/TypeScript/9RouterHooks/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,6 +1,5 @@ import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; -import { QuestStatus } from "../../../models/enums/QuestStatus"; -import { Health, Productive, Skills, TraderData } from "../common/tables/IBotBase"; +import { Health, IQuestStatus, Productive, Skills, TraderData } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; import { IQuest } from "../common/tables/IQuest"; import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests"; @@ -33,20 +32,12 @@ export interface ProfileChange { repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; changedHideoutStashes?: Record; - questsStatus: QuestStatusChange[]; + questsStatus: IQuestStatus[]; } export interface IHideoutStashItem { Id: string; Tpl: string; } -export interface QuestStatusChange { - qid: string; - startTime: number; - status: QuestStatus; - statusTimers: Record; - completedConditions: string[]; - availableAfter: number; -} export interface IWeaponBuildChange { id: string; name: string; diff --git a/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts index b5a406b..65aaa97 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts @@ -23,6 +23,8 @@ export interface IBotConfig extends IBaseConfig { equipment: Record; /** Show a bots botType value after their name */ showTypeInNickname: boolean; + /** What ai brain should a normal scav use per map */ + assaultBrainType: Record>; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; /** Chance scav has fake pscav name e.g. Scav name (player name) */ diff --git a/TypeScript/9RouterHooks/types/services/ProfileFixerService.d.ts b/TypeScript/9RouterHooks/types/services/ProfileFixerService.d.ts index e066e56..c8232fc 100644 --- a/TypeScript/9RouterHooks/types/services/ProfileFixerService.d.ts +++ b/TypeScript/9RouterHooks/types/services/ProfileFixerService.d.ts @@ -1,6 +1,7 @@ import { HideoutHelper } from "../helpers/HideoutHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; @@ -22,6 +23,7 @@ export declare class ProfileFixerService { protected hideoutHelper: HideoutHelper; protected inventoryHelper: InventoryHelper; protected traderHelper: TraderHelper; + protected profileHelper: ProfileHelper; protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected timeUtil: TimeUtil; @@ -29,7 +31,7 @@ export declare class ProfileFixerService { protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix