Index: conf/char_athena.conf =================================================================== --- conf/char_athena.conf (revision 17206) +++ conf/char_athena.conf (working copy) @@ -197,4 +197,10 @@ // Allow users to move characters as often as they like? char_moves_unlimited: no +// Translations +// Format: +// read_msg: language ID,path +// read_msg: 1,conf/msg_conf/char_msg_sp.conf // Spanish +// read_msg: 2,conf/msg_conf/char_msg_ru.conf // Russian + import: conf/import/char_conf.txt Index: conf/login_athena.conf =================================================================== --- conf/login_athena.conf (revision 17206) +++ conf/login_athena.conf (working copy) @@ -157,5 +157,11 @@ client_hash: 0, 113e195e6c051bb1cfb12a644bb084c5 client_hash: 99, cb1ea78023d337c38e8ba5124e2338ae +// Translations +// Format: +// read_msg: language ID,path +// read_msg: 1,conf/msg_conf/login_msg_sp.conf // Spanish +// read_msg: 2,conf/msg_conf/login_msg_ru.conf // Russian + import: conf/inter_athena.conf import: conf/import/login_conf.txt Index: conf/map_athena.conf =================================================================== --- conf/map_athena.conf (revision 17206) +++ conf/map_athena.conf (working copy) @@ -115,6 +115,13 @@ help2_txt: conf/help2.txt charhelp_txt: conf/charhelp.txt + +// Translations +// Format: +// read_msg: language ID,path +// read_msg: 1,conf/msg_conf/map_msg_sp.conf // Spanish +// read_msg: 2,conf/msg_conf/map_msg_ru.conf // Russian + // Maps: import: conf/maps_athena.conf Index: src/char/char.c =================================================================== --- src/char/char.c (revision 17206) +++ src/char/char.c (working copy) @@ -31,7 +31,7 @@ #include #define CHAR_MAX_MSG 200 -static char* msg_table[CHAR_MAX_MSG]; // Login Server messages_conf +static char* msg_table[MAX_LANG][CHAR_MAX_MSG]; // Char Server messages_conf char char_db[256] = "char"; char scdata_db[256] = "sc_data"; @@ -138,6 +138,7 @@ uint16 pincode_try; // Addon system unsigned int char_moves[MAX_CHARS]; // character moves left + int lang; }; int max_connect_user = -1; @@ -214,6 +215,7 @@ time_t expiration_time; // # of seconds 1/1/1970 (timestamp): Validity limit of the account (0 = unlimited) int group_id; unsigned changing_mapservers : 1; + int lang; }; static DBMap* auth_db; // int account_id -> struct auth_node* @@ -2204,7 +2206,7 @@ break; case 0x2717: // account data - if (RFIFOREST(fd) < 72) + if (RFIFOREST(fd) < 73) return 0; // find the authenticated session with this account id @@ -2221,9 +2223,14 @@ sd->char_slots = MAX_CHARS;/* cap to maximum */ } else if ( !sd->char_slots )/* no value aka 0 in sql */ sd->char_slots = MAX_CHARS;/* cap to maximum */ - safestrncpy(sd->birthdate, (const char*)RFIFOP(fd,52), sizeof(sd->birthdate)); - safestrncpy(sd->pincode, (const char*)RFIFOP(fd,63), sizeof(sd->pincode)); - sd->pincode_change = (time_t)RFIFOL(fd,68); + sd->lang = RFIFOB(fd,52); + if( sd->lang > MAX_LANG ) { + ShowError("Account '%d' `lang` column is higher than supported MAX_LANG (%d), update MAX_LANG in mmo.h! capping to 0...\n",sd->account_id,sd->lang); + sd->lang = 0;/* cap to 0 */ + } + safestrncpy(sd->birthdate, (const char*)RFIFOP(fd,53), sizeof(sd->birthdate)); + safestrncpy(sd->pincode, (const char*)RFIFOP(fd,64), sizeof(sd->pincode)); + sd->pincode_change = (time_t)RFIFOL(fd,69); ARR_FIND( 0, ARRAYLENGTH(server), server_id, server[server_id].fd > 0 && server[server_id].map[0] ); // continued from char_auth_ok... if( server_id == ARRAYLENGTH(server) || //server not online, bugreport:2359 @@ -2270,7 +2277,7 @@ #endif } } - RFIFOSKIP(fd,72); + RFIFOSKIP(fd,73); break; // login-server alive packet @@ -2970,7 +2977,7 @@ break; case 0x2b05: // request "change map server" - if (RFIFOREST(fd) < 39) + if (RFIFOREST(fd) < 40) return 0; { int map_id, map_fd = -1; @@ -3010,6 +3017,7 @@ node->expiration_time = 0; // FIXME (this thing isn't really supported we could as well purge it instead of fixing) node->ip = ntohl(RFIFOL(fd,31)); node->group_id = RFIFOL(fd,35); + node->lang = RFIFOL(fd,39); node->changing_mapservers = 1; idb_put(auth_db, RFIFOL(fd,2), node); @@ -3363,16 +3371,17 @@ {// auth ok cd->sex = sex; - WFIFOHEAD(fd,25 + sizeof(struct mmo_charstatus)); + WFIFOHEAD(fd,29 + sizeof(struct mmo_charstatus)); WFIFOW(fd,0) = 0x2afd; - WFIFOW(fd,2) = 25 + sizeof(struct mmo_charstatus); + WFIFOW(fd,2) = 29 + sizeof(struct mmo_charstatus); WFIFOL(fd,4) = account_id; WFIFOL(fd,8) = node->login_id1; WFIFOL(fd,12) = node->login_id2; WFIFOL(fd,16) = (uint32)node->expiration_time; // FIXME: will wrap to negative after "19-Jan-2038, 03:14:07 AM GMT" WFIFOL(fd,20) = node->group_id; - WFIFOB(fd,24) = node->changing_mapservers; - memcpy(WFIFOP(fd,25), cd, sizeof(struct mmo_charstatus)); + WFIFOL(fd,24) = node->lang; + WFIFOB(fd,28) = node->changing_mapservers; + memcpy(WFIFOP(fd,29), cd, sizeof(struct mmo_charstatus)); WFIFOSET(fd, WFIFOW(fd,2)); // only use the auth once and mark user online @@ -3969,6 +3978,7 @@ node->sex = sd->sex; node->expiration_time = sd->expiration_time; node->group_id = sd->group_id; + node->lang = sd->lang; node->ip = ipl; idb_put(auth_db, sd->account_id, node); @@ -5032,6 +5042,15 @@ char_movetoused = config_switch(w2); } else if (strcmpi(w1, "char_moves_unlimited") == 0) { char_moves_unlimited = config_switch(w2); + } else if (strcmpi(w1, "read_msg") == 0){ + int lang; + char path[256]; + if( sscanf(w2, "%d, %s", &lang, path) == 2){ + if( lang < 1 || lang > MAX_LANG ) + ShowWarning("read_msg: Invalid Lnaguage ID '%s' in file %s. Must be 1~%s\n", w1, cfgName, MAX_LANG); + else + msg_config_read(path,lang); + } } else if (strcmpi(w1, "import") == 0) { char_config_read(w2); } @@ -5121,7 +5140,7 @@ cli_get_options(argc,argv); - msg_config_read(MSG_CONF_NAME); + msg_config_read(MSG_CONF_NAME,0); char_config_read(CHAR_CONF_NAME); char_lan_config_read(LAN_CONF_NAME); sql_config_read(SQL_CONF_NAME); @@ -5208,14 +5227,16 @@ return 0; } -int char_msg_config_read(char *cfgName){ - return _msg_config_read(cfgName,CHAR_MAX_MSG,msg_table); +int char_msg_config_read(char *cfgName, int lang){ + return _msg_config_read(cfgName,CHAR_MAX_MSG,msg_table[lang]); } -const char* char_msg_txt(int msg_number){ - return _msg_txt(msg_number,CHAR_MAX_MSG,msg_table); +const char* char_msg_txt(int lang, int msg_number){ + return _msg_txt(msg_number,CHAR_MAX_MSG,msg_table[lang]); } void char_do_final_msg(void){ - _do_final_msg(CHAR_MAX_MSG,msg_table); + int i; + for( i = 0; i < MAX_LANG; i++) + _do_final_msg(CHAR_MAX_MSG,msg_table[i]); } /*====================================================== Index: src/char/char.h =================================================================== --- src/char/char.h (revision 17206) +++ src/char/char.h (working copy) @@ -21,11 +21,11 @@ #define DEFAULT_AUTOSAVE_INTERVAL 300*1000 -#define msg_config_read(cfgName) char_msg_config_read(cfgName) -#define msg_txt(msg_number) char_msg_txt(msg_number) +#define msg_config_read(cfgName, lang) char_msg_config_read(cfgName, lang) +#define msg_txt(lang, msg_number) char_msg_txt(lang, msg_number) #define do_final_msg() char_do_final_msg() -int char_msg_config_read(char *cfgName); -const char* char_msg_txt(int msg_number); +int char_msg_config_read(char *cfgName, int lang); +const char* char_msg_txt(int lang, int msg_number); void char_do_final_msg(void); enum { Index: src/char/int_auction.c =================================================================== --- src/char/int_auction.c (revision 17206) +++ src/char/int_auction.c (working copy) @@ -145,12 +145,12 @@ { if( auction->buyer_id ) { - mail_sendmail(0, msg_txt(200), auction->buyer_id, auction->buyer_name, msg_txt(201), msg_txt(202), 0, &auction->item); + mail_sendmail(0, msg_txt(0,200), auction->buyer_id, auction->buyer_name, msg_txt(0,201), msg_txt(0,202), 0, &auction->item); mapif_Auction_message(auction->buyer_id, 6); // You have won the auction - mail_sendmail(0, msg_txt(200), auction->seller_id, auction->seller_name, msg_txt(201), msg_txt(203), auction->price, NULL); + mail_sendmail(0, msg_txt(0,200), auction->seller_id, auction->seller_name, msg_txt(0,201), msg_txt(0,203), auction->price, NULL); } else - mail_sendmail(0, msg_txt(200), auction->seller_id, auction->seller_name, msg_txt(201), msg_txt(204), 0, &auction->item); + mail_sendmail(0, msg_txt(0,200), auction->seller_id, auction->seller_name, msg_txt(0,201), msg_txt(0,204), 0, &auction->item); ShowInfo("Auction End: id %u.\n", auction->auction_id); @@ -353,7 +353,7 @@ return; } - mail_sendmail(0, msg_txt(200), auction->seller_id, auction->seller_name, msg_txt(201), msg_txt(205), 0, &auction->item); + mail_sendmail(0, msg_txt(0,200), auction->seller_id, auction->seller_name, msg_txt(0,201), msg_txt(0,205), 0, &auction->item); auction_delete(auction); mapif_Auction_cancel(fd, char_id, 0); // The auction has been canceled @@ -392,9 +392,9 @@ } // Send Money to Seller - mail_sendmail(0, msg_txt(200), auction->seller_id, auction->seller_name, msg_txt(201), msg_txt(206), auction->price, NULL); + mail_sendmail(0, msg_txt(0,200), auction->seller_id, auction->seller_name, msg_txt(0,201), msg_txt(0,206), auction->price, NULL); // Send Item to Buyer - mail_sendmail(0, msg_txt(200), auction->buyer_id, auction->buyer_name, msg_txt(201), msg_txt(207), 0, &auction->item); + mail_sendmail(0, msg_txt(0,200), auction->buyer_id, auction->buyer_name, msg_txt(0,201), msg_txt(0,207), 0, &auction->item); mapif_Auction_message(auction->buyer_id, 6); // You have won the auction auction_delete(auction); @@ -433,11 +433,11 @@ { // Send Money back to the previous Buyer if( auction->buyer_id != char_id ) { - mail_sendmail(0, msg_txt(200), auction->buyer_id, auction->buyer_name, msg_txt(201), msg_txt(208), auction->price, NULL); + mail_sendmail(0, msg_txt(0,200), auction->buyer_id, auction->buyer_name, msg_txt(0,201), msg_txt(0,208), auction->price, NULL); mapif_Auction_message(auction->buyer_id, 7); // You have failed to win the auction } else - mail_sendmail(0, msg_txt(200), auction->buyer_id, auction->buyer_name, msg_txt(201), msg_txt(209), auction->price, NULL); + mail_sendmail(0, msg_txt(0,200), auction->buyer_id, auction->buyer_name, msg_txt(0,201), msg_txt(0,209), auction->price, NULL); } auction->buyer_id = char_id; @@ -448,9 +448,9 @@ { // Automatic won the auction mapif_Auction_bid(fd, char_id, bid - auction->buynow, 1); // You have successfully bid in the auction - mail_sendmail(0, msg_txt(200), auction->buyer_id, auction->buyer_name, msg_txt(201), msg_txt(210), 0, &auction->item); + mail_sendmail(0, msg_txt(0,200), auction->buyer_id, auction->buyer_name, msg_txt(0,201), msg_txt(0,210), 0, &auction->item); mapif_Auction_message(char_id, 6); // You have won the auction - mail_sendmail(0, msg_txt(200), auction->seller_id, auction->seller_name, msg_txt(201), msg_txt(211), auction->buynow, NULL); + mail_sendmail(0, msg_txt(0,200), auction->seller_id, auction->seller_name, msg_txt(0,201), msg_txt(0,211), auction->buynow, NULL); auction_delete(auction); return; Index: src/char/inter.c =================================================================== --- src/char/inter.c (revision 17206) +++ src/char/inter.c (working copy) @@ -77,7 +77,7 @@ case JOB_ACOLYTE: case JOB_MERCHANT: case JOB_THIEF: - return msg_txt(JOB_NOVICE+class_); + return msg_txt(0,JOB_NOVICE+class_); case JOB_KNIGHT: case JOB_PRIEST: @@ -85,10 +85,10 @@ case JOB_BLACKSMITH: case JOB_HUNTER: case JOB_ASSASSIN: - return msg_txt(7 - JOB_KNIGHT+class_); + return msg_txt(0,7 - JOB_KNIGHT+class_); case JOB_KNIGHT2: - return msg_txt(7); + return msg_txt(0,7); case JOB_CRUSADER: case JOB_MONK: @@ -97,20 +97,20 @@ case JOB_ALCHEMIST: case JOB_BARD: case JOB_DANCER: - return msg_txt(13 - JOB_CRUSADER+class_); + return msg_txt(0,13 - JOB_CRUSADER+class_); case JOB_CRUSADER2: - return msg_txt(13); + return msg_txt(0,13); case JOB_WEDDING: case JOB_SUPER_NOVICE: case JOB_GUNSLINGER: case JOB_NINJA: case JOB_XMAS: - return msg_txt(20 - JOB_WEDDING+class_); + return msg_txt(0,20 - JOB_WEDDING+class_); case JOB_SUMMER: - return msg_txt(71); + return msg_txt(0,71); case JOB_NOVICE_HIGH: case JOB_SWORDMAN_HIGH: @@ -119,7 +119,7 @@ case JOB_ACOLYTE_HIGH: case JOB_MERCHANT_HIGH: case JOB_THIEF_HIGH: - return msg_txt(25 - JOB_NOVICE_HIGH+class_); + return msg_txt(0,25 - JOB_NOVICE_HIGH+class_); case JOB_LORD_KNIGHT: case JOB_HIGH_PRIEST: @@ -127,10 +127,10 @@ case JOB_WHITESMITH: case JOB_SNIPER: case JOB_ASSASSIN_CROSS: - return msg_txt(32 - JOB_LORD_KNIGHT+class_); + return msg_txt(0,32 - JOB_LORD_KNIGHT+class_); case JOB_LORD_KNIGHT2: - return msg_txt(32); + return msg_txt(0,32); case JOB_PALADIN: case JOB_CHAMPION: @@ -139,10 +139,10 @@ case JOB_CREATOR: case JOB_CLOWN: case JOB_GYPSY: - return msg_txt(38 - JOB_PALADIN + class_); + return msg_txt(0,38 - JOB_PALADIN + class_); case JOB_PALADIN2: - return msg_txt(38); + return msg_txt(0,38); case JOB_BABY: case JOB_BABY_SWORDMAN: @@ -151,7 +151,7 @@ case JOB_BABY_ACOLYTE: case JOB_BABY_MERCHANT: case JOB_BABY_THIEF: - return msg_txt(45 - JOB_BABY + class_); + return msg_txt(0,45 - JOB_BABY + class_); case JOB_BABY_KNIGHT: case JOB_BABY_PRIEST: @@ -159,10 +159,10 @@ case JOB_BABY_BLACKSMITH: case JOB_BABY_HUNTER: case JOB_BABY_ASSASSIN: - return msg_txt(52 - JOB_BABY_KNIGHT + class_); + return msg_txt(0,52 - JOB_BABY_KNIGHT + class_); case JOB_BABY_KNIGHT2: - return msg_txt(52); + return msg_txt(0,52); case JOB_BABY_CRUSADER: case JOB_BABY_MONK: @@ -171,26 +171,26 @@ case JOB_BABY_ALCHEMIST: case JOB_BABY_BARD: case JOB_BABY_DANCER: - return msg_txt(58 - JOB_BABY_CRUSADER + class_); + return msg_txt(0,58 - JOB_BABY_CRUSADER + class_); case JOB_BABY_CRUSADER2: - return msg_txt(58); + return msg_txt(0,58); case JOB_SUPER_BABY: - return msg_txt(65); + return msg_txt(0,65); case JOB_TAEKWON: - return msg_txt(66); + return msg_txt(0,66); case JOB_STAR_GLADIATOR: case JOB_STAR_GLADIATOR2: - return msg_txt(67); + return msg_txt(0,67); case JOB_SOUL_LINKER: - return msg_txt(68); + return msg_txt(0,68); case JOB_GANGSI: case JOB_DEATH_KNIGHT: case JOB_DARK_COLLECTOR: - return msg_txt(72 - JOB_GANGSI+class_); + return msg_txt(0,72 - JOB_GANGSI+class_); case JOB_RUNE_KNIGHT: case JOB_WARLOCK: @@ -198,7 +198,7 @@ case JOB_ARCH_BISHOP: case JOB_MECHANIC: case JOB_GUILLOTINE_CROSS: - return msg_txt(75 - JOB_RUNE_KNIGHT+class_); + return msg_txt(0,75 - JOB_RUNE_KNIGHT+class_); case JOB_RUNE_KNIGHT_T: case JOB_WARLOCK_T: @@ -206,7 +206,7 @@ case JOB_ARCH_BISHOP_T: case JOB_MECHANIC_T: case JOB_GUILLOTINE_CROSS_T: - return msg_txt(75 - JOB_RUNE_KNIGHT_T+class_); + return msg_txt(0,75 - JOB_RUNE_KNIGHT_T+class_); case JOB_ROYAL_GUARD: case JOB_SORCERER: @@ -215,7 +215,7 @@ case JOB_SURA: case JOB_GENETIC: case JOB_SHADOW_CHASER: - return msg_txt(81 - JOB_ROYAL_GUARD+class_); + return msg_txt(0,81 - JOB_ROYAL_GUARD+class_); case JOB_ROYAL_GUARD_T: case JOB_SORCERER_T: @@ -224,23 +224,23 @@ case JOB_SURA_T: case JOB_GENETIC_T: case JOB_SHADOW_CHASER_T: - return msg_txt(81 - JOB_ROYAL_GUARD_T+class_); + return msg_txt(0,81 - JOB_ROYAL_GUARD_T+class_); case JOB_RUNE_KNIGHT2: case JOB_RUNE_KNIGHT_T2: - return msg_txt(75); + return msg_txt(0,75); case JOB_ROYAL_GUARD2: case JOB_ROYAL_GUARD_T2: - return msg_txt(81); + return msg_txt(0,81); case JOB_RANGER2: case JOB_RANGER_T2: - return msg_txt(77); + return msg_txt(0,77); case JOB_MECHANIC2: case JOB_MECHANIC_T2: - return msg_txt(79); + return msg_txt(0,79); case JOB_BABY_RUNE: case JOB_BABY_WARLOCK: @@ -255,30 +255,30 @@ case JOB_BABY_SURA: case JOB_BABY_GENETIC: case JOB_BABY_CHASER: - return msg_txt(88 - JOB_BABY_RUNE+class_); + return msg_txt(0,88 - JOB_BABY_RUNE+class_); case JOB_BABY_RUNE2: - return msg_txt(88); + return msg_txt(0,88); case JOB_BABY_GUARD2: - return msg_txt(94); + return msg_txt(0,94); case JOB_BABY_RANGER2: - return msg_txt(90); + return msg_txt(0,90); case JOB_BABY_MECHANIC2: - return msg_txt(92); + return msg_txt(0,92); case JOB_SUPER_NOVICE_E: case JOB_SUPER_BABY_E: - return msg_txt(101 - JOB_SUPER_NOVICE_E+class_); + return msg_txt(0,101 - JOB_SUPER_NOVICE_E+class_); case JOB_KAGEROU: case JOB_OBORO: - return msg_txt(103 - JOB_KAGEROU+class_); + return msg_txt(0,103 - JOB_KAGEROU+class_); default: - return msg_txt(105); + return msg_txt(0,105); } } Index: src/common/mmo.h =================================================================== --- src/common/mmo.h (revision 17206) +++ src/common/mmo.h (working copy) @@ -162,6 +162,7 @@ #define EL_CLASS_BASE 2114 #define EL_CLASS_MAX (EL_CLASS_BASE+MAX_ELEMENTAL_CLASS-1) +#define MAX_LANG 10 enum item_types { IT_HEALING = 0, IT_UNKNOWN, //1 Index: src/common/msg_conf.c =================================================================== --- src/common/msg_conf.c (revision 17206) +++ src/common/msg_conf.c (working copy) @@ -1,3 +1,4 @@ +#include "../common/mmo.h" #include #include #include Index: src/login/account.h =================================================================== --- src/login/account.h (revision 17206) +++ src/login/account.h (working copy) @@ -54,6 +54,7 @@ time_t pincode_change; // (timestamp): last time of pincode change int account_reg2_num; struct global_reg account_reg2[ACCOUNT_REG2_NUM]; // account script variables (stored on login server) + int lang; }; Index: src/login/account_sql.c =================================================================== --- src/login/account_sql.c (revision 17206) +++ src/login/account_sql.c (working copy) @@ -522,7 +522,7 @@ // retrieve login entry for the specified account if( SQL_ERROR == Sql_Query(sql_handle, - "SELECT `account_id`,`userid`,`user_pass`,`sex`,`email`,`group_id`,`state`,`unban_time`,`expiration_time`,`logincount`,`lastlogin`,`last_ip`,`birthdate`,`character_slots`,`pincode`, `pincode_change` FROM `%s` WHERE `account_id` = %d", + "SELECT `account_id`,`userid`,`user_pass`,`sex`,`email`,`group_id`,`state`,`unban_time`,`expiration_time`,`logincount`,`lastlogin`,`last_ip`,`birthdate`,`character_slots`,`pincode`, `pincode_change`, `lang` FROM `%s` WHERE `account_id` = %d", db->account_db, account_id ) ) { Sql_ShowDebug(sql_handle); @@ -551,6 +551,7 @@ Sql_GetData(sql_handle, 13, &data, NULL); acc->char_slots = atoi(data); Sql_GetData(sql_handle, 14, &data, NULL); safestrncpy(acc->pincode, data, sizeof(acc->pincode)); Sql_GetData(sql_handle, 15, &data, NULL); acc->pincode_change = atol(data); + Sql_GetData(sql_handle, 16, &data, NULL); acc->lang = atoi(data); Sql_FreeResult(sql_handle); @@ -599,7 +600,7 @@ if( is_new ) {// insert into account table if( SQL_SUCCESS != SqlStmt_Prepare(stmt, - "INSERT INTO `%s` (`account_id`, `userid`, `user_pass`, `sex`, `email`, `group_id`, `state`, `unban_time`, `expiration_time`, `logincount`, `lastlogin`, `last_ip`, `birthdate`, `character_slots`, `pincode`, `pincode_change`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", + "INSERT INTO `%s` (`account_id`, `userid`, `user_pass`, `sex`, `email`, `group_id`, `state`, `unban_time`, `expiration_time`, `logincount`, `lastlogin`, `last_ip`, `birthdate`, `character_slots`, `pincode`, `pincode_change`, `lang`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", db->account_db) || SQL_SUCCESS != SqlStmt_BindParam(stmt, 0, SQLDT_INT, (void*)&acc->account_id, sizeof(acc->account_id)) || SQL_SUCCESS != SqlStmt_BindParam(stmt, 1, SQLDT_STRING, (void*)acc->userid, strlen(acc->userid)) @@ -617,6 +618,7 @@ || SQL_SUCCESS != SqlStmt_BindParam(stmt, 13, SQLDT_UCHAR, (void*)&acc->char_slots, sizeof(acc->char_slots)) || SQL_SUCCESS != SqlStmt_BindParam(stmt, 14, SQLDT_STRING, (void*)&acc->pincode, strlen(acc->pincode)) || SQL_SUCCESS != SqlStmt_BindParam(stmt, 15, SQLDT_LONG, (void*)&acc->pincode_change, sizeof(acc->pincode_change)) + || SQL_SUCCESS != SqlStmt_BindParam(stmt, 16, SQLDT_LONG, (void*)&acc->lang, sizeof(acc->lang)) || SQL_SUCCESS != SqlStmt_Execute(stmt) ) { SqlStmt_ShowDebug(stmt); @@ -625,7 +627,7 @@ } else {// update account table - if( SQL_SUCCESS != SqlStmt_Prepare(stmt, "UPDATE `%s` SET `userid`=?,`user_pass`=?,`sex`=?,`email`=?,`group_id`=?,`state`=?,`unban_time`=?,`expiration_time`=?,`logincount`=?,`lastlogin`=?,`last_ip`=?,`birthdate`=?,`character_slots`=?,`pincode`=?, `pincode_change`=? WHERE `account_id` = '%d'", db->account_db, acc->account_id) + if( SQL_SUCCESS != SqlStmt_Prepare(stmt, "UPDATE `%s` SET `userid`=?,`user_pass`=?,`sex`=?,`email`=?,`group_id`=?,`state`=?,`unban_time`=?,`expiration_time`=?,`logincount`=?,`lastlogin`=?,`last_ip`=?,`birthdate`=?,`character_slots`=?,`pincode`=?, `pincode_change`=?, `lang`=? WHERE `account_id` = '%d'", db->account_db, acc->account_id) || SQL_SUCCESS != SqlStmt_BindParam(stmt, 0, SQLDT_STRING, (void*)acc->userid, strlen(acc->userid)) || SQL_SUCCESS != SqlStmt_BindParam(stmt, 1, SQLDT_STRING, (void*)acc->pass, strlen(acc->pass)) || SQL_SUCCESS != SqlStmt_BindParam(stmt, 2, SQLDT_ENUM, (void*)&acc->sex, sizeof(acc->sex)) @@ -641,6 +643,7 @@ || SQL_SUCCESS != SqlStmt_BindParam(stmt, 12, SQLDT_UCHAR, (void*)&acc->char_slots, sizeof(acc->char_slots)) || SQL_SUCCESS != SqlStmt_BindParam(stmt, 13, SQLDT_STRING, (void*)&acc->pincode, strlen(acc->pincode)) || SQL_SUCCESS != SqlStmt_BindParam(stmt, 14, SQLDT_LONG, (void*)&acc->pincode_change, sizeof(acc->pincode_change)) + || SQL_SUCCESS != SqlStmt_BindParam(stmt, 15, SQLDT_UCHAR, (void*)&acc->lang, sizeof(acc->lang)) || SQL_SUCCESS != SqlStmt_Execute(stmt) ) { SqlStmt_ShowDebug(stmt); Index: src/login/login.c =================================================================== --- src/login/login.c (revision 17206) +++ src/login/login.c (working copy) @@ -22,7 +22,7 @@ #include #define LOGIN_MAX_MSG 30 -static char* msg_table[LOGIN_MAX_MSG]; // Login Server messages_conf +static char* msg_table[MAX_LANG][LOGIN_MAX_MSG]; // Login Server messages_conf struct Login_Config login_config; int login_fd; // login server socket @@ -553,7 +553,7 @@ int group_id = 0; char birthdate[10+1] = ""; char pincode[4+1] = ""; - + int lang = 0; int account_id = RFIFOL(fd,2); RFIFOSKIP(fd,6); @@ -564,21 +564,23 @@ expiration_time = acc.expiration_time; group_id = acc.group_id; char_slots = acc.char_slots; + lang = acc.lang; safestrncpy(birthdate, acc.birthdate, sizeof(birthdate)); safestrncpy(pincode, acc.pincode, sizeof(pincode)); } - WFIFOHEAD(fd,72); + WFIFOHEAD(fd,73); WFIFOW(fd,0) = 0x2717; WFIFOL(fd,2) = account_id; safestrncpy((char*)WFIFOP(fd,6), email, 40); WFIFOL(fd,46) = (uint32)expiration_time; WFIFOB(fd,50) = (unsigned char)group_id; WFIFOB(fd,51) = char_slots; - safestrncpy((char*)WFIFOP(fd,52), birthdate, 10+1); - safestrncpy((char*)WFIFOP(fd,63), pincode, 4+1 ); - WFIFOL(fd,68) = (uint32)acc.pincode_change; - WFIFOSET(fd,72); + WFIFOB(fd,52) = (unsigned char)lang; + safestrncpy((char*)WFIFOP(fd,53), birthdate, 10+1); + safestrncpy((char*)WFIFOP(fd,64), pincode, 4+1 ); + WFIFOL(fd,69) = (uint32)acc.pincode_change; + WFIFOSET(fd,73); } break; @@ -979,7 +981,7 @@ safestrncpy(acc.birthdate, "0000-00-00", sizeof(acc.birthdate)); safestrncpy(acc.pincode, "", sizeof(acc.pincode)); acc.pincode_change = 0; - + acc.lang = 0; acc.char_slots = 0; if( !accounts->create(accounts, &acc) ) @@ -1298,11 +1300,11 @@ if (login_config.log_login) { if(result >= 0 && result <= 15) - login_log(ip, sd->userid, result, msg_txt(result)); + login_log(ip, sd->userid, result, msg_txt(sd->lang,result)); else if(result >= 99 && result <= 104) - login_log(ip, sd->userid, result, msg_txt(result-83)); //-83 offset + login_log(ip, sd->userid, result, msg_txt(sd->lang,result-83)); //-83 offset else - login_log(ip, sd->userid, result, msg_txt(22)); //unknow error + login_log(ip, sd->userid, result, msg_txt(sd->lang,22)); //unknow error } if( result == 1 && login_config.dynamic_pass_failure_ban ) @@ -1707,6 +1709,16 @@ login_config.client_hash_nodes = nnode; } } + else if (strcmpi(w1, "read_msg") == 0){ + int lang; + char path[256]; + if( sscanf(w2, "%d, %s", &lang, path) == 2){ + if( lang < 1 || lang > MAX_LANG ) + ShowWarning("read_msg: Invalid Lnaguage ID '%s' in file %s. Must be 1~%s\n", w1, cfgName, MAX_LANG); + else + msg_config_read(path,lang); + } + } else if(!strcmpi(w1, "import")) login_config_read(w2); else @@ -1853,7 +1865,7 @@ cli_get_options(argc,argv); - msg_config_read(MSG_CONF_NAME); + msg_config_read(MSG_CONF_NAME,0); login_config_read(LOGIN_CONF_NAME); login_lan_config_read(LAN_CONF_NAME); @@ -1923,14 +1935,16 @@ return 0; } -int login_msg_config_read(char *cfgName){ - return _msg_config_read(cfgName,LOGIN_MAX_MSG,msg_table); +int login_msg_config_read(char *cfgName, int lang){ + return _msg_config_read(cfgName,LOGIN_MAX_MSG,msg_table[lang]); } -const char* login_msg_txt(int msg_number){ - return _msg_txt(msg_number,LOGIN_MAX_MSG,msg_table); +const char* login_msg_txt(int lang, int msg_number){ + return _msg_txt(msg_number,LOGIN_MAX_MSG,msg_table[lang]); } void login_do_final_msg(void){ - _do_final_msg(LOGIN_MAX_MSG,msg_table); + int i; + for( i = 0; i < MAX_LANG; i++) + _do_final_msg(LOGIN_MAX_MSG,msg_table[i]); } /*====================================================== Index: src/login/login.h =================================================================== --- src/login/login.h (revision 17206) +++ src/login/login.h (working copy) @@ -22,7 +22,7 @@ long login_id1; long login_id2; char sex;// 'F','M','S' - + int lang; char userid[NAME_LENGTH]; char passwd[32+1]; // 23+1 for plaintext, 32+1 for md5-ed passwords int passwdenc; @@ -91,12 +91,12 @@ #define sex_num2str(num) ( (num == SEX_FEMALE ) ? 'F' : (num == SEX_MALE ) ? 'M' : 'S' ) #define sex_str2num(str) ( (str == 'F' ) ? SEX_FEMALE : (str == 'M' ) ? SEX_MALE : SEX_SERVER ) -#define msg_config_read(cfgName) login_msg_config_read(cfgName) -#define msg_txt(msg_number) login_msg_txt(msg_number) +#define msg_config_read(cfgName, lang) login_msg_config_read(cfgName, lang) +#define msg_txt(lang, msg_number) login_msg_txt(lang, msg_number) #define do_final_msg() login_do_final_msg() -int login_msg_config_read(char *cfgName); -const char* login_msg_txt(int msg_number); +int login_msg_config_read(char *cfgName, int lang); +const char* login_msg_txt(int lang, int msg_number); void login_do_final_msg(void); Index: src/map/atcommand.c =================================================================== --- src/map/atcommand.c (revision 17206) +++ src/map/atcommand.c (working copy) @@ -149,7 +149,7 @@ { int i; for (i = 900; i <= 903; ++i) - clif_displaymessage(fd, msg_txt(i)); + clif_displaymessage(fd, msg_txt(sd->lang,i)); return -1; } @@ -188,7 +188,7 @@ if(len) {// show packet length - sprintf(atcmd_output, msg_txt(904), type, packet_db[sd->packet_ver][type].len); // Packet 0x%x length: %d + sprintf(atcmd_output, msg_txt(sd->lang,904), type, packet_db[sd->packet_ver][type].len); // Packet 0x%x length: %d clif_displaymessage(fd, atcmd_output); return 0; } @@ -197,7 +197,7 @@ off=2; if(len == 0) {// unknown packet - ERROR - sprintf(atcmd_output, msg_txt(905), type); // Unknown packet: 0x%x + sprintf(atcmd_output, msg_txt(sd->lang,905), type); // Unknown packet: 0x%x clif_displaymessage(fd, atcmd_output); return -1; } else if(len == -1) @@ -245,7 +245,7 @@ while(*message != '"') {// find start of string if(*message == 0 || ISSPACE(*message)){ - PARSE_ERROR(msg_txt(906),message); // Not a string: + PARSE_ERROR(msg_txt(sd->lang,906),message); // Not a string: return -1; } ++message; @@ -275,7 +275,7 @@ ++message; CHECK_EOS(message); if(!ISXDIGIT(*message)){ - PARSE_ERROR(msg_txt(907),message); // Not a hexadecimal digit: + PARSE_ERROR(msg_txt(sd->lang,907),message); // Not a hexadecimal digit: return -1; } num=(ISDIGIT(*message)?*message-'0':TOLOWER(*message)-'a'+10); @@ -338,7 +338,7 @@ } } else {// unknown - PARSE_ERROR(msg_txt(908),message); // Unknown type of value in: + PARSE_ERROR(msg_txt(sd->lang,908),message); // Unknown type of value in: return -1; } SKIP_VALUE(message); @@ -355,10 +355,10 @@ WFIFOSET(fd,len); } } else { - clif_displaymessage(fd, msg_txt(259)); // Invalid packet + clif_displaymessage(fd, msg_txt(sd->lang,259)); // Invalid packet return -1; } - sprintf (atcmd_output, msg_txt(258), type, type); // Sent packet 0x%x (%d) + sprintf (atcmd_output, msg_txt(sd->lang,258), type, type); // Sent packet 0x%x (%d) clif_displaymessage(fd, atcmd_output); return 0; #undef PARSE_ERROR @@ -385,7 +385,7 @@ (sscanf(message, "%15s %hd %hd", map_name, &x, &y) < 3 && sscanf(message, "%15[^,],%hd,%hd", map_name, &x, &y) < 1)) { - clif_displaymessage(fd, msg_txt(909)); // Please enter a map (usage: @warp/@rura/@mapmove ). + clif_displaymessage(fd, msg_txt(sd->lang,909)); // Please enter a map (usage: @warp/@rura/@mapmove ). return -1; } @@ -394,30 +394,30 @@ m = map_mapindex2mapid(mapindex); if (!mapindex) { // m < 0 means on different server! [Kevin] - clif_displaymessage(fd, msg_txt(1)); // Map not found. + clif_displaymessage(fd, msg_txt(sd->lang,1)); // Map not found. return -1; } if ((x || y) && map_getcell(m, x, y, CELL_CHKNOPASS)) { //This is to prevent the pc_setpos call from printing an error. - clif_displaymessage(fd, msg_txt(2)); + clif_displaymessage(fd, msg_txt(sd->lang,2)); if (!map_search_freecell(NULL, m, &x, &y, 10, 10, 1)) x = y = 0; //Invalid cell, use random spot. } if (map[m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { - clif_displaymessage(fd, msg_txt(247)); + clif_displaymessage(fd, msg_txt(sd->lang,247)); return -1; } if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { - clif_displaymessage(fd, msg_txt(248)); + clif_displaymessage(fd, msg_txt(sd->lang,248)); return -1; } if (pc_setpos(sd, mapindex, x, y, CLR_TELEPORT) != 0) { - clif_displaymessage(fd, msg_txt(1)); // Map not found. + clif_displaymessage(fd, msg_txt(sd->lang,1)); // Map not found. return -1; } - clif_displaymessage(fd, msg_txt(0)); // Warped. + clif_displaymessage(fd, msg_txt(sd->lang,0)); // Warped. return 0; } @@ -432,7 +432,7 @@ memset(atcmd_player_name, '\0', sizeof atcmd_player_name); if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) { - clif_displaymessage(fd, msg_txt(910)); // Please enter a player name (usage: @where ). + clif_displaymessage(fd, msg_txt(sd->lang,910)); // Please enter a player name (usage: @where ). return -1; } @@ -441,7 +441,7 @@ strncmp(pl_sd->status.name, atcmd_player_name, NAME_LENGTH) != 0 || (pc_has_permission(pl_sd, PC_PERM_HIDE_SESSION) && pc_get_group_level(pl_sd) > pc_get_group_level(sd) && !pc_has_permission(sd, PC_PERM_WHO_DISPLAY_AID)) ) { - clif_displaymessage(fd, msg_txt(3)); // Character not found. + clif_displaymessage(fd, msg_txt(sd->lang,3)); // Character not found. return -1; } @@ -461,36 +461,36 @@ nullpo_retr(-1, sd); if (!message || !*message) { - clif_displaymessage(fd, msg_txt(911)); // Please enter a player name (usage: @jumpto/@warpto/@goto ). + clif_displaymessage(fd, msg_txt(sd->lang,911)); // Please enter a player name (usage: @jumpto/@warpto/@goto ). return -1; } if((pl_sd=map_nick2sd((char *)message)) == NULL && (pl_sd=map_charid2sd(atoi(message))) == NULL) { - clif_displaymessage(fd, msg_txt(3)); // Character not found. + clif_displaymessage(fd, msg_txt(sd->lang,3)); // Character not found. return -1; } if (pl_sd->bl.m >= 0 && map[pl_sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { - clif_displaymessage(fd, msg_txt(247)); // You are not authorized to warp to this map. + clif_displaymessage(fd, msg_txt(sd->lang,247)); // You are not authorized to warp to this map. return -1; } if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { - clif_displaymessage(fd, msg_txt(248)); // You are not authorized to warp from your current map. + clif_displaymessage(fd, msg_txt(sd->lang,248)); // You are not authorized to warp from your current map. return -1; } if( pc_isdead(sd) ) { - clif_displaymessage(fd, msg_txt(664)); + clif_displaymessage(fd, msg_txt(sd->lang,664)); return -1; } pc_setpos(sd, pl_sd->mapindex, pl_sd->bl.x, pl_sd->bl.y, CLR_TELEPORT); - sprintf(atcmd_output, msg_txt(4), pl_sd->status.name); // Jumped to %s + sprintf(atcmd_output, msg_txt(sd->lang,4), pl_sd->status.name); // Jumped to %s clif_displaymessage(fd, atcmd_output); return 0; @@ -510,25 +510,25 @@ sscanf(message, "%hd %hd", &x, &y); if (map[sd->bl.m].flag.noteleport && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { - clif_displaymessage(fd, msg_txt(248)); // You are not authorized to warp from your current map. + clif_displaymessage(fd, msg_txt(sd->lang,248)); // You are not authorized to warp from your current map. return -1; } if( pc_isdead(sd) ) { - clif_displaymessage(fd, msg_txt(664)); + clif_displaymessage(fd, msg_txt(sd->lang,664)); return -1; } if ((x || y) && map_getcell(sd->bl.m, x, y, CELL_CHKNOPASS)) { //This is to prevent the pc_setpos call from printing an error. - clif_displaymessage(fd, msg_txt(2)); + clif_displaymessage(fd, msg_txt(sd->lang,2)); if (!map_search_freecell(NULL, sd->bl.m, &x, &y, 10, 10, 1)) x = y = 0; //Invalid cell, use random spot. } pc_setpos(sd, sd->mapindex, x, y, CLR_TELEPORT); - sprintf(atcmd_output, msg_txt(5), sd->bl.x, sd->bl.y); // Jumped to %d %d + sprintf(atcmd_output, msg_txt(sd->lang,5), sd->bl.x, sd->bl.y); // Jumped to %d %d clif_displaymessage(fd, atcmd_output); return 0; } @@ -579,33 +579,33 @@ continue; switch (display_type) { case 2: { - StringBuf_Printf(&buf, msg_txt(343), pl_sd->status.name); // "Name: %s " + StringBuf_Printf(&buf, msg_txt(sd->lang,343), pl_sd->status.name); // "Name: %s " if (pc_get_group_id(pl_sd) > 0) // Player title, if exists - StringBuf_Printf(&buf, msg_txt(344), pc_group_id2name(pc_get_group_id(pl_sd))); // "(%s) " - StringBuf_Printf(&buf, msg_txt(347), pl_sd->status.base_level, pl_sd->status.job_level, + StringBuf_Printf(&buf, msg_txt(sd->lang,344), pc_group_id2name(pc_get_group_id(pl_sd))); // "(%s) " + StringBuf_Printf(&buf, msg_txt(sd->lang,347), pl_sd->status.base_level, pl_sd->status.job_level, job_name(pl_sd->status.class_)); // "| Lv:%d/%d | Job: %s" break; } case 3: { if (pc_has_permission(sd, PC_PERM_WHO_DISPLAY_AID)) - StringBuf_Printf(&buf, msg_txt(912), pl_sd->status.char_id, pl_sd->status.account_id); // "(CID:%d/AID:%d) " - StringBuf_Printf(&buf, msg_txt(343), pl_sd->status.name); // "Name: %s " + StringBuf_Printf(&buf, msg_txt(sd->lang,912), pl_sd->status.char_id, pl_sd->status.account_id); // "(CID:%d/AID:%d) " + StringBuf_Printf(&buf, msg_txt(sd->lang,343), pl_sd->status.name); // "Name: %s " if (pc_get_group_id(pl_sd) > 0) // Player title, if exists - StringBuf_Printf(&buf, msg_txt(344), pc_group_id2name(pc_get_group_id(pl_sd))); // "(%s) " - StringBuf_Printf(&buf, msg_txt(348), mapindex_id2name(pl_sd->mapindex), pl_sd->bl.x, pl_sd->bl.y); // "| Location: %s %d %d" + StringBuf_Printf(&buf, msg_txt(sd->lang,344), pc_group_id2name(pc_get_group_id(pl_sd))); // "(%s) " + StringBuf_Printf(&buf, msg_txt(sd->lang,348), mapindex_id2name(pl_sd->mapindex), pl_sd->bl.x, pl_sd->bl.y); // "| Location: %s %d %d" break; } default: { struct party_data *p = party_search(pl_sd->status.party_id); struct guild *g = guild_search(pl_sd->status.guild_id); - StringBuf_Printf(&buf, msg_txt(343), pl_sd->status.name); // "Name: %s " + StringBuf_Printf(&buf, msg_txt(sd->lang,343), pl_sd->status.name); // "Name: %s " if (pc_get_group_id(pl_sd) > 0) // Player title, if exists - StringBuf_Printf(&buf, msg_txt(344), pc_group_id2name(pc_get_group_id(pl_sd))); // "(%s) " + StringBuf_Printf(&buf, msg_txt(sd->lang,344), pc_group_id2name(pc_get_group_id(pl_sd))); // "(%s) " if (p != NULL) - StringBuf_Printf(&buf, msg_txt(345), p->party.name); // " | Party: '%s'" + StringBuf_Printf(&buf, msg_txt(sd->lang,345), p->party.name); // " | Party: '%s'" if (g != NULL) - StringBuf_Printf(&buf, msg_txt(346), g->name); // " | Guild: '%s'" + StringBuf_Printf(&buf, msg_txt(sd->lang,346), g->name); // " | Guild: '%s'" break; } } @@ -618,18 +618,18 @@ if (map_id < 0) { if (count == 0) - StringBuf_Printf(&buf, msg_txt(28)); // No player found. + StringBuf_Printf(&buf, msg_txt(sd->lang,28)); // No player found. else if (count == 1) - StringBuf_Printf(&buf, msg_txt(29)); // 1 player found. + StringBuf_Printf(&buf, msg_txt(sd->lang,29)); // 1 player found. else - StringBuf_Printf(&buf, msg_txt(30), count); // %d players found. + StringBuf_Printf(&buf, msg_txt(sd->lang,30), count); // %d players found. } else { if (count == 0) - StringBuf_Printf(&buf, msg_txt(54), map[map_id].name); // No player found in map '%s'. + StringBuf_Printf(&buf, msg_txt(sd->lang,54), map[map_id].name); // No player found in map '%s'. else if (count == 1) - StringBuf_Printf(&buf, msg_txt(55), map[map_id].name); // 1 player found in map '%s'. + StringBuf_Printf(&buf, msg_txt(sd->lang,55), map[map_id].name); // 1 player found in map '%s'. else - StringBuf_Printf(&buf, msg_txt(56), count, map[map_id].name); // %d players found in map '%s'. + StringBuf_Printf(&buf, msg_txt(sd->lang,56), count, map[map_id].name); // %d players found in map '%s'. } clif_displaymessage(fd, StringBuf_Value(&buf)); StringBuf_Destroy(&buf); @@ -683,18 +683,18 @@ if (pl_level > level) { if (pl_sd->sc.option & OPTION_INVISIBLE) continue; - sprintf(atcmd_output, msg_txt(913), pl_sd->status.name); // Name: %s (GM) + sprintf(atcmd_output, msg_txt(sd->lang,913), pl_sd->status.name); // Name: %s (GM) clif_displaymessage(fd, atcmd_output); count++; continue; } - sprintf(atcmd_output, msg_txt(914), // Name: %s (GM:%d) | Location: %s %d %d + sprintf(atcmd_output, msg_txt(sd->lang,914), // Name: %s (GM:%d) | Location: %s %d %d pl_sd->status.name, pl_level, mapindex_id2name(pl_sd->mapindex), pl_sd->bl.x, pl_sd->bl.y); clif_displaymessage(fd, atcmd_output); - sprintf(atcmd_output, msg_txt(915), // BLvl: %d | Job: %s (Lvl: %d) + sprintf(atcmd_output, msg_txt(sd->lang,915), // BLvl: %d | Job: %s (Lvl: %d) pl_sd->status.base_level, job_name(pl_sd->status.class_), pl_sd->status.job_level); clif_displaymessage(fd, atcmd_output); @@ -702,8 +702,8 @@ p = party_search(pl_sd->status.party_id); g = guild_search(pl_sd->status.guild_id); - sprintf(atcmd_output,msg_txt(916), // Party: '%s' | Guild: '%s' - p?p->party.name:msg_txt(917), g?g->name:msg_txt(917)); // None. + sprintf(atcmd_output,msg_txt(sd->lang,916), // Party: '%s' | Guild: '%s' + p?p->party.name:msg_txt(sd->lang,917), g?g->name:msg_txt(sd->lang,917)); // None. clif_displaymessage(fd, atcmd_output); count++; @@ -711,11 +711,11 @@ mapit_free(iter); if (count == 0) - clif_displaymessage(fd, msg_txt(150)); // No GM found. + clif_displaymessage(fd, msg_txt(sd->lang,150)); // No GM found. else if (count == 1) - clif_displaymessage(fd, msg_txt(151)); // 1 GM found. + clif_displaymessage(fd, msg_txt(sd->lang,151)); // 1 GM found. else { - sprintf(atcmd_output, msg_txt(152), count); // %d GMs found. + sprintf(atcmd_output, msg_txt(sd->lang,152), count); // %d GMs found. clif_displaymessage(fd, atcmd_output); } @@ -735,7 +735,7 @@ chrif_save(sd,0); - clif_displaymessage(fd, msg_txt(6)); // Your save point has been changed. + clif_displaymessage(fd, msg_txt(sd->lang,6)); // Your save point has been changed. return 0; } @@ -751,16 +751,16 @@ m = map_mapindex2mapid(sd->status.save_point.map); if (m >= 0 && map[m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { - clif_displaymessage(fd, msg_txt(249)); // You are not authorized to warp to your save map. + clif_displaymessage(fd, msg_txt(sd->lang,249)); // You are not authorized to warp to your save map. return -1; } if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { - clif_displaymessage(fd, msg_txt(248)); // You are not authorized to warp from your current map. + clif_displaymessage(fd, msg_txt(sd->lang,248)); // You are not authorized to warp from your current map. return -1; } pc_setpos(sd, sd->status.save_point.map, sd->status.save_point.x, sd->status.save_point.y, CLR_OUTSIGHT); - clif_displaymessage(fd, msg_txt(7)); // Warping to save point.. + clif_displaymessage(fd, msg_txt(sd->lang,7)); // Warping to save point.. return 0; } @@ -777,14 +777,14 @@ memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%d", &speed) < 1) { - sprintf(atcmd_output, msg_txt(918), MIN_WALK_SPEED, MAX_WALK_SPEED); // Please enter a speed value (usage: @speed <%d-%d>). + sprintf(atcmd_output, msg_txt(sd->lang,918), MIN_WALK_SPEED, MAX_WALK_SPEED); // Please enter a speed value (usage: @speed <%d-%d>). clif_displaymessage(fd, atcmd_output); return -1; } sd->base_status.speed = cap_value(speed, MIN_WALK_SPEED, MAX_WALK_SPEED); status_calc_bl(&sd->bl, SCB_SPEED); - clif_displaymessage(fd, msg_txt(8)); // Speed changed. + clif_displaymessage(fd, msg_txt(sd->lang,8)); // Speed changed. return 0; } @@ -800,11 +800,11 @@ if (storage_storageopen(sd) == 1) { //Already open. - clif_displaymessage(fd, msg_txt(250)); + clif_displaymessage(fd, msg_txt(sd->lang,250)); return -1; } - clif_displaymessage(fd, msg_txt(919)); // Storage opened. + clif_displaymessage(fd, msg_txt(sd->lang,919)); // Storage opened. return 0; } @@ -818,7 +818,7 @@ nullpo_retr(-1, sd); if (!sd->status.guild_id) { - clif_displaymessage(fd, msg_txt(252)); + clif_displaymessage(fd, msg_txt(sd->lang,252)); return -1; } @@ -826,17 +826,17 @@ return -1; if (sd->state.storage_flag == 1) { - clif_displaymessage(fd, msg_txt(250)); + clif_displaymessage(fd, msg_txt(sd->lang,250)); return -1; } if (sd->state.storage_flag == 2) { - clif_displaymessage(fd, msg_txt(251)); + clif_displaymessage(fd, msg_txt(sd->lang,251)); return -1; } storage_guild_storageopen(sd); - clif_displaymessage(fd, msg_txt(920)); // Guild storage opened. + clif_displaymessage(fd, msg_txt(sd->lang,920)); // Guild storage opened. return 0; } @@ -856,7 +856,7 @@ text = atcommand_help_string( command ); // notify the user of the requirement to enter an option - clif_displaymessage(fd, msg_txt(921)); // Please enter at least one option. + clif_displaymessage(fd, msg_txt(sd->lang,921)); // Please enter at least one option. if( text ) {// send the help text associated with this command @@ -870,7 +870,7 @@ sd->sc.opt2 = param2; pc_setoption(sd, param3); - clif_displaymessage(fd, msg_txt(9)); // Options changed. + clif_displaymessage(fd, msg_txt(sd->lang,9)); // Options changed. return 0; } @@ -887,7 +887,7 @@ status_set_viewdata(&sd->bl, sd->disguise); else status_set_viewdata(&sd->bl, sd->status.class_); - clif_displaymessage(fd, msg_txt(10)); // Invisible: Off + clif_displaymessage(fd, msg_txt(sd->lang,10)); // Invisible: Off // increment the number of pvp players on the map map[sd->bl.m].users_pvp++; @@ -901,7 +901,7 @@ } else { sd->sc.option |= OPTION_INVISIBLE; sd->vd.class_ = INVISIBLE_CLASS; - clif_displaymessage(fd, msg_txt(11)); // Invisible: On + clif_displaymessage(fd, msg_txt(sd->lang,11)); // Invisible: On // decrement the number of pvp players on the map map[sd->bl.m].users_pvp--; @@ -950,15 +950,15 @@ || job == JOB_LORD_KNIGHT2 || job == JOB_PALADIN2 || job == JOB_BABY_KNIGHT2 || job == JOB_BABY_CRUSADER2 || job == JOB_STAR_GLADIATOR2 || (job >= JOB_RUNE_KNIGHT2 && job <= JOB_MECHANIC_T2) || (job >= JOB_BABY_RUNE2 && job <= JOB_BABY_MECHANIC2) ) // Deny direct transformation into dummy jobs - {clif_displaymessage(fd, msg_txt(923)); //"You can not change to this job by command." + {clif_displaymessage(fd, msg_txt(sd->lang,923)); //"You can not change to this job by command." return 0;} if (pcdb_checkid(job)) { if (pc_jobchange(sd, job, upper) == 0) - clif_displaymessage(fd, msg_txt(12)); // Your job has been changed. + clif_displaymessage(fd, msg_txt(sd->lang,12)); // Your job has been changed. else { - clif_displaymessage(fd, msg_txt(155)); // You are unable to change your job. + clif_displaymessage(fd, msg_txt(sd->lang,155)); // You are unable to change your job. return -1; } } else { @@ -978,9 +978,9 @@ { nullpo_retr(-1, sd); status_kill(&sd->bl); - clif_displaymessage(sd->fd, msg_txt(13)); // A pity! You've died. + clif_displaymessage(sd->fd, msg_txt(sd->lang,13)); // A pity! You've died. if (fd != sd->fd) - clif_displaymessage(fd, msg_txt(14)); // Character killed. + clif_displaymessage(fd, msg_txt(sd->lang,14)); // Character killed. return 0; } @@ -992,11 +992,11 @@ nullpo_retr(-1, sd); if (!status_revive(&sd->bl, 100, 100)) { - clif_displaymessage(fd, msg_txt(667)); + clif_displaymessage(fd, msg_txt(sd->lang,667)); return -1; } clif_skill_nodamage(&sd->bl,&sd->bl,ALL_RESURRECTION,4,1); - clif_displaymessage(fd, msg_txt(16)); // You've been revived! It's a miracle! + clif_displaymessage(fd, msg_txt(sd->lang,16)); // You've been revived! It's a miracle! return 0; } @@ -1012,7 +1012,7 @@ if(*(command + 5) != 'c' && *(command + 5) != 'C') { if (!message || !*message) { - clif_displaymessage(fd, msg_txt(980)); // Please enter a message (usage: @kami ). + clif_displaymessage(fd, msg_txt(sd->lang,980)); // Please enter a message (usage: @kami ). return -1; } @@ -1023,12 +1023,12 @@ intif_broadcast(atcmd_output, strlen(atcmd_output) + 1, (*(command + 5) == 'b' || *(command + 5) == 'B') ? 0x10 : 0); } else { if(!message || !*message || (sscanf(message, "%lx %199[^\n]", &color, atcmd_output) < 2)) { - clif_displaymessage(fd, msg_txt(981)); // Please enter color and message (usage: @kamic ). + clif_displaymessage(fd, msg_txt(sd->lang,981)); // Please enter color and message (usage: @kamic ). return -1; } if(color > 0xFFFFFF) { - clif_displaymessage(fd, msg_txt(982)); // Invalid color. + clif_displaymessage(fd, msg_txt(sd->lang,982)); // Invalid color. return -1; } intif_broadcast2(atcmd_output, strlen(atcmd_output) + 1, color, 0x190, 12, 0, 0); @@ -1052,24 +1052,24 @@ if ( hp == 0 && sp == 0 ) { if (!status_percent_heal(&sd->bl, 100, 100)) - clif_displaymessage(fd, msg_txt(157)); // HP and SP have already been recovered. + clif_displaymessage(fd, msg_txt(sd->lang,157)); // HP and SP have already been recovered. else - clif_displaymessage(fd, msg_txt(17)); // HP, SP recovered. + clif_displaymessage(fd, msg_txt(sd->lang,17)); // HP, SP recovered. return 0; } if ( hp > 0 && sp >= 0 ) { if(!status_heal(&sd->bl, hp, sp, 0)) - clif_displaymessage(fd, msg_txt(157)); // HP and SP are already with the good value. + clif_displaymessage(fd, msg_txt(sd->lang,157)); // HP and SP are already with the good value. else - clif_displaymessage(fd, msg_txt(17)); // HP, SP recovered. + clif_displaymessage(fd, msg_txt(sd->lang,17)); // HP, SP recovered. return 0; } if ( hp < 0 && sp <= 0 ) { status_damage(NULL, &sd->bl, -hp, -sp, 0, 0); clif_damage(&sd->bl,&sd->bl, gettick(), 0, 0, -hp, 0, 4, 0); - clif_displaymessage(fd, msg_txt(156)); // HP or/and SP modified. + clif_displaymessage(fd, msg_txt(sd->lang,156)); // HP or/and SP modified. return 0; } @@ -1090,7 +1090,7 @@ status_damage(NULL, &sd->bl, 0, -sp, 0, 0); } - clif_displaymessage(fd, msg_txt(156)); // HP or/and SP modified. + clif_displaymessage(fd, msg_txt(sd->lang,156)); // HP or/and SP modified. return 0; } @@ -1112,7 +1112,7 @@ sscanf(message, "\"%99[^\"]\" %d", item_name, &number) < 1 && sscanf(message, "%99s %d", item_name, &number) < 1 )) { - clif_displaymessage(fd, msg_txt(983)); // Please enter an item name or ID (usage: @item ). + clif_displaymessage(fd, msg_txt(sd->lang,983)); // Please enter an item name or ID (usage: @item ). return -1; } @@ -1122,7 +1122,7 @@ if ((item_data = itemdb_searchname(item_name)) == NULL && (item_data = itemdb_exists(atoi(item_name))) == NULL) { - clif_displaymessage(fd, msg_txt(19)); // Invalid item ID or name. + clif_displaymessage(fd, msg_txt(sd->lang,19)); // Invalid item ID or name. return -1; } @@ -1145,7 +1145,7 @@ } if (flag == 0) - clif_displaymessage(fd, msg_txt(18)); // Item created. + clif_displaymessage(fd, msg_txt(sd->lang,18)); // Item created. return 0; } @@ -1168,8 +1168,8 @@ sscanf(message, "\"%99[^\"]\" %d %d %d %d %d %d %d %d", item_name, &number, &identify, &refine, &attr, &c1, &c2, &c3, &c4) < 9 && sscanf(message, "%99s %d %d %d %d %d %d %d %d", item_name, &number, &identify, &refine, &attr, &c1, &c2, &c3, &c4) < 9 )) { - clif_displaymessage(fd, msg_txt(984)); // Please enter all parameters (usage: @item2 - clif_displaymessage(fd, msg_txt(985)); // ). + clif_displaymessage(fd, msg_txt(sd->lang,984)); // Please enter all parameters (usage: @item2 + clif_displaymessage(fd, msg_txt(sd->lang,985)); // ). return -1; } @@ -1217,9 +1217,9 @@ } if (flag == 0) - clif_displaymessage(fd, msg_txt(18)); // Item created. + clif_displaymessage(fd, msg_txt(sd->lang,18)); // Item created. } else { - clif_displaymessage(fd, msg_txt(19)); // Invalid item ID or name. + clif_displaymessage(fd, msg_txt(sd->lang,19)); // Invalid item ID or name. return -1; } @@ -1239,7 +1239,7 @@ pc_delitem(sd, i, sd->status.inventory[i].amount, 0, 0, LOG_TYPE_COMMAND); } } - clif_displaymessage(fd, msg_txt(20)); // All of your items have been removed. + clif_displaymessage(fd, msg_txt(sd->lang,20)); // All of your items have been removed. return 0; } @@ -1254,13 +1254,13 @@ level = atoi(message); if (!message || !*message || !level) { - clif_displaymessage(fd, msg_txt(986)); // Please enter a level adjustment (usage: @lvup/@blevel/@baselvlup ). + clif_displaymessage(fd, msg_txt(sd->lang,986)); // Please enter a level adjustment (usage: @lvup/@blevel/@baselvlup ). return -1; } if (level > 0) { if (sd->status.base_level >= pc_maxbaselv(sd)) { // check for max level by Valaris - clif_displaymessage(fd, msg_txt(47)); // Base level can't go any higher. + clif_displaymessage(fd, msg_txt(sd->lang,47)); // Base level can't go any higher. return -1; } // End Addition if ((unsigned int)level > pc_maxbaselv(sd) || (unsigned int)level > pc_maxbaselv(sd) - sd->status.base_level) // fix positiv overflow @@ -1272,10 +1272,10 @@ sd->status.base_level += (unsigned int)level; status_percent_heal(&sd->bl, 100, 100); clif_misceffect(&sd->bl, 0); - clif_displaymessage(fd, msg_txt(21)); // Base level raised. + clif_displaymessage(fd, msg_txt(sd->lang,21)); // Base level raised. } else { if (sd->status.base_level == 1) { - clif_displaymessage(fd, msg_txt(158)); // Base level can't go any lower. + clif_displaymessage(fd, msg_txt(sd->lang,158)); // Base level can't go any lower. return -1; } level*=-1; @@ -1290,7 +1290,7 @@ else sd->status.status_point -= status_point; sd->status.base_level -= (unsigned int)level; - clif_displaymessage(fd, msg_txt(22)); // Base level lowered. + clif_displaymessage(fd, msg_txt(sd->lang,22)); // Base level lowered. } sd->status.base_exp = 0; clif_updatestatus(sd, SP_STATUSPOINT); @@ -1315,12 +1315,12 @@ level = atoi(message); if (!message || !*message || !level) { - clif_displaymessage(fd, msg_txt(987)); // Please enter a level adjustment (usage: @joblvup/@jlevel/@joblvlup ). + clif_displaymessage(fd, msg_txt(sd->lang,987)); // Please enter a level adjustment (usage: @joblvup/@jlevel/@joblvlup ). return -1; } if (level > 0) { if (sd->status.job_level >= pc_maxjoblv(sd)) { - clif_displaymessage(fd, msg_txt(23)); // Job level can't go any higher. + clif_displaymessage(fd, msg_txt(sd->lang,23)); // Job level can't go any higher. return -1; } if ((unsigned int)level > pc_maxjoblv(sd) || (unsigned int)level > pc_maxjoblv(sd) - sd->status.job_level) // fix positiv overflow @@ -1328,10 +1328,10 @@ sd->status.job_level += (unsigned int)level; sd->status.skill_point += level; clif_misceffect(&sd->bl, 1); - clif_displaymessage(fd, msg_txt(24)); // Job level raised. + clif_displaymessage(fd, msg_txt(sd->lang,24)); // Job level raised. } else { if (sd->status.job_level == 1) { - clif_displaymessage(fd, msg_txt(159)); // Job level can't go any lower. + clif_displaymessage(fd, msg_txt(sd->lang,159)); // Job level can't go any lower. return -1; } level *=-1; @@ -1344,7 +1344,7 @@ sd->status.skill_point = 0; else sd->status.skill_point -= level; - clif_displaymessage(fd, msg_txt(25)); // Job level lowered. + clif_displaymessage(fd, msg_txt(sd->lang,25)); // Job level lowered. } sd->status.job_exp = 0; clif_updatestatus(sd, SP_JOBLEVEL); @@ -1370,7 +1370,7 @@ help = config_lookup(&atcommand_config, "help"); if (help == NULL) { - clif_displaymessage(fd, msg_txt(27)); // "Commands help is not available." + clif_displaymessage(fd, msg_txt(sd->lang,27)); // "Commands help is not available." return -1; } @@ -1383,20 +1383,20 @@ } if (!pc_can_use_command(sd, command_name, COMMAND_ATCOMMAND)) { - sprintf(atcmd_output, msg_txt(153), message); // "%s is Unknown Command" + sprintf(atcmd_output, msg_txt(sd->lang,153), message); // "%s is Unknown Command" clif_displaymessage(fd, atcmd_output); atcommand_get_suggestions(sd, command_name, true); return -1; } if (!config_setting_lookup_string(help, command_name, &text)) { - sprintf(atcmd_output, msg_txt(988), atcommand_symbol, command_name); // There is no help for %c%s. + sprintf(atcmd_output, msg_txt(sd->lang,988), atcommand_symbol, command_name); // There is no help for %c%s. clif_displaymessage(fd, atcmd_output); atcommand_get_suggestions(sd, command_name, true); return -1; } - sprintf(atcmd_output, msg_txt(989), atcommand_symbol, command_name); // Help for command %c%s: + sprintf(atcmd_output, msg_txt(sd->lang,989), atcommand_symbol, command_name); // Help for command %c%s: clif_displaymessage(fd, atcmd_output); { // Display aliases @@ -1407,7 +1407,7 @@ bool has_aliases = false; StringBuf_Init(&buf); - StringBuf_AppendStr(&buf, msg_txt(990)); // Available aliases: + StringBuf_AppendStr(&buf, msg_txt(sd->lang,990)); // Available aliases: command_info = get_atcommandinfo_byname(command_name); iter = db_iterator(atcommand_alias_db); for (alias_info = dbi_first(iter); dbi_exists(iter); alias_info = dbi_next(iter)) { @@ -1459,7 +1459,7 @@ nullpo_retr(-1, sd); if (!map[sd->bl.m].flag.pvp) { - clif_displaymessage(fd, msg_txt(160)); // PvP is already Off. + clif_displaymessage(fd, msg_txt(sd->lang,160)); // PvP is already Off. return -1; } @@ -1469,7 +1469,7 @@ clif_map_property_mapall(sd->bl.m, MAPPROPERTY_NOTHING); map_foreachinmap(atcommand_pvpoff_sub,sd->bl.m, BL_PC); map_foreachinmap(atcommand_stopattack,sd->bl.m, BL_CHAR, 0); - clif_displaymessage(fd, msg_txt(31)); // PvP: Off. + clif_displaymessage(fd, msg_txt(sd->lang,31)); // PvP: Off. return 0; } @@ -1495,7 +1495,7 @@ nullpo_retr(-1, sd); if (map[sd->bl.m].flag.pvp) { - clif_displaymessage(fd, msg_txt(161)); // PvP is already On. + clif_displaymessage(fd, msg_txt(sd->lang,161)); // PvP is already On. return -1; } @@ -1507,7 +1507,7 @@ map_foreachinmap(atcommand_pvpon_sub,sd->bl.m, BL_PC); } - clif_displaymessage(fd, msg_txt(32)); // PvP: On. + clif_displaymessage(fd, msg_txt(sd->lang,32)); // PvP: On. return 0; } @@ -1520,14 +1520,14 @@ nullpo_retr(-1, sd); if (!map[sd->bl.m].flag.gvg) { - clif_displaymessage(fd, msg_txt(162)); // GvG is already Off. + clif_displaymessage(fd, msg_txt(sd->lang,162)); // GvG is already Off. return -1; } map[sd->bl.m].flag.gvg = 0; clif_map_property_mapall(sd->bl.m, MAPPROPERTY_NOTHING); map_foreachinmap(atcommand_stopattack,sd->bl.m, BL_CHAR, 0); - clif_displaymessage(fd, msg_txt(33)); // GvG: Off. + clif_displaymessage(fd, msg_txt(sd->lang,33)); // GvG: Off. return 0; } @@ -1540,13 +1540,13 @@ nullpo_retr(-1, sd); if (map[sd->bl.m].flag.gvg) { - clif_displaymessage(fd, msg_txt(163)); // GvG is already On. + clif_displaymessage(fd, msg_txt(sd->lang,163)); // GvG is already On. return -1; } map[sd->bl.m].flag.gvg = 1; clif_map_property_mapall(sd->bl.m, MAPPROPERTY_AGITZONE); - clif_displaymessage(fd, msg_txt(34)); // GvG: On. + clif_displaymessage(fd, msg_txt(sd->lang,34)); // GvG: On. return 0; } @@ -1562,7 +1562,7 @@ memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%d %d %d", &hair_style, &hair_color, &cloth_color) < 1) { - sprintf(atcmd_output, msg_txt(991), // Please enter at least one value (usage: @model ). + sprintf(atcmd_output, msg_txt(sd->lang,991), // Please enter at least one value (usage: @model ). MIN_HAIR_STYLE, MAX_HAIR_STYLE, MIN_HAIR_COLOR, MAX_HAIR_COLOR, MIN_CLOTH_COLOR, MAX_CLOTH_COLOR); clif_displaymessage(fd, atcmd_output); return -1; @@ -1574,9 +1574,9 @@ pc_changelook(sd, LOOK_HAIR, hair_style); pc_changelook(sd, LOOK_HAIR_COLOR, hair_color); pc_changelook(sd, LOOK_CLOTHES_COLOR, cloth_color); - clif_displaymessage(fd, msg_txt(36)); // Appearence changed. + clif_displaymessage(fd, msg_txt(sd->lang,36)); // Appearence changed. } else { - clif_displaymessage(fd, msg_txt(37)); // An invalid number was specified. + clif_displaymessage(fd, msg_txt(sd->lang,37)); // An invalid number was specified. return -1; } @@ -1594,16 +1594,16 @@ memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%d", &cloth_color) < 1) { - sprintf(atcmd_output, msg_txt(992), MIN_CLOTH_COLOR, MAX_CLOTH_COLOR); // Please enter a clothes color (usage: @dye/@ccolor ). + sprintf(atcmd_output, msg_txt(sd->lang,992), MIN_CLOTH_COLOR, MAX_CLOTH_COLOR); // Please enter a clothes color (usage: @dye/@ccolor ). clif_displaymessage(fd, atcmd_output); return -1; } if (cloth_color >= MIN_CLOTH_COLOR && cloth_color <= MAX_CLOTH_COLOR) { pc_changelook(sd, LOOK_CLOTHES_COLOR, cloth_color); - clif_displaymessage(fd, msg_txt(36)); // Appearence changed. + clif_displaymessage(fd, msg_txt(sd->lang,36)); // Appearence changed. } else { - clif_displaymessage(fd, msg_txt(37)); // An invalid number was specified. + clif_displaymessage(fd, msg_txt(sd->lang,37)); // An invalid number was specified. return -1; } @@ -1621,16 +1621,16 @@ memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%d", &hair_style) < 1) { - sprintf(atcmd_output, msg_txt(993), MIN_HAIR_STYLE, MAX_HAIR_STYLE); // Please enter a hair style (usage: @hairstyle/@hstyle ). + sprintf(atcmd_output, msg_txt(sd->lang,993), MIN_HAIR_STYLE, MAX_HAIR_STYLE); // Please enter a hair style (usage: @hairstyle/@hstyle ). clif_displaymessage(fd, atcmd_output); return -1; } if (hair_style >= MIN_HAIR_STYLE && hair_style <= MAX_HAIR_STYLE) { pc_changelook(sd, LOOK_HAIR, hair_style); - clif_displaymessage(fd, msg_txt(36)); // Appearence changed. + clif_displaymessage(fd, msg_txt(sd->lang,36)); // Appearence changed. } else { - clif_displaymessage(fd, msg_txt(37)); // An invalid number was specified. + clif_displaymessage(fd, msg_txt(sd->lang,37)); // An invalid number was specified. return -1; } @@ -1648,16 +1648,16 @@ memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%d", &hair_color) < 1) { - sprintf(atcmd_output, msg_txt(994), MIN_HAIR_COLOR, MAX_HAIR_COLOR); // Please enter a hair color (usage: @haircolor/@hcolor ). + sprintf(atcmd_output, msg_txt(sd->lang,994), MIN_HAIR_COLOR, MAX_HAIR_COLOR); // Please enter a hair color (usage: @haircolor/@hcolor ). clif_displaymessage(fd, atcmd_output); return -1; } if (hair_color >= MIN_HAIR_COLOR && hair_color <= MAX_HAIR_COLOR) { pc_changelook(sd, LOOK_HAIR_COLOR, hair_color); - clif_displaymessage(fd, msg_txt(36)); // Appearence changed. + clif_displaymessage(fd, msg_txt(sd->lang,36)); // Appearence changed. } else { - clif_displaymessage(fd, msg_txt(37)); // An invalid number was specified. + clif_displaymessage(fd, msg_txt(sd->lang,37)); // An invalid number was specified. return -1; } @@ -1723,7 +1723,7 @@ nullpo_retr(-1, sd); if( map[sd->bl.m].flag.nogo && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE) ) { - clif_displaymessage(sd->fd,msg_txt(995)); // You cannot use @go on this map. + clif_displaymessage(sd->fd,msg_txt(sd->lang,995)); // You cannot use @go on this map. return 0; } @@ -1740,7 +1740,7 @@ // attempt to find the text help string text = atcommand_help_string( command ); - clif_displaymessage(fd, msg_txt(38)); // Invalid location number, or name. + clif_displaymessage(fd, msg_txt(sd->lang,38)); // Invalid location number, or name. if( text ) {// send the text to the client @@ -1843,21 +1843,21 @@ { m = map_mapname2mapid(data[town].map); if (m >= 0 && map[m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { - clif_displaymessage(fd, msg_txt(247)); + clif_displaymessage(fd, msg_txt(sd->lang,247)); return -1; } if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { - clif_displaymessage(fd, msg_txt(248)); + clif_displaymessage(fd, msg_txt(sd->lang,248)); return -1; } if (pc_setpos(sd, mapindex_name2id(data[town].map), data[town].x, data[town].y, CLR_TELEPORT) == 0) { - clif_displaymessage(fd, msg_txt(0)); // Warped. + clif_displaymessage(fd, msg_txt(sd->lang,0)); // Warped. } else { - clif_displaymessage(fd, msg_txt(1)); // Map not found. + clif_displaymessage(fd, msg_txt(sd->lang,1)); // Map not found. return -1; } } else { // if you arrive here, you have an error in town variable when reading of names - clif_displaymessage(fd, msg_txt(38)); // Invalid location number or name. + clif_displaymessage(fd, msg_txt(sd->lang,38)); // Invalid location number or name. return -1; } @@ -1885,7 +1885,7 @@ memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message) { - clif_displaymessage(fd, msg_txt(80)); // Give the display name or monster name/id please. + clif_displaymessage(fd, msg_txt(sd->lang,80)); // Give the display name or monster name/id please. return -1; } if (sscanf(message, "\"%23[^\"]\" %23s %d", name, monster, &number) > 1 || @@ -1901,7 +1901,7 @@ //As before, name may be already filled. name[0] = '\0'; } else { - clif_displaymessage(fd, msg_txt(80)); // Give a display name and monster name/id please. + clif_displaymessage(fd, msg_txt(sd->lang,80)); // Give a display name and monster name/id please. return -1; } @@ -1909,12 +1909,12 @@ mob_id = mobdb_checkid(atoi(monster)); if (mob_id == 0) { - clif_displaymessage(fd, msg_txt(40)); // Invalid monster ID or name. + clif_displaymessage(fd, msg_txt(sd->lang,40)); // Invalid monster ID or name. return -1; } if (mob_id == MOBID_EMPERIUM) { - clif_displaymessage(fd, msg_txt(83)); // Monster 'Emperium' cannot be spawned. + clif_displaymessage(fd, msg_txt(sd->lang,83)); // Monster 'Emperium' cannot be spawned. return -1; } @@ -1948,13 +1948,13 @@ if (count != 0) if (number == count) - clif_displaymessage(fd, msg_txt(39)); // All monster summoned! + clif_displaymessage(fd, msg_txt(sd->lang,39)); // All monster summoned! else { - sprintf(atcmd_output, msg_txt(240), count); // %d monster(s) summoned! + sprintf(atcmd_output, msg_txt(sd->lang,240), count); // %d monster(s) summoned! clif_displaymessage(fd, atcmd_output); } else { - clif_displaymessage(fd, msg_txt(40)); // Invalid monster ID or name. + clif_displaymessage(fd, msg_txt(sd->lang,40)); // Invalid monster ID or name. return -1; } @@ -2001,7 +2001,7 @@ map_foreachinmap(atkillmonster_sub, map_id, BL_MOB, -drop_flag); - clif_displaymessage(fd, msg_txt(165)); // All monsters killed! + clif_displaymessage(fd, msg_txt(sd->lang,165)); // All monsters killed! return 0; } @@ -2018,26 +2018,26 @@ memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%d %d", &position, &refine) < 2) { - clif_displaymessage(fd, msg_txt(996)); // Please enter a position and an amount (usage: @refine <+/- amount>). - sprintf(atcmd_output, msg_txt(997), EQP_HEAD_LOW); // %d: Lower Headgear + clif_displaymessage(fd, msg_txt(sd->lang,996)); // Please enter a position and an amount (usage: @refine <+/- amount>). + sprintf(atcmd_output, msg_txt(sd->lang,997), EQP_HEAD_LOW); // %d: Lower Headgear clif_displaymessage(fd, atcmd_output); - sprintf(atcmd_output, msg_txt(998), EQP_HAND_R); // %d: Right Hand + sprintf(atcmd_output, msg_txt(sd->lang,998), EQP_HAND_R); // %d: Right Hand clif_displaymessage(fd, atcmd_output); - sprintf(atcmd_output, msg_txt(999), EQP_GARMENT); // %d: Garment + sprintf(atcmd_output, msg_txt(sd->lang,999), EQP_GARMENT); // %d: Garment clif_displaymessage(fd, atcmd_output); - sprintf(atcmd_output, msg_txt(1000), EQP_ACC_L); // %d: Left Accessory + sprintf(atcmd_output, msg_txt(sd->lang,1000), EQP_ACC_L); // %d: Left Accessory clif_displaymessage(fd, atcmd_output); - sprintf(atcmd_output, msg_txt(1001), EQP_ARMOR); // %d: Body Armor + sprintf(atcmd_output, msg_txt(sd->lang,1001), EQP_ARMOR); // %d: Body Armor clif_displaymessage(fd, atcmd_output); - sprintf(atcmd_output, msg_txt(1002), EQP_HAND_L); // %d: Left Hand + sprintf(atcmd_output, msg_txt(sd->lang,1002), EQP_HAND_L); // %d: Left Hand clif_displaymessage(fd, atcmd_output); - sprintf(atcmd_output, msg_txt(1003), EQP_SHOES); // %d: Shoes + sprintf(atcmd_output, msg_txt(sd->lang,1003), EQP_SHOES); // %d: Shoes clif_displaymessage(fd, atcmd_output); - sprintf(atcmd_output, msg_txt(1004), EQP_ACC_R); // %d: Right Accessory + sprintf(atcmd_output, msg_txt(sd->lang,1004), EQP_ACC_R); // %d: Right Accessory clif_displaymessage(fd, atcmd_output); - sprintf(atcmd_output, msg_txt(1005), EQP_HEAD_TOP); // %d: Top Headgear + sprintf(atcmd_output, msg_txt(sd->lang,1005), EQP_HEAD_TOP); // %d: Top Headgear clif_displaymessage(fd, atcmd_output); - sprintf(atcmd_output, msg_txt(1006), EQP_HEAD_MID); // %d: Mid Headgear + sprintf(atcmd_output, msg_txt(sd->lang,1006), EQP_HEAD_MID); // %d: Mid Headgear clif_displaymessage(fd, atcmd_output); return -1; } @@ -2073,11 +2073,11 @@ } if (count == 0) - clif_displaymessage(fd, msg_txt(166)); // No item has been refined. + clif_displaymessage(fd, msg_txt(sd->lang,166)); // No item has been refined. else if (count == 1) - clif_displaymessage(fd, msg_txt(167)); // 1 item has been refined. + clif_displaymessage(fd, msg_txt(sd->lang,167)); // 1 item has been refined. else { - sprintf(atcmd_output, msg_txt(168), count); // %d items have been refined. + sprintf(atcmd_output, msg_txt(sd->lang,168), count); // %d items have been refined. clif_displaymessage(fd, atcmd_output); } @@ -2102,13 +2102,13 @@ sscanf(message, "\"%99[^\"]\" %d %d", item_name, &attribute, &star) < 1 && sscanf(message, "%99s %d %d", item_name, &attribute, &star) < 1 )) { - clif_displaymessage(fd, msg_txt(1007)); // Please enter at least one item name/ID (usage: @produce <# of very's>). + clif_displaymessage(fd, msg_txt(sd->lang,1007)); // Please enter at least one item name/ID (usage: @produce <# of very's>). return -1; } if ( (item_data = itemdb_searchname(item_name)) == NULL && (item_data = itemdb_exists(atoi(item_name))) == NULL ) { - clif_displaymessage(fd, msg_txt(170)); //This item is not an equipment. + clif_displaymessage(fd, msg_txt(sd->lang,170)); //This item is not an equipment. return -1; } @@ -2135,7 +2135,7 @@ if ((flag = pc_additem(sd, &tmp_item, 1, LOG_TYPE_COMMAND))) clif_additem(sd, 0, 0, flag); } else { - sprintf(atcmd_output, msg_txt(169), item_id, item_data->name); // The item (%d: '%s') is not equipable. + sprintf(atcmd_output, msg_txt(sd->lang,169), item_id, item_data->name); // The item (%d: '%s') is not equipable. clif_displaymessage(fd, atcmd_output); return -1; } @@ -2156,13 +2156,13 @@ if( !message || !*message || sscanf(message, "%d", &position) < 1 ) { int i; - clif_displaymessage(sd->fd, msg_txt(668)); + clif_displaymessage(sd->fd, msg_txt(sd->lang,668)); for( i = 0; i < MAX_MEMOPOINTS; i++ ) { if( sd->status.memo_point[i].map ) sprintf(atcmd_output, "%d - %s (%d,%d)", i, mapindex_id2name(sd->status.memo_point[i].map), sd->status.memo_point[i].x, sd->status.memo_point[i].y); else - sprintf(atcmd_output, msg_txt(171), i); // %d - void + sprintf(atcmd_output, msg_txt(sd->lang,171), i); // %d - void clif_displaymessage(sd->fd, atcmd_output); } return 0; @@ -2170,7 +2170,7 @@ if( position < 0 || position >= MAX_MEMOPOINTS ) { - sprintf(atcmd_output, msg_txt(1008), 0, MAX_MEMOPOINTS-1); // Please enter a valid position (usage: @memo ). + sprintf(atcmd_output, msg_txt(sd->lang,1008), 0, MAX_MEMOPOINTS-1); // Please enter a valid position (usage: @memo ). clif_displaymessage(fd, atcmd_output); return -1; } @@ -2213,7 +2213,7 @@ nullpo_retr(-1, sd); if (!message || !*message || (i = sscanf(message, "%d %d %d %d %d %d", &type, &flag, &tick, &val1, &val2, &val3)) < 1) { - clif_displaymessage(fd, msg_txt(1009)); // Please enter a status type/flag (usage: @displaystatus { { {}}}). + clif_displaymessage(fd, msg_txt(sd->lang,1009)); // Please enter a status type/flag (usage: @displaystatus { { {}}}). return -1; } if (i < 2) flag = 1; @@ -2233,7 +2233,7 @@ unsigned int new_status_point; if (!message || !*message || (point = atoi(message)) == 0) { - clif_displaymessage(fd, msg_txt(1010)); // Please enter a number (usage: @stpoint ). + clif_displaymessage(fd, msg_txt(sd->lang,1010)); // Please enter a number (usage: @stpoint ). return -1; } @@ -2260,12 +2260,12 @@ if (new_status_point != sd->status.status_point) { sd->status.status_point = new_status_point; clif_updatestatus(sd, SP_STATUSPOINT); - clif_displaymessage(fd, msg_txt(174)); // Number of status points changed. + clif_displaymessage(fd, msg_txt(sd->lang,174)); // Number of status points changed. } else { if (point < 0) - clif_displaymessage(fd, msg_txt(41)); // Unable to decrease the number/value. + clif_displaymessage(fd, msg_txt(sd->lang,41)); // Unable to decrease the number/value. else - clif_displaymessage(fd, msg_txt(149)); // Unable to increase the number/value. + clif_displaymessage(fd, msg_txt(sd->lang,149)); // Unable to increase the number/value. return -1; } @@ -2282,7 +2282,7 @@ nullpo_retr(-1, sd); if (!message || !*message || (point = atoi(message)) == 0) { - clif_displaymessage(fd, msg_txt(1011)); // Please enter a number (usage: @skpoint ). + clif_displaymessage(fd, msg_txt(sd->lang,1011)); // Please enter a number (usage: @skpoint ). return -1; } @@ -2309,12 +2309,12 @@ if (new_skill_point != sd->status.skill_point) { sd->status.skill_point = new_skill_point; clif_updatestatus(sd, SP_SKILLPOINT); - clif_displaymessage(fd, msg_txt(175)); // Number of skill points changed. + clif_displaymessage(fd, msg_txt(sd->lang,175)); // Number of skill points changed. } else { if (point < 0) - clif_displaymessage(fd, msg_txt(41)); // Unable to decrease the number/value. + clif_displaymessage(fd, msg_txt(sd->lang,41)); // Unable to decrease the number/value. else - clif_displaymessage(fd, msg_txt(149)); // Unable to increase the number/value. + clif_displaymessage(fd, msg_txt(sd->lang,149)); // Unable to increase the number/value. return -1; } @@ -2330,20 +2330,20 @@ nullpo_retr(-1, sd); if (!message || !*message || (zeny = atoi(message)) == 0) { - clif_displaymessage(fd, msg_txt(1012)); // Please enter an amount (usage: @zeny ). + clif_displaymessage(fd, msg_txt(sd->lang,1012)); // Please enter an amount (usage: @zeny ). return -1; } if(zeny > 0){ if((ret=pc_getzeny(sd,zeny,LOG_TYPE_COMMAND,NULL)) == 1) - clif_displaymessage(fd, msg_txt(149)); // Unable to increase the number/value. + clif_displaymessage(fd, msg_txt(sd->lang,149)); // Unable to increase the number/value. } else { if( sd->status.zeny < -zeny ) zeny = -sd->status.zeny; if((ret=pc_payzeny(sd,-zeny,LOG_TYPE_COMMAND,NULL)) == 1) - clif_displaymessage(fd, msg_txt(41)); // Unable to decrease the number/value. + clif_displaymessage(fd, msg_txt(sd->lang,41)); // Unable to decrease the number/value. } - if(!ret) clif_displaymessage(fd, msg_txt(176)); //ret=0 mean cmd success + if(!ret) clif_displaymessage(fd, msg_txt(sd->lang,176)); //ret=0 mean cmd success return 0; } @@ -2361,14 +2361,14 @@ memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%d", &value) < 1 || value == 0) { - clif_displaymessage(fd, msg_txt(1013)); // Please enter a valid value (usage: @str/@agi/@vit/@int/@dex/@luk <+/-adjustment>). + clif_displaymessage(fd, msg_txt(sd->lang,1013)); // Please enter a valid value (usage: @str/@agi/@vit/@int/@dex/@luk <+/-adjustment>). return -1; } ARR_FIND( 0, ARRAYLENGTH(param), i, strcmpi(command+1, param[i]) == 0 ); if( i == ARRAYLENGTH(param) || i > MAX_STATUS_TYPE) { // normally impossible... - clif_displaymessage(fd, msg_txt(1013)); // Please enter a valid value (usage: @str/@agi/@vit/@int/@dex/@luk <+/-adjustment>). + clif_displaymessage(fd, msg_txt(sd->lang,1013)); // Please enter a valid value (usage: @str/@agi/@vit/@int/@dex/@luk <+/-adjustment>). return -1; } @@ -2397,12 +2397,12 @@ clif_updatestatus(sd, SP_STR + i); clif_updatestatus(sd, SP_USTR + i); status_calc_pc(sd, 0); - clif_displaymessage(fd, msg_txt(42)); // Stat changed. + clif_displaymessage(fd, msg_txt(sd->lang,42)); // Stat changed. } else { if (value < 0) - clif_displaymessage(fd, msg_txt(41)); // Unable to decrease the number/value. + clif_displaymessage(fd, msg_txt(sd->lang,41)); // Unable to decrease the number/value. else - clif_displaymessage(fd, msg_txt(149)); // Unable to increase the number/value. + clif_displaymessage(fd, msg_txt(sd->lang,149)); // Unable to increase the number/value. return -1; } @@ -2456,12 +2456,12 @@ if (count > 0) { // if at least 1 stat modified status_calc_pc(sd, 0); - clif_displaymessage(fd, msg_txt(84)); // All stats changed! + clif_displaymessage(fd, msg_txt(sd->lang,84)); // All stats changed! } else { if (value < 0) - clif_displaymessage(fd, msg_txt(177)); // You cannot decrease that stat anymore. + clif_displaymessage(fd, msg_txt(sd->lang,177)); // You cannot decrease that stat anymore. else - clif_displaymessage(fd, msg_txt(178)); // You cannot increase that stat anymore. + clif_displaymessage(fd, msg_txt(sd->lang,178)); // You cannot increase that stat anymore. return -1; } @@ -2479,16 +2479,16 @@ nullpo_retr(-1, sd); if (!message || !*message || sscanf(message, "%d", &level) < 1 || level == 0) { - clif_displaymessage(fd, msg_txt(1014)); // Please enter a valid level (usage: @guildlvup/@guildlvlup <# of levels>). + clif_displaymessage(fd, msg_txt(sd->lang,1014)); // Please enter a valid level (usage: @guildlvup/@guildlvlup <# of levels>). return -1; } if (sd->status.guild_id <= 0 || (guild_info = guild_search(sd->status.guild_id)) == NULL) { - clif_displaymessage(fd, msg_txt(43)); // You're not in a guild. + clif_displaymessage(fd, msg_txt(sd->lang,43)); // You're not in a guild. return -1; } //if (strcmp(sd->status.name, guild_info->master) != 0) { - // clif_displaymessage(fd, msg_txt(44)); // You're not the master of your guild. + // clif_displaymessage(fd, msg_txt(sd->lang,44)); // You're not the master of your guild. // return -1; //} @@ -2500,9 +2500,9 @@ if (added_level != 0) { intif_guild_change_basicinfo(guild_info->guild_id, GBI_GUILDLV, &added_level, sizeof(added_level)); - clif_displaymessage(fd, msg_txt(179)); // Guild level changed. + clif_displaymessage(fd, msg_txt(sd->lang,179)); // Guild level changed. } else { - clif_displaymessage(fd, msg_txt(45)); // Guild level change failed. + clif_displaymessage(fd, msg_txt(sd->lang,45)); // Guild level change failed. return -1; } @@ -2519,7 +2519,7 @@ nullpo_retr(-1, sd); if (!message || !*message) { - clif_displaymessage(fd, msg_txt(1015)); // Please enter a monster/egg name/ID (usage: @makeegg ). + clif_displaymessage(fd, msg_txt(sd->lang,1015)); // Please enter a monster/egg name/ID (usage: @makeegg ). return -1; } @@ -2542,7 +2542,7 @@ (short)pet_db[pet_id].EggID, 0, (short)pet_db[pet_id].intimate, 100, 0, 1, pet_db[pet_id].jname); } else { - clif_displaymessage(fd, msg_txt(180)); // The monster/egg name/id doesn't exist. + clif_displaymessage(fd, msg_txt(sd->lang,180)); // The monster/egg name/id doesn't exist. return -1; } @@ -2558,7 +2558,7 @@ if (sd->status.pet_id <= 0) clif_sendegg(sd); else { - clif_displaymessage(fd, msg_txt(181)); // You already have a pet. + clif_displaymessage(fd, msg_txt(sd->lang,181)); // You already have a pet. return -1; } @@ -2575,30 +2575,30 @@ nullpo_retr(-1, sd); if (!message || !*message || (friendly = atoi(message)) < 0) { - clif_displaymessage(fd, msg_txt(1016)); // Please enter a valid value (usage: @petfriendly <0-1000>). + clif_displaymessage(fd, msg_txt(sd->lang,1016)); // Please enter a valid value (usage: @petfriendly <0-1000>). return -1; } pd = sd->pd; if (!pd) { - clif_displaymessage(fd, msg_txt(184)); // Sorry, but you have no pet. + clif_displaymessage(fd, msg_txt(sd->lang,184)); // Sorry, but you have no pet. return -1; } if (friendly < 0 || friendly > 1000) { - clif_displaymessage(fd, msg_txt(37)); // An invalid number was specified. + clif_displaymessage(fd, msg_txt(sd->lang,37)); // An invalid number was specified. return -1; } if (friendly == pd->pet.intimate) { - clif_displaymessage(fd, msg_txt(183)); // Pet intimacy is already at maximum. + clif_displaymessage(fd, msg_txt(sd->lang,183)); // Pet intimacy is already at maximum. return -1; } pet_set_intimate(pd, friendly); clif_send_petstatus(sd); - clif_displaymessage(fd, msg_txt(182)); // Pet intimacy changed. + clif_displaymessage(fd, msg_txt(sd->lang,182)); // Pet intimacy changed. return 0; } @@ -2612,27 +2612,27 @@ nullpo_retr(-1, sd); if (!message || !*message || (hungry = atoi(message)) < 0) { - clif_displaymessage(fd, msg_txt(1017)); // Please enter a valid number (usage: @pethungry <0-100>). + clif_displaymessage(fd, msg_txt(sd->lang,1017)); // Please enter a valid number (usage: @pethungry <0-100>). return -1; } pd = sd->pd; if (!sd->status.pet_id || !pd) { - clif_displaymessage(fd, msg_txt(184)); // Sorry, but you have no pet. + clif_displaymessage(fd, msg_txt(sd->lang,184)); // Sorry, but you have no pet. return -1; } if (hungry < 0 || hungry > 100) { - clif_displaymessage(fd, msg_txt(37)); // An invalid number was specified. + clif_displaymessage(fd, msg_txt(sd->lang,37)); // An invalid number was specified. return -1; } if (hungry == pd->pet.hungry) { - clif_displaymessage(fd, msg_txt(186)); // Pet hunger is already at maximum. + clif_displaymessage(fd, msg_txt(sd->lang,186)); // Pet hunger is already at maximum. return -1; } pd->pet.hungry = hungry; clif_send_petstatus(sd); - clif_displaymessage(fd, msg_txt(185)); // Pet hunger changed. + clif_displaymessage(fd, msg_txt(sd->lang,185)); // Pet hunger changed. return 0; } @@ -2645,19 +2645,19 @@ struct pet_data *pd; nullpo_retr(-1, sd); if (!sd->status.pet_id || !sd->pd) { - clif_displaymessage(fd, msg_txt(184)); // Sorry, but you have no pet. + clif_displaymessage(fd, msg_txt(sd->lang,184)); // Sorry, but you have no pet. return -1; } pd = sd->pd; if (!pd->pet.rename_flag) { - clif_displaymessage(fd, msg_txt(188)); // You can already rename your pet. + clif_displaymessage(fd, msg_txt(sd->lang,188)); // You can already rename your pet. return -1; } pd->pet.rename_flag = 0; intif_save_petdata(sd->status.account_id, &pd->pet); clif_send_petstatus(sd); - clif_displaymessage(fd, msg_txt(187)); // You can now rename your pet. + clif_displaymessage(fd, msg_txt(sd->lang,187)); // You can now rename your pet. return 0; } @@ -2671,35 +2671,35 @@ nullpo_retr(-1, sd); if (!message || !*message) { - clif_displaymessage(fd, msg_txt(1018)); // Please enter a player name (usage: @recall ). + clif_displaymessage(fd, msg_txt(sd->lang,1018)); // Please enter a player name (usage: @recall ). return -1; } if((pl_sd=map_nick2sd((char *)message)) == NULL && (pl_sd=map_charid2sd(atoi(message))) == NULL) { - clif_displaymessage(fd, msg_txt(3)); // Character not found. + clif_displaymessage(fd, msg_txt(sd->lang,3)); // Character not found. return -1; } if ( pc_get_group_level(sd) < pc_get_group_level(pl_sd) ) { - clif_displaymessage(fd, msg_txt(81)); // Your GM level doesn't authorize you to preform this action on the specified player. + clif_displaymessage(fd, msg_txt(sd->lang,81)); // Your GM level doesn't authorize you to preform this action on the specified player. return -1; } if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { - clif_displaymessage(fd, msg_txt(1019)); // You are not authorized to warp someone to this map. + clif_displaymessage(fd, msg_txt(sd->lang,1019)); // You are not authorized to warp someone to this map. return -1; } if (pl_sd->bl.m >= 0 && map[pl_sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { - clif_displaymessage(fd, msg_txt(1020)); // You are not authorized to warp this player from their map. + clif_displaymessage(fd, msg_txt(sd->lang,1020)); // You are not authorized to warp this player from their map. return -1; } if (pl_sd->bl.m == sd->bl.m && pl_sd->bl.x == sd->bl.x && pl_sd->bl.y == sd->bl.y) { return -1; } pc_setpos(pl_sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_RESPAWN); - sprintf(atcmd_output, msg_txt(46), pl_sd->status.name); // %s recalled! + sprintf(atcmd_output, msg_txt(sd->lang,46), pl_sd->status.name); // %s recalled! clif_displaymessage(fd, atcmd_output); return 0; @@ -2716,12 +2716,12 @@ memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) { - clif_displaymessage(fd, msg_txt(1021)); // Please enter a player name (usage: @charblock/@block ). + clif_displaymessage(fd, msg_txt(sd->lang,1021)); // Please enter a player name (usage: @charblock/@block ). return -1; } chrif_char_ask_name(sd->status.account_id, atcmd_player_name, 1, 0, 0, 0, 0, 0, 0); // type: 1 - block - clif_displaymessage(fd, msg_txt(88)); // Character name sent to char-server to ask it. + clif_displaymessage(fd, msg_txt(sd->lang,88)); // Character name sent to char-server to ask it. return 0; } @@ -2753,7 +2753,7 @@ memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); if (!message || !*message || sscanf(message, "%255s %23[^\n]", atcmd_output, atcmd_player_name) < 2) { - clif_displaymessage(fd, msg_txt(1022)); // Please enter ban time and a player name (usage: @charban/@ban/@banish/@charbanish