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 a@a.com.
  3821. +		clif_displaymessage(fd, msg_txt(sd->lang,144)); // Invalid actual email. If you have default e-mail, give a@a.com.
  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, "a@a.com") == 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. <