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
ObjectIduintThe item's object id.
WeenieClassIduintThe item's class id, shared by every copy of it.
NamestringThe item's display name.
ItemTypeuintThe item's type bit mask (weapon, armor, food, and so on).
ContainerObjectIduintThe container holding the item, or zero when it is not inside one.
WielderObjectIduintThe creature wielding the item, or zero when nobody is.
ValidLocationsuintBit mask of the equipment slots the item may occupy; zero when it cannot be equipped at all.
EquippedLocationuintBit mask of the slot the item currently occupies; zero when it is not equipped.
UseabilityuintHow the item may be used -- in particular whether using it needs a second object as a target.
TargetTypeuintThe kind of object the item may be applied to, when it is a targeted-use item.
PublicFlagsuintThe object's public flag bits: the same bits that mark something as a door, a corpse, a vendor, and so on.
StackSizeintHow many of the item this stack holds.
StructureintThe item's remaining charges or uses; zero when it has no such counter.
MaximumStructureintThe ceiling for
Structure.SpellIduintThe spell the item casts when used, such as a scroll's; zero when it casts nothing.
PetClassintThe 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.
SummoningMasteryintThe summoning mastery the item belongs to; zero when it has none.
ProcSpellIduintThe spell the item can cast by itself when it strikes; zero when it has none.
ProcSpellSelfTargetedboolTrue when that cast-on-strike spell lands on the wielder rather than the one struck.
ProcSpellRatedoubleHow often the cast-on-strike spell fires, as a share of hits from 0 to 1.
WeaponSkillintThe skill the weapon attacks with. Read from the appraised weapon profile when there is one, otherwise from the property table.
DamageTypeintThe damage type the weapon deals, preferring the appraised weapon profile.
DamageintThe 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.
DamageVariancedoubleHow far below
Damagea hit can roll, as a fraction of it: 0.2 means a hit lands between 80% and 100% of the damage rating.UseRequiresSkillintThe skill needed to use the item; zero when none is.
UseRequiresSkillLevelintHow much of that skill the user needs.
UseRequiresSkillSpecializedintHow 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
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
AppraisedSpellIds
The spells an appraisal reported on the item; empty until it has been appraised.
public IReadOnlyList<uint> AppraisedSpellIds { get; init; }
Property Value
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
AttackType
The attack styles the weapon offers, as a bit mask.
public int AttackType { get; init; }
Property Value
BoostValue
How much of that vital one use restores.
public int BoostValue { get; init; }
Property Value
BoosterVital
Which vital the item restores when used (health, stamina, mana); zero when it restores none.
public int BoosterVital { get; init; }
Property Value
Burden
How much the item weighs against the character's burden limit.
public int Burden { get; init; }
Property Value
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
ContainerObjectId
The container holding the item, or zero when it is not inside one.
public uint ContainerObjectId { get; init; }
Property Value
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
ContainersCapacity
How many packs the item can hold, when it is a container.
public int ContainersCapacity { get; init; }
Property Value
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
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
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
DamageType
The damage type the weapon deals, preferring the appraised weapon profile.
public int DamageType { get; init; }
Property Value
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
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
EquippedLocation
Bit mask of the slot the item currently occupies; zero when it is not equipped.
public uint EquippedLocation { get; init; }
Property Value
GearCriticalChance
The item's critical-chance rating bonus; zero when it carries none.
public int GearCriticalChance { get; init; }
Property Value
GearCriticalDamage
The item's critical-damage rating bonus; zero when it carries none.
public int GearCriticalDamage { get; init; }
Property Value
GearCriticalDamageResistance
The item's critical-damage-resistance rating bonus; zero when it carries none.
public int GearCriticalDamageResistance { get; init; }
Property Value
GearCriticalResistance
The item's critical-resistance rating bonus; zero when it carries none.
public int GearCriticalResistance { get; init; }
Property Value
GearDamage
The item's damage rating bonus; zero when it carries none.
public int GearDamage { get; init; }
Property Value
GearDamageResistance
The item's damage-resistance rating bonus; zero when it carries none.
public int GearDamageResistance { get; init; }
Property Value
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
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
HealKitModifier
A healing kit's effectiveness multiplier; zero for anything that is not one.
public double HealKitModifier { get; init; }
Property Value
IconId
The item's icon, for a plugin that draws its own UI.
public uint IconId { get; init; }
Property Value
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
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
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
IsEquipped
True when the item currently occupies an equipment slot.
public bool IsEquipped { get; }
Property Value
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
ItemCurrentMana
How much mana the item currently holds.
public int ItemCurrentMana { get; init; }
Property Value
ItemMaximumMana
The most mana the item can hold.
public int ItemMaximumMana { get; init; }
Property Value
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
ItemType
The item's type bit mask (weapon, armor, food, and so on).
public uint ItemType { get; init; }
Property Value
ItemsCapacity
How many loose items the item can hold, when it is a container.
public int ItemsCapacity { get; init; }
Property Value
MaterialType
What the item is made of; zero when the client does not know.
public uint MaterialType { get; init; }
Property Value
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
MaximumStackSize
The largest stack the item can form; one for anything that does not stack.
public int MaximumStackSize { get; init; }
Property Value
MaximumStructure
The ceiling for Structure.
public int MaximumStructure { get; init; }
Property Value
Name
The item's display name.
public string Name { get; init; }
Property Value
NumTimesTinkered
How many times the item has been tinkered; zero when never or unknown.
public int NumTimesTinkered { get; init; }
Property Value
ObjectClass
The broad category the item falls into.
public PluginObjectClass ObjectClass { get; init; }
Property Value
ObjectId
The item's object id.
public uint ObjectId { get; init; }
Property Value
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
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
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
ProcSpellId
The spell the item can cast by itself when it strikes; zero when it has none.
public uint ProcSpellId { get; init; }
Property Value
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
ProcSpellSelfTargeted
True when that cast-on-strike spell lands on the wielder rather than the one struck.
public bool ProcSpellSelfTargeted { get; init; }
Property Value
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
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
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
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
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
StackSize
How many of the item this stack holds.
public int StackSize { get; init; }
Property Value
Structure
The item's remaining charges or uses; zero when it has no such counter.
public int Structure { get; init; }
Property Value
SummoningMastery
The summoning mastery the item belongs to; zero when it has none.
public int SummoningMastery { get; init; }
Property Value
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
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
UseRequiresSkill
The skill needed to use the item; zero when none is.
public int UseRequiresSkill { get; init; }
Property Value
UseRequiresSkillLevel
How much of that skill the user needs.
public int UseRequiresSkillLevel { get; init; }
Property Value
UseRequiresSkillSpecialized
How much of that skill the user needs when it is specialised.
public int UseRequiresSkillSpecialized { get; init; }
Property Value
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
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
Value
The item's worth in coin, for the whole stack.
public int Value { get; init; }
Property Value
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
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
WeaponType
The weapon category the item belongs to; zero when it is not a weapon.
public int WeaponType { get; init; }
Property Value
WeenieClassId
The item's class id, shared by every copy of it.
public uint WeenieClassId { get; init; }
Property Value
WieldDifficulty
How much of it the wielder needs.
public int WieldDifficulty { get; init; }
Property Value
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
WieldSkillType
The skill or attribute that requirement names.
public int WieldSkillType { get; init; }
Property Value
WielderObjectId
The creature wielding the item, or zero when nobody is.
public uint WielderObjectId { get; init; }
Property Value
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; }