Update types

This commit is contained in:
Dev 2023-03-13 19:11:29 +00:00
parent aeac2053d3
commit af9cacc6e9
31 changed files with 271 additions and 31 deletions

View File

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

View File

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

View File

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

View File

@ -3,6 +3,8 @@ export interface IInventoryConfig extends IBaseConfig {
kind: "aki-inventory";
newItemsMarkedFound: boolean;
randomLootContainers: Record<string, RewardDetails>;
/** Contains item tpls that the server should consider money and treat the same as roubles/euros/dollars */
customMoneyTpls: string[];
}
export interface RewardDetails {
rewardCount: number;

View File

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

View File

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

View File

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

View File

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

View File

@ -3,6 +3,8 @@ export interface IInventoryConfig extends IBaseConfig {
kind: "aki-inventory";
newItemsMarkedFound: boolean;
randomLootContainers: Record<string, RewardDetails>;
/** Contains item tpls that the server should consider money and treat the same as roubles/euros/dollars */
customMoneyTpls: string[];
}
export interface RewardDetails {
rewardCount: number;

View File

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

View File

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

View File

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

View File

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

View File

@ -3,6 +3,8 @@ export interface IInventoryConfig extends IBaseConfig {
kind: "aki-inventory";
newItemsMarkedFound: boolean;
randomLootContainers: Record<string, RewardDetails>;
/** Contains item tpls that the server should consider money and treat the same as roubles/euros/dollars */
customMoneyTpls: string[];
}
export interface RewardDetails {
rewardCount: number;

View File

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

View File

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

View File

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

View File

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

View File

@ -3,6 +3,8 @@ export interface IInventoryConfig extends IBaseConfig {
kind: "aki-inventory";
newItemsMarkedFound: boolean;
randomLootContainers: Record<string, RewardDetails>;
/** Contains item tpls that the server should consider money and treat the same as roubles/euros/dollars */
customMoneyTpls: string[];
}
export interface RewardDetails {
rewardCount: number;

View File

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

View File

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

View File

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

View File

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

View File

@ -3,6 +3,8 @@ export interface IInventoryConfig extends IBaseConfig {
kind: "aki-inventory";
newItemsMarkedFound: boolean;
randomLootContainers: Record<string, RewardDetails>;
/** Contains item tpls that the server should consider money and treat the same as roubles/euros/dollars */
customMoneyTpls: string[];
}
export interface RewardDetails {
rewardCount: number;

View File

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

View File

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

View File

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

View File

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

View File

@ -3,6 +3,8 @@ export interface IInventoryConfig extends IBaseConfig {
kind: "aki-inventory";
newItemsMarkedFound: boolean;
randomLootContainers: Record<string, RewardDetails>;
/** Contains item tpls that the server should consider money and treat the same as roubles/euros/dollars */
customMoneyTpls: string[];
}
export interface RewardDetails {
rewardCount: number;

View File

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

View File

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