mirror of
https://github.com/sp-tarkov/server.git
synced 2025-02-13 09:50:43 -05:00
Add code to insert roubes into wallets on bots
This commit is contained in:
parent
cc0f543bdf
commit
9525953444
@ -2343,5 +2343,18 @@
|
|||||||
"tarkovstreets": 26,
|
"tarkovstreets": 26,
|
||||||
"sandbox": 16,
|
"sandbox": 16,
|
||||||
"default": 16
|
"default": 16
|
||||||
}
|
},
|
||||||
|
"walletLoot": {
|
||||||
|
"itemCount": {
|
||||||
|
"min": 1,
|
||||||
|
"max": 3
|
||||||
|
},
|
||||||
|
"stackSizeWeight": {
|
||||||
|
"25000": 1,
|
||||||
|
"20000": 2,
|
||||||
|
"15000": 4,
|
||||||
|
"10000": 7,
|
||||||
|
"5000": 10
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -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);
|
this.addRequiredChildItemsToParent(itemToAddTemplate, itemWithChildrenToAdd, isPmc);
|
||||||
|
|
||||||
// Attempt to add item to container(s)
|
// 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<string>(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
|
* Some items need child items to function, add them to the itemToAddChildrenTo array
|
||||||
* @param itemToAddTemplate Db template of item to check
|
* @param itemToAddTemplate Db template of item to check
|
||||||
|
@ -37,6 +37,8 @@ export interface IBotConfig extends IBaseConfig
|
|||||||
secureContainerAmmoStackCount: number;
|
secureContainerAmmoStackCount: number;
|
||||||
/** Bot roles in this array will be given a dog tag on generation */
|
/** Bot roles in this array will be given a dog tag on generation */
|
||||||
botRolesWithDogTags: string[];
|
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 */
|
/** Number of bots to generate and store in cache on raid start per bot type */
|
||||||
@ -80,6 +82,12 @@ export interface PresetBatch
|
|||||||
sptBear: number;
|
sptBear: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface IWalletLootSettings
|
||||||
|
{
|
||||||
|
itemCount: number;
|
||||||
|
stackSizeWeight: Record<string, number>;
|
||||||
|
}
|
||||||
|
|
||||||
export interface EquipmentFilters
|
export interface EquipmentFilters
|
||||||
{
|
{
|
||||||
/** Limits for mod types per weapon .e.g. scopes */
|
/** Limits for mod types per weapon .e.g. scopes */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user