Initial support for enchantgrade (#5445)

Thanks to @LunarSHINING, @idk-whoami and @attackjom
This commit is contained in:
Lemongrass3110
2020-11-05 22:18:12 +01:00
committed by GitHub
parent 12cfe31bf1
commit d01b718cc0
15 changed files with 262 additions and 126 deletions

View File

@@ -645,7 +645,7 @@ void storage_guild_log( struct map_session_data* sd, struct item* item, int16 am
StringBuf buf;
StringBuf_Init(&buf);
StringBuf_Printf(&buf, "INSERT INTO `%s` (`time`, `guild_id`, `char_id`, `name`, `nameid`, `amount`, `identify`, `refine`, `attribute`, `unique_id`, `bound`", guild_storage_log_table);
StringBuf_Printf(&buf, "INSERT INTO `%s` (`time`, `guild_id`, `char_id`, `name`, `nameid`, `amount`, `identify`, `refine`, `attribute`, `unique_id`, `bound`, `enchantgrade`", guild_storage_log_table);
for (i = 0; i < MAX_SLOTS; ++i)
StringBuf_Printf(&buf, ", `card%d`", i);
for (i = 0; i < MAX_ITEM_RDM_OPT; ++i) {
@@ -653,8 +653,8 @@ void storage_guild_log( struct map_session_data* sd, struct item* item, int16 am
StringBuf_Printf(&buf, ", `option_val%d`", i);
StringBuf_Printf(&buf, ", `option_parm%d`", i);
}
StringBuf_Printf(&buf, ") VALUES(NOW(),'%u','%u', '%s', '%u', '%d','%d','%d','%d','%" PRIu64 "','%d'",
sd->status.guild_id, sd->status.char_id, sd->status.name, item->nameid, amount, item->identify, item->refine,item->attribute, item->unique_id, item->bound);
StringBuf_Printf(&buf, ") VALUES(NOW(),'%u','%u', '%s', '%u', '%d','%d','%d','%d','%" PRIu64 "','%d','%d'",
sd->status.guild_id, sd->status.char_id, sd->status.name, item->nameid, amount, item->identify, item->refine,item->attribute, item->unique_id, item->bound, item->enchantgrade);
for (i = 0; i < MAX_SLOTS; i++)
StringBuf_Printf(&buf, ",'%u'", item->card[i]);
@@ -676,7 +676,7 @@ enum e_guild_storage_log storage_guild_log_read_sub( struct map_session_data* sd
StringBuf_Init(&buf);
StringBuf_AppendStr(&buf, "SELECT `id`, `time`, `name`, `amount`");
StringBuf_AppendStr(&buf, " , `nameid`, `identify`, `refine`, `attribute`, `expire_time`, `bound`, `unique_id`");
StringBuf_AppendStr(&buf, " , `nameid`, `identify`, `refine`, `attribute`, `expire_time`, `bound`, `unique_id`, `enchantgrade`");
for (j = 0; j < MAX_SLOTS; ++j)
StringBuf_Printf(&buf, ", `card%d`", j);
for (j = 0; j < MAX_ITEM_RDM_OPT; ++j) {
@@ -713,13 +713,14 @@ enum e_guild_storage_log storage_guild_log_read_sub( struct map_session_data* sd
SqlStmt_BindColumn(stmt, 7, SQLDT_CHAR, &entry.item.attribute, 0, NULL, NULL);
SqlStmt_BindColumn(stmt, 8, SQLDT_UINT, &entry.item.expire_time, 0, NULL, NULL);
SqlStmt_BindColumn(stmt, 9, SQLDT_UINT, &entry.item.bound, 0, NULL, NULL);
SqlStmt_BindColumn(stmt, 10, SQLDT_UINT64, &entry.item.unique_id, 0, NULL, NULL);
SqlStmt_BindColumn(stmt, 10, SQLDT_UINT64, &entry.item.unique_id, 0, NULL, NULL);
SqlStmt_BindColumn(stmt, 11, SQLDT_INT8, &entry.item.enchantgrade,0, NULL, NULL);
for( j = 0; j < MAX_SLOTS; ++j )
SqlStmt_BindColumn(stmt, 11+j, SQLDT_UINT, &entry.item.card[j], 0, NULL, NULL);
SqlStmt_BindColumn(stmt, 12+j, SQLDT_UINT, &entry.item.card[j], 0, NULL, NULL);
for( j = 0; j < MAX_ITEM_RDM_OPT; ++j ) {
SqlStmt_BindColumn(stmt, 11+MAX_SLOTS+j*3, SQLDT_SHORT, &entry.item.option[j].id, 0, NULL, NULL);
SqlStmt_BindColumn(stmt, 11+MAX_SLOTS+j*3+1, SQLDT_SHORT, &entry.item.option[j].value, 0, NULL, NULL);
SqlStmt_BindColumn(stmt, 11+MAX_SLOTS+j*3+2, SQLDT_CHAR, &entry.item.option[j].param, 0, NULL, NULL);
SqlStmt_BindColumn(stmt, 12+MAX_SLOTS+j*3, SQLDT_SHORT, &entry.item.option[j].id, 0, NULL, NULL);
SqlStmt_BindColumn(stmt, 12+MAX_SLOTS+j*3+1, SQLDT_SHORT, &entry.item.option[j].value, 0, NULL, NULL);
SqlStmt_BindColumn(stmt, 12+MAX_SLOTS+j*3+2, SQLDT_CHAR, &entry.item.option[j].param, 0, NULL, NULL);
}
log.reserve(max);