class Item (server-side)
Available since version: 0.3.0
Represents a read-only Gothic item definition from the server item registry.
Properties
string instance
Represents the canonical Gothic item instance name.
number index
Represents the Gothic parser symbol index for this item instance.
number mainflag
Represents the item's main category flag. For more information, see Item Constants.
number mainFlag
Represents the item's main category flag. For more information, see Item Constants.
number flags
Represents the item's Gothic flags. For more information, see Item Constants.
string visual
Represents the item's visual model file.
number wear
Represents the armor wear slot value. For more information, see Item Constants.
number range
Represents the item's range value.
number value
Represents the item's value in currency units.
{total, types}|nil damage
Represents the item's damage information. Its types field uses Damage Constants.
number damageTotal
Represents the item's total damage.
number damageTypes
Represents the item's Gothic damage type flags. For more information, see Damage Constants.
string munition
Represents the required munition item instance name.
Item|nil munitionItem
Represents the required munition item definition.
number spell
Represents the spell id associated with this item.
string scemename
Represents the item's Gothic sceme name.
number mag_circle
Represents the magic circle required by this item.
{...} protections
Represents protection values exported for this item.
{...} conditions
Represents attribute conditions exported for this item.
Methods
getProtection
Returns the protection value for a Gothic damage type.
number getProtection(number damageType)
Parameters:
numberdamageType: Gothic damage type. For more information, see Damage Constants.
Returns number:
getCondAtr
Returns the required attribute type at the given condition index.
number getCondAtr(number index)
Parameters:
numberindex: Zero-based condition index.
Returns number:
getCondValue
Returns the required attribute value at the given condition index.
number getCondValue(number index)
Parameters:
numberindex: Zero-based condition index.
Returns number:
getByInstance
Returns an item definition by Gothic instance name.
Item|nil getByInstance(string instance)
Parameters:
stringinstance: Gothic item instance name.
Returns Item|nil:
Item definition or nil if missing.
getByIndex
Returns an item definition by Gothic parser symbol index.
Item|nil getByIndex(number index)
Parameters:
numberindex: Gothic parser symbol index.
Returns Item|nil:
Item definition or nil if missing.
exists
Returns whether an item definition exists for the given instance name.
boolean exists(string instance)
Parameters:
stringinstance: Gothic item instance name.
Returns boolean:
size
Returns the number of item definitions loaded by the server.
number size()
Returns number:
Callbacks
No callbacks.