diff --git a/project/assets/configs/bot.json b/project/assets/configs/bot.json index 88fd0a54..84e4a841 100644 --- a/project/assets/configs/bot.json +++ b/project/assets/configs/bot.json @@ -2343,5 +2343,18 @@ "tarkovstreets": 26, "sandbox": 16, "default": 16 - } + }, + "walletLoot": { + "itemCount": { + "min": 1, + "max": 3 + }, + "stackSizeWeight": { + "25000": 1, + "20000": 2, + "15000": 4, + "10000": 7, + "5000": 10 + } + } } diff --git a/project/src/generators/BotLootGenerator.ts b/project/src/generators/BotLootGenerator.ts index ec3b3e00..797cfcb9 100644 --- a/project/src/generators/BotLootGenerator.ts +++ b/project/src/generators/BotLootGenerator.ts @@ -397,6 +397,16 @@ export class BotLootGenerator } } + // Is Simple-Wallet + if (weightedItemTpl === "5783c43d2459774bbe137486") + { + const addCurrency = this.randomUtil.getChance100(25); + if (!addCurrency) + { + itemWithChildrenToAdd.push(...this.createWalletLoot(newRootItemId)); + } + } + this.addRequiredChildItemsToParent(itemToAddTemplate, itemWithChildrenToAdd, isPmc); // Attempt to add item to container(s) @@ -454,6 +464,29 @@ export class BotLootGenerator } } + protected createWalletLoot(walletId: string): Item[] + { + const result: Item[] = []; + + // Choose how many stacks of currency will be added to wallet + const itemCount = this.randomUtil.getInt(1, this.botConfig.walletLoot.itemCount); + for (let index = 0; index < itemCount; index++) + { + // Choose the size of the currency stack + const chosenStackCount = Number( + this.weightedRandomHelper.getWeightedValue(this.botConfig.walletLoot.stackSizeWeight), + ); + result.push({ + _id: this.hashUtil.generate(), + _tpl: "5449016a4bdc2d6f028b456f", // TODO - extend to be more than just roubles + parentId: walletId, + upd: { StackObjectsCount: chosenStackCount }, + }); + } + + return result; + } + /** * Some items need child items to function, add them to the itemToAddChildrenTo array * @param itemToAddTemplate Db template of item to check diff --git a/project/src/models/spt/config/IBotConfig.ts b/project/src/models/spt/config/IBotConfig.ts index 359ae446..3a787827 100644 --- a/project/src/models/spt/config/IBotConfig.ts +++ b/project/src/models/spt/config/IBotConfig.ts @@ -37,6 +37,8 @@ export interface IBotConfig extends IBaseConfig secureContainerAmmoStackCount: number; /** Bot roles in this array will be given a dog tag on generation */ botRolesWithDogTags: string[]; + /** Settings to control the items that get added into wallets on bots */ + walletLoot: IWalletLootSettings; } /** Number of bots to generate and store in cache on raid start per bot type */ @@ -80,6 +82,12 @@ export interface PresetBatch sptBear: number; } +export interface IWalletLootSettings +{ + itemCount: number; + stackSizeWeight: Record; +} + export interface EquipmentFilters { /** Limits for mod types per weapon .e.g. scopes */