Table of Contents

Struct PluginInventoryItem

Namespace
AcDream.Plugin.Abstractions
Assembly
AcDream.Plugin.Abstractions.dll

One item the player owns -- in a pack, equipped, or wielded -- flattened into the fields an inventory plugin needs. Numbers that only an appraisal can supply read as zero until the item has been appraised.

public readonly record struct PluginInventoryItem : IEquatable<PluginInventoryItem>
Implements
Inherited Members

Constructors

PluginInventoryItem(uint, uint, string, uint, uint, uint, uint, uint, uint, uint, uint, int, int, int, uint, int, int, uint, bool, double, int, int, int, double, int, int, int)

One item the player owns -- in a pack, equipped, or wielded -- flattened into the fields an inventory plugin needs. Numbers that only an appraisal can supply read as zero until the item has been appraised.

public PluginInventoryItem(uint ObjectId, uint WeenieClassId, string Name, uint ItemType, uint ContainerObjectId, uint WielderObjectId, uint ValidLocations, uint EquippedLocation, uint Useability, uint TargetType, uint PublicFlags, int StackSize, int Structure, int MaximumStructure, uint SpellId, int PetClass, int SummoningMastery, uint ProcSpellId, bool ProcSpellSelfTargeted, double ProcSpellRate, int WeaponSkill, int DamageType, int Damage, double DamageVariance, int UseRequiresSkill, int UseRequiresSkillLevel, int UseRequiresSkillSpecialized)

Parameters

ObjectId uint

The item's object id.

WeenieClassId uint

The item's class id, shared by every copy of it.

Name string

The item's display name.

ItemType uint

The item's type bit mask (weapon, armor, food, and so on).

ContainerObjectId uint

The container holding the item, or zero when it is not inside one.

WielderObjectId uint

The creature wielding the item, or zero when nobody is.

ValidLocations uint

Bit mask of the equipment slots the item may occupy; zero when it cannot be equipped at all.

EquippedLocation uint

Bit mask of the slot the item currently occupies; zero when it is not equipped.

Useability uint

How the item may be used -- in particular whether using it needs a second object as a target.

TargetType uint

The kind of object the item may be applied to, when it is a targeted-use item.

PublicFlags uint

The object's public flag bits: the same bits that mark something as a door, a corpse, a vendor, and so on.

StackSize int

How many of the item this stack holds.

Structure int

The item's remaining charges or uses; zero when it has no such counter.

MaximumStructure int

The ceiling for Structure.

SpellId uint

The spell the item casts when used, such as a scroll's; zero when it casts nothing.

PetClass int

The kind of pet a pet device summons, when the server says; zero when the item is not one or the server keeps it to itself, as the usual servers do. IsPetDevice does not depend on it alone.

SummoningMastery int

The summoning mastery the item belongs to; zero when it has none.

ProcSpellId uint

The spell the item can cast by itself when it strikes; zero when it has none.

ProcSpellSelfTargeted bool

True when that cast-on-strike spell lands on the wielder rather than the one struck.

ProcSpellRate double

How often the cast-on-strike spell fires, as a share of hits from 0 to 1.

WeaponSkill int

The skill the weapon attacks with. Read from the appraised weapon profile when there is one, otherwise from the property table.

DamageType int

The damage type the weapon deals, preferring the appraised weapon profile.

Damage int

The weapon's damage rating, preferring the appraised weapon profile. Minus one means the server left the value unset, which is not the same as zero damage.

DamageVariance double

How far below Damage a hit can roll, as a fraction of it: 0.2 means a hit lands between 80% and 100% of the damage rating.

UseRequiresSkill int

The skill needed to use the item; zero when none is.

UseRequiresSkillLevel int

How much of that skill the user needs.

UseRequiresSkillSpecialized int

How much of that skill the user needs when it is specialised.

Fields

SummoningCooldownId

The shared cooldown every summoning essence belongs to in the game's item data: using any one of them starts it for all of them. Pass it to GetCooldownRemaining(uint) to see how long until the next summon.

public const uint SummoningCooldownId = 213

Field Value

uint

Properties

AmmoType

The ammunition class a launcher takes, or an arrow or bolt belongs to; zero for anything else.

public uint AmmoType { get; init; }

Property Value

uint

AppraisedSpellIds

The spells an appraisal reported on the item; empty until it has been appraised.

public IReadOnlyList<uint> AppraisedSpellIds { get; init; }

Property Value

IReadOnlyList<uint>

ArmorLevel

The item's flat armor value; zero for anything that offers no protection. Read from the item's own property table, so it is available without an appraisal.

public int ArmorLevel { get; init; }

Property Value

int

AttackType

The attack styles the weapon offers, as a bit mask.

public int AttackType { get; init; }

Property Value

int

BoostValue

How much of that vital one use restores.

public int BoostValue { get; init; }

Property Value

int

BoosterVital

Which vital the item restores when used (health, stamina, mana); zero when it restores none.

public int BoosterVital { get; init; }

Property Value

int

Burden

How much the item weighs against the character's burden limit.

public int Burden { get; init; }

Property Value

int

CombatUse

Which combat role the item fills (melee weapon, missile weapon, shield, ammunition); zero when it has none.

public int CombatUse { get; init; }

Property Value

int

ContainerObjectId

The container holding the item, or zero when it is not inside one.

public uint ContainerObjectId { get; init; }

Property Value

uint

ContainerSlot

The item's slot number inside its container, or -1 when the client does not know it.

public int ContainerSlot { get; init; }

Property Value

int

ContainersCapacity

How many packs the item can hold, when it is a container.

public int ContainersCapacity { get; init; }

Property Value

int

CooldownSeconds

How long, in seconds, the item's shared cooldown lasts once it is used; zero when the server sent no length.

public double CooldownSeconds { get; init; }

Property Value

double

CoverageMask

The body parts a piece of clothing or armor covers, as the coverage bits the server sends with the object; zero for anything that is not worn.

public uint CoverageMask { get; init; }

Property Value

uint

Damage

The weapon's damage rating, preferring the appraised weapon profile. Minus one means the server left the value unset, which is not the same as zero damage.

public int Damage { get; init; }

Property Value

int

DamageType

The damage type the weapon deals, preferring the appraised weapon profile.

public int DamageType { get; init; }

Property Value

int

DamageVariance

How far below Damage a hit can roll, as a fraction of it: 0.2 means a hit lands between 80% and 100% of the damage rating.

public double DamageVariance { get; init; }

Property Value

double

Effects

The icon-highlight effect bits the server sends with the object itself. Bit 0 is "magical", which is how a loot rule can tell that an item is expected to carry spells before anything has appraised it.

public uint Effects { get; init; }

Property Value

uint

EquippedLocation

Bit mask of the slot the item currently occupies; zero when it is not equipped.

public uint EquippedLocation { get; init; }

Property Value

uint

GearCriticalChance

The item's critical-chance rating bonus; zero when it carries none.

public int GearCriticalChance { get; init; }

Property Value

int

GearCriticalDamage

The item's critical-damage rating bonus; zero when it carries none.

public int GearCriticalDamage { get; init; }

Property Value

int

GearCriticalDamageResistance

The item's critical-damage-resistance rating bonus; zero when it carries none.

public int GearCriticalDamageResistance { get; init; }

Property Value

int

GearCriticalResistance

The item's critical-resistance rating bonus; zero when it carries none.

public int GearCriticalResistance { get; init; }

Property Value

int

GearDamage

The item's damage rating bonus; zero when it carries none.

public int GearDamage { get; init; }

Property Value

int

GearDamageResistance

The item's damage-resistance rating bonus; zero when it carries none.

public int GearDamageResistance { get; init; }

Property Value

int

HasCastOnStrike

True when the item can cast a spell of its own on a hit, at some rate above zero.

public bool HasCastOnStrike { get; }

Property Value

bool

Header

The raw description words and optional values of the item's latest full description, as the server sent them; null for an item the client never received a description of, and on a host that does not report them. See PluginObjectHeader.

public PluginObjectHeader? Header { get; init; }

Property Value

PluginObjectHeader

HealKitModifier

A healing kit's effectiveness multiplier; zero for anything that is not one.

public double HealKitModifier { get; init; }

Property Value

double

IconId

The item's icon, for a plugin that draws its own UI.

public uint IconId { get; init; }

Property Value

uint

IconOverlayId

The icon drawn over the item's icon, as a full icon id (for example the mark an imbue adds); zero when the item has none.

public uint IconOverlayId { get; init; }

Property Value

uint

IconUnderlayId

The icon drawn beneath the item's icon, as a full icon id (for example the backdrop the server gives a rare item); zero when the item has none. Loot rules written for the original client's macro tools match on this value without its 0x06000000 prefix.

public uint IconUnderlayId { get; init; }

Property Value

uint

ImbuedEffect

The imbue burned into the item: the rends that change which element it strikes with, plus the critical bonuses. Zero when the item carries no imbue. Any non-zero value means the item can no longer be imbued again.

public int ImbuedEffect { get; init; }

Property Value

int

IsEquipped

True when the item currently occupies an equipment slot.

public bool IsEquipped { get; }

Property Value

bool

IsPetDevice

True when the item summons a pet: it belongs to the summoning essences' shared cooldown (SummoningCooldownId), which the server sends with the item itself, or the server named the pet it summons (PetClass).

public bool IsPetDevice { get; }

Property Value

bool

ItemCurrentMana

How much mana the item currently holds.

public int ItemCurrentMana { get; init; }

Property Value

int

ItemMaximumMana

The most mana the item can hold.

public int ItemMaximumMana { get; init; }

Property Value

int

ItemSpellcraft

The item's spellcraft rating, which sets how hard its own spells are to activate; zero when it has none.

public int ItemSpellcraft { get; init; }

Property Value

int

ItemType

The item's type bit mask (weapon, armor, food, and so on).

public uint ItemType { get; init; }

Property Value

uint

ItemsCapacity

How many loose items the item can hold, when it is a container.

public int ItemsCapacity { get; init; }

Property Value

int

MaterialType

What the item is made of; zero when the client does not know.

public uint MaterialType { get; init; }

Property Value

uint

MaxDamage

The top end of the item's damage roll, zero when the client does not know it. This is Damage with the server's "unset" sentinel folded to zero, so it is always a number a calculation can use.

public int MaxDamage { get; init; }

Property Value

int

MaximumStackSize

The largest stack the item can form; one for anything that does not stack.

public int MaximumStackSize { get; init; }

Property Value

int

MaximumStructure

The ceiling for Structure.

public int MaximumStructure { get; init; }

Property Value

int

Name

The item's display name.

public string Name { get; init; }

Property Value

string

NumTimesTinkered

How many times the item has been tinkered; zero when never or unknown.

public int NumTimesTinkered { get; init; }

Property Value

int

ObjectClass

The broad category the item falls into.

public PluginObjectClass ObjectClass { get; init; }

Property Value

PluginObjectClass

ObjectId

The item's object id.

public uint ObjectId { get; init; }

Property Value

uint

Palettes

The color swaps applied to the item's appearance; empty when the client has no appearance data for it.

public IReadOnlyList<PluginPaletteInfo> Palettes { get; init; }

Property Value

IReadOnlyList<PluginPaletteInfo>

PetClass

The kind of pet a pet device summons, when the server says; zero when the item is not one or the server keeps it to itself, as the usual servers do. IsPetDevice does not depend on it alone.

public int PetClass { get; init; }

Property Value

int

PluralName

The item's name for more than one of it; an empty string when the server did not send one.

public string PluralName { get; init; }

Property Value

string

ProcSpellId

The spell the item can cast by itself when it strikes; zero when it has none.

public uint ProcSpellId { get; init; }

Property Value

uint

ProcSpellRate

How often the cast-on-strike spell fires, as a share of hits from 0 to 1.

public double ProcSpellRate { get; init; }

Property Value

double

ProcSpellSelfTargeted

True when that cast-on-strike spell lands on the wielder rather than the one struck.

public bool ProcSpellSelfTargeted { get; init; }

Property Value

bool

PublicFlags

The object's public flag bits: the same bits that mark something as a door, a corpse, a vendor, and so on.

public uint PublicFlags { get; init; }

Property Value

uint

Retained

True when the item is marked as retained, which stops it being dropped, sold, or salvaged by accident. False when the item carries no such mark.

public bool Retained { get; init; }

Property Value

bool

SalvageWorkmanship

The same value as Workmanship, as a double. Nothing is recovered by widening it -- the server sent a single -- so this is only a convenience for a crafting calculator that works in doubles.

public double SalvageWorkmanship { get; init; }

Property Value

double

SharedCooldownId

The shared cooldown the item belongs to: using it starts that cooldown for every item with the same id. The server sends it with the item and again in an appraisal; zero when the item has none.

public uint SharedCooldownId { get; init; }

Property Value

uint

SpellId

The spell the item casts when used, such as a scroll's; zero when it casts nothing.

public uint SpellId { get; init; }

Property Value

uint

StackSize

How many of the item this stack holds.

public int StackSize { get; init; }

Property Value

int

Structure

The item's remaining charges or uses; zero when it has no such counter.

public int Structure { get; init; }

Property Value

int

SummoningMastery

The summoning mastery the item belongs to; zero when it has none.

public int SummoningMastery { get; init; }

Property Value

int

TargetType

The kind of object the item may be applied to, when it is a targeted-use item.

public uint TargetType { get; init; }

Property Value

uint

UseRadius

How close, in metres, the character must be to use the item; zero when the server did not send a distance.

public float UseRadius { get; init; }

Property Value

float

UseRequiresSkill

The skill needed to use the item; zero when none is.

public int UseRequiresSkill { get; init; }

Property Value

int

UseRequiresSkillLevel

How much of that skill the user needs.

public int UseRequiresSkillLevel { get; init; }

Property Value

int

UseRequiresSkillSpecialized

How much of that skill the user needs when it is specialised.

public int UseRequiresSkillSpecialized { get; init; }

Property Value

int

Useability

How the item may be used -- in particular whether using it needs a second object as a target.

public uint Useability { get; init; }

Property Value

uint

ValidLocations

Bit mask of the equipment slots the item may occupy; zero when it cannot be equipped at all.

public uint ValidLocations { get; init; }

Property Value

uint

Value

The item's worth in coin, for the whole stack.

public int Value { get; init; }

Property Value

int

WandElementalDamageType

The damage type recorded in the item's own property table, which is where a casting weapon's element lives. DamageType prefers the appraised weapon profile and so reports what the weapon strikes with in melee; for a wand or staff that profile says nothing about the element it casts. Zero when the property is absent.

public int WandElementalDamageType { get; init; }

Property Value

int

WeaponSkill

The skill the weapon attacks with. Read from the appraised weapon profile when there is one, otherwise from the property table.

public int WeaponSkill { get; init; }

Property Value

int

WeaponType

The weapon category the item belongs to; zero when it is not a weapon.

public int WeaponType { get; init; }

Property Value

int

WeenieClassId

The item's class id, shared by every copy of it.

public uint WeenieClassId { get; init; }

Property Value

uint

WieldDifficulty

How much of it the wielder needs.

public int WieldDifficulty { get; init; }

Property Value

int

WieldRequirements

What kind of requirement must be met to wield the item -- a skill, an attribute, a level -- or zero when there is none.

public int WieldRequirements { get; init; }

Property Value

int

WieldSkillType

The skill or attribute that requirement names.

public int WieldSkillType { get; init; }

Property Value

int

WielderObjectId

The creature wielding the item, or zero when nobody is.

public uint WielderObjectId { get; init; }

Property Value

uint

Workmanship

The item's workmanship as the server sends it with the object itself: a fractional number from 1 to 10, not the whole-number band an appraisal shows a player. A bag of salvage carries the average workmanship of everything melted into it here. Zero when the server sent none.

public float Workmanship { get; init; }

Property Value

float