Improved support for enchantgrade (#5975)

Added further support for enchantgrade so that the enchantgrade is not lost during certain processes and can be accessed via script commands.
Also added missing logging support for it.
This commit is contained in:
Lemongrass3110
2021-05-30 00:44:50 +02:00
committed by GitHub
parent 5d92d1a000
commit 3a8e4ffbc7
8 changed files with 51 additions and 11 deletions

View File

@@ -159,7 +159,7 @@ void inter_storage_checkDB(void) {
if (SQL_ERROR == Sql_Query(sql_handle, "SELECT `id`,`account_id`,`nameid`,`amount`,`equip`,`identify`,`refine`,"
"`attribute`,`card0`,`card1`,`card2`,`card3`,`option_id0`,`option_val0`,`option_parm0`,`option_id1`,`option_val1`,`option_parm1`,"
"`option_id2`,`option_val2`,`option_parm2`,`option_id3`,`option_val3`,`option_parm3`,`option_id4`,`option_val4`,`option_parm4`,"
"`expire_time`,`bound`,`unique_id`"
"`expire_time`,`bound`,`unique_id`,`enchantgrade`"
" FROM `%s` LIMIT 1;", storage_table.second->table)) {
Sql_ShowDebug(sql_handle);
}else{
@@ -334,7 +334,7 @@ bool mapif_parse_itembound_retrieve(int fd)
StringBuf_Init(&buf);
// Get bound items from player's inventory
StringBuf_AppendStr(&buf, "SELECT `id`, `nameid`, `amount`, `equip`, `identify`, `refine`, `attribute`, `expire_time`, `bound`");
StringBuf_AppendStr(&buf, "SELECT `id`, `nameid`, `amount`, `equip`, `identify`, `refine`, `attribute`, `expire_time`, `bound`, `enchantgrade`");
for( j = 0; j < MAX_SLOTS; ++j )
StringBuf_Printf(&buf, ", `card%d`", j);
for( j = 0; j < MAX_ITEM_RDM_OPT; ++j ) {
@@ -364,12 +364,13 @@ bool mapif_parse_itembound_retrieve(int fd)
SqlStmt_BindColumn(stmt, 6, SQLDT_CHAR, &item.attribute, 0, NULL, NULL);
SqlStmt_BindColumn(stmt, 7, SQLDT_UINT, &item.expire_time, 0, NULL, NULL);
SqlStmt_BindColumn(stmt, 8, SQLDT_UINT, &item.bound, 0, NULL, NULL);
SqlStmt_BindColumn(stmt, 9, SQLDT_INT8, &item.enchantgrade,0, NULL, NULL);
for( j = 0; j < MAX_SLOTS; ++j )
SqlStmt_BindColumn(stmt, 9+j, SQLDT_UINT, &item.card[j], 0, NULL, NULL);
SqlStmt_BindColumn(stmt,10+j, SQLDT_UINT, &item.card[j], 0, NULL, NULL);
for( j = 0; j < MAX_ITEM_RDM_OPT; ++j ) {
SqlStmt_BindColumn(stmt, 9+MAX_SLOTS+j*3, SQLDT_SHORT, &item.option[j].id, 0, NULL, NULL);
SqlStmt_BindColumn(stmt, 10+MAX_SLOTS+j*3, SQLDT_SHORT, &item.option[j].value, 0, NULL, NULL);
SqlStmt_BindColumn(stmt, 11+MAX_SLOTS+j*3, SQLDT_CHAR, &item.option[j].param, 0, NULL, NULL);
SqlStmt_BindColumn(stmt, 11+MAX_SLOTS+j*3, SQLDT_SHORT, &item.option[j].id, 0, NULL, NULL);
SqlStmt_BindColumn(stmt, 12+MAX_SLOTS+j*3, SQLDT_SHORT, &item.option[j].value, 0, NULL, NULL);
SqlStmt_BindColumn(stmt, 13+MAX_SLOTS+j*3, SQLDT_CHAR, &item.option[j].param, 0, NULL, NULL);
}
memset(&items, 0, sizeof(items));
while( SQL_SUCCESS == SqlStmt_NextRow(stmt) )