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
Item.AmountInt32Read amount from item type object.
Color
Item.ColorUInt16Container
Item.ContainerInt32Serial of the container which contains the object.
ContainerCurrentItems
Item.ContainerCurrentItemsInt32ContainerCurrentWeight
Item.ContainerCurrentWeightInt32ContainerOpened
Item.ContainerOpenedBooleanTrue when the container was opened
Contains
Item.ContainsList[Item]Contains the list of Item inside a container.
CorpseNumberItems
Item.CorpseNumberItemsInt32-1 until corpse is checked, then # items in corpse. Used by looter to ignore empty corpses
Deleted
Item.DeletedBooleanDirection
Item.DirectionStringItem direction.
Durability
Item.DurabilityInt32Get the current durability of an Item. (0: no durability)
Graphics
Item.GraphicsUInt16GridNum
Item.GridNumByteReturns the GridNum of the item. (need better documentation)
Hue
Item.HueUInt16Image
Item.ImageBitmapGet the in-game image on an Item as Bitmap object. See MSDN: https://docs.microsoft.com/dotnet/api/system.drawing.bitmap
IsBagOfSending
Item.IsBagOfSendingBooleanTrue: if the item is a bag of sending - False: otherwise.
IsContainer
Item.IsContainerBooleanTrue: if the item is a container - False: otherwise.
IsCorpse
Item.IsCorpseBooleanTrue: if the item is a corpse - False: otherwise.
IsDoor
Item.IsDoorBooleanTrue: if the item is a door - False: otherwise.
IsInBank
Item.IsInBankBooleanTrue: if the item is in the Player's bank - False: otherwise.
IsLootable
Item.IsLootableBooleanTrue: For regualar items - False: for hair, beards, etc.
IsPotion
Item.IsPotionBooleanTrue: if the item is a potion - False: otherwise.
IsResource
Item.IsResourceBooleanTrue: if the item is a resource (ore, sand, wood, stone, fish) - False: otherwise
IsSearchable
Item.IsSearchableBooleanTrue: if the item is a pouch - False: otherwise.
IsTwoHanded
Item.IsTwoHandedBooleanTrue: if the item is a 2-handed weapon - False: otherwise.
IsVirtueShield
Item.IsVirtueShieldBooleanTrue: if the item is a virtue shield - False: otherwise.
ItemID
Item.ItemIDInt32Represents the type of Item, usually unique for the Item image. Sometime called ID or Graphics ID.
Layer
Item.LayerStringGets the Layer, for werable items only. (need better documentation)
Light
Item.LightByteItem light's direction (e.g. will affect corpse's facing direction)
MaxContainerWeight
Item.MaxContainerWeightInt32MaxDurability
Item.MaxDurabilityInt32Get the maximum durability of an Item. (0: no durability)
MaxItems
Item.MaxItemsInt32Movable
Item.MovableBooleanItem is movable
Name
Item.NameStringItem name
OnGround
Item.OnGroundBooleanTrue: if the item is on the ground - False: otherwise.
Position
Item.PositionPoint3DProperties
Item.PropertiesList[Property]Get the list of Properties of an Item.
PropsUpdated
Item.PropsUpdatedBooleanTrue: if Properties are updated - False: otherwise.
RootContainer
Item.RootContainerInt32Get serial of root container of item.
Serial
Item.SerialInt32Updated
Item.UpdatedBooleanCheck if the Item already have been updated with all the properties. (need better documentation)
Visible
Item.VisibleBooleanItem is Visible
Weight
Item.WeightInt32Get the weight of a item. (0: no weight)
Methods
DistanceTo
Item.DistanceTo(mob)Return the distance in number of tiles, from Item to Mobile.
mob(Mobile): Target as Mobile
Int32Equals
Item.Equals(obj)obj(Object)
BooleanGetHashCode
Item.GetHashCode()Int32GetWorldPosition
Item.GetWorldPosition()Point3DIsChildOf
Item.IsChildOf(container, maxDepth)Check if an Item is contained in a container. Can be a Item or a Mobile (wear by).
container(Item): Item as container.maxDepth(Int32)
BooleanToString
Item.ToString()String