Compare commits

..

No commits in common. "main" and "1.8.2" have entirely different histories.
main ... 1.8.2

11 changed files with 43 additions and 100 deletions

View File

@ -21,7 +21,7 @@
"pmc":
{
"chanceSameSideIsHostilePercent": 80,
"chanceSameSideIsHostile": 80,
"containersOnPMCs": true,
"isUsec": 50,
"lootNValue": 3,

View File

@ -110,8 +110,8 @@ export class Bots
// Adjusts the chance for PMC to spawn instead of the default bot type if configured outside of the default values.
if (this.modConfig.pmc.convertIntoPmcChance.assault.min != this.botConfig.pmc.convertIntoPmcChance.assault.min || this.modConfig.pmc.convertIntoPmcChance.assault.max != this.botConfig.pmc.convertIntoPmcChance.assault.max
|| this.modConfig.pmc.convertIntoPmcChance.cursedassault.min != this.botConfig.pmc.convertIntoPmcChance.cursedassault.min || this.modConfig.pmc.convertIntoPmcChance.cursedassault.max != this.botConfig.pmc.convertIntoPmcChance.cursedassault.max
|| this.modConfig.pmc.convertIntoPmcChance.pmcbot.min != this.botConfig.pmc.convertIntoPmcChance.pmcbot.min || this.modConfig.pmc.convertIntoPmcChance.pmcbot.max != this.botConfig.pmc.convertIntoPmcChance.pmcbot.max
|| this.modConfig.pmc.convertIntoPmcChance.exusec.min != this.botConfig.pmc.convertIntoPmcChance.exusec.min || this.modConfig.pmc.convertIntoPmcChance.exusec.max != this.botConfig.pmc.convertIntoPmcChance.exusec.max)
|| this.modConfig.pmc.convertIntoPmcChance.pmcBot.min != this.botConfig.pmc.convertIntoPmcChance.pmcBot.min || this.modConfig.pmc.convertIntoPmcChance.pmcBot.max != this.botConfig.pmc.convertIntoPmcChance.pmcBot.max
|| this.modConfig.pmc.convertIntoPmcChance.exUsec.min != this.botConfig.pmc.convertIntoPmcChance.exUsec.min || this.modConfig.pmc.convertIntoPmcChance.exUsec.max != this.botConfig.pmc.convertIntoPmcChance.exUsec.max)
{
this.adjustPmcChance();
this.logger.info("Chance to Convert Bots into PMC Patched");
@ -146,10 +146,10 @@ export class Bots
// Function to enable secured and common containers on PMCs.
private containersOnPMCs(): void
{
const backpackLoot = this.botConfig.pmc.backpackLoot.whitelist;
const dynaLoot = this.botConfig.pmc.dynamicLoot.whitelist;
backpackLoot.push("5448bf274bdc2dfc2f8b456a");
backpackLoot.push("5795f317245977243854e041");
dynaLoot.push("5448bf274bdc2dfc2f8b456a");
dynaLoot.push("5795f317245977243854e041");
}
private chooseRandomWeightedDifficulty(): string
@ -167,12 +167,12 @@ export class Bots
pmcConfig.assault.min = modConfig.assault.min;
pmcConfig.assault.max = modConfig.assault.max;
pmcConfig.cursedassault.min = modConfig.cursedassault.min;
pmcConfig.cursedassault.max = modConfig.cursedassault.max;
pmcConfig.pmcbot.min = modConfig.pmcbot.min;
pmcConfig.pmcbot.max = modConfig.pmcbot.max;
pmcConfig.exusec.min = modConfig.exusec.min;
pmcConfig.exusec.max = modConfig.exusec.max;
pmcConfig.cursedassault.min = modConfig.cursedAssault.min;
pmcConfig.cursedassault.max = modConfig.cursedAssault.max;
pmcConfig.pmcbot.min = modConfig.pmcBot.min;
pmcConfig.pmcbot.max = modConfig.pmcBot.max;
pmcConfig.exusec.min = modConfig.exUsec.min;
pmcConfig.exusec.max = modConfig.exUsec.max;
}

View File

@ -55,9 +55,9 @@ export class Loot
{
// Customs Marked Room Loot.
let spawnPoints = this.tables.getTables().locations.bigmap.looseLoot.spawnpoints;
const customsMarked1 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135 (10)"));
const customsMarked2 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135 (9)"));
const customsMarked3 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135 (8)"));
const customsMarked1 = spawnPoints.find(x=>x.template.Id==="Loot 135 (10)1137996");
const customsMarked2 = spawnPoints.find(x=>x.template.Id==="Loot 135 (9)1132486");
const customsMarked3 = spawnPoints.find(x=>x.template.Id==="Loot 135 (8)1141962");
// Pushing containers into the customs marked room loot pool.
customsMarked1.itemDistribution.push(...this.containers());
@ -67,15 +67,15 @@ export class Loot
// Reserve Marked Room Loot.
spawnPoints = this.tables.getTables().locations.rezervbase.looseLoot.spawnpoints;
const rsrvRBBK1 = spawnPoints.find(x=>x.template.Id==="Loot 135 (10)51646628");
const rsrvRBBK2 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135 (8)"));
const rsrvRBBK3 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135 (9)"));
const rsrvRBBK2 = spawnPoints.find(x=>x.template.Id==="Loot 135 (8)51666758");
const rsrvRBBK3 = spawnPoints.find(x=>x.template.Id==="Loot 135 (9)51636512");
const rsrvRBPKPM1 = spawnPoints.find(x=>x.template.Id.startsWith("cult_Loot 135 (11)"));
const rsrvRBPKPM2 = spawnPoints.find(x=>x.template.Id.startsWith("cult_Loot 135 (12)"));
const rsrvRBPKPM1 = spawnPoints.find(x=>x.template.Id==="cult_Loot 135 (11)51654030");
const rsrvRBPKPM2 = spawnPoints.find(x=>x.template.Id==="cult_Loot 135 (12)51653462");
const rsrvRBVO1 = spawnPoints.find(x=>x.template.Id==="Loot 135 (10)51658080");
const rsrvRBVO2 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135 (11)"));
const rsrvRBVO3 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135 (12)"));
const rsrvRBVO2 = spawnPoints.find(x=>x.template.Id==="Loot 135 (11)51652762");
const rsrvRBVO3 = spawnPoints.find(x=>x.template.Id==="Loot 135 (12)51652706");
// Pushing containers into the reserve base marked room loot pool.
rsrvRBBK1.itemDistribution.push(...this.containers());
@ -91,23 +91,23 @@ export class Loot
// Streets Marked Room Loot.
spawnPoints = this.tables.getTables().locations.tarkovstreets.looseLoot.spawnpoints;
const streets = spawnPoints.find(x=>x.template.Id==="Loot 135_Leo_Rare5491814");
const streets1 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135_Leo_Rare (1)"));
const streets2 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135_Leo_Rare (2)"));
const streets3 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135_Leo_Rare (3)"));
const streets4 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135_Leo_Rare (4)"));
const streets5 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135_Leo_Rare (5)"));
const streets = spawnPoints.find(x=>x.template.Id==="Loot 135_Leo_Rare3328366");
const streets1 = spawnPoints.find(x=>x.template.Id==="Loot 135_Leo_Rare (1)3332226");
const streets2 = spawnPoints.find(x=>x.template.Id==="Loot 135_Leo_Rare (2)3322128");
const streets3 = spawnPoints.find(x=>x.template.Id==="Loot 135_Leo_Rare (3)3810498");
const streets4 = spawnPoints.find(x=>x.template.Id==="Loot 135_Leo_Rare (4)3951260");
const streets5 = spawnPoints.find(x=>x.template.Id==="Loot 135_Leo_Rare (5)3325368");
const streets6 = spawnPoints.find(x=>x.template.Id==="Loot 135_Leo_Rare (6)3814146");
const streets6a = spawnPoints.find(x=>x.template.Id==="Loot 135_Leo_Rare (6)3955044");
const streets7 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135_Leo_Rare (7)"));
const streets8 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135_Leo_Rare (8)"));
const streets9 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135_Leo_Rare (9)"));
const streets7 = spawnPoints.find(x=>x.template.Id==="Loot 135_Leo_Rare (7)3811846");
const streets8 = spawnPoints.find(x=>x.template.Id==="Loot 135_Leo_Rare (8)3803698");
const streets9 = spawnPoints.find(x=>x.template.Id==="Loot 135_Leo_Rare (9)3826302");
const streets10 = spawnPoints.find(x=>x.template.Id==="Loot 135_Leo_Rare (10)5484984");
const streets11 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135_Leo_Rare (11)"));
const streets12 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135_Leo_Rare (12)"));
const streets13 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135_Leo_Rare (13)"));
const streets14 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135_Leo_Rare (14)"));
const streets15 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135_Leo_Rare (15)"));
const streets11 = spawnPoints.find(x=>x.template.Id==="Loot 135_Leo_Rare (11)3332946");
const streets12 = spawnPoints.find(x=>x.template.Id==="Loot 135_Leo_Rare (12)3804226");
const streets13 = spawnPoints.find(x=>x.template.Id==="Loot 135_Leo_Rare (13)3967988");
const streets14 = spawnPoints.find(x=>x.template.Id==="Loot 135_Leo_Rare (14)3809678");
const streets15 = spawnPoints.find(x=>x.template.Id==="Loot 135_Leo_Rare (15)3947696");
// Pushing containers into the streets marked room loot pool.
streets.itemDistribution.push(...this.containers());

View File

@ -42,13 +42,6 @@ export declare class TraderController {
* @returns array if ITraderBase objects
*/
getAllTraders(sessionID: string): ITraderBase[];
/**
* Order traders by their traderId (Ttid)
* @param traderA First trader to compare
* @param traderB Second trader to compare
* @returns 1,-1 or 0
*/
protected sortByTraderId(traderA: ITraderBase, traderB: ITraderBase): number;
getTrader(sessionID: string, traderID: string): ITraderBase;
getAssort(sessionId: string, traderId: string): ITraderAssort;
getPurchasesData(sessionID: string, traderID: string): Record<string, IBarterScheme[][]>;

View File

@ -14,14 +14,12 @@ import { SeasonalEventService } from "../services/SeasonalEventService";
import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
import { TimeUtil } from "../utils/TimeUtil";
import { BotInventoryGenerator } from "./BotInventoryGenerator";
import { BotLevelGenerator } from "./BotLevelGenerator";
export declare class BotGenerator {
protected logger: ILogger;
protected hashUtil: HashUtil;
protected randomUtil: RandomUtil;
protected timeUtil: TimeUtil;
protected jsonUtil: JsonUtil;
protected profileHelper: ProfileHelper;
protected databaseServer: DatabaseServer;
@ -34,7 +32,7 @@ export declare class BotGenerator {
protected seasonalEventService: SeasonalEventService;
protected configServer: ConfigServer;
protected botConfig: IBotConfig;
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer);
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer);
/**
* Generate a player scav bot object
* @param role e.g. assault / pmcbot

View File

@ -1,5 +1,4 @@
import { ItemHelper } from "../helpers/ItemHelper";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { IBotConfig } from "../models/spt/config/IBotConfig";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
@ -16,7 +15,6 @@ export declare class PMCLootGenerator {
protected itemFilterService: ItemFilterService;
protected seasonalEventService: SeasonalEventService;
protected pocketLootPool: string[];
protected vestLootPool: string[];
protected backpackLootPool: string[];
protected botConfig: IBotConfig;
constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService);
@ -25,18 +23,6 @@ export declare class PMCLootGenerator {
* @returns string array of tpls
*/
generatePMCPocketLootPool(): string[];
/**
* Create an array of loot items a PMC can have in their vests
* @returns string array of tpls
*/
generatePMCVestLootPool(): string[];
/**
* Check if item has a width/hide that lets it fit into a 1x2 slot
* 1x1 / 1x2 / 2x1
* @param item Item to check size of
* @returns true if it fits
*/
protected itemFitsInto1By2Slot(item: ITemplateItem): boolean;
/**
* Create an array of loot items a PMC can have in their backpack
* @returns string array of tpls

View File

@ -1,6 +1,5 @@
import { IPmcData } from "../models/eft/common/IPmcData";
import { ITraderAssort } from "../models/eft/common/tables/ITrader";
import { QuestStatus } from "../models/enums/QuestStatus";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
import { LocalisationService } from "../services/LocalisationService";
@ -16,22 +15,12 @@ export declare class AssortHelper {
/**
* Remove assorts from a trader that have not been unlocked yet
* @param pmcProfile player profile
* @param traderId traders id the assort belongs to
* @param traderAssorts All assort items from same trader
* @param mergedQuestAssorts Dict of quest assort to quest id unlocks for all traders
* @param traderId traders id
* @param assort assort items from a trader
* @param mergedQuestAssorts An object of quest assort to quest id unlocks for all traders
* @returns assort items minus locked quest assorts
*/
stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, traderAssorts: ITraderAssort, mergedQuestAssorts: Record<string, Record<string, string>>, flea?: boolean): ITraderAssort;
/**
* Get a quest id + the statuses quest can be in to unlock assort
* @param mergedQuestAssorts quest assorts to search for assort id
* @param assortId Assort to look for linked quest id
* @returns quest id + array of quest status the assort should show for
*/
protected getQuestIdAndStatusThatShowAssort(mergedQuestAssorts: Record<string, Record<string, string>>, assortId: string): {
questId: string;
status: QuestStatus[];
};
stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort, mergedQuestAssorts: Record<string, Record<string, string>>, flea?: boolean): ITraderAssort;
/**
* Remove assorts from a trader that have not been unlocked yet
* @param pmcProfile player profile

View File

@ -40,7 +40,7 @@ export declare class QuestHelper {
protected questConfig: IQuestConfig;
constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, traderHelper: TraderHelper, configServer: ConfigServer);
/**
* Get status of a quest in player profile by its id
* Get status of a quest by quest id
* @param pmcData Profile to search
* @param questID Quest id to look up
* @returns QuestStatus enum

View File

@ -47,22 +47,7 @@ export declare class RagfairOfferHelper {
protected questConfig: IQuestConfig;
constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, 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(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[];
/**
* Get offers from flea/traders specifically when building weapon preset
* @param searchRequest Search request data
* @param itemsToAdd string array of item tpls to search for
* @param traderAssorts All trader assorts player can access/buy
* @param pmcProfile Player profile
* @returns ITraderAssort
*/
getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[];
/**
* Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme
* @param offer Offer to check is quest locked
* @param traderAssorts all trader assorts for player
* @returns true if quest locked
*/
traderOfferItemQuestLocked(offer: IRagfairOffer, traderAssorts: Record<string, ITraderAssort>): boolean;
getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[];
/**
* Has a traders offer ran out of stock to sell to player
* @param offer Offer to check stock of

View File

@ -1,8 +1,5 @@
import { MinMax } from "../../common/MinMax";
export interface IPmcConfig {
vestLoot: SlotLootSettings;
pocketLoot: SlotLootSettings;
backpackLoot: SlotLootSettings;
dynamicLoot: DynamicLoot;
useDifficultyOverride: boolean;
difficulty: string;
@ -25,11 +22,8 @@ export interface PmcTypes {
usec: string;
bear: string;
}
export interface SlotLootSettings {
export interface DynamicLoot {
whitelist: string[];
blacklist: string[];
moneyStackLimits: Record<string, number>;
}
export interface DynamicLoot {
moneyStackLimits: Record<string, number>;
}

View File

@ -30,8 +30,6 @@ export interface Reputation {
}
export interface Dynamic {
purchasesAreFoundInRaid: boolean;
/** Use the highest trader price for an offer if its greater than the price in templates/prices.json */
useTraderPriceForOffersIfHigher: boolean;
barter: Barter;
offerAdjustment: OfferAdjustment;
expiredOfferThreshold: number;