OptionalactionsOptionalarmorOptionalattackOptionalchangeOptionalchangesOptionalclassOptionalclOptionalcontextOptionaldescriptionOptionaldescriptorsOptionaleffectOptionalflagsOptionallanguagesOptionallevelOptionallinksOptionalparentOptionalschoolOptionalscriptOptionalshowShow item in combat tab.
OptionalshowDisplay item and its actions in quick actions and token HUD.
OptionalslOptionalslotNumber of slots the spell takes to prepare.
Defaults to 1 if the data is not present, 0 if the spell is at-will.
OptionalsubschoolOptionalsubOptionaltagOptionalweaponStaticmetadataActive state as per what setActive would correspond with.
The item's material addons.
Consumes are adds charges by default.
Base material
Is this item usable at base level, disregarding per-action details.
Remaining charges
Finite charges
Is Active
This returns composite result of if the item is equipped, has quantity, is not disabled, is not out of charges, etc. and is not representative if the item can be set active or not via setActive.
AbstractisThe item's actual material.
Abstract_Internal ExperimentalReturn active state change from data if present
This is a hack to allow item-type agnostic active state change detection.
InternalHandle charge update sanity checking, constraining them to reasonable values, and propagating to parent items if charges are shared.
Changed data
Context
Creation data
Creation context options
Triggering user ID
Changed data
Context
Triggering user ID
InternalCreation data
Context options
Triggering user
InternalInternalChanged data
Context
Triggering user
Protected_ProtectedUpdate action limited uses
{@inheritDoc ItemPF.recharge}
Options
Exact time period only
Optionalperiod?: stringRecharge only if matching this time period
OptionalrollData?: objectRoll data
InternalProtected_ProtectedRecharges item's uses, if any.
Options
Optionalexact?: booleanMatch only exact time period
Optionalmaximize?: booleanMaximize instead of using recharge formula
Optionalperiod?: stringRecharge only if it matches this time period
OptionalrollData?: objectRoll data instance
Optionalvalue?: numberSet charges to specific value
InternalUpdate Charge Linking
InternalUpdate this item's charges based on provided item.
Charge source
Add charges to the spell or its relevant resource pool (spell points or spontaneous spells).
Number of charges to add
Optionaldata: object = nullAdditional data to pass to the update
Updated document or undefined if no update is possible or required.
Get default charge cost for spell actions.
Optionaloptions: { rollData?: object } = {}Additional options
OptionalrollData?: objectRoll data instance
Default charge formula.
Protected AbstractgetProtectedCalled by ()
Optionaloptions: { isolated?: boolean; rollData?: object } = {}Visible item name
OptionalasPlayer: boolean = falseIf true, return value players see.
AbstractgetDataModel specific roll data
Roll data
Spell components
Additional options
Optionalcompact?: booleanRemove redundant components (e.g. M/DF becomes DF for divine caster)
Number of remaining uses, or max.
Return max uses.
Prepare data dependent on other items
Called in actor.prepareDerivedData() when all items are guaranteed to be prepared.
Recharges item's uses, if any.
Options
AbstractsetSet item's active state.
Active state
Optionalcontext: objectOptional update context
Static_Adjust temporary item before creation
Temporary document
Creation data
Override values even if defined
Static_InternalUsed in consumable creation
String to convert
Roll data instance
StaticdefineStaticgetGet the price of a consumable given the spell level and caster level.
Spell item data.
Consumable type.
Optionaloverrides: { cl?: number; sl?: number; uses?: number } = {}Data overrides
Optionalcl?: numberCaster level
Optionalsl?: numberSpell level
Optionaluses?: numberNumber of uses (for wands)
StaticgetA spell item's data.
StaticmigrateStatic AbstractmigrateParent datamodel (item document) migration
AVOID USING THIS
Document source data
StaticpruneStatictoConvert spell into a consumable item.
Spell item data or spell item document
Consumable type
Optionaloptions: {Options & overrides
Optionalcl?: numberCaster level
Optionalidentified?: booleanOptionalsl?: numberSpell level
OptionalspellType?: stringSpell type
OptionalunidentifiedName?: stringOptionaluses?: numberStatictoOpen Consumable conversion dialog.
Automatically calls () as appropriate.
Spell item data or spell item
Optionaloptions: {Additional options
Optionalactor?: objectThe actor the consumable is being created on.
OptionalallowSpell?: booleanAllow spell creation
Optionalidentified?: booleanInitial identified state
Optionalitem?: ItemPFSource item document
OptionalspellType?: stringSpell type
Basic Item model with actions and related data