ITEMDEF

From SphereWiki
Revision as of 17:26, 6 June 2009 by MrSugarCube (talk | contribs)
Jump to: navigation, search


An ITEMDEF block defines the basic properties of an item.

Properties

Here is a list of all item definition properties.


Name Read/Write Description
DEFNAME RW Gets or sets defname of the item
DISPID RW Gets or sets the ID to display as to clients.
DUPEITEM RW Gets or sets the defname of the item that this is a duplicate/rotation of (see DUPELIST).
DUPELIST item_defname, item_defname, ... RW Gets or sets a comma-separated list of items that this item will cycle through when rotated.
DYE RW Gets or sets whether or not the item can be dyed using dye tubs (1 or 0).
FLIP RW Gets or sets whether or not the item automatically rotates when dropped.
ID RW Gets or sets the ID of the item to inherit property values from.
ISARMOR R Gets whether or not the item is considered to be armour.
ISWEAPON R Gets whether or not the item is considered to be a weapon.
SKILL RW Gets or sets the skill that is used with the weapon.
LAYER RW Gets or sets the layer that the item will occupy when equipped (1 or 0).
REPAIR RW Gets or sets whether or not the item can be repaired (1 or 0).
REPLICATE RW Gets or sets whether or not multiple instances of the item can be crafted at once.
RESDISPNID RW Gets or sets the item ID to display as to clients who don't have a high enough RESDISP to see the item.
RESMAKE R Returns the names of the resources needed to craft the item.
REQSTR RW Gets or sets the amount of strength needed to equip the item.
SKILLMAKE RW Gets or sets the list of skills needed to craft the item.
SKILLMAKE.n.KEY R Gets the name of the nth skill needed to craft the item.
SKILLMAKE.n.VAL R Gets the amount of the nth skill needed to craft the item.
SPEED RW Gets or sets the speed of the weapon.
TDATA1 RW Gets or sets the TDATA1 value of the item.
TDATA2 RW Gets or sets the TDATA2 value of the item.
TDATA3 RW Gets or sets the TDATA3 value of the item.
TDATA4 RW Gets or sets the TDATA4 value of the item.
TFLAGS RW Gets or sets the flags of the item from tiledata.mul.
TWOHANDS RW Gets or sets whether or not the item occupies both hands when equipped (layer_hand2)
TYPE RW Gets or sets the item's type.
VALUE RW Gets or sets the base value of the item.
WEIGHT RW Gets or sets the weight of the item.


Multi Definitions

For multi items (t_multi, t_multi_custom, t_ship), the ITEMDEF has additional properties.

Properties

Here is a list of all multi definition properties.

Name Read/Write Description
BASECOMPONENT R Gets how many static components the multi has in the multi.mul file.
BASECOMPONENT.n.KEY R Accesses the multi's static components directly from the multi.mul file. (ID,DX,DY,DZ,D,VISIBLE)
MULTIREGION left, top, right, bottom RW Gets or sets the boundaries of the multi (t_multi, t_multi_custom, t_ship).
COMPONENT R Gets how many dynamic components have been defined for the multi.
COMPONENT.n.KEY R Accesses the multi's dynamic components. (ID,DX,DY,DZ,D)
COMPONENT item_defname, dx, dy, dz W Defines a dynamic component to the multi that will be spawned along with it (e.g. doors and house sign)
REGIONFLAGS RW Gets or sets the flags that will be set on the multi's region.
SHIPSPEED tiles, period RW Gets or sets the speed that a ship will move at. (t_ship only)
TSPEECH RW Gets a list of attached SPEECH handlers, or adds a handler to the multi.


Examples

//
// Blue Gold
//
[ITEMDEF i_gold_blue]
ID=i_gold      // inherits from i_gold
NAME=Blue Gold // named Blue Gold
TYPE=t_gold    // is type t_gold
VALUE=10       // valued at gold

ON=@Create
    COLOR = colors_blue
    
    
    //
    // Small Stone and Plaster House (from default script pack)
    //
[ITEMDEF 04064]                           // item ID 0x4064 (in mul files)
DEFNAME=i_multi_house_stone_plaster_small
NAME=Small Stone and Plaster House
TYPE=t_multi
VALUE=43800                               // valued at 43800 gold
MULTIREGION=-3,-3,3,4                     // size of the region, relative to location of the item
COMPONENT=i_door_wood,0,3,7               // adds a door at 0,3,7 (relative to location of the item)
COMPONENT=i_sign_brass_2,2,4,5            // adds a brass sign at 2,4,5 (relative to location of the item)