diff options
Diffstat (limited to 'src/map/itemdb.h')
-rw-r--r-- | src/map/itemdb.h | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/src/map/itemdb.h b/src/map/itemdb.h index 198d7a542..902e6e5e9 100644 --- a/src/map/itemdb.h +++ b/src/map/itemdb.h @@ -41,7 +41,9 @@ enum item_itemid { ITEMID_YELLOW_POTION = 503, ITEMID_WHITE_POTION = 504, ITEMID_BLUE_POTION = 505, + ITEMID_APPLE = 512, ITEMID_HOLY_WATER = 523, + ITEMID_PUMPKIN = 535, ITEMID_RED_SLIM_POTION = 545, ITEMID_YELLOW_SLIM_POTION = 546, ITEMID_WHITE_SLIM_POTION = 547, @@ -372,7 +374,7 @@ enum ItemNouseRestrictions { struct item_data { uint16 nameid; char name[ITEM_NAME_LENGTH],jname[ITEM_NAME_LENGTH]; - + //Do not add stuff between value_buy and view_id (see how getiteminfo works) int value_buy; int value_sell; @@ -394,24 +396,25 @@ struct item_data { int delay; //Lupus: I rearranged order of these fields due to compatibility with ITEMINFO script command -// some script commands should be revised as well... - unsigned int class_base[3]; //Specifies if the base can wear this item (split in 3 indexes per type: 1-1, 2-1, 2-2) - unsigned class_upper : 6; //Specifies if the upper-type can equip it (bitfield, 0x01: normal, 0x02: upper, 0x04: baby normal, 0x08: third normal, 0x10: third upper, 0x20: third baby) +// some script commands should be revised as well... + unsigned int class_base[3]; ///< Specifies if the base can wear this item (split in 3 indexes per type: 1-1, 2-1, 2-2) + unsigned class_upper : 6; ///< Specifies if the upper-type can equip it (bitfield, 0x01: normal, 0x02: upper, 0x04: baby normal, 0x08: third normal, 0x10: third upper, 0x20: third baby) struct { unsigned short chance; int id; - } mob[MAX_SEARCH]; //Holds the mobs that have the highest drop rate for this item. [Skotlex] - struct script_code *script; //Default script for everything. - struct script_code *equip_script; //Script executed once when equipping. - struct script_code *unequip_script;//Script executed once when unequipping. + } mob[MAX_SEARCH]; ///< Holds the mobs that have the highest drop rate for this item. [Skotlex] + struct script_code *script; ///< Default script for everything. + struct script_code *equip_script; ///< Script executed once when equipping. + struct script_code *unequip_script; ///< Script executed once when unequipping. struct { unsigned available : 1; - unsigned no_refine : 1; // [celest] - unsigned delay_consume : 1; // Signifies items that are not consumed immediately upon double-click [Skotlex] - unsigned trade_restriction : 9; ///< Item trade restrictions mask (@see enum ItemTradeRestrictions) + unsigned no_refine : 1; // [celest] + unsigned delay_consume : 1; ///< Signifies items that are not consumed immediately upon double-click [Skotlex] + unsigned trade_restriction : 9; ///< Item trade restrictions mask (@see enum ItemTradeRestrictions) unsigned autoequip: 1; unsigned buyingstore : 1; unsigned bindonequip : 1; + unsigned keepafteruse : 1; } flag; struct {// item stacking limitation unsigned short amount; @@ -424,13 +427,17 @@ struct item_data { unsigned int flag; ///< Item nouse restriction mask (@see enum ItemNouseRestrictions) unsigned short override; } item_usage; - short gm_lv_trade_override; //GM-level to override trade_restriction + short gm_lv_trade_override; ///< GM-level to override trade_restriction /* bugreport:309 */ struct item_combo **combos; unsigned char combos_count; /* TODO add a pointer to some sort of (struct extra) and gather all the not-common vals into it to save memory */ struct item_group *group; struct item_package *package; + + /* HPM Custom Struct */ + struct HPluginData **hdata; + unsigned int hdatac; }; struct item_combo { @@ -597,6 +604,7 @@ struct itemdb_interface { void (*read_combos) (); int (*gendercheck) (struct item_data *id); int (*validate_entry) (struct item_data *entry, int n, const char *source); + void (*readdb_additional_fields) (int itemid, config_setting_t *it, int n, const char *source); int (*readdb_sql_sub) (Sql *handle, int n, const char *source); int (*readdb_libconfig_sub) (config_setting_t *it, int n, const char *source); int (*readdb_libconfig) (const char *filename); @@ -607,6 +615,8 @@ struct itemdb_interface { int (*final_sub) (DBKey key, DBData *data, va_list ap); void (*clear) (bool total); struct item_combo * (*id2combo) (unsigned short id); + bool (*is_item_usable) (struct item_data *item); + bool (*lookup_const) (const config_setting_t *it, const char *name, int *value); }; struct itemdb_interface *itemdb; |