Allow dogtags to be added to custom bots
This commit is contained in:
parent
cef8cbadea
commit
04edb19f14
@ -311,6 +311,7 @@
|
|||||||
},
|
},
|
||||||
"chanceAssaultScavHasPlayerScavName": 10,
|
"chanceAssaultScavHasPlayerScavName": 10,
|
||||||
"secureContainerAmmoStackCount": 20,
|
"secureContainerAmmoStackCount": 20,
|
||||||
|
"botRolesWithDogTags": ["sptbear", "sptusec"],
|
||||||
"revenge": {
|
"revenge": {
|
||||||
"assault": ["assault", "marksman", "gifter"],
|
"assault": ["assault", "marksman", "gifter"],
|
||||||
"marksman": ["assault", "marksman", "gifter"],
|
"marksman": ["assault", "marksman", "gifter"],
|
||||||
|
@ -218,10 +218,14 @@ export class BotGenerator
|
|||||||
if (this.botHelper.isBotPmc(botRole))
|
if (this.botHelper.isBotPmc(botRole))
|
||||||
{
|
{
|
||||||
this.getRandomisedGameVersionAndCategory(bot.Info);
|
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
|
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
|
// generate new bot ID
|
||||||
bot = this.generateId(bot);
|
bot = this.generateId(bot);
|
||||||
|
|
||||||
@ -537,9 +541,9 @@ export class BotGenerator
|
|||||||
* @param bot bot to add dogtag to
|
* @param bot bot to add dogtag to
|
||||||
* @returns Bot with dogtag added
|
* @returns Bot with dogtag added
|
||||||
*/
|
*/
|
||||||
protected generateDogtag(bot: IBotBase): IBotBase
|
protected addDogtagToBot(bot: IBotBase): void
|
||||||
{
|
{
|
||||||
const upd: Upd = {
|
const dogtagUpd: Upd = {
|
||||||
SpawnedInSession: true,
|
SpawnedInSession: true,
|
||||||
Dogtag: {
|
Dogtag: {
|
||||||
AccountId: bot.sessionId,
|
AccountId: bot.sessionId,
|
||||||
@ -562,11 +566,9 @@ export class BotGenerator
|
|||||||
parentId: bot.Inventory.equipment,
|
parentId: bot.Inventory.equipment,
|
||||||
slotId: "Dogtag",
|
slotId: "Dogtag",
|
||||||
location: undefined,
|
location: undefined,
|
||||||
upd: upd,
|
upd: dogtagUpd,
|
||||||
};
|
};
|
||||||
|
|
||||||
bot.Inventory.items.push(inventoryItem);
|
bot.Inventory.items.push(inventoryItem);
|
||||||
|
|
||||||
return bot;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,8 @@ export interface IBotConfig extends IBaseConfig
|
|||||||
chanceAssaultScavHasPlayerScavName: number;
|
chanceAssaultScavHasPlayerScavName: number;
|
||||||
/** How many stacks of secret ammo should a bot have in its bot secure container */
|
/** How many stacks of secret ammo should a bot have in its bot secure container */
|
||||||
secureContainerAmmoStackCount: number;
|
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 */
|
/** Number of bots to generate and store in cache on raid start per bot type */
|
||||||
|
Loading…
Reference in New Issue
Block a user