|
@@ -299,7 +299,10 @@ int char_mmo_char_tosql(uint32 char_id, struct mmo_charstatus* p){
|
|
(p->rename != cp->rename) || (p->robe != cp->robe) || (p->character_moves != cp->character_moves) ||
|
|
(p->rename != cp->rename) || (p->robe != cp->robe) || (p->character_moves != cp->character_moves) ||
|
|
(p->unban_time != cp->unban_time) || (p->font != cp->font) || (p->uniqueitem_counter != cp->uniqueitem_counter) ||
|
|
(p->unban_time != cp->unban_time) || (p->font != cp->font) || (p->uniqueitem_counter != cp->uniqueitem_counter) ||
|
|
(p->hotkey_rowshift != cp->hotkey_rowshift) || (p->clan_id != cp->clan_id ) || (p->title_id != cp->title_id) ||
|
|
(p->hotkey_rowshift != cp->hotkey_rowshift) || (p->clan_id != cp->clan_id ) || (p->title_id != cp->title_id) ||
|
|
- (p->show_equip != cp->show_equip) || (p->hotkey_rowshift2 != cp->hotkey_rowshift2)
|
|
|
|
|
|
+ (p->show_equip != cp->show_equip) || (p->hotkey_rowshift2 != cp->hotkey_rowshift2) ||
|
|
|
|
+ (p->max_ap != cp->max_ap) || (p->ap != cp->ap) || (p->trait_point != cp->trait_point) ||
|
|
|
|
+ (p->pow != cp->pow) || (p->sta != cp->sta) || (p->wis != cp->wis) ||
|
|
|
|
+ (p->spl != cp->spl) || (p->con != cp->con) || (p->crt != cp->crt)
|
|
)
|
|
)
|
|
{ //Save status
|
|
{ //Save status
|
|
if( SQL_ERROR == Sql_Query(sql_handle, "UPDATE `%s` SET `base_level`='%d', `job_level`='%d',"
|
|
if( SQL_ERROR == Sql_Query(sql_handle, "UPDATE `%s` SET `base_level`='%d', `job_level`='%d',"
|
|
@@ -310,7 +313,9 @@ int char_mmo_char_tosql(uint32 char_id, struct mmo_charstatus* p){
|
|
"`weapon`='%d',`shield`='%d',`head_top`='%d',`head_mid`='%d',`head_bottom`='%d',"
|
|
"`weapon`='%d',`shield`='%d',`head_top`='%d',`head_mid`='%d',`head_bottom`='%d',"
|
|
"`last_map`='%s',`last_x`='%d',`last_y`='%d',`save_map`='%s',`save_x`='%d',`save_y`='%d', `rename`='%d',"
|
|
"`last_map`='%s',`last_x`='%d',`last_y`='%d',`save_map`='%s',`save_x`='%d',`save_y`='%d', `rename`='%d',"
|
|
"`delete_date`='%lu',`robe`='%d',`moves`='%d',`font`='%u',`uniqueitem_counter`='%u',"
|
|
"`delete_date`='%lu',`robe`='%d',`moves`='%d',`font`='%u',`uniqueitem_counter`='%u',"
|
|
- "`hotkey_rowshift`='%d', `clan_id`='%d', `title_id`='%lu', `show_equip`='%d', `hotkey_rowshift2`='%d'"
|
|
|
|
|
|
+ "`hotkey_rowshift`='%d', `clan_id`='%d', `title_id`='%lu', `show_equip`='%d', `hotkey_rowshift2`='%d',"
|
|
|
|
+ "`max_ap`='%u',`ap`='%u',`trait_point`='%d',"
|
|
|
|
+ "`pow`='%d',`sta`='%d',`wis`='%d',`spl`='%d',`con`='%d',`crt`='%d'"
|
|
" WHERE `account_id`='%d' AND `char_id` = '%d'",
|
|
" WHERE `account_id`='%d' AND `char_id` = '%d'",
|
|
schema_config.char_db, p->base_level, p->job_level,
|
|
schema_config.char_db, p->base_level, p->job_level,
|
|
p->base_exp, p->job_exp, p->zeny,
|
|
p->base_exp, p->job_exp, p->zeny,
|
|
@@ -323,6 +328,8 @@ int char_mmo_char_tosql(uint32 char_id, struct mmo_charstatus* p){
|
|
(unsigned long)p->delete_date, // FIXME: platform-dependent size
|
|
(unsigned long)p->delete_date, // FIXME: platform-dependent size
|
|
p->robe, p->character_moves, p->font, p->uniqueitem_counter,
|
|
p->robe, p->character_moves, p->font, p->uniqueitem_counter,
|
|
p->hotkey_rowshift, p->clan_id, p->title_id, p->show_equip, p->hotkey_rowshift2,
|
|
p->hotkey_rowshift, p->clan_id, p->title_id, p->show_equip, p->hotkey_rowshift2,
|
|
|
|
+ p->max_ap, p->ap, p->trait_point,
|
|
|
|
+ p->pow, p->sta, p->wis, p->spl, p->con, p->crt,
|
|
p->account_id, p->char_id) )
|
|
p->account_id, p->char_id) )
|
|
{
|
|
{
|
|
Sql_ShowDebug(sql_handle);
|
|
Sql_ShowDebug(sql_handle);
|
|
@@ -924,7 +931,8 @@ int char_mmo_chars_fromsql(struct char_session_data* sd, uint8* buf, uint8* coun
|
|
"`status_point`,`skill_point`,`option`,`karma`,`manner`,`hair`,`hair_color`,"
|
|
"`status_point`,`skill_point`,`option`,`karma`,`manner`,`hair`,`hair_color`,"
|
|
"`clothes_color`,`body`,`weapon`,`shield`,`head_top`,`head_mid`,`head_bottom`,`last_map`,`rename`,`delete_date`,"
|
|
"`clothes_color`,`body`,`weapon`,`shield`,`head_top`,`head_mid`,`head_bottom`,`last_map`,`rename`,`delete_date`,"
|
|
"`robe`,`moves`,`unban_time`,`font`,`uniqueitem_counter`,`sex`,`hotkey_rowshift`,`title_id`,`show_equip`,"
|
|
"`robe`,`moves`,`unban_time`,`font`,`uniqueitem_counter`,`sex`,`hotkey_rowshift`,`title_id`,`show_equip`,"
|
|
- "`hotkey_rowshift2`"
|
|
|
|
|
|
+ "`hotkey_rowshift2`,"
|
|
|
|
+ "`max_ap`,`ap`,`trait_point`,`pow`,`sta`,`wis`,`spl`,`con`,`crt`"
|
|
" FROM `%s` WHERE `account_id`='%d' AND `char_num` < '%d'", schema_config.char_db, sd->account_id, MAX_CHARS)
|
|
" FROM `%s` WHERE `account_id`='%d' AND `char_num` < '%d'", schema_config.char_db, sd->account_id, MAX_CHARS)
|
|
|| SQL_ERROR == SqlStmt_Execute(stmt)
|
|
|| SQL_ERROR == SqlStmt_Execute(stmt)
|
|
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 0, SQLDT_INT, &p.char_id, 0, NULL, NULL)
|
|
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 0, SQLDT_INT, &p.char_id, 0, NULL, NULL)
|
|
@@ -973,6 +981,15 @@ int char_mmo_chars_fromsql(struct char_session_data* sd, uint8* buf, uint8* coun
|
|
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 43, SQLDT_ULONG, &p.title_id, 0, NULL, NULL)
|
|
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 43, SQLDT_ULONG, &p.title_id, 0, NULL, NULL)
|
|
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 44, SQLDT_UINT16, &p.show_equip, 0, NULL, NULL)
|
|
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 44, SQLDT_UINT16, &p.show_equip, 0, NULL, NULL)
|
|
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 45, SQLDT_UCHAR, &p.hotkey_rowshift2, 0, NULL, NULL)
|
|
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 45, SQLDT_UCHAR, &p.hotkey_rowshift2, 0, NULL, NULL)
|
|
|
|
+ || SQL_ERROR == SqlStmt_BindColumn(stmt, 46, SQLDT_UINT, &p.max_ap, 0, NULL, NULL)
|
|
|
|
+ || SQL_ERROR == SqlStmt_BindColumn(stmt, 47, SQLDT_UINT, &p.ap, 0, NULL, NULL)
|
|
|
|
+ || SQL_ERROR == SqlStmt_BindColumn(stmt, 48, SQLDT_UINT, &p.trait_point, 0, NULL, NULL)
|
|
|
|
+ || SQL_ERROR == SqlStmt_BindColumn(stmt, 49, SQLDT_SHORT, &p.pow, 0, NULL, NULL)
|
|
|
|
+ || SQL_ERROR == SqlStmt_BindColumn(stmt, 50, SQLDT_SHORT, &p.sta, 0, NULL, NULL)
|
|
|
|
+ || SQL_ERROR == SqlStmt_BindColumn(stmt, 51, SQLDT_SHORT, &p.wis, 0, NULL, NULL)
|
|
|
|
+ || SQL_ERROR == SqlStmt_BindColumn(stmt, 52, SQLDT_SHORT, &p.spl, 0, NULL, NULL)
|
|
|
|
+ || SQL_ERROR == SqlStmt_BindColumn(stmt, 53, SQLDT_SHORT, &p.con, 0, NULL, NULL)
|
|
|
|
+ || SQL_ERROR == SqlStmt_BindColumn(stmt, 54, SQLDT_SHORT, &p.crt, 0, NULL, NULL)
|
|
)
|
|
)
|
|
{
|
|
{
|
|
SqlStmt_ShowDebug(stmt);
|
|
SqlStmt_ShowDebug(stmt);
|
|
@@ -1040,7 +1057,8 @@ int char_mmo_char_fromsql(uint32 char_id, struct mmo_charstatus* p, bool load_ev
|
|
"`status_point`,`skill_point`,`option`,`karma`,`manner`,`party_id`,`guild_id`,`pet_id`,`homun_id`,`elemental_id`,`hair`,"
|
|
"`status_point`,`skill_point`,`option`,`karma`,`manner`,`party_id`,`guild_id`,`pet_id`,`homun_id`,`elemental_id`,`hair`,"
|
|
"`hair_color`,`clothes_color`,`body`,`weapon`,`shield`,`head_top`,`head_mid`,`head_bottom`,`last_map`,`last_x`,`last_y`,"
|
|
"`hair_color`,`clothes_color`,`body`,`weapon`,`shield`,`head_top`,`head_mid`,`head_bottom`,`last_map`,`last_x`,`last_y`,"
|
|
"`save_map`,`save_x`,`save_y`,`partner_id`,`father`,`mother`,`child`,`fame`,`rename`,`delete_date`,`robe`, `moves`,"
|
|
"`save_map`,`save_x`,`save_y`,`partner_id`,`father`,`mother`,`child`,`fame`,`rename`,`delete_date`,`robe`, `moves`,"
|
|
- "`unban_time`,`font`,`uniqueitem_counter`,`sex`,`hotkey_rowshift`,`clan_id`,`title_id`,`show_equip`,`hotkey_rowshift2`"
|
|
|
|
|
|
+ "`unban_time`,`font`,`uniqueitem_counter`,`sex`,`hotkey_rowshift`,`clan_id`,`title_id`,`show_equip`,`hotkey_rowshift2`,"
|
|
|
|
+ "`max_ap`,`ap`,`trait_point`,`pow`,`sta`,`wis`,`spl`,`con`,`crt`"
|
|
" FROM `%s` WHERE `char_id`=? LIMIT 1", schema_config.char_db)
|
|
" FROM `%s` WHERE `char_id`=? LIMIT 1", schema_config.char_db)
|
|
|| SQL_ERROR == SqlStmt_BindParam(stmt, 0, SQLDT_INT, &char_id, 0)
|
|
|| SQL_ERROR == SqlStmt_BindParam(stmt, 0, SQLDT_INT, &char_id, 0)
|
|
|| SQL_ERROR == SqlStmt_Execute(stmt)
|
|
|| SQL_ERROR == SqlStmt_Execute(stmt)
|
|
@@ -1107,6 +1125,15 @@ int char_mmo_char_fromsql(uint32 char_id, struct mmo_charstatus* p, bool load_ev
|
|
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 60, SQLDT_ULONG, &p->title_id, 0, NULL, NULL)
|
|
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 60, SQLDT_ULONG, &p->title_id, 0, NULL, NULL)
|
|
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 61, SQLDT_UINT16, &p->show_equip, 0, NULL, NULL)
|
|
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 61, SQLDT_UINT16, &p->show_equip, 0, NULL, NULL)
|
|
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 62, SQLDT_UCHAR, &p->hotkey_rowshift2, 0, NULL, NULL)
|
|
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 62, SQLDT_UCHAR, &p->hotkey_rowshift2, 0, NULL, NULL)
|
|
|
|
+ || SQL_ERROR == SqlStmt_BindColumn(stmt, 63, SQLDT_UINT, &p->max_ap, 0, NULL, NULL)
|
|
|
|
+ || SQL_ERROR == SqlStmt_BindColumn(stmt, 64, SQLDT_UINT, &p->ap, 0, NULL, NULL)
|
|
|
|
+ || SQL_ERROR == SqlStmt_BindColumn(stmt, 65, SQLDT_UINT, &p->trait_point, 0, NULL, NULL)
|
|
|
|
+ || SQL_ERROR == SqlStmt_BindColumn(stmt, 66, SQLDT_SHORT, &p->pow, 0, NULL, NULL)
|
|
|
|
+ || SQL_ERROR == SqlStmt_BindColumn(stmt, 67, SQLDT_SHORT, &p->sta, 0, NULL, NULL)
|
|
|
|
+ || SQL_ERROR == SqlStmt_BindColumn(stmt, 68, SQLDT_SHORT, &p->wis, 0, NULL, NULL)
|
|
|
|
+ || SQL_ERROR == SqlStmt_BindColumn(stmt, 69, SQLDT_SHORT, &p->spl, 0, NULL, NULL)
|
|
|
|
+ || SQL_ERROR == SqlStmt_BindColumn(stmt, 70, SQLDT_SHORT, &p->con, 0, NULL, NULL)
|
|
|
|
+ || SQL_ERROR == SqlStmt_BindColumn(stmt, 71, SQLDT_SHORT, &p->crt, 0, NULL, NULL)
|
|
)
|
|
)
|
|
{
|
|
{
|
|
SqlStmt_ShowDebug(stmt);
|
|
SqlStmt_ShowDebug(stmt);
|
|
@@ -2017,7 +2044,7 @@ void char_read_fame_list(void)
|
|
memset(chemist_fame_list, 0, sizeof(chemist_fame_list));
|
|
memset(chemist_fame_list, 0, sizeof(chemist_fame_list));
|
|
memset(taekwon_fame_list, 0, sizeof(taekwon_fame_list));
|
|
memset(taekwon_fame_list, 0, sizeof(taekwon_fame_list));
|
|
// Build Blacksmith ranking list
|
|
// Build Blacksmith ranking list
|
|
- if( SQL_ERROR == Sql_Query(sql_handle, "SELECT `char_id`,`fame`,`name` FROM `%s` WHERE `fame`>0 AND (`class`='%d' OR `class`='%d' OR `class`='%d' OR `class`='%d' OR `class`='%d' OR `class`='%d') ORDER BY `fame` DESC LIMIT 0,%d", schema_config.char_db, JOB_BLACKSMITH, JOB_WHITESMITH, JOB_BABY_BLACKSMITH, JOB_MECHANIC, JOB_MECHANIC_T, JOB_BABY_MECHANIC, fame_list_size_smith) )
|
|
|
|
|
|
+ if( SQL_ERROR == Sql_Query(sql_handle, "SELECT `char_id`,`fame`,`name` FROM `%s` WHERE `fame`>0 AND (`class`='%d' OR `class`='%d' OR `class`='%d' OR `class`='%d' OR `class`='%d' OR `class`='%d' OR `class`='%d') ORDER BY `fame` DESC LIMIT 0,%d", schema_config.char_db, JOB_BLACKSMITH, JOB_WHITESMITH, JOB_BABY_BLACKSMITH, JOB_MECHANIC, JOB_MECHANIC_T, JOB_BABY_MECHANIC, JOB_MEISTER, fame_list_size_smith) )
|
|
Sql_ShowDebug(sql_handle);
|
|
Sql_ShowDebug(sql_handle);
|
|
for( i = 0; i < fame_list_size_smith && SQL_SUCCESS == Sql_NextRow(sql_handle); ++i )
|
|
for( i = 0; i < fame_list_size_smith && SQL_SUCCESS == Sql_NextRow(sql_handle); ++i )
|
|
{
|
|
{
|
|
@@ -2032,7 +2059,7 @@ void char_read_fame_list(void)
|
|
memcpy(smith_fame_list[i].name, data, zmin(len, NAME_LENGTH));
|
|
memcpy(smith_fame_list[i].name, data, zmin(len, NAME_LENGTH));
|
|
}
|
|
}
|
|
// Build Alchemist ranking list
|
|
// Build Alchemist ranking list
|
|
- if( SQL_ERROR == Sql_Query(sql_handle, "SELECT `char_id`,`fame`,`name` FROM `%s` WHERE `fame`>0 AND (`class`='%d' OR `class`='%d' OR `class`='%d' OR `class`='%d' OR `class`='%d' OR `class`='%d') ORDER BY `fame` DESC LIMIT 0,%d", schema_config.char_db, JOB_ALCHEMIST, JOB_CREATOR, JOB_BABY_ALCHEMIST, JOB_GENETIC, JOB_GENETIC_T, JOB_BABY_GENETIC, fame_list_size_chemist) )
|
|
|
|
|
|
+ if( SQL_ERROR == Sql_Query(sql_handle, "SELECT `char_id`,`fame`,`name` FROM `%s` WHERE `fame`>0 AND (`class`='%d' OR `class`='%d' OR `class`='%d' OR `class`='%d' OR `class`='%d' OR `class`='%d' OR `class`='%d') ORDER BY `fame` DESC LIMIT 0,%d", schema_config.char_db, JOB_ALCHEMIST, JOB_CREATOR, JOB_BABY_ALCHEMIST, JOB_GENETIC, JOB_GENETIC_T, JOB_BABY_GENETIC, JOB_BIOLO, fame_list_size_chemist) )
|
|
Sql_ShowDebug(sql_handle);
|
|
Sql_ShowDebug(sql_handle);
|
|
for( i = 0; i < fame_list_size_chemist && SQL_SUCCESS == Sql_NextRow(sql_handle); ++i )
|
|
for( i = 0; i < fame_list_size_chemist && SQL_SUCCESS == Sql_NextRow(sql_handle); ++i )
|
|
{
|
|
{
|
|
@@ -2316,7 +2343,8 @@ bool char_checkdb(void){
|
|
"`shield`,`head_top`,`head_mid`,`head_bottom`,`robe`,`last_map`,`last_x`,`last_y`,`save_map`,"
|
|
"`shield`,`head_top`,`head_mid`,`head_bottom`,`robe`,`last_map`,`last_x`,`last_y`,`save_map`,"
|
|
"`save_x`,`save_y`,`partner_id`,`online`,`father`,`mother`,`child`,`fame`,`rename`,`delete_date`,"
|
|
"`save_x`,`save_y`,`partner_id`,`online`,`father`,`mother`,`child`,`fame`,`rename`,`delete_date`,"
|
|
"`moves`,`unban_time`,`font`,`sex`,`hotkey_rowshift`,`clan_id`,`last_login`,`title_id`,`show_equip`,"
|
|
"`moves`,`unban_time`,`font`,`sex`,`hotkey_rowshift`,`clan_id`,`last_login`,`title_id`,`show_equip`,"
|
|
- "`hotkey_rowshift2`"
|
|
|
|
|
|
+ "`hotkey_rowshift2`,"
|
|
|
|
+ "`max_ap`,`ap`,`trait_point`,`pow`,`sta`,`wis`,`spl`,`con`,`crt`"
|
|
" FROM `%s` LIMIT 1;", schema_config.char_db) ){
|
|
" FROM `%s` LIMIT 1;", schema_config.char_db) ){
|
|
Sql_ShowDebug(sql_handle);
|
|
Sql_ShowDebug(sql_handle);
|
|
return false;
|
|
return false;
|