viewing paste rA small sync | Diff

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