diff options
author | Haru <haru@dotalux.com> | 2017-09-17 23:52:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-17 23:52:02 +0200 |
commit | d4723731ed75151e0194a0a082db0a906d06502c (patch) | |
tree | 2c134cba7d9c55a5940a136c710396e8ff5de404 /src/plugins/db2sql.c | |
parent | 74d54ad2c3e7a5bff9f0d35c3fb94bc0b77fd7e2 (diff) | |
parent | 5e23e5019a54fe30762471c18272bbc322c442b6 (diff) | |
download | hercules-d4723731ed75151e0194a0a082db0a906d06502c.tar.gz hercules-d4723731ed75151e0194a0a082db0a906d06502c.tar.bz2 hercules-d4723731ed75151e0194a0a082db0a906d06502c.tar.xz hercules-d4723731ed75151e0194a0a082db0a906d06502c.zip |
Merge pull request #1828 from HerculesWS/item_viewid
Item DB: replace numbers with constants and split View into Subtype and ViewSprite
Diffstat (limited to 'src/plugins/db2sql.c')
-rw-r--r-- | src/plugins/db2sql.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/plugins/db2sql.c b/src/plugins/db2sql.c index 33a62757a..38e5ead5d 100644 --- a/src/plugins/db2sql.c +++ b/src/plugins/db2sql.c @@ -255,6 +255,9 @@ int itemdb2sql_sub(struct config_setting_t *entry, int n, const char *source) // type StrBuf->Printf(&buf, "'%d',", it->flag.delay_consume ? IT_DELAYCONSUME : it->type); + // subtype + StrBuf->Printf(&buf, "'%d',", it->subtype); + // price_buy StrBuf->Printf(&buf, "'%d',", it->value_buy); @@ -294,10 +297,11 @@ int itemdb2sql_sub(struct config_setting_t *entry, int n, const char *source) StrBuf->Printf(&buf, "'%"PRIu64"',", ui64); // equip_upper - if (libconfig->setting_lookup_int(entry, "Upper", &i32) && i32 >= 0) + if (itemdb->lookup_const_mask(entry, "Upper", &i32) && i32 >= 0) ui32 = (uint32)i32; else ui32 = ITEMUPPER_ALL; + StrBuf->Printf(&buf, "'%u',", ui32); // equip_genders @@ -320,12 +324,12 @@ int itemdb2sql_sub(struct config_setting_t *entry, int n, const char *source) // refineable StrBuf->Printf(&buf, "'%d',", it->flag.no_refine?0:1); - + // disable_options StrBuf->Printf(&buf, "'%d',", it->flag.no_options?1:0); - // view - StrBuf->Printf(&buf, "'%d',", it->look); + // view_sprite + StrBuf->Printf(&buf, "'%d',", it->view_sprite); // bindonequip StrBuf->Printf(&buf, "'%d',", it->flag.bindonequip?1:0); @@ -449,6 +453,7 @@ void itemdb2sql_tableheader(void) " `name_english` varchar(50) NOT NULL DEFAULT '',\n" " `name_japanese` varchar(50) NOT NULL DEFAULT '',\n" " `type` tinyint(2) UNSIGNED NOT NULL DEFAULT '0',\n" + " `subtype` tinyint(2) UNSIGNED DEFAULT NULL,\n" " `price_buy` mediumint(10) DEFAULT NULL,\n" " `price_sell` mediumint(10) DEFAULT NULL,\n" " `weight` smallint(5) UNSIGNED DEFAULT NULL,\n" @@ -466,7 +471,7 @@ void itemdb2sql_tableheader(void) " `equip_level_max` smallint(5) UNSIGNED DEFAULT NULL,\n" " `refineable` tinyint(1) UNSIGNED DEFAULT NULL,\n" " `disable_options` tinyint(1) UNSIGNED DEFAULT NULL,\n" - " `view` smallint(3) UNSIGNED DEFAULT NULL,\n" + " `view_sprite` smallint(3) UNSIGNED DEFAULT NULL,\n" " `bindonequip` tinyint(1) UNSIGNED DEFAULT NULL,\n" " `forceserial` tinyint(1) UNSIGNED DEFAULT NULL,\n" " `buyingstore` tinyint(1) UNSIGNED DEFAULT NULL,\n" |