Horizon Official Technical Documentation
ItemDefinitions.hpp
Go to the documentation of this file.
1/***************************************************
2 * _ _ _ *
3 * | | | | (_) *
4 * | |_| | ___ _ __ _ _______ _ __ *
5 * | _ |/ _ \| '__| |_ / _ \| '_ \ *
6 * | | | | (_) | | | |/ / (_) | | | | *
7 * \_| |_/\___/|_| |_/___\___/|_| |_| *
8 ***************************************************
9 * This file is part of Horizon (c).
10 * Copyright (c) 2019 Sagun K. (sagunxp@gmail.com).
11 * Copyright (c) 2019 Horizon Dev Team.
12 *
13 * Base Author - Sagun K. (sagunxp@gmail.com)
14 *
15 * This library is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * This library is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this library. If not, see <http://www.gnu.org/licenses/>.
27 **************************************************/
28
29#ifndef HORIZON_ZONE_ITEM_DEFINITIONS
30#define HORIZON_ZONE_ITEM_DEFINITIONS
31
33#include <string>
34#include <vector>
35#include <memory>
36#include <array>
37
38#define ITEM_NAME_LENGTH 50
39#define UNKNOWN_ITEM_ID 512 // Apple
40
41#define MAX_ITEM_OPTIONS 5
42#define MAX_ITEM_SLOTS 4
43#define MAX_REFINE_LEVEL 20
44
45static_assert(MAX_ITEM_OPTIONS >= 0, "MAX_ITEM_OPTIONS cannot be less than 0.");
46static_assert(MAX_ITEM_OPTIONS <= 5,
47 "MAX_ITEM_OPTIONS is limited by the client and database layout "
48 "and should not be changed unless supported by the client.");
49static_assert(MAX_ITEM_SLOTS > 0 && MAX_ITEM_SLOTS <= 4,
50 "MAX_ITEM_SLOTS is limited by the client and database layout "
51 "and should not be changed unless supported by the client.");
52
53#define MIN_INVENTORY_SIZE 100
54#define MAX_INVENTORY_SIZE 300
55
57 "Max Inventory should be greater than minimum storage size of 1.");
58
59#define MIN_STORAGE_SIZE 600
60#define MAX_STORAGE_SIZE 600
61
63 "Max storage should be greater than minimum storage size of 1.");
64
65#define MAX_INVENTORY_STACK_LIMIT 30000
66#define MAX_CART_STACK_LIMIT 30000
67#define MAX_STORAGE_STACK_LIMIT 30000
68#define MAX_GSTORAGE_STACK_LIMIT 30000
69
70static_assert(MAX_INVENTORY_STACK_LIMIT > 0,
71 "MAX_INVENTORY_STACK_LIMIT should be greater than 0.");
72static_assert(MAX_CART_STACK_LIMIT > 0,
73 "MAX_CART_STACK_LIMIT should be greater than 0.");
74static_assert(MAX_STORAGE_STACK_LIMIT > 0,
75 "MAX_STORAGE_STACK_LIMIT should be greater than 0.");
76static_assert(MAX_GSTORAGE_STACK_LIMIT > 0,
77 "MAX_GSTORAGE_STACK_LIMIT should be greater than 0.");
78
80{
87};
88
90{
91 REFINE_CHANCE_TYPE_NORMAL = 0, // Normal Chance
92 REFINE_CHANCE_TYPE_ENRICHED = 1, // Enriched Ore Chance
93 REFINE_CHANCE_TYPE_E_NORMAL = 2, // Event Normal Ore Chance
94 REFINE_CHANCE_TYPE_E_ENRICHED = 3, // Event Enriched Ore Chance
96};
97
99{
125 // dual-wield constants
132#ifndef MAX_WEAPON_TYPE
134#endif
135};
136
138{
139 IT_WTM_RANGED = (1ULL << IT_WT_BOW) | (1ULL << IT_WT_WHIP) | (1ULL << IT_WT_MUSICAL)
140 | (1ULL << IT_WT_RIFLE) | (1ULL < IT_WT_GATLING) | (1ULL << IT_WT_SHOTGUN)
141 | (1ULL << IT_WT_REVOLVER) | (1ULL << IT_WT_GRENADE),
142 IT_WTM_MELEE = (1ULL << IT_WT_DAGGER)| (1ULL << IT_WT_1HSWORD) | (1ULL << IT_WT_2HSWORD)
143 | (1ULL << IT_WT_1HSPEAR) | (1ULL << IT_WT_1HAXE) | (1ULL << IT_WT_2HAXE) | (1ULL << IT_WT_1HMACE)
144 | (1ULL << IT_WT_2HMACE) | (1ULL << IT_WT_KNUCKLE) | (1ULL << IT_WT_KATAR)
145 | (1ULL << IT_WT_HUUMA)
147
149{
157
159{
162 IT_GENDER_ANY = 2
164
165//Equip position constants
167{
168 IT_EQPM_NONE = 0x000000,
170 IT_EQPM_HAND_R = 0x000002, //2
171 IT_EQPM_GARMENT = 0x000004, //4
172 IT_EQPM_ACC_L = 0x000008, //8
173 IT_EQPM_ARMOR = 0x000010, //16
174 IT_EQPM_HAND_L = 0x000020, //32
175 IT_EQPM_SHOES = 0x000040, //64
176 IT_EQPM_ACC_R = 0x000080, //128
177 IT_EQPM_HEAD_TOP = 0x000100, //256
178 IT_EQPM_HEAD_MID = 0x000200, //512
179 IT_EQPM_COSTUME_HEAD_TOP = 0x000400, //1024
180 IT_EQPM_COSTUME_HEAD_MID = 0x000800, //2048
181 IT_EQPM_COSTUME_HEAD_LOW = 0x001000, //4096
182 IT_EQPM_COSTUME_GARMENT = 0x002000, //8192
183 //UNUSED_COSTUME_FLOOR = 0x004000, //16384
184 IT_EQPM_AMMO = 0x008000, //32768
185 IT_EQPM_SHADOW_ARMOR = 0x010000, //65536
186 IT_EQPM_SHADOW_WEAPON = 0x020000, //131072
187 IT_EQPM_SHADOW_SHIELD = 0x040000, //262144
188 IT_EQPM_SHADOW_SHOES = 0x080000, //524288
189 IT_EQPM_SHADOW_ACC_R = 0x100000, //1048576
190 IT_EQPM_SHADOW_ACC_L = 0x200000, //2097152
191
192 // Composites
202
204{
228
230{
231 ITRMASK_NONE = 0x0000,
232 ITRMASK_DROP = 0x0001,
233 ITRMASK_TRADE = 0x0002,
236 ITRMASK_CART = 0x0010,
239 ITRMASK_MAIL = 0x0080,
242 ITRMASK_ALL = 0x03ff
244
246{
249 IURMASK_ALL = 0x1
251
252enum item_type : uint8_t
253{
269
271{
284
285enum item_bind_type : uint16_t
286{
294};
295
297{
298 ITEM_INV_ADD_SUCCESS, // * 0 = success
299 ITEM_INV_ADD_INVALID, // * 1 = invalid itemid not found or negative amount
300 ITEM_INV_ADD_OVER_WEIGHT, // * 2 = overweight
302 ITEM_INV_ADD_NO_INV_SPACE, // * 4 = no free place found
303 ITEM_INV_ADD_OVER_QUANTITY, // * 5 = max amount reached
305 ITEM_INV_ADD_OVER_STACK_LIMIT, // * 7 = stack limitation
306};
307
309{
318};
319
321{
325};
326
328{
331};
332
334{
335 uint32_t item_id;
336 std::string name{""}, key_name{""};
337
338 int32_t value_buy{0};
339 int32_t value_sell{0};
340
342
343 union {
346 } sub_type{IT_WT_FIST};
347
349 uint32_t weight{0};
350 int32_t attack{0};
351 int32_t defense{0};
352 int8_t attack_range{0};
354 uint32_t sprite_id{0};
355
356 union {
357 int8_t armor;
358 int8_t weapon;
359 } level{0};
360
361 int32_t magic_atk{0};
362 struct {
363 int32_t max_lv{0};
364 int32_t min_lv{0};
365 std::vector<uint32_t> job_ids;
368
370
371 int delay{0};
372
373 std::string default_script{""};
374 std::string equip_script{""};
375 std::string unequip_script{""};
376
377 struct {
378 unsigned available : 1;
379 unsigned refineable : 1;
380 unsigned consumption_delay : 1;
381 unsigned bind_on_equip : 1;
382 unsigned force_serial : 1;
383 unsigned keep_after_use : 1;
384 unsigned allow_item_options: 1;
385 unsigned drop_announce : 1;
386 unsigned show_drop_effect : 1;
389
390 struct {
391 unsigned int inventory{0};
392 unsigned int cart{0};
393 unsigned int storage{0};
394 unsigned int guild_storage{0};
396
398
401};
402
404{
408
414{
415 item_entry_data() { memset(this, 0, sizeof(*this)); }
416
418
420 {
423 || hire_expire_date > 0
424 )
425 return false;
426 return true;
427 }
428
429 bool operator == (item_entry_data const &right)
430 {
431 if (item_id != right.item_id
432 || bind_type != right.bind_type
434 || unique_id != right.unique_id
435 || type != right.type
436 || info.is_favorite != right.info.is_favorite
437 )
438 return false;
439
440 return true;
441 }
442
443 bool operator != (item_entry_data const &right)
444 {
445 return !(*this == right);
446 }
447
448 // Assignment operator copy constructor
450 {
452 index.inventory = right.index.inventory;
454 index.storage = right.index.storage;
455
456 item_id = right.item_id;
457 type = right.type;
458 amount = right.amount;
462
463 for (int i = 0; i < MAX_ITEM_SLOTS; ++i)
464 slot_item_id[i] = right.slot_item_id[i];
465
468 ele_type = right.ele_type;
469
470 for (int i = 0; i < MAX_ITEM_OPTIONS; ++i)
471 {
472 option_data[i].index = right.option_data[i].index;
473 option_data[i].value = right.option_data[i].value;
474 option_data[i].param = right.option_data[i].param;
475 }
476 bind_type = right.bind_type;
480 sprite_id = right.sprite_id;
481
482 unique_id = right.unique_id;
483 config = right.config;
484 return *this;
485 }
486
487 bool is_favorite() { return info.is_favorite; }
488 void set_favorite(bool val) { info.is_favorite = val; }
489
490 bool is_broken() { return info.is_broken; }
491 void set_broken(bool val) { info.is_broken = val; }
492
494 void set_identified(bool val) { info.is_identified = val; }
495
496 uint32_t get_item_id() { return item_id; }
497 void set_item_id(uint32_t id) { item_id = id; }
498
499 uint16_t get_amount() { return amount; }
500 void set_amount(uint16_t amt) { amount = amt; }
501
504
507
508 uint8_t get_refine_level() { return refine_level; }
509 void set_refine_level(int lvl) { refine_level = lvl; }
510
512 void set_hire_expire_date(int date) { hire_expire_date = date; }
513
516
517 uint8_t get_option_count() { return option_count; }
519
520 uint16_t get_sprite_id() { return sprite_id; }
521 void set_sprite_id(uint16_t id) { sprite_id = id; }
522
523 union {
524 uint16_t inventory;
525 uint16_t storage;
526 } index{0};
527
529#if (CLIENT_TYPE == 'M' && PACKET_VERSION >= 20181121) || \
530 (CLIENT_TYPE == 'R' && PACKET_VERSION >= 20180704) || \
531 (CLIENT_TYPE == 'Z' && PACKET_VERSION >= 20181114)
532 uint32_t item_id{0};
533#else
534 uint16_t item_id{0};
535#endif
537 uint16_t amount{0};
540 uint8_t refine_level{0};
541#if (CLIENT_TYPE == 'M' && PACKET_VERSION >= 20181121) || \
542 (CLIENT_TYPE == 'R' && PACKET_VERSION >= 20180704) || \
543 (CLIENT_TYPE == 'Z' && PACKET_VERSION >= 20181114)
545#else
546 uint16_t slot_item_id[MAX_ITEM_SLOTS]{0};
547#endif
548 uint32_t hire_expire_date{0};
549 uint16_t sprite_id{0};
550
552 uint8_t option_count{0};
553 struct options {
554 int16_t get_index() const { return index; }
555 void set_index(int idx) { index = idx; }
556
557 int16_t get_value() const { return value; }
558 void set_value(int val) { value = val; }
559
560 int16_t index{0};
561 int16_t value{0};
562 uint8_t param{0};
565 item_entry_info () { memset(this, 0, sizeof(*this)); }
566 unsigned is_identified : 1;
567 unsigned is_broken : 1;
568 unsigned is_favorite : 1;
569 unsigned spare_bits : 5;
572 uint64_t unique_id{0};
573 // Item configuration data.
574 std::shared_ptr<const item_config_data> config;
575};
576
577typedef std::array<std::pair<item_equip_location_mask, std::weak_ptr<item_entry_data>>, IT_EQPI_MAX> EquipmentListType;
578
579#pragma pack(push, 1)
580struct item_slot {
581#if ((CLIENT_TYPE == 'M' && PACKET_VERSION >= 20181121) || \
582 (CLIENT_TYPE == 'R' && PACKET_VERSION >= 20180704) || \
583 (CLIENT_TYPE == 'Z' && PACKET_VERSION >= 20181114))
585#else
587#endif
588};
589#pragma pack(pop)
590#endif /* HORIZON_ZONE_ITEM_DEFINITIONS */
static const uint8_t mask[8]
Bitmask for accessing individual bits of a byte.
Definition: DES.cpp:71
uint16_t uint16
Definition: Definitions.hpp:40
uint32_t uint32
Definition: Definitions.hpp:39
#define MAX_INVENTORY_STACK_LIMIT
Definition: ItemDefinitions.hpp:65
item_inventory_addition_notif_type
Definition: ItemDefinitions.hpp:297
@ ITEM_INV_ADD_UNKNOWN
Definition: ItemDefinitions.hpp:301
@ ITEM_INV_ADD_OVER_WEIGHT
Definition: ItemDefinitions.hpp:300
@ ITEM_INV_ADD_SUCCESS
Definition: ItemDefinitions.hpp:298
@ ITEM_INV_ADD_NO_INV_SPACE
Definition: ItemDefinitions.hpp:302
@ ITEM_INV_ADD_OVER_STACK_LIMIT
Definition: ItemDefinitions.hpp:305
@ ITEM_INV_ADD_UNKNOWN2
Definition: ItemDefinitions.hpp:304
@ ITEM_INV_ADD_INVALID
Definition: ItemDefinitions.hpp:299
@ ITEM_INV_ADD_OVER_QUANTITY
Definition: ItemDefinitions.hpp:303
item_equip_result_type
Definition: ItemDefinitions.hpp:321
@ IT_EQUIP_FAIL
Definition: ItemDefinitions.hpp:324
@ IT_EQUIP_SUCCESS
Definition: ItemDefinitions.hpp:322
@ IT_EQUIP_FAIL_LV
Definition: ItemDefinitions.hpp:323
item_ammunition_type
Definition: ItemDefinitions.hpp:271
@ IT_AT_BULLET
Definition: ItemDefinitions.hpp:275
@ IT_AT_CANNONBALL
Definition: ItemDefinitions.hpp:280
@ IT_AT_KUNAI
Definition: ItemDefinitions.hpp:279
@ IT_AT_GRENADE
Definition: ItemDefinitions.hpp:277
@ IT_AT_SHURIKEN
Definition: ItemDefinitions.hpp:278
@ IT_AT_SHELL
Definition: ItemDefinitions.hpp:276
@ IT_AT_DAGGER
Definition: ItemDefinitions.hpp:274
@ IT_AT_ARROW
Definition: ItemDefinitions.hpp:273
@ IT_AT_NONE
Definition: ItemDefinitions.hpp:272
@ IT_AT_MAX
Definition: ItemDefinitions.hpp:282
@ IT_AT_THROWABLE_ITEM
Definition: ItemDefinitions.hpp:281
refine_type
Definition: ItemDefinitions.hpp:80
@ REFINE_TYPE_WEAPON1
Definition: ItemDefinitions.hpp:82
@ REFINE_TYPE_WEAPON4
Definition: ItemDefinitions.hpp:85
@ REFINE_TYPE_ARMOR
Definition: ItemDefinitions.hpp:81
@ REFINE_TYPE_WEAPON2
Definition: ItemDefinitions.hpp:83
@ REFINE_TYPE_MAX
Definition: ItemDefinitions.hpp:86
@ REFINE_TYPE_WEAPON3
Definition: ItemDefinitions.hpp:84
#define MIN_STORAGE_SIZE
Definition: ItemDefinitions.hpp:59
#define MAX_INVENTORY_SIZE
Definition: ItemDefinitions.hpp:54
item_transaction_mask
Definition: ItemDefinitions.hpp:230
@ ITRMASK_AUCTION
Item can be auctioned.
Definition: ItemDefinitions.hpp:240
@ ITRMASK_DROP
Item can be dropped.
Definition: ItemDefinitions.hpp:232
@ ITRMASK_TRADE
Item can be traded (nor vended)
Definition: ItemDefinitions.hpp:233
@ ITRMASK_SELL_TO_NPC
Item can be sold to NPCs.
Definition: ItemDefinitions.hpp:235
@ ITRMASK_BUYING_STORE
Item can be listed in the buying store.
Definition: ItemDefinitions.hpp:241
@ ITRMASK_ALL
Sum of all the above values.
Definition: ItemDefinitions.hpp:242
@ ITRMASK_TRADEWPARTNER
Wedded partner can override ITR_NOTRADE restriction.
Definition: ItemDefinitions.hpp:234
@ ITRMASK_NONE
No restrictions.
Definition: ItemDefinitions.hpp:231
@ ITRMASK_MAIL
Item can be attached to mail messages.
Definition: ItemDefinitions.hpp:239
@ ITRMASK_CART
Item can be placed in the cart.
Definition: ItemDefinitions.hpp:236
@ ITRMASK_STORAGE
Item can be placed in the storage.
Definition: ItemDefinitions.hpp:237
@ ITRMASK_GSTORAGE
Item can be placed in the guild storage.
Definition: ItemDefinitions.hpp:238
#define MAX_CART_STACK_LIMIT
Definition: ItemDefinitions.hpp:66
#define MAX_STORAGE_STACK_LIMIT
Definition: ItemDefinitions.hpp:67
item_deletion_reason_type
Definition: ItemDefinitions.hpp:309
@ ITEM_DEL_NORMAL
Definition: ItemDefinitions.hpp:310
@ ITEM_DEL_TOSTORAGE
Material changed.
Definition: ItemDefinitions.hpp:314
@ ITEM_DEL_FAILREFINE
Item used for a skill.
Definition: ItemDefinitions.hpp:312
@ ITEM_DEL_MATERIALCHANGE
Refine failed.
Definition: ItemDefinitions.hpp:313
@ ITEM_DEL_SKILLUSE
Normal.
Definition: ItemDefinitions.hpp:311
@ ITEM_DEL_TOCART
Moved to storage.
Definition: ItemDefinitions.hpp:315
@ ITEM_DEL_ANALYSIS
Item sold.
Definition: ItemDefinitions.hpp:317
@ ITEM_DEL_SOLD
Moved to cart.
Definition: ItemDefinitions.hpp:316
item_type
Definition: ItemDefinitions.hpp:253
@ IT_TYPE_ETC
Definition: ItemDefinitions.hpp:257
@ IT_TYPE_PET_ARMOR
Definition: ItemDefinitions.hpp:262
@ IT_TYPE_CASH
Definition: ItemDefinitions.hpp:266
@ IT_TYPE_HEALING
Definition: ItemDefinitions.hpp:254
@ IT_TYPE_UNKNOWN
Definition: ItemDefinitions.hpp:255
@ IT_TYPE_PET_EGG
Definition: ItemDefinitions.hpp:261
@ IT_TYPE_USABLE
Definition: ItemDefinitions.hpp:256
@ IT_TYPE_CONSUMPTION_DELAY
Definition: ItemDefinitions.hpp:265
@ IT_TYPE_ARMOR
Definition: ItemDefinitions.hpp:259
@ IT_TYPE_WEAPON
Definition: ItemDefinitions.hpp:258
@ IT_TYPE_MAX
Definition: ItemDefinitions.hpp:267
@ IT_TYPE_CARD
Definition: ItemDefinitions.hpp:260
@ IT_TYPE_UNKNOWN2
Definition: ItemDefinitions.hpp:263
@ IT_TYPE_AMMO
Definition: ItemDefinitions.hpp:264
#define MAX_ITEM_SLOTS
Definition: ItemDefinitions.hpp:42
item_equip_location_index
Definition: ItemDefinitions.hpp:204
@ IT_EQPI_ACC_L
Definition: ItemDefinitions.hpp:205
@ IT_EQPI_SHADOW_ACC_L
Definition: ItemDefinitions.hpp:225
@ IT_EQPI_COSTUME_LOW
Definition: ItemDefinitions.hpp:217
@ IT_EQPI_HAND_L
Definition: ItemDefinitions.hpp:213
@ IT_EQPI_SHADOW_SHIELD
Definition: ItemDefinitions.hpp:222
@ IT_EQPI_SHADOW_ARMOR
Definition: ItemDefinitions.hpp:220
@ IT_EQPI_SHOES
Definition: ItemDefinitions.hpp:207
@ IT_EQPI_AMMO
Definition: ItemDefinitions.hpp:219
@ IT_EQPI_COSTUME_GARMENT
Definition: ItemDefinitions.hpp:218
@ IT_EQPI_SHADOW_WEAPON
Definition: ItemDefinitions.hpp:221
@ IT_EQPI_HEAD_LOW
Definition: ItemDefinitions.hpp:209
@ IT_EQPI_GARMENT
Definition: ItemDefinitions.hpp:208
@ IT_EQPI_HEAD_MID
Definition: ItemDefinitions.hpp:210
@ IT_EQPI_HAND_R
Definition: ItemDefinitions.hpp:214
@ IT_EQPI_ARMOR
Definition: ItemDefinitions.hpp:212
@ IT_EQPI_COSTUME_MID
Definition: ItemDefinitions.hpp:216
@ IT_EQPI_MAX
Definition: ItemDefinitions.hpp:226
@ IT_EQPI_ACC_R
Definition: ItemDefinitions.hpp:206
@ IT_EQPI_SHADOW_ACC_R
Definition: ItemDefinitions.hpp:224
@ IT_EQPI_COSTUME_TOP
Definition: ItemDefinitions.hpp:215
@ IT_EQPI_HEAD_TOP
Definition: ItemDefinitions.hpp:211
@ IT_EQPI_SHADOW_SHOES
Definition: ItemDefinitions.hpp:223
item_bind_type
Definition: ItemDefinitions.hpp:286
@ IT_BIND_ACCOUNT
Definition: ItemDefinitions.hpp:289
@ IT_BIND_PARTY
Definition: ItemDefinitions.hpp:291
@ IT_BIND_GUILD
Definition: ItemDefinitions.hpp:290
@ IT_BIND_MAX
Definition: ItemDefinitions.hpp:293
@ IT_BIND_MIN
Definition: ItemDefinitions.hpp:288
@ IT_BIND_CHARACTER
Definition: ItemDefinitions.hpp:292
@ IT_BIND_NONE
Definition: ItemDefinitions.hpp:287
item_storage_type
Definition: ItemDefinitions.hpp:404
@ ITEM_STORE_INVENTORY
Definition: ItemDefinitions.hpp:405
@ ITEM_STORE_STORAGE
Definition: ItemDefinitions.hpp:406
item_equip_location_mask
Definition: ItemDefinitions.hpp:167
@ IT_EQPM_SHADOW_WEAPON
Definition: ItemDefinitions.hpp:186
@ IT_EQPM_SHADOW_ACC_R
Definition: ItemDefinitions.hpp:189
@ IT_EQPM_SHOES
Definition: ItemDefinitions.hpp:175
@ IT_EQPM_COSTUME_HEAD_TOP
Definition: ItemDefinitions.hpp:179
@ IT_EQPM_AMMO
Definition: ItemDefinitions.hpp:184
@ IT_EQPM_ARMOR
Definition: ItemDefinitions.hpp:173
@ IT_EQPM_HEAD_MID
Definition: ItemDefinitions.hpp:178
@ IT_EQPM_ACC
Definition: ItemDefinitions.hpp:197
@ IT_EQPM_SHADOW_ACC
Definition: ItemDefinitions.hpp:199
@ IT_EQPM_COSTUME
Definition: ItemDefinitions.hpp:198
@ IT_EQPM_SHADOW_ARMS
Definition: ItemDefinitions.hpp:200
@ IT_EQPM_HAND_R
Definition: ItemDefinitions.hpp:170
@ IT_EQPM_WEAPON
Definition: ItemDefinitions.hpp:193
@ IT_EQPM_HELM
Definition: ItemDefinitions.hpp:196
@ IT_EQPM_HEAD_LOW
Definition: ItemDefinitions.hpp:169
@ IT_EQPM_HEAD_TOP
Definition: ItemDefinitions.hpp:177
@ IT_EQPM_SHADOW_SHOES
Definition: ItemDefinitions.hpp:188
@ IT_EQPM_HAND_L
Definition: ItemDefinitions.hpp:174
@ IT_EQPM_SHIELD
Definition: ItemDefinitions.hpp:194
@ IT_EQPM_ARMS
Definition: ItemDefinitions.hpp:195
@ IT_EQPM_COSTUME_HEAD_LOW
Definition: ItemDefinitions.hpp:181
@ IT_EQPM_SHADOW_ARMOR
Definition: ItemDefinitions.hpp:185
@ IT_EQPM_COSTUME_GARMENT
Definition: ItemDefinitions.hpp:182
@ IT_EQPM_SHADOW_SHIELD
Definition: ItemDefinitions.hpp:187
@ IT_EQPM_COSTUME_HEAD_MID
Definition: ItemDefinitions.hpp:180
@ IT_EQPM_ACC_R
Definition: ItemDefinitions.hpp:176
@ IT_EQPM_ACC_L
Definition: ItemDefinitions.hpp:172
@ IT_EQPM_NONE
Definition: ItemDefinitions.hpp:168
@ IT_EQPM_GARMENT
Definition: ItemDefinitions.hpp:171
@ IT_EQPM_SHADOW_ACC_L
Definition: ItemDefinitions.hpp:190
#define MAX_GSTORAGE_STACK_LIMIT
Definition: ItemDefinitions.hpp:68
item_weapon_type_mask
Definition: ItemDefinitions.hpp:138
@ IT_WTM_MELEE
Definition: ItemDefinitions.hpp:142
@ IT_WTM_RANGED
Definition: ItemDefinitions.hpp:139
item_unequip_result_type
Definition: ItemDefinitions.hpp:328
@ IT_UNEQUIP_FAIL
Definition: ItemDefinitions.hpp:330
@ IT_UNEQUIP_SUCCESS
Definition: ItemDefinitions.hpp:329
item_weapon_type
Definition: ItemDefinitions.hpp:99
@ IT_WT_FIST
Bare hands.
Definition: ItemDefinitions.hpp:100
@ IT_WT_1HSWORD
Definition: ItemDefinitions.hpp:102
@ IT_WT_KATAR
Definition: ItemDefinitions.hpp:116
@ IT_WT_2HSPEAR
Definition: ItemDefinitions.hpp:105
@ IT_WT_2HMACE
Definition: ItemDefinitions.hpp:109
@ IT_WT_GATLING
Definition: ItemDefinitions.hpp:119
@ IT_WT_GRENADE
Definition: ItemDefinitions.hpp:121
@ IT_WT_DOUBLE_DAGGER_AXE
dagger + axe
Definition: ItemDefinitions.hpp:130
@ IT_WT_RIFLE
Definition: ItemDefinitions.hpp:118
@ IT_WT_2HAXE
Definition: ItemDefinitions.hpp:107
@ IT_WT_BOW
Definition: ItemDefinitions.hpp:111
@ IT_WT_2HSTAFF
Definition: ItemDefinitions.hpp:123
@ IT_WT_SHOTGUN
Definition: ItemDefinitions.hpp:120
@ IT_WT_DOUBLE_SWORDS
2 swords
Definition: ItemDefinitions.hpp:127
@ IT_WT_HUUMA
Definition: ItemDefinitions.hpp:122
@ IT_WT_1HSPEAR
Definition: ItemDefinitions.hpp:104
@ IT_WT_BOOK
Definition: ItemDefinitions.hpp:115
@ IT_WT_WHIP
Definition: ItemDefinitions.hpp:114
@ IT_WT_MUSICAL
Definition: ItemDefinitions.hpp:113
@ IT_WT_DOUBLE_DAGGER_SWORD
dagger + sword
Definition: ItemDefinitions.hpp:129
@ IT_WT_STAFF
Definition: ItemDefinitions.hpp:110
@ IT_WT_MAX_WEAPON_TYPE
Definition: ItemDefinitions.hpp:133
@ IT_WT_KNUCKLE
Definition: ItemDefinitions.hpp:112
@ IT_WT_DOUBLE_SWORD_AXE
sword + axe
Definition: ItemDefinitions.hpp:131
@ IT_WT_2HSWORD
Definition: ItemDefinitions.hpp:103
@ IT_WT_1HAXE
Definition: ItemDefinitions.hpp:106
@ IT_WT_1HMACE
Definition: ItemDefinitions.hpp:108
@ IT_WT_DAGGER
Definition: ItemDefinitions.hpp:101
@ IT_WT_DOUBLE_AXES
2 axes
Definition: ItemDefinitions.hpp:128
@ IT_WT_REVOLVER
Definition: ItemDefinitions.hpp:117
@ IT_WT_DOUBLE_DAGGERS
2 daggers
Definition: ItemDefinitions.hpp:126
@ IT_WT_SINGLE_MAX
Definition: ItemDefinitions.hpp:124
item_usage_restriction_mask
Definition: ItemDefinitions.hpp:246
@ IURMASK_NONE
No restrictions.
Definition: ItemDefinitions.hpp:247
@ IURMASK_ALL
Sum of all the above values.
Definition: ItemDefinitions.hpp:249
@ IURMASK_SITTING
Item can't be used while sitting.
Definition: ItemDefinitions.hpp:248
refine_chance_type
Definition: ItemDefinitions.hpp:90
@ REFINE_CHANCE_TYPE_ENRICHED
Definition: ItemDefinitions.hpp:92
@ REFINE_CHANCE_TYPE_MAX
Definition: ItemDefinitions.hpp:95
@ REFINE_CHANCE_TYPE_E_NORMAL
Definition: ItemDefinitions.hpp:93
@ REFINE_CHANCE_TYPE_NORMAL
Definition: ItemDefinitions.hpp:91
@ REFINE_CHANCE_TYPE_E_ENRICHED
Definition: ItemDefinitions.hpp:94
item_gender_type
Definition: ItemDefinitions.hpp:159
@ IT_GENDER_FEMALE
Definition: ItemDefinitions.hpp:160
@ IT_GENDER_ANY
Definition: ItemDefinitions.hpp:162
@ IT_GENDER_MALE
Definition: ItemDefinitions.hpp:161
item_level_type
Definition: ItemDefinitions.hpp:149
@ IT_LVL_WEAPON3
Definition: ItemDefinitions.hpp:153
@ IT_LVL_ARMOR
Definition: ItemDefinitions.hpp:150
@ IT_LVL_MAX
Definition: ItemDefinitions.hpp:155
@ IT_LVL_WEAPON2
Definition: ItemDefinitions.hpp:152
@ IT_LVL_WEAPON4
Definition: ItemDefinitions.hpp:154
@ IT_LVL_WEAPON1
Definition: ItemDefinitions.hpp:151
#define MAX_ITEM_OPTIONS
Definition: ItemDefinitions.hpp:41
#define MIN_INVENTORY_SIZE
Definition: ItemDefinitions.hpp:53
#define MAX_STORAGE_SIZE
Definition: ItemDefinitions.hpp:60
std::array< std::pair< item_equip_location_mask, std::weak_ptr< item_entry_data > >, IT_EQPI_MAX > EquipmentListType
Definition: ItemDefinitions.hpp:577
element_type
Definition: UnitDefinitions.hpp:970
@ ELE_NEUTRAL
Definition: UnitDefinitions.hpp:971
size_t count(GridTypeListContainer< SPECIFIC_TYPE > const &elements, SPECIFIC_TYPE *)
Definition: GridReferenceContainer.hpp:100
Definition: ItemDefinitions.hpp:334
std::string default_script
Default script for everything.
Definition: ItemDefinitions.hpp:373
int8_t attack_range
Definition: ItemDefinitions.hpp:352
int drop_effect_mode
Definition: ItemDefinitions.hpp:369
int8_t armor
Definition: ItemDefinitions.hpp:357
int32_t min_lv
Definition: ItemDefinitions.hpp:364
unsigned trade_restriction_mask
Item trade restrictions mask (.
Definition: ItemDefinitions.hpp:387
unsigned bind_on_equip
Definition: ItemDefinitions.hpp:381
item_ammunition_type ammo_t
Definition: ItemDefinitions.hpp:345
int32_t value_buy
Definition: ItemDefinitions.hpp:338
unsigned int storage
Definition: ItemDefinitions.hpp:393
int32_t max_lv
Definition: ItemDefinitions.hpp:363
std::string equip_script
Script executed once when equipping.
Definition: ItemDefinitions.hpp:374
int8_t weapon
Definition: ItemDefinitions.hpp:358
int trade_restriction_group_override_id
Definition: ItemDefinitions.hpp:399
struct item_config_data::@130 stack
unsigned consumption_delay
Signifies items that are not consumed immediately upon double-click.
Definition: ItemDefinitions.hpp:380
unsigned int inventory
Definition: ItemDefinitions.hpp:391
struct item_config_data::@128 requirements
int32_t defense
Definition: ItemDefinitions.hpp:351
std::string key_name
Definition: ItemDefinitions.hpp:336
item_weapon_type weapon_t
Definition: ItemDefinitions.hpp:344
std::vector< uint32_t > job_ids
Definition: ItemDefinitions.hpp:365
item_gender_type gender
Definition: ItemDefinitions.hpp:366
int delay
Definition: ItemDefinitions.hpp:371
std::string unequip_script
Script executed once when unequipping.
Definition: ItemDefinitions.hpp:375
unsigned refineable
Definition: ItemDefinitions.hpp:379
uint64_t equip_location_mask
Definition: ItemDefinitions.hpp:348
item_type type
Definition: ItemDefinitions.hpp:341
unsigned keep_after_use
Definition: ItemDefinitions.hpp:383
unsigned int guild_storage
Definition: ItemDefinitions.hpp:394
int usage_restriction_group_override_id
Definition: ItemDefinitions.hpp:397
int32_t attack
Definition: ItemDefinitions.hpp:350
int32_t value_sell
Definition: ItemDefinitions.hpp:339
unsigned force_serial
Definition: ItemDefinitions.hpp:382
unsigned allow_item_options
disallows use of item options on the item. (non-equippable items are automatically flagged)
Definition: ItemDefinitions.hpp:384
unsigned int cart
Definition: ItemDefinitions.hpp:392
unsigned drop_announce
Official Drop Announce.
Definition: ItemDefinitions.hpp:385
int usage_restriction_mask
Definition: ItemDefinitions.hpp:397
union item_config_data::@126 IT_WT_FIST
unsigned available
Definition: ItemDefinitions.hpp:378
union item_config_data::@127 level
bool trade_restriction_partner_override
Definition: ItemDefinitions.hpp:400
std::string name
Definition: ItemDefinitions.hpp:336
int32_t magic_atk
Definition: ItemDefinitions.hpp:361
uint32_t item_id
Definition: ItemDefinitions.hpp:335
uint32_t weight
Definition: ItemDefinitions.hpp:349
struct item_config_data::@129 config
unsigned show_drop_effect
Shows Drop Effect.
Definition: ItemDefinitions.hpp:386
int8_t card_slot_count
Definition: ItemDefinitions.hpp:353
uint32_t sprite_id
Definition: ItemDefinitions.hpp:354
Definition: ItemDefinitions.hpp:564
unsigned is_favorite
Definition: ItemDefinitions.hpp:568
unsigned is_broken
Definition: ItemDefinitions.hpp:567
unsigned spare_bits
Definition: ItemDefinitions.hpp:569
unsigned is_identified
Definition: ItemDefinitions.hpp:566
item_entry_info()
Definition: ItemDefinitions.hpp:565
Definition: ItemDefinitions.hpp:553
int16_t get_index() const
Definition: ItemDefinitions.hpp:554
void set_index(int idx)
Definition: ItemDefinitions.hpp:555
int16_t index
Definition: ItemDefinitions.hpp:560
void set_value(int val)
Definition: ItemDefinitions.hpp:558
int16_t get_value() const
Definition: ItemDefinitions.hpp:557
int16_t value
Definition: ItemDefinitions.hpp:561
uint8_t param
Definition: ItemDefinitions.hpp:562
Structure used to store and convey item data in the state machine and in communication with the clien...
Definition: ItemDefinitions.hpp:414
void set_item_id(uint32_t id)
Definition: ItemDefinitions.hpp:497
void set_amount(uint16_t amt)
Definition: ItemDefinitions.hpp:500
uint32_t actual_equip_location_mask
Definition: ItemDefinitions.hpp:539
uint16_t sprite_id
Definition: ItemDefinitions.hpp:549
void set_bind_type(item_bind_type val)
Definition: ItemDefinitions.hpp:515
uint64_t unique_id
Definition: ItemDefinitions.hpp:572
struct item_entry_data::options option_data[MAX_ITEM_OPTIONS]
uint8_t option_count
Definition: ItemDefinitions.hpp:552
item_entry_data()
Definition: ItemDefinitions.hpp:415
void set_actual_equip_location_mask(uint32_t mask)
Definition: ItemDefinitions.hpp:506
uint32_t get_item_id()
Definition: ItemDefinitions.hpp:496
uint32_t current_equip_location_mask
Definition: ItemDefinitions.hpp:538
bool is_stackable()
Definition: ItemDefinitions.hpp:419
void set_option_count(uint8_t count)
Definition: ItemDefinitions.hpp:518
bool operator!=(item_entry_data const &right)
Definition: ItemDefinitions.hpp:443
uint16_t storage
Definition: ItemDefinitions.hpp:525
item_bind_type get_bind_type()
Definition: ItemDefinitions.hpp:514
bool is_equipment()
Definition: ItemDefinitions.hpp:417
uint16_t get_amount()
Definition: ItemDefinitions.hpp:499
element_type ele_type
Definition: ItemDefinitions.hpp:551
void set_broken(bool val)
Definition: ItemDefinitions.hpp:491
void set_identified(bool val)
Definition: ItemDefinitions.hpp:494
uint16_t get_sprite_id()
Definition: ItemDefinitions.hpp:520
item_bind_type bind_type
Definition: ItemDefinitions.hpp:571
uint16_t inventory
Definition: ItemDefinitions.hpp:524
uint32_t slot_item_id[MAX_ITEM_SLOTS]
Definition: ItemDefinitions.hpp:544
bool operator==(item_entry_data const &right)
Definition: ItemDefinitions.hpp:429
item_type type
Definition: ItemDefinitions.hpp:536
void set_sprite_id(uint16_t id)
Definition: ItemDefinitions.hpp:521
uint32_t get_current_equip_location_mask()
Definition: ItemDefinitions.hpp:502
uint32_t item_id
Definition: ItemDefinitions.hpp:532
item_entry_data operator=(item_entry_data const &right)
Definition: ItemDefinitions.hpp:449
union item_entry_data::@131 index
uint32_t hire_expire_date
Definition: ItemDefinitions.hpp:548
std::shared_ptr< const item_config_data > config
Definition: ItemDefinitions.hpp:574
bool is_favorite()
Definition: ItemDefinitions.hpp:487
uint8_t refine_level
Definition: ItemDefinitions.hpp:540
uint8_t get_refine_level()
Definition: ItemDefinitions.hpp:508
void set_favorite(bool val)
Definition: ItemDefinitions.hpp:488
struct item_entry_data::item_entry_info info
uint32_t get_actual_equip_location_mask()
Definition: ItemDefinitions.hpp:505
uint32_t get_hire_expire_date()
Definition: ItemDefinitions.hpp:511
void set_current_equip_location_mask(uint32_t mask)
Definition: ItemDefinitions.hpp:503
bool is_identified()
Definition: ItemDefinitions.hpp:493
void set_refine_level(int lvl)
Definition: ItemDefinitions.hpp:509
uint16_t amount
Definition: ItemDefinitions.hpp:537
void set_hire_expire_date(int date)
Definition: ItemDefinitions.hpp:512
uint8_t get_option_count()
Definition: ItemDefinitions.hpp:517
item_storage_type storage_type
Definition: ItemDefinitions.hpp:528
bool is_broken()
Definition: ItemDefinitions.hpp:490
Definition: ItemDefinitions.hpp:580
uint32 item_id[MAX_ITEM_SLOTS]
Definition: ItemDefinitions.hpp:584