Format of the entries
The format of the items in this file is always the same:
N: serial number : & object name~ G: symbol : colour I: tval : sval : pval [: pval2] W: depth : rarity : weight : cost P: base armor class : base damage : plus to-hit : plus to-dam : plus to-ac A: depth/rarity : depth/rarity : etc F: flag | flag | etc f: obvious flag | obvious flag | etc D: description
the following additional lines can also be contained:
T: tval : sval Z: granted power a: activation
- N
indicates the beginning of an entry. The serial number must increase for each new item. The '&' and '~' symbols are used to include articles and pluralisation, respectively, as necessary to ensure grammatical correctness in object descriptions.
- G
- is for graphics - symbol and colour. There are 15 colours, as follows: Another colour, "d", is used for "flavoured" items. Note that the default symbol and colour can be changed through the use of pref files, which is used e.g. for the graphic modes.
D - Dark Gray
w - White
s - Gray
o - Orange
r - Red
g - Green
b - Blue
u - Brown
W - Light Gray
v - Violet
y - Yellow
R - Light Red
G - Light Green
B - Light Blue
U - Light Brown
- I
- is for basic information. The tval is for the type of item, the sval identifies the subtype and the pval indicates the amount of effect the item has, if applicable (e.g. the bonus to speed of a Ring of Speed).
There can be an optional fourth value, pval2, used e.g. to store the fuel of a torch or the spell of a staff. In this last case you can use the format SPELL=Manathrust instead of the numeric spell index. Normally, the tval, sval pair should be unique for each item. The maximum usable value is 255, but flavoured items are limited to the number of available flavours:
(*) only the first 32 items with sval 0 - 31, the mushrooms, are flavoured. Other items are handled normally. Note also that there are some hard-coded interpretation of the sval of an item, e.g. the sval of a tome or music instrument is also the spell list defined in spells.lua.tval
maximum number
(sval 0 - number-1)
TV_RING
62
TV_AMULET
34
TV_STAFF
35
TV_WAND, TV_ROD
39
TV_POTION, TV_POTION2
66
TV_SCROLL
55
TV_FOOD
32 (*)
- W
- is for extra information. Depth is the depth the object is normally found at and defines what level the object is, rarity determines how common the object is (currently unused, thanks to the A: allocation lines), weight is in tenth-pounds and cost is the item's base value.
- P
- is for power information. The items base armour class, its base damage in the form XdY and bonuses to-hit, to-dam and to-ac.
- A
- is for allocation - depth and rarity, in pairs (the larger rarity the more rare the item is). This allows an item to have up to 4 natural depths and rarities. It is used to ensure that certain vital items such as food and identify scrolls are found throughout the dungeon. The "allocation" depth need not match the depth as specified in the W: line, it can be shallower or deeper.
- F
- is for flags. These are fairly self-explanatory. As many F: lines may be used as are needed to specify all the flags and flags are separated by the '|' symbol. A list of all flags can be found in defines.h or in object.pkg (don't use the prefix TR#_).
- f
is used for obvious flags in the same manner, e.g. a two-handed weapon has the flag MUST2H both as a normal as well as an obvious flag.
- D
- is for description. As many D: lines may be used as are needed to describe the object.
- T
is used only for NORM_ART artifacts (e.g. artifacts directly defined in k_info.txt). This line stores the tval and sval of the base object type of the artifact, i.e. only items of this type can be improved to this artifact during the item generation.
- Z
- can be used to store the name of one granted power that can be used while wearing the item. A list of all 62 hard-coded power names can be found in tables.c, the code is in powers.c. Additional powers can be added in a Lua script by using add_power().
- a
can be used to define the activation of an item. The ACTIVATE flag should be set, as well as the ACTIVATE_NO_WIELD flag if the item should be activated without wearing it. This line comes in two forms: a:HARDCORE=number or a:SPELL=spell for a hard-coded or Lua scripted activation, respectively.
A list of all hard-coded activations can be found in defines.h (don't use the ACT_ prefix). A Lua activation is a normal spell with the additional field ["activation"] that stores the recharge time of the activation (see e.g. scpt/s_stick.lua).
ToME Wiki