Allow dogtags to be added to custom bots

This commit is contained in:
Dev 2024-01-17 22:17:12 +00:00
parent cef8cbadea
commit 04edb19f14
3 changed files with 11 additions and 6 deletions

View File

@ -311,6 +311,7 @@
},
"chanceAssaultScavHasPlayerScavName": 10,
"secureContainerAmmoStackCount": 20,
"botRolesWithDogTags": ["sptbear", "sptusec"],
"revenge": {
"assault": ["assault", "marksman", "gifter"],
"marksman": ["assault", "marksman", "gifter"],

View File

@ -218,10 +218,14 @@ export class BotGenerator
if (this.botHelper.isBotPmc(botRole))
{
this.getRandomisedGameVersionAndCategory(bot.Info);
bot = this.generateDogtag(bot);
bot.Info.IsStreamerModeAvailable = true; // Set to true so client patches can pick it up later - client sometimes alters botrole to assaultGroup
}
if (this.botConfig.botRolesWithDogTags.includes(botRole))
{
this.addDogtagToBot(bot);
}
// generate new bot ID
bot = this.generateId(bot);
@ -537,9 +541,9 @@ export class BotGenerator
* @param bot bot to add dogtag to
* @returns Bot with dogtag added
*/
protected generateDogtag(bot: IBotBase): IBotBase
protected addDogtagToBot(bot: IBotBase): void
{
const upd: Upd = {
const dogtagUpd: Upd = {
SpawnedInSession: true,
Dogtag: {
AccountId: bot.sessionId,
@ -562,11 +566,9 @@ export class BotGenerator
parentId: bot.Inventory.equipment,
slotId: "Dogtag",
location: undefined,
upd: upd,
upd: dogtagUpd,
};
bot.Inventory.items.push(inventoryItem);
return bot;
}
}

View File

@ -37,6 +37,8 @@ export interface IBotConfig extends IBaseConfig
chanceAssaultScavHasPlayerScavName: number;
/** How many stacks of secret ammo should a bot have in its bot secure container */
secureContainerAmmoStackCount: number;
/** Bot roles in this array will be given a dog tag on generation */
botRolesWithDogTags: string[];
}
/** Number of bots to generate and store in cache on raid start per bot type */