viewing paste rathena docs | Diff

Posted on the
  1. Index: src/common/db.c
  2. ===================================================================
  3. --- src/common/db.c	(revision 16039)
  4. +++ src/common/db.c	(working copy)
  5. @@ -2742,7 +2742,7 @@
  6.  	while( node ) {
  7.  		if( node->key == key ) {
  8.  			if( node->prev && n > 5 ) {
  9. -				// ˆ—Œø—Š‰ü‘P‚ׂ̈Éhead‚Ɉړ®‚³‚¹‚é
  10. +				//Moving the head in order to improve processing efficiency
  11.  				if(node->prev) node->prev->next = node->next;
  12.  				if(node->next) node->next->prev = node->prev;
  13.  				node->next = *head;
  14. @@ -2789,7 +2789,7 @@
  15.  	while( node ) {
  16.  		if( node->key == key ) {
  17.  			if( node->prev && n > 5 ) {
  18. -				// ˆ—Œø—Š‰ü‘P‚ׂ̈Éhead‚Ɉړ®‚³‚¹‚é
  19. +				//Moving the head in order to improve processing efficiency
  20.  				if(node->prev) node->prev->next = node->next;
  21.  				if(node->next) node->next->prev = node->prev;
  22.  				node->next = *head;
  23. @@ -2803,7 +2803,7 @@
  24.  		node = node->next;
  25.  		n++;
  26.  	}
  27. -	// Œ©‚‚©‚ç‚È‚¢‚Ì‚Å‘}“ü
  28. +	//Insert because it can not find
  29.  	linkdb_insert( head, key, data );
  30.  }
  31.  
  32. Index: src/common/strlib.c
  33. ===================================================================
  34. --- src/common/strlib.c	(revision 16039)
  35. +++ src/common/strlib.c	(working copy)
  36. @@ -581,6 +581,8 @@
  37.  			sv->done = true;
  38.  			state = END;
  39.  			break;
  40. +		default: //do nothing
  41. +		    break;
  42.  		}
  43.  	}
  44.  	if( IS_END() )
  45. Index: src/common/nullpo.c
  46. ===================================================================
  47. --- src/common/nullpo.c	(revision 16039)
  48. +++ src/common/nullpo.c	(working copy)
  49. @@ -12,7 +12,8 @@
  50.                               const char *fmt, va_list ap);
  51.  
  52.  /*======================================
  53. - * Nullƒ`ƒFƒbƒN ‹y‚Ñ î•ño—Í
  54. + * Semble checker si le target est null et retourne 0 (false) dans ce cas
  55. + * Semble chek les arguments fournit egalement ??
  56.   *--------------------------------------*/
  57.  int nullpo_chk_f(const char *file, int line, const char *func, const void *target,
  58.                   const char *fmt, ...)
  59.  
  60. Index: src/char/int_mercenary.c
  61. ===================================================================
  62. --- src/char/int_mercenary.c	(revision 16039)
  63. +++ src/char/int_mercenary.c	(working copy)
  64. @@ -136,6 +136,7 @@
  65.  	return true;
  66.  }
  67.  
  68. +
  69.  static void mapif_mercenary_send(int fd, struct s_mercenary *merc, unsigned char flag)
  70.  {
  71.  	int size = sizeof(struct s_mercenary) + 5;
  72. Index: src/char/int_party.c
  73. ===================================================================
  74. --- src/char/int_party.c	(revision 16039)
  75. +++ src/char/int_party.c	(working copy)
  76. @@ -324,9 +324,10 @@
  77.  }
  78.  
  79.  //-------------------------------------------------------------------
  80. -// map server‚ւ̒ʐM
  81. +// Communication to the map server
  82.  
  83. -// ƒp[ƒeƒBì¬‰Â”Û
  84. +
  85. +// Create a party whether or not
  86.  int mapif_party_created(int fd,int account_id,int char_id,struct party *p)
  87.  {
  88.  	WFIFOHEAD(fd, 39);
  89. @@ -348,7 +349,7 @@
  90.  	return 0;
  91.  }
  92.  
  93. -// ƒp[ƒeƒBî•ñŒ©‚‚©‚ç‚ž
  94. +//Party information not found
  95.  static void mapif_party_noinfo(int fd, int party_id, int char_id)
  96.  {
  97.  	WFIFOHEAD(fd, 12);
  98. @@ -359,7 +360,8 @@
  99.  	WFIFOSET(fd,12);
  100.  	ShowWarning("int_party: info not found (party_id=%d char_id=%d)\n", party_id, char_id);
  101.  }
  102. -// ƒp[ƒeƒBî•ñ‚Ü‚Æ‚ß‘—‚è
  103. +
  104. +//Digest party information
  105.  static void mapif_party_info(int fd, struct party* p, int char_id)
  106.  {
  107.  	unsigned char buf[8 + sizeof(struct party)];
  108. @@ -373,7 +375,8 @@
  109.  	else
  110.  		mapif_send(fd,buf,WBUFW(buf,2));
  111.  }
  112. -// ƒp[ƒeƒBƒƒ“ƒo’ljÁ‰Â”Û
  113. +
  114. +//Whether or not additional party members
  115.  int mapif_party_memberadded(int fd, int party_id, int account_id, int char_id, int flag) {
  116.  	WFIFOHEAD(fd, 15);
  117.  	WFIFOW(fd,0) = 0x3822;
  118. @@ -386,7 +389,7 @@
  119.  	return 0;
  120.  }
  121.  
  122. -// ƒp[ƒeƒBÝ’è•ÏX’Ê’m
  123. +// Party setting change notification
  124.  int mapif_party_optionchanged(int fd,struct party *p,int account_id,int flag)
  125.  {
  126.  	unsigned char buf[16];
  127. @@ -403,7 +406,7 @@
  128.  	return 0;
  129.  }
  130.  
  131. -// ƒp[ƒeƒB’E‘Þ’Ê’m
  132. +//Withdrawal notification party
  133.  int mapif_party_withdraw(int party_id,int account_id, int char_id) {
  134.  	unsigned char buf[16];
  135.  
  136. @@ -415,7 +418,7 @@
  137.  	return 0;
  138.  }
  139.  
  140. -// ƒp[ƒeƒBƒ}ƒbƒvXV’Ê’m
  141. +//Party map update notification
  142.  int mapif_party_membermoved(struct party *p,int idx)
  143.  {
  144.  	unsigned char buf[20];
  145. @@ -431,7 +434,7 @@
  146.  	return 0;
  147.  }
  148.  
  149. -// ƒp[ƒeƒB‰ðŽU’Ê’m
  150. +//Dissolution party notification
  151.  int mapif_party_broken(int party_id,int flag)
  152.  {
  153.  	unsigned char buf[16];
  154. @@ -442,7 +445,8 @@
  155.  	//printf("int_party: broken %d\n",party_id);
  156.  	return 0;
  157.  }
  158. -// ƒp[ƒeƒB“à”­ŒŸ
  159. +
  160. +//Remarks in the party
  161.  int mapif_party_message(int party_id,int account_id,char *mes,int len, int sfd)
  162.  {
  163.  	unsigned char buf[512];
  164. @@ -456,7 +460,7 @@
  165.  }
  166.  
  167.  //-------------------------------------------------------------------
  168. -// map server‚©‚ç‚̒ʐM
  169. +// Communication from the map server
  170.  
  171.  
  172.  // Create Party
  173. @@ -507,7 +511,8 @@
  174.  
  175.  	return 0;
  176.  }
  177. -// ƒp[ƒeƒBî•ñ—v‹
  178. +
  179. +// Party information request
  180.  static void mapif_parse_PartyInfo(int fd, int party_id, int char_id)
  181.  {
  182.  	struct party_data *p;
  183. @@ -518,7 +523,8 @@
  184.  	else
  185.  		mapif_party_noinfo(fd, party_id, char_id);
  186.  }
  187. -// ƒp[ƒeƒB’ljÁ—v‹
  188. +
  189. +// Add request party
  190.  int mapif_parse_PartyAddMember(int fd, int party_id, struct party_member *member)
  191.  {
  192.  	struct party_data *p;
  193. @@ -556,7 +562,7 @@
  194.  	return 0;
  195.  }
  196.  
  197. -// ƒp[ƒeƒB[Ý’è•ÏX—v‹
  198. +//Party setting change request
  199.  int mapif_parse_PartyChangeOption(int fd,int party_id,int account_id,int exp,int item)
  200.  {
  201.  	struct party_data *p;
  202. @@ -576,7 +582,8 @@
  203.  	inter_party_tosql(&p->party, PS_BASIC, 0);
  204.  	return 0;
  205.  }
  206. -// ƒp[ƒeƒB’E‘Þ—v‹
  207. +
  208. +//Request leave party
  209.  int mapif_parse_PartyLeave(int fd, int party_id, int account_id, int char_id)
  210.  {
  211.  	struct party_data *p;
  212. @@ -684,7 +691,7 @@
  213.  	return 0;
  214.  }
  215.  
  216. -// ƒp[ƒeƒB‰ðŽU—v‹
  217. +//Request party dissolution
  218.  int mapif_parse_BreakParty(int fd,int party_id)
  219.  {
  220.  	struct party_data *p;
  221. @@ -697,7 +704,8 @@
  222.  	mapif_party_broken(fd,party_id);
  223.  	return 0;
  224.  }
  225. -// ƒp[ƒeƒBƒƒbƒZ[ƒW‘—M
  226. +
  227. +//Party sending the message
  228.  int mapif_parse_PartyMessage(int fd,int party_id,int account_id,char *mes,int len)
  229.  {
  230.  	return mapif_party_message(party_id,account_id,mes,len, fd);
  231. @@ -727,11 +735,12 @@
  232.  	return 1;
  233.  }
  234.  
  235. -// map server ‚©‚ç‚̒ʐM
  236. -// E‚PƒpƒPƒbƒg‚̂݉ðÍ‚·‚邱‚Æ
  237. -// EƒpƒPƒbƒg’·ƒf[ƒ^‚Íinter.c‚ɃZƒbƒg‚µ‚Ä‚š‚­‚±‚Æ
  238. -// EƒpƒPƒbƒg’·ƒ`ƒFƒbƒN‚âARFIFOSKIP‚͌Ăяo‚µŒ³‚ōs‚í‚ê‚é‚̂ōs‚Á‚Ä‚Í‚È‚ç‚È‚¢
  239. -// EƒGƒ‰[‚È‚ç0(false)A‚»‚€‚Å‚È‚¢‚È‚ç1(true)‚ð‚©‚Š‚³‚È‚¯‚ê‚΂Ȃç‚È‚¢
  240. +
  241. +// Communication from the map server
  242. +//-Analysis that only one packet
  243. +// Data packet length is set to inter.c that you
  244. +// Do NOT go and check the packet length, RFIFOSKIP is done by the caller
  245. +// ? (False), must return 1 (true) if error, 0 if otherwise.
  246.  int inter_party_parse_frommap(int fd)
  247.  {
  248.  	RFIFOHEAD(fd);
  249. @@ -751,7 +760,7 @@
  250.  	return 1;
  251.  }
  252.  
  253. -// ƒT[ƒo[‚©‚ç’E‘Þ—v‹iƒLƒƒƒ‰íœ—pj
  254. +//Leave request from the server (for delete character)
  255.  int inter_party_leave(int party_id,int account_id, int char_id)
  256.  {
  257.  	return mapif_parse_PartyLeave(-1,party_id,account_id, char_id);
  258. Index: src/char/char.c
  259. ===================================================================
  260. --- src/char/char.c	(revision 16039)
  261. +++ src/char/char.c	(working copy)
  262. @@ -1005,7 +1005,7 @@
  263.  	||	SQL_ERROR == SqlStmt_BindColumn(stmt, 26, SQLDT_INT,    &p->guild_id, 0, NULL, NULL)
  264.  	||	SQL_ERROR == SqlStmt_BindColumn(stmt, 27, SQLDT_INT,    &p->pet_id, 0, NULL, NULL)
  265.  	||	SQL_ERROR == SqlStmt_BindColumn(stmt, 28, SQLDT_INT,    &p->hom_id, 0, NULL, NULL)
  266. -	||	SQL_ERROR == SqlStmt_BindColumn(stmt, 29, SQLDT_INT,	&p->ele_id, 0, NULL, NULL)	   
  267. +	||	SQL_ERROR == SqlStmt_BindColumn(stmt, 29, SQLDT_INT,	&p->ele_id, 0, NULL, NULL)
  268.  	||	SQL_ERROR == SqlStmt_BindColumn(stmt, 30, SQLDT_SHORT,  &p->hair, 0, NULL, NULL)
  269.  	||	SQL_ERROR == SqlStmt_BindColumn(stmt, 31, SQLDT_SHORT,  &p->hair_color, 0, NULL, NULL)
  270.  	||	SQL_ERROR == SqlStmt_BindColumn(stmt, 32, SQLDT_SHORT,  &p->clothes_color, 0, NULL, NULL)
  271. Index: src/char/int_guild.c
  272. ===================================================================
  273. --- src/char/int_guild.c	(revision 16039)
  274. +++ src/char/int_guild.c	(working copy)
  275. @@ -1871,7 +1871,7 @@
  276.  	return 1;
  277.  }
  278.  
  279. -// ƒT[ƒo[‚©‚ç’E‘Þ—v‹iƒLƒƒƒ‰íœ—pj
  280. +// processes a mapserver connection event
  281.  int inter_guild_leave(int guild_id, int account_id, int char_id)
  282.  {
  283.  	return mapif_parse_GuildLeave(-1, guild_id, account_id, char_id, 0, "** Character Deleted **");
  284. Index: src/char/int_elemental.c
  285. ===================================================================
  286. --- src/char/int_elemental.c	(revision 16039)
  287. +++ src/char/int_elemental.c	(working copy)
  288. @@ -20,9 +20,9 @@
  289.  
  290.  	if( ele->elemental_id == 0 ) { // Create new DB entry
  291.  		if( SQL_ERROR == Sql_Query(sql_handle,
  292. -								   "INSERT INTO `elemental` (`char_id`,`class`,`mode`,`hp`,`sp`,`max_hp`,`max_sp`,`str`,`agi`,`vit`,`int`,`dex`,`luk`,`life_time`)"
  293. -								   "VALUES ('%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%u')",
  294. -								   ele->char_id, ele->class_, ele->mode, ele->hp, ele->sp, ele->max_hp, ele->max_sp, ele->str, ele->agi, ele->vit, ele->int_, ele->dex, ele->luk, ele->life_time) )
  295. +			"INSERT INTO `elemental` (`char_id`,`class`,`mode`,`hp`,`sp`,`max_hp`,`max_sp`,`str`,`agi`,`vit`,`int`,`dex`,`luk`,`life_time`)"
  296. +			"VALUES ('%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%u')",
  297. +			ele->char_id, ele->class_, ele->mode, ele->hp, ele->sp, ele->max_hp, ele->max_sp, ele->str, ele->agi, ele->vit, ele->int_, ele->dex, ele->luk, ele->life_time) )
  298.  		{
  299.  			Sql_ShowDebug(sql_handle);
  300.  			flag = false;
  301. @@ -30,11 +30,11 @@
  302.  		else
  303.  			ele->elemental_id = (int)Sql_LastInsertId(sql_handle);
  304.  	} else if( SQL_ERROR == Sql_Query(sql_handle,
  305. -									"UPDATE `elemental` SET `char_id` = '%d', `class` = '%d', `mode` = '%d', `hp` = '%d', `sp` = '%d',"
  306. -									"`max_hp` = '%d', `max_sp` = '%d', `str` = '%d', `agi` = '%d', `vit` = '%d', `int` = '%d', `dex` = '%d',"
  307. -									"`luk` = '%d', `life_time` = '%u' WHERE `ele_id` = '%d'",
  308. -									ele->char_id, ele->class_, ele->mode, ele->hp, ele->sp, ele->max_hp, ele->max_sp, ele->str, ele->agi,
  309. -									ele->vit, ele->int_, ele->dex, ele->luk, ele->life_time, ele->elemental_id) )
  310. +		"UPDATE `elemental` SET `char_id` = '%d', `class` = '%d', `mode` = '%d', `hp` = '%d', `sp` = '%d',"
  311. +		"`max_hp` = '%d', `max_sp` = '%d', `str` = '%d', `agi` = '%d', `vit` = '%d', `int` = '%d', `dex` = '%d',"
  312. +		"`luk` = '%d', `life_time` = '%u' WHERE `ele_id` = '%d'",
  313. +		ele->char_id, ele->class_, ele->mode, ele->hp, ele->sp, ele->max_hp, ele->max_sp, ele->str, ele->agi,
  314. +		ele->vit, ele->int_, ele->dex, ele->luk, ele->life_time, ele->elemental_id) )
  315.  	{ // Update DB entry
  316.  		Sql_ShowDebug(sql_handle);
  317.  		flag = false;
  318. @@ -44,23 +44,23 @@
  319.  
  320.  bool mapif_elemental_load(int ele_id, int char_id, struct s_elemental *ele) {
  321.  	char* data;
  322. -	
  323. +
  324.  	memset(ele, 0, sizeof(struct s_elemental));
  325.  	ele->elemental_id = ele_id;
  326.  	ele->char_id = char_id;
  327. -	
  328. +
  329.  	if( SQL_ERROR == Sql_Query(sql_handle, "SELECT `class`, `mode`, `hp`, `sp`, `max_hp`, `max_sp`, `str`, `agi`, `vit`, `int`, `dex`,"
  330. -							   "`luk`, `life_time` FROM `elemental` WHERE `ele_id` = '%d' AND `char_id` = '%d'",
  331. +		"`luk`, `life_time` FROM `elemental` WHERE `ele_id` = '%d' AND `char_id` = '%d'",
  332.  							   ele_id, char_id) ) {
  333.  		Sql_ShowDebug(sql_handle);
  334.  		return false;
  335.  	}
  336. -	
  337. +
  338.  	if( SQL_SUCCESS != Sql_NextRow(sql_handle) ) {
  339.  		Sql_FreeResult(sql_handle);
  340.  		return false;
  341.  	}
  342. -	
  343. +
  344.  	Sql_GetData(sql_handle,  0, &data, NULL); ele->class_ = atoi(data);
  345.  	Sql_GetData(sql_handle,  1, &data, NULL); ele->mode = atoi(data);
  346.  	Sql_GetData(sql_handle,  2, &data, NULL); ele->hp = atoi(data);
  347. @@ -86,7 +86,7 @@
  348.  		Sql_ShowDebug(sql_handle);
  349.  		return false;
  350.  	}
  351. -	
  352. +
  353.  	return true;
  354.  }
  355.  
  356. @@ -94,7 +94,7 @@
  357.  
  358.  static void mapif_elemental_send(int fd, struct s_elemental *ele, unsigned char flag) {
  359.  	int size = sizeof(struct s_elemental) + 5;
  360. -	
  361. +
  362.  	WFIFOHEAD(fd,size);
  363.  	WFIFOW(fd,0) = 0x387c;
  364.  	WFIFOW(fd,2) = size;
  365. @@ -150,7 +150,7 @@
  366.   *------------------------------------------*/
  367.  int inter_elemental_parse_frommap(int fd) {
  368.  	unsigned short cmd = RFIFOW(fd,0);
  369. -	
  370. +
  371.  	switch( cmd ) {
  372.  		case 0x307c: mapif_parse_elemental_create(fd, (struct s_elemental*)RFIFOP(fd,4)); break;
  373.  		case 0x307d: mapif_parse_elemental_load(fd, (int)RFIFOL(fd,2), (int)RFIFOL(fd,6)); break;
  374.  
  375. Index: src/map/script.c
  376. ===================================================================
  377. --- src/map/script.c	(revision 16039)
  378. +++ src/map/script.c	(working copy)
  379.  
  380. @@ -5691,10 +5692,10 @@
  381.   *------------------------------------------*/
  382.  BUILDIN_FUNC(countitem2)
  383.  {
  384. -	int nameid, iden, ref, attr, c1, c2, c3, c4;
  385.  	int count = 0;
  386.  	int i;
  387.  	struct item_data* id = NULL;
  388. +    struct item tmp_it;
  389.  	struct script_data* data;
  390.  
  391.  	TBL_PC* sd = script_rid2sd(st);
  392. @@ -5722,22 +5723,19 @@
  393.  		return 1;
  394.  	}
  395.  
  396. -	nameid = id->nameid;
  397. -	iden = script_getnum(st,3);
  398. -	ref  = script_getnum(st,4);
  399. -	attr = script_getnum(st,5);
  400. -	c1 = (short)script_getnum(st,6);
  401. -	c2 = (short)script_getnum(st,7);
  402. -	c3 = (short)script_getnum(st,8);
  403. -	c4 = (short)script_getnum(st,9);
  404. +	tmp_it.nameid = id->nameid;
  405. +	tmp_it.identify = script_getnum(st,3);
  406. +	tmp_it.refine  = script_getnum(st,4);
  407. +	tmp_it.attribute = script_getnum(st,5);
  408. +	tmp_it.card[0] = (short)script_getnum(st,6);
  409. +	tmp_it.card[1] = (short)script_getnum(st,7);
  410. +	tmp_it.card[2] = (short)script_getnum(st,8);
  411. +	tmp_it.card[3] = (short)script_getnum(st,9);
  412.  
  413.  	for(i = 0; i < MAX_INVENTORY; i++)
  414. -		if (sd->status.inventory[i].nameid > 0 && sd->inventory_data[i] != NULL &&
  415. -			sd->status.inventory[i].amount > 0 && sd->status.inventory[i].nameid == nameid &&
  416. -			sd->status.inventory[i].identify == iden && sd->status.inventory[i].refine == ref &&
  417. -			sd->status.inventory[i].attribute == attr && sd->status.inventory[i].card[0] == c1 &&
  418. -			sd->status.inventory[i].card[1] == c2 && sd->status.inventory[i].card[2] == c3 &&
  419. -			sd->status.inventory[i].card[3] == c4
  420. +		if ( (&sd->status.inventory[i] != NULL)
  421. +                        && sd->status.inventory[i].amount > 0 
  422. +                        && compare_item(&sd->status.inventory[i],&tmp_it,1)
  423.  		)
  424.  			count += sd->status.inventory[i].amount;
  425.  
  426. @@ -6608,7 +6606,7 @@
  427.  	return 0;
  428.  }
  429.  /*==========================================
  430. - *Žw’èID‚ÌPT–ŒŽæ“Ÿ
  431. + * return the name of a partyid
  432.   *------------------------------------------*/
  433.  BUILDIN_FUNC(getpartyname)
  434.  {
  435. @@ -9295,7 +9293,8 @@
  436.  }
  437.  
  438.  /*==========================================
  439. - * ó‘Ԉُí‘ϐ«‚ðŒvŽZ‚µ‚œŠm—Š‚ð•Ô‚·
  440. + * To get rate of a sc type, actually I don't really get it since we returning tick but oh well..
  441. + * @TODO that fonction doesn't take an consideration last status_change_start altering so...
  442.   *------------------------------------------*/
  443.  BUILDIN_FUNC(getscrate)
  444.  {
  445. @@ -9838,7 +9837,9 @@
  446.  }
  447.  
  448.  /*==========================================
  449. - * RID‚̃Aƒ^ƒbƒ`
  450. + * Attach un joueurs au script, st.rid 
  451. + * Permet a un script d'executer des actions
  452. + * requierant un joueur autrement que par contact direct.
  453.   *------------------------------------------*/
  454.  BUILDIN_FUNC(attachrid)
  455.  {
  456. Index: src/map/elemental.c
  457. ===================================================================
  458. --- src/map/elemental.c	(revision 16039)
  459. +++ src/map/elemental.c	(working copy)
  460. @@ -255,7 +255,7 @@
  461.  				if( bl ) status_change_end(bl,type,INVALID_TIMER);
  462.  				break;
  463.  			default:
  464. -				ShowWarning("Invalid SC=%d in elemental_clean_single_effect\n",type);
  465. +				ShowWarning("Invalide SC=%d in elemental_clean_single_effect\n",type);
  466.  				break;
  467.  		}
  468.  	}
  469. @@ -349,7 +349,7 @@
  470.  
  471.  	if( elemental_skillnotok(skillnum, ed) )
  472.  		return 0;
  473. -	
  474. +
  475.  	if( ed->ud.skilltimer != INVALID_TIMER )
  476.  		return 0;
  477.  	else if( DIFF_TICK(tick, ed->ud.canact_tick) < 0 )
  478. @@ -413,7 +413,7 @@
  479.  
  480.  	if( elemental_skillnotok(skillnum, ed) )
  481.  		return 0;
  482. -	
  483. +
  484.  	if( ed->ud.skilltimer != INVALID_TIMER )
  485.  		return 0;
  486.  	else if( DIFF_TICK(gettick(), ed->ud.canact_tick) < 0 )
  487. @@ -566,10 +566,10 @@
  488.  		return 0;
  489.  
  490.  	ed->last_thinktime = tick;
  491. -	
  492. +
  493.  	if( ed->ud.skilltimer != INVALID_TIMER )
  494.  		return 0;
  495. -	
  496. +
  497.  	if( ed->ud.walktimer != INVALID_TIMER && ed->ud.walkpath.path_pos <= 2 )
  498.  		return 0; //No thinking when you just started to walk.
  499.  
  500. @@ -612,7 +612,8 @@
  501.  			return 1;
  502.  		}
  503.  
  504. -		if( battle_check_range(&ed->bl,target,ed->db->range2) && rnd()%100 < 2 ) { // 2% chance to cast attack skill.
  505. +		if( battle_check_range(&ed->bl,target,view_range) && rnd()%100 < 2 ) // 2% chance to cast attack skill.
  506. +		{
  507.  			if(	elemental_action(ed,target,tick) )
  508.  				return 1;
  509.  		}
  510. @@ -643,7 +644,7 @@
  511.  	return 0;
  512.  }
  513.  
  514. -static int elemental_ai_timer(int tid, unsigned int tick, int id, intptr data) {
  515. +static int elemental_ai_timer(int tid, unsigned int tick, int id, intptr_t data) {
  516.  	map_foreachpc(elemental_ai_sub_foreachclient,tick);
  517.  
  518.  	return 0;
  519. Index: src/map/atcommand.h
  520. ===================================================================
  521. --- src/map/atcommand.h	(revision 16039)
  522. +++ src/map/atcommand.h	(working copy)
  523. @@ -4,6 +4,7 @@
  524.  #ifndef _ATCOMMAND_H_
  525.  #define _ATCOMMAND_H_
  526.  
  527. +//#include "map.h"
  528.  struct map_session_data;
  529.  
  530.  //This is the distance at which @autoloot works,
  531. Index: src/map/battle.c
  532. ===================================================================
  533. --- src/map/battle.c	(revision 16039)
  534. +++ src/map/battle.c	(working copy)
  535. @@ -105,6 +105,7 @@
  536.  		case BL_HOM: return ((struct homun_data*)bl)->ud.target;
  537.  		case BL_MER: return ((struct mercenary_data*)bl)->ud.target;
  538.  		case BL_ELEM: return ((struct elemental_data*)bl)->ud.target;
  539. +		default: break; //unhandled type
  540.  	}
  541.  	return 0;
  542.  }
  543. @@ -145,6 +146,7 @@
  544.  		c = 23;
  545.  	return bl_list[rnd()%c];
  546.  }
  547. +
  548.  static int battle_getenemyarea_sub(struct block_list *bl, va_list ap)
  549.  {
  550.  	struct block_list **bl_list, *src;
  551. @@ -183,7 +185,7 @@
  552.  	return bl_list[rnd()%c];
  553.  }
  554.  
  555. -// ƒ_??[ƒW‚Ì’x‰„
  556. +// ï¿œ_??[ï¿œWᅵ̒xᅵᅵ
  557.  struct delay_damage {
  558.  	struct block_list *src;
  559.  	int target;
  560. @@ -266,6 +268,7 @@
  561.  
  562.  	return 0;
  563.  }
  564. +
  565.  int battle_attr_ratio(int atk_elem,int def_type, int def_lv)
  566.  {
  567.  
  568. @@ -340,7 +343,8 @@
  569.  }
  570.  
  571.  /*==========================================
  572. - * ƒ_??[ƒW??IŒvŽZ
  573. + * Main battle_calc function
  574. + * primary call
  575.   *------------------------------------------*/
  576.  int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damage *d,int damage,int skill_num,int skill_lv)
  577.  {
  578. @@ -394,7 +398,7 @@
  579.  				(skill_num && skill_get_ele(skill_num, skill_lv) == ELE_GHOST) ||
  580.  				(!skill_num && (status_get_status_data(src))->rhw.ele == ELE_GHOST)
  581.  					)
  582. -				status_change_end(bl,SC_WHITEIMPRISON,INVALID_TIMER); // Those skills do damage and removes effect
  583. +				status_change_end(bl,SC_WHITEIMPRISON, INVALID_TIMER); // Those skills do damage and removes effect
  584.  			else
  585.  			{
  586.  				d->dmg_lv = ATK_BLOCK;
  587. @@ -468,7 +472,7 @@
  588.  						clif_millenniumshield(sd,sce->val2);
  589.  					sce->val3 = 1000; // Next Shield
  590.  				} else
  591. -					status_change_end(bl,SC_MILLENNIUMSHIELD,INVALID_TIMER); // All shields down
  592. +					status_change_end(bl,SC_MILLENNIUMSHIELD, INVALID_TIMER); // All shields down
  593.  			}
  594.  			return 0;
  595.  		}
  596. @@ -533,9 +537,8 @@
  597.  		}
  598.  
  599.  		//Now damage increasing effects
  600. -		if( sc->data[SC_AETERNA] && skill_num != PF_SOULBURN )
  601. -		{
  602. -			if( src->type != BL_MER || skill_num == 0 )
  603. +		if (sc->data[SC_AETERNA] && skill_num != PF_SOULBURN) {
  604. +			if (src->type != BL_MER || skill_num == 0)
  605.  				damage <<= 1; // Lex Aeterna only doubles damage of regular attacks from mercenaries
  606.  
  607.  			if( skill_num != ASC_BREAKER || !(flag&BF_WEAPON) )
  608. @@ -556,11 +559,11 @@
  609.  
  610.  			if( sc->data[SC_DEEPSLEEP] ) {
  611.  				damage += damage / 2; // 1.5 times more damage while in Deep Sleep.
  612. -				status_change_end(bl,SC_DEEPSLEEP,INVALID_TIMER);
  613. +				status_change_end(bl,SC_DEEPSLEEP, INVALID_TIMER);
  614.  			}
  615.  
  616.  			if( sc->data[SC_VOICEOFSIREN] )
  617. -				status_change_end(bl,SC_VOICEOFSIREN,INVALID_TIMER);
  618. +				status_change_end(bl,SC_VOICEOFSIREN, INVALID_TIMER);
  619.  		}
  620.  
  621.  
  622. @@ -900,7 +903,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. @@ -919,7 +922,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. @@ -1024,6 +1027,7 @@
  641.  
  642.  	return damage;
  643.  }
  644. +
  645.  /*==========================================
  646.   * Calculates the standard damage of a normal attack assuming it hits,
  647.   * it calculates nothing extra fancy, is needed for magnum break's WATK_ELEMENT bonus. [Skotlex]
  648. @@ -1607,7 +1611,8 @@
  649.  						sd->inventory_data[index] &&
  650.  						sd->inventory_data[index]->type == IT_ARMOR)
  651.  						ATK_ADD(sd->inventory_data[index]->weight/10);
  652. -				} else
  653. +				}
  654. +				else
  655.  					ATK_ADD(sstatus->rhw.atk2); //Else use Atk2
  656.  				break;
  657.  			case HFLI_SBR44:	//[orn]
  658. @@ -2303,7 +2308,7 @@
  659.  							case 13261: // Coconut Bomb
  660.  							case 13262: // Melon Bomb
  661.  							case 13263: // Pinapple Bomb
  662. -								skillratio += 400;	// Unconfirded
  663. +								skillratio += 400;	// Unconfirmed
  664.  								break;
  665.  							case 13264: // Banana Bomb 2000%
  666.  								skillratio += 1900;
  667. @@ -3703,7 +3700,7 @@
  668.  }
  669.  
  670.  /*==========================================
  671. - * ‚»‚Ì‘Œƒ_??[ƒWŒvŽZ
  672. + * Calcule les degat d'une attaque Misc selon le skill
  673.   *------------------------------------------*/
  674.  struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *target,int skill_num,int skill_lv,int mflag)
  675.  {
  676. @@ -4015,7 +4012,7 @@
  677.  	return md;
  678.  }
  679.  /*==========================================
  680. - * ƒ_??[ƒWŒvŽZˆêŠ‡?ˆ—?—p
  681. + *
  682.   *------------------------------------------*/
  683.  struct Damage battle_calc_attack(int attack_type,struct block_list *bl,struct block_list *target,int skill_num,int skill_lv,int count)
  684.  {
  685. @@ -4072,7 +4069,7 @@
  686.  					rd1 = min(damage,status_get_max_hp(bl)) * sc->data[SC_DEATHBOUND]->val2 / 100; // Amplify damage.
  687.  					*dmg = rd1 * 30 / 100; // Received damge = 30% of amplifly damage.
  688.  					clif_skill_damage(src,bl,gettick(), status_get_amotion(src), 0, -30000, 1, RK_DEATHBOUND, sc->data[SC_DEATHBOUND]->val1,6);
  689. -					status_change_end(bl,SC_DEATHBOUND,INVALID_TIMER);
  690. +					status_change_end(bl,SC_DEATHBOUND, INVALID_TIMER);
  691.  					rdamage += rd1;
  692.  					if (rdamage < 1) rdamage = 1;
  693.  				}
  694. @@ -4142,6 +4139,7 @@
  695.  	if (rhp || rsp)
  696.  		status_zap(tbl, rhp, rsp);
  697.  }
  698. +
  699.  // Deals the same damage to targets in area. [pakpil]
  700.  int battle_damage_area( struct block_list *bl, va_list ap) {
  701.  	unsigned int tick;
  702. @@ -4172,8 +4170,9 @@
  703.  
  704.  	return 0;
  705.  }
  706. +
  707.  /*==========================================
  708. - * ’Ê??UŒ‚?ˆ—?‚Ü‚Æ‚ß
  709. + * 
  710.   *------------------------------------------*/
  711.  enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* target, unsigned int tick, int flag) {
  712.  	struct map_session_data *sd = NULL, *tsd = NULL;
  713. @@ -4240,13 +4239,13 @@
  714.  			}
  715.  		}
  716.  	}
  717. +        if(sc && sc->count){
  718. +            if (sc->data[SC_CLOAKING] && !(sc->data[SC_CLOAKING]->val4&2))
  719. +                    status_change_end(src, SC_CLOAKING, INVALID_TIMER);
  720.  
  721. -	if (sc && sc->data[SC_CLOAKING] && !(sc->data[SC_CLOAKING]->val4&2))
  722. -		status_change_end(src, SC_CLOAKING, INVALID_TIMER);
  723. -		
  724. -	if (sc && sc->data[SC_CLOAKINGEXCEED] && !(sc->data[SC_CLOAKINGEXCEED]->val4&2))
  725. -		status_change_end(src, SC_CLOAKINGEXCEED, INVALID_TIMER);
  726. -
  727. +            if (sc->data[SC_CLOAKINGEXCEED] && !(sc->data[SC_CLOAKINGEXCEED]->val4&2))
  728. +                    status_change_end(src,SC_CLOAKINGEXCEED,INVALID_TIMER);
  729. +        }
  730.  	if( tsc && tsc->data[SC_AUTOCOUNTER] && status_check_skilluse(target, src, KN_AUTOCOUNTER, 1) )
  731.  	{
  732.  		int dir = map_calc_dir(target,src->x,src->y);
  733. @@ -4289,8 +4288,9 @@
  734.  			return ATK_MISS;
  735.  		}
  736.  	}
  737. -
  738. -	if (sc) {
  739. +	
  740. +	if (sc && sc->count)
  741. +	{
  742.  		if (sc->data[SC_SACRIFICE]) {
  743.  			int skilllv = sc->data[SC_SACRIFICE]->val1;
  744.  			damage_lv ret_val;
  745. @@ -4502,6 +4502,10 @@
  746.  				status_change_end(target, SC_POISONREACT, INVALID_TIMER);
  747.  		}
  748.  	}
  749. +        if (sc && sc->data[SC_CAMOUFLAGE] && !(sc->data[SC_CAMOUFLAGE]->val3&2)){ //moved so basic attack get critical bonus
  750. +		status_change_end(src,SC_CAMOUFLAGE,INVALID_TIMER);
  751. +        }
  752. +        
  753.  	map_freeblock_unlock();
  754.  	return wd.dmg_lv;
  755.  }
  756. @@ -4554,6 +4558,7 @@
  757.  				if (((TBL_SKILL*)src)->group && ((TBL_SKILL*)src)->group->src_id)
  758.  					src = map_id2bl(((TBL_SKILL*)src)->group->src_id);
  759.  				break;
  760. +			default: break; //other type doesn't have master (recursive check so don't showwarning)
  761.  		}
  762.  	} while (src && src != prev);
  763.  	return prev;
  764. @@ -4695,9 +4700,9 @@
  765.  			int inf2 = 0;
  766.  			if (!su->group)
  767.  				return 0;
  768. +			inf2 = skill_get_inf2(su->group->skill_id);
  769.  			if( battle_config.vs_traps_bctall && (target->type&battle_config.vs_traps_bctall) &&
  770. -				(inf2 = skill_get_inf2(su->group->skill_id))&INF2_TRAP &&
  771. -					map_flag_vs(src->m) )
  772. +				inf2&INF2_TRAP && map_flag_vs(src->m) )
  773.  				return 1;//traps may target everyone
  774.  			if (su->group->src_id == target->id) {
  775.  				if (inf2&INF2_NO_TARGET_SELF)
  776. @@ -4707,6 +4712,7 @@
  777.  			}
  778.  			break;
  779.  		}
  780. +		default: break; //unhandle others
  781.  	}
  782.  
  783.  	switch( s_bl->type )
  784. @@ -4847,7 +4853,7 @@
  785.  	return (flag&state)?1:-1;
  786.  }
  787.  /*==========================================
  788. - * ŽË’ö”»’è
  789. + * ᅵ˒ᅵᅵᅵᅵᅵ
  790.   *------------------------------------------*/
  791.  bool battle_check_range(struct block_list *src, struct block_list *bl, int range)
  792.  {
  793. Index: src/map/skill.c
  794. ===================================================================
  795. --- src/map/skill.c	(revision 16039)
  796. +++ src/map/skill.c	(working copy)
  797. @@ -781,7 +781,7 @@
  798.  						rate += rate*sc->data[SC_SKILLRATE_UP]->val2/100;
  799.  						status_change_end(src, SC_SKILLRATE_UP, INVALID_TIMER);
  800.  					}
  801. -					sc_start4(src,SC_COMBO, rate, TK_COUNTER, bl->id,0,0,
  802. +					sc_start2(src,SC_COMBO, rate, TK_COUNTER, bl->id,
  803.  						(2000 - 4*sstatus->agi - 2*sstatus->dex));
  804.  				}
  805.  			}
  806. @@ -795,7 +795,7 @@
  807.  					skill_get_time2(AS_ENCHANTPOISON,sce->val1),0);
  808.  			// Enchant Deadly Poison gives a chance to deadly poison attacked enemies
  809.  			if((sce=sc->data[SC_EDP]))
  810. -				sc_start4(bl,SC_DPOISON,sce->val2, sce->val1,0,0,0,
  811. +				sc_start(bl,SC_DPOISON,sce->val2, sce->val1,
  812.  					skill_get_time2(ASC_EDP,sce->val1));
  813.  		}
  814.  	}
  815. @@ -1268,7 +1268,7 @@
  816.  		if( dstsd )
  817.  			skill_addtimerskill(src,tick+status_get_amotion(src),bl->id,0,0,skillid,skilllv,BF_WEAPON,0);
  818.  		else if( dstmd && !is_boss(bl) )
  819. -			sc_start(bl, SC_STUN, 100, skilllv, 1000 + 1000 * (rnd() %3));
  820. +			sc_start(bl, SC_STUN, 100, skilllv, 1000 + 1000 * (rnd()%3));
  821.  		break;
  822.  	case SR_GENTLETOUCH_QUIET:
  823.  		sc_start(bl, SC_SILENCE, 2 * skilllv, skilllv, skill_get_time(skillid, skilllv));
  824. @@ -1331,7 +1331,7 @@
  825.  					sc_start(bl, SC_MELON_BOMB, 100, skilllv, skill_get_time(GN_SLINGITEM, skilllv));	// Reduces ASPD and moviment speed
  826.  					break;
  827.  				case 13264:
  828. -					sc_start(bl, SC_BANANA_BOMB, 100, skilllv, skill_get_time(GN_SLINGITEM, skilllv));	// Reduces LUK À?Needed confirm it, may be it's bugged in kRORE?
  829. +					sc_start(bl, SC_BANANA_BOMB, 100, skilllv, skill_get_time(GN_SLINGITEM, skilllv));	// Reduces LUK ᅵ?Needed confirm it, may be it's bugged in kRORE?
  830.  					sc_start(bl, SC_BANANA_BOMB_SITDOWN, 75, skilllv, skill_get_time(GN_SLINGITEM_RANGEMELEEATK,skilllv)); // Sitdown for 3 seconds.
  831.  					break;
  832.  			}
  833. @@ -2031,10 +2031,16 @@
  834.  			break;
  835.  		case BL_SKILL:
  836.  			su = (struct skill_unit *)target;
  837. -			if( su && su->group && (su->group->unit_id == UNT_ANKLESNARE || su->group->unit_id == UNT_ELECTRICSHOCKER
  838. -				|| su->group->unit_id == UNT_CLUSTERBOMB || su->group->unit_id == UNT_REVERBERATION) )
  839. -				return 0; // ankle snare, electricshocker, clusterbomb, reverberation cannot be knocked back
  840. +			if( su && su->group)
  841. +                            switch(su->group->unit_id){  //defined trap that cannot be knocked back
  842. +                                case UNT_ANKLESNARE:     //allow easier modification [Lighta], @TODO set up an flag on skill_unit_db for that        
  843. +                                case UNT_ELECTRICSHOCKER:
  844. +                              //  case UNT_CLUSTERBOMB: //http://irowiki.org/wiki/Bomb_Cluster
  845. +                                case UNT_REVERBERATION:
  846. +				return 0;
  847. +                            }
  848.  			break;
  849. +		default : break; //unhandled type
  850.  	}
  851.  
  852.  	if (direction == -1) // <optimized>: do the computation here instead of outside
  853. @@ -2104,7 +2110,7 @@
  854.  	struct map_session_data *sd, *tsd;
  855.  	int type,damage,rdamage=0;
  856.  
  857. -	if(skillid > 0 && skilllv <= 0) return 0;
  858. +	if( skillid > 0 && skilllv <= 0 ) return 0; // Invalid skill id or level.
  859.  
  860.  	nullpo_ret(src);	//Source is the master behind the attack (player/mob/pet)
  861.  	nullpo_ret(dsrc); //dsrc is the actual originator of the damage, can be the same as src, or a skill casted by src.
  862. @@ -2674,12 +2680,12 @@
  863.  }
  864.  
  865.  /*==========================================
  866. - * ƒXƒLƒ‹”Í??U?—p(map_foreachinarea‚©‚çŒÄ‚΂ê‚é)
  867. - * flag‚ɂ‚¢‚Ä?F16?i?‚ðŠm”F
  868. + * ï¿œXï¿œLᅵᅵᅵᅵ??U?ï¿œp(map_foreachinareaᅵᅵᅵᅵĂ΂ᅵᅵ)
  869. + * flagᅵɂ‚ᅵᅵᅵ?F16?i?ᅵᅵᅵmï¿œF
  870.   * MSB <- 00fTffff ->LSB
  871. - *	T	=ƒ^?ƒQƒbƒg‘I?—p(BCT_*)
  872. - *  ffff=Ž©—R‚ÉŽg—p‰Â”\
  873. - *  0	=—\–ñ?B0‚ɌŒè
  874. + *	T	=ᅵ^?ᅵQᅵbᅵgᅵI?ᅵp(BCT_*)
  875. + *  ffff=ᅵᅵᅵRᅵɎgï¿œpᅵ”\
  876. + *  0	=ï¿œ\ᅵᅵ?B0ᅵɌŒᅵ
  877.   *------------------------------------------*/
  878.  typedef int (*SkillFunc)(struct block_list *, struct block_list *, int, int, unsigned int, int);
  879.  int skill_area_sub (struct block_list *bl, va_list ap)
  880. @@ -2878,6 +2884,7 @@
  881.  	{
  882.  		case BL_HOM: sd = ((TBL_HOM*)bl)->master; break;
  883.  		case BL_MER: sd = ((TBL_MER*)bl)->master; break;
  884. +		default : break; //unhandled type
  885.  	}
  886.  
  887.  	status = status_get_status_data(bl);
  888. @@ -3104,10 +3111,10 @@
  889.  							if( j )
  890.  							{
  891.  								i = applyeffects[rnd()%j];
  892. -								status_change_start(target, i, 10000, skl->skill_lv,
  893. +								sc_start4(target, i, 100, skl->skill_lv,
  894.  									(i == SC_BURNING ? 1000 : 0),
  895.  									(i == SC_BURNING ? src->id : 0),
  896. -									0, skill_get_time(WL_TETRAVORTEX,skl->skill_lv), 0);
  897. +									0, skill_get_time(WL_TETRAVORTEX,skl->skill_lv) );
  898.  							}
  899.  						}
  900.  					}
  901. @@ -3127,9 +3134,11 @@
  902.  					break;
  903.  				case LG_MOONSLASHER:
  904.  				case SR_WINDMILL:
  905. -					if( target->type == BL_PC ) {
  906. -						struct map_session_data *tsd = NULL;
  907. -						if( (tsd = ((TBL_PC*)target)) && !pc_issit(tsd) ) {
  908. +					if( target->type == BL_PC )
  909. +					{
  910. +						TBL_PC *tsd = BL_CAST(BL_PC,target);
  911. +						if( tsd && !pc_issit(tsd) )
  912. +						{
  913.  							pc_setsit(tsd);
  914.  							skill_sit(tsd,1);
  915.  							clif_sitting(&tsd->bl);
  916. @@ -3229,6 +3238,7 @@
  917.  	}
  918.  	return 1;
  919.  }
  920. +
  921.  static int skill_ative_reverberation( struct block_list *bl, va_list ap) {
  922.  	struct skill_unit *su = (TBL_SKILL*)bl;
  923.  	struct skill_unit_group *sg;
  924. @@ -4155,7 +4165,7 @@
  925.  
  926.  				if( j == 0 )
  927.  				{ // No Spheres
  928. -					clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0);
  929. +					clif_skill_fail(sd,skillid,USESKILL_FAIL_SUMMON_NONE,0);
  930.  					break;
  931.  				}
  932.  
  933. @@ -4241,6 +4251,7 @@
  934.  				sc_start(bl, SC_INFRAREDSCAN, 10000, skilllv, skill_get_time(skillid, skilllv));
  935.  			status_change_end(bl, SC_HIDING, INVALID_TIMER);
  936.  			status_change_end(bl, SC_CLOAKING, INVALID_TIMER);
  937. +            status_change_end(bl, SC_CHASEWALK, INVALID_TIMER);
  938.  			status_change_end(bl, SC_CLOAKINGEXCEED, INVALID_TIMER); // Need confirm it.
  939.  		}
  940.  		else
  941. @@ -4304,20 +4315,26 @@
  942.  		break;
  943.  
  944.  	case SR_HOWLINGOFLION:
  945. -			status_change_end(bl, SC_SWINGDANCE, INVALID_TIMER);
  946. -			status_change_end(bl, SC_SYMPHONYOFLOVER, INVALID_TIMER);
  947. -			status_change_end(bl, SC_MOONLITSERENADE, INVALID_TIMER);
  948. -			status_change_end(bl, SC_RUSHWINDMILL, INVALID_TIMER);
  949. -			status_change_end(bl, SC_ECHOSONG, INVALID_TIMER);
  950. -			status_change_end(bl, SC_HARMONIZE, INVALID_TIMER);
  951. -			status_change_end(bl, SC_SIRCLEOFNATURE, INVALID_TIMER);
  952. -			status_change_end(bl, SC_SATURDAYNIGHTFEVER, INVALID_TIMER);
  953. -			status_change_end(bl, SC_DANCEWITHWUG, INVALID_TIMER);
  954. -			status_change_end(bl, SC_LERADSDEW, INVALID_TIMER);
  955. -			status_change_end(bl, SC_MELODYOFSINK, INVALID_TIMER);
  956. -			status_change_end(bl, SC_BEYONDOFWARCRY, INVALID_TIMER);
  957. -			status_change_end(bl, SC_UNLIMITEDHUMMINGVOICE, INVALID_TIMER);
  958. +		{
  959. +			struct status_change *tsc = status_get_sc(bl);
  960. +            if(tsc && tsc->count){
  961. +                int i=0;
  962. +                const enum sc_type scs[] = {
  963. +                    SC_SWINGDANCE, SC_SYMPHONYOFLOVER,
  964. +                    SC_MOONLITSERENADE, SC_RUSHWINDMILL, SC_ECHOSONG, SC_HARMONIZE,
  965. +                    SC_DEEPSLEEP, SC_VOICEOFSIREN, SC_SATURDAYNIGHTFEVER, SC_GLOOMYDAY, //Group B
  966. +                    SC_UNLIMITEDHUMMINGVOICE, SC_SONGOFMANA, SC_DANCEWITHWUG, 
  967. +                    SC_BEYONDOFWARCRY, SC_MELODYOFSINK, SC_LERADSDEW, SC_SIRCLEOFNATURE   //Group B Wanderer        
  968. +                };
  969. +                        
  970. +                for (i = 0; i < ARRAYLENGTH(scs); i++){
  971. +                        if(i==SC_SATURDAYNIGHTFEVER) tsc->data[i]->val2=0; //Mark a dispelled berserk to avoid setting hp to 100 by setting hp penalty to 0.
  972. +                        if (tsc->data[scs[i]]) 
  973. +                                status_change_end(bl, scs[i], INVALID_TIMER);
  974. +                }
  975. +            }    
  976.  			skill_attack(BF_WEAPON, src, src, bl, skillid, skilllv, tick, flag);
  977. +		}
  978.  		break;
  979.  
  980.  	case SR_EARTHSHAKER:
  981. @@ -4346,10 +4363,10 @@
  982.  			struct status_change *tsc = status_get_sc(bl);
  983.  			if( tsc && tsc->data[SC_POISON] ) {
  984.  				skill_attack(skill_get_type(skillid), src, src, bl, skillid, skilllv, tick, flag);
  985. -				status_change_end(bl, SC_POISON, INVALID_TIMER);
  986. +			status_change_end(bl, SC_POISON, INVALID_TIMER);
  987.  			}
  988.  			else if( sd )
  989. -				clif_skill_fail(sd, skillid, 0, 0);
  990. +			clif_skill_fail(sd, skillid, USESKILL_FAIL_LEVEL, 0);
  991.  		}
  992.  		break;
  993.  
  994. @@ -4417,7 +4434,7 @@
  995.  	case EL_ROCK_CRUSHER:
  996.  		clif_skill_nodamage(src,battle_get_master(src),skillid,skilllv,1);
  997.  		clif_skill_damage(src, src, tick, status_get_amotion(src), 0, -30000, 1, skillid, skilllv, 6);
  998. -		if( rnd()%100 < 50 )
  999. +			if( rnd()%100 < 50 )
  1000.  			skill_attack(BF_MAGIC,src,src,bl,skillid,skilllv,tick,flag);
  1001.  		else
  1002.  			skill_attack(BF_WEAPON,src,src,bl,EL_ROCK_CRUSHER_ATK,skilllv,tick,flag);
  1003. @@ -4802,6 +4819,7 @@
  1004.  					else switch (src->type) {
  1005.  						case BL_MOB: target_id = ((TBL_MOB*)src)->target_id; break;
  1006.  						case BL_PET: target_id = ((TBL_PET*)src)->target_id; break;
  1007. +						default : break; //unhandled type
  1008.  					}
  1009.  					if (!target_id)
  1010.  						break;
  1011. @@ -7454,9 +7472,9 @@
  1012.  			if( (tsc && (tsc->data[SC_FREEZE] || tsc->data[SC_STONE] ||
  1013.  				tsc->data[SC_BLIND]))&& (rnd()%100 < 30+5*skilllv) )
  1014.  			{
  1015. -				status_change_end(bl, SC_FREEZE, INVALID_TIMER);
  1016. -				status_change_end(bl, SC_STONE, INVALID_TIMER);
  1017. -				status_change_end(bl, SC_BLIND, INVALID_TIMER);
  1018. +                status_change_end(bl, SC_FREEZE, INVALID_TIMER);
  1019. +                status_change_end(bl, SC_STONE, INVALID_TIMER);
  1020. +                status_change_end(bl, SC_BLIND, INVALID_TIMER);
  1021.  			}
  1022.  			// Success rate only applies to the curing effect and not stat bonus.
  1023.  			clif_skill_nodamage(bl, bl, skillid, skilllv,
  1024. @@ -7740,7 +7758,7 @@
  1025.  
  1026.  	case RA_WUGDASH:
  1027.  		if( tsce ) {
  1028. -			clif_skill_nodamage(src,bl,skillid,skilllv,status_change_end(bl, type, -1));
  1029. +			clif_skill_nodamage(src,bl,skillid,skilllv,status_change_end(bl, type, INVALID_TIMER));
  1030.  			map_freeblock_unlock();
  1031.  			return 0;
  1032.  		}
  1033. @@ -7830,7 +7848,7 @@
  1034.  				clif_skill_nodamage(src,bl,skillid,1,1);
  1035.  			}
  1036.  			else
  1037. -				clif_skill_fail(sd,skillid,0x15,0);
  1038. +				clif_skill_fail(sd,skillid,USESKILL_FAIL_GC_WEAPONBLOCKING,0);
  1039.  		}
  1040.  		break;
  1041.  
  1042. @@ -7938,7 +7956,7 @@
  1043.  								clif_skill_damage(src,bl,tick, status_get_amotion(src), 0, -30000, 1, skillid, skilllv, 6);
  1044.  								if( rate < brate )
  1045.  									map_foreachinrange(skill_area_sub,src,skill_get_splash(skillid,skilllv),BL_CHAR,src,skillid,skilllv,tick,flag|BCT_ENEMY|1,skill_castend_damage_id);
  1046. -								status_change_end(bl,SC_SHIELDSPELL_DEF,INVALID_TIMER);
  1047. +								status_change_end(bl,SC_SHIELDSPELL_DEF, INVALID_TIMER);
  1048.  								break;
  1049.  							case 2:
  1050.  								val = 10 * shield_data->def; // % Reflected damage.
  1051. @@ -8039,6 +8057,7 @@
  1052.  			clif_skill_nodamage(bl,src,skillid,skilllv,
  1053.  				sc_start(bl, type, 100, skilllv, skill_get_time(skillid, skilllv)));
  1054.  		break;
  1055. +
  1056.  	case SR_CURSEDCIRCLE:
  1057.  		if( flag&1 ) {
  1058.  			if( is_boss(bl) ) break;
  1059. @@ -8204,7 +8223,7 @@
  1060.  				status_fix_damage(src,bl,9999,clif_damage(src,bl,tick,0,0,9999,0,0,0));
  1061.  		} else if( sd ) {
  1062.  			if( !sd->status.party_id ) {
  1063. -				clif_skill_fail(sd,skillid,0x11,0);
  1064. +				clif_skill_fail(sd,skillid,USESKILL_FAIL_NEED_HELPER,0);
  1065.  				break;
  1066.  			}
  1067.  			if( map_foreachinrange(skill_area_sub, bl, skill_get_splash(skillid,skilllv),
  1068. @@ -8281,6 +8300,7 @@
  1069.  					else switch (src->type) {
  1070.  						case BL_MOB: target_id = ((TBL_MOB*)src)->target_id; break;
  1071.  						case BL_PET: target_id = ((TBL_PET*)src)->target_id; break;
  1072. +						default : break; //unhandled type
  1073.  					}
  1074.  					if (!target_id)
  1075.  						break;
  1076. @@ -8355,12 +8375,12 @@
  1077.  
  1078.  			// Remove previous elemental fisrt.
  1079.  			if( sd->ed && elemental_delete(sd->ed,0) ) {
  1080. -				clif_skill_fail(sd,skillid,0,0);
  1081. +				clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0);
  1082.  				break;
  1083.  			}
  1084.  			// Summoning the new one.
  1085.  			if( !elemental_create(sd,elemental_class,skill_get_time(skillid,skilllv)) ) {
  1086. -				clif_skill_fail(sd,skillid,0,0);
  1087. +				clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0);
  1088.  				break;
  1089.  			}
  1090.  			clif_skill_nodamage(src,bl,skillid,skilllv,1);
  1091. @@ -8371,12 +8391,12 @@
  1092.  		if( sd ) {
  1093.  			int mode = EL_MODE_PASSIVE;	// Standard mode.
  1094.  			if( !sd->ed ) {
  1095. -				clif_skill_fail(sd,skillid,0,0);
  1096. +				clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0);
  1097.  				break;
  1098.  			}
  1099.  			if( skilllv == 4 ) {// At level 4 delete elementals.
  1100.  				if( elemental_delete(sd->ed, 0) )
  1101. -					clif_skill_fail(sd,skillid,0,0);
  1102. +					clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0);
  1103.  				break;
  1104.  			}
  1105.  			switch( skilllv ) {// Select mode bassed on skill level used.
  1106. @@ -8385,7 +8405,7 @@
  1107.  				case 3: mode = EL_MODE_AGGRESSIVE; break;
  1108.  			}
  1109.  			if( !elemental_change_mode(sd->ed,mode) ) {
  1110. -				clif_skill_fail(sd,skillid,0,0);
  1111. +				clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0);
  1112.  				break;
  1113.  			}
  1114.  			clif_skill_nodamage(src,bl,skillid,skilllv,1);
  1115. @@ -8407,11 +8427,11 @@
  1116.  			int s_hp = sd->battle_status.hp * 10 / 100, s_sp = sd->battle_status.sp * 10 / 100;
  1117.  			int e_hp, e_sp;
  1118.  			if( !ed ) {
  1119. -				clif_skill_fail(sd,skillid,0,0);
  1120. +				clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0);
  1121.  				break;
  1122.  			}
  1123.  			if( !status_charge(&sd->bl,s_hp,s_sp) ) {
  1124. -				clif_skill_fail(sd,skillid,0,0);
  1125. +				clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0);
  1126.  				break;
  1127.  			}
  1128.  			e_hp = ed->battle_status.max_hp * 10 / 100;
  1129. @@ -8434,7 +8454,7 @@
  1130.  			clif_skill_nodamage(src, bl, skillid, skilllv, 1);
  1131.  			sc_start2(bl, type, 100, skilllv, src->id, skill_get_time(skillid,skilllv));
  1132.  		} else if( sd ) {
  1133. -			clif_skill_fail(sd, skillid, 0, 0);
  1134. +			clif_skill_fail(sd, skillid, USESKILL_FAIL_LEVEL, 0);
  1135.  			break;
  1136.  		}
  1137.  		break;
  1138. @@ -8466,7 +8486,7 @@
  1139.  					else
  1140.  						skill_attack(BF_WEAPON,src,src,bl,GN_SLINGITEM_RANGEMELEEATK,skilllv,tick,flag);
  1141.  				} else //Otherwise, it fails, shows animation and removes items.
  1142. -					clif_skill_fail(sd,GN_SLINGITEM_RANGEMELEEATK,0xa,0);
  1143. +					clif_skill_fail(sd,GN_SLINGITEM_RANGEMELEEATK,USESKILL_FAIL,0);
  1144.  			} else {
  1145.  				struct script_code *script = sd->inventory_data[i]->script;
  1146.  				if( !script )
  1147. @@ -9617,7 +9637,7 @@
  1148.  
  1149.  	case LG_BANDING:
  1150.  		if( sc && sc->data[SC_BANDING] )
  1151. -			status_change_end(src,SC_BANDING,INVALID_TIMER);
  1152. +			status_change_end(src,SC_BANDING, INVALID_TIMER);
  1153.  		else if( (sg = skill_unitsetting(src,skillid,skilllv,src->x,src->y,0)) != NULL ) {
  1154.  			sc_start4(src,SC_BANDING,100,skilllv,0,0,sg->group_id,skill_get_time(skillid,skilllv));
  1155.  			if( sd ) pc_banding(sd,skilllv);
  1156. @@ -9686,7 +9706,7 @@
  1157.  			}
  1158.  		}
  1159.  		break;
  1160. -		
  1161. +
  1162.  	case SO_FIREWALK:
  1163.  	case SO_ELECTRICWALK:
  1164.  		if( sc && sc->data[type] )
  1165. @@ -11075,8 +11095,8 @@
  1166.  				// Reveal hidden players every 5 seconds.
  1167.  				if( sg->val2 % 5 == 0 ) {
  1168.  					// TODO: check if other hidden status can be removed.
  1169. -					status_change_end(bl,SC_HIDING,INVALID_TIMER);
  1170. -					status_change_end(bl,SC_CLOAKING,INVALID_TIMER);
  1171. +					status_change_end(bl,SC_HIDING, INVALID_TIMER);
  1172. +					status_change_end(bl,SC_CLOAKING, INVALID_TIMER);
  1173.  				}
  1174.  			}
  1175.  			/* Enable this if kRO fix the current skill. Currently no damage on undead and demon monster. [Jobbie]
  1176. @@ -12186,7 +12206,7 @@
  1177.  		case SC_MANHOLE:
  1178.  		case SC_DIMENSIONDOOR:
  1179.  			if( sc && sc->data[SC_MAGNETICFIELD] ) {
  1180. -				clif_skill_fail(sd,skill,0,0);
  1181. +			clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0);
  1182.  				return 0;
  1183.  			}
  1184.  			break;
  1185. @@ -12194,7 +12214,7 @@
  1186.  				int count;
  1187.  				count = skill_check_pc_partner(sd, skill, &lv, skill_get_splash(skill,lv), 0);
  1188.  				if( count < 1 ) {
  1189. -					clif_skill_fail(sd,skill,0x11,0);
  1190. +				clif_skill_fail(sd,skill,USESKILL_FAIL_NEED_HELPER,0);
  1191.  					return 0;
  1192.  				} else
  1193.  					require.sp -= require.sp * 20 * count / 100; //  -20% each W/M in the party.
  1194. @@ -12204,19 +12224,19 @@
  1195.  		case SO_ELECTRICWALK:	// Can't be casted until you've walked all cells.
  1196.  			if( sc && sc->data[SC_PROPERTYWALK] &&
  1197.  			   sc->data[SC_PROPERTYWALK]->val3 < skill_get_maxcount(sc->data[SC_PROPERTYWALK]->val1,sc->data[SC_PROPERTYWALK]->val2) ) {
  1198. -				clif_skill_fail(sd,skill,0x0,0);
  1199. +			clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0);
  1200.  				return 0;
  1201.  			}
  1202.  			break;
  1203.  		case SO_EL_CONTROL:
  1204.  			if( !sd->status.ele_id || !sd->ed ) {
  1205. -				clif_skill_fail(sd,skill,0x00,0);
  1206. +			clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0);
  1207.  				return 0;
  1208.  			}
  1209.  			break;
  1210.  		case RETURN_TO_ELDICASTES:
  1211.  			if( sd->sc.option&OPTION_MADOGEAR ) { //Cannot be used if Mado is equipped.
  1212. -				clif_skill_fail(sd,skill,0,0);
  1213. +			clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0);
  1214.  				return 0;
  1215.  			}
  1216.  			break;			
  1217. @@ -14251,7 +14271,7 @@
  1218.  				struct status_change *sc = NULL;
  1219.  				if( (sc = status_get_sc(src)) != NULL && sc->data[SC_NEUTRALBARRIER_MASTER] ) {
  1220.  					sc->data[SC_NEUTRALBARRIER_MASTER]->val2 = 0;
  1221. -					status_change_end(src,SC_NEUTRALBARRIER_MASTER,INVALID_TIMER);
  1222. +					status_change_end(src,SC_NEUTRALBARRIER_MASTER, INVALID_TIMER);
  1223.  				}
  1224.  			}
  1225.  			break;
  1226. @@ -14260,7 +14280,7 @@
  1227.  				struct status_change *sc = NULL;
  1228.  				if( (sc = status_get_sc(src)) != NULL && sc->data[SC_STEALTHFIELD_MASTER] ) {
  1229.  					sc->data[SC_STEALTHFIELD_MASTER]->val2 = 0;
  1230. -					status_change_end(src,SC_STEALTHFIELD_MASTER,INVALID_TIMER);
  1231. +					status_change_end(src,SC_STEALTHFIELD_MASTER, INVALID_TIMER);
  1232.  				}
  1233.  			}
  1234.  			break;
  1235. @@ -14269,7 +14289,7 @@
  1236.  				struct status_change *sc = NULL;
  1237.  				if( (sc = status_get_sc(src)) && sc->data[SC_BANDING] ) {
  1238.  					sc->data[SC_BANDING]->val4 = 0;
  1239. -					status_change_end(src,SC_BANDING,INVALID_TIMER);
  1240. +					status_change_end(src,SC_BANDING, INVALID_TIMER);
  1241.  				}
  1242.  			}
  1243.  			break;
  1244. @@ -15318,7 +15338,7 @@
  1245.  					break;
  1246.  				case GN_MAKEBOMB:
  1247.  				case GN_MIX_COOKING:
  1248. -					clif_msg_skill(sd,skill_id,0x627);
  1249. +					clif_msg_skill(sd,skill_id,1);
  1250.  					break;
  1251.  				case GN_S_PHARMACY:
  1252.  					break;	// No effects here.					
  1253. @@ -15387,13 +15407,13 @@
  1254.  						clif_additem(sd,0,0,flag);
  1255.  						map_addflooritem(&tmp_item,tmp_item.amount,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
  1256.  					}
  1257. -					clif_msg_skill(sd,skill_id,0x628);
  1258. +					clif_msg_skill(sd,skill_id,2);
  1259.  				}
  1260.  				break;
  1261.  			case GN_S_PHARMACY:
  1262.  				break;	// No effects here.
  1263.  			case GN_MAKEBOMB:
  1264. -				clif_msg_skill(sd,skill_id,0x628);
  1265. +				clif_msg_skill(sd,skill_id,2);
  1266.  				break;				
  1267.  			default:
  1268.  				if( skill_produce_db[idx].itemlv > 10 && skill_produce_db[idx].itemlv <= 20 )
  1269. @@ -15591,10 +15611,10 @@
  1270.  
  1271.  	return 1;
  1272.  }
  1273. +
  1274.  int skill_select_menu(struct map_session_data *sd,int flag,int skill_id) {
  1275.  	int id, lv, prob, aslvl = 0;
  1276.  	nullpo_ret(sd);
  1277. -	
  1278.  	if (sd->sc.data[SC_STOP]) {
  1279.  		aslvl = sd->sc.data[SC_STOP]->val1;
  1280.  		status_change_end(&sd->bl,SC_STOP,INVALID_TIMER);
  1281. @@ -15612,6 +15632,7 @@
  1282.  	sc_start4(&sd->bl,SC__AUTOSHADOWSPELL,100,id,lv,prob,0,skill_get_time(SC_AUTOSHADOWSPELL,aslvl));
  1283.  	return 0;
  1284.  }
  1285. +
  1286.  int skill_elementalanalysis(struct map_session_data* sd, int n, int skill_lv, unsigned short* item_list) {
  1287.  	int i;
  1288.  
  1289. @@ -15631,7 +15652,7 @@
  1290.  		if( skill_lv == 2 )
  1291.  			del_amount -= (del_amount % 10);
  1292.  		add_amount = (skill_lv == 1) ? del_amount * (5 + rnd()%5) : del_amount / 10 ;
  1293. -		
  1294. +
  1295.  		if( (nameid = sd->status.inventory[idx].nameid) <= 0 || del_amount > sd->status.inventory[idx].amount ) {
  1296.  			clif_skill_fail(sd,SO_EL_ANALYSIS,0,0);
  1297.  			return 1;
  1298. @@ -16631,6 +16652,7 @@
  1299.  
  1300.  	return true;
  1301.  }
  1302. +
  1303.  static bool skill_parse_row_spellbookdb(char* split[], int columns, int current)
  1304.  {// SkillID,PreservePoints
  1305.  
  1306. @@ -16655,6 +16677,7 @@
  1307.  
  1308.  	return false;
  1309.  }
  1310. +
  1311.  static bool skill_parse_row_improvisedb(char* split[], int columns, int current)
  1312.  {// SkillID
  1313.  	int i = atoi(split[0]);
  1314. Index: src/map/unit.c
  1315. ===================================================================
  1316. --- src/map/unit.c	(revision 16039)
  1317. +++ src/map/unit.c	(working copy)
  1318. @@ -7,6 +7,7 @@
  1319.  #include "../common/db.h"
  1320.  #include "../common/malloc.h"
  1321.  #include "../common/random.h"
  1322. +
  1323.  #include "unit.h"
  1324.  #include "map.h"
  1325.  #include "path.h"
  1326. @@ -136,8 +137,7 @@
  1327.  		return 0;
  1328.  	}
  1329.  	ud->walktimer = INVALID_TIMER;
  1330. -	if( bl->prev == NULL ) return 0; // block_list ‚©‚甲‚¯‚Ä‚¢‚é‚̂ňړ®’âŽ~‚·‚é
  1331. -
  1332. +	if( bl->prev == NULL ) return 0; // Stop moved because it is missing from the block_list
  1333.  	if(ud->walkpath.path_pos>=ud->walkpath.path_len)
  1334.  		return 0;
  1335.  
  1336. @@ -1010,8 +1008,8 @@
  1337.  	int temp = 0;
  1338.  
  1339.  	nullpo_ret(src);
  1340. -	if(status_isdead(src))
  1341. -		return 0; // Ž€‚ñ‚Å‚¢‚È‚¢‚©
  1342. +	if( status_isdead(src) )
  1343. +		return 0; //Do not continue source is dead
  1344.  
  1345.  	sd = BL_CAST(BL_PC, src);
  1346.  	ud = unit_bl2ud(src);
  1347. @@ -1097,7 +1095,7 @@
  1348.  		return 0;
  1349.  
  1350.  	tstatus = status_get_status_data(target);
  1351. -	//’Œ‘O‚̃XƒLƒ‹ó‹µ‚Ì‹L˜^
  1352. +	//The previous record of skill status
  1353.  	if(sd) {
  1354.  		switch(skill_num){
  1355.  		case SA_CASTCANCEL:
  1356. @@ -1132,11 +1130,10 @@
  1357.  			break;
  1358.  		case WL_WHITEIMPRISON:
  1359.  			if( battle_check_target(src,target,BCT_SELF|BCT_ENEMY) < 0 ) {
  1360. -				clif_skill_fail(sd,skill_num,0xb,0);
  1361. +				clif_skill_fail(sd,skill_num,USESKILL_FAIL_TOTARGET,0);
  1362.  				return 0;
  1363.  			}
  1364.  			break;
  1365. -
  1366.  		}
  1367.  		if (!skill_check_condition_castbegin(sd, skill_num, skill_lv))
  1368.  			return 0;
  1369. @@ -1259,6 +1256,7 @@
  1370.  					md->state.aggressive = (tstatus->mode&MD_ANGRY)?1:0;
  1371.  					md->min_chase = md->db->range3;
  1372.  					break;
  1373. +				default: break; //unhandled type
  1374.  				}
  1375.  			}
  1376.  		}
  1377. @@ -1295,11 +1293,11 @@
  1378.  			status_change_end(src,SC_CLOAKINGEXCEED, INVALID_TIMER);
  1379.  			if (!src->prev) return 0;
  1380.  		} else if( sc->data[SC_CAMOUFLAGE] && skill_num != RA_CAMOUFLAGE )
  1381. -			status_change_end(src,SC_CAMOUFLAGE,INVALID_TIMER);
  1382. +			status_change_end(src,SC_CAMOUFLAGE, INVALID_TIMER);
  1383.  
  1384.  		if( sc->data[SC_CURSEDCIRCLE_ATKER] ) {
  1385.  			sc->data[SC_CURSEDCIRCLE_ATKER]->val3 = 1;
  1386. -			status_change_end(src,SC_CURSEDCIRCLE_ATKER,INVALID_TIMER);
  1387. +			status_change_end(src,SC_CURSEDCIRCLE_ATKER, INVALID_TIMER);
  1388.  		}
  1389.  
  1390.  	}
  1391. @@ -1338,7 +1336,7 @@
  1392.  
  1393.  	nullpo_ret(src);
  1394.  
  1395. -	if(!src->prev) return 0; // map ã‚É‘¶Ý‚·‚é‚©
  1396. +	if(!src->prev) return 0; // Exists on the map
  1397.  	if(status_isdead(src)) return 0;
  1398.  
  1399.  	sd = BL_CAST(BL_PC, src);
  1400. @@ -1375,7 +1373,7 @@
  1401.  		return 0;
  1402.  	}
  1403.  
  1404. -	/* ŽË’ö‚ƏáŠQ•šƒ`ƒFƒbƒN */
  1405. +	/* Check range and obstacle */
  1406.  	bl.type = BL_NUL;
  1407.  	bl.m = src->m;
  1408.  	bl.x = skill_x;
  1409. @@ -1427,7 +1425,7 @@
  1410.  
  1411.  		if( sc->data[SC_CURSEDCIRCLE_ATKER] ) {
  1412.  			sc->data[SC_CURSEDCIRCLE_ATKER]->val3 = 1;
  1413. -			status_change_end(src,SC_CURSEDCIRCLE_ATKER,INVALID_TIMER);
  1414. +			status_change_end(src,SC_CURSEDCIRCLE_ATKER, INVALID_TIMER);
  1415.  		}
  1416.  
  1417.  	}
  1418. @@ -1499,8 +1497,8 @@
  1419.  }
  1420.  
  1421.  /*==========================================
  1422. - * UŒ‚—v‹
  1423. - * type‚ª1‚È‚çŒp‘±UŒ‚
  1424. + * Attack request
  1425. + * If type is an ongoing attack
  1426.   *------------------------------------------*/
  1427.  int unit_attack(struct block_list *src,int target_id,int continuous)
  1428.  {
  1429. @@ -1581,7 +1579,7 @@
  1430.  {
  1431.  	nullpo_retr(false, bl);
  1432.  
  1433. -	if( bl->x==x && bl->y==y )	// “¯‚¶ƒ}ƒX
  1434. +	if( bl->x==x && bl->y==y )	//Same place
  1435.  		return true;
  1436.  
  1437.  	return path_search(NULL,bl->m,bl->x,bl->y,x,y,easy,CELL_CHKNOREACH);
  1438. @@ -1625,7 +1623,7 @@
  1439.  	return path_search(NULL,bl->m,bl->x,bl->y,tbl->x-dx,tbl->y-dy,easy,CELL_CHKNOREACH);
  1440.  }
  1441.  /*==========================================
  1442. - * Calculates position of Pet/Mercenary/Homunculus
  1443. + * Calculates position of Pet/Mercenary/Homunculus/Elemental
  1444.   *------------------------------------------*/
  1445.  int	unit_calc_pos(struct block_list *bl, int tx, int ty, int dir)
  1446.  {
  1447. @@ -1683,7 +1681,7 @@
  1448.  }
  1449.  
  1450.  /*==========================================
  1451. - * PC‚̍UŒ‚ (timerŠÖ”)
  1452. + * Attack of the PC (function timer)
  1453.   *------------------------------------------*/
  1454.  static int unit_attack_timer_sub(struct block_list* src, int tid, unsigned int tick)
  1455.  {
  1456. @@ -1881,7 +1879,7 @@
  1457.  	return 1;
  1458.  }
  1459.  
  1460. -// unit_data ‚̏‰Šú‰»ˆ—
  1461. +// unit_data initialization process
  1462.  void unit_dataset(struct block_list *bl)
  1463.  {
  1464.  	struct unit_data *ud;
  1465. @@ -1922,7 +1920,7 @@
  1466.  }
  1467.  
  1468.  /*==========================================
  1469. - * Œ©‚œ–ڂ̃TƒCƒY‚ð•ÏX‚·‚é
  1470. + * To change the size of the object (player or mob only)
  1471.   *------------------------------------------*/
  1472.  int unit_changeviewsize(struct block_list *bl,short size)
  1473.  {
  1474. @@ -2418,7 +2416,8 @@
  1475.  
  1476.  			elemental_summon_stop(ed);
  1477.  			break;
  1478. -		}			
  1479. +		}
  1480. +	    default: break; //unhandled type
  1481.  	}
  1482.  
  1483.  	skill_clear_unitgroup(bl);
  1484. Index: src/map/battle.h
  1485. ===================================================================
  1486. --- src/map/battle.h	(revision 16039)
  1487. +++ src/map/battle.h	(working copy)
  1488. @@ -14,7 +14,7 @@
  1489.  	ATK_DEF      // attack connected
  1490.  } damage_lv;
  1491.  
  1492. -// ƒ_ƒ[ƒW
  1493. +// dammage structure
  1494.  struct Damage {
  1495.  	int damage,damage2;
  1496.  	int type,div_;
  1497. @@ -47,7 +47,7 @@
  1498.  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);
  1499.  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);
  1500.  
  1501. -enum {	// ÅIŒvŽZ‚̃tƒ‰ƒO
  1502. +enum {	//Attack type for battle calc
  1503.  	BF_WEAPON	= 0x0001,
  1504.  	BF_MAGIC	= 0x0002,
  1505.  	BF_MISC		= 0x0004,
  1506. Index: src/map/skill.h
  1507. ===================================================================
  1508. --- src/map/skill.h	(revision 16039)
  1509. +++ src/map/skill.h	(working copy)
  1510. @@ -87,7 +87,7 @@
  1511.  	int itemid[MAX_SKILL_ITEM_REQUIRE],amount[MAX_SKILL_ITEM_REQUIRE];
  1512.  };
  1513.  
  1514. -// ƒXƒLƒ‹ƒf?ƒ^ƒx?ƒX
  1515. +// Database skills
  1516.  struct s_skill_db {
  1517.  	char name[NAME_LENGTH];
  1518.  	char desc[40];
  1519. @@ -116,7 +116,7 @@
  1520.  extern struct s_skill_db skill_db[MAX_SKILL_DB];
  1521.  
  1522.  #define MAX_SKILL_UNIT_LAYOUT	50
  1523. -#define MAX_SQUARE_LAYOUT		5	// 11*11‚̃†ƒjƒbƒg”z’u‚ªÅ‘å
  1524. +#define MAX_SQUARE_LAYOUT		5	// 11*11 Placement of a maximum unit
  1525.  #define MAX_SKILL_UNIT_COUNT ((MAX_SQUARE_LAYOUT*2+1)*(MAX_SQUARE_LAYOUT*2+1))
  1526.  struct s_skill_unit_layout {
  1527.  	int count;
  1528. @@ -194,7 +194,7 @@
  1529.  	UF_DUALMODE      = 0x0800,	// Spells should trigger both ontimer and onplace/onout/onleft effects.
  1530.  };
  1531.  
  1532. -// ƒAƒCƒeƒ€ì¬ƒf?ƒ^ƒx?ƒX
  1533. +// Create Database item
  1534.  struct s_skill_produce_db {
  1535.  	int nameid, trigger;
  1536.  	int req_skill,req_skill_lv,itemlv;
  1537. @@ -202,14 +202,14 @@
  1538.  };
  1539.  extern struct s_skill_produce_db skill_produce_db[MAX_SKILL_PRODUCE_DB];
  1540.  
  1541. -// –îì¬ƒf?ƒ^ƒx?ƒX
  1542. +// Creating database arrow
  1543.  struct s_skill_arrow_db {
  1544.  	int nameid, trigger;
  1545.  	int cre_id[MAX_ARROW_RESOURCE],cre_amount[MAX_ARROW_RESOURCE];
  1546.  };
  1547.  extern struct s_skill_arrow_db skill_arrow_db[MAX_SKILL_ARROW_DB];
  1548.  
  1549. -// ƒAƒuƒ‰ƒJƒ_ƒuƒ‰ƒf?ƒ^ƒx?ƒX
  1550. +// Abracadabra database
  1551.  struct s_skill_abra_db {
  1552.  	int skillid;
  1553.  	int req_lv;
  1554. @@ -226,7 +226,8 @@
  1555.  //Returns the cast type of the skill: ground cast, castend damage, castend no damage
  1556.  enum { CAST_GROUND, CAST_DAMAGE, CAST_NODAMAGE };
  1557.  int skill_get_casttype(int id); //[Skotlex]
  1558. -// ƒXƒLƒ‹ƒf?ƒ^ƒx?ƒX‚ւ̃AƒNƒZƒT
  1559. +
  1560. +// Accessor to the skills database
  1561.  //
  1562.  int skill_get_index( int id );
  1563.  int	skill_get_type( int id );
  1564. @@ -276,13 +277,13 @@
  1565.  int skill_cleartimerskill(struct block_list *src);
  1566.  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);
  1567.  
  1568. -// ’ljÁ?‰Ê
  1569. +// Results? Added
  1570.  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);
  1571.  int skill_counter_additional_effect( struct block_list* src, struct block_list *bl,int skillid,int skilllv,int attack_type,unsigned int tick);
  1572.  int skill_blown(struct block_list* src, struct block_list* target, int count, int direction, int flag);
  1573.  int skill_break_equip(struct block_list *bl, unsigned short where, int rate, int flag);
  1574.  int skill_strip_equip(struct block_list *bl, unsigned short where, int rate, int lv, int time);
  1575. -// ƒ†ƒjƒbƒgƒXƒLƒ‹
  1576. +// Skills unit
  1577.  struct skill_unit_group* skill_id2group(int group_id);
  1578.  struct skill_unit_group *skill_unitsetting(struct block_list* src, short skillid, short skilllv, short x, short y, int flag);
  1579.  struct skill_unit *skill_initunit (struct skill_unit_group *group, int idx, int x, int y, int val1, int val2);
  1580. @@ -317,7 +318,7 @@
  1581.  // Guild skills [celest]
  1582.  int skill_guildaura_sub (struct map_session_data* sd, int id, int strvit, int agidex);
  1583.  
  1584. -// ‰r¥ƒLƒƒƒ“ƒZƒ‹
  1585. +// Chant canceled
  1586.  int skill_castcancel(struct block_list *bl,int type);
  1587.  
  1588.  int skill_sit (struct map_session_data *sd, int type);
  1589. @@ -331,7 +332,7 @@
  1590.  
  1591.  bool skill_check_cloaking(struct block_list *bl, struct status_change_entry *sce);
  1592.  
  1593. -// ƒXƒe?ƒ^ƒXˆÙí
  1594. +// Abnormal status
  1595.  int skill_enchant_elemental_end(struct block_list *bl, int type);
  1596.  int skillnotok(int skillid, struct map_session_data *sd);
  1597.  int skillnotok_hom(int skillid, struct homun_data *hd);
  1598. @@ -339,13 +340,13 @@
  1599.  
  1600.  int skill_chastle_mob_changetarget(struct block_list *bl,va_list ap);
  1601.  
  1602. -// ƒAƒCƒeƒ€ì¬
  1603. +// Item creation
  1604.  int skill_can_produce_mix( struct map_session_data *sd, int nameid, int trigger, int qty);
  1605.  int skill_produce_mix( struct map_session_data *sd, int skill_id, int nameid, int slot1, int slot2, int slot3, int qty );
  1606.  
  1607.  int skill_arrow_create( struct map_session_data *sd,int nameid);
  1608.  
  1609. -// mobƒXƒLƒ‹‚Ì‚œ‚ß
  1610. +// skills for the mob
  1611.  int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int skillid,int skilllv,unsigned int tick,int flag );
  1612.  int skill_castend_damage_id( struct block_list* src, struct block_list *bl,int skillid,int skilllv,unsigned int tick,int flag );
  1613.  int skill_castend_pos2( struct block_list *src, int x,int y,int skillid,int skilllv,unsigned int tick,int flag);
  1614. Index: src/map/unit.h
  1615. ===================================================================
  1616. --- src/map/unit.h	(revision 16039)
  1617. +++ src/map/unit.h	(working copy)
  1618. @@ -68,61 +68,61 @@
  1619.  	unsigned dead_sit : 2;
  1620.  };
  1621.  
  1622. -// PC, MOB, PET ‚É‹€’Ê‚·‚鏈—‚ð‚P‚‚ɂ܂Ƃ߂éŒv‰æ
  1623. +// PC, MOB, PET Planning process into one that is common to
  1624.  
  1625. -// •àsŠJŽn
  1626. -//     –ß‚è’l‚́A0 ( ¬Œ÷ ), 1 ( Žž”s )
  1627. +// walk initiation
  1628. +//     The return value is 0 (success), 1 (failure)
  1629.  int unit_walktoxy( struct block_list *bl, short x, short y, int easy);
  1630.  int unit_walktobl( struct block_list *bl, struct block_list *target, int range, int easy);
  1631.  int unit_run(struct block_list *bl);
  1632.  int unit_calc_pos(struct block_list *bl, int tx, int ty, int dir);
  1633.  
  1634. -// •às’âŽ~
  1635. -// type‚͈ȉº‚Ì‘g‚ݍ‡‚킹 : 
  1636. -//     1: ˆÊ’uî•ñ‚Ì‘—M( ‚±‚̊֐”‚ÌŒã‚Ɉʒuî•ñ‚𑗐M‚·‚éê‡‚Í•s—v )
  1637. -//     2: ƒ_ƒ[ƒWƒfƒBƒŒƒC—L‚è
  1638. -//     4: •s–Ÿ(MOB‚̂݁H)
  1639. +// Stop walking
  1640. +// The combination of the following type:
  1641. +//     1: (If you want to send the location information after this function is not required) transmission of location information
  1642. +//     2: Damaged delay
  1643. +//     4: Unknown (only MOB?)
  1644.  int unit_stop_walking(struct block_list *bl,int type);
  1645.  int unit_can_move(struct block_list *bl);
  1646.  int unit_is_walking(struct block_list *bl);
  1647.  int unit_set_walkdelay(struct block_list *bl, unsigned int tick, int delay, int type);
  1648.  
  1649.  int unit_escape(struct block_list *bl, struct block_list *target, short dist);
  1650. -// ˆÊ’u‚Ì‹­§ˆÚ“®(‚«”ò‚΂µ‚È‚Ç)
  1651. +// Position of forced move (such as a blow)
  1652.  int unit_movepos(struct block_list *bl, short dst_x, short dst_y, int easy, bool checkpath);
  1653.  int unit_warp(struct block_list *bl, short map, short x, short y, clr_type type);
  1654.  int unit_setdir(struct block_list *bl,unsigned char dir);
  1655.  uint8 unit_getdir(struct block_list *bl);
  1656.  int unit_blown(struct block_list* bl, int dx, int dy, int count, int flag);
  1657.  
  1658. -// ‚»‚±‚Ü‚Å•às‚Å‚œ‚Ç‚è’…‚¯‚é‚©‚Ì”»’è
  1659. +// Determination of walking path until you reach in there
  1660.  bool unit_can_reach_pos(struct block_list *bl,int x,int y,int easy);
  1661.  bool unit_can_reach_bl(struct block_list *bl,struct block_list *tbl, int range, int easy, short *x, short *y);
  1662.  
  1663. -// UŒ‚ŠÖ˜A
  1664. +// Attack-related
  1665.  int unit_stop_attack(struct block_list *bl);
  1666.  int unit_attack(struct block_list *src,int target_id,int continuous);
  1667.  int unit_cancel_combo(struct block_list *bl);
  1668.  
  1669. -// ƒXƒLƒ‹Žg—p
  1670. +// Using the skill
  1671.  int unit_skilluse_id(struct block_list *src, int target_id, short skill_num, short skill_lv);
  1672.  int unit_skilluse_pos(struct block_list *src, short skill_x, short skill_y, short skill_num, short skill_lv);
  1673.  
  1674. -// ƒXƒLƒ‹Žg—p( •â³Ï‚݃LƒƒƒXƒgŽžŠÔAƒLƒƒƒ“ƒZƒ‹•s‰ÂÝ’è•t‚« )
  1675. +// Skill use (corrected cast time, not with setting Cancel)
  1676.  int unit_skilluse_id2(struct block_list *src, int target_id, short skill_num, short skill_lv, int casttime, int castcancel);
  1677.  int unit_skilluse_pos2( struct block_list *src, short skill_x, short skill_y, short skill_num, short skill_lv, int casttime, int castcancel);
  1678.  
  1679. -// ‰r¥ƒLƒƒƒ“ƒZƒ‹
  1680. +// Chant canceled
  1681.  int unit_skillcastcancel(struct block_list *bl,int type);
  1682.  
  1683.  int unit_counttargeted(struct block_list *bl);
  1684.  int unit_set_target(struct unit_data* ud, int target_id);
  1685.  
  1686. -// unit_data ‚̏‰Šú‰»ˆ—
  1687. +// unit_data Initialization process
  1688.  void unit_dataset(struct block_list *bl);
  1689.  
  1690.  int unit_fixdamage(struct block_list *src,struct block_list *target,unsigned int tick,int sdelay,int ddelay,int damage,int div,int type,int damage2);
  1691. -// ‚»‚Ì‘Œ
  1692. +// Other
  1693.  struct unit_data* unit_bl2ud(struct block_list *bl);
  1694.  void unit_remove_map_pc(struct map_session_data *sd, clr_type clrtype);
  1695.  void unit_free_pc(struct map_session_data *sd);
  1696. @@ -131,7 +131,7 @@
  1697.  int unit_free(struct block_list *bl, clr_type clrtype);
  1698.  int unit_changeviewsize(struct block_list *bl,short size);
  1699.  
  1700. -// ‰Šú‰»ƒ‹[ƒ`ƒ“
  1701. +// Initialization routine
  1702.  int do_init_unit(void);
  1703.  int do_final_unit(void);
  1704.  /**
  1705. Index: src/map/mercenary.c
  1706. ===================================================================
  1707. --- src/map/mercenary.c	(revision 16039)
  1708. +++ src/map/mercenary.c	(working copy)
  1709. @@ -371,7 +371,7 @@
  1710.  	const enum sc_type scs[] = { SC_MERC_FLEEUP, SC_MERC_ATKUP, SC_MERC_HPUP, SC_MERC_SPUP, SC_MERC_HITUP };
  1711.  	int index = rnd() % ARRAYLENGTH(scs);
  1712.  
  1713. -	status_change_start(&md->bl, scs[index], 10000, rnd()%5, 0, 0, 0, 600000, 0);
  1714. +	sc_start(&md->bl, scs[index], 100, rnd()%5, 600000);
  1715.  	return 0;
  1716.  }
  1717.  
  1718. Index: src/map/storage.c
  1719. ===================================================================
  1720. --- src/map/storage.c	(revision 16039)
  1721. +++ src/map/storage.c	(working copy)
  1722. @@ -27,7 +27,7 @@
  1723.  static DBMap* guild_storage_db; // int guild_id -> struct guild_storage*
  1724.  
  1725.  /*==========================================
  1726. - * ‘qŒÉ“àƒAƒCƒeƒ€ƒ\[ƒg
  1727. + * Sort items in the warehouse
  1728.   *------------------------------------------*/
  1729.  static int storage_comp_item(const void *_i1, const void *_i2)
  1730.  {
  1731. @@ -54,9 +54,9 @@
  1732.  }
  1733.  
  1734.  /*==========================================
  1735. - * ‰Šú‰»‚Æ‚©
  1736. + * Init/Terminate
  1737.   *------------------------------------------*/
  1738. -int do_init_storage(void) // map.c::do_init()‚©‚çŒÄ‚΂ê‚é
  1739. +int do_init_storage(void) // Called from map.c::do_init()
  1740.  {
  1741.  	guild_storage_db=idb_alloc(DB_OPT_RELEASE_DATA);
  1742.  	return 1;
  1743. @@ -110,14 +110,18 @@
  1744.  	return 0;
  1745.  }
  1746.  
  1747. -// helper function
  1748. -int compare_item(struct item *a, struct item *b)
  1749. +/* helper function
  1750. + * checking if 2 item structure are identique
  1751. + * flag :
  1752. + *      1 = not checking expire_time
  1753. + */
  1754. +int compare_item(struct item *a, struct item *b, short flag)
  1755.  {
  1756.  	if( a->nameid == b->nameid &&
  1757.  		a->identify == b->identify &&
  1758.  		a->refine == b->refine &&
  1759.  		a->attribute == b->attribute &&
  1760. -		a->expire_time == b->expire_time )
  1761. +		(flag&1 || (a->expire_time == b->expire_time) ))
  1762.  	{
  1763.  		int i;
  1764.  		for (i = 0; i < MAX_SLOTS && (a->card[i] == b->card[i]); i++);
  1765. @@ -150,7 +154,7 @@
  1766.  	{//Stackable
  1767.  		for( i = 0; i < MAX_STORAGE; i++ )
  1768.  		{
  1769. -			if( compare_item(&stor->items[i], item_data) )
  1770. +			if( compare_item(&stor->items[i], item_data,0) )
  1771.  			{// existing items found, stack them
  1772.  				if( amount > MAX_AMOUNT - stor->items[i].amount )
  1773.  					return 1;
  1774. @@ -404,7 +408,7 @@
  1775.  
  1776.  	if(itemdb_isstackable2(data)){ //Stackable
  1777.  		for(i=0;i<MAX_GUILD_STORAGE;i++){
  1778. -			if(compare_item(&stor->items[i], item_data)) {
  1779. +			if(compare_item(&stor->items[i], item_data, 0)) {
  1780.  				if(stor->items[i].amount+amount > MAX_AMOUNT)
  1781.  					return 1;
  1782.  				stor->items[i].amount+=amount;
  1783. Index: src/map/storage.h
  1784. ===================================================================
  1785. --- src/map/storage.h	(revision 16039)
  1786. +++ src/map/storage.h	(working copy)
  1787. @@ -23,6 +23,7 @@
  1788.  void do_reconnect_storage(void);
  1789.  void storage_storage_quit(struct map_session_data *sd, int flag);
  1790.  
  1791. +int compare_item(struct item *a, struct item *b, short flag);
  1792.  struct guild_storage* guild2storage(int guild_id);
  1793.  int guild_storage_delete(int guild_id);
  1794.  int storage_guild_storageopen(struct map_session_data *sd);
  1795. Index: src/map/buyingstore.c
  1796. ===================================================================
  1797. --- src/map/buyingstore.c	(revision 16039)
  1798. +++ src/map/buyingstore.c	(working copy)
  1799. @@ -6,6 +6,7 @@
  1800.  #include "../common/showmsg.h"  // ShowWarning
  1801.  #include "../common/socket.h"  // RBUF*
  1802.  #include "../common/strlib.h"  // safestrncpy
  1803. +#include "../common/nullpo.h" //security check
  1804.  #include "atcommand.h"  // msg_txt
  1805.  #include "battle.h"  // battle_config.*
  1806.  #include "buyingstore.h"  // struct s_buyingstore
  1807. @@ -46,6 +47,8 @@
  1808.  
  1809.  bool buyingstore_setup(struct map_session_data* sd, unsigned char slots)
  1810.  {
  1811. +     nullpo_retr(sd,false);
  1812. +        
  1813.  	if( !battle_config.feature_buying_store || sd->state.vending || sd->state.buyingstore || sd->state.trading || slots == 0 )
  1814.  	{
  1815.  		return false;
  1816. @@ -90,6 +93,7 @@
  1817.  	{// canceled, or no items
  1818.  		return;
  1819.  	}
  1820. +        nullpo_retv(sd);
  1821.  
  1822.  	if( !battle_config.feature_buying_store || pc_istrading(sd) || sd->buyingstore.slots == 0 || count > sd->buyingstore.slots || zenylimit <= 0 || zenylimit > sd->status.zeny || !storename[0] )
  1823.  	{// disabled or invalid input
  1824. Index: src/map/mob.c
  1825. ===================================================================
  1826. --- src/map/mob.c	(revision 16039)
  1827. +++ src/map/mob.c	(working copy)
  1828. @@ -239,12 +239,12 @@
  1829.  
  1830.  		if( i )
  1831.  		{
  1832. -			if( i&2 )
  1833. -				data->state.size = SZ_MEDIUM;
  1834. -			else if( i&4 )
  1835. -				data->state.size = SZ_BIG;
  1836. -			if( i&8 )
  1837. -				data->state.ai = 1;
  1838. +				if (i&2)
  1839. +					data->state.size=SZ_MEDIUM;
  1840. +				else if (i&4)
  1841. +					data->state.size=SZ_BIG;
  1842. +				if (i&8)
  1843. +					data->state.ai=1;
  1844.  		}
  1845.  		data->eventname[0] = '\0'; //Clear event as it is not used.
  1846.  	}
  1847. @@ -2508,6 +2508,7 @@
  1848.  				case BL_PET: sd = ((TBL_PET*)src)->msd; break;
  1849.  				case BL_HOM: sd = ((TBL_HOM*)src)->master; break;
  1850.  				case BL_MER: sd = ((TBL_MER*)src)->master; break;
  1851. +				default : break; //unhandled type
  1852.  			}
  1853.  
  1854.  		if( sd && sd->md && src && src->type != BL_HOM && mob_db(md->class_)->lv > sd->status.base_level/2 )
  1855. @@ -2722,7 +2723,7 @@
  1856.  }
  1857.  
  1858.  /*==========================================
  1859. - * mob‰ñ•œ
  1860. + * mob heal, permet d'update la barre d'hp d'un mob pour le joueur
  1861.   *------------------------------------------*/
  1862.  void mob_heal(struct mob_data *md,unsigned int heal)
  1863.  {
  1864. @@ -2763,7 +2764,7 @@
  1865.  }
  1866.  
  1867.  /*==========================================
  1868. - * ‰æ–Ê“à‚ÌŽæ‚芪‚«‚̐”ŒvŽZ—p(foreachinarea)
  1869. + *  Permet de savoir si un mob est le slave d'un mobid
  1870.   *------------------------------------------*/
  1871.  int mob_countslave_sub(struct block_list *bl,va_list ap)
  1872.  {
  1873. @@ -2778,7 +2779,7 @@
  1874.  }
  1875.  
  1876.  /*==========================================
  1877. - * ‰æ–Ê“à‚ÌŽæ‚芪‚«‚̐”ŒvŽZ
  1878. + * Permet de compter le nombre de slave d'un mob sur la map
  1879.   *------------------------------------------*/
  1880.  int mob_countslave(struct block_list *bl)
  1881.  {
  1882. @@ -2884,7 +2885,7 @@
  1883.  }
  1884.  
  1885.  /*==========================================
  1886. - *MOBskill‚©‚çŠY“–skillid‚Ìskillidx‚ð•Ô‚·
  1887. + * MOBskill lookup
  1888.   *------------------------------------------*/
  1889.  int mob_skillid2skillidx(int class_,int skillid)
  1890.  {
  1891. @@ -3896,7 +3897,7 @@
  1892.  
  1893.  	class_=atoi(str[0]);
  1894.  
  1895. -	if(mob_db(class_) == mob_dummy)	// ’l‚ªˆÙí‚Ȃ珈—‚µ‚È‚¢B
  1896. +	if(mob_db(class_) == mob_dummy)	// invalid class (probably undefined in db)
  1897.  	{
  1898.  		ShowWarning("mob_readdb_mobavail: Unknown mob id %d.\n", class_);
  1899.  		return false;
  1900. Index: src/map/clif.c
  1901. ===================================================================
  1902. --- src/map/clif.c	(revision 16039)
  1903. +++ src/map/clif.c	(working copy)
  1904. @@ -196,7 +196,7 @@
  1905.  static int clif_parse (int fd);
  1906.  
  1907.  /*==========================================
  1908. - * mapŽI‚ÌipÝ’è
  1909. + * map?¿œI?¿œ?¿œip?¿œÝ’ï¿œ
  1910.   *------------------------------------------*/
  1911.  int clif_setip(const char* ip)
  1912.  {
  1913. @@ -1358,9 +1358,9 @@
  1914.  	case BL_MOB:
  1915.  		{
  1916.  			TBL_MOB *md = ((TBL_MOB*)bl);
  1917. -			if(md->special_state.size==2) // tiny/big mobs [Valaris]
  1918. +			if(md->special_state.size==SZ_BIG) // tiny/big mobs [Valaris]
  1919.  				clif_specialeffect(&md->bl,423,AREA);
  1920. -			else if(md->special_state.size==1)
  1921. +			else if(md->special_state.size==SZ_MEDIUM)
  1922.  				clif_specialeffect(&md->bl,421,AREA);
  1923.  		}
  1924.  		break;
  1925. @@ -1564,9 +1564,9 @@
  1926.  	case BL_MOB:
  1927.  		{
  1928.  			TBL_MOB *md = ((TBL_MOB*)bl);
  1929. -			if(md->special_state.size==2) // tiny/big mobs [Valaris]
  1930. +			if(md->special_state.size==SZ_BIG) // tiny/big mobs [Valaris]
  1931.  				clif_specialeffect(&md->bl,423,AREA);
  1932. -			else if(md->special_state.size==1)
  1933. +			else if(md->special_state.size==SZ_MEDIUM)
  1934.  				clif_specialeffect(&md->bl,421,AREA);
  1935.  		}
  1936.  		break;
  1937. @@ -3161,7 +3161,7 @@
  1938.  	fd=sd->fd;
  1939.  	WFIFOHEAD(fd, packet_len(0x013c));
  1940.  	WFIFOW(fd,0)=0x013c;
  1941. -	WFIFOW(fd,2)=val+2;//–î‚̃AƒCƒeƒ€ID
  1942. +	WFIFOW(fd,2)=val+2;//Item ID of the arrow
  1943.  	WFIFOSET(fd,packet_len(0x013c));
  1944.  }
  1945.  
  1946. @@ -15856,7 +15856,7 @@
  1947.  		sd->menuskill_id = SC_AUTOSHADOWSPELL;
  1948.  		sd->menuskill_val = c;
  1949.  	} else {
  1950. -		status_change_end(&sd->bl,SC_STOP,-1);
  1951. +		status_change_end(&sd->bl,SC_STOP, INVALID_TIMER);
  1952.  		clif_skill_fail(sd,SC_AUTOSHADOWSPELL,0x15,0);
  1953.  	}
  1954.  
  1955. Index: src/map/chat.c
  1956. ===================================================================
  1957. --- src/map/chat.c	(revision 16039)
  1958. +++ src/map/chat.c	(working copy)
  1959. @@ -156,11 +156,11 @@
  1960.  
  1961.  	pc_setchatid(sd,cd->bl.id);
  1962.  
  1963. -	clif_joinchatok(sd,cd);	// V‚œ‚ÉŽQ‰Á‚µ‚œl‚É‚Í‘Sˆõ‚̃ŠƒXƒg
  1964. -	clif_addchat(cd,sd);	// Šù‚É’†‚É‹‚œl‚ɂ͒ljÁ‚µ‚œl‚Ì•ñ
  1965. -	clif_dispchat(cd,0);	// ŽüˆÍ‚̐l‚ɂ͐l”•Ï‰»•ñ
  1966. +	clif_joinchatok(sd,cd);	//To the person who newly joined the list of all
  1967. +	clif_addchat(cd,sd);	//Reports To the person who already in the chat 
  1968. +	clif_dispchat(cd,0);	//Reported number of changes to the people around 
  1969.  
  1970. -	chat_triggerevent(cd); // ƒCƒxƒ“ƒg
  1971. +	chat_triggerevent(cd); //Event 
  1972.  
  1973.  	return 0;
  1974.  }
  1975. @@ -372,7 +372,7 @@
  1976.  }
  1977.  
  1978.  /*==========================================
  1979. - * ‹K’èl”ˆÈã‚ŃCƒxƒ“ƒg‚ª’è‹`‚³‚ê‚Ä‚é‚È‚çŽÀs
  1980. + * Trigger npc event when we enter the chatroom
  1981.   *------------------------------------------*/
  1982.  int chat_triggerevent(struct chat_data *cd)
  1983.  {
  1984. Index: src/map/mob.h
  1985. ===================================================================
  1986. --- src/map/mob.h	(revision 16039)
  1987. +++ src/map/mob.h	(working copy)
  1988. @@ -64,9 +64,9 @@
  1989.  };
  1990.  
  1991.  enum size {
  1992. -	SZ_SMALL = 0,
  1993. -	SZ_MEDIUM,
  1994. -	SZ_BIG,
  1995. +    SZ_SMALL = 0,
  1996. +    SZ_MEDIUM,
  1997. +    SZ_BIG,
  1998.  };
  1999.  
  2000.  struct mob_skill {
  2001. Index: src/map/guild.c
  2002. ===================================================================
  2003. --- src/map/guild.c	(revision 16039)
  2004. +++ src/map/guild.c	(working copy)
  2005. @@ -39,12 +39,12 @@
  2006.  	struct eventlist *next;
  2007.  };
  2008.  
  2009. -// ƒMƒ‹ƒh‚ÌEXPƒLƒƒƒbƒVƒ…‚̃tƒ‰ƒbƒVƒ…‚ÉŠÖ˜A‚·‚é’萔
  2010. -#define GUILD_SEND_XY_INVERVAL	5000	// À•W‚â‚g‚o‘—M‚ÌŠÔŠu
  2011. -#define GUILD_PAYEXP_INVERVAL 10000	// ŠÔŠu(ƒLƒƒƒbƒVƒ…‚̍ő吶‘¶ŽžŠÔAƒ~ƒŠ•b)
  2012. -#define GUILD_PAYEXP_LIST 8192	// ƒLƒƒƒbƒVƒ…‚̍ő吔
  2013. +//Constant related to the flash of the Guild EXP cache
  2014. +#define GUILD_SEND_XY_INVERVAL	5000 // Interval of sending coordinates and HP
  2015. +#define GUILD_PAYEXP_INVERVAL 10000 //Interval (maximum survival time of the cache, in milliseconds)
  2016. +#define GUILD_PAYEXP_LIST 8192 //The maximum number of cache
  2017.  
  2018. -// ƒMƒ‹ƒh‚ÌEXPƒLƒƒƒbƒVƒ…
  2019. +//Guild EXP cache
  2020.  struct guild_expcache {
  2021.  	int guild_id, account_id, char_id;
  2022.  	uint64 exp;
  2023. @@ -91,7 +91,7 @@
  2024.  	return guild_skill_tree[id-GD_SKILLBASE].max;
  2025.  }
  2026.  
  2027. -// ƒMƒ‹ƒhƒXƒLƒ‹‚ª‚ ‚é‚©Šm”F
  2028. +// Retrive skilllv learned by guild
  2029.  int guild_checkskill(struct guild *g,int id)
  2030.  {
  2031.  	int idx = id-GD_SKILLBASE;
  2032. @@ -110,8 +110,7 @@
  2033.  	skillid = atoi(split[0]);
  2034.  	id = skillid - GD_SKILLBASE;
  2035.  
  2036. -	if( id < 0 || id >= MAX_GUILDSKILL )
  2037. -	{
  2038. +	if (id < 0 || id >= MAX_GUILDSKILL) {
  2039.  		ShowWarning("guild_read_guildskill_tree_db: Invalid skill id %d.\n", skillid);
  2040.  		return false;
  2041.  	}
  2042. @@ -119,13 +118,12 @@
  2043.  	guild_skill_tree[id].id = skillid;
  2044.  	guild_skill_tree[id].max = atoi(split[1]);
  2045.  
  2046. -	if( guild_skill_tree[id].id == GD_GLORYGUILD && battle_config.require_glory_guild && guild_skill_tree[id].max == 0 )
  2047. -	{// enable guild's glory when required for emblems
  2048. +	if (guild_skill_tree[id].id == GD_GLORYGUILD && battle_config.require_glory_guild && guild_skill_tree[id].max == 0) {
  2049. +		// enable guild's glory when required for emblems
  2050.  		guild_skill_tree[id].max = 1;
  2051.  	}
  2052.  
  2053. -	for( k = 0; k < MAX_GUILD_SKILL_REQUIRE; k++ )
  2054. -	{
  2055. +	for (k = 0; k < MAX_GUILD_SKILL_REQUIRE; k++) {
  2056.  		guild_skill_tree[id].need[k].id = atoi(split[k*2+2]);
  2057.  		guild_skill_tree[id].need[k].lv = atoi(split[k*2+3]);
  2058.  	}
  2059. @@ -147,8 +145,7 @@
  2060.  	if (idx < 0 || idx >= MAX_GUILDSKILL)
  2061.  		return 0;
  2062.  
  2063. -	for(i=0;i<MAX_GUILD_SKILL_REQUIRE;i++)
  2064. -	{
  2065. +	for (i = 0; i < MAX_GUILD_SKILL_REQUIRE; i++) {
  2066.  		if(guild_skill_tree[idx].need[i].id == 0) break;
  2067.  		if(guild_skill_tree[idx].need[i].lv > guild_checkskill(g,guild_skill_tree[idx].need[i].id))
  2068.  			return 0;
  2069. @@ -261,7 +258,7 @@
  2070.  	return( i < g->max_member ) ? g->member[i].position : -1;
  2071.  }
  2072.  
  2073. -// ƒƒ“ƒo[î•ñ‚̍쐬
  2074. +//Creation of member information
  2075.  void guild_makemember(struct guild_member *m,struct map_session_data *sd)
  2076.  {
  2077.  	nullpo_retv(sd);
  2078. @@ -283,7 +280,7 @@
  2079.  }
  2080.  
  2081.  /**
  2082. - *  ƒMƒ‹ƒh‚ÌEXPƒLƒƒƒbƒVƒ…‚ðinterŽI‚Ƀtƒ‰ƒbƒVƒ…‚·‚é
  2083. + * Server cache to be flushed to inter the Guild EXP
  2084.   * @see DBApply
  2085.   */
  2086.  int guild_payexp_timer_sub(DBKey key, DBData *data, va_list ap) {
  2087. @@ -392,7 +389,7 @@
  2088.  	return 1;
  2089.  }
  2090.  
  2091. -// ì¬‰Â”Û
  2092. +//Whether or not to create guilde
  2093.  int guild_created(int account_id,int guild_id)
  2094.  {
  2095.  	struct map_session_data *sd=map_id2sd(account_id);
  2096. @@ -400,7 +397,7 @@
  2097.  	if(sd==NULL)
  2098.  		return 0;
  2099.  	if(!guild_id) {
  2100. -		clif_guild_created(sd,2);	// ì¬Žž”si“¯–ŒƒMƒ‹ƒh‘¶Ýj
  2101. +		clif_guild_created(sd,2);	// Creation failure (presence of the same name Guild)
  2102.  		return 0;
  2103.  	}
  2104.  	//struct guild *g;
  2105. @@ -411,13 +408,13 @@
  2106.  	return 0;
  2107.  }
  2108.  
  2109. -// î•ñ—v‹
  2110. +//Information request
  2111.  int guild_request_info(int guild_id)
  2112.  {
  2113.  	return intif_guild_request_info(guild_id);
  2114.  }
  2115.  
  2116. -// ƒCƒxƒ“ƒg•t‚«î•ñ—v‹
  2117. +//Information request with event
  2118.  int guild_npc_request_info(int guild_id,const char *event)
  2119.  {
  2120.  	if( guild_search(guild_id) )
  2121. @@ -442,7 +439,7 @@
  2122.  	return guild_request_info(guild_id);
  2123.  }
  2124.  
  2125. -// Š‘®ƒLƒƒƒ‰‚ÌŠm”F
  2126. +//Confirmation of the character belongs to guild
  2127.  int guild_check_member(struct guild *g)
  2128.  {
  2129.  	int i;
  2130. @@ -469,7 +466,7 @@
  2131.  	return 0;
  2132.  }
  2133.  
  2134. -// î•ñŠ“ŸŽž”si‚»‚ÌID‚̃Lƒƒƒ‰‚ð‘S•”–¢Š‘®‚É‚·‚éj
  2135. +//Delete association with guild_id for all characters 
  2136.  int guild_recv_noinfo(int guild_id)
  2137.  {
  2138.  	struct map_session_data *sd;
  2139. @@ -486,7 +483,7 @@
  2140.  	return 0;
  2141.  }
  2142.  
  2143. -// î•ñŠ“Ÿ
  2144. +//Get and display information for all member
  2145.  int guild_recv_info(struct guild *sg)
  2146.  {
  2147.  	struct guild *g,before;
  2148. @@ -504,7 +501,7 @@
  2149.  		idb_put(guild_db,sg->guild_id,g);
  2150.  		before=*sg;
  2151.  
  2152. -		// Å‰‚̃[ƒh‚Ȃ̂ц[ƒU[‚̃`ƒFƒbƒN‚ðs‚€
  2153. +		//Perform the check on the user because the first load
  2154.  		guild_check_member(sg);
  2155.  		if ((sd = map_nick2sd(sg->master)) != NULL)
  2156.  		{
  2157. @@ -539,32 +536,32 @@
  2158.  			bm++;
  2159.  	}
  2160.  
  2161. -	for(i=0;i<g->max_member;i++){	// î•ñ‚Ì‘—M
  2162. +	for(i=0;i<g->max_member;i++){	//Transmission of information at all members
  2163.  		sd = g->member[i].sd;
  2164.  		if( sd==NULL )
  2165.  			continue;
  2166.  
  2167.  		if(	before.guild_lv!=g->guild_lv || bm!=m ||
  2168.  			before.max_member!=g->max_member ){
  2169. -			clif_guild_basicinfo(sd);	// Šî–{î•ñ‘—M
  2170. -			clif_guild_emblem(sd,g);	// ƒGƒ“ƒuƒŒƒ€‘—M
  2171. +			clif_guild_basicinfo(sd); //Submit basic information
  2172. +			clif_guild_emblem(sd,g); //Submit emblem
  2173.  		}
  2174.  
  2175. -		if(bm!=m){		// ƒƒ“ƒo[î•ñ‘—M
  2176. +		if(bm!=m){		//Send members information
  2177.  			clif_guild_memberlist(g->member[i].sd);
  2178.  		}
  2179.  
  2180.  		if( before.skill_point!=g->skill_point)
  2181. -			clif_guild_skillinfo(sd);	// ƒXƒLƒ‹î•ñ‘—M
  2182. +			clif_guild_skillinfo(sd); //Submit information skills
  2183.  
  2184. -		if( guild_new ){	// –¢‘—M‚Ȃ珊‘®î•ñ‚à‘—‚é
  2185. +		if( guild_new ){	// Send information and affiliation if unsent
  2186.  			clif_guild_belonginfo(sd,g);
  2187.  			clif_guild_notice(sd,g);
  2188.  			sd->guild_emblem_id=g->emblem_id;
  2189.  		}
  2190.  	}
  2191.  
  2192. -	// ƒCƒxƒ“ƒg‚Ì”­¶
  2193. +	//Occurrence of an event
  2194.  	if (guild_infoevent_db->remove(guild_infoevent_db, db_i2key(sg->guild_id), &data))
  2195.  	{
  2196.  		struct eventlist *ev = db_data2ptr(&data), *ev2;
  2197. @@ -579,8 +576,9 @@
  2198.  	return 0;
  2199.  }
  2200.  
  2201. -
  2202. -// ƒMƒ‹ƒh‚Ö‚ÌŠ©—U
  2203. +/*=============================================
  2204. + * Player sd send a guild invatation to player tsd to join his guild
  2205. + *--------------------------------------------*/
  2206.  int guild_invite(struct map_session_data *sd,struct map_session_data *tsd)
  2207.  {
  2208.  	struct guild *g;
  2209. @@ -616,7 +614,7 @@
  2210.  		return 0;
  2211.  	}
  2212.  
  2213. -	// ’èˆõŠm”F
  2214. +	//search an empty spot in guild 
  2215.  	ARR_FIND( 0, g->max_member, i, g->member[i].account_id == 0 );
  2216.  	if(i==g->max_member){
  2217.  		clif_guild_inviteack(sd,3);
  2218. @@ -714,7 +712,9 @@
  2219.  		g->member[i].sd = sd;
  2220.  }
  2221.  
  2222. -// ƒMƒ‹ƒhƒƒ“ƒo‚ª’ljÁ‚³‚ê‚œ
  2223. +/*==========================================
  2224. + * Add a player to a given guild_id
  2225. + *----------------------------------------*/
  2226.  int guild_member_added(int guild_id,int account_id,int char_id,int flag)
  2227.  {
  2228.  	struct map_session_data *sd= map_id2sd(account_id),*sd2;
  2229. @@ -724,7 +724,7 @@
  2230.  		return 0;
  2231.  
  2232.  	if(sd==NULL || sd->guild_invite==0){
  2233. -		// ƒLƒƒƒ‰‘€‚É“o˜^‚Å‚«‚È‚©‚Á‚œ‚œ‚ß’E‘Þ—v‹‚ðo‚·
  2234. +		// cancel if player not present or invalide guild_id invitation
  2235.  		if (flag == 0) {
  2236.  			ShowError("guild: member added error %d is not online\n",account_id);
  2237.   			intif_guild_leave(guild_id,account_id,char_id,0,"** Data Error **");
  2238. @@ -735,13 +735,13 @@
  2239.  	sd->guild_invite = 0;
  2240.  	sd->guild_invite_account = 0;
  2241.  
  2242. -	if(flag==1){	// Žž”s
  2243. +	if(flag==1){	//failure
  2244.  		if( sd2!=NULL )
  2245.  			clif_guild_inviteack(sd2,3);
  2246.  		return 0;
  2247.  	}
  2248.  
  2249. -		// ¬Œ÷
  2250. +	//if all ok adding player to guild
  2251.  	sd->status.guild_id = g->guild_id;
  2252.  	sd->guild_emblem_id = g->emblem_id;
  2253.  	//Packets which were sent in the previous 'guild_sent' implementation.
  2254. @@ -759,7 +759,9 @@
  2255.  	return 0;
  2256.  }
  2257.  
  2258. -// ƒMƒ‹ƒh’E‘Þ—v‹
  2259. +/*==========================================
  2260. + * Player request leaving a given guild_id
  2261. + *----------------------------------------*/
  2262.  int guild_leave(struct map_session_data* sd, int guild_id, int account_id, int char_id, const char* mes)
  2263.  {
  2264.  	struct guild *g;
  2265. @@ -780,7 +782,9 @@
  2266.  	return 0;
  2267.  }
  2268.  
  2269. -// ƒMƒ‹ƒh’Ç•ú—v‹
  2270. +/*==========================================
  2271. + * Request remove a player to a given guild_id
  2272. + *----------------------------------------*/
  2273.  int guild_expulsion(struct map_session_data* sd, int guild_id, int account_id, int char_id, const char* mes)
  2274.  {
  2275.  	struct map_session_data *tsd;
  2276. @@ -917,7 +921,7 @@
  2277.  	}
  2278.  
  2279.  	if(idx == -1 || c == 0) {
  2280. -		// ƒMƒ‹ƒh‚̃ƒ“ƒo[ŠO‚È‚Ì‚Å’Ç•úˆµ‚¢‚·‚é
  2281. +		//Treat char_id who doesn't match guild_id (not found as member)
  2282.  		struct map_session_data *sd = map_id2sd(account_id);
  2283.  		if(sd && sd->status.char_id == char_id) {
  2284.  			sd->status.guild_id=0;
  2285. @@ -953,7 +957,10 @@
  2286.  
  2287.  	return 0;
  2288.  }
  2289. -// ƒMƒ‹ƒh‰ï˜b‘—M
  2290. +
  2291. +/*====================================================
  2292. + * Send a message to whole guild
  2293. + *---------------------------------------------------*/
  2294.  int guild_send_message(struct map_session_data *sd,const char *mes,int len)
  2295.  {
  2296.  	nullpo_ret(sd);
  2297. @@ -968,7 +975,10 @@
  2298.  
  2299.  	return 0;
  2300.  }
  2301. -// ƒMƒ‹ƒh‰ï˜bŽóM
  2302. +
  2303. +/*====================================================
  2304. + * Guild receive a message, will be displayed to whole member
  2305. + *---------------------------------------------------*/
  2306.  int guild_recv_message(int guild_id,int account_id,const char *mes,int len)
  2307.  {
  2308.  	struct guild *g;
  2309. @@ -977,12 +987,18 @@
  2310.  	clif_guild_message(g,account_id,mes,len);
  2311.  	return 0;
  2312.  }
  2313. -// ƒMƒ‹ƒhƒƒ“ƒo‚Ì–ðE•ÏX
  2314. +
  2315. +/*====================================================
  2316. + * Member changing position in guild
  2317. + *---------------------------------------------------*/
  2318.  int guild_change_memberposition(int guild_id,int account_id,int char_id,short idx)
  2319.  {
  2320.  	return intif_guild_change_memberinfo(guild_id,account_id,char_id,GMI_POSITION,&idx,sizeof(idx));
  2321.  }
  2322. -// ƒMƒ‹ƒhƒƒ“ƒo‚Ì–ðE•ÏX’Ê’m
  2323. +
  2324. +/*====================================================
  2325. + * Notification of new position for member
  2326. + *---------------------------------------------------*/
  2327.  int guild_memberposition_changed(struct guild *g,int idx,int pos)
  2328.  {
  2329.  	nullpo_ret(g);
  2330. @@ -995,7 +1011,10 @@
  2331.  		clif_charnameupdate(g->member[idx].sd);
  2332.  	return 0;
  2333.  }
  2334. -// ƒMƒ‹ƒh–ðE•ÏX
  2335. +
  2336. +/*====================================================
  2337. + * Change guild title or member
  2338. + *---------------------------------------------------*/
  2339.  int guild_change_position(int guild_id,int idx,
  2340.  	int mode,int exp_mode,const char *name)
  2341.  {
  2342. @@ -1009,7 +1028,10 @@
  2343.  	safestrncpy(p.name,name,NAME_LENGTH);
  2344.  	return intif_guild_position(guild_id,idx,&p);
  2345.  }
  2346. -// ƒMƒ‹ƒh–ðE•ÏX’Ê’m
  2347. +
  2348. +/*====================================================
  2349. + * Notification of member has changed his guild tiltle
  2350. + *---------------------------------------------------*/
  2351.  int guild_position_changed(int guild_id,int idx,struct guild_position *p)
  2352.  {
  2353.  	struct guild *g=guild_search(guild_id);
  2354. @@ -1025,7 +1047,10 @@
  2355.  			clif_charnameupdate(g->member[i].sd);
  2356.  	return 0;
  2357.  }
  2358. -// ƒMƒ‹ƒh’m•ÏX
  2359. +
  2360. +/*====================================================
  2361. + * Change guild notice
  2362. + *---------------------------------------------------*/
  2363.  int guild_change_notice(struct map_session_data *sd,int guild_id,const char *mes1,const char *mes2)
  2364.  {
  2365.  	nullpo_ret(sd);
  2366. @@ -1034,7 +1059,10 @@
  2367.  		return 0;
  2368.  	return intif_guild_notice(guild_id,mes1,mes2);
  2369.  }
  2370. -// ƒMƒ‹ƒh’m•ÏX’Ê’m
  2371. +
  2372. +/*====================================================
  2373. + * Notification of guild has changed his notice
  2374. + *---------------------------------------------------*/
  2375.  int guild_notice_changed(int guild_id,const char *mes1,const char *mes2)
  2376.  {
  2377.  	int i;
  2378. @@ -1052,7 +1080,10 @@
  2379.  	}
  2380.  	return 0;
  2381.  }
  2382. -// ƒMƒ‹ƒhƒGƒ“ƒuƒŒƒ€•ÏX
  2383. +
  2384. +/*====================================================
  2385. + * Change guild emblem
  2386. + *---------------------------------------------------*/
  2387.  int guild_change_emblem(struct map_session_data *sd,int len,const char *data)
  2388.  {
  2389.  	struct guild *g;
  2390. @@ -1066,7 +1097,10 @@
  2391.  
  2392.  	return intif_guild_emblem(sd->status.guild_id,len,data);
  2393.  }
  2394. -// ƒMƒ‹ƒhƒGƒ“ƒuƒŒƒ€•ÏX’Ê’m
  2395. +
  2396. +/*====================================================
  2397. + * Notification of guild emblem changed
  2398. + *---------------------------------------------------*/
  2399.  int guild_emblem_changed(int len,int guild_id,int emblem_id,const char *data)
  2400.  {
  2401.  	int i;
  2402. @@ -1146,7 +1180,9 @@
  2403.  	return db_ptr2data(c);
  2404.  }
  2405.  
  2406. -// ƒMƒ‹ƒh‚ÌEXPã”[
  2407. +/*====================================================
  2408. + * return Taxed experience from player sd to guild
  2409. + *---------------------------------------------------*/
  2410.  unsigned int guild_payexp(struct map_session_data *sd,unsigned int exp)
  2411.  {
  2412.  	struct guild *g;
  2413. @@ -1178,7 +1214,11 @@
  2414.  	return exp;
  2415.  }
  2416.  
  2417. -// Celest
  2418. +/*====================================================
  2419. + * Player sd  pay a tribue experience exp to his guild
  2420. + * Add this experience to guild exp
  2421. + * [Celest]
  2422. + *---------------------------------------------------*/
  2423.  int guild_getexp(struct map_session_data *sd,int exp)
  2424.  {
  2425.  	struct guild_expcache *c;
  2426. @@ -1195,7 +1235,9 @@
  2427.  	return exp;
  2428.  }
  2429.  
  2430. -// ƒXƒLƒ‹ƒ|ƒCƒ“ƒgŠ„‚èU‚è
  2431. +/*====================================================
  2432. + * Ask to increase guildskill skill_num
  2433. + *---------------------------------------------------*/
  2434.  int guild_skillup(TBL_PC* sd, int skill_num)
  2435.  {
  2436.  	struct guild* g;
  2437. @@ -1216,7 +1258,10 @@
  2438.  
  2439.  	return 0;
  2440.  }
  2441. -// ƒXƒLƒ‹ƒ|ƒCƒ“ƒgŠ„‚èU‚è’Ê’m
  2442. +
  2443. +/*====================================================
  2444. + * Notification of guildskill skill_num increase request
  2445. + *---------------------------------------------------*/
  2446.  int guild_skillupack(int guild_id,int skill_num,int account_id)
  2447.  {
  2448.  	struct map_session_data *sd=map_id2sd(account_id);
  2449. @@ -1263,7 +1308,14 @@
  2450.  	}
  2451.  	return;
  2452.  }
  2453. -// ƒMƒ‹ƒh“¯–¿”Š“Ÿ
  2454. +
  2455. +
  2456. +/*====================================================
  2457. + * Count number of relation the guild have
  2458. + * flag :
  2459. + *		0 = allied
  2460. + *		1 = ennemy	
  2461. + *---------------------------------------------------*/
  2462.  int guild_get_alliance_count(struct guild *g,int flag)
  2463.  {
  2464.  	int i,c;
  2465. @@ -1302,7 +1354,9 @@
  2466.  	return( i < MAX_GUILDALLIANCE ) ? 1 : 0;
  2467.  }
  2468.  
  2469. -// ƒMƒ‹ƒh“¯–¿—v‹
  2470. +/*====================================================
  2471. + * Player sd, asking player tsd an alliance between there 2 guild
  2472. + *---------------------------------------------------*/
  2473.  int guild_reqalliance(struct map_session_data *sd,struct map_session_data *tsd)
  2474.  {
  2475.  	struct guild *g[2];
  2476. @@ -1343,7 +1397,7 @@
  2477.  		return 0;
  2478.  	}
  2479.  
  2480. -	for(i=0;i<MAX_GUILDALLIANCE;i++){	// ‚·‚Å‚É“¯–¿ó‘Ô‚©Šm”F
  2481. +	for(i=0;i<MAX_GUILDALLIANCE;i++){	// check if already allied
  2482.  		if(	g[0]->alliance[i].guild_id==tsd->status.guild_id &&
  2483.  			g[0]->alliance[i].opposition==0){
  2484.  			clif_guild_allianceack(sd,0);
  2485. @@ -1357,7 +1411,10 @@
  2486.  	clif_guild_reqalliance(tsd,sd->status.account_id,g[0]->name);
  2487.  	return 0;
  2488.  }
  2489. -// ƒMƒ‹ƒhŠ©—U‚Ö‚Ì•Ô“š
  2490. +
  2491. +/*====================================================
  2492. + * Player sd, awsser to player tsd (account_id) for an alliance request
  2493. + *---------------------------------------------------*/
  2494.  int guild_reply_reqalliance(struct map_session_data *sd,int account_id,int flag)
  2495.  {
  2496.  	struct map_session_data *tsd;
  2497. @@ -1369,13 +1426,13 @@
  2498.  		return 0;
  2499.  	}
  2500.  
  2501. -	if(sd->guild_alliance!=tsd->status.guild_id)	// Š©—U‚ƃMƒ‹ƒhID‚ªˆá‚€
  2502. +	if(sd->guild_alliance!=tsd->status.guild_id)	// proposed guild_id alliance doesn't match tsd guildid
  2503.  		return 0;
  2504.  
  2505. -	if(flag==1){	// ³‘ø
  2506. +	if(flag==1){	// consent
  2507.  		int i;
  2508.  
  2509. -		struct guild *g,*tg;	// “¯–¿”ÄŠm”F
  2510. +		struct guild *g,*tg;	// Reconfirm the number of alliance
  2511.  		g=guild_search(sd->status.guild_id);
  2512.  		tg=guild_search(tsd->status.guild_id);
  2513.  
  2514. @@ -1403,11 +1460,11 @@
  2515.  					tsd->status.account_id,sd->status.account_id,9 );
  2516.  		}
  2517.  
  2518. -		// interŽI‚Ö“¯–¿—v¿
  2519. +		// inform other servers
  2520.  		intif_guild_alliance( sd->status.guild_id,tsd->status.guild_id,
  2521.  			sd->status.account_id,tsd->status.account_id,0 );
  2522.  		return 0;
  2523. -	}else{		// ‹‘”Û
  2524. +	}else{		// deny
  2525.  		sd->guild_alliance=0;
  2526.  		sd->guild_alliance_account=0;
  2527.  		if(tsd!=NULL)
  2528. @@ -1416,7 +1473,9 @@
  2529.  	return 0;
  2530.  }
  2531.  
  2532. -// ƒMƒ‹ƒhŠÖŒW‰ðÁ
  2533. +/*====================================================
  2534. + * Player sd asking to break alliance with guild guild_id
  2535. + *---------------------------------------------------*/
  2536.  int guild_delalliance(struct map_session_data *sd,int guild_id,int flag)
  2537.  {
  2538.  	nullpo_ret(sd);
  2539. @@ -1430,7 +1489,10 @@
  2540.  	return 0;
  2541.  }
  2542.  
  2543. -// ƒMƒ‹ƒh“G‘Î
  2544. +
  2545. +/*====================================================
  2546. + * Player sd, asking player tsd a formal ennemy relation between there 2 guild
  2547. + *---------------------------------------------------*/
  2548.  int guild_opposition(struct map_session_data *sd,struct map_session_data *tsd)
  2549.  {
  2550.  	struct guild *g;
  2551. @@ -1451,9 +1513,9 @@
  2552.  		return 0;
  2553.  	}
  2554.  
  2555. -	for(i=0;i<MAX_GUILDALLIANCE;i++){	// ‚·‚Å‚ÉŠÖŒW‚ðŽ‚Á‚Ä‚¢‚é‚©Šm”F
  2556. +	for(i=0;i<MAX_GUILDALLIANCE;i++){	// checking relations
  2557.  		if(g->alliance[i].guild_id==tsd->status.guild_id){
  2558. -			if(g->alliance[i].opposition==1){	// ‚·‚Å‚É“G‘Î
  2559. +			if(g->alliance[i].opposition==1){	// check if not already hostile
  2560.  				clif_guild_oppositionack(sd,2);
  2561.  				return 0;
  2562.  			}
  2563. @@ -1465,13 +1527,15 @@
  2564.  		}
  2565.  	}
  2566.  
  2567. -	// interŽI‚É“G‘Ηv¿
  2568. +	// inform other serv
  2569.  	intif_guild_alliance( sd->status.guild_id,tsd->status.guild_id,
  2570.  			sd->status.account_id,tsd->status.account_id,1 );
  2571.  	return 0;
  2572.  }
  2573.  
  2574. -// ƒMƒ‹ƒh“¯–¿/“G‘Î’Ê’m
  2575. +/*====================================================
  2576. + * Notification of a relationship between 2 guild
  2577. + *---------------------------------------------------*/
  2578.  int guild_allianceack(int guild_id1,int guild_id2,int account_id1,int account_id2,int flag,const char *name1,const char *name2)
  2579.  {
  2580.  	struct guild *g[2];
  2581. @@ -1495,14 +1559,14 @@
  2582.  		sd[0]->guild_alliance_account=0;
  2583.  	}
  2584.  
  2585. -	if(flag&0x70){	// Žž”s
  2586. +	if(flag&0x70){	// failure
  2587.  		for(i=0;i<2-(flag&1);i++)
  2588.  			if( sd[i]!=NULL )
  2589.  				clif_guild_allianceack(sd[i],((flag>>4)==i+1)?3:4);
  2590.  		return 0;
  2591.  	}
  2592.  
  2593. -	if(!(flag&0x08)){	// ŠÖŒW’ljÁ
  2594. +	if(!(flag&0x08)){	// new relationship
  2595.  		for(i=0;i<2-(flag&1);i++)
  2596.  		{
  2597.  			if(g[i]!=NULL)
  2598. @@ -1516,7 +1580,7 @@
  2599.  				}
  2600.  			}
  2601.  		}
  2602. -	}else{				// ŠÖŒW‰ðÁ
  2603. +	}else{				// remove relationship
  2604.  		for(i=0;i<2-(flag&1);i++)
  2605.  		{
  2606.  			if(g[i]!=NULL)
  2607. @@ -1525,21 +1589,21 @@
  2608.  				if( j < MAX_GUILDALLIANCE )
  2609.  					g[i]->alliance[j].guild_id = 0;
  2610.  			}
  2611. -			if( sd[i]!=NULL )	// ‰ðÁ’Ê’m
  2612. +			if( sd[i]!=NULL )	// notify players
  2613.  				clif_guild_delalliance(sd[i],guild_id[1-i],(flag&1));
  2614.  		}
  2615.  	}
  2616.  
  2617. -	if((flag&0x0f)==0){			// “¯–¿’Ê’m
  2618. +	if((flag&0x0f)==0){			// alliance notification
  2619.  		if( sd[1]!=NULL )
  2620.  			clif_guild_allianceack(sd[1],2);
  2621. -	}else if((flag&0x0f)==1){	// “G‘Î’Ê’m
  2622. +	}else if((flag&0x0f)==1){	// ennemy notification
  2623.  		if( sd[0]!=NULL )
  2624.  			clif_guild_oppositionack(sd[0],0);
  2625.  	}
  2626.  
  2627.  
  2628. -	for(i=0;i<2-(flag&1);i++){	// “¯–¿/“G‘΃ŠƒXƒg‚̍đ—M
  2629. +	for(i=0;i<2-(flag&1);i++){	// Retransmission of the relationship list to all members
  2630.  		struct map_session_data *sd;
  2631.  		if(g[i]!=NULL)
  2632.  			for(j=0;j<g[i]->max_member;j++)
  2633. @@ -1549,10 +1613,9 @@
  2634.  	return 0;
  2635.  }
  2636.  
  2637. -/**
  2638. - * ƒMƒ‹ƒh‰ðŽU’Ê’m—p
  2639. - * @see DBApply
  2640. - */
  2641. +/*====================================================
  2642. + * Notification for the guild disbanded
  2643. + *---------------------------------------------------*/
  2644.  int guild_broken_sub(DBKey key, DBData *data, va_list ap)
  2645.  {
  2646.  	struct guild *g = db_data2ptr(data);
  2647. @@ -1562,7 +1625,7 @@
  2648.  
  2649.  	nullpo_ret(g);
  2650.  
  2651. -	for(i=0;i<MAX_GUILDALLIANCE;i++){	// ŠÖŒW‚ð”jŠü
  2652. +	for(i=0;i<MAX_GUILDALLIANCE;i++){	// Destroy all relationships
  2653.  		if(g->alliance[i].guild_id==guild_id){
  2654.  			for(j=0;j<g->max_member;j++)
  2655.  				if( (sd=g->member[j].sd)!=NULL )
  2656. @@ -1608,7 +1671,7 @@
  2657.  	if(flag!=0 || g==NULL)
  2658.  		return 0;
  2659.  
  2660. -	for(i=0;i<g->max_member;i++){	// ƒMƒ‹ƒh‰ðŽU‚ð’Ê’m
  2661. +	for(i=0;i<g->max_member;i++){ //Notification to disband the guild at all remaining member
  2662.  		if((sd=g->member[i].sd)!=NULL){
  2663.  			if(sd->state.storage_flag == 2)
  2664.  				storage_guild_storage_quit(sd,1);
  2665. @@ -1700,7 +1763,10 @@
  2666.  	return 1;
  2667.  }
  2668.  
  2669. -// ƒMƒ‹ƒh‰ðŽU
  2670. +
  2671. +/*====================================================
  2672. + * Guild disbanded
  2673. + *---------------------------------------------------*/
  2674.  int guild_break(struct map_session_data *sd,char *name)
  2675.  {
  2676.  	struct guild *g;
  2677. @@ -1893,6 +1959,9 @@
  2678.  	return 0;
  2679.  }
  2680.  
  2681. +/*====================================================
  2682. + * Start normal woe and triggers all npc OnAgitStart
  2683. + *---------------------------------------------------*/
  2684.  int guild_agit_start(void)
  2685.  {	// Run All NPC_Event[OnAgitStart]
  2686.  	int c = npc_event_doall("OnAgitStart");
  2687. @@ -1900,6 +1969,9 @@
  2688.  	return 0;
  2689.  }
  2690.  
  2691. +/*====================================================
  2692. + * End normal woe and triggers all npc OnAgitEnd
  2693. + *---------------------------------------------------*/
  2694.  int guild_agit_end(void)
  2695.  {	// Run All NPC_Event[OnAgitEnd]
  2696.  	int c = npc_event_doall("OnAgitEnd");
  2697. @@ -1907,6 +1979,9 @@
  2698.  	return 0;
  2699.  }
  2700.  
  2701. +/*====================================================
  2702. + * Start woe2 and triggers all npc OnAgitStart2
  2703. + *---------------------------------------------------*/
  2704.  int guild_agit2_start(void)
  2705.  {	// Run All NPC_Event[OnAgitStart2]
  2706.  	int c = npc_event_doall("OnAgitStart2");
  2707. @@ -1914,6 +1989,9 @@
  2708.  	return 0;
  2709.  }
  2710.  
  2711. +/*====================================================
  2712. + * End woe2 and triggers all npc OnAgitEnd2
  2713. + *---------------------------------------------------*/
  2714.  int guild_agit2_end(void)
  2715.  {	// Run All NPC_Event[OnAgitEnd2]
  2716.  	int c = npc_event_doall("OnAgitEnd2");
  2717. Index: src/map/itemdb.c
  2718. ===================================================================
  2719. --- src/map/itemdb.c	(revision 16039)
  2720. +++ src/map/itemdb.c	(working copy)
  2721. @@ -50,7 +50,7 @@
  2722.  }
  2723.  
  2724.  /*==========================================
  2725. - * –Œ‘O‚ÅŒŸõ
  2726. + * Retourne l'item data a partir du nom de l'item. 
  2727.   *------------------------------------------*/
  2728.  struct item_data* itemdb_searchname(const char *str)
  2729.  {
  2730. @@ -135,7 +135,7 @@
  2731.  
  2732.  
  2733.  /*==========================================
  2734. - * ” ŒnƒAƒCƒeƒ€ŒŸõ
  2735. + * Retourne un item id random appartenant au groupe. 
  2736.   *------------------------------------------*/
  2737.  int itemdb_searchrandomid(int group)
  2738.  {
  2739. @@ -584,7 +584,7 @@
  2740.  }
  2741.  
  2742.  /*==========================================
  2743. - * ‘•”õ§ŒÀƒtƒ@ƒCƒ‹“ǂݏo‚µ
  2744. + * Read item forbiden by mapflag restricted
  2745.   *------------------------------------------*/
  2746.  static bool itemdb_read_noequip(char* str[], int columns, int current)
  2747.  {// <nameid>,<mode>
  2748. @@ -870,7 +870,8 @@
  2749.  }
  2750.  
  2751.  /*==========================================
  2752. - * ƒAƒCƒeƒ€ƒf[ƒ^ƒx[ƒX‚̓ǂݍž‚Ý
  2753. + * Reading item from item db
  2754. + * item_db2 overwriting item_db
  2755.   *------------------------------------------*/
  2756.  static int itemdb_readdb(void)
  2757.  {
  2758. Index: src/map/intif.c
  2759. ===================================================================
  2760. --- src/map/intif.c	(revision 16039)
  2761. +++ src/map/intif.c	(working copy)
  2762. @@ -46,11 +46,11 @@
  2763.  	-1,-1, 7, 3,  0, 0, 0, 0,  0, 0, 0, 0,  0, 0,  0, 0, //0x3890  Homunculus [albator]
  2764.  };
  2765.  
  2766. -extern int char_fd;		// inter server‚Ìfd‚Íchar_fd‚ðŽg‚€
  2767. -#define inter_fd char_fd	// ƒGƒCƒŠƒAƒX
  2768. +extern int char_fd;		// inter server Fd used for char_fd
  2769. +#define inter_fd char_fd	// alias
  2770.  
  2771.  //-----------------------------------------------------------------
  2772. -// inter server‚Ö‚Ì‘—M
  2773. +// Send to inter server 
  2774.  
  2775.  int CheckForCharServer(void)
  2776.  {
  2777. @@ -136,7 +136,7 @@
  2778.  	return 0;
  2779.  }
  2780.  
  2781. -// GMƒƒbƒZ[ƒW‚𑗐M
  2782. +// GM Send a message
  2783.  int intif_broadcast(const char* mes, int len, int type)
  2784.  {
  2785.  	int lp = type ? 4 : 0;
  2786. @@ -386,7 +386,7 @@
  2787.  	return 0;
  2788.  }
  2789.  
  2790. -// ƒp[ƒeƒBì¬—v‹
  2791. +// Party creation request
  2792.  int intif_create_party(struct party_member *member,char *name,int item,int item2)
  2793.  {
  2794.  	if (CheckForCharServer())
  2795. @@ -403,7 +403,8 @@
  2796.  	WFIFOSET(inter_fd,WFIFOW(inter_fd, 2));
  2797.  	return 0;
  2798.  }
  2799. -// ƒp[ƒeƒBî•ñ—v‹
  2800. +
  2801. +// Party information request
  2802.  int intif_request_partyinfo(int party_id, int char_id)
  2803.  {
  2804.  	if (CheckForCharServer())
  2805. @@ -415,7 +416,8 @@
  2806.  	WFIFOSET(inter_fd,10);
  2807.  	return 0;
  2808.  }
  2809. -// ƒp[ƒeƒB’ljÁ—v‹
  2810. +
  2811. +// Request to add a member to party 
  2812.  int intif_party_addmember(int party_id,struct party_member *member)
  2813.  {
  2814.  	if (CheckForCharServer())
  2815. @@ -428,7 +430,8 @@
  2816.  	WFIFOSET(inter_fd,WFIFOW(inter_fd, 2));
  2817.  	return 1;
  2818.  }
  2819. -// ƒp[ƒeƒBÝ’è•ÏX
  2820. +
  2821. +// Request to change party configuration (exp,item share)
  2822.  int intif_party_changeoption(int party_id,int account_id,int exp,int item)
  2823.  {
  2824.  	if (CheckForCharServer())
  2825. @@ -442,7 +445,8 @@
  2826.  	WFIFOSET(inter_fd,14);
  2827.  	return 0;
  2828.  }
  2829. -// ƒp[ƒeƒB’E‘Þ—v‹
  2830. +
  2831. +// Request to leave party
  2832.  int intif_party_leave(int party_id,int account_id, int char_id)
  2833.  {
  2834.  	if (CheckForCharServer())
  2835. @@ -455,7 +459,8 @@
  2836.  	WFIFOSET(inter_fd,14);
  2837.  	return 0;
  2838.  }
  2839. -// ƒp[ƒeƒBˆÚ“®—v‹
  2840. +
  2841. +// Request keeping party for new map ?? 
  2842.  int intif_party_changemap(struct map_session_data *sd,int online)
  2843.  {
  2844.  	int m, mapindex;
  2845. @@ -481,7 +486,8 @@
  2846.  	WFIFOSET(inter_fd,19);
  2847.  	return 1;
  2848.  }
  2849. -// ƒp[ƒeƒB[‰ðŽU—v‹
  2850. +
  2851. +// Request breaking party 
  2852.  int intif_break_party(int party_id)
  2853.  {
  2854.  	if (CheckForCharServer())
  2855. @@ -492,7 +498,8 @@
  2856.  	WFIFOSET(inter_fd,6);
  2857.  	return 0;
  2858.  }
  2859. -// ƒp[ƒeƒB‰ï˜b‘—M
  2860. +
  2861. +// Sending party chat
  2862.  int intif_party_message(int party_id,int account_id,const char *mes,int len)
  2863.  {
  2864.  	if (CheckForCharServer())
  2865. @@ -511,6 +518,7 @@
  2866.  	return 0;
  2867.  }
  2868.  
  2869. +// Request a new leader for party
  2870.  int intif_party_leaderchange(int party_id,int account_id,int char_id)
  2871.  {
  2872.  	if (CheckForCharServer())
  2873. @@ -524,8 +532,7 @@
  2874.  	return 0;
  2875.  }
  2876.  
  2877. -
  2878. -// ƒMƒ‹ƒhì¬—v‹
  2879. +// Request a Guild creation
  2880.  int intif_guild_create(const char *name,const struct guild_member *master)
  2881.  {
  2882.  	if (CheckForCharServer())
  2883. @@ -541,7 +548,8 @@
  2884.  	WFIFOSET(inter_fd,WFIFOW(inter_fd,2));
  2885.  	return 0;
  2886.  }
  2887. -// ƒMƒ‹ƒhî•ñ—v‹
  2888. +
  2889. +// Request Guild information
  2890.  int intif_guild_request_info(int guild_id)
  2891.  {
  2892.  	if (CheckForCharServer())
  2893. @@ -552,7 +560,8 @@
  2894.  	WFIFOSET(inter_fd,6);
  2895.  	return 0;
  2896.  }
  2897. -// ƒMƒ‹ƒhƒƒ“ƒo’ljÁ—v‹
  2898. +
  2899. +// Request to add member to the guild
  2900.  int intif_guild_addmember(int guild_id,struct guild_member *m)
  2901.  {
  2902.  	if (CheckForCharServer())
  2903. @@ -566,6 +575,7 @@
  2904.  	return 0;
  2905.  }
  2906.  
  2907. +// Request a new leader for guild
  2908.  int intif_guild_change_gm(int guild_id, const char* name, int len)
  2909.  {
  2910.  	if (CheckForCharServer())
  2911. @@ -579,7 +589,7 @@
  2912.  	return 0;
  2913.  }
  2914.  
  2915. -// ƒMƒ‹ƒhƒƒ“ƒo’E‘Þ/’Ç•ú—v‹
  2916. +// Request to leave guild
  2917.  int intif_guild_leave(int guild_id,int account_id,int char_id,int flag,const char *mes)
  2918.  {
  2919.  	if (CheckForCharServer())
  2920. @@ -594,7 +604,8 @@
  2921.  	WFIFOSET(inter_fd,55);
  2922.  	return 0;
  2923.  }
  2924. -// ƒMƒ‹ƒhƒƒ“ƒo‚̃Iƒ“ƒ‰ƒCƒ“ó‹µ/LvXV—v‹
  2925. +
  2926. +//Update request / Lv online status of the guild members
  2927.  int intif_guild_memberinfoshort(int guild_id,int account_id,int char_id,int online,int lv,int class_)
  2928.  {
  2929.  	if (CheckForCharServer())
  2930. @@ -610,7 +621,8 @@
  2931.  	WFIFOSET(inter_fd,19);
  2932.  	return 0;
  2933.  }
  2934. -// ƒMƒ‹ƒh‰ðŽU’Ê’m
  2935. +
  2936. +//Guild disbanded notification
  2937.  int intif_guild_break(int guild_id)
  2938.  {
  2939.  	if (CheckForCharServer())
  2940. @@ -621,7 +633,8 @@
  2941.  	WFIFOSET(inter_fd,6);
  2942.  	return 0;
  2943.  }
  2944. -// ƒMƒ‹ƒh‰ï˜b‘—M
  2945. +
  2946. +// Send a guild message
  2947.  int intif_guild_message(int guild_id,int account_id,const char *mes,int len)
  2948.  {
  2949.  	if (CheckForCharServer())
  2950. @@ -640,7 +653,8 @@
  2951.  
  2952.  	return 0;
  2953.  }
  2954. -// ƒMƒ‹ƒhŠî–{î•ñ•ÏX—v‹
  2955. +
  2956. +// Request a change of Guild basic information
  2957.  int intif_guild_change_basicinfo(int guild_id,int type,const void *data,int len)
  2958.  {
  2959.  	if (CheckForCharServer())
  2960. @@ -654,7 +668,8 @@
  2961.  	WFIFOSET(inter_fd,len+10);
  2962.  	return 0;
  2963.  }
  2964. -// ƒMƒ‹ƒhƒƒ“ƒoî•ñ•ÏX—v‹
  2965. +
  2966. +// Request a change of Guild member information
  2967.  int intif_guild_change_memberinfo(int guild_id,int account_id,int char_id,
  2968.  	int type,const void *data,int len)
  2969.  {
  2970. @@ -671,7 +686,8 @@
  2971.  	WFIFOSET(inter_fd,len+18);
  2972.  	return 0;
  2973.  }
  2974. -// ƒMƒ‹ƒh–ðE•ÏX—v‹
  2975. +
  2976. +// Request a change of Guild title 
  2977.  int intif_guild_position(int guild_id,int idx,struct guild_position *p)
  2978.  {
  2979.  	if (CheckForCharServer())
  2980. @@ -685,7 +701,8 @@
  2981.  	WFIFOSET(inter_fd,WFIFOW(inter_fd,2));
  2982.  	return 0;
  2983.  }
  2984. -// ƒMƒ‹ƒhƒXƒLƒ‹ƒAƒbƒv—v‹
  2985. +
  2986. +// Request an update of Guildskill skillnum 
  2987.  int intif_guild_skillup(int guild_id, int skill_num, int account_id, int max)
  2988.  {
  2989.  	if( CheckForCharServer() )
  2990. @@ -699,7 +716,8 @@
  2991.  	WFIFOSET(inter_fd, 18);
  2992.  	return 0;
  2993.  }
  2994. -// ƒMƒ‹ƒh“¯–¿/“G‘Ηv‹
  2995. +
  2996. +// Request a new guild relationship
  2997.  int intif_guild_alliance(int guild_id1,int guild_id2,int account_id1,int account_id2,int flag)
  2998.  {
  2999.  	if (CheckForCharServer())
  3000. @@ -714,7 +732,8 @@
  3001.  	WFIFOSET(inter_fd,19);
  3002.  	return 0;
  3003.  }
  3004. -// ƒMƒ‹ƒh’m•ÏX—v‹
  3005. +
  3006. +// Request to change guild notice
  3007.  int intif_guild_notice(int guild_id,const char *mes1,const char *mes2)
  3008.  {
  3009.  	if (CheckForCharServer())
  3010. @@ -727,7 +746,8 @@
  3011.  	WFIFOSET(inter_fd,186);
  3012.  	return 0;
  3013.  }
  3014. -// ƒMƒ‹ƒhƒGƒ“ƒuƒŒƒ€•ÏX—v‹
  3015. +
  3016. +// Request to change guild emblem
  3017.  int intif_guild_emblem(int guild_id,int len,const char *data)
  3018.  {
  3019.  	if (CheckForCharServer())
  3020. @@ -761,7 +781,8 @@
  3021.  	return 1;
  3022.  }
  3023.  
  3024. -//ƒMƒ‹ƒhéè—̃Mƒ‹ƒh•ÏX—v‹
  3025. +
  3026. +// Request change castle guild owner and save data
  3027.  int intif_guild_castle_datasave(int castle_id,int index, int value)
  3028.  {
  3029.  	if (CheckForCharServer())
  3030. @@ -868,7 +889,7 @@
  3031.  	}
  3032.  	//Success to send whisper.
  3033.  	clif_wis_message(sd->fd, wisp_source, (char*)RFIFOP(fd,56),RFIFOW(fd,2)-56);
  3034. -	intif_wis_replay(id,0);   // ‘—M¬Œ÷
  3035. +	intif_wis_replay(id,0);   // succes
  3036.  	return 0;
  3037.  }
  3038.  
  3039. @@ -925,7 +946,7 @@
  3040.  	return 0;
  3041.  }
  3042.  
  3043. -// ƒAƒJƒEƒ“ƒg•Ï”’Ê’m
  3044. +// Request player registre
  3045.  int intif_parse_Registers(int fd)
  3046.  {
  3047.  	int j,p,len,max, flag;
  3048. @@ -1017,13 +1038,15 @@
  3049.  	storage_guild_storageopen(sd);
  3050.  	return 0;
  3051.  }
  3052. +
  3053. +// ACK guild_storage saved
  3054.  int intif_parse_SaveGuildStorage(int fd)
  3055.  {
  3056.  	storage_guild_storagesaved(/*RFIFOL(fd,2), */RFIFOL(fd,6));
  3057.  	return 0;
  3058.  }
  3059.  
  3060. -// ƒp[ƒeƒBì¬‰Â”Û
  3061. +// ACK party creation
  3062.  int intif_parse_PartyCreated(int fd)
  3063.  {
  3064.  	if(battle_config.etc_log)
  3065. @@ -1031,7 +1054,8 @@
  3066.  	party_created(RFIFOL(fd,2), RFIFOL(fd,6),RFIFOB(fd,10),RFIFOL(fd,11), (char *)RFIFOP(fd,15));
  3067.  	return 0;
  3068.  }
  3069. -// ƒp[ƒeƒBî•ñ
  3070. +
  3071. +// Receive party info
  3072.  int intif_parse_PartyInfo(int fd)
  3073.  {
  3074.  	if( RFIFOW(fd,2) == 12 ){
  3075. @@ -1045,7 +1069,8 @@
  3076.  	party_recv_info((struct party *)RFIFOP(fd,8), RFIFOL(fd,4));
  3077.  	return 0;
  3078.  }
  3079. -// ƒp[ƒeƒB’ljÁ’Ê’m
  3080. +
  3081. +// ACK adding party member
  3082.  int intif_parse_PartyMemberAdded(int fd)
  3083.  {
  3084.  	if(battle_config.etc_log)
  3085. @@ -1053,13 +1078,15 @@
  3086.  	party_member_added(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10), RFIFOB(fd, 14));
  3087.  	return 0;
  3088.  }
  3089. -// ƒp[ƒeƒBÝ’è•ÏX’Ê’m
  3090. +
  3091. +// ACK changing party option
  3092.  int intif_parse_PartyOptionChanged(int fd)
  3093.  {
  3094.  	party_optionchanged(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOW(fd,10),RFIFOW(fd,12),RFIFOB(fd,14));
  3095.  	return 0;
  3096.  }
  3097. -// ƒp[ƒeƒB’E‘Þ’Ê’m
  3098. +
  3099. +// ACK member leaving party
  3100.  int intif_parse_PartyMemberWithdraw(int fd)
  3101.  {
  3102.  	if(battle_config.etc_log)
  3103. @@ -1067,32 +1094,36 @@
  3104.  	party_member_withdraw(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10));
  3105.  	return 0;
  3106.  }
  3107. -// ƒp[ƒeƒB‰ðŽU’Ê’m
  3108. +
  3109. +// ACK party break
  3110.  int intif_parse_PartyBroken(int fd)
  3111.  {
  3112.  	party_broken(RFIFOL(fd,2));
  3113.  	return 0;
  3114.  }
  3115. -// ƒp[ƒeƒBˆÚ“®’Ê’m
  3116. +
  3117. +// ACK party on new map
  3118.  int intif_parse_PartyMove(int fd)
  3119.  {
  3120.  	party_recv_movemap(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOW(fd,14),RFIFOB(fd,16),RFIFOW(fd,17));
  3121.  	return 0;
  3122.  }
  3123. -// ƒp[ƒeƒBƒƒbƒZ[ƒW
  3124. +
  3125. +// ACK party messages
  3126.  int intif_parse_PartyMessage(int fd)
  3127.  {
  3128.  	party_recv_message(RFIFOL(fd,4),RFIFOL(fd,8),(char *) RFIFOP(fd,12),RFIFOW(fd,2)-12);
  3129.  	return 0;
  3130.  }
  3131.  
  3132. -// ƒMƒ‹ƒhì¬‰Â”Û
  3133. +// ACK guild creation
  3134.  int intif_parse_GuildCreated(int fd)
  3135.  {
  3136.  	guild_created(RFIFOL(fd,2),RFIFOL(fd,6));
  3137.  	return 0;
  3138.  }
  3139. -// ƒMƒ‹ƒhî•ñ
  3140. +
  3141. +// ACK guild infos
  3142.  int intif_parse_GuildInfo(int fd)
  3143.  {
  3144.  	if(RFIFOW(fd,2) == 8) {
  3145. @@ -1100,12 +1131,14 @@
  3146.  		guild_recv_noinfo(RFIFOL(fd,4));
  3147.  		return 0;
  3148.  	}
  3149. +
  3150.  	if( RFIFOW(fd,2)!=sizeof(struct guild)+4 )
  3151.  		ShowError("intif: guild info : data size error Gid: %d recv size: %d Expected size: %d\n",RFIFOL(fd,4),RFIFOW(fd,2),sizeof(struct guild)+4);
  3152.  	guild_recv_info((struct guild *)RFIFOP(fd,4));
  3153.  	return 0;
  3154.  }
  3155. -// ƒMƒ‹ƒhƒƒ“ƒo’ljÁ’Ê’m
  3156. +
  3157. +// ACK adding guild member
  3158.  int intif_parse_GuildMemberAdded(int fd)
  3159.  {
  3160.  	if(battle_config.etc_log)
  3161. @@ -1113,20 +1146,22 @@
  3162.  	guild_member_added(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14));
  3163.  	return 0;
  3164.  }
  3165. -// ƒMƒ‹ƒhƒƒ“ƒo’E‘Þ/’Ç•ú’Ê’m
  3166. +
  3167. +// ACK member leaving guild
  3168.  int intif_parse_GuildMemberWithdraw(int fd)
  3169.  {
  3170.  	guild_member_withdraw(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14),(char *)RFIFOP(fd,55),(char *)RFIFOP(fd,15));
  3171.  	return 0;
  3172.  }
  3173.  
  3174. -// ƒMƒ‹ƒhƒƒ“ƒoƒIƒ“ƒ‰ƒCƒ“ó‘Ô/Lv•ÏX’Ê’m
  3175. +// ACK guild member basic info
  3176.  int intif_parse_GuildMemberInfoShort(int fd)
  3177.  {
  3178.  	guild_recv_memberinfoshort(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14),RFIFOW(fd,15),RFIFOW(fd,17));
  3179.  	return 0;
  3180.  }
  3181. -// ƒMƒ‹ƒh‰ðŽU’Ê’m
  3182. +
  3183. +// ACK guild break
  3184.  int intif_parse_GuildBroken(int fd)
  3185.  {
  3186.  	guild_broken(RFIFOL(fd,2),RFIFOB(fd,6));
  3187. @@ -1189,7 +1224,7 @@
  3188.  	return 0;
  3189.  }
  3190.  
  3191. -// ƒMƒ‹ƒh–ðE•ÏX’Ê’m
  3192. +// ACK change of guild title
  3193.  int intif_parse_GuildPosition(int fd)
  3194.  {
  3195.  	if( RFIFOW(fd,2)!=sizeof(struct guild_position)+12 )
  3196. @@ -1197,54 +1232,61 @@
  3197.  	guild_position_changed(RFIFOL(fd,4),RFIFOL(fd,8),(struct guild_position *)RFIFOP(fd,12));
  3198.  	return 0;
  3199.  }
  3200. -// ƒMƒ‹ƒhƒXƒLƒ‹Š„‚èU‚è’Ê’m
  3201. +
  3202. +// ACK change of guild skill update
  3203.  int intif_parse_GuildSkillUp(int fd)
  3204.  {
  3205.  	guild_skillupack(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10));
  3206.  	return 0;
  3207.  }
  3208. -// ƒMƒ‹ƒh“¯–¿/“G‘Î’Ê’m
  3209. +
  3210. +// ACK change of guild relationship
  3211.  int intif_parse_GuildAlliance(int fd)
  3212.  {
  3213.  	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));
  3214.  	return 0;
  3215.  }
  3216. -// ƒMƒ‹ƒh’m•ÏX’Ê’m
  3217. +
  3218. +// ACK change of guild notice
  3219.  int intif_parse_GuildNotice(int fd)
  3220.  {
  3221.  	guild_notice_changed(RFIFOL(fd,2),(char *) RFIFOP(fd,6),(char *) RFIFOP(fd,66));
  3222.  	return 0;
  3223.  }
  3224. -// ƒMƒ‹ƒhƒGƒ“ƒuƒŒƒ€•ÏX’Ê’m
  3225. +
  3226. +// ACK change of guild emblem
  3227.  int intif_parse_GuildEmblem(int fd)
  3228.  {
  3229.  	guild_emblem_changed(RFIFOW(fd,2)-12,RFIFOL(fd,4),RFIFOL(fd,8), (char *)RFIFOP(fd,12));
  3230.  	return 0;
  3231.  }
  3232. -// ƒMƒ‹ƒh‰ï˜bŽóM
  3233. +
  3234. +// ACK guild message
  3235.  int intif_parse_GuildMessage(int fd)
  3236.  {
  3237.  	guild_recv_message(RFIFOL(fd,4),RFIFOL(fd,8),(char *) RFIFOP(fd,12),RFIFOW(fd,2)-12);
  3238.  	return 0;
  3239.  }
  3240. -// ƒMƒ‹ƒhéƒf[ƒ^—v‹•ÔM
  3241. +// Reply guild castle data request
  3242.  int intif_parse_GuildCastleDataLoad(int fd)
  3243.  {
  3244.  	return guild_castledataloadack(RFIFOW(fd,2), (struct guild_castle *)RFIFOP(fd,4));
  3245.  }
  3246.  
  3247. +// ACK change of guildmaster
  3248.  int intif_parse_GuildMasterChanged(int fd)
  3249.  {
  3250.  	return guild_gm_changed(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10));
  3251.  }
  3252.  
  3253. -// pet
  3254. +// Request pet creation
  3255.  int intif_parse_CreatePet(int fd)
  3256.  {
  3257.  	pet_get_egg(RFIFOL(fd,2),RFIFOL(fd,7),RFIFOB(fd,6));
  3258.  	return 0;
  3259.  }
  3260.  
  3261. +// ACK pet data
  3262.  int intif_parse_RecvPetData(int fd)
  3263.  {
  3264.  	struct s_pet p;
  3265. @@ -1261,6 +1303,8 @@
  3266.  
  3267.  	return 0;
  3268.  }
  3269. +
  3270. +// ACK pet save data
  3271.  int intif_parse_SavePetOk(int fd)
  3272.  {
  3273.  	if(RFIFOB(fd,6) == 1)
  3274. @@ -1269,6 +1313,7 @@
  3275.  	return 0;
  3276.  }
  3277.  
  3278. +// ACK deleting pet
  3279.  int intif_parse_DeletePetOk(int fd)
  3280.  {
  3281.  	if(RFIFOB(fd,2) == 1)
  3282. @@ -1277,6 +1322,7 @@
  3283.  	return 0;
  3284.  }
  3285.  
  3286. +// ACK changing name resquest, players,pets,hommon
  3287.  int intif_parse_ChangeNameOk(int fd)
  3288.  {
  3289.  	struct map_session_data *sd = NULL;
  3290. @@ -2112,19 +2158,19 @@
  3291.  }
  3292.  
  3293.  //-----------------------------------------------------------------
  3294. -// inter server‚©‚ç‚̒ʐM
  3295. -// ƒGƒ‰[‚ª‚ ‚ê‚Î0(false)‚ð•Ô‚·‚±‚Æ
  3296. -// ƒpƒPƒbƒg‚ªˆ—‚Å‚«‚ê‚Î1,ƒpƒPƒbƒg’·‚ª‘«‚è‚È‚¯‚ê‚Î2‚ð•Ô‚·‚±‚Æ
  3297. +// Communication from the inter server
  3298. +// Return a 0 (false) if there were any errors.
  3299. +// 1, 2 if there are not enough to return the length of the packet if the packet processing
  3300.  int intif_parse(int fd)
  3301.  {
  3302.  	int packet_len, cmd;
  3303.  	cmd = RFIFOW(fd,0);
  3304. -	// ƒpƒPƒbƒg‚ÌIDŠm”F
  3305. +	// Verify ID of the packet
  3306.  	if(cmd<0x3800 || cmd>=0x3800+(sizeof(packet_len_table)/sizeof(packet_len_table[0])) ||
  3307.  	   packet_len_table[cmd-0x3800]==0){
  3308.  	   	return 0;
  3309.  	}
  3310. -	// ƒpƒPƒbƒg‚Ì’·‚³Šm”F
  3311. +	// Check the length of the packet
  3312.  	packet_len = packet_len_table[cmd-0x3800];
  3313.  	if(packet_len==-1){
  3314.  		if(RFIFOREST(fd)<4)
  3315. @@ -2134,7 +2180,7 @@
  3316.  	if((int)RFIFOREST(fd)<packet_len){
  3317.  		return 2;
  3318.  	}
  3319. -	// ˆ—•ªŠò
  3320. +	// Processing branch
  3321.  	switch(cmd){
  3322.  	case 0x3800:
  3323.  		if (RFIFOL(fd,4) == 0xFF000000) //Normal announce.
  3324. @@ -2217,7 +2263,7 @@
  3325.  		ShowError("intif_parse : unknown packet %d %x\n",fd,RFIFOW(fd,0));
  3326.  		return 0;
  3327.  	}
  3328. -	// ƒpƒPƒbƒg“Ç‚Ý”ò‚΂µ
  3329. +	// Skip packet
  3330.  	RFIFOSKIP(fd,packet_len);
  3331.  	return 1;
  3332.  }
  3333. Index: src/map/intif.h
  3334. ===================================================================
  3335. --- src/map/intif.h	(revision 16039)
  3336. +++ src/map/intif.h	(working copy)
  3337. @@ -98,6 +98,7 @@
  3338.  int intif_Auction_cancel(int char_id, unsigned int auction_id);
  3339.  int intif_Auction_close(int char_id, unsigned int auction_id);
  3340.  int intif_Auction_bid(int char_id, const char* name, unsigned int auction_id, int bid);
  3341. +
  3342.  // ELEMENTAL SYSTEM
  3343.  int intif_elemental_create(struct s_elemental *ele);
  3344.  int intif_elemental_request(int ele_id, int char_id);
  3345. Index: src/map/npc.c
  3346. ===================================================================
  3347. --- src/map/npc.c	(revision 16039)
  3348. +++ src/map/npc.c	(working copy)
  3349. @@ -127,9 +127,9 @@
  3350.  }
  3351.  
  3352.  /*==========================================
  3353. - * NPC‚Ì–³Œø‰»/—LŒø‰»
  3354. + * NPC
  3355.   * npc_enable
  3356. - * npc_enable_sub —LŒøŽž‚ÉOnTouchƒCƒxƒ“ƒg‚ðŽÀs
  3357. + * npc_enable_sub On Touch
  3358.   *------------------------------------------*/
  3359.  int npc_enable_sub(struct block_list *bl, va_list ap)
  3360.  {
  3361. @@ -159,7 +159,6 @@
  3362.  int npc_enable(const char* name, int flag)
  3363.  {
  3364.  	struct npc_data* nd = npc_name2id(name);
  3365. -
  3366.  	if (nd==NULL)
  3367.  	{
  3368.  		ShowError("npc_enable: Attempted to %s a non-existing NPC '%s' (flag=%d).\n", (flag&3) ? "show" : "hide", name, flag);
  3369. @@ -194,7 +193,7 @@
  3370.  }
  3371.  
  3372.  /*==========================================
  3373. - * NPC‚𖌑O‚Å’T‚·
  3374. + * NPC lookup
  3375.   *------------------------------------------*/
  3376.  struct npc_data* npc_name2id(const char* name)
  3377.  {
  3378. @@ -434,7 +433,8 @@
  3379.  }
  3380.  
  3381.  /*==========================================
  3382. - * ƒ^ƒCƒ}[ƒCƒxƒ“ƒg—pƒ‰ƒxƒ‹‚ÌŽæ‚荞‚Ý
  3383. + * 
  3384. + * npc_parse_script->strdb_foreach
  3385.   * called from npc_parse_script
  3386.   *------------------------------------------*/
  3387.  int npc_timerevent_export(struct npc_data *nd, int i)
  3388. @@ -1060,7 +1060,7 @@
  3389.  }
  3390.  
  3391.  /*==========================================
  3392. - * NPC‚̃I[ƒvƒ“ƒ`ƒƒƒbƒg”­ŒŸ
  3393. + * NPC I guess something like npctalk
  3394.   *------------------------------------------*/
  3395.  int npc_globalmessage(const char* name, const char* mes)
  3396.  {
  3397. @@ -1102,7 +1102,7 @@
  3398.  }
  3399.  
  3400.  /*==========================================
  3401. - * ƒNƒŠƒbƒNŽž‚ÌNPCˆ—
  3402. + * NPC 1st call when clicking on npc 
  3403.   *------------------------------------------*/
  3404.  int npc_click(struct map_session_data* sd, struct npc_data* nd)
  3405.  {
  3406. Index: src/map/status.c
  3407. ===================================================================
  3408. --- src/map/status.c	(revision 16039)
  3409. +++ src/map/status.c	(working copy)
  3410. @@ -62,7 +62,7 @@
  3411.  	int randombonus_max[MAX_REFINE]; // cumulative maximum random bonus damage
  3412.  } refine_info[REFINE_TYPE_MAX];
  3413.  
  3414. -static int atkmods[3][MAX_WEAPON_TYPE];	// •ŠíATKƒTƒCƒYC³(size_fix.txt)
  3415. +static int atkmods[3][MAX_WEAPON_TYPE];	// ᅵᅵᅵᅵATKᅵTᅵCᅵYᅵCᅵᅵ(size_fix.txt)
  3416.  static char job_bonus[CLASS_COUNT][MAX_LEVEL];
  3417.  #ifdef RENEWAL
  3418.  enum {
  3419. @@ -1107,7 +1107,7 @@
  3420.  			status_change_end(target, SC_BERSERK, INVALID_TIMER);
  3421.  		if( sc->data[SC_RAISINGDRAGON] && status->hp <= 1000 )
  3422.  			status_change_end(target, SC_RAISINGDRAGON, INVALID_TIMER);
  3423. -		if (sc->data[SC_SATURDAYNIGHTFEVER] && status->hp <= 100)
  3424. +		if( sc->data[SC_SATURDAYNIGHTFEVER] && status->hp <= 100 )
  3425.  			status_change_end(target, SC_SATURDAYNIGHTFEVER, INVALID_TIMER);
  3426.  	}
  3427.  
  3428. @@ -1118,6 +1118,8 @@
  3429.  		case BL_HOM: merc_damage((TBL_HOM*)target,src,hp,sp); break;
  3430.  		case BL_MER: mercenary_damage((TBL_MER*)target,src,hp,sp); break;
  3431.  		case BL_ELEM: elemental_damage((TBL_ELEM*)target,src,hp,sp); break;
  3432. +		default:	//Unhandled case, do nothing to object.
  3433. +			break;
  3434.  	}
  3435.  
  3436.  	if( target->type == BL_PC && ((TBL_PC*)target)->disguise && src )
  3437. @@ -1282,6 +1284,9 @@
  3438.  	case BL_HOM: merc_hom_heal((TBL_HOM*)bl,hp,sp); break;
  3439.  	case BL_MER: mercenary_heal((TBL_MER*)bl,hp,sp); break;
  3440.  	case BL_ELEM: elemental_heal((TBL_ELEM*)bl,hp,sp); break;
  3441. +	default:
  3442. +	    ShowWarning("Invalid bl type=%d in status_heal\n",bl->type);
  3443. +	    break;
  3444.  	}
  3445.  
  3446.  	return hp+sp;
  3447. @@ -1388,6 +1393,9 @@
  3448.  		case BL_PC:  pc_revive((TBL_PC*)bl, hp, sp); break;
  3449.  		case BL_MOB: mob_revive((TBL_MOB*)bl, hp); break;
  3450.  		case BL_HOM: merc_hom_revive((TBL_HOM*)bl, hp, sp); break;
  3451. +		default:
  3452. +		    ShowWarning("Invalid bl type=%d in status_revive\n",bl->type);
  3453. +		    break;
  3454.  	}
  3455.  	return 1;
  3456.  }
  3457. @@ -1554,8 +1562,8 @@
  3458.  
  3459.  		}
  3460.  	}
  3461. -
  3462. -	if (sc && sc->option)
  3463. +	// Check for src's status changes
  3464. +	if( sc && sc->option )
  3465.  	{
  3466.  		if (sc->option&OPTION_HIDE)
  3467.  		switch (skill_num) { //Usable skills while hiding.
  3468. @@ -1581,6 +1589,7 @@
  3469.  
  3470.  	tsc = status_get_sc(target);
  3471.  
  3472. +	// Check for target's status changes.
  3473.  	if(tsc && tsc->count) {
  3474.  		if( tsc->data[SC_INVINCIBLE] )
  3475.  			return 0;
  3476. @@ -1947,7 +1956,7 @@
  3477.  
  3478.  	if (flag&2)
  3479.  	{	// change for sized monsters [Valaris]
  3480. -		if (md->special_state.size==1) {
  3481. +		if (md->special_state.size==SZ_MEDIUM) {
  3482.  			status->max_hp>>=1;
  3483.  			status->max_sp>>=1;
  3484.  			if (!status->max_hp) status->max_hp = 1;
  3485. @@ -1966,7 +1975,7 @@
  3486.  			if (!status->int_) status->int_ = 1;
  3487.  			if (!status->dex) status->dex = 1;
  3488.  			if (!status->luk) status->luk = 1;
  3489. -		} else if (md->special_state.size==2) {
  3490. +		} else if (md->special_state.size==SZ_BIG) {
  3491.  			status->max_hp<<=1;
  3492.  			status->max_sp<<=1;
  3493.  			status->hp=status->max_hp;
  3494. @@ -2167,7 +2176,7 @@
  3495.  	b_weight = sd->weight;
  3496.  	b_max_weight = sd->max_weight;
  3497.  
  3498. -	pc_calc_skilltree(sd);	// ƒXƒLƒ‹ƒcƒŠ?‚ÌŒvŽZ
  3499. +	pc_calc_skilltree(sd);	// ï¿œXï¿œLᅵᅵᅵcᅵᅵ?ᅵ̌vï¿œZ
  3500.  
  3501.  	sd->max_weight = max_weight_base[pc_class2idx(sd->status.class_)]+sd->status.str*300;
  3502.  
  3503. @@ -3703,6 +3712,9 @@
  3504.  		case BL_HOM: status_calc_homunculus_(BL_CAST(BL_HOM,bl), first); break;
  3505.  		case BL_MER: status_calc_mercenary_(BL_CAST(BL_MER,bl), first);  break;
  3506.  		case BL_ELEM: status_calc_elemental_(BL_CAST(BL_ELEM,bl), first);  break;
  3507. +		default:
  3508. +		    ShowWarning("Invalid bl type=%d in status_calc_bl_ and flag&SCB_BASE\n",bl->type);
  3509. +		    break;
  3510.  		}
  3511.  	}
  3512.  
  3513. @@ -5113,7 +5125,8 @@
  3514.  static unsigned short status_calc_mode(struct block_list *bl, struct status_change *sc, int mode)
  3515.  {
  3516.  	if(!sc || !sc->count)
  3517. -		return mode;
  3518. +		return cap_value(mode,0,USHRT_MAX);
  3519. +        
  3520.  	if(sc->data[SC_MODECHANGE]) {
  3521.  		if (sc->data[SC_MODECHANGE]->val2)
  3522.  			mode = sc->data[SC_MODECHANGE]->val2; //Set mode
  3523. @@ -5128,22 +5141,26 @@
  3524.  const char* status_get_name(struct block_list *bl) {
  3525.  	nullpo_ret(bl);
  3526.  	switch (bl->type) {
  3527. -	case BL_PC:  return ((TBL_PC *)bl)->fakename[0] != '\0' ? ((TBL_PC*)bl)->fakename : ((TBL_PC*)bl)->status.name;
  3528. -	case BL_MOB: return ((TBL_MOB*)bl)->name;
  3529. -	case BL_PET: return ((TBL_PET*)bl)->pet.name;
  3530. -	case BL_HOM: return ((TBL_HOM*)bl)->homunculus.name;
  3531. -	case BL_NPC: return ((TBL_NPC*)bl)->name;
  3532. +		case BL_PC:  return ((TBL_PC *)bl)->fakename[0] != '\0' ? ((TBL_PC*)bl)->fakename : ((TBL_PC*)bl)->status.name;
  3533. +		case BL_MOB: return ((TBL_MOB*)bl)->name;
  3534. +		case BL_PET: return ((TBL_PET*)bl)->pet.name;
  3535. +		case BL_HOM: return ((TBL_HOM*)bl)->homunculus.name;
  3536. +		case BL_NPC: return ((TBL_NPC*)bl)->name;
  3537. +		default:
  3538. +		    ShowError("Invalide type=%d in status_get_name\n",bl->type);
  3539.  	}
  3540.  	return "Unknown";
  3541.  }
  3542.  
  3543.  /*==========================================
  3544. - * ‘ΏۂÌClass‚ð•Ô‚·(”Ä—p)
  3545. - * –ß‚è‚͐®”‚Å0ˆÈã
  3546. + * Hookup de la class d'un bl.
  3547. + * Donne l'id de la classe
  3548.   *------------------------------------------*/
  3549. -int status_get_class(struct block_list *bl) {
  3550. +int status_get_class(struct block_list *bl)
  3551. +{
  3552.  	nullpo_ret(bl);
  3553. -	switch( bl->type ) {
  3554. +	switch( bl->type )
  3555. +	{
  3556.  		case BL_PC:  return ((TBL_PC*)bl)->status.class_;
  3557.  		case BL_MOB: return ((TBL_MOB*)bl)->vd->class_; //Class used on all code should be the view class of the mob.
  3558.  		case BL_PET: return ((TBL_PET*)bl)->pet.class_;
  3559. @@ -5151,14 +5168,17 @@
  3560.  		case BL_MER: return ((TBL_MER*)bl)->mercenary.class_;
  3561.  		case BL_NPC: return ((TBL_NPC*)bl)->class_;
  3562.  		case BL_ELEM: return ((TBL_ELEM*)bl)->elemental.class_;
  3563. +		default:
  3564. +		    ShowError("Invalide type=%d in status_get_class\n",bl->type);
  3565.  	}
  3566.  	return 0;
  3567.  }
  3568.  /*==========================================
  3569. - * ‘Ώۂ̃Œƒxƒ‹‚ð•Ô‚·(”Ä—p)
  3570. - * –ß‚è‚͐®”‚Å0ˆÈã
  3571. + * Avoir les battle_calc status d'un bl, hookup pour tous les type.
  3572. + * Permet des fonction general sans extra switch
  3573.   *------------------------------------------*/
  3574. -int status_get_lv(struct block_list *bl) {
  3575. +int status_get_lv(struct block_list *bl)
  3576. +{
  3577.  	nullpo_ret(bl);
  3578.  	switch (bl->type) {
  3579.  		case BL_PC:  return ((TBL_PC*)bl)->status.base_level;
  3580. @@ -5167,6 +5187,8 @@
  3581.  		case BL_HOM: return ((TBL_HOM*)bl)->homunculus.level;
  3582.  		case BL_MER: return ((TBL_MER*)bl)->db->lv;
  3583.  		case BL_ELEM: return ((TBL_ELEM*)bl)->db->lv;
  3584. +		default:
  3585. +		    ShowError("Invalide type=%d in status_get_lv\n",bl->type);
  3586.  	}
  3587.  	return 1;
  3588.  }
  3589. @@ -5265,6 +5287,8 @@
  3590.  			if (((TBL_ELEM*)bl)->master)
  3591.  				return ((TBL_ELEM*)bl)->master->status.party_id;
  3592.  			break;
  3593. +		default:
  3594. +			ShowWarning("Invalid bl type=%x in status_get_party_id\n",bl->type);
  3595.  	}
  3596.  	return 0;
  3597.  }
  3598. @@ -5305,6 +5329,9 @@
  3599.  			if (((TBL_ELEM*)bl)->master)
  3600.  				return ((TBL_ELEM*)bl)->master->status.guild_id;
  3601.  			break;
  3602. +		default:
  3603. +			ShowWarning("Invalid bl type=%x in status_get_guild_id\n",bl->type);
  3604. +
  3605.  	}
  3606.  	return 0;
  3607.  }
  3608. @@ -5346,6 +5373,9 @@
  3609.  			if (((TBL_ELEM*)bl)->master)
  3610.  				return ((TBL_ELEM*)bl)->master->guild_emblem_id;
  3611.  			break;
  3612. +		default:
  3613. +			ShowWarning("Invalid bl type=%x in status_get_emblem_id\n",bl->type);
  3614. +
  3615.  	}
  3616.  	return 0;
  3617.  }
  3618. @@ -5353,19 +5383,23 @@
  3619.  int status_get_mexp(struct block_list *bl)
  3620.  {
  3621.  	nullpo_ret(bl);
  3622. -	if(bl->type==BL_MOB)
  3623. -		return ((struct mob_data *)bl)->db->mexp;
  3624. -	if(bl->type==BL_PET)
  3625. -		return ((struct pet_data *)bl)->db->mexp;
  3626. +	switch(bl->type){
  3627. +	    case BL_MOB: return ((struct mob_data *)bl)->db->mexp;
  3628. +	    case BL_PET: return ((struct pet_data *)bl)->db->mexp;
  3629. +	    default:
  3630. +		ShowWarning("Invalid bl type=%x in status_get_mexp\n",bl->type);
  3631. +	}
  3632.  	return 0;
  3633.  }
  3634.  int status_get_race2(struct block_list *bl)
  3635.  {
  3636.  	nullpo_ret(bl);
  3637. -	if(bl->type == BL_MOB)
  3638. -		return ((struct mob_data *)bl)->db->race2;
  3639. -	if(bl->type==BL_PET)
  3640. -		return ((struct pet_data *)bl)->db->race2;
  3641. +	switch(bl->type){
  3642. +	    case BL_MOB: return ((struct mob_data *)bl)->db->race2;
  3643. +	    case BL_PET: return ((struct pet_data *)bl)->db->race2;
  3644. +	    default:
  3645. +		ShowWarning("Invalid bl type=%x in status_get_race2\n",bl->type);
  3646. +	}
  3647.  	return 0;
  3648.  }
  3649.  
  3650. @@ -5398,6 +5432,8 @@
  3651.  		case BL_HOM: return ((TBL_HOM*)bl)->vd;
  3652.  		case BL_MER: return ((TBL_MER*)bl)->vd;
  3653.  		case BL_ELEM: return ((TBL_ELEM*)bl)->vd;
  3654. +		default:
  3655. +		ShowWarning("Invalid bl type=%x in status_get_viewdata\n",bl->type);
  3656.  	}
  3657.  	return NULL;
  3658.  }
  3659. @@ -5531,7 +5567,9 @@
  3660.  			else
  3661.  				ShowError("status_set_viewdata (ELEMENTAL): No view data for class %d\n", class_);
  3662.  		}
  3663. -		break;			
  3664. +		break;
  3665. +	default:
  3666. +	    ShowWarning("Invalid bl type=%x in status_set_viewdata\n",bl->type);
  3667.  	}
  3668.  	vd = status_get_viewdata(bl);
  3669.  	if (vd && vd->cloth_color && (
  3670. @@ -5552,6 +5590,8 @@
  3671.  		case BL_HOM: return &((TBL_HOM*)bl)->sc;
  3672.  		case BL_MER: return &((TBL_MER*)bl)->sc;
  3673.  		case BL_ELEM: return &((TBL_ELEM*)bl)->sc;
  3674. +		default:
  3675. +	    	ShowWarning("invalide bl type=%x in status_get_sc\n");
  3676.  	}
  3677.  	return NULL;
  3678.  }
  3679. @@ -5608,6 +5648,8 @@
  3680.  			case SC__UNLUCKY:
  3681.  			case SC__WEAKNESS:
  3682.  				return 0;
  3683. +		    default: //let.s continue if not
  3684. +			break;
  3685.  		}
  3686.  
  3687.  	sd = BL_CAST(BL_PC,bl);
  3688. @@ -5735,8 +5777,9 @@
  3689.  		}
  3690.  	}
  3691.  
  3692. -	if (sc) {
  3693. -		if (sc->data[SC_SCRESIST])
  3694. +	if( sc && sc->count )
  3695. +	{
  3696. +		if( sc->data[SC_SCRESIST] )
  3697.  			sc_def += sc->data[SC_SCRESIST]->val1; //Status resist
  3698.  		else if (sc->data[SC_SIEGFRIED])
  3699.  			sc_def += sc->data[SC_SIEGFRIED]->val3; //Status resistance.
  3700. @@ -5842,6 +5885,7 @@
  3701.  		case SC_DEEPSLEEP:
  3702.  		case SC_MANDRAGORA:
  3703.  			return 0;
  3704. +		default: break; //continue
  3705.  		}
  3706.  	}
  3707.  	else if( sc->data[SC_INSPIRATION] ) {
  3708. @@ -5865,6 +5909,7 @@
  3709.  			case SC__BODYPAINT:
  3710.  			case SC__IGNORANCE:
  3711.  				return 0;
  3712. +			default: break; //continue
  3713.  		}
  3714.  	}
  3715.  
  3716. @@ -6174,6 +6219,7 @@
  3717.  			case SC_MAGNETICFIELD:
  3718.  
  3719.  				return 0;
  3720. +			default: break; //continue
  3721.  		}
  3722.  	}
  3723.  
  3724. @@ -6376,6 +6422,7 @@
  3725.  		if( type != SC_GT_CHANGE )
  3726.  			status_change_end(bl, SC_GT_CHANGE, INVALID_TIMER);
  3727.  		break;
  3728. +		default: break; //our status doesn't end another one continue
  3729.  	}
  3730.  
  3731.  	//Check for overlapping fails
  3732. @@ -6738,7 +6785,7 @@
  3733.  			status_zap(bl, diff, 0);
  3734.  		}
  3735.  		// fall through
  3736. -		case SC_POISON:				/* “Å */
  3737. +		case SC_POISON:				/* ᅵᅵ */
  3738.  		val3 = tick/1000; //Damage iterations
  3739.  		if(val3 < 1) val3 = 1;
  3740.  		tick_time = 1000; // [GodLesZ] tick time
  3741. @@ -6811,7 +6858,7 @@
  3742.  			else
  3743.  				val4 |= battle_config.monster_cloak_check_type&7;
  3744.  			break;
  3745. -		case SC_SIGHT:			/* ƒTƒCƒg/ƒ‹ƒAƒt */
  3746. +		case SC_SIGHT:			/* ᅵTᅵCᅵg/ᅵᅵᅵAᅵt */
  3747.  		case SC_RUWACH:
  3748.  		case SC_SIGHTBLASTER:
  3749.  			val3 = skill_get_splash(val2, val1); //Val2 should bring the skill-id.
  3750. @@ -7873,6 +7920,7 @@
  3751.  			if (battle_config.sc_castcancel&bl->type)
  3752.  				unit_skillcastcancel(bl, 0);
  3753.  		break;
  3754. +		default: break; //continue
  3755.  	}
  3756.  
  3757.  	// Set option as needed.
  3758. @@ -8149,6 +8197,7 @@
  3759.  		case SC_RAISINGDRAGON:
  3760.  			sce->val2 = status->max_hp / 100;// Officially tested its 1%hp drain. [Jobbie]
  3761.  			break;
  3762. +		default: break; //continue
  3763.  	}
  3764.  
  3765.  	if( opt_flag&2 && sd && sd->touching_id )
  3766. @@ -8157,7 +8206,8 @@
  3767.  	return 1;
  3768.  }
  3769.  /*==========================================
  3770. - * ƒXƒe[ƒ^ƒXˆÙí‘S‰ðœ
  3771. + * Ending all status except those listed.
  3772. + * @TODO maybe usefull for dispel instead reseting a liste there.
  3773.   * type:
  3774.   * 0 - ???
  3775.   * 1 - ???
  3776. @@ -8246,7 +8296,7 @@
  3777.  }
  3778.  
  3779.  /*==========================================
  3780. - * ƒXƒe[ƒ^ƒXˆÙíI—¹
  3781. + * Special condition we want to effectuate, check before ending a status.
  3782.   *------------------------------------------*/
  3783.  int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const char* file, int line)
  3784.  {
  3785. @@ -8294,6 +8344,7 @@
  3786.  				sce->timer = add_timer(gettick()+10, status_change_timer, bl->id, type);
  3787.  				return 1;
  3788.  			}
  3789. +			default: break; //continue
  3790.  		}
  3791.  	}
  3792.  
  3793. @@ -8629,7 +8680,7 @@
  3794.  				struct unit_data *ud = unit_bl2ud(bl);
  3795.  				if (ud) {
  3796.  					ud->state.running = 0;
  3797. -					if (ud->walktimer != -1)
  3798. +					if (ud->walktimer != INVALID_TIMER)
  3799.  						unit_stop_walking(bl,1);
  3800.  				}
  3801.  			}
  3802. @@ -8689,6 +8740,7 @@
  3803.  		case SC_CURSEDCIRCLE_TARGET:		
  3804.  			clif_bladestop(bl, sce->val2, 0);
  3805.  			break;
  3806. +		default: break; //continue
  3807.  		}
  3808.  
  3809.  	opt_flag = 1;
  3810. @@ -8912,7 +8964,8 @@
  3811.  }
  3812.  
  3813.  /*==========================================
  3814. - * ƒXƒe[ƒ^ƒXˆÙíI—¹ƒ^ƒCƒ}[
  3815. + * For recusive status, like for each 5s we drop sp etc.
  3816. + * Reseting the end timer. 
  3817.   *------------------------------------------*/
  3818.  int status_change_timer(int tid, unsigned int tick, int id, intptr_t data)
  3819.  {
  3820. @@ -9108,7 +9161,7 @@
  3821.  		}
  3822.  		break;
  3823.  
  3824. -	case SC_DANCING: //ƒ_ƒ“ƒXƒXƒLƒ‹‚ÌŽžŠÔSPÁ”ï
  3825. +	case SC_DANCING: //ᅵ_ᅵᅵᅵXᅵXᅵLᅵᅵᅵ̎ᅵᅵᅵSPᅵᅵᅵᅵ
  3826.  		{
  3827.  			int s = 0;
  3828.  			int sp = 1;
  3829. @@ -9661,8 +9714,8 @@
  3830.  		{
  3831.  			struct block_list *s_bl = battle_get_master(bl);
  3832.  			if( s_bl )
  3833. -				status_change_end(s_bl,type+1,INVALID_TIMER);
  3834. -			status_change_end(bl,type,INVALID_TIMER);
  3835. +				status_change_end(s_bl,type+1, INVALID_TIMER);
  3836. +			status_change_end(bl,type, INVALID_TIMER);
  3837.  			break;
  3838.  		}
  3839.  		sc_timer_next(2000 + tick, status_change_timer, bl->id, data);
  3840. @@ -9690,6 +9743,7 @@
  3841.  		/* they only end by status_change_end */
  3842.  		sc_timer_next(600000 + tick, status_change_timer, bl->id, data);
  3843.  		return 0;
  3844. +	default: break; //continue
  3845.  	}
  3846.  
  3847.  	// default for all non-handled control paths is to end the status
  3848. @@ -9698,7 +9752,7 @@
  3849.  }
  3850.  
  3851.  /*==========================================
  3852. - * ƒXƒe[ƒ^ƒXˆÙíƒ^ƒCƒ}[”͈͏ˆ—
  3853. + * ï¿œXï¿œeï¿œ[ï¿œ^ï¿œXᅵُᅵ^ï¿œCï¿œ}ï¿œ[ᅵ͈͏ᅵᅵᅵ
  3854.   *------------------------------------------*/
  3855.  int status_change_timer_sub(struct block_list* bl, va_list ap)
  3856.  {
  3857. @@ -9715,7 +9769,7 @@
  3858.  	tsc = status_get_sc(bl);
  3859.  
  3860.  	switch( type ) {
  3861. -	case SC_SIGHT:	/* ƒTƒCƒg */
  3862. +	case SC_SIGHT:	/* Reveal hidden ennemy on 3*3 range */
  3863.  	case SC_CONCENTRATE:
  3864.  		status_change_end(bl, SC_HIDING, INVALID_TIMER);
  3865.  		status_change_end(bl, SC_CLOAKING, INVALID_TIMER);
  3866. @@ -9723,7 +9777,7 @@
  3867.  		status_change_end(bl, SC_CAMOUFLAGE, INVALID_TIMER);
  3868.  		status_change_end(bl, SC__INVISIBILITY, INVALID_TIMER);
  3869.  		break;
  3870. -	case SC_RUWACH:	/* ƒ‹ƒAƒt */
  3871. +	case SC_RUWACH:	/* Reveal hidden target and deal little dammages if ennemy */
  3872.  		if (tsc && (tsc->data[SC_HIDING] || tsc->data[SC_CLOAKING] ||
  3873.  				tsc->data[SC_CAMOUFLAGE] || tsc->data[SC_CLOAKINGEXCEED] ||
  3874.  					tsc->data[SC__INVISIBILITY])) {
  3875. @@ -9756,6 +9810,8 @@
  3876.  			status_change_end(bl, type, INVALID_TIMER);
  3877.  		}
  3878.  		break;
  3879. +	 default:
  3880. +	     ShowWarning("Invalid statuc sc=%d in status_change_timer_sub\n",type);
  3881.  	}
  3882.  	return 0;
  3883.  }
  3884. @@ -10203,8 +10259,7 @@
  3885.  
  3886.  	class_ = atoi(fields[0]);
  3887.  
  3888. -	if(!pcdb_checkid(class_))
  3889. -	{
  3890. +	if(!pcdb_checkid(class_)) {
  3891.  		ShowWarning("status_readdb_job1: Invalid job class %d specified.\n", class_);
  3892.  		return false;
  3893.  	}
  3894. @@ -10337,7 +10392,7 @@
  3895.  }
  3896.  
  3897.  /*==========================================
  3898. - * ƒXƒLƒ‹ŠÖŒW‰Šú‰»ˆ—
  3899. + * Creation et destruction de la db des status.
  3900.   *------------------------------------------*/
  3901.  int do_init_status(void)
  3902.  {
  3903. Index: src/map/status.h
  3904. ===================================================================
  3905. --- src/map/status.h	(revision 16039)
  3906. +++ src/map/status.h	(working copy)
  3907. @@ -1279,7 +1279,7 @@
  3908.  	BREAK_SHOULDER = 0x08, // DEF reduced by 50%
  3909.  	BREAK_WAIST    = 0x10, // DEF reduced by 25%, ATK reduced by 25%
  3910.  	BREAK_NECK     = 0x20, // current attack does 2x damage, inflicts 'bleeding' for 30 seconds
  3911. -	BREAK_FLAGS    = BREAK_ANKLE | BREAK_WRIST | BREAK_KNEE | BREAK_SHOULDER | BREAK_WAIST | BREAK_NECK,
  3912. +	BREAK_FLAGS    = (BREAK_ANKLE | BREAK_WRIST | BREAK_KNEE | BREAK_SHOULDER | BREAK_WAIST | BREAK_NECK),
  3913.  };
  3914.  
  3915.  extern int current_equip_item_index;
  3916. @@ -1388,8 +1388,8 @@
  3917.  	OPTION_DRAGON5   = 0x04000000,
  3918.  	OPTION_MOUNTING  = 0x08000000,//dull name (cuz ind named it :/)
  3919.  	// compound constants
  3920. -	OPTION_CART      = OPTION_CART1|OPTION_CART2|OPTION_CART3|OPTION_CART4|OPTION_CART5,
  3921. -	OPTION_DRAGON    = OPTION_DRAGON1|OPTION_DRAGON2|OPTION_DRAGON3|OPTION_DRAGON4|OPTION_DRAGON5,
  3922. +	OPTION_CART      = (OPTION_CART1|OPTION_CART2|OPTION_CART3|OPTION_CART4|OPTION_CART5),
  3923. +	OPTION_DRAGON    = (OPTION_DRAGON1|OPTION_DRAGON2|OPTION_DRAGON3|OPTION_DRAGON4|OPTION_DRAGON5),
  3924.  	OPTION_MASK      = ~OPTION_INVISIBLE,
  3925.  };
  3926.  
  3927. Index: src/map/trade.c
  3928. ===================================================================
  3929. --- src/map/trade.c	(revision 16039)
  3930. +++ src/map/trade.c	(working copy)
  3931. @@ -500,7 +500,7 @@
  3932.  }
  3933.  
  3934.  /*==========================================
  3935. - * Žæˆø‹–‘ø(trade‰Ÿ‚µ)
  3936. + * Trading license (press trade)
  3937.   *------------------------------------------*/
  3938.  void trade_tradecommit(struct map_session_data *sd)
  3939.  {
  3940. Index: src/map/pc.c
  3941. ===================================================================
  3942. --- src/map/pc.c	(revision 16039)
  3943. +++ src/map/pc.c	(working copy)
  3944. @@ -47,7 +47,7 @@
  3945.  #include <time.h>
  3946.  
  3947.  
  3948. -#define PVP_CALCRANK_INTERVAL 1000	// PVP‡ˆÊŒvŽZ‚ÌŠÔŠu
  3949. +#define PVP_CALCRANK_INTERVAL 1000	// PVP calculation interval
  3950.  static unsigned int exp_table[CLASS_COUNT][2][MAX_LEVEL];
  3951.  static unsigned int max_level[CLASS_COUNT][2];
  3952.  static unsigned int statp[MAX_LEVEL+1];
  3953. @@ -277,6 +277,7 @@
  3954.  
  3955.  	return 0;
  3956.  }
  3957. +
  3958.  int pc_banding(struct map_session_data *sd, short skill_lv) {
  3959.  	int c;
  3960.  	int b_sd[MAX_PARTY]; // In case of a full Royal Guard party.
  3961. @@ -558,7 +559,7 @@
  3962.  }
  3963.  
  3964.  /*==========================================
  3965. - * Ú?Žb̏‰Šú‰?
  3966. + * Off init ? Connection?
  3967.   *------------------------------------------*/
  3968.  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)
  3969.  {
  3970. @@ -832,10 +833,15 @@
  3971.  	return false; // Job Change Fail
  3972.  }
  3973.  
  3974. +/*=================================================
  3975. +* Can the player equip the item at index n in inventory
  3976. +* return
  3977. +*	0 = no
  3978. +*	1 = yes
  3979. +*------------------------------------------------*/
  3980.  int pc_isequip(struct map_session_data *sd,int n)
  3981.  {
  3982.  	struct item_data *item;
  3983. -	//?¶‚â—{Žq‚̏ꍇ‚ÌŒ³‚̐E‹Æ‚ðŽZo‚·‚é
  3984.  
  3985.  	nullpo_ret(sd);
  3986.  
  3987. @@ -865,8 +871,7 @@
  3988.  			return 0;
  3989.  	}
  3990.  
  3991. -	if (sd->sc.count) {
  3992. -			
  3993. +	if (sd->sc.count) {		
  3994.  		if(item->equip & EQP_ARMS && item->type == IT_WEAPON && sd->sc.data[SC_STRIPWEAPON]) // Also works with left-hand weapons [DracoRPG]
  3995.  			return 0;
  3996.  		if(item->equip & EQP_SHIELD && item->type == IT_ARMOR && sd->sc.data[SC_STRIPSHIELD])
  3997. @@ -910,8 +915,8 @@
  3998.  }
  3999.  
  4000.  /*==========================================
  4001. - * session id‚É–â‘è–³‚µ
  4002. - * charŽI‚©‚ç‘—‚ç‚ê‚Ä‚«‚œƒXƒe?ƒ^ƒX‚ðÝ’è
  4003. + * No problem with the session id
  4004. + * set the status that has been sent from char server
  4005.   *------------------------------------------*/
  4006.  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)
  4007.  {
  4008. @@ -1025,7 +1030,7 @@
  4009.  	for( i = 0; i < 3; i++ )
  4010.  		sd->hate_mob[i] = -1;
  4011.  
  4012. -	// ˆÊ’u‚̐ݒè
  4013. +	//warp player
  4014.  	if ((i=pc_setpos(sd,sd->status.last_point.map, sd->status.last_point.x, sd->status.last_point.y, CLR_OUTSIGHT)) != 0) {
  4015.  		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);
  4016.  
  4017. @@ -1195,6 +1200,7 @@
  4018.  			sd->status.skill[sd->reproduceskill_id].flag = SKILL_FLAG_PLAGIARIZED;
  4019.  		}
  4020.  	}
  4021. +
  4022.  	//Weird... maybe registries were reloaded?
  4023.  	if (sd->state.active)
  4024.  		return 0;
  4025. @@ -1265,7 +1271,7 @@
  4026.  
  4027.  
  4028.  /*==========================================
  4029. - * ?‚Š‚ç‚ê‚éƒXƒLƒ‹‚ÌŒvŽZ
  4030. + * Calculation of Skills lvls
  4031.   *------------------------------------------*/
  4032.  int pc_calc_skilltree(struct map_session_data *sd)
  4033.  {
  4034. @@ -1282,22 +1288,20 @@
  4035.  	}
  4036.  	c = pc_class2idx(c);
  4037.  
  4038. -	for( i = 0; i < MAX_SKILL; i++ )
  4039. -	{ 
  4040. -		if( sd->status.skill[i].flag != SKILL_FLAG_PLAGIARIZED ) //Don't touch plagiarized skills
  4041. +	for (i = 0; i < MAX_SKILL; i++) { 
  4042. +		if (sd->status.skill[i].flag != SKILL_FLAG_PLAGIARIZED) //Don't touch plagiarized skills
  4043.  			sd->status.skill[i].id = 0; //First clear skills.
  4044.  	}
  4045.  
  4046. -	for( i = 0; i < MAX_SKILL; i++ )
  4047. -	{ 
  4048. -		if( sd->status.skill[i].flag != SKILL_FLAG_PERMANENT && sd->status.skill[i].flag != SKILL_FLAG_PLAGIARIZED )
  4049. -		{ // Restore original level of skills after deleting earned skills.
  4050. +	for (i = 0; i < MAX_SKILL; i++) { 
  4051. +		if (sd->status.skill[i].flag != SKILL_FLAG_PERMANENT && sd->status.skill[i].flag != SKILL_FLAG_PLAGIARIZED) {
  4052. +			// Restore original level of skills after deleting earned skills.	
  4053.  			sd->status.skill[i].lv = (sd->status.skill[i].flag == SKILL_FLAG_TEMPORARY) ? 0 : sd->status.skill[i].flag - SKILL_FLAG_REPLACED_LV_0;
  4054.  			sd->status.skill[i].flag = SKILL_FLAG_PERMANENT;
  4055.  		}
  4056.  
  4057. -		if( sd->sc.count && sd->sc.data[SC_SPIRIT] && sd->sc.data[SC_SPIRIT]->val2 == SL_BARDDANCER && i >= DC_HUMMING && i<= DC_SERVICEFORYOU )
  4058. -		{ //Enable Bard/Dancer spirit linked skills.
  4059. +		if (sd->sc.count && sd->sc.data[SC_SPIRIT] && sd->sc.data[SC_SPIRIT]->val2 == SL_BARDDANCER && i >= DC_HUMMING && i<= DC_SERVICEFORYOU) {
  4060. +			//Enable Bard/Dancer spirit linked skills.
  4061.  			if( sd->status.sex )
  4062.  			{ //Link dancer skills to bard.
  4063.  				if( sd->status.skill[i-8].lv < 10 )
  4064. @@ -1368,8 +1372,7 @@
  4065.  					{
  4066.  						if (sd->status.skill[k].id == 0 || sd->status.skill[k].flag == SKILL_FLAG_TEMPORARY || sd->status.skill[k].flag == SKILL_FLAG_PLAGIARIZED)
  4067.  							k = 0; //Not learned.
  4068. -						else
  4069. -						if (sd->status.skill[k].flag >= SKILL_FLAG_REPLACED_LV_0) //Real lerned level
  4070. +						else if (sd->status.skill[k].flag >= SKILL_FLAG_REPLACED_LV_0) //Real learned level
  4071.  							k = sd->status.skill[skill_tree[c][i].need[j].id].flag - SKILL_FLAG_REPLACED_LV_0;
  4072.  						else
  4073.  							k = pc_checkskill(sd,k);
  4074. @@ -1448,6 +1451,7 @@
  4075.  
  4076.  	if(battle_config.skillfree)
  4077.  		return; //Function serves no purpose if this is set
  4078. +    nullpo_retv(sd);
  4079.  
  4080.  	i = pc_calc_skilltree_normalize_job(sd);
  4081.  	c = pc_mapid2jobid(i, sd->status.sex);
  4082. @@ -1471,8 +1475,7 @@
  4083.  				{
  4084.  					if( sd->status.skill[k].id == 0 || sd->status.skill[k].flag == SKILL_FLAG_TEMPORARY || sd->status.skill[k].flag == SKILL_FLAG_PLAGIARIZED )
  4085.  						k = 0; //Not learned.
  4086. -					else
  4087. -					if( sd->status.skill[k].flag >= SKILL_FLAG_REPLACED_LV_0) //Real lerned level
  4088. +					else if( sd->status.skill[k].flag >= SKILL_FLAG_REPLACED_LV_0) //Real learned level
  4089.  						k = sd->status.skill[skill_tree[c][i].need[j].id].flag - SKILL_FLAG_REPLACED_LV_0;
  4090.  					else
  4091.  						k = pc_checkskill(sd,k);
  4092. @@ -1513,9 +1516,7 @@
  4093.  			sd->status.skill[i].id = 0;
  4094.  			sd->status.skill[i].lv = 0;
  4095.  			sd->status.skill[i].flag = 0;
  4096. -		}
  4097. -		else
  4098. -		if (sd->status.skill[i].flag >= SKILL_FLAG_REPLACED_LV_0){
  4099. +		} else if (sd->status.skill[i].flag >= SKILL_FLAG_REPLACED_LV_0) {
  4100.  			sd->status.skill[i].lv = sd->status.skill[i].flag - SKILL_FLAG_REPLACED_LV_0;
  4101.  			sd->status.skill[i].flag = 0;
  4102.  		}
  4103. @@ -3327,7 +3328,7 @@
  4104.  	return 1;
  4105.  }
  4106.  /*==========================================
  4107. - * ƒJ?ƒh?“ü
  4108. + * Append a cart to an item ?
  4109.   *------------------------------------------*/
  4110.  int pc_insert_card(struct map_session_data* sd, int idx_card, int idx_equip)
  4111.  {
  4112. @@ -3382,18 +3383,18 @@
  4113.  }
  4114.  
  4115.  //
  4116. -// ƒAƒCƒeƒ€•š
  4117. +// Items
  4118.  //
  4119.  
  4120.  /*==========================================
  4121. - * ƒXƒLƒ‹‚É‚æ‚锃‚¢’lC³
  4122. + * Correction buying value by skills
  4123.   *------------------------------------------*/
  4124.  int pc_modifybuyvalue(struct map_session_data *sd,int orig_value)
  4125.  {
  4126.  	int skill,val = orig_value,rate1 = 0,rate2 = 0;
  4127. -	if((skill=pc_checkskill(sd,MC_DISCOUNT))>0)	// ƒfƒBƒXƒJƒEƒ“ƒg
  4128. +	if((skill=pc_checkskill(sd,MC_DISCOUNT))>0)	// merchant discount
  4129.  		rate1 = 5+skill*2-((skill==10)? 1:0);
  4130. -	if((skill=pc_checkskill(sd,RG_COMPULSION))>0)	// ƒRƒ€ƒpƒ‹ƒVƒ‡ƒ“ƒfƒBƒXƒJƒEƒ“ƒg
  4131. +	if((skill=pc_checkskill(sd,RG_COMPULSION))>0)	// rogue discount
  4132.  		rate2 = 5+skill*4;
  4133.  	if(rate1 < rate2) rate1 = rate2;
  4134.  	if(rate1)
  4135. @@ -3405,12 +3406,12 @@
  4136.  }
  4137.  
  4138.  /*==========================================
  4139. - * ƒXƒLƒ‹‚É‚æ‚é?‚è’lC³
  4140. + * Correction selling value by skills
  4141.   *------------------------------------------*/
  4142.  int pc_modifysellvalue(struct map_session_data *sd,int orig_value)
  4143.  {
  4144.  	int skill,val = orig_value,rate = 0;
  4145. -	if((skill=pc_checkskill(sd,MC_OVERCHARGE))>0)	// ƒI?ƒo?ƒ`ƒƒ?ƒW
  4146. +	if((skill=pc_checkskill(sd,MC_OVERCHARGE))>0)	//OverCharge ?
  4147.  		rate = 5+skill*2-((skill==10)? 1:0);
  4148.  	if(rate)
  4149.  		val = (int)((double)orig_value*(double)(100+rate)/100.);
  4150. @@ -3421,8 +3422,8 @@
  4151.  }
  4152.  
  4153.  /*==========================================
  4154. - * ƒAƒCƒeƒ€‚𔃂Á‚œŽbɁAV‚µ‚¢ƒAƒCƒeƒ€—“‚ðŽg‚€‚©A
  4155. - * 3–œŒÂ§ŒÀ‚É‚©‚©‚é‚©Šm”F
  4156. + * Checking if we have enough place on inventory for new item
  4157. + * Make sure to take 30,000 limit
  4158.   *------------------------------------------*/
  4159.  int pc_checkadditem(struct map_session_data *sd,int nameid,int amount)
  4160.  {
  4161. @@ -3449,7 +3450,8 @@
  4162.  }
  4163.  
  4164.  /*==========================================
  4165. - * ‹ó‚«ƒAƒCƒeƒ€—“‚ÌŒÂ?
  4166. + * Return number of available place in inventory
  4167. + * Each non stackable item will reduce place by 1
  4168.   *------------------------------------------*/
  4169.  int pc_inventoryblank(struct map_session_data *sd)
  4170.  {
  4171. @@ -3544,9 +3546,8 @@
  4172.  			ShowWarning("pc_getcash: Cash point overflow (cash=%d, have cash=%d, account_id=%d, char_id=%d).\n", cash, sd->cashPoints, sd->status.account_id, sd->status.char_id);
  4173.  			cash = MAX_ZENY-sd->cashPoints;
  4174.  		}
  4175. +		pc_setaccountreg(sd,"#CASHPOINTS",sd->cashPoints + cash);
  4176.  
  4177. -		pc_setaccountreg(sd, "#CASHPOINTS", sd->cashPoints+cash);
  4178. -
  4179.  		if( battle_config.cashshop_show_points )
  4180.  		{
  4181.  			sprintf(output, msg_txt(505), cash, sd->cashPoints);
  4182. @@ -3609,7 +3610,7 @@
  4183.  }
  4184.  
  4185.  /*==========================================
  4186. - * ƒAƒCƒeƒ€‚ð’T‚µ‚āAƒCƒ“ƒfƒbƒNƒX‚ð•Ô‚·
  4187. + * Searching a specified itemid in inventory and return his stored index
  4188.   *------------------------------------------*/
  4189.  int pc_search_inventory(struct map_session_data *sd,int item_id)
  4190.  {
  4191. @@ -3621,7 +3622,14 @@
  4192.  }
  4193.  
  4194.  /*==========================================
  4195. - * ƒAƒCƒeƒ€’ljÁBŒÂ?‚Ì‚Ýitem\‘¢?‚Ì?Žš‚𖳎‹
  4196. + * Attempt tp add a new item in inventory
  4197. + * return
  4198. + 	0 = success
  4199. + 	1 = invalid itemid not found or negative amount
  4200. +	2 = overweight
  4201. +	4 = no free place found
  4202. +	5 = max amount reached
  4203. +	
  4204.   *------------------------------------------*/
  4205.  int pc_additem(struct map_session_data *sd,struct item *item_data,int amount,e_log_pick_type log_type)
  4206.  {
  4207. @@ -3692,7 +3700,10 @@
  4208.  }
  4209.  
  4210.  /*==========================================
  4211. - * ƒAƒCƒeƒ€‚ðŒž‚ç‚·
  4212. + * Remove an item at index n from inventory by amount
  4213. + * return
  4214. + *	0 = succes
  4215. + *	1 = invalid itemid or negative amount	
  4216.   *------------------------------------------*/
  4217.  int pc_delitem(struct map_session_data *sd,int n,int amount,int type, short reason, e_log_pick_type log_type)
  4218.  {
  4219. @@ -3720,7 +3731,10 @@
  4220.  }
  4221.  
  4222.  /*==========================================
  4223. - * ƒAƒCƒeƒ€‚ð—Ž‚·
  4224. + * Attempt to drop an item
  4225. + * return
  4226. + *	0 = fail
  4227. + *	1 = success
  4228.   *------------------------------------------*/
  4229.  int pc_dropitem(struct map_session_data *sd,int n,int amount)
  4230.  {
  4231. @@ -3761,7 +3775,10 @@
  4232.  }
  4233.  
  4234.  /*==========================================
  4235. - * ƒAƒCƒeƒ€‚ðE‚€
  4236. + * Attempt to pickup an item
  4237. + * return
  4238. + *	0 = fail
  4239. + *	1 = success
  4240.   *------------------------------------------*/
  4241.  int pc_takeitem(struct map_session_data *sd,struct flooritem_data *fitem)
  4242.  {
  4243. @@ -3774,7 +3791,7 @@
  4244.  	nullpo_ret(fitem);
  4245.  
  4246.  	if(!check_distance_bl(&fitem->bl, &sd->bl, 2) && sd->ud.skillid!=BS_GREED)
  4247. -		return 0;	// ‹——£‚ª‰“‚¢
  4248. +		return 0;	// Distance is too far
  4249.  
  4250.  	if (sd->status.party_id)
  4251.  		p = party_search(sd->status.party_id);
  4252. @@ -3828,6 +3845,12 @@
  4253.  	return 1;
  4254.  }
  4255.  
  4256. +/*==========================================
  4257. + * Can we use the item  ?
  4258. + * Return
  4259. + *	0 = no
  4260. + *	1 = yes 
  4261. + *------------------------------------------*/
  4262.  int pc_isUseitem(struct map_session_data *sd,int n)
  4263.  {
  4264.  	struct item_data *item;
  4265. @@ -3846,7 +3869,7 @@
  4266.  	if( !item->script ) //if it has no script, you can't really consume it!
  4267.  		return 0;
  4268.  
  4269. -	switch( nameid )
  4270. +	switch( nameid ) //lot of harcoded nameid here, need to be removed [Lighta]
  4271.  	{
  4272.  		case 605: // Anodyne
  4273.  			if( map_flag_gvg(sd->bl.m) )
  4274. @@ -3983,7 +4006,10 @@
  4275.  }
  4276.  
  4277.  /*==========================================
  4278. - * ƒAƒCƒeƒ€‚ðŽg‚€
  4279. + * Last checks et use item
  4280. + * return
  4281. + *	0 = fail
  4282. + *	1 = success
  4283.   *------------------------------------------*/
  4284.  int pc_useitem(struct map_session_data *sd,int n)
  4285.  {
  4286. @@ -4005,6 +4031,7 @@
  4287.  	)
  4288.  		return 0;
  4289.  
  4290. +        //Check if status forbid us
  4291.  	if( sd->sc.count && (
  4292.  		sd->sc.data[SC_BERSERK] ||
  4293.  		(sd->sc.data[SC_GRAVITATION] && sd->sc.data[SC_GRAVITATION]->val3 == BCT_SELF) ||
  4294. @@ -4102,7 +4129,10 @@
  4295.  }
  4296.  
  4297.  /*==========================================
  4298. - * ƒJ?ƒgƒAƒCƒeƒ€’ljÁBŒÂ?‚Ì‚Ýitem\‘¢?‚Ì?Žš‚𖳎‹
  4299. + * Add item on cart for given index
  4300. + * return
  4301. + *	0 = success
  4302. + *	1 = fail 
  4303.   *------------------------------------------*/
  4304.  int pc_cart_additem(struct map_session_data *sd,struct item *item_data,int amount,e_log_pick_type log_type)
  4305.  {
  4306. @@ -4162,7 +4192,10 @@
  4307.  }
  4308.  
  4309.  /*==========================================
  4310. - * ƒJ?ƒgƒAƒCƒeƒ€‚ðŒž‚ç‚·
  4311. + * Delete item on cart for given index
  4312. + * return
  4313. + *	0 = success
  4314. + *	1 = fail
  4315.   *------------------------------------------*/
  4316.  int pc_cart_delitem(struct map_session_data *sd,int n,int amount,int type,e_log_pick_type log_type)
  4317.  {
  4318. @@ -4189,7 +4222,10 @@
  4319.  }
  4320.  
  4321.  /*==========================================
  4322. - * ƒJ?ƒg‚ÖƒAƒCƒeƒ€ˆÚ“®
  4323. + * Transfert item from inventory to cart
  4324. + * return
  4325. + *	0 = fail
  4326. + *	1 = succes
  4327.   *------------------------------------------*/
  4328.  int pc_putitemtocart(struct map_session_data *sd,int idx,int amount)
  4329.  {
  4330. @@ -4212,7 +4248,10 @@
  4331.  }
  4332.  
  4333.  /*==========================================
  4334. - * ƒJ?ƒg?‚̃AƒCƒeƒ€?Šm”F(ŒÂ?‚̍·•ª‚ð•Ô‚·)
  4335. + * Get number of item on cart
  4336. + * return
  4337. + 	-1 = itemid not found or no amount found
  4338. +	x = remaining itemid on cart after get
  4339.   *------------------------------------------*/
  4340.  int pc_cartitem_amount(struct map_session_data* sd, int idx, int amount)
  4341.  {
  4342. @@ -4228,7 +4267,10 @@
  4343.  }
  4344.  
  4345.  /*==========================================
  4346. - * ƒJ?ƒg‚©‚çƒAƒCƒeƒ€ˆÚ“®
  4347. + * Retrieve an item at index idx from cart
  4348. + * return
  4349. + *	0 = player not found or (FIXME) succes (from pc_cart_delitem) 
  4350. + *	1 = failure
  4351.   *------------------------------------------*/
  4352.  int pc_getitemfromcart(struct map_session_data *sd,int idx,int amount)
  4353.  {
  4354. @@ -4252,7 +4294,7 @@
  4355.  }
  4356.  
  4357.  /*==========================================
  4358. - * ƒXƒeƒBƒ‹•iŒöŠJ
  4359. + *  Display item stolen msg to player sd
  4360.   *------------------------------------------*/
  4361.  int pc_show_steal(struct block_list *bl,va_list ap)
  4362.  {
  4363. @@ -4274,7 +4316,10 @@
  4364.  	return 0;
  4365.  }
  4366.  /*==========================================
  4367. - *
  4368. + * Stole an item from bl (mob)
  4369. + * return
  4370. + *	0 = fail
  4371. + *	1 = succes
  4372.   *------------------------------------------*/
  4373.  int pc_steal_item(struct map_session_data *sd,struct block_list *bl, int lv)
  4374.  {
  4375. @@ -4355,7 +4400,10 @@
  4376.  }
  4377.  
  4378.  /*==========================================
  4379. - *
  4380. + * Stole zeny from bl (mob)
  4381. + * return
  4382. + *	0 = fail
  4383. + *	1 = success	
  4384.   *------------------------------------------*/
  4385.  int pc_steal_coin(struct map_session_data *sd,struct block_list *target)
  4386.  {
  4387. @@ -4544,7 +4592,11 @@
  4388.  }
  4389.  
  4390.  /*==========================================
  4391. - * PC‚̃‰ƒ“ƒ_ƒ€ƒ?ƒv
  4392. + * Warp player sd to random location on current map
  4393. + * may fail if no Cell walkable found (1000 attempt)
  4394. + * return
  4395. + *	0 = fail or FIXME succes (from pc_setpos)
  4396. + *  x(1|2) = fail
  4397.   *------------------------------------------*/
  4398.  int pc_randomwarp(struct map_session_data *sd, clr_type type)
  4399.  {
  4400. @@ -4555,7 +4607,7 @@
  4401.  
  4402.  	m=sd->bl.m;
  4403.  
  4404. -	if (map[sd->bl.m].flag.noteleport)	// ƒeƒŒƒ|?ƒg‹ÖŽ~
  4405. +	if (map[sd->bl.m].flag.noteleport) //Teleport forbiden
  4406.  		return 0;
  4407.  
  4408.  	do{
  4409. @@ -4619,14 +4671,16 @@
  4410.  }
  4411.  
  4412.  //
  4413. -// •Ší??
  4414. -//
  4415. +// Skills
  4416. +// 
  4417.  /*==========================================
  4418. - * ƒXƒLƒ‹‚Ì?õ Š—L‚µ‚Ä‚¢‚œê‡Lv‚ª•Ô‚é
  4419. + * Return player sd skilllv learned for given skill 
  4420.   *------------------------------------------*/
  4421.  int pc_checkskill(struct map_session_data *sd,int skill_id)
  4422.  {
  4423. -	if(sd == NULL) return 0;
  4424. +	if( sd == NULL )
  4425. +		return 0;
  4426. +
  4427.  	if( skill_id >= GD_SKILLBASE && skill_id < GD_MAX )
  4428.  	{
  4429.  		struct guild *g;
  4430. @@ -4648,13 +4702,8 @@
  4431.  }
  4432.  
  4433.  /*==========================================
  4434. - * •Ší?X‚É‚æ‚éƒXƒLƒ‹‚Ì??ƒ`ƒFƒbƒN
  4435. - * ˆø?F
  4436. - *   struct map_session_data *sd	ƒZƒbƒVƒ‡ƒ“ƒf?ƒ^
  4437. - *   int nameid						?”õ•iID
  4438. - * •Ô‚è’lF
  4439. - *   0		?X‚È‚µ
  4440. - *   -1		ƒXƒLƒ‹‚ð‰ðœ
  4441. + * Checking if player match condition for given skill and kill status if not
  4442. + * Status probably require for thoses skills (unsure)
  4443.   *------------------------------------------*/
  4444.  int pc_checkallowskill(struct map_session_data *sd)
  4445.  {
  4446. @@ -4700,7 +4749,8 @@
  4447.  }
  4448.  
  4449.  /*==========================================
  4450. - * ? ”õ•i‚̃`ƒFƒbƒN
  4451. + * Return equiped itemid? on player sd at pos
  4452. + * if -1 mean nothing equiped
  4453.   *------------------------------------------*/
  4454.  int pc_checkequip(struct map_session_data *sd,int pos)
  4455.  {
  4456. @@ -5370,7 +5420,7 @@
  4457.  {
  4458.  	int bonus = 0;
  4459.  	struct status_data *status = status_get_status_data(src);
  4460. -
  4461. +        nullpo_retv(sd);
  4462.  	if (sd->expaddrace[status->race])
  4463.  		bonus += sd->expaddrace[status->race];
  4464.  	bonus += sd->expaddrace[status->mode&MD_BOSS?RC_BOSS:RC_NONBOSS];
  4465. @@ -5392,7 +5442,7 @@
  4466.  	return;
  4467.  }
  4468.  /*==========================================
  4469. - * ??’lŽæ“Ÿ
  4470. + * Give x exp at sd player and calculate remaining exp for next lvl
  4471.   *------------------------------------------*/
  4472.  int pc_gainexp(struct map_session_data *sd, struct block_list *src, unsigned int base_exp,unsigned int job_exp,bool quest)
  4473.  {
  4474. @@ -5485,8 +5535,10 @@
  4475.  };
  4476.  
  4477.  /*==========================================
  4478. - * base level‘€•K—v??’lŒvŽZ
  4479. + * base level exp lookup.
  4480.   *------------------------------------------*/
  4481. +
  4482. +///How much bexp do player need for next level
  4483.  unsigned int pc_nextbaseexp(struct map_session_data *sd)
  4484.  {
  4485.  	nullpo_ret(sd);
  4486. @@ -5497,6 +5549,7 @@
  4487.  	return exp_table[pc_class2idx(sd->status.class_)][0][sd->status.base_level-1];
  4488.  }
  4489.  
  4490. +///How much bexp do player need for this level
  4491.  unsigned int pc_thisbaseexp(struct map_session_data *sd)
  4492.  {
  4493.  	if(sd->status.base_level>pc_maxbaselv(sd) || sd->status.base_level<=1)
  4494. @@ -5507,8 +5560,13 @@
  4495.  
  4496.  
  4497.  /*==========================================
  4498. - * job level‘€•K—v??’lŒvŽZ
  4499. + * job level exp lookup
  4500. + * return
  4501. + *	0 = not found
  4502. + *	x = exp for level
  4503.   *------------------------------------------*/
  4504. +
  4505. +///How much jexp do player need for next level
  4506.  unsigned int pc_nextjobexp(struct map_session_data *sd)
  4507.  {
  4508.  	nullpo_ret(sd);
  4509. @@ -5518,6 +5576,7 @@
  4510.  	return exp_table[pc_class2idx(sd->status.class_)][1][sd->status.job_level-1];
  4511.  }
  4512.  
  4513. +///How much jexp do player need for next level
  4514.  unsigned int pc_thisjobexp(struct map_session_data *sd)
  4515.  {
  4516.  	if(sd->status.job_level>pc_maxjoblv(sd) || sd->status.job_level<=1)
  4517. @@ -5687,7 +5746,8 @@
  4518.  }
  4519.  
  4520.  /*==========================================
  4521. - * ƒXƒLƒ‹ƒ|ƒCƒ“ƒgŠ„‚èU‚è
  4522. + * Update skilllv for player sd
  4523. + * Skill point allocation
  4524.   *------------------------------------------*/
  4525.  int pc_skillup(struct map_session_data *sd,int skill_num)
  4526.  {
  4527. @@ -5749,6 +5809,7 @@
  4528.  		}
  4529.  	}
  4530.  
  4531. +	//pc_calc_skilltree takes care of setting the ID to valid skills. [Skotlex]
  4532.  	if (pc_has_permission(sd, PC_PERM_ALL_SKILL))
  4533.  	{	//Get ALL skills except npc/guild ones. [Skotlex]
  4534.  		//and except SG_DEVIL [Komurka] and MO_TRIPLEATTACK and RG_SNATCHER [ultramage]
  4535. @@ -6001,7 +6062,7 @@
  4536.  		if( i == NV_TRICKDEAD && (sd->class_&MAPID_UPPERMASK) != MAPID_NOVICE )
  4537.  		{
  4538.  			sd->status.skill[i].lv = 0;
  4539. -			sd->status.skill[i].flag = 0;
  4540. +			sd->status.skill[i].flag = SKILL_FLAG_PERMANENT;
  4541.  			continue;
  4542.  		}
  4543.  
  4544. @@ -6176,6 +6237,9 @@
  4545.  	sd->canlog_tick = gettick();
  4546.  }
  4547.  
  4548. +/*==========================================
  4549. + * Invoked when a player have negative current hp
  4550. + *------------------------------------------*/
  4551.  int pc_dead(struct map_session_data *sd,struct block_list *src)
  4552.  {
  4553.  	int i=0,j=0,k=0;
  4554. @@ -6278,6 +6342,8 @@
  4555.  	break;
  4556.  	case BL_MER:
  4557.  		src = &((TBL_MER*)src)->master->bl;
  4558. +	    break;
  4559. +	default: //what should we do for other ??
  4560.  	break;
  4561.  	}
  4562.  
  4563. @@ -6498,10 +6564,11 @@
  4564.  	if(battle_config.pc_invincible_time > 0)
  4565.  		pc_setinvincibletimer(sd, battle_config.pc_invincible_time);
  4566.  }
  4567. -// script? ˜A
  4568.  //
  4569. +// script
  4570. +//
  4571.  /*==========================================
  4572. - * script—pPCƒXƒe?ƒ^ƒX?‚ݏo‚µ
  4573. + * script reading pc status registry
  4574.   *------------------------------------------*/
  4575.  int pc_readparam(struct map_session_data* sd,int type)
  4576.  {
  4577. @@ -6547,7 +6614,7 @@
  4578.  }
  4579.  
  4580.  /*==========================================
  4581. - * script—pPCƒXƒe?ƒ^ƒXÝ’è
  4582. + * script set pc status registry
  4583.   *------------------------------------------*/
  4584.  int pc_setparam(struct map_session_data *sd,int type,int val)
  4585.  {
  4586. @@ -6715,7 +6782,9 @@
  4587.  }
  4588.  
  4589.  /*==========================================
  4590. - * HP/SP‰ñ•œ
  4591. + * HP/SP Recovery
  4592. + * Heal player hp nad/or sp linearly
  4593. + * Calculate bonus by status
  4594.   *------------------------------------------*/
  4595.  int pc_itemheal(struct map_session_data *sd,int itemid, int hp,int sp)
  4596.  {
  4597. @@ -6773,7 +6842,8 @@
  4598.  }
  4599.  
  4600.  /*==========================================
  4601. - * HP/SP‰ñ•œ
  4602. + * HP/SP Recovery
  4603. + * Heal player hp nad/or sp by rate
  4604.   *------------------------------------------*/
  4605.  int pc_percentheal(struct map_session_data *sd,int hp,int sp)
  4606.  {
  4607. @@ -6811,9 +6881,7 @@
  4608.  }
  4609.  
  4610.  /*==========================================
  4611. - * E?X
  4612. - * ˆø?	job E‹Æ 0`23
  4613. - *		upper ’ʏí 0, ?¶ 1, —{Žq 2, ‚»‚Ì‚Ü‚Ü -1
  4614. + * Called when player changing job 
  4615.   * Rewrote to make it tidider [Celest]
  4616.   *------------------------------------------*/
  4617.  int pc_jobchange(struct map_session_data *sd,int job, int upper)
  4618. @@ -6904,7 +6972,7 @@
  4619.  	for(i=0;i<EQI_MAX;i++) {
  4620.  		if(sd->equip_index[i] >= 0)
  4621.  			if(!pc_isequip(sd,sd->equip_index[i]))
  4622. -				pc_unequipitem(sd,sd->equip_index[i],2);	// ?”õŠO‚µ
  4623. +				pc_unequipitem(sd,sd->equip_index[i],2);	// ?ᅵᅵᅵOᅵᅵ
  4624.  	}
  4625.  
  4626.  	//Change look, if disguised, you need to undisguise 
  4627. @@ -6970,7 +7038,7 @@
  4628.  }
  4629.  
  4630.  /*==========================================
  4631. - * Œ©‚œ–Ú?X
  4632. + * Tell client player sd has change equipement
  4633.   *------------------------------------------*/
  4634.  int pc_equiplookall(struct map_session_data *sd)
  4635.  {
  4636. @@ -6987,7 +7055,7 @@
  4637.  }
  4638.  
  4639.  /*==========================================
  4640. - * Œ©‚œ–Ú?X
  4641. + * Tell client player sd has change look (hair,equip...)
  4642.   *------------------------------------------*/
  4643.  int pc_changelook(struct map_session_data *sd,int type,int val)
  4644.  {
  4645. @@ -7047,7 +7115,7 @@
  4646.  }
  4647.  
  4648.  /*==========================================
  4649. - * •t?•i(‘é,ƒyƒR,ƒJ?ƒg)Ý’è
  4650. + * Give an option (type) to player (sd) and display it to client
  4651.   *------------------------------------------*/
  4652.  int pc_setoption(struct map_session_data *sd,int type)
  4653.  {
  4654. @@ -7165,7 +7233,7 @@
  4655.  }
  4656.  
  4657.  /*==========================================
  4658. - * ƒJ?ƒgÝ’è
  4659. + * Give player a cart
  4660.   *------------------------------------------*/
  4661.  int pc_setcart(struct map_session_data *sd,int type)
  4662.  {
  4663. @@ -7190,12 +7258,12 @@
  4664.  }
  4665.  
  4666.  /*==========================================
  4667. - * ‘éÝ’è
  4668. + * Give player a falcon
  4669.   *------------------------------------------*/
  4670.  int pc_setfalcon(TBL_PC* sd, int flag)
  4671.  {
  4672.  	if( flag ){
  4673. -		if( pc_checkskill(sd,HT_FALCON)>0 )	// ƒtƒ@ƒ‹ƒRƒ“ƒ}ƒXƒ^ƒŠ?ƒXƒLƒ‹ŠŽ
  4674. +		if( pc_checkskill(sd,HT_FALCON)>0 )	// ᅵtᅵ@ᅵᅵᅵRᅵᅵᅵ}ᅵXᅵ^ᅵᅵ?ᅵXᅵLᅵᅵᅵᅵᅵᅵ
  4675.  			pc_setoption(sd,sd->sc.option|OPTION_FALCON);
  4676.  	} else if( pc_isfalcon(sd) ){
  4677.  		pc_setoption(sd,sd->sc.option&~OPTION_FALCON); // remove falcon
  4678. @@ -7205,12 +7273,12 @@
  4679.  }
  4680.  
  4681.  /*==========================================
  4682. - * ƒyƒRƒyƒRÝ’è
  4683. + * Give player a wug (wolf)
  4684.   *------------------------------------------*/
  4685.  int pc_setriding(TBL_PC* sd, int flag)
  4686.  {
  4687.  	if( flag ){
  4688. -		if( pc_checkskill(sd,KN_RIDING) > 0 ) // ƒ‰ƒCƒfƒBƒ“ƒOƒXƒLƒ‹ŠŽ
  4689. +		if( pc_checkskill(sd,KN_RIDING) > 0 ) // ᅵᅵᅵCᅵfᅵBᅵᅵᅵOᅵXᅵLᅵᅵᅵᅵᅵᅵ
  4690.  			pc_setoption(sd, sd->sc.option|OPTION_RIDING);
  4691.  	} else if( pc_isriding(sd) ){
  4692.  			pc_setoption(sd, sd->sc.option&~OPTION_RIDING);
  4693. @@ -7220,7 +7288,7 @@
  4694.  }
  4695.  
  4696.  /*==========================================
  4697. - * ƒAƒCƒeƒ€ƒhƒƒbƒv‰Â•s‰Â”»’è
  4698. + * Check if player can drop an item
  4699.   *------------------------------------------*/
  4700.  int pc_candrop(struct map_session_data *sd, struct item *item)
  4701.  {
  4702. @@ -7232,7 +7300,8 @@
  4703.  }
  4704.  
  4705.  /*==========================================
  4706. - * script—p??‚Ì’l‚ð?‚Þ
  4707. + * Read ram register for player sd
  4708. + * get val (int) from reg for player sd
  4709.   *------------------------------------------*/
  4710.  int pc_readreg(struct map_session_data* sd, int reg)
  4711.  {
  4712. @@ -7244,7 +7313,8 @@
  4713.  	return ( i < sd->reg_num ) ? sd->reg[i].data : 0;
  4714.  }
  4715.  /*==========================================
  4716. - * script—p??‚Ì’l‚ðÝ’è
  4717. + * Set ram register for player sd
  4718. + * memo val(int) at reg for player sd
  4719.   *------------------------------------------*/
  4720.  int pc_setreg(struct map_session_data* sd, int reg, int val)
  4721.  {
  4722. @@ -7272,7 +7342,8 @@
  4723.  }
  4724.  
  4725.  /*==========================================
  4726. - * script—p•¶Žš—ñ??‚Ì’l‚ð?‚Þ
  4727. + * Read ram register for player sd
  4728. + * get val (str) from reg for player sd
  4729.   *------------------------------------------*/
  4730.  char* pc_readregstr(struct map_session_data* sd, int reg)
  4731.  {
  4732. @@ -7284,7 +7355,8 @@
  4733.  	return ( i < sd->regstr_num ) ? sd->regstr[i].data : NULL;
  4734.  }
  4735.  /*==========================================
  4736. - * script—p•¶Žš—ñ??‚Ì’l‚ðÝ’è
  4737. + * Set ram register for player sd
  4738. + * memo val(str) at reg for player sd
  4739.   *------------------------------------------*/
  4740.  int pc_setregstr(struct map_session_data* sd, int reg, const char* str)
  4741.  {
  4742. @@ -7564,7 +7636,7 @@
  4743.  }
  4744.  
  4745.  /*==========================================
  4746. - * ƒCƒxƒ“ƒgƒ^ƒCƒ}??—
  4747. + * Exec eventtimer for player sd (retrieved from map_session (id))
  4748.   *------------------------------------------*/
  4749.  static int pc_eventtimer(int tid, unsigned int tick, int id, intptr_t data)
  4750.  {
  4751. @@ -7589,7 +7661,7 @@
  4752.  }
  4753.  
  4754.  /*==========================================
  4755. - * ƒCƒxƒ“ƒgƒ^ƒCƒ}?’ljÁ
  4756. + * Add eventtimer for player sd ?
  4757.   *------------------------------------------*/
  4758.  int pc_addeventtimer(struct map_session_data *sd,int tick,const char *name)
  4759.  {
  4760. @@ -7607,7 +7679,7 @@
  4761.  }
  4762.  
  4763.  /*==========================================
  4764. - * ƒCƒxƒ“ƒgƒ^ƒCƒ}?íœ
  4765. + * Del eventtimer for player sd ?
  4766.   *------------------------------------------*/
  4767.  int pc_deleventtimer(struct map_session_data *sd,const char *name)
  4768.  {
  4769. @@ -7637,7 +7709,7 @@
  4770.  }
  4771.  
  4772.  /*==========================================
  4773. - * ƒCƒxƒ“ƒgƒ^ƒCƒ}?ƒJƒEƒ“ƒg’l’ljÁ
  4774. + * Update eventtimer count for player sd
  4775.   *------------------------------------------*/
  4776.  int pc_addeventtimercount(struct map_session_data *sd,const char *name,int tick)
  4777.  {
  4778. @@ -7656,7 +7728,7 @@
  4779.  }
  4780.  
  4781.  /*==========================================
  4782. - * ƒCƒxƒ“ƒgƒ^ƒCƒ}?‘Síœ
  4783. + * Remove all eventtimer for player sd
  4784.   *------------------------------------------*/
  4785.  int pc_cleareventtimer(struct map_session_data *sd)
  4786.  {
  4787. @@ -7679,10 +7751,10 @@
  4788.  }
  4789.  
  4790.  //
  4791. -// ? ”õ•š
  4792. +// Equipment
  4793.  //
  4794.  /*==========================================
  4795. - * ƒAƒCƒeƒ€‚ð?”õ‚·‚é
  4796. + * Equip item on player sd at req_pos from inventory index n 
  4797.   *------------------------------------------*/
  4798.  int pc_equipitem(struct map_session_data *sd,int n,int req_pos)
  4799.  {
  4800. @@ -7865,7 +7937,7 @@
  4801.  }
  4802.  
  4803.  /*==========================================
  4804. - * ? ”õ‚µ‚œ•š‚ðŠO‚·
  4805. + * Called when attemting to unequip an item from player 
  4806.   * type:
  4807.   * 0 - only unequip
  4808.   * 1 - calculate status after unequipping
  4809. @@ -7994,8 +8066,8 @@
  4810.  }
  4811.  
  4812.  /*==========================================
  4813. - * ƒAƒCƒeƒ€‚Ìindex”Ô?‚ð‹l‚ß‚œ‚è
  4814. - * ? ”õ•i‚Ì?”õ‰Â”\ƒ`ƒFƒbƒN‚ðs‚È‚€
  4815. + * Checking if player (sd) have unauthorize, invalide item 
  4816. + * on inventory, cart, equiped for the map (item_noequip) 
  4817.   *------------------------------------------*/
  4818.  int pc_checkitem(struct map_session_data *sd)
  4819.  {
  4820. @@ -8075,7 +8147,7 @@
  4821.  }
  4822.  
  4823.  /*==========================================
  4824. - * PVP‡ˆÊŒvŽZ—p(foreachinarea)
  4825. + * Update PVP rank for sd1 to sd2 
  4826.   *------------------------------------------*/
  4827.  int pc_calc_pvprank_sub(struct block_list *bl,va_list ap)
  4828.  {
  4829. @@ -8094,7 +8166,8 @@
  4830.  	return 0;
  4831.  }
  4832.  /*==========================================
  4833. - * PVP‡ˆÊŒvŽZ
  4834. + * Calculate new rank beetween all present players (map_foreachinarea)
  4835. + * and display result
  4836.   *------------------------------------------*/
  4837.  int pc_calc_pvprank(struct map_session_data *sd)
  4838.  {
  4839. @@ -8109,7 +8182,7 @@
  4840.  	return sd->pvp_rank;
  4841.  }
  4842.  /*==========================================
  4843. - * PVP‡ˆÊŒvŽZ(timer)
  4844. + * Calculate next sd ranking calculation from config
  4845.   *------------------------------------------*/
  4846.  int pc_calc_pvprank_timer(int tid, unsigned int tick, int id, intptr_t data)
  4847.  {
  4848. @@ -8131,7 +8204,10 @@
  4849.  }
  4850.  
  4851.  /*==========================================
  4852. - * sd‚ÍŒ‹¥‚µ‚Ä‚¢‚é‚©(?¥‚̏ꍇ‚Í‘Š•û‚Ìchar_id‚ð•Ô‚·)
  4853. + * Checking if sd is married
  4854. + * Return 
  4855. + *	partner_id = yes, 
  4856. + *	0 = no
  4857.   *------------------------------------------*/
  4858.  int pc_ismarried(struct map_session_data *sd)
  4859.  {
  4860. @@ -8143,7 +8219,10 @@
  4861.  		return 0;
  4862.  }
  4863.  /*==========================================
  4864. - * sd‚ªdstsd‚ÆŒ‹¥(dstsdšsd‚ÌŒ‹¥?—‚à“¯Žbɍs‚€)
  4865. + * Marry player sd to player dstsd
  4866. + * return
  4867. + *	-1 = fail
  4868. + *	0 = success
  4869.   *------------------------------------------*/
  4870.  int pc_marriage(struct map_session_data *sd,struct map_session_data *dstsd)
  4871.  {
  4872. @@ -8158,6 +8237,9 @@
  4873.  
  4874.  /*==========================================
  4875.   * Divorce sd from its partner
  4876. + * return
  4877. + *	-1 = fail
  4878. + *	0 = success
  4879.   *------------------------------------------*/
  4880.  int pc_divorce(struct map_session_data *sd)
  4881.  {
  4882. @@ -8196,7 +8278,7 @@
  4883.  }
  4884.  
  4885.  /*==========================================
  4886. - * sd‚Ì‘Š•û‚Ìmap_session_data‚ð•Ô‚·
  4887. + * Get sd partner charid. (Married partner)
  4888.   *------------------------------------------*/
  4889.  struct map_session_data *pc_get_partner(struct map_session_data *sd)
  4890.  {
  4891. @@ -8207,6 +8289,9 @@
  4892.  	return NULL;
  4893.  }
  4894.  
  4895. +/*==========================================
  4896. + * Get sd father charid. (Need to be baby)
  4897. + *------------------------------------------*/
  4898.  struct map_session_data *pc_get_father (struct map_session_data *sd)
  4899.  {
  4900.  	if (sd && sd->class_&JOBL_BABY && sd->status.father > 0)
  4901. @@ -8216,6 +8301,9 @@
  4902.  	return NULL;
  4903.  }
  4904.  
  4905. +/*==========================================
  4906. + * Get sd mother charid. (Need to be baby)
  4907. + *------------------------------------------*/
  4908.  struct map_session_data *pc_get_mother (struct map_session_data *sd)
  4909.  {
  4910.  	if (sd && sd->class_&JOBL_BABY && sd->status.mother > 0)
  4911. @@ -8225,6 +8313,9 @@
  4912.  	return NULL;
  4913.  }
  4914.  
  4915. +/*==========================================
  4916. + * Get sd children charid. (Need to be married)
  4917. + *------------------------------------------*/
  4918.  struct map_session_data *pc_get_child (struct map_session_data *sd)
  4919.  {
  4920.  	if (sd && pc_ismarried(sd) && sd->status.child > 0)
  4921. @@ -8234,6 +8325,9 @@
  4922.  	return NULL;
  4923.  }
  4924.  
  4925. +/*==========================================
  4926. + * Set player sd to bleed. (losing hp and/or sp each diff_tick)
  4927. + *------------------------------------------*/
  4928.  void pc_bleeding (struct map_session_data *sd, unsigned int diff_tick)
  4929.  {
  4930.  	int hp = 0, sp = 0;
  4931. @@ -8295,7 +8389,7 @@
  4932.  }
  4933.  
  4934.  /*==========================================
  4935. - * ƒZ?ƒuƒ|ƒCƒ“ƒg‚Ì•Û‘¶
  4936. + * Memo player sd savepoint. (map,x,y)
  4937.   *------------------------------------------*/
  4938.  int pc_setsavepoint(struct map_session_data *sd, short mapindex,int x,int y)
  4939.  {
  4940. @@ -8309,7 +8403,7 @@
  4941.  }
  4942.  
  4943.  /*==========================================
  4944. - * Ž©“®ƒZ?ƒu (timer??)
  4945. + * Save 1 player data  at autosave intervalle
  4946.   *------------------------------------------*/
  4947.  int pc_autosave(int tid, unsigned int tick, int id, intptr_t data)
  4948.  {
  4949. @@ -8426,7 +8520,7 @@
  4950.  	skill = cap_value(pc_checkskill(sd,NC_MAINFRAME),0,4);
  4951.  	if( sd->sc.data[SC_OVERHEAT_LIMITPOINT] ) {
  4952.  		heat += sd->sc.data[SC_OVERHEAT_LIMITPOINT]->val1;
  4953. -		status_change_end(&sd->bl,SC_OVERHEAT_LIMITPOINT,-1);
  4954. +		status_change_end(&sd->bl,SC_OVERHEAT_LIMITPOINT, INVALID_TIMER);
  4955.  	}
  4956.  
  4957.  	heat = max(0,heat); // Avoid negative HEAT
  4958. @@ -8599,7 +8693,7 @@
  4959.  	FILE *fp;
  4960.  	char line[24000],*p;
  4961.  
  4962. -	// •K—v??’l?‚Ý?‚Ý
  4963. +	//reset
  4964.  	memset(exp_table,0,sizeof(exp_table));
  4965.  	memset(max_level,0,sizeof(max_level));
  4966.  
  4967. @@ -8684,12 +8778,12 @@
  4968.  	}
  4969.  	ShowStatus("Done reading '"CL_WHITE"%s"CL_RESET"'.\n","exp.txt");
  4970.  
  4971. -	// ƒXƒLƒ‹ƒcƒŠ?
  4972. +	// ᅵXᅵLᅵᅵᅵcᅵᅵ?
  4973.  	memset(skill_tree,0,sizeof(skill_tree));
  4974.  
  4975.  	sv_readdb(db_path, DBPATH"skill_tree.txt", ',', 3+MAX_PC_SKILL_REQUIRE*2, 4+MAX_PC_SKILL_REQUIRE*2, -1, &pc_readdb_skilltree);
  4976.  
  4977. -	// ?«C³ƒe?ƒuƒ‹
  4978. +	// ?ᅵᅵᅵCᅵᅵᅵe?ᅵuᅵᅵ
  4979.  	for(i=0;i<4;i++)
  4980.  		for(j=0;j<ELE_MAX;j++)
  4981.  			for(k=0;k<ELE_MAX;k++)
  4982. @@ -8741,7 +8835,7 @@
  4983.  	fclose(fp);
  4984.  	ShowStatus("Done reading '"CL_WHITE"%s"CL_RESET"'.\n","attr_fix.txt");
  4985.  
  4986. -	// ƒXƒLƒ‹ƒcƒŠ?
  4987. +	// reset statspoint
  4988.  	memset(statp,0,sizeof(statp));
  4989.  	i=1;
  4990.  
  4991. @@ -8872,7 +8966,7 @@
  4992.  	return;
  4993.  }
  4994.  /*==========================================
  4995. - * pc? ŒW‰Šú‰»
  4996. + * pc Init/Terminate
  4997.   *------------------------------------------*/
  4998.  void do_final_pc(void) {
  4999.  
  5000. Index: src/map/map.c
  5001. ===================================================================
  5002. --- src/map/map.c	(revision 16039)
  5003. +++ src/map/map.c	(working copy)
  5004.  
  5005. @@ -991,7 +991,7 @@
  5006.  	if(bl_list_count>=BL_LIST_MAX)
  5007.  		ShowWarning("map_foreachinmovearea: block count too many!\n");
  5008.  
  5009. -	map_freeblock_lock();	// ƒƒ‚ƒŠ‚©‚ç‚̉ð•ú‚ð‹ÖŽ~‚·‚é
  5010. +	map_freeblock_lock();	// Prohibit the release from memory
  5011.  
  5012.  	for(i=blockcount;i<bl_list_count;i++)
  5013.  		if(bl_list[i]->prev)
  5014. @@ -1002,7 +1002,7 @@
  5015.  			va_end(ap);
  5016.  		}
  5017.  
  5018. -	map_freeblock_unlock();	// ‰ð•ú‚ð‹–‰Â‚·‚é
  5019. +	map_freeblock_unlock();	// Allow Free
  5020.  
  5021.  	bl_list_count = blockcount;
  5022.  	return returnCount;
  5023.  
  5024. @@ -1469,10 +1469,13 @@
  5025.  }
  5026.  
  5027.  /*==========================================
  5028. - * (m,x,y)‚𒆐S‚É3x3ˆÈ?‚ɏ°ƒAƒCƒeƒ€Ý’u
  5029. - *
  5030. - * item_data‚ÍamountˆÈŠO‚ðcopy‚·‚é
  5031. - * type flag: &1 MVP item. &2 do stacking check.
  5032. + * Rajoute un item sur la map au location (m,x,y)
  5033. + * Parametres 
  5034. + * @item_data attribut de l'item
  5035. + * @amount quantité
  5036. + * @m, @x, @y index de la map et coordonnée en x,y
  5037. + * @first_charid, @second_charid, @third_charid, champ pour les priorité de ramassage
  5038. + * @flag: &1 MVP item. &2 do stacking check.
  5039.   *------------------------------------------*/
  5040.  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)
  5041.  {
  5042.  
  5043.  
  5044. @@ -2489,7 +2492,7 @@
  5045.  }
  5046.  
  5047.  /*==========================================
  5048. - * (m,x,y)‚̏ó‘Ԃ𒲂ׂé
  5049. + * Confirme si le type de cell en (m,x,y) est celui passer en parametre
  5050.   *------------------------------------------*/
  5051.  int map_getcell(int m,int x,int y,cell_chk cellchk)
  5052.  {
  5053.  
  5054. Index: src/map/map.h
  5055. ===================================================================
  5056. --- src/map/map.h	(revision 16039)
  5057. +++ src/map/map.h	(working copy)
  5058. @@ -608,7 +608,7 @@
  5059.  
  5060.  extern char wisp_server_name[];
  5061.  
  5062. -// ŽI‘S‘̏î•ñ
  5063. +// users
  5064.  void map_setusers(int);
  5065.  int map_getusers(void);
  5066.  int map_usercount(void);
  5067. Index: src/map/pet.c
  5068. ===================================================================
  5069. --- src/map/pet.c	(revision 16039)
  5070. +++ src/map/pet.c	(working copy)
  5071. @@ -1031,7 +1031,7 @@
  5072.  	memset(pd->loot->item,0,pd->loot->max * sizeof(struct item));
  5073.  	pd->loot->count = 0;
  5074.  	pd->loot->weight = 0;
  5075. -	pd->ud.canact_tick = gettick()+10000;	//	10*1000ms‚̊ԏE‚í‚È‚¢
  5076. +	pd->ud.canact_tick = gettick()+10000;	//	Not picked up during the 10*1000ms
  5077.  
  5078.  	if (dlist->item)
  5079.  		add_timer(gettick()+540,pet_delay_item_drop,0,(intptr_t)dlist);
  5080. @@ -1195,7 +1195,7 @@
  5081.  }
  5082.  
  5083.  /*==========================================
  5084. - *ƒyƒbƒgƒf[ƒ^“ǂݍž‚Ý
  5085. + *Pet read db data
  5086.   *------------------------------------------*/ 
  5087.  int read_petdb()
  5088.  {
  5089. @@ -1343,7 +1343,7 @@
  5090.  }
  5091.  
  5092.  /*==========================================
  5093. - * ƒXƒLƒ‹ŠÖŒW‰Šú‰»ˆ—
  5094. + * Initialization process relationship skills
  5095.   *------------------------------------------*/
  5096.  int do_init_pet(void)
  5097.  {
  5098. Index: src/map/path.c
  5099. ===================================================================
  5100. --- src/map/path.c	(revision 16039)
  5101. +++ src/map/path.c	(working copy)
  5102. @@ -45,7 +45,7 @@
  5103.  
  5104.  /*==========================================
  5105.   * heap update (helper function)
  5106. - * cost‚ªŒž‚Á‚œ‚̂ōª‚Ì•û‚ÖˆÚ“®
  5107. + * move toward the root Because cost has decreased
  5108.   *------------------------------------------*/
  5109.  static void update_heap_path(int *heap,struct tmp_path *tp,int index)
  5110.  {
  5111. @@ -147,8 +147,7 @@
  5112.  
  5113.  /*==========================================
  5114.   * Find the closest reachable cell, 'count' cells away from (x0,y0) in direction (dx,dy).
  5115. - * 
  5116. - * ‚«”ò‚΂µ‚œ‚ ‚Ƃ̍À•W‚ðŠ“Ÿ
  5117. + * Income after the coordinates of the blow
  5118.   *------------------------------------------*/
  5119.  int path_blownpos(int m,int x0,int y0,int dx,int dy,int count)
  5120.  {
  5121. @@ -343,7 +342,7 @@
  5122.  	tp[i].flag=0;
  5123.  	heap[0]=0;
  5124.  	push_heap_path(heap,tp,calc_index(x0,y0));
  5125. -	xs = md->xs-1; // ‚ ‚ç‚©‚¶‚ß‚PŒžŽZ‚µ‚Ä‚š‚­
  5126. +	xs = md->xs-1; // Place by subtracting a pre-
  5127.  	ys = md->ys-1;
  5128.  
  5129.  	for(;;)
  5130. @@ -361,10 +360,10 @@
  5131.  		if(x==x1 && y==y1)
  5132.  			break;
  5133.  
  5134. -		// dc[0] : y++ ‚ÌŽž‚̃RƒXƒg‘•ª
  5135. -		// dc[1] : x-- ‚ÌŽž‚̃RƒXƒg‘•ª
  5136. -		// dc[2] : y-- ‚ÌŽž‚̃RƒXƒg‘•ª
  5137. -		// dc[3] : x++ ‚ÌŽž‚̃RƒXƒg‘•ª
  5138. +		// dc[0] : y++ //Incremental cost at the time
  5139. +		// dc[1] : x-- 
  5140. +		// dc[2] : y-- 
  5141. +		// dc[3] : x++ 
  5142.  
  5143.  		if(y < ys && !map_getcellp(md,x  ,y+1,cell)) {
  5144.  			f |= 1; dc[0] = (y >= y1 ? 20 : 0);
  5145. Index: athena-start
  5146. ===================================================================
  5147. --- athena-start	(revision 16039)
  5148. +++ athena-start	(working copy)
  5149. @@ -50,6 +50,16 @@
  5150.  
  5151.          echo "Now Started Athena."
  5152.  ;;
  5153. +    'start2')
  5154. +        print_start
  5155. +        check_files
  5156. +
  5157. +        exec ./${L_SRV}&
  5158. +        exec ./${C_SRV}&
  5159. +        gdb -ex run ./${M_SRV}&
  5160. +
  5161. +        echo "Now Started Athena in debug mode."
  5162. +;;
  5163.      'stop')
  5164.          ps ax | grep -E "${L_SRV}|${C_SRV}|${M_SRV}" | awk '{print $1}' | xargs kill
  5165.  ;;
Viewed 2708 times, submitted by lighta.