summaryrefslogtreecommitdiff
path: root/src/char/char.c
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-06-15 23:18:04 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-06-15 23:18:04 +0000
commit54b84a5d7845efe40d3e06a12ac2f2c5ac0137e6 (patch)
tree2d88dc1e376d1e1a5baa8f595c47e78cb257d713 /src/char/char.c
parent1ec9c82750a775daa00c68bcd8c4e28e7e2859a6 (diff)
downloadhercules-54b84a5d7845efe40d3e06a12ac2f2c5ac0137e6.tar.gz
hercules-54b84a5d7845efe40d3e06a12ac2f2c5ac0137e6.tar.bz2
hercules-54b84a5d7845efe40d3e06a12ac2f2c5ac0137e6.tar.xz
hercules-54b84a5d7845efe40d3e06a12ac2f2c5ac0137e6.zip
Fixed bugreport:6035, chars will now start with all stats 1 and 48 status points as for clients 2012 march and beyond.
Did some cleanup at clif.c packet parsing and applied some curly brace love. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16308 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char/char.c')
-rw-r--r--src/char/char.c30
1 files changed, 21 insertions, 9 deletions
diff --git a/src/char/char.c b/src/char/char.c
index 914bb086b..da5524c93 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -1330,13 +1330,12 @@ int check_char_name(char * name, char * esc_name)
// Function to create a new character
//-----------------------------------
#if PACKETVER >= 20120307
-int make_new_char_sql(struct char_session_data* sd, char* name_, int slot, int hair_color, int hair_style)
-{
- int str = 5, agi = 5, vit = 5, int_ = 5, dex = 5,luk = 5;
+int make_new_char_sql(struct char_session_data* sd, char* name_, int slot, int hair_color, int hair_style) {
+ int str = 1, agi = 1, vit = 1, int_ = 1, dex = 1, luk = 1;
#else
-int make_new_char_sql(struct char_session_data* sd, char* name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style)
-{
+int make_new_char_sql(struct char_session_data* sd, char* name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style) {
#endif
+
char name[NAME_LENGTH];
char esc_name[NAME_LENGTH*2+1];
int char_id, flag;
@@ -1381,18 +1380,31 @@ int make_new_char_sql(struct char_session_data* sd, char* name_, int str, int ag
charlog_db, "make new char", sd->account_id, slot, esc_name, str, agi, vit, int_, dex, luk, hair_style, hair_color) )
Sql_ShowDebug(sql_handle);
}
-
+#if PACKETVER >= 20120307
//Insert the new char entry to the database
- if( SQL_ERROR == Sql_Query(sql_handle, "INSERT INTO `%s` (`account_id`, `char_num`, `name`, `zeny`, `str`, `agi`, `vit`, `int`, `dex`, `luk`, `max_hp`, `hp`,"
+ if( SQL_ERROR == Sql_Query(sql_handle, "INSERT INTO `%s` (`account_id`, `char_num`, `name`, `zeny`, `status_point`,`str`, `agi`, `vit`, `int`, `dex`, `luk`, `max_hp`, `hp`,"
"`max_sp`, `sp`, `hair`, `hair_color`, `last_map`, `last_x`, `last_y`, `save_map`, `save_x`, `save_y`) VALUES ("
- "'%d', '%d', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d','%d', '%d','%d', '%d', '%s', '%d', '%d', '%s', '%d', '%d')",
- char_db, sd->account_id , slot, esc_name, start_zeny, str, agi, vit, int_, dex, luk,
+ "'%d', '%d', '%s', '%d', '%d','%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d','%d', '%d','%d', '%d', '%s', '%d', '%d', '%s', '%d', '%d')",
+ char_db, sd->account_id , slot, esc_name, start_zeny, 48, str, agi, vit, int_, dex, luk,
(40 * (100 + vit)/100) , (40 * (100 + vit)/100 ), (11 * (100 + int_)/100), (11 * (100 + int_)/100), hair_style, hair_color,
mapindex_id2name(start_point.map), start_point.x, start_point.y, mapindex_id2name(start_point.map), start_point.x, start_point.y) )
{
Sql_ShowDebug(sql_handle);
return -2; //No, stop the procedure!
}
+#else
+ //Insert the new char entry to the database
+ if( SQL_ERROR == Sql_Query(sql_handle, "INSERT INTO `%s` (`account_id`, `char_num`, `name`, `zeny`, `str`, `agi`, `vit`, `int`, `dex`, `luk`, `max_hp`, `hp`,"
+ "`max_sp`, `sp`, `hair`, `hair_color`, `last_map`, `last_x`, `last_y`, `save_map`, `save_x`, `save_y`) VALUES ("
+ "'%d', '%d', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d','%d', '%d','%d', '%d', '%s', '%d', '%d', '%s', '%d', '%d')",
+ char_db, sd->account_id , slot, esc_name, start_zeny, str, agi, vit, int_, dex, luk,
+ (40 * (100 + vit)/100) , (40 * (100 + vit)/100 ), (11 * (100 + int_)/100), (11 * (100 + int_)/100), hair_style, hair_color,
+ mapindex_id2name(start_point.map), start_point.x, start_point.y, mapindex_id2name(start_point.map), start_point.x, start_point.y) )
+ {
+ Sql_ShowDebug(sql_handle);
+ return -2; //No, stop the procedure!
+ }
+#endif
//Retrieve the newly auto-generated char id
char_id = (int)Sql_LastInsertId(sql_handle);
//Give the char the default items