summaryrefslogtreecommitdiff
path: root/doc/item_db.txt
blob: 8a33f9c35170fb07b17241a59b1e869bae7ce37a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
//===== Hercules Documentation ===============================
//= Item Database
//===== By: ==================================================
//= Hercules Dev Team
//===== Current Version: =====================================
//= 20120904
//===== Description: =========================================
//= Explanation of the item_db.conf file and structure.
//============================================================

item_db: (
{
	// =================== Mandatory fields ===============================
	Id: ID                        (int)
	AegisName: "Aegis_Name"       (string, optional if Inherit: true)
	Name: "Item Name"             (string, optional if Inherit: true)
	// =================== Optional fields ================================
	Type: Item Type               (int, defaults to 3 = etc item)
	Buy: Buy Price                (int, defaults to Sell * 2)
	Sell: Sell Price              (int, defaults to Buy / 2)
	Weight: Item Weight           (int, defaults to 0, units in Weight/10 )
	Atk: Attack                   (int, defaults to 0)
	Matk: Magical Attack          (int, defaults to 0, ignored in pre-re)
	Def: Defense                  (int, defaults to 0)
	Range: Attack Range           (int, defaults to 0)
	Slots: Slots                  (int, defaults to 0)
	Job: {                        (defaults to all job)
		All: true/false               (boolean, defaults to false)
		Novice: true/false            (boolean, defaults to false)
		Swordsman: true/false         (boolean, defaults to false)
		Magician: true/false          (boolean, defaults to false)
		Archer: true/false            (boolean, defaults to false)
		Acolyte: true/false           (boolean, defaults to false)
		Merchant: true/false          (boolean, defaults to false)
		Thief: true/false             (boolean, defaults to false)
		Knight: true/false            (boolean, defaults to false)
		Priest: true/false            (boolean, defaults to false)
		Wizard: true/false            (boolean, defaults to false)
		Blacksmith: true/false        (boolean, defaults to false)
		Hunter: true/false            (boolean, defaults to false)
		Assassin: true/false          (boolean, defaults to false)
		Crusader: true/false          (boolean, defaults to false)
		Monk: true/false              (boolean, defaults to false)
		Sage: true/false              (boolean, defaults to false)
		Rogue: true/false             (boolean, defaults to false)
		Alchemist: true/false         (boolean, defaults to false)
		Bard: true/false              (boolean, defaults to false)
		Gunslinger: true/false        (boolean, defaults to false)
		Ninja: true/false             (boolean, defaults to false)
		Taekwon: true/false           (boolean, defaults to false)
		Star_Gladiator: true/false    (boolean, defaults to false)
		Soul_Linker: true/false       (boolean, defaults to false)
		Gangsi: true/false            (boolean, defaults to false)
		Death_Knight: true/false      (boolean, defaults to false)
		Dark_Collector: true/false    (boolean, defaults to false)
		Kagerou: true/false           (boolean, defaults to false)
		Rebellion: true/false         (boolean, defaults to false)
		Summoner: true/false          (boolean, defaults to false)
	}
	Job: Job mask                 (alternate synxtax, int, defaults to all jobs = 0xFFFFFFFF)
	Upper: Upper mask             (int, defaults to any = 0x3f)
	Gender: Gender                (string, defaults to "SEX_ANY")
	Loc: Equip location           (int, required value for equipment)
	WeaponLv: Weapon Level        (int, defaults to 0)
	EquipLv: Equip required level (int, defaults to 0)
	EquipLv: [min, max]           (alternative syntax with min / max level)
	Refine: Refineable            (boolean, defaults to true)
	Subtype: Item Subtype         (int, defaults to 0)
	ViewSprite: Sprite view ID    (int, defaults to 0)
	BindOnEquip: true/false       (boolean, defaults to false)
	ForceSerial: true/false       (boolean, defaults to false)
	BuyingStore: true/false       (boolean, defaults to false)
	Delay: Delay to use item      (int, defaults to 0)
	KeepAfterUse: true/false      (boolean, defaults to false)
	DropAnnounce: true/false      (boolean, defaults to false)
	Trade: {                      (defaults to no restrictions)
		override: GroupID             (int, defaults to 100)
		nodrop: true/false            (boolean, defaults to false)
		notrade: true/false           (boolean, defaults to false)
		nostorage: true/false         (boolean, defaults to false)
		nocart: true/false            (boolean, defaults to false)
		noselltonpc: true/false       (boolean, defaults to false)
		nomail: true/false            (boolean, defaults to false)
		noauction: true/false         (boolean, defaults to false)		
		nogstorage: true/false        (boolean, defaults to false)
		partneroverride: true/false   (boolean, defaults to false)
	}
	Nouse: {                      (defaults to no restrictions)
		override: GroupID             (int, defaults to 100)
		sitting: true/false           (boolean, defaults to false)
	}
	Stack: [amount, flag]         (int, defaults to 0)
	Sprite: SpriteID              (int, defaults to 0)
	Script: <"
		Script
		(it can be multi-line)
	">
	OnEquipScript: <" OnEquip Script (can also be multi-line) ">
	OnUnequipScript: <" OnUnequip Script (can also be multi-line) ">
	// =================== Optional fields (item_db2 only) ================
	Inherit: true/false           (boolean, if true, inherit the values
	                              that weren't specified, from item_db.conf,
	                              else override it and use default values)
},
...
)

Id: Item id

AegisName: Server name to reference the item in scripts and lookups.
           Allowed characters: [A-Za-z0-9_]

Name: Name in English for displaying as output for @ and script commands.

Type:
	0	Healing item.
	2	Usable item.
	3	Etc item
	4	Weapon
	5	Armor/Garment/Boots/Headgear
	6	Card
	7	Pet egg
	8	Pet equipment
	10	Ammo (Arrows/Bullets/etc)
	11	Usable with delayed consumption (item is lost from inventory
		after selecting a target, for use with skills and pet lures)
	18	Another delayed consume that requires user confirmation before
		using item.

Buy: Default buying price. When not specified, becomes double the sell price.

Sell: Default selling price. When not specified, becomes half the buy price.

Weight: Item's weight. Each 10 is 1 weight. When not specified, becomes 0.

Atk: Weapon's attack. When not specified, becomes 0.

Matk: Weapon's magical attack (only used in renewal mode, ignored in
      pre-renewal). When not specified, becomes 0.

Def: Armor's defense. When not specified, becomes 0.

Range: Weapon's attack range. When not specified, becomes 0.

Slots: Amount of slots the item possesses. When not specified, becomes 0.

Job:  Job restrictions. If this block is omitted, item can be equipped by all class
		All the settings in this group are boolean values,
		Default value is false (restriction not set) for any missing setting.

	Alternate Format:
		Equippable jobs. Uses the following bitmask table:

		(S.) Novice    (2^00): 0x00000001
		Swordman       (2^01): 0x00000002
		Magician       (2^02): 0x00000004
		Archer         (2^03): 0x00000008
		Acolyte        (2^04): 0x00000010
		Merchant       (2^05): 0x00000020
		Thief          (2^06): 0x00000040
		Knight         (2^07): 0x00000080
		Priest         (2^08): 0x00000100
		Wizard         (2^09): 0x00000200
		Blacksmith     (2^10): 0x00000400
		Hunter         (2^11): 0x00000800
		Assassin       (2^12): 0x00001000
		Unused         (2^13): 0x00002000
		Crusader       (2^14): 0x00004000
		Monk           (2^15): 0x00008000
		Sage           (2^16): 0x00010000
		Rogue          (2^17): 0x00020000
		Alchemist      (2^18): 0x00040000
		Bard/Dancer    (2^19): 0x00080000
		Unused         (2^20): 0x00100000
		Taekwon        (2^21): 0x00200000
		Star Gladiator (2^22): 0x00400000
		Soul Linker    (2^23): 0x00800000
		Gunslinger     (2^24): 0x01000000
		Ninja          (2^25): 0x02000000
		Gangsi         (2^26): 0x04000000
		Death Knight   (2^27): 0x08000000
		Dark Collector (2^28): 0x10000000
		Kagerou/Oboro  (2^29): 0x20000000
		Rebellion      (2^30): 0x40000000
		Summoner       (2^31): 0x80000000
		Some other commonly used values:
		All except novice:     0xFFFFFFFE
		All (default value):   0xFFFFFFFF

Upper: Equippable upper-types. Uses the following bitmasks:
	Normal jobs:      0x01 (1)
	Upper jobs:       0x02 (2)
	Baby jobs:        0x04 (4)
	Third jobs:       0x08 (8)
	Upper Third jobs: 0x10 (16)
	Baby Third jobs:  0x20 (32)

	Under pre-re mode third classes are considered upper, making use of
	the 8 and above masks is therefore not necessary unless in renewal
	mode. When no value is specified, all classes (mask 0x3f) are able to
	equip the item.

Gender: Gender restriction.
	Available genders:
		SEX_FEMALE: 0
		SEX_MALE:   1
		SEX_ANY:    2
	When not specified, becomes "SEX_ANY".

Loc: Equipment's placement. A value needs to be specified if the item is an
     equipment piece. Values are:

	2^0  001 = Lower Headgear
	2^1  002 = Weapon
	2^2  004 = Garment
	2^3  008 = Accessory 1
	2^4  016 = Armor
	2^5  032 = Shield
	2^6  064 = Footgear
	2^7  128 = Accessory 2
	2^8  256 = Upper Headgear
	2^9  512 = Middle Headgear
	2^10 1024 = Costume Top Headgear
	2^11 2048 = Costume Mid Headgear
	2^12 4096 = Costume Low Headgear
	2^13 8192 = Costume Garment/Robe
	2^16 65536 = Shadow Armor
	2^17 131072 = Shadow Weapon
	2^18 262144 = Shadow Shield
	2^18 524288 = Shadow Shoes
	2^20 1048576 = Shadow Accessory 2
	2^21 2097152 = Shadow Accessory 1

WeaponLv: Weapon level. Becomes 0 when not specified.

EquipLv: Base level required to be able to equip. It is possible to specify
	 two values, if an item has a maximum level, by using the following
         syntax:

	EquipLv: [minLv, maxLv]

	If only one value is specified, maxLv becomes the current server's
	MAX_LEVEL. If no values are specified, minLv becomes 0.

Refineable: true if the item can be refined, false otherwise. If no value is
            specified, it defaults to true.

ViewSprite: Defines a replacement view-sprite for the item (eg:
      Making apples look like apple juice).

Subtype: For weapons and ammo, indicates the weapon-class of the item.

	For weapons, the types are:
		W_FIST      0: Bare fist
		W_DAGGER    1: Daggers
		W_1HSWORD   2: One-handed swords
		W_2HSWORD   3: Two-handed swords
		W_1HSPEAR   4: One-handed spears
		W_2HSPEAR   5: Two-handed spears
		W_1HAXE     6: One-handed axes
		W_2HAXE     7: Two-handed axes
		W_MACE      8: Maces
		W_2HMACE    9: Unused
		W_STAFF    10: Staves
		W_BOW      11: Bows
		W_KNUCKLE  12: Knuckles
		W_MUSICAL  13: Musical instruments
		W_WHIP     14: Whips
		W_BOOK     15: Books
		W_KATAR    16: Katars
		W_REVOLVER 17: Reveolvers
		W_RIFLE    18: Rifles
		W_GATLING  19: Gatling guns
		W_SHOTGUN  20: Shotguns
		W_GRENADE  21: Grenade launchers
		W_HUUMA    22: Fuuma shurikens
		W_2HSTAFF  23: Two-handed staves

	For ammo, the types are:
		A_ARROW       1: Arrows
		A_DAGGER      2: Throwable daggers
		A_BULLET      3: Bullets
		A_SHELL       4: Shells
		A_GRENADE     5: Grenades
		A_SHURIKEN    6: Shuriken
		A_KUNAI       7: Kunai
		A_CANNONBALL  8: Cannon balls
		A_THROWWEAPON 9: Throwable items (Sling Item)

BindOnEquip: Whether the item will automatically bind to the character when it
             is equipped for the first time. An item that has this field set,
             will display a confirmation dialog the first time it is equipped,
             and, if accepted, the item will become character-bound.

ForceSerial: Whether the item will be given new unique id or not. When the item
			 have this field as true, the item will be unstackable and new uniqueID
			 will be given to each item.

BuyingStore: Whether the item can be sold via buyingstore, one must also edit
             data\buyingstoreitemlist.txt for client to accept item.

DropAnnounce: Enables global announcement of the selected item when dropped by monster.

Delay: Delay for an item to be used again. Value is in milliseconds.
       There is a max concurrent number of entries modifiable in
       src/map/itemdb.h as MAX_ITEMDELAYS.

Trade: Item trade restrictions. If this block is omitted, the item will have no
       trade restrictions.
       All the settings in this group are boolean values, unless otherwise
       specified. Default value is false (restriction not set) for any missing
       setting.

	Allowed settings in this block are:
		override: If specified and in the interval [1:100], sets the
		          minimum GM Group ID that can bypass the defined trade
		          restrictions. This is an integer value.
		nodrop: Item can't be dropped.
		notrade: Item can't be traded (nor vended).
		partneroverride: Wedded partners can override the notrade setting.
		noselltonpc: Item can't be sold to NPCs.
		nocart: Item can't be placed in the cart.
		nostorage: Item can't be placed in the storage.
		nogstorage: Item can't be placed in the guild storage.
		nomail: Item can't be attached to mail messages.
		noauction: Item can't be auctioned.

Nouse: Defines if an item cannot be used under certain circumstances. If this
       block is omitted, there will be no usage restrictions.
       All the settings in this group are boolean values, unless otherwise
       specified. Default value is false (restriction not set) for any missing
       setting.

	Allowed settings in this block are:
		override: If specified and in the interval [1:100], sets the
		          minimum GM Group ID that can bypass the defined usage
		          restrictions. This is an integer value.
		sitting: Item can't be used while sitting.

Stack: Prevents an item to be stacked more than x times in given
       inventory types. Generally used by 3rd class related skill items.
       Syntax: [amount, type]
    Available types:
       1: Character inventory restriction
       2: Character cart restriction
       4: Account storage restriction
       8: Guild storage restriction
       Note: Stack limit of 0 will disable a restriction.

Sprite: SpriteID will be sent to the client instead of ItemID.
        NOTE: Replaces an item client-side while keeping them separate server-side.
              Think of it as a way to disguise items.

Script: Script to execute when the item is used/equipped.

OnEquipScript: Script to execute when the item is equipped.
               Warning, not all item bonuses will work here as expected.

OnUnequipScript: Script to execute when the item is unequipped.
                 Warning, not all item bonuses will work here as expected.

Inherit: This can be used only in item_db2.conf, and if set to true, and the
         item already exists in item_db.conf, all the missing fields will be
         inherited from there rather than using their default values.