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

Constructors

new
InRaidHelper(
logger: ILogger,
timeUtil: TimeUtil,
saveServer: SaveServer,
jsonUtil: JsonUtil,
itemHelper: ItemHelper,
databaseServer: DatabaseServer,
inventoryHelper: InventoryHelper,
profileHelper: ProfileHelper,
questHelper: QuestHelper,
paymentHelper: PaymentHelper,
localisationService: LocalisationService,
profileFixerService: ProfileFixerService,
configServer: ConfigServer,
randomUtil: RandomUtil,
)

Properties

protected
configServer: ConfigServer
protected
databaseServer: DatabaseServer
protected
inRaidConfig: IInRaidConfig
protected
inventoryHelper: InventoryHelper
protected
itemHelper: ItemHelper
protected
jsonUtil: JsonUtil
protected
localisationService: LocalisationService
protected
logger: ILogger
protected
lostOnDeathConfig: ILostOnDeathConfig
protected
paymentHelper: PaymentHelper
protected
profileFixerService: ProfileFixerService
protected
profileHelper: ProfileHelper
protected
questHelper: QuestHelper
protected
randomUtil: RandomUtil
protected
saveServer: SaveServer
protected
timeUtil: TimeUtil

Methods

protected
applyTraderStandingAdjustments(tradersServerProfile: Record<string, TraderInfo>, tradersClientProfile: Record<string, TraderInfo>): void

Adjust server trader settings if they differ from data sent by client

Get items in vest/pocket/backpack inventory containers (excluding children)

protected
getInventoryItemsLostOnDeath(pmcProfile: IPmcData): Item[]

Get an array of items from a profile that will be lost on death

protected
isItemKeptAfterDeath(pmcData: IPmcData, itemToCheck: Item): boolean

Does the provided items slotId mean its kept on the player after death

protected
processAlteredQuests(
sessionId: string,
pmcData: IPmcData,
preRaidQuests: IQuestStatus[],
postRaidProfile: IPostRaidPmcData,
): void

Look for quests with a status different from what it began the raid with

Reset the skill points earned in a raid to 0, ready for next raid

protected
setPlayerInRaidLocationStatusToNone(sessionID: string): void

Set the SPT inraid location Profile property to 'none'

protected
transferPostRaidLimbEffectsToProfile(saveProgressRequest: ISaveProgressRequestData, profileData: IPmcData): void

Take body part effects from client profile and apply to server profile

protected
updateProfileAchievements(profile: IPmcData, clientAchievements: Record<string, number>): void

Transfer client achievements into profile

protected
validateTaskConditionCounters(saveProgressRequest: ISaveProgressRequestData, profileData: IPmcData): void

Check counters are correct in profile

addUpdToMoneyFromRaid(items: Item[]): void

Check items array and add an upd object to money with a stack count of 1 Single stack money items have no upd object and thus no StackObjectsCount, causing issues

deleteInventory(pmcData: IPmcData, sessionId: string): void

Clear PMC inventory of all items except those that are exempt Used post-raid to remove items after death

getPlayerGear(items: Item[]): Item[]

Return the equipped items from a players inventory

Lookup quest item loss from lostOnDeath config

Iterate over inventory items and remove the property that defines an item as Found in Raid Only removes property if item had FiR when entering raid

setInventory(
sessionID: string,
serverProfile: IPmcData,
postRaidProfile: IPmcData,
): void

Update a players inventory post-raid Remove equipped items from pre-raid Add new items found in raid to profile Store insurance items in profile

updatePmcProfileDataPostRaid(
pmcData: IPmcData,
saveProgressRequest: ISaveProgressRequestData,
sessionId: string,
): void

Update various serverPMC profile values; quests/limb hp/trader standing with values post-raic

updateProfileBaseStats(
profileData: IPmcData,
saveProgressRequest: ISaveProgressRequestData,
sessionID: string,
): void

Reset a profile to a baseline, used post-raid Reset points earned during session property Increment exp

updateScavProfileDataPostRaid(
scavData: IPmcData,
saveProgressRequest: ISaveProgressRequestData,
sessionId: string,
): void

Update scav quest values on server profile with updated values post-raid