Lua API

LuaItem classmod

Represents an item.

Fields

LuaItem.integer_id [R] The integer ID of this item.
LuaItem.position [RW] The item's position.
LuaItem.charges [RW] The number of charges this item holds (for rods, bait, etc.)
LuaItem.subname [RW] The subname of this item.
LuaItem.image [RW] The image ID of the item.
LuaItem.value [RW] The value of the item.
LuaItem.param1 [RW] A generic parameter.
LuaItem.param2 [RW] A generic parameter.
LuaItem.param3 [RW] A generic parameter.
LuaItem.param4 [RW] A generic parameter.
LuaItem.own_state [RW] Controls the ownership of this item.
LuaItem.material [RW] The material ID of this item.
LuaItem.id [R] The new-style prototype ID of the item.
LuaItem.name [R] The name of the item with article and number.
LuaItem.basename [R] The name of the item without article and number.
LuaItem.number [RW] The number of this item.
LuaItem.curse_state [RW] The curse state of this item.
LuaItem.identify_state [RW] The identify state of this item.
LuaItem.color [RW] The color ID of the item.
LuaItem.is_acidproof [RW] The flag if the item is acidproof.
LuaItem.is_fireproof [RW] The flag if the item is fireproof.
LuaItem.is_coldproof [RW] The flag if the item is coldproof.
LuaItem.is_precious [RW] The flag if the item is precious.
LuaItem.has_charges [RW] The flag if the item has charge.
LuaItem.has_cooldown_time [RW] The flag if the item has cooldown time.
LuaItem.is_aphrodisiac [RW] The flag if the item is aphrodisiac.
LuaItem.is_poisoned [RW] The flag if the item is poisoned.
LuaItem.is_blessed_by_ehekatl [RW] The flag if the item is blessed by Ehekatl.
LuaItem.is_stolen [RW] The flag if the item is stolen.
LuaItem.is_quest_target [RW] The flag if the item is quest target.
LuaItem.is_no_drop [RW] The flag if the item is marked as no-drop.
LuaItem.is_alive [RW] The flag if the item is alive.
LuaItem.is_eternal_force [RW] The flag if the item is eternal force.
LuaItem.is_handmade [RW] The flag if the item is handmade.
LuaItem.is_showroom_only [RW] The flag if the item is showroom only.
LuaItem.prototype [R] The prototype data of the character.

Methods

LuaItem:remove () Removes this item.
LuaItem:change_material (material_id) Changes the material of this item.

Fields

# LuaItem.integer_id

[R] The integer ID of this item.

  • integer_id : (num)
# LuaItem.position

[RW] The item's position.

  • position : (num)
# LuaItem.charges

[RW] The number of charges this item holds (for rods, bait, etc.)

  • charges : (num)
# LuaItem.subname

[RW] The subname of this item.

Controls the character index of corpses, etc.

  • subname : (num)
# LuaItem.image

[RW] The image ID of the item.

  • image : (num)
# LuaItem.value

[RW] The value of the item.

  • value : (num)
# LuaItem.param1

[RW] A generic parameter.

  • param1 : (num)
# LuaItem.param2

[RW] A generic parameter.

  • param2 : (num)
# LuaItem.param3

[RW] A generic parameter.

  • param3 : (num)
# LuaItem.param4

[RW] A generic parameter.

  • param4 : (num)
# LuaItem.own_state

[RW] Controls the ownership of this item.

-2: Item was dropped by the player on death 0: Normal, can be picked up by the player 1: Not owned ("It's not your property", etc.) 2: Not carryable (shopkeeper's trunk). 3: Built shelter 4: Harvestable item in harvest quests

  • own_state : (num)
# LuaItem.material

[RW] The material ID of this item.

To change it, use LuaItem.change_material.

  • material : (string)
# LuaItem.id

[R] The new-style prototype ID of the item.

  • id : (string)
# LuaItem.name

[R] The name of the item with article and number.

  • name : (string)
# LuaItem.basename

[R] The name of the item without article and number.

  • basename : (string)
# LuaItem.number

[RW] The number of this item.

  • number : (num)
# LuaItem.curse_state

[RW] The curse state of this item.

  • curse_state : (CurseState)
# LuaItem.identify_state

[RW] The identify state of this item.

  • identify_state : (IdentifyState)
# LuaItem.color

[RW] The color ID of the item.

  • color : (ColorIndex)
# LuaItem.is_acidproof

[RW] The flag if the item is acidproof.

  • is_acidproof : (boolean)
# LuaItem.is_fireproof

[RW] The flag if the item is fireproof.

  • is_fireproof : (boolean)
# LuaItem.is_coldproof

[RW] The flag if the item is coldproof.

  • is_coldproof : (boolean)
# LuaItem.is_precious

[RW] The flag if the item is precious.

  • is_precious : (boolean)
# LuaItem.has_charges

[RW] The flag if the item has charge.

  • has_charges : (boolean)
# LuaItem.has_cooldown_time

[RW] The flag if the item has cooldown time.

  • has_cooldown_time : (boolean)
# LuaItem.is_aphrodisiac

[RW] The flag if the item is aphrodisiac.

  • is_aphrodisiac : (boolean)
# LuaItem.is_poisoned

[RW] The flag if the item is poisoned.

  • is_poisoned : (boolean)
# LuaItem.is_blessed_by_ehekatl

[RW] The flag if the item is blessed by Ehekatl.

  • is_blessed_by_ehekatl : (boolean)
# LuaItem.is_stolen

[RW] The flag if the item is stolen.

  • is_stolen : (boolean)
# LuaItem.is_quest_target

[RW] The flag if the item is quest target.

  • is_quest_target : (boolean)
# LuaItem.is_no_drop

[RW] The flag if the item is marked as no-drop.

  • is_no_drop : (boolean)
# LuaItem.is_alive

[RW] The flag if the item is alive.

  • is_alive : (boolean)
# LuaItem.is_eternal_force

[RW] The flag if the item is eternal force.

  • is_eternal_force : (boolean)
# LuaItem.is_handmade

[RW] The flag if the item is handmade.

  • is_handmade : (boolean)
# LuaItem.is_showroom_only

[RW] The flag if the item is showroom only.

  • is_showroom_only : (boolean)
# LuaItem.prototype

[R] The prototype data of the character.

Methods

# LuaItem:remove ()

Removes this item.

The item reference will no longer be valid for use.

# LuaItem:change_material (material_id)

Changes the material of this item.

Parameters:
  • material_id : (string) ID of the item material