Update types and package.json version number compatibility

This commit is contained in:
Dev 2023-09-18 15:11:02 +01:00
parent d23f96f3db
commit 9932613f6b
247 changed files with 931 additions and 570 deletions

View File

@ -4,7 +4,7 @@
"main": "src/mod.js", "main": "src/mod.js",
"license": "MIT", "license": "MIT",
"author": "Chomp", "author": "Chomp",
"akiVersion": "~3.6", "akiVersion": "~3.7",
"scripts": { "scripts": {
"setup": "npm i", "setup": "npm i",
"build": "node ./packageBuild.ts" "build": "node ./packageBuild.ts"

View File

@ -72,5 +72,5 @@ export declare class BotController {
* @returns cap number * @returns cap number
*/ */
getBotCap(): number; getBotCap(): number;
getPmcBotTypes(): Record<string, Record<string, Record<string, number>>>; getAiBotBrainTypes(): any;
} }

View File

@ -207,7 +207,7 @@ export declare class HideoutController {
*/ */
protected handleRecipe(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; 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 sessionID Session id
* @param pmcData Player profile * @param pmcData Player profile
* @param request Get rewards from scavcase craft request * @param request Get rewards from scavcase craft request

View File

@ -5,6 +5,7 @@ import { QuestConditionHelper } from "../helpers/QuestConditionHelper";
import { QuestHelper } from "../helpers/QuestHelper"; import { QuestHelper } from "../helpers/QuestHelper";
import { TraderHelper } from "../helpers/TraderHelper"; import { TraderHelper } from "../helpers/TraderHelper";
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { IQuestStatus } from "../models/eft/common/tables/IBotBase";
import { Item } from "../models/eft/common/tables/IItem"; import { Item } from "../models/eft/common/tables/IItem";
import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest";
import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests";
@ -23,10 +24,12 @@ import { MailSendService } from "../services/MailSendService";
import { PlayerService } from "../services/PlayerService"; import { PlayerService } from "../services/PlayerService";
import { SeasonalEventService } from "../services/SeasonalEventService"; import { SeasonalEventService } from "../services/SeasonalEventService";
import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
export declare class QuestController { export declare class QuestController {
protected logger: ILogger; protected logger: ILogger;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected jsonUtil: JsonUtil;
protected httpResponseUtil: HttpResponseUtil; protected httpResponseUtil: HttpResponseUtil;
protected eventOutputHolder: EventOutputHolder; protected eventOutputHolder: EventOutputHolder;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
@ -43,7 +46,7 @@ export declare class QuestController {
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected questConfig: IQuestConfig; 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 * Handle client/quest/list
* Get all quests visible to player * Get all quests visible to player
@ -110,6 +113,13 @@ export declare class QuestController {
* @returns ItemEvent client response * @returns ItemEvent client response
*/ */
completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse; 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 * Send a popup to player on successful completion of a quest
* @param sessionID session id * @param sessionID session id
@ -137,8 +147,9 @@ export declare class QuestController {
* @param sessionID session id * @param sessionID session id
* @param pmcData player profile * @param pmcData player profile
* @param questsToFail quests to fail * @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 * Handle QuestHandover event
* @param pmcData Player profile * @param pmcData Player profile

View File

@ -1,5 +1,5 @@
import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; 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 { Item } from "../models/eft/common/tables/IItem";
import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData";
import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig";
@ -72,7 +72,7 @@ export declare class InRaidHelper {
* @param preRaidQuests Quests prior to starting raid * @param preRaidQuests Quests prior to starting raid
* @param postRaidQuests Quest after 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; protected resetSkillPointsEarnedDuringRaid(profile: IPmcData): void;
/** /**
* Take body part effects from client profile and apply to server profile * Take body part effects from client profile and apply to server profile

View File

@ -21,11 +21,11 @@ export declare class ProfileHelper {
protected profileSnapshotService: ProfileSnapshotService; protected profileSnapshotService: ProfileSnapshotService;
constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, 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 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<string, string>): void;
/** /**
* Get all profiles from server * Get all profiles from server
* @returns Dictionary of profiles * @returns Dictionary of profiles

View File

@ -3,5 +3,6 @@ export declare class QuestConditionHelper {
getQuestConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getQuestConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[];
getLevelConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLevelConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[];
getLoyaltyConditions(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[]; protected filterConditions(q: AvailableForConditions[], questType: string, furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[];
} }

View File

@ -1,5 +1,5 @@
import { IPmcData } from "../models/eft/common/IPmcData"; 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 { Item } from "../models/eft/common/tables/IItem";
import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
@ -84,7 +84,15 @@ export declare class QuestHelper {
* @param profile Player profile * @param profile Player profile
* @returns true if loyalty is high enough to fulfill quest requirement * @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; 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 * take reward item from quest and set FiR status + fix stack sizes + fix mod Ids
* @param reward Reward item to fix * @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 newState State the new quest should be in when returned
* @param acceptedQuest Details of accepted quest from client * @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 * Get quests that can be shown to player after starting a quest
* @param startedQuestId Quest started by player * @param startedQuestId Quest started by player
@ -161,9 +169,10 @@ export declare class QuestHelper {
* @param pmcData Player profile * @param pmcData Player profile
* @param failRequest Fail quest request data * @param failRequest Fail quest request data
* @param sessionID Session id * @param sessionID Session id
* @param output Client output
* @returns Item event router response * @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 * Get List of All Quests from db
* NOT CLONED * NOT CLONED
@ -224,11 +233,12 @@ export declare class QuestHelper {
*/ */
protected getIntelCenterRewardBonus(pmcData: IPmcData): number; 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 * @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<string, string>;
/** /**
* Add all quests to a profile with the provided statuses * Add all quests to a profile with the provided statuses
* @param pmcProfile profile to update * @param pmcProfile profile to update

View File

@ -21,7 +21,7 @@ export interface IBotBase {
BackendCounters: Record<string, BackendCounter>; BackendCounters: Record<string, BackendCounter>;
InsuredItems: InsuredItem[]; InsuredItems: InsuredItem[];
Hideout: Hideout; Hideout: Hideout;
Quests: Quest[]; Quests: IQuestStatus[];
TradersInfo: Record<string, TraderInfo>; TradersInfo: Record<string, TraderInfo>;
UnlockedInfo: IUnlockedInfo; UnlockedInfo: IUnlockedInfo;
RagfairInfo: RagfairInfo; RagfairInfo: RagfairInfo;
@ -355,7 +355,7 @@ export declare enum SurvivorClass {
PARAMEDIC = 3, PARAMEDIC = 3,
SURVIVOR = 4 SURVIVOR = 4
} }
export interface Quest { export interface IQuestStatus {
qid: string; qid: string;
startTime: number; startTime: number;
status: QuestStatus; status: QuestStatus;

View File

@ -32,6 +32,8 @@ export interface IQuest {
changeQuestMessageText: string; changeQuestMessageText: string;
/** "Pmc" or "Scav" */ /** "Pmc" or "Scav" */
side: string; side: string;
/** Status of quest to player */
sptStatus?: QuestStatus;
} }
export interface Conditions { export interface Conditions {
Started: AvailableForConditions[]; Started: AvailableForConditions[];

View File

@ -1,6 +1,5 @@
import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType";
import { QuestStatus } from "../../../models/enums/QuestStatus"; import { Health, IQuestStatus, Productive, Skills, TraderData } from "../common/tables/IBotBase";
import { Health, Productive, Skills, TraderData } from "../common/tables/IBotBase";
import { Item, Upd } from "../common/tables/IItem"; import { Item, Upd } from "../common/tables/IItem";
import { IQuest } from "../common/tables/IQuest"; import { IQuest } from "../common/tables/IQuest";
import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests"; import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests";
@ -33,20 +32,12 @@ export interface ProfileChange {
repeatableQuests?: IPmcDataRepeatableQuest[]; repeatableQuests?: IPmcDataRepeatableQuest[];
recipeUnlocked: Record<string, boolean>; recipeUnlocked: Record<string, boolean>;
changedHideoutStashes?: Record<string, IHideoutStashItem>; changedHideoutStashes?: Record<string, IHideoutStashItem>;
questsStatus: QuestStatusChange[]; questsStatus: IQuestStatus[];
} }
export interface IHideoutStashItem { export interface IHideoutStashItem {
Id: string; Id: string;
Tpl: string; Tpl: string;
} }
export interface QuestStatusChange {
qid: string;
startTime: number;
status: QuestStatus;
statusTimers: Record<QuestStatus, number>;
completedConditions: string[];
availableAfter: number;
}
export interface IWeaponBuildChange { export interface IWeaponBuildChange {
id: string; id: string;
name: string; name: string;

View File

@ -23,6 +23,8 @@ export interface IBotConfig extends IBaseConfig {
equipment: Record<string, EquipmentFilters>; equipment: Record<string, EquipmentFilters>;
/** Show a bots botType value after their name */ /** Show a bots botType value after their name */
showTypeInNickname: boolean; showTypeInNickname: boolean;
/** What ai brain should a normal scav use per map */
assaultBrainType: Record<string, Record<string, number>>;
/** Max number of bots that can be spawned in a raid at any one time */ /** Max number of bots that can be spawned in a raid at any one time */
maxBotCap: Record<string, number>; maxBotCap: Record<string, number>;
/** Chance scav has fake pscav name e.g. Scav name (player name) */ /** Chance scav has fake pscav name e.g. Scav name (player name) */

View File

@ -1,6 +1,7 @@
import { HideoutHelper } from "../helpers/HideoutHelper"; import { HideoutHelper } from "../helpers/HideoutHelper";
import { InventoryHelper } from "../helpers/InventoryHelper"; import { InventoryHelper } from "../helpers/InventoryHelper";
import { ItemHelper } from "../helpers/ItemHelper"; import { ItemHelper } from "../helpers/ItemHelper";
import { ProfileHelper } from "../helpers/ProfileHelper";
import { TraderHelper } from "../helpers/TraderHelper"; import { TraderHelper } from "../helpers/TraderHelper";
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase";
@ -22,6 +23,7 @@ export declare class ProfileFixerService {
protected hideoutHelper: HideoutHelper; protected hideoutHelper: HideoutHelper;
protected inventoryHelper: InventoryHelper; protected inventoryHelper: InventoryHelper;
protected traderHelper: TraderHelper; protected traderHelper: TraderHelper;
protected profileHelper: ProfileHelper;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
@ -29,7 +31,7 @@ export declare class ProfileFixerService {
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected coreConfig: ICoreConfig; protected coreConfig: ICoreConfig;
protected ragfairConfig: IRagfairConfig; 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 * Find issues in the pmc profile data that may cause issues and fix them
* @param pmcProfile profile to check and fix * @param pmcProfile profile to check and fix

View File

@ -5,7 +5,7 @@
"license": "MIT", "license": "MIT",
"main": "src/mod.js", "main": "src/mod.js",
"isBundleMod": true, "isBundleMod": true,
"akiVersion": "~3.6", "akiVersion": "~3.7",
"scripts": { "scripts": {
"setup": "npm i", "setup": "npm i",
"build": "node ./packageBuild.ts" "build": "node ./packageBuild.ts"

View File

@ -72,5 +72,5 @@ export declare class BotController {
* @returns cap number * @returns cap number
*/ */
getBotCap(): number; getBotCap(): number;
getPmcBotTypes(): Record<string, Record<string, Record<string, number>>>; getAiBotBrainTypes(): any;
} }

View File

@ -207,7 +207,7 @@ export declare class HideoutController {
*/ */
protected handleRecipe(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; 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 sessionID Session id
* @param pmcData Player profile * @param pmcData Player profile
* @param request Get rewards from scavcase craft request * @param request Get rewards from scavcase craft request

View File

@ -5,6 +5,7 @@ import { QuestConditionHelper } from "../helpers/QuestConditionHelper";
import { QuestHelper } from "../helpers/QuestHelper"; import { QuestHelper } from "../helpers/QuestHelper";
import { TraderHelper } from "../helpers/TraderHelper"; import { TraderHelper } from "../helpers/TraderHelper";
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { IQuestStatus } from "../models/eft/common/tables/IBotBase";
import { Item } from "../models/eft/common/tables/IItem"; import { Item } from "../models/eft/common/tables/IItem";
import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest";
import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests";
@ -23,10 +24,12 @@ import { MailSendService } from "../services/MailSendService";
import { PlayerService } from "../services/PlayerService"; import { PlayerService } from "../services/PlayerService";
import { SeasonalEventService } from "../services/SeasonalEventService"; import { SeasonalEventService } from "../services/SeasonalEventService";
import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
export declare class QuestController { export declare class QuestController {
protected logger: ILogger; protected logger: ILogger;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected jsonUtil: JsonUtil;
protected httpResponseUtil: HttpResponseUtil; protected httpResponseUtil: HttpResponseUtil;
protected eventOutputHolder: EventOutputHolder; protected eventOutputHolder: EventOutputHolder;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
@ -43,7 +46,7 @@ export declare class QuestController {
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected questConfig: IQuestConfig; 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 * Handle client/quest/list
* Get all quests visible to player * Get all quests visible to player
@ -110,6 +113,13 @@ export declare class QuestController {
* @returns ItemEvent client response * @returns ItemEvent client response
*/ */
completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse; 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 * Send a popup to player on successful completion of a quest
* @param sessionID session id * @param sessionID session id
@ -137,8 +147,9 @@ export declare class QuestController {
* @param sessionID session id * @param sessionID session id
* @param pmcData player profile * @param pmcData player profile
* @param questsToFail quests to fail * @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 * Handle QuestHandover event
* @param pmcData Player profile * @param pmcData Player profile

View File

@ -1,5 +1,5 @@
import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; 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 { Item } from "../models/eft/common/tables/IItem";
import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData";
import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig";
@ -72,7 +72,7 @@ export declare class InRaidHelper {
* @param preRaidQuests Quests prior to starting raid * @param preRaidQuests Quests prior to starting raid
* @param postRaidQuests Quest after 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; protected resetSkillPointsEarnedDuringRaid(profile: IPmcData): void;
/** /**
* Take body part effects from client profile and apply to server profile * Take body part effects from client profile and apply to server profile

View File

@ -21,11 +21,11 @@ export declare class ProfileHelper {
protected profileSnapshotService: ProfileSnapshotService; protected profileSnapshotService: ProfileSnapshotService;
constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, 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 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<string, string>): void;
/** /**
* Get all profiles from server * Get all profiles from server
* @returns Dictionary of profiles * @returns Dictionary of profiles

View File

@ -3,5 +3,6 @@ export declare class QuestConditionHelper {
getQuestConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getQuestConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[];
getLevelConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLevelConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[];
getLoyaltyConditions(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[]; protected filterConditions(q: AvailableForConditions[], questType: string, furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[];
} }

View File

@ -1,5 +1,5 @@
import { IPmcData } from "../models/eft/common/IPmcData"; 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 { Item } from "../models/eft/common/tables/IItem";
import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
@ -84,7 +84,15 @@ export declare class QuestHelper {
* @param profile Player profile * @param profile Player profile
* @returns true if loyalty is high enough to fulfill quest requirement * @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; 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 * take reward item from quest and set FiR status + fix stack sizes + fix mod Ids
* @param reward Reward item to fix * @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 newState State the new quest should be in when returned
* @param acceptedQuest Details of accepted quest from client * @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 * Get quests that can be shown to player after starting a quest
* @param startedQuestId Quest started by player * @param startedQuestId Quest started by player
@ -161,9 +169,10 @@ export declare class QuestHelper {
* @param pmcData Player profile * @param pmcData Player profile
* @param failRequest Fail quest request data * @param failRequest Fail quest request data
* @param sessionID Session id * @param sessionID Session id
* @param output Client output
* @returns Item event router response * @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 * Get List of All Quests from db
* NOT CLONED * NOT CLONED
@ -224,11 +233,12 @@ export declare class QuestHelper {
*/ */
protected getIntelCenterRewardBonus(pmcData: IPmcData): number; 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 * @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<string, string>;
/** /**
* Add all quests to a profile with the provided statuses * Add all quests to a profile with the provided statuses
* @param pmcProfile profile to update * @param pmcProfile profile to update

View File

@ -21,7 +21,7 @@ export interface IBotBase {
BackendCounters: Record<string, BackendCounter>; BackendCounters: Record<string, BackendCounter>;
InsuredItems: InsuredItem[]; InsuredItems: InsuredItem[];
Hideout: Hideout; Hideout: Hideout;
Quests: Quest[]; Quests: IQuestStatus[];
TradersInfo: Record<string, TraderInfo>; TradersInfo: Record<string, TraderInfo>;
UnlockedInfo: IUnlockedInfo; UnlockedInfo: IUnlockedInfo;
RagfairInfo: RagfairInfo; RagfairInfo: RagfairInfo;
@ -355,7 +355,7 @@ export declare enum SurvivorClass {
PARAMEDIC = 3, PARAMEDIC = 3,
SURVIVOR = 4 SURVIVOR = 4
} }
export interface Quest { export interface IQuestStatus {
qid: string; qid: string;
startTime: number; startTime: number;
status: QuestStatus; status: QuestStatus;

View File

@ -32,6 +32,8 @@ export interface IQuest {
changeQuestMessageText: string; changeQuestMessageText: string;
/** "Pmc" or "Scav" */ /** "Pmc" or "Scav" */
side: string; side: string;
/** Status of quest to player */
sptStatus?: QuestStatus;
} }
export interface Conditions { export interface Conditions {
Started: AvailableForConditions[]; Started: AvailableForConditions[];

View File

@ -1,6 +1,5 @@
import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType";
import { QuestStatus } from "../../../models/enums/QuestStatus"; import { Health, IQuestStatus, Productive, Skills, TraderData } from "../common/tables/IBotBase";
import { Health, Productive, Skills, TraderData } from "../common/tables/IBotBase";
import { Item, Upd } from "../common/tables/IItem"; import { Item, Upd } from "../common/tables/IItem";
import { IQuest } from "../common/tables/IQuest"; import { IQuest } from "../common/tables/IQuest";
import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests"; import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests";
@ -33,20 +32,12 @@ export interface ProfileChange {
repeatableQuests?: IPmcDataRepeatableQuest[]; repeatableQuests?: IPmcDataRepeatableQuest[];
recipeUnlocked: Record<string, boolean>; recipeUnlocked: Record<string, boolean>;
changedHideoutStashes?: Record<string, IHideoutStashItem>; changedHideoutStashes?: Record<string, IHideoutStashItem>;
questsStatus: QuestStatusChange[]; questsStatus: IQuestStatus[];
} }
export interface IHideoutStashItem { export interface IHideoutStashItem {
Id: string; Id: string;
Tpl: string; Tpl: string;
} }
export interface QuestStatusChange {
qid: string;
startTime: number;
status: QuestStatus;
statusTimers: Record<QuestStatus, number>;
completedConditions: string[];
availableAfter: number;
}
export interface IWeaponBuildChange { export interface IWeaponBuildChange {
id: string; id: string;
name: string; name: string;

View File

@ -23,6 +23,8 @@ export interface IBotConfig extends IBaseConfig {
equipment: Record<string, EquipmentFilters>; equipment: Record<string, EquipmentFilters>;
/** Show a bots botType value after their name */ /** Show a bots botType value after their name */
showTypeInNickname: boolean; showTypeInNickname: boolean;
/** What ai brain should a normal scav use per map */
assaultBrainType: Record<string, Record<string, number>>;
/** Max number of bots that can be spawned in a raid at any one time */ /** Max number of bots that can be spawned in a raid at any one time */
maxBotCap: Record<string, number>; maxBotCap: Record<string, number>;
/** Chance scav has fake pscav name e.g. Scav name (player name) */ /** Chance scav has fake pscav name e.g. Scav name (player name) */

View File

@ -1,6 +1,7 @@
import { HideoutHelper } from "../helpers/HideoutHelper"; import { HideoutHelper } from "../helpers/HideoutHelper";
import { InventoryHelper } from "../helpers/InventoryHelper"; import { InventoryHelper } from "../helpers/InventoryHelper";
import { ItemHelper } from "../helpers/ItemHelper"; import { ItemHelper } from "../helpers/ItemHelper";
import { ProfileHelper } from "../helpers/ProfileHelper";
import { TraderHelper } from "../helpers/TraderHelper"; import { TraderHelper } from "../helpers/TraderHelper";
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase";
@ -22,6 +23,7 @@ export declare class ProfileFixerService {
protected hideoutHelper: HideoutHelper; protected hideoutHelper: HideoutHelper;
protected inventoryHelper: InventoryHelper; protected inventoryHelper: InventoryHelper;
protected traderHelper: TraderHelper; protected traderHelper: TraderHelper;
protected profileHelper: ProfileHelper;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
@ -29,7 +31,7 @@ export declare class ProfileFixerService {
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected coreConfig: ICoreConfig; protected coreConfig: ICoreConfig;
protected ragfairConfig: IRagfairConfig; 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 * Find issues in the pmc profile data that may cause issues and fix them
* @param pmcProfile profile to check and fix * @param pmcProfile profile to check and fix

View File

@ -4,7 +4,7 @@
"main": "src/mod.js", "main": "src/mod.js",
"license": "MIT", "license": "MIT",
"author": "Chomp", "author": "Chomp",
"akiVersion": "~3.6", "akiVersion": "~3.7",
"scripts": { "scripts": {
"setup": "npm i", "setup": "npm i",
"build": "node ./packageBuild.ts" "build": "node ./packageBuild.ts"

View File

@ -72,5 +72,5 @@ export declare class BotController {
* @returns cap number * @returns cap number
*/ */
getBotCap(): number; getBotCap(): number;
getPmcBotTypes(): Record<string, Record<string, Record<string, number>>>; getAiBotBrainTypes(): any;
} }

View File

@ -207,7 +207,7 @@ export declare class HideoutController {
*/ */
protected handleRecipe(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; 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 sessionID Session id
* @param pmcData Player profile * @param pmcData Player profile
* @param request Get rewards from scavcase craft request * @param request Get rewards from scavcase craft request

View File

@ -5,6 +5,7 @@ import { QuestConditionHelper } from "../helpers/QuestConditionHelper";
import { QuestHelper } from "../helpers/QuestHelper"; import { QuestHelper } from "../helpers/QuestHelper";
import { TraderHelper } from "../helpers/TraderHelper"; import { TraderHelper } from "../helpers/TraderHelper";
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { IQuestStatus } from "../models/eft/common/tables/IBotBase";
import { Item } from "../models/eft/common/tables/IItem"; import { Item } from "../models/eft/common/tables/IItem";
import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest";
import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests";
@ -23,10 +24,12 @@ import { MailSendService } from "../services/MailSendService";
import { PlayerService } from "../services/PlayerService"; import { PlayerService } from "../services/PlayerService";
import { SeasonalEventService } from "../services/SeasonalEventService"; import { SeasonalEventService } from "../services/SeasonalEventService";
import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
export declare class QuestController { export declare class QuestController {
protected logger: ILogger; protected logger: ILogger;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected jsonUtil: JsonUtil;
protected httpResponseUtil: HttpResponseUtil; protected httpResponseUtil: HttpResponseUtil;
protected eventOutputHolder: EventOutputHolder; protected eventOutputHolder: EventOutputHolder;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
@ -43,7 +46,7 @@ export declare class QuestController {
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected questConfig: IQuestConfig; 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 * Handle client/quest/list
* Get all quests visible to player * Get all quests visible to player
@ -110,6 +113,13 @@ export declare class QuestController {
* @returns ItemEvent client response * @returns ItemEvent client response
*/ */
completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse; 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 * Send a popup to player on successful completion of a quest
* @param sessionID session id * @param sessionID session id
@ -137,8 +147,9 @@ export declare class QuestController {
* @param sessionID session id * @param sessionID session id
* @param pmcData player profile * @param pmcData player profile
* @param questsToFail quests to fail * @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 * Handle QuestHandover event
* @param pmcData Player profile * @param pmcData Player profile

View File

@ -1,5 +1,5 @@
import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; 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 { Item } from "../models/eft/common/tables/IItem";
import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData";
import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig";
@ -72,7 +72,7 @@ export declare class InRaidHelper {
* @param preRaidQuests Quests prior to starting raid * @param preRaidQuests Quests prior to starting raid
* @param postRaidQuests Quest after 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; protected resetSkillPointsEarnedDuringRaid(profile: IPmcData): void;
/** /**
* Take body part effects from client profile and apply to server profile * Take body part effects from client profile and apply to server profile

View File

@ -21,11 +21,11 @@ export declare class ProfileHelper {
protected profileSnapshotService: ProfileSnapshotService; protected profileSnapshotService: ProfileSnapshotService;
constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, 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 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<string, string>): void;
/** /**
* Get all profiles from server * Get all profiles from server
* @returns Dictionary of profiles * @returns Dictionary of profiles

View File

@ -3,5 +3,6 @@ export declare class QuestConditionHelper {
getQuestConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getQuestConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[];
getLevelConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLevelConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[];
getLoyaltyConditions(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[]; protected filterConditions(q: AvailableForConditions[], questType: string, furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[];
} }

View File

@ -1,5 +1,5 @@
import { IPmcData } from "../models/eft/common/IPmcData"; 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 { Item } from "../models/eft/common/tables/IItem";
import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
@ -84,7 +84,15 @@ export declare class QuestHelper {
* @param profile Player profile * @param profile Player profile
* @returns true if loyalty is high enough to fulfill quest requirement * @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; 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 * take reward item from quest and set FiR status + fix stack sizes + fix mod Ids
* @param reward Reward item to fix * @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 newState State the new quest should be in when returned
* @param acceptedQuest Details of accepted quest from client * @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 * Get quests that can be shown to player after starting a quest
* @param startedQuestId Quest started by player * @param startedQuestId Quest started by player
@ -161,9 +169,10 @@ export declare class QuestHelper {
* @param pmcData Player profile * @param pmcData Player profile
* @param failRequest Fail quest request data * @param failRequest Fail quest request data
* @param sessionID Session id * @param sessionID Session id
* @param output Client output
* @returns Item event router response * @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 * Get List of All Quests from db
* NOT CLONED * NOT CLONED
@ -224,11 +233,12 @@ export declare class QuestHelper {
*/ */
protected getIntelCenterRewardBonus(pmcData: IPmcData): number; 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 * @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<string, string>;
/** /**
* Add all quests to a profile with the provided statuses * Add all quests to a profile with the provided statuses
* @param pmcProfile profile to update * @param pmcProfile profile to update

View File

@ -21,7 +21,7 @@ export interface IBotBase {
BackendCounters: Record<string, BackendCounter>; BackendCounters: Record<string, BackendCounter>;
InsuredItems: InsuredItem[]; InsuredItems: InsuredItem[];
Hideout: Hideout; Hideout: Hideout;
Quests: Quest[]; Quests: IQuestStatus[];
TradersInfo: Record<string, TraderInfo>; TradersInfo: Record<string, TraderInfo>;
UnlockedInfo: IUnlockedInfo; UnlockedInfo: IUnlockedInfo;
RagfairInfo: RagfairInfo; RagfairInfo: RagfairInfo;
@ -355,7 +355,7 @@ export declare enum SurvivorClass {
PARAMEDIC = 3, PARAMEDIC = 3,
SURVIVOR = 4 SURVIVOR = 4
} }
export interface Quest { export interface IQuestStatus {
qid: string; qid: string;
startTime: number; startTime: number;
status: QuestStatus; status: QuestStatus;

View File

@ -32,6 +32,8 @@ export interface IQuest {
changeQuestMessageText: string; changeQuestMessageText: string;
/** "Pmc" or "Scav" */ /** "Pmc" or "Scav" */
side: string; side: string;
/** Status of quest to player */
sptStatus?: QuestStatus;
} }
export interface Conditions { export interface Conditions {
Started: AvailableForConditions[]; Started: AvailableForConditions[];

View File

@ -1,6 +1,5 @@
import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType";
import { QuestStatus } from "../../../models/enums/QuestStatus"; import { Health, IQuestStatus, Productive, Skills, TraderData } from "../common/tables/IBotBase";
import { Health, Productive, Skills, TraderData } from "../common/tables/IBotBase";
import { Item, Upd } from "../common/tables/IItem"; import { Item, Upd } from "../common/tables/IItem";
import { IQuest } from "../common/tables/IQuest"; import { IQuest } from "../common/tables/IQuest";
import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests"; import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests";
@ -33,20 +32,12 @@ export interface ProfileChange {
repeatableQuests?: IPmcDataRepeatableQuest[]; repeatableQuests?: IPmcDataRepeatableQuest[];
recipeUnlocked: Record<string, boolean>; recipeUnlocked: Record<string, boolean>;
changedHideoutStashes?: Record<string, IHideoutStashItem>; changedHideoutStashes?: Record<string, IHideoutStashItem>;
questsStatus: QuestStatusChange[]; questsStatus: IQuestStatus[];
} }
export interface IHideoutStashItem { export interface IHideoutStashItem {
Id: string; Id: string;
Tpl: string; Tpl: string;
} }
export interface QuestStatusChange {
qid: string;
startTime: number;
status: QuestStatus;
statusTimers: Record<QuestStatus, number>;
completedConditions: string[];
availableAfter: number;
}
export interface IWeaponBuildChange { export interface IWeaponBuildChange {
id: string; id: string;
name: string; name: string;

View File

@ -23,6 +23,8 @@ export interface IBotConfig extends IBaseConfig {
equipment: Record<string, EquipmentFilters>; equipment: Record<string, EquipmentFilters>;
/** Show a bots botType value after their name */ /** Show a bots botType value after their name */
showTypeInNickname: boolean; showTypeInNickname: boolean;
/** What ai brain should a normal scav use per map */
assaultBrainType: Record<string, Record<string, number>>;
/** Max number of bots that can be spawned in a raid at any one time */ /** Max number of bots that can be spawned in a raid at any one time */
maxBotCap: Record<string, number>; maxBotCap: Record<string, number>;
/** Chance scav has fake pscav name e.g. Scav name (player name) */ /** Chance scav has fake pscav name e.g. Scav name (player name) */

View File

@ -1,6 +1,7 @@
import { HideoutHelper } from "../helpers/HideoutHelper"; import { HideoutHelper } from "../helpers/HideoutHelper";
import { InventoryHelper } from "../helpers/InventoryHelper"; import { InventoryHelper } from "../helpers/InventoryHelper";
import { ItemHelper } from "../helpers/ItemHelper"; import { ItemHelper } from "../helpers/ItemHelper";
import { ProfileHelper } from "../helpers/ProfileHelper";
import { TraderHelper } from "../helpers/TraderHelper"; import { TraderHelper } from "../helpers/TraderHelper";
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase";
@ -22,6 +23,7 @@ export declare class ProfileFixerService {
protected hideoutHelper: HideoutHelper; protected hideoutHelper: HideoutHelper;
protected inventoryHelper: InventoryHelper; protected inventoryHelper: InventoryHelper;
protected traderHelper: TraderHelper; protected traderHelper: TraderHelper;
protected profileHelper: ProfileHelper;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
@ -29,7 +31,7 @@ export declare class ProfileFixerService {
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected coreConfig: ICoreConfig; protected coreConfig: ICoreConfig;
protected ragfairConfig: IRagfairConfig; 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 * Find issues in the pmc profile data that may cause issues and fix them
* @param pmcProfile profile to check and fix * @param pmcProfile profile to check and fix

View File

@ -4,7 +4,7 @@
"main": "src/mod.js", "main": "src/mod.js",
"license": "MIT", "license": "MIT",
"author": "Shirito", "author": "Shirito",
"akiVersion": "~3.6", "akiVersion": "~3.7",
"scripts": { "scripts": {
"setup": "npm i", "setup": "npm i",
"build": "node ./packageBuild.ts" "build": "node ./packageBuild.ts"

View File

@ -72,5 +72,5 @@ export declare class BotController {
* @returns cap number * @returns cap number
*/ */
getBotCap(): number; getBotCap(): number;
getPmcBotTypes(): Record<string, Record<string, Record<string, number>>>; getAiBotBrainTypes(): any;
} }

View File

@ -207,7 +207,7 @@ export declare class HideoutController {
*/ */
protected handleRecipe(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; 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 sessionID Session id
* @param pmcData Player profile * @param pmcData Player profile
* @param request Get rewards from scavcase craft request * @param request Get rewards from scavcase craft request

View File

@ -5,6 +5,7 @@ import { QuestConditionHelper } from "../helpers/QuestConditionHelper";
import { QuestHelper } from "../helpers/QuestHelper"; import { QuestHelper } from "../helpers/QuestHelper";
import { TraderHelper } from "../helpers/TraderHelper"; import { TraderHelper } from "../helpers/TraderHelper";
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { IQuestStatus } from "../models/eft/common/tables/IBotBase";
import { Item } from "../models/eft/common/tables/IItem"; import { Item } from "../models/eft/common/tables/IItem";
import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest";
import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests";
@ -23,10 +24,12 @@ import { MailSendService } from "../services/MailSendService";
import { PlayerService } from "../services/PlayerService"; import { PlayerService } from "../services/PlayerService";
import { SeasonalEventService } from "../services/SeasonalEventService"; import { SeasonalEventService } from "../services/SeasonalEventService";
import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
export declare class QuestController { export declare class QuestController {
protected logger: ILogger; protected logger: ILogger;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected jsonUtil: JsonUtil;
protected httpResponseUtil: HttpResponseUtil; protected httpResponseUtil: HttpResponseUtil;
protected eventOutputHolder: EventOutputHolder; protected eventOutputHolder: EventOutputHolder;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
@ -43,7 +46,7 @@ export declare class QuestController {
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected questConfig: IQuestConfig; 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 * Handle client/quest/list
* Get all quests visible to player * Get all quests visible to player
@ -110,6 +113,13 @@ export declare class QuestController {
* @returns ItemEvent client response * @returns ItemEvent client response
*/ */
completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse; 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 * Send a popup to player on successful completion of a quest
* @param sessionID session id * @param sessionID session id
@ -137,8 +147,9 @@ export declare class QuestController {
* @param sessionID session id * @param sessionID session id
* @param pmcData player profile * @param pmcData player profile
* @param questsToFail quests to fail * @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 * Handle QuestHandover event
* @param pmcData Player profile * @param pmcData Player profile

View File

@ -1,5 +1,5 @@
import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; 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 { Item } from "../models/eft/common/tables/IItem";
import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData";
import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig";
@ -72,7 +72,7 @@ export declare class InRaidHelper {
* @param preRaidQuests Quests prior to starting raid * @param preRaidQuests Quests prior to starting raid
* @param postRaidQuests Quest after 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; protected resetSkillPointsEarnedDuringRaid(profile: IPmcData): void;
/** /**
* Take body part effects from client profile and apply to server profile * Take body part effects from client profile and apply to server profile

View File

@ -21,11 +21,11 @@ export declare class ProfileHelper {
protected profileSnapshotService: ProfileSnapshotService; protected profileSnapshotService: ProfileSnapshotService;
constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, 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 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<string, string>): void;
/** /**
* Get all profiles from server * Get all profiles from server
* @returns Dictionary of profiles * @returns Dictionary of profiles

View File

@ -3,5 +3,6 @@ export declare class QuestConditionHelper {
getQuestConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getQuestConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[];
getLevelConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLevelConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[];
getLoyaltyConditions(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[]; protected filterConditions(q: AvailableForConditions[], questType: string, furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[];
} }

View File

@ -1,5 +1,5 @@
import { IPmcData } from "../models/eft/common/IPmcData"; 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 { Item } from "../models/eft/common/tables/IItem";
import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
@ -84,7 +84,15 @@ export declare class QuestHelper {
* @param profile Player profile * @param profile Player profile
* @returns true if loyalty is high enough to fulfill quest requirement * @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; 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 * take reward item from quest and set FiR status + fix stack sizes + fix mod Ids
* @param reward Reward item to fix * @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 newState State the new quest should be in when returned
* @param acceptedQuest Details of accepted quest from client * @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 * Get quests that can be shown to player after starting a quest
* @param startedQuestId Quest started by player * @param startedQuestId Quest started by player
@ -161,9 +169,10 @@ export declare class QuestHelper {
* @param pmcData Player profile * @param pmcData Player profile
* @param failRequest Fail quest request data * @param failRequest Fail quest request data
* @param sessionID Session id * @param sessionID Session id
* @param output Client output
* @returns Item event router response * @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 * Get List of All Quests from db
* NOT CLONED * NOT CLONED
@ -224,11 +233,12 @@ export declare class QuestHelper {
*/ */
protected getIntelCenterRewardBonus(pmcData: IPmcData): number; 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 * @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<string, string>;
/** /**
* Add all quests to a profile with the provided statuses * Add all quests to a profile with the provided statuses
* @param pmcProfile profile to update * @param pmcProfile profile to update

View File

@ -21,7 +21,7 @@ export interface IBotBase {
BackendCounters: Record<string, BackendCounter>; BackendCounters: Record<string, BackendCounter>;
InsuredItems: InsuredItem[]; InsuredItems: InsuredItem[];
Hideout: Hideout; Hideout: Hideout;
Quests: Quest[]; Quests: IQuestStatus[];
TradersInfo: Record<string, TraderInfo>; TradersInfo: Record<string, TraderInfo>;
UnlockedInfo: IUnlockedInfo; UnlockedInfo: IUnlockedInfo;
RagfairInfo: RagfairInfo; RagfairInfo: RagfairInfo;
@ -355,7 +355,7 @@ export declare enum SurvivorClass {
PARAMEDIC = 3, PARAMEDIC = 3,
SURVIVOR = 4 SURVIVOR = 4
} }
export interface Quest { export interface IQuestStatus {
qid: string; qid: string;
startTime: number; startTime: number;
status: QuestStatus; status: QuestStatus;

View File

@ -32,6 +32,8 @@ export interface IQuest {
changeQuestMessageText: string; changeQuestMessageText: string;
/** "Pmc" or "Scav" */ /** "Pmc" or "Scav" */
side: string; side: string;
/** Status of quest to player */
sptStatus?: QuestStatus;
} }
export interface Conditions { export interface Conditions {
Started: AvailableForConditions[]; Started: AvailableForConditions[];

View File

@ -1,6 +1,5 @@
import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType";
import { QuestStatus } from "../../../models/enums/QuestStatus"; import { Health, IQuestStatus, Productive, Skills, TraderData } from "../common/tables/IBotBase";
import { Health, Productive, Skills, TraderData } from "../common/tables/IBotBase";
import { Item, Upd } from "../common/tables/IItem"; import { Item, Upd } from "../common/tables/IItem";
import { IQuest } from "../common/tables/IQuest"; import { IQuest } from "../common/tables/IQuest";
import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests"; import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests";
@ -33,20 +32,12 @@ export interface ProfileChange {
repeatableQuests?: IPmcDataRepeatableQuest[]; repeatableQuests?: IPmcDataRepeatableQuest[];
recipeUnlocked: Record<string, boolean>; recipeUnlocked: Record<string, boolean>;
changedHideoutStashes?: Record<string, IHideoutStashItem>; changedHideoutStashes?: Record<string, IHideoutStashItem>;
questsStatus: QuestStatusChange[]; questsStatus: IQuestStatus[];
} }
export interface IHideoutStashItem { export interface IHideoutStashItem {
Id: string; Id: string;
Tpl: string; Tpl: string;
} }
export interface QuestStatusChange {
qid: string;
startTime: number;
status: QuestStatus;
statusTimers: Record<QuestStatus, number>;
completedConditions: string[];
availableAfter: number;
}
export interface IWeaponBuildChange { export interface IWeaponBuildChange {
id: string; id: string;
name: string; name: string;

View File

@ -23,6 +23,8 @@ export interface IBotConfig extends IBaseConfig {
equipment: Record<string, EquipmentFilters>; equipment: Record<string, EquipmentFilters>;
/** Show a bots botType value after their name */ /** Show a bots botType value after their name */
showTypeInNickname: boolean; showTypeInNickname: boolean;
/** What ai brain should a normal scav use per map */
assaultBrainType: Record<string, Record<string, number>>;
/** Max number of bots that can be spawned in a raid at any one time */ /** Max number of bots that can be spawned in a raid at any one time */
maxBotCap: Record<string, number>; maxBotCap: Record<string, number>;
/** Chance scav has fake pscav name e.g. Scav name (player name) */ /** Chance scav has fake pscav name e.g. Scav name (player name) */

View File

@ -1,6 +1,7 @@
import { HideoutHelper } from "../helpers/HideoutHelper"; import { HideoutHelper } from "../helpers/HideoutHelper";
import { InventoryHelper } from "../helpers/InventoryHelper"; import { InventoryHelper } from "../helpers/InventoryHelper";
import { ItemHelper } from "../helpers/ItemHelper"; import { ItemHelper } from "../helpers/ItemHelper";
import { ProfileHelper } from "../helpers/ProfileHelper";
import { TraderHelper } from "../helpers/TraderHelper"; import { TraderHelper } from "../helpers/TraderHelper";
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase";
@ -22,6 +23,7 @@ export declare class ProfileFixerService {
protected hideoutHelper: HideoutHelper; protected hideoutHelper: HideoutHelper;
protected inventoryHelper: InventoryHelper; protected inventoryHelper: InventoryHelper;
protected traderHelper: TraderHelper; protected traderHelper: TraderHelper;
protected profileHelper: ProfileHelper;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
@ -29,7 +31,7 @@ export declare class ProfileFixerService {
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected coreConfig: ICoreConfig; protected coreConfig: ICoreConfig;
protected ragfairConfig: IRagfairConfig; 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 * Find issues in the pmc profile data that may cause issues and fix them
* @param pmcProfile profile to check and fix * @param pmcProfile profile to check and fix

View File

@ -4,7 +4,7 @@
"main": "src/mod.js", "main": "src/mod.js",
"license": "MIT", "license": "MIT",
"author": "Chomp", "author": "Chomp",
"akiVersion": "~3.6", "akiVersion": "~3.7",
"scripts": { "scripts": {
"setup": "npm i", "setup": "npm i",
"build": "node ./packageBuild.ts" "build": "node ./packageBuild.ts"

View File

@ -72,5 +72,5 @@ export declare class BotController {
* @returns cap number * @returns cap number
*/ */
getBotCap(): number; getBotCap(): number;
getPmcBotTypes(): Record<string, Record<string, Record<string, number>>>; getAiBotBrainTypes(): any;
} }

View File

@ -207,7 +207,7 @@ export declare class HideoutController {
*/ */
protected handleRecipe(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; 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 sessionID Session id
* @param pmcData Player profile * @param pmcData Player profile
* @param request Get rewards from scavcase craft request * @param request Get rewards from scavcase craft request

View File

@ -5,6 +5,7 @@ import { QuestConditionHelper } from "../helpers/QuestConditionHelper";
import { QuestHelper } from "../helpers/QuestHelper"; import { QuestHelper } from "../helpers/QuestHelper";
import { TraderHelper } from "../helpers/TraderHelper"; import { TraderHelper } from "../helpers/TraderHelper";
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { IQuestStatus } from "../models/eft/common/tables/IBotBase";
import { Item } from "../models/eft/common/tables/IItem"; import { Item } from "../models/eft/common/tables/IItem";
import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest";
import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests";
@ -23,10 +24,12 @@ import { MailSendService } from "../services/MailSendService";
import { PlayerService } from "../services/PlayerService"; import { PlayerService } from "../services/PlayerService";
import { SeasonalEventService } from "../services/SeasonalEventService"; import { SeasonalEventService } from "../services/SeasonalEventService";
import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
export declare class QuestController { export declare class QuestController {
protected logger: ILogger; protected logger: ILogger;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected jsonUtil: JsonUtil;
protected httpResponseUtil: HttpResponseUtil; protected httpResponseUtil: HttpResponseUtil;
protected eventOutputHolder: EventOutputHolder; protected eventOutputHolder: EventOutputHolder;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
@ -43,7 +46,7 @@ export declare class QuestController {
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected questConfig: IQuestConfig; 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 * Handle client/quest/list
* Get all quests visible to player * Get all quests visible to player
@ -110,6 +113,13 @@ export declare class QuestController {
* @returns ItemEvent client response * @returns ItemEvent client response
*/ */
completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse; 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 * Send a popup to player on successful completion of a quest
* @param sessionID session id * @param sessionID session id
@ -137,8 +147,9 @@ export declare class QuestController {
* @param sessionID session id * @param sessionID session id
* @param pmcData player profile * @param pmcData player profile
* @param questsToFail quests to fail * @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 * Handle QuestHandover event
* @param pmcData Player profile * @param pmcData Player profile

View File

@ -1,5 +1,5 @@
import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; 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 { Item } from "../models/eft/common/tables/IItem";
import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData";
import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig";
@ -72,7 +72,7 @@ export declare class InRaidHelper {
* @param preRaidQuests Quests prior to starting raid * @param preRaidQuests Quests prior to starting raid
* @param postRaidQuests Quest after 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; protected resetSkillPointsEarnedDuringRaid(profile: IPmcData): void;
/** /**
* Take body part effects from client profile and apply to server profile * Take body part effects from client profile and apply to server profile

View File

@ -21,11 +21,11 @@ export declare class ProfileHelper {
protected profileSnapshotService: ProfileSnapshotService; protected profileSnapshotService: ProfileSnapshotService;
constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, 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 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<string, string>): void;
/** /**
* Get all profiles from server * Get all profiles from server
* @returns Dictionary of profiles * @returns Dictionary of profiles

View File

@ -3,5 +3,6 @@ export declare class QuestConditionHelper {
getQuestConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getQuestConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[];
getLevelConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLevelConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[];
getLoyaltyConditions(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[]; protected filterConditions(q: AvailableForConditions[], questType: string, furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[];
} }

View File

@ -1,5 +1,5 @@
import { IPmcData } from "../models/eft/common/IPmcData"; 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 { Item } from "../models/eft/common/tables/IItem";
import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
@ -84,7 +84,15 @@ export declare class QuestHelper {
* @param profile Player profile * @param profile Player profile
* @returns true if loyalty is high enough to fulfill quest requirement * @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; 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 * take reward item from quest and set FiR status + fix stack sizes + fix mod Ids
* @param reward Reward item to fix * @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 newState State the new quest should be in when returned
* @param acceptedQuest Details of accepted quest from client * @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 * Get quests that can be shown to player after starting a quest
* @param startedQuestId Quest started by player * @param startedQuestId Quest started by player
@ -161,9 +169,10 @@ export declare class QuestHelper {
* @param pmcData Player profile * @param pmcData Player profile
* @param failRequest Fail quest request data * @param failRequest Fail quest request data
* @param sessionID Session id * @param sessionID Session id
* @param output Client output
* @returns Item event router response * @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 * Get List of All Quests from db
* NOT CLONED * NOT CLONED
@ -224,11 +233,12 @@ export declare class QuestHelper {
*/ */
protected getIntelCenterRewardBonus(pmcData: IPmcData): number; 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 * @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<string, string>;
/** /**
* Add all quests to a profile with the provided statuses * Add all quests to a profile with the provided statuses
* @param pmcProfile profile to update * @param pmcProfile profile to update

View File

@ -21,7 +21,7 @@ export interface IBotBase {
BackendCounters: Record<string, BackendCounter>; BackendCounters: Record<string, BackendCounter>;
InsuredItems: InsuredItem[]; InsuredItems: InsuredItem[];
Hideout: Hideout; Hideout: Hideout;
Quests: Quest[]; Quests: IQuestStatus[];
TradersInfo: Record<string, TraderInfo>; TradersInfo: Record<string, TraderInfo>;
UnlockedInfo: IUnlockedInfo; UnlockedInfo: IUnlockedInfo;
RagfairInfo: RagfairInfo; RagfairInfo: RagfairInfo;
@ -355,7 +355,7 @@ export declare enum SurvivorClass {
PARAMEDIC = 3, PARAMEDIC = 3,
SURVIVOR = 4 SURVIVOR = 4
} }
export interface Quest { export interface IQuestStatus {
qid: string; qid: string;
startTime: number; startTime: number;
status: QuestStatus; status: QuestStatus;

View File

@ -32,6 +32,8 @@ export interface IQuest {
changeQuestMessageText: string; changeQuestMessageText: string;
/** "Pmc" or "Scav" */ /** "Pmc" or "Scav" */
side: string; side: string;
/** Status of quest to player */
sptStatus?: QuestStatus;
} }
export interface Conditions { export interface Conditions {
Started: AvailableForConditions[]; Started: AvailableForConditions[];

View File

@ -1,6 +1,5 @@
import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType";
import { QuestStatus } from "../../../models/enums/QuestStatus"; import { Health, IQuestStatus, Productive, Skills, TraderData } from "../common/tables/IBotBase";
import { Health, Productive, Skills, TraderData } from "../common/tables/IBotBase";
import { Item, Upd } from "../common/tables/IItem"; import { Item, Upd } from "../common/tables/IItem";
import { IQuest } from "../common/tables/IQuest"; import { IQuest } from "../common/tables/IQuest";
import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests"; import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests";
@ -33,20 +32,12 @@ export interface ProfileChange {
repeatableQuests?: IPmcDataRepeatableQuest[]; repeatableQuests?: IPmcDataRepeatableQuest[];
recipeUnlocked: Record<string, boolean>; recipeUnlocked: Record<string, boolean>;
changedHideoutStashes?: Record<string, IHideoutStashItem>; changedHideoutStashes?: Record<string, IHideoutStashItem>;
questsStatus: QuestStatusChange[]; questsStatus: IQuestStatus[];
} }
export interface IHideoutStashItem { export interface IHideoutStashItem {
Id: string; Id: string;
Tpl: string; Tpl: string;
} }
export interface QuestStatusChange {
qid: string;
startTime: number;
status: QuestStatus;
statusTimers: Record<QuestStatus, number>;
completedConditions: string[];
availableAfter: number;
}
export interface IWeaponBuildChange { export interface IWeaponBuildChange {
id: string; id: string;
name: string; name: string;

View File

@ -23,6 +23,8 @@ export interface IBotConfig extends IBaseConfig {
equipment: Record<string, EquipmentFilters>; equipment: Record<string, EquipmentFilters>;
/** Show a bots botType value after their name */ /** Show a bots botType value after their name */
showTypeInNickname: boolean; showTypeInNickname: boolean;
/** What ai brain should a normal scav use per map */
assaultBrainType: Record<string, Record<string, number>>;
/** Max number of bots that can be spawned in a raid at any one time */ /** Max number of bots that can be spawned in a raid at any one time */
maxBotCap: Record<string, number>; maxBotCap: Record<string, number>;
/** Chance scav has fake pscav name e.g. Scav name (player name) */ /** Chance scav has fake pscav name e.g. Scav name (player name) */

View File

@ -1,6 +1,7 @@
import { HideoutHelper } from "../helpers/HideoutHelper"; import { HideoutHelper } from "../helpers/HideoutHelper";
import { InventoryHelper } from "../helpers/InventoryHelper"; import { InventoryHelper } from "../helpers/InventoryHelper";
import { ItemHelper } from "../helpers/ItemHelper"; import { ItemHelper } from "../helpers/ItemHelper";
import { ProfileHelper } from "../helpers/ProfileHelper";
import { TraderHelper } from "../helpers/TraderHelper"; import { TraderHelper } from "../helpers/TraderHelper";
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase";
@ -22,6 +23,7 @@ export declare class ProfileFixerService {
protected hideoutHelper: HideoutHelper; protected hideoutHelper: HideoutHelper;
protected inventoryHelper: InventoryHelper; protected inventoryHelper: InventoryHelper;
protected traderHelper: TraderHelper; protected traderHelper: TraderHelper;
protected profileHelper: ProfileHelper;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
@ -29,7 +31,7 @@ export declare class ProfileFixerService {
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected coreConfig: ICoreConfig; protected coreConfig: ICoreConfig;
protected ragfairConfig: IRagfairConfig; 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 * Find issues in the pmc profile data that may cause issues and fix them
* @param pmcProfile profile to check and fix * @param pmcProfile profile to check and fix

View File

@ -4,7 +4,7 @@
"main": "src/mod.js", "main": "src/mod.js",
"license": "MIT", "license": "MIT",
"author": "Alex", "author": "Alex",
"akiVersion": "~3.6", "akiVersion": "~3.7",
"scripts": { "scripts": {
"setup": "npm i", "setup": "npm i",
"build": "node ./packageBuild.ts" "build": "node ./packageBuild.ts"

View File

@ -72,5 +72,5 @@ export declare class BotController {
* @returns cap number * @returns cap number
*/ */
getBotCap(): number; getBotCap(): number;
getPmcBotTypes(): Record<string, Record<string, Record<string, number>>>; getAiBotBrainTypes(): any;
} }

View File

@ -207,7 +207,7 @@ export declare class HideoutController {
*/ */
protected handleRecipe(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; 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 sessionID Session id
* @param pmcData Player profile * @param pmcData Player profile
* @param request Get rewards from scavcase craft request * @param request Get rewards from scavcase craft request

View File

@ -5,6 +5,7 @@ import { QuestConditionHelper } from "../helpers/QuestConditionHelper";
import { QuestHelper } from "../helpers/QuestHelper"; import { QuestHelper } from "../helpers/QuestHelper";
import { TraderHelper } from "../helpers/TraderHelper"; import { TraderHelper } from "../helpers/TraderHelper";
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { IQuestStatus } from "../models/eft/common/tables/IBotBase";
import { Item } from "../models/eft/common/tables/IItem"; import { Item } from "../models/eft/common/tables/IItem";
import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest";
import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests";
@ -23,10 +24,12 @@ import { MailSendService } from "../services/MailSendService";
import { PlayerService } from "../services/PlayerService"; import { PlayerService } from "../services/PlayerService";
import { SeasonalEventService } from "../services/SeasonalEventService"; import { SeasonalEventService } from "../services/SeasonalEventService";
import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
export declare class QuestController { export declare class QuestController {
protected logger: ILogger; protected logger: ILogger;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected jsonUtil: JsonUtil;
protected httpResponseUtil: HttpResponseUtil; protected httpResponseUtil: HttpResponseUtil;
protected eventOutputHolder: EventOutputHolder; protected eventOutputHolder: EventOutputHolder;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
@ -43,7 +46,7 @@ export declare class QuestController {
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected questConfig: IQuestConfig; 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 * Handle client/quest/list
* Get all quests visible to player * Get all quests visible to player
@ -110,6 +113,13 @@ export declare class QuestController {
* @returns ItemEvent client response * @returns ItemEvent client response
*/ */
completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse; 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 * Send a popup to player on successful completion of a quest
* @param sessionID session id * @param sessionID session id
@ -137,8 +147,9 @@ export declare class QuestController {
* @param sessionID session id * @param sessionID session id
* @param pmcData player profile * @param pmcData player profile
* @param questsToFail quests to fail * @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 * Handle QuestHandover event
* @param pmcData Player profile * @param pmcData Player profile

View File

@ -1,5 +1,5 @@
import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; 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 { Item } from "../models/eft/common/tables/IItem";
import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData";
import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig";
@ -72,7 +72,7 @@ export declare class InRaidHelper {
* @param preRaidQuests Quests prior to starting raid * @param preRaidQuests Quests prior to starting raid
* @param postRaidQuests Quest after 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; protected resetSkillPointsEarnedDuringRaid(profile: IPmcData): void;
/** /**
* Take body part effects from client profile and apply to server profile * Take body part effects from client profile and apply to server profile

View File

@ -21,11 +21,11 @@ export declare class ProfileHelper {
protected profileSnapshotService: ProfileSnapshotService; protected profileSnapshotService: ProfileSnapshotService;
constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, 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 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<string, string>): void;
/** /**
* Get all profiles from server * Get all profiles from server
* @returns Dictionary of profiles * @returns Dictionary of profiles

View File

@ -3,5 +3,6 @@ export declare class QuestConditionHelper {
getQuestConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getQuestConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[];
getLevelConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLevelConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[];
getLoyaltyConditions(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[]; protected filterConditions(q: AvailableForConditions[], questType: string, furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[];
} }

View File

@ -1,5 +1,5 @@
import { IPmcData } from "../models/eft/common/IPmcData"; 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 { Item } from "../models/eft/common/tables/IItem";
import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
@ -84,7 +84,15 @@ export declare class QuestHelper {
* @param profile Player profile * @param profile Player profile
* @returns true if loyalty is high enough to fulfill quest requirement * @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; 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 * take reward item from quest and set FiR status + fix stack sizes + fix mod Ids
* @param reward Reward item to fix * @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 newState State the new quest should be in when returned
* @param acceptedQuest Details of accepted quest from client * @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 * Get quests that can be shown to player after starting a quest
* @param startedQuestId Quest started by player * @param startedQuestId Quest started by player
@ -161,9 +169,10 @@ export declare class QuestHelper {
* @param pmcData Player profile * @param pmcData Player profile
* @param failRequest Fail quest request data * @param failRequest Fail quest request data
* @param sessionID Session id * @param sessionID Session id
* @param output Client output
* @returns Item event router response * @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 * Get List of All Quests from db
* NOT CLONED * NOT CLONED
@ -224,11 +233,12 @@ export declare class QuestHelper {
*/ */
protected getIntelCenterRewardBonus(pmcData: IPmcData): number; 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 * @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<string, string>;
/** /**
* Add all quests to a profile with the provided statuses * Add all quests to a profile with the provided statuses
* @param pmcProfile profile to update * @param pmcProfile profile to update

View File

@ -21,7 +21,7 @@ export interface IBotBase {
BackendCounters: Record<string, BackendCounter>; BackendCounters: Record<string, BackendCounter>;
InsuredItems: InsuredItem[]; InsuredItems: InsuredItem[];
Hideout: Hideout; Hideout: Hideout;
Quests: Quest[]; Quests: IQuestStatus[];
TradersInfo: Record<string, TraderInfo>; TradersInfo: Record<string, TraderInfo>;
UnlockedInfo: IUnlockedInfo; UnlockedInfo: IUnlockedInfo;
RagfairInfo: RagfairInfo; RagfairInfo: RagfairInfo;
@ -355,7 +355,7 @@ export declare enum SurvivorClass {
PARAMEDIC = 3, PARAMEDIC = 3,
SURVIVOR = 4 SURVIVOR = 4
} }
export interface Quest { export interface IQuestStatus {
qid: string; qid: string;
startTime: number; startTime: number;
status: QuestStatus; status: QuestStatus;

View File

@ -32,6 +32,8 @@ export interface IQuest {
changeQuestMessageText: string; changeQuestMessageText: string;
/** "Pmc" or "Scav" */ /** "Pmc" or "Scav" */
side: string; side: string;
/** Status of quest to player */
sptStatus?: QuestStatus;
} }
export interface Conditions { export interface Conditions {
Started: AvailableForConditions[]; Started: AvailableForConditions[];

View File

@ -1,6 +1,5 @@
import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType";
import { QuestStatus } from "../../../models/enums/QuestStatus"; import { Health, IQuestStatus, Productive, Skills, TraderData } from "../common/tables/IBotBase";
import { Health, Productive, Skills, TraderData } from "../common/tables/IBotBase";
import { Item, Upd } from "../common/tables/IItem"; import { Item, Upd } from "../common/tables/IItem";
import { IQuest } from "../common/tables/IQuest"; import { IQuest } from "../common/tables/IQuest";
import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests"; import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests";
@ -33,20 +32,12 @@ export interface ProfileChange {
repeatableQuests?: IPmcDataRepeatableQuest[]; repeatableQuests?: IPmcDataRepeatableQuest[];
recipeUnlocked: Record<string, boolean>; recipeUnlocked: Record<string, boolean>;
changedHideoutStashes?: Record<string, IHideoutStashItem>; changedHideoutStashes?: Record<string, IHideoutStashItem>;
questsStatus: QuestStatusChange[]; questsStatus: IQuestStatus[];
} }
export interface IHideoutStashItem { export interface IHideoutStashItem {
Id: string; Id: string;
Tpl: string; Tpl: string;
} }
export interface QuestStatusChange {
qid: string;
startTime: number;
status: QuestStatus;
statusTimers: Record<QuestStatus, number>;
completedConditions: string[];
availableAfter: number;
}
export interface IWeaponBuildChange { export interface IWeaponBuildChange {
id: string; id: string;
name: string; name: string;

View File

@ -23,6 +23,8 @@ export interface IBotConfig extends IBaseConfig {
equipment: Record<string, EquipmentFilters>; equipment: Record<string, EquipmentFilters>;
/** Show a bots botType value after their name */ /** Show a bots botType value after their name */
showTypeInNickname: boolean; showTypeInNickname: boolean;
/** What ai brain should a normal scav use per map */
assaultBrainType: Record<string, Record<string, number>>;
/** Max number of bots that can be spawned in a raid at any one time */ /** Max number of bots that can be spawned in a raid at any one time */
maxBotCap: Record<string, number>; maxBotCap: Record<string, number>;
/** Chance scav has fake pscav name e.g. Scav name (player name) */ /** Chance scav has fake pscav name e.g. Scav name (player name) */

View File

@ -1,6 +1,7 @@
import { HideoutHelper } from "../helpers/HideoutHelper"; import { HideoutHelper } from "../helpers/HideoutHelper";
import { InventoryHelper } from "../helpers/InventoryHelper"; import { InventoryHelper } from "../helpers/InventoryHelper";
import { ItemHelper } from "../helpers/ItemHelper"; import { ItemHelper } from "../helpers/ItemHelper";
import { ProfileHelper } from "../helpers/ProfileHelper";
import { TraderHelper } from "../helpers/TraderHelper"; import { TraderHelper } from "../helpers/TraderHelper";
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase";
@ -22,6 +23,7 @@ export declare class ProfileFixerService {
protected hideoutHelper: HideoutHelper; protected hideoutHelper: HideoutHelper;
protected inventoryHelper: InventoryHelper; protected inventoryHelper: InventoryHelper;
protected traderHelper: TraderHelper; protected traderHelper: TraderHelper;
protected profileHelper: ProfileHelper;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
@ -29,7 +31,7 @@ export declare class ProfileFixerService {
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected coreConfig: ICoreConfig; protected coreConfig: ICoreConfig;
protected ragfairConfig: IRagfairConfig; 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 * Find issues in the pmc profile data that may cause issues and fix them
* @param pmcProfile profile to check and fix * @param pmcProfile profile to check and fix

View File

@ -4,7 +4,7 @@
"main": "src/mod.js", "main": "src/mod.js",
"license": "MIT", "license": "MIT",
"author": "Chomp", "author": "Chomp",
"akiVersion": "~3.6", "akiVersion": "~3.7",
"scripts": { "scripts": {
"setup": "npm i", "setup": "npm i",
"build": "node ./packageBuild.ts" "build": "node ./packageBuild.ts"

View File

@ -72,5 +72,5 @@ export declare class BotController {
* @returns cap number * @returns cap number
*/ */
getBotCap(): number; getBotCap(): number;
getPmcBotTypes(): Record<string, Record<string, Record<string, number>>>; getAiBotBrainTypes(): any;
} }

View File

@ -207,7 +207,7 @@ export declare class HideoutController {
*/ */
protected handleRecipe(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; 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 sessionID Session id
* @param pmcData Player profile * @param pmcData Player profile
* @param request Get rewards from scavcase craft request * @param request Get rewards from scavcase craft request

View File

@ -5,6 +5,7 @@ import { QuestConditionHelper } from "../helpers/QuestConditionHelper";
import { QuestHelper } from "../helpers/QuestHelper"; import { QuestHelper } from "../helpers/QuestHelper";
import { TraderHelper } from "../helpers/TraderHelper"; import { TraderHelper } from "../helpers/TraderHelper";
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { IQuestStatus } from "../models/eft/common/tables/IBotBase";
import { Item } from "../models/eft/common/tables/IItem"; import { Item } from "../models/eft/common/tables/IItem";
import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest";
import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests";
@ -23,10 +24,12 @@ import { MailSendService } from "../services/MailSendService";
import { PlayerService } from "../services/PlayerService"; import { PlayerService } from "../services/PlayerService";
import { SeasonalEventService } from "../services/SeasonalEventService"; import { SeasonalEventService } from "../services/SeasonalEventService";
import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
export declare class QuestController { export declare class QuestController {
protected logger: ILogger; protected logger: ILogger;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected jsonUtil: JsonUtil;
protected httpResponseUtil: HttpResponseUtil; protected httpResponseUtil: HttpResponseUtil;
protected eventOutputHolder: EventOutputHolder; protected eventOutputHolder: EventOutputHolder;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
@ -43,7 +46,7 @@ export declare class QuestController {
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected questConfig: IQuestConfig; 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 * Handle client/quest/list
* Get all quests visible to player * Get all quests visible to player
@ -110,6 +113,13 @@ export declare class QuestController {
* @returns ItemEvent client response * @returns ItemEvent client response
*/ */
completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse; 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 * Send a popup to player on successful completion of a quest
* @param sessionID session id * @param sessionID session id
@ -137,8 +147,9 @@ export declare class QuestController {
* @param sessionID session id * @param sessionID session id
* @param pmcData player profile * @param pmcData player profile
* @param questsToFail quests to fail * @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 * Handle QuestHandover event
* @param pmcData Player profile * @param pmcData Player profile

View File

@ -1,5 +1,5 @@
import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; 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 { Item } from "../models/eft/common/tables/IItem";
import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData";
import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig";
@ -72,7 +72,7 @@ export declare class InRaidHelper {
* @param preRaidQuests Quests prior to starting raid * @param preRaidQuests Quests prior to starting raid
* @param postRaidQuests Quest after 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; protected resetSkillPointsEarnedDuringRaid(profile: IPmcData): void;
/** /**
* Take body part effects from client profile and apply to server profile * Take body part effects from client profile and apply to server profile

View File

@ -21,11 +21,11 @@ export declare class ProfileHelper {
protected profileSnapshotService: ProfileSnapshotService; protected profileSnapshotService: ProfileSnapshotService;
constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, 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 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<string, string>): void;
/** /**
* Get all profiles from server * Get all profiles from server
* @returns Dictionary of profiles * @returns Dictionary of profiles

View File

@ -3,5 +3,6 @@ export declare class QuestConditionHelper {
getQuestConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getQuestConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[];
getLevelConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLevelConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[];
getLoyaltyConditions(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[]; protected filterConditions(q: AvailableForConditions[], questType: string, furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[];
} }

View File

@ -1,5 +1,5 @@
import { IPmcData } from "../models/eft/common/IPmcData"; 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 { Item } from "../models/eft/common/tables/IItem";
import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
@ -84,7 +84,15 @@ export declare class QuestHelper {
* @param profile Player profile * @param profile Player profile
* @returns true if loyalty is high enough to fulfill quest requirement * @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; 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 * take reward item from quest and set FiR status + fix stack sizes + fix mod Ids
* @param reward Reward item to fix * @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 newState State the new quest should be in when returned
* @param acceptedQuest Details of accepted quest from client * @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 * Get quests that can be shown to player after starting a quest
* @param startedQuestId Quest started by player * @param startedQuestId Quest started by player
@ -161,9 +169,10 @@ export declare class QuestHelper {
* @param pmcData Player profile * @param pmcData Player profile
* @param failRequest Fail quest request data * @param failRequest Fail quest request data
* @param sessionID Session id * @param sessionID Session id
* @param output Client output
* @returns Item event router response * @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 * Get List of All Quests from db
* NOT CLONED * NOT CLONED
@ -224,11 +233,12 @@ export declare class QuestHelper {
*/ */
protected getIntelCenterRewardBonus(pmcData: IPmcData): number; 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 * @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<string, string>;
/** /**
* Add all quests to a profile with the provided statuses * Add all quests to a profile with the provided statuses
* @param pmcProfile profile to update * @param pmcProfile profile to update

View File

@ -21,7 +21,7 @@ export interface IBotBase {
BackendCounters: Record<string, BackendCounter>; BackendCounters: Record<string, BackendCounter>;
InsuredItems: InsuredItem[]; InsuredItems: InsuredItem[];
Hideout: Hideout; Hideout: Hideout;
Quests: Quest[]; Quests: IQuestStatus[];
TradersInfo: Record<string, TraderInfo>; TradersInfo: Record<string, TraderInfo>;
UnlockedInfo: IUnlockedInfo; UnlockedInfo: IUnlockedInfo;
RagfairInfo: RagfairInfo; RagfairInfo: RagfairInfo;
@ -355,7 +355,7 @@ export declare enum SurvivorClass {
PARAMEDIC = 3, PARAMEDIC = 3,
SURVIVOR = 4 SURVIVOR = 4
} }
export interface Quest { export interface IQuestStatus {
qid: string; qid: string;
startTime: number; startTime: number;
status: QuestStatus; status: QuestStatus;

View File

@ -32,6 +32,8 @@ export interface IQuest {
changeQuestMessageText: string; changeQuestMessageText: string;
/** "Pmc" or "Scav" */ /** "Pmc" or "Scav" */
side: string; side: string;
/** Status of quest to player */
sptStatus?: QuestStatus;
} }
export interface Conditions { export interface Conditions {
Started: AvailableForConditions[]; Started: AvailableForConditions[];

View File

@ -1,6 +1,5 @@
import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType";
import { QuestStatus } from "../../../models/enums/QuestStatus"; import { Health, IQuestStatus, Productive, Skills, TraderData } from "../common/tables/IBotBase";
import { Health, Productive, Skills, TraderData } from "../common/tables/IBotBase";
import { Item, Upd } from "../common/tables/IItem"; import { Item, Upd } from "../common/tables/IItem";
import { IQuest } from "../common/tables/IQuest"; import { IQuest } from "../common/tables/IQuest";
import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests"; import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests";
@ -33,20 +32,12 @@ export interface ProfileChange {
repeatableQuests?: IPmcDataRepeatableQuest[]; repeatableQuests?: IPmcDataRepeatableQuest[];
recipeUnlocked: Record<string, boolean>; recipeUnlocked: Record<string, boolean>;
changedHideoutStashes?: Record<string, IHideoutStashItem>; changedHideoutStashes?: Record<string, IHideoutStashItem>;
questsStatus: QuestStatusChange[]; questsStatus: IQuestStatus[];
} }
export interface IHideoutStashItem { export interface IHideoutStashItem {
Id: string; Id: string;
Tpl: string; Tpl: string;
} }
export interface QuestStatusChange {
qid: string;
startTime: number;
status: QuestStatus;
statusTimers: Record<QuestStatus, number>;
completedConditions: string[];
availableAfter: number;
}
export interface IWeaponBuildChange { export interface IWeaponBuildChange {
id: string; id: string;
name: string; name: string;

View File

@ -23,6 +23,8 @@ export interface IBotConfig extends IBaseConfig {
equipment: Record<string, EquipmentFilters>; equipment: Record<string, EquipmentFilters>;
/** Show a bots botType value after their name */ /** Show a bots botType value after their name */
showTypeInNickname: boolean; showTypeInNickname: boolean;
/** What ai brain should a normal scav use per map */
assaultBrainType: Record<string, Record<string, number>>;
/** Max number of bots that can be spawned in a raid at any one time */ /** Max number of bots that can be spawned in a raid at any one time */
maxBotCap: Record<string, number>; maxBotCap: Record<string, number>;
/** Chance scav has fake pscav name e.g. Scav name (player name) */ /** Chance scav has fake pscav name e.g. Scav name (player name) */

View File

@ -1,6 +1,7 @@
import { HideoutHelper } from "../helpers/HideoutHelper"; import { HideoutHelper } from "../helpers/HideoutHelper";
import { InventoryHelper } from "../helpers/InventoryHelper"; import { InventoryHelper } from "../helpers/InventoryHelper";
import { ItemHelper } from "../helpers/ItemHelper"; import { ItemHelper } from "../helpers/ItemHelper";
import { ProfileHelper } from "../helpers/ProfileHelper";
import { TraderHelper } from "../helpers/TraderHelper"; import { TraderHelper } from "../helpers/TraderHelper";
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase"; import { Bonus, HideoutSlot } from "../models/eft/common/tables/IBotBase";
@ -22,6 +23,7 @@ export declare class ProfileFixerService {
protected hideoutHelper: HideoutHelper; protected hideoutHelper: HideoutHelper;
protected inventoryHelper: InventoryHelper; protected inventoryHelper: InventoryHelper;
protected traderHelper: TraderHelper; protected traderHelper: TraderHelper;
protected profileHelper: ProfileHelper;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
@ -29,7 +31,7 @@ export declare class ProfileFixerService {
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected coreConfig: ICoreConfig; protected coreConfig: ICoreConfig;
protected ragfairConfig: IRagfairConfig; 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 * Find issues in the pmc profile data that may cause issues and fix them
* @param pmcProfile profile to check and fix * @param pmcProfile profile to check and fix

View File

@ -4,7 +4,7 @@
"main": "src/mod.js", "main": "src/mod.js",
"license": "MIT", "license": "MIT",
"author": "Chomp", "author": "Chomp",
"akiVersion": "~3.6", "akiVersion": "~3.7",
"modDependencies": { "modDependencies": {
"17AsyncImporterWithDependency2": "~1" "17AsyncImporterWithDependency2": "~1"
}, },

View File

@ -72,5 +72,5 @@ export declare class BotController {
* @returns cap number * @returns cap number
*/ */
getBotCap(): number; getBotCap(): number;
getPmcBotTypes(): Record<string, Record<string, Record<string, number>>>; getAiBotBrainTypes(): any;
} }

View File

@ -207,7 +207,7 @@ export declare class HideoutController {
*/ */
protected handleRecipe(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; 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 sessionID Session id
* @param pmcData Player profile * @param pmcData Player profile
* @param request Get rewards from scavcase craft request * @param request Get rewards from scavcase craft request

View File

@ -5,6 +5,7 @@ import { QuestConditionHelper } from "../helpers/QuestConditionHelper";
import { QuestHelper } from "../helpers/QuestHelper"; import { QuestHelper } from "../helpers/QuestHelper";
import { TraderHelper } from "../helpers/TraderHelper"; import { TraderHelper } from "../helpers/TraderHelper";
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { IQuestStatus } from "../models/eft/common/tables/IBotBase";
import { Item } from "../models/eft/common/tables/IItem"; import { Item } from "../models/eft/common/tables/IItem";
import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest";
import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests";
@ -23,10 +24,12 @@ import { MailSendService } from "../services/MailSendService";
import { PlayerService } from "../services/PlayerService"; import { PlayerService } from "../services/PlayerService";
import { SeasonalEventService } from "../services/SeasonalEventService"; import { SeasonalEventService } from "../services/SeasonalEventService";
import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
export declare class QuestController { export declare class QuestController {
protected logger: ILogger; protected logger: ILogger;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected jsonUtil: JsonUtil;
protected httpResponseUtil: HttpResponseUtil; protected httpResponseUtil: HttpResponseUtil;
protected eventOutputHolder: EventOutputHolder; protected eventOutputHolder: EventOutputHolder;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
@ -43,7 +46,7 @@ export declare class QuestController {
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected questConfig: IQuestConfig; 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 * Handle client/quest/list
* Get all quests visible to player * Get all quests visible to player
@ -110,6 +113,13 @@ export declare class QuestController {
* @returns ItemEvent client response * @returns ItemEvent client response
*/ */
completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse; 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 * Send a popup to player on successful completion of a quest
* @param sessionID session id * @param sessionID session id
@ -137,8 +147,9 @@ export declare class QuestController {
* @param sessionID session id * @param sessionID session id
* @param pmcData player profile * @param pmcData player profile
* @param questsToFail quests to fail * @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 * Handle QuestHandover event
* @param pmcData Player profile * @param pmcData Player profile

View File

@ -1,5 +1,5 @@
import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; 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 { Item } from "../models/eft/common/tables/IItem";
import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData";
import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig";
@ -72,7 +72,7 @@ export declare class InRaidHelper {
* @param preRaidQuests Quests prior to starting raid * @param preRaidQuests Quests prior to starting raid
* @param postRaidQuests Quest after 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; protected resetSkillPointsEarnedDuringRaid(profile: IPmcData): void;
/** /**
* Take body part effects from client profile and apply to server profile * Take body part effects from client profile and apply to server profile

View File

@ -21,11 +21,11 @@ export declare class ProfileHelper {
protected profileSnapshotService: ProfileSnapshotService; protected profileSnapshotService: ProfileSnapshotService;
constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, 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 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<string, string>): void;
/** /**
* Get all profiles from server * Get all profiles from server
* @returns Dictionary of profiles * @returns Dictionary of profiles

View File

@ -3,5 +3,6 @@ export declare class QuestConditionHelper {
getQuestConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getQuestConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[];
getLevelConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[]; getLevelConditions(q: AvailableForConditions[], furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[];
getLoyaltyConditions(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[]; protected filterConditions(q: AvailableForConditions[], questType: string, furtherFilter?: (a: AvailableForConditions) => AvailableForConditions[]): AvailableForConditions[];
} }

View File

@ -1,5 +1,5 @@
import { IPmcData } from "../models/eft/common/IPmcData"; 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 { Item } from "../models/eft/common/tables/IItem";
import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
@ -84,7 +84,15 @@ export declare class QuestHelper {
* @param profile Player profile * @param profile Player profile
* @returns true if loyalty is high enough to fulfill quest requirement * @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; 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 * take reward item from quest and set FiR status + fix stack sizes + fix mod Ids
* @param reward Reward item to fix * @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 newState State the new quest should be in when returned
* @param acceptedQuest Details of accepted quest from client * @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 * Get quests that can be shown to player after starting a quest
* @param startedQuestId Quest started by player * @param startedQuestId Quest started by player
@ -161,9 +169,10 @@ export declare class QuestHelper {
* @param pmcData Player profile * @param pmcData Player profile
* @param failRequest Fail quest request data * @param failRequest Fail quest request data
* @param sessionID Session id * @param sessionID Session id
* @param output Client output
* @returns Item event router response * @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 * Get List of All Quests from db
* NOT CLONED * NOT CLONED
@ -224,11 +233,12 @@ export declare class QuestHelper {
*/ */
protected getIntelCenterRewardBonus(pmcData: IPmcData): number; 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 * @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<string, string>;
/** /**
* Add all quests to a profile with the provided statuses * Add all quests to a profile with the provided statuses
* @param pmcProfile profile to update * @param pmcProfile profile to update

View File

@ -21,7 +21,7 @@ export interface IBotBase {
BackendCounters: Record<string, BackendCounter>; BackendCounters: Record<string, BackendCounter>;
InsuredItems: InsuredItem[]; InsuredItems: InsuredItem[];
Hideout: Hideout; Hideout: Hideout;
Quests: Quest[]; Quests: IQuestStatus[];
TradersInfo: Record<string, TraderInfo>; TradersInfo: Record<string, TraderInfo>;
UnlockedInfo: IUnlockedInfo; UnlockedInfo: IUnlockedInfo;
RagfairInfo: RagfairInfo; RagfairInfo: RagfairInfo;
@ -355,7 +355,7 @@ export declare enum SurvivorClass {
PARAMEDIC = 3, PARAMEDIC = 3,
SURVIVOR = 4 SURVIVOR = 4
} }
export interface Quest { export interface IQuestStatus {
qid: string; qid: string;
startTime: number; startTime: number;
status: QuestStatus; status: QuestStatus;

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