Item

The Item class represent a single in-game Item object. Examples of Item are: Swords, bags, bandages, reagents, clothing. While the Item.Serial is unique for each Item, Item.ItemID is the unique for the Item appearance, or image. Sometimes is also called ID or Graphics ID. Item can also be house foriture as well as decorative items on the ground, like lamp post and banches. However, for Item on the ground that cannot be picked up, they might be part of the world map, see Statics class.

Table of Contents

Properties

Amount

Syntax: Item.Amount
Returns: Int32

Read amount from item type object.

Color

Syntax: Item.Color
Returns: UInt16

Container

Syntax: Item.Container
Returns: Int32

Serial of the container which contains the object.

ContainerCurrentItems

Syntax: Item.ContainerCurrentItems
Returns: Int32

ContainerCurrentWeight

Syntax: Item.ContainerCurrentWeight
Returns: Int32

ContainerOpened

Syntax: Item.ContainerOpened
Returns: Boolean

True when the container was opened

Contains

Syntax: Item.Contains
Returns: List[Item]

Contains the list of Item inside a container.

CorpseNumberItems

Syntax: Item.CorpseNumberItems
Returns: Int32

-1 until corpse is checked, then # items in corpse. Used by looter to ignore empty corpses

Deleted

Syntax: Item.Deleted
Returns: Boolean

Direction

Syntax: Item.Direction
Returns: String

Item direction.

Durability

Syntax: Item.Durability
Returns: Int32

Get the current durability of an Item. (0: no durability)

Graphics

Syntax: Item.Graphics
Returns: UInt16

GridNum

Syntax: Item.GridNum
Returns: Byte

Returns the GridNum of the item. (need better documentation)

Hue

Syntax: Item.Hue
Returns: UInt16

Image

Syntax: Item.Image
Returns: Bitmap

Get the in-game image on an Item as Bitmap object. See MSDN: https://docs.microsoft.com/dotnet/api/system.drawing.bitmap

IsBagOfSending

Syntax: Item.IsBagOfSending
Returns: Boolean

True: if the item is a bag of sending - False: otherwise.

IsContainer

Syntax: Item.IsContainer
Returns: Boolean

True: if the item is a container - False: otherwise.

IsCorpse

Syntax: Item.IsCorpse
Returns: Boolean

True: if the item is a corpse - False: otherwise.

IsDoor

Syntax: Item.IsDoor
Returns: Boolean

True: if the item is a door - False: otherwise.

IsInBank

Syntax: Item.IsInBank
Returns: Boolean

True: if the item is in the Player's bank - False: otherwise.

IsLootable

Syntax: Item.IsLootable
Returns: Boolean

True: For regualar items - False: for hair, beards, etc.

IsPotion

Syntax: Item.IsPotion
Returns: Boolean

True: if the item is a potion - False: otherwise.

IsResource

Syntax: Item.IsResource
Returns: Boolean

True: if the item is a resource (ore, sand, wood, stone, fish) - False: otherwise

IsSearchable

Syntax: Item.IsSearchable
Returns: Boolean

True: if the item is a pouch - False: otherwise.

IsTwoHanded

Syntax: Item.IsTwoHanded
Returns: Boolean

True: if the item is a 2-handed weapon - False: otherwise.

IsVirtueShield

Syntax: Item.IsVirtueShield
Returns: Boolean

True: if the item is a virtue shield - False: otherwise.

ItemID

Syntax: Item.ItemID
Returns: Int32

Represents the type of Item, usually unique for the Item image. Sometime called ID or Graphics ID.

Layer

Syntax: Item.Layer
Returns: String

Gets the Layer, for werable items only. (need better documentation)

Light

Syntax: Item.Light
Returns: Byte

Item light's direction (e.g. will affect corpse's facing direction)

MaxContainerWeight

Syntax: Item.MaxContainerWeight
Returns: Int32

MaxDurability

Syntax: Item.MaxDurability
Returns: Int32

Get the maximum durability of an Item. (0: no durability)

MaxItems

Syntax: Item.MaxItems
Returns: Int32

Movable

Syntax: Item.Movable
Returns: Boolean

Item is movable

Name

Syntax: Item.Name
Returns: String

Item name

OnGround

Syntax: Item.OnGround
Returns: Boolean

True: if the item is on the ground - False: otherwise.

Position

Syntax: Item.Position
Returns: Point3D

Properties

Syntax: Item.Properties
Returns: List[Property]

Get the list of Properties of an Item.

PropsUpdated

Syntax: Item.PropsUpdated
Returns: Boolean

True: if Properties are updated - False: otherwise.

RootContainer

Syntax: Item.RootContainer
Returns: Int32

Get serial of root container of item.

Serial

Syntax: Item.Serial
Returns: Int32

Updated

Syntax: Item.Updated
Returns: Boolean

Check if the Item already have been updated with all the properties. (need better documentation)

Visible

Syntax: Item.Visible
Returns: Boolean

Item is Visible

Weight

Syntax: Item.Weight
Returns: Int32

Get the weight of a item. (0: no weight)

Methods

DistanceTo

Syntax: Item.DistanceTo(mob)

Return the distance in number of tiles, from Item to Mobile.

Parameters:
  • mob (Mobile): Target as Mobile
Returns: Int32

Equals

Syntax: Item.Equals(obj)
Parameters:
  • obj (Object)
Returns: Boolean

GetHashCode

Syntax: Item.GetHashCode()
Returns: Int32

GetWorldPosition

Syntax: Item.GetWorldPosition()
Returns: Point3D

IsChildOf

Syntax: Item.IsChildOf(container, maxDepth)

Check if an Item is contained in a container. Can be a Item or a Mobile (wear by).

Parameters:
  • container (Item): Item as container.
  • maxDepth (Int32)
Returns: Boolean

ToString

Syntax: Item.ToString()
Returns: String