Table of Contents

Class NwItem

Namespace
Anvil.API
Assembly
NWN.Anvil.dll

An item object that can be carried by creatures, stored in placeable containers, or dropped in an anrea.

public sealed class NwItem : NwGameObject, IEquatable<NwObject>
Inheritance
NwItem
Implements
Inherited Members
Extension Methods

Properties

ACValue

Gets the armor class of this item. This will return the full AC value of this item, taking into account all modifiers in regards to bonus AC.
Unlike the standard ruleset, it will stack multiple AC bonuses instead of taking the highest.
This value does not take into account AC bonuses vs certain conditions nor the DecreaseAC(IPACModifierType, int) Item Property.
It will also not take into account ability changes, nor if there is an existing amount of that bonus type. For example, wearing +1 armor, thus using a +1 Armor AC modifier, will not stack with Epic Mage Armor, which gives +5 in Armor AC bonuses.

AddGoldValue

Gets or sets the additional GP value of this item.
Does not persist through saving.

Appearance

Gets the appearance properties of this item.

BaseACValue

Gets the base armor class of this item.

BaseGoldValue

Gets or sets the base GP value of this item.
Does not persist through saving.

BaseItem

Gets or sets the NwBaseItem for this item.

CursedFlag

Gets or sets a value indicating whether this item is considered cursed. Cursed items cannot be dropped.

Droppable

Gets or sets a value indicating whether this item can be dropped. Droppable items will appear on a creature's remains when the creature is killed.

GoldValue

Gets the gp value for this item.

HasInventory

Gets a value indicating whether this item has an inventory (container).

HiddenWhenEquipped

Gets or sets a value indicating whether this item should be hidden when equipped.

Identified

Gets or sets a value indicating whether this item has been identified.

Infinite

Gets or sets a value indicating whether this item may be infinitely purchased from stores.
An infinite item will still be available to purchase from a store after a player buys the item.

Inventory

Gets the inventory of this item, if it is a container.

IsRangedWeapon

Gets if this item is considered a ranged weapon.

IsValid

Gets a value indicating whether this is a valid object.

ItemCharges

Gets or sets the number of charges left on this item.

ItemProperties

Gets all active item properties currently applied to this object.

MinEquipLevel

Gets the minimum level required to equip this item.
If an override is set with SetMinEquipLevelOverride(byte), this property will return the override value.

OriginalUnidentifiedDescription

Gets the original unidentified description for this item.

Pickpocketable

Gets or sets a value indicating whether this item can be pickpocketed.

Possessor

Gets the GameObject that has this item in its inventory. Returns null if it is on the ground, or not in any inventory.

RootPossessor

Gets the root possessor of this item.

StackSize

Gets or sets the number of stacked items attached to this item.

Stolen

Gets or sets a value indicating whether this item is considered stolen. Only stores with the "Buys Stolen Goods" will purchase this item. The stolen flag is set automatically on pickpocketed items, and traps crafted with the craft trap skill.

UnidentifiedDescription

Gets or sets the unidentified description for this item.

Weight

Gets or sets the weight of this item, in pounds.

Methods

AcquireItem(NwItem, bool)
AddItemProperty(ItemProperty, EffectDuration, TimeSpan, AddPropPolicy, bool, bool, bool)

Add an item property. Optional parameters allow for preventing unwanted stacking by removing the existing one first.

ClearMinEquipLevelOverride()

Clears any override that is set for the item's min equip level.

Clone(Location, bool, string?, bool)

Creates a copy of this item.

Clone(Location, string?, bool)

Creates a copy of this game object.

Clone(NwGameObject, string?, bool, bool)

Creates a copy of this item.

CompareItem(NwItem)

Compare this item to another item to test if it is stackable.

Create(string, Location, bool, int, string?)

Creates a new item from a template ResRef.

Create(string, NwGameObject?, int, string)

Creates a new item from a template ResRef.

Deserialize(byte[])
GetMinEquipLevelOverride()

Gets the override that is set for the item's min equip level.

GetUsesPerDayRemaining(ItemProperty)

Gets the number of uses per day remaining for the specified item property on this item.

HasItemProperty(ItemPropertyTableEntry?, ItemPropertySubTypeTableEntry?, EffectDuration?, string?)

Gets whether this item has a given item property that matches the specified filters.
If no filters are set, returns if any item property is set on this item.

HasItemProperty(ItemPropertyType)

Gets whether this item has a given item property.

RemoveItemProperties(ItemPropertyTableEntry?, ItemPropertySubTypeTableEntry?, EffectDuration?, string?)

Remove all item properties from this item, using the specified filter options.
If no filters are set, removes all item properties from this item.

RemoveItemProperty(ItemProperty)

Removes the specified item property from this item.
See ItemProperties to enumerate item properties on this item.

Serialize()
SetMinEquipLevelOverride(byte)

Sets the override value to use for this item's min equip level.

SetUsesPerDayRemaining(ItemProperty, int)

Sets the number of uses per day remaining for the specified item property on this item.

Events

OnInventoryItemAdd
OnInventoryItemRemove
OnItemDecrementStackSize

Called when an item is destroyed, reducing the stack size of an item.

OnItemDestroy

Called when an item is destroyed, deleting the item.

Operators

implicit operator CNWSItem?(NwItem?)