Difference between revisions of "ITEMDEF"
From SphereWiki
MrSugarCube (talk | contribs) |
|||
(17 intermediate revisions by 9 users not shown) | |||
Line 1: | Line 1: | ||
+ | {{Languages|ITEMDEF}} | ||
+ | |||
__FORCETOC__ | __FORCETOC__ | ||
Line 9: | Line 11: | ||
{| border="1" cellspacing="4" cellpadding="4" | {| border="1" cellspacing="4" cellpadding="4" | ||
| '''Name''' || '''Read/Write''' || '''Description''' | | '''Name''' || '''Read/Write''' || '''Description''' | ||
+ | |- | ||
+ | | [[AMMOANIM]] || RW || Overrides TDATA4 for bow/crossbow type weapons. | ||
+ | |- | ||
+ | | [[AMMOANIMHUE]] || RW || Sets the color of the effect when firing bow/crossbow type weapons. | ||
+ | |- | ||
+ | | [[AMMOANIMRENDER]] || RW || Sets the render mode of the effect when firing bow/crossbow type weapons. | ||
+ | |- | ||
+ | | [[AMMOCONT]] || RW || Sets the container UID or ID where to search for ammos for bow/crossbow type weapons. | ||
+ | |- | ||
+ | | [[AMMOTYPE]] || RW || Overrides TDATA3 for bow/crossbow type weapons. | ||
|- | |- | ||
| [[ARMOR]] ''min,max'' || RW || Gets or sets the base protection that the armour will give. | | [[ARMOR]] ''min,max'' || RW || Gets or sets the base protection that the armour will give. | ||
Line 17: | Line 29: | ||
|- | |- | ||
| [[BASEID]] || R || Gets the defname of the item if set, otherwise the ID. | | [[BASEID]] || R || Gets the defname of the item if set, otherwise the ID. | ||
+ | |- | ||
+ | | [[BONUSSTR]] | [[BONUSDEX]] | [[BONUSINT]] | [[BONUSHITS]] | [[BONUSSTAM]] | [[BONUSMANA]] | [[BONUSSKILLx]] | [[BONUSSKILLxAMT]] (X branch only) || RW || Increases (or decreases) the applicable Stat. Positive or negative integer. | ||
+ | For BonusSkill, x is a sequential number(1-4) and must assign a skill. Ex:bonusskill1=bowcraft and BonusSkillxAMT is the amount | ||
|- | |- | ||
| [[CAN]] || RW || Gets or sets attributes for the item. See can_i_flags in sphere_defs.scp. | | [[CAN]] || RW || Gets or sets attributes for the item. See can_i_flags in sphere_defs.scp. | ||
Line 47: | Line 62: | ||
|- | |- | ||
| [[ISWEAPON]] || R || Gets whether or not the item is considered to be a weapon. | | [[ISWEAPON]] || R || Gets whether or not the item is considered to be a weapon. | ||
+ | |- | ||
+ | | [[LAYER]] || RW || Gets or sets the layer that the item will occupy when equipped (1 or 0). | ||
|- | |- | ||
| [[NAME]] || RW || Gets or sets the name of the item. | | [[NAME]] || RW || Gets or sets the name of the item. | ||
Line 55: | Line 72: | ||
|- | |- | ||
| [[RANGEL]] || R || Gets the minimum range of the weapon. | | [[RANGEL]] || R || Gets the minimum range of the weapon. | ||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| [[REPAIR]] || RW || Gets or sets whether or not the item can be repaired (1 or 0). | | [[REPAIR]] || RW || Gets or sets whether or not the item can be repaired (1 or 0). | ||
Line 66: | Line 79: | ||
| [[RESDISPDNHUE]] || RW || Gets or sets the colour to display as to clients who don't have a high enough [[RESDISP]] to see the item. | | [[RESDISPDNHUE]] || RW || Gets or sets the colour to display as to clients who don't have a high enough [[RESDISP]] to see the item. | ||
|- | |- | ||
− | | [[ | + | | [[RESDISPDNID]] || RW || Gets or sets the item ID to display as to clients who don't have a high enough [[RESDISP]] to see the item. |
|- | |- | ||
| [[RESLEVEL]] || RW || Gets the minimum [[RESDISP]] required for a client to see the item. | | [[RESLEVEL]] || RW || Gets the minimum [[RESDISP]] required for a client to see the item. | ||
Line 81: | Line 94: | ||
|- | |- | ||
| [[REQSTR]] || RW || Gets or sets the amount of strength needed to equip the item. | | [[REQSTR]] || RW || Gets or sets the amount of strength needed to equip the item. | ||
+ | |- | ||
+ | | [[SKILL (Item Property)|SKILL]] || RW || Gets or sets the skill that is used with the weapon. | ||
|- | |- | ||
| [[SKILLMAKE]] || RW || Gets or sets the list of skills needed to craft the item. | | [[SKILLMAKE]] || RW || Gets or sets the list of skills needed to craft the item. | ||
Line 102: | Line 117: | ||
| [[TEVENTS]] || RW || Gets a list of events attached the item, or adds an event to the item. | | [[TEVENTS]] || RW || Gets a list of events attached the item, or adds an event to the item. | ||
|- | |- | ||
− | | [[TFLAGS]] || | + | | [[TFLAGS]] || R || 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) | | [[TWOHANDS]] || RW || Gets or sets whether or not the item occupies both hands when equipped (layer_hand2) | ||
Line 111: | Line 126: | ||
|- | |- | ||
| [[WEIGHT]] || RW || Gets or sets the weight of the item. | | [[WEIGHT]] || RW || Gets or sets the weight of the item. | ||
+ | |- | ||
+ | | [[WEIGHTREDUCTION]] || RW || Gets or sets the percent of weight reduction of the item. | ||
|} | |} | ||
− | |||
==Multi Definitions== | ==Multi Definitions== | ||
Line 121: | Line 137: | ||
{| border="1" cellspacing="4" cellpadding="4" | {| border="1" cellspacing="4" cellpadding="4" | ||
− | | '''Name''' || '''Read/Write''' || '''Description''' | + | | '''Name''' || '''Read/Write''' || '''Override†''' || '''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) | ||
|- | |- | ||
− | | [[ | + | | [[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) |
|- | |- | ||
− | | [[ | + | | [[MULTIREGION]] ''left, top, right, bottom'' || RW || ?? || Gets or sets the boundaries of the multi (t_multi, t_multi_custom, t_ship). |
|- | |- | ||
− | | [[ | + | | [[REGIONFLAGS]] || RW || ?? || Gets or sets the flags that will be set on the multi's region. |
|- | |- | ||
− | | [[ | + | | [[SHIPSPEED]] ''period,tiles'' || RW || ?? || Gets or sets the speed (tenths) and tiles that a ship will move at. (t_ship only) |
|- | |- | ||
− | | [[ | + | | [[SHIPSPEED.TILES]] || RW || Y || Gets or sets the tiles that a ship will move at each movement. (t_ship only) |
|- | |- | ||
− | | [[SHIPSPEED]] | + | | [[SHIPSPEED.PERIOD]] || RW || Y || Gets or sets the speed (tenths per each movement) 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. | + | | [[TSPEECH]] || RW || ?? || Gets a list of attached [[SPEECH]] handlers, or adds a handler to the multi. |
|} | |} | ||
− | + | '''†''' Some ITEMDEF properties can be overridden by using [[Override_TAGs]]. For example, TAG.OVERRIDE.SHIPSPEED.PERIOD and TAG.OVERRIDE.SHIPSPEED.TILES can be set on individual ships in-game to affect their speed. | |
==Examples== | ==Examples== | ||
Line 171: | Line 191: | ||
[[Category: Reference Compendium]] | [[Category: Reference Compendium]] | ||
+ | [[Category: Definitions]] |
Latest revision as of 14:56, 16 January 2023
Missing languages
An ITEMDEF block defines the basic properties of an item.
Properties
Here is a list of all item definition properties.
Name | Read/Write | Description |
AMMOANIM | RW | Overrides TDATA4 for bow/crossbow type weapons. |
AMMOANIMHUE | RW | Sets the color of the effect when firing bow/crossbow type weapons. |
AMMOANIMRENDER | RW | Sets the render mode of the effect when firing bow/crossbow type weapons. |
AMMOCONT | RW | Sets the container UID or ID where to search for ammos for bow/crossbow type weapons. |
AMMOTYPE | RW | Overrides TDATA3 for bow/crossbow type weapons. |
ARMOR min,max | RW | Gets or sets the base protection that the armour will give. |
ARMOR.LO | R | Gets the minimum base protection the armour will give. |
ARMOR.HI | R | Gets the maximum base protection the armour will give. |
BASEID | R | Gets the defname of the item if set, otherwise the ID. |
BONUSSTR | BONUSDEX | BONUSINT | BONUSHITS | BONUSSTAM | BONUSMANA | BONUSSKILLx | BONUSSKILLxAMT (X branch only) | RW | Increases (or decreases) the applicable Stat. Positive or negative integer.
For BonusSkill, x is a sequential number(1-4) and must assign a skill. Ex:bonusskill1=bowcraft and BonusSkillxAMT is the amount |
CAN | RW | Gets or sets attributes for the item. See can_i_flags in sphere_defs.scp. |
DAM min,max | RW | Gets or sets the base damage that the weapon will deal. |
DAM.LO | R | Gets the minimum base damage the weapon will deal. |
DAM.HI | R | Gets the maximum base damage the weapon will deal. |
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. |
HEIGHT | RW | Gets or sets the height of the item. |
ID | RW | Gets or sets the ID of the item to inherit property values from. |
INSTANCES | R | Returns the number of this item that exist in the world. |
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. |
LAYER | RW | Gets or sets the layer that the item will occupy when equipped (1 or 0). |
NAME | RW | Gets or sets the name of the item. |
RANGE min, max | RW | Gets or sets the range of the weapon. |
RANGEH | R | Gets the maximum range of the weapon. |
RANGEL | R | Gets the minimum range of the weapon. |
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. |
RESDISPDNHUE | RW | Gets or sets the colour to display as to clients who don't have a high enough RESDISP to see the item. |
RESDISPDNID | RW | Gets or sets the item ID to display as to clients who don't have a high enough RESDISP to see the item. |
RESLEVEL | RW | Gets the minimum RESDISP required for a client to see the item. |
RESMAKE | R | Returns the names of the resources needed to craft the item. |
RESOURCES | RW | Gets or sets the resources that are needed to craft the item. |
RESOURCES.COUNT | R | Gets the number of different resources that are needed to craft the item. |
RESOURCES.n.KEY | R | Gets the BASEID of the nth resource needed to craft the item. (zero-based) |
RESOURCES.n.VAL | R | Gets the amount of the nth resource needed to craft the item. (zero-based) |
REQSTR | RW | Gets or sets the amount of strength needed to equip the item. |
SKILL | RW | Gets or sets the skill that is used with the weapon. |
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. |
TAG.name | RW | Gets or sets the value of a TAG. |
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. |
TEVENTS | RW | Gets a list of events attached the item, or adds an event to the item. |
TFLAGS | R | 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. |
WEIGHTREDUCTION | RW | Gets or sets the percent of weight reduction 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 | Override† | 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) |
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) |
MULTIREGION left, top, right, bottom | RW | ?? | Gets or sets the boundaries of the multi (t_multi, t_multi_custom, t_ship). |
REGIONFLAGS | RW | ?? | Gets or sets the flags that will be set on the multi's region. |
SHIPSPEED period,tiles | RW | ?? | Gets or sets the speed (tenths) and tiles that a ship will move at. (t_ship only) |
SHIPSPEED.TILES | RW | Y | Gets or sets the tiles that a ship will move at each movement. (t_ship only) |
SHIPSPEED.PERIOD | RW | Y | Gets or sets the speed (tenths per each movement) 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. |
† Some ITEMDEF properties can be overridden by using Override_TAGs. For example, TAG.OVERRIDE.SHIPSPEED.PERIOD and TAG.OVERRIDE.SHIPSPEED.TILES can be set on individual ships in-game to affect their speed.
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)