diff --git a/TypeScript/13AddTrader/types/controllers/GameController.d.ts b/TypeScript/13AddTrader/types/controllers/GameController.d.ts index e47d5fa..53d046a 100644 --- a/TypeScript/13AddTrader/types/controllers/GameController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/GameController.d.ts @@ -43,6 +43,11 @@ export declare class GameController { protected locationConfig: ILocationConfig; constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, applicationContext: ApplicationContext, configServer: ConfigServer); gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + /** + * Players set botReload to a high value and don't expect the crazy fast reload speeds, give them a warn about it + * @param pmcProfile Player profile + */ + protected warnOnActiveBotReloadSkill(pmcProfile: IPmcData): void; /** * When player logs in, iterate over all active effects and reduce timer * TODO - add body part HP regen diff --git a/TypeScript/13AddTrader/types/controllers/QuestController.d.ts b/TypeScript/13AddTrader/types/controllers/QuestController.d.ts index 7e4bd69..d41ca3b 100644 --- a/TypeScript/13AddTrader/types/controllers/QuestController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/QuestController.d.ts @@ -4,7 +4,8 @@ import { ProfileHelper } from "../helpers/ProfileHelper"; import { QuestConditionHelper } from "../helpers/QuestConditionHelper"; import { QuestHelper } from "../helpers/QuestHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { IQuest, Reward } from "../models/eft/common/tables/IQuest"; +import { Item } from "../models/eft/common/tables/IItem"; +import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IAcceptQuestRequestData } from "../models/eft/quests/IAcceptQuestRequestData"; @@ -124,6 +125,22 @@ export declare class QuestController { * @returns IItemEventRouterResponse */ handoverQuest(pmcData: IPmcData, handoverQuestRequest: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Show warning to user and write to log that repeatable quest failed a condition check + * @param handoverQuestRequest Quest request + * @param output Response to send to user + * @returns IItemEventRouterResponse + */ + protected showRepeatableQuestInvalidConditionError(handoverQuestRequest: IHandoverQuestRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; + /** + * Show warning to user and write to log quest item handed over did not match what is required + * @param handoverQuestRequest Quest request + * @param itemHandedOver Non-matching item found + * @param handoverRequirements Quest handover requirements + * @param output Response to send to user + * @returns IItemEventRouterResponse + */ + protected showQuestItemHandoverMatchError(handoverQuestRequest: IHandoverQuestRequestData, itemHandedOver: Item, handoverRequirements: AvailableForConditions, output: IItemEventRouterResponse): IItemEventRouterResponse; /** * Increment a backend counter stored value by an amount, * Create counter if it does not exist diff --git a/TypeScript/13AddTrader/types/helpers/PaymentHelper.d.ts b/TypeScript/13AddTrader/types/helpers/PaymentHelper.d.ts index 2d068a4..1534f4a 100644 --- a/TypeScript/13AddTrader/types/helpers/PaymentHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/PaymentHelper.d.ts @@ -1,6 +1,11 @@ +import { IInventoryConfig } from "../models/spt/config/IInventoryConfig"; +import { ConfigServer } from "../servers/ConfigServer"; export declare class PaymentHelper { + protected configServer: ConfigServer; + protected inventoryConfig: IInventoryConfig; + constructor(configServer: ConfigServer); /** - * Check whether tpl is Money + * Is the passed in tpl money (also checks custom currencies in inventoryConfig.customMoneyTpls) * @param {string} tpl * @returns void */ diff --git a/TypeScript/13AddTrader/types/models/spt/config/IInventoryConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/IInventoryConfig.d.ts index 4642b9b..3ad0cce 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/IInventoryConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/IInventoryConfig.d.ts @@ -3,6 +3,8 @@ export interface IInventoryConfig extends IBaseConfig { kind: "aki-inventory"; newItemsMarkedFound: boolean; randomLootContainers: Record; + /** Contains item tpls that the server should consider money and treat the same as roubles/euros/dollars */ + customMoneyTpls: string[]; } export interface RewardDetails { rewardCount: number; diff --git a/TypeScript/13AddTrader/types/services/PmcChatResponseService.d.ts b/TypeScript/13AddTrader/types/services/PmcChatResponseService.d.ts index d4acf50..9b19440 100644 --- a/TypeScript/13AddTrader/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/13AddTrader/types/services/PmcChatResponseService.d.ts @@ -16,7 +16,7 @@ export declare class PmcChatResponseService { protected pmcResponsesConfig: IPmcChatResponse; constructor(randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); /** - * Chooses a random victim from those provided and sends a message to the player, can be positive or negative + * For each PMC victim of the player, have a chance to send a message to the player, can be positive or negative * @param sessionId Session id * @param pmcVictims Array of bots killed by player */ @@ -46,11 +46,11 @@ export declare class PmcChatResponseService { */ protected allCaps(isVictim: boolean): boolean; /** - * Should the word 'bro' be appended to the message being sent to player + * Should a suffix be appended to the end of the message being sent to player * @param isVictim Was responder a victim of player * @returns true = should be stripped */ - appendBroToMessageEnd(isVictim: boolean): boolean; + appendSuffixToMessageEnd(isVictim: boolean): boolean; /** * Choose a type of response based on the weightings in pmc response config * @param isVictim Was responder killed by player @@ -64,10 +64,21 @@ export declare class PmcChatResponseService { * @returns */ protected getResponseLocaleKeys(keyType: string, isVictim?: boolean): string[]; + /** + * Get all locale keys that start with `pmcresponse-suffix` + * @returns array of keys + */ + protected getResponseSuffixLocaleKeys(): string[]; /** * Randomly draw a victim of the the array and return thier details * @param pmcVictims Possible victims to choose from * @returns IUserDialogInfo */ protected chooseRandomVictim(pmcVictims: Victim[]): IUserDialogInfo; + /** + * Convert a victim object into a IUserDialogInfo object + * @param pmcVictim victim to convert + * @returns IUserDialogInfo + */ + protected getVictimDetails(pmcVictim: Victim): IUserDialogInfo; } diff --git a/TypeScript/1LogToConsole/types/controllers/GameController.d.ts b/TypeScript/1LogToConsole/types/controllers/GameController.d.ts index e47d5fa..53d046a 100644 --- a/TypeScript/1LogToConsole/types/controllers/GameController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/GameController.d.ts @@ -43,6 +43,11 @@ export declare class GameController { protected locationConfig: ILocationConfig; constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, applicationContext: ApplicationContext, configServer: ConfigServer); gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + /** + * Players set botReload to a high value and don't expect the crazy fast reload speeds, give them a warn about it + * @param pmcProfile Player profile + */ + protected warnOnActiveBotReloadSkill(pmcProfile: IPmcData): void; /** * When player logs in, iterate over all active effects and reduce timer * TODO - add body part HP regen diff --git a/TypeScript/1LogToConsole/types/controllers/QuestController.d.ts b/TypeScript/1LogToConsole/types/controllers/QuestController.d.ts index 7e4bd69..d41ca3b 100644 --- a/TypeScript/1LogToConsole/types/controllers/QuestController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/QuestController.d.ts @@ -4,7 +4,8 @@ import { ProfileHelper } from "../helpers/ProfileHelper"; import { QuestConditionHelper } from "../helpers/QuestConditionHelper"; import { QuestHelper } from "../helpers/QuestHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { IQuest, Reward } from "../models/eft/common/tables/IQuest"; +import { Item } from "../models/eft/common/tables/IItem"; +import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IAcceptQuestRequestData } from "../models/eft/quests/IAcceptQuestRequestData"; @@ -124,6 +125,22 @@ export declare class QuestController { * @returns IItemEventRouterResponse */ handoverQuest(pmcData: IPmcData, handoverQuestRequest: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Show warning to user and write to log that repeatable quest failed a condition check + * @param handoverQuestRequest Quest request + * @param output Response to send to user + * @returns IItemEventRouterResponse + */ + protected showRepeatableQuestInvalidConditionError(handoverQuestRequest: IHandoverQuestRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; + /** + * Show warning to user and write to log quest item handed over did not match what is required + * @param handoverQuestRequest Quest request + * @param itemHandedOver Non-matching item found + * @param handoverRequirements Quest handover requirements + * @param output Response to send to user + * @returns IItemEventRouterResponse + */ + protected showQuestItemHandoverMatchError(handoverQuestRequest: IHandoverQuestRequestData, itemHandedOver: Item, handoverRequirements: AvailableForConditions, output: IItemEventRouterResponse): IItemEventRouterResponse; /** * Increment a backend counter stored value by an amount, * Create counter if it does not exist diff --git a/TypeScript/1LogToConsole/types/helpers/PaymentHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/PaymentHelper.d.ts index 2d068a4..1534f4a 100644 --- a/TypeScript/1LogToConsole/types/helpers/PaymentHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/PaymentHelper.d.ts @@ -1,6 +1,11 @@ +import { IInventoryConfig } from "../models/spt/config/IInventoryConfig"; +import { ConfigServer } from "../servers/ConfigServer"; export declare class PaymentHelper { + protected configServer: ConfigServer; + protected inventoryConfig: IInventoryConfig; + constructor(configServer: ConfigServer); /** - * Check whether tpl is Money + * Is the passed in tpl money (also checks custom currencies in inventoryConfig.customMoneyTpls) * @param {string} tpl * @returns void */ diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IInventoryConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IInventoryConfig.d.ts index 4642b9b..3ad0cce 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IInventoryConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IInventoryConfig.d.ts @@ -3,6 +3,8 @@ export interface IInventoryConfig extends IBaseConfig { kind: "aki-inventory"; newItemsMarkedFound: boolean; randomLootContainers: Record; + /** Contains item tpls that the server should consider money and treat the same as roubles/euros/dollars */ + customMoneyTpls: string[]; } export interface RewardDetails { rewardCount: number; diff --git a/TypeScript/1LogToConsole/types/services/PmcChatResponseService.d.ts b/TypeScript/1LogToConsole/types/services/PmcChatResponseService.d.ts index d4acf50..9b19440 100644 --- a/TypeScript/1LogToConsole/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/1LogToConsole/types/services/PmcChatResponseService.d.ts @@ -16,7 +16,7 @@ export declare class PmcChatResponseService { protected pmcResponsesConfig: IPmcChatResponse; constructor(randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); /** - * Chooses a random victim from those provided and sends a message to the player, can be positive or negative + * For each PMC victim of the player, have a chance to send a message to the player, can be positive or negative * @param sessionId Session id * @param pmcVictims Array of bots killed by player */ @@ -46,11 +46,11 @@ export declare class PmcChatResponseService { */ protected allCaps(isVictim: boolean): boolean; /** - * Should the word 'bro' be appended to the message being sent to player + * Should a suffix be appended to the end of the message being sent to player * @param isVictim Was responder a victim of player * @returns true = should be stripped */ - appendBroToMessageEnd(isVictim: boolean): boolean; + appendSuffixToMessageEnd(isVictim: boolean): boolean; /** * Choose a type of response based on the weightings in pmc response config * @param isVictim Was responder killed by player @@ -64,10 +64,21 @@ export declare class PmcChatResponseService { * @returns */ protected getResponseLocaleKeys(keyType: string, isVictim?: boolean): string[]; + /** + * Get all locale keys that start with `pmcresponse-suffix` + * @returns array of keys + */ + protected getResponseSuffixLocaleKeys(): string[]; /** * Randomly draw a victim of the the array and return thier details * @param pmcVictims Possible victims to choose from * @returns IUserDialogInfo */ protected chooseRandomVictim(pmcVictims: Victim[]): IUserDialogInfo; + /** + * Convert a victim object into a IUserDialogInfo object + * @param pmcVictim victim to convert + * @returns IUserDialogInfo + */ + protected getVictimDetails(pmcVictim: Victim): IUserDialogInfo; } diff --git a/TypeScript/2EditDatabase/types/controllers/GameController.d.ts b/TypeScript/2EditDatabase/types/controllers/GameController.d.ts index e47d5fa..53d046a 100644 --- a/TypeScript/2EditDatabase/types/controllers/GameController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/GameController.d.ts @@ -43,6 +43,11 @@ export declare class GameController { protected locationConfig: ILocationConfig; constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, applicationContext: ApplicationContext, configServer: ConfigServer); gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + /** + * Players set botReload to a high value and don't expect the crazy fast reload speeds, give them a warn about it + * @param pmcProfile Player profile + */ + protected warnOnActiveBotReloadSkill(pmcProfile: IPmcData): void; /** * When player logs in, iterate over all active effects and reduce timer * TODO - add body part HP regen diff --git a/TypeScript/2EditDatabase/types/controllers/QuestController.d.ts b/TypeScript/2EditDatabase/types/controllers/QuestController.d.ts index 7e4bd69..d41ca3b 100644 --- a/TypeScript/2EditDatabase/types/controllers/QuestController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/QuestController.d.ts @@ -4,7 +4,8 @@ import { ProfileHelper } from "../helpers/ProfileHelper"; import { QuestConditionHelper } from "../helpers/QuestConditionHelper"; import { QuestHelper } from "../helpers/QuestHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { IQuest, Reward } from "../models/eft/common/tables/IQuest"; +import { Item } from "../models/eft/common/tables/IItem"; +import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IAcceptQuestRequestData } from "../models/eft/quests/IAcceptQuestRequestData"; @@ -124,6 +125,22 @@ export declare class QuestController { * @returns IItemEventRouterResponse */ handoverQuest(pmcData: IPmcData, handoverQuestRequest: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Show warning to user and write to log that repeatable quest failed a condition check + * @param handoverQuestRequest Quest request + * @param output Response to send to user + * @returns IItemEventRouterResponse + */ + protected showRepeatableQuestInvalidConditionError(handoverQuestRequest: IHandoverQuestRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; + /** + * Show warning to user and write to log quest item handed over did not match what is required + * @param handoverQuestRequest Quest request + * @param itemHandedOver Non-matching item found + * @param handoverRequirements Quest handover requirements + * @param output Response to send to user + * @returns IItemEventRouterResponse + */ + protected showQuestItemHandoverMatchError(handoverQuestRequest: IHandoverQuestRequestData, itemHandedOver: Item, handoverRequirements: AvailableForConditions, output: IItemEventRouterResponse): IItemEventRouterResponse; /** * Increment a backend counter stored value by an amount, * Create counter if it does not exist diff --git a/TypeScript/2EditDatabase/types/helpers/PaymentHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/PaymentHelper.d.ts index 2d068a4..1534f4a 100644 --- a/TypeScript/2EditDatabase/types/helpers/PaymentHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/PaymentHelper.d.ts @@ -1,6 +1,11 @@ +import { IInventoryConfig } from "../models/spt/config/IInventoryConfig"; +import { ConfigServer } from "../servers/ConfigServer"; export declare class PaymentHelper { + protected configServer: ConfigServer; + protected inventoryConfig: IInventoryConfig; + constructor(configServer: ConfigServer); /** - * Check whether tpl is Money + * Is the passed in tpl money (also checks custom currencies in inventoryConfig.customMoneyTpls) * @param {string} tpl * @returns void */ diff --git a/TypeScript/2EditDatabase/types/models/spt/config/IInventoryConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/IInventoryConfig.d.ts index 4642b9b..3ad0cce 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/IInventoryConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/IInventoryConfig.d.ts @@ -3,6 +3,8 @@ export interface IInventoryConfig extends IBaseConfig { kind: "aki-inventory"; newItemsMarkedFound: boolean; randomLootContainers: Record; + /** Contains item tpls that the server should consider money and treat the same as roubles/euros/dollars */ + customMoneyTpls: string[]; } export interface RewardDetails { rewardCount: number; diff --git a/TypeScript/2EditDatabase/types/services/PmcChatResponseService.d.ts b/TypeScript/2EditDatabase/types/services/PmcChatResponseService.d.ts index d4acf50..9b19440 100644 --- a/TypeScript/2EditDatabase/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/2EditDatabase/types/services/PmcChatResponseService.d.ts @@ -16,7 +16,7 @@ export declare class PmcChatResponseService { protected pmcResponsesConfig: IPmcChatResponse; constructor(randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); /** - * Chooses a random victim from those provided and sends a message to the player, can be positive or negative + * For each PMC victim of the player, have a chance to send a message to the player, can be positive or negative * @param sessionId Session id * @param pmcVictims Array of bots killed by player */ @@ -46,11 +46,11 @@ export declare class PmcChatResponseService { */ protected allCaps(isVictim: boolean): boolean; /** - * Should the word 'bro' be appended to the message being sent to player + * Should a suffix be appended to the end of the message being sent to player * @param isVictim Was responder a victim of player * @returns true = should be stripped */ - appendBroToMessageEnd(isVictim: boolean): boolean; + appendSuffixToMessageEnd(isVictim: boolean): boolean; /** * Choose a type of response based on the weightings in pmc response config * @param isVictim Was responder killed by player @@ -64,10 +64,21 @@ export declare class PmcChatResponseService { * @returns */ protected getResponseLocaleKeys(keyType: string, isVictim?: boolean): string[]; + /** + * Get all locale keys that start with `pmcresponse-suffix` + * @returns array of keys + */ + protected getResponseSuffixLocaleKeys(): string[]; /** * Randomly draw a victim of the the array and return thier details * @param pmcVictims Possible victims to choose from * @returns IUserDialogInfo */ protected chooseRandomVictim(pmcVictims: Victim[]): IUserDialogInfo; + /** + * Convert a victim object into a IUserDialogInfo object + * @param pmcVictim victim to convert + * @returns IUserDialogInfo + */ + protected getVictimDetails(pmcVictim: Victim): IUserDialogInfo; } diff --git a/TypeScript/3GetSptConfigFile/types/controllers/GameController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/GameController.d.ts index e47d5fa..53d046a 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/GameController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/GameController.d.ts @@ -43,6 +43,11 @@ export declare class GameController { protected locationConfig: ILocationConfig; constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, applicationContext: ApplicationContext, configServer: ConfigServer); gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + /** + * Players set botReload to a high value and don't expect the crazy fast reload speeds, give them a warn about it + * @param pmcProfile Player profile + */ + protected warnOnActiveBotReloadSkill(pmcProfile: IPmcData): void; /** * When player logs in, iterate over all active effects and reduce timer * TODO - add body part HP regen diff --git a/TypeScript/3GetSptConfigFile/types/controllers/QuestController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/QuestController.d.ts index 7e4bd69..d41ca3b 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/QuestController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/QuestController.d.ts @@ -4,7 +4,8 @@ import { ProfileHelper } from "../helpers/ProfileHelper"; import { QuestConditionHelper } from "../helpers/QuestConditionHelper"; import { QuestHelper } from "../helpers/QuestHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { IQuest, Reward } from "../models/eft/common/tables/IQuest"; +import { Item } from "../models/eft/common/tables/IItem"; +import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IAcceptQuestRequestData } from "../models/eft/quests/IAcceptQuestRequestData"; @@ -124,6 +125,22 @@ export declare class QuestController { * @returns IItemEventRouterResponse */ handoverQuest(pmcData: IPmcData, handoverQuestRequest: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Show warning to user and write to log that repeatable quest failed a condition check + * @param handoverQuestRequest Quest request + * @param output Response to send to user + * @returns IItemEventRouterResponse + */ + protected showRepeatableQuestInvalidConditionError(handoverQuestRequest: IHandoverQuestRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; + /** + * Show warning to user and write to log quest item handed over did not match what is required + * @param handoverQuestRequest Quest request + * @param itemHandedOver Non-matching item found + * @param handoverRequirements Quest handover requirements + * @param output Response to send to user + * @returns IItemEventRouterResponse + */ + protected showQuestItemHandoverMatchError(handoverQuestRequest: IHandoverQuestRequestData, itemHandedOver: Item, handoverRequirements: AvailableForConditions, output: IItemEventRouterResponse): IItemEventRouterResponse; /** * Increment a backend counter stored value by an amount, * Create counter if it does not exist diff --git a/TypeScript/3GetSptConfigFile/types/helpers/PaymentHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/PaymentHelper.d.ts index 2d068a4..1534f4a 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/PaymentHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/PaymentHelper.d.ts @@ -1,6 +1,11 @@ +import { IInventoryConfig } from "../models/spt/config/IInventoryConfig"; +import { ConfigServer } from "../servers/ConfigServer"; export declare class PaymentHelper { + protected configServer: ConfigServer; + protected inventoryConfig: IInventoryConfig; + constructor(configServer: ConfigServer); /** - * Check whether tpl is Money + * Is the passed in tpl money (also checks custom currencies in inventoryConfig.customMoneyTpls) * @param {string} tpl * @returns void */ diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/IInventoryConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/IInventoryConfig.d.ts index 4642b9b..3ad0cce 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/IInventoryConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/IInventoryConfig.d.ts @@ -3,6 +3,8 @@ export interface IInventoryConfig extends IBaseConfig { kind: "aki-inventory"; newItemsMarkedFound: boolean; randomLootContainers: Record; + /** Contains item tpls that the server should consider money and treat the same as roubles/euros/dollars */ + customMoneyTpls: string[]; } export interface RewardDetails { rewardCount: number; diff --git a/TypeScript/3GetSptConfigFile/types/services/PmcChatResponseService.d.ts b/TypeScript/3GetSptConfigFile/types/services/PmcChatResponseService.d.ts index d4acf50..9b19440 100644 --- a/TypeScript/3GetSptConfigFile/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/PmcChatResponseService.d.ts @@ -16,7 +16,7 @@ export declare class PmcChatResponseService { protected pmcResponsesConfig: IPmcChatResponse; constructor(randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); /** - * Chooses a random victim from those provided and sends a message to the player, can be positive or negative + * For each PMC victim of the player, have a chance to send a message to the player, can be positive or negative * @param sessionId Session id * @param pmcVictims Array of bots killed by player */ @@ -46,11 +46,11 @@ export declare class PmcChatResponseService { */ protected allCaps(isVictim: boolean): boolean; /** - * Should the word 'bro' be appended to the message being sent to player + * Should a suffix be appended to the end of the message being sent to player * @param isVictim Was responder a victim of player * @returns true = should be stripped */ - appendBroToMessageEnd(isVictim: boolean): boolean; + appendSuffixToMessageEnd(isVictim: boolean): boolean; /** * Choose a type of response based on the weightings in pmc response config * @param isVictim Was responder killed by player @@ -64,10 +64,21 @@ export declare class PmcChatResponseService { * @returns */ protected getResponseLocaleKeys(keyType: string, isVictim?: boolean): string[]; + /** + * Get all locale keys that start with `pmcresponse-suffix` + * @returns array of keys + */ + protected getResponseSuffixLocaleKeys(): string[]; /** * Randomly draw a victim of the the array and return thier details * @param pmcVictims Possible victims to choose from * @returns IUserDialogInfo */ protected chooseRandomVictim(pmcVictims: Victim[]): IUserDialogInfo; + /** + * Convert a victim object into a IUserDialogInfo object + * @param pmcVictim victim to convert + * @returns IUserDialogInfo + */ + protected getVictimDetails(pmcVictim: Victim): IUserDialogInfo; } diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/GameController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/GameController.d.ts index e47d5fa..53d046a 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/GameController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/GameController.d.ts @@ -43,6 +43,11 @@ export declare class GameController { protected locationConfig: ILocationConfig; constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, applicationContext: ApplicationContext, configServer: ConfigServer); gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + /** + * Players set botReload to a high value and don't expect the crazy fast reload speeds, give them a warn about it + * @param pmcProfile Player profile + */ + protected warnOnActiveBotReloadSkill(pmcProfile: IPmcData): void; /** * When player logs in, iterate over all active effects and reduce timer * TODO - add body part HP regen diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/QuestController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/QuestController.d.ts index 7e4bd69..d41ca3b 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/QuestController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/QuestController.d.ts @@ -4,7 +4,8 @@ import { ProfileHelper } from "../helpers/ProfileHelper"; import { QuestConditionHelper } from "../helpers/QuestConditionHelper"; import { QuestHelper } from "../helpers/QuestHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { IQuest, Reward } from "../models/eft/common/tables/IQuest"; +import { Item } from "../models/eft/common/tables/IItem"; +import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IAcceptQuestRequestData } from "../models/eft/quests/IAcceptQuestRequestData"; @@ -124,6 +125,22 @@ export declare class QuestController { * @returns IItemEventRouterResponse */ handoverQuest(pmcData: IPmcData, handoverQuestRequest: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Show warning to user and write to log that repeatable quest failed a condition check + * @param handoverQuestRequest Quest request + * @param output Response to send to user + * @returns IItemEventRouterResponse + */ + protected showRepeatableQuestInvalidConditionError(handoverQuestRequest: IHandoverQuestRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; + /** + * Show warning to user and write to log quest item handed over did not match what is required + * @param handoverQuestRequest Quest request + * @param itemHandedOver Non-matching item found + * @param handoverRequirements Quest handover requirements + * @param output Response to send to user + * @returns IItemEventRouterResponse + */ + protected showQuestItemHandoverMatchError(handoverQuestRequest: IHandoverQuestRequestData, itemHandedOver: Item, handoverRequirements: AvailableForConditions, output: IItemEventRouterResponse): IItemEventRouterResponse; /** * Increment a backend counter stored value by an amount, * Create counter if it does not exist diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/PaymentHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/PaymentHelper.d.ts index 2d068a4..1534f4a 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/PaymentHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/PaymentHelper.d.ts @@ -1,6 +1,11 @@ +import { IInventoryConfig } from "../models/spt/config/IInventoryConfig"; +import { ConfigServer } from "../servers/ConfigServer"; export declare class PaymentHelper { + protected configServer: ConfigServer; + protected inventoryConfig: IInventoryConfig; + constructor(configServer: ConfigServer); /** - * Check whether tpl is Money + * Is the passed in tpl money (also checks custom currencies in inventoryConfig.customMoneyTpls) * @param {string} tpl * @returns void */ diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IInventoryConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IInventoryConfig.d.ts index 4642b9b..3ad0cce 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IInventoryConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IInventoryConfig.d.ts @@ -3,6 +3,8 @@ export interface IInventoryConfig extends IBaseConfig { kind: "aki-inventory"; newItemsMarkedFound: boolean; randomLootContainers: Record; + /** Contains item tpls that the server should consider money and treat the same as roubles/euros/dollars */ + customMoneyTpls: string[]; } export interface RewardDetails { rewardCount: number; diff --git a/TypeScript/4UseACustomConfigFile/types/services/PmcChatResponseService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/PmcChatResponseService.d.ts index d4acf50..9b19440 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/PmcChatResponseService.d.ts @@ -16,7 +16,7 @@ export declare class PmcChatResponseService { protected pmcResponsesConfig: IPmcChatResponse; constructor(randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); /** - * Chooses a random victim from those provided and sends a message to the player, can be positive or negative + * For each PMC victim of the player, have a chance to send a message to the player, can be positive or negative * @param sessionId Session id * @param pmcVictims Array of bots killed by player */ @@ -46,11 +46,11 @@ export declare class PmcChatResponseService { */ protected allCaps(isVictim: boolean): boolean; /** - * Should the word 'bro' be appended to the message being sent to player + * Should a suffix be appended to the end of the message being sent to player * @param isVictim Was responder a victim of player * @returns true = should be stripped */ - appendBroToMessageEnd(isVictim: boolean): boolean; + appendSuffixToMessageEnd(isVictim: boolean): boolean; /** * Choose a type of response based on the weightings in pmc response config * @param isVictim Was responder killed by player @@ -64,10 +64,21 @@ export declare class PmcChatResponseService { * @returns */ protected getResponseLocaleKeys(keyType: string, isVictim?: boolean): string[]; + /** + * Get all locale keys that start with `pmcresponse-suffix` + * @returns array of keys + */ + protected getResponseSuffixLocaleKeys(): string[]; /** * Randomly draw a victim of the the array and return thier details * @param pmcVictims Possible victims to choose from * @returns IUserDialogInfo */ protected chooseRandomVictim(pmcVictims: Victim[]): IUserDialogInfo; + /** + * Convert a victim object into a IUserDialogInfo object + * @param pmcVictim victim to convert + * @returns IUserDialogInfo + */ + protected getVictimDetails(pmcVictim: Victim): IUserDialogInfo; } diff --git a/TypeScript/5ReplaceMethod/types/controllers/GameController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/GameController.d.ts index e47d5fa..53d046a 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/GameController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/GameController.d.ts @@ -43,6 +43,11 @@ export declare class GameController { protected locationConfig: ILocationConfig; constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, applicationContext: ApplicationContext, configServer: ConfigServer); gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + /** + * Players set botReload to a high value and don't expect the crazy fast reload speeds, give them a warn about it + * @param pmcProfile Player profile + */ + protected warnOnActiveBotReloadSkill(pmcProfile: IPmcData): void; /** * When player logs in, iterate over all active effects and reduce timer * TODO - add body part HP regen diff --git a/TypeScript/5ReplaceMethod/types/controllers/QuestController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/QuestController.d.ts index 7e4bd69..d41ca3b 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/QuestController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/QuestController.d.ts @@ -4,7 +4,8 @@ import { ProfileHelper } from "../helpers/ProfileHelper"; import { QuestConditionHelper } from "../helpers/QuestConditionHelper"; import { QuestHelper } from "../helpers/QuestHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { IQuest, Reward } from "../models/eft/common/tables/IQuest"; +import { Item } from "../models/eft/common/tables/IItem"; +import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IAcceptQuestRequestData } from "../models/eft/quests/IAcceptQuestRequestData"; @@ -124,6 +125,22 @@ export declare class QuestController { * @returns IItemEventRouterResponse */ handoverQuest(pmcData: IPmcData, handoverQuestRequest: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Show warning to user and write to log that repeatable quest failed a condition check + * @param handoverQuestRequest Quest request + * @param output Response to send to user + * @returns IItemEventRouterResponse + */ + protected showRepeatableQuestInvalidConditionError(handoverQuestRequest: IHandoverQuestRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; + /** + * Show warning to user and write to log quest item handed over did not match what is required + * @param handoverQuestRequest Quest request + * @param itemHandedOver Non-matching item found + * @param handoverRequirements Quest handover requirements + * @param output Response to send to user + * @returns IItemEventRouterResponse + */ + protected showQuestItemHandoverMatchError(handoverQuestRequest: IHandoverQuestRequestData, itemHandedOver: Item, handoverRequirements: AvailableForConditions, output: IItemEventRouterResponse): IItemEventRouterResponse; /** * Increment a backend counter stored value by an amount, * Create counter if it does not exist diff --git a/TypeScript/5ReplaceMethod/types/helpers/PaymentHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/PaymentHelper.d.ts index 2d068a4..1534f4a 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/PaymentHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/PaymentHelper.d.ts @@ -1,6 +1,11 @@ +import { IInventoryConfig } from "../models/spt/config/IInventoryConfig"; +import { ConfigServer } from "../servers/ConfigServer"; export declare class PaymentHelper { + protected configServer: ConfigServer; + protected inventoryConfig: IInventoryConfig; + constructor(configServer: ConfigServer); /** - * Check whether tpl is Money + * Is the passed in tpl money (also checks custom currencies in inventoryConfig.customMoneyTpls) * @param {string} tpl * @returns void */ diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/IInventoryConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/IInventoryConfig.d.ts index 4642b9b..3ad0cce 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/IInventoryConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/IInventoryConfig.d.ts @@ -3,6 +3,8 @@ export interface IInventoryConfig extends IBaseConfig { kind: "aki-inventory"; newItemsMarkedFound: boolean; randomLootContainers: Record; + /** Contains item tpls that the server should consider money and treat the same as roubles/euros/dollars */ + customMoneyTpls: string[]; } export interface RewardDetails { rewardCount: number; diff --git a/TypeScript/5ReplaceMethod/types/services/PmcChatResponseService.d.ts b/TypeScript/5ReplaceMethod/types/services/PmcChatResponseService.d.ts index d4acf50..9b19440 100644 --- a/TypeScript/5ReplaceMethod/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/PmcChatResponseService.d.ts @@ -16,7 +16,7 @@ export declare class PmcChatResponseService { protected pmcResponsesConfig: IPmcChatResponse; constructor(randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); /** - * Chooses a random victim from those provided and sends a message to the player, can be positive or negative + * For each PMC victim of the player, have a chance to send a message to the player, can be positive or negative * @param sessionId Session id * @param pmcVictims Array of bots killed by player */ @@ -46,11 +46,11 @@ export declare class PmcChatResponseService { */ protected allCaps(isVictim: boolean): boolean; /** - * Should the word 'bro' be appended to the message being sent to player + * Should a suffix be appended to the end of the message being sent to player * @param isVictim Was responder a victim of player * @returns true = should be stripped */ - appendBroToMessageEnd(isVictim: boolean): boolean; + appendSuffixToMessageEnd(isVictim: boolean): boolean; /** * Choose a type of response based on the weightings in pmc response config * @param isVictim Was responder killed by player @@ -64,10 +64,21 @@ export declare class PmcChatResponseService { * @returns */ protected getResponseLocaleKeys(keyType: string, isVictim?: boolean): string[]; + /** + * Get all locale keys that start with `pmcresponse-suffix` + * @returns array of keys + */ + protected getResponseSuffixLocaleKeys(): string[]; /** * Randomly draw a victim of the the array and return thier details * @param pmcVictims Possible victims to choose from * @returns IUserDialogInfo */ protected chooseRandomVictim(pmcVictims: Victim[]): IUserDialogInfo; + /** + * Convert a victim object into a IUserDialogInfo object + * @param pmcVictim victim to convert + * @returns IUserDialogInfo + */ + protected getVictimDetails(pmcVictim: Victim): IUserDialogInfo; } diff --git a/readme.md b/readme.md index e752a52..930980a 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,4 @@ -# Mod examples for 3.5.2 +# Mod examples for 3.5.3 A collection of example mods that perform typical actions in SPT