viewing paste Multilanguage initial sup | C

Posted on the
  1. Index: conf/char_athena.conf
  2. ===================================================================
  3. --- conf/char_athena.conf	(revision 17206)
  4. +++ conf/char_athena.conf	(working copy)
  5. @@ -197,4 +197,10 @@
  6.  // Allow users to move characters as often as they like?
  7.  char_moves_unlimited: no
  8.  
  9. +// Translations
  10. +// Format:
  11. +// read_msg: language ID,path
  12. +// read_msg: 1,conf/msg_conf/char_msg_sp.conf // Spanish
  13. +// read_msg: 2,conf/msg_conf/char_msg_ru.conf // Russian
  14. +
  15.  import: conf/import/char_conf.txt
  16. Index: conf/login_athena.conf
  17. ===================================================================
  18. --- conf/login_athena.conf	(revision 17206)
  19. +++ conf/login_athena.conf	(working copy)
  20. @@ -157,5 +157,11 @@
  21.  client_hash: 0, 113e195e6c051bb1cfb12a644bb084c5
  22.  client_hash: 99, cb1ea78023d337c38e8ba5124e2338ae
  23.  
  24. +// Translations
  25. +// Format:
  26. +// read_msg: language ID,path
  27. +// read_msg: 1,conf/msg_conf/login_msg_sp.conf // Spanish
  28. +// read_msg: 2,conf/msg_conf/login_msg_ru.conf // Russian
  29. +
  30.  import: conf/inter_athena.conf
  31.  import: conf/import/login_conf.txt
  32. Index: conf/map_athena.conf
  33. ===================================================================
  34. --- conf/map_athena.conf	(revision 17206)
  35. +++ conf/map_athena.conf	(working copy)
  36. @@ -115,6 +115,13 @@
  37.  help2_txt: conf/help2.txt
  38.  charhelp_txt: conf/charhelp.txt
  39.  
  40. +
  41. +// Translations
  42. +// Format:
  43. +// read_msg: language ID,path
  44. +// read_msg: 1,conf/msg_conf/map_msg_sp.conf // Spanish
  45. +// read_msg: 2,conf/msg_conf/map_msg_ru.conf // Russian
  46. +
  47.  // Maps:
  48.  import: conf/maps_athena.conf
  49.  
  50. Index: src/char/char.c
  51. ===================================================================
  52. --- src/char/char.c	(revision 17206)
  53. +++ src/char/char.c	(working copy)
  54. @@ -31,7 +31,7 @@
  55.  #include <stdlib.h>
  56.  
  57.  #define CHAR_MAX_MSG 200
  58. -static char* msg_table[CHAR_MAX_MSG]; // Login Server messages_conf
  59. +static char* msg_table[MAX_LANG][CHAR_MAX_MSG]; // Char Server messages_conf
  60.  
  61.  char char_db[256] = "char";
  62.  char scdata_db[256] = "sc_data";
  63. @@ -138,6 +138,7 @@
  64.  	uint16 pincode_try;
  65.  	// Addon system
  66.  	unsigned int char_moves[MAX_CHARS]; // character moves left
  67. +	int lang;
  68.  };
  69.  
  70.  int max_connect_user = -1;
  71. @@ -214,6 +215,7 @@
  72.  	time_t expiration_time; // # of seconds 1/1/1970 (timestamp): Validity limit of the account (0 = unlimited)
  73.  	int group_id;
  74.  	unsigned changing_mapservers : 1;
  75. +	int lang;
  76.  };
  77.  
  78.  static DBMap* auth_db; // int account_id -> struct auth_node*
  79. @@ -2204,7 +2206,7 @@
  80.  		break;
  81.  
  82.  		case 0x2717: // account data
  83. -			if (RFIFOREST(fd) < 72)
  84. +			if (RFIFOREST(fd) < 73)
  85.  				return 0;
  86.  
  87.  			// find the authenticated session with this account id
  88. @@ -2221,9 +2223,14 @@
  89.  					sd->char_slots = MAX_CHARS;/* cap to maximum */
  90.  				} else if ( !sd->char_slots )/* no value aka 0 in sql */
  91.  					sd->char_slots = MAX_CHARS;/* cap to maximum */
  92. -				safestrncpy(sd->birthdate, (const char*)RFIFOP(fd,52), sizeof(sd->birthdate));
  93. -				safestrncpy(sd->pincode, (const char*)RFIFOP(fd,63), sizeof(sd->pincode));
  94. -				sd->pincode_change = (time_t)RFIFOL(fd,68);
  95. +				sd->lang = RFIFOB(fd,52);
  96. +				if( sd->lang > MAX_LANG ) {
  97. +					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);
  98. +					sd->lang = 0;/* cap to 0 */
  99. +				}
  100. +				safestrncpy(sd->birthdate, (const char*)RFIFOP(fd,53), sizeof(sd->birthdate));
  101. +				safestrncpy(sd->pincode, (const char*)RFIFOP(fd,64), sizeof(sd->pincode));
  102. +				sd->pincode_change = (time_t)RFIFOL(fd,69);
  103.  				ARR_FIND( 0, ARRAYLENGTH(server), server_id, server[server_id].fd > 0 && server[server_id].map[0] );
  104.  				// continued from char_auth_ok...
  105.  				if( server_id == ARRAYLENGTH(server) || //server not online, bugreport:2359
  106. @@ -2270,7 +2277,7 @@
  107.  #endif
  108.  				}
  109.  			}
  110. -			RFIFOSKIP(fd,72);
  111. +			RFIFOSKIP(fd,73);
  112.  		break;
  113.  
  114.  		// login-server alive packet
  115. @@ -2970,7 +2977,7 @@
  116.  		break;
  117.  
  118.  		case 0x2b05: // request "change map server"
  119. -			if (RFIFOREST(fd) < 39)
  120. +			if (RFIFOREST(fd) < 40)
  121.  				return 0;
  122.  		{
  123.  			int map_id, map_fd = -1;
  124. @@ -3010,6 +3017,7 @@
  125.  				node->expiration_time = 0; // FIXME (this thing isn't really supported we could as well purge it instead of fixing)
  126.  				node->ip = ntohl(RFIFOL(fd,31));
  127.  				node->group_id = RFIFOL(fd,35);
  128. +				node->lang = RFIFOL(fd,39);
  129.  				node->changing_mapservers = 1;
  130.  				idb_put(auth_db, RFIFOL(fd,2), node);
  131.  
  132. @@ -3363,16 +3371,17 @@
  133.  			{// auth ok
  134.  				cd->sex = sex;
  135.  
  136. -				WFIFOHEAD(fd,25 + sizeof(struct mmo_charstatus));
  137. +				WFIFOHEAD(fd,29 + sizeof(struct mmo_charstatus));
  138.  				WFIFOW(fd,0) = 0x2afd;
  139. -				WFIFOW(fd,2) = 25 + sizeof(struct mmo_charstatus);
  140. +				WFIFOW(fd,2) = 29 + sizeof(struct mmo_charstatus);
  141.  				WFIFOL(fd,4) = account_id;
  142.  				WFIFOL(fd,8) = node->login_id1;
  143.  				WFIFOL(fd,12) = node->login_id2;
  144.  				WFIFOL(fd,16) = (uint32)node->expiration_time; // FIXME: will wrap to negative after "19-Jan-2038, 03:14:07 AM GMT"
  145.  				WFIFOL(fd,20) = node->group_id;
  146. -				WFIFOB(fd,24) = node->changing_mapservers;
  147. -				memcpy(WFIFOP(fd,25), cd, sizeof(struct mmo_charstatus));
  148. +				WFIFOL(fd,24) = node->lang;
  149. +				WFIFOB(fd,28) = node->changing_mapservers;
  150. +				memcpy(WFIFOP(fd,29), cd, sizeof(struct mmo_charstatus));
  151.  				WFIFOSET(fd, WFIFOW(fd,2));
  152.  
  153.  				// only use the auth once and mark user online
  154. @@ -3969,6 +3978,7 @@
  155.  			node->sex = sd->sex;
  156.  			node->expiration_time = sd->expiration_time;
  157.  			node->group_id = sd->group_id;
  158. +			node->lang = sd->lang;
  159.  			node->ip = ipl;
  160.  			idb_put(auth_db, sd->account_id, node);
  161.  
  162. @@ -5032,6 +5042,15 @@
  163.  			char_movetoused = config_switch(w2);
  164.  		} else if (strcmpi(w1, "char_moves_unlimited") == 0) {
  165.  			char_moves_unlimited = config_switch(w2);
  166. +		} else if (strcmpi(w1, "read_msg") == 0){
  167. +			int lang;
  168. +			char path[256];
  169. +			if( sscanf(w2, "%d, %s", &lang, path) == 2){
  170. +				if( lang < 1 || lang > MAX_LANG )
  171. +					ShowWarning("read_msg: Invalid Lnaguage ID '%s' in file %s. Must be 1~%s\n", w1, cfgName, MAX_LANG);
  172. +				else
  173. +					msg_config_read(path,lang);
  174. +			}
  175.  		} else if (strcmpi(w1, "import") == 0) {
  176.  			char_config_read(w2);
  177.  		}
  178. @@ -5121,7 +5140,7 @@
  179.  
  180.  	cli_get_options(argc,argv);
  181.  
  182. -	msg_config_read(MSG_CONF_NAME);
  183. +	msg_config_read(MSG_CONF_NAME,0);
  184.  	char_config_read(CHAR_CONF_NAME);
  185.  	char_lan_config_read(LAN_CONF_NAME);
  186.  	sql_config_read(SQL_CONF_NAME);
  187. @@ -5208,14 +5227,16 @@
  188.  	return 0;
  189.  }
  190.  
  191. -int char_msg_config_read(char *cfgName){
  192. -	return _msg_config_read(cfgName,CHAR_MAX_MSG,msg_table);
  193. +int char_msg_config_read(char *cfgName, int lang){
  194. +	return _msg_config_read(cfgName,CHAR_MAX_MSG,msg_table[lang]);
  195.  }
  196. -const char* char_msg_txt(int msg_number){
  197. -	return _msg_txt(msg_number,CHAR_MAX_MSG,msg_table);
  198. +const char* char_msg_txt(int lang, int msg_number){
  199. +	return _msg_txt(msg_number,CHAR_MAX_MSG,msg_table[lang]);
  200.  }
  201.  void char_do_final_msg(void){
  202. -	_do_final_msg(CHAR_MAX_MSG,msg_table);
  203. +	int i;
  204. +	for( i = 0; i < MAX_LANG; i++)
  205. +		_do_final_msg(CHAR_MAX_MSG,msg_table[i]);
  206.  }
  207.  
  208.  /*======================================================
  209. Index: src/char/char.h
  210. ===================================================================
  211. --- src/char/char.h	(revision 17206)
  212. +++ src/char/char.h	(working copy)
  213. @@ -21,11 +21,11 @@
  214.  
  215.  #define DEFAULT_AUTOSAVE_INTERVAL 300*1000
  216.  
  217. -#define msg_config_read(cfgName) char_msg_config_read(cfgName)
  218. -#define msg_txt(msg_number) char_msg_txt(msg_number)
  219. +#define msg_config_read(cfgName, lang) char_msg_config_read(cfgName, lang)
  220. +#define msg_txt(lang, msg_number) char_msg_txt(lang, msg_number)
  221.  #define do_final_msg() char_do_final_msg()
  222. -int char_msg_config_read(char *cfgName);
  223. -const char* char_msg_txt(int msg_number);
  224. +int char_msg_config_read(char *cfgName, int lang);
  225. +const char* char_msg_txt(int lang, int msg_number);
  226.  void char_do_final_msg(void);
  227.  
  228.  enum {
  229. Index: src/char/int_auction.c
  230. ===================================================================
  231. --- src/char/int_auction.c	(revision 17206)
  232. +++ src/char/int_auction.c	(working copy)
  233. @@ -145,12 +145,12 @@
  234.  	{
  235.  		if( auction->buyer_id )
  236.  		{
  237. -			mail_sendmail(0, msg_txt(200), auction->buyer_id, auction->buyer_name, msg_txt(201), msg_txt(202), 0, &auction->item);
  238. +			mail_sendmail(0, msg_txt(0,200), auction->buyer_id, auction->buyer_name, msg_txt(0,201), msg_txt(0,202), 0, &auction->item);
  239.  			mapif_Auction_message(auction->buyer_id, 6); // You have won the auction
  240. -			mail_sendmail(0, msg_txt(200), auction->seller_id, auction->seller_name, msg_txt(201), msg_txt(203), auction->price, NULL);
  241. +			mail_sendmail(0, msg_txt(0,200), auction->seller_id, auction->seller_name, msg_txt(0,201), msg_txt(0,203), auction->price, NULL);
  242.  		}
  243.  		else
  244. -			mail_sendmail(0, msg_txt(200), auction->seller_id, auction->seller_name, msg_txt(201), msg_txt(204), 0, &auction->item);
  245. +			mail_sendmail(0, msg_txt(0,200), auction->seller_id, auction->seller_name, msg_txt(0,201), msg_txt(0,204), 0, &auction->item);
  246.  
  247.  		ShowInfo("Auction End: id %u.\n", auction->auction_id);
  248.  
  249. @@ -353,7 +353,7 @@
  250.  		return;
  251.  	}
  252.  
  253. -	mail_sendmail(0, msg_txt(200), auction->seller_id, auction->seller_name, msg_txt(201), msg_txt(205), 0, &auction->item);
  254. +	mail_sendmail(0, msg_txt(0,200), auction->seller_id, auction->seller_name, msg_txt(0,201), msg_txt(0,205), 0, &auction->item);
  255.  	auction_delete(auction);
  256.  
  257.  	mapif_Auction_cancel(fd, char_id, 0); // The auction has been canceled
  258. @@ -392,9 +392,9 @@
  259.  	}
  260.  
  261.  	// Send Money to Seller
  262. -	mail_sendmail(0, msg_txt(200), auction->seller_id, auction->seller_name, msg_txt(201), msg_txt(206), auction->price, NULL);
  263. +	mail_sendmail(0, msg_txt(0,200), auction->seller_id, auction->seller_name, msg_txt(0,201), msg_txt(0,206), auction->price, NULL);
  264.  	// Send Item to Buyer
  265. -	mail_sendmail(0, msg_txt(200), auction->buyer_id, auction->buyer_name, msg_txt(201), msg_txt(207), 0, &auction->item);
  266. +	mail_sendmail(0, msg_txt(0,200), auction->buyer_id, auction->buyer_name, msg_txt(0,201), msg_txt(0,207), 0, &auction->item);
  267.  	mapif_Auction_message(auction->buyer_id, 6); // You have won the auction
  268.  	auction_delete(auction);
  269.  
  270. @@ -433,11 +433,11 @@
  271.  	{ // Send Money back to the previous Buyer
  272.  		if( auction->buyer_id != char_id )
  273.  		{
  274. -			mail_sendmail(0, msg_txt(200), auction->buyer_id, auction->buyer_name, msg_txt(201), msg_txt(208), auction->price, NULL);
  275. +			mail_sendmail(0, msg_txt(0,200), auction->buyer_id, auction->buyer_name, msg_txt(0,201), msg_txt(0,208), auction->price, NULL);
  276.  			mapif_Auction_message(auction->buyer_id, 7); // You have failed to win the auction
  277.  		}
  278.  		else
  279. -			mail_sendmail(0, msg_txt(200), auction->buyer_id, auction->buyer_name, msg_txt(201), msg_txt(209), auction->price, NULL);
  280. +			mail_sendmail(0, msg_txt(0,200), auction->buyer_id, auction->buyer_name, msg_txt(0,201), msg_txt(0,209), auction->price, NULL);
  281.  	}
  282.  
  283.  	auction->buyer_id = char_id;
  284. @@ -448,9 +448,9 @@
  285.  	{ // Automatic won the auction
  286.  		mapif_Auction_bid(fd, char_id, bid - auction->buynow, 1); // You have successfully bid in the auction
  287.  
  288. -		mail_sendmail(0, msg_txt(200), auction->buyer_id, auction->buyer_name, msg_txt(201), msg_txt(210), 0, &auction->item);
  289. +		mail_sendmail(0, msg_txt(0,200), auction->buyer_id, auction->buyer_name, msg_txt(0,201), msg_txt(0,210), 0, &auction->item);
  290.  		mapif_Auction_message(char_id, 6); // You have won the auction
  291. -		mail_sendmail(0, msg_txt(200), auction->seller_id, auction->seller_name, msg_txt(201), msg_txt(211), auction->buynow, NULL);
  292. +		mail_sendmail(0, msg_txt(0,200), auction->seller_id, auction->seller_name, msg_txt(0,201), msg_txt(0,211), auction->buynow, NULL);
  293.  
  294.  		auction_delete(auction);
  295.  		return;
  296. Index: src/char/inter.c
  297. ===================================================================
  298. --- src/char/inter.c	(revision 17206)
  299. +++ src/char/inter.c	(working copy)
  300. @@ -77,7 +77,7 @@
  301.  		case JOB_ACOLYTE:
  302.  		case JOB_MERCHANT:
  303.  		case JOB_THIEF:
  304. -			return msg_txt(JOB_NOVICE+class_);
  305. +			return msg_txt(0,JOB_NOVICE+class_);
  306.  
  307.  		case JOB_KNIGHT:
  308.  		case JOB_PRIEST:
  309. @@ -85,10 +85,10 @@
  310.  		case JOB_BLACKSMITH:
  311.  		case JOB_HUNTER:
  312.  		case JOB_ASSASSIN:
  313. -			return msg_txt(7 - JOB_KNIGHT+class_);
  314. +			return msg_txt(0,7 - JOB_KNIGHT+class_);
  315.  
  316.  		case JOB_KNIGHT2:
  317. -			return msg_txt(7);
  318. +			return msg_txt(0,7);
  319.  
  320.  		case JOB_CRUSADER:
  321.  		case JOB_MONK:
  322. @@ -97,20 +97,20 @@
  323.  		case JOB_ALCHEMIST:
  324.  		case JOB_BARD:
  325.  		case JOB_DANCER:
  326. -			return msg_txt(13 - JOB_CRUSADER+class_);
  327. +			return msg_txt(0,13 - JOB_CRUSADER+class_);
  328.  
  329.  		case JOB_CRUSADER2:
  330. -			return msg_txt(13);
  331. +			return msg_txt(0,13);
  332.  
  333.  		case JOB_WEDDING:
  334.  		case JOB_SUPER_NOVICE:
  335.  		case JOB_GUNSLINGER:
  336.  		case JOB_NINJA:
  337.  		case JOB_XMAS:
  338. -			return msg_txt(20 - JOB_WEDDING+class_);
  339. +			return msg_txt(0,20 - JOB_WEDDING+class_);
  340.  
  341.  		case JOB_SUMMER:
  342. -			return msg_txt(71);
  343. +			return msg_txt(0,71);
  344.  
  345.  		case JOB_NOVICE_HIGH:
  346.  		case JOB_SWORDMAN_HIGH:
  347. @@ -119,7 +119,7 @@
  348.  		case JOB_ACOLYTE_HIGH:
  349.  		case JOB_MERCHANT_HIGH:
  350.  		case JOB_THIEF_HIGH:
  351. -			return msg_txt(25 - JOB_NOVICE_HIGH+class_);
  352. +			return msg_txt(0,25 - JOB_NOVICE_HIGH+class_);
  353.  
  354.  		case JOB_LORD_KNIGHT:
  355.  		case JOB_HIGH_PRIEST:
  356. @@ -127,10 +127,10 @@
  357.  		case JOB_WHITESMITH:
  358.  		case JOB_SNIPER:
  359.  		case JOB_ASSASSIN_CROSS:
  360. -			return msg_txt(32 - JOB_LORD_KNIGHT+class_);
  361. +			return msg_txt(0,32 - JOB_LORD_KNIGHT+class_);
  362.  
  363.  		case JOB_LORD_KNIGHT2:
  364. -			return msg_txt(32);
  365. +			return msg_txt(0,32);
  366.  
  367.  		case JOB_PALADIN:
  368.  		case JOB_CHAMPION:
  369. @@ -139,10 +139,10 @@
  370.  		case JOB_CREATOR:
  371.  		case JOB_CLOWN:
  372.  		case JOB_GYPSY:
  373. -			return msg_txt(38 - JOB_PALADIN + class_);
  374. +			return msg_txt(0,38 - JOB_PALADIN + class_);
  375.  
  376.  		case JOB_PALADIN2:
  377. -			return msg_txt(38);
  378. +			return msg_txt(0,38);
  379.  
  380.  		case JOB_BABY:
  381.  		case JOB_BABY_SWORDMAN:
  382. @@ -151,7 +151,7 @@
  383.  		case JOB_BABY_ACOLYTE:
  384.  		case JOB_BABY_MERCHANT:
  385.  		case JOB_BABY_THIEF:
  386. -			return msg_txt(45 - JOB_BABY + class_);
  387. +			return msg_txt(0,45 - JOB_BABY + class_);
  388.  
  389.  		case JOB_BABY_KNIGHT:
  390.  		case JOB_BABY_PRIEST:
  391. @@ -159,10 +159,10 @@
  392.  		case JOB_BABY_BLACKSMITH:
  393.  		case JOB_BABY_HUNTER:
  394.  		case JOB_BABY_ASSASSIN:
  395. -			return msg_txt(52 - JOB_BABY_KNIGHT + class_);
  396. +			return msg_txt(0,52 - JOB_BABY_KNIGHT + class_);
  397.  
  398.  		case JOB_BABY_KNIGHT2:
  399. -			return msg_txt(52);
  400. +			return msg_txt(0,52);
  401.  
  402.  		case JOB_BABY_CRUSADER:
  403.  		case JOB_BABY_MONK:
  404. @@ -171,26 +171,26 @@
  405.  		case JOB_BABY_ALCHEMIST:
  406.  		case JOB_BABY_BARD:
  407.  		case JOB_BABY_DANCER:
  408. -			return msg_txt(58 - JOB_BABY_CRUSADER + class_);
  409. +			return msg_txt(0,58 - JOB_BABY_CRUSADER + class_);
  410.  
  411.  		case JOB_BABY_CRUSADER2:
  412. -			return msg_txt(58);
  413. +			return msg_txt(0,58);
  414.  
  415.  		case JOB_SUPER_BABY:
  416. -			return msg_txt(65);
  417. +			return msg_txt(0,65);
  418.  
  419.  		case JOB_TAEKWON:
  420. -			return msg_txt(66);
  421. +			return msg_txt(0,66);
  422.  		case JOB_STAR_GLADIATOR:
  423.  		case JOB_STAR_GLADIATOR2:
  424. -			return msg_txt(67);
  425. +			return msg_txt(0,67);
  426.  		case JOB_SOUL_LINKER:
  427. -			return msg_txt(68);
  428. +			return msg_txt(0,68);
  429.  
  430.  		case JOB_GANGSI:
  431.  		case JOB_DEATH_KNIGHT:
  432.  		case JOB_DARK_COLLECTOR:
  433. -			return msg_txt(72 - JOB_GANGSI+class_);
  434. +			return msg_txt(0,72 - JOB_GANGSI+class_);
  435.  
  436.  		case JOB_RUNE_KNIGHT:
  437.  		case JOB_WARLOCK:
  438. @@ -198,7 +198,7 @@
  439.  		case JOB_ARCH_BISHOP:
  440.  		case JOB_MECHANIC:
  441.  		case JOB_GUILLOTINE_CROSS:
  442. -			return msg_txt(75 - JOB_RUNE_KNIGHT+class_);
  443. +			return msg_txt(0,75 - JOB_RUNE_KNIGHT+class_);
  444.  
  445.  		case JOB_RUNE_KNIGHT_T:
  446.  		case JOB_WARLOCK_T:
  447. @@ -206,7 +206,7 @@
  448.  		case JOB_ARCH_BISHOP_T:
  449.  		case JOB_MECHANIC_T:
  450.  		case JOB_GUILLOTINE_CROSS_T:
  451. -			return msg_txt(75 - JOB_RUNE_KNIGHT_T+class_);
  452. +			return msg_txt(0,75 - JOB_RUNE_KNIGHT_T+class_);
  453.  
  454.  		case JOB_ROYAL_GUARD:
  455.  		case JOB_SORCERER:
  456. @@ -215,7 +215,7 @@
  457.  		case JOB_SURA:
  458.  		case JOB_GENETIC:
  459.  		case JOB_SHADOW_CHASER:
  460. -			return msg_txt(81 - JOB_ROYAL_GUARD+class_);
  461. +			return msg_txt(0,81 - JOB_ROYAL_GUARD+class_);
  462.  
  463.  		case JOB_ROYAL_GUARD_T:
  464.  		case JOB_SORCERER_T:
  465. @@ -224,23 +224,23 @@
  466.  		case JOB_SURA_T:
  467.  		case JOB_GENETIC_T:
  468.  		case JOB_SHADOW_CHASER_T:
  469. -			return msg_txt(81 - JOB_ROYAL_GUARD_T+class_);
  470. +			return msg_txt(0,81 - JOB_ROYAL_GUARD_T+class_);
  471.  
  472.  		case JOB_RUNE_KNIGHT2:
  473.  		case JOB_RUNE_KNIGHT_T2:
  474. -			return msg_txt(75);
  475. +			return msg_txt(0,75);
  476.  
  477.  		case JOB_ROYAL_GUARD2:
  478.  		case JOB_ROYAL_GUARD_T2:
  479. -			return msg_txt(81);
  480. +			return msg_txt(0,81);
  481.  
  482.  		case JOB_RANGER2:
  483.  		case JOB_RANGER_T2:
  484. -			return msg_txt(77);
  485. +			return msg_txt(0,77);
  486.  
  487.  		case JOB_MECHANIC2:
  488.  		case JOB_MECHANIC_T2:
  489. -			return msg_txt(79);
  490. +			return msg_txt(0,79);
  491.  
  492.  		case JOB_BABY_RUNE:
  493.  		case JOB_BABY_WARLOCK:
  494. @@ -255,30 +255,30 @@
  495.  		case JOB_BABY_SURA:
  496.  		case JOB_BABY_GENETIC:
  497.  		case JOB_BABY_CHASER:
  498. -			return msg_txt(88 - JOB_BABY_RUNE+class_);
  499. +			return msg_txt(0,88 - JOB_BABY_RUNE+class_);
  500.  
  501.  		case JOB_BABY_RUNE2:
  502. -			return msg_txt(88);
  503. +			return msg_txt(0,88);
  504.  
  505.  		case JOB_BABY_GUARD2:
  506. -			return msg_txt(94);
  507. +			return msg_txt(0,94);
  508.  
  509.  		case JOB_BABY_RANGER2:
  510. -			return msg_txt(90);
  511. +			return msg_txt(0,90);
  512.  
  513.  		case JOB_BABY_MECHANIC2:
  514. -			return msg_txt(92);
  515. +			return msg_txt(0,92);
  516.  
  517.  		case JOB_SUPER_NOVICE_E:
  518.  		case JOB_SUPER_BABY_E:
  519. -			return msg_txt(101 - JOB_SUPER_NOVICE_E+class_);
  520. +			return msg_txt(0,101 - JOB_SUPER_NOVICE_E+class_);
  521.  
  522.  		case JOB_KAGEROU:
  523.  		case JOB_OBORO:
  524. -			return msg_txt(103 - JOB_KAGEROU+class_);
  525. +			return msg_txt(0,103 - JOB_KAGEROU+class_);
  526.  
  527.  		default:
  528. -			return msg_txt(105);
  529. +			return msg_txt(0,105);
  530.  	}
  531.  }
  532.  
  533. Index: src/common/mmo.h
  534. ===================================================================
  535. --- src/common/mmo.h	(revision 17206)
  536. +++ src/common/mmo.h	(working copy)
  537. @@ -162,6 +162,7 @@
  538.  #define EL_CLASS_BASE 2114
  539.  #define EL_CLASS_MAX (EL_CLASS_BASE+MAX_ELEMENTAL_CLASS-1)
  540.  
  541. +#define MAX_LANG 10
  542.  enum item_types {
  543.  	IT_HEALING = 0,
  544.  	IT_UNKNOWN, //1
  545. Index: src/common/msg_conf.c
  546. ===================================================================
  547. --- src/common/msg_conf.c	(revision 17206)
  548. +++ src/common/msg_conf.c	(working copy)
  549. @@ -1,3 +1,4 @@
  550. +#include "../common/mmo.h"
  551.  #include <stdio.h>
  552.  #include <string.h>
  553.  #include <stdlib.h>
  554. Index: src/login/account.h
  555. ===================================================================
  556. --- src/login/account.h	(revision 17206)
  557. +++ src/login/account.h	(working copy)
  558. @@ -54,6 +54,7 @@
  559.  	time_t pincode_change;	// (timestamp): last time of pincode change
  560.  	int account_reg2_num;
  561.  	struct global_reg account_reg2[ACCOUNT_REG2_NUM]; // account script variables (stored on login server)
  562. +	int lang;
  563.  };
  564.  
  565.  
  566. Index: src/login/account_sql.c
  567. ===================================================================
  568. --- src/login/account_sql.c	(revision 17206)
  569. +++ src/login/account_sql.c	(working copy)
  570. @@ -522,7 +522,7 @@
  571.  
  572.  	// retrieve login entry for the specified account
  573.  	if( SQL_ERROR == Sql_Query(sql_handle,
  574. -	    "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",
  575. +	    "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",
  576.  		db->account_db, account_id )
  577.  	) {
  578.  		Sql_ShowDebug(sql_handle);
  579. @@ -551,6 +551,7 @@
  580.  	Sql_GetData(sql_handle, 13, &data, NULL); acc->char_slots = atoi(data);
  581.  	Sql_GetData(sql_handle, 14, &data, NULL); safestrncpy(acc->pincode, data, sizeof(acc->pincode));
  582.  	Sql_GetData(sql_handle, 15, &data, NULL); acc->pincode_change = atol(data);
  583. +	Sql_GetData(sql_handle, 16, &data, NULL); acc->lang = atoi(data);
  584.  
  585.  	Sql_FreeResult(sql_handle);
  586.  
  587. @@ -599,7 +600,7 @@
  588.  	if( is_new )
  589.  	{// insert into account table
  590.  		if( SQL_SUCCESS != SqlStmt_Prepare(stmt,
  591. -			"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 (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
  592. +			"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 (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
  593.  			db->account_db)
  594.  		||  SQL_SUCCESS != SqlStmt_BindParam(stmt,  0, SQLDT_INT,    (void*)&acc->account_id,      sizeof(acc->account_id))
  595.  		||  SQL_SUCCESS != SqlStmt_BindParam(stmt,  1, SQLDT_STRING, (void*)acc->userid,           strlen(acc->userid))
  596. @@ -617,6 +618,7 @@
  597.  		||  SQL_SUCCESS != SqlStmt_BindParam(stmt, 13, SQLDT_UCHAR,  (void*)&acc->char_slots,      sizeof(acc->char_slots))
  598.  		||  SQL_SUCCESS != SqlStmt_BindParam(stmt, 14, SQLDT_STRING, (void*)&acc->pincode,         strlen(acc->pincode))
  599.  		||  SQL_SUCCESS != SqlStmt_BindParam(stmt, 15, SQLDT_LONG,   (void*)&acc->pincode_change,  sizeof(acc->pincode_change))
  600. +		||  SQL_SUCCESS != SqlStmt_BindParam(stmt, 16, SQLDT_LONG,   (void*)&acc->lang, 	       sizeof(acc->lang))
  601.  		||  SQL_SUCCESS != SqlStmt_Execute(stmt)
  602.  		) {
  603.  			SqlStmt_ShowDebug(stmt);
  604. @@ -625,7 +627,7 @@
  605.  	}
  606.  	else
  607.  	{// update account table
  608. -		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)
  609. +		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)
  610.  		||  SQL_SUCCESS != SqlStmt_BindParam(stmt,  0, SQLDT_STRING, (void*)acc->userid,           strlen(acc->userid))
  611.  		||  SQL_SUCCESS != SqlStmt_BindParam(stmt,  1, SQLDT_STRING, (void*)acc->pass,             strlen(acc->pass))
  612.  		||  SQL_SUCCESS != SqlStmt_BindParam(stmt,  2, SQLDT_ENUM,   (void*)&acc->sex,             sizeof(acc->sex))
  613. @@ -641,6 +643,7 @@
  614.  		||  SQL_SUCCESS != SqlStmt_BindParam(stmt, 12, SQLDT_UCHAR,  (void*)&acc->char_slots,      sizeof(acc->char_slots))
  615.  		||  SQL_SUCCESS != SqlStmt_BindParam(stmt, 13, SQLDT_STRING, (void*)&acc->pincode,         strlen(acc->pincode))
  616.  		||  SQL_SUCCESS != SqlStmt_BindParam(stmt, 14, SQLDT_LONG,   (void*)&acc->pincode_change,  sizeof(acc->pincode_change))
  617. +		||  SQL_SUCCESS != SqlStmt_BindParam(stmt, 15, SQLDT_UCHAR,  (void*)&acc->lang,            sizeof(acc->lang))
  618.  		||  SQL_SUCCESS != SqlStmt_Execute(stmt)
  619.  		) {
  620.  			SqlStmt_ShowDebug(stmt);
  621. Index: src/login/login.c
  622. ===================================================================
  623. --- src/login/login.c	(revision 17206)
  624. +++ src/login/login.c	(working copy)
  625. @@ -22,7 +22,7 @@
  626.  #include <string.h>
  627.  
  628.  #define LOGIN_MAX_MSG 30
  629. -static char* msg_table[LOGIN_MAX_MSG]; // Login Server messages_conf
  630. +static char* msg_table[MAX_LANG][LOGIN_MAX_MSG]; // Login Server messages_conf
  631.  struct Login_Config login_config;
  632.  
  633.  int login_fd; // login server socket
  634. @@ -553,7 +553,7 @@
  635.  				int group_id = 0;
  636.  				char birthdate[10+1] = "";
  637.  				char pincode[4+1] = "";
  638. -
  639. +				int lang = 0;
  640.  				int account_id = RFIFOL(fd,2);
  641.  				RFIFOSKIP(fd,6);
  642.  
  643. @@ -564,21 +564,23 @@
  644.  					expiration_time = acc.expiration_time;
  645.  					group_id = acc.group_id;
  646.  					char_slots = acc.char_slots;
  647. +					lang = acc.lang;
  648.  					safestrncpy(birthdate, acc.birthdate, sizeof(birthdate));
  649.  					safestrncpy(pincode, acc.pincode, sizeof(pincode));
  650.  				}
  651.  
  652. -				WFIFOHEAD(fd,72);
  653. +				WFIFOHEAD(fd,73);
  654.  				WFIFOW(fd,0) = 0x2717;
  655.  				WFIFOL(fd,2) = account_id;
  656.  				safestrncpy((char*)WFIFOP(fd,6), email, 40);
  657.  				WFIFOL(fd,46) = (uint32)expiration_time;
  658.  				WFIFOB(fd,50) = (unsigned char)group_id;
  659.  				WFIFOB(fd,51) = char_slots;
  660. -				safestrncpy((char*)WFIFOP(fd,52), birthdate, 10+1);
  661. -				safestrncpy((char*)WFIFOP(fd,63), pincode, 4+1 );
  662. -				WFIFOL(fd,68) = (uint32)acc.pincode_change;
  663. -				WFIFOSET(fd,72);
  664. +				WFIFOB(fd,52) = (unsigned char)lang;
  665. +				safestrncpy((char*)WFIFOP(fd,53), birthdate, 10+1);
  666. +				safestrncpy((char*)WFIFOP(fd,64), pincode, 4+1 );
  667. +				WFIFOL(fd,69) = (uint32)acc.pincode_change;
  668. +				WFIFOSET(fd,73);
  669.  			}
  670.  		break;
  671.  
  672. @@ -979,7 +981,7 @@
  673.  	safestrncpy(acc.birthdate, "0000-00-00", sizeof(acc.birthdate));
  674.  	safestrncpy(acc.pincode, "", sizeof(acc.pincode));
  675.  	acc.pincode_change = 0;
  676. -
  677. +	acc.lang = 0;
  678.  	acc.char_slots = 0;
  679.  
  680.  	if( !accounts->create(accounts, &acc) )
  681. @@ -1298,11 +1300,11 @@
  682.  	if (login_config.log_login)
  683.  	{
  684.  		if(result >= 0 && result <= 15)
  685. -		    login_log(ip, sd->userid, result, msg_txt(result));
  686. +		    login_log(ip, sd->userid, result, msg_txt(sd->lang,result));
  687.  		else if(result >= 99 && result <= 104)
  688. -		    login_log(ip, sd->userid, result, msg_txt(result-83)); //-83 offset
  689. +		    login_log(ip, sd->userid, result, msg_txt(sd->lang,result-83)); //-83 offset
  690.  		else
  691. -		    login_log(ip, sd->userid, result, msg_txt(22)); //unknow error
  692. +		    login_log(ip, sd->userid, result, msg_txt(sd->lang,22)); //unknow error
  693.  	}
  694.  
  695.  	if( result == 1 && login_config.dynamic_pass_failure_ban )
  696. @@ -1707,6 +1709,16 @@
  697.  				login_config.client_hash_nodes = nnode;
  698.  			}
  699.  		}
  700. +		else if (strcmpi(w1, "read_msg") == 0){
  701. +			int lang;
  702. +			char path[256];
  703. +			if( sscanf(w2, "%d, %s", &lang, path) == 2){
  704. +				if( lang < 1 || lang > MAX_LANG )
  705. +					ShowWarning("read_msg: Invalid Lnaguage ID '%s' in file %s. Must be 1~%s\n", w1, cfgName, MAX_LANG);
  706. +				else
  707. +					msg_config_read(path,lang);
  708. +			}
  709. +		}
  710.  		else if(!strcmpi(w1, "import"))
  711.  			login_config_read(w2);
  712.  		else
  713. @@ -1853,7 +1865,7 @@
  714.  
  715.  	cli_get_options(argc,argv);
  716.  
  717. -	msg_config_read(MSG_CONF_NAME);
  718. +	msg_config_read(MSG_CONF_NAME,0);
  719.  	login_config_read(LOGIN_CONF_NAME);
  720.  	login_lan_config_read(LAN_CONF_NAME);
  721.  
  722. @@ -1923,14 +1935,16 @@
  723.  	return 0;
  724.  }
  725.  
  726. -int login_msg_config_read(char *cfgName){
  727. -	return _msg_config_read(cfgName,LOGIN_MAX_MSG,msg_table);
  728. +int login_msg_config_read(char *cfgName, int lang){
  729. +	return _msg_config_read(cfgName,LOGIN_MAX_MSG,msg_table[lang]);
  730.  }
  731. -const char* login_msg_txt(int msg_number){
  732. -	return _msg_txt(msg_number,LOGIN_MAX_MSG,msg_table);
  733. +const char* login_msg_txt(int lang, int msg_number){
  734. +	return _msg_txt(msg_number,LOGIN_MAX_MSG,msg_table[lang]);
  735.  }
  736.  void login_do_final_msg(void){
  737. -	_do_final_msg(LOGIN_MAX_MSG,msg_table);
  738. +	int i;
  739. +	for( i = 0; i < MAX_LANG; i++)
  740. +		_do_final_msg(LOGIN_MAX_MSG,msg_table[i]);
  741.  }
  742.  
  743.  /*======================================================
  744. Index: src/login/login.h
  745. ===================================================================
  746. --- src/login/login.h	(revision 17206)
  747. +++ src/login/login.h	(working copy)
  748. @@ -22,7 +22,7 @@
  749.  	long login_id1;
  750.  	long login_id2;
  751.  	char sex;// 'F','M','S'
  752. -
  753. +	int lang;
  754.  	char userid[NAME_LENGTH];
  755.  	char passwd[32+1]; // 23+1 for plaintext, 32+1 for md5-ed passwords
  756.  	int passwdenc;
  757. @@ -91,12 +91,12 @@
  758.  #define sex_num2str(num) ( (num ==  SEX_FEMALE  ) ? 'F' : (num ==  SEX_MALE  ) ? 'M' : 'S' )
  759.  #define sex_str2num(str) ( (str == 'F' ) ?  SEX_FEMALE  : (str == 'M' ) ?  SEX_MALE  :  SEX_SERVER  )
  760.  
  761. -#define msg_config_read(cfgName) login_msg_config_read(cfgName)
  762. -#define msg_txt(msg_number) login_msg_txt(msg_number)
  763. +#define msg_config_read(cfgName, lang) login_msg_config_read(cfgName, lang)
  764. +#define msg_txt(lang, msg_number) login_msg_txt(lang, msg_number)
  765.  #define do_final_msg() login_do_final_msg()
  766.  
  767. -int login_msg_config_read(char *cfgName);
  768. -const char* login_msg_txt(int msg_number);
  769. +int login_msg_config_read(char *cfgName, int lang);
  770. +const char* login_msg_txt(int lang, int msg_number);
  771.  void login_do_final_msg(void);
  772.  
  773.  
  774. Index: src/map/atcommand.c
  775. ===================================================================
  776. --- src/map/atcommand.c	(revision 17206)
  777. +++ src/map/atcommand.c	(working copy)
  778. @@ -149,7 +149,7 @@
  779.  	{
  780.  		int i;
  781.  		for (i = 900; i <= 903; ++i)
  782. -			clif_displaymessage(fd, msg_txt(i));
  783. +			clif_displaymessage(fd, msg_txt(sd->lang,i));
  784.  		return -1;
  785.  	}
  786.  
  787. @@ -188,7 +188,7 @@
  788.  
  789.  		if(len)
  790.  		{// show packet length
  791. -			sprintf(atcmd_output, msg_txt(904), type, packet_db[sd->packet_ver][type].len); // Packet 0x%x length: %d
  792. +			sprintf(atcmd_output, msg_txt(sd->lang,904), type, packet_db[sd->packet_ver][type].len); // Packet 0x%x length: %d
  793.  			clif_displaymessage(fd, atcmd_output);
  794.  			return 0;
  795.  		}
  796. @@ -197,7 +197,7 @@
  797.  		off=2;
  798.  		if(len == 0)
  799.  		{// unknown packet - ERROR
  800. -			sprintf(atcmd_output, msg_txt(905), type); // Unknown packet: 0x%x
  801. +			sprintf(atcmd_output, msg_txt(sd->lang,905), type); // Unknown packet: 0x%x
  802.  			clif_displaymessage(fd, atcmd_output);
  803.  			return -1;
  804.  		} else if(len == -1)
  805. @@ -245,7 +245,7 @@
  806.  					while(*message != '"')
  807.  					{// find start of string
  808.  						if(*message == 0 || ISSPACE(*message)){
  809. -							PARSE_ERROR(msg_txt(906),message); // Not a string:
  810. +							PARSE_ERROR(msg_txt(sd->lang,906),message); // Not a string:
  811.  							return -1;
  812.  						}
  813.  						++message;
  814. @@ -275,7 +275,7 @@
  815.  								++message;
  816.  								CHECK_EOS(message);
  817.  								if(!ISXDIGIT(*message)){
  818. -									PARSE_ERROR(msg_txt(907),message); // Not a hexadecimal digit:
  819. +									PARSE_ERROR(msg_txt(sd->lang,907),message); // Not a hexadecimal digit:
  820.  									return -1;
  821.  								}
  822.  								num=(ISDIGIT(*message)?*message-'0':TOLOWER(*message)-'a'+10);
  823. @@ -338,7 +338,7 @@
  824.  				}
  825.  			} else
  826.  			{// unknown
  827. -				PARSE_ERROR(msg_txt(908),message); // Unknown type of value in:
  828. +				PARSE_ERROR(msg_txt(sd->lang,908),message); // Unknown type of value in:
  829.  				return -1;
  830.  			}
  831.  			SKIP_VALUE(message);
  832. @@ -355,10 +355,10 @@
  833.  			WFIFOSET(fd,len);
  834.  		}
  835.  	} else {
  836. -		clif_displaymessage(fd, msg_txt(259)); // Invalid packet
  837. +		clif_displaymessage(fd, msg_txt(sd->lang,259)); // Invalid packet
  838.  		return -1;
  839.  	}
  840. -	sprintf (atcmd_output, msg_txt(258), type, type); // Sent packet 0x%x (%d)
  841. +	sprintf (atcmd_output, msg_txt(sd->lang,258), type, type); // Sent packet 0x%x (%d)
  842.  	clif_displaymessage(fd, atcmd_output);
  843.  	return 0;
  844.  #undef PARSE_ERROR
  845. @@ -385,7 +385,7 @@
  846.  		(sscanf(message, "%15s %hd %hd", map_name, &x, &y) < 3 &&
  847.  		 sscanf(message, "%15[^,],%hd,%hd", map_name, &x, &y) < 1)) {
  848.  
  849. -			clif_displaymessage(fd, msg_txt(909)); // Please enter a map (usage: @warp/@rura/@mapmove <mapname> <x> <y>).
  850. +			clif_displaymessage(fd, msg_txt(sd->lang,909)); // Please enter a map (usage: @warp/@rura/@mapmove <mapname> <x> <y>).
  851.  			return -1;
  852.  	}
  853.  
  854. @@ -394,30 +394,30 @@
  855.  		m = map_mapindex2mapid(mapindex);
  856.  
  857.  	if (!mapindex) { // m < 0 means on different server! [Kevin]
  858. -		clif_displaymessage(fd, msg_txt(1)); // Map not found.
  859. +		clif_displaymessage(fd, msg_txt(sd->lang,1)); // Map not found.
  860.  		return -1;
  861.  	}
  862.  
  863.  	if ((x || y) && map_getcell(m, x, y, CELL_CHKNOPASS))
  864.    	{	//This is to prevent the pc_setpos call from printing an error.
  865. -		clif_displaymessage(fd, msg_txt(2));
  866. +		clif_displaymessage(fd, msg_txt(sd->lang,2));
  867.  		if (!map_search_freecell(NULL, m, &x, &y, 10, 10, 1))
  868.  			x = y = 0; //Invalid cell, use random spot.
  869.  	}
  870.  	if (map[m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
  871. -		clif_displaymessage(fd, msg_txt(247));
  872. +		clif_displaymessage(fd, msg_txt(sd->lang,247));
  873.  		return -1;
  874.  	}
  875.  	if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
  876. -		clif_displaymessage(fd, msg_txt(248));
  877. +		clif_displaymessage(fd, msg_txt(sd->lang,248));
  878.  		return -1;
  879.  	}
  880.  	if (pc_setpos(sd, mapindex, x, y, CLR_TELEPORT) != 0) {
  881. -		clif_displaymessage(fd, msg_txt(1)); // Map not found.
  882. +		clif_displaymessage(fd, msg_txt(sd->lang,1)); // Map not found.
  883.  		return -1;
  884.  	}
  885.  
  886. -	clif_displaymessage(fd, msg_txt(0)); // Warped.
  887. +	clif_displaymessage(fd, msg_txt(sd->lang,0)); // Warped.
  888.  	return 0;
  889.  }
  890.  
  891. @@ -432,7 +432,7 @@
  892.  	memset(atcmd_player_name, '\0', sizeof atcmd_player_name);
  893.  
  894.  	if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
  895. -		clif_displaymessage(fd, msg_txt(910)); // Please enter a player name (usage: @where <char name>).
  896. +		clif_displaymessage(fd, msg_txt(sd->lang,910)); // Please enter a player name (usage: @where <char name>).
  897.  		return -1;
  898.  	}
  899.  
  900. @@ -441,7 +441,7 @@
  901.  	    strncmp(pl_sd->status.name, atcmd_player_name, NAME_LENGTH) != 0 ||
  902.  	    (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))
  903.  	) {
  904. -		clif_displaymessage(fd, msg_txt(3)); // Character not found.
  905. +		clif_displaymessage(fd, msg_txt(sd->lang,3)); // Character not found.
  906.  		return -1;
  907.  	}
  908.  
  909. @@ -461,36 +461,36 @@
  910.  	nullpo_retr(-1, sd);
  911.  
  912.  	if (!message || !*message) {
  913. -		clif_displaymessage(fd, msg_txt(911)); // Please enter a player name (usage: @jumpto/@warpto/@goto <char name/ID>).
  914. +		clif_displaymessage(fd, msg_txt(sd->lang,911)); // Please enter a player name (usage: @jumpto/@warpto/@goto <char name/ID>).
  915.  		return -1;
  916.  	}
  917.  
  918.  	if((pl_sd=map_nick2sd((char *)message)) == NULL && (pl_sd=map_charid2sd(atoi(message))) == NULL)
  919.  	{
  920. -		clif_displaymessage(fd, msg_txt(3)); // Character not found.
  921. +		clif_displaymessage(fd, msg_txt(sd->lang,3)); // Character not found.
  922.  		return -1;
  923.  	}
  924.  
  925.  	if (pl_sd->bl.m >= 0 && map[pl_sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE))
  926.  	{
  927. -		clif_displaymessage(fd, msg_txt(247));	// You are not authorized to warp to this map.
  928. +		clif_displaymessage(fd, msg_txt(sd->lang,247));	// You are not authorized to warp to this map.
  929.  		return -1;
  930.  	}
  931.  
  932.  	if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE))
  933.  	{
  934. -		clif_displaymessage(fd, msg_txt(248));	// You are not authorized to warp from your current map.
  935. +		clif_displaymessage(fd, msg_txt(sd->lang,248));	// You are not authorized to warp from your current map.
  936.  		return -1;
  937.  	}
  938.  
  939.  	if( pc_isdead(sd) )
  940.  	{
  941. -		clif_displaymessage(fd, msg_txt(664));
  942. +		clif_displaymessage(fd, msg_txt(sd->lang,664));
  943.  		return -1;
  944.  	}
  945.  
  946.  	pc_setpos(sd, pl_sd->mapindex, pl_sd->bl.x, pl_sd->bl.y, CLR_TELEPORT);
  947. -	sprintf(atcmd_output, msg_txt(4), pl_sd->status.name); // Jumped to %s
  948. +	sprintf(atcmd_output, msg_txt(sd->lang,4), pl_sd->status.name); // Jumped to %s
  949.   	clif_displaymessage(fd, atcmd_output);
  950.  
  951.  	return 0;
  952. @@ -510,25 +510,25 @@
  953.  	sscanf(message, "%hd %hd", &x, &y);
  954.  
  955.  	if (map[sd->bl.m].flag.noteleport && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
  956. -		clif_displaymessage(fd, msg_txt(248));	// You are not authorized to warp from your current map.
  957. +		clif_displaymessage(fd, msg_txt(sd->lang,248));	// You are not authorized to warp from your current map.
  958.  		return -1;
  959.  	}
  960.  
  961.  	if( pc_isdead(sd) )
  962.  	{
  963. -		clif_displaymessage(fd, msg_txt(664));
  964. +		clif_displaymessage(fd, msg_txt(sd->lang,664));
  965.  		return -1;
  966.  	}
  967.  
  968.  	if ((x || y) && map_getcell(sd->bl.m, x, y, CELL_CHKNOPASS))
  969.    	{	//This is to prevent the pc_setpos call from printing an error.
  970. -		clif_displaymessage(fd, msg_txt(2));
  971. +		clif_displaymessage(fd, msg_txt(sd->lang,2));
  972.  		if (!map_search_freecell(NULL, sd->bl.m, &x, &y, 10, 10, 1))
  973.  			x = y = 0; //Invalid cell, use random spot.
  974.  	}
  975.  
  976.  	pc_setpos(sd, sd->mapindex, x, y, CLR_TELEPORT);
  977. -	sprintf(atcmd_output, msg_txt(5), sd->bl.x, sd->bl.y); // Jumped to %d %d
  978. +	sprintf(atcmd_output, msg_txt(sd->lang,5), sd->bl.x, sd->bl.y); // Jumped to %d %d
  979.  	clif_displaymessage(fd, atcmd_output);
  980.  	return 0;
  981.  }
  982. @@ -579,33 +579,33 @@
  983.  				continue;
  984.  			switch (display_type) {
  985.  				case 2: {
  986. -					StringBuf_Printf(&buf, msg_txt(343), pl_sd->status.name); // "Name: %s "
  987. +					StringBuf_Printf(&buf, msg_txt(sd->lang,343), pl_sd->status.name); // "Name: %s "
  988.  					if (pc_get_group_id(pl_sd) > 0) // Player title, if exists
  989. -						StringBuf_Printf(&buf, msg_txt(344), pc_group_id2name(pc_get_group_id(pl_sd))); // "(%s) "
  990. -					StringBuf_Printf(&buf, msg_txt(347), pl_sd->status.base_level, pl_sd->status.job_level,
  991. +						StringBuf_Printf(&buf, msg_txt(sd->lang,344), pc_group_id2name(pc_get_group_id(pl_sd))); // "(%s) "
  992. +					StringBuf_Printf(&buf, msg_txt(sd->lang,347), pl_sd->status.base_level, pl_sd->status.job_level,
  993.  						job_name(pl_sd->status.class_)); // "| Lv:%d/%d | Job: %s"
  994.  					break;
  995.  				}
  996.  				case 3: {
  997.  					if (pc_has_permission(sd, PC_PERM_WHO_DISPLAY_AID))
  998. -						StringBuf_Printf(&buf, msg_txt(912), pl_sd->status.char_id, pl_sd->status.account_id);	// "(CID:%d/AID:%d) "
  999. -					StringBuf_Printf(&buf, msg_txt(343), pl_sd->status.name); // "Name: %s "
  1000. +						StringBuf_Printf(&buf, msg_txt(sd->lang,912), pl_sd->status.char_id, pl_sd->status.account_id);	// "(CID:%d/AID:%d) "
  1001. +					StringBuf_Printf(&buf, msg_txt(sd->lang,343), pl_sd->status.name); // "Name: %s "
  1002.  					if (pc_get_group_id(pl_sd) > 0) // Player title, if exists
  1003. -						StringBuf_Printf(&buf, msg_txt(344), pc_group_id2name(pc_get_group_id(pl_sd))); // "(%s) "
  1004. -					StringBuf_Printf(&buf, msg_txt(348), mapindex_id2name(pl_sd->mapindex), pl_sd->bl.x, pl_sd->bl.y); // "| Location: %s %d %d"
  1005. +						StringBuf_Printf(&buf, msg_txt(sd->lang,344), pc_group_id2name(pc_get_group_id(pl_sd))); // "(%s) "
  1006. +					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"
  1007.  					break;
  1008.  				}
  1009.  				default: {
  1010.  					struct party_data *p = party_search(pl_sd->status.party_id);
  1011.  					struct guild *g = guild_search(pl_sd->status.guild_id);
  1012.  
  1013. -					StringBuf_Printf(&buf, msg_txt(343), pl_sd->status.name); // "Name: %s "
  1014. +					StringBuf_Printf(&buf, msg_txt(sd->lang,343), pl_sd->status.name); // "Name: %s "
  1015.  					if (pc_get_group_id(pl_sd) > 0) // Player title, if exists
  1016. -						StringBuf_Printf(&buf, msg_txt(344), pc_group_id2name(pc_get_group_id(pl_sd))); // "(%s) "
  1017. +						StringBuf_Printf(&buf, msg_txt(sd->lang,344), pc_group_id2name(pc_get_group_id(pl_sd))); // "(%s) "
  1018.  					if (p != NULL)
  1019. -						StringBuf_Printf(&buf, msg_txt(345), p->party.name); // " | Party: '%s'"
  1020. +						StringBuf_Printf(&buf, msg_txt(sd->lang,345), p->party.name); // " | Party: '%s'"
  1021.  					if (g != NULL)
  1022. -						StringBuf_Printf(&buf, msg_txt(346), g->name); // " | Guild: '%s'"
  1023. +						StringBuf_Printf(&buf, msg_txt(sd->lang,346), g->name); // " | Guild: '%s'"
  1024.  					break;
  1025.  				}
  1026.  			}
  1027. @@ -618,18 +618,18 @@
  1028.  
  1029.  	if (map_id < 0) {
  1030.  		if (count == 0)
  1031. -			StringBuf_Printf(&buf, msg_txt(28)); // No player found.
  1032. +			StringBuf_Printf(&buf, msg_txt(sd->lang,28)); // No player found.
  1033.  		else if (count == 1)
  1034. -			StringBuf_Printf(&buf, msg_txt(29)); // 1 player found.
  1035. +			StringBuf_Printf(&buf, msg_txt(sd->lang,29)); // 1 player found.
  1036.  		else
  1037. -			StringBuf_Printf(&buf, msg_txt(30), count); // %d players found.
  1038. +			StringBuf_Printf(&buf, msg_txt(sd->lang,30), count); // %d players found.
  1039.  	} else {
  1040.  		if (count == 0)
  1041. -			StringBuf_Printf(&buf, msg_txt(54), map[map_id].name); // No player found in map '%s'.
  1042. +			StringBuf_Printf(&buf, msg_txt(sd->lang,54), map[map_id].name); // No player found in map '%s'.
  1043.  		else if (count == 1)
  1044. -			StringBuf_Printf(&buf, msg_txt(55), map[map_id].name); // 1 player found in map '%s'.
  1045. +			StringBuf_Printf(&buf, msg_txt(sd->lang,55), map[map_id].name); // 1 player found in map '%s'.
  1046.  		else
  1047. -			StringBuf_Printf(&buf, msg_txt(56), count, map[map_id].name); // %d players found in map '%s'.
  1048. +			StringBuf_Printf(&buf, msg_txt(sd->lang,56), count, map[map_id].name); // %d players found in map '%s'.
  1049.  	}
  1050.  	clif_displaymessage(fd, StringBuf_Value(&buf));
  1051.  	StringBuf_Destroy(&buf);
  1052. @@ -683,18 +683,18 @@
  1053.  		if (pl_level > level) {
  1054.  			if (pl_sd->sc.option & OPTION_INVISIBLE)
  1055.  				continue;
  1056. -			sprintf(atcmd_output, msg_txt(913), pl_sd->status.name); // Name: %s (GM)
  1057. +			sprintf(atcmd_output, msg_txt(sd->lang,913), pl_sd->status.name); // Name: %s (GM)
  1058.  			clif_displaymessage(fd, atcmd_output);
  1059.  			count++;
  1060.  			continue;
  1061.  		}
  1062.  
  1063. -		sprintf(atcmd_output, msg_txt(914), // Name: %s (GM:%d) | Location: %s %d %d
  1064. +		sprintf(atcmd_output, msg_txt(sd->lang,914), // Name: %s (GM:%d) | Location: %s %d %d
  1065.  			pl_sd->status.name, pl_level,
  1066.  			mapindex_id2name(pl_sd->mapindex), pl_sd->bl.x, pl_sd->bl.y);
  1067.  		clif_displaymessage(fd, atcmd_output);
  1068.  
  1069. -		sprintf(atcmd_output, msg_txt(915), // BLvl: %d | Job: %s (Lvl: %d)
  1070. +		sprintf(atcmd_output, msg_txt(sd->lang,915), // BLvl: %d | Job: %s (Lvl: %d)
  1071.  			pl_sd->status.base_level,
  1072.  			job_name(pl_sd->status.class_), pl_sd->status.job_level);
  1073.  		clif_displaymessage(fd, atcmd_output);
  1074. @@ -702,8 +702,8 @@
  1075.  		p = party_search(pl_sd->status.party_id);
  1076.  		g = guild_search(pl_sd->status.guild_id);
  1077.  
  1078. -		sprintf(atcmd_output,msg_txt(916),	// Party: '%s' | Guild: '%s'
  1079. -			p?p->party.name:msg_txt(917), g?g->name:msg_txt(917));	// None.
  1080. +		sprintf(atcmd_output,msg_txt(sd->lang,916),	// Party: '%s' | Guild: '%s'
  1081. +			p?p->party.name:msg_txt(sd->lang,917), g?g->name:msg_txt(sd->lang,917));	// None.
  1082.  
  1083.  		clif_displaymessage(fd, atcmd_output);
  1084.  		count++;
  1085. @@ -711,11 +711,11 @@
  1086.  	mapit_free(iter);
  1087.  
  1088.  	if (count == 0)
  1089. -		clif_displaymessage(fd, msg_txt(150)); // No GM found.
  1090. +		clif_displaymessage(fd, msg_txt(sd->lang,150)); // No GM found.
  1091.  	else if (count == 1)
  1092. -		clif_displaymessage(fd, msg_txt(151)); // 1 GM found.
  1093. +		clif_displaymessage(fd, msg_txt(sd->lang,151)); // 1 GM found.
  1094.  	else {
  1095. -		sprintf(atcmd_output, msg_txt(152), count); // %d GMs found.
  1096. +		sprintf(atcmd_output, msg_txt(sd->lang,152), count); // %d GMs found.
  1097.  		clif_displaymessage(fd, atcmd_output);
  1098.  	}
  1099.  
  1100. @@ -735,7 +735,7 @@
  1101.  
  1102.  	chrif_save(sd,0);
  1103.  
  1104. -	clif_displaymessage(fd, msg_txt(6)); // Your save point has been changed.
  1105. +	clif_displaymessage(fd, msg_txt(sd->lang,6)); // Your save point has been changed.
  1106.  
  1107.  	return 0;
  1108.  }
  1109. @@ -751,16 +751,16 @@
  1110.  
  1111.  	m = map_mapindex2mapid(sd->status.save_point.map);
  1112.  	if (m >= 0 && map[m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
  1113. -		clif_displaymessage(fd, msg_txt(249));	// You are not authorized to warp to your save map.
  1114. +		clif_displaymessage(fd, msg_txt(sd->lang,249));	// You are not authorized to warp to your save map.
  1115.  		return -1;
  1116.  	}
  1117.  	if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
  1118. -		clif_displaymessage(fd, msg_txt(248));	// You are not authorized to warp from your current map.
  1119. +		clif_displaymessage(fd, msg_txt(sd->lang,248));	// You are not authorized to warp from your current map.
  1120.  		return -1;
  1121.  	}
  1122.  
  1123.  	pc_setpos(sd, sd->status.save_point.map, sd->status.save_point.x, sd->status.save_point.y, CLR_OUTSIGHT);
  1124. -	clif_displaymessage(fd, msg_txt(7)); // Warping to save point..
  1125. +	clif_displaymessage(fd, msg_txt(sd->lang,7)); // Warping to save point..
  1126.  
  1127.  	return 0;
  1128.  }
  1129. @@ -777,14 +777,14 @@
  1130.  	memset(atcmd_output, '\0', sizeof(atcmd_output));
  1131.  
  1132.  	if (!message || !*message || sscanf(message, "%d", &speed) < 1) {
  1133. -		sprintf(atcmd_output, msg_txt(918), MIN_WALK_SPEED, MAX_WALK_SPEED); // Please enter a speed value (usage: @speed <%d-%d>).
  1134. +		sprintf(atcmd_output, msg_txt(sd->lang,918), MIN_WALK_SPEED, MAX_WALK_SPEED); // Please enter a speed value (usage: @speed <%d-%d>).
  1135.  		clif_displaymessage(fd, atcmd_output);
  1136.  		return -1;
  1137.  	}
  1138.  
  1139.  	sd->base_status.speed = cap_value(speed, MIN_WALK_SPEED, MAX_WALK_SPEED);
  1140.  	status_calc_bl(&sd->bl, SCB_SPEED);
  1141. -	clif_displaymessage(fd, msg_txt(8)); // Speed changed.
  1142. +	clif_displaymessage(fd, msg_txt(sd->lang,8)); // Speed changed.
  1143.  	return 0;
  1144.  }
  1145.  
  1146. @@ -800,11 +800,11 @@
  1147.  
  1148.  	if (storage_storageopen(sd) == 1)
  1149.  	{	//Already open.
  1150. -		clif_displaymessage(fd, msg_txt(250));
  1151. +		clif_displaymessage(fd, msg_txt(sd->lang,250));
  1152.  		return -1;
  1153.  	}
  1154.  
  1155. -	clif_displaymessage(fd, msg_txt(919)); // Storage opened.
  1156. +	clif_displaymessage(fd, msg_txt(sd->lang,919)); // Storage opened.
  1157.  
  1158.  	return 0;
  1159.  }
  1160. @@ -818,7 +818,7 @@
  1161.  	nullpo_retr(-1, sd);
  1162.  
  1163.  	if (!sd->status.guild_id) {
  1164. -		clif_displaymessage(fd, msg_txt(252));
  1165. +		clif_displaymessage(fd, msg_txt(sd->lang,252));
  1166.  		return -1;
  1167.  	}
  1168.  
  1169. @@ -826,17 +826,17 @@
  1170.  		return -1;
  1171.  
  1172.  	if (sd->state.storage_flag == 1) {
  1173. -		clif_displaymessage(fd, msg_txt(250));
  1174. +		clif_displaymessage(fd, msg_txt(sd->lang,250));
  1175.  		return -1;
  1176.  	}
  1177.  
  1178.  	if (sd->state.storage_flag == 2) {
  1179. -		clif_displaymessage(fd, msg_txt(251));
  1180. +		clif_displaymessage(fd, msg_txt(sd->lang,251));
  1181.  		return -1;
  1182.  	}
  1183.  
  1184.  	storage_guild_storageopen(sd);
  1185. -	clif_displaymessage(fd, msg_txt(920)); // Guild storage opened.
  1186. +	clif_displaymessage(fd, msg_txt(sd->lang,920)); // Guild storage opened.
  1187.  	return 0;
  1188.  }
  1189.  
  1190. @@ -856,7 +856,7 @@
  1191.  		text = atcommand_help_string( command );
  1192.  
  1193.  		// notify the user of the requirement to enter an option
  1194. -		clif_displaymessage(fd, msg_txt(921)); // Please enter at least one option.
  1195. +		clif_displaymessage(fd, msg_txt(sd->lang,921)); // Please enter at least one option.
  1196.  
  1197.  		if( text )
  1198.  		{// send the help text associated with this command
  1199. @@ -870,7 +870,7 @@
  1200.  	sd->sc.opt2 = param2;
  1201.  	pc_setoption(sd, param3);
  1202.  
  1203. -	clif_displaymessage(fd, msg_txt(9)); // Options changed.
  1204. +	clif_displaymessage(fd, msg_txt(sd->lang,9)); // Options changed.
  1205.  
  1206.  	return 0;
  1207.  }
  1208. @@ -887,7 +887,7 @@
  1209.  			status_set_viewdata(&sd->bl, sd->disguise);
  1210.  		else
  1211.  			status_set_viewdata(&sd->bl, sd->status.class_);
  1212. -		clif_displaymessage(fd, msg_txt(10)); // Invisible: Off
  1213. +		clif_displaymessage(fd, msg_txt(sd->lang,10)); // Invisible: Off
  1214.  
  1215.  		// increment the number of pvp players on the map
  1216.  		map[sd->bl.m].users_pvp++;
  1217. @@ -901,7 +901,7 @@
  1218.  	} else {
  1219.  		sd->sc.option |= OPTION_INVISIBLE;
  1220.  		sd->vd.class_ = INVISIBLE_CLASS;
  1221. -		clif_displaymessage(fd, msg_txt(11)); // Invisible: On
  1222. +		clif_displaymessage(fd, msg_txt(sd->lang,11)); // Invisible: On
  1223.  
  1224.  		// decrement the number of pvp players on the map
  1225.  		map[sd->bl.m].users_pvp--;
  1226. @@ -950,15 +950,15 @@
  1227.          || job == JOB_LORD_KNIGHT2 || job == JOB_PALADIN2 || job == JOB_BABY_KNIGHT2 || job == JOB_BABY_CRUSADER2 || job == JOB_STAR_GLADIATOR2
  1228.  		 || (job >= JOB_RUNE_KNIGHT2 && job <= JOB_MECHANIC_T2) || (job >= JOB_BABY_RUNE2 && job <= JOB_BABY_MECHANIC2)
  1229.  	) // Deny direct transformation into dummy jobs
  1230. -		{clif_displaymessage(fd, msg_txt(923)); //"You can not change to this job by command."
  1231. +		{clif_displaymessage(fd, msg_txt(sd->lang,923)); //"You can not change to this job by command."
  1232.  		return 0;}
  1233.  
  1234.  	if (pcdb_checkid(job))
  1235.  	{
  1236.  		if (pc_jobchange(sd, job, upper) == 0)
  1237. -			clif_displaymessage(fd, msg_txt(12)); // Your job has been changed.
  1238. +			clif_displaymessage(fd, msg_txt(sd->lang,12)); // Your job has been changed.
  1239.  		else {
  1240. -			clif_displaymessage(fd, msg_txt(155)); // You are unable to change your job.
  1241. +			clif_displaymessage(fd, msg_txt(sd->lang,155)); // You are unable to change your job.
  1242.  			return -1;
  1243.  		}
  1244.  	} else {
  1245. @@ -978,9 +978,9 @@
  1246.  {
  1247.  	nullpo_retr(-1, sd);
  1248.  	status_kill(&sd->bl);
  1249. -	clif_displaymessage(sd->fd, msg_txt(13)); // A pity! You've died.
  1250. +	clif_displaymessage(sd->fd, msg_txt(sd->lang,13)); // A pity! You've died.
  1251.  	if (fd != sd->fd)
  1252. -		clif_displaymessage(fd, msg_txt(14)); // Character killed.
  1253. +		clif_displaymessage(fd, msg_txt(sd->lang,14)); // Character killed.
  1254.  	return 0;
  1255.  }
  1256.  
  1257. @@ -992,11 +992,11 @@
  1258.  	nullpo_retr(-1, sd);
  1259.  	if (!status_revive(&sd->bl, 100, 100))
  1260.  	{
  1261. -		clif_displaymessage(fd, msg_txt(667));
  1262. +		clif_displaymessage(fd, msg_txt(sd->lang,667));
  1263.  		return -1;
  1264.  	}
  1265.  	clif_skill_nodamage(&sd->bl,&sd->bl,ALL_RESURRECTION,4,1);
  1266. -	clif_displaymessage(fd, msg_txt(16)); // You've been revived! It's a miracle!
  1267. +	clif_displaymessage(fd, msg_txt(sd->lang,16)); // You've been revived! It's a miracle!
  1268.  	return 0;
  1269.  }
  1270.  
  1271. @@ -1012,7 +1012,7 @@
  1272.  
  1273.  	if(*(command + 5) != 'c' && *(command + 5) != 'C') {
  1274.  		if (!message || !*message) {
  1275. -			clif_displaymessage(fd, msg_txt(980)); // Please enter a message (usage: @kami <message>).
  1276. +			clif_displaymessage(fd, msg_txt(sd->lang,980)); // Please enter a message (usage: @kami <message>).
  1277.  			return -1;
  1278.  		}
  1279.  
  1280. @@ -1023,12 +1023,12 @@
  1281.  			intif_broadcast(atcmd_output, strlen(atcmd_output) + 1, (*(command + 5) == 'b' || *(command + 5) == 'B') ? 0x10 : 0);
  1282.  	} else {
  1283.  		if(!message || !*message || (sscanf(message, "%lx %199[^\n]", &color, atcmd_output) < 2)) {
  1284. -			clif_displaymessage(fd, msg_txt(981)); // Please enter color and message (usage: @kamic <color> <message>).
  1285. +			clif_displaymessage(fd, msg_txt(sd->lang,981)); // Please enter color and message (usage: @kamic <color> <message>).
  1286.  			return -1;
  1287.  		}
  1288.  
  1289.  		if(color > 0xFFFFFF) {
  1290. -			clif_displaymessage(fd, msg_txt(982)); // Invalid color.
  1291. +			clif_displaymessage(fd, msg_txt(sd->lang,982)); // Invalid color.
  1292.  			return -1;
  1293.  		}
  1294.  		intif_broadcast2(atcmd_output, strlen(atcmd_output) + 1, color, 0x190, 12, 0, 0);
  1295. @@ -1052,24 +1052,24 @@
  1296.  
  1297.  	if ( hp == 0 && sp == 0 ) {
  1298.  		if (!status_percent_heal(&sd->bl, 100, 100))
  1299. -			clif_displaymessage(fd, msg_txt(157)); // HP and SP have already been recovered.
  1300. +			clif_displaymessage(fd, msg_txt(sd->lang,157)); // HP and SP have already been recovered.
  1301.  		else
  1302. -			clif_displaymessage(fd, msg_txt(17)); // HP, SP recovered.
  1303. +			clif_displaymessage(fd, msg_txt(sd->lang,17)); // HP, SP recovered.
  1304.  		return 0;
  1305.  	}
  1306.  
  1307.  	if ( hp > 0 && sp >= 0 ) {
  1308.  		if(!status_heal(&sd->bl, hp, sp, 0))
  1309. -			clif_displaymessage(fd, msg_txt(157)); // HP and SP are already with the good value.
  1310. +			clif_displaymessage(fd, msg_txt(sd->lang,157)); // HP and SP are already with the good value.
  1311.  		else
  1312. -			clif_displaymessage(fd, msg_txt(17)); // HP, SP recovered.
  1313. +			clif_displaymessage(fd, msg_txt(sd->lang,17)); // HP, SP recovered.
  1314.  		return 0;
  1315.  	}
  1316.  
  1317.  	if ( hp < 0 && sp <= 0 ) {
  1318.  		status_damage(NULL, &sd->bl, -hp, -sp, 0, 0);
  1319.  		clif_damage(&sd->bl,&sd->bl, gettick(), 0, 0, -hp, 0, 4, 0);
  1320. -		clif_displaymessage(fd, msg_txt(156)); // HP or/and SP modified.
  1321. +		clif_displaymessage(fd, msg_txt(sd->lang,156)); // HP or/and SP modified.
  1322.  		return 0;
  1323.  	}
  1324.  
  1325. @@ -1090,7 +1090,7 @@
  1326.  			status_damage(NULL, &sd->bl, 0, -sp, 0, 0);
  1327.  	}
  1328.  
  1329. -	clif_displaymessage(fd, msg_txt(156)); // HP or/and SP modified.
  1330. +	clif_displaymessage(fd, msg_txt(sd->lang,156)); // HP or/and SP modified.
  1331.  	return 0;
  1332.  }
  1333.  
  1334. @@ -1112,7 +1112,7 @@
  1335.  		sscanf(message, "\"%99[^\"]\" %d", item_name, &number) < 1 &&
  1336.  		sscanf(message, "%99s %d", item_name, &number) < 1
  1337.  	)) {
  1338. -		clif_displaymessage(fd, msg_txt(983)); // Please enter an item name or ID (usage: @item <item name/ID> <quantity>).
  1339. +		clif_displaymessage(fd, msg_txt(sd->lang,983)); // Please enter an item name or ID (usage: @item <item name/ID> <quantity>).
  1340.  		return -1;
  1341.  	}
  1342.  
  1343. @@ -1122,7 +1122,7 @@
  1344.  	if ((item_data = itemdb_searchname(item_name)) == NULL &&
  1345.  	    (item_data = itemdb_exists(atoi(item_name))) == NULL)
  1346.  	{
  1347. -		clif_displaymessage(fd, msg_txt(19)); // Invalid item ID or name.
  1348. +		clif_displaymessage(fd, msg_txt(sd->lang,19)); // Invalid item ID or name.
  1349.  		return -1;
  1350.  	}
  1351.  
  1352. @@ -1145,7 +1145,7 @@
  1353.  	}
  1354.  
  1355.  	if (flag == 0)
  1356. -		clif_displaymessage(fd, msg_txt(18)); // Item created.
  1357. +		clif_displaymessage(fd, msg_txt(sd->lang,18)); // Item created.
  1358.  	return 0;
  1359.  }
  1360.  
  1361. @@ -1168,8 +1168,8 @@
  1362.  		sscanf(message, "\"%99[^\"]\" %d %d %d %d %d %d %d %d", item_name, &number, &identify, &refine, &attr, &c1, &c2, &c3, &c4) < 9 &&
  1363.  		sscanf(message, "%99s %d %d %d %d %d %d %d %d", item_name, &number, &identify, &refine, &attr, &c1, &c2, &c3, &c4) < 9
  1364.  	)) {
  1365. -		clif_displaymessage(fd, msg_txt(984)); // Please enter all parameters (usage: @item2 <item name/ID> <quantity>
  1366. -		clif_displaymessage(fd, msg_txt(985)); //   <identify_flag> <refine> <attribute> <card1> <card2> <card3> <card4>).
  1367. +		clif_displaymessage(fd, msg_txt(sd->lang,984)); // Please enter all parameters (usage: @item2 <item name/ID> <quantity>
  1368. +		clif_displaymessage(fd, msg_txt(sd->lang,985)); //   <identify_flag> <refine> <attribute> <card1> <card2> <card3> <card4>).
  1369.  		return -1;
  1370.  	}
  1371.  
  1372. @@ -1217,9 +1217,9 @@
  1373.  		}
  1374.  
  1375.  		if (flag == 0)
  1376. -			clif_displaymessage(fd, msg_txt(18)); // Item created.
  1377. +			clif_displaymessage(fd, msg_txt(sd->lang,18)); // Item created.
  1378.  	} else {
  1379. -		clif_displaymessage(fd, msg_txt(19)); // Invalid item ID or name.
  1380. +		clif_displaymessage(fd, msg_txt(sd->lang,19)); // Invalid item ID or name.
  1381.  		return -1;
  1382.  	}
  1383.  
  1384. @@ -1239,7 +1239,7 @@
  1385.  			pc_delitem(sd, i, sd->status.inventory[i].amount, 0, 0, LOG_TYPE_COMMAND);
  1386.  		}
  1387.  	}
  1388. -	clif_displaymessage(fd, msg_txt(20)); // All of your items have been removed.
  1389. +	clif_displaymessage(fd, msg_txt(sd->lang,20)); // All of your items have been removed.
  1390.  
  1391.  	return 0;
  1392.  }
  1393. @@ -1254,13 +1254,13 @@
  1394.  	level = atoi(message);
  1395.  
  1396.  	if (!message || !*message || !level) {
  1397. -		clif_displaymessage(fd, msg_txt(986)); // Please enter a level adjustment (usage: @lvup/@blevel/@baselvlup <number of levels>).
  1398. +		clif_displaymessage(fd, msg_txt(sd->lang,986)); // Please enter a level adjustment (usage: @lvup/@blevel/@baselvlup <number of levels>).
  1399.  		return -1;
  1400.  	}
  1401.  
  1402.  	if (level > 0) {
  1403.  		if (sd->status.base_level >= pc_maxbaselv(sd)) { // check for max level by Valaris
  1404. -			clif_displaymessage(fd, msg_txt(47)); // Base level can't go any higher.
  1405. +			clif_displaymessage(fd, msg_txt(sd->lang,47)); // Base level can't go any higher.
  1406.  			return -1;
  1407.  		} // End Addition
  1408.  		if ((unsigned int)level > pc_maxbaselv(sd) || (unsigned int)level > pc_maxbaselv(sd) - sd->status.base_level) // fix positiv overflow
  1409. @@ -1272,10 +1272,10 @@
  1410.  		sd->status.base_level += (unsigned int)level;
  1411.  		status_percent_heal(&sd->bl, 100, 100);
  1412.  		clif_misceffect(&sd->bl, 0);
  1413. -		clif_displaymessage(fd, msg_txt(21)); // Base level raised.
  1414. +		clif_displaymessage(fd, msg_txt(sd->lang,21)); // Base level raised.
  1415.  	} else {
  1416.  		if (sd->status.base_level == 1) {
  1417. -			clif_displaymessage(fd, msg_txt(158)); // Base level can't go any lower.
  1418. +			clif_displaymessage(fd, msg_txt(sd->lang,158)); // Base level can't go any lower.
  1419.  			return -1;
  1420.  		}
  1421.  		level*=-1;
  1422. @@ -1290,7 +1290,7 @@
  1423.  		else
  1424.  			sd->status.status_point -= status_point;
  1425.  		sd->status.base_level -= (unsigned int)level;
  1426. -		clif_displaymessage(fd, msg_txt(22)); // Base level lowered.
  1427. +		clif_displaymessage(fd, msg_txt(sd->lang,22)); // Base level lowered.
  1428.  	}
  1429.  	sd->status.base_exp = 0;
  1430.  	clif_updatestatus(sd, SP_STATUSPOINT);
  1431. @@ -1315,12 +1315,12 @@
  1432.  	level = atoi(message);
  1433.  
  1434.  	if (!message || !*message || !level) {
  1435. -		clif_displaymessage(fd, msg_txt(987)); // Please enter a level adjustment (usage: @joblvup/@jlevel/@joblvlup <number of levels>).
  1436. +		clif_displaymessage(fd, msg_txt(sd->lang,987)); // Please enter a level adjustment (usage: @joblvup/@jlevel/@joblvlup <number of levels>).
  1437.  		return -1;
  1438.  	}
  1439.  	if (level > 0) {
  1440.  		if (sd->status.job_level >= pc_maxjoblv(sd)) {
  1441. -			clif_displaymessage(fd, msg_txt(23)); // Job level can't go any higher.
  1442. +			clif_displaymessage(fd, msg_txt(sd->lang,23)); // Job level can't go any higher.
  1443.  			return -1;
  1444.  		}
  1445.  		if ((unsigned int)level > pc_maxjoblv(sd) || (unsigned int)level > pc_maxjoblv(sd) - sd->status.job_level) // fix positiv overflow
  1446. @@ -1328,10 +1328,10 @@
  1447.  		sd->status.job_level += (unsigned int)level;
  1448.  		sd->status.skill_point += level;
  1449.  		clif_misceffect(&sd->bl, 1);
  1450. -		clif_displaymessage(fd, msg_txt(24)); // Job level raised.
  1451. +		clif_displaymessage(fd, msg_txt(sd->lang,24)); // Job level raised.
  1452.  	} else {
  1453.  		if (sd->status.job_level == 1) {
  1454. -			clif_displaymessage(fd, msg_txt(159)); // Job level can't go any lower.
  1455. +			clif_displaymessage(fd, msg_txt(sd->lang,159)); // Job level can't go any lower.
  1456.  			return -1;
  1457.  		}
  1458.  		level *=-1;
  1459. @@ -1344,7 +1344,7 @@
  1460.  			sd->status.skill_point = 0;
  1461.  		else
  1462.  			sd->status.skill_point -= level;
  1463. -		clif_displaymessage(fd, msg_txt(25)); // Job level lowered.
  1464. +		clif_displaymessage(fd, msg_txt(sd->lang,25)); // Job level lowered.
  1465.  	}
  1466.  	sd->status.job_exp = 0;
  1467.  	clif_updatestatus(sd, SP_JOBLEVEL);
  1468. @@ -1370,7 +1370,7 @@
  1469.  
  1470.  	help = config_lookup(&atcommand_config, "help");
  1471.  	if (help == NULL) {
  1472. -		clif_displaymessage(fd, msg_txt(27)); // "Commands help is not available."
  1473. +		clif_displaymessage(fd, msg_txt(sd->lang,27)); // "Commands help is not available."
  1474.  		return -1;
  1475.  	}
  1476.  
  1477. @@ -1383,20 +1383,20 @@
  1478.  	}
  1479.  
  1480.  	if (!pc_can_use_command(sd, command_name, COMMAND_ATCOMMAND)) {
  1481. -		sprintf(atcmd_output, msg_txt(153), message); // "%s is Unknown Command"
  1482. +		sprintf(atcmd_output, msg_txt(sd->lang,153), message); // "%s is Unknown Command"
  1483.  		clif_displaymessage(fd, atcmd_output);
  1484.  		atcommand_get_suggestions(sd, command_name, true);
  1485.  		return -1;
  1486.  	}
  1487.  
  1488.  	if (!config_setting_lookup_string(help, command_name, &text)) {
  1489. -		sprintf(atcmd_output, msg_txt(988), atcommand_symbol, command_name); // There is no help for %c%s.
  1490. +		sprintf(atcmd_output, msg_txt(sd->lang,988), atcommand_symbol, command_name); // There is no help for %c%s.
  1491.  		clif_displaymessage(fd, atcmd_output);
  1492.  		atcommand_get_suggestions(sd, command_name, true);
  1493.  		return -1;
  1494.  	}
  1495.  
  1496. -	sprintf(atcmd_output, msg_txt(989), atcommand_symbol, command_name); // Help for command %c%s:
  1497. +	sprintf(atcmd_output, msg_txt(sd->lang,989), atcommand_symbol, command_name); // Help for command %c%s:
  1498.  	clif_displaymessage(fd, atcmd_output);
  1499.  
  1500.  	{   // Display aliases
  1501. @@ -1407,7 +1407,7 @@
  1502.  		bool has_aliases = false;
  1503.  
  1504.  		StringBuf_Init(&buf);
  1505. -		StringBuf_AppendStr(&buf, msg_txt(990)); // Available aliases:
  1506. +		StringBuf_AppendStr(&buf, msg_txt(sd->lang,990)); // Available aliases:
  1507.  		command_info = get_atcommandinfo_byname(command_name);
  1508.  		iter = db_iterator(atcommand_alias_db);
  1509.  		for (alias_info = dbi_first(iter); dbi_exists(iter); alias_info = dbi_next(iter)) {
  1510. @@ -1459,7 +1459,7 @@
  1511.  	nullpo_retr(-1, sd);
  1512.  
  1513.  	if (!map[sd->bl.m].flag.pvp) {
  1514. -		clif_displaymessage(fd, msg_txt(160)); // PvP is already Off.
  1515. +		clif_displaymessage(fd, msg_txt(sd->lang,160)); // PvP is already Off.
  1516.  		return -1;
  1517.  	}
  1518.  
  1519. @@ -1469,7 +1469,7 @@
  1520.  		clif_map_property_mapall(sd->bl.m, MAPPROPERTY_NOTHING);
  1521.  	map_foreachinmap(atcommand_pvpoff_sub,sd->bl.m, BL_PC);
  1522.  	map_foreachinmap(atcommand_stopattack,sd->bl.m, BL_CHAR, 0);
  1523. -	clif_displaymessage(fd, msg_txt(31)); // PvP: Off.
  1524. +	clif_displaymessage(fd, msg_txt(sd->lang,31)); // PvP: Off.
  1525.  	return 0;
  1526.  }
  1527.  
  1528. @@ -1495,7 +1495,7 @@
  1529.  	nullpo_retr(-1, sd);
  1530.  
  1531.  	if (map[sd->bl.m].flag.pvp) {
  1532. -		clif_displaymessage(fd, msg_txt(161)); // PvP is already On.
  1533. +		clif_displaymessage(fd, msg_txt(sd->lang,161)); // PvP is already On.
  1534.  		return -1;
  1535.  	}
  1536.  
  1537. @@ -1507,7 +1507,7 @@
  1538.  		map_foreachinmap(atcommand_pvpon_sub,sd->bl.m, BL_PC);
  1539.  	}
  1540.  
  1541. -	clif_displaymessage(fd, msg_txt(32)); // PvP: On.
  1542. +	clif_displaymessage(fd, msg_txt(sd->lang,32)); // PvP: On.
  1543.  
  1544.  	return 0;
  1545.  }
  1546. @@ -1520,14 +1520,14 @@
  1547.  	nullpo_retr(-1, sd);
  1548.  
  1549.  	if (!map[sd->bl.m].flag.gvg) {
  1550. -		clif_displaymessage(fd, msg_txt(162)); // GvG is already Off.
  1551. +		clif_displaymessage(fd, msg_txt(sd->lang,162)); // GvG is already Off.
  1552.  		return -1;
  1553.  	}
  1554.  
  1555.  	map[sd->bl.m].flag.gvg = 0;
  1556.  	clif_map_property_mapall(sd->bl.m, MAPPROPERTY_NOTHING);
  1557.  	map_foreachinmap(atcommand_stopattack,sd->bl.m, BL_CHAR, 0);
  1558. -	clif_displaymessage(fd, msg_txt(33)); // GvG: Off.
  1559. +	clif_displaymessage(fd, msg_txt(sd->lang,33)); // GvG: Off.
  1560.  
  1561.  	return 0;
  1562.  }
  1563. @@ -1540,13 +1540,13 @@
  1564.  	nullpo_retr(-1, sd);
  1565.  
  1566.  	if (map[sd->bl.m].flag.gvg) {
  1567. -		clif_displaymessage(fd, msg_txt(163)); // GvG is already On.
  1568. +		clif_displaymessage(fd, msg_txt(sd->lang,163)); // GvG is already On.
  1569.  		return -1;
  1570.  	}
  1571.  
  1572.  	map[sd->bl.m].flag.gvg = 1;
  1573.  	clif_map_property_mapall(sd->bl.m, MAPPROPERTY_AGITZONE);
  1574. -	clif_displaymessage(fd, msg_txt(34)); // GvG: On.
  1575. +	clif_displaymessage(fd, msg_txt(sd->lang,34)); // GvG: On.
  1576.  
  1577.  	return 0;
  1578.  }
  1579. @@ -1562,7 +1562,7 @@
  1580.  	memset(atcmd_output, '\0', sizeof(atcmd_output));
  1581.  
  1582.  	if (!message || !*message || sscanf(message, "%d %d %d", &hair_style, &hair_color, &cloth_color) < 1) {
  1583. -		sprintf(atcmd_output, msg_txt(991), // Please enter at least one value (usage: @model <hair ID: %d-%d> <hair color: %d-%d> <clothes color: %d-%d>).
  1584. +		sprintf(atcmd_output, msg_txt(sd->lang,991), // Please enter at least one value (usage: @model <hair ID: %d-%d> <hair color: %d-%d> <clothes color: %d-%d>).
  1585.  		        MIN_HAIR_STYLE, MAX_HAIR_STYLE, MIN_HAIR_COLOR, MAX_HAIR_COLOR, MIN_CLOTH_COLOR, MAX_CLOTH_COLOR);
  1586.  		clif_displaymessage(fd, atcmd_output);
  1587.  		return -1;
  1588. @@ -1574,9 +1574,9 @@
  1589.  			pc_changelook(sd, LOOK_HAIR, hair_style);
  1590.  			pc_changelook(sd, LOOK_HAIR_COLOR, hair_color);
  1591.  			pc_changelook(sd, LOOK_CLOTHES_COLOR, cloth_color);
  1592. -			clif_displaymessage(fd, msg_txt(36)); // Appearence changed.
  1593. +			clif_displaymessage(fd, msg_txt(sd->lang,36)); // Appearence changed.
  1594.  	} else {
  1595. -		clif_displaymessage(fd, msg_txt(37)); // An invalid number was specified.
  1596. +		clif_displaymessage(fd, msg_txt(sd->lang,37)); // An invalid number was specified.
  1597.  		return -1;
  1598.  	}
  1599.  
  1600. @@ -1594,16 +1594,16 @@
  1601.  	memset(atcmd_output, '\0', sizeof(atcmd_output));
  1602.  
  1603.  	if (!message || !*message || sscanf(message, "%d", &cloth_color) < 1) {
  1604. -		sprintf(atcmd_output, msg_txt(992), MIN_CLOTH_COLOR, MAX_CLOTH_COLOR); // Please enter a clothes color (usage: @dye/@ccolor <clothes color: %d-%d>).
  1605. +		sprintf(atcmd_output, msg_txt(sd->lang,992), MIN_CLOTH_COLOR, MAX_CLOTH_COLOR); // Please enter a clothes color (usage: @dye/@ccolor <clothes color: %d-%d>).
  1606.  		clif_displaymessage(fd, atcmd_output);
  1607.  		return -1;
  1608.  	}
  1609.  
  1610.  	if (cloth_color >= MIN_CLOTH_COLOR && cloth_color <= MAX_CLOTH_COLOR) {
  1611.  		pc_changelook(sd, LOOK_CLOTHES_COLOR, cloth_color);
  1612. -		clif_displaymessage(fd, msg_txt(36)); // Appearence changed.
  1613. +		clif_displaymessage(fd, msg_txt(sd->lang,36)); // Appearence changed.
  1614.  	} else {
  1615. -		clif_displaymessage(fd, msg_txt(37)); // An invalid number was specified.
  1616. +		clif_displaymessage(fd, msg_txt(sd->lang,37)); // An invalid number was specified.
  1617.  		return -1;
  1618.  	}
  1619.  
  1620. @@ -1621,16 +1621,16 @@
  1621.  	memset(atcmd_output, '\0', sizeof(atcmd_output));
  1622.  
  1623.  	if (!message || !*message || sscanf(message, "%d", &hair_style) < 1) {
  1624. -		sprintf(atcmd_output, msg_txt(993), MIN_HAIR_STYLE, MAX_HAIR_STYLE); // Please enter a hair style (usage: @hairstyle/@hstyle <hair ID: %d-%d>).
  1625. +		sprintf(atcmd_output, msg_txt(sd->lang,993), MIN_HAIR_STYLE, MAX_HAIR_STYLE); // Please enter a hair style (usage: @hairstyle/@hstyle <hair ID: %d-%d>).
  1626.  		clif_displaymessage(fd, atcmd_output);
  1627.  		return -1;
  1628.  	}
  1629.  
  1630.  	if (hair_style >= MIN_HAIR_STYLE && hair_style <= MAX_HAIR_STYLE) {
  1631.  			pc_changelook(sd, LOOK_HAIR, hair_style);
  1632. -			clif_displaymessage(fd, msg_txt(36)); // Appearence changed.
  1633. +			clif_displaymessage(fd, msg_txt(sd->lang,36)); // Appearence changed.
  1634.  	} else {
  1635. -		clif_displaymessage(fd, msg_txt(37)); // An invalid number was specified.
  1636. +		clif_displaymessage(fd, msg_txt(sd->lang,37)); // An invalid number was specified.
  1637.  		return -1;
  1638.  	}
  1639.  
  1640. @@ -1648,16 +1648,16 @@
  1641.  	memset(atcmd_output, '\0', sizeof(atcmd_output));
  1642.  
  1643.  	if (!message || !*message || sscanf(message, "%d", &hair_color) < 1) {
  1644. -		sprintf(atcmd_output, msg_txt(994), MIN_HAIR_COLOR, MAX_HAIR_COLOR); // Please enter a hair color (usage: @haircolor/@hcolor <hair color: %d-%d>).
  1645. +		sprintf(atcmd_output, msg_txt(sd->lang,994), MIN_HAIR_COLOR, MAX_HAIR_COLOR); // Please enter a hair color (usage: @haircolor/@hcolor <hair color: %d-%d>).
  1646.  		clif_displaymessage(fd, atcmd_output);
  1647.  		return -1;
  1648.  	}
  1649.  
  1650.  	if (hair_color >= MIN_HAIR_COLOR && hair_color <= MAX_HAIR_COLOR) {
  1651.  			pc_changelook(sd, LOOK_HAIR_COLOR, hair_color);
  1652. -			clif_displaymessage(fd, msg_txt(36)); // Appearence changed.
  1653. +			clif_displaymessage(fd, msg_txt(sd->lang,36)); // Appearence changed.
  1654.  	} else {
  1655. -		clif_displaymessage(fd, msg_txt(37)); // An invalid number was specified.
  1656. +		clif_displaymessage(fd, msg_txt(sd->lang,37)); // An invalid number was specified.
  1657.  		return -1;
  1658.  	}
  1659.  
  1660. @@ -1723,7 +1723,7 @@
  1661.  	nullpo_retr(-1, sd);
  1662.  
  1663.  	if( map[sd->bl.m].flag.nogo && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE) ) {
  1664. -		clif_displaymessage(sd->fd,msg_txt(995)); // You cannot use @go on this map.
  1665. +		clif_displaymessage(sd->fd,msg_txt(sd->lang,995)); // You cannot use @go on this map.
  1666.  		return 0;
  1667.  	}
  1668.  
  1669. @@ -1740,7 +1740,7 @@
  1670.  		// attempt to find the text help string
  1671.  		text = atcommand_help_string( command );
  1672.  
  1673. -		clif_displaymessage(fd, msg_txt(38)); // Invalid location number, or name.
  1674. +		clif_displaymessage(fd, msg_txt(sd->lang,38)); // Invalid location number, or name.
  1675.  
  1676.  		if( text )
  1677.  		{// send the text to the client
  1678. @@ -1843,21 +1843,21 @@
  1679.  	{
  1680.  		m = map_mapname2mapid(data[town].map);
  1681.  		if (m >= 0 && map[m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
  1682. -			clif_displaymessage(fd, msg_txt(247));
  1683. +			clif_displaymessage(fd, msg_txt(sd->lang,247));
  1684.  			return -1;
  1685.  		}
  1686.  		if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
  1687. -			clif_displaymessage(fd, msg_txt(248));
  1688. +			clif_displaymessage(fd, msg_txt(sd->lang,248));
  1689.  			return -1;
  1690.  		}
  1691.  		if (pc_setpos(sd, mapindex_name2id(data[town].map), data[town].x, data[town].y, CLR_TELEPORT) == 0) {
  1692. -			clif_displaymessage(fd, msg_txt(0)); // Warped.
  1693. +			clif_displaymessage(fd, msg_txt(sd->lang,0)); // Warped.
  1694.  		} else {
  1695. -			clif_displaymessage(fd, msg_txt(1)); // Map not found.
  1696. +			clif_displaymessage(fd, msg_txt(sd->lang,1)); // Map not found.
  1697.  			return -1;
  1698.  		}
  1699.  	} else { // if you arrive here, you have an error in town variable when reading of names
  1700. -		clif_displaymessage(fd, msg_txt(38)); // Invalid location number or name.
  1701. +		clif_displaymessage(fd, msg_txt(sd->lang,38)); // Invalid location number or name.
  1702.  		return -1;
  1703.  	}
  1704.  
  1705. @@ -1885,7 +1885,7 @@
  1706.  	memset(atcmd_output, '\0', sizeof(atcmd_output));
  1707.  
  1708.  	if (!message || !*message) {
  1709. -			clif_displaymessage(fd, msg_txt(80)); // Give the display name or monster name/id please.
  1710. +			clif_displaymessage(fd, msg_txt(sd->lang,80)); // Give the display name or monster name/id please.
  1711.  			return -1;
  1712.  	}
  1713.  	if (sscanf(message, "\"%23[^\"]\" %23s %d", name, monster, &number) > 1 ||
  1714. @@ -1901,7 +1901,7 @@
  1715.  		//As before, name may be already filled.
  1716.  		name[0] = '\0';
  1717.  	} else {
  1718. -		clif_displaymessage(fd, msg_txt(80)); // Give a display name and monster name/id please.
  1719. +		clif_displaymessage(fd, msg_txt(sd->lang,80)); // Give a display name and monster name/id please.
  1720.  		return -1;
  1721.  	}
  1722.  
  1723. @@ -1909,12 +1909,12 @@
  1724.  		mob_id = mobdb_checkid(atoi(monster));
  1725.  
  1726.  	if (mob_id == 0) {
  1727. -		clif_displaymessage(fd, msg_txt(40)); // Invalid monster ID or name.
  1728. +		clif_displaymessage(fd, msg_txt(sd->lang,40)); // Invalid monster ID or name.
  1729.  		return -1;
  1730.  	}
  1731.  
  1732.  	if (mob_id == MOBID_EMPERIUM) {
  1733. -		clif_displaymessage(fd, msg_txt(83)); // Monster 'Emperium' cannot be spawned.
  1734. +		clif_displaymessage(fd, msg_txt(sd->lang,83)); // Monster 'Emperium' cannot be spawned.
  1735.  		return -1;
  1736.  	}
  1737.  
  1738. @@ -1948,13 +1948,13 @@
  1739.  
  1740.  	if (count != 0)
  1741.  		if (number == count)
  1742. -			clif_displaymessage(fd, msg_txt(39)); // All monster summoned!
  1743. +			clif_displaymessage(fd, msg_txt(sd->lang,39)); // All monster summoned!
  1744.  		else {
  1745. -			sprintf(atcmd_output, msg_txt(240), count); // %d monster(s) summoned!
  1746. +			sprintf(atcmd_output, msg_txt(sd->lang,240), count); // %d monster(s) summoned!
  1747.  			clif_displaymessage(fd, atcmd_output);
  1748.  		}
  1749.  	else {
  1750. -		clif_displaymessage(fd, msg_txt(40)); // Invalid monster ID or name.
  1751. +		clif_displaymessage(fd, msg_txt(sd->lang,40)); // Invalid monster ID or name.
  1752.  		return -1;
  1753.  	}
  1754.  
  1755. @@ -2001,7 +2001,7 @@
  1756.  
  1757.  	map_foreachinmap(atkillmonster_sub, map_id, BL_MOB, -drop_flag);
  1758.  
  1759. -	clif_displaymessage(fd, msg_txt(165)); // All monsters killed!
  1760. +	clif_displaymessage(fd, msg_txt(sd->lang,165)); // All monsters killed!
  1761.  
  1762.  	return 0;
  1763.  }
  1764. @@ -2018,26 +2018,26 @@
  1765.  	memset(atcmd_output, '\0', sizeof(atcmd_output));
  1766.  
  1767.  	if (!message || !*message || sscanf(message, "%d %d", &position, &refine) < 2) {
  1768. -		clif_displaymessage(fd, msg_txt(996)); // Please enter a position and an amount (usage: @refine <equip position> <+/- amount>).
  1769. -		sprintf(atcmd_output, msg_txt(997), EQP_HEAD_LOW); // %d: Lower Headgear
  1770. +		clif_displaymessage(fd, msg_txt(sd->lang,996)); // Please enter a position and an amount (usage: @refine <equip position> <+/- amount>).
  1771. +		sprintf(atcmd_output, msg_txt(sd->lang,997), EQP_HEAD_LOW); // %d: Lower Headgear
  1772.  		clif_displaymessage(fd, atcmd_output);
  1773. -		sprintf(atcmd_output, msg_txt(998), EQP_HAND_R); // %d: Right Hand
  1774. +		sprintf(atcmd_output, msg_txt(sd->lang,998), EQP_HAND_R); // %d: Right Hand
  1775.  		clif_displaymessage(fd, atcmd_output);
  1776. -		sprintf(atcmd_output, msg_txt(999), EQP_GARMENT); // %d: Garment
  1777. +		sprintf(atcmd_output, msg_txt(sd->lang,999), EQP_GARMENT); // %d: Garment
  1778.  		clif_displaymessage(fd, atcmd_output);
  1779. -		sprintf(atcmd_output, msg_txt(1000), EQP_ACC_L); // %d: Left Accessory
  1780. +		sprintf(atcmd_output, msg_txt(sd->lang,1000), EQP_ACC_L); // %d: Left Accessory
  1781.  		clif_displaymessage(fd, atcmd_output);
  1782. -		sprintf(atcmd_output, msg_txt(1001), EQP_ARMOR); // %d: Body Armor
  1783. +		sprintf(atcmd_output, msg_txt(sd->lang,1001), EQP_ARMOR); // %d: Body Armor
  1784.  		clif_displaymessage(fd, atcmd_output);
  1785. -		sprintf(atcmd_output, msg_txt(1002), EQP_HAND_L); // %d: Left Hand
  1786. +		sprintf(atcmd_output, msg_txt(sd->lang,1002), EQP_HAND_L); // %d: Left Hand
  1787.  		clif_displaymessage(fd, atcmd_output);
  1788. -		sprintf(atcmd_output, msg_txt(1003), EQP_SHOES); // %d: Shoes
  1789. +		sprintf(atcmd_output, msg_txt(sd->lang,1003), EQP_SHOES); // %d: Shoes
  1790.  		clif_displaymessage(fd, atcmd_output);
  1791. -		sprintf(atcmd_output, msg_txt(1004), EQP_ACC_R); // %d: Right Accessory
  1792. +		sprintf(atcmd_output, msg_txt(sd->lang,1004), EQP_ACC_R); // %d: Right Accessory
  1793.  		clif_displaymessage(fd, atcmd_output);
  1794. -		sprintf(atcmd_output, msg_txt(1005), EQP_HEAD_TOP); // %d: Top Headgear
  1795. +		sprintf(atcmd_output, msg_txt(sd->lang,1005), EQP_HEAD_TOP); // %d: Top Headgear
  1796.  		clif_displaymessage(fd, atcmd_output);
  1797. -		sprintf(atcmd_output, msg_txt(1006), EQP_HEAD_MID); // %d: Mid Headgear
  1798. +		sprintf(atcmd_output, msg_txt(sd->lang,1006), EQP_HEAD_MID); // %d: Mid Headgear
  1799.  		clif_displaymessage(fd, atcmd_output);
  1800.  		return -1;
  1801.  	}
  1802. @@ -2073,11 +2073,11 @@
  1803.  	}
  1804.  
  1805.  	if (count == 0)
  1806. -		clif_displaymessage(fd, msg_txt(166)); // No item has been refined.
  1807. +		clif_displaymessage(fd, msg_txt(sd->lang,166)); // No item has been refined.
  1808.  	else if (count == 1)
  1809. -		clif_displaymessage(fd, msg_txt(167)); // 1 item has been refined.
  1810. +		clif_displaymessage(fd, msg_txt(sd->lang,167)); // 1 item has been refined.
  1811.  	else {
  1812. -		sprintf(atcmd_output, msg_txt(168), count); // %d items have been refined.
  1813. +		sprintf(atcmd_output, msg_txt(sd->lang,168), count); // %d items have been refined.
  1814.  		clif_displaymessage(fd, atcmd_output);
  1815.  	}
  1816.  
  1817. @@ -2102,13 +2102,13 @@
  1818.  		sscanf(message, "\"%99[^\"]\" %d %d", item_name, &attribute, &star) < 1 &&
  1819.  		sscanf(message, "%99s %d %d", item_name, &attribute, &star) < 1
  1820.  	)) {
  1821. -		clif_displaymessage(fd, msg_txt(1007)); // Please enter at least one item name/ID (usage: @produce <equip name/ID> <element> <# of very's>).
  1822. +		clif_displaymessage(fd, msg_txt(sd->lang,1007)); // Please enter at least one item name/ID (usage: @produce <equip name/ID> <element> <# of very's>).
  1823.  		return -1;
  1824.  	}
  1825.  
  1826.  	if ( (item_data = itemdb_searchname(item_name)) == NULL &&
  1827.  		 (item_data = itemdb_exists(atoi(item_name))) == NULL ) {
  1828. -		clif_displaymessage(fd, msg_txt(170)); //This item is not an equipment.
  1829. +		clif_displaymessage(fd, msg_txt(sd->lang,170)); //This item is not an equipment.
  1830.  		return -1;
  1831.  	}
  1832.  
  1833. @@ -2135,7 +2135,7 @@
  1834.  		if ((flag = pc_additem(sd, &tmp_item, 1, LOG_TYPE_COMMAND)))
  1835.  			clif_additem(sd, 0, 0, flag);
  1836.  	} else {
  1837. -		sprintf(atcmd_output, msg_txt(169), item_id, item_data->name); // The item (%d: '%s') is not equipable.
  1838. +		sprintf(atcmd_output, msg_txt(sd->lang,169), item_id, item_data->name); // The item (%d: '%s') is not equipable.
  1839.  		clif_displaymessage(fd, atcmd_output);
  1840.  		return -1;
  1841.  	}
  1842. @@ -2156,13 +2156,13 @@
  1843.  	if( !message || !*message || sscanf(message, "%d", &position) < 1 )
  1844.  	{
  1845.  		int i;
  1846. -		clif_displaymessage(sd->fd,  msg_txt(668));
  1847. +		clif_displaymessage(sd->fd,  msg_txt(sd->lang,668));
  1848.  		for( i = 0; i < MAX_MEMOPOINTS; i++ )
  1849.  		{
  1850.  			if( sd->status.memo_point[i].map )
  1851.  				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);
  1852.  			else
  1853. -				sprintf(atcmd_output, msg_txt(171), i); // %d - void
  1854. +				sprintf(atcmd_output, msg_txt(sd->lang,171), i); // %d - void
  1855.  			clif_displaymessage(sd->fd, atcmd_output);
  1856.   		}
  1857.  		return 0;
  1858. @@ -2170,7 +2170,7 @@
  1859.  
  1860.  	if( position < 0 || position >= MAX_MEMOPOINTS )
  1861.  	{
  1862. -		sprintf(atcmd_output, msg_txt(1008), 0, MAX_MEMOPOINTS-1); // Please enter a valid position (usage: @memo <memo_position:%d-%d>).
  1863. +		sprintf(atcmd_output, msg_txt(sd->lang,1008), 0, MAX_MEMOPOINTS-1); // Please enter a valid position (usage: @memo <memo_position:%d-%d>).
  1864.  		clif_displaymessage(fd, atcmd_output);
  1865.  		return -1;
  1866.  	}
  1867. @@ -2213,7 +2213,7 @@
  1868.  	nullpo_retr(-1, sd);
  1869.  
  1870.  	if (!message || !*message || (i = sscanf(message, "%d %d %d %d %d %d", &type, &flag, &tick, &val1, &val2, &val3)) < 1) {
  1871. -		clif_displaymessage(fd, msg_txt(1009)); // Please enter a status type/flag (usage: @displaystatus <status type> <flag> <tick> {<val1> {<val2> {<val3>}}}).
  1872. +		clif_displaymessage(fd, msg_txt(sd->lang,1009)); // Please enter a status type/flag (usage: @displaystatus <status type> <flag> <tick> {<val1> {<val2> {<val3>}}}).
  1873.  		return -1;
  1874.  	}
  1875.  	if (i < 2) flag = 1;
  1876. @@ -2233,7 +2233,7 @@
  1877.  	unsigned int new_status_point;
  1878.  
  1879.  	if (!message || !*message || (point = atoi(message)) == 0) {
  1880. -		clif_displaymessage(fd, msg_txt(1010)); // Please enter a number (usage: @stpoint <number of points>).
  1881. +		clif_displaymessage(fd, msg_txt(sd->lang,1010)); // Please enter a number (usage: @stpoint <number of points>).
  1882.  		return -1;
  1883.  	}
  1884.  
  1885. @@ -2260,12 +2260,12 @@
  1886.  	if (new_status_point != sd->status.status_point) {
  1887.  		sd->status.status_point = new_status_point;
  1888.  		clif_updatestatus(sd, SP_STATUSPOINT);
  1889. -		clif_displaymessage(fd, msg_txt(174)); // Number of status points changed.
  1890. +		clif_displaymessage(fd, msg_txt(sd->lang,174)); // Number of status points changed.
  1891.  	} else {
  1892.  		if (point < 0)
  1893. -			clif_displaymessage(fd, msg_txt(41)); // Unable to decrease the number/value.
  1894. +			clif_displaymessage(fd, msg_txt(sd->lang,41)); // Unable to decrease the number/value.
  1895.  		else
  1896. -			clif_displaymessage(fd, msg_txt(149)); // Unable to increase the number/value.
  1897. +			clif_displaymessage(fd, msg_txt(sd->lang,149)); // Unable to increase the number/value.
  1898.  		return -1;
  1899.  	}
  1900.  
  1901. @@ -2282,7 +2282,7 @@
  1902.  	nullpo_retr(-1, sd);
  1903.  
  1904.  	if (!message || !*message || (point = atoi(message)) == 0) {
  1905. -		clif_displaymessage(fd, msg_txt(1011)); // Please enter a number (usage: @skpoint <number of points>).
  1906. +		clif_displaymessage(fd, msg_txt(sd->lang,1011)); // Please enter a number (usage: @skpoint <number of points>).
  1907.  		return -1;
  1908.  	}
  1909.  
  1910. @@ -2309,12 +2309,12 @@
  1911.  	if (new_skill_point != sd->status.skill_point) {
  1912.  		sd->status.skill_point = new_skill_point;
  1913.  		clif_updatestatus(sd, SP_SKILLPOINT);
  1914. -		clif_displaymessage(fd, msg_txt(175)); // Number of skill points changed.
  1915. +		clif_displaymessage(fd, msg_txt(sd->lang,175)); // Number of skill points changed.
  1916.  	} else {
  1917.  		if (point < 0)
  1918. -			clif_displaymessage(fd, msg_txt(41)); // Unable to decrease the number/value.
  1919. +			clif_displaymessage(fd, msg_txt(sd->lang,41)); // Unable to decrease the number/value.
  1920.  		else
  1921. -			clif_displaymessage(fd, msg_txt(149)); // Unable to increase the number/value.
  1922. +			clif_displaymessage(fd, msg_txt(sd->lang,149)); // Unable to increase the number/value.
  1923.  		return -1;
  1924.  	}
  1925.  
  1926. @@ -2330,20 +2330,20 @@
  1927.  	nullpo_retr(-1, sd);
  1928.  
  1929.  	if (!message || !*message || (zeny = atoi(message)) == 0) {
  1930. -		clif_displaymessage(fd, msg_txt(1012)); // Please enter an amount (usage: @zeny <amount>).
  1931. +		clif_displaymessage(fd, msg_txt(sd->lang,1012)); // Please enter an amount (usage: @zeny <amount>).
  1932.  		return -1;
  1933.  	}
  1934.  
  1935.  	if(zeny > 0){
  1936.  	    if((ret=pc_getzeny(sd,zeny,LOG_TYPE_COMMAND,NULL)) == 1)
  1937. -		clif_displaymessage(fd, msg_txt(149)); // Unable to increase the number/value.
  1938. +		clif_displaymessage(fd, msg_txt(sd->lang,149)); // Unable to increase the number/value.
  1939.  	}
  1940.  	else {
  1941.  	    if( sd->status.zeny < -zeny ) zeny = -sd->status.zeny;
  1942.  	    if((ret=pc_payzeny(sd,-zeny,LOG_TYPE_COMMAND,NULL)) == 1)
  1943. -		clif_displaymessage(fd, msg_txt(41)); // Unable to decrease the number/value.
  1944. +		clif_displaymessage(fd, msg_txt(sd->lang,41)); // Unable to decrease the number/value.
  1945.  	}
  1946. -	if(!ret) clif_displaymessage(fd, msg_txt(176)); //ret=0 mean cmd success
  1947. +	if(!ret) clif_displaymessage(fd, msg_txt(sd->lang,176)); //ret=0 mean cmd success
  1948.  	return 0;
  1949.  }
  1950.  
  1951. @@ -2361,14 +2361,14 @@
  1952.  	memset(atcmd_output, '\0', sizeof(atcmd_output));
  1953.  
  1954.  	if (!message || !*message || sscanf(message, "%d", &value) < 1 || value == 0) {
  1955. -		clif_displaymessage(fd, msg_txt(1013)); // Please enter a valid value (usage: @str/@agi/@vit/@int/@dex/@luk <+/-adjustment>).
  1956. +		clif_displaymessage(fd, msg_txt(sd->lang,1013)); // Please enter a valid value (usage: @str/@agi/@vit/@int/@dex/@luk <+/-adjustment>).
  1957.  		return -1;
  1958.  	}
  1959.  
  1960.  	ARR_FIND( 0, ARRAYLENGTH(param), i, strcmpi(command+1, param[i]) == 0 );
  1961.  
  1962.  	if( i == ARRAYLENGTH(param) || i > MAX_STATUS_TYPE) { // normally impossible...
  1963. -		clif_displaymessage(fd, msg_txt(1013)); // Please enter a valid value (usage: @str/@agi/@vit/@int/@dex/@luk <+/-adjustment>).
  1964. +		clif_displaymessage(fd, msg_txt(sd->lang,1013)); // Please enter a valid value (usage: @str/@agi/@vit/@int/@dex/@luk <+/-adjustment>).
  1965.  		return -1;
  1966.  	}
  1967.  
  1968. @@ -2397,12 +2397,12 @@
  1969.  		clif_updatestatus(sd, SP_STR + i);
  1970.  		clif_updatestatus(sd, SP_USTR + i);
  1971.  		status_calc_pc(sd, 0);
  1972. -		clif_displaymessage(fd, msg_txt(42)); // Stat changed.
  1973. +		clif_displaymessage(fd, msg_txt(sd->lang,42)); // Stat changed.
  1974.  	} else {
  1975.  		if (value < 0)
  1976. -			clif_displaymessage(fd, msg_txt(41)); // Unable to decrease the number/value.
  1977. +			clif_displaymessage(fd, msg_txt(sd->lang,41)); // Unable to decrease the number/value.
  1978.  		else
  1979. -			clif_displaymessage(fd, msg_txt(149)); // Unable to increase the number/value.
  1980. +			clif_displaymessage(fd, msg_txt(sd->lang,149)); // Unable to increase the number/value.
  1981.  		return -1;
  1982.  	}
  1983.  
  1984. @@ -2456,12 +2456,12 @@
  1985.  
  1986.  	if (count > 0) { // if at least 1 stat modified
  1987.  		status_calc_pc(sd, 0);
  1988. -		clif_displaymessage(fd, msg_txt(84)); // All stats changed!
  1989. +		clif_displaymessage(fd, msg_txt(sd->lang,84)); // All stats changed!
  1990.  	} else {
  1991.  		if (value < 0)
  1992. -			clif_displaymessage(fd, msg_txt(177)); // You cannot decrease that stat anymore.
  1993. +			clif_displaymessage(fd, msg_txt(sd->lang,177)); // You cannot decrease that stat anymore.
  1994.  		else
  1995. -			clif_displaymessage(fd, msg_txt(178)); // You cannot increase that stat anymore.
  1996. +			clif_displaymessage(fd, msg_txt(sd->lang,178)); // You cannot increase that stat anymore.
  1997.  		return -1;
  1998.  	}
  1999.  
  2000. @@ -2479,16 +2479,16 @@
  2001.  	nullpo_retr(-1, sd);
  2002.  
  2003.  	if (!message || !*message || sscanf(message, "%d", &level) < 1 || level == 0) {
  2004. -		clif_displaymessage(fd, msg_txt(1014)); // Please enter a valid level (usage: @guildlvup/@guildlvlup <# of levels>).
  2005. +		clif_displaymessage(fd, msg_txt(sd->lang,1014)); // Please enter a valid level (usage: @guildlvup/@guildlvlup <# of levels>).
  2006.  		return -1;
  2007.  	}
  2008.  
  2009.  	if (sd->status.guild_id <= 0 || (guild_info = guild_search(sd->status.guild_id)) == NULL) {
  2010. -		clif_displaymessage(fd, msg_txt(43)); // You're not in a guild.
  2011. +		clif_displaymessage(fd, msg_txt(sd->lang,43)); // You're not in a guild.
  2012.  		return -1;
  2013.  	}
  2014.  	//if (strcmp(sd->status.name, guild_info->master) != 0) {
  2015. -	//	clif_displaymessage(fd, msg_txt(44)); // You're not the master of your guild.
  2016. +	//	clif_displaymessage(fd, msg_txt(sd->lang,44)); // You're not the master of your guild.
  2017.  	//	return -1;
  2018.  	//}
  2019.  
  2020. @@ -2500,9 +2500,9 @@
  2021.  
  2022.  	if (added_level != 0) {
  2023.  		intif_guild_change_basicinfo(guild_info->guild_id, GBI_GUILDLV, &added_level, sizeof(added_level));
  2024. -		clif_displaymessage(fd, msg_txt(179)); // Guild level changed.
  2025. +		clif_displaymessage(fd, msg_txt(sd->lang,179)); // Guild level changed.
  2026.  	} else {
  2027. -		clif_displaymessage(fd, msg_txt(45)); // Guild level change failed.
  2028. +		clif_displaymessage(fd, msg_txt(sd->lang,45)); // Guild level change failed.
  2029.  		return -1;
  2030.  	}
  2031.  
  2032. @@ -2519,7 +2519,7 @@
  2033.  	nullpo_retr(-1, sd);
  2034.  
  2035.  	if (!message || !*message) {
  2036. -		clif_displaymessage(fd, msg_txt(1015)); // Please enter a monster/egg name/ID (usage: @makeegg <pet>).
  2037. +		clif_displaymessage(fd, msg_txt(sd->lang,1015)); // Please enter a monster/egg name/ID (usage: @makeegg <pet>).
  2038.  		return -1;
  2039.  	}
  2040.  
  2041. @@ -2542,7 +2542,7 @@
  2042.  			(short)pet_db[pet_id].EggID, 0, (short)pet_db[pet_id].intimate,
  2043.  			100, 0, 1, pet_db[pet_id].jname);
  2044.  	} else {
  2045. -		clif_displaymessage(fd, msg_txt(180)); // The monster/egg name/id doesn't exist.
  2046. +		clif_displaymessage(fd, msg_txt(sd->lang,180)); // The monster/egg name/id doesn't exist.
  2047.  		return -1;
  2048.  	}
  2049.  
  2050. @@ -2558,7 +2558,7 @@
  2051.  	if (sd->status.pet_id <= 0)
  2052.  		clif_sendegg(sd);
  2053.  	else {
  2054. -		clif_displaymessage(fd, msg_txt(181)); // You already have a pet.
  2055. +		clif_displaymessage(fd, msg_txt(sd->lang,181)); // You already have a pet.
  2056.  		return -1;
  2057.  	}
  2058.  
  2059. @@ -2575,30 +2575,30 @@
  2060.  	nullpo_retr(-1, sd);
  2061.  
  2062.  	if (!message || !*message || (friendly = atoi(message)) < 0) {
  2063. -		clif_displaymessage(fd, msg_txt(1016)); // Please enter a valid value (usage: @petfriendly <0-1000>).
  2064. +		clif_displaymessage(fd, msg_txt(sd->lang,1016)); // Please enter a valid value (usage: @petfriendly <0-1000>).
  2065.  		return -1;
  2066.  	}
  2067.  
  2068.  	pd = sd->pd;
  2069.  	if (!pd) {
  2070. -		clif_displaymessage(fd, msg_txt(184)); // Sorry, but you have no pet.
  2071. +		clif_displaymessage(fd, msg_txt(sd->lang,184)); // Sorry, but you have no pet.
  2072.  		return -1;
  2073.  	}
  2074.  
  2075.  	if (friendly < 0 || friendly > 1000)
  2076.  	{
  2077. -		clif_displaymessage(fd, msg_txt(37)); // An invalid number was specified.
  2078. +		clif_displaymessage(fd, msg_txt(sd->lang,37)); // An invalid number was specified.
  2079.  		return -1;
  2080.  	}
  2081.  
  2082.  	if (friendly == pd->pet.intimate) {
  2083. -		clif_displaymessage(fd, msg_txt(183)); // Pet intimacy is already at maximum.
  2084. +		clif_displaymessage(fd, msg_txt(sd->lang,183)); // Pet intimacy is already at maximum.
  2085.  		return -1;
  2086.  	}
  2087.  
  2088.  	pet_set_intimate(pd, friendly);
  2089.  	clif_send_petstatus(sd);
  2090. -	clif_displaymessage(fd, msg_txt(182)); // Pet intimacy changed.
  2091. +	clif_displaymessage(fd, msg_txt(sd->lang,182)); // Pet intimacy changed.
  2092.  	return 0;
  2093.  }
  2094.  
  2095. @@ -2612,27 +2612,27 @@
  2096.  	nullpo_retr(-1, sd);
  2097.  
  2098.  	if (!message || !*message || (hungry = atoi(message)) < 0) {
  2099. -		clif_displaymessage(fd, msg_txt(1017)); // Please enter a valid number (usage: @pethungry <0-100>).
  2100. +		clif_displaymessage(fd, msg_txt(sd->lang,1017)); // Please enter a valid number (usage: @pethungry <0-100>).
  2101.  		return -1;
  2102.  	}
  2103.  
  2104.  	pd = sd->pd;
  2105.  	if (!sd->status.pet_id || !pd) {
  2106. -		clif_displaymessage(fd, msg_txt(184)); // Sorry, but you have no pet.
  2107. +		clif_displaymessage(fd, msg_txt(sd->lang,184)); // Sorry, but you have no pet.
  2108.  		return -1;
  2109.  	}
  2110.  	if (hungry < 0 || hungry > 100) {
  2111. -		clif_displaymessage(fd, msg_txt(37)); // An invalid number was specified.
  2112. +		clif_displaymessage(fd, msg_txt(sd->lang,37)); // An invalid number was specified.
  2113.  		return -1;
  2114.  	}
  2115.  	if (hungry == pd->pet.hungry) {
  2116. -		clif_displaymessage(fd, msg_txt(186)); // Pet hunger is already at maximum.
  2117. +		clif_displaymessage(fd, msg_txt(sd->lang,186)); // Pet hunger is already at maximum.
  2118.  		return -1;
  2119.  	}
  2120.  
  2121.  	pd->pet.hungry = hungry;
  2122.  	clif_send_petstatus(sd);
  2123. -	clif_displaymessage(fd, msg_txt(185)); // Pet hunger changed.
  2124. +	clif_displaymessage(fd, msg_txt(sd->lang,185)); // Pet hunger changed.
  2125.  
  2126.  	return 0;
  2127.  }
  2128. @@ -2645,19 +2645,19 @@
  2129.  	struct pet_data *pd;
  2130.  	nullpo_retr(-1, sd);
  2131.  	if (!sd->status.pet_id || !sd->pd) {
  2132. -		clif_displaymessage(fd, msg_txt(184)); // Sorry, but you have no pet.
  2133. +		clif_displaymessage(fd, msg_txt(sd->lang,184)); // Sorry, but you have no pet.
  2134.  		return -1;
  2135.  	}
  2136.  	pd = sd->pd;
  2137.  	if (!pd->pet.rename_flag) {
  2138. -		clif_displaymessage(fd, msg_txt(188)); // You can already rename your pet.
  2139. +		clif_displaymessage(fd, msg_txt(sd->lang,188)); // You can already rename your pet.
  2140.  		return -1;
  2141.  	}
  2142.  
  2143.  	pd->pet.rename_flag = 0;
  2144.  	intif_save_petdata(sd->status.account_id, &pd->pet);
  2145.  	clif_send_petstatus(sd);
  2146. -	clif_displaymessage(fd, msg_txt(187)); // You can now rename your pet.
  2147. +	clif_displaymessage(fd, msg_txt(sd->lang,187)); // You can now rename your pet.
  2148.  
  2149.  	return 0;
  2150.  }
  2151. @@ -2671,35 +2671,35 @@
  2152.  	nullpo_retr(-1, sd);
  2153.  
  2154.  	if (!message || !*message) {
  2155. -		clif_displaymessage(fd, msg_txt(1018)); // Please enter a player name (usage: @recall <char name/ID>).
  2156. +		clif_displaymessage(fd, msg_txt(sd->lang,1018)); // Please enter a player name (usage: @recall <char name/ID>).
  2157.  		return -1;
  2158.  	}
  2159.  
  2160.  	if((pl_sd=map_nick2sd((char *)message)) == NULL && (pl_sd=map_charid2sd(atoi(message))) == NULL)
  2161.  	{
  2162. -		clif_displaymessage(fd, msg_txt(3)); // Character not found.
  2163. +		clif_displaymessage(fd, msg_txt(sd->lang,3)); // Character not found.
  2164.  		return -1;
  2165.  	}
  2166.  
  2167.  	if ( pc_get_group_level(sd) < pc_get_group_level(pl_sd) )
  2168.  	{
  2169. -		clif_displaymessage(fd, msg_txt(81)); // Your GM level doesn't authorize you to preform this action on the specified player.
  2170. +		clif_displaymessage(fd, msg_txt(sd->lang,81)); // Your GM level doesn't authorize you to preform this action on the specified player.
  2171.  		return -1;
  2172.  	}
  2173.  
  2174.  	if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
  2175. -		clif_displaymessage(fd, msg_txt(1019)); // You are not authorized to warp someone to this map.
  2176. +		clif_displaymessage(fd, msg_txt(sd->lang,1019)); // You are not authorized to warp someone to this map.
  2177.  		return -1;
  2178.  	}
  2179.  	if (pl_sd->bl.m >= 0 && map[pl_sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
  2180. -		clif_displaymessage(fd, msg_txt(1020)); // You are not authorized to warp this player from their map.
  2181. +		clif_displaymessage(fd, msg_txt(sd->lang,1020)); // You are not authorized to warp this player from their map.
  2182.  		return -1;
  2183.  	}
  2184.  	if (pl_sd->bl.m == sd->bl.m && pl_sd->bl.x == sd->bl.x && pl_sd->bl.y == sd->bl.y) {
  2185.  		return -1;
  2186.  	}
  2187.  	pc_setpos(pl_sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_RESPAWN);
  2188. -	sprintf(atcmd_output, msg_txt(46), pl_sd->status.name); // %s recalled!
  2189. +	sprintf(atcmd_output, msg_txt(sd->lang,46), pl_sd->status.name); // %s recalled!
  2190.  	clif_displaymessage(fd, atcmd_output);
  2191.  
  2192.  	return 0;
  2193. @@ -2716,12 +2716,12 @@
  2194.  	memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
  2195.  
  2196.  	if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
  2197. -		clif_displaymessage(fd, msg_txt(1021)); // Please enter a player name (usage: @charblock/@block <char name>).
  2198. +		clif_displaymessage(fd, msg_txt(sd->lang,1021)); // Please enter a player name (usage: @charblock/@block <char name>).
  2199.  		return -1;
  2200.  	}
  2201.  
  2202.  	chrif_char_ask_name(sd->status.account_id, atcmd_player_name, 1, 0, 0, 0, 0, 0, 0); // type: 1 - block
  2203. -	clif_displaymessage(fd, msg_txt(88)); // Character name sent to char-server to ask it.
  2204. +	clif_displaymessage(fd, msg_txt(sd->lang,88)); // Character name sent to char-server to ask it.
  2205.  
  2206.  	return 0;
  2207.  }
  2208. @@ -2753,7 +2753,7 @@
  2209.  	memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
  2210.  
  2211.  	if (!message || !*message || sscanf(message, "%255s %23[^\n]", atcmd_output, atcmd_player_name) < 2) {
  2212. -		clif_displaymessage(fd, msg_txt(1022)); // Please enter ban time and a player name (usage: @charban/@ban/@banish/@charbanish <time> <char name>).
  2213. +		clif_displaymessage(fd, msg_txt(sd->lang,1022)); // Please enter ban time and a player name (usage: @charban/@ban/@banish/@charbanish <time> <char name>).
  2214.  		return -1;
  2215.  	}
  2216.  
  2217. @@ -2797,7 +2797,7 @@
  2218.  		}
  2219.  	}
  2220.  	if (year == 0 && month == 0 && day == 0 && hour == 0 && minute == 0 && second == 0) {
  2221. -		clif_displaymessage(fd, msg_txt(85)); // Invalid time for ban command.
  2222. +		clif_displaymessage(fd, msg_txt(sd->lang,85)); // Invalid time for ban command.
  2223.  		return -1;
  2224.  	}
  2225.  	/**
  2226. @@ -2813,12 +2813,12 @@
  2227.  	tmtime->tm_sec  = tmtime->tm_sec + second;
  2228.  	timestamp = mktime(tmtime);
  2229.  	if( timestamp <= time(NULL) && !pc_can_use_command(sd, "unban", COMMAND_ATCOMMAND) ) {
  2230. -		clif_displaymessage(fd,msg_txt(1023)); // You are not allowed to reduce the length of a ban.
  2231. +		clif_displaymessage(fd,msg_txt(sd->lang,1023)); // You are not allowed to reduce the length of a ban.
  2232.  		return -1;
  2233.  	}
  2234.  
  2235.  	chrif_char_ask_name(sd->status.account_id, atcmd_player_name, 2, year, month, day, hour, minute, second); // type: 2 - ban
  2236. -	clif_displaymessage(fd, msg_txt(88)); // Character name sent to char-server to ask it.
  2237. +	clif_displaymessage(fd, msg_txt(sd->lang,88)); // Character name sent to char-server to ask it.
  2238.  
  2239.  	return 0;
  2240.  }
  2241. @@ -2833,13 +2833,13 @@
  2242.  	memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
  2243.  
  2244.  	if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
  2245. -		clif_displaymessage(fd, msg_txt(1024)); // Please enter a player name (usage: @charunblock <char name>).
  2246. +		clif_displaymessage(fd, msg_txt(sd->lang,1024)); // Please enter a player name (usage: @charunblock <char name>).
  2247.  		return -1;
  2248.  	}
  2249.  
  2250.  	// send answer to login server via char-server
  2251.  	chrif_char_ask_name(sd->status.account_id, atcmd_player_name, 3, 0, 0, 0, 0, 0, 0); // type: 3 - unblock
  2252. -	clif_displaymessage(fd, msg_txt(88)); // Character name sent to char-server to ask it.
  2253. +	clif_displaymessage(fd, msg_txt(sd->lang,88)); // Character name sent to char-server to ask it.
  2254.  
  2255.  	return 0;
  2256.  }
  2257. @@ -2854,13 +2854,13 @@
  2258.  	memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
  2259.  
  2260.  	if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
  2261. -		clif_displaymessage(fd, msg_txt(1025)); // Please enter a player name (usage: @charunban <char name>).
  2262. +		clif_displaymessage(fd, msg_txt(sd->lang,1025)); // Please enter a player name (usage: @charunban <char name>).
  2263.  		return -1;
  2264.  	}
  2265.  
  2266.  	// send answer to login server via char-server
  2267.  	chrif_char_ask_name(sd->status.account_id, atcmd_player_name, 4, 0, 0, 0, 0, 0, 0); // type: 4 - unban
  2268. -	clif_displaymessage(fd, msg_txt(88)); // Character name sent to char-server to ask it.
  2269. +	clif_displaymessage(fd, msg_txt(sd->lang,88)); // Character name sent to char-server to ask it.
  2270.  
  2271.  	return 0;
  2272.  }
  2273. @@ -2875,7 +2875,7 @@
  2274.  	if (night_flag != 1) {
  2275.  		map_night_timer(night_timer_tid, 0, 0, 1);
  2276.  	} else {
  2277. -		clif_displaymessage(fd, msg_txt(89)); // Night mode is already enabled.
  2278. +		clif_displaymessage(fd, msg_txt(sd->lang,89)); // Night mode is already enabled.
  2279.  		return -1;
  2280.  	}
  2281.  
  2282. @@ -2892,7 +2892,7 @@
  2283.  	if (night_flag != 0) {
  2284.  		map_day_timer(day_timer_tid, 0, 0, 1);
  2285.  	} else {
  2286. -		clif_displaymessage(fd, msg_txt(90)); // Day mode is already enabled.
  2287. +		clif_displaymessage(fd, msg_txt(sd->lang,90)); // Day mode is already enabled.
  2288.  		return -1;
  2289.  	}
  2290.  
  2291. @@ -2916,12 +2916,12 @@
  2292.  		{
  2293.  			status_kill(&pl_sd->bl);
  2294.  			clif_specialeffect(&pl_sd->bl,450,AREA);
  2295. -			clif_displaymessage(pl_sd->fd, msg_txt(61)); // The holy messenger has given judgement.
  2296. +			clif_displaymessage(pl_sd->fd, msg_txt(sd->lang,61)); // The holy messenger has given judgement.
  2297.  		}
  2298.  	}
  2299.  	mapit_free(iter);
  2300.  
  2301. -	clif_displaymessage(fd, msg_txt(62)); // Judgement was made.
  2302. +	clif_displaymessage(fd, msg_txt(sd->lang,62)); // Judgement was made.
  2303.  
  2304.  	return 0;
  2305.  }
  2306. @@ -2943,12 +2943,12 @@
  2307.  		{
  2308.  			status_kill(&pl_sd->bl);
  2309.  			clif_specialeffect(&pl_sd->bl,450,AREA);
  2310. -			clif_displaymessage(pl_sd->fd, msg_txt(61)); // The holy messenger has given judgement.
  2311. +			clif_displaymessage(pl_sd->fd, msg_txt(sd->lang,61)); // The holy messenger has given judgement.
  2312.  		}
  2313.  	}
  2314.  	mapit_free(iter);
  2315.  
  2316. -	clif_displaymessage(fd, msg_txt(62)); // Judgement was made.
  2317. +	clif_displaymessage(fd, msg_txt(sd->lang,62)); // Judgement was made.
  2318.  
  2319.  	return 0;
  2320.  }
  2321. @@ -2961,7 +2961,7 @@
  2322.  	status_revive(&sd->bl, 100, 100);
  2323.  
  2324.  	clif_skill_nodamage(&sd->bl,&sd->bl,ALL_RESURRECTION,4,1);
  2325. -	clif_displaymessage(sd->fd, msg_txt(63)); // Mercy has been shown.
  2326. +	clif_displaymessage(sd->fd, msg_txt(sd->lang,63)); // Mercy has been shown.
  2327.  }
  2328.  
  2329.  /*==========================================
  2330. @@ -2980,7 +2980,7 @@
  2331.  			atcommand_raise_sub(pl_sd);
  2332.  	mapit_free(iter);
  2333.  
  2334. -	clif_displaymessage(fd, msg_txt(64)); // Mercy has been granted.
  2335. +	clif_displaymessage(fd, msg_txt(sd->lang,64)); // Mercy has been granted.
  2336.  
  2337.  	return 0;
  2338.  }
  2339. @@ -3001,7 +3001,7 @@
  2340.  			atcommand_raise_sub(pl_sd);
  2341.  	mapit_free(iter);
  2342.  
  2343. -	clif_displaymessage(fd, msg_txt(64)); // Mercy has been granted.
  2344. +	clif_displaymessage(fd, msg_txt(sd->lang,64)); // Mercy has been granted.
  2345.  
  2346.  	return 0;
  2347.  }
  2348. @@ -3017,19 +3017,19 @@
  2349.  	memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
  2350.  
  2351.  	if (!message || !*message) {
  2352. -		clif_displaymessage(fd, msg_txt(1026)); // Please enter a player name (usage: @kick <char name/ID>).
  2353. +		clif_displaymessage(fd, msg_txt(sd->lang,1026)); // Please enter a player name (usage: @kick <char name/ID>).
  2354.  		return -1;
  2355.  	}
  2356.  
  2357.  	if((pl_sd=map_nick2sd((char *)message)) == NULL && (pl_sd=map_charid2sd(atoi(message))) == NULL)
  2358.  	{
  2359. -		clif_displaymessage(fd, msg_txt(3)); // Character not found.
  2360. +		clif_displaymessage(fd, msg_txt(sd->lang,3)); // Character not found.
  2361.  		return -1;
  2362.  	}
  2363.  
  2364.  	if ( pc_get_group_level(sd) < pc_get_group_level(pl_sd) )
  2365.  	{
  2366. -		clif_displaymessage(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player.
  2367. +		clif_displaymessage(fd, msg_txt(sd->lang,81)); // Your GM level don't authorise you to do this action on this player.
  2368.  		return -1;
  2369.  	}
  2370.  
  2371. @@ -3057,7 +3057,7 @@
  2372.  	}
  2373.  	mapit_free(iter);
  2374.  
  2375. -	clif_displaymessage(fd, msg_txt(195)); // All players have been kicked!
  2376. +	clif_displaymessage(fd, msg_txt(sd->lang,195)); // All players have been kicked!
  2377.  
  2378.  	return 0;
  2379.  }
  2380. @@ -3071,7 +3071,7 @@
  2381.  	pc_allskillup(sd); // all skills
  2382.  	sd->status.skill_point = 0; // 0 skill points
  2383.  	clif_updatestatus(sd, SP_SKILLPOINT); // update
  2384. -	clif_displaymessage(fd, msg_txt(76)); // All skills have been added to your skill tree.
  2385. +	clif_displaymessage(fd, msg_txt(sd->lang,76)); // All skills have been added to your skill tree.
  2386.  
  2387.  	return 0;
  2388.  }
  2389. @@ -3092,7 +3092,7 @@
  2390.  		text = atcommand_help_string( command );
  2391.  
  2392.  		// send the error message as always
  2393. -		clif_displaymessage(fd, msg_txt(1027)); // Please enter a quest skill number.
  2394. +		clif_displaymessage(fd, msg_txt(sd->lang,1027)); // Please enter a quest skill number.
  2395.  
  2396.  		if( text )
  2397.  		{// send the skill ID list associated with this command
  2398. @@ -3102,20 +3102,20 @@
  2399.  		return -1;
  2400.  	}
  2401.  	if (skill_id >= MAX_SKILL_DB) {
  2402. -		clif_displaymessage(fd, msg_txt(198)); // This skill number doesn't exist.
  2403. +		clif_displaymessage(fd, msg_txt(sd->lang,198)); // This skill number doesn't exist.
  2404.  		return -1;
  2405.  	}
  2406.  	if (!(skill_get_inf2(skill_id) & INF2_QUEST_SKILL)) {
  2407. -		clif_displaymessage(fd, msg_txt(197)); // This skill number doesn't exist or isn't a quest skill.
  2408. +		clif_displaymessage(fd, msg_txt(sd->lang,197)); // This skill number doesn't exist or isn't a quest skill.
  2409.  		return -1;
  2410.  	}
  2411.  	if (pc_checkskill(sd, skill_id) > 0) {
  2412. -		clif_displaymessage(fd, msg_txt(196)); // You already have this quest skill.
  2413. +		clif_displaymessage(fd, msg_txt(sd->lang,196)); // You already have this quest skill.
  2414.  		return -1;
  2415.  	}
  2416.  
  2417.  	pc_skill(sd, skill_id, 1, 0);
  2418. -	clif_displaymessage(fd, msg_txt(70)); // You have learned the skill.
  2419. +	clif_displaymessage(fd, msg_txt(sd->lang,70)); // You have learned the skill.
  2420.  
  2421.  	return 0;
  2422.  }
  2423. @@ -3136,7 +3136,7 @@
  2424.  		text = atcommand_help_string( command );
  2425.  
  2426.  		// send the error message as always
  2427. -		clif_displaymessage(fd, msg_txt(1027)); // Please enter a quest skill number.
  2428. +		clif_displaymessage(fd, msg_txt(sd->lang,1027)); // Please enter a quest skill number.
  2429.  
  2430.  		if( text )
  2431.  		{// send the skill ID list associated with this command
  2432. @@ -3146,22 +3146,22 @@
  2433.  		return -1;
  2434.  	}
  2435.  	if (skill_id >= MAX_SKILL) {
  2436. -		clif_displaymessage(fd, msg_txt(198)); // This skill number doesn't exist.
  2437. +		clif_displaymessage(fd, msg_txt(sd->lang,198)); // This skill number doesn't exist.
  2438.  		return -1;
  2439.  	}
  2440.  	if (!(skill_get_inf2(skill_id) & INF2_QUEST_SKILL)) {
  2441. -		clif_displaymessage(fd, msg_txt(197)); // This skill number doesn't exist or isn't a quest skill.
  2442. +		clif_displaymessage(fd, msg_txt(sd->lang,197)); // This skill number doesn't exist or isn't a quest skill.
  2443.  		return -1;
  2444.  	}
  2445.  	if (pc_checkskill(sd, skill_id) == 0) {
  2446. -		clif_displaymessage(fd, msg_txt(201)); // You don't have this quest skill.
  2447. +		clif_displaymessage(fd, msg_txt(sd->lang,201)); // You don't have this quest skill.
  2448.  		return -1;
  2449.  	}
  2450.  
  2451.  	sd->status.skill[skill_id].lv = 0;
  2452.  	sd->status.skill[skill_id].flag = 0;
  2453.  	clif_deleteskill(sd,skill_id);
  2454. -	clif_displaymessage(fd, msg_txt(71)); // You have forgotten the skill.
  2455. +	clif_displaymessage(fd, msg_txt(sd->lang,71)); // You have forgotten the skill.
  2456.  
  2457.  	return 0;
  2458.  }
  2459. @@ -3180,7 +3180,7 @@
  2460.  	if( !message || !*message || (number = atoi(message)) < 0 || number > max_spiritballs )
  2461.  	{
  2462.  		char msg[CHAT_SIZE_MAX];
  2463. -		safesnprintf(msg, sizeof(msg), msg_txt(1028), max_spiritballs); // Please enter a party name (usage: @party <party_name>).
  2464. +		safesnprintf(msg, sizeof(msg), msg_txt(sd->lang,1028), max_spiritballs); // Please enter a party name (usage: @party <party_name>).
  2465.  		clif_displaymessage(fd, msg);
  2466.  		return -1;
  2467.  	}
  2468. @@ -3205,7 +3205,7 @@
  2469.  	memset(party, '\0', sizeof(party));
  2470.  
  2471.  	if (!message || !*message || sscanf(message, "%23[^\n]", party) < 1) {
  2472. -		clif_displaymessage(fd, msg_txt(1029)); // Please enter a party name (usage: @party <party_name>).
  2473. +		clif_displaymessage(fd, msg_txt(sd->lang,1029)); // Please enter a party name (usage: @party <party_name>).
  2474.  		return -1;
  2475.  	}
  2476.  
  2477. @@ -3226,7 +3226,7 @@
  2478.  	memset(guild, '\0', sizeof(guild));
  2479.  
  2480.  	if (!message || !*message || sscanf(message, "%23[^\n]", guild) < 1) {
  2481. -		clif_displaymessage(fd, msg_txt(1030)); // Please enter a guild name (usage: @guild <guild_name>).
  2482. +		clif_displaymessage(fd, msg_txt(sd->lang,1030)); // Please enter a guild name (usage: @guild <guild_name>).
  2483.  		return -1;
  2484.  	}
  2485.  
  2486. @@ -3255,15 +3255,15 @@
  2487.  					return -1; // Something went wrong
  2488.  				}
  2489.  			} else { // Not guild master
  2490. -				clif_displaymessage(fd, msg_txt(1181)); // You need to be a Guild Master to use this command.
  2491. +				clif_displaymessage(fd, msg_txt(sd->lang,1181)); // You need to be a Guild Master to use this command.
  2492.  				return -1;
  2493.  			}
  2494.  		} else { // Guild was not found. HOW?
  2495. -			clif_displaymessage(fd, msg_txt(252)); // You are not in a guild.
  2496. +			clif_displaymessage(fd, msg_txt(sd->lang,252)); // You are not in a guild.
  2497.  			return -1;
  2498.  		}
  2499.  	} else { // Player does not have a guild
  2500. -		clif_displaymessage(fd, msg_txt(252)); // You are not in a guild.
  2501. +		clif_displaymessage(fd, msg_txt(sd->lang,252)); // You are not in a guild.
  2502.  		return -1;
  2503.  	}
  2504.  	return 0;
  2505. @@ -3276,13 +3276,13 @@
  2506.  {
  2507.  	nullpo_retr(-1, sd);
  2508.  	if (agit_flag == 1) {
  2509. -		clif_displaymessage(fd, msg_txt(73)); // War of Emperium is currently in progress.
  2510. +		clif_displaymessage(fd, msg_txt(sd->lang,73)); // War of Emperium is currently in progress.
  2511.  		return -1;
  2512.  	}
  2513.  
  2514.  	agit_flag = 1;
  2515.  	guild_agit_start();
  2516. -	clif_displaymessage(fd, msg_txt(72)); // War of Emperium has been initiated.
  2517. +	clif_displaymessage(fd, msg_txt(sd->lang,72)); // War of Emperium has been initiated.
  2518.  
  2519.  	return 0;
  2520.  }
  2521. @@ -3294,13 +3294,13 @@
  2522.  {
  2523.  	nullpo_retr(-1, sd);
  2524.  	if (agit2_flag == 1) {
  2525. -		clif_displaymessage(fd, msg_txt(404)); // "War of Emperium SE is currently in progress."
  2526. +		clif_displaymessage(fd, msg_txt(sd->lang,404)); // "War of Emperium SE is currently in progress."
  2527.  		return -1;
  2528.  	}
  2529.  
  2530.  	agit2_flag = 1;
  2531.  	guild_agit2_start();
  2532. -	clif_displaymessage(fd, msg_txt(403)); // "War of Emperium SE has been initiated."
  2533. +	clif_displaymessage(fd, msg_txt(sd->lang,403)); // "War of Emperium SE has been initiated."
  2534.  
  2535.  	return 0;
  2536.  }
  2537. @@ -3312,13 +3312,13 @@
  2538.  {
  2539.  	nullpo_retr(-1, sd);
  2540.  	if (agit_flag == 0) {
  2541. -		clif_displaymessage(fd, msg_txt(75)); // War of Emperium is currently not in progress.
  2542. +		clif_displaymessage(fd, msg_txt(sd->lang,75)); // War of Emperium is currently not in progress.
  2543.  		return -1;
  2544.  	}
  2545.  
  2546.  	agit_flag = 0;
  2547.  	guild_agit_end();
  2548. -	clif_displaymessage(fd, msg_txt(74)); // War of Emperium has been ended.
  2549. +	clif_displaymessage(fd, msg_txt(sd->lang,74)); // War of Emperium has been ended.
  2550.  
  2551.  	return 0;
  2552.  }
  2553. @@ -3330,13 +3330,13 @@
  2554.  {
  2555.  	nullpo_retr(-1, sd);
  2556.  	if (agit2_flag == 0) {
  2557. -		clif_displaymessage(fd, msg_txt(406)); // "War of Emperium SE is currently not in progress."
  2558. +		clif_displaymessage(fd, msg_txt(sd->lang,406)); // "War of Emperium SE is currently not in progress."
  2559.  		return -1;
  2560.  	}
  2561.  
  2562.  	agit2_flag = 0;
  2563.  	guild_agit2_end();
  2564. -	clif_displaymessage(fd, msg_txt(405)); // "War of Emperium SE has been ended."
  2565. +	clif_displaymessage(fd, msg_txt(sd->lang,405)); // "War of Emperium SE has been ended."
  2566.  
  2567.  	return 0;
  2568.  }
  2569. @@ -3366,23 +3366,23 @@
  2570.  	memset(atcmd_output, '\0', sizeof(atcmd_output));
  2571.  
  2572.  	if (!message || !*message || sscanf(message, "%99s", item_name) < 0) {
  2573. -		clif_displaymessage(fd, msg_txt(1031)); // Please enter part of an item name (usage: @idsearch <part_of_item_name>).
  2574. +		clif_displaymessage(fd, msg_txt(sd->lang,1031)); // Please enter part of an item name (usage: @idsearch <part_of_item_name>).
  2575.  		return -1;
  2576.  	}
  2577.  
  2578. -	sprintf(atcmd_output, msg_txt(77), item_name); // The reference result of '%s' (name: id):
  2579. +	sprintf(atcmd_output, msg_txt(sd->lang,77), item_name); // The reference result of '%s' (name: id):
  2580.  	clif_displaymessage(fd, atcmd_output);
  2581.  	match = itemdb_searchname_array(item_array, MAX_SEARCH, item_name);
  2582.  	if (match > MAX_SEARCH) {
  2583. -		sprintf(atcmd_output, msg_txt(269), MAX_SEARCH, match);
  2584. +		sprintf(atcmd_output, msg_txt(sd->lang,269), MAX_SEARCH, match);
  2585.  		clif_displaymessage(fd, atcmd_output);
  2586.  		match = MAX_SEARCH;
  2587.  	}
  2588.  	for(i = 0; i < match; i++) {
  2589. -		sprintf(atcmd_output, msg_txt(78), item_array[i]->jname, item_array[i]->nameid); // %s: %d
  2590. +		sprintf(atcmd_output, msg_txt(sd->lang,78), item_array[i]->jname, item_array[i]->nameid); // %s: %d
  2591.  		clif_displaymessage(fd, atcmd_output);
  2592.  	}
  2593. -	sprintf(atcmd_output, msg_txt(79), match); // It is %d affair above.
  2594. +	sprintf(atcmd_output, msg_txt(sd->lang,79), match); // It is %d affair above.
  2595.  	clif_displaymessage(fd, atcmd_output);
  2596.  
  2597.  	return 0;
  2598. @@ -3401,7 +3401,7 @@
  2599.  	memset(atcmd_output, '\0', sizeof(atcmd_output));
  2600.  
  2601.  	if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
  2602. -		clif_displaymessage(fd, msg_txt(1032)); // You are not authorized to warp somenone to your current map.
  2603. +		clif_displaymessage(fd, msg_txt(sd->lang,1032)); // You are not authorized to warp somenone to your current map.
  2604.  		return -1;
  2605.  	}
  2606.  
  2607. @@ -3426,9 +3426,9 @@
  2608.  	}
  2609.  	mapit_free(iter);
  2610.  
  2611. -	clif_displaymessage(fd, msg_txt(92)); // All characters recalled!
  2612. +	clif_displaymessage(fd, msg_txt(sd->lang,92)); // All characters recalled!
  2613.  	if (count) {
  2614. -		sprintf(atcmd_output, msg_txt(1033), count); // Because you are not authorized to warp from some maps, %d player(s) have not been recalled.
  2615. +		sprintf(atcmd_output, msg_txt(sd->lang,1033), count); // Because you are not authorized to warp from some maps, %d player(s) have not been recalled.
  2616.  		clif_displaymessage(fd, atcmd_output);
  2617.  	}
  2618.  
  2619. @@ -3451,19 +3451,19 @@
  2620.  	memset(atcmd_output, '\0', sizeof(atcmd_output));
  2621.  
  2622.  	if (!message || !*message || sscanf(message, "%23[^\n]", guild_name) < 1) {
  2623. -		clif_displaymessage(fd, msg_txt(1034)); // Please enter a guild name/ID (usage: @guildrecall <guild_name/ID>).
  2624. +		clif_displaymessage(fd, msg_txt(sd->lang,1034)); // Please enter a guild name/ID (usage: @guildrecall <guild_name/ID>).
  2625.  		return -1;
  2626.  	}
  2627.  
  2628.  	if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
  2629. -		clif_displaymessage(fd, msg_txt(1032)); // You are not authorized to warp somenone to your current map.
  2630. +		clif_displaymessage(fd, msg_txt(sd->lang,1032)); // You are not authorized to warp somenone to your current map.
  2631.  		return -1;
  2632.  	}
  2633.  
  2634.  	if ((g = guild_searchname(guild_name)) == NULL && // name first to avoid error when name begin with a number
  2635.  	    (g = guild_search(atoi(message))) == NULL)
  2636.  	{
  2637. -		clif_displaymessage(fd, msg_txt(94)); // Incorrect name/ID, or no one from the guild is online.
  2638. +		clif_displaymessage(fd, msg_txt(sd->lang,94)); // Incorrect name/ID, or no one from the guild is online.
  2639.  		return -1;
  2640.  	}
  2641.  
  2642. @@ -3484,10 +3484,10 @@
  2643.  	}
  2644.  	mapit_free(iter);
  2645.  
  2646. -	sprintf(atcmd_output, msg_txt(93), g->name); // All online characters of the %s guild have been recalled to your position.
  2647. +	sprintf(atcmd_output, msg_txt(sd->lang,93), g->name); // All online characters of the %s guild have been recalled to your position.
  2648.  	clif_displaymessage(fd, atcmd_output);
  2649.  	if (count) {
  2650. -		sprintf(atcmd_output, msg_txt(1033), count); // Because you are not authorized to warp from some maps, %d player(s) have not been recalled.
  2651. +		sprintf(atcmd_output, msg_txt(sd->lang,1033), count); // Because you are not authorized to warp from some maps, %d player(s) have not been recalled.
  2652.  		clif_displaymessage(fd, atcmd_output);
  2653.  	}
  2654.  
  2655. @@ -3510,19 +3510,19 @@
  2656.  	memset(atcmd_output, '\0', sizeof(atcmd_output));
  2657.  
  2658.  	if (!message || !*message || sscanf(message, "%23[^\n]", party_name) < 1) {
  2659. -		clif_displaymessage(fd, msg_txt(1035)); // Please enter a party name/ID (usage: @partyrecall <party_name/ID>).
  2660. +		clif_displaymessage(fd, msg_txt(sd->lang,1035)); // Please enter a party name/ID (usage: @partyrecall <party_name/ID>).
  2661.  		return -1;
  2662.  	}
  2663.  
  2664.  	if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
  2665. -		clif_displaymessage(fd, msg_txt(1032)); // You are not authorized to warp somenone to your current map.
  2666. +		clif_displaymessage(fd, msg_txt(sd->lang,1032)); // You are not authorized to warp somenone to your current map.
  2667.  		return -1;
  2668.  	}
  2669.  
  2670.  	if ((p = party_searchname(party_name)) == NULL && // name first to avoid error when name begin with a number
  2671.  	    (p = party_search(atoi(message))) == NULL)
  2672.  	{
  2673. -		clif_displaymessage(fd, msg_txt(96)); // Incorrect name or ID, or no one from the party is online.
  2674. +		clif_displaymessage(fd, msg_txt(sd->lang,96)); // Incorrect name or ID, or no one from the party is online.
  2675.  		return -1;
  2676.  	}
  2677.  
  2678. @@ -3543,10 +3543,10 @@
  2679.  	}
  2680.  	mapit_free(iter);
  2681.  
  2682. -	sprintf(atcmd_output, msg_txt(95), p->party.name); // All online characters of the %s party have been recalled to your position.
  2683. +	sprintf(atcmd_output, msg_txt(sd->lang,95), p->party.name); // All online characters of the %s party have been recalled to your position.
  2684.  	clif_displaymessage(fd, atcmd_output);
  2685.  	if (count) {
  2686. -		sprintf(atcmd_output, msg_txt(1033), count); // Because you are not authorized to warp from some maps, %d player(s) have not been recalled.
  2687. +		sprintf(atcmd_output, msg_txt(sd->lang,1033), count); // Because you are not authorized to warp from some maps, %d player(s) have not been recalled.
  2688.  		clif_displaymessage(fd, atcmd_output);
  2689.  	}
  2690.  
  2691. @@ -3560,7 +3560,7 @@
  2692.  {
  2693.  	nullpo_retr(-1, sd);
  2694.  	itemdb_reload();
  2695. -	clif_displaymessage(fd, msg_txt(97)); // Item database has been reloaded.
  2696. +	clif_displaymessage(fd, msg_txt(sd->lang,97)); // Item database has been reloaded.
  2697.  
  2698.  	return 0;
  2699.  }
  2700. @@ -3577,7 +3577,7 @@
  2701.  	read_mercenarydb();
  2702.  	read_mercenary_skilldb();
  2703.  	reload_elementaldb();
  2704. -	clif_displaymessage(fd, msg_txt(98)); // Monster database has been reloaded.
  2705. +	clif_displaymessage(fd, msg_txt(sd->lang,98)); // Monster database has been reloaded.
  2706.  
  2707.  	return 0;
  2708.  }
  2709. @@ -3592,7 +3592,7 @@
  2710.  	merc_skill_reload();
  2711.  	reload_elemental_skilldb();
  2712.  	read_mercenary_skilldb();
  2713. -	clif_displaymessage(fd, msg_txt(99)); // Skill database has been reloaded.
  2714. +	clif_displaymessage(fd, msg_txt(sd->lang,99)); // Skill database has been reloaded.
  2715.  
  2716.  	return 0;
  2717.  }
  2718. @@ -3605,14 +3605,14 @@
  2719.  	config_t run_test;
  2720.  
  2721.  	if (conf_read_file(&run_test, "conf/groups.conf")) {
  2722. -		clif_displaymessage(fd, msg_txt(1036)); // Error reading groups.conf, reload failed.
  2723. +		clif_displaymessage(fd, msg_txt(sd->lang,1036)); // Error reading groups.conf, reload failed.
  2724.  		return -1;
  2725.  	}
  2726.  
  2727.  	config_destroy(&run_test);
  2728.  
  2729.  	if (conf_read_file(&run_test, ATCOMMAND_CONF_FILENAME)) {
  2730. -		clif_displaymessage(fd, msg_txt(1037)); // Error reading atcommand_athena.conf, reload failed.
  2731. +		clif_displaymessage(fd, msg_txt(sd->lang,1037)); // Error reading atcommand_athena.conf, reload failed.
  2732.  		return -1;
  2733.  	}
  2734.  
  2735. @@ -3620,7 +3620,7 @@
  2736.  
  2737.  	atcommand_doload();
  2738.  	pc_groups_reload();
  2739. -	clif_displaymessage(fd, msg_txt(254));
  2740. +	clif_displaymessage(fd, msg_txt(sd->lang,254));
  2741.  	return 0;
  2742.  }
  2743.  /*==========================================
  2744. @@ -3668,7 +3668,7 @@
  2745.  		mob_reload(); //Needed as well so rate changes take effect.
  2746.  		chrif_ragsrvinfo(battle_config.base_exp_rate, battle_config.job_exp_rate, battle_config.item_rate_common);
  2747.  	}
  2748. -	clif_displaymessage(fd, msg_txt(255));
  2749. +	clif_displaymessage(fd, msg_txt(sd->lang,255));
  2750.  	return 0;
  2751.  }
  2752.  /*==========================================
  2753. @@ -3677,7 +3677,7 @@
  2754.  ACMD_FUNC(reloadstatusdb)
  2755.  {
  2756.  	status_readdb();
  2757. -	clif_displaymessage(fd, msg_txt(256));
  2758. +	clif_displaymessage(fd, msg_txt(sd->lang,256));
  2759.  	return 0;
  2760.  }
  2761.  /*==========================================
  2762. @@ -3686,7 +3686,7 @@
  2763.  ACMD_FUNC(reloadpcdb)
  2764.  {
  2765.  	pc_readdb();
  2766. -	clif_displaymessage(fd, msg_txt(257));
  2767. +	clif_displaymessage(fd, msg_txt(sd->lang,257));
  2768.  	return 0;
  2769.  }
  2770.  
  2771. @@ -3696,7 +3696,7 @@
  2772.  ACMD_FUNC(reloadmotd)
  2773.  {
  2774.  	pc_read_motd();
  2775. -	clif_displaymessage(fd, msg_txt(268));
  2776. +	clif_displaymessage(fd, msg_txt(sd->lang,268));
  2777.  	return 0;
  2778.  }
  2779.  
  2780. @@ -3714,7 +3714,7 @@
  2781.  	script_reload();
  2782.  	npc_reload();
  2783.  
  2784. -	clif_displaymessage(fd, msg_txt(100)); // Scripts have been reloaded.
  2785. +	clif_displaymessage(fd, msg_txt(sd->lang,100)); // Scripts have been reloaded.
  2786.  
  2787.  	return 0;
  2788.  }
  2789. @@ -3747,7 +3747,7 @@
  2790.  	sscanf(message, "%d %23[^\n]", &list, mapname);
  2791.  
  2792.  	if (list < 0 || list > 3) {
  2793. -		clif_displaymessage(fd, msg_txt(1038)); // Please enter at least one valid list number (usage: @mapinfo <0-3> <map>).
  2794. +		clif_displaymessage(fd, msg_txt(sd->lang,1038)); // Please enter at least one valid list number (usage: @mapinfo <0-3> <map>).
  2795.  		return -1;
  2796.  	}
  2797.  
  2798. @@ -3759,12 +3759,12 @@
  2799.  	}
  2800.  
  2801.  	if (m_id < 0) {
  2802. -		clif_displaymessage(fd, msg_txt(1)); // Map not found.
  2803. +		clif_displaymessage(fd, msg_txt(sd->lang,1)); // Map not found.
  2804.  		return -1;
  2805.  	}
  2806.  	m_index = mapindex_name2id(mapname); //This one shouldn't fail since the previous seek did not.
  2807.  
  2808. -	clif_displaymessage(fd, msg_txt(1039)); // ------ Map Info ------
  2809. +	clif_displaymessage(fd, msg_txt(sd->lang,1039)); // ------ Map Info ------
  2810.  
  2811.  	// count chats (for initial message)
  2812.  	chat_num = 0;
  2813. @@ -3774,137 +3774,137 @@
  2814.  			chat_num++;
  2815.  	mapit_free(iter);
  2816.  
  2817. -	sprintf(atcmd_output, msg_txt(1040), mapname, map[m_id].users, map[m_id].npc_num, chat_num); // Map Name: %s | Players In Map: %d | NPCs In Map: %d | Chats In Map: %d
  2818. +	sprintf(atcmd_output, msg_txt(sd->lang,1040), mapname, map[m_id].users, map[m_id].npc_num, chat_num); // Map Name: %s | Players In Map: %d | NPCs In Map: %d | Chats In Map: %d
  2819.  	clif_displaymessage(fd, atcmd_output);
  2820. -	clif_displaymessage(fd, msg_txt(1041)); // ------ Map Flags ------
  2821. +	clif_displaymessage(fd, msg_txt(sd->lang,1041)); // ------ Map Flags ------
  2822.  	if (map[m_id].flag.town)
  2823. -		clif_displaymessage(fd, msg_txt(1042)); // Town Map
  2824. +		clif_displaymessage(fd, msg_txt(sd->lang,1042)); // Town Map
  2825.  
  2826.  	if (battle_config.autotrade_mapflag == map[m_id].flag.autotrade)
  2827. -		clif_displaymessage(fd, msg_txt(1043)); // Autotrade Enabled
  2828. +		clif_displaymessage(fd, msg_txt(sd->lang,1043)); // Autotrade Enabled
  2829.  	else
  2830. -		clif_displaymessage(fd, msg_txt(1044)); // Autotrade Disabled
  2831. +		clif_displaymessage(fd, msg_txt(sd->lang,1044)); // Autotrade Disabled
  2832.  
  2833.  	if (map[m_id].flag.battleground)
  2834. -		clif_displaymessage(fd, msg_txt(1045)); // Battlegrounds ON
  2835. +		clif_displaymessage(fd, msg_txt(sd->lang,1045)); // Battlegrounds ON
  2836.  
  2837. -	strcpy(atcmd_output,msg_txt(1046)); // PvP Flags:
  2838. +	strcpy(atcmd_output,msg_txt(sd->lang,1046)); // PvP Flags:
  2839.  	if (map[m_id].flag.pvp)
  2840. -		strcat(atcmd_output, msg_txt(1047)); // Pvp ON |
  2841. +		strcat(atcmd_output, msg_txt(sd->lang,1047)); // Pvp ON |
  2842.  	if (map[m_id].flag.pvp_noguild)
  2843. -		strcat(atcmd_output, msg_txt(1048)); // NoGuild |
  2844. +		strcat(atcmd_output, msg_txt(sd->lang,1048)); // NoGuild |
  2845.  	if (map[m_id].flag.pvp_noparty)
  2846. -		strcat(atcmd_output, msg_txt(1049)); // NoParty |
  2847. +		strcat(atcmd_output, msg_txt(sd->lang,1049)); // NoParty |
  2848.  	if (map[m_id].flag.pvp_nightmaredrop)
  2849. -		strcat(atcmd_output, msg_txt(1050)); // NightmareDrop |
  2850. +		strcat(atcmd_output, msg_txt(sd->lang,1050)); // NightmareDrop |
  2851.  	if (map[m_id].flag.pvp_nocalcrank)
  2852. -		strcat(atcmd_output, msg_txt(1051)); // NoCalcRank |
  2853. +		strcat(atcmd_output, msg_txt(sd->lang,1051)); // NoCalcRank |
  2854.  	clif_displaymessage(fd, atcmd_output);
  2855.  
  2856. -	strcpy(atcmd_output,msg_txt(1052)); // GvG Flags:
  2857. +	strcpy(atcmd_output,msg_txt(sd->lang,1052)); // GvG Flags:
  2858.  	if (map[m_id].flag.gvg)
  2859. -		strcat(atcmd_output, msg_txt(1053)); // GvG ON |
  2860. +		strcat(atcmd_output, msg_txt(sd->lang,1053)); // GvG ON |
  2861.  	if (map[m_id].flag.gvg_dungeon)
  2862. -		strcat(atcmd_output, msg_txt(1054)); // GvG Dungeon |
  2863. +		strcat(atcmd_output, msg_txt(sd->lang,1054)); // GvG Dungeon |
  2864.  	if (map[m_id].flag.gvg_castle)
  2865. -		strcat(atcmd_output, msg_txt(1055)); // GvG Castle |
  2866. +		strcat(atcmd_output, msg_txt(sd->lang,1055)); // GvG Castle |
  2867.  	if (map[m_id].flag.gvg_noparty)
  2868. -		strcat(atcmd_output, msg_txt(1056)); // NoParty |
  2869. +		strcat(atcmd_output, msg_txt(sd->lang,1056)); // NoParty |
  2870.  	clif_displaymessage(fd, atcmd_output);
  2871.  
  2872. -	strcpy(atcmd_output,msg_txt(1057)); // Teleport Flags:
  2873. +	strcpy(atcmd_output,msg_txt(sd->lang,1057)); // Teleport Flags:
  2874.  	if (map[m_id].flag.noteleport)
  2875. -		strcat(atcmd_output, msg_txt(1058)); // NoTeleport |
  2876. +		strcat(atcmd_output, msg_txt(sd->lang,1058)); // NoTeleport |
  2877.  	if (map[m_id].flag.monster_noteleport)
  2878. -		strcat(atcmd_output, msg_txt(1059)); // Monster NoTeleport |
  2879. +		strcat(atcmd_output, msg_txt(sd->lang,1059)); // Monster NoTeleport |
  2880.  	if (map[m_id].flag.nowarp)
  2881. -		strcat(atcmd_output, msg_txt(1060)); // NoWarp |
  2882. +		strcat(atcmd_output, msg_txt(sd->lang,1060)); // NoWarp |
  2883.  	if (map[m_id].flag.nowarpto)
  2884. -		strcat(atcmd_output, msg_txt(1061)); // NoWarpTo |
  2885. +		strcat(atcmd_output, msg_txt(sd->lang,1061)); // NoWarpTo |
  2886.  	if (map[m_id].flag.noreturn)
  2887. -		strcat(atcmd_output, msg_txt(1062)); // NoReturn |
  2888. +		strcat(atcmd_output, msg_txt(sd->lang,1062)); // NoReturn |
  2889.  	if (map[m_id].flag.nogo)
  2890. -		strcat(atcmd_output, msg_txt(1063)); // NoGo |
  2891. +		strcat(atcmd_output, msg_txt(sd->lang,1063)); // NoGo |
  2892.  	if (map[m_id].flag.nomemo)
  2893. -		strcat(atcmd_output, msg_txt(1064)); // NoMemo |
  2894. +		strcat(atcmd_output, msg_txt(sd->lang,1064)); // NoMemo |
  2895.  	clif_displaymessage(fd, atcmd_output);
  2896.  
  2897. -	sprintf(atcmd_output, msg_txt(1065),  // No Exp Penalty: %s | No Zeny Penalty: %s
  2898. -		(map[m_id].flag.noexppenalty) ? msg_txt(1066) : msg_txt(1067), (map[m_id].flag.nozenypenalty) ? msg_txt(1066) : msg_txt(1067)); // On / Off
  2899. +	sprintf(atcmd_output, msg_txt(sd->lang,1065),  // No Exp Penalty: %s | No Zeny Penalty: %s
  2900. +		(map[m_id].flag.noexppenalty) ? msg_txt(sd->lang,1066) : msg_txt(sd->lang,1067), (map[m_id].flag.nozenypenalty) ? msg_txt(sd->lang,1066) : msg_txt(sd->lang,1067)); // On / Off
  2901.  	clif_displaymessage(fd, atcmd_output);
  2902.  
  2903.  	if (map[m_id].flag.nosave) {
  2904.  		if (!map[m_id].save.map)
  2905. -			clif_displaymessage(fd, msg_txt(1068)); // No Save (Return to last Save Point)
  2906. +			clif_displaymessage(fd, msg_txt(sd->lang,1068)); // No Save (Return to last Save Point)
  2907.  		else if (map[m_id].save.x == -1 || map[m_id].save.y == -1 ) {
  2908. -			sprintf(atcmd_output, msg_txt(1069), mapindex_id2name(map[m_id].save.map)); // No Save, Save Point: %s,Random
  2909. +			sprintf(atcmd_output, msg_txt(sd->lang,1069), mapindex_id2name(map[m_id].save.map)); // No Save, Save Point: %s,Random
  2910.  			clif_displaymessage(fd, atcmd_output);
  2911.  		}
  2912.  		else {
  2913. -			sprintf(atcmd_output, msg_txt(1070), // No Save, Save Point: %s,%d,%d
  2914. +			sprintf(atcmd_output, msg_txt(sd->lang,1070), // No Save, Save Point: %s,%d,%d
  2915.  				mapindex_id2name(map[m_id].save.map),map[m_id].save.x,map[m_id].save.y);
  2916.  			clif_displaymessage(fd, atcmd_output);
  2917.  		}
  2918.  	}
  2919.  
  2920. -	strcpy(atcmd_output,msg_txt(1071)); // Weather Flags:
  2921. +	strcpy(atcmd_output,msg_txt(sd->lang,1071)); // Weather Flags:
  2922.  	if (map[m_id].flag.snow)
  2923. -		strcat(atcmd_output, msg_txt(1072)); // Snow |
  2924. +		strcat(atcmd_output, msg_txt(sd->lang,1072)); // Snow |
  2925.  	if (map[m_id].flag.fog)
  2926. -		strcat(atcmd_output, msg_txt(1073)); // Fog |
  2927. +		strcat(atcmd_output, msg_txt(sd->lang,1073)); // Fog |
  2928.  	if (map[m_id].flag.sakura)
  2929. -		strcat(atcmd_output, msg_txt(1074)); // Sakura |
  2930. +		strcat(atcmd_output, msg_txt(sd->lang,1074)); // Sakura |
  2931.  	if (map[m_id].flag.clouds)
  2932. -		strcat(atcmd_output, msg_txt(1075)); // Clouds |
  2933. +		strcat(atcmd_output, msg_txt(sd->lang,1075)); // Clouds |
  2934.  	if (map[m_id].flag.clouds2)
  2935. -		strcat(atcmd_output, msg_txt(1076)); // Clouds2 |
  2936. +		strcat(atcmd_output, msg_txt(sd->lang,1076)); // Clouds2 |
  2937.  	if (map[m_id].flag.fireworks)
  2938. -		strcat(atcmd_output, msg_txt(1077)); // Fireworks |
  2939. +		strcat(atcmd_output, msg_txt(sd->lang,1077)); // Fireworks |
  2940.  	if (map[m_id].flag.leaves)
  2941. -		strcat(atcmd_output, msg_txt(1078)); // Leaves |
  2942. +		strcat(atcmd_output, msg_txt(sd->lang,1078)); // Leaves |
  2943.  	/**
  2944.  	 * No longer available, keeping here just in case it's back someday. [Ind]
  2945.  	 **/
  2946.  	//if (map[m_id].flag.rain)
  2947. -	//	strcat(atcmd_output, msg_txt(1079)); // Rain |
  2948. +	//	strcat(atcmd_output, msg_txt(sd->lang,1079)); // Rain |
  2949.  	if (map[m_id].flag.nightenabled)
  2950. -		strcat(atcmd_output, msg_txt(1080)); // Displays Night |
  2951. +		strcat(atcmd_output, msg_txt(sd->lang,1080)); // Displays Night |
  2952.  	clif_displaymessage(fd, atcmd_output);
  2953.  
  2954. -	strcpy(atcmd_output,msg_txt(1081)); // Other Flags:
  2955. +	strcpy(atcmd_output,msg_txt(sd->lang,1081)); // Other Flags:
  2956.  	if (map[m_id].flag.nobranch)
  2957. -		strcat(atcmd_output, msg_txt(1082)); // NoBranch |
  2958. +		strcat(atcmd_output, msg_txt(sd->lang,1082)); // NoBranch |
  2959.  	if (map[m_id].flag.notrade)
  2960. -		strcat(atcmd_output, msg_txt(1083)); // NoTrade |
  2961. +		strcat(atcmd_output, msg_txt(sd->lang,1083)); // NoTrade |
  2962.  	if (map[m_id].flag.novending)
  2963. -		strcat(atcmd_output, msg_txt(1084)); // NoVending |
  2964. +		strcat(atcmd_output, msg_txt(sd->lang,1084)); // NoVending |
  2965.  	if (map[m_id].flag.nodrop)
  2966. -		strcat(atcmd_output, msg_txt(1085)); // NoDrop |
  2967. +		strcat(atcmd_output, msg_txt(sd->lang,1085)); // NoDrop |
  2968.  	if (map[m_id].flag.noskill)
  2969. -		strcat(atcmd_output, msg_txt(1086)); // NoSkill |
  2970. +		strcat(atcmd_output, msg_txt(sd->lang,1086)); // NoSkill |
  2971.  	if (map[m_id].flag.noicewall)
  2972. -		strcat(atcmd_output, msg_txt(1087)); // NoIcewall |
  2973. +		strcat(atcmd_output, msg_txt(sd->lang,1087)); // NoIcewall |
  2974.  	if (map[m_id].flag.allowks)
  2975. -		strcat(atcmd_output, msg_txt(1088)); // AllowKS |
  2976. +		strcat(atcmd_output, msg_txt(sd->lang,1088)); // AllowKS |
  2977.  	if (map[m_id].flag.reset)
  2978. -		strcat(atcmd_output, msg_txt(1089)); // Reset |
  2979. +		strcat(atcmd_output, msg_txt(sd->lang,1089)); // Reset |
  2980.  	clif_displaymessage(fd, atcmd_output);
  2981.  
  2982. -	strcpy(atcmd_output,msg_txt(1090)); // Other Flags:
  2983. +	strcpy(atcmd_output,msg_txt(sd->lang,1090)); // Other Flags:
  2984.  	if (map[m_id].nocommand)
  2985. -		strcat(atcmd_output, msg_txt(1091)); // NoCommand |
  2986. +		strcat(atcmd_output, msg_txt(sd->lang,1091)); // NoCommand |
  2987.  	if (map[m_id].flag.nobaseexp)
  2988. -		strcat(atcmd_output, msg_txt(1092)); // NoBaseEXP |
  2989. +		strcat(atcmd_output, msg_txt(sd->lang,1092)); // NoBaseEXP |
  2990.  	if (map[m_id].flag.nojobexp)
  2991. -		strcat(atcmd_output, msg_txt(1093)); // NoJobEXP |
  2992. +		strcat(atcmd_output, msg_txt(sd->lang,1093)); // NoJobEXP |
  2993.  	if (map[m_id].flag.nomobloot)
  2994. -		strcat(atcmd_output, msg_txt(1094)); // NoMobLoot |
  2995. +		strcat(atcmd_output, msg_txt(sd->lang,1094)); // NoMobLoot |
  2996.  	if (map[m_id].flag.nomvploot)
  2997. -		strcat(atcmd_output, msg_txt(1095)); // NoMVPLoot |
  2998. +		strcat(atcmd_output, msg_txt(sd->lang,1095)); // NoMVPLoot |
  2999.  	if (map[m_id].flag.partylock)
  3000. -		strcat(atcmd_output, msg_txt(1096)); // PartyLock |
  3001. +		strcat(atcmd_output, msg_txt(sd->lang,1096)); // PartyLock |
  3002.  	if (map[m_id].flag.guildlock)
  3003. -		strcat(atcmd_output, msg_txt(1097)); // GuildLock |
  3004. +		strcat(atcmd_output, msg_txt(sd->lang,1097)); // GuildLock |
  3005.  	clif_displaymessage(fd, atcmd_output);
  3006.  
  3007.  	switch (list) {
  3008. @@ -3912,12 +3912,12 @@
  3009.  		// Do nothing. It's list 0, no additional display.
  3010.  		break;
  3011.  	case 1:
  3012. -		clif_displaymessage(fd, msg_txt(1098)); // ----- Players in Map -----
  3013. +		clif_displaymessage(fd, msg_txt(sd->lang,1098)); // ----- Players in Map -----
  3014.  		iter = mapit_getallusers();
  3015.  		for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) )
  3016.  		{
  3017.  			if (pl_sd->mapindex == m_index) {
  3018. -				sprintf(atcmd_output, msg_txt(1099), // Player '%s' (session #%d) | Location: %d,%d
  3019. +				sprintf(atcmd_output, msg_txt(sd->lang,1099), // Player '%s' (session #%d) | Location: %d,%d
  3020.  				        pl_sd->status.name, pl_sd->fd, pl_sd->bl.x, pl_sd->bl.y);
  3021.  				clif_displaymessage(fd, atcmd_output);
  3022.  			}
  3023. @@ -3925,33 +3925,33 @@
  3024.  		mapit_free(iter);
  3025.  		break;
  3026.  	case 2:
  3027. -		clif_displaymessage(fd, msg_txt(1100)); // ----- NPCs in Map -----
  3028. +		clif_displaymessage(fd, msg_txt(sd->lang,1100)); // ----- NPCs in Map -----
  3029.  		for (i = 0; i < map[m_id].npc_num;)
  3030.  		{
  3031.  			nd = map[m_id].npc[i];
  3032.  			switch(nd->ud.dir) {
  3033. -			case 0:  strcpy(direction, msg_txt(1101)); break; // North
  3034. -			case 1:  strcpy(direction, msg_txt(1102)); break; // North West
  3035. -			case 2:  strcpy(direction, msg_txt(1103)); break; // West
  3036. -			case 3:  strcpy(direction, msg_txt(1104)); break; // South West
  3037. -			case 4:  strcpy(direction, msg_txt(1105)); break; // South
  3038. -			case 5:  strcpy(direction, msg_txt(1106)); break; // South East
  3039. -			case 6:  strcpy(direction, msg_txt(1107)); break; // East
  3040. -			case 7:  strcpy(direction, msg_txt(1108)); break; // North East
  3041. -			case 9:  strcpy(direction, msg_txt(1109)); break; // North
  3042. -			default: strcpy(direction, msg_txt(1110)); break; // Unknown
  3043. +			case 0:  strcpy(direction, msg_txt(sd->lang,1101)); break; // North
  3044. +			case 1:  strcpy(direction, msg_txt(sd->lang,1102)); break; // North West
  3045. +			case 2:  strcpy(direction, msg_txt(sd->lang,1103)); break; // West
  3046. +			case 3:  strcpy(direction, msg_txt(sd->lang,1104)); break; // South West
  3047. +			case 4:  strcpy(direction, msg_txt(sd->lang,1105)); break; // South
  3048. +			case 5:  strcpy(direction, msg_txt(sd->lang,1106)); break; // South East
  3049. +			case 6:  strcpy(direction, msg_txt(sd->lang,1107)); break; // East
  3050. +			case 7:  strcpy(direction, msg_txt(sd->lang,1108)); break; // North East
  3051. +			case 9:  strcpy(direction, msg_txt(sd->lang,1109)); break; // North
  3052. +			default: strcpy(direction, msg_txt(sd->lang,1110)); break; // Unknown
  3053.  			}
  3054.  			if(strcmp(nd->name,nd->exname) == 0)
  3055. -				sprintf(atcmd_output, msg_txt(1111), // NPC %d: %s | Direction: %s | Sprite: %d | Location: %d %d
  3056. +				sprintf(atcmd_output, msg_txt(sd->lang,1111), // NPC %d: %s | Direction: %s | Sprite: %d | Location: %d %d
  3057.  				    ++i, nd->name, direction, nd->class_, nd->bl.x, nd->bl.y);
  3058.  			else
  3059. -				sprintf(atcmd_output, msg_txt(1112), // NPC %d: %s::%s | Direction: %s | Sprite: %d | Location: %d %d
  3060. +				sprintf(atcmd_output, msg_txt(sd->lang,1112), // NPC %d: %s::%s | Direction: %s | Sprite: %d | Location: %d %d
  3061.  			        ++i, nd->name, nd->exname, direction, nd->class_, nd->bl.x, nd->bl.y);
  3062.  			clif_displaymessage(fd, atcmd_output);
  3063.  		}
  3064.  		break;
  3065.  	case 3:
  3066. -		clif_displaymessage(fd, msg_txt(1113)); // ----- Chats in Map -----
  3067. +		clif_displaymessage(fd, msg_txt(sd->lang,1113)); // ----- Chats in Map -----
  3068.  		iter = mapit_getallusers();
  3069.  		for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) )
  3070.  		{
  3071. @@ -3959,18 +3959,18 @@
  3072.  			    pl_sd->mapindex == m_index &&
  3073.  			    cd->usersd[0] == pl_sd)
  3074.  			{
  3075. -				sprintf(atcmd_output, msg_txt(1114), // Chat: %s | Player: %s | Location: %d %d
  3076. +				sprintf(atcmd_output, msg_txt(sd->lang,1114), // Chat: %s | Player: %s | Location: %d %d
  3077.  				        cd->title, pl_sd->status.name, cd->bl.x, cd->bl.y);
  3078.  				clif_displaymessage(fd, atcmd_output);
  3079. -				sprintf(atcmd_output, msg_txt(1115), //    Users: %d/%d | Password: %s | Public: %s
  3080. -				        cd->users, cd->limit, cd->pass, (cd->pub) ? msg_txt(1116) : msg_txt(1117)); // Yes / No
  3081. +				sprintf(atcmd_output, msg_txt(sd->lang,1115), //    Users: %d/%d | Password: %s | Public: %s
  3082. +				        cd->users, cd->limit, cd->pass, (cd->pub) ? msg_txt(sd->lang,1116) : msg_txt(sd->lang,1117)); // Yes / No
  3083.  				clif_displaymessage(fd, atcmd_output);
  3084.  			}
  3085.  		}
  3086.  		mapit_free(iter);
  3087.  		break;
  3088.  	default: // normally impossible to arrive here
  3089. -		clif_displaymessage(fd, msg_txt(1118)); // Please enter at least one valid list number (usage: @mapinfo <0-3> <map>).
  3090. +		clif_displaymessage(fd, msg_txt(sd->lang,1118)); // Please enter at least one valid list number (usage: @mapinfo <0-3> <map>).
  3091.  		return -1;
  3092.  		break;
  3093.  	}
  3094. @@ -3986,36 +3986,36 @@
  3095.  	nullpo_retr(-1, sd);
  3096.  
  3097.  	if (sd->disguise) {
  3098. -		clif_displaymessage(fd, msg_txt(212)); // Cannot mount while in disguise.
  3099. +		clif_displaymessage(fd, msg_txt(sd->lang,212)); // Cannot mount while in disguise.
  3100.  		return -1;
  3101.  	}
  3102.  
  3103.  	if( (sd->class_&MAPID_THIRDMASK) == MAPID_RUNE_KNIGHT && pc_checkskill(sd,RK_DRAGONTRAINING) > 0 ) {
  3104.  		if( !(sd->sc.option&OPTION_DRAGON1) ) {
  3105. -			clif_displaymessage(sd->fd,msg_txt(1119)); // You have mounted your Dragon.
  3106. +			clif_displaymessage(sd->fd,msg_txt(sd->lang,1119)); // You have mounted your Dragon.
  3107.  			pc_setoption(sd, sd->sc.option|OPTION_DRAGON1);
  3108.  		} else {
  3109. -			clif_displaymessage(sd->fd,msg_txt(1120)); // You have released your Dragon.
  3110. +			clif_displaymessage(sd->fd,msg_txt(sd->lang,1120)); // You have released your Dragon.
  3111.  			pc_setoption(sd, sd->sc.option&~OPTION_DRAGON1);
  3112.  		}
  3113.  		return 0;
  3114.  	}
  3115.  	if( (sd->class_&MAPID_THIRDMASK) == MAPID_RANGER && pc_checkskill(sd,RA_WUGRIDER) > 0 ) {
  3116.  		if( !pc_isridingwug(sd) ) {
  3117. -			clif_displaymessage(sd->fd,msg_txt(1121)); // You have mounted your Warg.
  3118. +			clif_displaymessage(sd->fd,msg_txt(sd->lang,1121)); // You have mounted your Warg.
  3119.  			pc_setoption(sd, sd->sc.option|OPTION_WUGRIDER);
  3120.  		} else {
  3121. -			clif_displaymessage(sd->fd,msg_txt(1122)); // You have released your Warg.
  3122. +			clif_displaymessage(sd->fd,msg_txt(sd->lang,1122)); // You have released your Warg.
  3123.  			pc_setoption(sd, sd->sc.option&~OPTION_WUGRIDER);
  3124.  		}
  3125.  		return 0;
  3126.  	}
  3127.  	if( (sd->class_&MAPID_THIRDMASK) == MAPID_MECHANIC ) {
  3128.  		if( !pc_ismadogear(sd) ) {
  3129. -			clif_displaymessage(sd->fd,msg_txt(1123)); // You have mounted your Mado Gear.
  3130. +			clif_displaymessage(sd->fd,msg_txt(sd->lang,1123)); // You have mounted your Mado Gear.
  3131.  			pc_setoption(sd, sd->sc.option|OPTION_MADOGEAR);
  3132.  		} else {
  3133. -			clif_displaymessage(sd->fd,msg_txt(1124)); // You have released your Mado Gear.
  3134. +			clif_displaymessage(sd->fd,msg_txt(sd->lang,1124)); // You have released your Mado Gear.
  3135.  			pc_setoption(sd, sd->sc.option&~OPTION_MADOGEAR);
  3136.  		}
  3137.  		return 0;
  3138. @@ -4023,15 +4023,15 @@
  3139.  	if (!pc_isriding(sd)) { // if actually no peco
  3140.  
  3141.  		if (!pc_checkskill(sd, KN_RIDING)) {
  3142. -			clif_displaymessage(fd, msg_txt(213)); // You can not mount a Peco Peco with your current job.
  3143. +			clif_displaymessage(fd, msg_txt(sd->lang,213)); // You can not mount a Peco Peco with your current job.
  3144.  			return -1;
  3145.  		}
  3146.  
  3147.  		pc_setoption(sd, sd->sc.option | OPTION_RIDING);
  3148. -		clif_displaymessage(fd, msg_txt(102)); // You have mounted a Peco Peco.
  3149. +		clif_displaymessage(fd, msg_txt(sd->lang,102)); // You have mounted a Peco Peco.
  3150.  	} else {//Dismount
  3151.  		pc_setoption(sd, sd->sc.option & ~OPTION_RIDING);
  3152. -		clif_displaymessage(fd, msg_txt(214)); // You have released your Peco Peco.
  3153. +		clif_displaymessage(fd, msg_txt(sd->lang,214)); // You have released your Peco Peco.
  3154.  	}
  3155.  
  3156.  	return 0;
  3157. @@ -4051,11 +4051,11 @@
  3158.  
  3159.  	if (!enable_spy)
  3160.  	{
  3161. -		clif_displaymessage(fd, msg_txt(1125)); // The mapserver has spy command support disabled.
  3162. +		clif_displaymessage(fd, msg_txt(sd->lang,1125)); // The mapserver has spy command support disabled.
  3163.  		return -1;
  3164.  	}
  3165.  	if (!message || !*message || sscanf(message, "%23[^\n]", guild_name) < 1) {
  3166. -		clif_displaymessage(fd, msg_txt(1126)); // Please enter a guild name/ID (usage: @guildspy <guild_name/ID>).
  3167. +		clif_displaymessage(fd, msg_txt(sd->lang,1126)); // Please enter a guild name/ID (usage: @guildspy <guild_name/ID>).
  3168.  		return -1;
  3169.  	}
  3170.  
  3171. @@ -4063,15 +4063,15 @@
  3172.  	    (g = guild_search(atoi(message))) != NULL) {
  3173.  		if (sd->guildspy == g->guild_id) {
  3174.  			sd->guildspy = 0;
  3175. -			sprintf(atcmd_output, msg_txt(103), g->name); // No longer spying on the %s guild.
  3176. +			sprintf(atcmd_output, msg_txt(sd->lang,103), g->name); // No longer spying on the %s guild.
  3177.  			clif_displaymessage(fd, atcmd_output);
  3178.  		} else {
  3179.  			sd->guildspy = g->guild_id;
  3180. -			sprintf(atcmd_output, msg_txt(104), g->name); // Spying on the %s guild.
  3181. +			sprintf(atcmd_output, msg_txt(sd->lang,104), g->name); // Spying on the %s guild.
  3182.  			clif_displaymessage(fd, atcmd_output);
  3183.  		}
  3184.  	} else {
  3185. -		clif_displaymessage(fd, msg_txt(94)); // Incorrect name/ID, or no one from the specified guild is online.
  3186. +		clif_displaymessage(fd, msg_txt(sd->lang,94)); // Incorrect name/ID, or no one from the specified guild is online.
  3187.  		return -1;
  3188.  	}
  3189.  
  3190. @@ -4092,12 +4092,12 @@
  3191.  
  3192.  	if (!enable_spy)
  3193.  	{
  3194. -		clif_displaymessage(fd, msg_txt(1125)); // The mapserver has spy command support disabled.
  3195. +		clif_displaymessage(fd, msg_txt(sd->lang,1125)); // The mapserver has spy command support disabled.
  3196.  		return -1;
  3197.  	}
  3198.  
  3199.  	if (!message || !*message || sscanf(message, "%23[^\n]", party_name) < 1) {
  3200. -		clif_displaymessage(fd, msg_txt(1127)); // Please enter a party name/ID (usage: @partyspy <party_name/ID>).
  3201. +		clif_displaymessage(fd, msg_txt(sd->lang,1127)); // Please enter a party name/ID (usage: @partyspy <party_name/ID>).
  3202.  		return -1;
  3203.  	}
  3204.  
  3205. @@ -4105,15 +4105,15 @@
  3206.  	    (p = party_search(atoi(message))) != NULL) {
  3207.  		if (sd->partyspy == p->party.party_id) {
  3208.  			sd->partyspy = 0;
  3209. -			sprintf(atcmd_output, msg_txt(105), p->party.name); // No longer spying on the %s party.
  3210. +			sprintf(atcmd_output, msg_txt(sd->lang,105), p->party.name); // No longer spying on the %s party.
  3211.  			clif_displaymessage(fd, atcmd_output);
  3212.  		} else {
  3213.  			sd->partyspy = p->party.party_id;
  3214. -			sprintf(atcmd_output, msg_txt(106), p->party.name); // Spying on the %s party.
  3215. +			sprintf(atcmd_output, msg_txt(sd->lang,106), p->party.name); // Spying on the %s party.
  3216.  			clif_displaymessage(fd, atcmd_output);
  3217.  		}
  3218.  	} else {
  3219. -		clif_displaymessage(fd, msg_txt(96)); // Incorrect name/ID, or no one from the specified party is online.
  3220. +		clif_displaymessage(fd, msg_txt(sd->lang,96)); // Incorrect name/ID, or no one from the specified party is online.
  3221.  		return -1;
  3222.  	}
  3223.  
  3224. @@ -4140,9 +4140,9 @@
  3225.  	if (count > 0) {
  3226.  		clif_misceffect(&sd->bl, 3);
  3227.  		clif_equiplist(sd);
  3228. -		clif_displaymessage(fd, msg_txt(107)); // All items have been repaired.
  3229. +		clif_displaymessage(fd, msg_txt(sd->lang,107)); // All items have been repaired.
  3230.  	} else {
  3231. -		clif_displaymessage(fd, msg_txt(108)); // No item need to be repaired.
  3232. +		clif_displaymessage(fd, msg_txt(sd->lang,108)); // No item need to be repaired.
  3233.  		return -1;
  3234.  	}
  3235.  
  3236. @@ -4160,20 +4160,20 @@
  3237.  	memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
  3238.  
  3239.  	if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
  3240. -		clif_displaymessage(fd, msg_txt(1128)); // Please enter a player name (usage: @nuke <char name>).
  3241. +		clif_displaymessage(fd, msg_txt(sd->lang,1128)); // Please enter a player name (usage: @nuke <char name>).
  3242.  		return -1;
  3243.  	}
  3244.  
  3245.  	if ((pl_sd = map_nick2sd(atcmd_player_name)) != NULL) {
  3246.  		if (pc_get_group_level(sd) >= pc_get_group_level(pl_sd)) { // you can kill only lower or same GM level
  3247.  			skill_castend_nodamage_id(&pl_sd->bl, &pl_sd->bl, NPC_SELFDESTRUCTION, 99, gettick(), 0);
  3248. -			clif_displaymessage(fd, msg_txt(109)); // Player has been nuked!
  3249. +			clif_displaymessage(fd, msg_txt(sd->lang,109)); // Player has been nuked!
  3250.  		} else {
  3251. -			clif_displaymessage(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player.
  3252. +			clif_displaymessage(fd, msg_txt(sd->lang,81)); // Your GM level don't authorise you to do this action on this player.
  3253.  			return -1;
  3254.  		}
  3255.  	} else {
  3256. -		clif_displaymessage(fd, msg_txt(3)); // Character not found.
  3257. +		clif_displaymessage(fd, msg_txt(sd->lang,3)); // Character not found.
  3258.  		return -1;
  3259.  	}
  3260.  
  3261. @@ -4193,17 +4193,17 @@
  3262.  	memset(npcname, 0, sizeof(npcname));
  3263.  
  3264.  	if (!message || !*message || sscanf(message, "%23[^\n]", npcname) < 1) {
  3265. -		clif_displaymessage(fd, msg_txt(1129)); // Please enter a NPC name (usage: @tonpc <NPC_name>).
  3266. +		clif_displaymessage(fd, msg_txt(sd->lang,1129)); // Please enter a NPC name (usage: @tonpc <NPC_name>).
  3267.  		return -1;
  3268.  	}
  3269.  
  3270.  	if ((nd = npc_name2id(npcname)) != NULL) {
  3271.  		if (pc_setpos(sd, map_id2index(nd->bl.m), nd->bl.x, nd->bl.y, CLR_TELEPORT) == 0)
  3272. -			clif_displaymessage(fd, msg_txt(0)); // Warped.
  3273. +			clif_displaymessage(fd, msg_txt(sd->lang,0)); // Warped.
  3274.  		else
  3275.  			return -1;
  3276.  	} else {
  3277. -		clif_displaymessage(fd, msg_txt(111)); // This NPC doesn't exist.
  3278. +		clif_displaymessage(fd, msg_txt(sd->lang,111)); // This NPC doesn't exist.
  3279.  		return -1;
  3280.  	}
  3281.  
  3282. @@ -4221,15 +4221,15 @@
  3283.  	memset(NPCname, '\0', sizeof(NPCname));
  3284.  
  3285.  	if (!message || !*message || sscanf(message, "%23[^\n]", NPCname) < 1) {
  3286. -		clif_displaymessage(fd, msg_txt(1130)); // Please enter a NPC name (usage: @enablenpc <NPC_name>).
  3287. +		clif_displaymessage(fd, msg_txt(sd->lang,1130)); // Please enter a NPC name (usage: @enablenpc <NPC_name>).
  3288.  		return -1;
  3289.  	}
  3290.  
  3291.  	if (npc_name2id(NPCname) != NULL) {
  3292.  		npc_enable(NPCname, 1);
  3293. -		clif_displaymessage(fd, msg_txt(110)); // Npc Enabled.
  3294. +		clif_displaymessage(fd, msg_txt(sd->lang,110)); // Npc Enabled.
  3295.  	} else {
  3296. -		clif_displaymessage(fd, msg_txt(111)); // This NPC doesn't exist.
  3297. +		clif_displaymessage(fd, msg_txt(sd->lang,111)); // This NPC doesn't exist.
  3298.  		return -1;
  3299.  	}
  3300.  
  3301. @@ -4247,17 +4247,17 @@
  3302.  	memset(NPCname, '\0', sizeof(NPCname));
  3303.  
  3304.  	if (!message || !*message || sscanf(message, "%23[^\n]", NPCname) < 1) {
  3305. -		clif_displaymessage(fd, msg_txt(1131)); // Please enter a NPC name (usage: @hidenpc <NPC_name>).
  3306. +		clif_displaymessage(fd, msg_txt(sd->lang,1131)); // Please enter a NPC name (usage: @hidenpc <NPC_name>).
  3307.  		return -1;
  3308.  	}
  3309.  
  3310.  	if (npc_name2id(NPCname) == NULL) {
  3311. -		clif_displaymessage(fd, msg_txt(111)); // This NPC doesn't exist.
  3312. +		clif_displaymessage(fd, msg_txt(sd->lang,111)); // This NPC doesn't exist.
  3313.  		return -1;
  3314.  	}
  3315.  
  3316.  	npc_enable(NPCname, 0);
  3317. -	clif_displaymessage(fd, msg_txt(112)); // Npc Disabled.
  3318. +	clif_displaymessage(fd, msg_txt(sd->lang,112)); // Npc Disabled.
  3319.  	return 0;
  3320.  }
  3321.  
  3322. @@ -4266,13 +4266,13 @@
  3323.  	FILE *fp;
  3324.  
  3325.  	if (!message || !*message) {
  3326. -		clif_displaymessage(fd, msg_txt(1132)); // Please enter a script file name (usage: @loadnpc <file name>).
  3327. +		clif_displaymessage(fd, msg_txt(sd->lang,1132)); // Please enter a script file name (usage: @loadnpc <file name>).
  3328.  		return -1;
  3329.  	}
  3330.  
  3331.  	// check if script file exists
  3332.  	if ((fp = fopen(message, "r")) == NULL) {
  3333. -		clif_displaymessage(fd, msg_txt(261));
  3334. +		clif_displaymessage(fd, msg_txt(sd->lang,261));
  3335.  		return -1;
  3336.  	}
  3337.  	fclose(fp);
  3338. @@ -4282,7 +4282,7 @@
  3339.  	npc_parsesrcfile(message,true);
  3340.  	npc_read_event_script();
  3341.  
  3342. -	clif_displaymessage(fd, msg_txt(262));
  3343. +	clif_displaymessage(fd, msg_txt(sd->lang,262));
  3344.  
  3345.  	return 0;
  3346.  }
  3347. @@ -4296,26 +4296,26 @@
  3348.  	memset(NPCname, '\0', sizeof(NPCname));
  3349.  
  3350.  	if (!message || !*message || sscanf(message, "%24[^\n]", NPCname) < 1) {
  3351. -		clif_displaymessage(fd, msg_txt(1133)); // Please enter a NPC name (usage: @npcoff <NPC_name>).
  3352. +		clif_displaymessage(fd, msg_txt(sd->lang,1133)); // Please enter a NPC name (usage: @npcoff <NPC_name>).
  3353.  		return -1;
  3354.  	}
  3355.  
  3356.  	if ((nd = npc_name2id(NPCname)) == NULL) {
  3357. -		clif_displaymessage(fd, msg_txt(111)); // This NPC doesn't exist.
  3358. +		clif_displaymessage(fd, msg_txt(sd->lang,111)); // This NPC doesn't exist.
  3359.  		return -1;
  3360.  	}
  3361.  
  3362.  	npc_unload_duplicates(nd);
  3363.  	npc_unload(nd,true);
  3364.  	npc_read_event_script();
  3365. -	clif_displaymessage(fd, msg_txt(112)); // Npc Disabled.
  3366. +	clif_displaymessage(fd, msg_txt(sd->lang,112)); // Npc Disabled.
  3367.  	return 0;
  3368.  }
  3369.  
  3370.  /*==========================================
  3371.   * time in txt for time command (by [Yor])
  3372.   *------------------------------------------*/
  3373. -char* txt_time(unsigned int duration)
  3374. +char* txt_time(uint16 lang, unsigned int duration)
  3375.  {
  3376.  	int days, hours, minutes, seconds;
  3377.  	char temp[CHAT_SIZE_MAX];
  3378. @@ -4332,21 +4332,21 @@
  3379.  	seconds = duration - (60 * minutes);
  3380.  
  3381.  	if (days == 1)
  3382. -		sprintf(temp, msg_txt(219), days); // %d day
  3383. +		sprintf(temp, msg_txt(lang,219), days); // %d day
  3384.  	else if (days > 1)
  3385. -		sprintf(temp, msg_txt(220), days); // %d days
  3386. +		sprintf(temp, msg_txt(lang,220), days); // %d days
  3387.  	if (hours == 1)
  3388. -		sprintf(temp1, msg_txt(221), temp, hours); // %s %d hour
  3389. +		sprintf(temp1, msg_txt(lang,221), temp, hours); // %s %d hour
  3390.  	else if (hours > 1)
  3391. -		sprintf(temp1, msg_txt(222), temp, hours); // %s %d hours
  3392. +		sprintf(temp1, msg_txt(lang,222), temp, hours); // %s %d hours
  3393.  	if (minutes < 2)
  3394. -		sprintf(temp, msg_txt(223), temp1, minutes); // %s %d minute
  3395. +		sprintf(temp, msg_txt(lang,223), temp1, minutes); // %s %d minute
  3396.  	else
  3397. -		sprintf(temp, msg_txt(224), temp1, minutes); // %s %d minutes
  3398. +		sprintf(temp, msg_txt(lang,224), temp1, minutes); // %s %d minutes
  3399.  	if (seconds == 1)
  3400. -		sprintf(temp1, msg_txt(225), temp, seconds); // %s and %d second
  3401. +		sprintf(temp1, msg_txt(lang,225), temp, seconds); // %s and %d second
  3402.  	else if (seconds > 1)
  3403. -		sprintf(temp1, msg_txt(226), temp, seconds); // %s and %d seconds
  3404. +		sprintf(temp1, msg_txt(lang,226), temp, seconds); // %s and %d seconds
  3405.  
  3406.  	return temp1;
  3407.  }
  3408. @@ -4369,54 +4369,54 @@
  3409.  	time(&time_server);  // get time in seconds since 1/1/1970
  3410.  	datetime = localtime(&time_server); // convert seconds in structure
  3411.  	// like sprintf, but only for date/time (Sunday, November 02 2003 15:12:52)
  3412. -	strftime(temp, sizeof(temp)-1, msg_txt(230), datetime); // Server time (normal time): %A, %B %d %Y %X.
  3413. +	strftime(temp, sizeof(temp)-1, msg_txt(sd->lang,230), datetime); // Server time (normal time): %A, %B %d %Y %X.
  3414.  	clif_displaymessage(fd, temp);
  3415.  
  3416.  	if (battle_config.night_duration == 0 && battle_config.day_duration == 0) {
  3417.  		if (night_flag == 0)
  3418. -			clif_displaymessage(fd, msg_txt(231)); // Game time: The game is in permanent daylight.
  3419. +			clif_displaymessage(fd, msg_txt(sd->lang,231)); // Game time: The game is in permanent daylight.
  3420.  		else
  3421. -			clif_displaymessage(fd, msg_txt(232)); // Game time: The game is in permanent night.
  3422. +			clif_displaymessage(fd, msg_txt(sd->lang,232)); // Game time: The game is in permanent night.
  3423.  	} else if (battle_config.night_duration == 0)
  3424.  		if (night_flag == 1) { // we start with night
  3425.  			timer_data = get_timer(day_timer_tid);
  3426. -			sprintf(temp, msg_txt(233), txt_time(DIFF_TICK(timer_data->tick,gettick())/1000)); // Game time: The game is actualy in night for %s.
  3427. +			sprintf(temp, msg_txt(sd->lang,233), txt_time(sd->lang,DIFF_TICK(timer_data->tick,gettick())/1000)); // Game time: The game is actualy in night for %s.
  3428.  			clif_displaymessage(fd, temp);
  3429. -			clif_displaymessage(fd, msg_txt(234)); // Game time: After, the game will be in permanent daylight.
  3430. +			clif_displaymessage(fd, msg_txt(sd->lang,234)); // Game time: After, the game will be in permanent daylight.
  3431.  		} else
  3432. -			clif_displaymessage(fd, msg_txt(231)); // Game time: The game is in permanent daylight.
  3433. +			clif_displaymessage(fd, msg_txt(sd->lang,231)); // Game time: The game is in permanent daylight.
  3434.  	else if (battle_config.day_duration == 0)
  3435.  		if (night_flag == 0) { // we start with day
  3436.  			timer_data = get_timer(night_timer_tid);
  3437. -			sprintf(temp, msg_txt(235), txt_time(DIFF_TICK(timer_data->tick,gettick())/1000)); // Game time: The game is actualy in daylight for %s.
  3438. +			sprintf(temp, msg_txt(sd->lang,235), txt_time(sd->lang,DIFF_TICK(timer_data->tick,gettick())/1000)); // Game time: The game is actualy in daylight for %s.
  3439.  			clif_displaymessage(fd, temp);
  3440. -			clif_displaymessage(fd, msg_txt(236)); // Game time: After, the game will be in permanent night.
  3441. +			clif_displaymessage(fd, msg_txt(sd->lang,236)); // Game time: After, the game will be in permanent night.
  3442.  		} else
  3443. -			clif_displaymessage(fd, msg_txt(232)); // Game time: The game is in permanent night.
  3444. +			clif_displaymessage(fd, msg_txt(sd->lang,232)); // Game time: The game is in permanent night.
  3445.  	else {
  3446.  		if (night_flag == 0) {
  3447.  			timer_data = get_timer(night_timer_tid);
  3448.  			timer_data2 = get_timer(day_timer_tid);
  3449. -			sprintf(temp, msg_txt(235), txt_time(DIFF_TICK(timer_data->tick,gettick())/1000)); // Game time: The game is actualy in daylight for %s.
  3450. +			sprintf(temp, msg_txt(sd->lang,235), txt_time(sd->lang,DIFF_TICK(timer_data->tick,gettick())/1000)); // Game time: The game is actualy in daylight for %s.
  3451.  			clif_displaymessage(fd, temp);
  3452.  			if (DIFF_TICK(timer_data->tick, timer_data2->tick) > 0)
  3453. -				sprintf(temp, msg_txt(237), txt_time(DIFF_TICK(timer_data->interval,DIFF_TICK(timer_data->tick,timer_data2->tick)) / 1000)); // Game time: After, the game will be in night for %s.
  3454. +				sprintf(temp, msg_txt(sd->lang,237), txt_time(sd->lang,DIFF_TICK(timer_data->interval,DIFF_TICK(timer_data->tick,timer_data2->tick)) / 1000)); // Game time: After, the game will be in night for %s.
  3455.  			else
  3456. -				sprintf(temp, msg_txt(237), txt_time(DIFF_TICK(timer_data2->tick,timer_data->tick)/1000)); // Game time: After, the game will be in night for %s.
  3457. +				sprintf(temp, msg_txt(sd->lang,237), txt_time(sd->lang,DIFF_TICK(timer_data2->tick,timer_data->tick)/1000)); // Game time: After, the game will be in night for %s.
  3458.  			clif_displaymessage(fd, temp);
  3459. -			sprintf(temp, msg_txt(238), txt_time(timer_data->interval / 1000)); // Game time: A day cycle has a normal duration of %s.
  3460. +			sprintf(temp, msg_txt(sd->lang,238), txt_time(sd->lang,timer_data->interval / 1000)); // Game time: A day cycle has a normal duration of %s.
  3461.  			clif_displaymessage(fd, temp);
  3462.  		} else {
  3463.  			timer_data = get_timer(day_timer_tid);
  3464.  			timer_data2 = get_timer(night_timer_tid);
  3465. -			sprintf(temp, msg_txt(233), txt_time(DIFF_TICK(timer_data->tick,gettick()) / 1000)); // Game time: The game is actualy in night for %s.
  3466. +			sprintf(temp, msg_txt(sd->lang,233), txt_time(sd->lang,DIFF_TICK(timer_data->tick,gettick()) / 1000)); // Game time: The game is actualy in night for %s.
  3467.  			clif_displaymessage(fd, temp);
  3468.  			if (DIFF_TICK(timer_data->tick,timer_data2->tick) > 0)
  3469. -				sprintf(temp, msg_txt(239), txt_time((timer_data->interval - DIFF_TICK(timer_data->tick, timer_data2->tick)) / 1000)); // Game time: After, the game will be in daylight for %s.
  3470. +				sprintf(temp, msg_txt(sd->lang,239), txt_time(sd->lang,(timer_data->interval - DIFF_TICK(timer_data->tick, timer_data2->tick)) / 1000)); // Game time: After, the game will be in daylight for %s.
  3471.  			else
  3472. -				sprintf(temp, msg_txt(239), txt_time(DIFF_TICK(timer_data2->tick, timer_data->tick) / 1000)); // Game time: After, the game will be in daylight for %s.
  3473. +				sprintf(temp, msg_txt(sd->lang,239), txt_time(sd->lang,DIFF_TICK(timer_data2->tick, timer_data->tick) / 1000)); // Game time: After, the game will be in daylight for %s.
  3474.  			clif_displaymessage(fd, temp);
  3475. -			sprintf(temp, msg_txt(238), txt_time(timer_data->interval / 1000)); // Game time: A day cycle has a normal duration of %s.
  3476. +			sprintf(temp, msg_txt(sd->lang,238), txt_time(sd->lang,timer_data->interval / 1000)); // Game time: A day cycle has a normal duration of %s.
  3477.  			clif_displaymessage(fd, temp);
  3478.  		}
  3479.  	}
  3480. @@ -4466,24 +4466,24 @@
  3481.  	memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
  3482.  
  3483.  	if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
  3484. -		clif_displaymessage(fd, msg_txt(1134)); // Please enter a player name (usage: @jail <char_name>).
  3485. +		clif_displaymessage(fd, msg_txt(sd->lang,1134)); // Please enter a player name (usage: @jail <char_name>).
  3486.  		return -1;
  3487.  	}
  3488.  
  3489.  	if ((pl_sd = map_nick2sd(atcmd_player_name)) == NULL) {
  3490. -		clif_displaymessage(fd, msg_txt(3)); // Character not found.
  3491. +		clif_displaymessage(fd, msg_txt(sd->lang,3)); // Character not found.
  3492.  		return -1;
  3493.  	}
  3494.  
  3495.  	if (pc_get_group_level(sd) < pc_get_group_level(pl_sd))
  3496.    	{ // you can jail only lower or same GM
  3497. -		clif_displaymessage(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player.
  3498. +		clif_displaymessage(fd, msg_txt(sd->lang,81)); // Your GM level don't authorise you to do this action on this player.
  3499.  		return -1;
  3500.  	}
  3501.  
  3502.  	if (pl_sd->sc.data[SC_JAILED])
  3503.  	{
  3504. -		clif_displaymessage(fd, msg_txt(118)); // Player warped in jails.
  3505. +		clif_displaymessage(fd, msg_txt(sd->lang,118)); // Player warped in jails.
  3506.  		return -1;
  3507.  	}
  3508.  
  3509. @@ -4502,8 +4502,8 @@
  3510.  
  3511.  	//Duration of INT_MAX to specify infinity.
  3512.  	sc_start4(&pl_sd->bl,SC_JAILED,100,INT_MAX,m_index,x,y,1000);
  3513. -	clif_displaymessage(pl_sd->fd, msg_txt(117)); // GM has send you in jails.
  3514. -	clif_displaymessage(fd, msg_txt(118)); // Player warped in jails.
  3515. +	clif_displaymessage(pl_sd->fd, msg_txt(sd->lang,117)); // GM has send you in jails.
  3516. +	clif_displaymessage(fd, msg_txt(sd->lang,118)); // Player warped in jails.
  3517.  	return 0;
  3518.  }
  3519.  
  3520. @@ -4518,31 +4518,31 @@
  3521.  	memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
  3522.  
  3523.  	if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
  3524. -		clif_displaymessage(fd, msg_txt(1135)); // Please enter a player name (usage: @unjail/@discharge <char_name>).
  3525. +		clif_displaymessage(fd, msg_txt(sd->lang,1135)); // Please enter a player name (usage: @unjail/@discharge <char_name>).
  3526.  		return -1;
  3527.  	}
  3528.  
  3529.  	if ((pl_sd = map_nick2sd(atcmd_player_name)) == NULL) {
  3530. -		clif_displaymessage(fd, msg_txt(3)); // Character not found.
  3531. +		clif_displaymessage(fd, msg_txt(sd->lang,3)); // Character not found.
  3532.  		return -1;
  3533.  	}
  3534.  
  3535.  	if (pc_get_group_level(sd) < pc_get_group_level(pl_sd)) { // you can jail only lower or same GM
  3536.  
  3537. -		clif_displaymessage(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player.
  3538. +		clif_displaymessage(fd, msg_txt(sd->lang,81)); // Your GM level don't authorise you to do this action on this player.
  3539.  		return -1;
  3540.  	}
  3541.  
  3542.  	if (!pl_sd->sc.data[SC_JAILED])
  3543.  	{
  3544. -		clif_displaymessage(fd, msg_txt(119)); // This player is not in jails.
  3545. +		clif_displaymessage(fd, msg_txt(sd->lang,119)); // This player is not in jails.
  3546.  		return -1;
  3547.  	}
  3548.  
  3549.  	//Reset jail time to 1 sec.
  3550.  	sc_start(&pl_sd->bl,SC_JAILED,100,1,1000);
  3551. -	clif_displaymessage(pl_sd->fd, msg_txt(120)); // A GM has discharged you from jail.
  3552. -	clif_displaymessage(fd, msg_txt(121)); // Player unjailed.
  3553. +	clif_displaymessage(pl_sd->fd, msg_txt(sd->lang,120)); // A GM has discharged you from jail.
  3554. +	clif_displaymessage(fd, msg_txt(sd->lang,121)); // Player unjailed.
  3555.  	return 0;
  3556.  }
  3557.  
  3558. @@ -4556,7 +4556,7 @@
  3559.  	nullpo_retr(-1, sd);
  3560.  
  3561.  	if (!message || !*message || sscanf(message, "%255s %23[^\n]",atcmd_output,atcmd_player_name) < 2) {
  3562. -		clif_displaymessage(fd, msg_txt(400));	//Usage: @jailfor <time> <character name>
  3563. +		clif_displaymessage(fd, msg_txt(sd->lang,400));	//Usage: @jailfor <time> <character name>
  3564.  		return -1;
  3565.  	}
  3566.  
  3567. @@ -4598,24 +4598,24 @@
  3568.  	}
  3569.  
  3570.  	if (year == 0 && month == 0 && day == 0 && hour == 0 && minute == 0) {
  3571. -		clif_displaymessage(fd, msg_txt(1136)); // Invalid time for jail command.
  3572. +		clif_displaymessage(fd, msg_txt(sd->lang,1136)); // Invalid time for jail command.
  3573.  		return -1;
  3574.  	}
  3575.  
  3576.  	if ((pl_sd = map_nick2sd(atcmd_player_name)) == NULL) {
  3577. -		clif_displaymessage(fd, msg_txt(3)); // Character not found.
  3578. +		clif_displaymessage(fd, msg_txt(sd->lang,3)); // Character not found.
  3579.  		return -1;
  3580.  	}
  3581.  
  3582.  	if (pc_get_group_level(pl_sd) > pc_get_group_level(sd)) {
  3583. -		clif_displaymessage(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player.
  3584. +		clif_displaymessage(fd, msg_txt(sd->lang,81)); // Your GM level don't authorise you to do this action on this player.
  3585.  		return -1;
  3586.  	}
  3587.  
  3588.  	jailtime = year*12*30*24*60 + month*30*24*60 + day*24*60 + hour*60 + minute;	//In minutes
  3589.  
  3590.  	if(jailtime==0) {
  3591. -		clif_displaymessage(fd, msg_txt(1136)); // Invalid time for jail command.
  3592. +		clif_displaymessage(fd, msg_txt(sd->lang,1136)); // Invalid time for jail command.
  3593.  		return -1;
  3594.  	}
  3595.  
  3596. @@ -4626,17 +4626,17 @@
  3597.  		jailtime += pl_sd->sc.data[SC_JAILED]->val1;
  3598.  		if (jailtime <= 0) {
  3599.  			jailtime = 0;
  3600. -			clif_displaymessage(pl_sd->fd, msg_txt(120)); // GM has discharge you.
  3601. -			clif_displaymessage(fd, msg_txt(121)); // Player unjailed
  3602. +			clif_displaymessage(pl_sd->fd, msg_txt(sd->lang,120)); // GM has discharge you.
  3603. +			clif_displaymessage(fd, msg_txt(sd->lang,121)); // Player unjailed
  3604.  		} else {
  3605.  			get_jail_time(jailtime,&year,&month,&day,&hour,&minute);
  3606. -			sprintf(atcmd_output,msg_txt(402),msg_txt(1137),year,month,day,hour,minute); //%s in jail for %d years, %d months, %d days, %d hours and %d minutes
  3607. +			sprintf(atcmd_output,msg_txt(sd->lang,402),msg_txt(sd->lang,1137),year,month,day,hour,minute); //%s in jail for %d years, %d months, %d days, %d hours and %d minutes
  3608.  	 		clif_displaymessage(pl_sd->fd, atcmd_output);
  3609. -			sprintf(atcmd_output,msg_txt(402),msg_txt(1138),year,month,day,hour,minute); //This player is now in jail for %d years, %d months, %d days, %d hours and %d minutes
  3610. +			sprintf(atcmd_output,msg_txt(sd->lang,402),msg_txt(sd->lang,1138),year,month,day,hour,minute); //This player is now in jail for %d years, %d months, %d days, %d hours and %d minutes
  3611.  	 		clif_displaymessage(fd, atcmd_output);
  3612.  		}
  3613.  	} else if (jailtime < 0) {
  3614. -		clif_displaymessage(fd, msg_txt(1136));
  3615. +		clif_displaymessage(fd, msg_txt(sd->lang,1136));
  3616.  		return -1;
  3617.  	}
  3618.  
  3619. @@ -4666,23 +4666,23 @@
  3620.  	nullpo_retr(-1, sd);
  3621.  
  3622.  	if (!sd->sc.data[SC_JAILED]) {
  3623. -		clif_displaymessage(fd, msg_txt(1139)); // You are not in jail.
  3624. +		clif_displaymessage(fd, msg_txt(sd->lang,1139)); // You are not in jail.
  3625.  		return -1;
  3626.  	}
  3627.  
  3628.  	if (sd->sc.data[SC_JAILED]->val1 == INT_MAX) {
  3629. -		clif_displaymessage(fd, msg_txt(1140)); // You have been jailed indefinitely.
  3630. +		clif_displaymessage(fd, msg_txt(sd->lang,1140)); // You have been jailed indefinitely.
  3631.  		return 0;
  3632.  	}
  3633.  
  3634.  	if (sd->sc.data[SC_JAILED]->val1 <= 0) { // Was not jailed with @jailfor (maybe @jail? or warped there? or got recalled?)
  3635. -		clif_displaymessage(fd, msg_txt(1141)); // You have been jailed for an unknown amount of time.
  3636. +		clif_displaymessage(fd, msg_txt(sd->lang,1141)); // You have been jailed for an unknown amount of time.
  3637.  		return -1;
  3638.  	}
  3639.  
  3640.  	//Get remaining jail time
  3641.  	get_jail_time(sd->sc.data[SC_JAILED]->val1,&year,&month,&day,&hour,&minute);
  3642. -	sprintf(atcmd_output,msg_txt(402),msg_txt(1142),year,month,day,hour,minute); // You will remain in jail for %d years, %d months, %d days, %d hours and %d minutes
  3643. +	sprintf(atcmd_output,msg_txt(sd->lang,402),msg_txt(sd->lang,1142),year,month,day,hour,minute); // You will remain in jail for %d years, %d months, %d days, %d hours and %d minutes
  3644.  
  3645.  	clif_displaymessage(fd, atcmd_output);
  3646.  
  3647. @@ -4698,7 +4698,7 @@
  3648.  	nullpo_retr(-1, sd);
  3649.  
  3650.  	if (!message || !*message) {
  3651. -		clif_displaymessage(fd, msg_txt(1143)); // Please enter a Monster/NPC name/ID (usage: @disguise <name/ID>).
  3652. +		clif_displaymessage(fd, msg_txt(sd->lang,1143)); // Please enter a Monster/NPC name/ID (usage: @disguise <name/ID>).
  3653.  		return -1;
  3654.  	}
  3655.  
  3656. @@ -4717,18 +4717,18 @@
  3657.  
  3658.  	if (id == 0)
  3659.  	{
  3660. -		clif_displaymessage(fd, msg_txt(123));	// Invalid Monster/NPC name/ID specified.
  3661. +		clif_displaymessage(fd, msg_txt(sd->lang,123));	// Invalid Monster/NPC name/ID specified.
  3662.  		return -1;
  3663.  	}
  3664.  
  3665.  	if(pc_isriding(sd))
  3666.  	{
  3667. -		clif_displaymessage(fd, msg_txt(1144)); // Character cannot be disguised while mounted.
  3668. +		clif_displaymessage(fd, msg_txt(sd->lang,1144)); // Character cannot be disguised while mounted.
  3669.  		return -1;
  3670.  	}
  3671.  
  3672.  	pc_disguise(sd, id);
  3673. -	clif_displaymessage(fd, msg_txt(122)); // Disguise applied.
  3674. +	clif_displaymessage(fd, msg_txt(sd->lang,122)); // Disguise applied.
  3675.  
  3676.  	return 0;
  3677.  }
  3678. @@ -4744,7 +4744,7 @@
  3679.  	nullpo_retr(-1, sd);
  3680.  
  3681.  	if (!message || !*message) {
  3682. -		clif_displaymessage(fd, msg_txt(1145)); // Please enter a Monster/NPC name/ID (usage: @disguiseall <name/ID>).
  3683. +		clif_displaymessage(fd, msg_txt(sd->lang,1145)); // Please enter a Monster/NPC name/ID (usage: @disguiseall <name/ID>).
  3684.  		return -1;
  3685.  	}
  3686.  
  3687. @@ -4752,7 +4752,7 @@
  3688.  		mob_id = atoi(message);
  3689.  
  3690.  	if (!mobdb_checkid(mob_id) && !npcdb_checkid(mob_id)) { //if mob or npc...
  3691. -		clif_displaymessage(fd, msg_txt(123)); // Monster/NPC name/id not found.
  3692. +		clif_displaymessage(fd, msg_txt(sd->lang,123)); // Monster/NPC name/id not found.
  3693.  		return -1;
  3694.  	}
  3695.  
  3696. @@ -4761,7 +4761,7 @@
  3697.  		pc_disguise(pl_sd, mob_id);
  3698.  	mapit_free(iter);
  3699.  
  3700. -	clif_displaymessage(fd, msg_txt(122)); // Disguise applied.
  3701. +	clif_displaymessage(fd, msg_txt(sd->lang,122)); // Disguise applied.
  3702.  	return 0;
  3703.  }
  3704.  
  3705. @@ -4779,7 +4779,7 @@
  3706.  	memset(guild, '\0', sizeof(guild));
  3707.  
  3708.  	if( !message || !*message || sscanf(message, "%23[^,], %23[^\r\n]", monster, guild) < 2 ) {
  3709. -		clif_displaymessage(fd, msg_txt(1146)); // Please enter a mob name/ID and guild name/ID (usage: @disguiseguild <mob name/ID>, <guild name/ID>).
  3710. +		clif_displaymessage(fd, msg_txt(sd->lang,1146)); // Please enter a mob name/ID and guild name/ID (usage: @disguiseguild <mob name/ID>, <guild name/ID>).
  3711.  		return -1;
  3712.  	}
  3713.  
  3714. @@ -4795,12 +4795,12 @@
  3715.  	}
  3716.  
  3717.  	if( id == 0 ) {
  3718. -		clif_displaymessage(fd, msg_txt(123));	// Monster/NPC name/id hasn't been found.
  3719. +		clif_displaymessage(fd, msg_txt(sd->lang,123));	// Monster/NPC name/id hasn't been found.
  3720.  		return -1;
  3721.  	}
  3722.  
  3723.  	if( (g = guild_searchname(guild)) == NULL && (g = guild_search(atoi(guild))) == NULL ) {
  3724. -		clif_displaymessage(fd, msg_txt(94)); // Incorrect name/ID, or no one from the guild is online.
  3725. +		clif_displaymessage(fd, msg_txt(sd->lang,94)); // Incorrect name/ID, or no one from the guild is online.
  3726.  		return -1;
  3727.  	}
  3728.  
  3729. @@ -4808,7 +4808,7 @@
  3730.  		if( (pl_sd = g->member[i].sd) && !pc_isriding(pl_sd) )
  3731.  			pc_disguise(pl_sd, id);
  3732.  
  3733. -	clif_displaymessage(fd, msg_txt(122)); // Disguise applied.
  3734. +	clif_displaymessage(fd, msg_txt(sd->lang,122)); // Disguise applied.
  3735.  	return 0;
  3736.  }
  3737.  
  3738. @@ -4821,9 +4821,9 @@
  3739.  	nullpo_retr(-1, sd);
  3740.  	if (sd->disguise) {
  3741.  		pc_disguise(sd, 0);
  3742. -		clif_displaymessage(fd, msg_txt(124)); // Undisguise applied.
  3743. +		clif_displaymessage(fd, msg_txt(sd->lang,124)); // Undisguise applied.
  3744.  	} else {
  3745. -		clif_displaymessage(fd, msg_txt(125)); // You're not disguised.
  3746. +		clif_displaymessage(fd, msg_txt(sd->lang,125)); // You're not disguised.
  3747.  		return -1;
  3748.  	}
  3749.  
  3750. @@ -4845,7 +4845,7 @@
  3751.  			pc_disguise(pl_sd, 0);
  3752.  	mapit_free(iter);
  3753.  
  3754. -	clif_displaymessage(fd, msg_txt(124)); // Undisguise applied.
  3755. +	clif_displaymessage(fd, msg_txt(sd->lang,124)); // Undisguise applied.
  3756.  
  3757.  	return 0;
  3758.  }
  3759. @@ -4864,12 +4864,12 @@
  3760.  	memset(guild_name, '\0', sizeof(guild_name));
  3761.  
  3762.  	if(!message || !*message || sscanf(message, "%23[^\n]", guild_name) < 1) {
  3763. -		clif_displaymessage(fd, msg_txt(1147)); // Please enter guild name/ID (usage: @undisguiseguild <guild name/ID>).
  3764. +		clif_displaymessage(fd, msg_txt(sd->lang,1147)); // Please enter guild name/ID (usage: @undisguiseguild <guild name/ID>).
  3765.  		return -1;
  3766.  	}
  3767.  
  3768.  	if( (g = guild_searchname(guild_name)) == NULL && (g = guild_search(atoi(message))) == NULL ) {
  3769. -		clif_displaymessage(fd, msg_txt(94)); // Incorrect name/ID, or no one from the guild is online.
  3770. +		clif_displaymessage(fd, msg_txt(sd->lang,94)); // Incorrect name/ID, or no one from the guild is online.
  3771.  		return -1;
  3772.  	}
  3773.  
  3774. @@ -4877,7 +4877,7 @@
  3775.  		if( (pl_sd = g->member[i].sd) && pl_sd->disguise )
  3776.  			pc_disguise(pl_sd, 0);
  3777.  
  3778. -	clif_displaymessage(fd, msg_txt(124)); // Undisguise applied.
  3779. +	clif_displaymessage(fd, msg_txt(sd->lang,124)); // Undisguise applied.
  3780.  
  3781.  	return 0;
  3782.  }
  3783. @@ -4900,7 +4900,7 @@
  3784.  	if (nextj)
  3785.  		nextj = sd->status.job_exp*100.0/nextj;
  3786.  
  3787. -	sprintf(output, msg_txt(1148), sd->status.base_level, nextb, sd->status.job_level, nextj); // Base Level: %d (%.3f%%) | Job Level: %d (%.3f%%)
  3788. +	sprintf(output, msg_txt(sd->lang,1148), sd->status.base_level, nextb, sd->status.job_level, nextj); // Base Level: %d (%.3f%%) | Job Level: %d (%.3f%%)
  3789.  	clif_displaymessage(fd, output);
  3790.  	return 0;
  3791.  }
  3792. @@ -4916,7 +4916,7 @@
  3793.  	memset(atcmd_output, '\0', sizeof(atcmd_output));
  3794.  
  3795.  	if (!message || !*message) {
  3796. -		clif_displaymessage(fd, msg_txt(1149)); // Please enter a message (usage: @broadcast <message>).
  3797. +		clif_displaymessage(fd, msg_txt(sd->lang,1149)); // Please enter a message (usage: @broadcast <message>).
  3798.  		return -1;
  3799.  	}
  3800.  
  3801. @@ -4936,7 +4936,7 @@
  3802.  	memset(atcmd_output, '\0', sizeof(atcmd_output));
  3803.  
  3804.  	if (!message || !*message) {
  3805. -		clif_displaymessage(fd, msg_txt(1150)); // Please enter a message (usage: @localbroadcast <message>).
  3806. +		clif_displaymessage(fd, msg_txt(sd->lang,1150)); // Please enter a message (usage: @localbroadcast <message>).
  3807.  		return -1;
  3808.  	}
  3809.  
  3810. @@ -4960,26 +4960,26 @@
  3811.  	memset(new_email, '\0', sizeof(new_email));
  3812.  
  3813.  	if (!message || !*message || sscanf(message, "%99s %99s", actual_email, new_email) < 2) {
  3814. -		clif_displaymessage(fd, msg_txt(1151)); // Please enter 2 emails (usage: @email <actual@email> <new@email>).
  3815. +		clif_displaymessage(fd, msg_txt(sd->lang,1151)); // Please enter 2 emails (usage: @email <actual@email> <new@email>).
  3816.  		return -1;
  3817.  	}
  3818.  
  3819.  	if (e_mail_check(actual_email) == 0) {
  3820. -		clif_displaymessage(fd, msg_txt(144)); // Invalid actual email. If you have default e-mail, give [email protected].
  3821. +		clif_displaymessage(fd, msg_txt(sd->lang,144)); // Invalid actual email. If you have default e-mail, give [email protected].
  3822.  		return -1;
  3823.  	} else if (e_mail_check(new_email) == 0) {
  3824. -		clif_displaymessage(fd, msg_txt(145)); // Invalid new email. Please enter a real e-mail.
  3825. +		clif_displaymessage(fd, msg_txt(sd->lang,145)); // Invalid new email. Please enter a real e-mail.
  3826.  		return -1;
  3827.  	} else if (strcmpi(new_email, "[email protected]") == 0) {
  3828. -		clif_displaymessage(fd, msg_txt(146)); // New email must be a real e-mail.
  3829. +		clif_displaymessage(fd, msg_txt(sd->lang,146)); // New email must be a real e-mail.
  3830.  		return -1;
  3831.  	} else if (strcmpi(actual_email, new_email) == 0) {
  3832. -		clif_displaymessage(fd, msg_txt(147)); // New email must be different of the actual e-mail.
  3833. +		clif_displaymessage(fd, msg_txt(sd->lang,147)); // New email must be different of the actual e-mail.
  3834.  		return -1;
  3835.  	}
  3836.  
  3837.  	chrif_changeemail(sd->status.account_id, actual_email, new_email);
  3838. -	clif_displaymessage(fd, msg_txt(148)); // Information sended to login-server via char-server.
  3839. +	clif_displaymessage(fd, msg_txt(sd->lang,148)); // Information sended to login-server via char-server.
  3840.  	return 0;
  3841.  }
  3842.  
  3843. @@ -4992,12 +4992,12 @@
  3844.  	nullpo_retr(-1, sd);
  3845.  
  3846.  	if (!message || !*message || sscanf(message, "%d", &type) < 1) {
  3847. -		clif_displaymessage(fd, msg_txt(1152)); // Please enter an effect number (usage: @effect <effect number>).
  3848. +		clif_displaymessage(fd, msg_txt(sd->lang,1152)); // Please enter an effect number (usage: @effect <effect number>).
  3849.  		return -1;
  3850.  	}
  3851.  
  3852.  	clif_specialeffect(&sd->bl, type, (send_target)flag);
  3853. -	clif_displaymessage(fd, msg_txt(229)); // Your effect has changed.
  3854. +	clif_displaymessage(fd, msg_txt(sd->lang,229)); // Your effect has changed.
  3855.  	return 0;
  3856.  }
  3857.  
  3858. @@ -5011,9 +5011,9 @@
  3859.  	sd->state.killer = !sd->state.killer;
  3860.  
  3861.  	if(sd->state.killer)
  3862. -		clif_displaymessage(fd, msg_txt(241));
  3863. +		clif_displaymessage(fd, msg_txt(sd->lang,241));
  3864.  	else {
  3865. -		clif_displaymessage(fd, msg_txt(292));
  3866. +		clif_displaymessage(fd, msg_txt(sd->lang,292));
  3867.  		pc_stop_attack(sd);
  3868.  	}
  3869.  	return 0;
  3870. @@ -5029,9 +5029,9 @@
  3871.  	sd->state.killable = !sd->state.killable;
  3872.  
  3873.  	if(sd->state.killable)
  3874. -		clif_displaymessage(fd, msg_txt(242));
  3875. +		clif_displaymessage(fd, msg_txt(sd->lang,242));
  3876.  	else {
  3877. -		clif_displaymessage(fd, msg_txt(288));
  3878. +		clif_displaymessage(fd, msg_txt(sd->lang,288));
  3879.  		map_foreachinrange(atcommand_stopattack,&sd->bl, AREA_SIZE, BL_CHAR, sd->bl.id);
  3880.  	}
  3881.  	return 0;
  3882. @@ -5045,7 +5045,7 @@
  3883.  {
  3884.  	nullpo_retr(-1, sd);
  3885.  	map[sd->bl.m].flag.noskill = 0;
  3886. -	clif_displaymessage(fd, msg_txt(244));
  3887. +	clif_displaymessage(fd, msg_txt(sd->lang,244));
  3888.  	return 0;
  3889.  }
  3890.  
  3891. @@ -5057,7 +5057,7 @@
  3892.  {
  3893.  	nullpo_retr(-1, sd);
  3894.  	map[sd->bl.m].flag.noskill = 1;
  3895. -	clif_displaymessage(fd, msg_txt(243));
  3896. +	clif_displaymessage(fd, msg_txt(sd->lang,243));
  3897.  	return 0;
  3898.  }
  3899.  
  3900. @@ -5073,19 +5073,19 @@
  3901.  	memset(atcmd_player_name, '\0', sizeof atcmd_player_name);
  3902.  
  3903.  	if (!message || !*message || sscanf(message, "%d %d %23[^\n]", &x, &y, atcmd_player_name) < 3) {
  3904. -		clif_displaymessage(fd, msg_txt(1153)); // Usage: @npcmove <X> <Y> <npc_name>
  3905. +		clif_displaymessage(fd, msg_txt(sd->lang,1153)); // Usage: @npcmove <X> <Y> <npc_name>
  3906.  		return -1;
  3907.  	}
  3908.  
  3909.  	if ((nd = npc_name2id(atcmd_player_name)) == NULL)
  3910.  	{
  3911. -		clif_displaymessage(fd, msg_txt(111)); // This NPC doesn't exist.
  3912. +		clif_displaymessage(fd, msg_txt(sd->lang,111)); // This NPC doesn't exist.
  3913.  		return -1;
  3914.  	}
  3915.  
  3916.  	if ((m=nd->bl.m) < 0 || nd->bl.prev == NULL)
  3917.  	{
  3918. -		clif_displaymessage(fd, msg_txt(1154)); // NPC is not on this map.
  3919. +		clif_displaymessage(fd, msg_txt(sd->lang,1154)); // NPC is not on this map.
  3920.  		return -1;	//Not on a map.
  3921.  	}
  3922.  
  3923. @@ -5094,7 +5094,7 @@
  3924.  	map_foreachinrange(clif_outsight, &nd->bl, AREA_SIZE, BL_PC, &nd->bl);
  3925.  	map_moveblock(&nd->bl, x, y, gettick());
  3926.  	map_foreachinrange(clif_insight, &nd->bl, AREA_SIZE, BL_PC, &nd->bl);
  3927. -	clif_displaymessage(fd, msg_txt(1155)); // NPC moved.
  3928. +	clif_displaymessage(fd, msg_txt(sd->lang,1155)); // NPC moved.
  3929.  
  3930.  	return 0;
  3931.  }
  3932. @@ -5114,14 +5114,14 @@
  3933.  	memset(warpname, '\0', sizeof(warpname));
  3934.  
  3935.  	if (!message || !*message || sscanf(message, "%31s %d %d %23[^\n]", mapname, &x, &y, warpname) < 4) {
  3936. -		clif_displaymessage(fd, msg_txt(1156)); // Usage: @addwarp <mapname> <X> <Y> <npc name>
  3937. +		clif_displaymessage(fd, msg_txt(sd->lang,1156)); // Usage: @addwarp <mapname> <X> <Y> <npc name>
  3938.  		return -1;
  3939.  	}
  3940.  
  3941.  	m = mapindex_name2id(mapname);
  3942.  	if( m == 0 )
  3943.  	{
  3944. -		sprintf(atcmd_output, msg_txt(1157), mapname); // Unknown map '%s'.
  3945. +		sprintf(atcmd_output, msg_txt(sd->lang,1157), mapname); // Unknown map '%s'.
  3946.  		clif_displaymessage(fd, atcmd_output);
  3947.  		return -1;
  3948.  	}
  3949. @@ -5130,7 +5130,7 @@
  3950.  	if( nd == NULL )
  3951.  		return -1;
  3952.  
  3953. -	sprintf(atcmd_output, msg_txt(1158), nd->exname); // New warp NPC '%s' created.
  3954. +	sprintf(atcmd_output, msg_txt(sd->lang,1158), nd->exname); // New warp NPC '%s' created.
  3955.  	clif_displaymessage(fd, atcmd_output);
  3956.  	return 0;
  3957.  }
  3958. @@ -5149,22 +5149,22 @@
  3959.  			return -1;
  3960.  
  3961.  		pc_stop_following (sd);
  3962. -		clif_displaymessage(fd, msg_txt(1159)); // Follow mode OFF.
  3963. +		clif_displaymessage(fd, msg_txt(sd->lang,1159)); // Follow mode OFF.
  3964.  		return 0;
  3965.  	}
  3966.  
  3967.  	if ( (pl_sd = map_nick2sd((char *)message)) == NULL )
  3968.  	{
  3969. -		clif_displaymessage(fd, msg_txt(3)); // Character not found.
  3970. +		clif_displaymessage(fd, msg_txt(sd->lang,3)); // Character not found.
  3971.  		return -1;
  3972.  	}
  3973.  
  3974.  	if (sd->followtarget == pl_sd->bl.id) {
  3975.  		pc_stop_following (sd);
  3976. -		clif_displaymessage(fd, msg_txt(1159)); // Follow mode OFF.
  3977. +		clif_displaymessage(fd, msg_txt(sd->lang,1159)); // Follow mode OFF.
  3978.  	} else {
  3979.  		pc_follow(sd, pl_sd->bl.id);
  3980. -		clif_displaymessage(fd, msg_txt(1160)); // Follow mode ON.
  3981. +		clif_displaymessage(fd, msg_txt(sd->lang,1160)); // Follow mode ON.
  3982.  	}
  3983.  
  3984.  	return 0;
  3985. @@ -5201,7 +5201,7 @@
  3986.  	if (sd->state.storage_flag != 1)
  3987.    	{	//Open storage.
  3988.  		if( storage_storageopen(sd) == 1 ) {
  3989. -			clif_displaymessage(fd, msg_txt(1161)); // You currently cannot open your storage.
  3990. +			clif_displaymessage(fd, msg_txt(sd->lang,1161)); // You currently cannot open your storage.
  3991.  			return -1;
  3992.  		}
  3993.  	}
  3994. @@ -5215,7 +5215,7 @@
  3995.  	}
  3996.  	storage_storageclose(sd);
  3997.  
  3998. -	clif_displaymessage(fd, msg_txt(1162)); // All items stored.
  3999. +	clif_displaymessage(fd, msg_txt(sd->lang,1162)); // All items stored.
  4000.  	return 0;
  4001.  }
  4002.  
  4003. @@ -5225,7 +5225,7 @@
  4004.  	nullpo_retr(-1, sd);
  4005.  
  4006.  	if (sd->state.storage_flag == 1) {
  4007. -		clif_displaymessage(fd, msg_txt(250));
  4008. +		clif_displaymessage(fd, msg_txt(sd->lang,250));
  4009.  		return -1;
  4010.  	}
  4011.  
  4012. @@ -5235,7 +5235,7 @@
  4013.  	}
  4014.  	storage_storageclose(sd);
  4015.  
  4016. -	clif_displaymessage(fd, msg_txt(1394)); // Your storage was cleaned.
  4017. +	clif_displaymessage(fd, msg_txt(sd->lang,1394)); // Your storage was cleaned.
  4018.  	return 0;
  4019.  }
  4020.  
  4021. @@ -5249,17 +5249,17 @@
  4022.  	g = guild_search(sd->status.guild_id);
  4023.  
  4024.  	if (g == NULL) {
  4025. -		clif_displaymessage(fd, msg_txt(43));
  4026. +		clif_displaymessage(fd, msg_txt(sd->lang,43));
  4027.  		return -1;
  4028.  	}
  4029.  
  4030.  	if (sd->state.storage_flag == 1) {
  4031. -		clif_displaymessage(fd, msg_txt(250));
  4032. +		clif_displaymessage(fd, msg_txt(sd->lang,250));
  4033.  		return -1;
  4034.  	}
  4035.  
  4036.  	if (sd->state.storage_flag == 2) {
  4037. -		clif_displaymessage(fd, msg_txt(251));
  4038. +		clif_displaymessage(fd, msg_txt(sd->lang,251));
  4039.  		return -1;
  4040.  	}
  4041.  
  4042. @@ -5276,7 +5276,7 @@
  4043.  	storage_guild_storageclose(sd);
  4044.  	gstorage->lock = 0; // Cleaning done, release lock
  4045.  
  4046. -	clif_displaymessage(fd, msg_txt(1395)); // Your guild storage was cleaned.
  4047. +	clif_displaymessage(fd, msg_txt(sd->lang,1395)); // Your guild storage was cleaned.
  4048.  	return 0;
  4049.  }
  4050.  
  4051. @@ -5286,7 +5286,7 @@
  4052.  	nullpo_retr(-1, sd);
  4053.  
  4054.  	if (pc_iscarton(sd) == 0) {
  4055. -		clif_displaymessage(fd, msg_txt(1396)); // You do not have a cart to be cleaned.
  4056. +		clif_displaymessage(fd, msg_txt(sd->lang,1396)); // You do not have a cart to be cleaned.
  4057.  		return -1;
  4058.  	}
  4059.  
  4060. @@ -5301,7 +5301,7 @@
  4061.  	clif_clearcart(fd);
  4062.  	clif_updatestatus(sd,SP_CARTINFO);
  4063.  
  4064. -	clif_displaymessage(fd, msg_txt(1397)); // Your cart was cleaned.
  4065. +	clif_displaymessage(fd, msg_txt(sd->lang,1397)); // Your cart was cleaned.
  4066.  	return 0;
  4067.  }
  4068.  
  4069. @@ -5322,7 +5322,7 @@
  4070.  	nullpo_retr(-1, sd);
  4071.  
  4072.  	if (!message || !*message) {
  4073. -		clif_displaymessage(fd, msg_txt(1163)); // Please enter a skill name to look up (usage: @skillid <skill name>).
  4074. +		clif_displaymessage(fd, msg_txt(sd->lang,1163)); // Please enter a skill name to look up (usage: @skillid <skill name>).
  4075.  		return -1;
  4076.  	}
  4077.  
  4078. @@ -5333,17 +5333,17 @@
  4079.  	for( data = iter->first(iter,&key); iter->exists(iter); data = iter->next(iter,&key) ) {
  4080.  		idx = skill_get_index(db_data2i(data));
  4081.  		if (strnicmp(key.str, message, skillen) == 0 || strnicmp(skill_db[idx].desc, message, skillen) == 0) {
  4082. -			sprintf(atcmd_output, msg_txt(1164), db_data2i(data), skill_db[idx].desc, key.str); // skill %d: %s (%s)
  4083. +			sprintf(atcmd_output, msg_txt(sd->lang,1164), db_data2i(data), skill_db[idx].desc, key.str); // skill %d: %s (%s)
  4084.  			clif_displaymessage(fd, atcmd_output);
  4085.  		} else if ( found < MAX_SKILLID_PARTIAL_RESULTS && ( stristr(key.str,message) || stristr(skill_db[idx].desc,message) ) ) {
  4086. -			snprintf(partials[found++], MAX_SKILLID_PARTIAL_RESULTS_LEN, msg_txt(1164), db_data2i(data), skill_db[idx].desc, key.str);
  4087. +			snprintf(partials[found++], MAX_SKILLID_PARTIAL_RESULTS_LEN, msg_txt(sd->lang,1164), db_data2i(data), skill_db[idx].desc, key.str);
  4088.  		}
  4089.  	}
  4090.  
  4091.  	dbi_destroy(iter);
  4092.  
  4093.  	if( found ) {
  4094. -		sprintf(atcmd_output, msg_txt(1398), found); // -- Displaying first %d partial matches
  4095. +		sprintf(atcmd_output, msg_txt(sd->lang,1398), found); // -- Displaying first %d partial matches
  4096.  		clif_displaymessage(fd, atcmd_output);
  4097.  	}
  4098.  
  4099. @@ -5368,19 +5368,19 @@
  4100.  	nullpo_retr(-1, sd);
  4101.  
  4102.  	if(!message || !*message || sscanf(message, "%hu %hu %23[^\n]", &skill_id, &skill_lv, target) != 3) {
  4103. -		clif_displaymessage(fd, msg_txt(1165)); // Usage: @useskill <skill ID> <skill level> <target>
  4104. +		clif_displaymessage(fd, msg_txt(sd->lang,1165)); // Usage: @useskill <skill ID> <skill level> <target>
  4105.  		return -1;
  4106.  	}
  4107.  
  4108.  	if(!strcmp(target,"self")) pl_sd = sd; //quick keyword
  4109.  	else if ( (pl_sd = map_nick2sd(target)) == NULL ){
  4110. -		clif_displaymessage(fd, msg_txt(3)); // Character not found.
  4111. +		clif_displaymessage(fd, msg_txt(sd->lang,3)); // Character not found.
  4112.  		return -1;
  4113.  	}
  4114.  
  4115.  	if ( pc_get_group_level(sd) < pc_get_group_level(pl_sd) )
  4116.  	{
  4117. -		clif_displaymessage(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player.
  4118. +		clif_displaymessage(fd, msg_txt(sd->lang,81)); // Your GM level don't authorise you to do this action on this player.
  4119.  		return -1;
  4120.  	}
  4121.  
  4122. @@ -5413,7 +5413,7 @@
  4123.  
  4124.  	if (!message || !*message || sscanf(message, "%hu %hu", &skill_id, &skill_lv) < 1)
  4125.  	{
  4126. -		clif_displaymessage(fd, msg_txt(1166)); // Usage: @displayskill <skill ID> {<skill level>}
  4127. +		clif_displaymessage(fd, msg_txt(sd->lang,1166)); // Usage: @displayskill <skill ID> {<skill level>}
  4128.  		return -1;
  4129.  	}
  4130.  	status = status_get_status_data(&sd->bl);
  4131. @@ -5438,26 +5438,26 @@
  4132.  	nullpo_retr(-1, sd);
  4133.  
  4134.  	if(!message || !*message || sscanf(message, "%hu %23[^\r\n]", &skill_id, target) != 2) {
  4135. -		clif_displaymessage(fd, msg_txt(1167)); // Usage: @skilltree <skill ID> <target>
  4136. +		clif_displaymessage(fd, msg_txt(sd->lang,1167)); // Usage: @skilltree <skill ID> <target>
  4137.  		return -1;
  4138.  	}
  4139.  
  4140.  	if ( (pl_sd = map_nick2sd(target)) == NULL )
  4141.  	{
  4142. -		clif_displaymessage(fd, msg_txt(3)); // Character not found.
  4143. +		clif_displaymessage(fd, msg_txt(sd->lang,3)); // Character not found.
  4144.  		return -1;
  4145.  	}
  4146.  
  4147.  	c = pc_calc_skilltree_normalize_job(pl_sd);
  4148.  	c = pc_mapid2jobid(c, pl_sd->status.sex);
  4149.  
  4150. -	sprintf(atcmd_output, msg_txt(1168), job_name(c), pc_checkskill(pl_sd, NV_BASIC)); // Player is using %s skill tree (%d basic points).
  4151. +	sprintf(atcmd_output, msg_txt(sd->lang,1168), job_name(c), pc_checkskill(pl_sd, NV_BASIC)); // Player is using %s skill tree (%d basic points).
  4152.  	clif_displaymessage(fd, atcmd_output);
  4153.  
  4154.  	ARR_FIND( 0, MAX_SKILL_TREE, j, skill_tree[c][j].id == 0 || skill_tree[c][j].id == skill_id );
  4155.  	if( j == MAX_SKILL_TREE || skill_tree[c][j].id == 0 )
  4156.  	{
  4157. -		clif_displaymessage(fd, msg_txt(1169)); // The player cannot use that skill.
  4158. +		clif_displaymessage(fd, msg_txt(sd->lang,1169)); // The player cannot use that skill.
  4159.  		return 0;
  4160.  	}
  4161.  
  4162. @@ -5468,13 +5468,13 @@
  4163.  	{
  4164.  		if( ent->need[j].id && pc_checkskill(sd,ent->need[j].id) < ent->need[j].lv)
  4165.  		{
  4166. -			sprintf(atcmd_output, msg_txt(1170), ent->need[j].lv, skill_db[ent->need[j].id].desc); // Player requires level %d of skill %s.
  4167. +			sprintf(atcmd_output, msg_txt(sd->lang,1170), ent->need[j].lv, skill_db[ent->need[j].id].desc); // Player requires level %d of skill %s.
  4168.  			clif_displaymessage(fd, atcmd_output);
  4169.  			meets = 0;
  4170.  		}
  4171.  	}
  4172.  	if (meets == 1) {
  4173. -		clif_displaymessage(fd, msg_txt(1171)); // The player meets all the requirements for that skill.
  4174. +		clif_displaymessage(fd, msg_txt(sd->lang,1171)); // The player meets all the requirements for that skill.
  4175.  	}
  4176.  
  4177.  	return 0;
  4178. @@ -5512,24 +5512,24 @@
  4179.  	nullpo_retr(-1, sd);
  4180.  
  4181.  	if (!message || !*message || sscanf(message, "%23s", player_name) != 1) {
  4182. -		clif_displaymessage(fd, msg_txt(1172)); // Usage: @marry <char name>
  4183. +		clif_displaymessage(fd, msg_txt(sd->lang,1172)); // Usage: @marry <char name>
  4184.  		return -1;
  4185.  	}
  4186.  
  4187.  	if ((pl_sd = map_nick2sd(player_name)) == NULL) {
  4188. -		clif_displaymessage(fd, msg_txt(3));
  4189. +		clif_displaymessage(fd, msg_txt(sd->lang,3));
  4190.  		return -1;
  4191.  	}
  4192.  
  4193.  	if (pc_marriage(sd, pl_sd) == 0) {
  4194. -		clif_displaymessage(fd, msg_txt(1173)); // They are married... wish them well.
  4195. +		clif_displaymessage(fd, msg_txt(sd->lang,1173)); // They are married... wish them well.
  4196.  		clif_wedding_effect(&pl_sd->bl); //wedding effect and music [Lupus]
  4197.  		getring(sd); // Auto-give named rings (Aru)
  4198.  		getring(pl_sd);
  4199.  		return 0;
  4200.  	}
  4201.  
  4202. -	clif_displaymessage(fd, msg_txt(1174)); // The two cannot wed because one is either a baby or already married.
  4203. +	clif_displaymessage(fd, msg_txt(sd->lang,1174)); // The two cannot wed because one is either a baby or already married.
  4204.  	return -1;
  4205.  }
  4206.  
  4207. @@ -5542,12 +5542,12 @@
  4208.  	nullpo_retr(-1, sd);
  4209.  
  4210.  	if (pc_divorce(sd) != 0) {
  4211. -		sprintf(atcmd_output, msg_txt(1175), sd->status.name); // '%s' is not married.
  4212. +		sprintf(atcmd_output, msg_txt(sd->lang,1175), sd->status.name); // '%s' is not married.
  4213.  		clif_displaymessage(fd, atcmd_output);
  4214.  		return -1;
  4215.  	}
  4216.  
  4217. -	sprintf(atcmd_output, msg_txt(1176), sd->status.name); // '%s' and his/her partner are now divorced.
  4218. +	sprintf(atcmd_output, msg_txt(sd->lang,1176), sd->status.name); // '%s' and his/her partner are now divorced.
  4219.  	clif_displaymessage(fd, atcmd_output);
  4220.  	return 0;
  4221.  }
  4222. @@ -5561,8 +5561,8 @@
  4223.  	int pos[7] = { LOOK_HEAD_TOP,LOOK_HEAD_MID,LOOK_HEAD_BOTTOM,LOOK_WEAPON,LOOK_SHIELD,LOOK_SHOES,LOOK_ROBE };
  4224.  
  4225.  	if((i = sscanf(message, "%d %d", &j, &k)) < 1) {
  4226. -		clif_displaymessage(fd, msg_txt(1177)); // Usage: @changelook {<position>} <view id>
  4227. -		clif_displaymessage(fd, msg_txt(1178)); // Position: 1-Top 2-Middle 3-Bottom 4-Weapon 5-Shield 6-Shoes 7-Robe
  4228. +		clif_displaymessage(fd, msg_txt(sd->lang,1177)); // Usage: @changelook {<position>} <view id>
  4229. +		clif_displaymessage(fd, msg_txt(sd->lang,1178)); // Position: 1-Top 2-Middle 3-Bottom 4-Weapon 5-Shield 6-Shoes 7-Robe
  4230.  		return -1;
  4231.  	} else if ( i == 2 ) {
  4232.  		if (j < 1 || j > 7)
  4233. @@ -5587,17 +5587,17 @@
  4234.  	nullpo_retr(-1, sd);
  4235.  
  4236.  	if( map[sd->bl.m].flag.autotrade != battle_config.autotrade_mapflag ) {
  4237. -		clif_displaymessage(fd, msg_txt(1179)); // Autotrade is not allowed on this map.
  4238. +		clif_displaymessage(fd, msg_txt(sd->lang,1179)); // Autotrade is not allowed on this map.
  4239.  		return -1;
  4240.  	}
  4241.  
  4242.  	if( pc_isdead(sd) ) {
  4243. -		clif_displaymessage(fd, msg_txt(1180)); // You cannot autotrade when dead.
  4244. +		clif_displaymessage(fd, msg_txt(sd->lang,1180)); // You cannot autotrade when dead.
  4245.  		return -1;
  4246.  	}
  4247.  
  4248.  	if( !sd->state.vending && !sd->state.buyingstore ) { //check if player is vending or buying
  4249. -		clif_displaymessage(fd, msg_txt(549)); // "You should have a shop open to use @autotrade."
  4250. +		clif_displaymessage(fd, msg_txt(sd->lang,549)); // "You should have a shop open to use @autotrade."
  4251.  		return -1;
  4252.  	}
  4253.  
  4254. @@ -5622,22 +5622,22 @@
  4255.  	nullpo_retr(-1, sd);
  4256.  
  4257.  	if (sd->status.guild_id == 0 || (g = guild_search(sd->status.guild_id)) == NULL || strcmp(g->master,sd->status.name)) {
  4258. -		clif_displaymessage(fd, msg_txt(1181)); // You need to be a Guild Master to use this command.
  4259. +		clif_displaymessage(fd, msg_txt(sd->lang,1181)); // You need to be a Guild Master to use this command.
  4260.  		return -1;
  4261.  	}
  4262.  
  4263.  	if( map[sd->bl.m].flag.guildlock || map[sd->bl.m].flag.gvg_castle ) {
  4264. -		clif_displaymessage(fd, msg_txt(1182)); // You cannot change guild leaders on this map.
  4265. +		clif_displaymessage(fd, msg_txt(sd->lang,1182)); // You cannot change guild leaders on this map.
  4266.  		return -1;
  4267.  	}
  4268.  
  4269.  	if( !message[0] ) {
  4270. -		clif_displaymessage(fd, msg_txt(1183)); // Usage: @changegm <guild_member_name>
  4271. +		clif_displaymessage(fd, msg_txt(sd->lang,1183)); // Usage: @changegm <guild_member_name>
  4272.  		return -1;
  4273.  	}
  4274.  
  4275.  	if((pl_sd=map_nick2sd((char *) message)) == NULL || pl_sd->status.guild_id != sd->status.guild_id) {
  4276. -		clif_displaymessage(fd, msg_txt(1184)); // Target character must be online and be a guild member.
  4277. +		clif_displaymessage(fd, msg_txt(sd->lang,1184)); // Target character must be online and be a guild member.
  4278.  		return -1;
  4279.  	}
  4280.  
  4281. @@ -5655,7 +5655,7 @@
  4282.  
  4283.  	if( !message[0] )
  4284.  	{
  4285. -		clif_displaymessage(fd, msg_txt(1185)); // Usage: @changeleader <party_member_name>
  4286. +		clif_displaymessage(fd, msg_txt(sd->lang,1185)); // Usage: @changeleader <party_member_name>
  4287.  		return -1;
  4288.  	}
  4289.  
  4290. @@ -5677,7 +5677,7 @@
  4291.  
  4292.  	if (sd->status.party_id == 0 || (p = party_search(sd->status.party_id)) == NULL)
  4293.  	{
  4294. -		clif_displaymessage(fd, msg_txt(282));
  4295. +		clif_displaymessage(fd, msg_txt(sd->lang,282));
  4296.  		return -1;
  4297.  	}
  4298.  
  4299. @@ -5687,13 +5687,13 @@
  4300.  
  4301.  	if (!p->party.member[mi].leader)
  4302.  	{
  4303. -		clif_displaymessage(fd, msg_txt(282));
  4304. +		clif_displaymessage(fd, msg_txt(sd->lang,282));
  4305.  		return -1;
  4306.  	}
  4307.  
  4308.  	if(!message || !*message || sscanf(message, "%15s %15s", w1, w2) < 2)
  4309.  	{
  4310. -		clif_displaymessage(fd, msg_txt(1186)); // Usage: @partyoption <pickup share: yes/no> <item distribution: yes/no>
  4311. +		clif_displaymessage(fd, msg_txt(sd->lang,1186)); // Usage: @partyoption <pickup share: yes/no> <item distribution: yes/no>
  4312.  		return -1;
  4313.  	}
  4314.  
  4315. @@ -5703,7 +5703,7 @@
  4316.  	if (option != p->party.item)
  4317.  		party_changeoption(sd, p->party.exp, option);
  4318.  	else
  4319. -		clif_displaymessage(fd, msg_txt(286));
  4320. +		clif_displaymessage(fd, msg_txt(sd->lang,286));
  4321.  
  4322.  	return 0;
  4323.  }
  4324. @@ -5733,10 +5733,10 @@
  4325.  
  4326.  	sd->state.autoloot = rate;
  4327.  	if (sd->state.autoloot) {
  4328. -		snprintf(atcmd_output, sizeof atcmd_output, msg_txt(1187),((double)sd->state.autoloot)/100.); // Autolooting items with drop rates of %0.02f%% and below.
  4329. +		snprintf(atcmd_output, sizeof atcmd_output, msg_txt(sd->lang,1187),((double)sd->state.autoloot)/100.); // Autolooting items with drop rates of %0.02f%% and below.
  4330.  		clif_displaymessage(fd, atcmd_output);
  4331.  	}else
  4332. -		clif_displaymessage(fd, msg_txt(1188)); // Autoloot is now off.
  4333. +		clif_displaymessage(fd, msg_txt(sd->lang,1188)); // Autoloot is now off.
  4334.  
  4335.  	return 0;
  4336.  }
  4337. @@ -5769,7 +5769,7 @@
  4338.  			item_data = itemdb_searchname(message);
  4339.  		if (!item_data) {
  4340.  			// No items founds in the DB with Id or Name
  4341. -			clif_displaymessage(fd, msg_txt(1189)); // Item not found.
  4342. +			clif_displaymessage(fd, msg_txt(sd->lang,1189)); // Item not found.
  4343.  			return -1;
  4344.  		}
  4345.  	}
  4346. @@ -5778,27 +5778,27 @@
  4347.  	case 1:
  4348.  		ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid[i] == item_data->nameid);
  4349.  		if (i != AUTOLOOTITEM_SIZE) {
  4350. -			clif_displaymessage(fd, msg_txt(1190)); // You're already autolooting this item.
  4351. +			clif_displaymessage(fd, msg_txt(sd->lang,1190)); // You're already autolooting this item.
  4352.  			return -1;
  4353.  		}
  4354.  		ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid[i] == 0);
  4355.  		if (i == AUTOLOOTITEM_SIZE) {
  4356. -			clif_displaymessage(fd, msg_txt(1191)); // Your autolootitem list is full. Remove some items first with @autolootid -<item name or ID>.
  4357. +			clif_displaymessage(fd, msg_txt(sd->lang,1191)); // Your autolootitem list is full. Remove some items first with @autolootid -<item name or ID>.
  4358.  			return -1;
  4359.  		}
  4360.  		sd->state.autolootid[i] = item_data->nameid; // Autoloot Activated
  4361. -		sprintf(atcmd_output, msg_txt(1192), item_data->name, item_data->jname, item_data->nameid); // Autolooting item: '%s'/'%s' {%d}
  4362. +		sprintf(atcmd_output, msg_txt(sd->lang,1192), item_data->name, item_data->jname, item_data->nameid); // Autolooting item: '%s'/'%s' {%d}
  4363.  		clif_displaymessage(fd, atcmd_output);
  4364.  		sd->state.autolooting = 1;
  4365.  		break;
  4366.  	case 2:
  4367.  		ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid[i] == item_data->nameid);
  4368.  		if (i == AUTOLOOTITEM_SIZE) {
  4369. -			clif_displaymessage(fd, msg_txt(1193)); // You're currently not autolooting this item.
  4370. +			clif_displaymessage(fd, msg_txt(sd->lang,1193)); // You're currently not autolooting this item.
  4371.  			return -1;
  4372.  		}
  4373.  		sd->state.autolootid[i] = 0;
  4374. -		sprintf(atcmd_output, msg_txt(1194), item_data->name, item_data->jname, item_data->nameid); // Removed item: '%s'/'%s' {%d} from your autolootitem list.
  4375. +		sprintf(atcmd_output, msg_txt(sd->lang,1194), item_data->name, item_data->jname, item_data->nameid); // Removed item: '%s'/'%s' {%d} from your autolootitem list.
  4376.  		clif_displaymessage(fd, atcmd_output);
  4377.  		ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid[i] != 0);
  4378.  		if (i == AUTOLOOTITEM_SIZE) {
  4379. @@ -5806,15 +5806,15 @@
  4380.  		}
  4381.  		break;
  4382.  	case 3:
  4383. -		sprintf(atcmd_output, msg_txt(1195), AUTOLOOTITEM_SIZE); // You can have %d items on your autolootitem list.
  4384. +		sprintf(atcmd_output, msg_txt(sd->lang,1195), AUTOLOOTITEM_SIZE); // You can have %d items on your autolootitem list.
  4385.  		clif_displaymessage(fd, atcmd_output);
  4386. -		clif_displaymessage(fd, msg_txt(1196)); // To add an item to the list, use "@alootid +<item name or ID>". To remove an item, use "@alootid -<item name or ID>".
  4387. -		clif_displaymessage(fd, msg_txt(1197)); // "@alootid reset" will clear your autolootitem list.
  4388. +		clif_displaymessage(fd, msg_txt(sd->lang,1196)); // To add an item to the list, use "@alootid +<item name or ID>". To remove an item, use "@alootid -<item name or ID>".
  4389. +		clif_displaymessage(fd, msg_txt(sd->lang,1197)); // "@alootid reset" will clear your autolootitem list.
  4390.  		ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid[i] != 0);
  4391.  		if (i == AUTOLOOTITEM_SIZE) {
  4392. -			clif_displaymessage(fd, msg_txt(1198)); // Your autolootitem list is empty.
  4393. +			clif_displaymessage(fd, msg_txt(sd->lang,1198)); // Your autolootitem list is empty.
  4394.  		} else {
  4395. -			clif_displaymessage(fd, msg_txt(1199)); // Items on your autolootitem list:
  4396. +			clif_displaymessage(fd, msg_txt(sd->lang,1199)); // Items on your autolootitem list:
  4397.  			for(i = 0; i < AUTOLOOTITEM_SIZE; i++)
  4398.  			{
  4399.  				if (sd->state.autolootid[i] == 0)
  4400. @@ -5830,7 +5830,7 @@
  4401.  		break;
  4402.  	case 4:
  4403.  		memset(sd->state.autolootid, 0, sizeof(sd->state.autolootid));
  4404. -		clif_displaymessage(fd, msg_txt(1200)); // Your autolootitem list has been reset.
  4405. +		clif_displaymessage(fd, msg_txt(sd->lang,1200)); // Your autolootitem list has been reset.
  4406.  		sd->state.autolooting = 0;
  4407.  		break;
  4408.  	}
  4409. @@ -5848,11 +5848,11 @@
  4410.  //	if (map[sd->bl.m].flag.rain) {
  4411.  //		map[sd->bl.m].flag.rain=0;
  4412.  //		clif_weather(sd->bl.m);
  4413. -//		clif_displaymessage(fd, msg_txt(1201)); // The rain has stopped.
  4414. +//		clif_displaymessage(fd, msg_txt(sd->lang,1201)); // The rain has stopped.
  4415.  //	} else {
  4416.  //		map[sd->bl.m].flag.rain=1;
  4417.  //		clif_weather(sd->bl.m);
  4418. -//		clif_displaymessage(fd, msg_txt(1202)); // It has started to rain.
  4419. +//		clif_displaymessage(fd, msg_txt(sd->lang,1202)); // It has started to rain.
  4420.  //	}
  4421.  //	return 0;
  4422.  //}
  4423. @@ -5866,11 +5866,11 @@
  4424.  	if (map[sd->bl.m].flag.snow) {
  4425.  		map[sd->bl.m].flag.snow=0;
  4426.  		clif_weather(sd->bl.m);
  4427. -		clif_displaymessage(fd, msg_txt(1203)); // Snow has stopped falling.
  4428. +		clif_displaymessage(fd, msg_txt(sd->lang,1203)); // Snow has stopped falling.
  4429.  	} else {
  4430.  		map[sd->bl.m].flag.snow=1;
  4431.  		clif_weather(sd->bl.m);
  4432. -		clif_displaymessage(fd, msg_txt(1204)); // It has started to snow.
  4433. +		clif_displaymessage(fd, msg_txt(sd->lang,1204)); // It has started to snow.
  4434.  	}
  4435.  
  4436.  	return 0;
  4437. @@ -5885,11 +5885,11 @@
  4438.  	if (map[sd->bl.m].flag.sakura) {
  4439.  		map[sd->bl.m].flag.sakura=0;
  4440.  		clif_weather(sd->bl.m);
  4441. -		clif_displaymessage(fd, msg_txt(1205)); // Cherry tree leaves no longer fall.
  4442. +		clif_displaymessage(fd, msg_txt(sd->lang,1205)); // Cherry tree leaves no longer fall.
  4443.  	} else {
  4444.  		map[sd->bl.m].flag.sakura=1;
  4445.  		clif_weather(sd->bl.m);
  4446. -		clif_displaymessage(fd, msg_txt(1206)); // Cherry tree leaves have begun to fall.
  4447. +		clif_displaymessage(fd, msg_txt(sd->lang,1206)); // Cherry tree leaves have begun to fall.
  4448.  	}
  4449.  	return 0;
  4450.  }
  4451. @@ -5903,11 +5903,11 @@
  4452.  	if (map[sd->bl.m].flag.clouds) {
  4453.  		map[sd->bl.m].flag.clouds=0;
  4454.  		clif_weather(sd->bl.m);
  4455. -		clif_displaymessage(fd, msg_txt(1207)); // The clouds has disappear.
  4456. +		clif_displaymessage(fd, msg_txt(sd->lang,1207)); // The clouds has disappear.
  4457.  	} else {
  4458.  		map[sd->bl.m].flag.clouds=1;
  4459.  		clif_weather(sd->bl.m);
  4460. -		clif_displaymessage(fd, msg_txt(1208)); // Clouds appear.
  4461. +		clif_displaymessage(fd, msg_txt(sd->lang,1208)); // Clouds appear.
  4462.  	}
  4463.  
  4464.  	return 0;
  4465. @@ -5922,11 +5922,11 @@
  4466.  	if (map[sd->bl.m].flag.clouds2) {
  4467.  		map[sd->bl.m].flag.clouds2=0;
  4468.  		clif_weather(sd->bl.m);
  4469. -		clif_displaymessage(fd, msg_txt(1209)); // The alternative clouds disappear.
  4470. +		clif_displaymessage(fd, msg_txt(sd->lang,1209)); // The alternative clouds disappear.
  4471.  	} else {
  4472.  		map[sd->bl.m].flag.clouds2=1;
  4473.  		clif_weather(sd->bl.m);
  4474. -		clif_displaymessage(fd, msg_txt(1210)); // Alternative clouds appear.
  4475. +		clif_displaymessage(fd, msg_txt(sd->lang,1210)); // Alternative clouds appear.
  4476.  	}
  4477.  
  4478.  	return 0;
  4479. @@ -5941,11 +5941,11 @@
  4480.  	if (map[sd->bl.m].flag.fog) {
  4481.  		map[sd->bl.m].flag.fog=0;
  4482.  		clif_weather(sd->bl.m);
  4483. -		clif_displaymessage(fd, msg_txt(1211)); // The fog has gone.
  4484. +		clif_displaymessage(fd, msg_txt(sd->lang,1211)); // The fog has gone.
  4485.  	} else {
  4486.  		map[sd->bl.m].flag.fog=1;
  4487.  		clif_weather(sd->bl.m);
  4488. -		clif_displaymessage(fd, msg_txt(1212)); // Fog hangs over.
  4489. +		clif_displaymessage(fd, msg_txt(sd->lang,1212)); // Fog hangs over.
  4490.  	}
  4491.  		return 0;
  4492.  }
  4493. @@ -5959,11 +5959,11 @@
  4494.  	if (map[sd->bl.m].flag.leaves) {
  4495.  		map[sd->bl.m].flag.leaves=0;
  4496.  		clif_weather(sd->bl.m);
  4497. -		clif_displaymessage(fd, msg_txt(1213)); // Leaves no longer fall.
  4498. +		clif_displaymessage(fd, msg_txt(sd->lang,1213)); // Leaves no longer fall.
  4499.  	} else {
  4500.  		map[sd->bl.m].flag.leaves=1;
  4501.  		clif_weather(sd->bl.m);
  4502. -		clif_displaymessage(fd, msg_txt(1214)); // Fallen leaves fall.
  4503. +		clif_displaymessage(fd, msg_txt(sd->lang,1214)); // Fallen leaves fall.
  4504.  	}
  4505.  
  4506.  	return 0;
  4507. @@ -5978,11 +5978,11 @@
  4508.  	if (map[sd->bl.m].flag.fireworks) {
  4509.  		map[sd->bl.m].flag.fireworks=0;
  4510.  		clif_weather(sd->bl.m);
  4511. -		clif_displaymessage(fd, msg_txt(1215)); // Fireworks have ended.
  4512. +		clif_displaymessage(fd, msg_txt(sd->lang,1215)); // Fireworks have ended.
  4513.  	} else {
  4514.  		map[sd->bl.m].flag.fireworks=1;
  4515.  		clif_weather(sd->bl.m);
  4516. -		clif_displaymessage(fd, msg_txt(1216)); // Fireworks have launched.
  4517. +		clif_displaymessage(fd, msg_txt(sd->lang,1216)); // Fireworks have launched.
  4518.  	}
  4519.  
  4520.  	return 0;
  4521. @@ -6006,7 +6006,7 @@
  4522.  	map[sd->bl.m].flag.fireworks=0;
  4523.  	map[sd->bl.m].flag.leaves=0;
  4524.  	clif_weather(sd->bl.m);
  4525. -	clif_displaymessage(fd, msg_txt(291));
  4526. +	clif_displaymessage(fd, msg_txt(sd->lang,291));
  4527.  
  4528.  	return 0;
  4529.  }
  4530. @@ -6021,7 +6021,7 @@
  4531.  	memset(sound_file, '\0', sizeof(sound_file));
  4532.  
  4533.  		if(!message || !*message || sscanf(message, "%99[^\n]", sound_file) < 1) {
  4534. -		clif_displaymessage(fd, msg_txt(1217)); // Please enter a sound filename (usage: @sound <filename>).
  4535. +		clif_displaymessage(fd, msg_txt(sd->lang,1217)); // Please enter a sound filename (usage: @sound <filename>).
  4536.  		return -1;
  4537.  	}
  4538.  
  4539. @@ -6046,14 +6046,14 @@
  4540.  	nullpo_retr(-1, sd);
  4541.  
  4542.  	if (!message || !*message || sscanf(message, "%99[^\n]", mob_name) < 1) {
  4543. -		clif_displaymessage(fd, msg_txt(1218)); // Please enter a monster name (usage: @mobsearch <monster name>).
  4544. +		clif_displaymessage(fd, msg_txt(sd->lang,1218)); // Please enter a monster name (usage: @mobsearch <monster name>).
  4545.  		return -1;
  4546.  	}
  4547.  
  4548.  	if ((mob_id = atoi(mob_name)) == 0)
  4549.  		 mob_id = mobdb_searchname(mob_name);
  4550.  	if(mob_id > 0 && mobdb_checkid(mob_id) == 0){
  4551. -		snprintf(atcmd_output, sizeof atcmd_output, msg_txt(1219),mob_name); // Invalid mob ID %s!
  4552. +		snprintf(atcmd_output, sizeof atcmd_output, msg_txt(sd->lang,1219),mob_name); // Invalid mob ID %s!
  4553.  		clif_displaymessage(fd, atcmd_output);
  4554.  		return -1;
  4555.  	}
  4556. @@ -6061,7 +6061,7 @@
  4557.  				strcpy(mob_name,mob_db(mob_id)->jname);	// --ja--
  4558.  //				strcpy(mob_name,mob_db(mob_id)->name);	// --en--
  4559.  
  4560. -	snprintf(atcmd_output, sizeof atcmd_output, msg_txt(1220), mob_name, mapindex_id2name(sd->mapindex)); // Mob Search... %s %s
  4561. +	snprintf(atcmd_output, sizeof atcmd_output, msg_txt(sd->lang,1220), mob_name, mapindex_id2name(sd->mapindex)); // Mob Search... %s %s
  4562.  	clif_displaymessage(fd, atcmd_output);
  4563.  
  4564.  	it = mapit_geteachmob();
  4565. @@ -6103,7 +6103,7 @@
  4566.  ACMD_FUNC(cleanmap)
  4567.  {
  4568.  	map_foreachinmap(atcommand_cleanfloor_sub, sd->bl.m, BL_ITEM);
  4569. -	clif_displaymessage(fd, msg_txt(1221)); // All dropped items have been cleaned up.
  4570. +	clif_displaymessage(fd, msg_txt(sd->lang,1221)); // All dropped items have been cleaned up.
  4571.  	return 0;
  4572.  }
  4573.  
  4574. @@ -6121,7 +6121,7 @@
  4575.  		map_foreachinarea(atcommand_cleanfloor_sub, sd->bl.m, x0, y0, x1, y1, BL_ITEM);
  4576.  	}
  4577.  
  4578. -	clif_displaymessage(fd, msg_txt(1221)); // All dropped items have been cleaned up.
  4579. +	clif_displaymessage(fd, msg_txt(sd->lang,1221)); // All dropped items have been cleaned up.
  4580.  	return 0;
  4581.  }
  4582.  
  4583. @@ -6143,19 +6143,19 @@
  4584.  
  4585.  	if(!ifcolor) {
  4586.  		if (!message || !*message || sscanf(message, "%23[^,], %99[^\n]", name, mes) < 2) {
  4587. -			clif_displaymessage(fd, msg_txt(1222)); // Please enter the correct parameters (usage: @npctalk <npc name>, <message>).
  4588. +			clif_displaymessage(fd, msg_txt(sd->lang,1222)); // Please enter the correct parameters (usage: @npctalk <npc name>, <message>).
  4589.  			return -1;
  4590.  		}
  4591.  	}
  4592.  	else {
  4593.  		if (!message || !*message || sscanf(message, "%lx %23[^,], %99[^\n]", &color, name, mes) < 3) {
  4594. -			clif_displaymessage(fd, msg_txt(1223)); // Please enter the correct parameters (usage: @npctalkc <color> <npc name>, <message>).
  4595. +			clif_displaymessage(fd, msg_txt(sd->lang,1223)); // Please enter the correct parameters (usage: @npctalkc <color> <npc name>, <message>).
  4596.  			return -1;
  4597.  		}
  4598.  	}
  4599.  
  4600.  	if (!(nd = npc_name2id(name))) {
  4601. -		clif_displaymessage(fd, msg_txt(111)); // This NPC doesn't exist
  4602. +		clif_displaymessage(fd, msg_txt(sd->lang,111)); // This NPC doesn't exist
  4603.  		return -1;
  4604.  	}
  4605.  
  4606. @@ -6183,7 +6183,7 @@
  4607.  
  4608.  	if(!sd->status.pet_id || !(pd=sd->pd))
  4609.  	{
  4610. -		clif_displaymessage(fd, msg_txt(184));
  4611. +		clif_displaymessage(fd, msg_txt(sd->lang,184));
  4612.  		return -1;
  4613.  	}
  4614.  
  4615. @@ -6193,7 +6193,7 @@
  4616.  		return -1;
  4617.  
  4618.  	if (!message || !*message || sscanf(message, "%99[^\n]", mes) < 1) {
  4619. -		clif_displaymessage(fd, msg_txt(1224)); // Please enter a message (usage: @pettalk <message>).
  4620. +		clif_displaymessage(fd, msg_txt(sd->lang,1224)); // Please enter a message (usage: @pettalk <message>).
  4621.  		return -1;
  4622.  	}
  4623.  
  4624. @@ -6285,7 +6285,7 @@
  4625.  {
  4626.  	pc_resetstate(sd);
  4627.  	pc_resetskill(sd,1);
  4628. -	sprintf(atcmd_output, msg_txt(208), sd->status.name); // '%s' skill and stats points reseted!
  4629. +	sprintf(atcmd_output, msg_txt(sd->lang,208), sd->status.name); // '%s' skill and stats points reseted!
  4630.  	clif_displaymessage(fd, atcmd_output);
  4631.  	return 0;
  4632.  }
  4633. @@ -6305,7 +6305,7 @@
  4634.  
  4635.  	if (!message || !*message || sscanf(message, "%23s %d", name, &duration) < 1)
  4636.  	{
  4637. -		clif_displaymessage(fd, msg_txt(1225)); // Please enter a monster name (usage: @summon <monster name> {duration}).
  4638. +		clif_displaymessage(fd, msg_txt(sd->lang,1225)); // Please enter a monster name (usage: @summon <monster name> {duration}).
  4639.  		return -1;
  4640.  	}
  4641.  
  4642. @@ -6318,7 +6318,7 @@
  4643.  		mob_id = mobdb_searchname(name);
  4644.  	if(mob_id == 0 || mobdb_checkid(mob_id) == 0)
  4645.  	{
  4646. -		clif_displaymessage(fd, msg_txt(40));	// Invalid monster ID or name.
  4647. +		clif_displaymessage(fd, msg_txt(sd->lang,40));	// Invalid monster ID or name.
  4648.  		return -1;
  4649.  	}
  4650.  
  4651. @@ -6334,7 +6334,7 @@
  4652.  	mob_spawn(md);
  4653.  	sc_start4(&md->bl, SC_MODECHANGE, 100, 1, 0, MD_AGGRESSIVE, 0, 60000);
  4654.  	clif_skill_poseffect(&sd->bl,AM_CALLHOMUN,1,md->bl.x,md->bl.y,tick);
  4655. -	clif_displaymessage(fd, msg_txt(39));	// All monster summoned!
  4656. +	clif_displaymessage(fd, msg_txt(sd->lang,39));	// All monster summoned!
  4657.  
  4658.  	return 0;
  4659.  }
  4660. @@ -6350,19 +6350,19 @@
  4661.  	nullpo_retr(-1, sd);
  4662.  
  4663.  	if (!message || !*message || sscanf(message, "%d", &new_group) != 1) {
  4664. -		clif_displaymessage(fd, msg_txt(1226)); // Usage: @adjgroup <group_id>
  4665. +		clif_displaymessage(fd, msg_txt(sd->lang,1226)); // Usage: @adjgroup <group_id>
  4666.  		return -1;
  4667.  	}
  4668.  
  4669.  	if (!pc_group_exists(new_group)) {
  4670. -		clif_displaymessage(fd, msg_txt(1227)); // Specified group does not exist.
  4671. +		clif_displaymessage(fd, msg_txt(sd->lang,1227)); // Specified group does not exist.
  4672.  		return -1;
  4673.  	}
  4674.  
  4675.  	sd->group_id = new_group;
  4676.  	pc_group_pc_load(sd);/* update cache */
  4677. -	clif_displaymessage(fd, msg_txt(1228)); // Group changed successfully.
  4678. -	clif_displaymessage(sd->fd, msg_txt(1229)); // Your group has changed.
  4679. +	clif_displaymessage(fd, msg_txt(sd->lang,1228)); // Group changed successfully.
  4680. +	clif_displaymessage(sd->fd, msg_txt(sd->lang,1229)); // Your group has changed.
  4681.  	return 0;
  4682.  }
  4683.  
  4684. @@ -6376,13 +6376,13 @@
  4685.  	nullpo_retr(-1, sd);
  4686.  
  4687.  	if (!message || !*message) {
  4688. -		clif_displaymessage(fd, msg_txt(1230)); // Please enter a player name (usage: @trade <char name>).
  4689. +		clif_displaymessage(fd, msg_txt(sd->lang,1230)); // Please enter a player name (usage: @trade <char name>).
  4690.  		return -1;
  4691.  	}
  4692.  
  4693.  	if ( (pl_sd = map_nick2sd((char *)message)) == NULL )
  4694.  	{
  4695. -		clif_displaymessage(fd, msg_txt(3)); // Character not found.
  4696. +		clif_displaymessage(fd, msg_txt(sd->lang,3)); // Character not found.
  4697.  		return -1;
  4698.  	}
  4699.  
  4700. @@ -6400,17 +6400,17 @@
  4701.  	nullpo_retr(-1, sd);
  4702.  
  4703.  	if (!message || !*message || sscanf(message, "%127s %127s", flag, value) != 2) {
  4704. -        	clif_displaymessage(fd, msg_txt(1231)); // Usage: @setbattleflag <flag> <value>
  4705. +        	clif_displaymessage(fd, msg_txt(sd->lang,1231)); // Usage: @setbattleflag <flag> <value>
  4706.          	return -1;
  4707.      	}
  4708.  
  4709.  	if (battle_set_value(flag, value) == 0)
  4710.  	{
  4711. -		clif_displaymessage(fd, msg_txt(1232)); // Unknown battle_config flag.
  4712. +		clif_displaymessage(fd, msg_txt(sd->lang,1232)); // Unknown battle_config flag.
  4713.  		return -1;
  4714.  	}
  4715.  
  4716. -	clif_displaymessage(fd, msg_txt(1233)); // Set battle_config as requested.
  4717. +	clif_displaymessage(fd, msg_txt(sd->lang,1233)); // Set battle_config as requested.
  4718.  
  4719.  	return 0;
  4720.  }
  4721. @@ -6424,24 +6424,24 @@
  4722.  	nullpo_retr(-1, sd);
  4723.  
  4724.  	if (!message || !*message) {
  4725. -		clif_displaymessage(fd, msg_txt(1234)); // Please enter a player name (usage: @unmute <char name>).
  4726. +		clif_displaymessage(fd, msg_txt(sd->lang,1234)); // Please enter a player name (usage: @unmute <char name>).
  4727.  		return -1;
  4728.  	}
  4729.  
  4730.  	if ( (pl_sd = map_nick2sd((char *)message)) == NULL )
  4731.  	{
  4732. -		clif_displaymessage(fd, msg_txt(3)); // Character not found.
  4733. +		clif_displaymessage(fd, msg_txt(sd->lang,3)); // Character not found.
  4734.  		return -1;
  4735.  	}
  4736.  
  4737.  	if(!pl_sd->sc.data[SC_NOCHAT]) {
  4738. -		clif_displaymessage(sd->fd,msg_txt(1235)); // Player is not muted.
  4739. +		clif_displaymessage(sd->fd,msg_txt(sd->lang,1235)); // Player is not muted.
  4740.  		return -1;
  4741.  	}
  4742.  
  4743.  	pl_sd->status.manner = 0;
  4744.  	status_change_end(&pl_sd->bl, SC_NOCHAT, INVALID_TIMER);
  4745. -	clif_displaymessage(sd->fd,msg_txt(1236)); // Player unmuted.
  4746. +	clif_displaymessage(sd->fd,msg_txt(sd->lang,1236)); // Player unmuted.
  4747.  
  4748.  	return 0;
  4749.  }
  4750. @@ -6463,7 +6463,7 @@
  4751.  	minutes = seconds/minute;
  4752.  	seconds -= (seconds/minute>0)?(seconds/minute)*minute:0;
  4753.  
  4754. -	snprintf(atcmd_output, sizeof(atcmd_output), msg_txt(245), days, hours, minutes, seconds);
  4755. +	snprintf(atcmd_output, sizeof(atcmd_output), msg_txt(sd->lang,245), days, hours, minutes, seconds);
  4756.  	clif_displaymessage(fd, atcmd_output);
  4757.  
  4758.  	return 0;
  4759. @@ -6495,19 +6495,19 @@
  4760.  	nullpo_retr(-1, sd);
  4761.  
  4762.  	if (!message || !*message || sscanf(message, "%d %23[^\n]", &manner, atcmd_player_name) < 1) {
  4763. -		clif_displaymessage(fd, msg_txt(1237)); // Usage: @mute <time> <char name>
  4764. +		clif_displaymessage(fd, msg_txt(sd->lang,1237)); // Usage: @mute <time> <char name>
  4765.  		return -1;
  4766.  	}
  4767.  
  4768.  	if ( (pl_sd = map_nick2sd(atcmd_player_name)) == NULL )
  4769.  	{
  4770. -		clif_displaymessage(fd, msg_txt(3)); // Character not found.
  4771. +		clif_displaymessage(fd, msg_txt(sd->lang,3)); // Character not found.
  4772.  		return -1;
  4773.  	}
  4774.  
  4775.  	if ( pc_get_group_level(sd) < pc_get_group_level(pl_sd) )
  4776.  	{
  4777. -		clif_displaymessage(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player.
  4778. +		clif_displaymessage(fd, msg_txt(sd->lang,81)); // Your GM level don't authorise you to do this action on this player.
  4779.  		return -1;
  4780.  	}
  4781.  
  4782. @@ -6568,7 +6568,7 @@
  4783.  	if (num > 0) {
  4784.  		clif_item_identify_list(sd);
  4785.  	} else {
  4786. -		clif_displaymessage(fd,msg_txt(1238)); // There are no items to appraise.
  4787. +		clif_displaymessage(fd,msg_txt(sd->lang,1238)); // There are no items to appraise.
  4788.  	}
  4789.  	return 0;
  4790.  }
  4791. @@ -6655,7 +6655,7 @@
  4792.  	memset(atcmd_output2, '\0', sizeof(atcmd_output2));
  4793.  
  4794.  	if (!message || !*message) {
  4795. -		clif_displaymessage(fd, msg_txt(1239)); // Please enter a monster name/ID (usage: @mobinfo <monster_name_or_monster_ID>).
  4796. +		clif_displaymessage(fd, msg_txt(sd->lang,1239)); // Please enter a monster name/ID (usage: @mobinfo <monster_name_or_monster_ID>).
  4797.  		return -1;
  4798.  	}
  4799.  
  4800. @@ -6668,12 +6668,12 @@
  4801.  		count = mobdb_searchname_array(mob_array, MAX_SEARCH, message);
  4802.  
  4803.  	if (!count) {
  4804. -		clif_displaymessage(fd, msg_txt(40)); // Invalid monster ID or name.
  4805. +		clif_displaymessage(fd, msg_txt(sd->lang,40)); // Invalid monster ID or name.
  4806.  		return -1;
  4807.  	}
  4808.  
  4809.  	if (count > MAX_SEARCH) {
  4810. -		sprintf(atcmd_output, msg_txt(269), MAX_SEARCH, count);
  4811. +		sprintf(atcmd_output, msg_txt(sd->lang,269), MAX_SEARCH, count);
  4812.  		clif_displaymessage(fd, atcmd_output);
  4813.  		count = MAX_SEARCH;
  4814.  	}
  4815. @@ -6690,24 +6690,24 @@
  4816.  #endif
  4817.  		// stats
  4818.  		if (mob->mexp)
  4819. -			sprintf(atcmd_output, msg_txt(1240), mob->name, mob->jname, mob->sprite, mob->vd.class_); // MVP Monster: '%s'/'%s'/'%s' (%d)
  4820. +			sprintf(atcmd_output, msg_txt(sd->lang,1240), mob->name, mob->jname, mob->sprite, mob->vd.class_); // MVP Monster: '%s'/'%s'/'%s' (%d)
  4821.  		else
  4822. -			sprintf(atcmd_output, msg_txt(1241), mob->name, mob->jname, mob->sprite, mob->vd.class_); // Monster: '%s'/'%s'/'%s' (%d)
  4823. +			sprintf(atcmd_output, msg_txt(sd->lang,1241), mob->name, mob->jname, mob->sprite, mob->vd.class_); // Monster: '%s'/'%s'/'%s' (%d)
  4824.  		clif_displaymessage(fd, atcmd_output);
  4825. -		sprintf(atcmd_output, msg_txt(1242), mob->lv, mob->status.max_hp, base_exp, job_exp, MOB_HIT(mob), MOB_FLEE(mob)); //  Lv:%d  HP:%d  Base EXP:%u  Job EXP:%u  HIT:%d  FLEE:%d
  4826. +		sprintf(atcmd_output, msg_txt(sd->lang,1242), mob->lv, mob->status.max_hp, base_exp, job_exp, MOB_HIT(mob), MOB_FLEE(mob)); //  Lv:%d  HP:%d  Base EXP:%u  Job EXP:%u  HIT:%d  FLEE:%d
  4827.  		clif_displaymessage(fd, atcmd_output);
  4828. -		sprintf(atcmd_output, msg_txt(1243), //  DEF:%d  MDEF:%d  STR:%d  AGI:%d  VIT:%d  INT:%d  DEX:%d  LUK:%d
  4829. +		sprintf(atcmd_output, msg_txt(sd->lang,1243), //  DEF:%d  MDEF:%d  STR:%d  AGI:%d  VIT:%d  INT:%d  DEX:%d  LUK:%d
  4830.  			mob->status.def, mob->status.mdef,mob->status.str, mob->status.agi,
  4831.  			mob->status.vit, mob->status.int_, mob->status.dex, mob->status.luk);
  4832.  		clif_displaymessage(fd, atcmd_output);
  4833.  
  4834. -		sprintf(atcmd_output, msg_txt(1244), //  ATK:%d~%d  Range:%d~%d~%d  Size:%s  Race: %s  Element: %s (Lv:%d)
  4835. +		sprintf(atcmd_output, msg_txt(sd->lang,1244), //  ATK:%d~%d  Range:%d~%d~%d  Size:%s  Race: %s  Element: %s (Lv:%d)
  4836.  			mob->status.rhw.atk, mob->status.rhw.atk2, mob->status.rhw.range,
  4837.  			mob->range2 , mob->range3, msize[mob->status.size],
  4838.  			mrace[mob->status.race], melement[mob->status.def_ele], mob->status.ele_lv);
  4839.  		clif_displaymessage(fd, atcmd_output);
  4840.  		// drops
  4841. -		clif_displaymessage(fd, msg_txt(1245)); //  Drops:
  4842. +		clif_displaymessage(fd, msg_txt(sd->lang,1245)); //  Drops:
  4843.  		strcpy(atcmd_output, " ");
  4844.  		j = 0;
  4845.  		for (i = 0; i < MAX_MOB_DROP; i++) {
  4846. @@ -6731,14 +6731,14 @@
  4847.  			}
  4848.  		}
  4849.  		if (j == 0)
  4850. -			clif_displaymessage(fd, msg_txt(1246)); // This monster has no drops.
  4851. +			clif_displaymessage(fd, msg_txt(sd->lang,1246)); // This monster has no drops.
  4852.  		else if (j % 3 != 0)
  4853.  			clif_displaymessage(fd, atcmd_output);
  4854.  		// mvp
  4855.  		if (mob->mexp) {
  4856. -			sprintf(atcmd_output, msg_txt(1247), mob->mexp); //  MVP Bonus EXP:%u
  4857. +			sprintf(atcmd_output, msg_txt(sd->lang,1247), mob->mexp); //  MVP Bonus EXP:%u
  4858.  			clif_displaymessage(fd, atcmd_output);
  4859. -			strcpy(atcmd_output, msg_txt(1248)); //  MVP Items:
  4860. +			strcpy(atcmd_output, msg_txt(sd->lang,1248)); //  MVP Items:
  4861.  			j = 0;
  4862.  			for (i = 0; i < MAX_MVP_DROP; i++) {
  4863.  				if (mob->mvpitem[i].nameid <= 0 || (item_data = itemdb_exists(mob->mvpitem[i].nameid)) == NULL)
  4864. @@ -6753,7 +6753,7 @@
  4865.  				}
  4866.  			}
  4867.  			if (j == 0)
  4868. -				clif_displaymessage(fd, msg_txt(1249)); // This monster has no MVP prizes.
  4869. +				clif_displaymessage(fd, msg_txt(sd->lang,1249)); // This monster has no MVP prizes.
  4870.  			else
  4871.  				clif_displaymessage(fd, atcmd_output);
  4872.  		}
  4873. @@ -6780,13 +6780,13 @@
  4874.  	if((mob_id = atoi(mob_name)) == 0)
  4875.  		mob_id = mobdb_searchname(mob_name);
  4876.  	if(mob_id > 0 && mobdb_checkid(mob_id) == 0){
  4877. -		snprintf(atcmd_output, sizeof atcmd_output, msg_txt(1250),mob_name); // Invalid mob id %s!
  4878. +		snprintf(atcmd_output, sizeof atcmd_output, msg_txt(sd->lang,1250),mob_name); // Invalid mob id %s!
  4879.  		clif_displaymessage(fd, atcmd_output);
  4880.  		return 0;
  4881.  	}
  4882.  
  4883.  	if(mob_db(mob_id)->status.mode&MD_BOSS && !pc_has_permission(sd, PC_PERM_SHOW_BOSS)){	// If player group does not have access to boss mobs.
  4884. -		clif_displaymessage(fd, msg_txt(1251)); // Can't show boss mobs!
  4885. +		clif_displaymessage(fd, msg_txt(sd->lang,1251)); // Can't show boss mobs!
  4886.  		return 0;
  4887.  	}
  4888.  
  4889. @@ -6794,7 +6794,7 @@
  4890.  		strcpy(mob_name,mob_db(mob_id)->jname);    // --ja--
  4891.  		//strcpy(mob_name,mob_db(mob_id)->name);    // --en--
  4892.  
  4893. -	snprintf(atcmd_output, sizeof atcmd_output, msg_txt(1252), // Mob Search... %s %s
  4894. +	snprintf(atcmd_output, sizeof atcmd_output, msg_txt(sd->lang,1252), // Mob Search... %s %s
  4895.  		mob_name, mapindex_id2name(sd->mapindex));
  4896.  	clif_displaymessage(fd, atcmd_output);
  4897.  
  4898. @@ -6833,12 +6833,12 @@
  4899.  	nullpo_retr(-1, sd);
  4900.  
  4901.  	if ( !message || !*message || ( level = atoi(message) ) < 1 ) {
  4902. -		clif_displaymessage(fd, msg_txt(1253)); // Please enter a level adjustment (usage: @homlevel <number of levels>).
  4903. +		clif_displaymessage(fd, msg_txt(sd->lang,1253)); // Please enter a level adjustment (usage: @homlevel <number of levels>).
  4904.  		return -1;
  4905.  	}
  4906.  
  4907.  	if ( !merc_is_hom_active(sd->hd) ) {
  4908. -		clif_displaymessage(fd, msg_txt(1254)); // You do not have a homunculus.
  4909. +		clif_displaymessage(fd, msg_txt(sd->lang,1254)); // You do not have a homunculus.
  4910.  		return -1;
  4911.  	}
  4912.  
  4913. @@ -6864,12 +6864,12 @@
  4914.  	nullpo_retr(-1, sd);
  4915.  
  4916.  	if ( !merc_is_hom_active(sd->hd) ) {
  4917. -		clif_displaymessage(fd, msg_txt(1254)); // You do not have a homunculus.
  4918. +		clif_displaymessage(fd, msg_txt(sd->lang,1254)); // You do not have a homunculus.
  4919.  		return -1;
  4920.  	}
  4921.  
  4922.  	if ( !merc_hom_evolution(sd->hd) ) {
  4923. -		clif_displaymessage(fd, msg_txt(1255)); // Your homunculus doesn't evolve.
  4924. +		clif_displaymessage(fd, msg_txt(sd->lang,1255)); // Your homunculus doesn't evolve.
  4925.  		return -1;
  4926.  	}
  4927.  	clif_homskillinfoblock(sd);
  4928. @@ -6882,7 +6882,7 @@
  4929.  	nullpo_retr(-1, sd);
  4930.  
  4931.  	if (!merc_is_hom_active(sd->hd)) {
  4932. -		clif_displaymessage(fd, msg_txt(1254)); // You do not have a homunculus.
  4933. +		clif_displaymessage(fd, msg_txt(sd->lang,1254)); // You do not have a homunculus.
  4934.  		return -1;
  4935.  	}
  4936.  
  4937. @@ -6912,19 +6912,19 @@
  4938.  	nullpo_retr(-1, sd);
  4939.  
  4940.  	if ( sd->status.hom_id ) {
  4941. -		clif_displaymessage(fd, msg_txt(450));
  4942. +		clif_displaymessage(fd, msg_txt(sd->lang,450));
  4943.  		return -1;
  4944.  	}
  4945.  
  4946.  	if (!message || !*message) {
  4947. -		clif_displaymessage(fd, msg_txt(1256)); // Please enter a homunculus ID (usage: @makehomun <homunculus id>).
  4948. +		clif_displaymessage(fd, msg_txt(sd->lang,1256)); // Please enter a homunculus ID (usage: @makehomun <homunculus id>).
  4949.  		return -1;
  4950.  	}
  4951.  
  4952.  	homunid = atoi(message);
  4953.  	if( homunid < HM_CLASS_BASE || homunid > HM_CLASS_BASE + MAX_HOMUNCULUS_CLASS - 1 )
  4954.  	{
  4955. -		clif_displaymessage(fd, msg_txt(1257)); // Invalid Homunculus ID.
  4956. +		clif_displaymessage(fd, msg_txt(sd->lang,1257)); // Invalid Homunculus ID.
  4957.  		return -1;
  4958.  	}
  4959.  
  4960. @@ -6942,12 +6942,12 @@
  4961.  	nullpo_retr(-1, sd);
  4962.  
  4963.  	if ( !merc_is_hom_active(sd->hd) ) {
  4964. -		clif_displaymessage(fd, msg_txt(1254)); // You do not have a homunculus.
  4965. +		clif_displaymessage(fd, msg_txt(sd->lang,1254)); // You do not have a homunculus.
  4966.  		return -1;
  4967.  	}
  4968.  
  4969.  	if (!message || !*message) {
  4970. -		clif_displaymessage(fd, msg_txt(1258)); // Please enter a friendly value (usage: @homfriendly <friendly value [0-1000]>).
  4971. +		clif_displaymessage(fd, msg_txt(sd->lang,1258)); // Please enter a friendly value (usage: @homfriendly <friendly value [0-1000]>).
  4972.  		return -1;
  4973.  	}
  4974.  
  4975. @@ -6969,12 +6969,12 @@
  4976.  	nullpo_retr(-1, sd);
  4977.  
  4978.  	if ( !merc_is_hom_active(sd->hd) ) {
  4979. -		clif_displaymessage(fd, msg_txt(1254)); // You do not have a homunculus.
  4980. +		clif_displaymessage(fd, msg_txt(sd->lang,1254)); // You do not have a homunculus.
  4981.  		return -1;
  4982.  	}
  4983.  
  4984.  	if (!message || !*message) {
  4985. -		clif_displaymessage(fd, msg_txt(1259)); // Please enter a hunger value (usage: @homhungry <hunger value [0-100]>).
  4986. +		clif_displaymessage(fd, msg_txt(sd->lang,1259)); // Please enter a hunger value (usage: @homhungry <hunger value [0-100]>).
  4987.  		return -1;
  4988.  	}
  4989.  
  4990. @@ -7007,12 +7007,12 @@
  4991.  		return -1;
  4992.  
  4993.  	if ( !merc_is_hom_active(sd->hd) ) {
  4994. -		clif_displaymessage(fd, msg_txt(1254)); // You do not have a homunculus.
  4995. +		clif_displaymessage(fd, msg_txt(sd->lang,1254)); // You do not have a homunculus.
  4996.  		return -1;
  4997.  	}
  4998.  
  4999.  	if (!message || !*message || sscanf(message, "%99[^\n]", mes) < 1) {
  5000. -		clif_displaymessage(fd, msg_txt(1260)); // Please enter a message (usage: @homtalk <message>).
  5001. +		clif_displaymessage(fd, msg_txt(sd->lang,1260)); // Please enter a message (usage: @homtalk <message>).
  5002.  		return -1;
  5003.  	}
  5004.  
  5005. @@ -7032,28 +7032,28 @@
  5006.  	nullpo_retr(-1, sd);
  5007.  
  5008.  	if ( !merc_is_hom_active(sd->hd) ) {
  5009. -		clif_displaymessage(fd, msg_txt(1254)); // You do not have a homunculus.
  5010. +		clif_displaymessage(fd, msg_txt(sd->lang,1254)); // You do not have a homunculus.
  5011.  		return -1;
  5012.  	}
  5013.  
  5014.  	hd = sd->hd;
  5015.  	status = status_get_status_data(&hd->bl);
  5016. -	clif_displaymessage(fd, msg_txt(1261)); // Homunculus stats:
  5017. +	clif_displaymessage(fd, msg_txt(sd->lang,1261)); // Homunculus stats:
  5018.  
  5019. -	snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1262), // HP: %d/%d - SP: %d/%d
  5020. +	snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(sd->lang,1262), // HP: %d/%d - SP: %d/%d
  5021.  		status->hp, status->max_hp, status->sp, status->max_sp);
  5022.  	clif_displaymessage(fd, atcmd_output);
  5023.  
  5024. -	snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1263), // ATK: %d - MATK: %d~%d
  5025. +	snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(sd->lang,1263), // ATK: %d - MATK: %d~%d
  5026.  		status->rhw.atk2 +status->batk, status->matk_min, status->matk_max);
  5027.  	clif_displaymessage(fd, atcmd_output);
  5028.  
  5029. -	snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1264), // Hungry: %d - Intimacy: %u
  5030. +	snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(sd->lang,1264), // Hungry: %d - Intimacy: %u
  5031.  		hd->homunculus.hunger, hd->homunculus.intimacy/100);
  5032.  	clif_displaymessage(fd, atcmd_output);
  5033.  
  5034.  	snprintf(atcmd_output, sizeof(atcmd_output) ,
  5035. -		msg_txt(1265), // Stats: Str %d / Agi %d / Vit %d / Int %d / Dex %d / Luk %d
  5036. +		msg_txt(sd->lang,1265), // Stats: Str %d / Agi %d / Vit %d / Int %d / Dex %d / Luk %d
  5037.  		status->str, status->agi, status->vit,
  5038.  		status->int_, status->dex, status->luk);
  5039.  	clif_displaymessage(fd, atcmd_output);
  5040. @@ -7071,7 +7071,7 @@
  5041.  	nullpo_retr(-1, sd);
  5042.  
  5043.  	if ( !merc_is_hom_active(sd->hd) ) {
  5044. -		clif_displaymessage(fd, msg_txt(1254)); // You do not have a homunculus.
  5045. +		clif_displaymessage(fd, msg_txt(sd->lang,1254)); // You do not have a homunculus.
  5046.  		return -1;
  5047.  	}
  5048.  
  5049. @@ -7082,49 +7082,49 @@
  5050.  	lv = hom->level;
  5051.  
  5052.  	snprintf(atcmd_output, sizeof(atcmd_output) ,
  5053. -		msg_txt(1266), lv, db->name); // Homunculus growth stats (Lv %d %s):
  5054. +		msg_txt(sd->lang,1266), lv, db->name); // Homunculus growth stats (Lv %d %s):
  5055.  	clif_displaymessage(fd, atcmd_output);
  5056.  	lv--; //Since the first increase is at level 2.
  5057.  
  5058.  	evo = (hom->class_ == db->evo_class);
  5059.  	min = db->base.HP +lv*db->gmin.HP +(evo?db->emin.HP:0);
  5060.  	max = db->base.HP +lv*db->gmax.HP +(evo?db->emax.HP:0);;
  5061. -	snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1267), hom->max_hp, min, max); // Max HP: %d (%d~%d)
  5062. +	snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(sd->lang,1267), hom->max_hp, min, max); // Max HP: %d (%d~%d)
  5063.  	clif_displaymessage(fd, atcmd_output);
  5064.  
  5065.  	min = db->base.SP +lv*db->gmin.SP +(evo?db->emin.SP:0);
  5066.  	max = db->base.SP +lv*db->gmax.SP +(evo?db->emax.SP:0);;
  5067. -	snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1268), hom->max_sp, min, max); // Max SP: %d (%d~%d)
  5068. +	snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(sd->lang,1268), hom->max_sp, min, max); // Max SP: %d (%d~%d)
  5069.  	clif_displaymessage(fd, atcmd_output);
  5070.  
  5071.  	min = db->base.str +lv*(db->gmin.str/10) +(evo?db->emin.str:0);
  5072.  	max = db->base.str +lv*(db->gmax.str/10) +(evo?db->emax.str:0);;
  5073. -	snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1269), hom->str/10, min, max); // Str: %d (%d~%d)
  5074. +	snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(sd->lang,1269), hom->str/10, min, max); // Str: %d (%d~%d)
  5075.  	clif_displaymessage(fd, atcmd_output);
  5076.  
  5077.  	min = db->base.agi +lv*(db->gmin.agi/10) +(evo?db->emin.agi:0);
  5078.  	max = db->base.agi +lv*(db->gmax.agi/10) +(evo?db->emax.agi:0);;
  5079. -	snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1270), hom->agi/10, min, max); // Agi: %d (%d~%d)
  5080. +	snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(sd->lang,1270), hom->agi/10, min, max); // Agi: %d (%d~%d)
  5081.  	clif_displaymessage(fd, atcmd_output);
  5082.  
  5083.  	min = db->base.vit +lv*(db->gmin.vit/10) +(evo?db->emin.vit:0);
  5084.  	max = db->base.vit +lv*(db->gmax.vit/10) +(evo?db->emax.vit:0);;
  5085. -	snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1271), hom->vit/10, min, max); // Vit: %d (%d~%d)
  5086. +	snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(sd->lang,1271), hom->vit/10, min, max); // Vit: %d (%d~%d)
  5087.  	clif_displaymessage(fd, atcmd_output);
  5088.  
  5089.  	min = db->base.int_ +lv*(db->gmin.int_/10) +(evo?db->emin.int_:0);
  5090.  	max = db->base.int_ +lv*(db->gmax.int_/10) +(evo?db->emax.int_:0);;
  5091. -	snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1272), hom->int_/10, min, max); // Int: %d (%d~%d)
  5092. +	snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(sd->lang,1272), hom->int_/10, min, max); // Int: %d (%d~%d)
  5093.  	clif_displaymessage(fd, atcmd_output);
  5094.  
  5095.  	min = db->base.dex +lv*(db->gmin.dex/10) +(evo?db->emin.dex:0);
  5096.  	max = db->base.dex +lv*(db->gmax.dex/10) +(evo?db->emax.dex:0);;
  5097. -	snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1273), hom->dex/10, min, max); // Dex: %d (%d~%d)
  5098. +	snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(sd->lang,1273), hom->dex/10, min, max); // Dex: %d (%d~%d)
  5099.  	clif_displaymessage(fd, atcmd_output);
  5100.  
  5101.  	min = db->base.luk +lv*(db->gmin.luk/10) +(evo?db->emin.luk:0);
  5102.  	max = db->base.luk +lv*(db->gmax.luk/10) +(evo?db->emax.luk:0);;
  5103. -	snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1274), hom->luk/10, min, max); // Luk: %d (%d~%d)
  5104. +	snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(sd->lang,1274), hom->luk/10, min, max); // Luk: %d (%d~%d)
  5105.  	clif_displaymessage(fd, atcmd_output);
  5106.  
  5107.  	return 0;
  5108. @@ -7140,7 +7140,7 @@
  5109.  	if(!merc_hom_shuffle(sd->hd))
  5110.  		return -1;
  5111.  
  5112. -	clif_displaymessage(sd->fd, msg_txt(1275)); // Homunculus stats altered.
  5113. +	clif_displaymessage(sd->fd, msg_txt(sd->lang,1275)); // Homunculus stats altered.
  5114.  	atcommand_homstats(fd, sd, command, message); //Print out the new stats
  5115.  	return 0;
  5116.  }
  5117. @@ -7155,40 +7155,40 @@
  5118.  	int i, count = 1;
  5119.  
  5120.  	if (!message || !*message) {
  5121. -		clif_displaymessage(fd, msg_txt(1276)); // Please enter an item name/ID (usage: @ii/@iteminfo <item name/ID>).
  5122. +		clif_displaymessage(fd, msg_txt(sd->lang,1276)); // Please enter an item name/ID (usage: @ii/@iteminfo <item name/ID>).
  5123.  		return -1;
  5124.  	}
  5125.  	if ((item_array[0] = itemdb_exists(atoi(message))) == NULL)
  5126.  		count = itemdb_searchname_array(item_array, MAX_SEARCH, message);
  5127.  
  5128.  	if (!count) {
  5129. -		clif_displaymessage(fd, msg_txt(19));	// Invalid item ID or name.
  5130. +		clif_displaymessage(fd, msg_txt(sd->lang,19));	// Invalid item ID or name.
  5131.  		return -1;
  5132.  	}
  5133.  
  5134.  	if (count > MAX_SEARCH) {
  5135. -		sprintf(atcmd_output, msg_txt(269), MAX_SEARCH, count); // Displaying first %d out of %d matches
  5136. +		sprintf(atcmd_output, msg_txt(sd->lang,269), MAX_SEARCH, count); // Displaying first %d out of %d matches
  5137.  		clif_displaymessage(fd, atcmd_output);
  5138.  		count = MAX_SEARCH;
  5139.  	}
  5140.  	for (i = 0; i < count; i++) {
  5141.  		item_data = item_array[i];
  5142. -		sprintf(atcmd_output, msg_txt(1277), // Item: '%s'/'%s'[%d] (%d) Type: %s | Extra Effect: %s
  5143. +		sprintf(atcmd_output, msg_txt(sd->lang,1277), // Item: '%s'/'%s'[%d] (%d) Type: %s | Extra Effect: %s
  5144.  			item_data->name,item_data->jname,item_data->slot,item_data->nameid,
  5145.  			itemdb_typename(item_data->type),
  5146. -			(item_data->script==NULL)? msg_txt(1278) : msg_txt(1279) // None / With script
  5147. +			(item_data->script==NULL)? msg_txt(sd->lang,1278) : msg_txt(sd->lang,1279) // None / With script
  5148.  		);
  5149.  		clif_displaymessage(fd, atcmd_output);
  5150.  
  5151. -		sprintf(atcmd_output, msg_txt(1280), item_data->value_buy, item_data->value_sell, item_data->weight/10. ); // NPC Buy:%dz, Sell:%dz | Weight: %.1f
  5152. +		sprintf(atcmd_output, msg_txt(sd->lang,1280), item_data->value_buy, item_data->value_sell, item_data->weight/10. ); // NPC Buy:%dz, Sell:%dz | Weight: %.1f
  5153.  		clif_displaymessage(fd, atcmd_output);
  5154.  
  5155.  		if (item_data->maxchance == -1)
  5156. -			strcpy(atcmd_output, msg_txt(1281)); //  - Available in the shops only.
  5157. +			strcpy(atcmd_output, msg_txt(sd->lang,1281)); //  - Available in the shops only.
  5158.  		else if (!battle_config.atcommand_mobinfo_type && item_data->maxchance)
  5159. -			sprintf(atcmd_output, msg_txt(1282), (float)item_data->maxchance / 100 ); //  - Maximal monsters drop chance: %02.02f%%
  5160. +			sprintf(atcmd_output, msg_txt(sd->lang,1282), (float)item_data->maxchance / 100 ); //  - Maximal monsters drop chance: %02.02f%%
  5161.  		else
  5162. -			strcpy(atcmd_output, msg_txt(1283)); //  - Monsters don't drop this item.
  5163. +			strcpy(atcmd_output, msg_txt(sd->lang,1283)); //  - Monsters don't drop this item.
  5164.  		clif_displaymessage(fd, atcmd_output);
  5165.  
  5166.  	}
  5167. @@ -7204,32 +7204,32 @@
  5168.  	int i,j, count = 1;
  5169.  
  5170.  	if (!message || !*message) {
  5171. -		clif_displaymessage(fd, msg_txt(1284)); // Please enter item name/ID (usage: @whodrops <item name/ID>).
  5172. +		clif_displaymessage(fd, msg_txt(sd->lang,1284)); // Please enter item name/ID (usage: @whodrops <item name/ID>).
  5173.  		return -1;
  5174.  	}
  5175.  	if ((item_array[0] = itemdb_exists(atoi(message))) == NULL)
  5176.  		count = itemdb_searchname_array(item_array, MAX_SEARCH, message);
  5177.  
  5178.  	if (!count) {
  5179. -		clif_displaymessage(fd, msg_txt(19));	// Invalid item ID or name.
  5180. +		clif_displaymessage(fd, msg_txt(sd->lang,19));	// Invalid item ID or name.
  5181.  		return -1;
  5182.  	}
  5183.  
  5184.  	if (count > MAX_SEARCH) {
  5185. -		sprintf(atcmd_output, msg_txt(269), MAX_SEARCH, count); // Displaying first %d out of %d matches
  5186. +		sprintf(atcmd_output, msg_txt(sd->lang,269), MAX_SEARCH, count); // Displaying first %d out of %d matches
  5187.  		clif_displaymessage(fd, atcmd_output);
  5188.  		count = MAX_SEARCH;
  5189.  	}
  5190.  	for (i = 0; i < count; i++) {
  5191.  		item_data = item_array[i];
  5192. -		sprintf(atcmd_output, msg_txt(1285), item_data->jname,item_data->slot); // Item: '%s'[%d]
  5193. +		sprintf(atcmd_output, msg_txt(sd->lang,1285), item_data->jname,item_data->slot); // Item: '%s'[%d]
  5194.  		clif_displaymessage(fd, atcmd_output);
  5195.  
  5196.  		if (item_data->mob[0].chance == 0) {
  5197. -			strcpy(atcmd_output, msg_txt(1286)); //  - Item is not dropped by mobs.
  5198. +			strcpy(atcmd_output, msg_txt(sd->lang,1286)); //  - Item is not dropped by mobs.
  5199.  			clif_displaymessage(fd, atcmd_output);
  5200.  		} else {
  5201. -			sprintf(atcmd_output, msg_txt(1287), MAX_SEARCH); //  - Common mobs with highest drop chance (only max %d are listed):
  5202. +			sprintf(atcmd_output, msg_txt(sd->lang,1287), MAX_SEARCH); //  - Common mobs with highest drop chance (only max %d are listed):
  5203.  			clif_displaymessage(fd, atcmd_output);
  5204.  
  5205.  			for (j=0; j < MAX_SEARCH && item_data->mob[j].chance > 0; j++)
  5206. @@ -7255,7 +7255,7 @@
  5207.  	int i, j, k;
  5208.  
  5209.  	if (!message || !*message) {
  5210. -		clif_displaymessage(fd, msg_txt(1288)); // Please enter a monster name/ID (usage: @whereis <monster_name_or_monster_ID>).
  5211. +		clif_displaymessage(fd, msg_txt(sd->lang,1288)); // Please enter a monster name/ID (usage: @whereis <monster_name_or_monster_ID>).
  5212.  		return -1;
  5213.  	}
  5214.  
  5215. @@ -7268,18 +7268,18 @@
  5216.  		count = mobdb_searchname_array(mob_array, MAX_SEARCH, message);
  5217.  
  5218.  	if (!count) {
  5219. -		clif_displaymessage(fd, msg_txt(40)); // Invalid monster ID or name.
  5220. +		clif_displaymessage(fd, msg_txt(sd->lang,40)); // Invalid monster ID or name.
  5221.  		return -1;
  5222.  	}
  5223.  
  5224.  	if (count > MAX_SEARCH) {
  5225. -		sprintf(atcmd_output, msg_txt(269), MAX_SEARCH, count);
  5226. +		sprintf(atcmd_output, msg_txt(sd->lang,269), MAX_SEARCH, count);
  5227.  		clif_displaymessage(fd, atcmd_output);
  5228.  		count = MAX_SEARCH;
  5229.  	}
  5230.  	for (k = 0; k < count; k++) {
  5231.  		mob = mob_array[k];
  5232. -		snprintf(atcmd_output, sizeof atcmd_output, msg_txt(1289), mob->jname); // %s spawns in:
  5233. +		snprintf(atcmd_output, sizeof atcmd_output, msg_txt(sd->lang,1289), mob->jname); // %s spawns in:
  5234.  		clif_displaymessage(fd, atcmd_output);
  5235.  
  5236.  		for (i = 0; i < ARRAYLENGTH(mob->spawn) && mob->spawn[i].qty; i++)
  5237. @@ -7290,7 +7290,7 @@
  5238.  			clif_displaymessage(fd, atcmd_output);
  5239.  		}
  5240.  		if (i == 0)
  5241. -			clif_displaymessage(fd, msg_txt(1290)); // This monster does not spawn normally.
  5242. +			clif_displaymessage(fd, msg_txt(sd->lang,1290)); // This monster does not spawn normally.
  5243.  	}
  5244.  
  5245.  	return 0;
  5246. @@ -7301,10 +7301,10 @@
  5247.  	const char * revision;
  5248.  
  5249.  	if ((revision = get_svn_revision()) != 0) {
  5250. -		sprintf(atcmd_output,msg_txt(1295),revision); // rAthena Version SVN r%s
  5251. +		sprintf(atcmd_output,msg_txt(sd->lang,1295),revision); // rAthena Version SVN r%s
  5252.  		clif_displaymessage(fd,atcmd_output);
  5253.  	} else
  5254. -		clif_displaymessage(fd,msg_txt(1296)); // Cannot determine SVN revision.
  5255. +		clif_displaymessage(fd,msg_txt(sd->lang,1296)); // Cannot determine SVN revision.
  5256.  
  5257.  	return 0;
  5258.  }
  5259. @@ -7339,7 +7339,7 @@
  5260.  	nullpo_ret(sd);
  5261.  
  5262.  	if (!message || !*message) {
  5263. -		clif_displaymessage(fd, msg_txt(1297)); // Please enter a time in minutes (usage: @mutearea/@stfu <time in minutes>).
  5264. +		clif_displaymessage(fd, msg_txt(sd->lang,1297)); // Please enter a time in minutes (usage: @mutearea/@stfu <time in minutes>).
  5265.  		return -1;
  5266.  	}
  5267.  
  5268. @@ -7360,16 +7360,16 @@
  5269.  	nullpo_ret(sd);
  5270.  	memset(buf, '\0', sizeof(buf));
  5271.  
  5272. -	snprintf(buf, CHAT_SIZE_MAX, msg_txt(1298), // Experience rates: Base %.2fx / Job %.2fx
  5273. +	snprintf(buf, CHAT_SIZE_MAX, msg_txt(sd->lang,1298), // Experience rates: Base %.2fx / Job %.2fx
  5274.  		battle_config.base_exp_rate/100., battle_config.job_exp_rate/100.);
  5275.  	clif_displaymessage(fd, buf);
  5276. -	snprintf(buf, CHAT_SIZE_MAX, msg_txt(1299), // Normal Drop Rates: Common %.2fx / Healing %.2fx / Usable %.2fx / Equipment %.2fx / Card %.2fx
  5277. +	snprintf(buf, CHAT_SIZE_MAX, msg_txt(sd->lang,1299), // Normal Drop Rates: Common %.2fx / Healing %.2fx / Usable %.2fx / Equipment %.2fx / Card %.2fx
  5278.  		battle_config.item_rate_common/100., battle_config.item_rate_heal/100., battle_config.item_rate_use/100., battle_config.item_rate_equip/100., battle_config.item_rate_card/100.);
  5279.  	clif_displaymessage(fd, buf);
  5280. -	snprintf(buf, CHAT_SIZE_MAX, msg_txt(1300), // Boss Drop Rates: Common %.2fx / Healing %.2fx / Usable %.2fx / Equipment %.2fx / Card %.2fx
  5281. +	snprintf(buf, CHAT_SIZE_MAX, msg_txt(sd->lang,1300), // Boss Drop Rates: Common %.2fx / Healing %.2fx / Usable %.2fx / Equipment %.2fx / Card %.2fx
  5282.  		battle_config.item_rate_common_boss/100., battle_config.item_rate_heal_boss/100., battle_config.item_rate_use_boss/100., battle_config.item_rate_equip_boss/100., battle_config.item_rate_card_boss/100.);
  5283.  	clif_displaymessage(fd, buf);
  5284. -	snprintf(buf, CHAT_SIZE_MAX, msg_txt(1301), // Other Drop Rates: MvP %.2fx / Card-Based %.2fx / Treasure %.2fx
  5285. +	snprintf(buf, CHAT_SIZE_MAX, msg_txt(sd->lang,1301), // Other Drop Rates: MvP %.2fx / Card-Based %.2fx / Treasure %.2fx
  5286.  		battle_config.item_rate_mvp/100., battle_config.item_rate_adddrop/100., battle_config.item_rate_treasure/100.);
  5287.  	clif_displaymessage(fd, buf);
  5288.  
  5289. @@ -7394,11 +7394,11 @@
  5290.  		return -1;
  5291.  
  5292.  	if (!message || !*message || sscanf(message, "%199[^\n]", tempmes) < 0) {
  5293. -		clif_displaymessage(fd, msg_txt(1302)); // Please enter a message (usage: @me <message>).
  5294. +		clif_displaymessage(fd, msg_txt(sd->lang,1302)); // Please enter a message (usage: @me <message>).
  5295.  		return -1;
  5296.  	}
  5297.  
  5298. -	sprintf(atcmd_output, msg_txt(270), sd->status.name, tempmes);	// *%s %s*
  5299. +	sprintf(atcmd_output, msg_txt(sd->lang,270), sd->status.name, tempmes);	// *%s %s*
  5300.  	clif_disp_overhead(sd, atcmd_output);
  5301.  
  5302.  	return 0;
  5303. @@ -7427,7 +7427,7 @@
  5304.  	else if( size == SZ_BIG )
  5305.  		clif_specialeffect(&sd->bl,422,AREA);
  5306.  
  5307. -	clif_displaymessage(fd, msg_txt(1303)); // Size change applied.
  5308. +	clif_displaymessage(fd, msg_txt(sd->lang,1303)); // Size change applied.
  5309.  	return 0;
  5310.  }
  5311.  
  5312. @@ -7457,7 +7457,7 @@
  5313.  	}
  5314.  	mapit_free(iter);
  5315.  
  5316. -	clif_displaymessage(fd, msg_txt(1303)); // Size change applied.
  5317. +	clif_displaymessage(fd, msg_txt(sd->lang,1303)); // Size change applied.
  5318.  	return 0;
  5319.  }
  5320.  
  5321. @@ -7472,12 +7472,12 @@
  5322.  	memset(guild, '\0', sizeof(guild));
  5323.  
  5324.  	if( !message || !*message || sscanf(message, "%d %23[^\n]", &size, guild) < 2 ) {
  5325. -		clif_displaymessage(fd, msg_txt(1304)); // Please enter guild name/ID (usage: @sizeguild <size> <guild name/ID>).
  5326. +		clif_displaymessage(fd, msg_txt(sd->lang,1304)); // Please enter guild name/ID (usage: @sizeguild <size> <guild name/ID>).
  5327.  		return -1;
  5328.  	}
  5329.  
  5330.  	if( (g = guild_searchname(guild)) == NULL && (g = guild_search(atoi(guild))) == NULL ) {
  5331. -		clif_displaymessage(fd, msg_txt(94)); // Incorrect name/ID, or no one from the guild is online.
  5332. +		clif_displaymessage(fd, msg_txt(sd->lang,94)); // Incorrect name/ID, or no one from the guild is online.
  5333.  		return -1;
  5334.  	}
  5335.  
  5336. @@ -7498,7 +7498,7 @@
  5337.  		}
  5338.  	}
  5339.  
  5340. -	clif_displaymessage(fd, msg_txt(1303)); // Size change applied.
  5341. +	clif_displaymessage(fd, msg_txt(sd->lang,1303)); // Size change applied.
  5342.  	return 0;
  5343.  }
  5344.  
  5345. @@ -7512,10 +7512,10 @@
  5346.  
  5347.  	if (!sd->state.monster_ignore) {
  5348.  		sd->state.monster_ignore = 1;
  5349. -		clif_displaymessage(sd->fd, msg_txt(1305)); // You are now immune to attacks.
  5350. +		clif_displaymessage(sd->fd, msg_txt(sd->lang,1305)); // You are now immune to attacks.
  5351.  	} else {
  5352.  		sd->state.monster_ignore = 0;
  5353. -		clif_displaymessage(sd->fd, msg_txt(1306)); // Returned to normal state.
  5354. +		clif_displaymessage(sd->fd, msg_txt(sd->lang,1306)); // Returned to normal state.
  5355.  	}
  5356.  
  5357.  	return 0;
  5358. @@ -7534,23 +7534,23 @@
  5359.  		{
  5360.  			sd->fakename[0] = '\0';
  5361.  			clif_charnameack(0, &sd->bl);
  5362. -			clif_displaymessage(sd->fd, msg_txt(1307)); // Returned to real name.
  5363. +			clif_displaymessage(sd->fd, msg_txt(sd->lang,1307)); // Returned to real name.
  5364.  			return 0;
  5365.  		}
  5366.  
  5367. -		clif_displaymessage(sd->fd, msg_txt(1308)); // You must enter a name.
  5368. +		clif_displaymessage(sd->fd, msg_txt(sd->lang,1308)); // You must enter a name.
  5369.  		return -1;
  5370.  	}
  5371.  
  5372.  	if( strlen(message) < 2 )
  5373.  	{
  5374. -		clif_displaymessage(sd->fd, msg_txt(1309)); // Fake name must be at least two characters.
  5375. +		clif_displaymessage(sd->fd, msg_txt(sd->lang,1309)); // Fake name must be at least two characters.
  5376.  		return -1;
  5377.  	}
  5378.  
  5379.  	safestrncpy(sd->fakename, message, sizeof(sd->fakename));
  5380.  	clif_charnameack(0, &sd->bl);
  5381. -	clif_displaymessage(sd->fd, msg_txt(1310)); // Fake name enabled.
  5382. +	clif_displaymessage(sd->fd, msg_txt(sd->lang,1310)); // Fake name enabled.
  5383.  
  5384.  	return 0;
  5385.  }
  5386. @@ -7573,7 +7573,7 @@
  5387.  	memset(flag_name, '\0', sizeof(flag_name));
  5388.  
  5389.  	if (!message || !*message || (sscanf(message, "%99s %hd", flag_name, &flag) < 1)) {
  5390. -		clif_displaymessage(sd->fd,msg_txt(1311)); // Enabled Mapflags in this map:
  5391. +		clif_displaymessage(sd->fd,msg_txt(sd->lang,1311)); // Enabled Mapflags in this map:
  5392.  		clif_displaymessage(sd->fd,"----------------------------------");
  5393.  		checkflag(autotrade);			checkflag(allowks);				checkflag(nomemo);		checkflag(noteleport);
  5394.  		checkflag(noreturn);			checkflag(monster_noteleport);	checkflag(nosave);		checkflag(nobranch);
  5395. @@ -7588,8 +7588,8 @@
  5396.  		checkflag(restricted);			checkflag(nodrop);				checkflag(novending);	checkflag(loadevent);
  5397.  		checkflag(nochat);				checkflag(partylock);			checkflag(guildlock);	checkflag(src4instance);
  5398.  		clif_displaymessage(sd->fd," ");
  5399. -		clif_displaymessage(sd->fd,msg_txt(1312)); // Usage: "@mapflag monster_noteleport 1" (0=Off | 1=On)
  5400. -		clif_displaymessage(sd->fd,msg_txt(1313)); // Type "@mapflag available" to list the available mapflags.
  5401. +		clif_displaymessage(sd->fd,msg_txt(sd->lang,1312)); // Usage: "@mapflag monster_noteleport 1" (0=Off | 1=On)
  5402. +		clif_displaymessage(sd->fd,msg_txt(sd->lang,1313)); // Type "@mapflag available" to list the available mapflags.
  5403.  		return 1;
  5404.  	}
  5405.  	for (i = 0; flag_name[i]; i++) flag_name[i] = (char)tolower(flag_name[i]); //lowercase
  5406. @@ -7607,9 +7607,9 @@
  5407.  	setflag(restricted);		setflag(nodrop);			setflag(novending);			setflag(loadevent);
  5408.  	setflag(nochat);			setflag(partylock);			setflag(guildlock);			setflag(src4instance);
  5409.  
  5410. -	clif_displaymessage(sd->fd,msg_txt(1314)); // Invalid flag name or flag.
  5411. -	clif_displaymessage(sd->fd,msg_txt(1312)); // Usage: "@mapflag monster_noteleport 1" (0=Off | 1=On)
  5412. -	clif_displaymessage(sd->fd,msg_txt(1315)); // Available Flags:
  5413. +	clif_displaymessage(sd->fd,msg_txt(sd->lang,1314)); // Invalid flag name or flag.
  5414. +	clif_displaymessage(sd->fd,msg_txt(sd->lang,1312)); // Usage: "@mapflag monster_noteleport 1" (0=Off | 1=On)
  5415. +	clif_displaymessage(sd->fd,msg_txt(sd->lang,1315)); // Available Flags:
  5416.  	clif_displaymessage(sd->fd,"----------------------------------");
  5417.  	clif_displaymessage(sd->fd,"town, autotrade, allowks, nomemo, noteleport, noreturn, monster_noteleport, nosave,");
  5418.  	clif_displaymessage(sd->fd,"nobranch, noexppenalty, pvp, pvp_noparty, pvp_noguild, pvp_nightmaredrop,");
  5419. @@ -7632,12 +7632,12 @@
  5420.  {
  5421.  	if (sd->state.showexp) {
  5422.  		sd->state.showexp = 0;
  5423. -		clif_displaymessage(fd, msg_txt(1316)); // Gained exp will not be shown.
  5424. +		clif_displaymessage(fd, msg_txt(sd->lang,1316)); // Gained exp will not be shown.
  5425.  		return 0;
  5426.  	}
  5427.  
  5428.  	sd->state.showexp = 1;
  5429. -	clif_displaymessage(fd, msg_txt(1317)); // Gained exp is now shown.
  5430. +	clif_displaymessage(fd, msg_txt(sd->lang,1317)); // Gained exp is now shown.
  5431.  	return 0;
  5432.  }
  5433.  
  5434. @@ -7645,12 +7645,12 @@
  5435.  {
  5436.  	if (sd->state.showzeny) {
  5437.  		sd->state.showzeny = 0;
  5438. -		clif_displaymessage(fd, msg_txt(1318)); // Gained zeny will not be shown.
  5439. +		clif_displaymessage(fd, msg_txt(sd->lang,1318)); // Gained zeny will not be shown.
  5440.  		return 0;
  5441.  	}
  5442.  
  5443.  	sd->state.showzeny = 1;
  5444. -	clif_displaymessage(fd, msg_txt(1319)); // Gained zeny is now shown.
  5445. +	clif_displaymessage(fd, msg_txt(sd->lang,1319)); // Gained zeny is now shown.
  5446.  	return 0;
  5447.  }
  5448.  
  5449. @@ -7658,12 +7658,12 @@
  5450.  {
  5451.  	if (sd->state.showdelay) {
  5452.  		sd->state.showdelay = 0;
  5453. -		clif_displaymessage(fd, msg_txt(1320)); // Skill delay failures will not be shown.
  5454. +		clif_displaymessage(fd, msg_txt(sd->lang,1320)); // Skill delay failures will not be shown.
  5455.  		return 0;
  5456.  	}
  5457.  
  5458.  	sd->state.showdelay = 1;
  5459. -	clif_displaymessage(fd, msg_txt(1321)); // Skill delay failures are now shown.
  5460. +	clif_displaymessage(fd, msg_txt(sd->lang,1321)); // Skill delay failures are now shown.
  5461.  	return 0;
  5462.  }
  5463.  
  5464. @@ -7683,7 +7683,7 @@
  5465.  
  5466.  	if(did == 0) {
  5467.  		// "Duel: @invite without @duel."
  5468. -		clif_displaymessage(fd, msg_txt(350));
  5469. +		clif_displaymessage(fd, msg_txt(sd->lang,350));
  5470.  		return 0;
  5471.  	}
  5472.  
  5473. @@ -7691,32 +7691,32 @@
  5474.  		duel_list[did].members_count >= duel_list[did].max_players_limit) {
  5475.  
  5476.  		// "Duel: Limit of players is reached."
  5477. -		clif_displaymessage(fd, msg_txt(351));
  5478. +		clif_displaymessage(fd, msg_txt(sd->lang,351));
  5479.  		return 0;
  5480.  	}
  5481.  
  5482.  	if(target_sd == NULL) {
  5483.  		// "Duel: Player not found."
  5484. -		clif_displaymessage(fd, msg_txt(352));
  5485. +		clif_displaymessage(fd, msg_txt(sd->lang,352));
  5486.  		return 0;
  5487.  	}
  5488.  
  5489.  	if(target_sd->duel_group > 0 || target_sd->duel_invite > 0) {
  5490.  		// "Duel: Player already in duel."
  5491. -		clif_displaymessage(fd, msg_txt(353));
  5492. +		clif_displaymessage(fd, msg_txt(sd->lang,353));
  5493.  		return 0;
  5494.  	}
  5495.  
  5496.  	if(battle_config.duel_only_on_same_map && target_sd->bl.m != sd->bl.m)
  5497.  	{
  5498. -		sprintf(atcmd_output, msg_txt(364), message);
  5499. +		sprintf(atcmd_output, msg_txt(sd->lang,364), message);
  5500.  		clif_displaymessage(fd, atcmd_output);
  5501.  		return 0;
  5502.  	}
  5503.  
  5504.  	duel_invite(did, sd, target_sd);
  5505.  	// "Duel: Invitation has been sent."
  5506. -	clif_displaymessage(fd, msg_txt(354));
  5507. +	clif_displaymessage(fd, msg_txt(sd->lang,354));
  5508.  	return 0;
  5509.  }
  5510.  
  5511. @@ -7731,14 +7731,14 @@
  5512.  
  5513.  	if(sd->duel_invite > 0) {
  5514.  		// "Duel: @duel without @reject."
  5515. -		clif_displaymessage(fd, msg_txt(355));
  5516. +		clif_displaymessage(fd, msg_txt(sd->lang,355));
  5517.  		return 0;
  5518.  	}
  5519.  
  5520.  	if(!duel_checktime(sd)) {
  5521.  		char output[CHAT_SIZE_MAX];
  5522.  		// "Duel: You can take part in duel only one time per %d minutes."
  5523. -		sprintf(output, msg_txt(356), battle_config.duel_time_interval);
  5524. +		sprintf(output, msg_txt(sd->lang,356), battle_config.duel_time_interval);
  5525.  		clif_displaymessage(fd, output);
  5526.  		return 0;
  5527.  	}
  5528. @@ -7746,7 +7746,7 @@
  5529.  	if( message[0] ) {
  5530.  		if(sscanf(message, "%d", &maxpl) >= 1) {
  5531.  			if(maxpl < 2 || maxpl > 65535) {
  5532. -				clif_displaymessage(fd, msg_txt(357)); // "Duel: Invalid value."
  5533. +				clif_displaymessage(fd, msg_txt(sd->lang,357)); // "Duel: Invalid value."
  5534.  				return 0;
  5535.  			}
  5536.  			duel_create(sd, maxpl);
  5537. @@ -7757,15 +7757,15 @@
  5538.  				unsigned int maxpl=0, newduel;
  5539.  				if((newduel = duel_create(sd, 2)) != -1) {
  5540.  					if(target_sd->duel_group > 0 ||	target_sd->duel_invite > 0) {
  5541. -						clif_displaymessage(fd, msg_txt(353)); // "Duel: Player already in duel."
  5542. +						clif_displaymessage(fd, msg_txt(sd->lang,353)); // "Duel: Player already in duel."
  5543.  						return 0;
  5544.  					}
  5545.  					duel_invite(newduel, sd, target_sd);
  5546. -					clif_displaymessage(fd, msg_txt(354)); // "Duel: Invitation has been sent."
  5547. +					clif_displaymessage(fd, msg_txt(sd->lang,354)); // "Duel: Invitation has been sent."
  5548.  				}
  5549.  			} else {
  5550.  				// "Duel: Player not found."
  5551. -				clif_displaymessage(fd, msg_txt(352));
  5552. +				clif_displaymessage(fd, msg_txt(sd->lang,352));
  5553.  				return 0;
  5554.  			}
  5555.  		}
  5556. @@ -7780,12 +7780,12 @@
  5557.  {
  5558.  	if(sd->duel_group <= 0) {
  5559.  		// "Duel: @leave without @duel."
  5560. -		clif_displaymessage(fd, msg_txt(358));
  5561. +		clif_displaymessage(fd, msg_txt(sd->lang,358));
  5562.  		return 0;
  5563.  	}
  5564.  
  5565.  	duel_leave(sd->duel_group, sd);
  5566. -	clif_displaymessage(fd, msg_txt(359)); // "Duel: You left the duel."
  5567. +	clif_displaymessage(fd, msg_txt(sd->lang,359)); // "Duel: You left the duel."
  5568.  	return 0;
  5569.  }
  5570.  
  5571. @@ -7794,27 +7794,27 @@
  5572.  	if(!duel_checktime(sd)) {
  5573.  		char output[CHAT_SIZE_MAX];
  5574.  		// "Duel: You can take part in duel only one time per %d minutes."
  5575. -		sprintf(output, msg_txt(356), battle_config.duel_time_interval);
  5576. +		sprintf(output, msg_txt(sd->lang,356), battle_config.duel_time_interval);
  5577.  		clif_displaymessage(fd, output);
  5578.  		return 0;
  5579.  	}
  5580.  
  5581.  	if(sd->duel_invite <= 0) {
  5582.  		// "Duel: @accept without invititation."
  5583. -		clif_displaymessage(fd, msg_txt(360));
  5584. +		clif_displaymessage(fd, msg_txt(sd->lang,360));
  5585.  		return 0;
  5586.  	}
  5587.  
  5588.  	if( duel_list[sd->duel_invite].max_players_limit > 0 && duel_list[sd->duel_invite].members_count >= duel_list[sd->duel_invite].max_players_limit )
  5589.  	{
  5590.  		// "Duel: Limit of players is reached."
  5591. -		clif_displaymessage(fd, msg_txt(351));
  5592. +		clif_displaymessage(fd, msg_txt(sd->lang,351));
  5593.  		return 0;
  5594.  	}
  5595.  
  5596.  	duel_accept(sd->duel_invite, sd);
  5597.  	// "Duel: Invitation has been accepted."
  5598. -	clif_displaymessage(fd, msg_txt(361));
  5599. +	clif_displaymessage(fd, msg_txt(sd->lang,361));
  5600.  	return 0;
  5601.  }
  5602.  
  5603. @@ -7822,13 +7822,13 @@
  5604.  {
  5605.  	if(sd->duel_invite <= 0) {
  5606.  		// "Duel: @reject without invititation."
  5607. -		clif_displaymessage(fd, msg_txt(362));
  5608. +		clif_displaymessage(fd, msg_txt(sd->lang,362));
  5609.  		return 0;
  5610.  	}
  5611.  
  5612.  	duel_reject(sd->duel_invite, sd);
  5613.  	// "Duel: Invitation has been rejected."
  5614. -	clif_displaymessage(fd, msg_txt(363));
  5615. +	clif_displaymessage(fd, msg_txt(sd->lang,363));
  5616.  	return 0;
  5617.  }
  5618.  
  5619. @@ -7843,7 +7843,7 @@
  5620.  	nullpo_retr(-1, sd);
  5621.  
  5622.  	if( !message || !*message || (value = atoi(message)) == 0 ) {
  5623. -		clif_displaymessage(fd, msg_txt(1322)); // Please enter an amount.
  5624. +		clif_displaymessage(fd, msg_txt(sd->lang,1322)); // Please enter an amount.
  5625.  		return -1;
  5626.  	}
  5627.  
  5628. @@ -7853,36 +7853,36 @@
  5629.  			if( (ret=pc_getcash(sd, value, 0)) >= 0){
  5630.  				// If this option is set, the message is already sent by pc function
  5631.  				if( !battle_config.cashshop_show_points ){
  5632. -					sprintf(output, msg_txt(505), ret, sd->cashPoints);
  5633. +					sprintf(output, msg_txt(sd->lang,505), ret, sd->cashPoints);
  5634.  					clif_disp_onlyself(sd, output, strlen(output));
  5635.  				}
  5636.  			}
  5637. -			else clif_displaymessage(fd, msg_txt(149)); // Unable to decrease the number/value.
  5638. +			else clif_displaymessage(fd, msg_txt(sd->lang,149)); // Unable to decrease the number/value.
  5639.  		} else {
  5640.  			if( (ret=pc_paycash(sd, -value, 0)) >= 0){
  5641.  				// If this option is set, the message is already sent by pc function
  5642.  				if( !battle_config.cashshop_show_points ){
  5643. -					sprintf(output, msg_txt(410), ret, sd->cashPoints);
  5644. +					sprintf(output, msg_txt(sd->lang,410), ret, sd->cashPoints);
  5645.  					clif_disp_onlyself(sd, output, strlen(output));
  5646.  				}
  5647.  			}
  5648. -			else clif_displaymessage(fd, msg_txt(41)); // Unable to decrease the number/value.
  5649. +			else clif_displaymessage(fd, msg_txt(sd->lang,41)); // Unable to decrease the number/value.
  5650.  		}
  5651.  	}
  5652.  	else
  5653.  	{ // @points
  5654.  		if( value > 0 ) {
  5655.  			if( (ret=pc_getcash(sd, 0, value)) >= 0){
  5656. -			    sprintf(output, msg_txt(506), ret, sd->kafraPoints);
  5657. +			    sprintf(output, msg_txt(sd->lang,506), ret, sd->kafraPoints);
  5658.  			    clif_disp_onlyself(sd, output, strlen(output));
  5659.  			}
  5660. -			else clif_displaymessage(fd, msg_txt(149)); // Unable to decrease the number/value.
  5661. +			else clif_displaymessage(fd, msg_txt(sd->lang,149)); // Unable to decrease the number/value.
  5662.  		} else {
  5663.  			if( (ret=pc_paycash(sd, -value, -value)) >= 0){
  5664. -			    sprintf(output, msg_txt(411), ret, sd->kafraPoints);
  5665. +			    sprintf(output, msg_txt(sd->lang,411), ret, sd->kafraPoints);
  5666.  			    clif_disp_onlyself(sd, output, strlen(output));
  5667.  			}
  5668. -			else clif_displaymessage(fd, msg_txt(41)); // Unable to decrease the number/value.
  5669. +			else clif_displaymessage(fd, msg_txt(sd->lang,41)); // Unable to decrease the number/value.
  5670.  		}
  5671.  	}
  5672.  
  5673. @@ -7896,17 +7896,17 @@
  5674.  	struct map_session_data *pl_sd=NULL;
  5675.  
  5676.  	if (!message || !*message) {
  5677. -		clif_displaymessage(sd->fd,msg_txt(1323)); // You must enter a player name or ID.
  5678. +		clif_displaymessage(sd->fd,msg_txt(sd->lang,1323)); // You must enter a player name or ID.
  5679.  		return 0;
  5680.  	}
  5681.  
  5682.  	if((pl_sd=map_nick2sd((char *)message)) == NULL && (pl_sd=map_charid2sd(atoi(message))) == NULL) {
  5683. -		clif_displaymessage(fd, msg_txt(3));	// Character not found.
  5684. +		clif_displaymessage(fd, msg_txt(sd->lang,3));	// Character not found.
  5685.  		return 0;
  5686.  	}
  5687.  
  5688.  	if(pc_get_group_level(pl_sd) > pc_get_group_level(sd)) {
  5689. -		clif_displaymessage(fd, msg_txt(126));	// Cannot clone a player of higher GM level than yourself.
  5690. +		clif_displaymessage(fd, msg_txt(sd->lang,126));	// Cannot clone a player of higher GM level than yourself.
  5691.  		return 0;
  5692.  	}
  5693.  
  5694. @@ -7915,13 +7915,13 @@
  5695.  	else if (strcmpi(command+1, "slaveclone") == 0) {
  5696.  		flag = 2;
  5697.  		if(pc_isdead(sd)){
  5698. -		    clif_displaymessage(fd, msg_txt(129+flag*2));
  5699. +		    clif_displaymessage(fd, msg_txt(sd->lang,129+flag*2));
  5700.  		    return 0;
  5701.  		}
  5702.  		master = sd->bl.id;
  5703.  		if (battle_config.atc_slave_clone_limit
  5704.  			&& mob_countslave(&sd->bl) >= battle_config.atc_slave_clone_limit) {
  5705. -			clif_displaymessage(fd, msg_txt(127));	// You've reached your slave clones limit.
  5706. +			clif_displaymessage(fd, msg_txt(sd->lang,127));	// You've reached your slave clones limit.
  5707.  			return 0;
  5708.  		}
  5709.  	}
  5710. @@ -7937,10 +7937,10 @@
  5711.  	}
  5712.  
  5713.  	if((x = mob_clone_spawn(pl_sd, sd->bl.m, x, y, "", master, 0, flag?1:0, 0)) > 0) {
  5714. -		clif_displaymessage(fd, msg_txt(128+flag*2));	// Evil Clone spawned. Clone spawned. Slave clone spawned.
  5715. +		clif_displaymessage(fd, msg_txt(sd->lang,128+flag*2));	// Evil Clone spawned. Clone spawned. Slave clone spawned.
  5716.  		return 0;
  5717.  	}
  5718. -	clif_displaymessage(fd, msg_txt(129+flag*2));	// Unable to spawn evil clone. Unable to spawn clone. Unable to spawn slave clone.
  5719. +	clif_displaymessage(fd, msg_txt(sd->lang,129+flag*2));	// Unable to spawn evil clone. Unable to spawn clone. Unable to spawn slave clone.
  5720.  	return 0;
  5721.  }
  5722.  
  5723. @@ -7955,24 +7955,24 @@
  5724.  		if(strcmpi(message, "on") == 0) {
  5725.  			if(!sd->state.mainchat) {
  5726.  				sd->state.mainchat = 1;
  5727. -				clif_displaymessage(fd, msg_txt(380)); // Main chat has been activated.
  5728. +				clif_displaymessage(fd, msg_txt(sd->lang,380)); // Main chat has been activated.
  5729.  			} else {
  5730. -				clif_displaymessage(fd, msg_txt(381)); // Main chat already activated.
  5731. +				clif_displaymessage(fd, msg_txt(sd->lang,381)); // Main chat already activated.
  5732.  			}
  5733.  		} else if(strcmpi(message, "off") == 0) {
  5734.  			if(sd->state.mainchat) {
  5735.  				sd->state.mainchat = 0;
  5736. -				clif_displaymessage(fd, msg_txt(382)); // Main chat has been disabled.
  5737. +				clif_displaymessage(fd, msg_txt(sd->lang,382)); // Main chat has been disabled.
  5738.  			} else {
  5739. -				clif_displaymessage(fd, msg_txt(383)); // Main chat already disabled.
  5740. +				clif_displaymessage(fd, msg_txt(sd->lang,383)); // Main chat already disabled.
  5741.  			}
  5742.  		} else {
  5743.  			if(!sd->state.mainchat) {
  5744.  				sd->state.mainchat = 1;
  5745. -				clif_displaymessage(fd, msg_txt(380)); // Main chat has been activated.
  5746. +				clif_displaymessage(fd, msg_txt(sd->lang,380)); // Main chat has been activated.
  5747.  			}
  5748.  			if (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT) {
  5749. -				clif_displaymessage(fd, msg_txt(387));
  5750. +				clif_displaymessage(fd, msg_txt(sd->lang,387));
  5751.  				return -1;
  5752.  			}
  5753.  
  5754. @@ -7989,9 +7989,9 @@
  5755.  	} else {
  5756.  
  5757.  		if(sd->state.mainchat)
  5758. -			clif_displaymessage(fd, msg_txt(384)); // Main chat currently enabled. Usage: @main <on|off>, @main <message>.
  5759. +			clif_displaymessage(fd, msg_txt(sd->lang,384)); // Main chat currently enabled. Usage: @main <on|off>, @main <message>.
  5760.  		else
  5761. -			clif_displaymessage(fd, msg_txt(385)); // Main chat currently disabled. Usage: @main <on|off>, @main <message>.
  5762. +			clif_displaymessage(fd, msg_txt(sd->lang,385)); // Main chat currently disabled. Usage: @main <on|off>, @main <message>.
  5763.  	}
  5764.  	return 0;
  5765.  }
  5766. @@ -8003,10 +8003,10 @@
  5767.  ACMD_FUNC(noask)
  5768.  {
  5769.  	if(sd->state.noask) {
  5770. -		clif_displaymessage(fd, msg_txt(391)); // Autorejecting is deactivated.
  5771. +		clif_displaymessage(fd, msg_txt(sd->lang,391)); // Autorejecting is deactivated.
  5772.  		sd->state.noask = 0;
  5773.  	} else {
  5774. -		clif_displaymessage(fd, msg_txt(390)); // Autorejecting is activated.
  5775. +		clif_displaymessage(fd, msg_txt(sd->lang,390)); // Autorejecting is activated.
  5776.  		sd->state.noask = 1;
  5777.  	}
  5778.  
  5779. @@ -8020,14 +8020,14 @@
  5780.  ACMD_FUNC(request)
  5781.  {
  5782.  	if (!message || !*message) {
  5783. -		clif_displaymessage(sd->fd,msg_txt(277));	// Usage: @request <petition/message to online GMs>.
  5784. +		clif_displaymessage(sd->fd,msg_txt(sd->lang,277));	// Usage: @request <petition/message to online GMs>.
  5785.  		return -1;
  5786.  	}
  5787.  
  5788. -	sprintf(atcmd_output, msg_txt(278), message);	// (@request): %s
  5789. +	sprintf(atcmd_output, msg_txt(sd->lang,278), message);	// (@request): %s
  5790.  	intif_wis_message_to_gm(sd->status.name, PC_PERM_RECEIVE_REQUESTS, atcmd_output);
  5791.  	clif_disp_onlyself(sd, atcmd_output, strlen(atcmd_output));
  5792. -	clif_displaymessage(sd->fd,msg_txt(279));	// @request sent.
  5793. +	clif_displaymessage(sd->fd,msg_txt(sd->lang,279));	// @request sent.
  5794.  	return 0;
  5795.  }
  5796.  
  5797. @@ -8037,7 +8037,7 @@
  5798.  ACMD_FUNC(feelreset)
  5799.  {
  5800.  	pc_resetfeel(sd);
  5801. -	clif_displaymessage(fd, msg_txt(1324)); // Reset 'Feeling' maps.
  5802. +	clif_displaymessage(fd, msg_txt(sd->lang,1324)); // Reset 'Feeling' maps.
  5803.  
  5804.  	return 0;
  5805.  }
  5806. @@ -8063,27 +8063,27 @@
  5807.  
  5808.  	if( sd->state.noks ) {
  5809.  		sd->state.noks = 0;
  5810. -		clif_displaymessage(fd, msg_txt(1325)); // [ K.S Protection Inactive ]
  5811. +		clif_displaymessage(fd, msg_txt(sd->lang,1325)); // [ K.S Protection Inactive ]
  5812.  	}
  5813.  	else
  5814.  	{
  5815.  		if( !message || !*message || !strcmpi(message, "party") )
  5816.  		{ // Default is Party
  5817.  			sd->state.noks = 2;
  5818. -			clif_displaymessage(fd, msg_txt(1326)); // [ K.S Protection Active - Option: Party ]
  5819. +			clif_displaymessage(fd, msg_txt(sd->lang,1326)); // [ K.S Protection Active - Option: Party ]
  5820.  		}
  5821.  		else if( !strcmpi(message, "self") )
  5822.  		{
  5823.  			sd->state.noks = 1;
  5824. -			clif_displaymessage(fd, msg_txt(1327)); // [ K.S Protection Active - Option: Self ]
  5825. +			clif_displaymessage(fd, msg_txt(sd->lang,1327)); // [ K.S Protection Active - Option: Self ]
  5826.  		}
  5827.  		else if( !strcmpi(message, "guild") )
  5828.  		{
  5829.  			sd->state.noks = 3;
  5830. -			clif_displaymessage(fd, msg_txt(1328)); // [ K.S Protection Active - Option: Guild ]
  5831. +			clif_displaymessage(fd, msg_txt(sd->lang,1328)); // [ K.S Protection Active - Option: Guild ]
  5832.  		}
  5833.  		else
  5834. -			clif_displaymessage(fd, msg_txt(1329)); // Usage: @noks <self|party|guild>
  5835. +			clif_displaymessage(fd, msg_txt(sd->lang,1329)); // Usage: @noks <self|party|guild>
  5836.  	}
  5837.  	return 0;
  5838.  }
  5839. @@ -8096,10 +8096,10 @@
  5840.  
  5841.  	if( map[sd->bl.m].flag.allowks ) {
  5842.  		map[sd->bl.m].flag.allowks = 0;
  5843. -		clif_displaymessage(fd, msg_txt(1330)); // [ Map K.S Protection Active ]
  5844. +		clif_displaymessage(fd, msg_txt(sd->lang,1330)); // [ Map K.S Protection Active ]
  5845.  	} else {
  5846.  		map[sd->bl.m].flag.allowks = 1;
  5847. -		clif_displaymessage(fd, msg_txt(1331)); // [ Map K.S Protection Inactive ]
  5848. +		clif_displaymessage(fd, msg_txt(sd->lang,1331)); // [ Map K.S Protection Inactive ]
  5849.  	}
  5850.  	return 0;
  5851.  }
  5852. @@ -8109,7 +8109,7 @@
  5853.  	nullpo_retr(-1, sd);
  5854.  
  5855.  	pc_resetstate(sd);
  5856. -	sprintf(atcmd_output, msg_txt(207), sd->status.name);
  5857. +	sprintf(atcmd_output, msg_txt(sd->lang,207), sd->status.name);
  5858.  	clif_displaymessage(fd, atcmd_output);
  5859.  	return 0;
  5860.  }
  5861. @@ -8119,7 +8119,7 @@
  5862.  	nullpo_retr(-1,sd);
  5863.  
  5864.  	pc_resetskill(sd,1);
  5865. -	sprintf(atcmd_output, msg_txt(206), sd->status.name);
  5866. +	sprintf(atcmd_output, msg_txt(sd->lang,206), sd->status.name);
  5867.  	clif_displaymessage(fd, atcmd_output);
  5868.  	return 0;
  5869.  }
  5870. @@ -8179,7 +8179,7 @@
  5871.  
  5872.  		if( count == 1 )
  5873.  		{
  5874. -			StringBuf_Printf(&buf, msg_txt(1332), location, sd->status.name); // ------ %s items list of '%s' ------
  5875. +			StringBuf_Printf(&buf, msg_txt(sd->lang,1332), location, sd->status.name); // ------ %s items list of '%s' ------
  5876.  			clif_displaymessage(fd, StringBuf_Value(&buf));
  5877.  			StringBuf_Clear(&buf);
  5878.  		}
  5879. @@ -8192,35 +8192,35 @@
  5880.  		if( it->equip )
  5881.  		{
  5882.  			char equipstr[CHAT_SIZE_MAX];
  5883. -			strcpy(equipstr, msg_txt(1333)); //  | equipped:
  5884. +			strcpy(equipstr, msg_txt(sd->lang,1333)); //  | equipped:
  5885.  			if( it->equip & EQP_GARMENT )
  5886. -				strcat(equipstr, msg_txt(1334)); // garment,
  5887. +				strcat(equipstr, msg_txt(sd->lang,1334)); // garment,
  5888.  			if( it->equip & EQP_ACC_L )
  5889. -				strcat(equipstr, msg_txt(1335)); // left accessory,
  5890. +				strcat(equipstr, msg_txt(sd->lang,1335)); // left accessory,
  5891.  			if( it->equip & EQP_ARMOR )
  5892. -				strcat(equipstr, msg_txt(1336)); // body/armor,
  5893. +				strcat(equipstr, msg_txt(sd->lang,1336)); // body/armor,
  5894.  			if( (it->equip & EQP_ARMS) == EQP_HAND_R )
  5895. -				strcat(equipstr, msg_txt(1337)); // right hand,
  5896. +				strcat(equipstr, msg_txt(sd->lang,1337)); // right hand,
  5897.  			if( (it->equip & EQP_ARMS) == EQP_HAND_L )
  5898. -				strcat(equipstr, msg_txt(1338)); // left hand,
  5899. +				strcat(equipstr, msg_txt(sd->lang,1338)); // left hand,
  5900.  			if( (it->equip & EQP_ARMS) == EQP_ARMS )
  5901. -				strcat(equipstr, msg_txt(1339)); // both hands,
  5902. +				strcat(equipstr, msg_txt(sd->lang,1339)); // both hands,
  5903.  			if( it->equip & EQP_SHOES )
  5904. -				strcat(equipstr, msg_txt(1340)); // feet,
  5905. +				strcat(equipstr, msg_txt(sd->lang,1340)); // feet,
  5906.  			if( it->equip & EQP_ACC_R )
  5907. -				strcat(equipstr, msg_txt(1341)); // right accessory,
  5908. +				strcat(equipstr, msg_txt(sd->lang,1341)); // right accessory,
  5909.  			if( (it->equip & EQP_HELM) == EQP_HEAD_LOW )
  5910. -				strcat(equipstr, msg_txt(1342)); // lower head,
  5911. +				strcat(equipstr, msg_txt(sd->lang,1342)); // lower head,
  5912.  			if( (it->equip & EQP_HELM) == EQP_HEAD_TOP )
  5913. -				strcat(equipstr, msg_txt(1343)); // top head,
  5914. +				strcat(equipstr, msg_txt(sd->lang,1343)); // top head,
  5915.  			if( (it->equip & EQP_HELM) == (EQP_HEAD_LOW|EQP_HEAD_TOP) )
  5916. -				strcat(equipstr, msg_txt(1344)); // lower/top head,
  5917. +				strcat(equipstr, msg_txt(sd->lang,1344)); // lower/top head,
  5918.  			if( (it->equip & EQP_HELM) == EQP_HEAD_MID )
  5919. -				strcat(equipstr, msg_txt(1345)); // mid head,
  5920. +				strcat(equipstr, msg_txt(sd->lang,1345)); // mid head,
  5921.  			if( (it->equip & EQP_HELM) == (EQP_HEAD_LOW|EQP_HEAD_MID) )
  5922. -				strcat(equipstr, msg_txt(1346)); // lower/mid head,
  5923. +				strcat(equipstr, msg_txt(sd->lang,1346)); // lower/mid head,
  5924.  			if( (it->equip & EQP_HELM) == EQP_HELM )
  5925. -				strcat(equipstr, msg_txt(1347)); // lower/mid/top head,
  5926. +				strcat(equipstr, msg_txt(sd->lang,1347)); // lower/mid/top head,
  5927.  			// remove final ', '
  5928.  			equipstr[strlen(equipstr) - 2] = '\0';
  5929.  			StringBuf_AppendStr(&buf, equipstr);
  5930. @@ -8232,19 +8232,19 @@
  5931.  		if( it->card[0] == CARD0_PET )
  5932.  		{// pet egg
  5933.  			if (it->card[3])
  5934. -				StringBuf_Printf(&buf, msg_txt(1348), (unsigned int)MakeDWord(it->card[1], it->card[2])); //  -> (pet egg, pet id: %u, named)
  5935. +				StringBuf_Printf(&buf, msg_txt(sd->lang,1348), (unsigned int)MakeDWord(it->card[1], it->card[2])); //  -> (pet egg, pet id: %u, named)
  5936.  			else
  5937. -				StringBuf_Printf(&buf, msg_txt(1349), (unsigned int)MakeDWord(it->card[1], it->card[2])); //  -> (pet egg, pet id: %u, unnamed)
  5938. +				StringBuf_Printf(&buf, msg_txt(sd->lang,1349), (unsigned int)MakeDWord(it->card[1], it->card[2])); //  -> (pet egg, pet id: %u, unnamed)
  5939.  		}
  5940.  		else
  5941.  		if(it->card[0] == CARD0_FORGE)
  5942.  		{// forged item
  5943. -			StringBuf_Printf(&buf, msg_txt(1350), (unsigned int)MakeDWord(it->card[2], it->card[3]), it->card[1]>>8, it->card[1]&0x0f); //  -> (crafted item, creator id: %u, star crumbs %d, element %d)
  5944. +			StringBuf_Printf(&buf, msg_txt(sd->lang,1350), (unsigned int)MakeDWord(it->card[2], it->card[3]), it->card[1]>>8, it->card[1]&0x0f); //  -> (crafted item, creator id: %u, star crumbs %d, element %d)
  5945.  		}
  5946.  		else
  5947.  		if(it->card[0] == CARD0_CREATE)
  5948.  		{// created item
  5949. -			StringBuf_Printf(&buf, msg_txt(1351), (unsigned int)MakeDWord(it->card[2], it->card[3])); //  -> (produced item, creator id: %u)
  5950. +			StringBuf_Printf(&buf, msg_txt(sd->lang,1351), (unsigned int)MakeDWord(it->card[2], it->card[3])); //  -> (produced item, creator id: %u)
  5951.  		}
  5952.  		else
  5953.  		{// normal item
  5954. @@ -8260,7 +8260,7 @@
  5955.  				counter2++;
  5956.  
  5957.  				if( counter2 == 1 )
  5958. -					StringBuf_AppendStr(&buf, msg_txt(1352)); //  -> (card(s):
  5959. +					StringBuf_AppendStr(&buf, msg_txt(sd->lang,1352)); //  -> (card(s):
  5960.  
  5961.  				if( counter2 != 1 )
  5962.  					StringBuf_AppendStr(&buf, ", ");
  5963. @@ -8279,9 +8279,9 @@
  5964.  	}
  5965.  
  5966.  	if( count == 0 )
  5967. -		StringBuf_Printf(&buf, msg_txt(1353), location); // No item found in this player's %s.
  5968. +		StringBuf_Printf(&buf, msg_txt(sd->lang,1353), location); // No item found in this player's %s.
  5969.  	else
  5970. -		StringBuf_Printf(&buf, msg_txt(1354), counter, count, location); // %d item(s) found in %d %s slots.
  5971. +		StringBuf_Printf(&buf, msg_txt(sd->lang,1354), counter, count, location); // %d item(s) found in %d %s slots.
  5972.  
  5973.  	clif_displaymessage(fd, StringBuf_Value(&buf));
  5974.  
  5975. @@ -8341,7 +8341,7 @@
  5976.  	output_table[15].value = sd->change_level_3rd;
  5977.  
  5978.  	sprintf(job_jobname, "Job - %s %s", job_name(sd->status.class_), "(level %d)");
  5979. -	sprintf(output, msg_txt(53), sd->status.name); // '%s' stats:
  5980. +	sprintf(output, msg_txt(sd->lang,53), sd->status.name); // '%s' stats:
  5981.  
  5982.  	clif_displaymessage(fd, output);
  5983.  
  5984. @@ -8363,7 +8363,7 @@
  5985.  
  5986.  	if( !message || !*message || ( sscanf(message, "\"%99[^\"]\" %d", item_name, &amount) < 2 && sscanf(message, "%99s %d", item_name, &amount) < 2 ) || amount < 1 )
  5987.  	{
  5988. -		clif_displaymessage(fd, msg_txt(1355)); // Please enter an item name/ID, a quantity, and a player name (usage: #delitem <player> <item_name_or_ID> <quantity>).
  5989. +		clif_displaymessage(fd, msg_txt(sd->lang,1355)); // Please enter an item name/ID, a quantity, and a player name (usage: #delitem <player> <item_name_or_ID> <quantity>).
  5990.  		return -1;
  5991.  	}
  5992.  
  5993. @@ -8373,7 +8373,7 @@
  5994.  	}
  5995.  	else
  5996.  	{
  5997. -		clif_displaymessage(fd, msg_txt(19)); // Invalid item ID or name.
  5998. +		clif_displaymessage(fd, msg_txt(sd->lang,19)); // Invalid item ID or name.
  5999.  		return -1;
  6000.  	}
  6001.  
  6002. @@ -8394,22 +8394,22 @@
  6003.  	}
  6004.  
  6005.  	// notify target
  6006. -	sprintf(atcmd_output, msg_txt(113), total-amount); // %d item(s) removed by a GM.
  6007. +	sprintf(atcmd_output, msg_txt(sd->lang,113), total-amount); // %d item(s) removed by a GM.
  6008.  	clif_displaymessage(sd->fd, atcmd_output);
  6009.  
  6010.  	// notify source
  6011.  	if( amount == total )
  6012.  	{
  6013. -		clif_displaymessage(fd, msg_txt(116)); // Character does not have the item.
  6014. +		clif_displaymessage(fd, msg_txt(sd->lang,116)); // Character does not have the item.
  6015.  	}
  6016.  	else if( amount )
  6017.  	{
  6018. -		sprintf(atcmd_output, msg_txt(115), total-amount, total-amount, total); // %d item(s) removed. Player had only %d on %d items.
  6019. +		sprintf(atcmd_output, msg_txt(sd->lang,115), total-amount, total-amount, total); // %d item(s) removed. Player had only %d on %d items.
  6020.  		clif_displaymessage(fd, atcmd_output);
  6021.  	}
  6022.  	else
  6023.  	{
  6024. -		sprintf(atcmd_output, msg_txt(114), total); // %d item(s) removed from the player.
  6025. +		sprintf(atcmd_output, msg_txt(sd->lang,114), total); // %d item(s) removed from the player.
  6026.  		clif_displaymessage(fd, atcmd_output);
  6027.  	}
  6028.  
  6029. @@ -8430,25 +8430,25 @@
  6030.  		if( sd->user_font )
  6031.  		{
  6032.  			sd->user_font = 0;
  6033. -			clif_displaymessage(fd, msg_txt(1356)); // Returning to normal font.
  6034. +			clif_displaymessage(fd, msg_txt(sd->lang,1356)); // Returning to normal font.
  6035.  			clif_font(sd);
  6036.  		}
  6037.  		else
  6038.  		{
  6039. -			clif_displaymessage(fd, msg_txt(1357)); // Use @font <1-9> to change your message font.
  6040. -			clif_displaymessage(fd, msg_txt(1358)); // Use 0 or no parameter to return to normal font.
  6041. +			clif_displaymessage(fd, msg_txt(sd->lang,1357)); // Use @font <1-9> to change your message font.
  6042. +			clif_displaymessage(fd, msg_txt(sd->lang,1358)); // Use 0 or no parameter to return to normal font.
  6043.  		}
  6044.  	}
  6045.  	else if( font_id < 0 || font_id > 9 )
  6046. -		clif_displaymessage(fd, msg_txt(1359)); // Invalid font. Use a value from 0 to 9.
  6047. +		clif_displaymessage(fd, msg_txt(sd->lang,1359)); // Invalid font. Use a value from 0 to 9.
  6048.  	else if( font_id != sd->user_font )
  6049.  	{
  6050.  		sd->user_font = font_id;
  6051.  		clif_font(sd);
  6052. -		clif_displaymessage(fd, msg_txt(1360)); // Font changed.
  6053. +		clif_displaymessage(fd, msg_txt(sd->lang,1360)); // Font changed.
  6054.  	}
  6055.  	else
  6056. -		clif_displaymessage(fd, msg_txt(1361)); // Already using this font.
  6057. +		clif_displaymessage(fd, msg_txt(sd->lang,1361)); // Already using this font.
  6058.  
  6059.  	return 0;
  6060.  }
  6061. @@ -8467,7 +8467,7 @@
  6062.  	memset(line_buff,' ',CHATBOX_SIZE);
  6063.  	line_buff[CHATBOX_SIZE-1] = 0;
  6064.  
  6065. -	clif_displaymessage(fd, msg_txt(273)); // "Commands available:"
  6066. +	clif_displaymessage(fd, msg_txt(sd->lang,273)); // "Commands available:"
  6067.  
  6068.  	for (cmd = dbi_first(iter); dbi_exists(iter); cmd = dbi_next(iter)) {
  6069.  		unsigned int slen = 0;
  6070. @@ -8505,7 +8505,7 @@
  6071.  	dbi_destroy(iter);
  6072.  	clif_displaymessage(fd,line_buff);
  6073.  
  6074. -	sprintf(atcmd_output, msg_txt(274), count); // "%d commands found."
  6075. +	sprintf(atcmd_output, msg_txt(sd->lang,274), count); // "%d commands found."
  6076.  	clif_displaymessage(fd, atcmd_output);
  6077.  
  6078.  	return;
  6079. @@ -8531,12 +8531,12 @@
  6080.  /* for new mounts */
  6081.  ACMD_FUNC(mount2) {
  6082.  
  6083. -	clif_displaymessage(sd->fd,msg_txt(1362)); // NOTICE: If you crash with mount your LUA is outdated.
  6084. +	clif_displaymessage(sd->fd,msg_txt(sd->lang,1362)); // NOTICE: If you crash with mount your LUA is outdated.
  6085.  	if( !(sd->sc.option&OPTION_MOUNTING) ) {
  6086. -		clif_displaymessage(sd->fd,msg_txt(1363)); // You have mounted.
  6087. +		clif_displaymessage(sd->fd,msg_txt(sd->lang,1363)); // You have mounted.
  6088.  		pc_setoption(sd, sd->sc.option|OPTION_MOUNTING);
  6089.  	} else {
  6090. -		clif_displaymessage(sd->fd,msg_txt(1364)); // You have released your mount.
  6091. +		clif_displaymessage(sd->fd,msg_txt(sd->lang,1364)); // You have released your mount.
  6092.  		pc_setoption(sd, sd->sc.option&~OPTION_MOUNTING);
  6093.  	}
  6094.  	return 0;
  6095. @@ -8546,8 +8546,8 @@
  6096.  	char query[NAME_LENGTH];
  6097.  
  6098.  	if (!message || !*message || strlen(message) > NAME_LENGTH ) {
  6099. -		clif_displaymessage(fd, msg_txt(1365)); // Usage: @accinfo/@accountinfo <account_id/char name>
  6100. -		clif_displaymessage(fd, msg_txt(1366)); // You may search partial name by making use of '%' in the search, ex. "@accinfo %Mario%" lists all characters whose name contains "Mario".
  6101. +		clif_displaymessage(fd, msg_txt(sd->lang,1365)); // Usage: @accinfo/@accountinfo <account_id/char name>
  6102. +		clif_displaymessage(fd, msg_txt(sd->lang,1366)); // You may search partial name by making use of '%' in the search, ex. "@accinfo %Mario%" lists all characters whose name contains "Mario".
  6103.  		return -1;
  6104.  	}
  6105.  
  6106. @@ -8567,19 +8567,19 @@
  6107.  	bool is_str = false;
  6108.  
  6109.  	if( !message || !*message || (toset = sscanf(message, "%31s %128[^\n]s", reg, val)) < 1  ) {
  6110. -		clif_displaymessage(fd, msg_txt(1367)); // Usage: @set <variable name> <value>
  6111. -		clif_displaymessage(fd, msg_txt(1368)); // Usage: ex. "@set PoringCharVar 50"
  6112. -		clif_displaymessage(fd, msg_txt(1369)); // Usage: ex. "@set PoringCharVarSTR$ Super Duper String"
  6113. -		clif_displaymessage(fd, msg_txt(1370)); // Usage: ex. "@set PoringCharVarSTR$" outputs its value, Super Duper String.
  6114. +		clif_displaymessage(fd, msg_txt(sd->lang,1367)); // Usage: @set <variable name> <value>
  6115. +		clif_displaymessage(fd, msg_txt(sd->lang,1368)); // Usage: ex. "@set PoringCharVar 50"
  6116. +		clif_displaymessage(fd, msg_txt(sd->lang,1369)); // Usage: ex. "@set PoringCharVarSTR$ Super Duper String"
  6117. +		clif_displaymessage(fd, msg_txt(sd->lang,1370)); // Usage: ex. "@set PoringCharVarSTR$" outputs its value, Super Duper String.
  6118.  		return -1;
  6119.  	}
  6120.  
  6121.  	/* disabled variable types (they require a proper script state to function, so allowing them would crash the server) */
  6122.  	if( reg[0] == '.' ) {
  6123. -		clif_displaymessage(fd, msg_txt(1371)); // NPC variables may not be used with @set.
  6124. +		clif_displaymessage(fd, msg_txt(sd->lang,1371)); // NPC variables may not be used with @set.
  6125.  		return -1;
  6126.  	} else if( reg[0] == '\'' ) {
  6127. -		clif_displaymessage(fd, msg_txt(1372)); // Instance variables may not be used with @set.
  6128. +		clif_displaymessage(fd, msg_txt(sd->lang,1372)); // Instance variables may not be used with @set.
  6129.  		return -1;
  6130.  	}
  6131.  
  6132. @@ -8657,16 +8657,16 @@
  6133.  
  6134.  	switch( data->type ) {
  6135.  		case C_INT:
  6136. -			sprintf(atcmd_output,msg_txt(1373),reg,data->u.num); // %s value is now :%d
  6137. +			sprintf(atcmd_output,msg_txt(sd->lang,1373),reg,data->u.num); // %s value is now :%d
  6138.  			break;
  6139.  		case C_STR:
  6140. -			sprintf(atcmd_output,msg_txt(1374),reg,data->u.str); // %s value is now :%s
  6141. +			sprintf(atcmd_output,msg_txt(sd->lang,1374),reg,data->u.str); // %s value is now :%s
  6142.  			break;
  6143.  		case C_CONSTSTR:
  6144. -			sprintf(atcmd_output,msg_txt(1375),reg); // %s is empty
  6145. +			sprintf(atcmd_output,msg_txt(sd->lang,1375),reg); // %s is empty
  6146.  			break;
  6147.  		default:
  6148. -			sprintf(atcmd_output,msg_txt(1376),reg,data->type); // %s data type is not supported :%u
  6149. +			sprintf(atcmd_output,msg_txt(sd->lang,1376),reg,data->type); // %s data type is not supported :%u
  6150.  			break;
  6151.  	}
  6152.  
  6153. @@ -8678,7 +8678,7 @@
  6154.  }
  6155.  ACMD_FUNC(reloadquestdb) {
  6156.  	do_reload_quest();
  6157. -	clif_displaymessage(fd, msg_txt(1377)); // Quest database has been reloaded.
  6158. +	clif_displaymessage(fd, msg_txt(sd->lang,1377)); // Quest database has been reloaded.
  6159.  	return 0;
  6160.  }
  6161.  ACMD_FUNC(addperm) {
  6162. @@ -8687,9 +8687,9 @@
  6163.  	int i;
  6164.  
  6165.  	if( !message || !*message ) {
  6166. -		sprintf(atcmd_output,  msg_txt(1378),command); // Usage: %s <permission_name>
  6167. +		sprintf(atcmd_output,  msg_txt(sd->lang,1378),command); // Usage: %s <permission_name>
  6168.  		clif_displaymessage(fd, atcmd_output);
  6169. -		clif_displaymessage(fd, msg_txt(1379)); // -- Permission List
  6170. +		clif_displaymessage(fd, msg_txt(sd->lang,1379)); // -- Permission List
  6171.  		for( i = 0; i < perm_size; i++ ) {
  6172.  			sprintf(atcmd_output,"- %s",pc_g_permission_name[i].name);
  6173.  			clif_displaymessage(fd, atcmd_output);
  6174. @@ -8700,9 +8700,9 @@
  6175.  	ARR_FIND(0, perm_size, i, strcmpi(pc_g_permission_name[i].name, message) == 0);
  6176.  
  6177.  	if( i == perm_size ) {
  6178. -		sprintf(atcmd_output,msg_txt(1380),message); // '%s' is not a known permission.
  6179. +		sprintf(atcmd_output,msg_txt(sd->lang,1380),message); // '%s' is not a known permission.
  6180.  		clif_displaymessage(fd, atcmd_output);
  6181. -		clif_displaymessage(fd, msg_txt(1379)); // -- Permission List
  6182. +		clif_displaymessage(fd, msg_txt(sd->lang,1379)); // -- Permission List
  6183.  		for( i = 0; i < perm_size; i++ ) {
  6184.  			sprintf(atcmd_output,"- %s",pc_g_permission_name[i].name);
  6185.  			clif_displaymessage(fd, atcmd_output);
  6186. @@ -8711,13 +8711,13 @@
  6187.  	}
  6188.  
  6189.  	if( add && (sd->permissions&pc_g_permission_name[i].permission) ) {
  6190. -		sprintf(atcmd_output,  msg_txt(1381),sd->status.name,pc_g_permission_name[i].name); // User '%s' already possesses the '%s' permission.
  6191. +		sprintf(atcmd_output,  msg_txt(sd->lang,1381),sd->status.name,pc_g_permission_name[i].name); // User '%s' already possesses the '%s' permission.
  6192.  		clif_displaymessage(fd, atcmd_output);
  6193.  		return -1;
  6194.  	} else if ( !add && !(sd->permissions&pc_g_permission_name[i].permission) ) {
  6195. -		sprintf(atcmd_output,  msg_txt(1382),sd->status.name,pc_g_permission_name[i].name); // User '%s' doesn't possess the '%s' permission.
  6196. +		sprintf(atcmd_output,  msg_txt(sd->lang,1382),sd->status.name,pc_g_permission_name[i].name); // User '%s' doesn't possess the '%s' permission.
  6197.  		clif_displaymessage(fd, atcmd_output);
  6198. -		sprintf(atcmd_output,msg_txt(1383),sd->status.name); // -- User '%s' Permissions
  6199. +		sprintf(atcmd_output,msg_txt(sd->lang,1383),sd->status.name); // -- User '%s' Permissions
  6200.  		clif_displaymessage(fd, atcmd_output);
  6201.  		for( i = 0; i < perm_size; i++ ) {
  6202.  			if( sd->permissions&pc_g_permission_name[i].permission ) {
  6203. @@ -8735,7 +8735,7 @@
  6204.  		sd->permissions &=~ pc_g_permission_name[i].permission;
  6205.  
  6206.  
  6207. -	sprintf(atcmd_output, msg_txt(1384),sd->status.name); // User '%s' permissions updated successfully. The changes are temporary.
  6208. +	sprintf(atcmd_output, msg_txt(sd->lang,1384),sd->status.name); // User '%s' permissions updated successfully. The changes are temporary.
  6209.  	clif_displaymessage(fd, atcmd_output);
  6210.  
  6211.  	return 0;
  6212. @@ -8743,14 +8743,14 @@
  6213.  ACMD_FUNC(unloadnpcfile) {
  6214.  
  6215.  	if( !message || !*message ) {
  6216. -		clif_displaymessage(fd, msg_txt(1385)); // Usage: @unloadnpcfile <file name>
  6217. +		clif_displaymessage(fd, msg_txt(sd->lang,1385)); // Usage: @unloadnpcfile <file name>
  6218.  		return -1;
  6219.  	}
  6220.  
  6221.  	if( npc_unloadfile(message) )
  6222. -		clif_displaymessage(fd, msg_txt(1386)); // File unloaded. Be aware that mapflags and monsters spawned directly are not removed.
  6223. +		clif_displaymessage(fd, msg_txt(sd->lang,1386)); // File unloaded. Be aware that mapflags and monsters spawned directly are not removed.
  6224.  	else {
  6225. -		clif_displaymessage(fd, msg_txt(1387)); // File not found.
  6226. +		clif_displaymessage(fd, msg_txt(sd->lang,1387)); // File not found.
  6227.  		return -1;
  6228.  	}
  6229.  	return 0;
  6230. @@ -8765,13 +8765,13 @@
  6231.  	bool need_skill = pc_checkskill(sd, MC_PUSHCART) ? false : true;
  6232.  
  6233.  	if( !message || !*message || val < 0 || val > MAX_CARTS ) {
  6234. -		sprintf(atcmd_output, msg_txt(1390),command,MAX_CARTS); // Unknown Cart (usage: %s <0-%d>).
  6235. +		sprintf(atcmd_output, msg_txt(sd->lang,1390),command,MAX_CARTS); // Unknown Cart (usage: %s <0-%d>).
  6236.  		clif_displaymessage(fd, atcmd_output);
  6237.  		return -1;
  6238.  	}
  6239.  
  6240.  	if( val == 0 && !pc_iscarton(sd) ) {
  6241. -		clif_displaymessage(fd, msg_txt(1391)); // You do not possess a cart to be removed
  6242. +		clif_displaymessage(fd, msg_txt(sd->lang,1391)); // You do not possess a cart to be removed
  6243.  		return -1;
  6244.  	}
  6245.  
  6246. @@ -8790,7 +8790,7 @@
  6247.  		MC_CART_MDFY(0);
  6248.  	}
  6249.  
  6250. -	clif_displaymessage(fd, msg_txt(1392)); // Cart Added
  6251. +	clif_displaymessage(fd, msg_txt(sd->lang,1392)); // Cart Added
  6252.  
  6253.  	return 0;
  6254.  	#undef MC_CART_MDFY
  6255. @@ -9154,7 +9154,7 @@
  6256.  		}
  6257.  
  6258.  		// Build the suggestion string
  6259. -		strcpy(buffer, msg_txt(205));
  6260. +		strcpy(buffer, msg_txt(sd->lang,205));
  6261.  		strcat(buffer,"\n");
  6262.  
  6263.  		for(i=0; i < prefix_count; ++i) {
  6264. @@ -9206,7 +9206,7 @@
  6265.  	if ( type == 1) {
  6266.  		//Commands are disabled on maps flagged as 'nocommand'
  6267.  		if ( map[sd->bl.m].nocommand && pc_get_group_level(sd) < map[sd->bl.m].nocommand ) {
  6268. -			clif_displaymessage(fd, msg_txt(143));
  6269. +			clif_displaymessage(fd, msg_txt(sd->lang,143));
  6270.  			return false;
  6271.  		}
  6272.  	}
  6273. @@ -9249,7 +9249,7 @@
  6274.  					return false;/* display as normal message */
  6275.  			}
  6276.  
  6277. -			sprintf(output, msg_txt(1388), charcommand_symbol); // Charcommand failed (usage: %c<command> <char name> <parameters>).
  6278. +			sprintf(output, msg_txt(sd->lang,1388), charcommand_symbol); // Charcommand failed (usage: %c<command> <char name> <parameters>).
  6279.  			clif_displaymessage(fd, output);
  6280.  			return true;
  6281.  		} while(0);
  6282. @@ -9276,7 +9276,7 @@
  6283.  		// Check if the command initiated is a character command
  6284.  		if (*message == charcommand_symbol &&
  6285.  				(ssd = map_nick2sd(charname)) == NULL && (ssd = map_nick2sd(charname2)) == NULL ) {
  6286. -			sprintf(output, msg_txt(1389), command); // %s failed. Player not found.
  6287. +			sprintf(output, msg_txt(sd->lang,1389), command); // %s failed. Player not found.
  6288.  			clif_displaymessage(fd, output);
  6289.  			return true;
  6290.  		}
  6291. @@ -9300,7 +9300,7 @@
  6292.  	info = get_atcommandinfo_byname(atcommand_checkalias(command + 1));
  6293.  	if (info == NULL) {
  6294.  		if( pc_get_group_level(sd) ) { // TODO: remove or replace with proper permission
  6295. -			sprintf(output, msg_txt(153), command); // "%s is Unknown Command."
  6296. +			sprintf(output, msg_txt(sd->lang,153), command); // "%s is Unknown Command."
  6297.  			clif_displaymessage(fd, output);
  6298.  			atcommand_get_suggestions(sd, command + 1, *message == atcommand_symbol);
  6299.  			return true;
  6300. @@ -9315,7 +9315,7 @@
  6301.  			return false;
  6302.  		}
  6303.  		if( pc_isdead(sd) && pc_has_permission(sd,PC_PERM_DISABLE_CMD_DEAD) ) {
  6304. -			clif_displaymessage(fd, msg_txt(1393)); // You can't use commands while dead
  6305. +			clif_displaymessage(fd, msg_txt(sd->lang,1393)); // You can't use commands while dead
  6306.  			return true;
  6307.  		}
  6308.  	}
  6309. @@ -9323,7 +9323,7 @@
  6310.  	// Check if target is valid only if confirmed that player can use command.
  6311.  	if (*message == charcommand_symbol &&
  6312.  	    (ssd = map_nick2sd(charname)) == NULL && (ssd = map_nick2sd(charname2)) == NULL ) {
  6313. -		sprintf(output, msg_txt(1389), command); // %s failed. Player not found.
  6314. +		sprintf(output, msg_txt(sd->lang,1389), command); // %s failed. Player not found.
  6315.  		clif_displaymessage(fd, output);
  6316.  		return true;
  6317.  	}
  6318. @@ -9331,7 +9331,7 @@
  6319.  	//Attempt to use the command
  6320.  	if ( (info->func(fd, (*atcmd_msg == atcommand_symbol) ? sd : ssd, command, params) != 0) )
  6321.  	{
  6322. -		sprintf(output,msg_txt(154), command); // %s failed.
  6323. +		sprintf(output,msg_txt(sd->lang,154), command); // %s failed.
  6324.  		clif_displaymessage(fd, output);
  6325.  		return true;
  6326.  	}
  6327. Index: src/map/buyingstore.c
  6328. ===================================================================
  6329. --- src/map/buyingstore.c	(revision 17206)
  6330. +++ src/map/buyingstore.c	(working copy)
  6331. @@ -58,13 +58,13 @@
  6332.  
  6333.  	if( map[sd->bl.m].flag.novending )
  6334.  	{// custom: no vending maps
  6335. -		clif_displaymessage(sd->fd, msg_txt(276)); // "You can't open a shop on this map"
  6336. +		clif_displaymessage(sd->fd, msg_txt(sd->lang,276)); // "You can't open a shop on this map"
  6337.  		return false;
  6338.  	}
  6339.  
  6340.  	if( map_getcell(sd->bl.m, sd->bl.x, sd->bl.y, CELL_CHKNOVENDING) )
  6341.  	{// custom: no vending cells
  6342. -		clif_displaymessage(sd->fd, msg_txt(204)); // "You can't open a shop on this cell."
  6343. +		clif_displaymessage(sd->fd, msg_txt(sd->lang,204)); // "You can't open a shop on this cell."
  6344.  		return false;
  6345.  	}
  6346.  
  6347. @@ -101,7 +101,7 @@
  6348.  	if( !pc_can_give_items(sd) )
  6349.  	{// custom: GM is not allowed to buy (give zeny)
  6350.  		sd->buyingstore.slots = 0;
  6351. -		clif_displaymessage(sd->fd, msg_txt(246));
  6352. +		clif_displaymessage(sd->fd, msg_txt(sd->lang,246));
  6353.  		clif_buyingstore_open_failed(sd, BUYINGSTORE_CREATE, 0);
  6354.  		return;
  6355.  	}
  6356. @@ -113,13 +113,13 @@
  6357.  
  6358.  	if( map[sd->bl.m].flag.novending )
  6359.  	{// custom: no vending maps
  6360. -		clif_displaymessage(sd->fd, msg_txt(276)); // "You can't open a shop on this map"
  6361. +		clif_displaymessage(sd->fd, msg_txt(sd->lang,276)); // "You can't open a shop on this map"
  6362.  		return;
  6363.  	}
  6364.  
  6365.  	if( map_getcell(sd->bl.m, sd->bl.x, sd->bl.y, CELL_CHKNOVENDING) )
  6366.  	{// custom: no vending cells
  6367. -		clif_displaymessage(sd->fd, msg_txt(204)); // "You can't open a shop on this cell."
  6368. +		clif_displaymessage(sd->fd, msg_txt(sd->lang,204)); // "You can't open a shop on this cell."
  6369.  		return;
  6370.  	}
  6371.  
  6372. @@ -221,7 +221,7 @@
  6373.  
  6374.  	if( !pc_can_give_items(sd) )
  6375.  	{// custom: GM is not allowed to sell
  6376. -		clif_displaymessage(sd->fd, msg_txt(246));
  6377. +		clif_displaymessage(sd->fd, msg_txt(sd->lang,246));
  6378.  		return;
  6379.  	}
  6380.  
  6381. @@ -259,7 +259,7 @@
  6382.  
  6383.  	if( !pc_can_give_items(sd) )
  6384.  	{// custom: GM is not allowed to sell
  6385. -		clif_displaymessage(sd->fd, msg_txt(246));
  6386. +		clif_displaymessage(sd->fd, msg_txt(sd->lang,246));
  6387.  		clif_buyingstore_trade_failed_seller(sd, BUYINGSTORE_TRADE_SELLER_FAILED, 0);
  6388.  		return;
  6389.  	}
  6390. Index: src/map/chat.c
  6391. ===================================================================
  6392. --- src/map/chat.c	(revision 17206)
  6393. +++ src/map/chat.c	(working copy)
  6394. @@ -7,7 +7,7 @@
  6395.  #include "../common/showmsg.h"
  6396.  #include "../common/strlib.h"
  6397.  #include "../common/mmo.h"
  6398. -#include "atcommand.h" // msg_txt()
  6399. +#include "atcommand.h" // msg_txt(sd->lang,)
  6400.  #include "battle.h" // struct battle_config
  6401.  #include "clif.h"
  6402.  #include "map.h"
  6403. @@ -83,13 +83,13 @@
  6404.  
  6405.  	if( map[sd->bl.m].flag.nochat )
  6406.  	{
  6407. -		clif_displaymessage(sd->fd, msg_txt(281));
  6408. +		clif_displaymessage(sd->fd, msg_txt(sd->lang,281));
  6409.  		return 0; //Can't create chatrooms on this map.
  6410.  	}
  6411.  
  6412.  	if( map_getcell(sd->bl.m,sd->bl.x,sd->bl.y,CELL_CHKNOCHAT) )
  6413.  	{
  6414. -		clif_displaymessage (sd->fd, msg_txt(665));
  6415. +		clif_displaymessage (sd->fd, msg_txt(sd->lang,665));
  6416.  		return 0;
  6417.  	}
  6418.  
  6419. Index: src/map/chrif.c
  6420. ===================================================================
  6421. --- src/map/chrif.c	(revision 17206)
  6422. +++ src/map/chrif.c	(working copy)
  6423. @@ -40,7 +40,7 @@
  6424.  
  6425.  static const int packet_len_table[0x3d] = { // U - used, F - free
  6426.  	60, 3,-1,27,10,-1, 6,-1,	// 2af8-2aff: U->2af8, U->2af9, U->2afa, U->2afb, U->2afc, U->2afd, U->2afe, U->2aff
  6427. -	 6,-1,18, 7,-1,39,30, 10,	// 2b00-2b07: U->2b00, U->2b01, U->2b02, U->2b03, U->2b04, U->2b05, U->2b06, U->2b07
  6428. +	 6,-1,18, 7,-1,40,30, 10,	// 2b00-2b07: U->2b00, U->2b01, U->2b02, U->2b03, U->2b04, U->2b05, U->2b06, U->2b07
  6429.  	 6,30, 0, 0,86, 7,44,34,	// 2b08-2b0f: U->2b08, U->2b09, F->2b0a, F->2b0b, U->2b0c, U->2b0d, U->2b0e, U->2b0f
  6430.  	11,10,10, 0,11, 0,266,10,	// 2b10-2b17: U->2b10, U->2b11, U->2b12, F->2b13, U->2b14, F->2b15, U->2b16, U->2b17
  6431.  	 2,10, 2,-1,-1,-1, 2, 7,	// 2b18-2b1f: U->2b18, U->2b19, U->2b1a, U->2b1b, U->2b1c, U->2b1d, U->2b1e, U->2b1f
  6432. @@ -419,7 +419,8 @@
  6433.  	WFIFOB(char_fd,30) = sd->status.sex;
  6434.  	WFIFOL(char_fd,31) = htonl(session[sd->fd]->client_addr);
  6435.  	WFIFOL(char_fd,35) = sd->group_id;
  6436. -	WFIFOSET(char_fd,39);
  6437. +	WFIFOL(char_fd,39) = sd->lang;
  6438. +	WFIFOSET(char_fd,40);
  6439.  
  6440.  	return 0;
  6441.  }
  6442. @@ -596,11 +597,12 @@
  6443.  	struct mmo_charstatus* status;
  6444.  	struct auth_node *node;
  6445.  	bool changing_mapservers;
  6446. +	int lang;
  6447.  	TBL_PC* sd;
  6448.  
  6449.  	//Check if both servers agree on the struct's size
  6450. -	if( RFIFOW(fd,2) - 25 != sizeof(struct mmo_charstatus) ) {
  6451. -		ShowError("chrif_authok: Data size mismatch! %d != %d\n", RFIFOW(fd,2) - 25, sizeof(struct mmo_charstatus));
  6452. +	if( RFIFOW(fd,2) - 29 != sizeof(struct mmo_charstatus) ) {
  6453. +		ShowError("chrif_authok: Data size mismatch! %d != %d\n", RFIFOW(fd,2) - 29, sizeof(struct mmo_charstatus));
  6454.  		return;
  6455.  	}
  6456.  
  6457. @@ -609,8 +611,9 @@
  6458.  	login_id2 = RFIFOL(fd,12);
  6459.  	expiration_time = (time_t)(int32)RFIFOL(fd,16);
  6460.  	group_id = RFIFOL(fd,20);
  6461. -	changing_mapservers = (RFIFOB(fd,24));
  6462. -	status = (struct mmo_charstatus*)RFIFOP(fd,25);
  6463. +	lang = RFIFOL(fd,24);
  6464. +	changing_mapservers = (RFIFOB(fd,28));
  6465. +	status = (struct mmo_charstatus*)RFIFOP(fd,29);
  6466.  	char_id = status->char_id;
  6467.  
  6468.  	//Check if we don't already have player data in our server
  6469. @@ -641,7 +644,7 @@
  6470.  		node->char_id == char_id &&
  6471.  		node->login_id1 == login_id1 )
  6472.  	{ //Auth Ok
  6473. -		if (pc_authok(sd, login_id2, expiration_time, group_id, status, changing_mapservers))
  6474. +		if (pc_authok(sd, login_id2, expiration_time, group_id, lang, status, changing_mapservers))
  6475.  			return;
  6476.  	} else { //Auth Failed
  6477.  		pc_authfail(sd);
  6478. @@ -810,7 +813,7 @@
  6479.  	WFIFOW(char_fd,30) = 5;
  6480.  	WFIFOSET(char_fd,44);
  6481.  
  6482. -	clif_displaymessage(sd->fd, msg_txt(408)); //"Need disconnection to perform change-sex request..."
  6483. +	clif_displaymessage(sd->fd, msg_txt(sd->lang,408)); //"Need disconnection to perform change-sex request..."
  6484.  
  6485.  	if (sd->fd)
  6486.  		clif_authfail_fd(sd->fd, 15);
  6487. @@ -843,15 +846,15 @@
  6488.  	}
  6489.  
  6490.  	if( type > 0 && type <= 5 )
  6491. -		snprintf(action,25,"%s",msg_txt(427+type)); //block|ban|unblock|unban|change the sex of
  6492. +		snprintf(action,25,"%s",msg_txt(sd->lang,427+type)); //block|ban|unblock|unban|change the sex of
  6493.  	else
  6494.  		snprintf(action,25,"???");
  6495.  
  6496.  	switch( answer ) {
  6497. -		case 0 : sprintf(output, msg_txt(424), action, NAME_LENGTH, player_name); break;
  6498. -		case 1 : sprintf(output, msg_txt(425), NAME_LENGTH, player_name); break;
  6499. -		case 2 : sprintf(output, msg_txt(426), action, NAME_LENGTH, player_name); break;
  6500. -		case 3 : sprintf(output, msg_txt(427), action, NAME_LENGTH, player_name); break;
  6501. +		case 0 : sprintf(output, msg_txt(sd->lang,424), action, NAME_LENGTH, player_name); break;
  6502. +		case 1 : sprintf(output, msg_txt(sd->lang,425), NAME_LENGTH, player_name); break;
  6503. +		case 2 : sprintf(output, msg_txt(sd->lang,426), action, NAME_LENGTH, player_name); break;
  6504. +		case 3 : sprintf(output, msg_txt(sd->lang,427), action, NAME_LENGTH, player_name); break;
  6505.  		default: output[0] = '\0'; break;
  6506.  	}
  6507.  
  6508. @@ -907,7 +910,7 @@
  6509.  		// save character
  6510.  		sd->login_id1++; // change identify, because if player come back in char within the 5 seconds, he can change its characters
  6511.  							  // do same modify in login-server for the account, but no in char-server (it ask again login_id1 to login, and don't remember it)
  6512. -		clif_displaymessage(sd->fd, msg_txt(409)); //"Your sex has been changed (need disconnection by the server)..."
  6513. +		clif_displaymessage(sd->fd, msg_txt(sd->lang,409)); //"Your sex has been changed (need disconnection by the server)..."
  6514.  		set_eof(sd->fd); // forced to disconnect for the change
  6515.  		map_quit(sd); // Remove leftovers (e.g. autotrading) [Paradox924X]
  6516.  	}
  6517. @@ -1003,16 +1006,16 @@
  6518.  	if (RFIFOB(fd,6) == 0) { // 0: change of statut, 1: ban
  6519.                  int ret_status = RFIFOL(fd,7); // status or final date of a banishment
  6520.                  if(0<ret_status && ret_status<=9)
  6521. -                    clif_displaymessage(sd->fd, msg_txt(411+ret_status));
  6522. +                    clif_displaymessage(sd->fd, msg_txt(sd->lang,411+ret_status));
  6523.                  else if(ret_status==100)
  6524. -                    clif_displaymessage(sd->fd, msg_txt(421));
  6525. +                    clif_displaymessage(sd->fd, msg_txt(sd->lang,421));
  6526.                  else    
  6527. -                    clif_displaymessage(sd->fd, msg_txt(420)); //"Your account has not more authorised." 
  6528. +                    clif_displaymessage(sd->fd, msg_txt(sd->lang,420)); //"Your account has not more authorised." 
  6529.  	} else if (RFIFOB(fd,6) == 1) { // 0: change of statut, 1: ban
  6530.  		time_t timestamp;
  6531.  		char tmpstr[2048];
  6532.  		timestamp = (time_t)RFIFOL(fd,7); // status or final date of a banishment
  6533. -		strcpy(tmpstr, msg_txt(423)); //"Your account has been banished until "
  6534. +		strcpy(tmpstr, msg_txt(sd->lang,423)); //"Your account has been banished until "
  6535.  		strftime(tmpstr + strlen(tmpstr), 24, "%d-%m-%Y %H:%M:%S", localtime(&timestamp));
  6536.  		clif_displaymessage(sd->fd, tmpstr);
  6537.  	}
  6538. Index: src/map/clif.c
  6539. ===================================================================
  6540. --- src/map/clif.c	(revision 17206)
  6541. +++ src/map/clif.c	(working copy)
  6542. @@ -6381,7 +6381,7 @@
  6543.  
  6544.  #if PACKETVER < 20070904
  6545.  	if( result == 7 ) {
  6546. -		clif_displaymessage(fd, msg_txt(3));
  6547. +		clif_displaymessage(fd, msg_txt(sd->lang,3));
  6548.  		return;
  6549.  	}
  6550.  #endif
  6551. @@ -6689,7 +6689,7 @@
  6552.  	fd=sd->fd;
  6553.  	if (battle_config.pet_no_gvg && map_flag_gvg(sd->bl.m))
  6554.  	{	//Disable pet hatching in GvG grounds during Guild Wars [Skotlex]
  6555. -		clif_displaymessage(fd, msg_txt(666));
  6556. +		clif_displaymessage(fd, msg_txt(sd->lang,666));
  6557.  		return;
  6558.  	}
  6559.  	WFIFOHEAD(fd, MAX_INVENTORY * 2 + 4);
  6560. @@ -7192,7 +7192,7 @@
  6561.  	memcpy(WFIFOP(fd,46),g->name, NAME_LENGTH);
  6562.  	memcpy(WFIFOP(fd,70),g->master, NAME_LENGTH);
  6563.  
  6564. -	safestrncpy((char*)WFIFOP(fd,94),msg_txt(300+guild_checkcastles(g)),16); // "'N' castles"
  6565. +	safestrncpy((char*)WFIFOP(fd,94),msg_txt(sd->lang,300+guild_checkcastles(g)),16); // "'N' castles"
  6566.  	WFIFOL(fd,110) = 0;  // zeny
  6567.  
  6568.  	WFIFOSET(fd,packet_len(0x1b6));
  6569. @@ -9208,7 +9208,7 @@
  6570.  	{
  6571.  		if( battle_config.pet_no_gvg && map_flag_gvg(sd->bl.m) )
  6572.  		{	//Return the pet to egg. [Skotlex]
  6573. -			clif_displaymessage(sd->fd, msg_txt(666));
  6574. +			clif_displaymessage(sd->fd, msg_txt(sd->lang,666));
  6575.  			pet_menu(sd, 3); //Option 3 is return to egg.
  6576.  		}
  6577.  		else
  6578. @@ -10030,7 +10030,7 @@
  6579.  		}
  6580.  	} else if(strcmpi(target, main_chat_nick) == 0) { // Main chat [LuzZza]
  6581.  		if(!sd->state.mainchat)
  6582. -			clif_displaymessage(fd, msg_txt(388)); // You should enable main chat with "@main on" command.
  6583. +			clif_displaymessage(fd, msg_txt(sd->lang,388)); // You should enable main chat with "@main on" command.
  6584.  		else {
  6585.  			// send the main message using inter-server system
  6586.  			intif_main_message( sd, message );
  6587. @@ -10410,7 +10410,7 @@
  6588.  	if( npc_isnear(&sd->bl) ) {
  6589.  		// uncomment to send msg_txt.
  6590.  		//char output[150];
  6591. -		//sprintf(output, msg_txt(662), battle_config.min_npc_vendchat_distance);
  6592. +		//sprintf(output, msg_txt(sd->lang,662), battle_config.min_npc_vendchat_distance);
  6593.  		//clif_displaymessage(sd->fd, output);
  6594.  		clif_skill_fail(sd,1,USESKILL_FAIL_THERE_ARE_NPC_AROUND,0);
  6595.  		return;
  6596. @@ -10492,15 +10492,15 @@
  6597.  //Handles notifying asker and rejecter of what has just ocurred.
  6598.  //Type is used to determine the correct msg_txt to use:
  6599.  //0:
  6600. -static void clif_noask_sub(struct map_session_data *src, struct map_session_data *target, int type)
  6601. +static void clif_noask_sub(struct map_session_data *sd, struct map_session_data *target, int type)
  6602.  {
  6603.  	const char* msg;
  6604.  	char output[256];
  6605.  	// Your request has been rejected by autoreject option.
  6606. -	msg = msg_txt(392);
  6607. -	clif_disp_onlyself(src, msg, strlen(msg));
  6608. +	msg = msg_txt(sd->lang,392);
  6609. +	clif_disp_onlyself(sd, msg, strlen(msg));
  6610.  	//Notice that a request was rejected.
  6611. -	snprintf(output, 256, msg_txt(393+type), src->status.name, 256);
  6612. +	snprintf(output, 256, msg_txt(sd->lang,393+type), sd->status.name, 256);
  6613.  	clif_disp_onlyself(target, output, strlen(output));
  6614.  }
  6615.  
  6616. @@ -11481,7 +11481,7 @@
  6617.  
  6618.  	if( map[sd->bl.m].flag.partylock )
  6619.  	{// Party locked.
  6620. -		clif_displaymessage(fd, msg_txt(227));
  6621. +		clif_displaymessage(fd, msg_txt(sd->lang,227));
  6622.  		return;
  6623.  	}
  6624.  	if( battle_config.basic_skill_check && pc_checkskill(sd,NV_BASIC) < 7 )
  6625. @@ -11502,7 +11502,7 @@
  6626.  
  6627.  	if( map[sd->bl.m].flag.partylock )
  6628.  	{// Party locked.
  6629. -		clif_displaymessage(fd, msg_txt(227));
  6630. +		clif_displaymessage(fd, msg_txt(sd->lang,227));
  6631.  		return;
  6632.  	}
  6633.  	if( battle_config.basic_skill_check && pc_checkskill(sd,NV_BASIC) < 7 )
  6634. @@ -11524,7 +11524,7 @@
  6635.  
  6636.  	if(map[sd->bl.m].flag.partylock)
  6637.  	{// Party locked.
  6638. -		clif_displaymessage(fd, msg_txt(227));
  6639. +		clif_displaymessage(fd, msg_txt(sd->lang,227));
  6640.  		return;
  6641.  	}
  6642.  
  6643. @@ -11547,7 +11547,7 @@
  6644.  
  6645.  	if(map[sd->bl.m].flag.partylock)
  6646.  	{// Party locked.
  6647. -		clif_displaymessage(fd, msg_txt(227));
  6648. +		clif_displaymessage(fd, msg_txt(sd->lang,227));
  6649.  		return;
  6650.  	}
  6651.  
  6652. @@ -11586,7 +11586,7 @@
  6653.  {
  6654.  	if(map[sd->bl.m].flag.partylock)
  6655.  	{	//Guild locked.
  6656. -		clif_displaymessage(fd, msg_txt(227));
  6657. +		clif_displaymessage(fd, msg_txt(sd->lang,227));
  6658.  		return;
  6659.  	}
  6660.  	party_leave(sd);
  6661. @@ -11599,7 +11599,7 @@
  6662.  {
  6663.  	if(map[sd->bl.m].flag.partylock)
  6664.  	{	//Guild locked.
  6665. -		clif_displaymessage(fd, msg_txt(227));
  6666. +		clif_displaymessage(fd, msg_txt(sd->lang,227));
  6667.  		return;
  6668.  	}
  6669.  	party_removemember(sd,RFIFOL(fd,2),(char*)RFIFOP(fd,6));
  6670. @@ -11921,11 +11921,11 @@
  6671.  	if( sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOROOM )
  6672.  		return;
  6673.  	if( map[sd->bl.m].flag.novending ) {
  6674. -		clif_displaymessage (sd->fd, msg_txt(276)); // "You can't open a shop on this map"
  6675. +		clif_displaymessage (sd->fd, msg_txt(sd->lang,276)); // "You can't open a shop on this map"
  6676.  		return;
  6677.  	}
  6678.  	if( map_getcell(sd->bl.m,sd->bl.x,sd->bl.y,CELL_CHKNOVENDING) ) {
  6679. -		clif_displaymessage (sd->fd, msg_txt(204)); // "You can't open a shop on this cell."
  6680. +		clif_displaymessage (sd->fd, msg_txt(sd->lang,204)); // "You can't open a shop on this cell."
  6681.  		return;
  6682.  	}
  6683.  
  6684. @@ -11945,7 +11945,7 @@
  6685.  
  6686.  	if(map[sd->bl.m].flag.guildlock)
  6687.  	{	//Guild locked.
  6688. -		clif_displaymessage(fd, msg_txt(228));
  6689. +		clif_displaymessage(fd, msg_txt(sd->lang,228));
  6690.  		return;
  6691.  	}
  6692.  
  6693. @@ -12111,7 +12111,7 @@
  6694.  
  6695.  	if(map[sd->bl.m].flag.guildlock)
  6696.  	{	//Guild locked.
  6697. -		clif_displaymessage(fd, msg_txt(228));
  6698. +		clif_displaymessage(fd, msg_txt(sd->lang,228));
  6699.  		return;
  6700.  	}
  6701.  
  6702. @@ -12144,12 +12144,12 @@
  6703.  {
  6704.  	if(map[sd->bl.m].flag.guildlock)
  6705.  	{	//Guild locked.
  6706. -		clif_displaymessage(fd, msg_txt(228));
  6707. +		clif_displaymessage(fd, msg_txt(sd->lang,228));
  6708.  		return;
  6709.  	}
  6710.  	if( sd->bg_id )
  6711.  	{
  6712. -		clif_displaymessage(fd, msg_txt(670)); //"You can't leave battleground guilds."
  6713. +		clif_displaymessage(fd, msg_txt(sd->lang,670)); //"You can't leave battleground guilds."
  6714.  		return;
  6715.  	}
  6716.  
  6717. @@ -12163,7 +12163,7 @@
  6718.  {
  6719.  	if( map[sd->bl.m].flag.guildlock || sd->bg_id )
  6720.  	{ // Guild locked.
  6721. -		clif_displaymessage(fd, msg_txt(228));
  6722. +		clif_displaymessage(fd, msg_txt(sd->lang,228));
  6723.  		return;
  6724.  	}
  6725.  	guild_expulsion(sd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),(char*)RFIFOP(fd,14));
  6726. @@ -12218,7 +12218,7 @@
  6727.  
  6728.  	if(map[sd->bl.m].flag.guildlock)
  6729.  	{	//Guild locked.
  6730. -		clif_displaymessage(fd, msg_txt(228));
  6731. +		clif_displaymessage(fd, msg_txt(sd->lang,228));
  6732.  		return;
  6733.  	}
  6734.  
  6735. @@ -12257,7 +12257,7 @@
  6736.  
  6737.  	if(map[sd->bl.m].flag.guildlock)
  6738.  	{	//Guild locked.
  6739. -		clif_displaymessage(fd, msg_txt(228));
  6740. +		clif_displaymessage(fd, msg_txt(sd->lang,228));
  6741.  		return;
  6742.  	}
  6743.  	guild_delalliance(sd,RFIFOL(fd,2),RFIFOL(fd,6));
  6744. @@ -12275,7 +12275,7 @@
  6745.  
  6746.  	if(map[sd->bl.m].flag.guildlock)
  6747.  	{	//Guild locked.
  6748. -		clif_displaymessage(fd, msg_txt(228));
  6749. +		clif_displaymessage(fd, msg_txt(sd->lang,228));
  6750.  		return;
  6751.  	}
  6752.  
  6753. @@ -12300,7 +12300,7 @@
  6754.  {
  6755.  	if( map[sd->bl.m].flag.guildlock )
  6756.  	{	//Guild locked.
  6757. -		clif_displaymessage(fd, msg_txt(228));
  6758. +		clif_displaymessage(fd, msg_txt(sd->lang,228));
  6759.  		return;
  6760.  	}
  6761.  	guild_break(sd,(char*)RFIFOP(fd,2));
  6762. @@ -12966,7 +12966,7 @@
  6763.  
  6764.  	// Friend doesn't exist (no player with this name)
  6765.  	if (f_sd == NULL) {
  6766. -		clif_displaymessage(fd, msg_txt(3));
  6767. +		clif_displaymessage(fd, msg_txt(sd->lang,3));
  6768.  		return;
  6769.  	}
  6770.  
  6771. @@ -12984,7 +12984,7 @@
  6772.  	// Friend already exists
  6773.  	for (i = 0; i < MAX_FRIENDS && sd->status.friends[i].char_id != 0; i++) {
  6774.  		if (sd->status.friends[i].char_id == f_sd->status.char_id) {
  6775. -			clif_displaymessage(fd, msg_txt(671)); //"Friend already exists."
  6776. +			clif_displaymessage(fd, msg_txt(sd->lang,671)); //"Friend already exists."
  6777.  			return;
  6778.  		}
  6779.  	}
  6780. @@ -13081,7 +13081,7 @@
  6781.  		(sd->status.friends[i].char_id != char_id || sd->status.friends[i].account_id != account_id); i++);
  6782.  
  6783.  	if (i == MAX_FRIENDS) {
  6784. -		clif_displaymessage(fd, msg_txt(672)); //"Name not found in list."
  6785. +		clif_displaymessage(fd, msg_txt(sd->lang,672)); //"Name not found in list."
  6786.  		return;
  6787.  	}
  6788.  
  6789. @@ -13106,7 +13106,7 @@
  6790.  
  6791.  	} else { //friend not online -- ask char server to delete from his friendlist
  6792.  		if(chrif_removefriend(char_id,sd->status.char_id)) { // char-server offline, abort
  6793. -			clif_displaymessage(fd, msg_txt(673)); //"This action can't be performed at the moment. Please try again later."
  6794. +			clif_displaymessage(fd, msg_txt(sd->lang,673)); //"This action can't be performed at the moment. Please try again later."
  6795.  			return;
  6796.  		}
  6797.  	}
  6798. @@ -13119,7 +13119,7 @@
  6799.  		memcpy(&sd->status.friends[j-1], &sd->status.friends[j], sizeof(sd->status.friends[0]));
  6800.  
  6801.  	memset(&sd->status.friends[MAX_FRIENDS-1], 0, sizeof(sd->status.friends[MAX_FRIENDS-1]));
  6802. -	clif_displaymessage(fd, msg_txt(674)); //"Friend removed"
  6803. +	clif_displaymessage(fd, msg_txt(sd->lang,674)); //"Friend removed"
  6804.  
  6805.  	WFIFOHEAD(fd,packet_len(0x20a));
  6806.  	WFIFOW(fd,0) = 0x20a;
  6807. @@ -13973,7 +13973,7 @@
  6808.  
  6809.  	if( DIFF_TICK(sd->cansendmail_tick, gettick()) > 0 )
  6810.  	{
  6811. -		clif_displaymessage(sd->fd,msg_txt(675)); //"Cannot send mails too fast!!."
  6812. +		clif_displaymessage(sd->fd,msg_txt(sd->lang,675)); //"Cannot send mails too fast!!."
  6813.  		clif_Mail_send(fd, true); // fail
  6814.  		return;
  6815.  	}
  6816. @@ -14302,7 +14302,7 @@
  6817.  	int bid = RFIFOL(fd,6);
  6818.  
  6819.  	if( !pc_can_give_items(sd) ) { //They aren't supposed to give zeny [Inkfish]
  6820. -		clif_displaymessage(sd->fd, msg_txt(246));
  6821. +		clif_displaymessage(sd->fd, msg_txt(sd->lang,246));
  6822.  		return;
  6823.  	}
  6824.  
  6825. Index: src/map/duel.c
  6826. ===================================================================
  6827. --- src/map/duel.c	(revision 17206)
  6828. +++ src/map/duel.c	(working copy)
  6829. @@ -62,13 +62,13 @@
  6830.  	char output[256];
  6831.  
  6832.  	if(duel_list[did].max_players_limit > 0)
  6833. -		sprintf(output, msg_txt(370), //" -- Duels: %d/%d, Members: %d/%d, Max players: %d --"
  6834. +		sprintf(output, msg_txt(sd->lang,370), //" -- Duels: %d/%d, Members: %d/%d, Max players: %d --"
  6835.  			did, duel_count,
  6836.  			duel_list[did].members_count,
  6837.  			duel_list[did].members_count + duel_list[did].invites_count,
  6838.  			duel_list[did].max_players_limit);
  6839.  	else
  6840. -		sprintf(output, msg_txt(371), //" -- Duels: %d/%d, Members: %d/%d --"
  6841. +		sprintf(output, msg_txt(sd->lang,371), //" -- Duels: %d/%d, Members: %d/%d --"
  6842.  			did, duel_count,
  6843.  			duel_list[did].members_count,
  6844.  			duel_list[did].members_count + duel_list[did].invites_count);
  6845. @@ -91,7 +91,7 @@
  6846.  	duel_list[i].invites_count = 0;
  6847.  	duel_list[i].max_players_limit = maxpl;
  6848.  
  6849. -	strcpy(output, msg_txt(372)); // " -- Duel has been created (@invite/@leave) --"
  6850. +	strcpy(output, msg_txt(sd->lang,372)); // " -- Duel has been created (@invite/@leave) --"
  6851.  	clif_disp_onlyself(sd, output, strlen(output));
  6852.  
  6853.  	clif_map_property(sd, MAPPROPERTY_FREEPVPZONE);
  6854. @@ -104,14 +104,14 @@
  6855.  	char output[256];
  6856.  
  6857.  	// " -- Player %s invites %s to duel --"
  6858. -	sprintf(output, msg_txt(373), sd->status.name, target_sd->status.name);
  6859. +	sprintf(output, msg_txt(sd->lang,373), sd->status.name, target_sd->status.name);
  6860.  	clif_disp_message(&sd->bl, output, strlen(output), DUEL_WOS);
  6861.  
  6862.  	target_sd->duel_invite = did;
  6863.  	duel_list[did].invites_count++;
  6864.  
  6865.  	// "Blue -- Player %s invites you to PVP duel (@accept/@reject) --"
  6866. -	sprintf(output, msg_txt(374), sd->status.name);
  6867. +	sprintf(output, msg_txt(sd->lang,374), sd->status.name);
  6868.  	clif_broadcast((struct block_list *)target_sd, output, strlen(output)+1, 0x10, SELF);
  6869.  }
  6870.  
  6871. @@ -128,7 +128,7 @@
  6872.  	char output[256];
  6873.  
  6874.  	// " <- Player %s has left duel --"
  6875. -	sprintf(output, msg_txt(375), sd->status.name);
  6876. +	sprintf(output, msg_txt(sd->lang,375), sd->status.name);
  6877.  	clif_disp_message(&sd->bl, output, strlen(output), DUEL_WOS);
  6878.  
  6879.  	duel_list[did].members_count--;
  6880. @@ -153,7 +153,7 @@
  6881.  	sd->duel_invite = 0;
  6882.  
  6883.  	// " -> Player %s has accepted duel --"
  6884. -	sprintf(output, msg_txt(376), sd->status.name);
  6885. +	sprintf(output, msg_txt(sd->lang,376), sd->status.name);
  6886.  	clif_disp_message(&sd->bl, output, strlen(output), DUEL_WOS);
  6887.  
  6888.  	clif_map_property(sd, MAPPROPERTY_FREEPVPZONE);
  6889. @@ -165,7 +165,7 @@
  6890.  	char output[256];
  6891.  
  6892.  	// " -- Player %s has rejected duel --"
  6893. -	sprintf(output, msg_txt(377), sd->status.name);
  6894. +	sprintf(output, msg_txt(sd->lang,377), sd->status.name);
  6895.  	clif_disp_message(&sd->bl, output, strlen(output), DUEL_WOS);
  6896.  
  6897.  	duel_list[did].invites_count--;
  6898. Index: src/map/guild.c
  6899. ===================================================================
  6900. --- src/map/guild.c	(revision 17206)
  6901. +++ src/map/guild.c	(working copy)
  6902. @@ -1370,7 +1370,7 @@
  6903.  	int i;
  6904.  
  6905.  	if(agit_flag || agit2_flag)	{	// Disable alliance creation during woe [Valaris]
  6906. -		clif_displaymessage(sd->fd,msg_txt(676)); //"Alliances cannot be made during Guild Wars!"
  6907. +		clif_displaymessage(sd->fd,msg_txt(sd->lang,676)); //"Alliances cannot be made during Guild Wars!"
  6908.  		return 0;
  6909.  	}	// end addition [Valaris]
  6910.  
  6911. @@ -1488,7 +1488,7 @@
  6912.  	nullpo_ret(sd);
  6913.  
  6914.  	if(agit_flag || agit2_flag)	{	// Disable alliance breaking during woe [Valaris]
  6915. -		clif_displaymessage(sd->fd,msg_txt(677)); //"Alliances cannot be broken during Guild Wars!"
  6916. +		clif_displaymessage(sd->fd,msg_txt(sd->lang,677)); //"Alliances cannot be broken during Guild Wars!"
  6917.  		return 0;
  6918.  	}	// end addition [Valaris]
  6919.  
  6920. @@ -1745,13 +1745,13 @@
  6921.  
  6922.  	if (g->member[pos].sd && g->member[pos].sd->fd)
  6923.  	{
  6924. -		clif_displaymessage(g->member[pos].sd->fd, msg_txt(678)); //"You no longer are the Guild Master."
  6925. +		clif_displaymessage(g->member[pos].sd->fd, msg_txt(g->member[pos].sd->lang,678)); //"You no longer are the Guild Master."
  6926.  		g->member[pos].sd->state.gmaster_flag = 0;
  6927.  	}
  6928.  
  6929.  	if (g->member[0].sd && g->member[0].sd->fd)
  6930.  	{
  6931. -		clif_displaymessage(g->member[0].sd->fd, msg_txt(679)); //"You have become the Guild Master!"
  6932. +		clif_displaymessage(g->member[0].sd->fd, msg_txt(g->member[0].sd->lang,679)); //"You have become the Guild Master!"
  6933.  		g->member[0].sd->state.gmaster_flag = g;
  6934.  		//Block his skills for 5 minutes to prevent abuse.
  6935.  		guild_block_skill(g->member[0].sd, 300000);
  6936. Index: src/map/homunculus.c
  6937. ===================================================================
  6938. --- src/map/homunculus.c	(revision 17206)
  6939. +++ src/map/homunculus.c	(working copy)
  6940. @@ -707,7 +707,7 @@
  6941.  	normalize_name(name," ");//bugreport:3032
  6942.  
  6943.  	if ( !flag || !strlen(name) ) {
  6944. -		clif_displaymessage(sd->fd, msg_txt(280)); // You cannot use this name
  6945. +		clif_displaymessage(sd->fd, msg_txt(sd->lang,280)); // You cannot use this name
  6946.  		return 0;
  6947.  	}
  6948.  	safestrncpy(hd->homunculus.name,name,NAME_LENGTH);
  6949. Index: src/map/intif.c
  6950. ===================================================================
  6951. --- src/map/intif.c	(revision 17206)
  6952. +++ src/map/intif.c	(working copy)
  6953. @@ -204,7 +204,7 @@
  6954.  	nullpo_ret(sd);
  6955.  
  6956.  	// format the message for main broadcasting
  6957. -	snprintf( output, sizeof(output), msg_txt(386), sd->status.name, message );
  6958. +	snprintf( output, sizeof(output), msg_txt(sd->lang,386), sd->status.name, message );
  6959.  
  6960.  	// send the message using the inter-server broadcast service
  6961.  	intif_broadcast2( output, strlen(output) + 1, 0xFE000000, 0, 0, 0, 0 );
  6962. @@ -1527,7 +1527,7 @@
  6963.  	else if( battle_config.mail_show_status && ( battle_config.mail_show_status == 1 || sd->mail.inbox.unread ) )
  6964.  	{
  6965.  		char output[128];
  6966. -		sprintf(output, msg_txt(510), sd->mail.inbox.unchecked, sd->mail.inbox.unread + sd->mail.inbox.unchecked);
  6967. +		sprintf(output, msg_txt(sd->lang,510), sd->mail.inbox.unchecked, sd->mail.inbox.unread + sd->mail.inbox.unchecked);
  6968.  		clif_disp_onlyself(sd, output, strlen(output));
  6969.  	}
  6970.  	return 0;
  6971. Index: src/map/map.c
  6972. ===================================================================
  6973. --- src/map/map.c	(revision 17206)
  6974. +++ src/map/map.c	(working copy)
  6975. @@ -107,7 +107,7 @@
  6976.  static int bl_list_count = 0;
  6977.  
  6978.  #define MAP_MAX_MSG 1500
  6979. -static char* msg_table[MAP_MAX_MSG]; // map Server messages
  6980. +static char* msg_table[MAX_LANG][MAP_MAX_MSG]; // map Server messages
  6981.  
  6982.  struct map_data map[MAX_MAP_PER_SERVER];
  6983.  int map_num = 0;
  6984. @@ -3273,7 +3273,16 @@
  6985.  			enable_grf = config_switch(w2);
  6986.  		else if (strcmpi(w1, "console_msg_log") == 0)
  6987.  			console_msg_log = atoi(w2);//[Ind]
  6988. -		else if (strcmpi(w1, "import") == 0)
  6989. +		else if (strcmpi(w1, "read_msg") == 0){
  6990. +			int lang;
  6991. +			char path[256];
  6992. +			if( sscanf(w2, "%d, %s", &lang, path) == 2){
  6993. +				if( lang < 1 || lang > MAX_LANG )
  6994. +					ShowWarning("read_msg: Invalid Lnaguage ID '%s' in file %s. Must be 1~%s\n", w1, cfgName, MAX_LANG);
  6995. +				else
  6996. +					msg_config_read(path,lang);
  6997. +			}
  6998. +		} else if (strcmpi(w1, "import") == 0)
  6999.  			map_config_read(w2);
  7000.  		else
  7001.  			ShowWarning("Unknown setting '%s' in file %s\n", w1, cfgName);
  7002. @@ -3757,7 +3766,7 @@
  7003.  	}
  7004.  
  7005.  	battle_config_read(BATTLE_CONF_FILENAME);
  7006. -	msg_config_read(MSG_CONF_NAME);
  7007. +	msg_config_read(MSG_CONF_NAME,0);
  7008.  	script_config_read(SCRIPT_CONF_NAME);
  7009.  	inter_config_read(INTER_CONF_NAME);
  7010.  	log_config_read(LOG_CONF_NAME);
  7011. @@ -3837,12 +3846,14 @@
  7012.  	return 0;
  7013.  }
  7014.  
  7015. -int map_msg_config_read(char *cfgName){
  7016. -	return _msg_config_read(cfgName,MAP_MAX_MSG,msg_table);
  7017. +int map_msg_config_read(char *cfgName, int lang){
  7018. +	return _msg_config_read(cfgName,MAP_MAX_MSG,msg_table[lang]);
  7019.  }
  7020. -const char* map_msg_txt(int msg_number){
  7021. -	return _msg_txt(msg_number,MAP_MAX_MSG,msg_table);
  7022. +const char* map_msg_txt(int lang, int msg_number){
  7023. +	return _msg_txt(msg_number,MAP_MAX_MSG,msg_table[lang]);
  7024.  }
  7025.  void map_do_final_msg(void){
  7026. -	_do_final_msg(MAP_MAX_MSG,msg_table);
  7027. +	int i;
  7028. +	for( i = 0; i < MAX_LANG; i++)
  7029. +		_do_final_msg(MAP_MAX_MSG,msg_table[i]);
  7030.  }
  7031. Index: src/map/map.h
  7032. ===================================================================
  7033. --- src/map/map.h	(revision 17206)
  7034. +++ src/map/map.h	(working copy)
  7035. @@ -28,11 +28,11 @@
  7036.  	MAPSERVER_ST_LAST
  7037.  };
  7038.  
  7039. -#define msg_config_read(cfgName) map_msg_config_read(cfgName)
  7040. -#define msg_txt(msg_number) map_msg_txt(msg_number)
  7041. +#define msg_config_read(cfgName, lang) map_msg_config_read(cfgName, lang)
  7042. +#define msg_txt(lang, msg_number) map_msg_txt(lang, msg_number)
  7043.  #define do_final_msg() map_do_final_msg()
  7044. -int map_msg_config_read(char *cfgName);
  7045. -const char* map_msg_txt(int msg_number);
  7046. +int map_msg_config_read(char *cfgName, int lang);
  7047. +const char* map_msg_txt(int lang, int msg_number);
  7048.  void map_do_final_msg(void);
  7049.  
  7050.  #define MAX_NPC_PER_MAP 512
  7051. Index: src/map/mob.c
  7052. ===================================================================
  7053. --- src/map/mob.c	(revision 17206)
  7054. +++ src/map/mob.c	(working copy)
  7055. @@ -142,7 +142,7 @@
  7056.  	nd->bl.y = md->bl.y;
  7057.  	nd->bl.type = BL_NPC;
  7058.  
  7059. -	safestrncpy(nd->name, msg_txt(656), sizeof(nd->name));
  7060. +	safestrncpy(nd->name, msg_txt(0,656), sizeof(nd->name));
  7061.  
  7062.  	nd->class_ = 565;
  7063.  	nd->speed = 200;
  7064. @@ -2388,7 +2388,7 @@
  7065.  			//A Rare Drop Global Announce by Lupus
  7066.  			if( mvp_sd && drop_rate <= battle_config.rare_drop_announce ) {
  7067.  				char message[128];
  7068. -				sprintf (message, msg_txt(541), mvp_sd->status.name, md->name, it->jname, (float)drop_rate/100);
  7069. +				sprintf (message, msg_txt(sd->lang,541), mvp_sd->status.name, md->name, it->jname, (float)drop_rate/100);
  7070.  				//MSG: "'%s' won %s's %s (chance: %0.02f%%)"
  7071.  				intif_broadcast(message,strlen(message)+1,0);
  7072.  			}
  7073. @@ -2527,7 +2527,7 @@
  7074.  					struct item_data *i_data;
  7075.  					char message[128];
  7076.  					i_data = itemdb_exists(item.nameid);
  7077. -					sprintf (message, msg_txt(541), mvp_sd->status.name, md->name, i_data->jname, temp/100.);
  7078. +					sprintf (message, msg_txt(sd->lang,541), mvp_sd->status.name, md->name, i_data->jname, temp/100.);
  7079.  					//MSG: "'%s' won %s's %s (chance: %0.02f%%)"
  7080.  					intif_broadcast(message,strlen(message)+1,0);
  7081.  				}
  7082. Index: src/map/npc.c
  7083. ===================================================================
  7084. --- src/map/npc.c	(revision 17206)
  7085. +++ src/map/npc.c	(working copy)
  7086. @@ -1155,17 +1155,17 @@
  7087.      strftime(time, sizeof(time), "%H:%M", localtime(&nd->u.tomb.kill_time));
  7088.  
  7089.  	// TODO: Find exact color?
  7090. -	snprintf(buffer, sizeof(buffer), msg_txt(657), nd->u.tomb.md->db->name);
  7091. +	snprintf(buffer, sizeof(buffer), msg_txt(sd->lang,657), nd->u.tomb.md->db->name);
  7092.      clif_scriptmes(sd, nd->bl.id, buffer);
  7093.  
  7094. -    clif_scriptmes(sd, nd->bl.id, msg_txt(658));
  7095. +    clif_scriptmes(sd, nd->bl.id, msg_txt(sd->lang,658));
  7096.  
  7097. -    snprintf(buffer, sizeof(buffer), msg_txt(659), time);
  7098. +    snprintf(buffer, sizeof(buffer), msg_txt(sd->lang,659), time);
  7099.      clif_scriptmes(sd, nd->bl.id, buffer);
  7100.  
  7101. -    clif_scriptmes(sd, nd->bl.id, msg_txt(660));
  7102. +    clif_scriptmes(sd, nd->bl.id, msg_txt(sd->lang,660));
  7103.  
  7104. -	snprintf(buffer, sizeof(buffer), msg_txt(661), nd->u.tomb.killer_name[0] ? nd->u.tomb.killer_name : "Unknown");
  7105. +	snprintf(buffer, sizeof(buffer), msg_txt(sd->lang,661), nd->u.tomb.killer_name[0] ? nd->u.tomb.killer_name : "Unknown");
  7106.      clif_scriptmes(sd, nd->bl.id, buffer);
  7107.  
  7108.      clif_scriptclose(sd, nd->bl.id);
  7109. Index: src/map/party.c
  7110. ===================================================================
  7111. --- src/map/party.c	(revision 17206)
  7112. +++ src/map/party.c	(working copy)
  7113. @@ -12,7 +12,7 @@
  7114.  #include "../common/strlib.h"
  7115.  
  7116.  #include "party.h"
  7117. -#include "atcommand.h"	//msg_txt()
  7118. +#include "atcommand.h"	//msg_txt(sd->lang,)
  7119.  #include "pc.h"
  7120.  #include "map.h"
  7121.  #include "instance.h"
  7122. @@ -345,7 +345,7 @@
  7123.  	ARR_FIND(0, MAX_PARTY, i, p->data[i].sd == sd);
  7124.  
  7125.  	if( i == MAX_PARTY || !p->party.member[i].leader ) {
  7126. -		clif_displaymessage(sd->fd, msg_txt(282));
  7127. +		clif_displaymessage(sd->fd, msg_txt(sd->lang,282));
  7128.  		return 0;
  7129.  	}
  7130.  
  7131. @@ -359,7 +359,7 @@
  7132.  
  7133.  	// confirm whether the account has the ability to invite before checking the player
  7134.  	if( !pc_has_permission(sd, PC_PERM_PARTY) || (tsd && !pc_has_permission(tsd, PC_PERM_PARTY)) ) {
  7135. -		clif_displaymessage(sd->fd, msg_txt(81)); // "Your GM level doesn't authorize you to preform this action on the specified player."
  7136. +		clif_displaymessage(sd->fd, msg_txt(sd->lang,81)); // "Your GM level doesn't authorize you to preform this action on the specified player."
  7137.  		return 0;
  7138.  	}
  7139.  
  7140. @@ -644,13 +644,13 @@
  7141.  		return false;
  7142.  
  7143.  	if (!tsd || tsd->status.party_id != sd->status.party_id) {
  7144. -		clif_displaymessage(sd->fd, msg_txt(283));
  7145. +		clif_displaymessage(sd->fd, msg_txt(sd->lang,283));
  7146.  		return false;
  7147.  	}
  7148.  
  7149.  	if( map[sd->bl.m].flag.partylock )
  7150.  	{
  7151. -		clif_displaymessage(sd->fd, msg_txt(287));
  7152. +		clif_displaymessage(sd->fd, msg_txt(sd->lang,287));
  7153.  		return false;
  7154.  	}
  7155.  
  7156. @@ -663,7 +663,7 @@
  7157.  
  7158.  	if (!p->party.member[mi].leader)
  7159.  	{	//Need to be a party leader.
  7160. -		clif_displaymessage(sd->fd, msg_txt(282));
  7161. +		clif_displaymessage(sd->fd, msg_txt(sd->lang,282));
  7162.  		return false;
  7163.  	}
  7164.  
  7165. @@ -674,11 +674,11 @@
  7166.  	//Change leadership.
  7167.  	p->party.member[mi].leader = 0;
  7168.  	if (p->data[mi].sd->fd)
  7169. -		clif_displaymessage(p->data[mi].sd->fd, msg_txt(284));
  7170. +		clif_displaymessage(p->data[mi].sd->fd, msg_txt(sd->lang,284));
  7171.  
  7172.  	p->party.member[tmi].leader = 1;
  7173.  	if (p->data[tmi].sd->fd)
  7174. -		clif_displaymessage(p->data[tmi].sd->fd, msg_txt(285));
  7175. +		clif_displaymessage(p->data[tmi].sd->fd, msg_txt(sd->lang,285));
  7176.  
  7177.  	//Update info.
  7178.  	intif_party_leaderchange(p->party.party_id,p->party.member[tmi].account_id,p->party.member[tmi].char_id);
  7179. Index: src/map/pc.c
  7180. ===================================================================
  7181. --- src/map/pc.c	(revision 17206)
  7182. +++ src/map/pc.c	(working copy)
  7183. @@ -913,7 +913,7 @@
  7184.   * No problem with the session id
  7185.   * set the status that has been sent from char server
  7186.   *------------------------------------------*/
  7187. -bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_time, int group_id, struct mmo_charstatus *st, bool changing_mapservers)
  7188. +bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_time, int group_id, int lang, struct mmo_charstatus *st, bool changing_mapservers)
  7189.  {
  7190.  	int i;
  7191.  	unsigned long tick = gettick();
  7192. @@ -921,6 +921,7 @@
  7193.  
  7194.  	sd->login_id2 = login_id2;
  7195.  	sd->group_id = group_id;
  7196. +	sd->lang = lang;
  7197.  
  7198.  	/* load user permissions */
  7199.  	pc_group_pc_load(sd);
  7200. @@ -1076,7 +1077,7 @@
  7201.  		// message of the limited time of the account
  7202.  		if (expiration_time != 0) { // don't display if it's unlimited or unknow value
  7203.  			char tmpstr[1024];
  7204. -			strftime(tmpstr, sizeof(tmpstr) - 1, msg_txt(501), localtime(&expiration_time)); // "Your account time limit is: %d-%m-%Y %H:%M:%S."
  7205. +			strftime(tmpstr, sizeof(tmpstr) - 1, msg_txt(sd->lang,501), localtime(&expiration_time)); // "Your account time limit is: %d-%m-%Y %H:%M:%S."
  7206.  			clif_wis_message(sd->fd, wisp_server_name, tmpstr, strlen(tmpstr)+1);
  7207.  		}
  7208.  
  7209. @@ -3695,7 +3696,7 @@
  7210.  	if( battle_config.cashshop_show_points )
  7211.  	{
  7212.  		char output[128];
  7213. -		sprintf(output, msg_txt(504), points, cash, sd->kafraPoints, sd->cashPoints);
  7214. +		sprintf(output, msg_txt(sd->lang,504), points, cash, sd->kafraPoints, sd->cashPoints);
  7215.  		clif_disp_onlyself(sd, output, strlen(output));
  7216.  	}
  7217.  	return cash+points;
  7218. @@ -3720,7 +3721,7 @@
  7219.  
  7220.  		if( battle_config.cashshop_show_points )
  7221.  		{
  7222. -			sprintf(output, msg_txt(505), cash, sd->cashPoints);
  7223. +			sprintf(output, msg_txt(sd->lang,505), cash, sd->cashPoints);
  7224.  			clif_disp_onlyself(sd, output, strlen(output));
  7225.  		}
  7226.  		return cash;
  7227. @@ -3743,7 +3744,7 @@
  7228.  
  7229.  		if( battle_config.cashshop_show_points )
  7230.  		{
  7231. -			sprintf(output, msg_txt(506), points, sd->kafraPoints);
  7232. +			sprintf(output, msg_txt(sd->lang,506), points, sd->kafraPoints);
  7233.  			clif_disp_onlyself(sd, output, strlen(output));
  7234.  		}
  7235.  		return points;
  7236. @@ -3957,13 +3958,13 @@
  7237.  
  7238.  	if( map[sd->bl.m].flag.nodrop )
  7239.  	{
  7240. -		clif_displaymessage (sd->fd, msg_txt(271));
  7241. +		clif_displaymessage (sd->fd, msg_txt(sd->lang,271));
  7242.  		return 0; //Can't drop items in nodrop mapflag maps.
  7243.  	}
  7244.  
  7245.  	if( !pc_candrop(sd,&sd->status.inventory[n]) )
  7246.  	{
  7247. -		clif_displaymessage (sd->fd, msg_txt(263));
  7248. +		clif_displaymessage (sd->fd, msg_txt(sd->lang,263));
  7249.  		return 0;
  7250.  	}
  7251.  
  7252. @@ -4096,7 +4097,7 @@
  7253.  		case 14591: // Siege Teleport Scroll
  7254.  			if( sd->duel_group && !battle_config.duel_allow_teleport )
  7255.  			{
  7256. -				clif_displaymessage(sd->fd, msg_txt(663));
  7257. +				clif_displaymessage(sd->fd, msg_txt(sd->lang,663));
  7258.  				return 0;
  7259.  			}
  7260.  			if( nameid != 601 && nameid != 12212 && map[sd->bl.m].flag.noreturn )
  7261. @@ -4378,7 +4379,7 @@
  7262.  
  7263.  	if( !itemdb_cancartstore(item_data, pc_get_group_level(sd)) )
  7264.  	{ // Check item trade restrictions	[Skotlex]
  7265. -		clif_displaymessage (sd->fd, msg_txt(264));
  7266. +		clif_displaymessage (sd->fd, msg_txt(sd->lang,264));
  7267.  		return 1;
  7268.  	}
  7269.  
  7270. @@ -4621,7 +4622,7 @@
  7271.  		struct item_data *i_data;
  7272.  		char message[128];
  7273.  		i_data = itemdb_search(itemid);
  7274. -		sprintf (message, msg_txt(542), (sd->status.name != NULL)?sd->status.name :"GM", md->db->jname, i_data->jname, (float)md->db->dropitem[i].p/100);
  7275. +		sprintf (message, msg_txt(sd->lang,542), (sd->status.name != NULL)?sd->status.name :"GM", md->db->jname, i_data->jname, (float)md->db->dropitem[i].p/100);
  7276.  		//MSG: "'%s' stole %s's %s (chance: %0.02f%%)"
  7277.  		intif_broadcast(message,strlen(message)+1,0);
  7278.  	}
  7279. @@ -4740,7 +4741,7 @@
  7280.  			sd->regen.state.gc = 0;
  7281.  		// make sure vending is allowed here
  7282.  		if (sd->state.vending && map[m].flag.novending) {
  7283. -			clif_displaymessage (sd->fd, msg_txt(276)); // "You can't open a shop on this map"
  7284. +			clif_displaymessage (sd->fd, msg_txt(sd->lang,276)); // "You can't open a shop on this map"
  7285.  			vending_closevending(sd);
  7286.  		}
  7287.  	}
  7288. @@ -4786,7 +4787,7 @@
  7289.  	}
  7290.  
  7291.  	if (sd->state.vending && map_getcell(m,x,y,CELL_CHKNOVENDING)) {
  7292. -		clif_displaymessage (sd->fd, msg_txt(204)); // "You can't open a shop on this cell."
  7293. +		clif_displaymessage (sd->fd, msg_txt(sd->lang,204)); // "You can't open a shop on this cell."
  7294.  		vending_closevending(sd);
  7295.  	}
  7296.  
  7297. @@ -5310,7 +5311,7 @@
  7298.  	case JOB_ACOLYTE:
  7299.  	case JOB_MERCHANT:
  7300.  	case JOB_THIEF:
  7301. -		return msg_txt(550 - JOB_NOVICE+class_);
  7302. +		return msg_txt(0,550 - JOB_NOVICE+class_);
  7303.  
  7304.  	case JOB_KNIGHT:
  7305.  	case JOB_PRIEST:
  7306. @@ -5318,10 +5319,10 @@
  7307.  	case JOB_BLACKSMITH:
  7308.  	case JOB_HUNTER:
  7309.  	case JOB_ASSASSIN:
  7310. -		return msg_txt(557 - JOB_KNIGHT+class_);
  7311. +		return msg_txt(0,557 - JOB_KNIGHT+class_);
  7312.  
  7313.  	case JOB_KNIGHT2:
  7314. -		return msg_txt(557);
  7315. +		return msg_txt(0,557);
  7316.  
  7317.  	case JOB_CRUSADER:
  7318.  	case JOB_MONK:
  7319. @@ -5330,23 +5331,23 @@
  7320.  	case JOB_ALCHEMIST:
  7321.  	case JOB_BARD:
  7322.  	case JOB_DANCER:
  7323. -		return msg_txt(563 - JOB_CRUSADER+class_);
  7324. +		return msg_txt(0,563 - JOB_CRUSADER+class_);
  7325.  
  7326.  	case JOB_CRUSADER2:
  7327. -		return msg_txt(563);
  7328. +		return msg_txt(0,563);
  7329.  
  7330.  	case JOB_WEDDING:
  7331.  	case JOB_SUPER_NOVICE:
  7332.  	case JOB_GUNSLINGER:
  7333.  	case JOB_NINJA:
  7334.  	case JOB_XMAS:
  7335. -		return msg_txt(570 - JOB_WEDDING+class_);
  7336. +		return msg_txt(0,570 - JOB_WEDDING+class_);
  7337.  
  7338.  	case JOB_SUMMER:
  7339. -		return msg_txt(621);
  7340. +		return msg_txt(0,621);
  7341.  
  7342.  	case JOB_HANBOK:
  7343. -		return msg_txt(694);
  7344. +		return msg_txt(0,694);
  7345.  
  7346.  	case JOB_NOVICE_HIGH:
  7347.  	case JOB_SWORDMAN_HIGH:
  7348. @@ -5355,7 +5356,7 @@
  7349.  	case JOB_ACOLYTE_HIGH:
  7350.  	case JOB_MERCHANT_HIGH:
  7351.  	case JOB_THIEF_HIGH:
  7352. -		return msg_txt(575 - JOB_NOVICE_HIGH+class_);
  7353. +		return msg_txt(0,575 - JOB_NOVICE_HIGH+class_);
  7354.  
  7355.  	case JOB_LORD_KNIGHT:
  7356.  	case JOB_HIGH_PRIEST:
  7357. @@ -5363,10 +5364,10 @@
  7358.  	case JOB_WHITESMITH:
  7359.  	case JOB_SNIPER:
  7360.  	case JOB_ASSASSIN_CROSS:
  7361. -		return msg_txt(582 - JOB_LORD_KNIGHT+class_);
  7362. +		return msg_txt(0,582 - JOB_LORD_KNIGHT+class_);
  7363.  
  7364.  	case JOB_LORD_KNIGHT2:
  7365. -		return msg_txt(582);
  7366. +		return msg_txt(0,582);
  7367.  
  7368.  	case JOB_PALADIN:
  7369.  	case JOB_CHAMPION:
  7370. @@ -5375,10 +5376,10 @@
  7371.  	case JOB_CREATOR:
  7372.  	case JOB_CLOWN:
  7373.  	case JOB_GYPSY:
  7374. -		return msg_txt(588 - JOB_PALADIN + class_);
  7375. +		return msg_txt(0,588 - JOB_PALADIN + class_);
  7376.  
  7377.  	case JOB_PALADIN2:
  7378. -		return msg_txt(588);
  7379. +		return msg_txt(0,588);
  7380.  
  7381.  	case JOB_BABY:
  7382.  	case JOB_BABY_SWORDMAN:
  7383. @@ -5387,7 +5388,7 @@
  7384.  	case JOB_BABY_ACOLYTE:
  7385.  	case JOB_BABY_MERCHANT:
  7386.  	case JOB_BABY_THIEF:
  7387. -		return msg_txt(595 - JOB_BABY + class_);
  7388. +		return msg_txt(0,595 - JOB_BABY + class_);
  7389.  
  7390.  	case JOB_BABY_KNIGHT:
  7391.  	case JOB_BABY_PRIEST:
  7392. @@ -5395,10 +5396,10 @@
  7393.  	case JOB_BABY_BLACKSMITH:
  7394.  	case JOB_BABY_HUNTER:
  7395.  	case JOB_BABY_ASSASSIN:
  7396. -		return msg_txt(602 - JOB_BABY_KNIGHT + class_);
  7397. +		return msg_txt(0,602 - JOB_BABY_KNIGHT + class_);
  7398.  
  7399.  	case JOB_BABY_KNIGHT2:
  7400. -		return msg_txt(602);
  7401. +		return msg_txt(0,602);
  7402.  
  7403.  	case JOB_BABY_CRUSADER:
  7404.  	case JOB_BABY_MONK:
  7405. @@ -5407,26 +5408,26 @@
  7406.  	case JOB_BABY_ALCHEMIST:
  7407.  	case JOB_BABY_BARD:
  7408.  	case JOB_BABY_DANCER:
  7409. -		return msg_txt(608 - JOB_BABY_CRUSADER + class_);
  7410. +		return msg_txt(0,608 - JOB_BABY_CRUSADER + class_);
  7411.  
  7412.  	case JOB_BABY_CRUSADER2:
  7413. -		return msg_txt(608);
  7414. +		return msg_txt(0,608);
  7415.  
  7416.  	case JOB_SUPER_BABY:
  7417. -		return msg_txt(615);
  7418. +		return msg_txt(0,615);
  7419.  
  7420.  	case JOB_TAEKWON:
  7421. -		return msg_txt(616);
  7422. +		return msg_txt(0,616);
  7423.  	case JOB_STAR_GLADIATOR:
  7424.  	case JOB_STAR_GLADIATOR2:
  7425. -		return msg_txt(617);
  7426. +		return msg_txt(0,617);
  7427.  	case JOB_SOUL_LINKER:
  7428. -		return msg_txt(618);
  7429. +		return msg_txt(0,618);
  7430.  
  7431.  	case JOB_GANGSI:
  7432.  	case JOB_DEATH_KNIGHT:
  7433.  	case JOB_DARK_COLLECTOR:
  7434. -		return msg_txt(622 - JOB_GANGSI+class_);
  7435. +		return msg_txt(0,622 - JOB_GANGSI+class_);
  7436.  
  7437.  	case JOB_RUNE_KNIGHT:
  7438.  	case JOB_WARLOCK:
  7439. @@ -5434,7 +5435,7 @@
  7440.  	case JOB_ARCH_BISHOP:
  7441.  	case JOB_MECHANIC:
  7442.  	case JOB_GUILLOTINE_CROSS:
  7443. -		return msg_txt(625 - JOB_RUNE_KNIGHT+class_);
  7444. +		return msg_txt(0,625 - JOB_RUNE_KNIGHT+class_);
  7445.  
  7446.  	case JOB_RUNE_KNIGHT_T:
  7447.  	case JOB_WARLOCK_T:
  7448. @@ -5442,7 +5443,7 @@
  7449.  	case JOB_ARCH_BISHOP_T:
  7450.  	case JOB_MECHANIC_T:
  7451.  	case JOB_GUILLOTINE_CROSS_T:
  7452. -            return msg_txt(681 - JOB_RUNE_KNIGHT_T+class_);
  7453. +            return msg_txt(0,681 - JOB_RUNE_KNIGHT_T+class_);
  7454.  
  7455.  	case JOB_ROYAL_GUARD:
  7456.  	case JOB_SORCERER:
  7457. @@ -5451,7 +5452,7 @@
  7458.  	case JOB_SURA:
  7459.  	case JOB_GENETIC:
  7460.  	case JOB_SHADOW_CHASER:
  7461. -		return msg_txt(631 - JOB_ROYAL_GUARD+class_);
  7462. +		return msg_txt(0,631 - JOB_ROYAL_GUARD+class_);
  7463.  
  7464.  	case JOB_ROYAL_GUARD_T:
  7465.  	case JOB_SORCERER_T:
  7466. @@ -5460,23 +5461,23 @@
  7467.  	case JOB_SURA_T:
  7468.  	case JOB_GENETIC_T:
  7469.  	case JOB_SHADOW_CHASER_T:
  7470. -            return msg_txt(687 - JOB_ROYAL_GUARD_T+class_);
  7471. +            return msg_txt(0,687 - JOB_ROYAL_GUARD_T+class_);
  7472.  
  7473.  	case JOB_RUNE_KNIGHT2:
  7474.  	case JOB_RUNE_KNIGHT_T2:
  7475. -		return msg_txt(625);
  7476. +		return msg_txt(0,625);
  7477.  
  7478.  	case JOB_ROYAL_GUARD2:
  7479.  	case JOB_ROYAL_GUARD_T2:
  7480. -		return msg_txt(631);
  7481. +		return msg_txt(0,631);
  7482.  
  7483.  	case JOB_RANGER2:
  7484.  	case JOB_RANGER_T2:
  7485. -		return msg_txt(627);
  7486. +		return msg_txt(0,627);
  7487.  
  7488.  	case JOB_MECHANIC2:
  7489.  	case JOB_MECHANIC_T2:
  7490. -		return msg_txt(629);
  7491. +		return msg_txt(0,629);
  7492.  
  7493.  	case JOB_BABY_RUNE:
  7494.  	case JOB_BABY_WARLOCK:
  7495. @@ -5491,30 +5492,30 @@
  7496.  	case JOB_BABY_SURA:
  7497.  	case JOB_BABY_GENETIC:
  7498.  	case JOB_BABY_CHASER:
  7499. -		return msg_txt(638 - JOB_BABY_RUNE+class_);
  7500. +		return msg_txt(0,638 - JOB_BABY_RUNE+class_);
  7501.  
  7502.  	case JOB_BABY_RUNE2:
  7503. -		return msg_txt(638);
  7504. +		return msg_txt(0,638);
  7505.  
  7506.  	case JOB_BABY_GUARD2:
  7507. -		return msg_txt(644);
  7508. +		return msg_txt(0,644);
  7509.  
  7510.  	case JOB_BABY_RANGER2:
  7511. -		return msg_txt(640);
  7512. +		return msg_txt(0,640);
  7513.  
  7514.  	case JOB_BABY_MECHANIC2:
  7515. -		return msg_txt(642);
  7516. +		return msg_txt(0,642);
  7517.  
  7518.  	case JOB_SUPER_NOVICE_E:
  7519.  	case JOB_SUPER_BABY_E:
  7520. -		return msg_txt(651 - JOB_SUPER_NOVICE_E+class_);
  7521. +		return msg_txt(0,651 - JOB_SUPER_NOVICE_E+class_);
  7522.  
  7523.  	case JOB_KAGEROU:
  7524.  	case JOB_OBORO:
  7525. -		return msg_txt(653 - JOB_KAGEROU+class_);
  7526. +		return msg_txt(0,653 - JOB_KAGEROU+class_);
  7527.  
  7528.  	default:
  7529. -		return msg_txt(655);
  7530. +		return msg_txt(0,655);
  7531.  	}
  7532.  }
  7533.  
  7534. @@ -9158,7 +9159,7 @@
  7535.  
  7536.  	night_flag = 0; // 0=day, 1=night [Yor]
  7537.  	map_foreachpc(pc_daynight_timer_sub);
  7538. -	strcpy(tmp_soutput, (data == 0) ? msg_txt(502) : msg_txt(60)); // The day has arrived!
  7539. +	strcpy(tmp_soutput, (data == 0) ? msg_txt(0,502) : msg_txt(0,60)); // The day has arrived!
  7540.  	intif_broadcast(tmp_soutput, strlen(tmp_soutput) + 1, 0);
  7541.  	return 0;
  7542.  }
  7543. @@ -9179,7 +9180,7 @@
  7544.  
  7545.  	night_flag = 1; // 0=day, 1=night [Yor]
  7546.  	map_foreachpc(pc_daynight_timer_sub);
  7547. -	strcpy(tmp_soutput, (data == 0) ? msg_txt(503) : msg_txt(59)); // The night has fallen...
  7548. +	strcpy(tmp_soutput, (data == 0) ? msg_txt(0,503) : msg_txt(0,59)); // The night has fallen...
  7549.  	intif_broadcast(tmp_soutput, strlen(tmp_soutput) + 1, 0);
  7550.  	return 0;
  7551.  }
  7552. Index: src/map/pc.h
  7553. ===================================================================
  7554. --- src/map/pc.h	(revision 17206)
  7555. +++ src/map/pc.h	(working copy)
  7556. @@ -479,6 +479,7 @@
  7557.  	const char* delunit_prevfile;
  7558.  	int delunit_prevline;
  7559.  
  7560. +	int lang;
  7561.  };
  7562.  
  7563.  //Update this max as necessary. 55 is the value needed for Super Baby currently
  7564. @@ -698,7 +699,7 @@
  7565.  int pc_makesavestatus(struct map_session_data *);
  7566.  void pc_respawn(struct map_session_data* sd, clr_type clrtype);
  7567.  int pc_setnewpc(struct map_session_data*,int,int,int,unsigned int,int,int);
  7568. -bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_time, int group_id, struct mmo_charstatus *st, bool changing_mapservers);
  7569. +bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_time, int group_id, int lang, struct mmo_charstatus *st, bool changing_mapservers);
  7570.  void pc_authfail(struct map_session_data *);
  7571.  int pc_reg_received(struct map_session_data *sd);
  7572.  
  7573. Index: src/map/pet.c
  7574. ===================================================================
  7575. --- src/map/pet.c	(revision 17206)
  7576. +++ src/map/pet.c	(working copy)
  7577. @@ -635,7 +635,7 @@
  7578.  	normalize_name(name," ");//bugreport:3032
  7579.  
  7580.  	if ( !flag || !strlen(name) ) {
  7581. -		clif_displaymessage(sd->fd, msg_txt(280)); // You cannot use this name for your pet.
  7582. +		clif_displaymessage(sd->fd, msg_txt(sd->lang,280)); // You cannot use this name for your pet.
  7583.  		clif_send_petstatus(sd); //Send status so client knows oet name change got rejected.
  7584.  		return 0;
  7585.  	}
  7586. Index: src/map/script.c
  7587. ===================================================================
  7588. --- src/map/script.c	(revision 17206)
  7589. +++ src/map/script.c	(working copy)
  7590. @@ -12661,7 +12661,7 @@
  7591.  			status_revive(&sd->bl, 100, 100);
  7592.  		else
  7593.  			status_percent_heal(&sd->bl, 100, 100);
  7594. -		clif_displaymessage(sd->fd,msg_txt(680));
  7595. +		clif_displaymessage(sd->fd,msg_txt(sd->lang,680));
  7596.  	}
  7597.  	mapit_free(iter);
  7598.  	return 0;
  7599. @@ -16774,7 +16774,7 @@
  7600.  
  7601.  	if( npc_isnear(&sd->bl) ) {
  7602.  		char output[150];
  7603. -		sprintf(output, msg_txt(662), battle_config.min_npc_vendchat_distance);
  7604. +		sprintf(output, msg_txt(sd->lang,662), battle_config.min_npc_vendchat_distance);
  7605.  		clif_displaymessage(sd->fd, output);
  7606.  		return 0;
  7607.  	}
  7608. Index: src/map/skill.c
  7609. ===================================================================
  7610. --- src/map/skill.c	(revision 17206)
  7611. +++ src/map/skill.c	(working copy)
  7612. @@ -582,7 +582,7 @@
  7613.  			if( npc_isnear(&sd->bl) ) {
  7614.  				// uncomment to send msg_txt.
  7615.  				//char output[150];
  7616. -				//sprintf(output, msg_txt(662), battle_config.min_npc_vendchat_distance);
  7617. +				//sprintf(output, msg_txt(sd->lang,662), battle_config.min_npc_vendchat_distance);
  7618.  				//clif_displaymessage(sd->fd, output);
  7619.  				clif_skill_fail(sd,skill_id,USESKILL_FAIL_THERE_ARE_NPC_AROUND,0);
  7620.  				return 1;
  7621. @@ -5306,7 +5306,7 @@
  7622.  			if (sd)
  7623.  				clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
  7624.  			if (skill_break_equip(bl, EQP_WEAPON, 10000, BCT_PARTY) && sd && sd != dstsd)
  7625. -				clif_displaymessage(sd->fd, msg_txt(669));
  7626. +				clif_displaymessage(sd->fd, msg_txt(sd->lang,669));
  7627.  		}
  7628.  		break;
  7629.  
  7630. @@ -6209,7 +6209,7 @@
  7631.  				break;
  7632.  			}
  7633.  			if(!battle_config.duel_allow_teleport && sd->duel_group && skill_lv <= 2) { // duel restriction [LuzZza]
  7634. -				char output[128]; sprintf(output, msg_txt(365), skill_get_name(AL_TELEPORT));
  7635. +				char output[128]; sprintf(output, msg_txt(sd->lang,365), skill_get_name(AL_TELEPORT));
  7636.  				clif_displaymessage(sd->fd, output); //"Duel: Can't use %s in duel."
  7637.  				break;
  7638.  			}
  7639. @@ -12736,7 +12736,7 @@
  7640.  			break;
  7641.  		case AL_WARP:
  7642.  			if(!battle_config.duel_allow_teleport && sd->duel_group) { // duel restriction [LuzZza]
  7643. -				char output[128]; sprintf(output, msg_txt(365), skill_get_name(AL_WARP));
  7644. +				char output[128]; sprintf(output, msg_txt(sd->lang,365), skill_get_name(AL_WARP));
  7645.  				clif_displaymessage(sd->fd, output); //"Duel: Can't use %s in duel."
  7646.  				return 0;
  7647.  			}
  7648. Index: src/map/storage.c
  7649. ===================================================================
  7650. --- src/map/storage.c	(revision 17206)
  7651. +++ src/map/storage.c	(working copy)
  7652. @@ -100,7 +100,7 @@
  7653.  
  7654.  	if( !pc_can_give_items(sd) )
  7655.    	{ //check is this GM level is allowed to put items to storage
  7656. -		clif_displaymessage(sd->fd, msg_txt(246));
  7657. +		clif_displaymessage(sd->fd, msg_txt(sd->lang,246));
  7658.  		return 1;
  7659.  	}
  7660.  
  7661. @@ -150,7 +150,7 @@
  7662.  
  7663.  	if( !itemdb_canstore(item_data, pc_get_group_level(sd)) )
  7664.  	{	//Check if item is storable. [Skotlex]
  7665. -		clif_displaymessage (sd->fd, msg_txt(264));
  7666. +		clif_displaymessage (sd->fd, msg_txt(sd->lang,264));
  7667.  		return 1;
  7668.  	}
  7669.  
  7670. @@ -395,7 +395,7 @@
  7671.  		return 1; //Can't open both storages at a time.
  7672.  
  7673.  	if( !pc_can_give_items(sd) ) { //check is this GM level can open guild storage and store items [Lupus]
  7674. -		clif_displaymessage(sd->fd, msg_txt(246));
  7675. +		clif_displaymessage(sd->fd, msg_txt(sd->lang,246));
  7676.  		return 1;
  7677.  	}
  7678.  
  7679. @@ -444,7 +444,7 @@
  7680.  
  7681.  	if( !itemdb_canguildstore(item_data, pc_get_group_level(sd)) || item_data->expire_time )
  7682.  	{	//Check if item is storable. [Skotlex]
  7683. -		clif_displaymessage (sd->fd, msg_txt(264));
  7684. +		clif_displaymessage (sd->fd, msg_txt(sd->lang,264));
  7685.  		return 1;
  7686.  	}
  7687.  
  7688. Index: src/map/trade.c
  7689. ===================================================================
  7690. --- src/map/trade.c	(revision 17206)
  7691. +++ src/map/trade.c	(working copy)
  7692. @@ -32,7 +32,7 @@
  7693.  	nullpo_retv(sd);
  7694.  
  7695.  	if (map[sd->bl.m].flag.notrade) {
  7696. -		clif_displaymessage (sd->fd, msg_txt(272));
  7697. +		clif_displaymessage (sd->fd, msg_txt(sd->lang,272));
  7698.  		return; //Can't trade in notrade mapflag maps.
  7699.  	}
  7700.  
  7701. @@ -71,7 +71,7 @@
  7702.  
  7703.  	if (!pc_can_give_items(sd) || !pc_can_give_items(target_sd)) //check if both GMs are allowed to trade
  7704.  	{
  7705. -		clif_displaymessage(sd->fd, msg_txt(246));
  7706. +		clif_displaymessage(sd->fd, msg_txt(sd->lang,246));
  7707.  		clif_tradestart(sd, 2); // GM is not allowed to trade
  7708.  		return;
  7709.  	}
  7710. @@ -201,25 +201,25 @@
  7711.  		index = sd->deal.item[i].index;
  7712.  		if (inventory[index].amount < sd->deal.item[i].amount)
  7713.  		{ // if more than the player have -> hack
  7714. -			sprintf(message_to_gm, msg_txt(538), sd->status.name, sd->status.account_id); // Hack on trade: character '%s' (account: %d) try to trade more items that he has.
  7715. +			sprintf(message_to_gm, msg_txt(sd->lang,538), sd->status.name, sd->status.account_id); // Hack on trade: character '%s' (account: %d) try to trade more items that he has.
  7716.  			intif_wis_message_to_gm(wisp_server_name, PC_PERM_RECEIVE_HACK_INFO, message_to_gm);
  7717. -			sprintf(message_to_gm, msg_txt(539), inventory[index].amount, inventory[index].nameid, sd->deal.item[i].amount); // This player has %d of a kind of item (id: %d), and try to trade %d of them.
  7718. +			sprintf(message_to_gm, msg_txt(sd->lang,539), inventory[index].amount, inventory[index].nameid, sd->deal.item[i].amount); // This player has %d of a kind of item (id: %d), and try to trade %d of them.
  7719.  			intif_wis_message_to_gm(wisp_server_name, PC_PERM_RECEIVE_HACK_INFO, message_to_gm);
  7720.  			// if we block people
  7721.  			if (battle_config.ban_hack_trade < 0) {
  7722.  				chrif_char_ask_name(-1, sd->status.name, 1, 0, 0, 0, 0, 0, 0); // type: 1 - block
  7723.  				set_eof(sd->fd); // forced to disconnect because of the hack
  7724.  				// message about the ban
  7725. -				strcpy(message_to_gm, msg_txt(540)); //  This player has been definitively blocked.
  7726. +				strcpy(message_to_gm, msg_txt(sd->lang,540)); //  This player has been definitively blocked.
  7727.  			// if we ban people
  7728.  			} else if (battle_config.ban_hack_trade > 0) {
  7729.  				chrif_char_ask_name(-1, sd->status.name, 2, 0, 0, 0, 0, battle_config.ban_hack_trade, 0); // type: 2 - ban (year, month, day, hour, minute, second)
  7730.  				set_eof(sd->fd); // forced to disconnect because of the hack
  7731.  				// message about the ban
  7732. -				sprintf(message_to_gm, msg_txt(507), battle_config.ban_hack_trade); //  This player has been banned for %d minute(s).
  7733. +				sprintf(message_to_gm, msg_txt(sd->lang,507), battle_config.ban_hack_trade); //  This player has been banned for %d minute(s).
  7734.  			} else
  7735.  				// message about the ban
  7736. -				strcpy(message_to_gm, msg_txt(508)); //  This player hasn't been banned (Ban option is disabled).
  7737. +				strcpy(message_to_gm, msg_txt(sd->lang,508)); //  This player hasn't been banned (Ban option is disabled).
  7738.  
  7739.  			intif_wis_message_to_gm(wisp_server_name, PC_PERM_RECEIVE_HACK_INFO, message_to_gm);
  7740.  			return 1;
  7741. @@ -356,14 +356,14 @@
  7742.  	if( !itemdb_cantrade(item, src_lv, dst_lv) && //Can't trade
  7743.  		(pc_get_partner(sd) != target_sd || !itemdb_canpartnertrade(item, src_lv, dst_lv)) ) //Can't partner-trade
  7744.  	{
  7745. -		clif_displaymessage (sd->fd, msg_txt(260));
  7746. +		clif_displaymessage (sd->fd, msg_txt(sd->lang,260));
  7747.  		clif_tradeitemok(sd, index+2, 1);
  7748.  		return;
  7749.  	}
  7750.  
  7751.  	if( item->expire_time )
  7752.  	{ // Rental System
  7753. -		clif_displaymessage (sd->fd, msg_txt(260));
  7754. +		clif_displaymessage (sd->fd, msg_txt(sd->lang,260));
  7755.  		clif_tradeitemok(sd, index+2, 1);
  7756.  		return;
  7757.  	}
  7758. Index: src/map/vending.c
  7759. ===================================================================
  7760. --- src/map/vending.c	(revision 17206)
  7761. +++ src/map/vending.c	(working copy)
  7762. @@ -56,7 +56,7 @@
  7763.  
  7764.  	if (!pc_can_give_items(sd) || !pc_can_give_items(vsd)) //check if both GMs are allowed to trade
  7765.  	{	// GM is not allowed to trade
  7766. -		clif_displaymessage(sd->fd, msg_txt(246));
  7767. +		clif_displaymessage(sd->fd, msg_txt(sd->lang,246));
  7768.  		return;
  7769.  	} 
  7770.  
  7771. @@ -188,7 +188,7 @@
  7772.  		if( battle_config.buyer_name )
  7773.  		{
  7774.  			char temp[256];
  7775. -			sprintf(temp, msg_txt(265), sd->status.name);
  7776. +			sprintf(temp, msg_txt(sd->lang,265), sd->status.name);
  7777.  			clif_disp_onlyself(vsd,temp,strlen(temp));
  7778.  		}
  7779.  	}
  7780. @@ -285,7 +285,7 @@
  7781.  	}
  7782.  
  7783.  	if( i != j )
  7784. -		clif_displaymessage (sd->fd, msg_txt(266)); //"Some of your items cannot be vended and were removed from the shop."
  7785. +		clif_displaymessage (sd->fd, msg_txt(sd->lang,266)); //"Some of your items cannot be vended and were removed from the shop."
  7786.  
  7787.  	if( i == 0 )
  7788.  	{	// no valid item found
Viewed 1819 times, submitted by Lilith.