Table of Contents

Class WornObjectScript

Namespace
SkyrimForge.Papyrus
Assembly
SkyrimForge.Game.dll

Functions and comments from WornObject.psc.

These functions operate directly on worn items within the inventory Valid Hand Slot: 0 - Left 1 - Right Valid Slot Masks: See Armor.psc Use zero when using hand slot

public static class WornObjectScript
Inheritance
WornObjectScript
Inherited Members

Properties

Dispatcher

The dispatcher that binds this script to a form and calls the functions and properties that have no generated member.

public static PapyrusScriptDispatcher Dispatcher { get; }

Property Value

PapyrusScriptDispatcher

Methods

CreateEnchantment(IActor, int, int, float, IReadOnlyCollection<MagicEffect>, IReadOnlyCollection<float>, IReadOnlyCollection<int>, IReadOnlyCollection<int>)

Creates a new enchantment on the item given the specified parameters all arrays must be the same size created enchantments are not purged from the save when removed or overwritten exact same enchantments are re-used by the game

public static Task CreateEnchantment(IActor akActor, int handSlot, int slotMask, float maxCharge, IReadOnlyCollection<MagicEffect> effects, IReadOnlyCollection<float> magnitudes, IReadOnlyCollection<int> areas, IReadOnlyCollection<int> durations)

Parameters

akActor IActor
handSlot int
slotMask int
maxCharge float
effects IReadOnlyCollection<MagicEffect>
magnitudes IReadOnlyCollection<float>
areas IReadOnlyCollection<int>
durations IReadOnlyCollection<int>

Returns

Task

GetDisplayName(IActor, int, int)

Returns the name of this reference this is the name that is displayed

public static Task<string> GetDisplayName(IActor akActor, int handSlot, int slotMask)

Parameters

akActor IActor
handSlot int
slotMask int

Returns

Task<string>

GetEnchantment(IActor, int, int)

Returns the player-made enchantment if there is one

public static Task<Enchantment?> GetEnchantment(IActor akActor, int handSlot, int slotMask)

Parameters

akActor IActor
handSlot int
slotMask int

Returns

Task<Enchantment?>

GetItemCharge(IActor, int, int)

public static Task<float> GetItemCharge(IActor akActor, int handSlot, int slotMask)

Parameters

akActor IActor
handSlot int
slotMask int

Returns

Task<float>

GetItemHealthPercent(IActor, int, int)

public static Task<float> GetItemHealthPercent(IActor akActor, int handSlot, int slotMask)

Parameters

akActor IActor
handSlot int
slotMask int

Returns

Task<float>

GetItemMaxCharge(IActor, int, int)

Works on any enchanted item

public static Task<float> GetItemMaxCharge(IActor akActor, int handSlot, int slotMask)

Parameters

akActor IActor
handSlot int
slotMask int

Returns

Task<float>

GetNumReferenceAliases(IActor, int, int)

Returns the number of ref aliases holding this reference

public static Task<int> GetNumReferenceAliases(IActor akActor, int handSlot, int slotMask)

Parameters

akActor IActor
handSlot int
slotMask int

Returns

Task<int>

GetPoison(IActor, int, int)

Returns the poison on the specified item

public static Task<Potion?> GetPoison(IActor akActor, int handSlot, int slotMask)

Parameters

akActor IActor
handSlot int
slotMask int

Returns

Task<Potion?>

SetDisplayName(IActor, int, int, string, bool)

Sets a reference's display name returns false if force is false and the reference is held by an alias using 'Stored Text' or 'Uses Stored Text' Text Replacement does not use this name and may be lost if forced

public static Task<bool> SetDisplayName(IActor akActor, int handSlot, int slotMask, string name, bool force = false)

Parameters

akActor IActor
handSlot int
slotMask int
name string
force bool

Returns

Task<bool>

SetEnchantment(IActor, int, int, Enchantment, float)

Changes an item's player-made enchantment to something else None enchantment will remove the existing enchantment does not delete the custom enchantment, only removes it

public static Task SetEnchantment(IActor akActor, int handSlot, int slotMask, Enchantment source, float maxCharge)

Parameters

akActor IActor
handSlot int
slotMask int
source Enchantment
maxCharge float

Returns

Task

SetItemHealthPercent(IActor, int, int, float)

public static Task SetItemHealthPercent(IActor akActor, int handSlot, int slotMask, float health)

Parameters

akActor IActor
handSlot int
slotMask int
health float

Returns

Task

SetItemMaxCharge(IActor, int, int, float)

Charges Only works on items that have user-enchants

public static Task SetItemMaxCharge(IActor akActor, int handSlot, int slotMask, float maxCharge)

Parameters

akActor IActor
handSlot int
slotMask int
maxCharge float

Returns

Task