Add property to location config to allow adding bot min/max spawn limits for maps
Limit marksman on customs/woods/streets between 2 and 4, woods to 2 and 5
This commit is contained in:
parent
02d43d491c
commit
ca48f0e83c
@ -647,7 +647,13 @@
|
||||
"enabled": true,
|
||||
"ignoreMaps": ["base", "develop", "hideout", "privatearea", "suburbs", "terminal", "town"]
|
||||
},
|
||||
"fitLootIntoContainerAttempts": 2
|
||||
"fitLootIntoContainerAttempts": 2,
|
||||
"addOpenZonesToAllMaps": true,
|
||||
"addCustomBotWavesToMaps": true,
|
||||
"enableBotTypeLimits": true,
|
||||
"botTypeLimits": {
|
||||
"tarkovstreets": [{"type": "marksman", "min": 2, "max": 4}],
|
||||
"woods": [{"type": "marksman", "min": 2, "max": 5}],
|
||||
"bigmap": [{"type": "marksman", "min": 2, "max": 4}]
|
||||
}
|
||||
}
|
||||
|
@ -89,6 +89,11 @@ export class GameController
|
||||
this.customLocationWaveService.applyWaveChangesToAllMaps();
|
||||
}
|
||||
|
||||
if (this.locationConfig.enableBotTypeLimits)
|
||||
{
|
||||
this.adjustMapBotLimits();
|
||||
}
|
||||
|
||||
// repeatableQuests are stored by in profile.Quests due to the responses of the client (e.g. Quests in offraidData)
|
||||
// Since we don't want to clutter the Quests list, we need to remove all completed (failed / successful) repeatable quests.
|
||||
// We also have to remove the Counters from the repeatableQuests
|
||||
@ -167,6 +172,49 @@ export class GameController
|
||||
}
|
||||
}
|
||||
|
||||
protected adjustMapBotLimits(): void
|
||||
{
|
||||
const mapsDb = this.databaseServer.getTables().locations;
|
||||
if (!this.locationConfig.botTypeLimits)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (const mapId in this.locationConfig.botTypeLimits)
|
||||
{
|
||||
const map: ILocationData = mapsDb[mapId];
|
||||
if (!map)
|
||||
{
|
||||
this.logger.warning(`Unable to edit bot limits of map: ${mapId} as it cannot be found`);
|
||||
}
|
||||
|
||||
for (const botToLimit of this.locationConfig.botTypeLimits[mapId])
|
||||
{
|
||||
const index = map.base.MinMaxBots.findIndex(x => x.WildSpawnType === botToLimit.type);
|
||||
if (index !== -1)
|
||||
{
|
||||
// Existing bot type found in MinMaxBots array, edit
|
||||
const limitObjectToUpdate = map.base.MinMaxBots[index];
|
||||
limitObjectToUpdate.min = botToLimit.min;
|
||||
limitObjectToUpdate.max = botToLimit.max;
|
||||
}
|
||||
else
|
||||
{
|
||||
map.base.MinMaxBots.push(
|
||||
{
|
||||
// Bot type not found, add new object
|
||||
WildSpawnType: botToLimit.type,
|
||||
min: botToLimit.min,
|
||||
max: botToLimit.max
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle client/game/config
|
||||
*/
|
||||
|
@ -160,7 +160,7 @@ export interface BotLocationModifier
|
||||
|
||||
export interface MinMaxBot
|
||||
{
|
||||
WildSpawnType: WildSpawnType
|
||||
WildSpawnType: WildSpawnType | string
|
||||
max: number
|
||||
min: number
|
||||
}
|
||||
@ -250,5 +250,6 @@ export interface Wave
|
||||
export enum WildSpawnType
|
||||
{
|
||||
ASSAULT = "assault",
|
||||
MARKSMAN = "marksman"
|
||||
MARKSMAN = "marksman",
|
||||
PMCBOT = "pmcbot"
|
||||
}
|
@ -20,6 +20,9 @@ export interface ILocationConfig extends IBaseConfig
|
||||
addOpenZonesToAllMaps: boolean
|
||||
/** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves*/
|
||||
addCustomBotWavesToMaps: boolean
|
||||
enableBotTypeLimits: boolean
|
||||
/** Add limits to a maps base.MinMaxBots array*/
|
||||
botTypeLimits: Record<string, IBotTypeLimit[]>
|
||||
}
|
||||
|
||||
export interface IFixEmptyBotWavesSettings
|
||||
@ -47,6 +50,13 @@ export interface CustomWaves
|
||||
normal: Record<string, Wave[]>
|
||||
}
|
||||
|
||||
export interface IBotTypeLimit
|
||||
{
|
||||
type: string
|
||||
min: number
|
||||
max: number
|
||||
}
|
||||
|
||||
export interface LootMultiplier
|
||||
{
|
||||
bigmap: number
|
||||
|
Loading…
Reference in New Issue
Block a user