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

Constructors

new
InventoryController(
logger: ILogger,
hashUtil: HashUtil,
jsonUtil: JsonUtil,
itemHelper: ItemHelper,
randomUtil: RandomUtil,
databaseServer: DatabaseServer,
fenceService: FenceService,
presetHelper: PresetHelper,
inventoryHelper: InventoryHelper,
questHelper: QuestHelper,
hideoutHelper: HideoutHelper,
ragfairOfferService: RagfairOfferService,
profileHelper: ProfileHelper,
paymentHelper: PaymentHelper,
localisationService: LocalisationService,
playerService: PlayerService,
lootGenerator: LootGenerator,
eventOutputHolder: EventOutputHolder,
httpResponseUtil: HttpResponseUtil,
)

Properties

protected
databaseServer: DatabaseServer
protected
eventOutputHolder: EventOutputHolder
protected
fenceService: FenceService
protected
hashUtil: HashUtil
protected
hideoutHelper: HideoutHelper
protected
httpResponseUtil: HttpResponseUtil
protected
inventoryHelper: InventoryHelper
protected
itemHelper: ItemHelper
protected
jsonUtil: JsonUtil
protected
localisationService: LocalisationService
protected
logger: ILogger
protected
lootGenerator: LootGenerator
protected
paymentHelper: PaymentHelper
protected
playerService: PlayerService
protected
presetHelper: PresetHelper
protected
profileHelper: ProfileHelper
protected
questHelper: QuestHelper
protected
ragfairOfferService: RagfairOfferService
protected
randomUtil: RandomUtil

Methods

Get a event router response with inventory trader message

protected
flagItemsAsInspectedAndRewardXp(itemTpls: string[], fullProfile: IAkiProfile): void

Get the tplid of an item from the examine request object

protected
sanitiseMapMarkerText(mapNoteText: string): string

Strip out characters from note string that are not: letter/numbers/unicode/spaces

bindItem(
pmcData: IPmcData,
sessionID: string,
): void

Bind an inventory item to the quick access menu at bottom of player screen Handle bind event

createMapMarker(
pmcData: IPmcData,
sessionID: string,
): void

Add note to a map

deleteMapMarker(
pmcData: IPmcData,
sessionID: string,
): void

Delete a map marker

discardItem(
pmcData: IPmcData,
sessionID: string,
): void

Handle Remove event Implements functionality "Discard" from Main menu (Stash etc.) Removes item from PMC Profile

editMapMarker(
pmcData: IPmcData,
sessionID: string,
): void

Edit an existing map marker

Handles examining an item

Handles folding of Weapons

Fully merge 2 inventory stacks together into one stack (merging where both stacks remain is called 'transfer') Deletes item from body.item and adding number of stacks into body.with

moveItem(
pmcData: IPmcData,
sessionID: string,
): void

Move Item change location of item with parentId and slotId transfers items from one profile to another if fromOwner/toOwner is set in the body. otherwise, move is contained within the same profile_f.

Handle OpenRandomLootContainer event Handle event fired when a container is unpacked (currently only the halloween pumpkin)

redeemProfileReward(
pmcData: IPmcData,
sessionId: string,
): void
setFavoriteItem(
pmcData: IPmcData,
sessionId: string,
): void
sortInventory(
pmcData: IPmcData,
sessionID: string,
): void

Handle ApplyInventoryChanges Sorts supplied items.

Split Item spliting 1 stack into 2

Swap Item its used for "reload" if you have weapon in hands and magazine is somewhere else in rig or backpack in equipment Also used to swap items using quick selection on character screen

Add a tag to an inventory item

Toggles "Toggleable" items like night vision goggles and face shields.

TODO: Adds no data to output to send to client, is this by design? Transfer items from one stack into another while keeping original stack Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload"

unbindItem(
pmcData: IPmcData,
sessionID: string,
): void

Unbind an inventory item from quick access menu at bottom of player screen Handle unbind event