viewing paste src-doc diff | Diff

Posted on the
  1. # This patch file was generated by NetBeans IDE
  2. # Following Index: paths are relative to: /home/lighta/Documents/Myscript/RO/Servs/rathena
  3. # This patch can be applied using context Tools: Patch action on respective folder.
  4. # It uses platform neutral UTF-8 encoding and \n newlines.
  5. # Above lines and this line are ignored by the patching process.
  6. Index: conf/msg_athena.conf
  7. --- conf/msg_athena.conf Base (BASE)
  8. +++ conf/msg_athena.conf Locally Modified (Based On LOCAL)
  9. @@ -6,8 +6,9 @@
  10.  // // English message
  11.  // msg_number: translated message
  12.  
  13. -//   0-499: reserved for GM commands
  14. -// 500-999 reserved for others
  15. +//   0-410: reserved for GM commands
  16. +// 500-900 reserved for others
  17. +// 900-1300 @atcommand
  18.  
  19.  // To disable a string (%s) field, make it's max length 0:
  20.  // eg:
  21. @@ -302,12 +303,13 @@
  22.  284: Leadership transferred.
  23.  285: You've become the party leader.
  24.  286: There's been no change in the setting.
  25. +287: You cannot change party leaders on this map.
  26.  //Missing stuff for @killer related commands.
  27. -287: Killer state reset.
  28.  288: You are no longer killable.
  29.  289: The player is now killable.
  30.  290: The player is no longer killable.
  31.  291: Weather effects will dispell on warp/refresh
  32. +292: Killer state reset.
  33.  // Guild Castles Number
  34.  // --------------------
  35.  //299: ?? Castles
  36. @@ -374,6 +376,7 @@
  37.  362: Duel: You can't use @reject without a duel invitation.
  38.  363: Duel: The duel invitation has been rejected.
  39.  364: Duel: You can't invite %s because he/she isn't on the same map. 
  40. +365: Duel: Can't use %s in duel. 
  41.  // @duel (part 2)
  42.  370:  -- Duels: %d/%d, Members: %d/%d, Max players: %d --
  43.  371:  -- Duels: %d/%d, Members: %d/%d --
  44. @@ -412,6 +415,30 @@
  45.  405: War of Emperium SE has been ended.
  46.  406: War of Emperium SE is currently not in progress.
  47.  
  48. +//chrif related
  49. +410: Need disconnection to perform change-sex request...
  50. +411: Your sex has been changed (need disconnection by the server)...
  51. +412: Your account has 'Unregistered'.
  52. +413: Your account has an 'Incorrect Password'...
  53. +414: Your account has expired.
  54. +415: Your account has been rejected from server.
  55. +416: Your account has been blocked by the GM Team.
  56. +417: Your Game's EXE file is not the latest version.
  57. +418: Your account has been prohibited to log in.
  58. +419: Server is jammed due to over populated.
  59. +420: Your account has not more authorised.
  60. +421: Your account has been totally erased.
  61. +423: Your account has been banished until 
  62. +424: Login-server has been asked to %s the player '%.*s'.
  63. +425: The player '%.*s' doesn't exist.
  64. +426: Your GM level don't authorise you to %s the player '%.*s'.
  65. +427: Login-server is offline. Impossible to %s the player '%.*s'.
  66. +428: block
  67. +429: ban
  68. +430: unblock
  69. +431: unban
  70. +432: change the sex of
  71. +
  72.  // Homunculus messages
  73.  450: You already have a homunculus
  74.  
  75. @@ -589,9 +616,19 @@
  76.  667: You're not dead.
  77.  668: Your actual memo positions are:
  78.  669: You broke target's weapon
  79. +670: You can't leave battleground guilds.
  80. +671: Friend already exists.
  81. +672: Name not found in list.
  82. +673: This action can't be performed at the moment. Please try again later.
  83. +674: Friend removed
  84. +675: Cannot send mails too fast!!.
  85. +676: Alliances cannot be made during Guild Wars!
  86. +677: Alliances cannot be broken during Guild Wars!
  87. +678: You no longer are the Guild Master.
  88. +679: You have become the Guild Master!
  89. +680: You have been recovered!
  90. +//681-899 free
  91.  
  92. -//670-899 free
  93. -
  94.  //------------------------------------
  95.  // More atcommands message
  96.  //------------------------------------
  97. @@ -640,9 +677,9 @@
  98.  
  99.  // @jobchange
  100.  922: Please enter a job ID.
  101. +923: You can not change to this job by command.
  102. +//924-979 free (future jobs?)
  103.  
  104. -//923-979 free (future jobs?)
  105. -
  106.  // @kami
  107.  980: Please enter a message (usage: @kami <message>).
  108.  981: Please enter color and message (usage: @kamic <color> <message>).
  109. Index: src/char/char.c
  110. --- src/char/char.c Base (BASE)
  111. +++ src/char/char.c Locally Modified (Based On LOCAL)
  112. @@ -126,7 +126,7 @@
  113.  	int found_char[MAX_CHARS]; // ids of chars on this account
  114.  	char email[40]; // e-mail (default: [email protected]) by [Yor]
  115.  	time_t expiration_time; // # of seconds 1/1/1970 (timestamp): Validity limit of the account (0 = unlimited)
  116. -	int group_id;
  117. +	int group_id; // permission
  118.  	uint32 version;
  119.  	uint8 clienttype;
  120.  	char new_name[NAME_LENGTH];
  121. @@ -3367,7 +3367,7 @@
  122.  	return -1;
  123.  }
  124.  
  125. -// char_mapif�̏������i���݂�inter_mapif����̂݁j
  126. +// Initialization process (currently only initialization inter_mapif)
  127.  static int char_mapif_init(int fd)
  128.  {
  129.  	return inter_mapif_init(fd);
  130. @@ -4728,7 +4728,7 @@
  131.  
  132.  	ShowInfo("Finished reading the char-server configuration.\n");
  133.  
  134. -	inter_init_sql((argc > 2) ? argv[2] : inter_cfgName); // inter server �ʱ�ȭ
  135. +	inter_init_sql((argc > 2) ? argv[2] : inter_cfgName); // inter server configuration
  136.  	ShowInfo("Finished reading the inter-server configuration.\n");
  137.  
  138.  	ShowInfo("Initializing char server.\n");
  139. @@ -4764,10 +4764,10 @@
  140.  	add_timer_func_list(broadcast_user_count, "broadcast_user_count");
  141.  	add_timer_interval(gettick() + 1000, broadcast_user_count, 0, 0, 5 * 1000);
  142.  
  143. -	// ???
  144. +	// Timer to clear (online_char_db)
  145.  	add_timer_func_list(chardb_waiting_disconnect, "chardb_waiting_disconnect");
  146.  
  147. -	// ???
  148. +	// Online Data timers (checking if char still connected)
  149.  	add_timer_func_list(online_data_cleanup, "online_data_cleanup");
  150.  	add_timer_interval(gettick() + 1000, online_data_cleanup, 0, 0, 600 * 1000);
  151.  
  152. Index: src/char/int_guild.c
  153. --- src/char/int_guild.c Base (BASE)
  154. +++ src/char/int_guild.c Locally Modified (Based On LOCAL)
  155. @@ -1142,7 +1142,7 @@
  156.  // Packet received from map server
  157.  
  158.  
  159. -// �M���h�쐬�v��
  160. +// Guild creation request
  161.  int mapif_parse_CreateGuild(int fd,int account_id,char *name,struct guild_member *master)
  162.  {
  163.  	struct guild *g;
  164. @@ -1837,11 +1837,13 @@
  165.  	return mapif_guild_master_changed(g, g->member[0].account_id, g->member[0].char_id);
  166.  }
  167.  
  168. -// map server ����̒ʐM
  169. -// �E�P�p�P�b�g�̂݉�͂��邱��
  170. -// �E�p�P�b�g���f�[�^��inter.c�ɃZ�b�g���Ă�������
  171. -// �E�p�P�b�g���`�F�b�N��ARFIFOSKIP�͌Ăяo�����ōs����̂ōs���Ă͂Ȃ�Ȃ�
  172. -// �E�G���[�Ȃ�0(false)�A�����łȂ��Ȃ�1(true)���������Ȃ���΂Ȃ�Ȃ�
  173. +// Communication from the map server
  174. +// - Can analyzed only one by one packet
  175. +// Data packet length that you set to inter.c
  176. +//- Shouldn't do checking and packet length, RFIFOSKIP is done by the caller
  177. +// Must Return
  178. +//	1 : ok
  179. +//  0 : error
  180.  int inter_guild_parse_frommap(int fd)
  181.  {
  182.  	RFIFOHEAD(fd);
  183. @@ -1871,7 +1873,7 @@
  184.  	return 1;
  185.  }
  186.  
  187. -// �T�[�o�[����E�ޗv���i�L�����폜�p�j
  188. +//Leave request from the server (for deleting character from guild)
  189.  int inter_guild_leave(int guild_id, int account_id, int char_id)
  190.  {
  191.  	return mapif_parse_GuildLeave(-1, guild_id, account_id, char_id, 0, "** Character Deleted **");
  192. Index: src/char/int_party.c
  193. --- src/char/int_party.c Base (BASE)
  194. +++ src/char/int_party.c Locally Modified (Based On LOCAL)
  195. @@ -324,9 +324,10 @@
  196.  }
  197.  
  198.  //-------------------------------------------------------------------
  199. -// map server�ւ̒ʐM
  200. +// Communication to the map server
  201.  
  202. -// �p�[�e�B�쐬�”�
  203. +
  204. +// Create a party whether or not
  205.  int mapif_party_created(int fd,int account_id,int char_id,struct party *p)
  206.  {
  207.  	WFIFOHEAD(fd, 39);
  208. @@ -348,7 +349,7 @@
  209.  	return 0;
  210.  }
  211.  
  212. -// �p�[�e�B��񌩂‚��炸
  213. +//Party information not found
  214.  static void mapif_party_noinfo(int fd, int party_id, int char_id)
  215.  {
  216.  	WFIFOHEAD(fd, 12);
  217. @@ -359,7 +360,8 @@
  218.  	WFIFOSET(fd,12);
  219.  	ShowWarning("int_party: info not found (party_id=%d char_id=%d)\n", party_id, char_id);
  220.  }
  221. -// �p�[�e�B���܂Ƃߑ���
  222. +
  223. +//Digest party information
  224.  static void mapif_party_info(int fd, struct party* p, int char_id)
  225.  {
  226.  	unsigned char buf[8 + sizeof(struct party)];
  227. @@ -373,7 +375,8 @@
  228.  	else
  229.  		mapif_send(fd,buf,WBUFW(buf,2));
  230.  }
  231. -// �p�[�e�B�����o�lj��”�
  232. +
  233. +//Whether or not additional party members
  234.  int mapif_party_memberadded(int fd, int party_id, int account_id, int char_id, int flag) {
  235.  	WFIFOHEAD(fd, 15);
  236.  	WFIFOW(fd,0) = 0x3822;
  237. @@ -386,7 +389,7 @@
  238.  	return 0;
  239.  }
  240.  
  241. -// �p�[�e�B�ݒ�ύX�ʒm
  242. +// Party setting change notification
  243.  int mapif_party_optionchanged(int fd,struct party *p,int account_id,int flag)
  244.  {
  245.  	unsigned char buf[16];
  246. @@ -403,7 +406,7 @@
  247.  	return 0;
  248.  }
  249.  
  250. -// �p�[�e�B�E�ޒʒm
  251. +//Withdrawal notification party
  252.  int mapif_party_withdraw(int party_id,int account_id, int char_id) {
  253.  	unsigned char buf[16];
  254.  
  255. @@ -415,7 +418,7 @@
  256.  	return 0;
  257.  }
  258.  
  259. -// �p�[�e�B�}�b�v�X�V�ʒm
  260. +//Party map update notification
  261.  int mapif_party_membermoved(struct party *p,int idx)
  262.  {
  263.  	unsigned char buf[20];
  264. @@ -431,7 +434,7 @@
  265.  	return 0;
  266.  }
  267.  
  268. -// �p�[�e�B���U�ʒm
  269. +//Dissolution party notification
  270.  int mapif_party_broken(int party_id,int flag)
  271.  {
  272.  	unsigned char buf[16];
  273. @@ -442,7 +445,8 @@
  274.  	//printf("int_party: broken %d\n",party_id);
  275.  	return 0;
  276.  }
  277. -// �p�[�e�B������
  278. +
  279. +//Remarks in the party
  280.  int mapif_party_message(int party_id,int account_id,char *mes,int len, int sfd)
  281.  {
  282.  	unsigned char buf[512];
  283. @@ -456,7 +460,7 @@
  284.  }
  285.  
  286.  //-------------------------------------------------------------------
  287. -// map server����̒ʐM
  288. +// Communication from the map server
  289.  
  290.  
  291.  // Create Party
  292. @@ -507,7 +511,8 @@
  293.  
  294.  	return 0;
  295.  }
  296. -// �p�[�e�B���v��
  297. +
  298. +// Party information request
  299.  static void mapif_parse_PartyInfo(int fd, int party_id, int char_id)
  300.  {
  301.  	struct party_data *p;
  302. @@ -518,7 +523,8 @@
  303.  	else
  304.  		mapif_party_noinfo(fd, party_id, char_id);
  305.  }
  306. -// �p�[�e�B�lj��v��
  307. +
  308. +// Add a player to party request
  309.  int mapif_parse_PartyAddMember(int fd, int party_id, struct party_member *member)
  310.  {
  311.  	struct party_data *p;
  312. @@ -556,7 +562,7 @@
  313.  	return 0;
  314.  }
  315.  
  316. -// �p�[�e�B�[�ݒ�ύX�v��
  317. +//Party setting change request
  318.  int mapif_parse_PartyChangeOption(int fd,int party_id,int account_id,int exp,int item)
  319.  {
  320.  	struct party_data *p;
  321. @@ -576,7 +582,8 @@
  322.  	inter_party_tosql(&p->party, PS_BASIC, 0);
  323.  	return 0;
  324.  }
  325. -// �p�[�e�B�E�ޗv��
  326. +
  327. +//Request leave party
  328.  int mapif_parse_PartyLeave(int fd, int party_id, int account_id, int char_id)
  329.  {
  330.  	struct party_data *p;
  331. @@ -684,7 +691,7 @@
  332.  	return 0;
  333.  }
  334.  
  335. -// �p�[�e�B���U�v��
  336. +//Request party dissolution
  337.  int mapif_parse_BreakParty(int fd,int party_id)
  338.  {
  339.  	struct party_data *p;
  340. @@ -697,7 +704,8 @@
  341.  	mapif_party_broken(fd,party_id);
  342.  	return 0;
  343.  }
  344. -// �p�[�e�B���b�Z�[�W���M
  345. +
  346. +//Party sending the message
  347.  int mapif_parse_PartyMessage(int fd,int party_id,int account_id,char *mes,int len)
  348.  {
  349.  	return mapif_party_message(party_id,account_id,mes,len, fd);
  350. @@ -727,11 +735,14 @@
  351.  	return 1;
  352.  }
  353.  
  354. -// map server ����̒ʐM
  355. -// �E�P�p�P�b�g�̂݉�͂��邱��
  356. -// �E�p�P�b�g���f�[�^��inter.c�ɃZ�b�g���Ă�������
  357. -// �E�p�P�b�g���`�F�b�N��ARFIFOSKIP�͌Ăяo�����ōs����̂ōs���Ă͂Ȃ�Ȃ�
  358. -// �E�G���[�Ȃ�0(false)�A�����łȂ��Ȃ�1(true)���������Ȃ���΂Ȃ�Ȃ�
  359. +
  360. +// Communication from the map server
  361. +//-Analysis that only one packet
  362. +// Data packet length is set to inter.c that you
  363. +// Do NOT go and check the packet length, RFIFOSKIP is done by the caller
  364. +// Return :
  365. +// 	0 : error
  366. +//	1 : ok
  367.  int inter_party_parse_frommap(int fd)
  368.  {
  369.  	RFIFOHEAD(fd);
  370. @@ -751,7 +762,7 @@
  371.  	return 1;
  372.  }
  373.  
  374. -// �T�[�o�[����E�ޗv���i�L�����폜�p�j
  375. +//Leave request from the server (for delete character)
  376.  int inter_party_leave(int party_id,int account_id, int char_id)
  377.  {
  378.  	return mapif_parse_PartyLeave(-1,party_id,account_id, char_id);
  379. Index: src/char/inter.c
  380. --- src/char/inter.c Base (BASE)
  381. +++ src/char/inter.c Locally Modified (Based On LOCAL)
  382. @@ -28,8 +28,8 @@
  383.  #include <sys/stat.h> // for stat/lstat/fstat - [Dekamaster/Ultimate GM Tool]
  384.  
  385.  
  386. -#define WISDATA_TTL (60*1000)	// Wis�f�[�^�̐�������(60�b)
  387. -#define WISDELLIST_MAX 256			// Wis�f�[�^�폜���X�g�̗v�f��
  388. +#define WISDATA_TTL (60*1000)	//Wis data Time To Live (60 seconds)
  389. +#define WISDELLIST_MAX 256		// Number of elements in the list Delete data Wis
  390.  
  391.  
  392.  Sql* sql_handle = NULL;
  393. @@ -1203,11 +1203,11 @@
  394.  	int cmd;
  395.  	int len = 0;
  396.  	cmd = RFIFOW(fd,0);
  397. -	// inter�I�NJ����𒲂ׂ�
  398. +	// Check is valid packet entry
  399.  	if(cmd < 0x3000 || cmd >= 0x3000 + ARRAYLENGTH(inter_recv_packet_length) || inter_recv_packet_length[cmd - 0x3000] == 0)
  400.  		return 0;
  401.  
  402. -	// �p�P�b�g���𒲂ׂ�
  403. +	// Check packet length
  404.  	if((len = inter_check_length(fd, inter_recv_packet_length[cmd - 0x3000])) == 0)
  405.  		return 2;
  406.  
  407. Index: src/common/db.c
  408. --- src/common/db.c Base (BASE)
  409. +++ src/common/db.c Locally Modified (Based On LOCAL)
  410. @@ -2743,7 +2743,7 @@
  411.  	while( node ) {
  412.  		if( node->key == key ) {
  413.  			if( node->prev && n > 5 ) {
  414. -				// �������P�ׂ̈�head�Ɉړ�������
  415. +				//Moving the head in order to improve processing efficiency
  416.  				if(node->prev) node->prev->next = node->next;
  417.  				if(node->next) node->next->prev = node->prev;
  418.  				node->next = *head;
  419. @@ -2790,7 +2790,7 @@
  420.  	while( node ) {
  421.  		if( node->key == key ) {
  422.  			if( node->prev && n > 5 ) {
  423. -				// �������P�ׂ̈�head�Ɉړ�������
  424. +				//Moving the head in order to improve processing efficiency
  425.  				if(node->prev) node->prev->next = node->next;
  426.  				if(node->next) node->next->prev = node->prev;
  427.  				node->next = *head;
  428. @@ -2804,7 +2804,7 @@
  429.  		node = node->next;
  430.  		n++;
  431.  	}
  432. -	// ���‚���Ȃ��̂ő}��
  433. +	//Insert because it can not find
  434.  	linkdb_insert( head, key, data );
  435.  }
  436.  
  437. Index: src/common/mmo.h
  438. --- src/common/mmo.h Base (BASE)
  439. +++ src/common/mmo.h Locally Modified (Based On LOCAL)
  440. @@ -536,15 +536,15 @@
  441.  	char name[NAME_LENGTH];
  442.  };
  443.  
  444. -enum {
  445. -	GBI_EXP	=1,		// �M���h��EXP
  446. -	GBI_GUILDLV,		// �M���h��Lv
  447. -	GBI_SKILLPOINT,		// �M���h�̃X�L���|�C���g
  448. -	GBI_SKILLLV,		// �M���h�X�L��Lv
  449. +enum { //Change Guild Infos 
  450. +	GBI_EXP	=1,		// Guild Experience (EXP)
  451. +	GBI_GUILDLV,		// Guild level
  452. +	GBI_SKILLPOINT,		// Guild skillpoints
  453. +	GBI_SKILLLV,		// Guild skilllv ?? seem unused
  454.  };
  455.  
  456. -enum {
  457. -	GMI_POSITION	=0,		// �����o�[�̖�E�ύX
  458. +enum { //Change Member Infos
  459. +	GMI_POSITION	=0,		
  460.  	GMI_EXP,
  461.  	GMI_HAIR,
  462.  	GMI_HAIR_COLOR,
  463. Index: src/map/atcommand.c
  464. --- src/map/atcommand.c Base (BASE)
  465. +++ src/map/atcommand.c Locally Modified (Based On LOCAL)
  466. @@ -1151,7 +1151,7 @@
  467.  	if (job == 13 || job == 21 || job == 22 || job == 26 || job == 27 || job == 4014 || job == 4022 || job == 4036 || job == 4044 || job == 4048
  468.  		 || (job >= JOB_RUNE_KNIGHT2 && job <= JOB_MECHANIC_T2) || (job >= JOB_BABY_RUNE2 && job <= JOB_BABY_MECHANIC2)
  469.  	) // Deny direct transformation into dummy jobs
  470. -		{clif_displaymessage(fd, "You can not change to this job by command.");
  471. +		{clif_displaymessage(fd, msg_txt(923)); //"You can not change to this job by command."
  472.  		return 0;}
  473.  
  474.  	if (pcdb_checkid(job))
  475. @@ -5196,7 +5196,7 @@
  476.  	if(sd->state.killer)
  477.  		clif_displaymessage(fd, msg_txt(241));
  478.  	else {
  479. -		clif_displaymessage(fd, msg_txt(287));
  480. +		clif_displaymessage(fd, msg_txt(292));
  481.  		pc_stop_attack(sd);
  482.  	}
  483.  	return 0;
  484. @@ -7461,17 +7461,17 @@
  485.  	int size = 0;
  486.  	nullpo_retr(-1, sd);
  487.  
  488. -	size = cap_value(atoi(message),0,2);
  489. +	size = cap_value(atoi(message),SZ_SMALL,SZ_BIG);
  490.  
  491.  	if(sd->state.size) {
  492. -		sd->state.size = 0;
  493. +		sd->state.size = SZ_SMALL;
  494.  		pc_setpos(sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_TELEPORT);
  495.  	}
  496.  
  497.  	sd->state.size = size;
  498. -	if( size == 1 )
  499. +	if( size == SZ_MEDIUM )
  500.  		clif_specialeffect(&sd->bl,420,AREA);
  501. -	else if( size == 2 )
  502. +	else if( size == SZ_BIG )
  503.  		clif_specialeffect(&sd->bl,422,AREA);
  504.  
  505.  	clif_displaymessage(fd, msg_txt(1303)); // Size change applied.
  506. @@ -7491,14 +7491,14 @@
  507.  	for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) ) {
  508.  		if( pl_sd->state.size != size ) {
  509.  			if( pl_sd->state.size ) {
  510. -				pl_sd->state.size = 0;
  511. +				pl_sd->state.size = SZ_SMALL;
  512.  				pc_setpos(pl_sd, pl_sd->mapindex, pl_sd->bl.x, pl_sd->bl.y, CLR_TELEPORT);
  513.  			}
  514.  
  515.  			pl_sd->state.size = size;
  516. -			if( size == 1 )
  517. +			if( size == SZ_MEDIUM )
  518.  				clif_specialeffect(&pl_sd->bl,420,AREA);
  519. -			else if( size == 2 )
  520. +			else if( size == SZ_BIG )
  521.  				clif_specialeffect(&pl_sd->bl,422,AREA);
  522.  		}
  523.  	}
  524. @@ -7528,19 +7528,19 @@
  525.  		return -1;
  526.  	}
  527.  
  528. -	size = cap_value(size,0,2);
  529. +	size = cap_value(size,SZ_SMALL,SZ_BIG);
  530.  
  531.  	for( i = 0; i < g->max_member; i++ ) {
  532.  		if( (pl_sd = g->member[i].sd) && pl_sd->state.size != size ) {
  533.  			if( pl_sd->state.size ) {
  534. -				pl_sd->state.size = 0;
  535. +				pl_sd->state.size = SZ_SMALL;
  536.  				pc_setpos(pl_sd, pl_sd->mapindex, pl_sd->bl.x, pl_sd->bl.y, CLR_TELEPORT);
  537.  			}
  538.  
  539.  			pl_sd->state.size = size;
  540. -			if( size == 1 )
  541. +			if( size == SZ_MEDIUM )
  542.  				clif_specialeffect(&pl_sd->bl,420,AREA);
  543. -			else if( size == 2 )
  544. +			else if( size == SZ_BIG )
  545.  				clif_specialeffect(&pl_sd->bl,422,AREA);
  546.  		}
  547.  	}
  548. Index: src/map/battle.c
  549. --- src/map/battle.c Base (BASE)
  550. +++ src/map/battle.c Locally Modified (Based On LOCAL)
  551. @@ -197,7 +197,7 @@
  552.  	return bl_list[rnd()%c];
  553.  }
  554.  
  555. -// �_??[�W�̒x��
  556. +// Dammage delayed info
  557.  struct delay_damage {
  558.  	int src_id;
  559.  	int target_id;
  560. @@ -350,29 +350,38 @@
  561.  			}
  562.  		}
  563.  	}
  564. -	if( tsc && tsc->count ) {
  565. -		if( tsc->data[SC_SPIDERWEB] && atk_elem == ELE_FIRE ){
  566. +	if( tsc && tsc->count ) { //since an atk can only have one type let's optimise this a bit
  567. +		switch(atk_elem){
  568. +			case ELE_FIRE:
  569. +				if (tsc->data[SC_SPIDERWEB]) {
  570.  			tsc->data[SC_SPIDERWEB]->val1 = 0; // free to move now
  571.  			if( tsc->data[SC_SPIDERWEB]->val2-- > 0 )
  572.  				damage <<= 1; // double damage
  573.  			if( tsc->data[SC_SPIDERWEB]->val2 == 0 )
  574.  				status_change_end(target, SC_SPIDERWEB, INVALID_TIMER);
  575.  		}
  576. -		if( tsc->data[SC_ORATIO] && atk_elem == ELE_HOLY )
  577. -			ratio += tsc->data[SC_ORATIO]->val1 * 2;
  578. -		if( tsc->data[SC_VENOMIMPRESS] && atk_elem == ELE_POISON )
  579. -			ratio += tsc->data[SC_VENOMIMPRESS]->val2;
  580. -		if( tsc->data[SC_THORNSTRAP] && atk_elem == ELE_FIRE )
  581. -			status_change_end(target, SC_THORNSTRAP, -1);
  582. -		if( tsc->data[SC_FIRE_CLOAK_OPTION] && atk_elem == ELE_FIRE )
  583. +				if( tsc->data[SC_THORNSTRAP])
  584. +					status_change_end(target, SC_THORNSTRAP, INVALID_TIMER);
  585. +				if( tsc->data[SC_FIRE_CLOAK_OPTION])
  586.  			damage -= damage * tsc->data[SC_FIRE_CLOAK_OPTION]->val2 / 100;	
  587.  		if( tsc->data[SC_CRYSTALIZE] && target->type != BL_MOB){
  588. -			if( atk_elem == ELE_WIND)
  589. -				damage = damage * 150 / 100;
  590. -			if( atk_elem == ELE_FIRE )
  591.  				status_change_end(target, SC_CRYSTALIZE, INVALID_TIMER);
  592.  		}
  593. +				break;
  594. +			case ELE_HOLY:
  595. +				if( tsc->data[SC_ORATIO])
  596. +					ratio += tsc->data[SC_ORATIO]->val1 * 2;
  597. +				break;
  598. +			case ELE_POISON:
  599. +				if( tsc->data[SC_VENOMIMPRESS])
  600. +					ratio += tsc->data[SC_VENOMIMPRESS]->val2;
  601. +				break;	
  602. +			case ELE_WIND:
  603. +				if( tsc->data[SC_CRYSTALIZE] && target->type != BL_MOB)
  604. +					damage = damage * 150 / 100;
  605. +				break;			
  606.  	}
  607. +	} //end tsc check
  608.  	if( src && src->type == BL_PC ){
  609.  		struct map_session_data *sd = BL_CAST(BL_PC, src);
  610.  		int s;
  611. @@ -395,7 +404,9 @@
  612.  }
  613.  
  614.  /*==========================================
  615. - * �_??[�W??I�v�Z
  616. + * Check dammage trough status.
  617. + * ATK may be MISS, BLOCKED FAIL, reduc, increase, end status...
  618. + * After this we apply bg/gvg reduction
  619.   *------------------------------------------*/
  620.  int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damage *d,int damage,int skill_num,int skill_lv)
  621.  {
  622. @@ -1002,7 +1013,7 @@
  623.  }
  624.  
  625.  /*==========================================
  626. - * HP/SP�z��̌v�Z
  627. + * HP/SP drain calculation
  628.   *------------------------------------------*/
  629.  static int battle_calc_drain(int damage, int rate, int per)
  630.  {
  631. @@ -1021,7 +1032,7 @@
  632.  }
  633.  
  634.  /*==========================================
  635. - * ?C��_??[�W
  636. + * Passif skill dammages increases
  637.   *------------------------------------------*/
  638.  int battle_addmastery(struct map_session_data *sd,struct block_list *target,int dmg,int type)
  639.  {
  640. @@ -2158,7 +2169,7 @@
  641.  								&& sd->inventory_data[index]->type == IT_WEAPON )
  642.  								skillratio += max(10000 - sd->inventory_data[index]->weight, 0) / 10;
  643.  							skillratio += 50 * pc_checkskill(sd,LK_SPIRALPIERCE);
  644. -						} // (1 + [(Caster�s Base Level - 100) / 200])
  645. +						} // (1 + [(Casters Base Level - 100) / 200])
  646.  						skillratio = skillratio * (100 + (status_get_lv(src)-100) / 2) / 100;
  647.  					break;
  648.  				case RK_WINDCUTTER:
  649. @@ -2333,7 +2344,7 @@
  650.  						skillratio += -100 + 15 * 200;
  651.  					RE_LVL_DMOD(100);
  652.  					break;
  653. -				case LG_SHIELDSPELL:// [(Caster�s Base Level x 4) + (Shield DEF x 10) + (Caster�s VIT x 2)] %
  654. +				case LG_SHIELDSPELL:// [(Casters Base Level x 4) + (Shield DEF x 10) + (Casters VIT x 2)] %
  655.  					if( sd ) { 
  656.  						struct item_data *shield_data = sd->inventory_data[sd->equip_index[EQI_HAND_L]];
  657.  						skillratio = status_get_lv(src) * 4 + status_get_vit(src) * 2;
  658. @@ -2374,34 +2385,34 @@
  659.  					RE_LVL_DMOD(100);
  660.  					break;
  661.  				case SR_SKYNETBLOW:
  662. -					//ATK [{(Skill Level x 80) + (Caster�s AGI)} x Caster�s Base Level / 100] %
  663. +					//ATK [{(Skill Level x 80) + (Caster AGI)} x Caster Base Level / 100] %
  664.  					skillratio = 80 * skill_lv + sstatus->agi;
  665. -					if( sc && sc->data[SC_COMBO] && sc->data[SC_COMBO]->val1 == SR_DRAGONCOMBO )//ATK [{(Skill Level x 100) + (Caster�s AGI) + 150} x Caster�s Base Level / 100] %
  666. +					if( sc && sc->data[SC_COMBO] && sc->data[SC_COMBO]->val1 == SR_DRAGONCOMBO )//ATK [{(Skill Level x 100) + (Caster AGI) + 150} x Caster Base Level / 100] %
  667.  						skillratio = 100 * skill_lv + sstatus->agi + 150;
  668.  					RE_LVL_DMOD(100);
  669.  					break;
  670.  				case SR_EARTHSHAKER:
  671. -					if( tsc && (tsc->data[SC_HIDING] || tsc->data[SC_CLOAKING] || // [(Skill Level x 150) x (Caster�s Base Level / 100) + (Caster�s INT x 3)] %
  672. +					if( tsc && (tsc->data[SC_HIDING] || tsc->data[SC_CLOAKING] || // [(Skill Level x 150) x (Caster Base Level / 100) + (Caster INT x 3)] %
  673.  						tsc->data[SC_CHASEWALK] || tsc->data[SC_CLOAKINGEXCEED] || tsc->data[SC__INVISIBILITY]) ){
  674.  						skillratio = 150 * skill_lv;
  675.  						RE_LVL_DMOD(100);
  676.  						skillratio += sstatus->int_ * 3;
  677. -					}else{ //[(Skill Level x 50) x (Caster�s Base Level / 100) + (Caster�s INT x 2)] %
  678. +					}else{ //[(Skill Level x 50) x (Caster Base Level / 100) + (Caster INT x 2)] %
  679.  						skillratio += 50 * (skill_lv-2);
  680.  						RE_LVL_DMOD(100);
  681.  						skillratio += sstatus->int_ * 2;
  682.  					}
  683.  					break;
  684. -				case SR_FALLENEMPIRE:// ATK [(Skill Level x 150 + 100) x Caster�s Base Level / 150] % 
  685. +				case SR_FALLENEMPIRE:// ATK [(Skill Level x 150 + 100) x Caster Base Level / 150] % 
  686.  					skillratio += 150 *skill_lv;
  687.  					RE_LVL_DMOD(150);
  688.   					break;
  689. -				case SR_TIGERCANNON:// ATK [((Caster�s consumed HP + SP) / 4) x Caster�s Base Level / 100] % 
  690. +				case SR_TIGERCANNON:// ATK [((Caster consumed HP + SP) / 4) x Caster Base Level / 100] % 
  691.  					{
  692.  						int hp = sstatus->max_hp * (10 + 2 * skill_lv) / 100,
  693.  							sp = sstatus->max_sp * (6 + skill_lv) / 100;
  694.  						skillratio = (hp+sp) / 4;
  695. -						if( sc && sc->data[SC_COMBO] && sc->data[SC_COMBO]->val1 == SR_FALLENEMPIRE ) // ATK [((Caster�s consumed HP + SP) / 2) x Caster�s Base Level / 100] %
  696. +						if( sc && sc->data[SC_COMBO] && sc->data[SC_COMBO]->val1 == SR_FALLENEMPIRE ) // ATK [((Caster consumed HP + SP) / 2) x Caster Base Level / 100] %
  697.  							skillratio = (hp+sp) / 2;
  698.  						RE_LVL_DMOD(100);
  699.  					}
  700. @@ -2415,15 +2426,15 @@
  701.  						RE_LVL_DMOD(150);
  702.  					break;
  703.  				case SR_KNUCKLEARROW:
  704. -					if( wflag&4 ){  // ATK [(Skill Level x 150) + (1000 x Target�s current weight / Maximum weight) + (Target�s Base Level x 5) x (Caster�s Base Level / 150)] %
  705. +					if( wflag&4 ){  // ATK [(Skill Level x 150) + (1000 x Target current weight / Maximum weight) + (Target Base Level x 5) x (Caster Base Level / 150)] %
  706.  						skillratio = 150 * skill_lv + status_get_lv(target) * 5 * (status_get_lv(src) / 100) ;
  707.  						if( tsd && tsd->weight )
  708.  							skillratio += 100 * (tsd->weight / tsd->max_weight);
  709. -					}else // ATK [(Skill Level x 100 + 500) x Caster�s Base Level / 100] %
  710. +					}else // ATK [(Skill Level x 100 + 500) x Caster Base Level / 100] %
  711.  						skillratio += 400 + (100 * skill_lv);
  712.  					RE_LVL_DMOD(100);
  713.  					break;
  714. -				case SR_WINDMILL: // ATK [(Caster�s Base Level + Caster�s DEX) x Caster�s Base Level / 100] %
  715. +				case SR_WINDMILL: // ATK [(Caster Base Level + Caster DEX) x Caster Base Level / 100] %
  716.  					skillratio = status_get_lv(src) + sstatus->dex;
  717.  					RE_LVL_DMOD(100);
  718.  					break;
  719. @@ -2443,14 +2454,14 @@
  720.  					skillratio += 300 * skill_lv - 100;
  721.  					RE_LVL_DMOD(150);
  722.  					break;
  723. -				case SR_RIDEINLIGHTNING: // ATK [{(Skill Level x 200) + Additional Damage} x Caster�s Base Level / 100] %
  724. +				case SR_RIDEINLIGHTNING: // ATK [{(Skill Level x 200) + Additional Damage} x Caster Base Level / 100] %
  725.  					if( (sstatus->rhw.ele) == ELE_WIND || (sstatus->lhw.ele) == ELE_WIND )
  726.  						skillratio += skill_lv * 50;
  727.  					skillratio += -100 + 200 * skill_lv;
  728.  					RE_LVL_DMOD(100);
  729.  					break;
  730.  				case WM_REVERBERATION_MELEE:
  731. -					// ATK [{(Skill Level x 100) + 300} x Caster�s Base Level / 100]
  732. +					// ATK [{(Skill Level x 100) + 300} x Caster Base Level / 100]
  733.  					skillratio += 200 + 100 * pc_checkskill(sd, WM_REVERBERATION);
  734.  					RE_LVL_DMOD(100);
  735.  					break;
  736. @@ -2468,7 +2479,7 @@
  737.  					skillratio += 400;
  738.  					break;
  739.  				case GN_CART_TORNADO:
  740. -					// ATK [( Skill Level x 50 ) + ( Cart Weight / ( 150 - Caster�s Base STR ))] + ( Cart Remodeling Skill Level x 50 )] %
  741. +					// ATK [( Skill Level x 50 ) + ( Cart Weight / ( 150 - Caster Base STR ))] + ( Cart Remodeling Skill Level x 50 )] %
  742.  					skillratio = 50 * skill_lv;
  743.  					if( sd && sd->cart_weight)
  744.  						 skillratio += sd->cart_weight/10 / max(150-sstatus->str,1) + pc_checkskill(sd, GN_REMODELING_CART) * 50;
  745. @@ -2587,7 +2598,7 @@
  746.  					if(sd) 
  747.  						ATK_ADD( 40 * pc_checkskill(sd, RA_RESEARCHTRAP) );
  748.  					break;
  749. -				case RA_WUGDASH://(Caster�s Current Weight x 10 / 8)
  750. +				case RA_WUGDASH ://(Caster Current Weight x 10 / 8)
  751.  					if( sd && sd->weight )
  752.  						ATK_ADD( sd->weight / 8 );
  753.  				case RA_WUGSTRIKE:
  754. @@ -2609,13 +2620,13 @@
  755.  						ATK_ADD ( (sstatus->max_sp * (1 + skill_lv * 2 / 10)) + 40 * status_get_lv(src) );
  756.  					}
  757.  					break;
  758. -				case SR_TIGERCANNON: // (Tiger Cannon skill level x 240) + (Target�s Base Level x 40)
  759. +				case SR_TIGERCANNON: // (Tiger Cannon skill level x 240) + (Target Base Level x 40)
  760.  					ATK_ADD( skill_lv * 240 + status_get_lv(target) * 40 );
  761.  					if( sc && sc->data[SC_COMBO] 
  762. -						&& sc->data[SC_COMBO]->val1 == SR_FALLENEMPIRE ) // (Tiger Cannon skill level x 500) + (Target�s Base Level x 40)
  763. +						&& sc->data[SC_COMBO]->val1 == SR_FALLENEMPIRE ) // (Tiger Cannon skill level x 500) + (Target Base Level x 40)
  764.  							ATK_ADD( skill_lv * 500 + status_get_lv(target) * 40 );
  765.  					break;
  766. -				case SR_FALLENEMPIRE:// [(Target�s Size value + Skill Level - 1) x Caster�s STR] + [(Target�s current weight x Caster�s DEX / 120)]
  767. +				case SR_FALLENEMPIRE:// [(Target Size value + Skill Level - 1) x Caster STR] + [(Target current weight x Caster DEX / 120)]
  768.  					ATK_ADD( ((tstatus->size+1)*2 + skill_lv - 1) * sstatus->str);
  769.  					if( tsd && tsd->weight ){
  770.  						ATK_ADD( (tsd->weight/10) * sstatus->dex / 120 );
  771. @@ -2854,7 +2865,7 @@
  772.  				ATK_ADD(10*sc->data[SC_GN_CARTBOOST]->val1);
  773.  
  774.  			if(sc->data[SC_GT_CHANGE] && sc->data[SC_GT_CHANGE]->val2){
  775. -				struct block_list *bl; // ATK increase: ATK [{(Caster�s DEX / 4) + (Caster�s STR / 2)} x Skill Level / 5]
  776. +				struct block_list *bl; // ATK increase: ATK [{(Caster DEX / 4) + (Caster STR / 2)} x Skill Level / 5]
  777.  				if( (bl = map_id2bl(sc->data[SC_GT_CHANGE]->val2)) )
  778.  					ATK_ADD( ( status_get_dex(bl)/4 + status_get_str(bl)/2 ) * sc->data[SC_GT_CHANGE]->val1 / 5 );
  779.  			}
  780. @@ -3710,8 +3721,8 @@
  781.  					case WL_HELLINFERNO:
  782.  						skillratio = 300 * skill_lv;
  783.  						RE_LVL_DMOD(100);	
  784. -						// Shadow: MATK [{( Skill Level x 300 ) x ( Caster�s Base Level / 100 ) x 4/5 }] %
  785. -						// Fire : MATK [{( Skill Level x 300 ) x ( Caster�s Base Level / 100 ) /5 }] %
  786. +						// Shadow: MATK [{( Skill Level x 300 ) x ( Caster Base Level / 100 ) x 4/5 }] %
  787. +						// Fire : MATK [{( Skill Level x 300 ) x ( Caster Base Level / 100 ) /5 }] %
  788.  						if( mflag&ELE_DARK ){ skillratio *= 4; s_ele = ELE_DARK; }
  789.  						skillratio /= 5;
  790.  						break;
  791. @@ -3755,7 +3766,7 @@
  792.  						skillratio = (skillratio + 200) * skill_lv;
  793.  						RE_LVL_DMOD(100);
  794.  						break;
  795. -					case LG_SHIELDSPELL:// [(Caster�s Base Level x 4) + (Shield MDEF x 100) + (Caster�s INT x 2)] %
  796. +					case LG_SHIELDSPELL:// [(Casters Base Level x 4) + (Shield MDEF x 100) + (Casters INT x 2)] %
  797.  						if( sd ) { 
  798.  							skillratio = status_get_lv(src) * 4 + sd->bonus.shieldmdef * 100 + status_get_int(src) * 2;
  799.  						} else
  800. @@ -3768,7 +3779,7 @@
  801.  						skillratio += 50 * skill_lv;
  802.  						break;
  803.  					case WM_REVERBERATION_MAGIC:
  804. -						// MATK [{(Skill Level x 100) + 100} x Caster�s Base Level / 100] %
  805. +						// MATK [{(Skill Level x 100) + 100} x Casters Base Level / 100] %
  806.  						skillratio += 100 * (sd ? pc_checkskill(sd, WM_REVERBERATION) : 1);
  807.  						RE_LVL_DMOD(100);
  808.  						break;
  809. @@ -4052,7 +4063,7 @@
  810.  }
  811.  
  812.  /*==========================================
  813. - * ���̑��_??[�W�v�Z
  814. + * Calculate Misc dammage for skillid
  815.   *------------------------------------------*/
  816.  struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *target,int skill_num,int skill_lv,int mflag)
  817.  {
  818. @@ -4235,7 +4246,7 @@
  819.  		md.damage = 100 + 200 * skill_lv + sstatus->int_;
  820.  		break;
  821.  	case GN_HELLS_PLANT_ATK:
  822. -		//[{( Hell Plant Skill Level x Caster�s Base Level ) x 10 } + {( Caster�s INT x 7 ) / 2 } x { 18 + ( Caster�s Job Level / 4 )] x ( 5 / ( 10 - Summon Flora Skill Level ))
  823. +		//[{( Hell Plant Skill Level x Casters Base Level ) x 10 } + {( Casters INT x 7 ) / 2 } x { 18 + ( Casters Job Level / 4 )] x ( 5 / ( 10 - Summon Flora Skill Level ))
  824.  		md.damage = ( skill_lv * status_get_lv(src) * 10 ) + ( sstatus->int_ * 7 / 2 ) * ( 18 + (sd?sd->status.job_level:0) / 4 ) * ( 5 / (10 - (sd?pc_checkskill(sd,AM_CANNIBALIZE):0)) ); 
  825.  		break;
  826.  	case KO_HAPPOKUNAI:
  827. @@ -4395,7 +4406,7 @@
  828.  	return md;
  829.  }
  830.  /*==========================================
  831. - * �_??[�W�v�Z�ꊇ?��?�p
  832. + * Battle main entry, from skill_attack
  833.   *------------------------------------------*/
  834.  struct Damage battle_calc_attack(int attack_type,struct block_list *bl,struct block_list *target,int skill_num,int skill_lv,int count)
  835.  {
  836. @@ -4435,7 +4446,7 @@
  837.  		rdamage = (*dmg) * sc->data[SC_REFLECTDAMAGE]->val2 / 100;
  838.  		if( rdamage > max_damage ) rdamage = max_damage;
  839.  	}else if( sc && sc->data[SC_CRESCENTELBOW] && !is_boss(src) && rnd()%100 < sc->data[SC_CRESCENTELBOW]->val2 ){
  840. -		//ATK [{(Target�s HP / 100) x Skill Level} x Caster�s Base Level / 125] % + [Received damage x {1 + (Skill Level x 0.2)}]
  841. +		//ATK [{(Target HP / 100) x Skill Level} x Caster Base Level / 125] % + [Received damage x {1 + (Skill Level x 0.2)}]
  842.  		int ratio = (status_get_hp(src) / 100) * sc->data[SC_CRESCENTELBOW]->val1 * status_get_lv(bl) / 125;
  843.  		if (ratio > 5000) ratio = 5000; // Maximum of 5000% ATK
  844.  		rdamage = rdamage * ratio / 100 + (*dmg) * (10 + sc->data[SC_CRESCENTELBOW]->val1 * 20 / 10) / 10;
  845. @@ -4564,7 +4575,7 @@
  846.  	return 0;
  847.  }
  848.  /*==========================================
  849. - * ��??U��?��?�܂Ƃ�
  850. + * Do a basic physical attack (call trough unit_attack_timer)
  851.   *------------------------------------------*/
  852.  enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* target, unsigned int tick, int flag) {
  853.  	struct map_session_data *sd = NULL, *tsd = NULL;
  854. @@ -4631,13 +4642,12 @@
  855.  			}
  856.  		}
  857.  	}
  858. -
  859. -	if (sc && sc->data[SC_CLOAKING] && !(sc->data[SC_CLOAKING]->val4&2))
  860. +    if (sc && sc->count) {
  861. +        if (sc->data[SC_CLOAKING] && !(sc->data[SC_CLOAKING]->val4 & 2))
  862.  		status_change_end(src, SC_CLOAKING, INVALID_TIMER);
  863. -		
  864. -	if (sc && sc->data[SC_CLOAKINGEXCEED] && !(sc->data[SC_CLOAKINGEXCEED]->val4&2))
  865. +        else if (sc->data[SC_CLOAKINGEXCEED] && !(sc->data[SC_CLOAKINGEXCEED]->val4 & 2))
  866.  		status_change_end(src, SC_CLOAKINGEXCEED, INVALID_TIMER);
  867. -
  868. +    }
  869.  	if( tsc && tsc->data[SC_AUTOCOUNTER] && status_check_skilluse(target, src, KN_AUTOCOUNTER, 1) )
  870.  	{
  871.  		int dir = map_calc_dir(target,src->x,src->y);
  872. @@ -5123,7 +5133,7 @@
  873.  		//All else not specified is an invalid target.
  874.  		default:
  875.  			return 0;
  876. -	}
  877. +    } //end switch actual target
  878.  
  879.  	switch( t_bl->type )
  880.  	{	//Checks on target master
  881. @@ -5152,7 +5162,7 @@
  882.  			break;
  883.  		}
  884.  		default: break; //other type doesn't have slave yet
  885. -	}
  886. +    } //end switch master target
  887.  
  888.  	switch( src->type ) { //Checks on actual src type
  889.  		case BL_PET:
  890. @@ -5179,7 +5189,7 @@
  891.  			if (t_bl->type == BL_MOB && ((TBL_MOB*)t_bl)->class_ == MOBID_EMPERIUM && flag&BCT_ENEMY)
  892.  				return 0; //mercenary may not attack Emperium
  893.  			break;
  894. -	}
  895. +    } //end switch actual src
  896.  
  897.  	switch( s_bl->type )
  898.  	{	//Checks on source master
  899. @@ -5233,7 +5243,7 @@
  900.  			if (t_bl->type != s_bl->type)
  901.  				state |= BCT_ENEMY;
  902.  			break;
  903. -	}
  904. +    } //end switch on src master
  905.  
  906.  	if( (flag&BCT_ALL) == BCT_ALL )
  907.  	{ //All actually stands for all attackable chars 
  908. @@ -5293,7 +5303,7 @@
  909.  			)
  910.  				state &= ~BCT_ENEMY;
  911.  		}
  912. -	}
  913. +    }//end map_flag_vs chk rivality
  914.  	else
  915.  	{ //Non pvp/gvg, check party/guild settings.
  916.  		if( flag&BCT_PARTY || state&BCT_ENEMY )
  917. @@ -5309,7 +5319,7 @@
  918.  			if(s_guild && t_guild && (s_guild == t_guild || guild_isallied(s_guild, t_guild)))
  919.  				state |= BCT_GUILD;
  920.  		}
  921. -	}
  922. +    } //end non pvp/gvg chk rivality
  923.  
  924.  	if( !state ) //If not an enemy, nor a guild, nor party, nor yourself, it's neutral.
  925.  		state = BCT_NEUTRAL;
  926. @@ -5320,7 +5330,8 @@
  927.  	return (flag&state)?1:-1;
  928.  }
  929.  /*==========================================
  930. - * �˒�����
  931. + * Check if can attack from this range
  932. + * Basic check then calling path_search for obstacle etc..
  933.   *------------------------------------------*/
  934.  bool battle_check_range(struct block_list *src, struct block_list *bl, int range)
  935.  {
  936. Index: src/map/battle.h
  937. --- src/map/battle.h Base (BASE)
  938. +++ src/map/battle.h Locally Modified (Based On LOCAL)
  939. @@ -14,24 +14,24 @@
  940.  	ATK_DEF      // attack connected
  941.  } damage_lv;
  942.  
  943. -// �_���[�W
  944. +// dammage structure
  945.  struct Damage {
  946. -	int damage,damage2;
  947. -	int type,div_;
  948. +	int damage,damage2; //right, left dmg
  949. +	int type,div_; //chk clif_damage for type @TODO add an enum ? ;  nb of hit
  950.  	int amotion,dmotion;
  951. -	int blewcount;
  952. -	int flag;
  953. +	int blewcount; //nb of knockback
  954. +	int flag; //chk BF_* flag, (enum below)
  955.  	enum damage_lv dmg_lv;	//ATK_LUCKY,ATK_FLEE,ATK_DEF
  956.  };
  957.  
  958. -// �����\�i�ǂݍ��݂�pc.c�Abattle_attr_fix�Ŏg�p�j
  959. +//(Used in read pc.c,) attribute table (battle_attr_fix)
  960.  extern int attr_fix_table[4][10][10];
  961.  
  962.  struct map_session_data;
  963.  struct mob_data;
  964.  struct block_list;
  965.  
  966. -// �_���[�W�v�Z
  967. +// Damage Calculation
  968.  
  969.  struct Damage battle_calc_attack(int attack_type,struct block_list *bl,struct block_list *target,int skill_num,int skill_lv,int count);
  970.  
  971. @@ -42,12 +42,12 @@
  972.  int battle_attr_ratio(int atk_elem,int def_type, int def_lv);
  973.  int battle_attr_fix(struct block_list *src, struct block_list *target, int damage,int atk_elem,int def_type, int def_lv);
  974.  
  975. -// �_���[�W�ŏI�v�Z
  976. +// Final calculation Damage
  977.  int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damage *d,int damage,int skill_num,int skill_lv);
  978.  int battle_calc_gvg_damage(struct block_list *src,struct block_list *bl,int damage,int div_,int skill_num,int skill_lv,int flag);
  979.  int battle_calc_bg_damage(struct block_list *src,struct block_list *bl,int damage,int div_,int skill_num,int skill_lv,int flag);
  980.  
  981. -enum {	// �ŏI�v�Z�̃t���O
  982. +enum {	// Flag of the final calculation
  983.  	BF_WEAPON	= 0x0001,
  984.  	BF_MAGIC	= 0x0002,
  985.  	BF_MISC		= 0x0004,
  986. @@ -62,10 +62,10 @@
  987.  
  988.  int battle_delay_damage (unsigned int tick, int amotion, struct block_list *src, struct block_list *target, int attack_type, int skill_id, int skill_lv, int damage, enum damage_lv dmg_lv, int ddelay);
  989.  
  990. -// �ʏ�U�������܂Ƃ�
  991. +// Summary normal attack treatment (basic attack)
  992.  enum damage_lv battle_weapon_attack( struct block_list *bl,struct block_list *target,unsigned int tick,int flag);
  993.  
  994. -// �e��p�����[�^�𓾂�
  995. +// Accessors
  996.  struct block_list* battle_get_master(struct block_list *src);
  997.  struct block_list* battle_gettargeted(struct block_list *target);
  998.  struct block_list* battle_getenemy(struct block_list *target, int type, int range);
  999. @@ -93,7 +93,7 @@
  1000.  bool battle_check_range(struct block_list *src,struct block_list *bl,int range);
  1001.  
  1002.  void battle_consume_ammo(struct map_session_data* sd, int skill, int lv);
  1003. -// �ݒ�
  1004. +// Settings
  1005.  
  1006.  #define MIN_HAIR_STYLE battle_config.min_hair_style
  1007.  #define MAX_HAIR_STYLE battle_config.max_hair_style
  1008. Index: src/map/chat.c
  1009. --- src/map/chat.c Base (BASE)
  1010. +++ src/map/chat.c Locally Modified (Based On LOCAL)
  1011. @@ -156,11 +156,11 @@
  1012.  
  1013.  	pc_setchatid(sd,cd->bl.id);
  1014.  
  1015. -	clif_joinchatok(sd,cd);	// �V���ɎQ�������l�ɂ͑S���̃��X�g
  1016. -	clif_addchat(cd,sd);	// ��ɒ��ɋ����l�ɂ͒lj������l�̕�
  1017. -	clif_dispchat(cd,0);	// ��͂̐l�ɂ͐l���ω���
  1018. +    clif_joinchatok(sd, cd); //To the person who newly joined the list of all
  1019. +    clif_addchat(cd, sd); //Reports To the person who already in the chat 
  1020. +    clif_dispchat(cd, 0); //Reported number of changes to the people around 
  1021.  
  1022. -	chat_triggerevent(cd); // �C�x���g
  1023. +    chat_triggerevent(cd); //Event 
  1024.  
  1025.  	return 0;
  1026.  }
  1027. @@ -372,7 +372,7 @@
  1028.  }
  1029.  
  1030.  /*==========================================
  1031. - * �K��l���ȏ�ŃC�x���g����`����Ă�Ȃ���s
  1032. + * Trigger npc event when we enter the chatroom
  1033.   *------------------------------------------*/
  1034.  int chat_triggerevent(struct chat_data *cd)
  1035.  {
  1036. Index: src/map/chrif.c
  1037. --- src/map/chrif.c Base (BASE)
  1038. +++ src/map/chrif.c Locally Modified (Based On LOCAL)
  1039. @@ -730,7 +730,7 @@
  1040.  }
  1041.  
  1042.  /*==========================================
  1043. - * �L�������₢���킹
  1044. + * Search Char trough id on char serv
  1045.   *------------------------------------------*/
  1046.  int chrif_searchcharid(int char_id)
  1047.  {
  1048. @@ -803,7 +803,7 @@
  1049.  	WFIFOW(char_fd,30) = 5;
  1050.  	WFIFOSET(char_fd,44);
  1051.  
  1052. -	clif_displaymessage(sd->fd, "Need disconnection to perform change-sex request...");
  1053. +	clif_displaymessage(sd->fd, msg_txt(410)); //"Need disconnection to perform change-sex request..."
  1054.  
  1055.  	if (sd->fd)
  1056.  		clif_authfail_fd(sd->fd, 15);
  1057. @@ -835,20 +835,16 @@
  1058.  		return;
  1059.  	}
  1060.  
  1061. -	switch( type ) {
  1062. -	case 1 : action = "block"; break;
  1063. -	case 2 : action = "ban"; break;
  1064. -	case 3 : action = "unblock"; break;
  1065. -	case 4 : action = "unban"; break;
  1066. -	case 5 : action = "change the sex of"; break;
  1067. -	default: action = "???"; break;
  1068. -	}
  1069. +        if(type>0 && type<=5)
  1070. +            sprintf(action,msg_txt(427+type)); //block|ban|unblock|unban|change the sex of
  1071. +        else
  1072. +            sprintf(action,"???");
  1073.  
  1074.  	switch( answer ) {
  1075. -	case 0 : sprintf(output, "Login-server has been asked to %s the player '%.*s'.", action, NAME_LENGTH, player_name); break;
  1076. -	case 1 : sprintf(output, "The player '%.*s' doesn't exist.", NAME_LENGTH, player_name); break;
  1077. -	case 2 : sprintf(output, "Your GM level don't authorise you to %s the player '%.*s'.", action, NAME_LENGTH, player_name); break;
  1078. -	case 3 : sprintf(output, "Login-server is offline. Impossible to %s the player '%.*s'.", action, NAME_LENGTH, player_name); break;
  1079. +	case 0 : sprintf(output, msg_txt(424), action, NAME_LENGTH, player_name); break;
  1080. +	case 1 : sprintf(output, msg_txt(425), NAME_LENGTH, player_name); break;
  1081. +	case 2 : sprintf(output, msg_txt(426), action, NAME_LENGTH, player_name); break;
  1082. +	case 3 : sprintf(output, msg_txt(427), action, NAME_LENGTH, player_name); break;
  1083.  	default: output[0] = '\0'; break;
  1084.  	}
  1085.  
  1086. @@ -856,7 +852,7 @@
  1087.  }
  1088.  
  1089.  /*==========================================
  1090. - * ���ʕω��I�� (modified by Yor)
  1091. + * Request char server to change sex of char (modified by Yor)
  1092.   *------------------------------------------*/
  1093.  int chrif_changedsex(int fd)
  1094.  {
  1095. @@ -902,7 +898,7 @@
  1096.  		// save character
  1097.  		sd->login_id1++; // change identify, because if player come back in char within the 5 seconds, he can change its characters
  1098.  							  // do same modify in login-server for the account, but no in char-server (it ask again login_id1 to login, and don't remember it)
  1099. -		clif_displaymessage(sd->fd, "Your sex has been changed (need disconnection by the server)...");
  1100. +		clif_displaymessage(sd->fd, msg_txt(411)); //"Your sex has been changed (need disconnection by the server)..."
  1101.  		set_eof(sd->fd); // forced to disconnect for the change
  1102.  		map_quit(sd); // Remove leftovers (e.g. autotrading) [Paradox924X]
  1103.  	}
  1104. @@ -1003,26 +999,20 @@
  1105.  	sd->login_id1++; // change identify, because if player come back in char within the 5 seconds, he can change its characters
  1106.  	if (RFIFOB(fd,6) == 0) // 0: change of statut, 1: ban
  1107.  	{ 
  1108. -		switch (RFIFOL(fd,7)) { // status or final date of a banishment
  1109. -		case 1: clif_displaymessage(sd->fd, "Your account has 'Unregistered'."); break;
  1110. -		case 2: clif_displaymessage(sd->fd, "Your account has an 'Incorrect Password'..."); break;
  1111. -		case 3: clif_displaymessage(sd->fd, "Your account has expired."); break;
  1112. -		case 4: clif_displaymessage(sd->fd, "Your account has been rejected from server."); break;
  1113. -		case 5: clif_displaymessage(sd->fd, "Your account has been blocked by the GM Team."); break;
  1114. -		case 6: clif_displaymessage(sd->fd, "Your Game's EXE file is not the latest version."); break;
  1115. -		case 7: clif_displaymessage(sd->fd, "Your account has been prohibited to log in."); break;
  1116. -		case 8: clif_displaymessage(sd->fd, "Server is jammed due to over populated."); break;
  1117. -		case 9: clif_displaymessage(sd->fd, "Your account has not more authorised."); break;
  1118. -		case 100: clif_displaymessage(sd->fd, "Your account has been totally erased."); break;
  1119. -		default:  clif_displaymessage(sd->fd, "Your account has not more authorised."); break;
  1120. +                int ret_status = RFIFOL(fd,7); // status or final date of a banishment
  1121. +                if(0<ret_status && ret_status<=9)
  1122. +                    clif_displaymessage(sd->fd, msg_txt(411+ret_status));
  1123. +                else if(ret_status==100)
  1124. +                    clif_displaymessage(sd->fd, msg_txt(421));
  1125. +                else    
  1126. +                    clif_displaymessage(sd->fd, msg_txt(420)); //"Your account has not more authorised." 
  1127.  		}
  1128. -	}
  1129.  	else if (RFIFOB(fd,6) == 1) // 0: change of statut, 1: ban
  1130.  	{ 
  1131.  		time_t timestamp;
  1132.  		char tmpstr[2048];
  1133.  		timestamp = (time_t)RFIFOL(fd,7); // status or final date of a banishment
  1134. -		strcpy(tmpstr, "Your account has been banished until ");
  1135. +		strcpy(tmpstr, msg_txt(423)); //"Your account has been banished until "
  1136.  		strftime(tmpstr + strlen(tmpstr), 24, "%d-%m-%Y %H:%M:%S", localtime(&timestamp));
  1137.  		clif_displaymessage(sd->fd, tmpstr);
  1138.  	}
  1139. @@ -1399,10 +1389,10 @@
  1140.  		cmd = RFIFOW(fd,0);
  1141.  		if (cmd < 0x2af8 || cmd >= 0x2af8 + ARRAYLENGTH(packet_len_table) || packet_len_table[cmd-0x2af8] == 0)
  1142.  		{
  1143. -			int r = intif_parse(fd); // intif�ɓn��
  1144. +			int r = intif_parse(fd); // Passed on to the intif
  1145.  
  1146. -			if (r == 1) continue;	// intif�ŏ�������
  1147. -			if (r == 2) return 0;	// intif�ŏ����������A�f�[�^������Ȃ�
  1148. +			if (r == 1) continue;	// Treated in intif 
  1149. +			if (r == 2) return 0;	// Didn't have enough data (len==-1)
  1150.  
  1151.  			ShowWarning("chrif_parse: session #%d, intif_parse failed (unrecognized command 0x%.4x).\n", fd, cmd);
  1152.  			set_eof(fd);
  1153. @@ -1478,8 +1468,8 @@
  1154.  }
  1155.  
  1156.  /*==========================================
  1157. - * timer�֐�
  1158. - * ������map�I�Ɍq�����Ă���N���C�A���g�l����char�I�֑���
  1159. + * timerFunction
  1160. + * Send to char the number of client connected to map
  1161.   *------------------------------------------*/
  1162.  int send_users_tochar(void)
  1163.  {
  1164. @@ -1508,8 +1498,8 @@
  1165.  }
  1166.  
  1167.  /*==========================================
  1168. - * timer�֐�
  1169. - * char�I�Ƃ̐ڑ����m�F���A�����؂�Ă�����ēx�ڑ�����
  1170. + * timerFunction
  1171. +  * Chk the connection to char server, (if it down)
  1172.   *------------------------------------------*/
  1173.  static int check_connect_char_server(int tid, unsigned int tick, int id, intptr_t data)
  1174.  {
  1175. @@ -1591,7 +1581,7 @@
  1176.  }
  1177.  
  1178.  /*==========================================
  1179. - * �I��
  1180. + * Destructor
  1181.   *------------------------------------------*/
  1182.  int do_final_chrif(void)
  1183.  {
  1184. Index: src/map/clif.c
  1185. --- src/map/clif.c Base (BASE)
  1186. +++ src/map/clif.c Locally Modified (Based On LOCAL)
  1187. @@ -193,6 +193,9 @@
  1188.  /*==========================================
  1189.   * map�I��ip�ݒ�
  1190.   *------------------------------------------*/
  1191. +/*==========================================
  1192. + * Ip setting of map-server
  1193. + *------------------------------------------*/
  1194.  int clif_setip(const char* ip)
  1195.  {
  1196.  	char ip_str[16];
  1197. @@ -1357,9 +1360,9 @@
  1198.  			int i;
  1199.  			if (sd->spiritball > 0)
  1200.  				clif_spiritball(sd);
  1201. -			if(sd->state.size==2) // tiny/big players [Valaris]
  1202. +			if(sd->state.size==SZ_BIG) // tiny/big players [Valaris]
  1203.  				clif_specialeffect(bl,423,AREA);
  1204. -			else if(sd->state.size==1)
  1205. +			else if(sd->state.size==SZ_MEDIUM)
  1206.  				clif_specialeffect(bl,421,AREA);
  1207.  			if( sd->bg_id && map[sd->bl.m].flag.battleground )
  1208.  				clif_sendbgemblem_area(sd);
  1209. @@ -1384,9 +1387,9 @@
  1210.  	case BL_MOB:
  1211.  		{
  1212.  			TBL_MOB *md = ((TBL_MOB*)bl);
  1213. -			if(md->special_state.size==2) // tiny/big mobs [Valaris]
  1214. +			if(md->special_state.size==SZ_BIG) // tiny/big mobs [Valaris]
  1215.  				clif_specialeffect(&md->bl,423,AREA);
  1216. -			else if(md->special_state.size==1)
  1217. +			else if(md->special_state.size==SZ_MEDIUM)
  1218.  				clif_specialeffect(&md->bl,421,AREA);
  1219.  		}
  1220.  		break;
  1221. @@ -1587,18 +1590,18 @@
  1222.  		{
  1223.  			TBL_PC *sd = ((TBL_PC*)bl);
  1224.  //			clif_movepc(sd);
  1225. -			if(sd->state.size==2) // tiny/big players [Valaris]
  1226. +			if(sd->state.size==SZ_BIG) // tiny/big players [Valaris]
  1227.  				clif_specialeffect(&sd->bl,423,AREA);
  1228. -			else if(sd->state.size==1)
  1229. +			else if(sd->state.size==SZ_MEDIUM)
  1230.  				clif_specialeffect(&sd->bl,421,AREA);
  1231.  		}
  1232.  		break;
  1233.  	case BL_MOB:
  1234.  		{
  1235.  			TBL_MOB *md = ((TBL_MOB*)bl);
  1236. -			if(md->special_state.size==2) // tiny/big mobs [Valaris]
  1237. +			if(md->special_state.size==SZ_BIG) // tiny/big mobs [Valaris]
  1238.  				clif_specialeffect(&md->bl,423,AREA);
  1239. -			else if(md->special_state.size==1)
  1240. +			else if(md->special_state.size==SZ_MEDIUM)
  1241.  				clif_specialeffect(&md->bl,421,AREA);
  1242.  		}
  1243.  		break;
  1244. @@ -3211,7 +3214,7 @@
  1245.  	fd=sd->fd;
  1246.  	WFIFOHEAD(fd, packet_len(0x013c));
  1247.  	WFIFOW(fd,0)=0x013c;
  1248. -	WFIFOW(fd,2)=val+2;//��̃A�C�e��ID
  1249. +	WFIFOW(fd,2)=val+2; //Item ID of the arrow
  1250.  	WFIFOSET(fd,packet_len(0x013c));
  1251.  }
  1252.  
  1253. @@ -4101,9 +4104,9 @@
  1254.  		{
  1255.  			TBL_PC* tsd = (TBL_PC*)bl;
  1256.  			clif_getareachar_pc(sd, tsd);
  1257. -			if(tsd->state.size==2) // tiny/big players [Valaris]
  1258. +			if(tsd->state.size==SZ_BIG) // tiny/big players [Valaris]
  1259.  				clif_specialeffect_single(bl,423,sd->fd);
  1260. -			else if(tsd->state.size==1)
  1261. +			else if(tsd->state.size==SZ_MEDIUM)
  1262.  				clif_specialeffect_single(bl,421,sd->fd);
  1263.  			if( tsd->bg_id && map[tsd->bl.m].flag.battleground )
  1264.  				clif_sendbgemblem_single(sd->fd,tsd);
  1265. @@ -12072,7 +12075,7 @@
  1266.  	}
  1267.  	if( sd->bg_id )
  1268.  	{
  1269. -		clif_displaymessage(fd, "You can't leave battleground guilds.");
  1270. +		clif_displaymessage(fd, msg_txt(670)); //"You can't leave battleground guilds."
  1271.  		return;
  1272.  	}
  1273.  
  1274. @@ -12889,7 +12892,7 @@
  1275.  	// Friend already exists
  1276.  	for (i = 0; i < MAX_FRIENDS && sd->status.friends[i].char_id != 0; i++) {
  1277.  		if (sd->status.friends[i].char_id == f_sd->status.char_id) {
  1278. -			clif_displaymessage(fd, "Friend already exists.");
  1279. +			clif_displaymessage(fd, msg_txt(671)); //"Friend already exists."
  1280.  			return;
  1281.  		}
  1282.  	}
  1283. @@ -12992,7 +12995,7 @@
  1284.  		(sd->status.friends[i].char_id != char_id || sd->status.friends[i].account_id != account_id); i++);
  1285.  
  1286.  	if (i == MAX_FRIENDS) {
  1287. -		clif_displaymessage(fd, "Name not found in list.");
  1288. +		clif_displaymessage(fd, msg_txt(672)); //"Name not found in list."
  1289.  		return;
  1290.  	}
  1291.  
  1292. @@ -13017,7 +13020,7 @@
  1293.  
  1294.  	} else { //friend not online -- ask char server to delete from his friendlist
  1295.  		if(chrif_removefriend(char_id,sd->status.char_id)) { // char-server offline, abort
  1296. -			clif_displaymessage(fd, "This action can't be performed at the moment. Please try again later.");
  1297. +			clif_displaymessage(fd, msg_txt(673)); //"This action can't be performed at the moment. Please try again later."
  1298.  			return;
  1299.  		}
  1300.  	}
  1301. @@ -13030,7 +13033,7 @@
  1302.  		memcpy(&sd->status.friends[j-1], &sd->status.friends[j], sizeof(sd->status.friends[0]));
  1303.  
  1304.  	memset(&sd->status.friends[MAX_FRIENDS-1], 0, sizeof(sd->status.friends[MAX_FRIENDS-1]));
  1305. -	clif_displaymessage(fd, "Friend removed");
  1306. +	clif_displaymessage(fd, msg_txt(674)); //"Friend removed"
  1307.  
  1308.  	WFIFOHEAD(fd,packet_len(0x20a));
  1309.  	WFIFOW(fd,0) = 0x20a;
  1310. @@ -13840,7 +13843,7 @@
  1311.  
  1312.  	if( DIFF_TICK(sd->cansendmail_tick, gettick()) > 0 )
  1313.  	{
  1314. -		clif_displaymessage(sd->fd,"Cannot send mails too fast!!.");
  1315. +		clif_displaymessage(sd->fd,msg_txt(675)); //"Cannot send mails too fast!!."
  1316.  		clif_Mail_send(fd, true); // fail
  1317.  		return;
  1318.  	}
  1319. @@ -16042,7 +16045,7 @@
  1320.  		sd->menuskill_id = SC_AUTOSHADOWSPELL;
  1321.  		sd->menuskill_val = c;
  1322.  	} else {
  1323. -		status_change_end(&sd->bl,SC_STOP,-1);
  1324. +		status_change_end(&sd->bl,SC_STOP,INVALID_TIMER);
  1325.  		clif_skill_fail(sd,SC_AUTOSHADOWSPELL,USESKILL_FAIL_IMITATION_SKILL_NONE,0);
  1326.  	}
  1327.  
  1328. Index: src/map/elemental.c
  1329. --- src/map/elemental.c Base (BASE)
  1330. +++ src/map/elemental.c Locally Modified (Based On LOCAL)
  1331. @@ -101,7 +101,7 @@
  1332.  	return 1;
  1333.  }
  1334.  
  1335. -static int elemental_summon_end(int tid, unsigned int tick, int id, intptr data) {
  1336. +static int elemental_summon_end(int tid, unsigned int tick, int id, intptr_t data) {
  1337.  	struct map_session_data *sd;
  1338.  	struct elemental_data *ed;
  1339.  
  1340. @@ -643,7 +643,7 @@
  1341.  	return 0;
  1342.  }
  1343.  
  1344. -static int elemental_ai_timer(int tid, unsigned int tick, int id, intptr data) {
  1345. +static int elemental_ai_timer(int tid, unsigned int tick, int id, intptr_t data) {
  1346.  	map_foreachpc(elemental_ai_sub_foreachclient,tick);
  1347.  
  1348.  	return 0;
  1349. Index: src/map/guild.c
  1350. --- src/map/guild.c Base (BASE)
  1351. +++ src/map/guild.c Locally Modified (Based On LOCAL)
  1352. @@ -39,12 +39,13 @@
  1353.  	struct eventlist *next;
  1354.  };
  1355.  
  1356. -// �M���h��EXP�L���b�V���̃t���b�V���Ɋ֘A����萔
  1357. -#define GUILD_SEND_XY_INVERVAL	5000	// ���W��g�o���M�̊Ԋu
  1358. -#define GUILD_PAYEXP_INVERVAL 10000	// �Ԋu(�L���b�V���̍ő吶�����ԁA�~���b)
  1359. -#define GUILD_PAYEXP_LIST 8192	// �L���b�V���̍ő吔
  1360. +//Constant related to the flash of the Guild EXP cache
  1361. +#define GUILD_SEND_XY_INVERVAL	5000 // Interval of sending coordinates and HP
  1362. +#define GUILD_PAYEXP_INVERVAL 10000 //Interval (maximum survival time of the cache, in milliseconds)
  1363. +#define GUILD_PAYEXP_LIST 8192 //The maximum number of cache
  1364.  
  1365. -// �M���h��EXP�L���b�V��
  1366. +//Guild EXP cache
  1367. +
  1368.  struct guild_expcache {
  1369.  	int guild_id, account_id, char_id;
  1370.  	uint64 exp;
  1371. @@ -91,10 +92,10 @@
  1372.  	return guild_skill_tree[id-GD_SKILLBASE].max;
  1373.  }
  1374.  
  1375. -// �M���h�X�L�������邩�m�F
  1376. -int guild_checkskill(struct guild *g,int id)
  1377. -{
  1378. -	int idx = id-GD_SKILLBASE;
  1379. +// Retrive skilllv learned by guild
  1380. +
  1381. +int guild_checkskill(struct guild *g, int id) {
  1382. +    int idx = id - GD_SKILLBASE;
  1383.  	if (idx < 0 || idx >= MAX_GUILDSKILL)
  1384.  		return 0;
  1385.  	return g->skill[idx].lv;
  1386. @@ -261,7 +262,7 @@
  1387.  	return( i < g->max_member ) ? g->member[i].position : -1;
  1388.  }
  1389.  
  1390. -// �����o�[���̍쐬
  1391. +//Creation of member information
  1392.  void guild_makemember(struct guild_member *m,struct map_session_data *sd)
  1393.  {
  1394.  	nullpo_retv(sd);
  1395. @@ -283,7 +284,7 @@
  1396.  }
  1397.  
  1398.  /**
  1399. - *  �M���h��EXP�L���b�V����inter�I�Ƀt���b�V������
  1400. + * Server cache to be flushed to inter the Guild EXP
  1401.   * @see DBApply
  1402.   */
  1403.  int guild_payexp_timer_sub(DBKey key, DBData *data, va_list ap) {
  1404. @@ -392,7 +393,7 @@
  1405.  	return 1;
  1406.  }
  1407.  
  1408. -// �쐬�”�
  1409. +//Whether or not to create guilde
  1410.  int guild_created(int account_id,int guild_id)
  1411.  {
  1412.  	struct map_session_data *sd=map_id2sd(account_id);
  1413. @@ -400,7 +401,7 @@
  1414.  	if(sd==NULL)
  1415.  		return 0;
  1416.  	if(!guild_id) {
  1417. -		clif_guild_created(sd,2);	// �쐬���s�i�����M���h���݁j
  1418. +        clif_guild_created(sd, 2); // Creation failure (presence of the same name Guild)
  1419.  		return 0;
  1420.  	}
  1421.  	//struct guild *g;
  1422. @@ -411,13 +412,13 @@
  1423.  	return 0;
  1424.  }
  1425.  
  1426. -// ���v��
  1427. +//Information request
  1428.  int guild_request_info(int guild_id)
  1429.  {
  1430.  	return intif_guild_request_info(guild_id);
  1431.  }
  1432.  
  1433. -// �C�x���g�t�����v��
  1434. +//Information request with event
  1435.  int guild_npc_request_info(int guild_id,const char *event)
  1436.  {
  1437.  	if( guild_search(guild_id) )
  1438. @@ -442,7 +443,7 @@
  1439.  	return guild_request_info(guild_id);
  1440.  }
  1441.  
  1442. -// �����L�����̊m�F
  1443. +//Confirmation of the character belongs to guild
  1444.  int guild_check_member(struct guild *g)
  1445.  {
  1446.  	int i;
  1447. @@ -469,7 +470,7 @@
  1448.  	return 0;
  1449.  }
  1450.  
  1451. -// ��񏊓����s�i����ID�̃L������S���������ɂ���j
  1452. +//Delete association with guild_id for all characters
  1453.  int guild_recv_noinfo(int guild_id)
  1454.  {
  1455.  	struct map_session_data *sd;
  1456. @@ -486,7 +487,7 @@
  1457.  	return 0;
  1458.  }
  1459.  
  1460. -// ��񏊓�
  1461. +//Get and display information for all member
  1462.  int guild_recv_info(struct guild *sg)
  1463.  {
  1464.  	struct guild *g,before;
  1465. @@ -504,7 +505,7 @@
  1466.  		idb_put(guild_db,sg->guild_id,g);
  1467.  		before=*sg;
  1468.  
  1469. -		// �ŏ��̃��[�h�Ȃ̂Ń��[�U�[�̃`�F�b�N���s��
  1470. +        //Perform the check on the user because the first load
  1471.  		guild_check_member(sg);
  1472.  		if ((sd = map_nick2sd(sg->master)) != NULL)
  1473.  		{
  1474. @@ -539,32 +540,32 @@
  1475.  			bm++;
  1476.  	}
  1477.  
  1478. -	for(i=0;i<g->max_member;i++){	// ���̑��M
  1479. +    for (i = 0; i < g->max_member; i++) { //Transmission of information at all members
  1480.  		sd = g->member[i].sd;
  1481.  		if( sd==NULL )
  1482.  			continue;
  1483.  
  1484. -		if(	before.guild_lv!=g->guild_lv || bm!=m ||
  1485. -			before.max_member!=g->max_member ){
  1486. -			clif_guild_basicinfo(sd);	// ��{��񑗐M
  1487. -			clif_guild_emblem(sd,g);	// �G���u�������M
  1488. +        if (before.guild_lv != g->guild_lv || bm != m ||
  1489. +                before.max_member != g->max_member) {
  1490. +            clif_guild_basicinfo(sd); //Submit basic information
  1491. +            clif_guild_emblem(sd, g); //Submit emblem
  1492.  		}
  1493.  
  1494. -		if(bm!=m){		// �����o�[��񑗐M
  1495. +        if (bm != m) { //Send members information
  1496.  			clif_guild_memberlist(g->member[i].sd);
  1497.  		}
  1498.  
  1499. -		if( before.skill_point!=g->skill_point)
  1500. -			clif_guild_skillinfo(sd);	// �X�L����񑗐M
  1501. +        if (before.skill_point != g->skill_point)
  1502. +            clif_guild_skillinfo(sd); //Submit information skills
  1503.  
  1504. -		if( guild_new ){	// �����M�Ȃ珊����������
  1505. -			clif_guild_belonginfo(sd,g);
  1506. -			clif_guild_notice(sd,g);
  1507. -			sd->guild_emblem_id=g->emblem_id;
  1508. +        if (guild_new) { // Send information and affiliation if unsent
  1509. +            clif_guild_belonginfo(sd, g);
  1510. +            clif_guild_notice(sd, g);
  1511. +            sd->guild_emblem_id = g->emblem_id;
  1512.  		}
  1513.  	}
  1514.  
  1515. -	// �C�x���g�̔���
  1516. +    //Occurrence of an event
  1517.  	if (guild_infoevent_db->remove(guild_infoevent_db, db_i2key(sg->guild_id), &data))
  1518.  	{
  1519.  		struct eventlist *ev = db_data2ptr(&data), *ev2;
  1520. @@ -579,10 +580,10 @@
  1521.  	return 0;
  1522.  }
  1523.  
  1524. -
  1525. -// �M���h�ւ̊��U
  1526. -int guild_invite(struct map_session_data *sd,struct map_session_data *tsd)
  1527. -{
  1528. +/*=============================================
  1529. + * Player sd send a guild invatation to player tsd to join his guild
  1530. + *--------------------------------------------*/
  1531. +int guild_invite(struct map_session_data *sd, struct map_session_data *tsd) {
  1532.  	struct guild *g;
  1533.  	int i;
  1534.  
  1535. @@ -597,7 +598,7 @@
  1536.  		return 0; //Invite permission.
  1537.  
  1538.  	if(!battle_config.invite_request_check) {
  1539. -		if (tsd->party_invite>0 || tsd->trade_partner || tsd->adopt_invite ) {	// ���肪����ǂ���
  1540. +        if (tsd->party_invite > 0 || tsd->trade_partner || tsd->adopt_invite) { //checking if there no other invitation pending
  1541.  			clif_guild_inviteack(sd,0);
  1542.  			return 0;
  1543.  		}
  1544. @@ -616,7 +617,7 @@
  1545.  		return 0;
  1546.  	}
  1547.  
  1548. -	// ����m�F
  1549. +    //search an empty spot in guild
  1550.  	ARR_FIND( 0, g->max_member, i, g->member[i].account_id == 0 );
  1551.  	if(i==g->max_member){
  1552.  		clif_guild_inviteack(sd,3);
  1553. @@ -714,7 +715,9 @@
  1554.  		g->member[i].sd = sd;
  1555.  }
  1556.  
  1557. -// �M���h�����o���lj����ꂽ
  1558. +/*==========================================
  1559. + * Add a player to a given guild_id
  1560. + *----------------------------------------*/
  1561.  int guild_member_added(int guild_id,int account_id,int char_id,int flag)
  1562.  {
  1563.  	struct map_session_data *sd= map_id2sd(account_id),*sd2;
  1564. @@ -724,7 +727,7 @@
  1565.  		return 0;
  1566.  
  1567.  	if(sd==NULL || sd->guild_invite==0){
  1568. -		// �L�������ɓo�^�ł��Ȃ��������ߒE�ޗv�����o��
  1569. +        // cancel if player not present or invalide guild_id invitation
  1570.  		if (flag == 0) {
  1571.  			ShowError("guild: member added error %d is not online\n",account_id);
  1572.   			intif_guild_leave(guild_id,account_id,char_id,0,"** Data Error **");
  1573. @@ -735,13 +738,13 @@
  1574.  	sd->guild_invite = 0;
  1575.  	sd->guild_invite_account = 0;
  1576.  
  1577. -	if(flag==1){	// ���s
  1578. +    if (flag == 1) { //failure
  1579.  		if( sd2!=NULL )
  1580.  			clif_guild_inviteack(sd2,3);
  1581.  		return 0;
  1582.  	}
  1583.  
  1584. -		// ����
  1585. +    //if all ok adding player to guild
  1586.  	sd->status.guild_id = g->guild_id;
  1587.  	sd->guild_emblem_id = g->emblem_id;
  1588.  	//Packets which were sent in the previous 'guild_sent' implementation.
  1589. @@ -759,7 +762,9 @@
  1590.  	return 0;
  1591.  }
  1592.  
  1593. -// �M���h�E�ޗv��
  1594. +/*==========================================
  1595. + * Player request leaving a given guild_id
  1596. + *----------------------------------------*/
  1597.  int guild_leave(struct map_session_data* sd, int guild_id, int account_id, int char_id, const char* mes)
  1598.  {
  1599.  	struct guild *g;
  1600. @@ -780,7 +785,9 @@
  1601.  	return 0;
  1602.  }
  1603.  
  1604. -// �M���h�Ǖ�v��
  1605. +/*==========================================
  1606. + * Request remove a player to a given guild_id
  1607. + *----------------------------------------*/
  1608.  int guild_expulsion(struct map_session_data* sd, int guild_id, int account_id, int char_id, const char* mes)
  1609.  {
  1610.  	struct map_session_data *tsd;
  1611. @@ -917,7 +924,7 @@
  1612.  	}
  1613.  
  1614.  	if(idx == -1 || c == 0) {
  1615. -		// �M���h�̃����o�[�O�Ȃ̂ŒǕ�����
  1616. +        //Treat char_id who doesn't match guild_id (not found as member)
  1617.  		struct map_session_data *sd = map_id2sd(account_id);
  1618.  		if(sd && sd->status.char_id == char_id) {
  1619.  			sd->status.guild_id=0;
  1620. @@ -953,7 +960,10 @@
  1621.  
  1622.  	return 0;
  1623.  }
  1624. -// �M���h��b���M
  1625. +
  1626. +/*====================================================
  1627. + * Send a message to whole guild
  1628. + *---------------------------------------------------*/
  1629.  int guild_send_message(struct map_session_data *sd,const char *mes,int len)
  1630.  {
  1631.  	nullpo_ret(sd);
  1632. @@ -968,7 +978,10 @@
  1633.  
  1634.  	return 0;
  1635.  }
  1636. -// �M���h��b��M
  1637. +
  1638. +/*====================================================
  1639. + * Guild receive a message, will be displayed to whole member
  1640. + *---------------------------------------------------*/
  1641.  int guild_recv_message(int guild_id,int account_id,const char *mes,int len)
  1642.  {
  1643.  	struct guild *g;
  1644. @@ -977,12 +990,18 @@
  1645.  	clif_guild_message(g,account_id,mes,len);
  1646.  	return 0;
  1647.  }
  1648. -// �M���h�����o�̖�E�ύX
  1649. +
  1650. +/*====================================================
  1651. + * Member changing position in guild
  1652. + *---------------------------------------------------*/
  1653.  int guild_change_memberposition(int guild_id,int account_id,int char_id,short idx)
  1654.  {
  1655.  	return intif_guild_change_memberinfo(guild_id,account_id,char_id,GMI_POSITION,&idx,sizeof(idx));
  1656.  }
  1657. -// �M���h�����o�̖�E�ύX�ʒm
  1658. +
  1659. +/*====================================================
  1660. + * Notification of new position for member
  1661. + *---------------------------------------------------*/
  1662.  int guild_memberposition_changed(struct guild *g,int idx,int pos)
  1663.  {
  1664.  	nullpo_ret(g);
  1665. @@ -995,7 +1014,10 @@
  1666.  		clif_charnameupdate(g->member[idx].sd);
  1667.  	return 0;
  1668.  }
  1669. -// �M���h��E�ύX
  1670. +
  1671. +/*====================================================
  1672. + * Change guild title or member
  1673. + *---------------------------------------------------*/
  1674.  int guild_change_position(int guild_id,int idx,
  1675.  	int mode,int exp_mode,const char *name)
  1676.  {
  1677. @@ -1009,7 +1031,10 @@
  1678.  	safestrncpy(p.name,name,NAME_LENGTH);
  1679.  	return intif_guild_position(guild_id,idx,&p);
  1680.  }
  1681. -// �M���h��E�ύX�ʒm
  1682. +
  1683. +/*====================================================
  1684. + * Notification of member has changed his guild tiltle
  1685. + *---------------------------------------------------*/
  1686.  int guild_position_changed(int guild_id,int idx,struct guild_position *p)
  1687.  {
  1688.  	struct guild *g=guild_search(guild_id);
  1689. @@ -1025,7 +1050,10 @@
  1690.  			clif_charnameupdate(g->member[i].sd);
  1691.  	return 0;
  1692.  }
  1693. -// �M���h���m�ύX
  1694. +
  1695. +/*====================================================
  1696. + * Change guild notice
  1697. + *---------------------------------------------------*/
  1698.  int guild_change_notice(struct map_session_data *sd,int guild_id,const char *mes1,const char *mes2)
  1699.  {
  1700.  	nullpo_ret(sd);
  1701. @@ -1034,7 +1062,10 @@
  1702.  		return 0;
  1703.  	return intif_guild_notice(guild_id,mes1,mes2);
  1704.  }
  1705. -// �M���h���m�ύX�ʒm
  1706. +
  1707. +/*====================================================
  1708. + * Notification of guild has changed his notice
  1709. + *---------------------------------------------------*/
  1710.  int guild_notice_changed(int guild_id,const char *mes1,const char *mes2)
  1711.  {
  1712.  	int i;
  1713. @@ -1052,7 +1083,10 @@
  1714.  	}
  1715.  	return 0;
  1716.  }
  1717. -// �M���h�G���u�����ύX
  1718. +
  1719. +/*====================================================
  1720. + * Change guild emblem
  1721. + *---------------------------------------------------*/
  1722.  int guild_change_emblem(struct map_session_data *sd,int len,const char *data)
  1723.  {
  1724.  	struct guild *g;
  1725. @@ -1066,7 +1100,10 @@
  1726.  
  1727.  	return intif_guild_emblem(sd->status.guild_id,len,data);
  1728.  }
  1729. -// �M���h�G���u�����ύX�ʒm
  1730. +
  1731. +/*====================================================
  1732. + * Notification of guild emblem changed
  1733. + *---------------------------------------------------*/
  1734.  int guild_emblem_changed(int len,int guild_id,int emblem_id,const char *data)
  1735.  {
  1736.  	int i;
  1737. @@ -1146,7 +1183,9 @@
  1738.  	return db_ptr2data(c);
  1739.  }
  1740.  
  1741. -// �M���h��EXP��[
  1742. +/*====================================================
  1743. + * return Taxed experience from player sd to guild
  1744. + *---------------------------------------------------*/
  1745.  unsigned int guild_payexp(struct map_session_data *sd,unsigned int exp)
  1746.  {
  1747.  	struct guild *g;
  1748. @@ -1178,7 +1217,11 @@
  1749.  	return exp;
  1750.  }
  1751.  
  1752. -// Celest
  1753. +/*====================================================
  1754. + * Player sd  pay a tribue experience exp to his guild
  1755. + * Add this experience to guild exp
  1756. + * [Celest]
  1757. + *---------------------------------------------------*/
  1758.  int guild_getexp(struct map_session_data *sd,int exp)
  1759.  {
  1760.  	struct guild_expcache *c;
  1761. @@ -1195,7 +1238,9 @@
  1762.  	return exp;
  1763.  }
  1764.  
  1765. -// �X�L���|�C���g����U��
  1766. +/*====================================================
  1767. + * Ask to increase guildskill skill_num
  1768. + *---------------------------------------------------*/
  1769.  int guild_skillup(TBL_PC* sd, int skill_num)
  1770.  {
  1771.  	struct guild* g;
  1772. @@ -1216,7 +1261,10 @@
  1773.  
  1774.  	return 0;
  1775.  }
  1776. -// �X�L���|�C���g����U��ʒm
  1777. +
  1778. +/*====================================================
  1779. + * Notification of guildskill skill_num increase request
  1780. + *---------------------------------------------------*/
  1781.  int guild_skillupack(int guild_id,int skill_num,int account_id)
  1782.  {
  1783.  	struct map_session_data *sd=map_id2sd(account_id);
  1784. @@ -1238,13 +1286,14 @@
  1785.  		}
  1786.  	}
  1787.  
  1788. -	// �S���ɒʒm
  1789. +	// Inform all members
  1790.  	for(i=0;i<g->max_member;i++)
  1791.  		if((sd=g->member[i].sd)!=NULL)
  1792.  			clif_guild_skillinfo(sd);
  1793.  
  1794.  	return 0;
  1795.  }
  1796. +
  1797.  void guild_guildaura_refresh(struct map_session_data *sd, int skill_num, int skill_lv) {
  1798.  	struct skill_unit_group* group = NULL;
  1799.  	int type = status_skill2sc(skill_num);
  1800. @@ -1263,7 +1312,13 @@
  1801.  	}
  1802.  	return;
  1803.  }
  1804. -// �M���h����������
  1805. +
  1806. +/*====================================================
  1807. + * Count number of relation the guild have
  1808. + * flag :
  1809. + *		0 = allied
  1810. + *		1 = ennemy
  1811. + *---------------------------------------------------*/
  1812.  int guild_get_alliance_count(struct guild *g,int flag)
  1813.  {
  1814.  	int i,c;
  1815. @@ -1287,8 +1342,13 @@
  1816.  		skill_blockpc_start_(sd, skill_num[i], time , true);
  1817.  }
  1818.  
  1819. -// �����֌W���ǂ����`�F�b�N
  1820. -// �����Ȃ�1�A����ȊO��0
  1821. +/*====================================================
  1822. + * Check relation between guild_id1 and guild_id2
  1823. + * flag :
  1824. + *		0 = allied
  1825. + *		1 = ennemy
  1826. + * return true if yes
  1827. + *---------------------------------------------------*/
  1828.  int guild_check_alliance(int guild_id1, int guild_id2, int flag)
  1829.  {
  1830.  	struct guild *g;
  1831. @@ -1302,14 +1362,16 @@
  1832.  	return( i < MAX_GUILDALLIANCE ) ? 1 : 0;
  1833.  }
  1834.  
  1835. -// �M���h�����v��
  1836. +/*====================================================
  1837. + * Player sd, asking player tsd an alliance between there 2 guild
  1838. + *---------------------------------------------------*/
  1839.  int guild_reqalliance(struct map_session_data *sd,struct map_session_data *tsd)
  1840.  {
  1841.  	struct guild *g[2];
  1842.  	int i;
  1843.  
  1844.  	if(agit_flag || agit2_flag)	{	// Disable alliance creation during woe [Valaris]
  1845. -		clif_displaymessage(sd->fd,"Alliances cannot be made during Guild Wars!");
  1846. +		clif_displaymessage(sd->fd,msg_txt(676)); //"Alliances cannot be made during Guild Wars!"
  1847.  		return 0;
  1848.  	}	// end addition [Valaris]
  1849.  
  1850. @@ -1343,7 +1405,7 @@
  1851.  		return 0;
  1852.  	}
  1853.  
  1854. -	for(i=0;i<MAX_GUILDALLIANCE;i++){	// ���łɓ�����Ԃ��m�F
  1855. +    for (i = 0; i < MAX_GUILDALLIANCE; i++) { // check if already allied
  1856.  		if(	g[0]->alliance[i].guild_id==tsd->status.guild_id &&
  1857.  			g[0]->alliance[i].opposition==0){
  1858.  			clif_guild_allianceack(sd,0);
  1859. @@ -1357,7 +1419,10 @@
  1860.  	clif_guild_reqalliance(tsd,sd->status.account_id,g[0]->name);
  1861.  	return 0;
  1862.  }
  1863. -// �M���h���U�ւ̕ԓ�
  1864. +
  1865. +/*====================================================
  1866. + * Player sd, awsser to player tsd (account_id) for an alliance request
  1867. + *---------------------------------------------------*/
  1868.  int guild_reply_reqalliance(struct map_session_data *sd,int account_id,int flag)
  1869.  {
  1870.  	struct map_session_data *tsd;
  1871. @@ -1369,13 +1434,13 @@
  1872.  		return 0;
  1873.  	}
  1874.  
  1875. -	if(sd->guild_alliance!=tsd->status.guild_id)	// ���U�ƃM���hID���Ⴄ
  1876. +    if (sd->guild_alliance != tsd->status.guild_id) // proposed guild_id alliance doesn't match tsd guildid
  1877.  		return 0;
  1878.  
  1879. -	if(flag==1){	// ����
  1880. +    if (flag == 1) { // consent
  1881.  		int i;
  1882.  
  1883. -		struct guild *g,*tg;	// �������Ċm�F
  1884. +        struct guild *g, *tg; // Reconfirm the number of alliance
  1885.  		g=guild_search(sd->status.guild_id);
  1886.  		tg=guild_search(tsd->status.guild_id);
  1887.  
  1888. @@ -1403,11 +1468,11 @@
  1889.  					tsd->status.account_id,sd->status.account_id,9 );
  1890.  		}
  1891.  
  1892. -		// inter�I�֓����v��
  1893. +        // inform other servers
  1894.  		intif_guild_alliance( sd->status.guild_id,tsd->status.guild_id,
  1895.  			sd->status.account_id,tsd->status.account_id,0 );
  1896.  		return 0;
  1897. -	}else{		// ����
  1898. +    } else { // deny
  1899.  		sd->guild_alliance=0;
  1900.  		sd->guild_alliance_account=0;
  1901.  		if(tsd!=NULL)
  1902. @@ -1416,13 +1481,15 @@
  1903.  	return 0;
  1904.  }
  1905.  
  1906. -// �M���h�֌W����
  1907. +/*====================================================
  1908. + * Player sd asking to break alliance with guild guild_id
  1909. + *---------------------------------------------------*/
  1910.  int guild_delalliance(struct map_session_data *sd,int guild_id,int flag)
  1911.  {
  1912.  	nullpo_ret(sd);
  1913.  
  1914.  	if(agit_flag || agit2_flag)	{	// Disable alliance breaking during woe [Valaris]
  1915. -		clif_displaymessage(sd->fd,"Alliances cannot be broken during Guild Wars!");
  1916. +		clif_displaymessage(sd->fd,msg_txt(677)); //"Alliances cannot be broken during Guild Wars!"
  1917.  		return 0;
  1918.  	}	// end addition [Valaris]
  1919.  
  1920. @@ -1430,7 +1497,9 @@
  1921.  	return 0;
  1922.  }
  1923.  
  1924. -// �M���h�G��
  1925. +/*====================================================
  1926. + * Player sd, asking player tsd a formal ennemy relation between there 2 guild
  1927. + *---------------------------------------------------*/
  1928.  int guild_opposition(struct map_session_data *sd,struct map_session_data *tsd)
  1929.  {
  1930.  	struct guild *g;
  1931. @@ -1451,9 +1520,9 @@
  1932.  		return 0;
  1933.  	}
  1934.  
  1935. -	for(i=0;i<MAX_GUILDALLIANCE;i++){	// ���łɊ֌W�������Ă��邩�m�F
  1936. +    for (i = 0; i < MAX_GUILDALLIANCE; i++) { // checking relations
  1937.  		if(g->alliance[i].guild_id==tsd->status.guild_id){
  1938. -			if(g->alliance[i].opposition==1){	// ���łɓG��
  1939. +            if (g->alliance[i].opposition == 1) { // check if not already hostile
  1940.  				clif_guild_oppositionack(sd,2);
  1941.  				return 0;
  1942.  			}
  1943. @@ -1465,13 +1534,15 @@
  1944.  		}
  1945.  	}
  1946.  
  1947. -	// inter�I�ɓG�Ηv��
  1948. +    // inform other serv
  1949.  	intif_guild_alliance( sd->status.guild_id,tsd->status.guild_id,
  1950.  			sd->status.account_id,tsd->status.account_id,1 );
  1951.  	return 0;
  1952.  }
  1953.  
  1954. -// �M���h����/�G�Βʒm
  1955. +/*====================================================
  1956. + * Notification of a relationship between 2 guild
  1957. + *---------------------------------------------------*/
  1958.  int guild_allianceack(int guild_id1,int guild_id2,int account_id1,int account_id2,int flag,const char *name1,const char *name2)
  1959.  {
  1960.  	struct guild *g[2];
  1961. @@ -1495,14 +1566,14 @@
  1962.  		sd[0]->guild_alliance_account=0;
  1963.  	}
  1964.  
  1965. -	if(flag&0x70){	// ���s
  1966. +    if (flag & 0x70) { // failure
  1967.  		for(i=0;i<2-(flag&1);i++)
  1968.  			if( sd[i]!=NULL )
  1969.  				clif_guild_allianceack(sd[i],((flag>>4)==i+1)?3:4);
  1970.  		return 0;
  1971.  	}
  1972.  
  1973. -	if(!(flag&0x08)){	// �֌W�lj�
  1974. +    if (!(flag & 0x08)) { // new relationship
  1975.  		for(i=0;i<2-(flag&1);i++)
  1976.  		{
  1977.  			if(g[i]!=NULL)
  1978. @@ -1516,7 +1587,7 @@
  1979.  				}
  1980.  			}
  1981.  		}
  1982. -	}else{				// �֌W����
  1983. +    } else { // remove relationship
  1984.  		for(i=0;i<2-(flag&1);i++)
  1985.  		{
  1986.  			if(g[i]!=NULL)
  1987. @@ -1525,21 +1596,21 @@
  1988.  				if( j < MAX_GUILDALLIANCE )
  1989.  					g[i]->alliance[j].guild_id = 0;
  1990.  			}
  1991. -			if( sd[i]!=NULL )	// �����ʒm
  1992. +            if (sd[i] != NULL) // notify players
  1993.  				clif_guild_delalliance(sd[i],guild_id[1-i],(flag&1));
  1994.  		}
  1995.  	}
  1996.  
  1997. -	if((flag&0x0f)==0){			// �����ʒm
  1998. +    if ((flag & 0x0f) == 0) { // alliance notification
  1999.  		if( sd[1]!=NULL )
  2000.  			clif_guild_allianceack(sd[1],2);
  2001. -	}else if((flag&0x0f)==1){	// �G�Βʒm
  2002. +    } else if ((flag & 0x0f) == 1) { // ennemy notification
  2003.  		if( sd[0]!=NULL )
  2004.  			clif_guild_oppositionack(sd[0],0);
  2005.  	}
  2006.  
  2007.  
  2008. -	for(i=0;i<2-(flag&1);i++){	// ����/�G�΃��X�g�̍đ��M
  2009. +    for (i = 0; i < 2 - (flag & 1); i++) { // Retransmission of the relationship list to all members
  2010.  		struct map_session_data *sd;
  2011.  		if(g[i]!=NULL)
  2012.  			for(j=0;j<g[i]->max_member;j++)
  2013. @@ -1550,7 +1621,7 @@
  2014.  }
  2015.  
  2016.  /**
  2017. - * �M���h���U�ʒm�p
  2018. + * Notification for the guild disbanded
  2019.   * @see DBApply
  2020.   */
  2021.  int guild_broken_sub(DBKey key, DBData *data, va_list ap)
  2022. @@ -1562,7 +1633,7 @@
  2023.  
  2024.  	nullpo_ret(g);
  2025.  
  2026. -	for(i=0;i<MAX_GUILDALLIANCE;i++){	// �֌W��j��
  2027. +	for(i=0;i<MAX_GUILDALLIANCE;i++){	// Destroy all relationships
  2028.  		if(g->alliance[i].guild_id==guild_id){
  2029.  			for(j=0;j<g->max_member;j++)
  2030.  				if( (sd=g->member[j].sd)!=NULL )
  2031. @@ -1608,7 +1679,7 @@
  2032.  	if(flag!=0 || g==NULL)
  2033.  		return 0;
  2034.  
  2035. -	for(i=0;i<g->max_member;i++){	// �M���h���U��ʒm
  2036. +	for(i=0;i<g->max_member;i++){	// Destroy all relationships
  2037.  		if((sd=g->member[i].sd)!=NULL){
  2038.  			if(sd->state.storage_flag == 2)
  2039.  				storage_guild_storage_quit(sd,1);
  2040. @@ -1675,13 +1746,13 @@
  2041.  
  2042.  	if (g->member[pos].sd && g->member[pos].sd->fd)
  2043.  	{
  2044. -		clif_displaymessage(g->member[pos].sd->fd, "You no longer are the Guild Master.");
  2045. +		clif_displaymessage(g->member[pos].sd->fd, msg_txt(678)); //"You no longer are the Guild Master."
  2046.  		g->member[pos].sd->state.gmaster_flag = 0;
  2047.  	}
  2048.  
  2049.  	if (g->member[0].sd && g->member[0].sd->fd)
  2050.  	{
  2051. -		clif_displaymessage(g->member[0].sd->fd, "You have become the Guild Master!");
  2052. +		clif_displaymessage(g->member[0].sd->fd, msg_txt(679)); //"You have become the Guild Master!"
  2053.  		g->member[0].sd->state.gmaster_flag = g;
  2054.  		//Block his skills for 5 minutes to prevent abuse.
  2055.  		guild_block_skill(g->member[0].sd, 300000);
  2056. @@ -1700,7 +1771,9 @@
  2057.  	return 1;
  2058.  }
  2059.  
  2060. -// �M���h���U
  2061. +/*====================================================
  2062. + * Guild disbanded
  2063. + *---------------------------------------------------*/
  2064.  int guild_break(struct map_session_data *sd,char *name)
  2065.  {
  2066.  	struct guild *g;
  2067. @@ -1850,7 +1923,7 @@
  2068.  	}
  2069.  }
  2070.  
  2071. -// �M���h�f�[�^�ꊇ��M�i�����j
  2072. +// Loadcastle data then invoque OnAgitInit* on last
  2073.  int guild_castledataloadack(int len, struct guild_castle *gc)
  2074.  {
  2075.  	int i;
  2076. @@ -1893,6 +1966,9 @@
  2077.  	return 0;
  2078.  }
  2079.  
  2080. +/*====================================================
  2081. + * Start normal woe and triggers all npc OnAgitStart
  2082. + *---------------------------------------------------*/
  2083.  int guild_agit_start(void)
  2084.  {	// Run All NPC_Event[OnAgitStart]
  2085.  	int c = npc_event_doall("OnAgitStart");
  2086. @@ -1900,6 +1976,9 @@
  2087.  	return 0;
  2088.  }
  2089.  
  2090. +/*====================================================
  2091. + * End normal woe and triggers all npc OnAgitEnd
  2092. + *---------------------------------------------------*/
  2093.  int guild_agit_end(void)
  2094.  {	// Run All NPC_Event[OnAgitEnd]
  2095.  	int c = npc_event_doall("OnAgitEnd");
  2096. @@ -1907,6 +1986,9 @@
  2097.  	return 0;
  2098.  }
  2099.  
  2100. +/*====================================================
  2101. + * Start woe2 and triggers all npc OnAgitStart2
  2102. + *---------------------------------------------------*/
  2103.  int guild_agit2_start(void)
  2104.  {	// Run All NPC_Event[OnAgitStart2]
  2105.  	int c = npc_event_doall("OnAgitStart2");
  2106. @@ -1914,6 +1996,9 @@
  2107.  	return 0;
  2108.  }
  2109.  
  2110. +/*====================================================
  2111. + * End woe2 and triggers all npc OnAgitEnd2
  2112. + *---------------------------------------------------*/
  2113.  int guild_agit2_end(void)
  2114.  {	// Run All NPC_Event[OnAgitEnd2]
  2115.  	int c = npc_event_doall("OnAgitEnd2");
  2116. Index: src/map/intif.c
  2117. --- src/map/intif.c Base (BASE)
  2118. +++ src/map/intif.c Locally Modified (Based On LOCAL)
  2119. @@ -46,11 +46,11 @@
  2120.  	-1,-1, 7, 3,  0, 0, 0, 0,  0, 0, 0, 0,  0, 0,  0, 0, //0x3890  Homunculus [albator]
  2121.  };
  2122.  
  2123. -extern int char_fd;		// inter server��fd��char_fd���g��
  2124. -#define inter_fd char_fd	// �G�C���A�X
  2125. +extern int char_fd; // inter server Fd used for char_fd
  2126. +#define inter_fd char_fd	// alias
  2127.  
  2128.  //-----------------------------------------------------------------
  2129. -// inter server�ւ̑��M
  2130. +// Send to inter server 
  2131.  
  2132.  int CheckForCharServer(void)
  2133.  {
  2134. @@ -136,7 +136,7 @@
  2135.  	return 0;
  2136.  }
  2137.  
  2138. -// GM���b�Z�[�W�𑗐M
  2139. +// GM Send a message
  2140.  int intif_broadcast(const char* mes, int len, int type)
  2141.  {
  2142.  	int lp = type ? 4 : 0;
  2143. @@ -386,7 +386,7 @@
  2144.  	return 0;
  2145.  }
  2146.  
  2147. -// �p�[�e�B�쐬�v��
  2148. +// Party creation request
  2149.  int intif_create_party(struct party_member *member,char *name,int item,int item2)
  2150.  {
  2151.  	if (CheckForCharServer())
  2152. @@ -403,7 +403,8 @@
  2153.  	WFIFOSET(inter_fd,WFIFOW(inter_fd, 2));
  2154.  	return 0;
  2155.  }
  2156. -// �p�[�e�B���v��
  2157. +
  2158. +// Party information request
  2159.  int intif_request_partyinfo(int party_id, int char_id)
  2160.  {
  2161.  	if (CheckForCharServer())
  2162. @@ -415,7 +416,8 @@
  2163.  	WFIFOSET(inter_fd,10);
  2164.  	return 0;
  2165.  }
  2166. -// �p�[�e�B�lj��v��
  2167. +
  2168. +// Request to add a member to party 
  2169.  int intif_party_addmember(int party_id,struct party_member *member)
  2170.  {
  2171.  	if (CheckForCharServer())
  2172. @@ -428,7 +430,8 @@
  2173.  	WFIFOSET(inter_fd,WFIFOW(inter_fd, 2));
  2174.  	return 1;
  2175.  }
  2176. -// �p�[�e�B�ݒ�ύX
  2177. +
  2178. +// Request to change party configuration (exp,item share)
  2179.  int intif_party_changeoption(int party_id,int account_id,int exp,int item)
  2180.  {
  2181.  	if (CheckForCharServer())
  2182. @@ -442,7 +445,8 @@
  2183.  	WFIFOSET(inter_fd,14);
  2184.  	return 0;
  2185.  }
  2186. -// �p�[�e�B�E�ޗv��
  2187. +
  2188. +// Request to leave party
  2189.  int intif_party_leave(int party_id,int account_id, int char_id)
  2190.  {
  2191.  	if (CheckForCharServer())
  2192. @@ -455,7 +459,8 @@
  2193.  	WFIFOSET(inter_fd,14);
  2194.  	return 0;
  2195.  }
  2196. -// �p�[�e�B�ړ��v��
  2197. +
  2198. +// Request keeping party for new map ?? 
  2199.  int intif_party_changemap(struct map_session_data *sd,int online)
  2200.  {
  2201.  	int m, mapindex;
  2202. @@ -481,7 +486,8 @@
  2203.  	WFIFOSET(inter_fd,19);
  2204.  	return 1;
  2205.  }
  2206. -// �p�[�e�B�[���U�v��
  2207. +
  2208. +// Request breaking party 
  2209.  int intif_break_party(int party_id)
  2210.  {
  2211.  	if (CheckForCharServer())
  2212. @@ -492,7 +498,8 @@
  2213.  	WFIFOSET(inter_fd,6);
  2214.  	return 0;
  2215.  }
  2216. -// �p�[�e�B��b���M
  2217. +
  2218. +// Sending party chat
  2219.  int intif_party_message(int party_id,int account_id,const char *mes,int len)
  2220.  {
  2221.  	if (CheckForCharServer())
  2222. @@ -511,6 +518,7 @@
  2223.  	return 0;
  2224.  }
  2225.  
  2226. +// Request a new leader for party
  2227.  int intif_party_leaderchange(int party_id,int account_id,int char_id)
  2228.  {
  2229.  	if (CheckForCharServer())
  2230. @@ -524,8 +532,7 @@
  2231.  	return 0;
  2232.  }
  2233.  
  2234. -
  2235. -// �M���h�쐬�v��
  2236. +// Request a Guild creation
  2237.  int intif_guild_create(const char *name,const struct guild_member *master)
  2238.  {
  2239.  	if (CheckForCharServer())
  2240. @@ -541,7 +548,8 @@
  2241.  	WFIFOSET(inter_fd,WFIFOW(inter_fd,2));
  2242.  	return 0;
  2243.  }
  2244. -// �M���h���v��
  2245. +
  2246. +// Request Guild information
  2247.  int intif_guild_request_info(int guild_id)
  2248.  {
  2249.  	if (CheckForCharServer())
  2250. @@ -552,7 +560,8 @@
  2251.  	WFIFOSET(inter_fd,6);
  2252.  	return 0;
  2253.  }
  2254. -// �M���h�����o�lj��v��
  2255. +
  2256. +// Request to add member to the guild
  2257.  int intif_guild_addmember(int guild_id,struct guild_member *m)
  2258.  {
  2259.  	if (CheckForCharServer())
  2260. @@ -566,6 +575,7 @@
  2261.  	return 0;
  2262.  }
  2263.  
  2264. +// Request a new leader for guild
  2265.  int intif_guild_change_gm(int guild_id, const char* name, int len)
  2266.  {
  2267.  	if (CheckForCharServer())
  2268. @@ -579,7 +589,7 @@
  2269.  	return 0;
  2270.  }
  2271.  
  2272. -// �M���h�����o�E��/�Ǖ�v��
  2273. +// Request to leave guild
  2274.  int intif_guild_leave(int guild_id,int account_id,int char_id,int flag,const char *mes)
  2275.  {
  2276.  	if (CheckForCharServer())
  2277. @@ -594,7 +604,8 @@
  2278.  	WFIFOSET(inter_fd,55);
  2279.  	return 0;
  2280.  }
  2281. -// �M���h�����o�̃I�����C����/Lv�X�V�v��
  2282. +
  2283. +//Update request / Lv online status of the guild members
  2284.  int intif_guild_memberinfoshort(int guild_id,int account_id,int char_id,int online,int lv,int class_)
  2285.  {
  2286.  	if (CheckForCharServer())
  2287. @@ -610,7 +621,8 @@
  2288.  	WFIFOSET(inter_fd,19);
  2289.  	return 0;
  2290.  }
  2291. -// �M���h���U�ʒm
  2292. +
  2293. +//Guild disbanded notification
  2294.  int intif_guild_break(int guild_id)
  2295.  {
  2296.  	if (CheckForCharServer())
  2297. @@ -621,7 +633,8 @@
  2298.  	WFIFOSET(inter_fd,6);
  2299.  	return 0;
  2300.  }
  2301. -// �M���h��b���M
  2302. +
  2303. +// Send a guild message
  2304.  int intif_guild_message(int guild_id,int account_id,const char *mes,int len)
  2305.  {
  2306.  	if (CheckForCharServer())
  2307. @@ -640,7 +653,8 @@
  2308.  
  2309.  	return 0;
  2310.  }
  2311. -// �M���h��{���ύX�v��
  2312. +
  2313. +// Request a change of Guild basic information
  2314.  int intif_guild_change_basicinfo(int guild_id,int type,const void *data,int len)
  2315.  {
  2316.  	if (CheckForCharServer())
  2317. @@ -654,7 +668,8 @@
  2318.  	WFIFOSET(inter_fd,len+10);
  2319.  	return 0;
  2320.  }
  2321. -// �M���h�����o���ύX�v��
  2322. +
  2323. +// Request a change of Guild member information
  2324.  int intif_guild_change_memberinfo(int guild_id,int account_id,int char_id,
  2325.  	int type,const void *data,int len)
  2326.  {
  2327. @@ -671,7 +686,8 @@
  2328.  	WFIFOSET(inter_fd,len+18);
  2329.  	return 0;
  2330.  }
  2331. -// �M���h��E�ύX�v��
  2332. +
  2333. +// Request a change of Guild title 
  2334.  int intif_guild_position(int guild_id,int idx,struct guild_position *p)
  2335.  {
  2336.  	if (CheckForCharServer())
  2337. @@ -685,7 +701,8 @@
  2338.  	WFIFOSET(inter_fd,WFIFOW(inter_fd,2));
  2339.  	return 0;
  2340.  }
  2341. -// �M���h�X�L���A�b�v�v��
  2342. +
  2343. +// Request an update of Guildskill skillnum 
  2344.  int intif_guild_skillup(int guild_id, int skill_num, int account_id, int max)
  2345.  {
  2346.  	if( CheckForCharServer() )
  2347. @@ -699,7 +716,8 @@
  2348.  	WFIFOSET(inter_fd, 18);
  2349.  	return 0;
  2350.  }
  2351. -// �M���h����/�G�Ηv��
  2352. +
  2353. +// Request a new guild relationship
  2354.  int intif_guild_alliance(int guild_id1,int guild_id2,int account_id1,int account_id2,int flag)
  2355.  {
  2356.  	if (CheckForCharServer())
  2357. @@ -714,7 +732,8 @@
  2358.  	WFIFOSET(inter_fd,19);
  2359.  	return 0;
  2360.  }
  2361. -// �M���h���m�ύX�v��
  2362. +
  2363. +// Request to change guild notice
  2364.  int intif_guild_notice(int guild_id,const char *mes1,const char *mes2)
  2365.  {
  2366.  	if (CheckForCharServer())
  2367. @@ -727,7 +746,8 @@
  2368.  	WFIFOSET(inter_fd,186);
  2369.  	return 0;
  2370.  }
  2371. -// �M���h�G���u�����ύX�v��
  2372. +
  2373. +// Request to change guild emblem
  2374.  int intif_guild_emblem(int guild_id,int len,const char *data)
  2375.  {
  2376.  	if (CheckForCharServer())
  2377. @@ -761,7 +781,8 @@
  2378.  	return 1;
  2379.  }
  2380.  
  2381. -//�M���h���̃M���h�ύX�v��
  2382. +
  2383. +// Request change castle guild owner and save data
  2384.  int intif_guild_castle_datasave(int castle_id,int index, int value)
  2385.  {
  2386.  	if (CheckForCharServer())
  2387. @@ -868,7 +889,7 @@
  2388.  	}
  2389.  	//Success to send whisper.
  2390.  	clif_wis_message(sd->fd, wisp_source, (char*)RFIFOP(fd,56),RFIFOW(fd,2)-56);
  2391. -	intif_wis_replay(id,0);   // ���M����
  2392. +	intif_wis_replay(id,0);   // succes
  2393.  	return 0;
  2394.  }
  2395.  
  2396. @@ -925,7 +946,7 @@
  2397.  	return 0;
  2398.  }
  2399.  
  2400. -// �A�J�E���g�ϐ��ʒm
  2401. +// Request player registre
  2402.  int intif_parse_Registers(int fd)
  2403.  {
  2404.  	int j,p,len,max, flag;
  2405. @@ -1017,13 +1038,15 @@
  2406.  	storage_guild_storageopen(sd);
  2407.  	return 0;
  2408.  }
  2409. +
  2410. +// ACK guild_storage saved
  2411.  int intif_parse_SaveGuildStorage(int fd)
  2412.  {
  2413.  	storage_guild_storagesaved(/*RFIFOL(fd,2), */RFIFOL(fd,6));
  2414.  	return 0;
  2415.  }
  2416.  
  2417. -// �p�[�e�B�쐬�”�
  2418. +// ACK party creation
  2419.  int intif_parse_PartyCreated(int fd)
  2420.  {
  2421.  	if(battle_config.etc_log)
  2422. @@ -1031,7 +1054,8 @@
  2423.  	party_created(RFIFOL(fd,2), RFIFOL(fd,6),RFIFOB(fd,10),RFIFOL(fd,11), (char *)RFIFOP(fd,15));
  2424.  	return 0;
  2425.  }
  2426. -// �p�[�e�B���
  2427. +
  2428. +// Receive party info
  2429.  int intif_parse_PartyInfo(int fd)
  2430.  {
  2431.  	if( RFIFOW(fd,2) == 12 ){
  2432. @@ -1045,7 +1069,8 @@
  2433.  	party_recv_info((struct party *)RFIFOP(fd,8), RFIFOL(fd,4));
  2434.  	return 0;
  2435.  }
  2436. -// �p�[�e�B�lj��ʒm
  2437. +
  2438. +// ACK adding party member
  2439.  int intif_parse_PartyMemberAdded(int fd)
  2440.  {
  2441.  	if(battle_config.etc_log)
  2442. @@ -1053,13 +1078,15 @@
  2443.  	party_member_added(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10), RFIFOB(fd, 14));
  2444.  	return 0;
  2445.  }
  2446. -// �p�[�e�B�ݒ�ύX�ʒm
  2447. +
  2448. +// ACK changing party option
  2449.  int intif_parse_PartyOptionChanged(int fd)
  2450.  {
  2451.  	party_optionchanged(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOW(fd,10),RFIFOW(fd,12),RFIFOB(fd,14));
  2452.  	return 0;
  2453.  }
  2454. -// �p�[�e�B�E�ޒʒm
  2455. +
  2456. +// ACK member leaving party
  2457.  int intif_parse_PartyMemberWithdraw(int fd)
  2458.  {
  2459.  	if(battle_config.etc_log)
  2460. @@ -1067,32 +1094,36 @@
  2461.  	party_member_withdraw(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10));
  2462.  	return 0;
  2463.  }
  2464. -// �p�[�e�B���U�ʒm
  2465. +
  2466. +// ACK party break
  2467.  int intif_parse_PartyBroken(int fd)
  2468.  {
  2469.  	party_broken(RFIFOL(fd,2));
  2470.  	return 0;
  2471.  }
  2472. -// �p�[�e�B�ړ��ʒm
  2473. +
  2474. +// ACK party on new map
  2475.  int intif_parse_PartyMove(int fd)
  2476.  {
  2477.  	party_recv_movemap(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOW(fd,14),RFIFOB(fd,16),RFIFOW(fd,17));
  2478.  	return 0;
  2479.  }
  2480. -// �p�[�e�B���b�Z�[�W
  2481. +
  2482. +// ACK party messages
  2483.  int intif_parse_PartyMessage(int fd)
  2484.  {
  2485.  	party_recv_message(RFIFOL(fd,4),RFIFOL(fd,8),(char *) RFIFOP(fd,12),RFIFOW(fd,2)-12);
  2486.  	return 0;
  2487.  }
  2488.  
  2489. -// �M���h�쐬�”�
  2490. +// ACK guild creation
  2491.  int intif_parse_GuildCreated(int fd)
  2492.  {
  2493.  	guild_created(RFIFOL(fd,2),RFIFOL(fd,6));
  2494.  	return 0;
  2495.  }
  2496. -// �M���h���
  2497. +
  2498. +// ACK guild infos
  2499.  int intif_parse_GuildInfo(int fd)
  2500.  {
  2501.  	if(RFIFOW(fd,2) == 8) {
  2502. @@ -1105,7 +1136,8 @@
  2503.  	guild_recv_info((struct guild *)RFIFOP(fd,4));
  2504.  	return 0;
  2505.  }
  2506. -// �M���h�����o�lj��ʒm
  2507. +
  2508. +// ACK adding guild member
  2509.  int intif_parse_GuildMemberAdded(int fd)
  2510.  {
  2511.  	if(battle_config.etc_log)
  2512. @@ -1113,20 +1145,22 @@
  2513.  	guild_member_added(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14));
  2514.  	return 0;
  2515.  }
  2516. -// �M���h�����o�E��/�Ǖ�ʒm
  2517. +
  2518. +// ACK member leaving guild
  2519.  int intif_parse_GuildMemberWithdraw(int fd)
  2520.  {
  2521.  	guild_member_withdraw(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14),(char *)RFIFOP(fd,55),(char *)RFIFOP(fd,15));
  2522.  	return 0;
  2523.  }
  2524.  
  2525. -// �M���h�����o�I�����C�����/Lv�ύX�ʒm
  2526. +// ACK guild member basic info
  2527.  int intif_parse_GuildMemberInfoShort(int fd)
  2528.  {
  2529.  	guild_recv_memberinfoshort(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14),RFIFOW(fd,15),RFIFOW(fd,17));
  2530.  	return 0;
  2531.  }
  2532. -// �M���h���U�ʒm
  2533. +
  2534. +// ACK guild break
  2535.  int intif_parse_GuildBroken(int fd)
  2536.  {
  2537.  	guild_broken(RFIFOL(fd,2),RFIFOB(fd,6));
  2538. @@ -1189,7 +1223,7 @@
  2539.  	return 0;
  2540.  }
  2541.  
  2542. -// �M���h��E�ύX�ʒm
  2543. +// ACK change of guild title
  2544.  int intif_parse_GuildPosition(int fd)
  2545.  {
  2546.  	if( RFIFOW(fd,2)!=sizeof(struct guild_position)+12 )
  2547. @@ -1197,54 +1231,62 @@
  2548.  	guild_position_changed(RFIFOL(fd,4),RFIFOL(fd,8),(struct guild_position *)RFIFOP(fd,12));
  2549.  	return 0;
  2550.  }
  2551. -// �M���h�X�L������U��ʒm
  2552. +
  2553. +// ACK change of guild skill update
  2554.  int intif_parse_GuildSkillUp(int fd)
  2555.  {
  2556.  	guild_skillupack(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10));
  2557.  	return 0;
  2558.  }
  2559. -// �M���h����/�G�Βʒm
  2560. +
  2561. +// ACK change of guild relationship
  2562.  int intif_parse_GuildAlliance(int fd)
  2563.  {
  2564.  	guild_allianceack(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOL(fd,14),RFIFOB(fd,18),(char *) RFIFOP(fd,19),(char *) RFIFOP(fd,43));
  2565.  	return 0;
  2566.  }
  2567. -// �M���h���m�ύX�ʒm
  2568. +
  2569. +// ACK change of guild notice
  2570.  int intif_parse_GuildNotice(int fd)
  2571.  {
  2572.  	guild_notice_changed(RFIFOL(fd,2),(char *) RFIFOP(fd,6),(char *) RFIFOP(fd,66));
  2573.  	return 0;
  2574.  }
  2575. -// �M���h�G���u�����ύX�ʒm
  2576. +
  2577. +// ACK change of guild emblem
  2578.  int intif_parse_GuildEmblem(int fd)
  2579.  {
  2580.  	guild_emblem_changed(RFIFOW(fd,2)-12,RFIFOL(fd,4),RFIFOL(fd,8), (char *)RFIFOP(fd,12));
  2581.  	return 0;
  2582.  }
  2583. -// �M���h��b��M
  2584. +
  2585. +// ACK guild message
  2586.  int intif_parse_GuildMessage(int fd)
  2587.  {
  2588.  	guild_recv_message(RFIFOL(fd,4),RFIFOL(fd,8),(char *) RFIFOP(fd,12),RFIFOW(fd,2)-12);
  2589.  	return 0;
  2590.  }
  2591. -// �M���h��f�[�^�v���ԐM
  2592. +
  2593. +// Reply guild castle data request
  2594.  int intif_parse_GuildCastleDataLoad(int fd)
  2595.  {
  2596.  	return guild_castledataloadack(RFIFOW(fd,2), (struct guild_castle *)RFIFOP(fd,4));
  2597.  }
  2598.  
  2599. +// ACK change of guildmaster
  2600.  int intif_parse_GuildMasterChanged(int fd)
  2601.  {
  2602.  	return guild_gm_changed(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10));
  2603.  }
  2604.  
  2605. -// pet
  2606. +// Request pet creation
  2607.  int intif_parse_CreatePet(int fd)
  2608.  {
  2609.  	pet_get_egg(RFIFOL(fd,2),RFIFOL(fd,7),RFIFOB(fd,6));
  2610.  	return 0;
  2611.  }
  2612.  
  2613. +// ACK pet data
  2614.  int intif_parse_RecvPetData(int fd)
  2615.  {
  2616.  	struct s_pet p;
  2617. @@ -1261,6 +1303,8 @@
  2618.  
  2619.  	return 0;
  2620.  }
  2621. +
  2622. +// ACK pet save data
  2623.  int intif_parse_SavePetOk(int fd)
  2624.  {
  2625.  	if(RFIFOB(fd,6) == 1)
  2626. @@ -1269,6 +1313,7 @@
  2627.  	return 0;
  2628.  }
  2629.  
  2630. +// ACK deleting pet
  2631.  int intif_parse_DeletePetOk(int fd)
  2632.  {
  2633.  	if(RFIFOB(fd,2) == 1)
  2634. @@ -1277,6 +1322,7 @@
  2635.  	return 0;
  2636.  }
  2637.  
  2638. +// ACK changing name resquest, players,pets,hommon
  2639.  int intif_parse_ChangeNameOk(int fd)
  2640.  {
  2641.  	struct map_session_data *sd = NULL;
  2642. @@ -2112,19 +2158,19 @@
  2643.  }
  2644.  
  2645.  //-----------------------------------------------------------------
  2646. -// inter server����̒ʐM
  2647. -// �G���[�������0(false)��Ԃ�����
  2648. -// �p�P�b�g�������ł����1,�p�P�b�g��������Ȃ����2��Ԃ�����
  2649. +// Communication from the inter server
  2650. +// Return a 0 (false) if there were any errors.
  2651. +// 1, 2 if there are not enough to return the length of the packet if the packet processing
  2652.  int intif_parse(int fd)
  2653.  {
  2654.  	int packet_len, cmd;
  2655.  	cmd = RFIFOW(fd,0);
  2656. -	// �p�P�b�g��ID�m�F
  2657. +    // Verify ID of the packet
  2658.  	if(cmd<0x3800 || cmd>=0x3800+(sizeof(packet_len_table)/sizeof(packet_len_table[0])) ||
  2659.  	   packet_len_table[cmd-0x3800]==0){
  2660.  	   	return 0;
  2661.  	}
  2662. -	// �p�P�b�g�̒����m�F
  2663. +    // Check the length of the packet
  2664.  	packet_len = packet_len_table[cmd-0x3800];
  2665.  	if(packet_len==-1){
  2666.  		if(RFIFOREST(fd)<4)
  2667. @@ -2134,7 +2180,7 @@
  2668.  	if((int)RFIFOREST(fd)<packet_len){
  2669.  		return 2;
  2670.  	}
  2671. -	// ��������
  2672. +    // Processing branch
  2673.  	switch(cmd){
  2674.  	case 0x3800:
  2675.  		if (RFIFOL(fd,4) == 0xFF000000) //Normal announce.
  2676. @@ -2217,7 +2263,7 @@
  2677.  		ShowError("intif_parse : unknown packet %d %x\n",fd,RFIFOW(fd,0));
  2678.  		return 0;
  2679.  	}
  2680. -	// �p�P�b�g�ǂݔ�΂�
  2681. +    // Skip packet
  2682.  	RFIFOSKIP(fd,packet_len);
  2683.  	return 1;
  2684.  }
  2685. Index: src/map/itemdb.c
  2686. --- src/map/itemdb.c Base (BASE)
  2687. +++ src/map/itemdb.c Locally Modified (Based On LOCAL)
  2688. @@ -25,7 +25,7 @@
  2689.  struct item_data dummy_item; //This is the default dummy item used for non-existant items. [Skotlex]
  2690.  
  2691.  /**
  2692. - * ���O�Ō����p
  2693. + * Search for item name 
  2694.   * name = item alias, so we should find items aliases first. if not found then look for "jname" (full name)
  2695.   * @see DBApply
  2696.   */
  2697. @@ -51,7 +51,7 @@
  2698.  }
  2699.  
  2700.  /*==========================================
  2701. - * ���O�Ō���
  2702. + * Return item data from item name. (lookup) 
  2703.   *------------------------------------------*/
  2704.  struct item_data* itemdb_searchname(const char *str)
  2705.  {
  2706. @@ -136,7 +136,7 @@
  2707.  
  2708.  
  2709.  /*==========================================
  2710. - * ���n�A�C�e������
  2711. + * Return a  random item id from group. (take in account % chance giving/tot group) 
  2712.   *------------------------------------------*/
  2713.  int itemdb_searchrandomid(int group)
  2714.  {
  2715. @@ -480,7 +480,8 @@
  2716.  }
  2717.  
  2718.  /*==========================================
  2719. - * �A�C�e���g�p�”\�t���O�̃I�[�o�[���C�h
  2720. + * Search by name for the override flags available items
  2721. + * (Give item another sprite)
  2722.   *------------------------------------------*/
  2723.  static bool itemdb_read_itemavail(char* str[], int columns, int current)
  2724.  {// <nameid>,<sprite>
  2725. @@ -585,7 +586,7 @@
  2726.  }
  2727.  
  2728.  /*==========================================
  2729. - * ���������t�@�C���ǂݏo��
  2730. + * Read item forbiden by mapflag (can't equip item)
  2731.   *------------------------------------------*/
  2732.  static bool itemdb_read_noequip(char* str[], int columns, int current)
  2733.  {// <nameid>,<mode>
  2734. @@ -1075,7 +1076,8 @@
  2735.  }
  2736.  
  2737.  /*==========================================
  2738. - * �A�C�e���f�[�^�x�[�X�̓ǂݍ���
  2739. + * Reading item from item db
  2740. + * item_db2 overwriting item_db
  2741.   *------------------------------------------*/
  2742.  static int itemdb_readdb(void)
  2743.  {
  2744. Index: src/map/map.c
  2745. --- src/map/map.c Base (BASE)
  2746. +++ src/map/map.c Locally Modified (Based On LOCAL)
  2747. @@ -93,7 +93,7 @@
  2748.  char *MSG_CONF_NAME;
  2749.  char *GRF_PATH_FILENAME;
  2750.  
  2751. -// �ɗ� static�Ń�?�J����?�߂�
  2752. +// DBMap declaartion
  2753.  static DBMap* id_db=NULL; // int id -> struct block_list*
  2754.  static DBMap* pc_db=NULL; // int id -> struct map_session_data*
  2755.  static DBMap* mobid_db=NULL; // int id -> struct mob_data*
  2756. @@ -187,8 +187,7 @@
  2757.  //
  2758.  
  2759.  /*==========================================
  2760. - * block��free����Ƃ�free��?���ɌĂ�
  2761. - * ���b�N����Ă���Ƃ��̓o�b�t�@�ɂ��߂�
  2762. + * Attempt to free a map blocklist
  2763.   *------------------------------------------*/
  2764.  int map_freeblock (struct block_list *bl)
  2765.  {
  2766. @@ -339,7 +338,7 @@
  2767.  	int pos;
  2768.  	nullpo_ret(bl);
  2769.  
  2770. -	// ?��blocklist����?������
  2771. +    // blocklist (2ways chainlist)
  2772.  	if (bl->prev == NULL) {
  2773.  		if (bl->next != NULL) {
  2774.  			// prev��NULL��next��NULL�łȂ��̂͗L���Ă͂Ȃ�Ȃ�
  2775. @@ -991,7 +990,7 @@
  2776.  	if(bl_list_count>=BL_LIST_MAX)
  2777.  		ShowWarning("map_foreachinmovearea: block count too many!\n");
  2778.  
  2779. -	map_freeblock_lock();	// ����������̉����֎~����
  2780. +	map_freeblock_lock();	// Prohibit the release from memory
  2781.  
  2782.  	for(i=blockcount;i<bl_list_count;i++)
  2783.  		if(bl_list[i]->prev)
  2784. @@ -1002,7 +1001,7 @@
  2785.  			va_end(ap);
  2786.  		}
  2787.  
  2788. -	map_freeblock_unlock();	// �������‚���
  2789. +	map_freeblock_unlock();	// Allow Free
  2790.  
  2791.  	bl_list_count = blockcount;
  2792.  	return returnCount;
  2793. @@ -1326,7 +1325,7 @@
  2794.  /*==========================================
  2795.   * ���A�C�e��������
  2796.   *
  2797. - * data==0�̎b�timer�ŏ������� * data!=0�̎b͏E�����ŏ������bƂ��ē��?
  2798. + * data==0�̎b�timer�ŏ������� * data!=0�̎b͏E�����ŏ������bƂ��ē�??
  2799.   *
  2800.   * ��҂́Amap_clearflooritem(id)��
  2801.   * map.h?��#define������
  2802. @@ -1469,10 +1468,13 @@
  2803.  }
  2804.  
  2805.  /*==========================================
  2806. - * (m,x,y)�𒆐S��3x3��?�ɏ��A�C�e���ݒu
  2807. - *
  2808. - * item_data��amount�ȊO��copy����
  2809. - * type flag: &1 MVP item. &2 do stacking check.
  2810. + * Add an item to location (m,x,y)
  2811. + * Parameters 
  2812. + * @item_data item attributes
  2813. + * @amount quantity
  2814. + * @m, @x, @y mapid,x,y
  2815. + * @first_charid, @second_charid, @third_charid, looting priority
  2816. + * @flag: &1 MVP item. &2 do stacking check.
  2817.   *------------------------------------------*/
  2818.  int map_addflooritem(struct item *item_data,int amount,int m,int x,int y,int first_charid,int second_charid,int third_charid,int flags)
  2819.  {
  2820. @@ -2497,7 +2499,7 @@
  2821.  }
  2822.  
  2823.  /*==========================================
  2824. - * (m,x,y)�̏�Ԃ𒲂ׂ�
  2825. + * Confirm if celltype in (m,x,y) match the one given in cellchk
  2826.   *------------------------------------------*/
  2827.  int map_getcell(int m,int x,int y,cell_chk cellchk)
  2828.  {
  2829. @@ -3978,7 +3980,7 @@
  2830.  	do_init_battleground();
  2831.  	do_init_duel();
  2832.  
  2833. -	npc_event_do_oninit();	// npc��OnInit�C�x���g?�s
  2834. +	npc_event_do_oninit();	// Init npcs (OnInit)
  2835.  
  2836.  	if( console )
  2837.  	{
  2838. Index: src/map/map.h
  2839. --- src/map/map.h Base (BASE)
  2840. +++ src/map/map.h Locally Modified (Based On LOCAL)
  2841. @@ -610,15 +610,16 @@
  2842.  
  2843.  extern char wisp_server_name[];
  2844.  
  2845. -// �I�S�̏��
  2846. +// users
  2847.  void map_setusers(int);
  2848.  int map_getusers(void);
  2849.  int map_usercount(void);
  2850. -// block�폜�֘A
  2851. +
  2852. +// blocklist lock
  2853.  int map_freeblock(struct block_list *bl);
  2854.  int map_freeblock_lock(void);
  2855.  int map_freeblock_unlock(void);
  2856. -// block�֘A
  2857. +// blocklist manipulation
  2858.  int map_addblock(struct block_list* bl);
  2859.  int map_delblock(struct block_list* bl);
  2860.  int map_moveblock(struct block_list *, int, int, unsigned int);
  2861. @@ -631,10 +632,10 @@
  2862.  int map_foreachincell(int (*func)(struct block_list*,va_list), int m, int x, int y, int type, ...);
  2863.  int map_foreachinpath(int (*func)(struct block_list*,va_list), int m, int x0, int y0, int x1, int y1, int range, int length, int type, ...);
  2864.  int map_foreachinmap(int (*func)(struct block_list*,va_list), int m, int type, ...);
  2865. -//block�֘A�ɒlj�
  2866. +//blocklist nb in one cell
  2867.  int map_count_oncell(int m,int x,int y,int type);
  2868.  struct skill_unit *map_find_skill_unit_oncell(struct block_list *,int x,int y,int skill_id,struct skill_unit *, int flag);
  2869. -// �ꎞ�Iobject�֘A
  2870. +// search and creation
  2871.  int map_get_new_object_id(void);
  2872.  int map_search_freecell(struct block_list *src, int m, short *x, short *y, int rx, int ry, int flag);
  2873.  //
  2874. @@ -642,13 +643,13 @@
  2875.  // npc
  2876.  bool map_addnpc(int,struct npc_data *);
  2877.  
  2878. -// ���A�C�e���֘A
  2879. +// map item
  2880.  int map_clearflooritem_timer(int tid, unsigned int tick, int id, intptr_t data);
  2881.  int map_removemobs_timer(int tid, unsigned int tick, int id, intptr_t data);
  2882.  #define map_clearflooritem(id) map_clearflooritem_timer(0,0,id,1)
  2883.  int map_addflooritem(struct item *item_data,int amount,int m,int x,int y,int first_charid,int second_charid,int third_charid,int flags);
  2884.  
  2885. -// �L����id�����L������ �ϊ��֘A
  2886. +// player to map session
  2887.  void map_addnickdb(int charid, const char* nick);
  2888.  void map_delnickdb(int charid, const char* nick);
  2889.  void map_reqnickdb(struct map_session_data* sd,int charid);
  2890. Index: src/map/mercenary.c
  2891. --- src/map/mercenary.c Base (BASE)
  2892. +++ src/map/mercenary.c Locally Modified (Based On LOCAL)
  2893. @@ -371,7 +371,7 @@
  2894.  	const enum sc_type scs[] = { SC_MERC_FLEEUP, SC_MERC_ATKUP, SC_MERC_HPUP, SC_MERC_SPUP, SC_MERC_HITUP };
  2895.  	int index = rnd() % ARRAYLENGTH(scs);
  2896.  
  2897. -	status_change_start(&md->bl, scs[index], 10000, rnd()%5, 0, 0, 0, 600000, 0);
  2898. +    sc_start(&md->bl, scs[index], 100, rnd() % 5, 600000);
  2899.  	return 0;
  2900.  }
  2901.  
  2902. Index: src/map/mob.c
  2903. --- src/map/mob.c Base (BASE)
  2904. +++ src/map/mob.c Locally Modified (Based On LOCAL)
  2905. @@ -2834,7 +2834,7 @@
  2906.  }
  2907.  
  2908.  /*==========================================
  2909. - * ��ʓ��̎�芪���̐��v�Z�p(foreachinarea)
  2910. + *  Count slave sub, curently chking if mob master is the given id
  2911.   *------------------------------------------*/
  2912.  int mob_countslave_sub(struct block_list *bl,va_list ap)
  2913.  {
  2914. @@ -2849,7 +2849,7 @@
  2915.  }
  2916.  
  2917.  /*==========================================
  2918. - * ��ʓ��̎�芪���̐��v�Z
  2919. + * Cout how many slave a mob got on map
  2920.   *------------------------------------------*/
  2921.  int mob_countslave(struct block_list *bl)
  2922.  {
  2923. @@ -2955,7 +2955,8 @@
  2924.  }
  2925.  
  2926.  /*==========================================
  2927. - *MOBskill����Y��skillid��skillidx��Ԃ�
  2928. + * MOBskill lookup (get skillindex trough skillid)
  2929. + * return -1 if not found
  2930.   *------------------------------------------*/
  2931.  int mob_skillid2skillidx(int class_,int skillid)
  2932.  {
  2933. @@ -3965,7 +3966,7 @@
  2934.  
  2935.  	class_=atoi(str[0]);
  2936.  
  2937. -	if(mob_db(class_) == mob_dummy)	// �l���ُ�Ȃ珈�����Ȃ��B
  2938. +	if(mob_db(class_) == mob_dummy)	// invalid class (probably undefined in db)
  2939.  	{
  2940.  		ShowWarning("mob_readdb_mobavail: Unknown mob id %d.\n", class_);
  2941.  		return false;
  2942. Index: src/map/npc.c
  2943. --- src/map/npc.c Base (BASE)
  2944. +++ src/map/npc.c Locally Modified (Based On LOCAL)
  2945. @@ -138,9 +138,7 @@
  2946.  }
  2947.  
  2948.  /*==========================================
  2949. - * NPC�̖���/�L��
  2950. - * npc_enable
  2951. - * npc_enable_sub �L���OnTouch�C�x���g�����s
  2952. + * sub fonction of npc_enable,  Run OnTouch event when enabled
  2953.   *------------------------------------------*/
  2954.  int npc_enable_sub(struct block_list *bl, va_list ap)
  2955.  {
  2956. @@ -167,6 +165,9 @@
  2957.  	return 0;
  2958.  }
  2959.  
  2960. +/*==========================================
  2961. + * Disable / Enable NPC
  2962. + *------------------------------------------*/
  2963.  int npc_enable(const char* name, int flag)
  2964.  {
  2965.  	struct npc_data* nd = npc_name2id(name);
  2966. @@ -198,14 +199,14 @@
  2967.  	} else
  2968.  		clif_changeoption(&nd->bl);
  2969.  
  2970. -	if( flag&3 && (nd->u.scr.xs >= 0 || nd->u.scr.ys >= 0) )
  2971. +	if( flag&3 && (nd->u.scr.xs >= 0 || nd->u.scr.ys >= 0) ) 	//check if player standing on a OnTouchArea	
  2972.  		map_foreachinarea( npc_enable_sub, nd->bl.m, nd->bl.x-nd->u.scr.xs, nd->bl.y-nd->u.scr.ys, nd->bl.x+nd->u.scr.xs, nd->bl.y+nd->u.scr.ys, BL_PC, nd );
  2973.  
  2974.  	return 0;
  2975.  }
  2976.  
  2977.  /*==========================================
  2978. - * NPC�𖼑O�ŒT��
  2979. + * NPC lookup (get npc_data trough npcname)
  2980.   *------------------------------------------*/
  2981.  struct npc_data* npc_name2id(const char* name)
  2982.  {
  2983. @@ -240,8 +241,9 @@
  2984.  	return 0;
  2985.  }
  2986.  #endif
  2987. +
  2988.  /*==========================================
  2989. - * �C�x���g�L���[�̃C�x���g����
  2990. + * Dequeue event and add timer for execution (100ms)
  2991.   *------------------------------------------*/
  2992.  int npc_event_dequeue(struct map_session_data* sd)
  2993.  {
  2994. @@ -299,7 +301,8 @@
  2995.  int npc_event_sub(struct map_session_data* sd, struct event_data* ev, const char* eventname); //[Lance]
  2996.  
  2997.  /**
  2998. - * �S��NPC��On*�C�x���g���s
  2999. + * Exec name (NPC events) on player or global
  3000. + * Do on all NPC when called with foreach 
  3001.   * @see DBApply
  3002.   */
  3003.  int npc_event_doall_sub(DBKey key, DBData *data, va_list ap)
  3004. @@ -363,11 +366,13 @@
  3005.  
  3006.  	return c;
  3007.  }
  3008. +
  3009.  // runs the specified event (global only)
  3010.  int npc_event_doall(const char* name)
  3011.  {
  3012.  	return npc_event_doall_id(name, 0);
  3013.  }
  3014. +
  3015.  // runs the specified event, with a RID attached (global only)
  3016.  int npc_event_doall_id(const char* name, int rid)
  3017.  {
  3018. @@ -388,7 +393,8 @@
  3019.  
  3020.  
  3021.  /*==========================================
  3022. - * ���v�C�x���g���s
  3023. + * Clock event execution
  3024. + * OnMinute/OnClock/OnHour/OnDay/OnDDHHMM
  3025.   *------------------------------------------*/
  3026.  int npc_event_do_clock(int tid, unsigned int tick, int id, intptr_t data)
  3027.  {
  3028. @@ -435,7 +441,7 @@
  3029.  }
  3030.  
  3031.  /*==========================================
  3032. - * OnInit�C�x���g���s(&���v�C�x���g�J�n)
  3033. + * OnInit Event execution (the start of the event and watch)
  3034.   *------------------------------------------*/
  3035.  void npc_event_do_oninit(void)
  3036.  {
  3037. @@ -445,7 +451,7 @@
  3038.  }
  3039.  
  3040.  /*==========================================
  3041. - * �^�C�}[�C�x���g�p���x���̎�荞��
  3042. + * Incorporation of the label for the timer event
  3043.   * called from npc_parse_script
  3044.   *------------------------------------------*/
  3045.  int npc_timerevent_export(struct npc_data *nd, int i)
  3046. @@ -454,7 +460,7 @@
  3047.  	char *lname = nd->u.scr.label_list[i].name;
  3048.  	int pos = nd->u.scr.label_list[i].pos;
  3049.  	if (sscanf(lname, "OnTimer%d%n", &t, &k) == 1 && lname[k] == '\0') {
  3050. -		// �^�C�}[�C�x���g
  3051. +		// Timer event
  3052.  		struct npc_timerevent_list *te = nd->u.scr.timer_event;
  3053.  		int j, k = nd->u.scr.timeramount;
  3054.  		if (te == NULL)
  3055. @@ -783,7 +789,7 @@
  3056.  }
  3057.  
  3058.  /*==========================================
  3059. - * �C�x���g�^��NPC����
  3060. + * NPC processing event type
  3061.   *------------------------------------------*/
  3062.  int npc_event(struct map_session_data* sd, const char* eventname, int ontouch)
  3063.  {
  3064. @@ -813,6 +819,9 @@
  3065.  	return npc_event_sub(sd,ev,eventname);
  3066.  }
  3067.  
  3068. +/*==========================================
  3069. + * Sub chk then execute area event type
  3070. + *------------------------------------------*/
  3071.  int npc_touch_areanpc_sub(struct block_list *bl, va_list ap)
  3072.  {
  3073.  	struct map_session_data *sd;
  3074. @@ -835,6 +844,9 @@
  3075.  	return 1;
  3076.  }
  3077.  
  3078. +/*==========================================
  3079. + * If player leave map or get out take next player in area event then exec OnTouch_
  3080. + *------------------------------------------*/
  3081.  int npc_touchnext_areanpc(struct map_session_data* sd, bool leavemap)
  3082.  {
  3083.  	struct npc_data *nd = map_id2nd(sd->touching_id);
  3084. @@ -861,7 +873,7 @@
  3085.  }
  3086.  
  3087.  /*==========================================
  3088. - * �ڐG�^��NPC����
  3089. + * Exec OnTouch for player if in range of area event
  3090.   *------------------------------------------*/
  3091.  int npc_touch_areanpc(struct map_session_data* sd, int m, int x, int y)
  3092.  {
  3093. @@ -1048,6 +1060,12 @@
  3094.  	return (map[m].npc[i]->bl.id);
  3095.  }
  3096.  
  3097. +/*==========================================
  3098. + * Chk if player not too far to acces the npc
  3099. + * return
  3100. + * npc_data : succes
  3101. + * NULL : fail	 
  3102. + *------------------------------------------*/
  3103.  struct npc_data* npc_checknear(struct map_session_data* sd, struct block_list* bl)
  3104.  {
  3105.  	struct npc_data *nd;
  3106. @@ -1072,7 +1090,7 @@
  3107.  }
  3108.  
  3109.  /*==========================================
  3110. - * NPC�̃I�[�v���`���b�g����
  3111. + * Make NPC talk in global chat (like npctalk)
  3112.   *------------------------------------------*/
  3113.  int npc_globalmessage(const char* name, const char* mes)
  3114.  {
  3115. @@ -1114,7 +1132,8 @@
  3116.  }
  3117.  
  3118.  /*==========================================
  3119. - * �N���b�N����NPC����
  3120. + * NPC 1st call when clicking on npc
  3121. + * Do specific action for npc type (openshop, run scripts...) 
  3122.   *------------------------------------------*/
  3123.  int npc_click(struct map_session_data* sd, struct npc_data* nd)
  3124.  {
  3125. @@ -1194,7 +1213,7 @@
  3126.  }
  3127.  
  3128.  /*==========================================
  3129. - *
  3130. + * Chk if valid call then open buy or selling list
  3131.   *------------------------------------------*/
  3132.  int npc_buysellsel(struct map_session_data* sd, int id, int type)
  3133.  {
  3134. @@ -1211,7 +1230,7 @@
  3135.  			sd->npc_id=0;
  3136.  		return 1;
  3137.  	}
  3138. -	if (nd->sc.option&OPTION_INVISIBLE)	// ���������
  3139. +    if (nd->sc.option & OPTION_INVISIBLE) // can't buy if npc is not visible (hack?)
  3140.  		return 1;
  3141.  	if( nd->class_ < 0 && !sd->state.callshop )
  3142.  	{// not called through a script and is not a visible NPC so an invalid call
  3143. @@ -1310,6 +1329,7 @@
  3144.  
  3145.      return 0;
  3146.  }
  3147. +
  3148.  //npc_buylist for script-controlled shops.
  3149.  static int npc_buylist_sub(struct map_session_data* sd, int n, unsigned short* item_list, struct npc_data* nd)
  3150.  {
  3151. @@ -1335,6 +1355,7 @@
  3152.  
  3153.  	return 0;
  3154.  }
  3155. +
  3156.  /*==========================================
  3157.   * Cash Shop Buy
  3158.   *------------------------------------------*/
  3159. @@ -1693,6 +1714,8 @@
  3160.  	return 0;
  3161.  }
  3162.  
  3163. +//Atempt to remove an npc from a map
  3164. +//This doesn't remove it from map_db
  3165.  int npc_remove_map(struct npc_data* nd)
  3166.  {
  3167.  	int m,i;
  3168. @@ -1729,6 +1752,8 @@
  3169.  	return 0;
  3170.  }
  3171.  
  3172. +//Chk if npc match src_id then unload
  3173. +//Sub fonction used to found duplicate
  3174.  static int npc_unload_dup_sub(struct npc_data* nd, va_list args)
  3175.  {
  3176.  	int src_id;
  3177. @@ -1745,6 +1770,8 @@
  3178.  	map_foreachnpc(npc_unload_dup_sub,nd->bl.id);
  3179.  }
  3180.  
  3181. +//Remove an npc from map and db
  3182. +//single is to free name (for duplicate one I suppose)
  3183.  int npc_unload(struct npc_data* nd, bool single) {
  3184.  	nullpo_ret(nd);
  3185.  
  3186. @@ -1957,7 +1984,7 @@
  3187.  
  3188.  		ShowWarning("npc_parsename: Duplicate unique name in file '%s', line'%d'. Renaming '%s' to '%s'.\n", filepath, strline(buffer,start-buffer), nd->exname, newname);
  3189.  		ShowDebug("this npc:\n   display name '%s'\n   unique name '%s'\n   map=%s, x=%d, y=%d\n", nd->name, nd->exname, this_mapname, nd->bl.x, nd->bl.y);
  3190. -		ShowDebug("other npc:\n   display name '%s'\n   unique name '%s'\n   map=%s, x=%d, y=%d\n", dnd->name, dnd->exname, other_mapname, dnd->bl.x, dnd->bl.y);
  3191. +		ShowDebug("other npc in '%s' :\n   display name '%s'\n   unique name '%s'\n   map=%s, x=%d, y=%d\n",dnd->path, dnd->name, dnd->exname, other_mapname, dnd->bl.x, dnd->bl.y);
  3192.  		safestrncpy(nd->exname, newname, sizeof(nd->exname));
  3193.  	}
  3194.  
  3195. @@ -1987,6 +2014,7 @@
  3196.  	}
  3197.  }
  3198.  
  3199. +//Add then display an npc warp on map
  3200.  struct npc_data* npc_add_warp(short from_mapid, short from_x, short from_y, short xs, short ys, unsigned short to_mapindex, short to_x, short to_y)
  3201.  {
  3202.  	int i;
  3203. @@ -2208,7 +2236,8 @@
  3204.  }
  3205.  
  3206.  /**
  3207. - * NPC�̃��x���f�[�^�R���o�[�g
  3208. + * NPCのラベルデータコンバート
  3209. + * Not sure, seem to add label in a chainlink
  3210.   * @see DBApply
  3211.   */
  3212.  int npc_convertlabel_db(DBKey key, DBData *data, va_list ap)
  3213. @@ -2671,6 +2700,7 @@
  3214.  	return 0;
  3215.  }
  3216.  
  3217. +//Set mapcell CELL_NPC to trigger event later
  3218.  void npc_setcells(struct npc_data* nd)
  3219.  {
  3220.  	int m = nd->bl.m, x = nd->bl.x, y = nd->bl.y, xs, ys;
  3221. @@ -2690,7 +2720,7 @@
  3222.  		return; // Other types doesn't have touch area
  3223.  	}
  3224.  
  3225. -	if (m < 0 || xs < 0 || ys < 0)
  3226. +	if (m < 0 || xs < 0 || ys < 0) //invalid range or map
  3227.  		return;
  3228.  
  3229.  	for (i = y-ys; i <= y+ys; i++) {
  3230. @@ -3052,7 +3082,9 @@
  3231.  }
  3232.  
  3233.  /*==========================================
  3234. - * �}�b�v�t���O�s�̉��
  3235. + * Set or disable mapflag on map
  3236. + * eg : bat_c01	mapflag	battleground	2
  3237. + * also chking if mapflag conflict with another
  3238.   *------------------------------------------*/
  3239.  static const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char* start, const char* buffer, const char* filepath)
  3240.  {
  3241. @@ -3317,6 +3349,8 @@
  3242.  	return strchr(start,'\n');// continue
  3243.  }
  3244.  
  3245. +//Read file and create npc/func/mapflag/monster.. accordly
  3246. +//@runOnInit should we exec OnInit when it's done ?
  3247.  void npc_parsesrcfile(const char* filepath, bool runOnInit)
  3248.  {
  3249.  	int m, lines = 0;
  3250. @@ -3538,11 +3572,11 @@
  3251.  			ShowInfo("%s: %d '%s' events.\n", config[i].name, script_event[i].event_count, config[i].event_name);
  3252.  	}
  3253.  }
  3254. +
  3255.  void npc_clear_pathlist(void) {
  3256.  	struct npc_path_data *npd = NULL;
  3257.  	DBIterator *path_list = db_iterator(npc_path_db);
  3258.  
  3259. -	
  3260.  	/* free all npc_path_data filepaths */
  3261.  	for( npd = dbi_first(path_list); dbi_exists(path_list); npd = dbi_next(path_list) ) {
  3262.  		if( npd->path )
  3263. @@ -3551,6 +3585,8 @@
  3264.  
  3265.  	dbi_destroy(path_list);
  3266.  }
  3267. +
  3268. +//Clear then reload npcs files
  3269.  int npc_reload(void) {
  3270.  	struct npc_src_list *nsl;
  3271.  	int m, i;
  3272. @@ -3646,6 +3682,8 @@
  3273.  	}
  3274.  	return 0;
  3275.  }
  3276. +
  3277. +//Unload all npc in the given file
  3278.  bool npc_unloadfile( const char* path ) {
  3279.  	DBIterator * iter = db_iterator(npcname_db);
  3280.  	struct npc_data* nd = NULL;
  3281. @@ -3666,12 +3704,14 @@
  3282.  
  3283.  	return found;
  3284.  }
  3285. +
  3286.  void do_clear_npc(void) {
  3287.  	db_clear(npcname_db);
  3288.  	db_clear(ev_db);
  3289.  }
  3290. +
  3291.  /*==========================================
  3292. - * �I��
  3293. + * Destructor 
  3294.   *------------------------------------------*/
  3295.  int do_final_npc(void) {
  3296.  	npc_clear_pathlist();
  3297. Index: src/map/party.c
  3298. --- src/map/party.c Base (BASE)
  3299. +++ src/map/party.c Locally Modified (Based On LOCAL)
  3300. @@ -103,14 +103,15 @@
  3301.  }
  3302.  
  3303.  /*==========================================
  3304. - * �I��
  3305. + * Destructor
  3306. + * Called in map shutdown, cleanup var
  3307.   *------------------------------------------*/
  3308.  void do_final_party(void)
  3309.  {
  3310.  	party_db->destroy(party_db,NULL);
  3311.  	party_booking_db->destroy(party_booking_db,NULL); // Party Booking [Spiria]
  3312.  }
  3313. -// ����
  3314. +// Constructor, init vars
  3315.  void do_init_party(void)
  3316.  {
  3317.  	party_db = idb_alloc(DB_OPT_RELEASE_DATA);
  3318. @@ -650,7 +651,7 @@
  3319.  
  3320.  	if( map[sd->bl.m].flag.partylock )
  3321.  	{
  3322. -		clif_displaymessage(sd->fd, "You cannot change party leaders on this map.");
  3323. +		clif_displaymessage(sd->fd, msg_txt(287));
  3324.  		return false;
  3325.  	}
  3326.  
  3327. Index: src/map/party.h
  3328. --- src/map/party.h Base (BASE)
  3329. +++ src/map/party.h Locally Modified (Based On LOCAL)
  3330. Index: src/map/path.c
  3331. --- src/map/path.c Base (BASE)
  3332. +++ src/map/path.c Locally Modified (Based On LOCAL)
  3333. @@ -45,7 +45,7 @@
  3334.  
  3335.  /*==========================================
  3336.   * heap update (helper function)
  3337. - * cost���������̂ō��̕�ֈړ�
  3338. + * move toward the root Because cost has decreased
  3339.   *------------------------------------------*/
  3340.  static void update_heap_path(int *heap,struct tmp_path *tp,int index)
  3341.  {
  3342. @@ -147,8 +147,7 @@
  3343.  
  3344.  /*==========================================
  3345.   * Find the closest reachable cell, 'count' cells away from (x0,y0) in direction (dx,dy).
  3346. - * 
  3347. - * ������΂������Ƃ̍��W������
  3348. + * Income after the coordinates of the blow
  3349.   *------------------------------------------*/
  3350.  int path_blownpos(int m,int x0,int y0,int dx,int dy,int count)
  3351.  {
  3352. @@ -343,7 +342,7 @@
  3353.  	tp[i].flag=0;
  3354.  	heap[0]=0;
  3355.  	push_heap_path(heap,tp,calc_index(x0,y0));
  3356. -	xs = md->xs-1; // ���炩���߂P���Z���Ă���
  3357. +    xs = md->xs - 1; // Place by subtracting a pre-
  3358.  	ys = md->ys-1;
  3359.  
  3360.  	for(;;)
  3361. @@ -361,10 +360,10 @@
  3362.  		if(x==x1 && y==y1)
  3363.  			break;
  3364.  
  3365. -		// dc[0] : y++ �̎��̃R�X�g����
  3366. -		// dc[1] : x-- �̎��̃R�X�g����
  3367. -		// dc[2] : y-- �̎��̃R�X�g����
  3368. -		// dc[3] : x++ �̎��̃R�X�g����
  3369. +		// dc[0] : y++ Incremental cost at the time
  3370. +		// dc[1] : x-- 
  3371. +		// dc[2] : y-- 
  3372. +		// dc[3] : x++ 
  3373.  
  3374.  		if(y < ys && !map_getcellp(md,x  ,y+1,cell)) {
  3375.  			f |= 1; dc[0] = (y >= y1 ? 20 : 0);
  3376. Index: src/map/pc.c
  3377. --- src/map/pc.c Base (BASE)
  3378. +++ src/map/pc.c Locally Modified (Based On LOCAL)
  3379. @@ -47,7 +47,7 @@
  3380.  #include <time.h>
  3381.  
  3382.  
  3383. -#define PVP_CALCRANK_INTERVAL 1000	// PVP���ʌv�Z�̊Ԋu
  3384. +#define PVP_CALCRANK_INTERVAL 1000	// PVP calculation interval
  3385.  static unsigned int exp_table[CLASS_COUNT][2][MAX_LEVEL];
  3386.  static unsigned int max_level[CLASS_COUNT][2];
  3387.  static unsigned int statp[MAX_LEVEL+1];
  3388. @@ -289,7 +289,7 @@
  3389.  	memset(b_sd, 0, sizeof(b_sd));
  3390.  	i = party_foreachsamemap(pc_check_banding,sd,range,&sd->bl,&c,&b_sd);
  3391.  
  3392. -	if( c < 1 )
  3393. +	if( c < 1 ) //just recalc status no need to recalc hp
  3394.  	{	// No more Royal Guards in Banding found.
  3395.  		if( (sc = status_get_sc(&sd->bl)) != NULL  && sc->data[SC_BANDING] )
  3396.  		{
  3397. @@ -559,7 +559,7 @@
  3398.  }
  3399.  
  3400.  /*==========================================
  3401. - * ��?�b̏���?
  3402. + * Off init ? Connection?
  3403.   *------------------------------------------*/
  3404.  int pc_setnewpc(struct map_session_data *sd, int account_id, int char_id, int login_id1, unsigned int client_tick, int sex, int fd)
  3405.  {
  3406. @@ -833,10 +833,15 @@
  3407.  	return false; // Job Change Fail
  3408.  }
  3409.  
  3410. +/*=================================================
  3411. + * Can the player equip the item at index n in inventory
  3412. + * return
  3413. + *	0 = no
  3414. + *	1 = yes
  3415. + *------------------------------------------------*/
  3416.  int pc_isequip(struct map_session_data *sd,int n)
  3417.  {
  3418.  	struct item_data *item;
  3419. -	//?����{�q�̏ꍇ�̌��̐E�Ƃ��Z�o����
  3420.  
  3421.  	nullpo_ret(sd);
  3422.  
  3423. @@ -917,8 +922,8 @@
  3424.  }
  3425.  
  3426.  /*==========================================
  3427. - * session id�ɖ�薳��
  3428. - * char�I���瑗���Ă����X�e?�^�X��ݒ�
  3429. + * No problem with the session id
  3430. + * set the status that has been sent from char server
  3431.   *------------------------------------------*/
  3432.  bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_time, int group_id, struct mmo_charstatus *st, bool changing_mapservers)
  3433.  {
  3434. @@ -1037,7 +1042,7 @@
  3435.  	for( i = 0; i < 3; i++ )
  3436.  		sd->hate_mob[i] = -1;
  3437.  
  3438. -	// �ʒu�̐ݒ�
  3439. +    //warp player
  3440.  	if ((i=pc_setpos(sd,sd->status.last_point.map, sd->status.last_point.x, sd->status.last_point.y, CLR_OUTSIGHT)) != 0) {
  3441.  		ShowError ("Last_point_map %s - id %d not found (error code %d)\n", mapindex_id2name(sd->status.last_point.map), sd->status.last_point.map, i);
  3442.  
  3443. @@ -1272,7 +1277,7 @@
  3444.  
  3445.  
  3446.  /*==========================================
  3447. - * ?������X�L���̌v�Z
  3448. + * Calculation of Skills lvls
  3449.   *------------------------------------------*/
  3450.  int pc_calc_skilltree(struct map_session_data *sd)
  3451.  {
  3452. @@ -3438,7 +3443,7 @@
  3453.  	return 1;
  3454.  }
  3455.  /*==========================================
  3456. - * �J?�h?��
  3457. + * Append a card to an item ?
  3458.   *------------------------------------------*/
  3459.  int pc_insert_card(struct map_session_data* sd, int idx_card, int idx_equip)
  3460.  {
  3461. @@ -3493,18 +3498,18 @@
  3462.  }
  3463.  
  3464.  //
  3465. -// �A�C�e����
  3466. +// Items
  3467.  //
  3468.  
  3469.  /*==========================================
  3470. - * �X�L���ɂ�锃���l�C��
  3471. + * Update buying value by skills
  3472.   *------------------------------------------*/
  3473.  int pc_modifybuyvalue(struct map_session_data *sd,int orig_value)
  3474.  {
  3475.  	int skill,val = orig_value,rate1 = 0,rate2 = 0;
  3476. -	if((skill=pc_checkskill(sd,MC_DISCOUNT))>0)	// �f�B�X�J�E���g
  3477. +	if((skill=pc_checkskill(sd,MC_DISCOUNT))>0)	// merchant discount
  3478.  		rate1 = 5+skill*2-((skill==10)? 1:0);
  3479. -	if((skill=pc_checkskill(sd,RG_COMPULSION))>0)	// �R���p���V�����f�B�X�J�E���g
  3480. +	if((skill=pc_checkskill(sd,RG_COMPULSION))>0)	 // rogue discount
  3481.  		rate2 = 5+skill*4;
  3482.  	if(rate1 < rate2) rate1 = rate2;
  3483.  	if(rate1)
  3484. @@ -3516,12 +3521,12 @@
  3485.  }
  3486.  
  3487.  /*==========================================
  3488. - * �X�L���ɂ��?��l�C��
  3489. + * Update selling value by skills
  3490.   *------------------------------------------*/
  3491.  int pc_modifysellvalue(struct map_session_data *sd,int orig_value)
  3492.  {
  3493.  	int skill,val = orig_value,rate = 0;
  3494. -	if((skill=pc_checkskill(sd,MC_OVERCHARGE))>0)	// �I?�o?�`��?�W
  3495. +	if((skill=pc_checkskill(sd,MC_OVERCHARGE))>0)	//OverCharge
  3496.  		rate = 5+skill*2-((skill==10)? 1:0);
  3497.  	if(rate)
  3498.  		val = (int)((double)orig_value*(double)(100+rate)/100.);
  3499. @@ -3532,8 +3537,8 @@
  3500.  }
  3501.  
  3502.  /*==========================================
  3503. - * �A�C�e���𔃂����bɁA�V�����A�C�e�������g�����A
  3504. - * 3�������ɂ����邩�m�F
  3505. + * Checking if we have enough place on inventory for new item
  3506. + * Make sure to take 30k as limit (for client I guess)
  3507.   *------------------------------------------*/
  3508.  int pc_checkadditem(struct map_session_data *sd,int nameid,int amount)
  3509.  {
  3510. @@ -3566,7 +3571,8 @@
  3511.  }
  3512.  
  3513.  /*==========================================
  3514. - * �󂫃A�C�e�����̌�?
  3515. + * Return number of available place in inventory
  3516. + * Each non stackable item will reduce place by 1
  3517.   *------------------------------------------*/
  3518.  int pc_inventoryblank(struct map_session_data *sd)
  3519.  {
  3520. @@ -3726,7 +3732,7 @@
  3521.  }
  3522.  
  3523.  /*==========================================
  3524. - * �A�C�e����T���āA�C���f�b�N�X��Ԃ�
  3525. + * Searching a specified itemid in inventory and return his stored index
  3526.   *------------------------------------------*/
  3527.  int pc_search_inventory(struct map_session_data *sd,int item_id)
  3528.  {
  3529. @@ -3738,7 +3744,16 @@
  3530.  }
  3531.  
  3532.  /*==========================================
  3533. - * �A�C�e���lj��B��?�̂�item�\��?��?���𖳎�
  3534. + * Attempt tp add a new item in inventory
  3535. + * return
  3536. +        0 = success
  3537. +        1 = invalid itemid not found or negative amount
  3538. +        2 = overweight
  3539. +		3 = ?
  3540. +        4 = no free place found
  3541. +        5 = max amount reached
  3542. +		6 = ?
  3543. +		7 = stack limitation
  3544.   *------------------------------------------*/
  3545.  int pc_additem(struct map_session_data *sd,struct item *item_data,int amount,e_log_pick_type log_type)
  3546.  {
  3547. @@ -3821,7 +3836,10 @@
  3548.  }
  3549.  
  3550.  /*==========================================
  3551. - * �A�C�e�������炷
  3552. + * Remove an item at index n from inventory by amount
  3553. + * return
  3554. + *	0 = succes
  3555. + *	1 = invalid itemid or negative amount
  3556.   *------------------------------------------*/
  3557.  int pc_delitem(struct map_session_data *sd,int n,int amount,int type, short reason, e_log_pick_type log_type)
  3558.  {
  3559. @@ -3849,7 +3867,10 @@
  3560.  }
  3561.  
  3562.  /*==========================================
  3563. - * �A�C�e���𗎂�
  3564. + * Attempt to drop an item
  3565. + * return
  3566. + *	0 = fail
  3567. + *	1 = success
  3568.   *------------------------------------------*/
  3569.  int pc_dropitem(struct map_session_data *sd,int n,int amount)
  3570.  {
  3571. @@ -3890,7 +3911,10 @@
  3572.  }
  3573.  
  3574.  /*==========================================
  3575. - * �A�C�e�����E��
  3576. + * Attempt to pickup an item
  3577. + * return
  3578. + *	0 = fail
  3579. + *	1 = success
  3580.   *------------------------------------------*/
  3581.  int pc_takeitem(struct map_session_data *sd,struct flooritem_data *fitem)
  3582.  {
  3583. @@ -3903,7 +3927,7 @@
  3584.  	nullpo_ret(fitem);
  3585.  
  3586.  	if(!check_distance_bl(&fitem->bl, &sd->bl, 2) && sd->ud.skillid!=BS_GREED)
  3587. -		return 0;	// ����������
  3588. +		return 0;	// Distance is too far
  3589.  
  3590.  	if (sd->status.party_id)
  3591.  		p = party_search(sd->status.party_id);
  3592. @@ -3957,6 +3981,12 @@
  3593.  	return 1;
  3594.  }
  3595.  
  3596. +/*==========================================
  3597. + * Can we use the item  ?
  3598. + * Return
  3599. + *	0 = no
  3600. + *	1 = yes
  3601. + *------------------------------------------*/
  3602.  int pc_isUseitem(struct map_session_data *sd,int n)
  3603.  {
  3604.  	struct item_data *item;
  3605. @@ -3975,7 +4005,7 @@
  3606.  	if( !item->script ) //if it has no script, you can't really consume it!
  3607.  		return 0;
  3608.  
  3609. -	switch( nameid )
  3610. +	switch( nameid ) //@TODO, lot oh harcoded nameid here
  3611.  	{
  3612.  		case 605: // Anodyne
  3613.  			if( map_flag_gvg(sd->bl.m) )
  3614. @@ -4117,7 +4147,10 @@
  3615.  }
  3616.  
  3617.  /*==========================================
  3618. - * �A�C�e�����g��
  3619. + * Last checks et use item
  3620. + * return
  3621. + *	0 = fail
  3622. + *	1 = success
  3623.   *------------------------------------------*/
  3624.  int pc_useitem(struct map_session_data *sd,int n)
  3625.  {
  3626. @@ -4240,7 +4273,10 @@
  3627.  }
  3628.  
  3629.  /*==========================================
  3630. - * �J?�g�A�C�e���lj��B��?�̂�item�\��?��?���𖳎�
  3631. + * Add item on cart for given index
  3632. + * return
  3633. + *	0 = success
  3634. + *	1 = fail
  3635.   *------------------------------------------*/
  3636.  int pc_cart_additem(struct map_session_data *sd,struct item *item_data,int amount,e_log_pick_type log_type)
  3637.  {
  3638. @@ -4306,7 +4342,10 @@
  3639.  }
  3640.  
  3641.  /*==========================================
  3642. - * �J?�g�A�C�e�������炷
  3643. + * Delete item on cart for given index
  3644. + * return
  3645. + *	0 = success
  3646. + *	1 = fail
  3647.   *------------------------------------------*/
  3648.  int pc_cart_delitem(struct map_session_data *sd,int n,int amount,int type,e_log_pick_type log_type)
  3649.  {
  3650. @@ -4333,7 +4372,10 @@
  3651.  }
  3652.  
  3653.  /*==========================================
  3654. - * �J?�g�փA�C�e���ړ�
  3655. + * Transfert item from inventory to cart
  3656. + * return
  3657. + *	0 = fail
  3658. + *	1 = succes
  3659.   *------------------------------------------*/
  3660.  int pc_putitemtocart(struct map_session_data *sd,int idx,int amount)
  3661.  {
  3662. @@ -4356,7 +4398,10 @@
  3663.  }
  3664.  
  3665.  /*==========================================
  3666. - * �J?�g?�̃A�C�e��?�m�F(��?�̍�����Ԃ�)
  3667. + * Get number of item on cart
  3668. + * return
  3669. +        -1 = itemid not found or no amount found
  3670. +        x = remaining itemid on cart after get
  3671.   *------------------------------------------*/
  3672.  int pc_cartitem_amount(struct map_session_data* sd, int idx, int amount)
  3673.  {
  3674. @@ -4372,7 +4417,10 @@
  3675.  }
  3676.  
  3677.  /*==========================================
  3678. - * �J?�g����A�C�e���ړ�
  3679. + * Retrieve an item at index idx from cart
  3680. + * return
  3681. + *	0 = player not found or (FIXME) succes (from pc_cart_delitem)
  3682. + *	1 = failure
  3683.   *------------------------------------------*/
  3684.  int pc_getitemfromcart(struct map_session_data *sd,int idx,int amount)
  3685.  {
  3686. @@ -4396,7 +4444,7 @@
  3687.  }
  3688.  
  3689.  /*==========================================
  3690. - * �X�e�B���i���J
  3691. + *  Display item stolen msg to player sd
  3692.   *------------------------------------------*/
  3693.  int pc_show_steal(struct block_list *bl,va_list ap)
  3694.  {
  3695. @@ -4418,7 +4466,10 @@
  3696.  	return 0;
  3697.  }
  3698.  /*==========================================
  3699. - *
  3700. + * Stole an item from bl (mob)
  3701. + * return
  3702. + *	0 = fail
  3703. + *	1 = succes
  3704.   *------------------------------------------*/
  3705.  int pc_steal_item(struct map_session_data *sd,struct block_list *bl, int lv)
  3706.  {
  3707. @@ -4499,7 +4550,10 @@
  3708.  }
  3709.  
  3710.  /*==========================================
  3711. - *
  3712. + * Stole zeny from bl (mob)
  3713. + * return
  3714. + *	0 = fail
  3715. + *	1 = success
  3716.   *------------------------------------------*/
  3717.  int pc_steal_coin(struct map_session_data *sd,struct block_list *target)
  3718.  {
  3719. @@ -4699,7 +4753,11 @@
  3720.  }
  3721.  
  3722.  /*==========================================
  3723. - * PC�̃����_����?�v
  3724. + * Warp player sd to random location on current map
  3725. + * may fail if no Cell walkable found (1000 attempt)
  3726. + * return
  3727. + *	0 = fail or FIXME succes (from pc_setpos)
  3728. + *  x(1|2) = fail
  3729.   *------------------------------------------*/
  3730.  int pc_randomwarp(struct map_session_data *sd, clr_type type)
  3731.  {
  3732. @@ -4710,7 +4768,7 @@
  3733.  
  3734.  	m=sd->bl.m;
  3735.  
  3736. -	if (map[sd->bl.m].flag.noteleport)	// �e���|?�g�֎~
  3737. +	if (map[sd->bl.m].flag.noteleport) //Teleport forbiden
  3738.  		return 0;
  3739.  
  3740.  	do{
  3741. @@ -4774,10 +4832,10 @@
  3742.  }
  3743.  
  3744.  //
  3745. -// ����??
  3746. +// Skills
  3747.  //
  3748.  /*==========================================
  3749. - * �X�L����?�� ���L���Ă����ꍇLv���Ԃ�
  3750. + * Return player sd skilllv learned for given skill
  3751.   *------------------------------------------*/
  3752.  int pc_checkskill(struct map_session_data *sd,int skill_id)
  3753.  {
  3754. @@ -4859,7 +4917,8 @@
  3755.  }
  3756.  
  3757.  /*==========================================
  3758. - * ? ���i�̃`�F�b�N
  3759. + * Return equiped itemid? on player sd at pos
  3760. + * if -1 mean nothing equiped
  3761.   *------------------------------------------*/
  3762.  int pc_checkequip(struct map_session_data *sd,int pos)
  3763.  {
  3764. @@ -5562,7 +5621,7 @@
  3765.  	return;
  3766.  }
  3767.  /*==========================================
  3768. - * ??�l�擾
  3769. + * Give x exp at sd player and calculate remaining exp for next lvl
  3770.   *------------------------------------------*/
  3771.  int pc_gainexp(struct map_session_data *sd, struct block_list *src, unsigned int base_exp,unsigned int job_exp,bool quest)
  3772.  {
  3773. @@ -5655,8 +5714,10 @@
  3774.  }
  3775.  
  3776.  /*==========================================
  3777. - * base level���K�v??�l�v�Z
  3778. + * base level exp lookup.
  3779.   *------------------------------------------*/
  3780. +
  3781. +///How much bexp do player need for next level
  3782.  unsigned int pc_nextbaseexp(struct map_session_data *sd)
  3783.  {
  3784.  	nullpo_ret(sd);
  3785. @@ -5667,6 +5728,7 @@
  3786.  	return exp_table[pc_class2idx(sd->status.class_)][0][sd->status.base_level-1];
  3787.  }
  3788.  
  3789. +///How much bexp do player need for this level
  3790.  unsigned int pc_thisbaseexp(struct map_session_data *sd)
  3791.  {
  3792.  	if(sd->status.base_level>pc_maxbaselv(sd) || sd->status.base_level<=1)
  3793. @@ -5677,8 +5739,13 @@
  3794.  
  3795.  
  3796.  /*==========================================
  3797. - * job level���K�v??�l�v�Z
  3798. + * job level exp lookup
  3799. + * return
  3800. + *	0 = not found
  3801. + *	x = exp for level
  3802.   *------------------------------------------*/
  3803. +
  3804. +///How much jexp do player need for next level
  3805.  unsigned int pc_nextjobexp(struct map_session_data *sd)
  3806.  {
  3807.  	nullpo_ret(sd);
  3808. @@ -5688,6 +5755,7 @@
  3809.  	return exp_table[pc_class2idx(sd->status.class_)][1][sd->status.job_level-1];
  3810.  }
  3811.  
  3812. +///How much jexp do player need for next level
  3813.  unsigned int pc_thisjobexp(struct map_session_data *sd)
  3814.  {
  3815.  	if(sd->status.job_level>pc_maxjoblv(sd) || sd->status.job_level<=1)
  3816. @@ -5857,7 +5925,8 @@
  3817.  }
  3818.  
  3819.  /*==========================================
  3820. - * �X�L���|�C���g����U��
  3821. + * Update skilllv for player sd
  3822. + * Skill point allocation
  3823.   *------------------------------------------*/
  3824.  int pc_skillup(struct map_session_data *sd,int skill_num)
  3825.  {
  3826. @@ -6353,6 +6422,9 @@
  3827.  	sd->canlog_tick = gettick();
  3828.  }
  3829.  
  3830. +/*==========================================
  3831. + * Invoked when a player have negative current hp
  3832. + *------------------------------------------*/
  3833.  int pc_dead(struct map_session_data *sd,struct block_list *src)
  3834.  {
  3835.  	int i=0,j=0,k=0;
  3836. @@ -6684,10 +6756,10 @@
  3837.  		guild_guildaura_refresh(sd,GD_HAWKEYES,guild_checkskill(sd->state.gmaster_flag,GD_HAWKEYES));
  3838.  	}
  3839.  }
  3840. -// script? �A
  3841. +// script
  3842.  //
  3843.  /*==========================================
  3844. - * script�pPC�X�e?�^�X?�ݏo��
  3845. + * script reading pc status registry
  3846.   *------------------------------------------*/
  3847.  int pc_readparam(struct map_session_data* sd,int type)
  3848.  {
  3849. @@ -6733,7 +6805,7 @@
  3850.  }
  3851.  
  3852.  /*==========================================
  3853. - * script�pPC�X�e?�^�X�ݒ�
  3854. + * script set pc status registry
  3855.   *------------------------------------------*/
  3856.  int pc_setparam(struct map_session_data *sd,int type,int val)
  3857.  {
  3858. @@ -6901,7 +6973,9 @@
  3859.  }
  3860.  
  3861.  /*==========================================
  3862. - * HP/SP��
  3863. + * HP/SP Recovery
  3864. + * Heal player hp nad/or sp linearly
  3865. + * Calculate bonus by status
  3866.   *------------------------------------------*/
  3867.  int pc_itemheal(struct map_session_data *sd,int itemid, int hp,int sp)
  3868.  {
  3869. @@ -6967,7 +7041,8 @@
  3870.  }
  3871.  
  3872.  /*==========================================
  3873. - * HP/SP��
  3874. + * HP/SP Recovery
  3875. + * Heal player hp nad/or sp by rate
  3876.   *------------------------------------------*/
  3877.  int pc_percentheal(struct map_session_data *sd,int hp,int sp)
  3878.  {
  3879. @@ -7005,9 +7080,7 @@
  3880.  }
  3881.  
  3882.  /*==========================================
  3883. - * �E?�X
  3884. - * ��?	job �E�� 0�`23
  3885. - *		upper �ʏ� 0, ?�� 1, �{�q 2, ���̂܂� -1
  3886. + * Called when player changing job
  3887.   * Rewrote to make it tidider [Celest]
  3888.   *------------------------------------------*/
  3889.  int pc_jobchange(struct map_session_data *sd,int job, int upper)
  3890. @@ -7099,7 +7172,7 @@
  3891.  	for(i=0;i<EQI_MAX;i++) {
  3892.  		if(sd->equip_index[i] >= 0)
  3893.  			if(!pc_isequip(sd,sd->equip_index[i]))
  3894. -				pc_unequipitem(sd,sd->equip_index[i],2);	// ?���O��
  3895. +				pc_unequipitem(sd,sd->equip_index[i],2);	// unequip invalid item for class
  3896.  	}
  3897.  
  3898.  	//Change look, if disguised, you need to undisguise 
  3899. @@ -7170,7 +7243,7 @@
  3900.  }
  3901.  
  3902.  /*==========================================
  3903. - * ������?�X
  3904. + * Tell client player sd has change equipement
  3905.   *------------------------------------------*/
  3906.  int pc_equiplookall(struct map_session_data *sd)
  3907.  {
  3908. @@ -7187,7 +7260,7 @@
  3909.  }
  3910.  
  3911.  /*==========================================
  3912. - * ������?�X
  3913. + * Tell client player sd has change look (hair,equip...)
  3914.   *------------------------------------------*/
  3915.  int pc_changelook(struct map_session_data *sd,int type,int val)
  3916.  {
  3917. @@ -7247,7 +7320,7 @@
  3918.  }
  3919.  
  3920.  /*==========================================
  3921. - * �t?�i(��,�y�R,�J?�g)�ݒ�
  3922. + * Give an option (type) to player (sd) and display it to client
  3923.   *------------------------------------------*/
  3924.  int pc_setoption(struct map_session_data *sd,int type)
  3925.  {
  3926. @@ -7364,7 +7437,7 @@
  3927.  }
  3928.  
  3929.  /*==========================================
  3930. - * �J?�g�ݒ�
  3931. + * Give player a cart
  3932.   *------------------------------------------*/
  3933.  int pc_setcart(struct map_session_data *sd,int type) {
  3934.  #ifndef NEW_CARTS
  3935. @@ -7414,7 +7487,7 @@
  3936.  }
  3937.  
  3938.  /*==========================================
  3939. - * ��ݒ�
  3940. + * Give player a falcon
  3941.   *------------------------------------------*/
  3942.  int pc_setfalcon(TBL_PC* sd, int flag)
  3943.  {
  3944. @@ -7429,7 +7502,7 @@
  3945.  }
  3946.  
  3947.  /*==========================================
  3948. - * �y�R�y�R�ݒ�
  3949. + *  Set player riding
  3950.   *------------------------------------------*/
  3951.  int pc_setriding(TBL_PC* sd, int flag)
  3952.  {
  3953. @@ -7444,7 +7517,7 @@
  3954.  }
  3955.  
  3956.  /*==========================================
  3957. - * 
  3958. + * Give player a mado
  3959.   *------------------------------------------*/
  3960.  int pc_setmadogear(TBL_PC* sd, int flag)
  3961.  {
  3962. @@ -7459,7 +7532,7 @@
  3963.  }
  3964.  
  3965.  /*==========================================
  3966. - * �A�C�e���h���b�v�•s�”���
  3967. + * Check if player can drop an item
  3968.   *------------------------------------------*/
  3969.  int pc_candrop(struct map_session_data *sd, struct item *item)
  3970.  {
  3971. @@ -7471,7 +7544,8 @@
  3972.  }
  3973.  
  3974.  /*==========================================
  3975. - * script�p??�̒l��?��
  3976. + * Read ram register for player sd
  3977. + * get val (int) from reg for player sd
  3978.   *------------------------------------------*/
  3979.  int pc_readreg(struct map_session_data* sd, int reg)
  3980.  {
  3981. @@ -7483,7 +7557,8 @@
  3982.  	return ( i < sd->reg_num ) ? sd->reg[i].data : 0;
  3983.  }
  3984.  /*==========================================
  3985. - * script�p??�̒l��ݒ�
  3986. + * Set ram register for player sd
  3987. + * memo val(int) at reg for player sd
  3988.   *------------------------------------------*/
  3989.  int pc_setreg(struct map_session_data* sd, int reg, int val)
  3990.  {
  3991. @@ -7511,7 +7586,8 @@
  3992.  }
  3993.  
  3994.  /*==========================================
  3995. - * script�p������??�̒l��?��
  3996. + * Read ram register for player sd
  3997. + * get val (str) from reg for player sd
  3998.   *------------------------------------------*/
  3999.  char* pc_readregstr(struct map_session_data* sd, int reg)
  4000.  {
  4001. @@ -7523,7 +7599,8 @@
  4002.  	return ( i < sd->regstr_num ) ? sd->regstr[i].data : NULL;
  4003.  }
  4004.  /*==========================================
  4005. - * script�p������??�̒l��ݒ�
  4006. + * Set ram register for player sd
  4007. + * memo val(str) at reg for player sd
  4008.   *------------------------------------------*/
  4009.  int pc_setregstr(struct map_session_data* sd, int reg, const char* str)
  4010.  {
  4011. @@ -7803,7 +7880,7 @@
  4012.  }
  4013.  
  4014.  /*==========================================
  4015. - * �C�x���g�^�C�}??��
  4016. + * Exec eventtimer for player sd (retrieved from map_session (id))
  4017.   *------------------------------------------*/
  4018.  static int pc_eventtimer(int tid, unsigned int tick, int id, intptr_t data)
  4019.  {
  4020. @@ -7828,7 +7905,7 @@
  4021.  }
  4022.  
  4023.  /*==========================================
  4024. - * �C�x���g�^�C�}?�lj�
  4025. + * Add eventtimer for player sd ?
  4026.   *------------------------------------------*/
  4027.  int pc_addeventtimer(struct map_session_data *sd,int tick,const char *name)
  4028.  {
  4029. @@ -7846,7 +7923,7 @@
  4030.  }
  4031.  
  4032.  /*==========================================
  4033. - * �C�x���g�^�C�}?�폜
  4034. + * Del eventtimer for player sd ?
  4035.   *------------------------------------------*/
  4036.  int pc_deleventtimer(struct map_session_data *sd,const char *name)
  4037.  {
  4038. @@ -7876,7 +7953,7 @@
  4039.  }
  4040.  
  4041.  /*==========================================
  4042. - * �C�x���g�^�C�}?�J�E���g�l�lj�
  4043. + * Update eventtimer count for player sd
  4044.   *------------------------------------------*/
  4045.  int pc_addeventtimercount(struct map_session_data *sd,const char *name,int tick)
  4046.  {
  4047. @@ -7895,7 +7972,7 @@
  4048.  }
  4049.  
  4050.  /*==========================================
  4051. - * �C�x���g�^�C�}?�S�폜
  4052. + * Remove all eventtimer for player sd
  4053.   *------------------------------------------*/
  4054.  int pc_cleareventtimer(struct map_session_data *sd)
  4055.  {
  4056. @@ -8068,7 +8145,7 @@
  4057.  	return ret;
  4058.  }
  4059.  /*==========================================
  4060. - * Attempt to equip item in inventory index 'n' in the EQP_ 'req_pos'
  4061. + * Equip item on player sd at req_pos from inventory index n
  4062.   *------------------------------------------*/
  4063.  int pc_equipitem(struct map_session_data *sd,int n,int req_pos)
  4064.  {
  4065. @@ -8269,7 +8346,7 @@
  4066.  }
  4067.  
  4068.  /*==========================================
  4069. - * ? �����������O��
  4070. + * Called when attemting to unequip an item from player
  4071.   * type:
  4072.   * 0 - only unequip
  4073.   * 1 - calculate status after unequipping
  4074. @@ -8432,8 +8509,8 @@
  4075.  }
  4076.  
  4077.  /*==========================================
  4078. - * �A�C�e����index��?���l�߂���
  4079. - * ? ���i��?���”\�`�F�b�N���s�Ȃ�
  4080. + * Checking if player (sd) have unauthorize, invalide item
  4081. + * on inventory, cart, equiped for the map (item_noequip)
  4082.   *------------------------------------------*/
  4083.  int pc_checkitem(struct map_session_data *sd)
  4084.  {
  4085. @@ -8513,7 +8590,7 @@
  4086.  }
  4087.  
  4088.  /*==========================================
  4089. - * PVP���ʌv�Z�p(foreachinarea)
  4090. + * Update PVP rank for sd1 in cmp to sd2
  4091.   *------------------------------------------*/
  4092.  int pc_calc_pvprank_sub(struct block_list *bl,va_list ap)
  4093.  {
  4094. @@ -8532,7 +8609,8 @@
  4095.  	return 0;
  4096.  }
  4097.  /*==========================================
  4098. - * PVP���ʌv�Z
  4099. + * Calculate new rank beetween all present players (map_foreachinarea)
  4100. + * and display result
  4101.   *------------------------------------------*/
  4102.  int pc_calc_pvprank(struct map_session_data *sd)
  4103.  {
  4104. @@ -8547,7 +8625,7 @@
  4105.  	return sd->pvp_rank;
  4106.  }
  4107.  /*==========================================
  4108. - * PVP���ʌv�Z(timer)
  4109. + * Calculate next sd ranking calculation from config
  4110.   *------------------------------------------*/
  4111.  int pc_calc_pvprank_timer(int tid, unsigned int tick, int id, intptr_t data)
  4112.  {
  4113. @@ -8569,7 +8647,10 @@
  4114.  }
  4115.  
  4116.  /*==========================================
  4117. - * sd�͌������Ă��邩(?���̏ꍇ�͑����char_id��Ԃ�)
  4118. + * Checking if sd is married
  4119. + * Return
  4120. + *	partner_id = yes,
  4121. + *	0 = no
  4122.   *------------------------------------------*/
  4123.  int pc_ismarried(struct map_session_data *sd)
  4124.  {
  4125. @@ -8581,7 +8662,10 @@
  4126.  		return 0;
  4127.  }
  4128.  /*==========================================
  4129. - * sd��dstsd�ƌ���(dstsd��sd�̌���?�������bɍs��)
  4130. + * Marry player sd to player dstsd
  4131. + * return
  4132. + *	-1 = fail
  4133. + *	0 = success
  4134.   *------------------------------------------*/
  4135.  int pc_marriage(struct map_session_data *sd,struct map_session_data *dstsd)
  4136.  {
  4137. @@ -8596,6 +8680,9 @@
  4138.  
  4139.  /*==========================================
  4140.   * Divorce sd from its partner
  4141. + * return
  4142. + *	-1 = fail
  4143. + *	0 = success
  4144.   *------------------------------------------*/
  4145.  int pc_divorce(struct map_session_data *sd)
  4146.  {
  4147. @@ -8634,7 +8721,7 @@
  4148.  }
  4149.  
  4150.  /*==========================================
  4151. - * sd�̑����map_session_data��Ԃ�
  4152. + * Get sd partner charid. (Married partner)
  4153.   *------------------------------------------*/
  4154.  struct map_session_data *pc_get_partner(struct map_session_data *sd)
  4155.  {
  4156. @@ -8645,6 +8732,9 @@
  4157.  	return NULL;
  4158.  }
  4159.  
  4160. +/*==========================================
  4161. + * Get sd father charid. (Need to be baby)
  4162. + *------------------------------------------*/
  4163.  struct map_session_data *pc_get_father (struct map_session_data *sd)
  4164.  {
  4165.  	if (sd && sd->class_&JOBL_BABY && sd->status.father > 0)
  4166. @@ -8654,6 +8744,9 @@
  4167.  	return NULL;
  4168.  }
  4169.  
  4170. +/*==========================================
  4171. + * Get sd mother charid. (Need to be baby)
  4172. + *------------------------------------------*/
  4173.  struct map_session_data *pc_get_mother (struct map_session_data *sd)
  4174.  {
  4175.  	if (sd && sd->class_&JOBL_BABY && sd->status.mother > 0)
  4176. @@ -8663,6 +8756,9 @@
  4177.  	return NULL;
  4178.  }
  4179.  
  4180. +/*==========================================
  4181. + * Get sd children charid. (Need to be married)
  4182. + *------------------------------------------*/
  4183.  struct map_session_data *pc_get_child (struct map_session_data *sd)
  4184.  {
  4185.  	if (sd && pc_ismarried(sd) && sd->status.child > 0)
  4186. @@ -8672,6 +8768,9 @@
  4187.  	return NULL;
  4188.  }
  4189.  
  4190. +/*==========================================
  4191. + * Set player sd to bleed. (losing hp and/or sp each diff_tick)
  4192. + *------------------------------------------*/
  4193.  void pc_bleeding (struct map_session_data *sd, unsigned int diff_tick)
  4194.  {
  4195.  	int hp = 0, sp = 0;
  4196. @@ -8733,7 +8832,7 @@
  4197.  }
  4198.  
  4199.  /*==========================================
  4200. - * �Z?�u�|�C���g�̕ۑ�
  4201. + * Memo player sd savepoint. (map,x,y)
  4202.   *------------------------------------------*/
  4203.  int pc_setsavepoint(struct map_session_data *sd, short mapindex,int x,int y)
  4204.  {
  4205. @@ -8747,7 +8846,7 @@
  4206.  }
  4207.  
  4208.  /*==========================================
  4209. - * �����Z?�u (timer??)
  4210. + * Save 1 player data  at autosave intervalle
  4211.   *------------------------------------------*/
  4212.  int pc_autosave(int tid, unsigned int tick, int id, intptr_t data)
  4213.  {
  4214. @@ -8864,7 +8963,7 @@
  4215.  	skill = cap_value(pc_checkskill(sd,NC_MAINFRAME),0,4);
  4216.  	if( sd->sc.data[SC_OVERHEAT_LIMITPOINT] ) {
  4217.  		heat += sd->sc.data[SC_OVERHEAT_LIMITPOINT]->val1;
  4218. -		status_change_end(&sd->bl,SC_OVERHEAT_LIMITPOINT,-1);
  4219. +		status_change_end(&sd->bl,SC_OVERHEAT_LIMITPOINT,INVALID_TIMER);
  4220.  	}
  4221.  
  4222.  	heat = max(0,heat); // Avoid negative HEAT
  4223. @@ -9067,11 +9166,8 @@
  4224.  }
  4225.  
  4226.  /*==========================================
  4227. - * DB reading.
  4228. - * exp.txt        - required experience values
  4229. - * skill_tree.txt - skill tree for every class
  4230. - * attr_fix.txt   - elemental adjustment table
  4231. - * statpoint.txt  - status points per base level
  4232. + * sub DB reading.
  4233. + * fonction used to read  skill_tree.txt
  4234.   *------------------------------------------*/
  4235.  static bool pc_readdb_skilltree(char* fields[], int columns, int current)
  4236.  {
  4237. @@ -9121,13 +9217,19 @@
  4238.  	return true;
  4239.  }
  4240.  
  4241. +/*==========================================
  4242. + * pc DB reading.
  4243. + * exp.txt        - required experience values
  4244. + * skill_tree.txt - skill tree for every class
  4245. + * attr_fix.txt   - elemental adjustment table
  4246. + *------------------------------------------*/
  4247.  int pc_readdb(void)
  4248.  {
  4249.  	int i,j,k;
  4250.  	FILE *fp;
  4251.  	char line[24000],*p;
  4252.  
  4253. -	// �K�v??�l?��?��
  4254. +    //reset
  4255.  	memset(exp_table,0,sizeof(exp_table));
  4256.  	memset(max_level,0,sizeof(max_level));
  4257.  
  4258. @@ -9212,12 +9314,11 @@
  4259.  	}
  4260.  	ShowStatus("Done reading '"CL_WHITE"%s"CL_RESET"'.\n","exp.txt");
  4261.  
  4262. -	// �X�L���c��?
  4263. +	// Reset and read skilltree
  4264.  	memset(skill_tree,0,sizeof(skill_tree));
  4265. -
  4266.  	sv_readdb(db_path, DBPATH"skill_tree.txt", ',', 3+MAX_PC_SKILL_REQUIRE*2, 4+MAX_PC_SKILL_REQUIRE*2, -1, &pc_readdb_skilltree);
  4267.  
  4268. -	// ?���C���e?�u��
  4269. +	// Reset then read attr_fix
  4270.  	for(i=0;i<4;i++)
  4271.  		for(j=0;j<ELE_MAX;j++)
  4272.  			for(k=0;k<ELE_MAX;k++)
  4273. @@ -9269,7 +9370,7 @@
  4274.  	fclose(fp);
  4275.  	ShowStatus("Done reading '"CL_WHITE"%s"CL_RESET"'.\n","attr_fix.txt");
  4276.  
  4277. -	// �X�L���c��?
  4278. +    // reset then read statspoint
  4279.  	memset(statp,0,sizeof(statp));
  4280.  	i=1;
  4281.  
  4282. @@ -9400,7 +9501,7 @@
  4283.  	return;
  4284.  }
  4285.  /*==========================================
  4286. - * pc? �W����
  4287. + * pc Init/Terminate
  4288.   *------------------------------------------*/
  4289.  void do_final_pc(void) {
  4290.  
  4291. Index: src/map/pc.h
  4292. --- src/map/pc.h Base (BASE)
  4293. +++ src/map/pc.h Locally Modified (Based On LOCAL)
  4294. @@ -174,7 +174,7 @@
  4295.  	unsigned short mapindex;
  4296.  	unsigned char head_dir; //0: Look forward. 1: Look right, 2: Look left.
  4297.  	unsigned int client_tick;
  4298. -	int npc_id,areanpc_id,npc_shopid,touching_id;
  4299. +	int npc_id,areanpc_id,npc_shopid,touching_id; //for script follow scriptoid;   ,npcid
  4300.  	int npc_item_flag; //Marks the npc_id with which you can use items during interactions with said npc (see script command enable_itemuse)
  4301.  	int npc_menu; // internal variable, used in npc menu handling
  4302.  	int npc_amount;
  4303. Index: src/map/pet.c
  4304. --- src/map/pet.c Base (BASE)
  4305. +++ src/map/pet.c Locally Modified (Based On LOCAL)
  4306. @@ -1031,7 +1031,7 @@
  4307.  	memset(pd->loot->item,0,pd->loot->max * sizeof(struct item));
  4308.  	pd->loot->count = 0;
  4309.  	pd->loot->weight = 0;
  4310. -	pd->ud.canact_tick = gettick()+10000;	//	10*1000ms�̊ԏE��Ȃ�
  4311. +	pd->ud.canact_tick = gettick()+10000;	//prevent picked up during 10*1000ms
  4312.  
  4313.  	if (dlist->item)
  4314.  		add_timer(gettick()+540,pet_delay_item_drop,0,(intptr_t)dlist);
  4315. @@ -1195,7 +1195,9 @@
  4316.  }
  4317.  
  4318.  /*==========================================
  4319. - *�y�b�g�f�[�^�ǂݍ���
  4320. + * Pet read db data
  4321. + * pet_db.txt
  4322. + * pet_db2.txt
  4323.   *------------------------------------------*/ 
  4324.  int read_petdb()
  4325.  {
  4326. @@ -1343,7 +1345,7 @@
  4327.  }
  4328.  
  4329.  /*==========================================
  4330. - * �X�L���֌W������
  4331. + * Initialization process relationship skills
  4332.   *------------------------------------------*/
  4333.  int do_init_pet(void)
  4334.  {
  4335. Index: src/map/script.c
  4336. --- src/map/script.c Base (BASE)
  4337. +++ src/map/script.c Locally Modified (Based On LOCAL)
  4338. @@ -12441,7 +12441,7 @@
  4339.  			status_revive(&sd->bl, 100, 100);
  4340.  		else
  4341.  			status_percent_heal(&sd->bl, 100, 100);
  4342. -		clif_displaymessage(sd->fd,"You have been recovered!");
  4343. +		clif_displaymessage(sd->fd,msg_txt(680));
  4344.  	}
  4345.  	mapit_free(iter);
  4346.  	return 0;
  4347. Index: src/map/skill.c
  4348. --- src/map/skill.c Base (BASE)
  4349. +++ src/map/skill.c Locally Modified (Based On LOCAL)
  4350. @@ -5959,7 +5959,8 @@
  4351.  				break;
  4352.  			}
  4353.  			if(!battle_config.duel_allow_teleport && sd->duel_group && skilllv <= 2) { // duel restriction [LuzZza]
  4354. -				clif_displaymessage(sd->fd, "Duel: Can't use teleport in duel.");
  4355. +                                char output[128]; sprintf(output, msg_txt(365), skill_get_name(AL_TELEPORT));
  4356. +				clif_displaymessage(sd->fd, output); //"Duel: Can't use %s in duel."
  4357.  				break;
  4358.  			}
  4359.  
  4360. @@ -7861,7 +7862,7 @@
  4361.  
  4362.  	case RA_WUGDASH:
  4363.  		if( tsce ) {
  4364. -			clif_skill_nodamage(src,bl,skillid,skilllv,status_change_end(bl, type, -1));
  4365. +			clif_skill_nodamage(src,bl,skillid,skilllv,status_change_end(bl, type, INVALID_TIMER));
  4366.  			map_freeblock_unlock();
  4367.  			return 0;
  4368.  		}
  4369. @@ -12207,7 +12208,8 @@
  4370.  			break;
  4371.  		case AL_WARP:
  4372.  			if(!battle_config.duel_allow_teleport && sd->duel_group) { // duel restriction [LuzZza]
  4373. -				clif_displaymessage(sd->fd, "Duel: Can't use warp in duel.");
  4374. +                                char output[128]; sprintf(output, msg_txt(365), skill_get_name(AL_WARP));
  4375. +				clif_displaymessage(sd->fd, output); //"Duel: Can't use %s in duel."
  4376.  				return 0;
  4377.  			}
  4378.  			break;
  4379. @@ -13401,12 +13403,12 @@
  4380.  			time += time * sc->data[SC_SLOWCAST]->val2 / 100;
  4381.  		if (sc->data[SC_SUFFRAGIUM]) {
  4382.  			time -= time * sc->data[SC_SUFFRAGIUM]->val2 / 100;
  4383. -			status_change_end(bl, SC_SUFFRAGIUM, -1);
  4384. +			status_change_end(bl, SC_SUFFRAGIUM, INVALID_TIMER);
  4385.  		}
  4386.  		if (sc->data[SC_MEMORIZE]) {
  4387.  			time>>=1;
  4388.  			if ((--sc->data[SC_MEMORIZE]->val2) <= 0)
  4389. -				status_change_end(bl, SC_MEMORIZE, -1);
  4390. +				status_change_end(bl, SC_MEMORIZE, INVALID_TIMER);
  4391.  		}
  4392.  		if (sc->data[SC_POEMBRAGI])
  4393.  			time -= time * sc->data[SC_POEMBRAGI]->val2 / 100;		
  4394. Index: src/map/skill.h
  4395. --- src/map/skill.h Base (BASE)
  4396. +++ src/map/skill.h Locally Modified (Based On LOCAL)
  4397. @@ -87,7 +87,8 @@
  4398.  	int itemid[MAX_SKILL_ITEM_REQUIRE],amount[MAX_SKILL_ITEM_REQUIRE];
  4399.  };
  4400.  
  4401. -// �X�L���f?�^�x?�X
  4402. +// Database skills
  4403. +
  4404.  struct s_skill_db {
  4405.  	char name[NAME_LENGTH];
  4406.  	char desc[40];
  4407. @@ -116,7 +117,7 @@
  4408.  extern struct s_skill_db skill_db[MAX_SKILL_DB];
  4409.  
  4410.  #define MAX_SKILL_UNIT_LAYOUT	50
  4411. -#define MAX_SQUARE_LAYOUT		5	// 11*11�̃��j�b�g�z�u���ő�
  4412. +#define MAX_SQUARE_LAYOUT		5	// 11*11 Placement of a maximum unit
  4413.  #define MAX_SKILL_UNIT_COUNT ((MAX_SQUARE_LAYOUT*2+1)*(MAX_SQUARE_LAYOUT*2+1))
  4414.  struct s_skill_unit_layout {
  4415.  	int count;
  4416. @@ -195,7 +196,8 @@
  4417.  	UF_DUALMODE      = 0x0800,	// Spells should trigger both ontimer and onplace/onout/onleft effects.
  4418.  };
  4419.  
  4420. -// �A�C�e���쐬�f?�^�x?�X
  4421. +// Create Database item
  4422. +
  4423.  struct s_skill_produce_db {
  4424.  	int nameid, trigger;
  4425.  	int req_skill,req_skill_lv,itemlv;
  4426. @@ -203,14 +205,16 @@
  4427.  };
  4428.  extern struct s_skill_produce_db skill_produce_db[MAX_SKILL_PRODUCE_DB];
  4429.  
  4430. -// ��쐬�f?�^�x?�X
  4431. +// Creating database arrow
  4432. +
  4433.  struct s_skill_arrow_db {
  4434.  	int nameid, trigger;
  4435.  	int cre_id[MAX_ARROW_RESOURCE],cre_amount[MAX_ARROW_RESOURCE];
  4436.  };
  4437.  extern struct s_skill_arrow_db skill_arrow_db[MAX_SKILL_ARROW_DB];
  4438.  
  4439. -// �A�u���J�_�u���f?�^�x?�X
  4440. +// Abracadabra database
  4441. +
  4442.  struct s_skill_abra_db {
  4443.  	int skillid;
  4444.  	int req_lv;
  4445. @@ -227,7 +231,8 @@
  4446.  //Returns the cast type of the skill: ground cast, castend damage, castend no damage
  4447.  enum { CAST_GROUND, CAST_DAMAGE, CAST_NODAMAGE };
  4448.  int skill_get_casttype(int id); //[Skotlex]
  4449. -// �X�L���f?�^�x?�X�ւ̃A�N�Z�T
  4450. +
  4451. +// Accessor to the skills database
  4452.  //
  4453.  int skill_get_index( int id );
  4454.  int	skill_get_type( int id );
  4455. @@ -277,13 +282,13 @@
  4456.  int skill_cleartimerskill(struct block_list *src);
  4457.  int skill_addtimerskill(struct block_list *src,unsigned int tick,int target,int x,int y,int skill_id,int skill_lv,int type,int flag);
  4458.  
  4459. -// �lj�?��
  4460. +// Results? Added
  4461.  int skill_additional_effect( struct block_list* src, struct block_list *bl,int skillid,int skilllv,int attack_type,int dmg_lv,unsigned int tick);
  4462.  int skill_counter_additional_effect( struct block_list* src, struct block_list *bl,int skillid,int skilllv,int attack_type,unsigned int tick);
  4463.  int skill_blown(struct block_list* src, struct block_list* target, int count, int direction, int flag);
  4464.  int skill_break_equip(struct block_list *bl, unsigned short where, int rate, int flag);
  4465.  int skill_strip_equip(struct block_list *bl, unsigned short where, int rate, int lv, int time);
  4466. -// ���j�b�g�X�L��
  4467. +// Skills unit
  4468.  struct skill_unit_group* skill_id2group(int group_id);
  4469.  struct skill_unit_group *skill_unitsetting(struct block_list* src, short skillid, short skilllv, short x, short y, int flag);
  4470.  struct skill_unit *skill_initunit (struct skill_unit_group *group, int idx, int x, int y, int val1, int val2);
  4471. @@ -321,7 +326,7 @@
  4472.  // Guild skills [celest]
  4473.  int skill_guildaura_sub (struct map_session_data* sd, int id, int strvit, int agidex);
  4474.  
  4475. -// �r���L�����Z��
  4476. +// Chant canceled
  4477.  int skill_castcancel(struct block_list *bl,int type);
  4478.  
  4479.  int skill_sit (struct map_session_data *sd, int type);
  4480. @@ -335,7 +340,7 @@
  4481.  
  4482.  bool skill_check_cloaking(struct block_list *bl, struct status_change_entry *sce);
  4483.  
  4484. -// �X�e?�^�X�ُ�
  4485. +// Abnormal status
  4486.  int skill_enchant_elemental_end(struct block_list *bl, int type);
  4487.  int skillnotok(int skillid, struct map_session_data *sd);
  4488.  int skillnotok_hom(int skillid, struct homun_data *hd);
  4489. @@ -343,13 +348,13 @@
  4490.  
  4491.  int skill_chastle_mob_changetarget(struct block_list *bl,va_list ap);
  4492.  
  4493. -// �A�C�e���쐬
  4494. +// Item creation
  4495.  int skill_can_produce_mix( struct map_session_data *sd, int nameid, int trigger, int qty);
  4496.  int skill_produce_mix( struct map_session_data *sd, int skill_id, int nameid, int slot1, int slot2, int slot3, int qty );
  4497.  
  4498.  int skill_arrow_create( struct map_session_data *sd,int nameid);
  4499.  
  4500. -// mob�X�L���̂���
  4501. +// skills for the mob
  4502.  int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int skillid,int skilllv,unsigned int tick,int flag );
  4503.  int skill_castend_damage_id( struct block_list* src, struct block_list *bl,int skillid,int skilllv,unsigned int tick,int flag );
  4504.  int skill_castend_pos2( struct block_list *src, int x,int y,int skillid,int skilllv,unsigned int tick,int flag);
  4505. @@ -365,7 +370,7 @@
  4506.  	((id) >= BD_ADAPTATION     && (id) <= DC_SERVICEFORYOU) || ((id) >= CG_ARROWVULCAN && (id) <= CG_MARIONETTE) || \
  4507.  	((id) >= CG_LONGINGFREEDOM && (id) <= CG_TAROTCARD)     || ((id) >= WA_SWING_DANCE && (id) <= WM_UNLIMITED_HUMMING_VOICE))
  4508.  
  4509. -// �X�L���U?�ꊇ?��
  4510. +// Skill action, (return dmg,heal)
  4511.  int skill_attack( int attack_type, struct block_list* src, struct block_list *dsrc,struct block_list *bl,int skillid,int skilllv,unsigned int tick,int flag );
  4512.  
  4513.  void skill_reload(void);
  4514. Index: src/map/status.c
  4515. --- src/map/status.c Base (BASE)
  4516. +++ src/map/status.c Locally Modified (Based On LOCAL)
  4517. @@ -66,7 +66,7 @@
  4518.  	int randombonus_max[MAX_REFINE]; // cumulative maximum random bonus damage
  4519.  } refine_info[REFINE_TYPE_MAX];
  4520.  
  4521. -static int atkmods[3][MAX_WEAPON_TYPE];	// ����ATK�T�C�Y�C��(size_fix.txt)
  4522. +static int atkmods[3][MAX_WEAPON_TYPE];	//ATK weapon modification for size (size_fix.txt)
  4523.  static char job_bonus[CLASS_COUNT][MAX_LEVEL];
  4524.  
  4525.  static struct eri *sc_data_ers; //For sc_data entries
  4526. @@ -2059,7 +2059,7 @@
  4527.  
  4528.  	if (flag&2)
  4529.  	{	// change for sized monsters [Valaris]
  4530. -		if (md->special_state.size==1) {
  4531. +		if (md->special_state.size==SZ_MEDIUM) {
  4532.  			status->max_hp>>=1;
  4533.  			status->max_sp>>=1;
  4534.  			if (!status->max_hp) status->max_hp = 1;
  4535. @@ -2078,7 +2078,7 @@
  4536.  			if (!status->int_) status->int_ = 1;
  4537.  			if (!status->dex) status->dex = 1;
  4538.  			if (!status->luk) status->luk = 1;
  4539. -		} else if (md->special_state.size==2) {
  4540. +		} else if (md->special_state.size==SZ_BIG) {
  4541.  			status->max_hp<<=1;
  4542.  			status->max_sp<<=1;
  4543.  			status->hp=status->max_hp;
  4544. @@ -10888,6 +10888,13 @@
  4545.  	return true;
  4546.  }
  4547.  
  4548. +/*
  4549. +* Read status db
  4550. +* job1.txt
  4551. +* job2.txt
  4552. +* size_fixe.txt
  4553. +* refine_db.txt
  4554. +*/
  4555.  int status_readdb(void)
  4556.  {
  4557.  	int i, j;
  4558. @@ -10895,13 +10902,13 @@
  4559.  	// initialize databases to default
  4560.  	//
  4561.  
  4562. -	// job_db1.txt
  4563. +	// reset job_db1.txt data
  4564.  	memset(max_weight_base, 0, sizeof(max_weight_base));
  4565.  	memset(hp_coefficient, 0, sizeof(hp_coefficient));
  4566.  	memset(hp_coefficient2, 0, sizeof(hp_coefficient2));
  4567.  	memset(sp_coefficient, 0, sizeof(sp_coefficient));
  4568.  	memset(aspd_base, 0, sizeof(aspd_base));
  4569. -	// job_db2.txt
  4570. +	// reset job_db2.txt data
  4571.  	memset(job_bonus,0,sizeof(job_bonus)); // Job-specific stats bonus
  4572.  
  4573.  	// size_fix.txt
  4574. @@ -10937,7 +10944,7 @@
  4575.  }
  4576.  
  4577.  /*==========================================
  4578. - * �X�L���֌W������
  4579. + * Status db init and destroy.
  4580.   *------------------------------------------*/
  4581.  int do_init_status(void)
  4582.  {
  4583. Index: src/map/storage.c
  4584. --- src/map/storage.c Base (BASE)
  4585. +++ src/map/storage.c Locally Modified (Based On LOCAL)
  4586. @@ -27,7 +27,7 @@
  4587.  static DBMap* guild_storage_db; // int guild_id -> struct guild_storage*
  4588.  
  4589.  /*==========================================
  4590. - * �q�ɓ��A�C�e���\�[�g
  4591. + * Sort items in the warehouse
  4592.   *------------------------------------------*/
  4593.  static int storage_comp_item(const void *_i1, const void *_i2)
  4594.  {
  4595. @@ -43,6 +43,7 @@
  4596.  	return i1->nameid - i2->nameid;
  4597.  }
  4598.  
  4599. +//Sort item by storage_comp_item (nameid)
  4600.  static void storage_sortitem(struct item* items, unsigned int size)
  4601.  {
  4602.  	nullpo_retv(items);
  4603. @@ -54,9 +55,9 @@
  4604.  }
  4605.  
  4606.  /*==========================================
  4607. - * ����Ƃ�
  4608. + * Init/Terminate
  4609.   *------------------------------------------*/
  4610. -int do_init_storage(void) // map.c::do_init()����Ă΂��
  4611. +int do_init_storage(void) // Called from map.c::do_init()
  4612.  {
  4613.  	guild_storage_db=idb_alloc(DB_OPT_RELEASE_DATA);
  4614.  	return 1;
  4615. @@ -110,7 +111,9 @@
  4616.  	return 0;
  4617.  }
  4618.  
  4619. -// helper function
  4620. +/* helper function
  4621. + * checking if 2 item structure are identique
  4622. + */
  4623.  int compare_item(struct item *a, struct item *b)
  4624.  {
  4625.  	if( a->nameid == b->nameid &&
  4626. @@ -202,6 +205,10 @@
  4627.  
  4628.  /*==========================================
  4629.   * Add an item to the storage from the inventory.
  4630. + * @index : inventory idx
  4631. + * return
  4632. + *	0 : fail
  4633. + *	1 : success
  4634.   *------------------------------------------*/
  4635.  int storage_storageadd(struct map_session_data* sd, int index, int amount)
  4636.  {
  4637. @@ -226,7 +233,11 @@
  4638.  }
  4639.  
  4640.  /*==========================================
  4641. - * Retrieve an item from the storage.
  4642. + * Retrieve an item from the storage into inventory
  4643. + * @index : storage idx
  4644. + * return
  4645. + *	0 : fail
  4646. + *	1 : success
  4647.   *------------------------------------------*/
  4648.  int storage_storageget(struct map_session_data* sd, int index, int amount)
  4649.  {
  4650. @@ -251,6 +262,10 @@
  4651.  
  4652.  /*==========================================
  4653.   * Move an item from cart to storage.
  4654. + * @index : cart inventory index
  4655. + * return
  4656. + *	0 : fail
  4657. + *	1 : success
  4658.   *------------------------------------------*/
  4659.  int storage_storageaddfromcart(struct map_session_data* sd, int index, int amount)
  4660.  {
  4661. @@ -275,7 +290,11 @@
  4662.  }
  4663.  
  4664.  /*==========================================
  4665. - * Get from Storage to the Cart
  4666. + * Get from Storage to the Cart inventory
  4667. + * @index : storage index
  4668. + * return
  4669. + *	0 : fail
  4670. + *	1 : success
  4671.   *------------------------------------------*/
  4672.  int storage_storagegettocart(struct map_session_data* sd, int index, int amount)
  4673.  {
  4674. @@ -344,8 +363,9 @@
  4675.  	return gs;
  4676.  }
  4677.  
  4678. +//For just locating a storage without creating one. [Skotlex]
  4679.  struct guild_storage *guild2storage2(int guild_id)
  4680. -{	//For just locating a storage without creating one. [Skotlex]
  4681. +{	
  4682.  	return (struct guild_storage*)idb_get(guild_storage_db,guild_id);
  4683.  }
  4684.  
  4685. @@ -355,6 +375,13 @@
  4686.  	return 0;
  4687.  }
  4688.  
  4689. +/*==========================================
  4690. +* Attempt to open guild storage for sd
  4691. +* return
  4692. +* 	0 : success (open or req to create a new one)
  4693. +* 	1 : fail
  4694. +*	2 : no guild for sd
  4695. + *------------------------------------------*/
  4696.  int storage_guild_storageopen(struct map_session_data* sd)
  4697.  {
  4698.  	struct guild_storage *gstor;
  4699. @@ -387,6 +414,12 @@
  4700.  	return 0;
  4701.  }
  4702.  
  4703. +/*==========================================
  4704. +* Attempt to add an item in guild storage, then refresh it
  4705. +* return
  4706. +* 	0 : success
  4707. +* 	1 : fail
  4708. + *------------------------------------------*/
  4709.  int guild_storage_additem(struct map_session_data* sd, struct guild_storage* stor, struct item* item_data, int amount)
  4710.  {
  4711.  	struct item_data *data;
  4712. @@ -439,6 +472,12 @@
  4713.  	return 0;
  4714.  }
  4715.  
  4716. +/*==========================================
  4717. +* Attempt to delete an item in guild storage, then refresh it
  4718. +* return
  4719. +* 	0 : success
  4720. +* 	1 : fail
  4721. + *------------------------------------------*/
  4722.  int guild_storage_delitem(struct map_session_data* sd, struct guild_storage* stor, int n, int amount)
  4723.  {
  4724.  	nullpo_retr(1, sd);
  4725. @@ -458,6 +497,13 @@
  4726.  	return 0;
  4727.  }
  4728.  
  4729. +/*==========================================
  4730. +* Attempt to add an item in guild storage from inventory, then refresh it
  4731. +* @index : inventory idx
  4732. +* return
  4733. +* 	0 : fail
  4734. +* 	1 : succes
  4735. + *------------------------------------------*/
  4736.  int storage_guild_storageadd(struct map_session_data* sd, int index, int amount)
  4737.  {
  4738.  	struct guild_storage *stor;
  4739. @@ -483,6 +529,13 @@
  4740.  	return 1;
  4741.  }
  4742.  
  4743. +/*==========================================
  4744. +* Attempt to retrieve an item from guild storage to inventory, then refresh it
  4745. +* @index : storage idx
  4746. +* return
  4747. +* 	0 : fail
  4748. +* 	1 : succes
  4749. + *------------------------------------------*/
  4750.  int storage_guild_storageget(struct map_session_data* sd, int index, int amount)
  4751.  {
  4752.  	struct guild_storage *stor;
  4753. @@ -505,13 +558,20 @@
  4754.  
  4755.  	if((flag = pc_additem(sd,&stor->items[index],amount,LOG_TYPE_GSTORAGE)) == 0)
  4756.  		guild_storage_delitem(sd,stor,index,amount);
  4757. -	else
  4758. +	else //inform fail
  4759.  		clif_additem(sd,0,0,flag);
  4760.  //	log_fromstorage(sd, index, 1);
  4761.  
  4762.  	return 0;
  4763.  }
  4764.  
  4765. +/*==========================================
  4766. +* Attempt to add an item in guild storage from cart, then refresh it
  4767. +* @index : cart inventory idx
  4768. +* return
  4769. +* 	0 : fail
  4770. +* 	1 : succes
  4771. + *------------------------------------------*/
  4772.  int storage_guild_storageaddfromcart(struct map_session_data* sd, int index, int amount)
  4773.  {
  4774.  	struct guild_storage *stor;
  4775. @@ -537,6 +597,13 @@
  4776.  	return 1;
  4777.  }
  4778.  
  4779. +/*==========================================
  4780. +* Attempt to retrieve an item from guild storage to cart, then refresh it
  4781. +* @index : storage idx
  4782. +* return
  4783. +* 	0 : fail
  4784. +* 	1 : succes
  4785. + *------------------------------------------*/
  4786.  int storage_guild_storagegettocart(struct map_session_data* sd, int index, int amount)
  4787.  {
  4788.  	struct guild_storage *stor;
  4789. @@ -562,6 +629,12 @@
  4790.  	return 1;
  4791.  }
  4792.  
  4793. +/*==========================================
  4794. +* Request to save guild storage
  4795. +* return
  4796. +* 	0 : fail (no storage)
  4797. +* 	1 : succes
  4798. + *------------------------------------------*/
  4799.  int storage_guild_storagesave(int account_id, int guild_id, int flag)
  4800.  {
  4801.  	struct guild_storage *stor = guild2storage2(guild_id);
  4802. @@ -577,6 +650,12 @@
  4803.  	return 0;
  4804.  }
  4805.  
  4806. +/*==========================================
  4807. +* ACK save of guild storage
  4808. +* return
  4809. +* 	0 : fail (no storage)
  4810. +* 	1 : succes
  4811. + *------------------------------------------*/
  4812.  int storage_guild_storagesaved(int guild_id)
  4813.  {
  4814.  	struct guild_storage *stor;
  4815. @@ -591,6 +670,7 @@
  4816.  	return 0;
  4817.  }
  4818.  
  4819. +//Close storage for sd and save it
  4820.  int storage_guild_storageclose(struct map_session_data* sd)
  4821.  {
  4822.  	struct guild_storage *stor;
  4823. Index: src/map/trade.c
  4824. --- src/map/trade.c Base (BASE)
  4825. +++ src/map/trade.c Locally Modified (Based On LOCAL)
  4826. @@ -510,7 +510,7 @@
  4827.  }
  4828.  
  4829.  /*==========================================
  4830. - * ����(trade����)
  4831. + * lock sd and tsd trade data, execute the trade, clear, then save players
  4832.   *------------------------------------------*/
  4833.  void trade_tradecommit(struct map_session_data *sd)
  4834.  {
  4835. Index: src/map/unit.c
  4836. --- src/map/unit.c Base (BASE)
  4837. +++ src/map/unit.c Locally Modified (Based On LOCAL)
  4838. @@ -137,7 +137,7 @@
  4839.  		return 0;
  4840.  	}
  4841.  	ud->walktimer = INVALID_TIMER;
  4842. -	if( bl->prev == NULL ) return 0; // block_list ���甲���Ă���̂ňړ���~����
  4843. +	if (bl->prev == NULL) return 0; // Stop moved because it is missing from the block_list
  4844.  
  4845.  	if(ud->walkpath.path_pos>=ud->walkpath.path_len)
  4846.  		return 0;
  4847. @@ -156,8 +156,7 @@
  4848.  	if(map_getcell(bl->m,x+dx,y+dy,CELL_CHKNOPASS))
  4849.  		return unit_walktoxy_sub(bl);
  4850.  
  4851. -	// �o�V���J����
  4852. -
  4853. +	//Refresh view for all those we lose sight
  4854.  	map_foreachinmovearea(clif_outsight, bl, AREA_SIZE, dx, dy, sd?BL_ALL:BL_PC, bl);
  4855.  
  4856.  	x += dx;
  4857. @@ -347,8 +346,8 @@
  4858.  		map_random_dir(bl, &ud->to_x, &ud->to_y);
  4859.  
  4860.  	if(ud->walktimer != INVALID_TIMER) {
  4861. -		// ���ݕ����Ă���Œ��̖ړI�n�ύX�Ȃ̂Ń}�X�ڂ̒��S�ɗ�������
  4862. -		// timer�֐�����unit_walktoxy_sub���ĂԂ悤�ɂ���
  4863. +		// When you come to the center of the grid because the change of destination while you're walking right now
  4864. +		// Call a function from a timer unit_walktoxy_sub
  4865.  		ud->state.change_walk_target = 1;
  4866.  		return 1;
  4867.  	}
  4868. @@ -1023,7 +1022,7 @@
  4869.  
  4870.  	nullpo_ret(src);
  4871.  	if(status_isdead(src))
  4872. -		return 0; // ����ł��Ȃ���
  4873. +		return 0; //Do not continue source is dead
  4874.  
  4875.  	sd = BL_CAST(BL_PC, src);
  4876.  	ud = unit_bl2ud(src);
  4877. @@ -1112,7 +1111,7 @@
  4878.  		return 0;
  4879.  
  4880.  	tstatus = status_get_status_data(target);
  4881. -	//���O�̃X�L���󋵂̋L�^
  4882. +	// Record the status of the previous skill)
  4883.  	if(sd) {
  4884.  		switch(skill_num){
  4885.  		case SA_CASTCANCEL:
  4886. @@ -1362,7 +1361,7 @@
  4887.  
  4888.  	nullpo_ret(src);
  4889.  
  4890. -	if(!src->prev) return 0; // map ��ɑ��݂��邩
  4891. +	if (!src->prev) return 0; // not on the map
  4892.  	if(status_isdead(src)) return 0;
  4893.  
  4894.  	sd = BL_CAST(BL_PC, src);
  4895. @@ -1399,7 +1398,7 @@
  4896.  		return 0;
  4897.  	}
  4898.  
  4899. -	/* �˒��Ə�Q���`�F�b�N */
  4900. +    /* Check range and obstacle */
  4901.  	bl.type = BL_NUL;
  4902.  	bl.m = src->m;
  4903.  	bl.x = skill_x;
  4904. @@ -1522,8 +1521,8 @@
  4905.  }
  4906.  
  4907.  /*==========================================
  4908. - * �U���v��
  4909. - * type��1�Ȃ�p���U��
  4910. + * Attack request
  4911. + * If type is an ongoing attack
  4912.   *------------------------------------------*/
  4913.  int unit_attack(struct block_list *src,int target_id,int continuous)
  4914.  {
  4915. @@ -1604,7 +1603,7 @@
  4916.  {
  4917.  	nullpo_retr(false, bl);
  4918.  
  4919. -	if( bl->x==x && bl->y==y )	// �����}�X
  4920. +	if (bl->x == x && bl->y == y) //Same place
  4921.  		return true;
  4922.  
  4923.  	return path_search(NULL,bl->m,bl->x,bl->y,x,y,easy,CELL_CHKNOREACH);
  4924. @@ -1648,7 +1647,7 @@
  4925.  	return path_search(NULL,bl->m,bl->x,bl->y,tbl->x-dx,tbl->y-dy,easy,CELL_CHKNOREACH);
  4926.  }
  4927.  /*==========================================
  4928. - * Calculates position of Pet/Mercenary/Homunculus
  4929. + * Calculates position of Pet/Mercenary/Homunculus/Elemental
  4930.   *------------------------------------------*/
  4931.  int	unit_calc_pos(struct block_list *bl, int tx, int ty, int dir)
  4932.  {
  4933. @@ -1706,7 +1705,7 @@
  4934.  }
  4935.  
  4936.  /*==========================================
  4937. - * PC�̍U�� (timer�֐�)
  4938. + * Continuous Attack (function timer)
  4939.   *------------------------------------------*/
  4940.  static int unit_attack_timer_sub(struct block_list* src, int tid, unsigned int tick)
  4941.  {
  4942. @@ -1908,7 +1907,7 @@
  4943.  	return 1;
  4944.  }
  4945.  
  4946. -// unit_data �̏�����
  4947. +// unit_data initialization process
  4948.  void unit_dataset(struct block_list *bl)
  4949.  {
  4950.  	struct unit_data *ud;
  4951. @@ -1949,7 +1948,7 @@
  4952.  }
  4953.  
  4954.  /*==========================================
  4955. - * �����ڂ̃T�C�Y��ύX����
  4956. + * To change the size of the char (player or mob only)
  4957.   *------------------------------------------*/
  4958.  int unit_changeviewsize(struct block_list *bl,short size)
  4959.  {
  4960. Index: src/map/vending.c
  4961. --- src/map/vending.c Base (BASE)
  4962. +++ src/map/vending.c Locally Modified (Based On LOCAL)
  4963. @@ -279,7 +279,7 @@
  4964.  		clif_skill_fail(sd, MC_VENDING, USESKILL_FAIL_LEVEL, 0);
  4965.  		return;
  4966.  	}
  4967. -
  4968. +	//check if nearby npc, (perhaps we should check for nearby shop too
  4969.      if( vending_checknearnpc(&sd->bl) ) {
  4970.          char output[150];
  4971.          sprintf(output,"You're too close to a NPC, you must be at least %d cells away from any NPC.",battle_config.min_npc_vending_distance);
  4972. Index: src/map/vending.h
  4973. --- src/map/vending.h Base (BASE)
  4974. +++ src/map/vending.h Locally Modified (Based On LOCAL)
  4975. @@ -10,9 +10,9 @@
  4976.  struct s_search_store_search;
  4977.  
  4978.  struct s_vending {
  4979. -	short index;
  4980. -	short amount;
  4981. -	unsigned int value;
  4982. +	short index; //cart index (return item data)
  4983. +	short amount; //amout of the item for vending
  4984. +	unsigned int value; //at wich price
  4985.  };
  4986.  
  4987.  void vending_closevending(struct map_session_data* sd);
Viewed 1925 times, submitted by lighta.