summaryrefslogtreecommitdiff
path: root/src/map/itemdb.h
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2013-11-08 07:18:40 +0100
committerHaru <haru@dotalux.com>2013-11-14 20:15:28 +0100
commited72a947a6c97804c1eef5b80bfa49d99f7d7586 (patch)
treef9196c943010e26c13c12d38c7a622d43301a4cd /src/map/itemdb.h
parent7d0a63b72f93c05b302c08cfb19d5651cef1cdb8 (diff)
downloadhercules-ed72a947a6c97804c1eef5b80bfa49d99f7d7586.tar.gz
hercules-ed72a947a6c97804c1eef5b80bfa49d99f7d7586.tar.bz2
hercules-ed72a947a6c97804c1eef5b80bfa49d99f7d7586.tar.xz
hercules-ed72a947a6c97804c1eef5b80bfa49d99f7d7586.zip
Item DB overhaul
http://hercules.ws/board/topic/2954-item-db-file-structure-overhaul - Item db was changed to libconfig format. - This new format is larger than the original format, but it's less subject to conflicts when some items are edited and the file gets updated. - It is no longer necessary to specify fields with no value, and only the actually used fields are specified. - Items scripts (especially the long ones) are made more readable by splitting them into multiple lines, with proper indentation. - A converter perl script is provided in the tools directory (and a link to the web-based version of the same script canbe found in the above forum topic) - All of this was made possible thanks to Ind, Yommy. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/itemdb.h')
-rw-r--r--src/map/itemdb.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/map/itemdb.h b/src/map/itemdb.h
index 80d2fd0ce..870ecce58 100644
--- a/src/map/itemdb.h
+++ b/src/map/itemdb.h
@@ -105,6 +105,17 @@ enum e_chain_cache {
ECC_MAX,
};
+enum item_class_upper {
+ ITEMUPPER_NONE = 0x00,
+ ITEMUPPER_NORMAL = 0x01,
+ ITEMUPPER_UPPER = 0x02,
+ ITEMUPPER_BABY = 0x04,
+ ITEMUPPER_THIRD = 0x08,
+ ITEMUPPER_THURDUPPER = 0x10,
+ ITEMUPPER_THIRDBABY = 0x20,
+ ITEMUPPER_ALL = 0x3f, // Sum of all the above
+};
+
struct item_data {
uint16 nameid;
char name[ITEM_NAME_LENGTH],jname[ITEM_NAME_LENGTH];
@@ -125,10 +136,8 @@ struct item_data {
int elv;
int wlv;
int view_id;
-#ifdef RENEWAL
int matk;
int elvmax;/* maximum level for this item */
-#endif
int delay;
//Lupus: I rearranged order of these fields due to compatibility with ITEMINFO script command
@@ -300,7 +309,6 @@ struct itemdb_interface {
int (*search_name_array) (struct item_data** data, int size, const char *str, int flag);
struct item_data* (*load)(int nameid);
struct item_data* (*search)(int nameid);
- int (*parse_dbrow) (char** str, const char* source, int line, int scriptopt);
struct item_data* (*exists) (int nameid);
bool (*in_group) (struct item_group *group, int nameid);
int (*group_item) (struct item_group *group);
@@ -338,7 +346,9 @@ struct itemdb_interface {
int (*combo_split_atoi) (char *str, int *val);
void (*read_combos) ();
int (*gendercheck) (struct item_data *id);
- void (*re_split_atoi) (char *str, int *atk, int *matk);
+ int (*validate_entry) (struct item_data *entry, 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) (void);
int (*read_sqldb) (void);
uint64 (*unique_id) (int8 flag, int64 value);