Skip to main content
The Deno 2 Release Candidate is here
Learn more
class PMCLootGenerator
import { PMCLootGenerator } from "https://deno.land/x/sptaki@1.2.0/generators/mod.ts";

Handle the generation of dynamic PMC loot in pockets and backpacks and the removal of blacklisted items

Constructors

new
PMCLootGenerator(
itemHelper: ItemHelper,
databaseServer: DatabaseServer,
configServer: ConfigServer,
itemFilterService: ItemFilterService,
ragfairPriceService: RagfairPriceService,
seasonalEventService: SeasonalEventService,
weightedRandomHelper: WeightedRandomHelper,
)

Properties

protected
backpackLootPool: Record<string, number>
protected
configServer: ConfigServer
protected
databaseServer: DatabaseServer
protected
itemFilterService: ItemFilterService
protected
itemHelper: ItemHelper
protected
pmcConfig: IPmcConfig
protected
pocketLootPool: Record<string, number>
protected
ragfairPriceService: RagfairPriceService
protected
roubleTpl: string
protected
seasonalEventService: SeasonalEventService
protected
vestLootPool: Record<string, number>
protected
weightedRandomHelper: WeightedRandomHelper

Methods

protected
itemFitsInto2By2Slot(item: ITemplateItem): boolean

Check if item has a width/height that lets it fit into a 2x2 slot 1x1 / 1x2 / 2x1 / 2x2

generatePMCBackpackLootPool(botRole: string): Record<string, number>

Create an array of loot items a PMC can have in their backpack

generatePMCPocketLootPool(botRole: string): Record<string, number>

Create an array of loot items a PMC can have in their pockets

generatePMCVestLootPool(botRole: string): Record<string, number>

Create an array of loot items a PMC can have in their vests