Fixed example 3 using an incorrect config property

This commit is contained in:
Dev 2024-04-26 14:24:17 +01:00
parent 082d87ddc8
commit 361af8a9d3

View File

@ -4,29 +4,30 @@ import { IPostAkiLoadMod } from "@spt-aki/models/external/IPostAkiLoadMod";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes";
import { IBotConfig } from "@spt-aki/models/spt/config/IBotConfig";
import { ILocationConfig } from "@spt-aki/models/spt/config/ILocationConfig";
class Mod implements IPostAkiLoadMod
{
public postAkiLoad(container: DependencyContainer): void {
public postAkiLoad(container: DependencyContainer): void
{
// get logger
const logger = container.resolve<ILogger>("WinstonLogger");
// get the config server
// get the config server so we can get a config with it
const configServer = container.resolve<ConfigServer>("ConfigServer");
// Request bot config
// Required - ConfigTypes.BOT is the enum of the config we want, others include ConfigTypes.Airdrop
const botConfig = configServer.getConfig<IBotConfig>(ConfigTypes.BOT);
// Request the map location config
// Required - ConfigTypes.LOCATION is the enum of the config we want, others include ConfigTypes.Airdrop
const locationConfig: ILocationConfig = configServer.getConfig<ILocationConfig>(ConfigTypes.LOCATION);
// log the original pmc difficulty
logger.info(`here is the original bot pmc difficulty: ${botConfig.pmc.difficulty}`)
// Log the original customs loose loot multipler
logger.info(`Here is the original customs map loose loot multipler: ${locationConfig.looseLootMultiplier.bigmap}`)
// adjust the difficulty
botConfig.pmc.difficulty = "easy";
// Adjust the multipler (customs is called bigmap in bsg land)
locationConfig.looseLootMultiplier.bigmap = 10;
// log the new pmc difficulty
logger.info(`here is the altered bot pmc difficulty: ${botConfig.pmc.difficulty}`)
// Log the new multipler
logger.info(`Here is the altered customs map loose loot multipler: ${locationConfig.looseLootMultiplier.bigmap}`)
}
}