Update types to 3.2.2
This commit is contained in:
parent
eeece35098
commit
5ba3a299f8
@ -11,4 +11,5 @@ export declare class LocationCallbacks {
|
|||||||
constructor(httpResponse: HttpResponseUtil, locationController: LocationController);
|
constructor(httpResponse: HttpResponseUtil, locationController: LocationController);
|
||||||
getLocationData(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ILocationsGenerateAllResponse>;
|
getLocationData(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ILocationsGenerateAllResponse>;
|
||||||
getLocation(url: string, info: IGetLocationRequestData, sessionID: string): IGetBodyResponseData<ILocationBase>;
|
getLocation(url: string, info: IGetLocationRequestData, sessionID: string): IGetBodyResponseData<ILocationBase>;
|
||||||
|
getAirdropLoot(url: string, info: IEmptyRequestData, sessionID: string): string;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { ProfileController } from "../controllers/ProfileController";
|
import { ProfileController } from "../controllers/ProfileController";
|
||||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
||||||
|
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
||||||
import { INullResponseData } from "../models/eft/httpResponse/INullResponseData";
|
import { INullResponseData } from "../models/eft/httpResponse/INullResponseData";
|
||||||
import { IGetMiniProfileRequestData } from "../models/eft/launcher/IGetMiniProfileRequestData";
|
import { IGetMiniProfileRequestData } from "../models/eft/launcher/IGetMiniProfileRequestData";
|
||||||
@ -12,20 +13,51 @@ import { ISearchFriendResponse } from "../models/eft/profile/ISearchFriendRespon
|
|||||||
import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNicknameRequestData";
|
import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNicknameRequestData";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||||
import { TimeUtil } from "../utils/TimeUtil";
|
import { TimeUtil } from "../utils/TimeUtil";
|
||||||
|
/** Handle profile related client events */
|
||||||
export declare class ProfileCallbacks {
|
export declare class ProfileCallbacks {
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
protected timeUtil: TimeUtil;
|
protected timeUtil: TimeUtil;
|
||||||
protected profileController: ProfileController;
|
protected profileController: ProfileController;
|
||||||
constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, profileController: ProfileController);
|
constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, profileController: ProfileController);
|
||||||
createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData<any>;
|
createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData<any>;
|
||||||
getProfileData(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any>;
|
/**
|
||||||
regenerateScav(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any>;
|
* Get the complete player profile (scav + pmc character)
|
||||||
|
* @param url
|
||||||
|
* @param info Empty
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @returns Profile object
|
||||||
|
*/
|
||||||
|
getProfileData(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IPmcData[]>;
|
||||||
|
/**
|
||||||
|
* Handle the creation of a scav profile for player
|
||||||
|
* Occurs post-raid and when profile first created immediately after character details are confirmed by player
|
||||||
|
* @param url
|
||||||
|
* @param info empty
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @returns Profile object
|
||||||
|
*/
|
||||||
|
regenerateScav(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IPmcData[]>;
|
||||||
|
/**
|
||||||
|
* Handle client/game/profile/voice/change event
|
||||||
|
* @param url
|
||||||
|
* @param info Change voice request object
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @returns Client response
|
||||||
|
*/
|
||||||
changeVoice(url: string, info: IProfileChangeVoiceRequestData, sessionID: string): INullResponseData;
|
changeVoice(url: string, info: IProfileChangeVoiceRequestData, sessionID: string): INullResponseData;
|
||||||
|
/**
|
||||||
|
* Handle client/game/profile/nickname/change event
|
||||||
|
* Client allows player to adjust their profile name
|
||||||
|
* @param url
|
||||||
|
* @param info Change nickname request object
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @returns client response
|
||||||
|
*/
|
||||||
changeNickname(url: string, info: IProfileChangeNicknameRequestData, sessionID: string): IGetBodyResponseData<any>;
|
changeNickname(url: string, info: IProfileChangeNicknameRequestData, sessionID: string): IGetBodyResponseData<any>;
|
||||||
validateNickname(url: string, info: IValidateNicknameRequestData, sessionID: string): IGetBodyResponseData<any>;
|
validateNickname(url: string, info: IValidateNicknameRequestData, sessionID: string): IGetBodyResponseData<any>;
|
||||||
getReservedNickname(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<string>;
|
getReservedNickname(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<string>;
|
||||||
/**
|
/**
|
||||||
* Called when creating a character, when you choose a character face/voice
|
* Called when creating a character when choosing a character face/voice
|
||||||
* @param url
|
* @param url
|
||||||
* @param info response (empty)
|
* @param info response (empty)
|
||||||
* @param sessionID
|
* @param sessionID
|
||||||
|
@ -19,6 +19,9 @@ import { ConfigServer } from "../servers/ConfigServer";
|
|||||||
import { RagfairServer } from "../servers/RagfairServer";
|
import { RagfairServer } from "../servers/RagfairServer";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { JsonUtil } from "../utils/JsonUtil";
|
||||||
|
/**
|
||||||
|
* Handle ragfair related callback events
|
||||||
|
*/
|
||||||
export declare class RagfairCallbacks extends OnLoadOnUpdate {
|
export declare class RagfairCallbacks extends OnLoadOnUpdate {
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
|
@ -35,6 +35,30 @@ export declare class InraidController {
|
|||||||
constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, configServer: ConfigServer);
|
constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, configServer: ConfigServer);
|
||||||
addPlayer(sessionID: string, info: IRegisterPlayerRequestData): void;
|
addPlayer(sessionID: string, info: IRegisterPlayerRequestData): void;
|
||||||
saveProgress(offraidData: ISaveProgressRequestData, sessionID: string): void;
|
saveProgress(offraidData: ISaveProgressRequestData, sessionID: string): void;
|
||||||
|
/**
|
||||||
|
* Handle updating the profile post-pmc raid
|
||||||
|
* @param sessionID session id
|
||||||
|
* @param offraidData post-raid data of raid
|
||||||
|
*/
|
||||||
|
protected savePmcProgress(sessionID: string, offraidData: ISaveProgressRequestData): void;
|
||||||
|
/**
|
||||||
|
* Reduce body part hp to % of max
|
||||||
|
* @param pmcData profile to edit
|
||||||
|
* @param multipler multipler to apply to max health
|
||||||
|
*/
|
||||||
|
protected reducePmcHealthToPercent(pmcData: IPmcData, multipler: number): void;
|
||||||
|
/**
|
||||||
|
* Handle updating the profile post-pscav raid
|
||||||
|
* @param sessionID session id
|
||||||
|
* @param offraidData post-raid data of raid
|
||||||
|
*/
|
||||||
|
protected savePlayerScavProgress(sessionID: string, offraidData: ISaveProgressRequestData): void;
|
||||||
|
/**
|
||||||
|
* Is the player dead after a raid - dead is anything other than "survived" / "runner"
|
||||||
|
* @param statusOnExit exit value from offraidData object
|
||||||
|
* @returns true if dead
|
||||||
|
*/
|
||||||
|
protected isPlayerDead(statusOnExit: string): boolean;
|
||||||
/**
|
/**
|
||||||
* Mark inventory items as FiR if player survived raid, otherwise remove FiR from them
|
* Mark inventory items as FiR if player survived raid, otherwise remove FiR from them
|
||||||
* @param offraidData Save Progress Request
|
* @param offraidData Save Progress Request
|
||||||
|
@ -92,7 +92,11 @@ export declare class InventoryController {
|
|||||||
*/
|
*/
|
||||||
toggleItem(pmcData: IPmcData, body: IInventoryToggleRequestData, sessionID: string): IItemEventRouterResponse;
|
toggleItem(pmcData: IPmcData, body: IInventoryToggleRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Handles Tagging of items (primary Containers).
|
* Add a tag to an inventory item
|
||||||
|
* @param pmcData profile with item to add tag to
|
||||||
|
* @param body tag request data
|
||||||
|
* @param sessionID session id
|
||||||
|
* @returns client response object
|
||||||
*/
|
*/
|
||||||
tagItem(pmcData: IPmcData, body: IInventoryTagRequestData, sessionID: string): IItemEventRouterResponse;
|
tagItem(pmcData: IPmcData, body: IInventoryTagRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
bindItem(pmcData: IPmcData, body: IInventoryBindRequestData, sessionID: string): IItemEventRouterResponse;
|
bindItem(pmcData: IPmcData, body: IInventoryBindRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
@ -1,18 +1,33 @@
|
|||||||
import { LocationGenerator } from "../generators/LocationGenerator";
|
import { LocationGenerator } from "../generators/LocationGenerator";
|
||||||
|
import { LootGenerator } from "../generators/LootGenerator";
|
||||||
import { ILocationBase } from "../models/eft/common/ILocationBase";
|
import { ILocationBase } from "../models/eft/common/ILocationBase";
|
||||||
import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSourceDestinationBase";
|
import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSourceDestinationBase";
|
||||||
|
import { IAirdropConfig } from "../models/spt/config/IAirdropConfig";
|
||||||
|
import { LootItem } from "../models/spt/services/LootItem";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { ILogger } from "../models/spt/utils/ILogger";
|
||||||
|
import { ConfigServer } from "../servers/ConfigServer";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||||
|
import { HashUtil } from "../utils/HashUtil";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { JsonUtil } from "../utils/JsonUtil";
|
||||||
import { TimeUtil } from "../utils/TimeUtil";
|
import { TimeUtil } from "../utils/TimeUtil";
|
||||||
export declare class LocationController {
|
export declare class LocationController {
|
||||||
protected jsonUtil: JsonUtil;
|
protected jsonUtil: JsonUtil;
|
||||||
|
protected hashUtil: HashUtil;
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected locationGenerator: LocationGenerator;
|
protected locationGenerator: LocationGenerator;
|
||||||
|
protected lootGenerator: LootGenerator;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseServer: DatabaseServer;
|
||||||
protected timeUtil: TimeUtil;
|
protected timeUtil: TimeUtil;
|
||||||
constructor(jsonUtil: JsonUtil, logger: ILogger, locationGenerator: LocationGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil);
|
protected configServer: ConfigServer;
|
||||||
|
protected airdropConfig: IAirdropConfig;
|
||||||
|
constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, logger: ILogger, locationGenerator: LocationGenerator, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer);
|
||||||
get(location: string): ILocationBase;
|
get(location: string): ILocationBase;
|
||||||
generate(name: string): ILocationBase;
|
generate(name: string): ILocationBase;
|
||||||
generateAll(): ILocationsGenerateAllResponse;
|
generateAll(): ILocationsGenerateAllResponse;
|
||||||
|
/**
|
||||||
|
* Get loot for an airdop container
|
||||||
|
* Generates it randomly based on config/airdrop.json values
|
||||||
|
* @returns Array of LootItem
|
||||||
|
*/
|
||||||
|
getAirdropLoot(): LootItem[];
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestDa
|
|||||||
import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData";
|
import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData";
|
||||||
import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult";
|
import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult";
|
||||||
import { IStartOfflineRaidRequestData } from "../models/eft/match/IStartOffineRaidRequestData";
|
import { IStartOfflineRaidRequestData } from "../models/eft/match/IStartOffineRaidRequestData";
|
||||||
|
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
||||||
import { IInRaidConfig } from "../models/spt/config/IInRaidConfig";
|
import { IInRaidConfig } from "../models/spt/config/IInRaidConfig";
|
||||||
import { IMatchConfig } from "../models/spt/config/IMatchConfig";
|
import { IMatchConfig } from "../models/spt/config/IMatchConfig";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { ILogger } from "../models/spt/utils/ILogger";
|
||||||
@ -29,6 +30,7 @@ export declare class MatchController {
|
|||||||
protected applicationContext: ApplicationContext;
|
protected applicationContext: ApplicationContext;
|
||||||
protected matchConfig: IMatchConfig;
|
protected matchConfig: IMatchConfig;
|
||||||
protected inraidConfig: IInRaidConfig;
|
protected inraidConfig: IInRaidConfig;
|
||||||
|
protected botConfig: IBotConfig;
|
||||||
constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, applicationContext: ApplicationContext);
|
constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, applicationContext: ApplicationContext);
|
||||||
getEnabled(): boolean;
|
getEnabled(): boolean;
|
||||||
getProfile(info: IGetProfileRequestData): IPmcData[];
|
getProfile(info: IGetProfileRequestData): IPmcData[];
|
||||||
|
@ -39,16 +39,31 @@ export declare class QuestController {
|
|||||||
* @returns array of IQuest
|
* @returns array of IQuest
|
||||||
*/
|
*/
|
||||||
getClientQuests(sessionID: string): IQuest[];
|
getClientQuests(sessionID: string): IQuest[];
|
||||||
|
/**
|
||||||
|
* Is the quest for the opposite side the player is on
|
||||||
|
* @param side player side (usec/bear)
|
||||||
|
* @param questId questId to check
|
||||||
|
*/
|
||||||
|
protected questIsForOtherSide(side: string, questId: string): boolean;
|
||||||
|
/**
|
||||||
|
* Handle the client accepting a quest and starting it
|
||||||
|
* Send starting rewards if any to player and
|
||||||
|
* Send start notification if any to player
|
||||||
|
* @param pmcData Profile to update
|
||||||
|
* @param acceptedQuest Quest accepted
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @returns client response
|
||||||
|
*/
|
||||||
acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Remove completed quest from profile
|
* Update completed quest in profile
|
||||||
* Add newly unlocked quests to profile
|
* Add newly unlocked quests to profile
|
||||||
* Also recalculate thier level due to exp rewards
|
* Also recalculate thier level due to exp rewards
|
||||||
* @param pmcData Player profile
|
* @param pmcData Player profile
|
||||||
* @param body completed quest request
|
* @param body Completed quest request
|
||||||
* @param sessionID session id
|
* @param sessionID Session id
|
||||||
* @returns ItemEvent response
|
* @returns ItemEvent client response
|
||||||
*/
|
*/
|
||||||
completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
@ -67,10 +82,20 @@ export declare class QuestController {
|
|||||||
protected getQuestsFailedByCompletingQuest(completedQuestId: string): IQuest[];
|
protected getQuestsFailedByCompletingQuest(completedQuestId: string): IQuest[];
|
||||||
/**
|
/**
|
||||||
* Fail the quests provided
|
* Fail the quests provided
|
||||||
|
* Update quest in profile, otherwise add fresh quest object with failed status
|
||||||
* @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
|
||||||
*/
|
*/
|
||||||
protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void;
|
protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void;
|
||||||
handoverQuest(pmcData: IPmcData, body: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
handoverQuest(pmcData: IPmcData, body: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Increment a backend counter stored value by an amount,
|
||||||
|
* Create counter if it does not exist
|
||||||
|
* @param pmcData Profile to find backend counter in
|
||||||
|
* @param conditionId backend counter id to update
|
||||||
|
* @param questId quest id counter is associated with
|
||||||
|
* @param counterValue value to increment the backend counter with
|
||||||
|
*/
|
||||||
|
protected updateProfileBackendCounterValue(pmcData: IPmcData, conditionId: string, questId: string, counterValue: number): void;
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ import { RagfairOfferHelper } from "../helpers/RagfairOfferHelper";
|
|||||||
import { RagfairSellHelper } from "../helpers/RagfairSellHelper";
|
import { RagfairSellHelper } from "../helpers/RagfairSellHelper";
|
||||||
import { RagfairSortHelper } from "../helpers/RagfairSortHelper";
|
import { RagfairSortHelper } from "../helpers/RagfairSortHelper";
|
||||||
import { RagfairTaxHelper } from "../helpers/RagfairTaxHelper";
|
import { RagfairTaxHelper } from "../helpers/RagfairTaxHelper";
|
||||||
|
import { TraderHelper } from "../helpers/TraderHelper";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||||
import { Item } from "../models/eft/common/tables/IItem";
|
import { Item } from "../models/eft/common/tables/IItem";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
@ -33,6 +34,9 @@ import { RagfairPriceService } from "../services/RagfairPriceService";
|
|||||||
import { RagfairRequiredItemsService } from "../services/RagfairRequiredItemsService";
|
import { RagfairRequiredItemsService } from "../services/RagfairRequiredItemsService";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||||
import { TimeUtil } from "../utils/TimeUtil";
|
import { TimeUtil } from "../utils/TimeUtil";
|
||||||
|
/**
|
||||||
|
* Handle RagfairCallback events
|
||||||
|
*/
|
||||||
export declare class RagfairController {
|
export declare class RagfairController {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected timeUtil: TimeUtil;
|
protected timeUtil: TimeUtil;
|
||||||
@ -52,14 +56,20 @@ export declare class RagfairController {
|
|||||||
protected handbookHelper: HandbookHelper;
|
protected handbookHelper: HandbookHelper;
|
||||||
protected paymentHelper: PaymentHelper;
|
protected paymentHelper: PaymentHelper;
|
||||||
protected inventoryHelper: InventoryHelper;
|
protected inventoryHelper: InventoryHelper;
|
||||||
|
protected traderHelper: TraderHelper;
|
||||||
protected ragfairHelper: RagfairHelper;
|
protected ragfairHelper: RagfairHelper;
|
||||||
protected ragfairOfferService: RagfairOfferService;
|
protected ragfairOfferService: RagfairOfferService;
|
||||||
protected ragfairRequiredItemsService: RagfairRequiredItemsService;
|
protected ragfairRequiredItemsService: RagfairRequiredItemsService;
|
||||||
protected ragfairOfferGenerator: RagfairOfferGenerator;
|
protected ragfairOfferGenerator: RagfairOfferGenerator;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected ragfairConfig: IRagfairConfig;
|
protected ragfairConfig: IRagfairConfig;
|
||||||
constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, itemEventRouter: ItemEventRouter, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, configServer: ConfigServer);
|
constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, itemEventRouter: ItemEventRouter, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, configServer: ConfigServer);
|
||||||
getOffers(sessionID: string, info: ISearchRequestData): IGetOffersResult;
|
getOffers(sessionID: string, info: ISearchRequestData): IGetOffersResult;
|
||||||
|
/**
|
||||||
|
* Update a trader flea offer with buy restrictions stored in the traders assort
|
||||||
|
* @param offer flea offer to update
|
||||||
|
*/
|
||||||
|
protected setTraderOfferPurchaseLimits(offer: IRagfairOffer): void;
|
||||||
protected isLinkedSearch(info: ISearchRequestData): boolean;
|
protected isLinkedSearch(info: ISearchRequestData): boolean;
|
||||||
protected isRequiredSearch(info: ISearchRequestData): boolean;
|
protected isRequiredSearch(info: ISearchRequestData): boolean;
|
||||||
update(): void;
|
update(): void;
|
||||||
|
@ -7,6 +7,7 @@ import { Exit } from "../models/eft/common/ILocationBase";
|
|||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||||
import { TraderInfo } from "../models/eft/common/tables/IBotBase";
|
import { TraderInfo } from "../models/eft/common/tables/IBotBase";
|
||||||
import { ICompletion, ICompletionAvailableFor, IElimination, IEliminationCondition, IExploration, IExplorationCondition, IPmcDataRepeatableQuest, IRepeatableQuest, IReward, IRewards } from "../models/eft/common/tables/IRepeatableQuests";
|
import { ICompletion, ICompletionAvailableFor, IElimination, IEliminationCondition, IExploration, IExplorationCondition, IPmcDataRepeatableQuest, IRepeatableQuest, IReward, IRewards } from "../models/eft/common/tables/IRepeatableQuests";
|
||||||
|
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQuestChangeRequest";
|
import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQuestChangeRequest";
|
||||||
import { ELocationName } from "../models/enums/ELocationName";
|
import { ELocationName } from "../models/enums/ELocationName";
|
||||||
@ -15,6 +16,7 @@ import { ILogger } from "../models/spt/utils/ILogger";
|
|||||||
import { ItemEventRouter } from "../routers/ItemEventRouter";
|
import { ItemEventRouter } from "../routers/ItemEventRouter";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { ConfigServer } from "../servers/ConfigServer";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||||
|
import { ItemFilterService } from "../services/ItemFilterService";
|
||||||
import { PaymentService } from "../services/PaymentService";
|
import { PaymentService } from "../services/PaymentService";
|
||||||
import { ProfileFixerService } from "../services/ProfileFixerService";
|
import { ProfileFixerService } from "../services/ProfileFixerService";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { JsonUtil } from "../utils/JsonUtil";
|
||||||
@ -64,9 +66,10 @@ export declare class RepeatableQuestController {
|
|||||||
protected itemEventRouter: ItemEventRouter;
|
protected itemEventRouter: ItemEventRouter;
|
||||||
protected paymentService: PaymentService;
|
protected paymentService: PaymentService;
|
||||||
protected objectId: ObjectId;
|
protected objectId: ObjectId;
|
||||||
|
protected itemFilterService: ItemFilterService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected questConfig: IQuestConfig;
|
protected questConfig: IQuestConfig;
|
||||||
constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, itemEventRouter: ItemEventRouter, paymentService: PaymentService, objectId: ObjectId, configServer: ConfigServer);
|
constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, itemEventRouter: ItemEventRouter, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer);
|
||||||
/**
|
/**
|
||||||
* This is the method reached by the /client/repeatalbeQuests/activityPeriods endpoint
|
* This is the method reached by the /client/repeatalbeQuests/activityPeriods endpoint
|
||||||
* Returns an array of objects in the format of repeatable quests to the client.
|
* Returns an array of objects in the format of repeatable quests to the client.
|
||||||
@ -217,4 +220,16 @@ export declare class RepeatableQuestController {
|
|||||||
debugLogRepeatableQuestIds(pmcData: IPmcData): void;
|
debugLogRepeatableQuestIds(pmcData: IPmcData): void;
|
||||||
probabilityObjectArray<K, V>(configArrayInput: ProbabilityObject<K, V>[]): ProbabilityObjectArray<K, V>;
|
probabilityObjectArray<K, V>(configArrayInput: ProbabilityObject<K, V>[]): ProbabilityObjectArray<K, V>;
|
||||||
changeRepeatableQuest(pmcDataIn: IPmcData, body: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse;
|
changeRepeatableQuest(pmcDataIn: IPmcData, body: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable)
|
||||||
|
* @returns a list of rewardable items [[_tpl, itemTemplate],...]
|
||||||
|
*/
|
||||||
|
protected getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig): [string, ITemplateItem][];
|
||||||
|
/**
|
||||||
|
* Checks if an id is a valid item. Valid meaning that it's an item that may be a reward
|
||||||
|
* or content of bot loot. Items that are tested as valid may be in a player backpack or stash.
|
||||||
|
* @param {*} tpl template id of item to check
|
||||||
|
* @returns boolean: true if item is valid reward
|
||||||
|
*/
|
||||||
|
isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig): boolean;
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ import { TraderHelper } from "../helpers/TraderHelper";
|
|||||||
import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader";
|
import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { ILogger } from "../models/spt/utils/ILogger";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||||
|
import { FenceService } from "../services/FenceService";
|
||||||
import { TraderAssortService } from "../services/TraderAssortService";
|
import { TraderAssortService } from "../services/TraderAssortService";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { JsonUtil } from "../utils/JsonUtil";
|
||||||
import { TimeUtil } from "../utils/TimeUtil";
|
import { TimeUtil } from "../utils/TimeUtil";
|
||||||
@ -15,8 +16,9 @@ export declare class TraderController {
|
|||||||
protected traderHelper: TraderHelper;
|
protected traderHelper: TraderHelper;
|
||||||
protected timeUtil: TimeUtil;
|
protected timeUtil: TimeUtil;
|
||||||
protected traderAssortService: TraderAssortService;
|
protected traderAssortService: TraderAssortService;
|
||||||
|
protected fenceService: FenceService;
|
||||||
protected jsonUtil: JsonUtil;
|
protected jsonUtil: JsonUtil;
|
||||||
constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, jsonUtil: JsonUtil);
|
constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, fenceService: FenceService, jsonUtil: JsonUtil);
|
||||||
/**
|
/**
|
||||||
* Runs when onLoad event is fired
|
* Runs when onLoad event is fired
|
||||||
* Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService
|
* Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService
|
||||||
@ -26,6 +28,7 @@ export declare class TraderController {
|
|||||||
/**
|
/**
|
||||||
* Runs when onUpdate is fired
|
* Runs when onUpdate is fired
|
||||||
* If current time is > nextResupply(expire) time of trader, refresh traders assorts and
|
* If current time is > nextResupply(expire) time of trader, refresh traders assorts and
|
||||||
|
* Fence is handled slightly differently
|
||||||
* @returns has run
|
* @returns has run
|
||||||
*/
|
*/
|
||||||
update(): boolean;
|
update(): boolean;
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
import { DependencyContainer } from "tsyringe";
|
import { DependencyContainer } from "tsyringe";
|
||||||
|
/**
|
||||||
|
* Handle the registration of classes to be used by the Dependency Injection code
|
||||||
|
*/
|
||||||
export declare class Container {
|
export declare class Container {
|
||||||
static registerTypes(depContainer: DependencyContainer): void;
|
static registerTypes(depContainer: DependencyContainer): void;
|
||||||
static registerListTypes(depContainer: DependencyContainer): void;
|
static registerListTypes(depContainer: DependencyContainer): void;
|
||||||
|
@ -40,7 +40,7 @@ export declare class BotGenerator {
|
|||||||
* @param botTemplate base bot template to use (e.g. assault/pmcbot)
|
* @param botTemplate base bot template to use (e.g. assault/pmcbot)
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
generatePlayerScav(role: string, difficulty: string, botTemplate: IBotType): IBotBase;
|
generatePlayerScav(sessionId: string, role: string, difficulty: string, botTemplate: IBotType): IBotBase;
|
||||||
generate(sessionId: string, info: IGenerateBotsRequestData): IBotBase[];
|
generate(sessionId: string, info: IGenerateBotsRequestData): IBotBase[];
|
||||||
/**
|
/**
|
||||||
* Choose if a bot should become a PMC by checking if bot type is allowed to become a Pmc in botConfig.convertFromChances and doing a random int check
|
* Choose if a bot should become a PMC by checking if bot type is allowed to become a Pmc in botConfig.convertFromChances and doing a random int check
|
||||||
@ -58,7 +58,7 @@ export declare class BotGenerator {
|
|||||||
* @returns IBotBase object
|
* @returns IBotBase object
|
||||||
*/
|
*/
|
||||||
protected getCloneOfBotBase(): IBotBase;
|
protected getCloneOfBotBase(): IBotBase;
|
||||||
protected generateBot(bot: IBotBase, role: string, node: IBotType, isPmc: boolean, isPlayerScav?: boolean): IBotBase;
|
protected generateBot(sessionId: string, bot: IBotBase, role: string, node: IBotType, isPmc: boolean, isPlayerScav?: boolean): IBotBase;
|
||||||
/**
|
/**
|
||||||
* Log the number of PMCs generated to the debug console
|
* Log the number of PMCs generated to the debug console
|
||||||
*/
|
*/
|
||||||
|
@ -18,7 +18,7 @@ export declare class BotInventoryGenerator {
|
|||||||
protected botGeneratorHelper: BotGeneratorHelper;
|
protected botGeneratorHelper: BotGeneratorHelper;
|
||||||
protected weightedRandomHelper: WeightedRandomHelper;
|
protected weightedRandomHelper: WeightedRandomHelper;
|
||||||
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, weightedRandomHelper: WeightedRandomHelper);
|
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, weightedRandomHelper: WeightedRandomHelper);
|
||||||
generateInventory(templateInventory: Inventory, equipmentChances: Chances, generation: Generation, botRole: string, isPmc: boolean): PmcInventory;
|
generateInventory(sessionId: string, templateInventory: Inventory, equipmentChances: Chances, generation: Generation, botRole: string, isPmc: boolean): PmcInventory;
|
||||||
protected generateEquipment(equipmentSlot: string, equipmentPool: Record<string, number>, modPool: Mods, spawnChances: Chances, botRole: string, inventory: PmcInventory): void;
|
protected generateEquipment(equipmentSlot: string, equipmentPool: Record<string, number>, modPool: Mods, spawnChances: Chances, botRole: string, inventory: PmcInventory): void;
|
||||||
protected generateInventoryBase(): PmcInventory;
|
protected generateInventoryBase(): PmcInventory;
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ export declare class BotLootGenerator {
|
|||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected botConfig: IBotConfig;
|
protected botConfig: IBotConfig;
|
||||||
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botLootCacheService: BotLootCacheService, configServer: ConfigServer);
|
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botLootCacheService: BotLootCacheService, configServer: ConfigServer);
|
||||||
generateLoot(templateInventory: Inventory, itemCounts: ItemMinMax, isPmc: boolean, botRole: string, botInventory: PmcInventory, equipmentChances: Chances): void;
|
generateLoot(sessionId: string, templateInventory: Inventory, itemCounts: ItemMinMax, isPmc: boolean, botRole: string, botInventory: PmcInventory, equipmentChances: Chances): void;
|
||||||
protected getRandomisedCount(min: number, max: number, nValue: number): number;
|
protected getRandomisedCount(min: number, max: number, nValue: number): number;
|
||||||
/**
|
/**
|
||||||
* Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit is reached
|
* Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit is reached
|
||||||
@ -47,7 +47,7 @@ export declare class BotLootGenerator {
|
|||||||
* @param botRole bots role, .e.g. pmcBot
|
* @param botRole bots role, .e.g. pmcBot
|
||||||
* @param isPmc are we generating for a pmc
|
* @param isPmc are we generating for a pmc
|
||||||
*/
|
*/
|
||||||
protected addLooseWeaponsToInventorySlot(botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean): void;
|
protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean): void;
|
||||||
/**
|
/**
|
||||||
* Get a random item from the pool parameter using the biasedRandomNumber system
|
* Get a random item from the pool parameter using the biasedRandomNumber system
|
||||||
* @param pool pool of items to pick an item from
|
* @param pool pool of items to pick an item from
|
||||||
|
@ -28,7 +28,18 @@ export declare class BotWeaponGenerator {
|
|||||||
protected botConfig: IBotConfig;
|
protected botConfig: IBotConfig;
|
||||||
constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer);
|
constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer);
|
||||||
/**
|
/**
|
||||||
* Get a random weapon from a bots pool of weapons (weighted)
|
* Pick a random weapon based on weightings and generate a functional weapon
|
||||||
|
* @param equipmentSlot Primary/secondary/holster
|
||||||
|
* @param botTemplateInventory e.g. assault.json
|
||||||
|
* @param weaponParentId
|
||||||
|
* @param modChances
|
||||||
|
* @param botRole role of bot, e.g. assault/followerBully
|
||||||
|
* @param isPmc Is weapon generated for a pmc
|
||||||
|
* @returns GenerateWeaponResult object
|
||||||
|
*/
|
||||||
|
generateRandomWeapon(sessionId: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean): GenerateWeaponResult;
|
||||||
|
/**
|
||||||
|
* Get a random weighted weapon from a bots pool of weapons
|
||||||
* @param equipmentSlot Primary/secondary/holster
|
* @param equipmentSlot Primary/secondary/holster
|
||||||
* @param botTemplateInventory e.g. assault.json
|
* @param botTemplateInventory e.g. assault.json
|
||||||
* @returns weapon tpl
|
* @returns weapon tpl
|
||||||
@ -39,43 +50,24 @@ export declare class BotWeaponGenerator {
|
|||||||
* @param weaponTpl weapon tpl to generate (use pickWeightedWeaponTplFromPool())
|
* @param weaponTpl weapon tpl to generate (use pickWeightedWeaponTplFromPool())
|
||||||
* @param equipmentSlot slot to fit into, primary/secondary/holster
|
* @param equipmentSlot slot to fit into, primary/secondary/holster
|
||||||
* @param botTemplateInventory e.g. assault.json
|
* @param botTemplateInventory e.g. assault.json
|
||||||
* @param weaponParentId
|
* @param weaponParentId ParentId of the weapon being generated
|
||||||
* @param modChances
|
* @param modChances Dictionary of item types and % chance weapon will have that mod
|
||||||
* @param botRole
|
* @param botRole e.g. assault/exusec
|
||||||
* @param isPmc
|
* @param isPmc
|
||||||
* @returns GenerateWeaponResult object
|
* @returns GenerateWeaponResult object
|
||||||
*/
|
*/
|
||||||
generateWeaponByTpl(weaponTpl: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean): GenerateWeaponResult;
|
generateWeaponByTpl(sessionId: string, weaponTpl: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean): GenerateWeaponResult;
|
||||||
/**
|
/**
|
||||||
* Generate an entirely random weapon
|
* Create array with weapon base as only element and
|
||||||
* @param equipmentSlot Primary/secondary/holster
|
* add additional properties based on weapon type
|
||||||
* @param botTemplateInventory e.g. assault.json
|
* @param weaponTpl Weapon tpl to create item with
|
||||||
* @param weaponParentId
|
* @param weaponParentId Weapons parent id
|
||||||
* @param modChances
|
* @param equipmentSlot e.g. primary/secondary/holster
|
||||||
* @param botRole
|
* @param weaponItemTemplate db template for weapon
|
||||||
* @param isPmc
|
|
||||||
* @returns GenerateWeaponResult object
|
|
||||||
*/
|
|
||||||
generateRandomWeapon(equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean): GenerateWeaponResult;
|
|
||||||
/**
|
|
||||||
* Create array with weapon base as only element
|
|
||||||
* Add additional properties as required
|
|
||||||
* @param weaponTpl
|
|
||||||
* @param weaponParentId
|
|
||||||
* @param equipmentSlot
|
|
||||||
* @param weaponItemTemplate
|
|
||||||
* @param botRole for durability values
|
* @param botRole for durability values
|
||||||
* @returns
|
* @returns Base weapon item in array
|
||||||
*/
|
*/
|
||||||
constructWeaponBaseArray(weaponTpl: string, weaponParentId: string, equipmentSlot: string, weaponItemTemplate: ITemplateItem, botRole: string): Item[];
|
constructWeaponBaseArray(weaponTpl: string, weaponParentId: string, equipmentSlot: string, weaponItemTemplate: ITemplateItem, botRole: string): Item[];
|
||||||
/**
|
|
||||||
* Add compatible magazines to an inventory based on a generated weapon
|
|
||||||
* @param weaponDetails
|
|
||||||
* @param magCounts
|
|
||||||
* @param inventory
|
|
||||||
* @param botRole the bot type we're getting generating extra mags for
|
|
||||||
*/
|
|
||||||
addExtraMagazinesToInventory(weaponDetails: GenerateWeaponResult, magCounts: MinMax, inventory: PmcInventory, botRole: string): void;
|
|
||||||
/**
|
/**
|
||||||
* Get the mods necessary to kit out a weapon to its preset level
|
* Get the mods necessary to kit out a weapon to its preset level
|
||||||
* @param weaponTpl weapon to find preset for
|
* @param weaponTpl weapon to find preset for
|
||||||
@ -84,20 +76,32 @@ export declare class BotWeaponGenerator {
|
|||||||
* @returns array of weapon mods
|
* @returns array of weapon mods
|
||||||
*/
|
*/
|
||||||
protected getPresetWeaponMods(weaponTpl: string, equipmentSlot: string, weaponParentId: string, itemTemplate: ITemplateItem, botRole: string): Item[];
|
protected getPresetWeaponMods(weaponTpl: string, equipmentSlot: string, weaponParentId: string, itemTemplate: ITemplateItem, botRole: string): Item[];
|
||||||
/** Checks if all required slots are occupied on a weapon and all it's mods */
|
/**
|
||||||
|
* Checks if all required slots are occupied on a weapon and all it's mods
|
||||||
|
* @param weaponItemArray Weapon + mods
|
||||||
|
* @returns true if valid
|
||||||
|
*/
|
||||||
protected isWeaponValid(weaponItemArray: Item[]): boolean;
|
protected isWeaponValid(weaponItemArray: Item[]): boolean;
|
||||||
/**
|
/**
|
||||||
* Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets.
|
* Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets.
|
||||||
* Additionally, adds extra bullets to SecuredContainer
|
* Additionally, adds extra bullets to SecuredContainer
|
||||||
* @param weaponMods
|
* @param weaponMods mods to attach to weapon
|
||||||
* @param weaponTemplate
|
* @param weaponTemplate db template for weapon
|
||||||
* @param magCounts
|
* @param magCounts magazine count to add to inventory
|
||||||
* @param ammoTpl
|
* @param ammoTpl ammo templateId to add to magazines
|
||||||
* @param inventory
|
* @param inventory inventory to add magazines to
|
||||||
* @param botRole the bot type we're getting generating extra mags for
|
* @param botRole the bot type we're getting generating extra mags for
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
protected generateExtraMagazines(weaponMods: Item[], weaponTemplate: ITemplateItem, magCounts: MinMax, ammoTpl: string, inventory: PmcInventory, botRole: string): void;
|
addExtraMagazinesToInventory(weaponMods: Item[], weaponTemplate: ITemplateItem, magCounts: MinMax, ammoTpl: string, inventory: PmcInventory, botRole: string): void;
|
||||||
|
/**
|
||||||
|
* Create a magazine using the parameters given
|
||||||
|
* @param magazineTpl Tpl of the magazine to create
|
||||||
|
* @param ammoTpl Ammo to add to magazine
|
||||||
|
* @param magTemplate template object of magazine
|
||||||
|
* @returns Item array
|
||||||
|
*/
|
||||||
|
protected createMagazine(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[];
|
||||||
/**
|
/**
|
||||||
* Get a randomised number of bullets for a specific magazine
|
* Get a randomised number of bullets for a specific magazine
|
||||||
* @param magCounts min and max count of magazines
|
* @param magCounts min and max count of magazines
|
||||||
@ -138,10 +142,9 @@ export declare class BotWeaponGenerator {
|
|||||||
* Finds and return a compatible ammo tpl based on the bots ammo weightings (x.json/inventory/equipment/ammo)
|
* Finds and return a compatible ammo tpl based on the bots ammo weightings (x.json/inventory/equipment/ammo)
|
||||||
* @param ammo a list of ammo tpls the weapon can use
|
* @param ammo a list of ammo tpls the weapon can use
|
||||||
* @param weaponTemplate the weapon we want to pick ammo for
|
* @param weaponTemplate the weapon we want to pick ammo for
|
||||||
* @param isPmc is the ammo being gathered for a pmc (runs pmc ammo filtering)
|
|
||||||
* @returns an ammo tpl that works with the desired gun
|
* @returns an ammo tpl that works with the desired gun
|
||||||
*/
|
*/
|
||||||
protected getCompatibleAmmo(ammo: Record<string, Record<string, number>>, weaponTemplate: ITemplateItem, isPmc: boolean): string;
|
protected getWeightedCompatibleAmmo(ammo: Record<string, Record<string, number>>, weaponTemplate: ITemplateItem): string;
|
||||||
/**
|
/**
|
||||||
* Get a weapons compatible cartridge caliber
|
* Get a weapons compatible cartridge caliber
|
||||||
* @param weaponTemplate Weapon to look up caliber of
|
* @param weaponTemplate Weapon to look up caliber of
|
||||||
|
@ -3,10 +3,9 @@ import { GameEventHelper } from "../helpers/GameEventHelper";
|
|||||||
import { ItemHelper } from "../helpers/ItemHelper";
|
import { ItemHelper } from "../helpers/ItemHelper";
|
||||||
import { PresetHelper } from "../helpers/PresetHelper";
|
import { PresetHelper } from "../helpers/PresetHelper";
|
||||||
import { RagfairServerHelper } from "../helpers/RagfairServerHelper";
|
import { RagfairServerHelper } from "../helpers/RagfairServerHelper";
|
||||||
import { ILooseLoot, SpawnpointTemplate } from "../models/eft/common/ILooseLoot";
|
import { ILooseLoot, SpawnpointsForced, SpawnpointTemplate } from "../models/eft/common/ILooseLoot";
|
||||||
import { Item } from "../models/eft/common/tables/IItem";
|
import { Item } from "../models/eft/common/tables/IItem";
|
||||||
import { IStaticAmmoDetails, IStaticContainerProps, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase";
|
import { IStaticAmmoDetails, IStaticContainerProps, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase";
|
||||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
|
||||||
import { ILocationConfig } from "../models/spt/config/ILocationConfig";
|
import { ILocationConfig } from "../models/spt/config/ILocationConfig";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { ILogger } from "../models/spt/utils/ILogger";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { ConfigServer } from "../servers/ConfigServer";
|
||||||
@ -36,11 +35,19 @@ export declare class LocationGenerator {
|
|||||||
generateContainerLoot(containerIn: IStaticContainerProps, staticForced: IStaticForcedProps[], staticLootDist: Record<string, IStaticLootDetails>, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, locationName: string): IStaticContainerProps;
|
generateContainerLoot(containerIn: IStaticContainerProps, staticForced: IStaticForcedProps[], staticLootDist: Record<string, IStaticLootDetails>, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, locationName: string): IStaticContainerProps;
|
||||||
protected getLooseLootMultiplerForLocation(location: string): number;
|
protected getLooseLootMultiplerForLocation(location: string): number;
|
||||||
protected getStaticLootMultiplerForLocation(location: string): number;
|
protected getStaticLootMultiplerForLocation(location: string): number;
|
||||||
|
/**
|
||||||
|
* Create array of loose + forced loot using probability system
|
||||||
|
* @param dynamicLootDist
|
||||||
|
* @param staticAmmoDist
|
||||||
|
* @param locationName Location to generate loot for
|
||||||
|
* @returns Array of spawn points with loot in them
|
||||||
|
*/
|
||||||
generateDynamicLoot(dynamicLootDist: ILooseLoot, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, locationName: string): SpawnpointTemplate[];
|
generateDynamicLoot(dynamicLootDist: ILooseLoot, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, locationName: string): SpawnpointTemplate[];
|
||||||
|
/**
|
||||||
|
* Add forced spawn point loot into loot parameter array
|
||||||
|
* @param loot array to add forced loot to
|
||||||
|
* @param forcedSpawnPoints forced loot to add
|
||||||
|
*/
|
||||||
|
protected addForcedLoot(loot: SpawnpointTemplate[], forcedSpawnPoints: SpawnpointsForced[]): void;
|
||||||
protected createItem(tpl: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, parentId?: string): IContainerItem;
|
protected createItem(tpl: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, parentId?: string): IContainerItem;
|
||||||
protected getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string;
|
|
||||||
protected getRandomValidCaliber(magTemplate: ITemplateItem): string;
|
|
||||||
protected drawAmmoTpl(caliber: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>): string;
|
|
||||||
protected createRandomMagCartridges(magTemplate: ITemplateItem, parentId: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, caliber?: string): Item;
|
|
||||||
protected createCartidges(parentId: string, ammoTpl: string, stackCount: number): Item;
|
|
||||||
}
|
}
|
||||||
|
55
TypeScript/10ScopesAndTypes/types/generators/LootGenerator.d.ts
vendored
Normal file
55
TypeScript/10ScopesAndTypes/types/generators/LootGenerator.d.ts
vendored
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
import { ItemHelper } from "../helpers/ItemHelper";
|
||||||
|
import { Preset } from "../models/eft/common/IGlobals";
|
||||||
|
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
||||||
|
import { LootItem } from "../models/spt/services/LootItem";
|
||||||
|
import { LootRequest } from "../models/spt/services/LootRequest";
|
||||||
|
import { ILogger } from "../models/spt/utils/ILogger";
|
||||||
|
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||||
|
import { ItemFilterService } from "../services/ItemFilterService";
|
||||||
|
import { RandomUtil } from "../utils/RandomUtil";
|
||||||
|
export declare class LootGenerator {
|
||||||
|
protected logger: ILogger;
|
||||||
|
protected databaseServer: DatabaseServer;
|
||||||
|
protected randomUtil: RandomUtil;
|
||||||
|
protected itemHelper: ItemHelper;
|
||||||
|
protected itemFilterService: ItemFilterService;
|
||||||
|
constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, itemFilterService: ItemFilterService);
|
||||||
|
/**
|
||||||
|
* Generate a list of items based on options passed in
|
||||||
|
* @param options parameters to adjust what loot is generated
|
||||||
|
* @returns An array of loot items
|
||||||
|
*/
|
||||||
|
createRandomloot(options: LootRequest): LootItem[];
|
||||||
|
/**
|
||||||
|
* Construct item limit record to hold max and current item count
|
||||||
|
* @param limits limits as defined in config
|
||||||
|
* @returns record, key: item tplId, value: current/max item count allowed
|
||||||
|
*/
|
||||||
|
protected initItemLimitCounter(limits: Record<string, number>): Record<string, {
|
||||||
|
current: number;
|
||||||
|
max: number;
|
||||||
|
}>;
|
||||||
|
/**
|
||||||
|
* Find a random item in items.json and add to result array
|
||||||
|
* @param items items to choose from
|
||||||
|
* @param itemTypeCounts item limit counts
|
||||||
|
* @param result array to add found item to
|
||||||
|
* @returns true if item was valid and added to pool
|
||||||
|
*/
|
||||||
|
protected findAndAddRandomItemToLoot(items: [string, ITemplateItem][], itemTypeCounts: Record<string, {
|
||||||
|
current: number;
|
||||||
|
max: number;
|
||||||
|
}>, result: LootItem[]): boolean;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Find a random item in items.json and add to result array
|
||||||
|
* @param globalDefaultPresets presets to choose from
|
||||||
|
* @param itemTypeCounts item limit counts
|
||||||
|
* @param result array to add found preset to
|
||||||
|
* @returns true if preset was valid and added to pool
|
||||||
|
*/
|
||||||
|
protected findAndAddRandomPresetToLoot(globalDefaultPresets: [string, Preset][], itemTypeCounts: Record<string, {
|
||||||
|
current: number;
|
||||||
|
max: number;
|
||||||
|
}>, result: LootItem[]): boolean;
|
||||||
|
}
|
@ -1,15 +1,21 @@
|
|||||||
import { ItemHelper } from "../helpers/ItemHelper";
|
import { ItemHelper } from "../helpers/ItemHelper";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
|
||||||
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
||||||
|
import { ConfigServer } from "../servers/ConfigServer";
|
||||||
|
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||||
|
import { ItemFilterService } from "../services/ItemFilterService";
|
||||||
|
/**
|
||||||
|
* Handle the generation of dynamic PMC loot in pockets and backpacks
|
||||||
|
* and the removal of blacklisted items
|
||||||
|
*/
|
||||||
export declare class PMCLootGenerator {
|
export declare class PMCLootGenerator {
|
||||||
protected itemHelper: ItemHelper;
|
protected itemHelper: ItemHelper;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseServer: DatabaseServer;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
|
protected itemFilterService: ItemFilterService;
|
||||||
protected pocketLootPool: string[];
|
protected pocketLootPool: string[];
|
||||||
protected backpackLootPool: string[];
|
protected backpackLootPool: string[];
|
||||||
protected botConfig: IBotConfig;
|
protected botConfig: IBotConfig;
|
||||||
constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer);
|
constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService);
|
||||||
generatePMCPocketLootPool(): string[];
|
generatePMCPocketLootPool(): string[];
|
||||||
generatePMCBackpackLootPool(): string[];
|
generatePMCBackpackLootPool(): string[];
|
||||||
}
|
}
|
||||||
|
@ -8,9 +8,13 @@ import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "../mo
|
|||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { ILogger } from "../models/spt/utils/ILogger";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { ConfigServer } from "../servers/ConfigServer";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||||
|
import { ItemFilterService } from "../services/ItemFilterService";
|
||||||
import { RagfairPriceService } from "../services/RagfairPriceService";
|
import { RagfairPriceService } from "../services/RagfairPriceService";
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
import { HashUtil } from "../utils/HashUtil";
|
||||||
import { RandomUtil } from "../utils/RandomUtil";
|
import { RandomUtil } from "../utils/RandomUtil";
|
||||||
|
/**
|
||||||
|
* Handle the creation of randomised scav case rewards
|
||||||
|
*/
|
||||||
export declare class ScavCaseRewardGenerator {
|
export declare class ScavCaseRewardGenerator {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected randomUtil: RandomUtil;
|
protected randomUtil: RandomUtil;
|
||||||
@ -18,9 +22,10 @@ export declare class ScavCaseRewardGenerator {
|
|||||||
protected itemHelper: ItemHelper;
|
protected itemHelper: ItemHelper;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseServer: DatabaseServer;
|
||||||
protected ragfairPriceService: RagfairPriceService;
|
protected ragfairPriceService: RagfairPriceService;
|
||||||
|
protected itemFilterService: ItemFilterService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected scavCaseConfig: IScavCaseConfig;
|
protected scavCaseConfig: IScavCaseConfig;
|
||||||
constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, configServer: ConfigServer);
|
constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, itemFilterService: ItemFilterService, configServer: ConfigServer);
|
||||||
/**
|
/**
|
||||||
* Create an array of rewards that will be given to the player upon completing their scav case build
|
* Create an array of rewards that will be given to the player upon completing their scav case build
|
||||||
* @param body client request
|
* @param body client request
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
|
||||||
import { IWeatherData } from "../models/eft/weather/IWeatherData";
|
import { IWeatherData } from "../models/eft/weather/IWeatherData";
|
||||||
import { IWeatherConfig } from "../models/spt/config/IWeatherConfig";
|
import { IWeatherConfig } from "../models/spt/config/IWeatherConfig";
|
||||||
|
import { ConfigServer } from "../servers/ConfigServer";
|
||||||
import { RandomUtil } from "../utils/RandomUtil";
|
import { RandomUtil } from "../utils/RandomUtil";
|
||||||
import { TimeUtil } from "../utils/TimeUtil";
|
import { TimeUtil } from "../utils/TimeUtil";
|
||||||
export declare class WeatherGenerator {
|
export declare class WeatherGenerator {
|
||||||
@ -21,11 +21,16 @@ export declare class WeatherGenerator {
|
|||||||
protected getAcceleratedTime(computedDate: Date): string;
|
protected getAcceleratedTime(computedDate: Date): string;
|
||||||
/**
|
/**
|
||||||
* Get current time formatted to fit BSGs requirement
|
* Get current time formatted to fit BSGs requirement
|
||||||
* @param computedDate
|
* @param computedDate date to format into bsg style
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
protected getNormalTime(computedDate: Date): string;
|
protected getNormalTime(computedDate: Date): string;
|
||||||
generateWeather(data: IWeatherData): IWeatherData;
|
/**
|
||||||
|
* Return randomised Weather data
|
||||||
|
* @param weatherData weather input data
|
||||||
|
* @returns Randomised weather data
|
||||||
|
*/
|
||||||
|
generateWeather(weatherData: IWeatherData): IWeatherData;
|
||||||
protected getWeightedFog(): string;
|
protected getWeightedFog(): string;
|
||||||
protected getWeightedRain(): number;
|
protected getWeightedRain(): number;
|
||||||
protected getRandomFloat(node: string): number;
|
protected getRandomFloat(node: string): number;
|
||||||
|
@ -17,7 +17,7 @@ export declare class AssortHelper {
|
|||||||
* @param assort assort items from a trader
|
* @param assort assort items from a trader
|
||||||
* @returns assort items minus locked quest assorts
|
* @returns assort items minus locked quest assorts
|
||||||
*/
|
*/
|
||||||
stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort): ITraderAssort;
|
stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort, flea?: boolean): ITraderAssort;
|
||||||
/**
|
/**
|
||||||
* Remove assorts from a trader that have not been unlocked yet
|
* Remove assorts from a trader that have not been unlocked yet
|
||||||
* @param pmcProfile player profile
|
* @param pmcProfile player profile
|
||||||
@ -32,5 +32,5 @@ export declare class AssortHelper {
|
|||||||
* @param itemID item id to remove from asort
|
* @param itemID item id to remove from asort
|
||||||
* @returns Modified assort
|
* @returns Modified assort
|
||||||
*/
|
*/
|
||||||
removeItemFromAssort(assort: ITraderAssort, itemID: string): ITraderAssort;
|
removeItemFromAssort(assort: ITraderAssort, itemID: string, flea?: boolean): ITraderAssort;
|
||||||
}
|
}
|
||||||
|
@ -3,10 +3,12 @@ import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"
|
|||||||
import { Mods, ModsChances } from "../models/eft/common/tables/IBotType";
|
import { Mods, ModsChances } from "../models/eft/common/tables/IBotType";
|
||||||
import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem";
|
import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem";
|
||||||
import { Grid, ITemplateItem, Slot } from "../models/eft/common/tables/ITemplateItem";
|
import { Grid, ITemplateItem, Slot } from "../models/eft/common/tables/ITemplateItem";
|
||||||
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
import { EquipmentFilterDetails, IBotConfig } from "../models/spt/config/IBotConfig";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { ILogger } from "../models/spt/utils/ILogger";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { ConfigServer } from "../servers/ConfigServer";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||||
|
import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService";
|
||||||
|
import { ItemFilterService } from "../services/ItemFilterService";
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
import { HashUtil } from "../utils/HashUtil";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { JsonUtil } from "../utils/JsonUtil";
|
||||||
import { RandomUtil } from "../utils/RandomUtil";
|
import { RandomUtil } from "../utils/RandomUtil";
|
||||||
@ -14,6 +16,7 @@ import { ContainerHelper } from "./ContainerHelper";
|
|||||||
import { InventoryHelper } from "./InventoryHelper";
|
import { InventoryHelper } from "./InventoryHelper";
|
||||||
import { ItemHelper } from "./ItemHelper";
|
import { ItemHelper } from "./ItemHelper";
|
||||||
import { ProbabilityHelper } from "./ProbabilityHelper";
|
import { ProbabilityHelper } from "./ProbabilityHelper";
|
||||||
|
import { ProfileHelper } from "./ProfileHelper";
|
||||||
export declare class BotGeneratorHelper {
|
export declare class BotGeneratorHelper {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected jsonUtil: JsonUtil;
|
protected jsonUtil: JsonUtil;
|
||||||
@ -25,10 +28,76 @@ export declare class BotGeneratorHelper {
|
|||||||
protected itemHelper: ItemHelper;
|
protected itemHelper: ItemHelper;
|
||||||
protected inventoryHelper: InventoryHelper;
|
protected inventoryHelper: InventoryHelper;
|
||||||
protected containerHelper: ContainerHelper;
|
protected containerHelper: ContainerHelper;
|
||||||
|
protected botEquipmentFilterService: BotEquipmentFilterService;
|
||||||
|
protected itemFilterService: ItemFilterService;
|
||||||
|
protected profileHelper: ProfileHelper;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected botConfig: IBotConfig;
|
protected botConfig: IBotConfig;
|
||||||
constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, configServer: ConfigServer);
|
constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, configServer: ConfigServer);
|
||||||
generateModsForItem(items: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances): Item[];
|
/**
|
||||||
|
* TODO - very similar to generateModsForWeapon
|
||||||
|
* Check mods are compatible and add to array
|
||||||
|
* @param equipment Equipment item to add mods to
|
||||||
|
* @param modPool Mod list to choose frm
|
||||||
|
* @param parentId parentid of item to add mod to
|
||||||
|
* @param parentTemplate template objet of item to add mods to
|
||||||
|
* @param modSpawnChances dictionary of mod items and their chance to spawn for this bot type
|
||||||
|
* @returns Item + compatible mods as an array
|
||||||
|
*/
|
||||||
|
generateModsForEquipment(equipment: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances): Item[];
|
||||||
|
/**
|
||||||
|
* TODO - very similar to generateModsForEquipment
|
||||||
|
* @param sessionId session id
|
||||||
|
* @param weapon Weapon to add mods to
|
||||||
|
* @param modPool pool of compatible mods to attach to gun
|
||||||
|
* @param weaponParentId parentId of weapon
|
||||||
|
* @param parentTemplate
|
||||||
|
* @param modSpawnChances
|
||||||
|
* @param ammoTpl ammo tpl to use when generating magazines/cartridges
|
||||||
|
* @param botRole role of bot weapon is generated for
|
||||||
|
* @returns Weapon with mods
|
||||||
|
*/
|
||||||
|
generateModsForWeapon(sessionId: string, weapon: Item[], modPool: Mods, weaponParentId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances, ammoTpl: string, botRole: string): Item[];
|
||||||
|
/**
|
||||||
|
* Generate a pool of mods for this bots mod type if bot has values inside `randomisedWeaponModSlots` array found in bot.json/equipment[botrole]
|
||||||
|
* @param allowedMods Mods to be added to mod pool
|
||||||
|
* @param botEquipBlacklist blacklist of items not allowed to be added to mod pool
|
||||||
|
* @param modSlot Slot to generate mods for
|
||||||
|
* @param itemModPool base mod pool to replace values of
|
||||||
|
*/
|
||||||
|
protected generateDynamicModPool(allowedMods: string[], botEquipBlacklist: EquipmentFilterDetails, modSlot: string, itemModPool: Record<string, string[]>): void;
|
||||||
|
/**
|
||||||
|
* Check if the specific item type on the weapon has reached the set limit
|
||||||
|
* @param modTpl item to check is limited
|
||||||
|
* @param currentCount current number of this item on gun
|
||||||
|
* @param maxLimit mod limit allowed
|
||||||
|
* @param botRole role of bot we're checking weapon of
|
||||||
|
* @returns true if limit reached
|
||||||
|
*/
|
||||||
|
protected weaponModLimitReached(modTpl: string, currentCount: {
|
||||||
|
count: number;
|
||||||
|
}, maxLimit: number, botRole: string): boolean;
|
||||||
|
/**
|
||||||
|
* log errors if mod is not valid for a slot
|
||||||
|
* @param modTpl
|
||||||
|
* @param found
|
||||||
|
* @param itemSlot
|
||||||
|
* @param modTemplate
|
||||||
|
* @param modSlot
|
||||||
|
* @param parentTemplate
|
||||||
|
* @returns true if valid
|
||||||
|
*/
|
||||||
|
protected isModValidForSlot(modTpl: string, found: boolean, itemSlot: Slot, modTemplate: ITemplateItem, modSlot: string, parentTemplate: ITemplateItem): boolean;
|
||||||
|
/**
|
||||||
|
* Create a mod item with parameters as properties
|
||||||
|
* @param modId _id
|
||||||
|
* @param modTpl _tpl
|
||||||
|
* @param parentId parentId
|
||||||
|
* @param modSlot slotId
|
||||||
|
* @param modTemplate Used to add additional properites in the upd object
|
||||||
|
* @returns Item object
|
||||||
|
*/
|
||||||
|
protected createModItem(modId: string, modTpl: string, parentId: string, modSlot: string, modTemplate: ITemplateItem): Item;
|
||||||
/**
|
/**
|
||||||
* Is this magazine cylinder related (revolvers and grenade launchers)
|
* Is this magazine cylinder related (revolvers and grenade launchers)
|
||||||
* @param magazineParentName the name of the magazines parent
|
* @param magazineParentName the name of the magazines parent
|
||||||
@ -62,11 +131,11 @@ export declare class BotGeneratorHelper {
|
|||||||
* Those magazines (e.g. 60dc519adf4c47305f6d410d) have a "Cartridges" entry with a _max_count=0.
|
* Those magazines (e.g. 60dc519adf4c47305f6d410d) have a "Cartridges" entry with a _max_count=0.
|
||||||
* Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots.
|
* Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots.
|
||||||
* This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine"
|
* This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine"
|
||||||
*
|
* @param items The items where the CylinderMagazine's camora are appended to
|
||||||
* @param {object} items The items where the CylinderMagazine's camora are appended to
|
* @param modPool modPool which should include available cartrigdes
|
||||||
* @param {object} modPool modPool which should include available cartrigdes
|
* @param parentId The CylinderMagazine's UID
|
||||||
* @param {string} parentId The CylinderMagazine's UID
|
* @param parentTemplate The CylinderMagazine's template
|
||||||
* @param {object} parentTemplate The CylinderMagazine's template
|
* @returns
|
||||||
*/
|
*/
|
||||||
protected fillCamora(items: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem): void;
|
protected fillCamora(items: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem): void;
|
||||||
/**
|
/**
|
||||||
@ -75,6 +144,13 @@ export declare class BotGeneratorHelper {
|
|||||||
* @returns string array of shells fro luitple camora sources
|
* @returns string array of shells fro luitple camora sources
|
||||||
*/
|
*/
|
||||||
protected mergeCamoraPoolsTogether(camorasWithShells: Record<string, string[]>): string[];
|
protected mergeCamoraPoolsTogether(camorasWithShells: Record<string, string[]>): string[];
|
||||||
|
/**
|
||||||
|
* Adds properties to an item
|
||||||
|
* e.g. Repairable / HasHinge / Foldable / MaxDurability
|
||||||
|
* @param itemTemplate
|
||||||
|
* @param botRole Used by weapons to randomise the durability values
|
||||||
|
* @returns Item Upd object with extra properties
|
||||||
|
*/
|
||||||
generateExtraPropertiesForItem(itemTemplate: ITemplateItem, botRole?: any): {
|
generateExtraPropertiesForItem(itemTemplate: ITemplateItem, botRole?: any): {
|
||||||
upd?: Upd;
|
upd?: Upd;
|
||||||
};
|
};
|
||||||
@ -93,12 +169,6 @@ export declare class BotGeneratorHelper {
|
|||||||
*/
|
*/
|
||||||
protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable;
|
protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable;
|
||||||
protected getModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string;
|
protected getModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string;
|
||||||
/**
|
|
||||||
* Sort by spawn chance, highest to lowest, higher is more common
|
|
||||||
* @param unsortedModArray String array to sort
|
|
||||||
* @returns Sorted string array
|
|
||||||
*/
|
|
||||||
protected sortModArray(unsortedModArray: string[]): string[];
|
|
||||||
/**
|
/**
|
||||||
* Can an item be added to an item without issue
|
* Can an item be added to an item without issue
|
||||||
* @param items
|
* @param items
|
||||||
@ -117,8 +187,15 @@ export declare class BotGeneratorHelper {
|
|||||||
* @returns a `boolean` indicating item was added
|
* @returns a `boolean` indicating item was added
|
||||||
*/
|
*/
|
||||||
addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], parentId: string, parentTpl: string, itemWithChildren: Item[], inventory: PmcInventory): boolean;
|
addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], parentId: string, parentTpl: string, itemWithChildren: Item[], inventory: PmcInventory): boolean;
|
||||||
|
/**
|
||||||
|
* is the provided item allowed inside a container
|
||||||
|
* @param slot location item wants to be placed in
|
||||||
|
* @param itemTpl item being placed
|
||||||
|
* @returns true if allowed
|
||||||
|
*/
|
||||||
protected itemAllowedInContainer(slot: Grid, itemTpl: string): boolean;
|
protected itemAllowedInContainer(slot: Grid, itemTpl: string): boolean;
|
||||||
}
|
}
|
||||||
|
/** TODO - move into own class */
|
||||||
export declare class ExhaustableArray<T> {
|
export declare class ExhaustableArray<T> {
|
||||||
private itemPool;
|
private itemPool;
|
||||||
private randomUtil;
|
private randomUtil;
|
||||||
|
@ -44,14 +44,72 @@ export declare class HideoutHelper {
|
|||||||
initProduction(recipeId: string, productionTime: number): Production;
|
initProduction(recipeId: string, productionTime: number): Production;
|
||||||
isProductionType(productive: Productive): productive is Production;
|
isProductionType(productive: Productive): productive is Production;
|
||||||
applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void;
|
applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void;
|
||||||
|
/**
|
||||||
|
* TODO:
|
||||||
|
* After looking at the skills there doesnt seem to be a configuration per skill to boost
|
||||||
|
* the XP gain PER skill. I THINK you should be able to put the variable "SkillProgress" (just like health has it)
|
||||||
|
* and be able to tune the skill gain PER skill, but I havent tested it and Im not sure!
|
||||||
|
* @param pmcData
|
||||||
|
* @param bonus
|
||||||
|
*/
|
||||||
protected applySkillXPBoost(pmcData: IPmcData, bonus: StageBonus): void;
|
protected applySkillXPBoost(pmcData: IPmcData, bonus: StageBonus): void;
|
||||||
|
/**
|
||||||
|
* Process a players hideout, update areas that use resources + increment production timers
|
||||||
|
* @param sessionID Session id
|
||||||
|
*/
|
||||||
updatePlayerHideout(sessionID: string): void;
|
updatePlayerHideout(sessionID: string): void;
|
||||||
|
/**
|
||||||
|
* Update progress timer for water collector
|
||||||
|
* @param pmcData profile to update
|
||||||
|
* @param productionId id of water collection production to update
|
||||||
|
* @param hideoutProperties Hideout properties
|
||||||
|
*/
|
||||||
|
protected updateWaterCollectorProductionTimer(pmcData: IPmcData, productionId: string, hideoutProperties: {
|
||||||
|
btcFarmCGs?: number;
|
||||||
|
isGeneratorOn: boolean;
|
||||||
|
waterCollectorHasFilter: boolean;
|
||||||
|
}): void;
|
||||||
|
/**
|
||||||
|
* Iterate over productions and update their progress timers
|
||||||
|
* @param pmcData Profile to check for productions and update
|
||||||
|
* @param hideoutProperties Hideout properties
|
||||||
|
*/
|
||||||
|
protected updateProductionTimers(pmcData: IPmcData, hideoutProperties: {
|
||||||
|
btcFarmCGs: number;
|
||||||
|
isGeneratorOn: boolean;
|
||||||
|
waterCollectorHasFilter: boolean;
|
||||||
|
}): void;
|
||||||
|
/**
|
||||||
|
* Update progress timer for scav case
|
||||||
|
* @param pmcData Profile to update
|
||||||
|
* @param productionId Id of scav case production to update
|
||||||
|
*/
|
||||||
|
protected updateScavCaseProductionTimer(pmcData: IPmcData, productionId: string): void;
|
||||||
|
/**
|
||||||
|
* Iterate over hideout areas that use resources (fuel/filters etc) and update associated values
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @param pmcData Profile to update areas of
|
||||||
|
* @param hideoutProperties hideout properties
|
||||||
|
*/
|
||||||
|
protected updateAreasWithResources(sessionID: string, pmcData: IPmcData, hideoutProperties: {
|
||||||
|
btcFarmCGs: number;
|
||||||
|
isGeneratorOn: boolean;
|
||||||
|
waterCollectorHasFilter: boolean;
|
||||||
|
}): void;
|
||||||
protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void;
|
protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void;
|
||||||
protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean;
|
protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean;
|
||||||
protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData): HideoutArea;
|
protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData): void;
|
||||||
protected updateWaterFilters(waterFilterArea: HideoutArea, pwProd: Production, isGeneratorOn: boolean, pmcData: IPmcData): HideoutArea;
|
/**
|
||||||
|
* Adjust water filter objects resourceValue or delete when they reach 0 resource
|
||||||
|
* @param waterFilterArea water filter area to update
|
||||||
|
* @param production production object
|
||||||
|
* @param isGeneratorOn is generatory enabled
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @returns Updated HideoutArea object
|
||||||
|
*/
|
||||||
|
protected updateWaterFilters(waterFilterArea: HideoutArea, production: Production, isGeneratorOn: boolean, pmcData: IPmcData): HideoutArea;
|
||||||
protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number): Upd;
|
protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number): Upd;
|
||||||
protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData): HideoutArea;
|
protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData): void;
|
||||||
protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production;
|
protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production;
|
||||||
protected getBTCSlots(pmcData: IPmcData): number;
|
protected getBTCSlots(pmcData: IPmcData): number;
|
||||||
protected getManagementSkillsSlots(): number;
|
protected getManagementSkillsSlots(): number;
|
||||||
|
@ -18,18 +18,6 @@ export declare class InRaidHelper {
|
|||||||
protected paymentHelper: PaymentHelper;
|
protected paymentHelper: PaymentHelper;
|
||||||
protected profileFixerService: ProfileFixerService;
|
protected profileFixerService: ProfileFixerService;
|
||||||
constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, paymentHelper: PaymentHelper, profileFixerService: ProfileFixerService);
|
constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, paymentHelper: PaymentHelper, profileFixerService: ProfileFixerService);
|
||||||
/**
|
|
||||||
* Reset the SPT inraid property stored in a profile to 'none'
|
|
||||||
* @param sessionID Session id
|
|
||||||
*/
|
|
||||||
protected removePlayer(sessionID: string): void;
|
|
||||||
/**
|
|
||||||
* Some maps have one-time-use keys (e.g. Labs
|
|
||||||
* Remove the relevant key from an inventory based on the post-raid request data passed in
|
|
||||||
* @param offraidData post-raid data
|
|
||||||
* @param sessionID Session id
|
|
||||||
*/
|
|
||||||
protected removeMapAccessKey(offraidData: ISaveProgressRequestData, sessionID: string): void;
|
|
||||||
/**
|
/**
|
||||||
* Check an array of items and add an upd object to money items with a stack count of 1
|
* Check an array of items and add an upd object to money items with a stack count of 1
|
||||||
* Single stack money items have no upd object and thus no StackObjectsCount, causing issues
|
* Single stack money items have no upd object and thus no StackObjectsCount, causing issues
|
||||||
@ -54,6 +42,18 @@ export declare class InRaidHelper {
|
|||||||
* @returns Reset profile object
|
* @returns Reset profile object
|
||||||
*/
|
*/
|
||||||
updateProfileBaseStats(profileData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionID: string): IPmcData;
|
updateProfileBaseStats(profileData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionID: string): IPmcData;
|
||||||
|
/**
|
||||||
|
* Some maps have one-time-use keys (e.g. Labs
|
||||||
|
* Remove the relevant key from an inventory based on the post-raid request data passed in
|
||||||
|
* @param offraidData post-raid data
|
||||||
|
* @param sessionID Session id
|
||||||
|
*/
|
||||||
|
protected removeMapAccessKey(offraidData: ISaveProgressRequestData, sessionID: string): void;
|
||||||
|
/**
|
||||||
|
* Set the SPT inraid location Profile property to 'none'
|
||||||
|
* @param sessionID Session id
|
||||||
|
*/
|
||||||
|
protected setPlayerInRaidLocationStatusToNone(sessionID: string): void;
|
||||||
/**
|
/**
|
||||||
* Adds SpawnedInSession property to items found in a raid
|
* Adds SpawnedInSession property to items found in a raid
|
||||||
* Removes SpawnedInSession for non-scav players if item was taken into raid with SpawnedInSession = true
|
* Removes SpawnedInSession for non-scav players if item was taken into raid with SpawnedInSession = true
|
||||||
@ -95,5 +95,10 @@ export declare class InRaidHelper {
|
|||||||
* @returns true if item is kept after death
|
* @returns true if item is kept after death
|
||||||
*/
|
*/
|
||||||
isItemKeptAfterDeath(slotId: string): boolean;
|
isItemKeptAfterDeath(slotId: string): boolean;
|
||||||
|
/**
|
||||||
|
* Return the equipped items from a players inventory
|
||||||
|
* @param items Players inventory to search through
|
||||||
|
* @returns an array of equipped items
|
||||||
|
*/
|
||||||
getPlayerGear(items: Item[]): Item[];
|
getPlayerGear(items: Item[]): Item[];
|
||||||
}
|
}
|
||||||
|
@ -1,35 +1,30 @@
|
|||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||||
import { InsuredItem } from "../models/eft/common/tables/IBotBase";
|
import { InsuredItem } from "../models/eft/common/tables/IBotBase";
|
||||||
import { Item, Repairable } from "../models/eft/common/tables/IItem";
|
import { Item, Repairable } from "../models/eft/common/tables/IItem";
|
||||||
|
import { IStaticAmmoDetails } from "../models/eft/common/tables/ILootBase";
|
||||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { ILogger } from "../models/spt/utils/ILogger";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
import { HashUtil } from "../utils/HashUtil";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { JsonUtil } from "../utils/JsonUtil";
|
||||||
|
import { MathUtil } from "../utils/MathUtil";
|
||||||
|
import { ObjectId } from "../utils/ObjectId";
|
||||||
|
import { RandomUtil } from "../utils/RandomUtil";
|
||||||
declare class ItemHelper {
|
declare class ItemHelper {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected hashUtil: HashUtil;
|
protected hashUtil: HashUtil;
|
||||||
protected jsonUtil: JsonUtil;
|
protected jsonUtil: JsonUtil;
|
||||||
|
protected randomUtil: RandomUtil;
|
||||||
|
protected objectId: ObjectId;
|
||||||
|
protected mathUtil: MathUtil;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseServer: DatabaseServer;
|
||||||
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer);
|
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer);
|
||||||
/**
|
/**
|
||||||
* Checks if a id is a valid item. Valid meaning that it's an item that be stored in stash
|
* Checks if a id is a valid item. Valid meaning that it's an item that be stored in stash
|
||||||
* @param {string} tpl the template id / tpl
|
* @param {string} tpl the template id / tpl
|
||||||
* @returns boolean; true for items that may be in player posession and not quest items
|
* @returns boolean; true for items that may be in player posession and not quest items
|
||||||
*/
|
*/
|
||||||
isValidItem(tpl: string, invalidBaseTypes?: string[]): boolean;
|
isValidItem(tpl: string, invalidBaseTypes?: string[]): boolean;
|
||||||
/**
|
|
||||||
* Checks if an id is a valid item. Valid meaning that it's an item that may be a reward
|
|
||||||
* or content of bot loot. Items that are tested as valid may be in a player backpack or stash.
|
|
||||||
* @param {*} tpl template id of item to check
|
|
||||||
* @returns boolean: true if item is valid reward
|
|
||||||
*/
|
|
||||||
isValidRewardItem(tpl: string): boolean;
|
|
||||||
/**
|
|
||||||
* Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable)
|
|
||||||
* @returns a list of rewardable items [[_tpl, itemTemplate],...]
|
|
||||||
*/
|
|
||||||
getRewardableItems(): [string, ITemplateItem][];
|
|
||||||
/**
|
/**
|
||||||
* Check if the tpl / template Id provided is a descendent of the baseclass
|
* Check if the tpl / template Id provided is a descendent of the baseclass
|
||||||
*
|
*
|
||||||
@ -196,6 +191,22 @@ declare class ItemHelper {
|
|||||||
* @returns ItemSize object (width and height)
|
* @returns ItemSize object (width and height)
|
||||||
*/
|
*/
|
||||||
getItemSize(items: Item[], rootItemId: string): ItemHelper.ItemSize;
|
getItemSize(items: Item[], rootItemId: string): ItemHelper.ItemSize;
|
||||||
|
/**
|
||||||
|
* Get a random cartridge from an items Filter property
|
||||||
|
* @param item
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string;
|
||||||
|
createRandomMagCartridges(magTemplate: ITemplateItem, parentId: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, caliber?: string): Item;
|
||||||
|
protected getRandomValidCaliber(magTemplate: ITemplateItem): string;
|
||||||
|
protected drawAmmoTpl(caliber: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>): string;
|
||||||
|
createCartidges(parentId: string, ammoTpl: string, stackCount: number): Item;
|
||||||
|
/**
|
||||||
|
* Get the size of a stack, return 1 if no stack object count property found
|
||||||
|
* @param item Item to get stack size of
|
||||||
|
* @returns size of stack
|
||||||
|
*/
|
||||||
|
getItemStackSize(item: Item): number;
|
||||||
}
|
}
|
||||||
declare namespace ItemHelper {
|
declare namespace ItemHelper {
|
||||||
interface ItemSize {
|
interface ItemSize {
|
||||||
|
@ -24,6 +24,19 @@ export declare class ProfileHelper {
|
|||||||
constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, fenceService: FenceService);
|
constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, fenceService: FenceService);
|
||||||
resetProfileQuestCondition(sessionID: string, conditionId: string): void;
|
resetProfileQuestCondition(sessionID: string, conditionId: string): void;
|
||||||
getCompleteProfile(sessionID: string): IPmcData[];
|
getCompleteProfile(sessionID: string): IPmcData[];
|
||||||
|
/**
|
||||||
|
* Fix xp doubling on post-raid xp reward screen by sending a 'dummy' profile to the post-raid screen
|
||||||
|
* Server saves the post-raid changes prior to the xp screen getting the profile, this results in the xp screen using
|
||||||
|
* the now updated profile values as a base, meaning it shows x2 xp gained
|
||||||
|
* Instead, clone the post-raid profile (so we dont alter its values), apply the pre-raid xp values to the cloned objects and return
|
||||||
|
* Delete snapshot of pre-raid profile prior to returning profile data
|
||||||
|
* @param sessionId Session id
|
||||||
|
* @param output pmc and scav profiles array
|
||||||
|
* @param pmcProfile post-raid pmc profile
|
||||||
|
* @param scavProfile post-raid scav profile
|
||||||
|
* @returns updated profile array
|
||||||
|
*/
|
||||||
|
protected postRaidXpWorkaroundFix(sessionId: string, output: IPmcData[], pmcProfile: IPmcData, scavProfile: IPmcData): IPmcData[];
|
||||||
isNicknameTaken(info: IValidateNicknameRequestData, sessionID: string): boolean;
|
isNicknameTaken(info: IValidateNicknameRequestData, sessionID: string): boolean;
|
||||||
/**
|
/**
|
||||||
* Add experience to a PMC inside the players profile
|
* Add experience to a PMC inside the players profile
|
||||||
|
@ -36,11 +36,20 @@ export declare class QuestHelper {
|
|||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected questConfig: IQuestConfig;
|
protected questConfig: IQuestConfig;
|
||||||
constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, configServer: ConfigServer);
|
constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, configServer: ConfigServer);
|
||||||
questStatus(pmcData: IPmcData, questID: string): QuestStatus;
|
|
||||||
/**
|
/**
|
||||||
* returns true is the condition is satisfied
|
* Get status of a quest by quest id
|
||||||
|
* @param pmcData Profile to search
|
||||||
|
* @param questID Quest id to look up
|
||||||
|
* @returns QuestStauts enum
|
||||||
|
*/
|
||||||
|
getQuestStatus(pmcData: IPmcData, questID: string): QuestStatus;
|
||||||
|
/**
|
||||||
|
* returns true is the level condition is satisfied
|
||||||
|
* @param playerLevel Players level
|
||||||
|
* @param condition Quest condition
|
||||||
|
* @returns true if player level is greater than or equal to quest
|
||||||
*/
|
*/
|
||||||
evaluateLevel(pmcProfile: IPmcData, cond: AvailableForConditions): boolean;
|
doesPlayerLevelFulfilCondition(playerLevel: number, condition: AvailableForConditions): boolean;
|
||||||
getDeltaQuests(before: IQuest[], after: IQuest[]): IQuest[];
|
getDeltaQuests(before: IQuest[], after: IQuest[]): IQuest[];
|
||||||
/**
|
/**
|
||||||
* Increase skill points of a skill on player profile
|
* Increase skill points of a skill on player profile
|
||||||
|
@ -22,12 +22,14 @@ import { ProfileHelper } from "./ProfileHelper";
|
|||||||
import { RagfairHelper } from "./RagfairHelper";
|
import { RagfairHelper } from "./RagfairHelper";
|
||||||
import { RagfairServerHelper } from "./RagfairServerHelper";
|
import { RagfairServerHelper } from "./RagfairServerHelper";
|
||||||
import { RagfairSortHelper } from "./RagfairSortHelper";
|
import { RagfairSortHelper } from "./RagfairSortHelper";
|
||||||
|
import { TraderHelper } from "./TraderHelper";
|
||||||
export declare class RagfairOfferHelper {
|
export declare class RagfairOfferHelper {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected timeUtil: TimeUtil;
|
protected timeUtil: TimeUtil;
|
||||||
protected hashUtil: HashUtil;
|
protected hashUtil: HashUtil;
|
||||||
protected itemEventRouter: ItemEventRouter;
|
protected itemEventRouter: ItemEventRouter;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseServer: DatabaseServer;
|
||||||
|
protected traderHelper: TraderHelper;
|
||||||
protected saveServer: SaveServer;
|
protected saveServer: SaveServer;
|
||||||
protected dialogueHelper: DialogueHelper;
|
protected dialogueHelper: DialogueHelper;
|
||||||
protected itemHelper: ItemHelper;
|
protected itemHelper: ItemHelper;
|
||||||
@ -43,10 +45,10 @@ export declare class RagfairOfferHelper {
|
|||||||
protected static goodSoldTemplate: string;
|
protected static goodSoldTemplate: string;
|
||||||
protected ragfairConfig: IRagfairConfig;
|
protected ragfairConfig: IRagfairConfig;
|
||||||
protected questConfig: IQuestConfig;
|
protected questConfig: IQuestConfig;
|
||||||
constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer);
|
constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer);
|
||||||
getValidOffers(info: ISearchRequestData, itemsToAdd: string[], assorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[];
|
getValidOffers(info: ISearchRequestData, itemsToAdd: string[], assorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[];
|
||||||
getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[];
|
getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[];
|
||||||
processOffers(sessionID: string): boolean;
|
processOffersOnProfile(sessionID: string): boolean;
|
||||||
protected getProfileOffers(sessionID: string): IRagfairOffer[];
|
protected getProfileOffers(sessionID: string): IRagfairOffer[];
|
||||||
protected deleteOfferByOfferId(sessionID: string, offerId: string): void;
|
protected deleteOfferByOfferId(sessionID: string, offerId: string): void;
|
||||||
protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse;
|
protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse;
|
||||||
|
@ -11,6 +11,12 @@ export declare class RagfairSellHelper {
|
|||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected ragfairConfig: IRagfairConfig;
|
protected ragfairConfig: IRagfairConfig;
|
||||||
constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer);
|
constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer);
|
||||||
calculateSellChance(baseChance: number, offerPrice: number, requirementsPriceInRub: number): number;
|
calculateSellChance(baseChancePercent: number, offerPriceRub: number, playerListedPriceRub: number): number;
|
||||||
rollForSale(sellChance: number, count: number): SellResult[];
|
/**
|
||||||
|
* Determine if the offer being listed will be sold
|
||||||
|
* @param sellChancePercent chance item will sell
|
||||||
|
* @param itemSellCount count of items to sell
|
||||||
|
* @returns Array of purchases of item(s) lsited
|
||||||
|
*/
|
||||||
|
rollForSale(sellChancePercent: number, itemSellCount: number): SellResult[];
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
|
|||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { ConfigServer } from "../servers/ConfigServer";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||||
import { SaveServer } from "../servers/SaveServer";
|
import { SaveServer } from "../servers/SaveServer";
|
||||||
|
import { ItemFilterService } from "../services/ItemFilterService";
|
||||||
import { LocaleService } from "../services/LocaleService";
|
import { LocaleService } from "../services/LocaleService";
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
import { HashUtil } from "../utils/HashUtil";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { JsonUtil } from "../utils/JsonUtil";
|
||||||
@ -13,6 +14,9 @@ import { RandomUtil } from "../utils/RandomUtil";
|
|||||||
import { DialogueHelper } from "./DialogueHelper";
|
import { DialogueHelper } from "./DialogueHelper";
|
||||||
import { ItemHelper } from "./ItemHelper";
|
import { ItemHelper } from "./ItemHelper";
|
||||||
import { ProfileHelper } from "./ProfileHelper";
|
import { ProfileHelper } from "./ProfileHelper";
|
||||||
|
/**
|
||||||
|
* Helper class for common ragfair server actions
|
||||||
|
*/
|
||||||
export declare class RagfairServerHelper {
|
export declare class RagfairServerHelper {
|
||||||
protected randomUtil: RandomUtil;
|
protected randomUtil: RandomUtil;
|
||||||
protected hashUtil: HashUtil;
|
protected hashUtil: HashUtil;
|
||||||
@ -23,11 +27,12 @@ export declare class RagfairServerHelper {
|
|||||||
protected localeService: LocaleService;
|
protected localeService: LocaleService;
|
||||||
protected dialogueHelper: DialogueHelper;
|
protected dialogueHelper: DialogueHelper;
|
||||||
protected jsonUtil: JsonUtil;
|
protected jsonUtil: JsonUtil;
|
||||||
|
protected itemFilterService: ItemFilterService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected ragfairConfig: IRagfairConfig;
|
protected ragfairConfig: IRagfairConfig;
|
||||||
protected questConfig: IQuestConfig;
|
protected questConfig: IQuestConfig;
|
||||||
protected static goodsReturnedTemplate: string;
|
protected static goodsReturnedTemplate: string;
|
||||||
constructor(randomUtil: RandomUtil, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, jsonUtil: JsonUtil, configServer: ConfigServer);
|
constructor(randomUtil: RandomUtil, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, jsonUtil: JsonUtil, itemFilterService: ItemFilterService, configServer: ConfigServer);
|
||||||
/**
|
/**
|
||||||
* Is item valid / on blacklist / quest item
|
* Is item valid / on blacklist / quest item
|
||||||
* @param itemDetails
|
* @param itemDetails
|
||||||
|
@ -39,6 +39,12 @@ export declare class TradeHelper {
|
|||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
sellItem(pmcData: IPmcData, body: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse;
|
sellItem(pmcData: IPmcData, body: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Increment the assorts buy count by number of items purchased
|
||||||
|
* Show error on screen if player attepts to buy more than what the buy max allows
|
||||||
|
* @param assortBeingPurchased assort being bought
|
||||||
|
* @param itemsPurchasedCount number of items being bought
|
||||||
|
*/
|
||||||
protected incrementAssortBuyCount(assortBeingPurchased: Item, itemsPurchasedCount: number): void;
|
protected incrementAssortBuyCount(assortBeingPurchased: Item, itemsPurchasedCount: number): void;
|
||||||
protected checkPurchaseIsWithinTraderItemLimit(assortBeingPurchased: Item, assortId: string, count: number): void;
|
protected checkPurchaseIsWithinTraderItemLimit(assortBeingPurchased: Item, assortId: string, count: number): void;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { RagfairAssortGenerator } from "../generators/RagfairAssortGenerator";
|
import { RagfairAssortGenerator } from "../generators/RagfairAssortGenerator";
|
||||||
import { RagfairOfferGenerator } from "../generators/RagfairOfferGenerator";
|
import { RagfairOfferGenerator } from "../generators/RagfairOfferGenerator";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
|
||||||
import { Item } from "../models/eft/common/tables/IItem";
|
import { Item } from "../models/eft/common/tables/IItem";
|
||||||
import { ITrader, ITraderAssort } from "../models/eft/common/tables/ITrader";
|
import { ITrader, ITraderAssort } from "../models/eft/common/tables/ITrader";
|
||||||
import { ITraderConfig } from "../models/spt/config/ITraderConfig";
|
import { ITraderConfig } from "../models/spt/config/ITraderConfig";
|
||||||
@ -41,12 +40,7 @@ export declare class TraderAssortHelper {
|
|||||||
* @param traderId traders id
|
* @param traderId traders id
|
||||||
* @returns a traders' assorts
|
* @returns a traders' assorts
|
||||||
*/
|
*/
|
||||||
getAssort(sessionId: string, traderId: string): ITraderAssort;
|
getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort;
|
||||||
/**
|
|
||||||
* if the fence assorts have expired, re-generate them
|
|
||||||
* @param pmcProfile Players profile
|
|
||||||
*/
|
|
||||||
refreshFenceAssortIfExpired(pmcProfile: IPmcData): void;
|
|
||||||
/**
|
/**
|
||||||
* Reset a traders assorts and move nextResupply value to future
|
* Reset a traders assorts and move nextResupply value to future
|
||||||
* Flag trader as needing a flea offer reset to be picked up by flea update() function
|
* Flag trader as needing a flea offer reset to be picked up by flea update() function
|
||||||
|
@ -65,7 +65,7 @@ export declare class TraderHelper {
|
|||||||
* @param item
|
* @param item
|
||||||
* @returns boolean
|
* @returns boolean
|
||||||
*/
|
*/
|
||||||
protected isWeaponAndBelowTraderBuyDurability(traderID: string, item: Item): boolean;
|
protected isWeaponBelowTraderBuyDurability(traderID: string, item: Item): boolean;
|
||||||
/**
|
/**
|
||||||
* Get the price of an item and all of its attached children
|
* Get the price of an item and all of its attached children
|
||||||
* Take into account bonuses/adjsutments e.g. discounts
|
* Take into account bonuses/adjsutments e.g. discounts
|
||||||
|
@ -34,6 +34,7 @@ export interface Props {
|
|||||||
LootExperience?: number;
|
LootExperience?: number;
|
||||||
ExamineExperience?: number;
|
ExamineExperience?: number;
|
||||||
HideEntrails?: boolean;
|
HideEntrails?: boolean;
|
||||||
|
InsuranceDisabled?: boolean;
|
||||||
RepairCost?: number;
|
RepairCost?: number;
|
||||||
RepairSpeed?: number;
|
RepairSpeed?: number;
|
||||||
ExtraSizeLeft?: number;
|
ExtraSizeLeft?: number;
|
||||||
@ -206,6 +207,7 @@ export interface Props {
|
|||||||
IsOneoff?: boolean;
|
IsOneoff?: boolean;
|
||||||
MustBoltBeOpennedForExternalReload?: boolean;
|
MustBoltBeOpennedForExternalReload?: boolean;
|
||||||
MustBoltBeOpennedForInternalReload?: boolean;
|
MustBoltBeOpennedForInternalReload?: boolean;
|
||||||
|
NoFiremodeOnBoltcatch?: boolean;
|
||||||
BoltAction?: boolean;
|
BoltAction?: boolean;
|
||||||
HipAccuracyRestorationDelay?: number;
|
HipAccuracyRestorationDelay?: number;
|
||||||
HipAccuracyRestorationSpeed?: number;
|
HipAccuracyRestorationSpeed?: number;
|
||||||
|
@ -67,6 +67,7 @@ export interface IBarterScheme {
|
|||||||
count: number;
|
count: number;
|
||||||
_tpl: string;
|
_tpl: string;
|
||||||
onlyFunctional?: boolean;
|
onlyFunctional?: boolean;
|
||||||
|
sptQuestLocked?: boolean;
|
||||||
}
|
}
|
||||||
export interface ISuit {
|
export interface ISuit {
|
||||||
_id: string;
|
_id: string;
|
||||||
|
@ -15,6 +15,8 @@ export interface IRagfairOffer {
|
|||||||
name?: string;
|
name?: string;
|
||||||
shortName?: string;
|
shortName?: string;
|
||||||
loyaltyLevel: number;
|
loyaltyLevel: number;
|
||||||
|
buyRestrictionMax?: number;
|
||||||
|
buyRestrictionCurrent?: number;
|
||||||
locked: boolean;
|
locked: boolean;
|
||||||
unlimitedCount: boolean;
|
unlimitedCount: boolean;
|
||||||
summaryCost: number;
|
summaryCost: number;
|
||||||
|
@ -23,7 +23,7 @@ export declare enum Ammo762x54 {
|
|||||||
BT_GZH = "5e023d34e8a400319a28ed44",
|
BT_GZH = "5e023d34e8a400319a28ed44",
|
||||||
BS_GZH = "5e023d48186a883be655e551"
|
BS_GZH = "5e023d48186a883be655e551"
|
||||||
}
|
}
|
||||||
export declare enum Ammo338Lapua {
|
export declare enum Ammo86x70 {
|
||||||
TAC_X = "5fc382b6d6fa9c00c571bbc3",
|
TAC_X = "5fc382b6d6fa9c00c571bbc3",
|
||||||
UCW = "5fc382c1016cce60e8341b20",
|
UCW = "5fc382c1016cce60e8341b20",
|
||||||
AP = "5fc382a9d724d907e2077dab",
|
AP = "5fc382a9d724d907e2077dab",
|
||||||
@ -85,13 +85,13 @@ export declare enum Ammo9x21 {
|
|||||||
PE_GZH = "5a26ac06c4a282000c5a90a8",
|
PE_GZH = "5a26ac06c4a282000c5a90a8",
|
||||||
BT_GZH = "5a26ac0ec4a28200741e1e18"
|
BT_GZH = "5a26ac0ec4a28200741e1e18"
|
||||||
}
|
}
|
||||||
export declare enum Ammo357Mag {
|
export declare enum Ammo9x33R {
|
||||||
FMJ = "62330b3ed4dc74626d570b95",
|
FMJ = "62330b3ed4dc74626d570b95",
|
||||||
HOLLOW_POINT = "62330bfadc5883093563729b",
|
HOLLOW_POINT = "62330bfadc5883093563729b",
|
||||||
SOFT_POINT = "62330c40bdd19b369e1e53d1",
|
SOFT_POINT = "62330c40bdd19b369e1e53d1",
|
||||||
JACKET_HP = "62330c18744e5e31df12f516"
|
JACKET_HP = "62330c18744e5e31df12f516"
|
||||||
}
|
}
|
||||||
export declare enum Ammo45ACP {
|
export declare enum Ammo1143x23ACP {
|
||||||
MATCH_FMJ = "5e81f423763d9f754677bf2e",
|
MATCH_FMJ = "5e81f423763d9f754677bf2e",
|
||||||
HYDRA_SHOK = "5efb0fc6aeb21837e749c801",
|
HYDRA_SHOK = "5efb0fc6aeb21837e749c801",
|
||||||
LASERMATCH_FMJ = "5efb0d4f4bc50b58e81710f3",
|
LASERMATCH_FMJ = "5efb0d4f4bc50b58e81710f3",
|
||||||
@ -126,7 +126,7 @@ export declare enum Ammo556x45 {
|
|||||||
MK_318_MOD_0_SOST = "60194943740c5d77f6705eea",
|
MK_318_MOD_0_SOST = "60194943740c5d77f6705eea",
|
||||||
SSA_AP = "601949593ae8f707c4608daa"
|
SSA_AP = "601949593ae8f707c4608daa"
|
||||||
}
|
}
|
||||||
export declare enum Ammo300Blackout {
|
export declare enum Ammo762x35 {
|
||||||
M62_TRACER = "619636be6db0f2477964e710",
|
M62_TRACER = "619636be6db0f2477964e710",
|
||||||
BCP_FMJ = "5fbe3ffdf8b6a877a729ea82",
|
BCP_FMJ = "5fbe3ffdf8b6a877a729ea82",
|
||||||
AP = "5fd20ff893a8961fc660a954",
|
AP = "5fd20ff893a8961fc660a954",
|
||||||
|
@ -68,6 +68,7 @@ export declare enum BaseClasses {
|
|||||||
ASSAULT_SCOPE = "55818add4bdc2d5b648b456f",
|
ASSAULT_SCOPE = "55818add4bdc2d5b648b456f",
|
||||||
REFLEX_SIGHT = "55818ad54bdc2ddc698b4569",
|
REFLEX_SIGHT = "55818ad54bdc2ddc698b4569",
|
||||||
TACTICAL_COMBO = "55818b164bdc2ddc698b456c",
|
TACTICAL_COMBO = "55818b164bdc2ddc698b456c",
|
||||||
|
FLASHLIGHT = "55818b084bdc2d5b648b4571",
|
||||||
MAGAZINE = "5448bc234bdc2d3c308b4569",
|
MAGAZINE = "5448bc234bdc2d3c308b4569",
|
||||||
LIGHT_LASER = "55818b0e4bdc2dde698b456e",
|
LIGHT_LASER = "55818b0e4bdc2dde698b456e",
|
||||||
FLASH_HIDER = "550aa4bf4bdc2dd6348b456b",
|
FLASH_HIDER = "550aa4bf4bdc2dd6348b456b",
|
||||||
|
@ -8,6 +8,7 @@ export declare enum ConfigTypes {
|
|||||||
IN_RAID = "aki-inraid",
|
IN_RAID = "aki-inraid",
|
||||||
INSURANCE = "aki-insurance",
|
INSURANCE = "aki-insurance",
|
||||||
INVENTORY = "aki-inventory",
|
INVENTORY = "aki-inventory",
|
||||||
|
ITEM = "aki-item",
|
||||||
LOCALE = "aki-locale",
|
LOCALE = "aki-locale",
|
||||||
LOCATION = "aki-location",
|
LOCATION = "aki-location",
|
||||||
MATCH = "aki-match",
|
MATCH = "aki-match",
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
export declare enum ELocationName {
|
export declare enum ELocationName {
|
||||||
FACTORY_DAY = "factory4_day",
|
FACTORY_DAY = "factory4_day",
|
||||||
|
FACTORY_NIGHT = "factory4_night",
|
||||||
BIGMAP = "bigmap",
|
BIGMAP = "bigmap",
|
||||||
WOODS = "Woods",
|
WOODS = "Woods",
|
||||||
SHORELINE = "Shoreline",
|
SHORELINE = "Shoreline",
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
|
import { MinMax } from "../../common/MinMax";
|
||||||
import { IBaseConfig } from "./IBaseConfig";
|
import { IBaseConfig } from "./IBaseConfig";
|
||||||
export interface IAirdropConfig extends IBaseConfig {
|
export interface IAirdropConfig extends IBaseConfig {
|
||||||
kind: "aki-airdrop";
|
kind: "aki-airdrop";
|
||||||
airdropChancePercent: AirdropChancePercent;
|
airdropChancePercent: AirdropChancePercent;
|
||||||
airdropMinOpenHeight: number;
|
|
||||||
airdropMaxOpenHeight: number;
|
|
||||||
planeMinFlyHeight: number;
|
planeMinFlyHeight: number;
|
||||||
planeMaxFlyHeight: number;
|
planeMaxFlyHeight: number;
|
||||||
planeVolume: number;
|
planeVolume: number;
|
||||||
airdropMinStartTimeSeconds: number;
|
airdropMinStartTimeSeconds: number;
|
||||||
airdropMaxStartTimeSeconds: number;
|
airdropMaxStartTimeSeconds: number;
|
||||||
|
loot: AirdropLoot;
|
||||||
}
|
}
|
||||||
export interface AirdropChancePercent {
|
export interface AirdropChancePercent {
|
||||||
bigmap: number;
|
bigmap: number;
|
||||||
@ -18,3 +18,11 @@ export interface AirdropChancePercent {
|
|||||||
interchange: number;
|
interchange: number;
|
||||||
reserve: number;
|
reserve: number;
|
||||||
}
|
}
|
||||||
|
export interface AirdropLoot {
|
||||||
|
presetCount: MinMax;
|
||||||
|
itemCount: MinMax;
|
||||||
|
itemBlacklist: string[];
|
||||||
|
itemTypeWhitelist: string[];
|
||||||
|
/** key: item base type: value: max count */
|
||||||
|
itemLimits: Record<string, number>;
|
||||||
|
}
|
||||||
|
@ -1,17 +1,31 @@
|
|||||||
import { MinMax } from "../../common/MinMax";
|
import { MinMax } from "../../common/MinMax";
|
||||||
import { IBaseConfig } from "./IBaseConfig";
|
import { IBaseConfig } from "./IBaseConfig";
|
||||||
|
import { IBotDurability } from "./IBotDurability";
|
||||||
|
import { IPmcConfig } from "./IPmcConfig";
|
||||||
export interface IBotConfig extends IBaseConfig {
|
export interface IBotConfig extends IBaseConfig {
|
||||||
kind: "aki-bot";
|
kind: "aki-bot";
|
||||||
|
/** How many variants of each bot should be generated on raid start */
|
||||||
presetBatch: PresetBatch;
|
presetBatch: PresetBatch;
|
||||||
|
/** What bot types should be classified as bosses */
|
||||||
bosses: string[];
|
bosses: string[];
|
||||||
durability: Durability;
|
/** Control weapon/armor durability min/max values for each bot type */
|
||||||
|
durability: IBotDurability;
|
||||||
|
/** Control the weighting of how expensive an average loot item is on a PMC or Scav */
|
||||||
lootNValue: LootNvalue;
|
lootNValue: LootNvalue;
|
||||||
|
/** Control what bots are added to a bots revenge list key: bottype, value: bottypes to revenge on seeing their death */
|
||||||
revenge: Record<string, string[]>;
|
revenge: Record<string, string[]>;
|
||||||
pmc: PmcConfig;
|
/** PMC bot specific config settings */
|
||||||
|
pmc: IPmcConfig;
|
||||||
|
/** Control how many items are allowed to spawn on a bot
|
||||||
|
* key: bottype, value: <key: itemTpl: value: max item count> */
|
||||||
itemSpawnLimits: Record<string, Record<string, number>>;
|
itemSpawnLimits: Record<string, Record<string, number>>;
|
||||||
equipment: Record<string, Equipment>;
|
/** Blacklist/whitelist items on a bot */
|
||||||
|
equipment: Record<string, EquipmentFilters>;
|
||||||
|
/** Show a bots botType value after their name */
|
||||||
showTypeInNickname: boolean;
|
showTypeInNickname: boolean;
|
||||||
|
/** Max number of bots that can be spawned in a raid at any one time */
|
||||||
maxBotCap: number;
|
maxBotCap: number;
|
||||||
|
/** How many stacks of secret ammo should a bot have in its bot secure container */
|
||||||
secureContainerAmmoStackCount: number;
|
secureContainerAmmoStackCount: number;
|
||||||
}
|
}
|
||||||
export interface PresetBatch {
|
export interface PresetBatch {
|
||||||
@ -44,79 +58,22 @@ export interface PresetBatch {
|
|||||||
test: number;
|
test: number;
|
||||||
exUsec: number;
|
exUsec: number;
|
||||||
}
|
}
|
||||||
export interface Durability {
|
|
||||||
default: DefaultDurability;
|
|
||||||
pmc: PmcDurability;
|
|
||||||
boss: BotDurability;
|
|
||||||
follower: BotDurability;
|
|
||||||
assault: BotDurability;
|
|
||||||
cursedassault: BotDurability;
|
|
||||||
marksman: BotDurability;
|
|
||||||
pmcbot: BotDurability;
|
|
||||||
exusec: BotDurability;
|
|
||||||
sectantpriest: BotDurability;
|
|
||||||
sectantwarrior: BotDurability;
|
|
||||||
}
|
|
||||||
export interface DefaultDurability {
|
|
||||||
armor: DefaultArmor;
|
|
||||||
weapon: WeaponDurability;
|
|
||||||
}
|
|
||||||
export interface DefaultArmor {
|
|
||||||
maxDelta: number;
|
|
||||||
minDelta: number;
|
|
||||||
}
|
|
||||||
export interface WeaponDurability {
|
|
||||||
lowestMax: number;
|
|
||||||
highestMax: number;
|
|
||||||
maxDelta: number;
|
|
||||||
minDelta: number;
|
|
||||||
}
|
|
||||||
export interface PmcDurability {
|
|
||||||
armor: PmcDurabilityArmor;
|
|
||||||
weapon: WeaponDurability;
|
|
||||||
}
|
|
||||||
export interface PmcDurabilityArmor {
|
|
||||||
lowestMaxPercent: number;
|
|
||||||
highestMaxPercent: number;
|
|
||||||
maxDelta: number;
|
|
||||||
minDelta: number;
|
|
||||||
}
|
|
||||||
export interface BotDurability {
|
|
||||||
armor: ArmorDurability;
|
|
||||||
weapon: WeaponDurability;
|
|
||||||
}
|
|
||||||
export interface ArmorDurability {
|
|
||||||
maxDelta: number;
|
|
||||||
minDelta: number;
|
|
||||||
}
|
|
||||||
export interface LootNvalue {
|
export interface LootNvalue {
|
||||||
scav: number;
|
scav: number;
|
||||||
pmc: number;
|
pmc: number;
|
||||||
}
|
}
|
||||||
export interface PmcConfig {
|
export interface EquipmentFilters {
|
||||||
dynamicLoot: PmcDynamicLoot;
|
weaponModLimits: ModLimits;
|
||||||
difficulty: string;
|
randomisedWeaponModSlots?: string[];
|
||||||
looseWeaponInBackpackChancePercent: number;
|
|
||||||
looseWeaponInBackpackLootMinMax: MinMax;
|
|
||||||
isUsec: number;
|
|
||||||
chanceSameSideIsHostilePercent: number;
|
|
||||||
usecType: string;
|
|
||||||
bearType: string;
|
|
||||||
maxBackpackLootTotalRub: number;
|
|
||||||
maxPocketLootTotalRub: number;
|
|
||||||
maxVestLootTotalRub: number;
|
|
||||||
convertIntoPmcChance: Record<string, MinMax>;
|
|
||||||
enemyTypes: string[];
|
|
||||||
}
|
|
||||||
export interface PmcDynamicLoot {
|
|
||||||
whitelist: string[];
|
|
||||||
blacklist: string[];
|
|
||||||
moneyStackLimits: Record<string, number>;
|
|
||||||
}
|
|
||||||
export interface Equipment {
|
|
||||||
blacklist: EquipmentFilterDetails[];
|
blacklist: EquipmentFilterDetails[];
|
||||||
whitelist: EquipmentFilterDetails[];
|
whitelist: EquipmentFilterDetails[];
|
||||||
}
|
}
|
||||||
|
export interface ModLimits {
|
||||||
|
/** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */
|
||||||
|
scopeLimit?: number;
|
||||||
|
/** How many lasers or lights are allowed on a weapon - hard coded to work with TACTICAL_COMBO, and FLASHLIGHT */
|
||||||
|
lightLaserLimit?: number;
|
||||||
|
}
|
||||||
export interface EquipmentFilterDetails {
|
export interface EquipmentFilterDetails {
|
||||||
levelRange: MinMax;
|
levelRange: MinMax;
|
||||||
equipment: Record<string, string[]>;
|
equipment: Record<string, string[]>;
|
||||||
|
47
TypeScript/10ScopesAndTypes/types/models/spt/config/IBotDurability.d.ts
vendored
Normal file
47
TypeScript/10ScopesAndTypes/types/models/spt/config/IBotDurability.d.ts
vendored
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
export interface IBotDurability {
|
||||||
|
default: DefaultDurability;
|
||||||
|
pmc: PmcDurability;
|
||||||
|
boss: BotDurability;
|
||||||
|
follower: BotDurability;
|
||||||
|
assault: BotDurability;
|
||||||
|
cursedassault: BotDurability;
|
||||||
|
marksman: BotDurability;
|
||||||
|
pmcbot: BotDurability;
|
||||||
|
exusec: BotDurability;
|
||||||
|
gifter: BotDurability;
|
||||||
|
sectantpriest: BotDurability;
|
||||||
|
sectantwarrior: BotDurability;
|
||||||
|
}
|
||||||
|
/** Durability values to be used when a more specific bot type cant be found */
|
||||||
|
export interface DefaultDurability {
|
||||||
|
armor: DefaultArmor;
|
||||||
|
weapon: WeaponDurability;
|
||||||
|
}
|
||||||
|
export interface DefaultArmor {
|
||||||
|
maxDelta: number;
|
||||||
|
minDelta: number;
|
||||||
|
}
|
||||||
|
export interface WeaponDurability {
|
||||||
|
lowestMax: number;
|
||||||
|
highestMax: number;
|
||||||
|
maxDelta: number;
|
||||||
|
minDelta: number;
|
||||||
|
}
|
||||||
|
export interface PmcDurability {
|
||||||
|
armor: PmcDurabilityArmor;
|
||||||
|
weapon: WeaponDurability;
|
||||||
|
}
|
||||||
|
export interface PmcDurabilityArmor {
|
||||||
|
lowestMaxPercent: number;
|
||||||
|
highestMaxPercent: number;
|
||||||
|
maxDelta: number;
|
||||||
|
minDelta: number;
|
||||||
|
}
|
||||||
|
export interface BotDurability {
|
||||||
|
armor: ArmorDurability;
|
||||||
|
weapon: WeaponDurability;
|
||||||
|
}
|
||||||
|
export interface ArmorDurability {
|
||||||
|
maxDelta: number;
|
||||||
|
minDelta: number;
|
||||||
|
}
|
5
TypeScript/10ScopesAndTypes/types/models/spt/config/IItemConfig.d.ts
vendored
Normal file
5
TypeScript/10ScopesAndTypes/types/models/spt/config/IItemConfig.d.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import { IBaseConfig } from "./IBaseConfig";
|
||||||
|
export interface IItemConfig extends IBaseConfig {
|
||||||
|
kind: "aki-item";
|
||||||
|
blacklist: string[];
|
||||||
|
}
|
22
TypeScript/10ScopesAndTypes/types/models/spt/config/IPmcConfig.d.ts
vendored
Normal file
22
TypeScript/10ScopesAndTypes/types/models/spt/config/IPmcConfig.d.ts
vendored
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import { MinMax } from "../../common/MinMax";
|
||||||
|
export interface IPmcConfig {
|
||||||
|
dynamicLoot: DynamicLoot;
|
||||||
|
useDifficultyOverride: boolean;
|
||||||
|
difficulty: string;
|
||||||
|
looseWeaponInBackpackChancePercent: number;
|
||||||
|
looseWeaponInBackpackLootMinMax: MinMax;
|
||||||
|
isUsec: number;
|
||||||
|
chanceSameSideIsHostilePercent: number;
|
||||||
|
usecType: string;
|
||||||
|
bearType: string;
|
||||||
|
maxBackpackLootTotalRub: number;
|
||||||
|
maxPocketLootTotalRub: number;
|
||||||
|
maxVestLootTotalRub: number;
|
||||||
|
convertIntoPmcChance: Record<string, MinMax>;
|
||||||
|
enemyTypes: string[];
|
||||||
|
}
|
||||||
|
export interface DynamicLoot {
|
||||||
|
whitelist: string[];
|
||||||
|
blacklist: string[];
|
||||||
|
moneyStackLimits: Record<string, number>;
|
||||||
|
}
|
@ -4,6 +4,8 @@ export interface IQuestConfig extends IBaseConfig {
|
|||||||
kind: "aki-quest";
|
kind: "aki-quest";
|
||||||
redeemTime: number;
|
redeemTime: number;
|
||||||
repeatableQuests: IRepeatableQuestConfig[];
|
repeatableQuests: IRepeatableQuestConfig[];
|
||||||
|
bearOnlyQuests: string[];
|
||||||
|
usecOnlyQuests: string[];
|
||||||
}
|
}
|
||||||
export interface IRepeatableQuestConfig {
|
export interface IRepeatableQuestConfig {
|
||||||
name: string;
|
name: string;
|
||||||
@ -15,6 +17,10 @@ export interface IRepeatableQuestConfig {
|
|||||||
locations: Record<ELocationName, string[]>;
|
locations: Record<ELocationName, string[]>;
|
||||||
traderWhitelist: ITraderWhitelist[];
|
traderWhitelist: ITraderWhitelist[];
|
||||||
questConfig: IQuestConfig;
|
questConfig: IQuestConfig;
|
||||||
|
/** Item base types to block when generating rewards */
|
||||||
|
rewardBaseTypeBlacklist: string[];
|
||||||
|
/** Item tplIds to ignore when generating rewards */
|
||||||
|
rewardBlacklist: string[];
|
||||||
}
|
}
|
||||||
export interface IRewardScaling {
|
export interface IRewardScaling {
|
||||||
levels: number[];
|
levels: number[];
|
||||||
|
@ -12,6 +12,7 @@ export interface Sell {
|
|||||||
chance: Chance;
|
chance: Chance;
|
||||||
time: Time;
|
time: Time;
|
||||||
reputation: Reputation;
|
reputation: Reputation;
|
||||||
|
simulatedSellHours: number;
|
||||||
}
|
}
|
||||||
export interface Chance {
|
export interface Chance {
|
||||||
base: number;
|
base: number;
|
||||||
|
@ -12,8 +12,10 @@ export interface UpdateTime {
|
|||||||
seconds: number;
|
seconds: number;
|
||||||
}
|
}
|
||||||
export interface FenceConfig {
|
export interface FenceConfig {
|
||||||
|
partialRefreshTimeSeconds: number;
|
||||||
|
partialRefreshChangePercent: number;
|
||||||
assortSize: number;
|
assortSize: number;
|
||||||
maxPresetsCount: number;
|
maxPresetsPercent: number;
|
||||||
presetPriceMult: number;
|
presetPriceMult: number;
|
||||||
blacklist: string[];
|
blacklist: string[];
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
export declare class AirDropLootItem {
|
export declare class LootItem {
|
||||||
id: string;
|
|
||||||
tpl: string;
|
tpl: string;
|
||||||
isPreset: boolean;
|
isPreset: boolean;
|
||||||
stackCount: number;
|
stackCount: number;
|
9
TypeScript/10ScopesAndTypes/types/models/spt/services/LootRequest.d.ts
vendored
Normal file
9
TypeScript/10ScopesAndTypes/types/models/spt/services/LootRequest.d.ts
vendored
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import { MinMax } from "../../common/MinMax";
|
||||||
|
export declare class LootRequest {
|
||||||
|
presetCount: MinMax;
|
||||||
|
itemCount: MinMax;
|
||||||
|
itemBlacklist: string[];
|
||||||
|
itemTypeWhitelist: string[];
|
||||||
|
/** key: item base type: value: max count */
|
||||||
|
itemLimits: Record<string, number>;
|
||||||
|
}
|
@ -1,12 +1,12 @@
|
|||||||
import { IBotType } from "../models/eft/common/tables/IBotType";
|
import { IBotType } from "../models/eft/common/tables/IBotType";
|
||||||
import { Equipment, EquipmentFilterDetails, IBotConfig } from "../models/spt/config/IBotConfig";
|
import { EquipmentFilters, EquipmentFilterDetails, IBotConfig } from "../models/spt/config/IBotConfig";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { ILogger } from "../models/spt/utils/ILogger";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { ConfigServer } from "../servers/ConfigServer";
|
||||||
export declare class BotEquipmentFilterService {
|
export declare class BotEquipmentFilterService {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected botConfig: IBotConfig;
|
protected botConfig: IBotConfig;
|
||||||
protected botEquipmentFilterlists: Record<string, Equipment>;
|
protected botEquipmentFilterlists: Record<string, EquipmentFilters>;
|
||||||
constructor(logger: ILogger, configServer: ConfigServer);
|
constructor(logger: ILogger, configServer: ConfigServer);
|
||||||
/**
|
/**
|
||||||
* Filter a bots data to exclude equipment and cartridges defines in the botConfig
|
* Filter a bots data to exclude equipment and cartridges defines in the botConfig
|
||||||
@ -22,7 +22,7 @@ export declare class BotEquipmentFilterService {
|
|||||||
* @param playerLevel Level of the player
|
* @param playerLevel Level of the player
|
||||||
* @returns EquipmentBlacklistDetails object
|
* @returns EquipmentBlacklistDetails object
|
||||||
*/
|
*/
|
||||||
protected getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails;
|
getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails;
|
||||||
/**
|
/**
|
||||||
* Get the whitelist for a specific bot type that's within the players level
|
* Get the whitelist for a specific bot type that's within the players level
|
||||||
* @param botRole Bot type
|
* @param botRole Bot type
|
||||||
|
@ -12,6 +12,11 @@ import { HashUtil } from "../utils/HashUtil";
|
|||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { JsonUtil } from "../utils/JsonUtil";
|
||||||
import { RandomUtil } from "../utils/RandomUtil";
|
import { RandomUtil } from "../utils/RandomUtil";
|
||||||
import { TimeUtil } from "../utils/TimeUtil";
|
import { TimeUtil } from "../utils/TimeUtil";
|
||||||
|
import { ItemFilterService } from "./ItemFilterService";
|
||||||
|
/**
|
||||||
|
* Handle actions surrounding Fence
|
||||||
|
* e.g. generating or refreshing assorts / get next refresh time
|
||||||
|
*/
|
||||||
export declare class FenceService {
|
export declare class FenceService {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected hashUtil: HashUtil;
|
protected hashUtil: HashUtil;
|
||||||
@ -22,18 +27,64 @@ export declare class FenceService {
|
|||||||
protected handbookHelper: HandbookHelper;
|
protected handbookHelper: HandbookHelper;
|
||||||
protected itemHelper: ItemHelper;
|
protected itemHelper: ItemHelper;
|
||||||
protected presetHelper: PresetHelper;
|
protected presetHelper: PresetHelper;
|
||||||
|
protected itemFilterService: ItemFilterService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected fenceAssort: ITraderAssort;
|
protected fenceAssort: ITraderAssort;
|
||||||
protected traderConfig: ITraderConfig;
|
protected traderConfig: ITraderConfig;
|
||||||
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, configServer: ConfigServer);
|
protected nextMiniRefreshTimestamp: number;
|
||||||
|
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, configServer: ConfigServer);
|
||||||
protected setFenceAssort(fenceAssort: ITraderAssort): void;
|
protected setFenceAssort(fenceAssort: ITraderAssort): void;
|
||||||
getFenceAssorts(): ITraderAssort;
|
/**
|
||||||
|
* Get assorts player can purchase
|
||||||
|
* Adjust prices based on fence level of player
|
||||||
|
* @param pmcProfile Player profile
|
||||||
|
* @returns ITraderAssort
|
||||||
|
*/
|
||||||
|
getFenceAssorts(pmcProfile: IPmcData): ITraderAssort;
|
||||||
|
/**
|
||||||
|
* Get fence assorts with no price adjustments based on fence rep
|
||||||
|
* @returns ITraderAssort
|
||||||
|
*/
|
||||||
|
getRawFenceAssorts(): ITraderAssort;
|
||||||
|
/**
|
||||||
|
* Does fence need to perform a partial refresh because its passed the refresh timer defined in trader.json
|
||||||
|
* @returns true if it needs a partial refresh
|
||||||
|
*/
|
||||||
|
needsPartialRefresh(): boolean;
|
||||||
|
/**
|
||||||
|
* Replace a percentage of fence assorts with freshly generated items
|
||||||
|
*/
|
||||||
|
performPartialRefresh(): void;
|
||||||
|
/**
|
||||||
|
* Choose an item (not mod) at random and remove from assorts
|
||||||
|
*/
|
||||||
|
protected removeRandomItemFromAssorts(): void;
|
||||||
|
/**
|
||||||
|
* Get an integer rounded count of items to replace based on percentrage from traderConfig value
|
||||||
|
* @param totalItemCount total item count
|
||||||
|
* @returns rounded int of items to replace
|
||||||
|
*/
|
||||||
|
protected getCountOfItemsToReplace(totalItemCount: number): number;
|
||||||
/**
|
/**
|
||||||
* Get the count of items fence offers
|
* Get the count of items fence offers
|
||||||
* @returns number
|
* @returns number
|
||||||
*/
|
*/
|
||||||
getOfferCount(): number;
|
getOfferCount(): number;
|
||||||
generateFenceAssortCache(pmcData: IPmcData): void;
|
/**
|
||||||
|
* Create a trader assort for fence
|
||||||
|
*/
|
||||||
|
generateFenceAssortCache(): void;
|
||||||
|
/**
|
||||||
|
* Create skeleton to hold assort items
|
||||||
|
* @returns ITraderAssort object
|
||||||
|
*/
|
||||||
|
protected createBaseTraderAssortItem(): ITraderAssort;
|
||||||
|
/**
|
||||||
|
* Hydrate result parameter object with generated assorts
|
||||||
|
* @param assortCount Number of assorts to generate
|
||||||
|
* @param assorts object to add assorts to
|
||||||
|
*/
|
||||||
|
protected createAssorts(assortCount: number, assorts: ITraderAssort): void;
|
||||||
/**
|
/**
|
||||||
* Get the next update timestamp for fence
|
* Get the next update timestamp for fence
|
||||||
* @returns future timestamp
|
* @returns future timestamp
|
||||||
@ -44,11 +95,14 @@ export declare class FenceService {
|
|||||||
*/
|
*/
|
||||||
protected getFenceRefreshTime(): number;
|
protected getFenceRefreshTime(): number;
|
||||||
/**
|
/**
|
||||||
* Get the fence level the passed in profile has
|
* Get fence level the passed in profile has
|
||||||
* @param pmcData Player profile
|
* @param pmcData Player profile
|
||||||
* @returns FenceLevel
|
* @returns FenceLevel object
|
||||||
*/
|
*/
|
||||||
getFenceInfo(pmcData: IPmcData): FenceLevel;
|
getFenceInfo(pmcData: IPmcData): FenceLevel;
|
||||||
|
/**
|
||||||
|
* Remove an assort from fence by id
|
||||||
|
* @param assortIdToRemove assort id to remove from fence assorts
|
||||||
|
*/
|
||||||
removeFenceOffer(assortIdToRemove: string): void;
|
removeFenceOffer(assortIdToRemove: string): void;
|
||||||
updateFenceOffers(pmcData: IPmcData): void;
|
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ import { DialogueHelper } from "../helpers/DialogueHelper";
|
|||||||
import { SecureContainerHelper } from "../helpers/SecureContainerHelper";
|
import { SecureContainerHelper } from "../helpers/SecureContainerHelper";
|
||||||
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 { InsuredItem } 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 { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig";
|
import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig";
|
||||||
@ -44,8 +45,22 @@ export declare class InsuranceService {
|
|||||||
* @param mapId Id of the map player died/exited that caused the insurance to be issued on
|
* @param mapId Id of the map player died/exited that caused the insurance to be issued on
|
||||||
*/
|
*/
|
||||||
sendInsuredItems(pmcData: IPmcData, sessionID: string, mapId: string): void;
|
sendInsuredItems(pmcData: IPmcData, sessionID: string, mapId: string): void;
|
||||||
|
/**
|
||||||
|
* Store lost gear post-raid inside profile
|
||||||
|
* @param pmcData player profile to store gear in
|
||||||
|
* @param offraidData post-raid request object
|
||||||
|
* @param preRaidGear gear player wore prior to raid
|
||||||
|
* @param sessionID Session id
|
||||||
|
*/
|
||||||
storeLostGear(pmcData: IPmcData, offraidData: ISaveProgressRequestData, preRaidGear: Item[], sessionID: string): void;
|
storeLostGear(pmcData: IPmcData, offraidData: ISaveProgressRequestData, preRaidGear: Item[], sessionID: string): void;
|
||||||
storeInsuredItemsForReturn(pmcData: IPmcData, offraidData: ISaveProgressRequestData, preRaidGear: Item[], sessionID: string): void;
|
storeInsuredItemsForReturn(pmcData: IPmcData, offraidData: ISaveProgressRequestData, preRaidGear: Item[], sessionID: string): void;
|
||||||
protected addGearToSend(pmcData: IPmcData, insuredItem: any, actualItem: any, sessionID: string): any;
|
/**
|
||||||
|
* Add gear item to InsuredItems array in player profile
|
||||||
|
* @param pmcData profile to store item in
|
||||||
|
* @param insuredItem Item to store in profile
|
||||||
|
* @param actualItem item to store
|
||||||
|
* @param sessionID Session id
|
||||||
|
*/
|
||||||
|
protected addGearToSend(pmcData: IPmcData, insuredItem: InsuredItem, actualItem: Item, sessionID: string): void;
|
||||||
getPremium(pmcData: IPmcData, inventoryItem: Item, traderId: string): number;
|
getPremium(pmcData: IPmcData, inventoryItem: Item, traderId: string): number;
|
||||||
}
|
}
|
||||||
|
24
TypeScript/10ScopesAndTypes/types/services/ItemFilterService.d.ts
vendored
Normal file
24
TypeScript/10ScopesAndTypes/types/services/ItemFilterService.d.ts
vendored
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
import { IItemConfig } from "../models/spt/config/IItemConfig";
|
||||||
|
import { ILogger } from "../models/spt/utils/ILogger";
|
||||||
|
import { ConfigServer } from "../servers/ConfigServer";
|
||||||
|
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||||
|
/** Centralise the handling of blacklisting items, uses blacklist found in config/item.json */
|
||||||
|
export declare class ItemFilterService {
|
||||||
|
protected logger: ILogger;
|
||||||
|
protected databaseServer: DatabaseServer;
|
||||||
|
protected configServer: ConfigServer;
|
||||||
|
protected blacklist: string[];
|
||||||
|
protected itemConfig: IItemConfig;
|
||||||
|
constructor(logger: ILogger, databaseServer: DatabaseServer, configServer: ConfigServer);
|
||||||
|
/**
|
||||||
|
* Check if the provided template id is blacklisted in config/item.json
|
||||||
|
* @param tpl template id
|
||||||
|
* @returns true if blacklisted
|
||||||
|
*/
|
||||||
|
isItemBlacklisted(tpl: string): boolean;
|
||||||
|
/**
|
||||||
|
* Return every template id blacklisted in config/item.json
|
||||||
|
* @returns string array of blacklisted tempalte ids
|
||||||
|
*/
|
||||||
|
getBlacklistedItems(): string[];
|
||||||
|
}
|
@ -45,6 +45,11 @@ export declare class ProfileFixerService {
|
|||||||
* @param pmcProfile Profile to find and remove slots from
|
* @param pmcProfile Profile to find and remove slots from
|
||||||
*/
|
*/
|
||||||
protected removeResourcesFromSlotsInHideoutWithoutLocationIndexValue(pmcProfile: IPmcData): void;
|
protected removeResourcesFromSlotsInHideoutWithoutLocationIndexValue(pmcProfile: IPmcData): void;
|
||||||
|
/**
|
||||||
|
* Hideout slots need to be in a specific order, locationIndex in ascending order
|
||||||
|
* @param pmcProfile profile to edit
|
||||||
|
*/
|
||||||
|
protected reorderHideoutAreasWithResouceInputs(pmcProfile: IPmcData): void;
|
||||||
/**
|
/**
|
||||||
* add in objects equal to the number of slots
|
* add in objects equal to the number of slots
|
||||||
* @param areaType area to check
|
* @param areaType area to check
|
||||||
|
@ -4,8 +4,18 @@ import { TimeUtil } from "./TimeUtil";
|
|||||||
export declare class HashUtil {
|
export declare class HashUtil {
|
||||||
protected timeUtil: TimeUtil;
|
protected timeUtil: TimeUtil;
|
||||||
constructor(timeUtil: TimeUtil);
|
constructor(timeUtil: TimeUtil);
|
||||||
|
/**
|
||||||
|
* Create a 24 character id using the sha256 algorithm + current timestamp
|
||||||
|
* @returns 24 character hash
|
||||||
|
*/
|
||||||
generate(): string;
|
generate(): string;
|
||||||
generateMd5ForData(data: string): string;
|
generateMd5ForData(data: string): string;
|
||||||
generateSha1ForData(data: string): string;
|
generateSha1ForData(data: string): string;
|
||||||
|
/**
|
||||||
|
* Create a hash for the data parameter
|
||||||
|
* @param algorithm algorithm to use to hash
|
||||||
|
* @param data data to be hashed
|
||||||
|
* @returns hash value
|
||||||
|
*/
|
||||||
generateHashForData(algorithm: string, data: crypto.BinaryLike): string;
|
generateHashForData(algorithm: string, data: crypto.BinaryLike): string;
|
||||||
}
|
}
|
||||||
|
@ -150,4 +150,10 @@ export declare class RandomUtil {
|
|||||||
*/
|
*/
|
||||||
drawRandomFromDict(dict: any, count?: number, replacement?: boolean): any[];
|
drawRandomFromDict(dict: any, count?: number, replacement?: boolean): any[];
|
||||||
getBiasedRandomNumber(min: number, max: number, shift: number, n: number): number;
|
getBiasedRandomNumber(min: number, max: number, shift: number, n: number): number;
|
||||||
|
/**
|
||||||
|
* Fisher-Yates shuffle an array
|
||||||
|
* @param array Array to shuffle
|
||||||
|
* @returns Shuffled array
|
||||||
|
*/
|
||||||
|
shuffle<T>(array: Array<T>): Array<T>;
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
/**
|
||||||
|
* Utility class to handle time related problems
|
||||||
|
*/
|
||||||
export declare class TimeUtil {
|
export declare class TimeUtil {
|
||||||
static readonly oneHourAsSeconds = 3600;
|
static readonly oneHourAsSeconds = 3600;
|
||||||
formatTime(date: Date): string;
|
formatTime(date: Date): string;
|
||||||
@ -19,4 +22,10 @@ export declare class TimeUtil {
|
|||||||
* @returns current date in format: 00.00.0000 (dd.mm.yyyy)
|
* @returns current date in format: 00.00.0000 (dd.mm.yyyy)
|
||||||
*/
|
*/
|
||||||
getDateMailFormat(): string;
|
getDateMailFormat(): string;
|
||||||
|
/**
|
||||||
|
* Convert hours into seconds
|
||||||
|
* @param hours hours to convert to seconds
|
||||||
|
* @returns number
|
||||||
|
*/
|
||||||
|
getHoursAsSeconds(hours: number): number;
|
||||||
}
|
}
|
||||||
|
@ -11,4 +11,5 @@ export declare class LocationCallbacks {
|
|||||||
constructor(httpResponse: HttpResponseUtil, locationController: LocationController);
|
constructor(httpResponse: HttpResponseUtil, locationController: LocationController);
|
||||||
getLocationData(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ILocationsGenerateAllResponse>;
|
getLocationData(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ILocationsGenerateAllResponse>;
|
||||||
getLocation(url: string, info: IGetLocationRequestData, sessionID: string): IGetBodyResponseData<ILocationBase>;
|
getLocation(url: string, info: IGetLocationRequestData, sessionID: string): IGetBodyResponseData<ILocationBase>;
|
||||||
|
getAirdropLoot(url: string, info: IEmptyRequestData, sessionID: string): string;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { ProfileController } from "../controllers/ProfileController";
|
import { ProfileController } from "../controllers/ProfileController";
|
||||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
||||||
|
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
||||||
import { INullResponseData } from "../models/eft/httpResponse/INullResponseData";
|
import { INullResponseData } from "../models/eft/httpResponse/INullResponseData";
|
||||||
import { IGetMiniProfileRequestData } from "../models/eft/launcher/IGetMiniProfileRequestData";
|
import { IGetMiniProfileRequestData } from "../models/eft/launcher/IGetMiniProfileRequestData";
|
||||||
@ -12,20 +13,51 @@ import { ISearchFriendResponse } from "../models/eft/profile/ISearchFriendRespon
|
|||||||
import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNicknameRequestData";
|
import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNicknameRequestData";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||||
import { TimeUtil } from "../utils/TimeUtil";
|
import { TimeUtil } from "../utils/TimeUtil";
|
||||||
|
/** Handle profile related client events */
|
||||||
export declare class ProfileCallbacks {
|
export declare class ProfileCallbacks {
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
protected timeUtil: TimeUtil;
|
protected timeUtil: TimeUtil;
|
||||||
protected profileController: ProfileController;
|
protected profileController: ProfileController;
|
||||||
constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, profileController: ProfileController);
|
constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, profileController: ProfileController);
|
||||||
createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData<any>;
|
createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData<any>;
|
||||||
getProfileData(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any>;
|
/**
|
||||||
regenerateScav(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any>;
|
* Get the complete player profile (scav + pmc character)
|
||||||
|
* @param url
|
||||||
|
* @param info Empty
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @returns Profile object
|
||||||
|
*/
|
||||||
|
getProfileData(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IPmcData[]>;
|
||||||
|
/**
|
||||||
|
* Handle the creation of a scav profile for player
|
||||||
|
* Occurs post-raid and when profile first created immediately after character details are confirmed by player
|
||||||
|
* @param url
|
||||||
|
* @param info empty
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @returns Profile object
|
||||||
|
*/
|
||||||
|
regenerateScav(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IPmcData[]>;
|
||||||
|
/**
|
||||||
|
* Handle client/game/profile/voice/change event
|
||||||
|
* @param url
|
||||||
|
* @param info Change voice request object
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @returns Client response
|
||||||
|
*/
|
||||||
changeVoice(url: string, info: IProfileChangeVoiceRequestData, sessionID: string): INullResponseData;
|
changeVoice(url: string, info: IProfileChangeVoiceRequestData, sessionID: string): INullResponseData;
|
||||||
|
/**
|
||||||
|
* Handle client/game/profile/nickname/change event
|
||||||
|
* Client allows player to adjust their profile name
|
||||||
|
* @param url
|
||||||
|
* @param info Change nickname request object
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @returns client response
|
||||||
|
*/
|
||||||
changeNickname(url: string, info: IProfileChangeNicknameRequestData, sessionID: string): IGetBodyResponseData<any>;
|
changeNickname(url: string, info: IProfileChangeNicknameRequestData, sessionID: string): IGetBodyResponseData<any>;
|
||||||
validateNickname(url: string, info: IValidateNicknameRequestData, sessionID: string): IGetBodyResponseData<any>;
|
validateNickname(url: string, info: IValidateNicknameRequestData, sessionID: string): IGetBodyResponseData<any>;
|
||||||
getReservedNickname(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<string>;
|
getReservedNickname(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<string>;
|
||||||
/**
|
/**
|
||||||
* Called when creating a character, when you choose a character face/voice
|
* Called when creating a character when choosing a character face/voice
|
||||||
* @param url
|
* @param url
|
||||||
* @param info response (empty)
|
* @param info response (empty)
|
||||||
* @param sessionID
|
* @param sessionID
|
||||||
|
@ -19,6 +19,9 @@ import { ConfigServer } from "../servers/ConfigServer";
|
|||||||
import { RagfairServer } from "../servers/RagfairServer";
|
import { RagfairServer } from "../servers/RagfairServer";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { JsonUtil } from "../utils/JsonUtil";
|
||||||
|
/**
|
||||||
|
* Handle ragfair related callback events
|
||||||
|
*/
|
||||||
export declare class RagfairCallbacks extends OnLoadOnUpdate {
|
export declare class RagfairCallbacks extends OnLoadOnUpdate {
|
||||||
protected httpResponse: HttpResponseUtil;
|
protected httpResponse: HttpResponseUtil;
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
|
@ -35,6 +35,30 @@ export declare class InraidController {
|
|||||||
constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, configServer: ConfigServer);
|
constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, configServer: ConfigServer);
|
||||||
addPlayer(sessionID: string, info: IRegisterPlayerRequestData): void;
|
addPlayer(sessionID: string, info: IRegisterPlayerRequestData): void;
|
||||||
saveProgress(offraidData: ISaveProgressRequestData, sessionID: string): void;
|
saveProgress(offraidData: ISaveProgressRequestData, sessionID: string): void;
|
||||||
|
/**
|
||||||
|
* Handle updating the profile post-pmc raid
|
||||||
|
* @param sessionID session id
|
||||||
|
* @param offraidData post-raid data of raid
|
||||||
|
*/
|
||||||
|
protected savePmcProgress(sessionID: string, offraidData: ISaveProgressRequestData): void;
|
||||||
|
/**
|
||||||
|
* Reduce body part hp to % of max
|
||||||
|
* @param pmcData profile to edit
|
||||||
|
* @param multipler multipler to apply to max health
|
||||||
|
*/
|
||||||
|
protected reducePmcHealthToPercent(pmcData: IPmcData, multipler: number): void;
|
||||||
|
/**
|
||||||
|
* Handle updating the profile post-pscav raid
|
||||||
|
* @param sessionID session id
|
||||||
|
* @param offraidData post-raid data of raid
|
||||||
|
*/
|
||||||
|
protected savePlayerScavProgress(sessionID: string, offraidData: ISaveProgressRequestData): void;
|
||||||
|
/**
|
||||||
|
* Is the player dead after a raid - dead is anything other than "survived" / "runner"
|
||||||
|
* @param statusOnExit exit value from offraidData object
|
||||||
|
* @returns true if dead
|
||||||
|
*/
|
||||||
|
protected isPlayerDead(statusOnExit: string): boolean;
|
||||||
/**
|
/**
|
||||||
* Mark inventory items as FiR if player survived raid, otherwise remove FiR from them
|
* Mark inventory items as FiR if player survived raid, otherwise remove FiR from them
|
||||||
* @param offraidData Save Progress Request
|
* @param offraidData Save Progress Request
|
||||||
|
@ -92,7 +92,11 @@ export declare class InventoryController {
|
|||||||
*/
|
*/
|
||||||
toggleItem(pmcData: IPmcData, body: IInventoryToggleRequestData, sessionID: string): IItemEventRouterResponse;
|
toggleItem(pmcData: IPmcData, body: IInventoryToggleRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Handles Tagging of items (primary Containers).
|
* Add a tag to an inventory item
|
||||||
|
* @param pmcData profile with item to add tag to
|
||||||
|
* @param body tag request data
|
||||||
|
* @param sessionID session id
|
||||||
|
* @returns client response object
|
||||||
*/
|
*/
|
||||||
tagItem(pmcData: IPmcData, body: IInventoryTagRequestData, sessionID: string): IItemEventRouterResponse;
|
tagItem(pmcData: IPmcData, body: IInventoryTagRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
bindItem(pmcData: IPmcData, body: IInventoryBindRequestData, sessionID: string): IItemEventRouterResponse;
|
bindItem(pmcData: IPmcData, body: IInventoryBindRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
@ -1,18 +1,33 @@
|
|||||||
import { LocationGenerator } from "../generators/LocationGenerator";
|
import { LocationGenerator } from "../generators/LocationGenerator";
|
||||||
|
import { LootGenerator } from "../generators/LootGenerator";
|
||||||
import { ILocationBase } from "../models/eft/common/ILocationBase";
|
import { ILocationBase } from "../models/eft/common/ILocationBase";
|
||||||
import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSourceDestinationBase";
|
import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSourceDestinationBase";
|
||||||
|
import { IAirdropConfig } from "../models/spt/config/IAirdropConfig";
|
||||||
|
import { LootItem } from "../models/spt/services/LootItem";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { ILogger } from "../models/spt/utils/ILogger";
|
||||||
|
import { ConfigServer } from "../servers/ConfigServer";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||||
|
import { HashUtil } from "../utils/HashUtil";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { JsonUtil } from "../utils/JsonUtil";
|
||||||
import { TimeUtil } from "../utils/TimeUtil";
|
import { TimeUtil } from "../utils/TimeUtil";
|
||||||
export declare class LocationController {
|
export declare class LocationController {
|
||||||
protected jsonUtil: JsonUtil;
|
protected jsonUtil: JsonUtil;
|
||||||
|
protected hashUtil: HashUtil;
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected locationGenerator: LocationGenerator;
|
protected locationGenerator: LocationGenerator;
|
||||||
|
protected lootGenerator: LootGenerator;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseServer: DatabaseServer;
|
||||||
protected timeUtil: TimeUtil;
|
protected timeUtil: TimeUtil;
|
||||||
constructor(jsonUtil: JsonUtil, logger: ILogger, locationGenerator: LocationGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil);
|
protected configServer: ConfigServer;
|
||||||
|
protected airdropConfig: IAirdropConfig;
|
||||||
|
constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, logger: ILogger, locationGenerator: LocationGenerator, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer);
|
||||||
get(location: string): ILocationBase;
|
get(location: string): ILocationBase;
|
||||||
generate(name: string): ILocationBase;
|
generate(name: string): ILocationBase;
|
||||||
generateAll(): ILocationsGenerateAllResponse;
|
generateAll(): ILocationsGenerateAllResponse;
|
||||||
|
/**
|
||||||
|
* Get loot for an airdop container
|
||||||
|
* Generates it randomly based on config/airdrop.json values
|
||||||
|
* @returns Array of LootItem
|
||||||
|
*/
|
||||||
|
getAirdropLoot(): LootItem[];
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestDa
|
|||||||
import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData";
|
import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData";
|
||||||
import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult";
|
import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult";
|
||||||
import { IStartOfflineRaidRequestData } from "../models/eft/match/IStartOffineRaidRequestData";
|
import { IStartOfflineRaidRequestData } from "../models/eft/match/IStartOffineRaidRequestData";
|
||||||
|
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
||||||
import { IInRaidConfig } from "../models/spt/config/IInRaidConfig";
|
import { IInRaidConfig } from "../models/spt/config/IInRaidConfig";
|
||||||
import { IMatchConfig } from "../models/spt/config/IMatchConfig";
|
import { IMatchConfig } from "../models/spt/config/IMatchConfig";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { ILogger } from "../models/spt/utils/ILogger";
|
||||||
@ -29,6 +30,7 @@ export declare class MatchController {
|
|||||||
protected applicationContext: ApplicationContext;
|
protected applicationContext: ApplicationContext;
|
||||||
protected matchConfig: IMatchConfig;
|
protected matchConfig: IMatchConfig;
|
||||||
protected inraidConfig: IInRaidConfig;
|
protected inraidConfig: IInRaidConfig;
|
||||||
|
protected botConfig: IBotConfig;
|
||||||
constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, applicationContext: ApplicationContext);
|
constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, applicationContext: ApplicationContext);
|
||||||
getEnabled(): boolean;
|
getEnabled(): boolean;
|
||||||
getProfile(info: IGetProfileRequestData): IPmcData[];
|
getProfile(info: IGetProfileRequestData): IPmcData[];
|
||||||
|
@ -39,16 +39,31 @@ export declare class QuestController {
|
|||||||
* @returns array of IQuest
|
* @returns array of IQuest
|
||||||
*/
|
*/
|
||||||
getClientQuests(sessionID: string): IQuest[];
|
getClientQuests(sessionID: string): IQuest[];
|
||||||
|
/**
|
||||||
|
* Is the quest for the opposite side the player is on
|
||||||
|
* @param side player side (usec/bear)
|
||||||
|
* @param questId questId to check
|
||||||
|
*/
|
||||||
|
protected questIsForOtherSide(side: string, questId: string): boolean;
|
||||||
|
/**
|
||||||
|
* Handle the client accepting a quest and starting it
|
||||||
|
* Send starting rewards if any to player and
|
||||||
|
* Send start notification if any to player
|
||||||
|
* @param pmcData Profile to update
|
||||||
|
* @param acceptedQuest Quest accepted
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @returns client response
|
||||||
|
*/
|
||||||
acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
* Remove completed quest from profile
|
* Update completed quest in profile
|
||||||
* Add newly unlocked quests to profile
|
* Add newly unlocked quests to profile
|
||||||
* Also recalculate thier level due to exp rewards
|
* Also recalculate thier level due to exp rewards
|
||||||
* @param pmcData Player profile
|
* @param pmcData Player profile
|
||||||
* @param body completed quest request
|
* @param body Completed quest request
|
||||||
* @param sessionID session id
|
* @param sessionID Session id
|
||||||
* @returns ItemEvent response
|
* @returns ItemEvent client response
|
||||||
*/
|
*/
|
||||||
completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
/**
|
/**
|
||||||
@ -67,10 +82,20 @@ export declare class QuestController {
|
|||||||
protected getQuestsFailedByCompletingQuest(completedQuestId: string): IQuest[];
|
protected getQuestsFailedByCompletingQuest(completedQuestId: string): IQuest[];
|
||||||
/**
|
/**
|
||||||
* Fail the quests provided
|
* Fail the quests provided
|
||||||
|
* Update quest in profile, otherwise add fresh quest object with failed status
|
||||||
* @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
|
||||||
*/
|
*/
|
||||||
protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void;
|
protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void;
|
||||||
handoverQuest(pmcData: IPmcData, body: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
handoverQuest(pmcData: IPmcData, body: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Increment a backend counter stored value by an amount,
|
||||||
|
* Create counter if it does not exist
|
||||||
|
* @param pmcData Profile to find backend counter in
|
||||||
|
* @param conditionId backend counter id to update
|
||||||
|
* @param questId quest id counter is associated with
|
||||||
|
* @param counterValue value to increment the backend counter with
|
||||||
|
*/
|
||||||
|
protected updateProfileBackendCounterValue(pmcData: IPmcData, conditionId: string, questId: string, counterValue: number): void;
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ import { RagfairOfferHelper } from "../helpers/RagfairOfferHelper";
|
|||||||
import { RagfairSellHelper } from "../helpers/RagfairSellHelper";
|
import { RagfairSellHelper } from "../helpers/RagfairSellHelper";
|
||||||
import { RagfairSortHelper } from "../helpers/RagfairSortHelper";
|
import { RagfairSortHelper } from "../helpers/RagfairSortHelper";
|
||||||
import { RagfairTaxHelper } from "../helpers/RagfairTaxHelper";
|
import { RagfairTaxHelper } from "../helpers/RagfairTaxHelper";
|
||||||
|
import { TraderHelper } from "../helpers/TraderHelper";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||||
import { Item } from "../models/eft/common/tables/IItem";
|
import { Item } from "../models/eft/common/tables/IItem";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
@ -33,6 +34,9 @@ import { RagfairPriceService } from "../services/RagfairPriceService";
|
|||||||
import { RagfairRequiredItemsService } from "../services/RagfairRequiredItemsService";
|
import { RagfairRequiredItemsService } from "../services/RagfairRequiredItemsService";
|
||||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||||
import { TimeUtil } from "../utils/TimeUtil";
|
import { TimeUtil } from "../utils/TimeUtil";
|
||||||
|
/**
|
||||||
|
* Handle RagfairCallback events
|
||||||
|
*/
|
||||||
export declare class RagfairController {
|
export declare class RagfairController {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected timeUtil: TimeUtil;
|
protected timeUtil: TimeUtil;
|
||||||
@ -52,14 +56,20 @@ export declare class RagfairController {
|
|||||||
protected handbookHelper: HandbookHelper;
|
protected handbookHelper: HandbookHelper;
|
||||||
protected paymentHelper: PaymentHelper;
|
protected paymentHelper: PaymentHelper;
|
||||||
protected inventoryHelper: InventoryHelper;
|
protected inventoryHelper: InventoryHelper;
|
||||||
|
protected traderHelper: TraderHelper;
|
||||||
protected ragfairHelper: RagfairHelper;
|
protected ragfairHelper: RagfairHelper;
|
||||||
protected ragfairOfferService: RagfairOfferService;
|
protected ragfairOfferService: RagfairOfferService;
|
||||||
protected ragfairRequiredItemsService: RagfairRequiredItemsService;
|
protected ragfairRequiredItemsService: RagfairRequiredItemsService;
|
||||||
protected ragfairOfferGenerator: RagfairOfferGenerator;
|
protected ragfairOfferGenerator: RagfairOfferGenerator;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected ragfairConfig: IRagfairConfig;
|
protected ragfairConfig: IRagfairConfig;
|
||||||
constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, itemEventRouter: ItemEventRouter, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, configServer: ConfigServer);
|
constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, itemEventRouter: ItemEventRouter, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, configServer: ConfigServer);
|
||||||
getOffers(sessionID: string, info: ISearchRequestData): IGetOffersResult;
|
getOffers(sessionID: string, info: ISearchRequestData): IGetOffersResult;
|
||||||
|
/**
|
||||||
|
* Update a trader flea offer with buy restrictions stored in the traders assort
|
||||||
|
* @param offer flea offer to update
|
||||||
|
*/
|
||||||
|
protected setTraderOfferPurchaseLimits(offer: IRagfairOffer): void;
|
||||||
protected isLinkedSearch(info: ISearchRequestData): boolean;
|
protected isLinkedSearch(info: ISearchRequestData): boolean;
|
||||||
protected isRequiredSearch(info: ISearchRequestData): boolean;
|
protected isRequiredSearch(info: ISearchRequestData): boolean;
|
||||||
update(): void;
|
update(): void;
|
||||||
|
@ -7,6 +7,7 @@ import { Exit } from "../models/eft/common/ILocationBase";
|
|||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||||
import { TraderInfo } from "../models/eft/common/tables/IBotBase";
|
import { TraderInfo } from "../models/eft/common/tables/IBotBase";
|
||||||
import { ICompletion, ICompletionAvailableFor, IElimination, IEliminationCondition, IExploration, IExplorationCondition, IPmcDataRepeatableQuest, IRepeatableQuest, IReward, IRewards } from "../models/eft/common/tables/IRepeatableQuests";
|
import { ICompletion, ICompletionAvailableFor, IElimination, IEliminationCondition, IExploration, IExplorationCondition, IPmcDataRepeatableQuest, IRepeatableQuest, IReward, IRewards } from "../models/eft/common/tables/IRepeatableQuests";
|
||||||
|
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
||||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQuestChangeRequest";
|
import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQuestChangeRequest";
|
||||||
import { ELocationName } from "../models/enums/ELocationName";
|
import { ELocationName } from "../models/enums/ELocationName";
|
||||||
@ -15,6 +16,7 @@ import { ILogger } from "../models/spt/utils/ILogger";
|
|||||||
import { ItemEventRouter } from "../routers/ItemEventRouter";
|
import { ItemEventRouter } from "../routers/ItemEventRouter";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { ConfigServer } from "../servers/ConfigServer";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||||
|
import { ItemFilterService } from "../services/ItemFilterService";
|
||||||
import { PaymentService } from "../services/PaymentService";
|
import { PaymentService } from "../services/PaymentService";
|
||||||
import { ProfileFixerService } from "../services/ProfileFixerService";
|
import { ProfileFixerService } from "../services/ProfileFixerService";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { JsonUtil } from "../utils/JsonUtil";
|
||||||
@ -64,9 +66,10 @@ export declare class RepeatableQuestController {
|
|||||||
protected itemEventRouter: ItemEventRouter;
|
protected itemEventRouter: ItemEventRouter;
|
||||||
protected paymentService: PaymentService;
|
protected paymentService: PaymentService;
|
||||||
protected objectId: ObjectId;
|
protected objectId: ObjectId;
|
||||||
|
protected itemFilterService: ItemFilterService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected questConfig: IQuestConfig;
|
protected questConfig: IQuestConfig;
|
||||||
constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, itemEventRouter: ItemEventRouter, paymentService: PaymentService, objectId: ObjectId, configServer: ConfigServer);
|
constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, itemEventRouter: ItemEventRouter, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer);
|
||||||
/**
|
/**
|
||||||
* This is the method reached by the /client/repeatalbeQuests/activityPeriods endpoint
|
* This is the method reached by the /client/repeatalbeQuests/activityPeriods endpoint
|
||||||
* Returns an array of objects in the format of repeatable quests to the client.
|
* Returns an array of objects in the format of repeatable quests to the client.
|
||||||
@ -217,4 +220,16 @@ export declare class RepeatableQuestController {
|
|||||||
debugLogRepeatableQuestIds(pmcData: IPmcData): void;
|
debugLogRepeatableQuestIds(pmcData: IPmcData): void;
|
||||||
probabilityObjectArray<K, V>(configArrayInput: ProbabilityObject<K, V>[]): ProbabilityObjectArray<K, V>;
|
probabilityObjectArray<K, V>(configArrayInput: ProbabilityObject<K, V>[]): ProbabilityObjectArray<K, V>;
|
||||||
changeRepeatableQuest(pmcDataIn: IPmcData, body: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse;
|
changeRepeatableQuest(pmcDataIn: IPmcData, body: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable)
|
||||||
|
* @returns a list of rewardable items [[_tpl, itemTemplate],...]
|
||||||
|
*/
|
||||||
|
protected getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig): [string, ITemplateItem][];
|
||||||
|
/**
|
||||||
|
* Checks if an id is a valid item. Valid meaning that it's an item that may be a reward
|
||||||
|
* or content of bot loot. Items that are tested as valid may be in a player backpack or stash.
|
||||||
|
* @param {*} tpl template id of item to check
|
||||||
|
* @returns boolean: true if item is valid reward
|
||||||
|
*/
|
||||||
|
isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig): boolean;
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ import { TraderHelper } from "../helpers/TraderHelper";
|
|||||||
import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader";
|
import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { ILogger } from "../models/spt/utils/ILogger";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||||
|
import { FenceService } from "../services/FenceService";
|
||||||
import { TraderAssortService } from "../services/TraderAssortService";
|
import { TraderAssortService } from "../services/TraderAssortService";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { JsonUtil } from "../utils/JsonUtil";
|
||||||
import { TimeUtil } from "../utils/TimeUtil";
|
import { TimeUtil } from "../utils/TimeUtil";
|
||||||
@ -15,8 +16,9 @@ export declare class TraderController {
|
|||||||
protected traderHelper: TraderHelper;
|
protected traderHelper: TraderHelper;
|
||||||
protected timeUtil: TimeUtil;
|
protected timeUtil: TimeUtil;
|
||||||
protected traderAssortService: TraderAssortService;
|
protected traderAssortService: TraderAssortService;
|
||||||
|
protected fenceService: FenceService;
|
||||||
protected jsonUtil: JsonUtil;
|
protected jsonUtil: JsonUtil;
|
||||||
constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, jsonUtil: JsonUtil);
|
constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, fenceService: FenceService, jsonUtil: JsonUtil);
|
||||||
/**
|
/**
|
||||||
* Runs when onLoad event is fired
|
* Runs when onLoad event is fired
|
||||||
* Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService
|
* Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService
|
||||||
@ -26,6 +28,7 @@ export declare class TraderController {
|
|||||||
/**
|
/**
|
||||||
* Runs when onUpdate is fired
|
* Runs when onUpdate is fired
|
||||||
* If current time is > nextResupply(expire) time of trader, refresh traders assorts and
|
* If current time is > nextResupply(expire) time of trader, refresh traders assorts and
|
||||||
|
* Fence is handled slightly differently
|
||||||
* @returns has run
|
* @returns has run
|
||||||
*/
|
*/
|
||||||
update(): boolean;
|
update(): boolean;
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
import { DependencyContainer } from "tsyringe";
|
import { DependencyContainer } from "tsyringe";
|
||||||
|
/**
|
||||||
|
* Handle the registration of classes to be used by the Dependency Injection code
|
||||||
|
*/
|
||||||
export declare class Container {
|
export declare class Container {
|
||||||
static registerTypes(depContainer: DependencyContainer): void;
|
static registerTypes(depContainer: DependencyContainer): void;
|
||||||
static registerListTypes(depContainer: DependencyContainer): void;
|
static registerListTypes(depContainer: DependencyContainer): void;
|
||||||
|
@ -40,7 +40,7 @@ export declare class BotGenerator {
|
|||||||
* @param botTemplate base bot template to use (e.g. assault/pmcbot)
|
* @param botTemplate base bot template to use (e.g. assault/pmcbot)
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
generatePlayerScav(role: string, difficulty: string, botTemplate: IBotType): IBotBase;
|
generatePlayerScav(sessionId: string, role: string, difficulty: string, botTemplate: IBotType): IBotBase;
|
||||||
generate(sessionId: string, info: IGenerateBotsRequestData): IBotBase[];
|
generate(sessionId: string, info: IGenerateBotsRequestData): IBotBase[];
|
||||||
/**
|
/**
|
||||||
* Choose if a bot should become a PMC by checking if bot type is allowed to become a Pmc in botConfig.convertFromChances and doing a random int check
|
* Choose if a bot should become a PMC by checking if bot type is allowed to become a Pmc in botConfig.convertFromChances and doing a random int check
|
||||||
@ -58,7 +58,7 @@ export declare class BotGenerator {
|
|||||||
* @returns IBotBase object
|
* @returns IBotBase object
|
||||||
*/
|
*/
|
||||||
protected getCloneOfBotBase(): IBotBase;
|
protected getCloneOfBotBase(): IBotBase;
|
||||||
protected generateBot(bot: IBotBase, role: string, node: IBotType, isPmc: boolean, isPlayerScav?: boolean): IBotBase;
|
protected generateBot(sessionId: string, bot: IBotBase, role: string, node: IBotType, isPmc: boolean, isPlayerScav?: boolean): IBotBase;
|
||||||
/**
|
/**
|
||||||
* Log the number of PMCs generated to the debug console
|
* Log the number of PMCs generated to the debug console
|
||||||
*/
|
*/
|
||||||
|
@ -18,7 +18,7 @@ export declare class BotInventoryGenerator {
|
|||||||
protected botGeneratorHelper: BotGeneratorHelper;
|
protected botGeneratorHelper: BotGeneratorHelper;
|
||||||
protected weightedRandomHelper: WeightedRandomHelper;
|
protected weightedRandomHelper: WeightedRandomHelper;
|
||||||
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, weightedRandomHelper: WeightedRandomHelper);
|
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, weightedRandomHelper: WeightedRandomHelper);
|
||||||
generateInventory(templateInventory: Inventory, equipmentChances: Chances, generation: Generation, botRole: string, isPmc: boolean): PmcInventory;
|
generateInventory(sessionId: string, templateInventory: Inventory, equipmentChances: Chances, generation: Generation, botRole: string, isPmc: boolean): PmcInventory;
|
||||||
protected generateEquipment(equipmentSlot: string, equipmentPool: Record<string, number>, modPool: Mods, spawnChances: Chances, botRole: string, inventory: PmcInventory): void;
|
protected generateEquipment(equipmentSlot: string, equipmentPool: Record<string, number>, modPool: Mods, spawnChances: Chances, botRole: string, inventory: PmcInventory): void;
|
||||||
protected generateInventoryBase(): PmcInventory;
|
protected generateInventoryBase(): PmcInventory;
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ export declare class BotLootGenerator {
|
|||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected botConfig: IBotConfig;
|
protected botConfig: IBotConfig;
|
||||||
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botLootCacheService: BotLootCacheService, configServer: ConfigServer);
|
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botLootCacheService: BotLootCacheService, configServer: ConfigServer);
|
||||||
generateLoot(templateInventory: Inventory, itemCounts: ItemMinMax, isPmc: boolean, botRole: string, botInventory: PmcInventory, equipmentChances: Chances): void;
|
generateLoot(sessionId: string, templateInventory: Inventory, itemCounts: ItemMinMax, isPmc: boolean, botRole: string, botInventory: PmcInventory, equipmentChances: Chances): void;
|
||||||
protected getRandomisedCount(min: number, max: number, nValue: number): number;
|
protected getRandomisedCount(min: number, max: number, nValue: number): number;
|
||||||
/**
|
/**
|
||||||
* Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit is reached
|
* Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit is reached
|
||||||
@ -47,7 +47,7 @@ export declare class BotLootGenerator {
|
|||||||
* @param botRole bots role, .e.g. pmcBot
|
* @param botRole bots role, .e.g. pmcBot
|
||||||
* @param isPmc are we generating for a pmc
|
* @param isPmc are we generating for a pmc
|
||||||
*/
|
*/
|
||||||
protected addLooseWeaponsToInventorySlot(botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean): void;
|
protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean): void;
|
||||||
/**
|
/**
|
||||||
* Get a random item from the pool parameter using the biasedRandomNumber system
|
* Get a random item from the pool parameter using the biasedRandomNumber system
|
||||||
* @param pool pool of items to pick an item from
|
* @param pool pool of items to pick an item from
|
||||||
|
@ -28,7 +28,18 @@ export declare class BotWeaponGenerator {
|
|||||||
protected botConfig: IBotConfig;
|
protected botConfig: IBotConfig;
|
||||||
constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer);
|
constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer);
|
||||||
/**
|
/**
|
||||||
* Get a random weapon from a bots pool of weapons (weighted)
|
* Pick a random weapon based on weightings and generate a functional weapon
|
||||||
|
* @param equipmentSlot Primary/secondary/holster
|
||||||
|
* @param botTemplateInventory e.g. assault.json
|
||||||
|
* @param weaponParentId
|
||||||
|
* @param modChances
|
||||||
|
* @param botRole role of bot, e.g. assault/followerBully
|
||||||
|
* @param isPmc Is weapon generated for a pmc
|
||||||
|
* @returns GenerateWeaponResult object
|
||||||
|
*/
|
||||||
|
generateRandomWeapon(sessionId: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean): GenerateWeaponResult;
|
||||||
|
/**
|
||||||
|
* Get a random weighted weapon from a bots pool of weapons
|
||||||
* @param equipmentSlot Primary/secondary/holster
|
* @param equipmentSlot Primary/secondary/holster
|
||||||
* @param botTemplateInventory e.g. assault.json
|
* @param botTemplateInventory e.g. assault.json
|
||||||
* @returns weapon tpl
|
* @returns weapon tpl
|
||||||
@ -39,43 +50,24 @@ export declare class BotWeaponGenerator {
|
|||||||
* @param weaponTpl weapon tpl to generate (use pickWeightedWeaponTplFromPool())
|
* @param weaponTpl weapon tpl to generate (use pickWeightedWeaponTplFromPool())
|
||||||
* @param equipmentSlot slot to fit into, primary/secondary/holster
|
* @param equipmentSlot slot to fit into, primary/secondary/holster
|
||||||
* @param botTemplateInventory e.g. assault.json
|
* @param botTemplateInventory e.g. assault.json
|
||||||
* @param weaponParentId
|
* @param weaponParentId ParentId of the weapon being generated
|
||||||
* @param modChances
|
* @param modChances Dictionary of item types and % chance weapon will have that mod
|
||||||
* @param botRole
|
* @param botRole e.g. assault/exusec
|
||||||
* @param isPmc
|
* @param isPmc
|
||||||
* @returns GenerateWeaponResult object
|
* @returns GenerateWeaponResult object
|
||||||
*/
|
*/
|
||||||
generateWeaponByTpl(weaponTpl: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean): GenerateWeaponResult;
|
generateWeaponByTpl(sessionId: string, weaponTpl: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean): GenerateWeaponResult;
|
||||||
/**
|
/**
|
||||||
* Generate an entirely random weapon
|
* Create array with weapon base as only element and
|
||||||
* @param equipmentSlot Primary/secondary/holster
|
* add additional properties based on weapon type
|
||||||
* @param botTemplateInventory e.g. assault.json
|
* @param weaponTpl Weapon tpl to create item with
|
||||||
* @param weaponParentId
|
* @param weaponParentId Weapons parent id
|
||||||
* @param modChances
|
* @param equipmentSlot e.g. primary/secondary/holster
|
||||||
* @param botRole
|
* @param weaponItemTemplate db template for weapon
|
||||||
* @param isPmc
|
|
||||||
* @returns GenerateWeaponResult object
|
|
||||||
*/
|
|
||||||
generateRandomWeapon(equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean): GenerateWeaponResult;
|
|
||||||
/**
|
|
||||||
* Create array with weapon base as only element
|
|
||||||
* Add additional properties as required
|
|
||||||
* @param weaponTpl
|
|
||||||
* @param weaponParentId
|
|
||||||
* @param equipmentSlot
|
|
||||||
* @param weaponItemTemplate
|
|
||||||
* @param botRole for durability values
|
* @param botRole for durability values
|
||||||
* @returns
|
* @returns Base weapon item in array
|
||||||
*/
|
*/
|
||||||
constructWeaponBaseArray(weaponTpl: string, weaponParentId: string, equipmentSlot: string, weaponItemTemplate: ITemplateItem, botRole: string): Item[];
|
constructWeaponBaseArray(weaponTpl: string, weaponParentId: string, equipmentSlot: string, weaponItemTemplate: ITemplateItem, botRole: string): Item[];
|
||||||
/**
|
|
||||||
* Add compatible magazines to an inventory based on a generated weapon
|
|
||||||
* @param weaponDetails
|
|
||||||
* @param magCounts
|
|
||||||
* @param inventory
|
|
||||||
* @param botRole the bot type we're getting generating extra mags for
|
|
||||||
*/
|
|
||||||
addExtraMagazinesToInventory(weaponDetails: GenerateWeaponResult, magCounts: MinMax, inventory: PmcInventory, botRole: string): void;
|
|
||||||
/**
|
/**
|
||||||
* Get the mods necessary to kit out a weapon to its preset level
|
* Get the mods necessary to kit out a weapon to its preset level
|
||||||
* @param weaponTpl weapon to find preset for
|
* @param weaponTpl weapon to find preset for
|
||||||
@ -84,20 +76,32 @@ export declare class BotWeaponGenerator {
|
|||||||
* @returns array of weapon mods
|
* @returns array of weapon mods
|
||||||
*/
|
*/
|
||||||
protected getPresetWeaponMods(weaponTpl: string, equipmentSlot: string, weaponParentId: string, itemTemplate: ITemplateItem, botRole: string): Item[];
|
protected getPresetWeaponMods(weaponTpl: string, equipmentSlot: string, weaponParentId: string, itemTemplate: ITemplateItem, botRole: string): Item[];
|
||||||
/** Checks if all required slots are occupied on a weapon and all it's mods */
|
/**
|
||||||
|
* Checks if all required slots are occupied on a weapon and all it's mods
|
||||||
|
* @param weaponItemArray Weapon + mods
|
||||||
|
* @returns true if valid
|
||||||
|
*/
|
||||||
protected isWeaponValid(weaponItemArray: Item[]): boolean;
|
protected isWeaponValid(weaponItemArray: Item[]): boolean;
|
||||||
/**
|
/**
|
||||||
* Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets.
|
* Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets.
|
||||||
* Additionally, adds extra bullets to SecuredContainer
|
* Additionally, adds extra bullets to SecuredContainer
|
||||||
* @param weaponMods
|
* @param weaponMods mods to attach to weapon
|
||||||
* @param weaponTemplate
|
* @param weaponTemplate db template for weapon
|
||||||
* @param magCounts
|
* @param magCounts magazine count to add to inventory
|
||||||
* @param ammoTpl
|
* @param ammoTpl ammo templateId to add to magazines
|
||||||
* @param inventory
|
* @param inventory inventory to add magazines to
|
||||||
* @param botRole the bot type we're getting generating extra mags for
|
* @param botRole the bot type we're getting generating extra mags for
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
protected generateExtraMagazines(weaponMods: Item[], weaponTemplate: ITemplateItem, magCounts: MinMax, ammoTpl: string, inventory: PmcInventory, botRole: string): void;
|
addExtraMagazinesToInventory(weaponMods: Item[], weaponTemplate: ITemplateItem, magCounts: MinMax, ammoTpl: string, inventory: PmcInventory, botRole: string): void;
|
||||||
|
/**
|
||||||
|
* Create a magazine using the parameters given
|
||||||
|
* @param magazineTpl Tpl of the magazine to create
|
||||||
|
* @param ammoTpl Ammo to add to magazine
|
||||||
|
* @param magTemplate template object of magazine
|
||||||
|
* @returns Item array
|
||||||
|
*/
|
||||||
|
protected createMagazine(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[];
|
||||||
/**
|
/**
|
||||||
* Get a randomised number of bullets for a specific magazine
|
* Get a randomised number of bullets for a specific magazine
|
||||||
* @param magCounts min and max count of magazines
|
* @param magCounts min and max count of magazines
|
||||||
@ -138,10 +142,9 @@ export declare class BotWeaponGenerator {
|
|||||||
* Finds and return a compatible ammo tpl based on the bots ammo weightings (x.json/inventory/equipment/ammo)
|
* Finds and return a compatible ammo tpl based on the bots ammo weightings (x.json/inventory/equipment/ammo)
|
||||||
* @param ammo a list of ammo tpls the weapon can use
|
* @param ammo a list of ammo tpls the weapon can use
|
||||||
* @param weaponTemplate the weapon we want to pick ammo for
|
* @param weaponTemplate the weapon we want to pick ammo for
|
||||||
* @param isPmc is the ammo being gathered for a pmc (runs pmc ammo filtering)
|
|
||||||
* @returns an ammo tpl that works with the desired gun
|
* @returns an ammo tpl that works with the desired gun
|
||||||
*/
|
*/
|
||||||
protected getCompatibleAmmo(ammo: Record<string, Record<string, number>>, weaponTemplate: ITemplateItem, isPmc: boolean): string;
|
protected getWeightedCompatibleAmmo(ammo: Record<string, Record<string, number>>, weaponTemplate: ITemplateItem): string;
|
||||||
/**
|
/**
|
||||||
* Get a weapons compatible cartridge caliber
|
* Get a weapons compatible cartridge caliber
|
||||||
* @param weaponTemplate Weapon to look up caliber of
|
* @param weaponTemplate Weapon to look up caliber of
|
||||||
|
@ -3,10 +3,9 @@ import { GameEventHelper } from "../helpers/GameEventHelper";
|
|||||||
import { ItemHelper } from "../helpers/ItemHelper";
|
import { ItemHelper } from "../helpers/ItemHelper";
|
||||||
import { PresetHelper } from "../helpers/PresetHelper";
|
import { PresetHelper } from "../helpers/PresetHelper";
|
||||||
import { RagfairServerHelper } from "../helpers/RagfairServerHelper";
|
import { RagfairServerHelper } from "../helpers/RagfairServerHelper";
|
||||||
import { ILooseLoot, SpawnpointTemplate } from "../models/eft/common/ILooseLoot";
|
import { ILooseLoot, SpawnpointsForced, SpawnpointTemplate } from "../models/eft/common/ILooseLoot";
|
||||||
import { Item } from "../models/eft/common/tables/IItem";
|
import { Item } from "../models/eft/common/tables/IItem";
|
||||||
import { IStaticAmmoDetails, IStaticContainerProps, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase";
|
import { IStaticAmmoDetails, IStaticContainerProps, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase";
|
||||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
|
||||||
import { ILocationConfig } from "../models/spt/config/ILocationConfig";
|
import { ILocationConfig } from "../models/spt/config/ILocationConfig";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { ILogger } from "../models/spt/utils/ILogger";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { ConfigServer } from "../servers/ConfigServer";
|
||||||
@ -36,11 +35,19 @@ export declare class LocationGenerator {
|
|||||||
generateContainerLoot(containerIn: IStaticContainerProps, staticForced: IStaticForcedProps[], staticLootDist: Record<string, IStaticLootDetails>, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, locationName: string): IStaticContainerProps;
|
generateContainerLoot(containerIn: IStaticContainerProps, staticForced: IStaticForcedProps[], staticLootDist: Record<string, IStaticLootDetails>, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, locationName: string): IStaticContainerProps;
|
||||||
protected getLooseLootMultiplerForLocation(location: string): number;
|
protected getLooseLootMultiplerForLocation(location: string): number;
|
||||||
protected getStaticLootMultiplerForLocation(location: string): number;
|
protected getStaticLootMultiplerForLocation(location: string): number;
|
||||||
|
/**
|
||||||
|
* Create array of loose + forced loot using probability system
|
||||||
|
* @param dynamicLootDist
|
||||||
|
* @param staticAmmoDist
|
||||||
|
* @param locationName Location to generate loot for
|
||||||
|
* @returns Array of spawn points with loot in them
|
||||||
|
*/
|
||||||
generateDynamicLoot(dynamicLootDist: ILooseLoot, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, locationName: string): SpawnpointTemplate[];
|
generateDynamicLoot(dynamicLootDist: ILooseLoot, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, locationName: string): SpawnpointTemplate[];
|
||||||
|
/**
|
||||||
|
* Add forced spawn point loot into loot parameter array
|
||||||
|
* @param loot array to add forced loot to
|
||||||
|
* @param forcedSpawnPoints forced loot to add
|
||||||
|
*/
|
||||||
|
protected addForcedLoot(loot: SpawnpointTemplate[], forcedSpawnPoints: SpawnpointsForced[]): void;
|
||||||
protected createItem(tpl: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, parentId?: string): IContainerItem;
|
protected createItem(tpl: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, parentId?: string): IContainerItem;
|
||||||
protected getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string;
|
|
||||||
protected getRandomValidCaliber(magTemplate: ITemplateItem): string;
|
|
||||||
protected drawAmmoTpl(caliber: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>): string;
|
|
||||||
protected createRandomMagCartridges(magTemplate: ITemplateItem, parentId: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, caliber?: string): Item;
|
|
||||||
protected createCartidges(parentId: string, ammoTpl: string, stackCount: number): Item;
|
|
||||||
}
|
}
|
||||||
|
55
TypeScript/11BundleLoadingSample/types/generators/LootGenerator.d.ts
vendored
Normal file
55
TypeScript/11BundleLoadingSample/types/generators/LootGenerator.d.ts
vendored
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
import { ItemHelper } from "../helpers/ItemHelper";
|
||||||
|
import { Preset } from "../models/eft/common/IGlobals";
|
||||||
|
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
||||||
|
import { LootItem } from "../models/spt/services/LootItem";
|
||||||
|
import { LootRequest } from "../models/spt/services/LootRequest";
|
||||||
|
import { ILogger } from "../models/spt/utils/ILogger";
|
||||||
|
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||||
|
import { ItemFilterService } from "../services/ItemFilterService";
|
||||||
|
import { RandomUtil } from "../utils/RandomUtil";
|
||||||
|
export declare class LootGenerator {
|
||||||
|
protected logger: ILogger;
|
||||||
|
protected databaseServer: DatabaseServer;
|
||||||
|
protected randomUtil: RandomUtil;
|
||||||
|
protected itemHelper: ItemHelper;
|
||||||
|
protected itemFilterService: ItemFilterService;
|
||||||
|
constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, itemFilterService: ItemFilterService);
|
||||||
|
/**
|
||||||
|
* Generate a list of items based on options passed in
|
||||||
|
* @param options parameters to adjust what loot is generated
|
||||||
|
* @returns An array of loot items
|
||||||
|
*/
|
||||||
|
createRandomloot(options: LootRequest): LootItem[];
|
||||||
|
/**
|
||||||
|
* Construct item limit record to hold max and current item count
|
||||||
|
* @param limits limits as defined in config
|
||||||
|
* @returns record, key: item tplId, value: current/max item count allowed
|
||||||
|
*/
|
||||||
|
protected initItemLimitCounter(limits: Record<string, number>): Record<string, {
|
||||||
|
current: number;
|
||||||
|
max: number;
|
||||||
|
}>;
|
||||||
|
/**
|
||||||
|
* Find a random item in items.json and add to result array
|
||||||
|
* @param items items to choose from
|
||||||
|
* @param itemTypeCounts item limit counts
|
||||||
|
* @param result array to add found item to
|
||||||
|
* @returns true if item was valid and added to pool
|
||||||
|
*/
|
||||||
|
protected findAndAddRandomItemToLoot(items: [string, ITemplateItem][], itemTypeCounts: Record<string, {
|
||||||
|
current: number;
|
||||||
|
max: number;
|
||||||
|
}>, result: LootItem[]): boolean;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Find a random item in items.json and add to result array
|
||||||
|
* @param globalDefaultPresets presets to choose from
|
||||||
|
* @param itemTypeCounts item limit counts
|
||||||
|
* @param result array to add found preset to
|
||||||
|
* @returns true if preset was valid and added to pool
|
||||||
|
*/
|
||||||
|
protected findAndAddRandomPresetToLoot(globalDefaultPresets: [string, Preset][], itemTypeCounts: Record<string, {
|
||||||
|
current: number;
|
||||||
|
max: number;
|
||||||
|
}>, result: LootItem[]): boolean;
|
||||||
|
}
|
@ -1,15 +1,21 @@
|
|||||||
import { ItemHelper } from "../helpers/ItemHelper";
|
import { ItemHelper } from "../helpers/ItemHelper";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
|
||||||
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
||||||
|
import { ConfigServer } from "../servers/ConfigServer";
|
||||||
|
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||||
|
import { ItemFilterService } from "../services/ItemFilterService";
|
||||||
|
/**
|
||||||
|
* Handle the generation of dynamic PMC loot in pockets and backpacks
|
||||||
|
* and the removal of blacklisted items
|
||||||
|
*/
|
||||||
export declare class PMCLootGenerator {
|
export declare class PMCLootGenerator {
|
||||||
protected itemHelper: ItemHelper;
|
protected itemHelper: ItemHelper;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseServer: DatabaseServer;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
|
protected itemFilterService: ItemFilterService;
|
||||||
protected pocketLootPool: string[];
|
protected pocketLootPool: string[];
|
||||||
protected backpackLootPool: string[];
|
protected backpackLootPool: string[];
|
||||||
protected botConfig: IBotConfig;
|
protected botConfig: IBotConfig;
|
||||||
constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer);
|
constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService);
|
||||||
generatePMCPocketLootPool(): string[];
|
generatePMCPocketLootPool(): string[];
|
||||||
generatePMCBackpackLootPool(): string[];
|
generatePMCBackpackLootPool(): string[];
|
||||||
}
|
}
|
||||||
|
@ -8,9 +8,13 @@ import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "../mo
|
|||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { ILogger } from "../models/spt/utils/ILogger";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { ConfigServer } from "../servers/ConfigServer";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||||
|
import { ItemFilterService } from "../services/ItemFilterService";
|
||||||
import { RagfairPriceService } from "../services/RagfairPriceService";
|
import { RagfairPriceService } from "../services/RagfairPriceService";
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
import { HashUtil } from "../utils/HashUtil";
|
||||||
import { RandomUtil } from "../utils/RandomUtil";
|
import { RandomUtil } from "../utils/RandomUtil";
|
||||||
|
/**
|
||||||
|
* Handle the creation of randomised scav case rewards
|
||||||
|
*/
|
||||||
export declare class ScavCaseRewardGenerator {
|
export declare class ScavCaseRewardGenerator {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected randomUtil: RandomUtil;
|
protected randomUtil: RandomUtil;
|
||||||
@ -18,9 +22,10 @@ export declare class ScavCaseRewardGenerator {
|
|||||||
protected itemHelper: ItemHelper;
|
protected itemHelper: ItemHelper;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseServer: DatabaseServer;
|
||||||
protected ragfairPriceService: RagfairPriceService;
|
protected ragfairPriceService: RagfairPriceService;
|
||||||
|
protected itemFilterService: ItemFilterService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected scavCaseConfig: IScavCaseConfig;
|
protected scavCaseConfig: IScavCaseConfig;
|
||||||
constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, configServer: ConfigServer);
|
constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, itemFilterService: ItemFilterService, configServer: ConfigServer);
|
||||||
/**
|
/**
|
||||||
* Create an array of rewards that will be given to the player upon completing their scav case build
|
* Create an array of rewards that will be given to the player upon completing their scav case build
|
||||||
* @param body client request
|
* @param body client request
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
|
||||||
import { IWeatherData } from "../models/eft/weather/IWeatherData";
|
import { IWeatherData } from "../models/eft/weather/IWeatherData";
|
||||||
import { IWeatherConfig } from "../models/spt/config/IWeatherConfig";
|
import { IWeatherConfig } from "../models/spt/config/IWeatherConfig";
|
||||||
|
import { ConfigServer } from "../servers/ConfigServer";
|
||||||
import { RandomUtil } from "../utils/RandomUtil";
|
import { RandomUtil } from "../utils/RandomUtil";
|
||||||
import { TimeUtil } from "../utils/TimeUtil";
|
import { TimeUtil } from "../utils/TimeUtil";
|
||||||
export declare class WeatherGenerator {
|
export declare class WeatherGenerator {
|
||||||
@ -21,11 +21,16 @@ export declare class WeatherGenerator {
|
|||||||
protected getAcceleratedTime(computedDate: Date): string;
|
protected getAcceleratedTime(computedDate: Date): string;
|
||||||
/**
|
/**
|
||||||
* Get current time formatted to fit BSGs requirement
|
* Get current time formatted to fit BSGs requirement
|
||||||
* @param computedDate
|
* @param computedDate date to format into bsg style
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
protected getNormalTime(computedDate: Date): string;
|
protected getNormalTime(computedDate: Date): string;
|
||||||
generateWeather(data: IWeatherData): IWeatherData;
|
/**
|
||||||
|
* Return randomised Weather data
|
||||||
|
* @param weatherData weather input data
|
||||||
|
* @returns Randomised weather data
|
||||||
|
*/
|
||||||
|
generateWeather(weatherData: IWeatherData): IWeatherData;
|
||||||
protected getWeightedFog(): string;
|
protected getWeightedFog(): string;
|
||||||
protected getWeightedRain(): number;
|
protected getWeightedRain(): number;
|
||||||
protected getRandomFloat(node: string): number;
|
protected getRandomFloat(node: string): number;
|
||||||
|
@ -17,7 +17,7 @@ export declare class AssortHelper {
|
|||||||
* @param assort assort items from a trader
|
* @param assort assort items from a trader
|
||||||
* @returns assort items minus locked quest assorts
|
* @returns assort items minus locked quest assorts
|
||||||
*/
|
*/
|
||||||
stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort): ITraderAssort;
|
stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort, flea?: boolean): ITraderAssort;
|
||||||
/**
|
/**
|
||||||
* Remove assorts from a trader that have not been unlocked yet
|
* Remove assorts from a trader that have not been unlocked yet
|
||||||
* @param pmcProfile player profile
|
* @param pmcProfile player profile
|
||||||
@ -32,5 +32,5 @@ export declare class AssortHelper {
|
|||||||
* @param itemID item id to remove from asort
|
* @param itemID item id to remove from asort
|
||||||
* @returns Modified assort
|
* @returns Modified assort
|
||||||
*/
|
*/
|
||||||
removeItemFromAssort(assort: ITraderAssort, itemID: string): ITraderAssort;
|
removeItemFromAssort(assort: ITraderAssort, itemID: string, flea?: boolean): ITraderAssort;
|
||||||
}
|
}
|
||||||
|
@ -3,10 +3,12 @@ import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"
|
|||||||
import { Mods, ModsChances } from "../models/eft/common/tables/IBotType";
|
import { Mods, ModsChances } from "../models/eft/common/tables/IBotType";
|
||||||
import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem";
|
import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem";
|
||||||
import { Grid, ITemplateItem, Slot } from "../models/eft/common/tables/ITemplateItem";
|
import { Grid, ITemplateItem, Slot } from "../models/eft/common/tables/ITemplateItem";
|
||||||
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
import { EquipmentFilterDetails, IBotConfig } from "../models/spt/config/IBotConfig";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { ILogger } from "../models/spt/utils/ILogger";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { ConfigServer } from "../servers/ConfigServer";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||||
|
import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService";
|
||||||
|
import { ItemFilterService } from "../services/ItemFilterService";
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
import { HashUtil } from "../utils/HashUtil";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { JsonUtil } from "../utils/JsonUtil";
|
||||||
import { RandomUtil } from "../utils/RandomUtil";
|
import { RandomUtil } from "../utils/RandomUtil";
|
||||||
@ -14,6 +16,7 @@ import { ContainerHelper } from "./ContainerHelper";
|
|||||||
import { InventoryHelper } from "./InventoryHelper";
|
import { InventoryHelper } from "./InventoryHelper";
|
||||||
import { ItemHelper } from "./ItemHelper";
|
import { ItemHelper } from "./ItemHelper";
|
||||||
import { ProbabilityHelper } from "./ProbabilityHelper";
|
import { ProbabilityHelper } from "./ProbabilityHelper";
|
||||||
|
import { ProfileHelper } from "./ProfileHelper";
|
||||||
export declare class BotGeneratorHelper {
|
export declare class BotGeneratorHelper {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected jsonUtil: JsonUtil;
|
protected jsonUtil: JsonUtil;
|
||||||
@ -25,10 +28,76 @@ export declare class BotGeneratorHelper {
|
|||||||
protected itemHelper: ItemHelper;
|
protected itemHelper: ItemHelper;
|
||||||
protected inventoryHelper: InventoryHelper;
|
protected inventoryHelper: InventoryHelper;
|
||||||
protected containerHelper: ContainerHelper;
|
protected containerHelper: ContainerHelper;
|
||||||
|
protected botEquipmentFilterService: BotEquipmentFilterService;
|
||||||
|
protected itemFilterService: ItemFilterService;
|
||||||
|
protected profileHelper: ProfileHelper;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected botConfig: IBotConfig;
|
protected botConfig: IBotConfig;
|
||||||
constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, configServer: ConfigServer);
|
constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, configServer: ConfigServer);
|
||||||
generateModsForItem(items: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances): Item[];
|
/**
|
||||||
|
* TODO - very similar to generateModsForWeapon
|
||||||
|
* Check mods are compatible and add to array
|
||||||
|
* @param equipment Equipment item to add mods to
|
||||||
|
* @param modPool Mod list to choose frm
|
||||||
|
* @param parentId parentid of item to add mod to
|
||||||
|
* @param parentTemplate template objet of item to add mods to
|
||||||
|
* @param modSpawnChances dictionary of mod items and their chance to spawn for this bot type
|
||||||
|
* @returns Item + compatible mods as an array
|
||||||
|
*/
|
||||||
|
generateModsForEquipment(equipment: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances): Item[];
|
||||||
|
/**
|
||||||
|
* TODO - very similar to generateModsForEquipment
|
||||||
|
* @param sessionId session id
|
||||||
|
* @param weapon Weapon to add mods to
|
||||||
|
* @param modPool pool of compatible mods to attach to gun
|
||||||
|
* @param weaponParentId parentId of weapon
|
||||||
|
* @param parentTemplate
|
||||||
|
* @param modSpawnChances
|
||||||
|
* @param ammoTpl ammo tpl to use when generating magazines/cartridges
|
||||||
|
* @param botRole role of bot weapon is generated for
|
||||||
|
* @returns Weapon with mods
|
||||||
|
*/
|
||||||
|
generateModsForWeapon(sessionId: string, weapon: Item[], modPool: Mods, weaponParentId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances, ammoTpl: string, botRole: string): Item[];
|
||||||
|
/**
|
||||||
|
* Generate a pool of mods for this bots mod type if bot has values inside `randomisedWeaponModSlots` array found in bot.json/equipment[botrole]
|
||||||
|
* @param allowedMods Mods to be added to mod pool
|
||||||
|
* @param botEquipBlacklist blacklist of items not allowed to be added to mod pool
|
||||||
|
* @param modSlot Slot to generate mods for
|
||||||
|
* @param itemModPool base mod pool to replace values of
|
||||||
|
*/
|
||||||
|
protected generateDynamicModPool(allowedMods: string[], botEquipBlacklist: EquipmentFilterDetails, modSlot: string, itemModPool: Record<string, string[]>): void;
|
||||||
|
/**
|
||||||
|
* Check if the specific item type on the weapon has reached the set limit
|
||||||
|
* @param modTpl item to check is limited
|
||||||
|
* @param currentCount current number of this item on gun
|
||||||
|
* @param maxLimit mod limit allowed
|
||||||
|
* @param botRole role of bot we're checking weapon of
|
||||||
|
* @returns true if limit reached
|
||||||
|
*/
|
||||||
|
protected weaponModLimitReached(modTpl: string, currentCount: {
|
||||||
|
count: number;
|
||||||
|
}, maxLimit: number, botRole: string): boolean;
|
||||||
|
/**
|
||||||
|
* log errors if mod is not valid for a slot
|
||||||
|
* @param modTpl
|
||||||
|
* @param found
|
||||||
|
* @param itemSlot
|
||||||
|
* @param modTemplate
|
||||||
|
* @param modSlot
|
||||||
|
* @param parentTemplate
|
||||||
|
* @returns true if valid
|
||||||
|
*/
|
||||||
|
protected isModValidForSlot(modTpl: string, found: boolean, itemSlot: Slot, modTemplate: ITemplateItem, modSlot: string, parentTemplate: ITemplateItem): boolean;
|
||||||
|
/**
|
||||||
|
* Create a mod item with parameters as properties
|
||||||
|
* @param modId _id
|
||||||
|
* @param modTpl _tpl
|
||||||
|
* @param parentId parentId
|
||||||
|
* @param modSlot slotId
|
||||||
|
* @param modTemplate Used to add additional properites in the upd object
|
||||||
|
* @returns Item object
|
||||||
|
*/
|
||||||
|
protected createModItem(modId: string, modTpl: string, parentId: string, modSlot: string, modTemplate: ITemplateItem): Item;
|
||||||
/**
|
/**
|
||||||
* Is this magazine cylinder related (revolvers and grenade launchers)
|
* Is this magazine cylinder related (revolvers and grenade launchers)
|
||||||
* @param magazineParentName the name of the magazines parent
|
* @param magazineParentName the name of the magazines parent
|
||||||
@ -62,11 +131,11 @@ export declare class BotGeneratorHelper {
|
|||||||
* Those magazines (e.g. 60dc519adf4c47305f6d410d) have a "Cartridges" entry with a _max_count=0.
|
* Those magazines (e.g. 60dc519adf4c47305f6d410d) have a "Cartridges" entry with a _max_count=0.
|
||||||
* Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots.
|
* Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots.
|
||||||
* This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine"
|
* This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine"
|
||||||
*
|
* @param items The items where the CylinderMagazine's camora are appended to
|
||||||
* @param {object} items The items where the CylinderMagazine's camora are appended to
|
* @param modPool modPool which should include available cartrigdes
|
||||||
* @param {object} modPool modPool which should include available cartrigdes
|
* @param parentId The CylinderMagazine's UID
|
||||||
* @param {string} parentId The CylinderMagazine's UID
|
* @param parentTemplate The CylinderMagazine's template
|
||||||
* @param {object} parentTemplate The CylinderMagazine's template
|
* @returns
|
||||||
*/
|
*/
|
||||||
protected fillCamora(items: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem): void;
|
protected fillCamora(items: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem): void;
|
||||||
/**
|
/**
|
||||||
@ -75,6 +144,13 @@ export declare class BotGeneratorHelper {
|
|||||||
* @returns string array of shells fro luitple camora sources
|
* @returns string array of shells fro luitple camora sources
|
||||||
*/
|
*/
|
||||||
protected mergeCamoraPoolsTogether(camorasWithShells: Record<string, string[]>): string[];
|
protected mergeCamoraPoolsTogether(camorasWithShells: Record<string, string[]>): string[];
|
||||||
|
/**
|
||||||
|
* Adds properties to an item
|
||||||
|
* e.g. Repairable / HasHinge / Foldable / MaxDurability
|
||||||
|
* @param itemTemplate
|
||||||
|
* @param botRole Used by weapons to randomise the durability values
|
||||||
|
* @returns Item Upd object with extra properties
|
||||||
|
*/
|
||||||
generateExtraPropertiesForItem(itemTemplate: ITemplateItem, botRole?: any): {
|
generateExtraPropertiesForItem(itemTemplate: ITemplateItem, botRole?: any): {
|
||||||
upd?: Upd;
|
upd?: Upd;
|
||||||
};
|
};
|
||||||
@ -93,12 +169,6 @@ export declare class BotGeneratorHelper {
|
|||||||
*/
|
*/
|
||||||
protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable;
|
protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable;
|
||||||
protected getModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string;
|
protected getModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string;
|
||||||
/**
|
|
||||||
* Sort by spawn chance, highest to lowest, higher is more common
|
|
||||||
* @param unsortedModArray String array to sort
|
|
||||||
* @returns Sorted string array
|
|
||||||
*/
|
|
||||||
protected sortModArray(unsortedModArray: string[]): string[];
|
|
||||||
/**
|
/**
|
||||||
* Can an item be added to an item without issue
|
* Can an item be added to an item without issue
|
||||||
* @param items
|
* @param items
|
||||||
@ -117,8 +187,15 @@ export declare class BotGeneratorHelper {
|
|||||||
* @returns a `boolean` indicating item was added
|
* @returns a `boolean` indicating item was added
|
||||||
*/
|
*/
|
||||||
addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], parentId: string, parentTpl: string, itemWithChildren: Item[], inventory: PmcInventory): boolean;
|
addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], parentId: string, parentTpl: string, itemWithChildren: Item[], inventory: PmcInventory): boolean;
|
||||||
|
/**
|
||||||
|
* is the provided item allowed inside a container
|
||||||
|
* @param slot location item wants to be placed in
|
||||||
|
* @param itemTpl item being placed
|
||||||
|
* @returns true if allowed
|
||||||
|
*/
|
||||||
protected itemAllowedInContainer(slot: Grid, itemTpl: string): boolean;
|
protected itemAllowedInContainer(slot: Grid, itemTpl: string): boolean;
|
||||||
}
|
}
|
||||||
|
/** TODO - move into own class */
|
||||||
export declare class ExhaustableArray<T> {
|
export declare class ExhaustableArray<T> {
|
||||||
private itemPool;
|
private itemPool;
|
||||||
private randomUtil;
|
private randomUtil;
|
||||||
|
@ -44,14 +44,72 @@ export declare class HideoutHelper {
|
|||||||
initProduction(recipeId: string, productionTime: number): Production;
|
initProduction(recipeId: string, productionTime: number): Production;
|
||||||
isProductionType(productive: Productive): productive is Production;
|
isProductionType(productive: Productive): productive is Production;
|
||||||
applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void;
|
applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void;
|
||||||
|
/**
|
||||||
|
* TODO:
|
||||||
|
* After looking at the skills there doesnt seem to be a configuration per skill to boost
|
||||||
|
* the XP gain PER skill. I THINK you should be able to put the variable "SkillProgress" (just like health has it)
|
||||||
|
* and be able to tune the skill gain PER skill, but I havent tested it and Im not sure!
|
||||||
|
* @param pmcData
|
||||||
|
* @param bonus
|
||||||
|
*/
|
||||||
protected applySkillXPBoost(pmcData: IPmcData, bonus: StageBonus): void;
|
protected applySkillXPBoost(pmcData: IPmcData, bonus: StageBonus): void;
|
||||||
|
/**
|
||||||
|
* Process a players hideout, update areas that use resources + increment production timers
|
||||||
|
* @param sessionID Session id
|
||||||
|
*/
|
||||||
updatePlayerHideout(sessionID: string): void;
|
updatePlayerHideout(sessionID: string): void;
|
||||||
|
/**
|
||||||
|
* Update progress timer for water collector
|
||||||
|
* @param pmcData profile to update
|
||||||
|
* @param productionId id of water collection production to update
|
||||||
|
* @param hideoutProperties Hideout properties
|
||||||
|
*/
|
||||||
|
protected updateWaterCollectorProductionTimer(pmcData: IPmcData, productionId: string, hideoutProperties: {
|
||||||
|
btcFarmCGs?: number;
|
||||||
|
isGeneratorOn: boolean;
|
||||||
|
waterCollectorHasFilter: boolean;
|
||||||
|
}): void;
|
||||||
|
/**
|
||||||
|
* Iterate over productions and update their progress timers
|
||||||
|
* @param pmcData Profile to check for productions and update
|
||||||
|
* @param hideoutProperties Hideout properties
|
||||||
|
*/
|
||||||
|
protected updateProductionTimers(pmcData: IPmcData, hideoutProperties: {
|
||||||
|
btcFarmCGs: number;
|
||||||
|
isGeneratorOn: boolean;
|
||||||
|
waterCollectorHasFilter: boolean;
|
||||||
|
}): void;
|
||||||
|
/**
|
||||||
|
* Update progress timer for scav case
|
||||||
|
* @param pmcData Profile to update
|
||||||
|
* @param productionId Id of scav case production to update
|
||||||
|
*/
|
||||||
|
protected updateScavCaseProductionTimer(pmcData: IPmcData, productionId: string): void;
|
||||||
|
/**
|
||||||
|
* Iterate over hideout areas that use resources (fuel/filters etc) and update associated values
|
||||||
|
* @param sessionID Session id
|
||||||
|
* @param pmcData Profile to update areas of
|
||||||
|
* @param hideoutProperties hideout properties
|
||||||
|
*/
|
||||||
|
protected updateAreasWithResources(sessionID: string, pmcData: IPmcData, hideoutProperties: {
|
||||||
|
btcFarmCGs: number;
|
||||||
|
isGeneratorOn: boolean;
|
||||||
|
waterCollectorHasFilter: boolean;
|
||||||
|
}): void;
|
||||||
protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void;
|
protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void;
|
||||||
protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean;
|
protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean;
|
||||||
protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData): HideoutArea;
|
protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData): void;
|
||||||
protected updateWaterFilters(waterFilterArea: HideoutArea, pwProd: Production, isGeneratorOn: boolean, pmcData: IPmcData): HideoutArea;
|
/**
|
||||||
|
* Adjust water filter objects resourceValue or delete when they reach 0 resource
|
||||||
|
* @param waterFilterArea water filter area to update
|
||||||
|
* @param production production object
|
||||||
|
* @param isGeneratorOn is generatory enabled
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @returns Updated HideoutArea object
|
||||||
|
*/
|
||||||
|
protected updateWaterFilters(waterFilterArea: HideoutArea, production: Production, isGeneratorOn: boolean, pmcData: IPmcData): HideoutArea;
|
||||||
protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number): Upd;
|
protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number): Upd;
|
||||||
protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData): HideoutArea;
|
protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData): void;
|
||||||
protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production;
|
protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production;
|
||||||
protected getBTCSlots(pmcData: IPmcData): number;
|
protected getBTCSlots(pmcData: IPmcData): number;
|
||||||
protected getManagementSkillsSlots(): number;
|
protected getManagementSkillsSlots(): number;
|
||||||
|
@ -18,18 +18,6 @@ export declare class InRaidHelper {
|
|||||||
protected paymentHelper: PaymentHelper;
|
protected paymentHelper: PaymentHelper;
|
||||||
protected profileFixerService: ProfileFixerService;
|
protected profileFixerService: ProfileFixerService;
|
||||||
constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, paymentHelper: PaymentHelper, profileFixerService: ProfileFixerService);
|
constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, paymentHelper: PaymentHelper, profileFixerService: ProfileFixerService);
|
||||||
/**
|
|
||||||
* Reset the SPT inraid property stored in a profile to 'none'
|
|
||||||
* @param sessionID Session id
|
|
||||||
*/
|
|
||||||
protected removePlayer(sessionID: string): void;
|
|
||||||
/**
|
|
||||||
* Some maps have one-time-use keys (e.g. Labs
|
|
||||||
* Remove the relevant key from an inventory based on the post-raid request data passed in
|
|
||||||
* @param offraidData post-raid data
|
|
||||||
* @param sessionID Session id
|
|
||||||
*/
|
|
||||||
protected removeMapAccessKey(offraidData: ISaveProgressRequestData, sessionID: string): void;
|
|
||||||
/**
|
/**
|
||||||
* Check an array of items and add an upd object to money items with a stack count of 1
|
* Check an array of items and add an upd object to money items with a stack count of 1
|
||||||
* Single stack money items have no upd object and thus no StackObjectsCount, causing issues
|
* Single stack money items have no upd object and thus no StackObjectsCount, causing issues
|
||||||
@ -54,6 +42,18 @@ export declare class InRaidHelper {
|
|||||||
* @returns Reset profile object
|
* @returns Reset profile object
|
||||||
*/
|
*/
|
||||||
updateProfileBaseStats(profileData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionID: string): IPmcData;
|
updateProfileBaseStats(profileData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionID: string): IPmcData;
|
||||||
|
/**
|
||||||
|
* Some maps have one-time-use keys (e.g. Labs
|
||||||
|
* Remove the relevant key from an inventory based on the post-raid request data passed in
|
||||||
|
* @param offraidData post-raid data
|
||||||
|
* @param sessionID Session id
|
||||||
|
*/
|
||||||
|
protected removeMapAccessKey(offraidData: ISaveProgressRequestData, sessionID: string): void;
|
||||||
|
/**
|
||||||
|
* Set the SPT inraid location Profile property to 'none'
|
||||||
|
* @param sessionID Session id
|
||||||
|
*/
|
||||||
|
protected setPlayerInRaidLocationStatusToNone(sessionID: string): void;
|
||||||
/**
|
/**
|
||||||
* Adds SpawnedInSession property to items found in a raid
|
* Adds SpawnedInSession property to items found in a raid
|
||||||
* Removes SpawnedInSession for non-scav players if item was taken into raid with SpawnedInSession = true
|
* Removes SpawnedInSession for non-scav players if item was taken into raid with SpawnedInSession = true
|
||||||
@ -95,5 +95,10 @@ export declare class InRaidHelper {
|
|||||||
* @returns true if item is kept after death
|
* @returns true if item is kept after death
|
||||||
*/
|
*/
|
||||||
isItemKeptAfterDeath(slotId: string): boolean;
|
isItemKeptAfterDeath(slotId: string): boolean;
|
||||||
|
/**
|
||||||
|
* Return the equipped items from a players inventory
|
||||||
|
* @param items Players inventory to search through
|
||||||
|
* @returns an array of equipped items
|
||||||
|
*/
|
||||||
getPlayerGear(items: Item[]): Item[];
|
getPlayerGear(items: Item[]): Item[];
|
||||||
}
|
}
|
||||||
|
@ -1,35 +1,30 @@
|
|||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||||
import { InsuredItem } from "../models/eft/common/tables/IBotBase";
|
import { InsuredItem } from "../models/eft/common/tables/IBotBase";
|
||||||
import { Item, Repairable } from "../models/eft/common/tables/IItem";
|
import { Item, Repairable } from "../models/eft/common/tables/IItem";
|
||||||
|
import { IStaticAmmoDetails } from "../models/eft/common/tables/ILootBase";
|
||||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { ILogger } from "../models/spt/utils/ILogger";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
import { HashUtil } from "../utils/HashUtil";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { JsonUtil } from "../utils/JsonUtil";
|
||||||
|
import { MathUtil } from "../utils/MathUtil";
|
||||||
|
import { ObjectId } from "../utils/ObjectId";
|
||||||
|
import { RandomUtil } from "../utils/RandomUtil";
|
||||||
declare class ItemHelper {
|
declare class ItemHelper {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected hashUtil: HashUtil;
|
protected hashUtil: HashUtil;
|
||||||
protected jsonUtil: JsonUtil;
|
protected jsonUtil: JsonUtil;
|
||||||
|
protected randomUtil: RandomUtil;
|
||||||
|
protected objectId: ObjectId;
|
||||||
|
protected mathUtil: MathUtil;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseServer: DatabaseServer;
|
||||||
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer);
|
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer);
|
||||||
/**
|
/**
|
||||||
* Checks if a id is a valid item. Valid meaning that it's an item that be stored in stash
|
* Checks if a id is a valid item. Valid meaning that it's an item that be stored in stash
|
||||||
* @param {string} tpl the template id / tpl
|
* @param {string} tpl the template id / tpl
|
||||||
* @returns boolean; true for items that may be in player posession and not quest items
|
* @returns boolean; true for items that may be in player posession and not quest items
|
||||||
*/
|
*/
|
||||||
isValidItem(tpl: string, invalidBaseTypes?: string[]): boolean;
|
isValidItem(tpl: string, invalidBaseTypes?: string[]): boolean;
|
||||||
/**
|
|
||||||
* Checks if an id is a valid item. Valid meaning that it's an item that may be a reward
|
|
||||||
* or content of bot loot. Items that are tested as valid may be in a player backpack or stash.
|
|
||||||
* @param {*} tpl template id of item to check
|
|
||||||
* @returns boolean: true if item is valid reward
|
|
||||||
*/
|
|
||||||
isValidRewardItem(tpl: string): boolean;
|
|
||||||
/**
|
|
||||||
* Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable)
|
|
||||||
* @returns a list of rewardable items [[_tpl, itemTemplate],...]
|
|
||||||
*/
|
|
||||||
getRewardableItems(): [string, ITemplateItem][];
|
|
||||||
/**
|
/**
|
||||||
* Check if the tpl / template Id provided is a descendent of the baseclass
|
* Check if the tpl / template Id provided is a descendent of the baseclass
|
||||||
*
|
*
|
||||||
@ -196,6 +191,22 @@ declare class ItemHelper {
|
|||||||
* @returns ItemSize object (width and height)
|
* @returns ItemSize object (width and height)
|
||||||
*/
|
*/
|
||||||
getItemSize(items: Item[], rootItemId: string): ItemHelper.ItemSize;
|
getItemSize(items: Item[], rootItemId: string): ItemHelper.ItemSize;
|
||||||
|
/**
|
||||||
|
* Get a random cartridge from an items Filter property
|
||||||
|
* @param item
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string;
|
||||||
|
createRandomMagCartridges(magTemplate: ITemplateItem, parentId: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, caliber?: string): Item;
|
||||||
|
protected getRandomValidCaliber(magTemplate: ITemplateItem): string;
|
||||||
|
protected drawAmmoTpl(caliber: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>): string;
|
||||||
|
createCartidges(parentId: string, ammoTpl: string, stackCount: number): Item;
|
||||||
|
/**
|
||||||
|
* Get the size of a stack, return 1 if no stack object count property found
|
||||||
|
* @param item Item to get stack size of
|
||||||
|
* @returns size of stack
|
||||||
|
*/
|
||||||
|
getItemStackSize(item: Item): number;
|
||||||
}
|
}
|
||||||
declare namespace ItemHelper {
|
declare namespace ItemHelper {
|
||||||
interface ItemSize {
|
interface ItemSize {
|
||||||
|
@ -24,6 +24,19 @@ export declare class ProfileHelper {
|
|||||||
constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, fenceService: FenceService);
|
constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, fenceService: FenceService);
|
||||||
resetProfileQuestCondition(sessionID: string, conditionId: string): void;
|
resetProfileQuestCondition(sessionID: string, conditionId: string): void;
|
||||||
getCompleteProfile(sessionID: string): IPmcData[];
|
getCompleteProfile(sessionID: string): IPmcData[];
|
||||||
|
/**
|
||||||
|
* Fix xp doubling on post-raid xp reward screen by sending a 'dummy' profile to the post-raid screen
|
||||||
|
* Server saves the post-raid changes prior to the xp screen getting the profile, this results in the xp screen using
|
||||||
|
* the now updated profile values as a base, meaning it shows x2 xp gained
|
||||||
|
* Instead, clone the post-raid profile (so we dont alter its values), apply the pre-raid xp values to the cloned objects and return
|
||||||
|
* Delete snapshot of pre-raid profile prior to returning profile data
|
||||||
|
* @param sessionId Session id
|
||||||
|
* @param output pmc and scav profiles array
|
||||||
|
* @param pmcProfile post-raid pmc profile
|
||||||
|
* @param scavProfile post-raid scav profile
|
||||||
|
* @returns updated profile array
|
||||||
|
*/
|
||||||
|
protected postRaidXpWorkaroundFix(sessionId: string, output: IPmcData[], pmcProfile: IPmcData, scavProfile: IPmcData): IPmcData[];
|
||||||
isNicknameTaken(info: IValidateNicknameRequestData, sessionID: string): boolean;
|
isNicknameTaken(info: IValidateNicknameRequestData, sessionID: string): boolean;
|
||||||
/**
|
/**
|
||||||
* Add experience to a PMC inside the players profile
|
* Add experience to a PMC inside the players profile
|
||||||
|
@ -36,11 +36,20 @@ export declare class QuestHelper {
|
|||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected questConfig: IQuestConfig;
|
protected questConfig: IQuestConfig;
|
||||||
constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, configServer: ConfigServer);
|
constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, configServer: ConfigServer);
|
||||||
questStatus(pmcData: IPmcData, questID: string): QuestStatus;
|
|
||||||
/**
|
/**
|
||||||
* returns true is the condition is satisfied
|
* Get status of a quest by quest id
|
||||||
|
* @param pmcData Profile to search
|
||||||
|
* @param questID Quest id to look up
|
||||||
|
* @returns QuestStauts enum
|
||||||
|
*/
|
||||||
|
getQuestStatus(pmcData: IPmcData, questID: string): QuestStatus;
|
||||||
|
/**
|
||||||
|
* returns true is the level condition is satisfied
|
||||||
|
* @param playerLevel Players level
|
||||||
|
* @param condition Quest condition
|
||||||
|
* @returns true if player level is greater than or equal to quest
|
||||||
*/
|
*/
|
||||||
evaluateLevel(pmcProfile: IPmcData, cond: AvailableForConditions): boolean;
|
doesPlayerLevelFulfilCondition(playerLevel: number, condition: AvailableForConditions): boolean;
|
||||||
getDeltaQuests(before: IQuest[], after: IQuest[]): IQuest[];
|
getDeltaQuests(before: IQuest[], after: IQuest[]): IQuest[];
|
||||||
/**
|
/**
|
||||||
* Increase skill points of a skill on player profile
|
* Increase skill points of a skill on player profile
|
||||||
|
@ -22,12 +22,14 @@ import { ProfileHelper } from "./ProfileHelper";
|
|||||||
import { RagfairHelper } from "./RagfairHelper";
|
import { RagfairHelper } from "./RagfairHelper";
|
||||||
import { RagfairServerHelper } from "./RagfairServerHelper";
|
import { RagfairServerHelper } from "./RagfairServerHelper";
|
||||||
import { RagfairSortHelper } from "./RagfairSortHelper";
|
import { RagfairSortHelper } from "./RagfairSortHelper";
|
||||||
|
import { TraderHelper } from "./TraderHelper";
|
||||||
export declare class RagfairOfferHelper {
|
export declare class RagfairOfferHelper {
|
||||||
protected logger: ILogger;
|
protected logger: ILogger;
|
||||||
protected timeUtil: TimeUtil;
|
protected timeUtil: TimeUtil;
|
||||||
protected hashUtil: HashUtil;
|
protected hashUtil: HashUtil;
|
||||||
protected itemEventRouter: ItemEventRouter;
|
protected itemEventRouter: ItemEventRouter;
|
||||||
protected databaseServer: DatabaseServer;
|
protected databaseServer: DatabaseServer;
|
||||||
|
protected traderHelper: TraderHelper;
|
||||||
protected saveServer: SaveServer;
|
protected saveServer: SaveServer;
|
||||||
protected dialogueHelper: DialogueHelper;
|
protected dialogueHelper: DialogueHelper;
|
||||||
protected itemHelper: ItemHelper;
|
protected itemHelper: ItemHelper;
|
||||||
@ -43,10 +45,10 @@ export declare class RagfairOfferHelper {
|
|||||||
protected static goodSoldTemplate: string;
|
protected static goodSoldTemplate: string;
|
||||||
protected ragfairConfig: IRagfairConfig;
|
protected ragfairConfig: IRagfairConfig;
|
||||||
protected questConfig: IQuestConfig;
|
protected questConfig: IQuestConfig;
|
||||||
constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer);
|
constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer);
|
||||||
getValidOffers(info: ISearchRequestData, itemsToAdd: string[], assorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[];
|
getValidOffers(info: ISearchRequestData, itemsToAdd: string[], assorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[];
|
||||||
getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[];
|
getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[];
|
||||||
processOffers(sessionID: string): boolean;
|
processOffersOnProfile(sessionID: string): boolean;
|
||||||
protected getProfileOffers(sessionID: string): IRagfairOffer[];
|
protected getProfileOffers(sessionID: string): IRagfairOffer[];
|
||||||
protected deleteOfferByOfferId(sessionID: string, offerId: string): void;
|
protected deleteOfferByOfferId(sessionID: string, offerId: string): void;
|
||||||
protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse;
|
protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse;
|
||||||
|
@ -11,6 +11,12 @@ export declare class RagfairSellHelper {
|
|||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected ragfairConfig: IRagfairConfig;
|
protected ragfairConfig: IRagfairConfig;
|
||||||
constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer);
|
constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer);
|
||||||
calculateSellChance(baseChance: number, offerPrice: number, requirementsPriceInRub: number): number;
|
calculateSellChance(baseChancePercent: number, offerPriceRub: number, playerListedPriceRub: number): number;
|
||||||
rollForSale(sellChance: number, count: number): SellResult[];
|
/**
|
||||||
|
* Determine if the offer being listed will be sold
|
||||||
|
* @param sellChancePercent chance item will sell
|
||||||
|
* @param itemSellCount count of items to sell
|
||||||
|
* @returns Array of purchases of item(s) lsited
|
||||||
|
*/
|
||||||
|
rollForSale(sellChancePercent: number, itemSellCount: number): SellResult[];
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
|
|||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { ConfigServer } from "../servers/ConfigServer";
|
||||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||||
import { SaveServer } from "../servers/SaveServer";
|
import { SaveServer } from "../servers/SaveServer";
|
||||||
|
import { ItemFilterService } from "../services/ItemFilterService";
|
||||||
import { LocaleService } from "../services/LocaleService";
|
import { LocaleService } from "../services/LocaleService";
|
||||||
import { HashUtil } from "../utils/HashUtil";
|
import { HashUtil } from "../utils/HashUtil";
|
||||||
import { JsonUtil } from "../utils/JsonUtil";
|
import { JsonUtil } from "../utils/JsonUtil";
|
||||||
@ -13,6 +14,9 @@ import { RandomUtil } from "../utils/RandomUtil";
|
|||||||
import { DialogueHelper } from "./DialogueHelper";
|
import { DialogueHelper } from "./DialogueHelper";
|
||||||
import { ItemHelper } from "./ItemHelper";
|
import { ItemHelper } from "./ItemHelper";
|
||||||
import { ProfileHelper } from "./ProfileHelper";
|
import { ProfileHelper } from "./ProfileHelper";
|
||||||
|
/**
|
||||||
|
* Helper class for common ragfair server actions
|
||||||
|
*/
|
||||||
export declare class RagfairServerHelper {
|
export declare class RagfairServerHelper {
|
||||||
protected randomUtil: RandomUtil;
|
protected randomUtil: RandomUtil;
|
||||||
protected hashUtil: HashUtil;
|
protected hashUtil: HashUtil;
|
||||||
@ -23,11 +27,12 @@ export declare class RagfairServerHelper {
|
|||||||
protected localeService: LocaleService;
|
protected localeService: LocaleService;
|
||||||
protected dialogueHelper: DialogueHelper;
|
protected dialogueHelper: DialogueHelper;
|
||||||
protected jsonUtil: JsonUtil;
|
protected jsonUtil: JsonUtil;
|
||||||
|
protected itemFilterService: ItemFilterService;
|
||||||
protected configServer: ConfigServer;
|
protected configServer: ConfigServer;
|
||||||
protected ragfairConfig: IRagfairConfig;
|
protected ragfairConfig: IRagfairConfig;
|
||||||
protected questConfig: IQuestConfig;
|
protected questConfig: IQuestConfig;
|
||||||
protected static goodsReturnedTemplate: string;
|
protected static goodsReturnedTemplate: string;
|
||||||
constructor(randomUtil: RandomUtil, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, jsonUtil: JsonUtil, configServer: ConfigServer);
|
constructor(randomUtil: RandomUtil, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, jsonUtil: JsonUtil, itemFilterService: ItemFilterService, configServer: ConfigServer);
|
||||||
/**
|
/**
|
||||||
* Is item valid / on blacklist / quest item
|
* Is item valid / on blacklist / quest item
|
||||||
* @param itemDetails
|
* @param itemDetails
|
||||||
|
@ -39,6 +39,12 @@ export declare class TradeHelper {
|
|||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
sellItem(pmcData: IPmcData, body: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse;
|
sellItem(pmcData: IPmcData, body: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse;
|
||||||
|
/**
|
||||||
|
* Increment the assorts buy count by number of items purchased
|
||||||
|
* Show error on screen if player attepts to buy more than what the buy max allows
|
||||||
|
* @param assortBeingPurchased assort being bought
|
||||||
|
* @param itemsPurchasedCount number of items being bought
|
||||||
|
*/
|
||||||
protected incrementAssortBuyCount(assortBeingPurchased: Item, itemsPurchasedCount: number): void;
|
protected incrementAssortBuyCount(assortBeingPurchased: Item, itemsPurchasedCount: number): void;
|
||||||
protected checkPurchaseIsWithinTraderItemLimit(assortBeingPurchased: Item, assortId: string, count: number): void;
|
protected checkPurchaseIsWithinTraderItemLimit(assortBeingPurchased: Item, assortId: string, count: number): void;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { RagfairAssortGenerator } from "../generators/RagfairAssortGenerator";
|
import { RagfairAssortGenerator } from "../generators/RagfairAssortGenerator";
|
||||||
import { RagfairOfferGenerator } from "../generators/RagfairOfferGenerator";
|
import { RagfairOfferGenerator } from "../generators/RagfairOfferGenerator";
|
||||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
|
||||||
import { Item } from "../models/eft/common/tables/IItem";
|
import { Item } from "../models/eft/common/tables/IItem";
|
||||||
import { ITrader, ITraderAssort } from "../models/eft/common/tables/ITrader";
|
import { ITrader, ITraderAssort } from "../models/eft/common/tables/ITrader";
|
||||||
import { ITraderConfig } from "../models/spt/config/ITraderConfig";
|
import { ITraderConfig } from "../models/spt/config/ITraderConfig";
|
||||||
@ -41,12 +40,7 @@ export declare class TraderAssortHelper {
|
|||||||
* @param traderId traders id
|
* @param traderId traders id
|
||||||
* @returns a traders' assorts
|
* @returns a traders' assorts
|
||||||
*/
|
*/
|
||||||
getAssort(sessionId: string, traderId: string): ITraderAssort;
|
getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort;
|
||||||
/**
|
|
||||||
* if the fence assorts have expired, re-generate them
|
|
||||||
* @param pmcProfile Players profile
|
|
||||||
*/
|
|
||||||
refreshFenceAssortIfExpired(pmcProfile: IPmcData): void;
|
|
||||||
/**
|
/**
|
||||||
* Reset a traders assorts and move nextResupply value to future
|
* Reset a traders assorts and move nextResupply value to future
|
||||||
* Flag trader as needing a flea offer reset to be picked up by flea update() function
|
* Flag trader as needing a flea offer reset to be picked up by flea update() function
|
||||||
|
@ -65,7 +65,7 @@ export declare class TraderHelper {
|
|||||||
* @param item
|
* @param item
|
||||||
* @returns boolean
|
* @returns boolean
|
||||||
*/
|
*/
|
||||||
protected isWeaponAndBelowTraderBuyDurability(traderID: string, item: Item): boolean;
|
protected isWeaponBelowTraderBuyDurability(traderID: string, item: Item): boolean;
|
||||||
/**
|
/**
|
||||||
* Get the price of an item and all of its attached children
|
* Get the price of an item and all of its attached children
|
||||||
* Take into account bonuses/adjsutments e.g. discounts
|
* Take into account bonuses/adjsutments e.g. discounts
|
||||||
|
@ -34,6 +34,7 @@ export interface Props {
|
|||||||
LootExperience?: number;
|
LootExperience?: number;
|
||||||
ExamineExperience?: number;
|
ExamineExperience?: number;
|
||||||
HideEntrails?: boolean;
|
HideEntrails?: boolean;
|
||||||
|
InsuranceDisabled?: boolean;
|
||||||
RepairCost?: number;
|
RepairCost?: number;
|
||||||
RepairSpeed?: number;
|
RepairSpeed?: number;
|
||||||
ExtraSizeLeft?: number;
|
ExtraSizeLeft?: number;
|
||||||
@ -206,6 +207,7 @@ export interface Props {
|
|||||||
IsOneoff?: boolean;
|
IsOneoff?: boolean;
|
||||||
MustBoltBeOpennedForExternalReload?: boolean;
|
MustBoltBeOpennedForExternalReload?: boolean;
|
||||||
MustBoltBeOpennedForInternalReload?: boolean;
|
MustBoltBeOpennedForInternalReload?: boolean;
|
||||||
|
NoFiremodeOnBoltcatch?: boolean;
|
||||||
BoltAction?: boolean;
|
BoltAction?: boolean;
|
||||||
HipAccuracyRestorationDelay?: number;
|
HipAccuracyRestorationDelay?: number;
|
||||||
HipAccuracyRestorationSpeed?: number;
|
HipAccuracyRestorationSpeed?: number;
|
||||||
|
@ -67,6 +67,7 @@ export interface IBarterScheme {
|
|||||||
count: number;
|
count: number;
|
||||||
_tpl: string;
|
_tpl: string;
|
||||||
onlyFunctional?: boolean;
|
onlyFunctional?: boolean;
|
||||||
|
sptQuestLocked?: boolean;
|
||||||
}
|
}
|
||||||
export interface ISuit {
|
export interface ISuit {
|
||||||
_id: string;
|
_id: string;
|
||||||
|
@ -15,6 +15,8 @@ export interface IRagfairOffer {
|
|||||||
name?: string;
|
name?: string;
|
||||||
shortName?: string;
|
shortName?: string;
|
||||||
loyaltyLevel: number;
|
loyaltyLevel: number;
|
||||||
|
buyRestrictionMax?: number;
|
||||||
|
buyRestrictionCurrent?: number;
|
||||||
locked: boolean;
|
locked: boolean;
|
||||||
unlimitedCount: boolean;
|
unlimitedCount: boolean;
|
||||||
summaryCost: number;
|
summaryCost: number;
|
||||||
|
@ -23,7 +23,7 @@ export declare enum Ammo762x54 {
|
|||||||
BT_GZH = "5e023d34e8a400319a28ed44",
|
BT_GZH = "5e023d34e8a400319a28ed44",
|
||||||
BS_GZH = "5e023d48186a883be655e551"
|
BS_GZH = "5e023d48186a883be655e551"
|
||||||
}
|
}
|
||||||
export declare enum Ammo338Lapua {
|
export declare enum Ammo86x70 {
|
||||||
TAC_X = "5fc382b6d6fa9c00c571bbc3",
|
TAC_X = "5fc382b6d6fa9c00c571bbc3",
|
||||||
UCW = "5fc382c1016cce60e8341b20",
|
UCW = "5fc382c1016cce60e8341b20",
|
||||||
AP = "5fc382a9d724d907e2077dab",
|
AP = "5fc382a9d724d907e2077dab",
|
||||||
@ -85,13 +85,13 @@ export declare enum Ammo9x21 {
|
|||||||
PE_GZH = "5a26ac06c4a282000c5a90a8",
|
PE_GZH = "5a26ac06c4a282000c5a90a8",
|
||||||
BT_GZH = "5a26ac0ec4a28200741e1e18"
|
BT_GZH = "5a26ac0ec4a28200741e1e18"
|
||||||
}
|
}
|
||||||
export declare enum Ammo357Mag {
|
export declare enum Ammo9x33R {
|
||||||
FMJ = "62330b3ed4dc74626d570b95",
|
FMJ = "62330b3ed4dc74626d570b95",
|
||||||
HOLLOW_POINT = "62330bfadc5883093563729b",
|
HOLLOW_POINT = "62330bfadc5883093563729b",
|
||||||
SOFT_POINT = "62330c40bdd19b369e1e53d1",
|
SOFT_POINT = "62330c40bdd19b369e1e53d1",
|
||||||
JACKET_HP = "62330c18744e5e31df12f516"
|
JACKET_HP = "62330c18744e5e31df12f516"
|
||||||
}
|
}
|
||||||
export declare enum Ammo45ACP {
|
export declare enum Ammo1143x23ACP {
|
||||||
MATCH_FMJ = "5e81f423763d9f754677bf2e",
|
MATCH_FMJ = "5e81f423763d9f754677bf2e",
|
||||||
HYDRA_SHOK = "5efb0fc6aeb21837e749c801",
|
HYDRA_SHOK = "5efb0fc6aeb21837e749c801",
|
||||||
LASERMATCH_FMJ = "5efb0d4f4bc50b58e81710f3",
|
LASERMATCH_FMJ = "5efb0d4f4bc50b58e81710f3",
|
||||||
@ -126,7 +126,7 @@ export declare enum Ammo556x45 {
|
|||||||
MK_318_MOD_0_SOST = "60194943740c5d77f6705eea",
|
MK_318_MOD_0_SOST = "60194943740c5d77f6705eea",
|
||||||
SSA_AP = "601949593ae8f707c4608daa"
|
SSA_AP = "601949593ae8f707c4608daa"
|
||||||
}
|
}
|
||||||
export declare enum Ammo300Blackout {
|
export declare enum Ammo762x35 {
|
||||||
M62_TRACER = "619636be6db0f2477964e710",
|
M62_TRACER = "619636be6db0f2477964e710",
|
||||||
BCP_FMJ = "5fbe3ffdf8b6a877a729ea82",
|
BCP_FMJ = "5fbe3ffdf8b6a877a729ea82",
|
||||||
AP = "5fd20ff893a8961fc660a954",
|
AP = "5fd20ff893a8961fc660a954",
|
||||||
|
@ -68,6 +68,7 @@ export declare enum BaseClasses {
|
|||||||
ASSAULT_SCOPE = "55818add4bdc2d5b648b456f",
|
ASSAULT_SCOPE = "55818add4bdc2d5b648b456f",
|
||||||
REFLEX_SIGHT = "55818ad54bdc2ddc698b4569",
|
REFLEX_SIGHT = "55818ad54bdc2ddc698b4569",
|
||||||
TACTICAL_COMBO = "55818b164bdc2ddc698b456c",
|
TACTICAL_COMBO = "55818b164bdc2ddc698b456c",
|
||||||
|
FLASHLIGHT = "55818b084bdc2d5b648b4571",
|
||||||
MAGAZINE = "5448bc234bdc2d3c308b4569",
|
MAGAZINE = "5448bc234bdc2d3c308b4569",
|
||||||
LIGHT_LASER = "55818b0e4bdc2dde698b456e",
|
LIGHT_LASER = "55818b0e4bdc2dde698b456e",
|
||||||
FLASH_HIDER = "550aa4bf4bdc2dd6348b456b",
|
FLASH_HIDER = "550aa4bf4bdc2dd6348b456b",
|
||||||
|
@ -8,6 +8,7 @@ export declare enum ConfigTypes {
|
|||||||
IN_RAID = "aki-inraid",
|
IN_RAID = "aki-inraid",
|
||||||
INSURANCE = "aki-insurance",
|
INSURANCE = "aki-insurance",
|
||||||
INVENTORY = "aki-inventory",
|
INVENTORY = "aki-inventory",
|
||||||
|
ITEM = "aki-item",
|
||||||
LOCALE = "aki-locale",
|
LOCALE = "aki-locale",
|
||||||
LOCATION = "aki-location",
|
LOCATION = "aki-location",
|
||||||
MATCH = "aki-match",
|
MATCH = "aki-match",
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
export declare enum ELocationName {
|
export declare enum ELocationName {
|
||||||
FACTORY_DAY = "factory4_day",
|
FACTORY_DAY = "factory4_day",
|
||||||
|
FACTORY_NIGHT = "factory4_night",
|
||||||
BIGMAP = "bigmap",
|
BIGMAP = "bigmap",
|
||||||
WOODS = "Woods",
|
WOODS = "Woods",
|
||||||
SHORELINE = "Shoreline",
|
SHORELINE = "Shoreline",
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user