viewing paste rA_doc_merge_homonS-wip | Diff

Posted on the
  1. # This patch file was generated by NetBeans IDE
  2. # Following Index: paths are relative to: /home/lighta/Documents/Myscript/RO/Servs/rathena
  3. # This patch can be applied using context Tools: Patch action on respective folder.
  4. # It uses platform neutral UTF-8 encoding and \n newlines.
  5. # Above lines and this line are ignored by the patching process.
  6. Index: src/common/core.c
  7. --- src/common/core.c Base (BASE)
  8. +++ src/common/core.c Locally Modified (Based On LOCAL)
  9. @@ -20,7 +20,7 @@
  10.  #ifndef _WIN32
  11.  #include <unistd.h>
  12.  #else
  13. -#include "../common/winapi.h" // Console close event handling
  14. +#include "winapi.h" // Console close event handling
  15.  #endif
  16.  
  17.  
  18. Index: src/map/atcommand.c
  19. --- src/map/atcommand.c Base (BASE)
  20. +++ src/map/atcommand.c Locally Modified (Based On LOCAL)
  21. @@ -3404,7 +3404,7 @@
  22.  	if( sd->spiritball > 0 )
  23.  		pc_delspiritball(sd, sd->spiritball, 1);
  24.  	sd->spiritball = number;
  25. -	clif_spiritball(sd);
  26. +	clif_spiritball(&sd->bl);
  27.  	// no message, player can look the difference
  28.  
  29.  	return 0;
  30. Index: src/map/battle.c
  31. --- src/map/battle.c Base (BASE)
  32. +++ src/map/battle.c Locally Modified (Based On LOCAL)
  33. @@ -367,6 +367,7 @@
  34.                          if( tsc->data[SC_CRYSTALIZE] && target->type != BL_MOB)
  35.                                  status_change_end(target, SC_CRYSTALIZE, INVALID_TIMER);
  36.                          if( tsc->data[SC_EARTH_INSIGNIA]) damage += damage/2;
  37. +						if ( tsc->data[SC_ASH]) damage = damage * tsc->data[SC_ASH]->val2 / 100;
  38.                          break;
  39.                  case ELE_HOLY:
  40.                          if( tsc->data[SC_ORATIO]) ratio += tsc->data[SC_ORATIO]->val1 * 2;
  41. @@ -730,6 +731,16 @@
  42.  			//Reduction: 6% + 6% every 20%
  43.  			damage -= damage * 6 * (1+per) / 100;
  44.  		}
  45. +		if(sc->data[SC_GRANITIC_ARMOR]){
  46. +            damage -= damage * sc->data[SC_GRANITIC_ARMOR]->val2/100;
  47. +        }
  48. +        if(sc->data[SC_PAIN_KILLER]){
  49. +            damage -= damage * sc->data[SC_PAIN_KILLER]->val3/100;
  50. +        }  
  51. +        if((sce=sc->data[SC_MAGMA_FLOW]) && (rnd()%100 <= sce->val2) ){        
  52. +            skill_castend_damage_id(bl,src,MH_MAGMA_FLOW,sce->val1,gettick(),0);
  53. +        }
  54. +
  55.  /**
  56.   * In renewal steel body reduces all incoming damage by 1/10
  57.   **/
  58. @@ -787,6 +798,10 @@
  59.  
  60.  		if( sd && (sce = sc->data[SC_FORCEOFVANGUARD]) && flag&BF_WEAPON && rnd()%100 < sce->val2 )
  61.  			pc_addspiritball(sd,skill_get_time(LG_FORCEOFVANGUARD,sce->val1),sce->val3);
  62. +		if (sc->data[SC_STYLE_CHANGE] && rnd() % 100 < 50) {
  63. +            TBL_HOM *hd = BL_CAST(BL_HOM,bl);
  64. +            if (hd) hom_addspiritball(hd, 10); //rajoute une sphere
  65. +        }
  66.  
  67.  		if( sc->data[SC__DEADLYINFECT] && damage > 0 && rnd()%100 < 65 + 5 * sc->data[SC__DEADLYINFECT]->val1 )
  68.  			status_change_spread(bl, src); // Deadly infect attacked side
  69. @@ -846,7 +861,11 @@
  70.  			sc_start(bl,sc->data[SC_POISONINGWEAPON]->val2,100,sc->data[SC_POISONINGWEAPON]->val1,skill_get_time2(GC_POISONINGWEAPON, 1));
  71.  		if( sc->data[SC__DEADLYINFECT] && damage > 0 && rnd()%100 < 65 + 5 * sc->data[SC__DEADLYINFECT]->val1 )
  72.  			status_change_spread(src, bl);
  73. +        if (sc->data[SC_STYLE_CHANGE] && rnd() % 100 < 50) {
  74. +            TBL_HOM *hd = BL_CAST(BL_HOM,bl);
  75. +            if (hd) hom_addspiritball(hd, 10);
  76.  	}
  77. +	}
  78.  
  79.  	if (battle_config.pk_mode && sd && bl->type == BL_PC && damage && map[bl->m].flag.pvp)
  80.    	{
  81. @@ -1480,6 +1499,14 @@
  82.  			break;
  83.  	}
  84.  
  85. +    if (!(nk & NK_NO_ELEFIX) && !n_ele)
  86. +        if (src->type == BL_HOM)
  87. +            n_ele = true; //element is "not elemental"
  88. +    if (sc && sc->data[SC_GOLDENE_FERSE] && ((!skill_num && (rnd() % 100 < sc->data[SC_GOLDENE_FERSE]->val4)) || skill_num == MH_STAHL_HORN)) {
  89. +        s_ele = s_ele_ = ELE_HOLY;
  90. +        n_ele = false;
  91. +    }
  92. +
  93.  	if(!skill_num)
  94.    	{	//Skills ALWAYS use ONLY your right-hand weapon (tested on Aegis 10.2)
  95.  		if (sd && sd->weapontype1 == 0 && sd->weapontype2 > 0)
  96. @@ -1818,7 +1845,7 @@
  97.  				skillratio += sc->data[SC_OVERTHRUST]->val3;
  98.  			if(sc->data[SC_MAXOVERTHRUST])
  99.  				skillratio += sc->data[SC_MAXOVERTHRUST]->val2;
  100. -			if(sc->data[SC_BERSERK] || sc->data[SC__BLOODYLUST])
  101. +			if (sc->data[SC_BERSERK] || sc->data[SC_SATURDAYNIGHTFEVER] || sc->data[SC__BLOODYLUST])
  102.  				skillratio += 100;
  103.  			if(sc->data[SC_ZENKAI] && sstatus->rhw.ele == sc->data[SC_ZENKAI]->val2 )
  104.  				skillratio += sc->data[SC_ZENKAI]->val1 * 2;
  105. @@ -2564,12 +2591,18 @@
  106.  				case KO_BAKURETSU:
  107.  					skillratio = 50 * skill_lv * (sd?pc_checkskill(sd,NJ_TOBIDOUGU):10);
  108.  					break;
  109. +				case MH_NEEDLE_OF_PARALYZE:
  110. +                    skillratio += 600 + 100 * skill_lv;
  111. +                    break;
  112.  				case MH_STAHL_HORN:
  113. -					skillratio += 500 + 100 * skill_lv;
  114. +                    skillratio += 400 + 100 * skill_lv;
  115.  					break;
  116.  				case MH_LAVA_SLIDE:
  117.  					skillratio = 70 * skill_lv;
  118.  					break;
  119. +                case MH_MAGMA_FLOW:
  120. +                    skillratio += -100 + 100 * skill_lv;
  121. +					break;
  122.  			}
  123.  
  124.  			ATK_RATE(skillratio);
  125. @@ -2686,8 +2719,13 @@
  126.  						ATK_ADDRATE(sc->data[SC_EDP]->val3);
  127.  				}
  128.  			}
  129. +			if(sc->data[SC_STYLE_CHANGE]){
  130. +                TBL_HOM *hd = BL_CAST(BL_HOM,src);
  131. +                if (hd) ATK_ADD(hd->spiritball * 3);
  132.  		}
  133.  
  134. +		}
  135. +
  136.  		switch (skill_num) {
  137.  			case AS_SONICBLOW:
  138.  				if (sc && sc->data[SC_SPIRIT] &&
  139. @@ -3895,6 +3933,18 @@
  140.  						else
  141.  							skillratio += 500 + 400 * skill_lv;
  142.  						break;
  143. +                    case MH_XENO_SLASHER:
  144. +                        if(skill_lv<5)
  145. +                            skillratio += 300 + 100 * skill_lv;
  146. +                        else
  147. +                            skillratio += 600;
  148. +                        break;
  149. +                    case MH_HEILIGE_STANGE:
  150. +                        skillratio += 400 + 250 * skill_lv;
  151. +                        break;
  152. +                    case MH_POISON_MIST:
  153. +                        skillratio += 100 * skill_lv;
  154. +                        break;
  155.  				}
  156.  
  157.  				MATK_RATE(skillratio);
  158. Index: src/map/clif.c
  159. --- src/map/clif.c Base (BASE)
  160. +++ src/map/clif.c Locally Modified (Based On LOCAL)
  161. @@ -1356,7 +1356,7 @@
  162.  			TBL_PC *sd = ((TBL_PC*)bl);
  163.  			int i;
  164.  			if (sd->spiritball > 0)
  165. -				clif_spiritball(sd);
  166. +				clif_spiritball(&sd->bl);
  167.  			if(sd->state.size==SZ_BIG) // tiny/big players [Valaris]
  168.  				clif_specialeffect(bl,423,AREA);
  169.  			else if(sd->state.size==SZ_MEDIUM)
  170. @@ -6897,21 +6897,27 @@
  171.  		clif_send(buf, packet_len(0x1cf), src, AREA);
  172.  }
  173.  
  174. +/*==========================================
  175. + * Server tells clients nearby 'sd' (and himself) to display 'sd->spiritball' number of spiritballs on 'sd'
  176. + * Notifies clients in an area of an object's spirits.
  177. + * 01d0 <id>.L <amount>.W (ZC_SPIRITS)
  178. + * 01e1 <id>.L <amount>.W (ZC_SPIRITS2)
  179. + *------------------------------------------*/
  180. +void clif_spiritball(struct block_list *bl) {
  181. +    unsigned char buf[16];
  182. +    TBL_PC *sd = BL_CAST(BL_PC,bl);
  183. +    TBL_HOM *hd = BL_CAST(BL_HOM,bl);
  184.  
  185. -/// Notifies clients in an area of an object's spirits.
  186. -/// 01d0 <id>.L <amount>.W (ZC_SPIRITS)
  187. -/// 01e1 <id>.L <amount>.W (ZC_SPIRITS2)
  188. -void clif_spiritball(struct map_session_data *sd)
  189. -{
  190. -	unsigned char buf[8];
  191. +    nullpo_retv(bl);
  192.  
  193. -	nullpo_retv(sd);
  194. -
  195. -	WBUFW(buf,0)=0x1d0;
  196. -	WBUFL(buf,2)=sd->bl.id;
  197. -	WBUFW(buf,6)=sd->spiritball;
  198. -	clif_send(buf,packet_len(0x1d0),&sd->bl,AREA);
  199. +    WBUFW(buf, 0) = 0x1d0;
  200. +    WBUFL(buf, 2) = bl->id;
  201. +    switch(bl->type){
  202. +        case BL_PC: WBUFW(buf, 6) = sd->spiritball; break;
  203. +        case BL_HOM: WBUFW(buf, 6) = hd->spiritball; break;
  204.  }
  205. +    clif_send(buf, packet_len(0x1d0), bl, AREA);
  206. +}
  207.  
  208.  
  209.  /// Notifies clients in area of a character's combo delay (ZC_COMBODELAY).
  210. Index: src/map/clif.h
  211. --- src/map/clif.h Base (BASE)
  212. +++ src/map/clif.h Locally Modified (Based On LOCAL)
  213. @@ -454,7 +454,7 @@
  214.  
  215.  void clif_autospell(struct map_session_data *sd,int skilllv);
  216.  void clif_devotion(struct block_list *src, struct map_session_data *tsd);
  217. -void clif_spiritball(struct map_session_data *sd);
  218. +void clif_spiritball(struct block_list *bl);
  219.  void clif_combo_delay(struct block_list *bl,int wait);
  220.  void clif_bladestop(struct block_list *src, int dst_id, int active);
  221.  void clif_changemapcell(int fd, int m, int x, int y, int type, enum send_target target);
  222. Index: src/map/guild.c
  223. --- src/map/guild.c Base (BASE)
  224. +++ src/map/guild.c Locally Modified (Based On LOCAL)
  225. @@ -408,7 +408,7 @@
  226.  	sd->status.guild_id=guild_id;
  227.  	clif_guild_created(sd,0);
  228.  	if(battle_config.guild_emperium_check)
  229. -		pc_delitem(sd,pc_search_inventory(sd,714),1,0,0,LOG_TYPE_CONSUME);	// ᅵGᅵᅵᅵyᅵᅵᅵEᅵᅵᅵᅵᅵᅵ
  230. +		pc_delitem(sd,pc_search_inventory(sd,714),1,0,0,LOG_TYPE_CONSUME);	//emperium consumption
  231.  	return 0;
  232.  }
  233.  
  234. Index: src/map/homunculus.c
  235. --- src/map/homunculus.c Base (BASE)
  236. +++ src/map/homunculus.c Locally Modified (Based On LOCAL)
  237. @@ -81,6 +81,46 @@
  238.  	}
  239.  }
  240.  
  241. +int hom_addspiritball(TBL_HOM *hd, int max) {
  242. +    nullpo_ret(hd);
  243. +
  244. +    if (max > MAX_SKILL_LEVEL)
  245. +        max = MAX_SKILL_LEVEL;
  246. +    if (hd->spiritball < 0)
  247. +        hd->spiritball = 0;
  248. +
  249. +    if (hd->spiritball && hd->spiritball >= max) {
  250. +        hd->spiritball = max;    
  251. +    }
  252. +    else
  253. +        hd->spiritball++;
  254. + 
  255. +    clif_spiritball(&hd->bl);
  256. +
  257. +    return 0;
  258. +}
  259. +
  260. +int hom_delspiritball(TBL_HOM *hd, int count, int type) {
  261. +    nullpo_ret(hd);
  262. +
  263. +    if (hd->spiritball <= 0) {
  264. +        hd->spiritball = 0;
  265. +        return 0;
  266. +    }
  267. +    if (count <= 0)
  268. +        return 0;
  269. +    if (count > MAX_SKILL_LEVEL)
  270. +        count = MAX_SKILL_LEVEL;
  271. +    if (count > hd->spiritball)
  272. +        count = hd->spiritball;
  273. +    
  274. +    hd->spiritball -= count;
  275. +    if (!type)
  276. +        clif_spiritball(&hd->bl);
  277. +
  278. +    return 0;
  279. +}
  280. +
  281.  void merc_damage(struct homun_data *hd) {
  282.  	clif_hominfo(hd->master,hd,0);
  283.  }
  284. Index: src/map/homunculus.h
  285. --- src/map/homunculus.h Base (BASE)
  286. +++ src/map/homunculus.h Locally Modified (Based On LOCAL)
  287. @@ -45,6 +45,8 @@
  288.  	int hungry_timer;	//[orn]
  289.  	unsigned int exp_next;
  290.  	char blockskill[MAX_SKILL];	// [orn]
  291. +    
  292. +    int spiritball; //for homun S [lighta]
  293.  };
  294.  
  295.  #define HOM_EVO 0x100 //256
  296. @@ -112,4 +114,7 @@
  297.  void merc_skill_reload(void);
  298.  void merc_reload(void);
  299.  
  300. +int hom_addspiritball(TBL_HOM *hd, int max);
  301. +int hom_delspiritball(TBL_HOM *hd, int count, int type);
  302. +
  303.  #endif /* _HOMUNCULUS_H_ */
  304. Index: src/map/map.h
  305. --- src/map/map.h Base (BASE)
  306. +++ src/map/map.h Locally Modified (Based On LOCAL)
  307. @@ -718,7 +718,6 @@
  308.  #define mapit_geteachnpc()  mapit_alloc(MAPIT_NORMAL,BL_NPC)
  309.  #define mapit_geteachiddb() mapit_alloc(MAPIT_NORMAL,BL_ALL)
  310.  
  311. -// ᅵᅵᅵ̑ᅵ
  312.  int map_check_dir(int s_dir,int t_dir);
  313.  unsigned char map_calc_dir( struct block_list *src,int x,int y);
  314.  int map_random_dir(struct block_list *bl, short *x, short *y); // [Skotlex]
  315. Index: src/map/mob.c
  316. --- src/map/mob.c Base (BASE)
  317. +++ src/map/mob.c Locally Modified (Based On LOCAL)
  318. @@ -900,10 +900,16 @@
  319.  	return 0;
  320.  }
  321.  
  322. -static int mob_count_sub(struct block_list *bl,va_list ap)
  323. -{
  324. -	return 1;
  325. +int mob_count_sub(struct block_list *bl, va_list ap) {
  326. +    int mobid[10], i;
  327. +    ARR_FIND(0, 10, i, (mobid[i] = va_arg(ap, int)) == 0); //fetch till 0
  328. +    if (mobid[0]) { //if there one let's check it otherwise go backward
  329. +        TBL_MOB *md = BL_CAST(BL_MOB, bl);
  330. +        ARR_FIND(0, 10, i, md->class_ == mobid[i]);
  331. +        return (i < 10) ? 1 : 0;
  332.  }
  333. +    return 1; //backward compatibility [Lighta]
  334. +}
  335.  
  336.  /*==========================================
  337.   * Mob spawning. Initialization is also variously here.
  338. Index: src/map/mob.h
  339. --- src/map/mob.h Base (BASE)
  340. +++ src/map/mob.h Locally Modified (Based On LOCAL)
  341. @@ -291,6 +291,7 @@
  342.  int mobskill_castend_pos( int tid, unsigned int tick, int id,int data );
  343.  int mob_summonslave(struct mob_data *md2,int *value,int amount,int skill_id);
  344.  int mob_countslave(struct block_list *bl);
  345. +int mob_count_sub(struct block_list *bl, va_list ap);
  346.  
  347.  int mob_is_clone(int class_);
  348.  
  349. Index: src/map/npc.c
  350. --- src/map/npc.c Base (BASE)
  351. +++ src/map/npc.c Locally Modified (Based On LOCAL)
  352. @@ -2236,7 +2236,7 @@
  353.  }
  354.  
  355.  /**
  356. - * NPCのラベルデヌタコンバヌト
  357. + * NPC other label
  358.   * Not sure, seem to add label in a chainlink
  359.   * @see DBApply
  360.   */
  361. Index: src/map/pc.c
  362. --- src/map/pc.c Base (BASE)
  363. +++ src/map/pc.c Locally Modified (Based On LOCAL)
  364. @@ -171,7 +171,7 @@
  365.  		memmove(sd->spirit_timer+i, sd->spirit_timer+i+1, (sd->spiritball-i)*sizeof(int));
  366.  	sd->spirit_timer[sd->spiritball] = INVALID_TIMER;
  367.  
  368. -	clif_spiritball(sd);
  369. +	clif_spiritball(&sd->bl);
  370.  
  371.  	return 0;
  372.  }
  373. @@ -206,7 +206,7 @@
  374.  	if( (sd->class_&MAPID_THIRDMASK) == MAPID_ROYAL_GUARD )
  375.  		clif_millenniumshield(sd,sd->spiritball);
  376.  	else
  377. -		clif_spiritball(sd);
  378. +		clif_spiritball(&sd->bl);
  379.  
  380.  	return 0;
  381.  }
  382. @@ -245,7 +245,7 @@
  383.  		if( (sd->class_&MAPID_THIRDMASK) == MAPID_ROYAL_GUARD )
  384.  			clif_millenniumshield(sd,sd->spiritball);
  385.  		else
  386. -			clif_spiritball(sd);
  387. +			clif_spiritball(&sd->bl);
  388.  	}
  389.  	return 0;
  390.  }
  391. @@ -2618,7 +2618,7 @@
  392.  }
  393.  
  394.  /*==========================================
  395. - * ? ???i????\????~{??i?X???
  396. + * Player bonus (type) with args type2 and val, called trough bonus2 (npc)
  397.   *------------------------------------------*/
  398.  int pc_bonus2(struct map_session_data *sd,int type,int type2,int val)
  399.  {
  400. @@ -4859,13 +4859,10 @@
  401.  }
  402.  
  403.  /*==========================================
  404. - * ??????X????X?L???????`?F?b?N
  405. - * ????F
  406. - *   struct map_session_data *sd	?Z?b?V?????f??^
  407. - *   int nameid						????iID
  408. - * ???l?F
  409. - *   0		??X???
  410. - *   -1		?X?L????????
  411. + * Chk if we still have the correct weapon to continue the skill (actually status)
  412. + * If not ending it
  413. + * Return
  414. + *	0 - No status found or all done
  415.   *------------------------------------------*/
  416.  int pc_checkallowskill(struct map_session_data *sd)
  417.  {
  418. @@ -4916,7 +4913,9 @@
  419.  
  420.  /*==========================================
  421.   * Return equiped itemid? on player sd at pos
  422. - * if -1 mean nothing equiped
  423. + * Return
  424. + * -1 : mean nothing equiped
  425. + * idx : (this index could be used in inventory to found item_data)
  426.   *------------------------------------------*/
  427.  int pc_checkequip(struct map_session_data *sd,int pos)
  428.  {
  429. @@ -6448,8 +6447,10 @@
  430.  			pet_unlocktarget(sd->pd);
  431.  	}
  432.  
  433. -	if( sd->status.hom_id > 0 && battle_config.homunculus_auto_vapor )
  434. +    if (sd->status.hom_id > 0){        
  435. +        if(battle_config.homunculus_auto_vapor && sd->hd && !sd->hd->sc.data[SC_LIGHT_OF_REGENE])
  436.  		merc_hom_vaporize(sd, 0);
  437. +    }
  438.  
  439.  	if( sd->md )
  440.  		merc_delete(sd->md, 3); // Your mercenary soldier has ran away.
  441. @@ -7490,7 +7491,7 @@
  442.  int pc_setfalcon(TBL_PC* sd, int flag)
  443.  {
  444.  	if( flag ){
  445. -		if( pc_checkskill(sd,HT_FALCON)>0 )	// ?t?@???R???}?X?^????X?L??????
  446. +		if( pc_checkskill(sd,HT_FALCON)>0 )	// add falcon if he have the skill
  447.  			pc_setoption(sd,sd->sc.option|OPTION_FALCON);
  448.  	} else if( pc_isfalcon(sd) ){
  449.  		pc_setoption(sd,sd->sc.option&~OPTION_FALCON); // remove falcon
  450. @@ -7505,7 +7506,7 @@
  451.  int pc_setriding(TBL_PC* sd, int flag)
  452.  {
  453.  	if( flag ){
  454. -		if( pc_checkskill(sd,KN_RIDING) > 0 ) // ???C?f?B???O?X?L??????
  455. +		if( pc_checkskill(sd,KN_RIDING) > 0 ) // add peco
  456.  			pc_setoption(sd, sd->sc.option|OPTION_RIDING);
  457.  	} else if( pc_isriding(sd) ){
  458.  			pc_setoption(sd, sd->sc.option&~OPTION_RIDING);
  459. Index: src/map/script.c
  460. --- src/map/script.c Base (BASE)
  461. +++ src/map/script.c Locally Modified (Based On LOCAL)
  462. @@ -283,9 +283,9 @@
  463.  		int count;
  464.  		int flag;
  465.  		struct linkdb_node *case_label;
  466. -	} curly[256];		// ᅵEᅵJᅵbᅵRᅵ̏ᅵᅵ
  467. -	int curly_count;	// ᅵEᅵJᅵbᅵRᅵ̐ᅵ
  468. -	int index;			// ᅵXᅵNᅵᅵᅵvᅵgᅵᅵᅵŎgᅵpᅵᅵᅵᅵᅵ\ᅵᅵᅵ̐ᅵ
  469. +	} curly[256];		// Information right parenthesis
  470. +	int curly_count;	// The number of right brackets
  471. +	int index;			// Number of the syntax used in the script
  472.  } syntax;
  473.  
  474.  const char* parse_curly_close(const char* p);
  475. @@ -338,7 +338,7 @@
  476.  #endif
  477.  
  478.  /*==========================================
  479. - * ᅵᅵᅵ[ï¿œJᅵᅵᅵvᅵᅵᅵgï¿œ^ï¿œCï¿œvᅵ錟 (ï¿œKï¿œvᅵȕᅵᅵ̂ᅵ)
  480. + * (Only those needed) local declaration prototype
  481.   *------------------------------------------*/
  482.  const char* parse_subexpr(const char* p,int limit);
  483.  int run_func(struct script_state *st);
  484. @@ -618,7 +618,7 @@
  485.  
  486.  
  487.  /*==========================================
  488. - * ᅵGᅵᅵᅵ[ᅵᅵᅵbᅵZᅵ[ᅵWᅵoᅵᅵ
  489. + * Output error message
  490.   *------------------------------------------*/
  491.  static void disp_error_message2(const char *mes,const char *pos,int report)
  492.  {
  493. @@ -808,7 +808,7 @@
  494.  
  495.  ///
  496.  /// @param l The id of the str_data entry
  497. -// ᅵőᅵ16Mᅵ܂ᅵ
  498. +// Maximum up to 16M
  499.  static void add_scriptl(int l)
  500.  {
  501.  	int backpatch = str_data[l].backpatch;
  502. @@ -823,7 +823,7 @@
  503.  		break;
  504.  	case C_NOP:
  505.  	case C_USERFUNC:
  506. -		// ᅵᅵᅵxᅵᅵᅵ̉”\ᅵᅵᅵᅵᅵᅵᅵᅵ̂ᅵbackpatchï¿œpï¿œfï¿œ[ï¿œ^ᅵᅵᅵߍᅵᅵᅵ
  507. +		// Embedded data backpatch there is a possibility of label
  508.  		add_scriptc(C_NAME);
  509.  		str_data[l].backpatch = script_pos;
  510.  		add_scriptb(backpatch);
  511. @@ -845,7 +845,7 @@
  512.  }
  513.  
  514.  /*==========================================
  515. - * ᅵᅵᅵxᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵ
  516. + * Resolve the label
  517.   *------------------------------------------*/
  518.  void set_label(int l,int pos, const char* script_pos)
  519.  {
  520. @@ -1218,7 +1218,7 @@
  521.  }
  522.  
  523.  /*==========================================
  524. - * ᅵᅵᅵ̉ᅵᅵ
  525. + * Analysis section
  526.   *------------------------------------------*/
  527.  const char* parse_simpleexpr(const char *p)
  528.  {
  529. @@ -1319,7 +1319,7 @@
  530.  }
  531.  
  532.  /*==========================================
  533. - * ᅵᅵᅵ̉ᅵᅵ
  534. + * Analysis of the expression
  535.   *------------------------------------------*/
  536.  const char* parse_subexpr(const char* p,int limit)
  537.  {
  538. @@ -1381,7 +1381,7 @@
  539.  }
  540.  
  541.  /*==========================================
  542. - * ᅵᅵᅵ̕]ᅵᅵ
  543. + * Evaluation of the expression
  544.   *------------------------------------------*/
  545.  const char* parse_expr(const char *p)
  546.  {
  547. @@ -1395,7 +1395,7 @@
  548.  }
  549.  
  550.  /*==========================================
  551. - * ï¿œsᅵ̉ᅵᅵ
  552. + * Analysis of the line
  553.   *------------------------------------------*/
  554.  const char* parse_line(const char* p)
  555.  {
  556. @@ -1403,7 +1403,7 @@
  557.  
  558.  	p=skip_space(p);
  559.  	if(*p==';') {
  560. -		// if(); for(); while(); ᅵ̂ᅵᅵ߂ɕ‚ᅵᅵᅵᅵᅵ
  561. +		//Close decision for if(); for(); while(); 
  562.  		p = parse_syntax_close(p + 1);
  563.  		return p;
  564.  	}
  565. @@ -1421,7 +1421,7 @@
  566.  		return parse_curly_close(p);
  567.  	}
  568.  
  569. -	// ï¿œ\ᅵᅵᅵ֘Aᅵ̏ᅵᅵᅵ
  570. +	// Syntax-related processing
  571.  	p2 = parse_syntax(p);
  572.  	if(p2 != NULL)
  573.  		return p2;
  574. @@ -1445,13 +1445,13 @@
  575.  			disp_error_message("parse_line: need ';'",p);
  576.  	}
  577.  
  578. -	// if, for , while ᅵ̕‚ᅵᅵᅵᅵᅵ
  579. +	//Binding decision for if(), for(), while() 
  580.  	p = parse_syntax_close(p+1);
  581.  
  582.  	return p;
  583.  }
  584.  
  585. -// { ... } ᅵ̕‚ᅵᅵᅵᅵᅵ
  586. +// { ... } Closing process
  587.  const char* parse_curly_close(const char* p)
  588.  {
  589.  	if(syntax.curly_count <= 0) {
  590. @@ -1459,46 +1459,46 @@
  591.  		return p + 1;
  592.  	} else if(syntax.curly[syntax.curly_count-1].type == TYPE_NULL) {
  593.  		syntax.curly_count--;
  594. -		// if, for , while ᅵ̕‚ᅵᅵᅵᅵᅵ
  595. +		//Close decision  if, for , while
  596.  		p = parse_syntax_close(p + 1);
  597.  		return p;
  598.  	} else if(syntax.curly[syntax.curly_count-1].type == TYPE_SWITCH) {
  599. -		// switch() ᅵ‚ᅵᅵᅵᅵᅵ
  600. +		//Closing switch()
  601.  		int pos = syntax.curly_count-1;
  602.  		char label[256];
  603.  		int l;
  604. -		// ᅵꎞᅵϐᅵᅵᅵᅵᅵᅵᅵ
  605. +		// Remove temporary variables
  606.  		sprintf(label,"set $@__SW%x_VAL,0;",syntax.curly[pos].index);
  607.  		syntax.curly[syntax.curly_count++].type = TYPE_NULL;
  608.  		parse_line(label);
  609.  		syntax.curly_count--;
  610.  
  611. -		// ᅵᅵᅵᅵᅵᅵᅵŏIᅵᅵᅵ|ï¿œCᅵᅵᅵ^ᅵɈړᅵ
  612. +		// Go to the end pointer unconditionally
  613.  		sprintf(label,"goto __SW%x_FIN;",syntax.curly[pos].index);
  614.  		syntax.curly[syntax.curly_count++].type = TYPE_NULL;
  615.  		parse_line(label);
  616.  		syntax.curly_count--;
  617.  
  618. -		// ᅵᅵᅵݒnᅵ̃ᅵᅵxᅵᅵᅵᅵtᅵᅵᅵᅵ
  619. +		// You are here labeled
  620.  		sprintf(label,"__SW%x_%x",syntax.curly[pos].index,syntax.curly[pos].count);
  621.  		l=add_str(label);
  622.  		set_label(l,script_pos, p);
  623.  
  624.  		if(syntax.curly[pos].flag) {
  625. -			// default ᅵᅵᅵᅵᅵ݂ᅵᅵᅵ
  626. +			//Exists default 
  627.  			sprintf(label,"goto __SW%x_DEF;",syntax.curly[pos].index);
  628.  			syntax.curly[syntax.curly_count++].type = TYPE_NULL;
  629.  			parse_line(label);
  630.  			syntax.curly_count--;
  631.  		}
  632.  
  633. -		// ᅵIᅵᅵᅵᅵᅵxᅵᅵᅵᅵtᅵᅵᅵᅵ
  634. +		// Label end
  635.  		sprintf(label,"__SW%x_FIN",syntax.curly[pos].index);
  636.  		l=add_str(label);
  637.  		set_label(l,script_pos, p);
  638.  		linkdb_final(&syntax.curly[pos].case_label);	// free the list of case label
  639.  		syntax.curly_count--;
  640. -		// if, for , while ᅵ̕‚ᅵᅵᅵᅵᅵ
  641. +		//Closing decision if, for , while
  642.  		p = parse_syntax_close(p + 1);
  643.  		return p;
  644.  	} else {
  645. @@ -1507,9 +1507,9 @@
  646.  	}
  647.  }
  648.  
  649. -// ï¿œ\ᅵᅵᅵ֘Aᅵ̏ᅵᅵᅵ
  650. +// Syntax-related processing
  651.  //	 break, case, continue, default, do, for, function,
  652. -//	 if, switch, while ᅵᅵᅵᅵᅵ̓ᅵᅵᅵᅵŏᅵᅵᅵᅵᅵᅵ܂ᅵᅵB
  653. +//	 if, switch, while ? will handle this internally.
  654.  const char* parse_syntax(const char* p)
  655.  {
  656.  	const char *p2 = skip_word(p);
  657. @@ -1518,7 +1518,7 @@
  658.  	case 'B':
  659.  	case 'b':
  660.  		if(p2 - p == 5 && !strncasecmp(p,"break",5)) {
  661. -			// break ᅵ̏ᅵᅵᅵ
  662. +			// break Processing
  663.  			char label[256];
  664.  			int pos = syntax.curly_count - 1;
  665.  			while(pos >= 0) {
  666. @@ -1547,7 +1547,7 @@
  667.  			p = skip_space(p2);
  668.  			if(*p != ';')
  669.  				disp_error_message("parse_syntax: need ';'",p);
  670. -			// if, for , while ᅵ̕‚ᅵᅵᅵᅵᅵ
  671. +			// Closing decision if, for , while
  672.  			p = parse_syntax_close(p + 1);
  673.  			return p;
  674.  		}
  675. @@ -1555,7 +1555,7 @@
  676.  	case 'c':
  677.  	case 'C':
  678.  		if(p2 - p == 4 && !strncasecmp(p,"case",4)) {
  679. -			// case ᅵ̏ᅵᅵᅵ
  680. +			//Processing case
  681.  			int pos = syntax.curly_count-1;
  682.  			if(pos < 0 || syntax.curly[pos].type != TYPE_SWITCH) {
  683.  				disp_error_message("parse_syntax: unexpected 'case' ",p);
  684. @@ -1565,18 +1565,18 @@
  685.  				int  l,v;
  686.  				char *np;
  687.  				if(syntax.curly[pos].count != 1) {
  688. -					// FALLTHRU ï¿œpᅵ̃Wᅵᅵᅵᅵᅵv
  689. +					//Jump for FALLTHRU
  690.  					sprintf(label,"goto __SW%x_%xJ;",syntax.curly[pos].index,syntax.curly[pos].count);
  691.  					syntax.curly[syntax.curly_count++].type = TYPE_NULL;
  692.  					parse_line(label);
  693.  					syntax.curly_count--;
  694.  
  695. -					// ᅵᅵᅵݒnᅵ̃ᅵᅵxᅵᅵᅵᅵtᅵᅵᅵᅵ
  696. +					// You are here labeled
  697.  					sprintf(label,"__SW%x_%x",syntax.curly[pos].index,syntax.curly[pos].count);
  698.  					l=add_str(label);
  699.  					set_label(l,script_pos, p);
  700.  				}
  701. -				// switch ᅵᅵᅵ蕶
  702. +				//Decision statement switch
  703.  				p = skip_space(p2);
  704.  				if(p == p2) {
  705.  					disp_error_message("parse_syntax: expect space ' '",p);
  706. @@ -1604,12 +1604,12 @@
  707.  				sprintf(label,"if(%d != $@__SW%x_VAL) goto __SW%x_%x;",
  708.  					v,syntax.curly[pos].index,syntax.curly[pos].index,syntax.curly[pos].count+1);
  709.  				syntax.curly[syntax.curly_count++].type = TYPE_NULL;
  710. -				// ï¿œQᅵᅵparse ᅵᅵᅵȂᅵᅵƃ_ᅵᅵ
  711. +				// Bad I do not parse twice
  712.  				p2 = parse_line(label);
  713.  				parse_line(p2);
  714.  				syntax.curly_count--;
  715.  				if(syntax.curly[pos].count != 1) {
  716. -					// FALLTHRU ï¿œIᅵᅵᅵᅵ̃ᅵᅵxᅵᅵ
  717. +					// Label after the completion of FALLTHRU
  718.  					sprintf(label,"__SW%x_%xJ",syntax.curly[pos].index,syntax.curly[pos].count);
  719.  					l=add_str(label);
  720.  					set_label(l,script_pos,p);
  721. @@ -1628,13 +1628,13 @@
  722.  			}
  723.  			return p + 1;
  724.  		} else if(p2 - p == 8 && !strncasecmp(p,"continue",8)) {
  725. -			// continue ᅵ̏ᅵᅵᅵ
  726. +			// Processing continue
  727.  			char label[256];
  728.  			int pos = syntax.curly_count - 1;
  729.  			while(pos >= 0) {
  730.  				if(syntax.curly[pos].type == TYPE_DO) {
  731.  					sprintf(label,"goto __DO%x_NXT;",syntax.curly[pos].index);
  732. -					syntax.curly[pos].flag = 1; // continue ï¿œpᅵ̃ᅵᅵᅵᅵNᅵᅵᅵᅵtᅵᅵᅵO
  733. +					syntax.curly[pos].flag = 1; //Flag put the link for continue
  734.  					break;
  735.  				} else if(syntax.curly[pos].type == TYPE_FOR) {
  736.  					sprintf(label,"goto __FR%x_NXT;",syntax.curly[pos].index);
  737. @@ -1655,7 +1655,7 @@
  738.  			p = skip_space(p2);
  739.  			if(*p != ';')
  740.  				disp_error_message("parse_syntax: need ';'",p);
  741. -			// if, for , while ᅵ̕‚ᅵᅵᅵᅵᅵ
  742. +			//Closing decision if, for , while
  743.  			p = parse_syntax_close(p + 1);
  744.  			return p;
  745.  		}
  746. @@ -1663,7 +1663,7 @@
  747.  	case 'd':
  748.  	case 'D':
  749.  		if(p2 - p == 7 && !strncasecmp(p,"default",7)) {
  750. -			// switch - default ᅵ̏ᅵᅵᅵ
  751. +			// Switch - default processing
  752.  			int pos = syntax.curly_count-1;
  753.  			if(pos < 0 || syntax.curly[pos].type != TYPE_SWITCH) {
  754.  				disp_error_message("parse_syntax: unexpected 'default'",p);
  755. @@ -1672,7 +1672,7 @@
  756.  			} else {
  757.  				char label[256];
  758.  				int l;
  759. -				// ᅵᅵᅵݒnᅵ̃ᅵᅵxᅵᅵᅵᅵtᅵᅵᅵᅵ
  760. +				// Put the label location
  761.  				p = skip_space(p2);
  762.  				if(*p != ':') {
  763.  					disp_error_message("parse_syntax: need ':'",p);
  764. @@ -1681,13 +1681,13 @@
  765.  				l=add_str(label);
  766.  				set_label(l,script_pos,p);
  767.  
  768. -				// ᅵᅵᅵᅵᅵᅵᅵŎᅵᅵ̃ᅵᅵᅵᅵNᅵɔᅵ΂ᅵ
  769. +				// Skip to the next link w/o condition
  770.  				sprintf(label,"goto __SW%x_%x;",syntax.curly[pos].index,syntax.curly[pos].count+1);
  771.  				syntax.curly[syntax.curly_count++].type = TYPE_NULL;
  772.  				parse_line(label);
  773.  				syntax.curly_count--;
  774.  
  775. -				// default ᅵ̃ᅵᅵxᅵᅵᅵᅵtᅵᅵᅵᅵ
  776. +				// The default label
  777.  				sprintf(label,"__SW%x_DEF",syntax.curly[pos].index);
  778.  				l=add_str(label);
  779.  				set_label(l,script_pos,p);
  780. @@ -1705,7 +1705,7 @@
  781.  			syntax.curly[syntax.curly_count].count = 1;
  782.  			syntax.curly[syntax.curly_count].index = syntax.index++;
  783.  			syntax.curly[syntax.curly_count].flag  = 0;
  784. -			// ᅵᅵᅵݒnᅵ̃ᅵᅵxᅵᅵᅵ`ᅵᅵᅵᅵᅵᅵ
  785. +			// Label of the (do) form here
  786.  			sprintf(label,"__DO%x_BGN",syntax.curly[syntax.curly_count].index);
  787.  			l=add_str(label);
  788.  			set_label(l,script_pos,p);
  789. @@ -1731,22 +1731,22 @@
  790.  				disp_error_message("parse_syntax: need '('",p);
  791.  			p++;
  792.  
  793. -			// ᅵᅵᅵᅵᅵᅵᅵᅵᅵsᅵᅵᅵᅵ
  794. +			// Execute the initialization statement
  795.  			syntax.curly[syntax.curly_count++].type = TYPE_NULL;
  796.  			p=parse_line(p);
  797.  			syntax.curly_count--;
  798.  
  799. -			// ᅵᅵᅵᅵᅵᅵᅵfï¿œJï¿œnᅵ̃ᅵᅵxᅵᅵᅵ`ᅵᅵᅵᅵᅵᅵ
  800. +			// Form the start of label decision
  801.  			sprintf(label,"__FR%x_J",syntax.curly[pos].index);
  802.  			l=add_str(label);
  803.  			set_label(l,script_pos,p);
  804.  
  805.  			p=skip_space(p);
  806.  			if(*p == ';') {
  807. -				// for(;;) ᅵ̃pï¿œ^ï¿œ[ᅵᅵᅵȂ̂ŕKᅵᅵᅵ^
  808. +				// For (; Because the pattern of always true ;)
  809.  				;
  810.  			} else {
  811. -				// ᅵᅵᅵᅵᅵᅵᅵUᅵȂᅵIᅵᅵᅵnï¿œ_ᅵɔᅵ΂ᅵ
  812. +				// Skip to the end point if the condition is false
  813.  				sprintf(label,"__FR%x_FIN",syntax.curly[pos].index);
  814.  				add_scriptl(add_str("jump_zero"));
  815.  				add_scriptc(C_ARG);
  816. @@ -1759,32 +1759,32 @@
  817.  				disp_error_message("parse_syntax: need ';'",p);
  818.  			p++;
  819.  
  820. -			// ᅵᅵᅵ[ï¿œvï¿œJï¿œnᅵɔᅵ΂ᅵ
  821. +			// Skip to the beginning of the loop
  822.  			sprintf(label,"goto __FR%x_BGN;",syntax.curly[pos].index);
  823.  			syntax.curly[syntax.curly_count++].type = TYPE_NULL;
  824.  			parse_line(label);
  825.  			syntax.curly_count--;
  826.  
  827. -			// ᅵᅵᅵ̃ᅵᅵ[ï¿œvᅵւ̃ᅵᅵxᅵᅵᅵ`ᅵᅵᅵᅵᅵᅵ
  828. +			// Labels to form the next loop
  829.  			sprintf(label,"__FR%x_NXT",syntax.curly[pos].index);
  830.  			l=add_str(label);
  831.  			set_label(l,script_pos,p);
  832.  
  833. -			// ᅵᅵᅵ̃ᅵᅵ[ï¿œvᅵɓᅵ鎞ᅵ̏ᅵᅵᅵ
  834. -			// for ᅵŌᅵᅵ ')' ᅵᅵ ';' ᅵƂᅵᅵĈᅵᅵᅵᅵtᅵᅵᅵO
  835. +			// Process the next time you enter the loop
  836. +			// A ')' last for; flag to be treated as'
  837.  			parse_syntax_for_flag = 1;
  838.  			syntax.curly[syntax.curly_count++].type = TYPE_NULL;
  839.  			p=parse_line(p);
  840.  			syntax.curly_count--;
  841.  			parse_syntax_for_flag = 0;
  842.  
  843. -			// ᅵᅵᅵᅵᅵᅵᅵ菈ᅵᅵᅵɔᅵ΂ᅵ
  844. +			// Skip to the determination process conditions
  845.  			sprintf(label,"goto __FR%x_J;",syntax.curly[pos].index);
  846.  			syntax.curly[syntax.curly_count++].type = TYPE_NULL;
  847.  			parse_line(label);
  848.  			syntax.curly_count--;
  849.  
  850. -			// ᅵᅵᅵ[ï¿œvï¿œJï¿œnᅵ̃ᅵᅵxᅵᅵᅵtᅵᅵ
  851. +			// Loop start labeling
  852.  			sprintf(label,"__FR%x_BGN",syntax.curly[pos].index);
  853.  			l=add_str(label);
  854.  			set_label(l,script_pos,p);
  855. @@ -1811,7 +1811,7 @@
  856.  				else
  857.  					disp_error_message("parse_syntax:function: function name is invalid", func_name);
  858.  
  859. -				// if, for , while ᅵ̕‚ᅵᅵᅵᅵᅵ
  860. +				// Close condition of if, for, while
  861.  				p = parse_syntax_close(p2 + 1);
  862.  				return p;
  863.  			}
  864. @@ -1856,7 +1856,7 @@
  865.  	case 'i':
  866.  	case 'I':
  867.  		if(p2 - p == 2 && !strncasecmp(p,"if",2)) {
  868. -			// if() ᅵ̏ᅵᅵᅵ
  869. +			// If process
  870.  			char label[256];
  871.  			p=skip_space(p2);
  872.  			if(*p != '(') { //Prevent if this {} non-c syntax. from Rayce (jA)
  873. @@ -1880,7 +1880,7 @@
  874.  	case 's':
  875.  	case 'S':
  876.  		if(p2 - p == 6 && !strncasecmp(p,"switch",6)) {
  877. -			// switch() ᅵ̏ᅵᅵᅵ
  878. +			// Processing of switch ()
  879.  			char label[256];
  880.  			p=skip_space(p2);
  881.  			if(*p != '(') {
  882. @@ -1917,12 +1917,12 @@
  883.  			syntax.curly[syntax.curly_count].count = 1;
  884.  			syntax.curly[syntax.curly_count].index = syntax.index++;
  885.  			syntax.curly[syntax.curly_count].flag  = 0;
  886. -			// ᅵᅵᅵᅵᅵᅵᅵfï¿œJï¿œnᅵ̃ᅵᅵxᅵᅵᅵ`ᅵᅵᅵᅵᅵᅵ
  887. +			// Form the start of label decision
  888.  			sprintf(label,"__WL%x_NXT",syntax.curly[syntax.curly_count].index);
  889.  			l=add_str(label);
  890.  			set_label(l,script_pos,p);
  891.  
  892. -			// ᅵᅵᅵᅵᅵᅵᅵUᅵȂᅵIᅵᅵᅵnï¿œ_ᅵɔᅵ΂ᅵ
  893. +			// Skip to the end point if the condition is false
  894.  			sprintf(label,"__WL%x_FIN",syntax.curly[syntax.curly_count].index);
  895.  			syntax.curly_count++;
  896.  			add_scriptl(add_str("jump_zero"));
  897. @@ -1939,7 +1939,7 @@
  898.  }
  899.  
  900.  const char* parse_syntax_close(const char *p) {
  901. -	// if(...) for(...) hoge(); ᅵ̂悀ᅵɁAï¿œPï¿œxᅵ‚ᅵᅵᅵꂜᅵᅵēxᅵ‚ᅵᅵᅵᅵ邩ᅵmï¿œFᅵᅵᅵᅵ
  902. +	// If (...) for (...) hoge (); as to make sure closed closed once again
  903.  	int flag;
  904.  
  905.  	do {
  906. @@ -1948,9 +1948,9 @@
  907.  	return p;
  908.  }
  909.  
  910. -// if, for , while , do ᅵ̕‚ᅵᅵᅵᅵᅵ
  911. -//	 flag == 1 : ᅵ‚ᅵᅵᅵꂜ
  912. -//	 flag == 0 : ᅵ‚ᅵᅵᅵᅵȂᅵ
  913. +// Close judgment if, for, while, of do
  914. +//	 flag == 1 : closed
  915. +//	 flag == 0 : not closed
  916.  const char* parse_syntax_close_sub(const char* p,int* flag)
  917.  {
  918.  	char label[256];
  919. @@ -1968,13 +1968,13 @@
  920.  		// if-block and else-block end is a new line
  921.  		parse_nextline(false, p);
  922.  
  923. -		// if ᅵŏIᅵꏊᅵ֔ᅵ΂ᅵ
  924. +		// Skip to the last location if
  925.  		sprintf(label,"goto __IF%x_FIN;",syntax.curly[pos].index);
  926.  		syntax.curly[syntax.curly_count++].type = TYPE_NULL;
  927.  		parse_line(label);
  928.  		syntax.curly_count--;
  929.  
  930. -		// ᅵᅵᅵݒnᅵ̃ᅵᅵxᅵᅵᅵᅵtᅵᅵᅵᅵ
  931. +		// Put the label of the location
  932.  		sprintf(label,"__IF%x_%x",syntax.curly[pos].index,syntax.curly[pos].count);
  933.  		l=add_str(label);
  934.  		set_label(l,script_pos,p);
  935. @@ -2010,14 +2010,14 @@
  936.  				}
  937.  			}
  938.  		}
  939. -		// if ᅵ‚ᅵ
  940. +		// Close if
  941.  		syntax.curly_count--;
  942. -		// ᅵŏIï¿œnᅵ̃ᅵᅵxᅵᅵᅵᅵtᅵᅵᅵᅵ
  943. +		// Put the label of the final location
  944.  		sprintf(label,"__IF%x_FIN",syntax.curly[pos].index);
  945.  		l=add_str(label);
  946.  		set_label(l,script_pos,p);
  947.  		if(syntax.curly[pos].flag == 1) {
  948. -			// ᅵᅵᅵᅵifᅵɑ΂ᅵᅵᅵelseᅵᅵᅵᅵȂᅵᅵ̂Ń|ï¿œCᅵᅵᅵ^ᅵ̈ʒuᅵ͓ᅵᅵᅵ
  949. +			// Because the position of the pointer is the same if not else for this
  950.  			return bp;
  951.  		}
  952.  		return p;
  953. @@ -2027,13 +2027,13 @@
  954.  		const char *p2;
  955.  
  956.  		if(syntax.curly[pos].flag) {
  957. -			// ᅵᅵᅵݒnᅵ̃ᅵᅵxᅵᅵᅵ`ᅵᅵᅵᅵᅵᅵ(continue ᅵłᅵᅵᅵᅵɗᅵᅵᅵ)
  958. +			// (Come here continue) to form the label here
  959.  			sprintf(label,"__DO%x_NXT",syntax.curly[pos].index);
  960.  			l=add_str(label);
  961.  			set_label(l,script_pos,p);
  962.  		}
  963.  
  964. -		// ᅵᅵᅵᅵᅵᅵᅵUᅵȂᅵIᅵᅵᅵnï¿œ_ᅵɔᅵ΂ᅵ
  965. +		// Skip to the end point if the condition is false
  966.  		p = skip_space(p);
  967.  		p2 = skip_word(p);
  968.  		if(p2 - p != 5 || strncasecmp(p,"while",5))
  969. @@ -2055,13 +2055,13 @@
  970.  		add_scriptl(add_str(label));
  971.  		add_scriptc(C_FUNC);
  972.  
  973. -		// ï¿œJï¿œnï¿œnï¿œ_ᅵɔᅵ΂ᅵ
  974. +		// Skip to the starting point
  975.  		sprintf(label,"goto __DO%x_BGN;",syntax.curly[pos].index);
  976.  		syntax.curly[syntax.curly_count++].type = TYPE_NULL;
  977.  		parse_line(label);
  978.  		syntax.curly_count--;
  979.  
  980. -		// ᅵᅵᅵᅵᅵIᅵᅵᅵnï¿œ_ᅵ̃ᅵᅵxᅵᅵᅵ`ᅵᅵᅵᅵᅵᅵ
  981. +		// Form label of the end point conditions
  982.  		sprintf(label,"__DO%x_FIN",syntax.curly[pos].index);
  983.  		l=add_str(label);
  984.  		set_label(l,script_pos,p);
  985. @@ -2077,13 +2077,13 @@
  986.  		// for-block end is a new line
  987.  		parse_nextline(false, p);
  988.  
  989. -		// ᅵᅵᅵ̃ᅵᅵ[ï¿œvᅵɔᅵ΂ᅵ
  990. +		// Skip to the next loop
  991.  		sprintf(label,"goto __FR%x_NXT;",syntax.curly[pos].index);
  992.  		syntax.curly[syntax.curly_count++].type = TYPE_NULL;
  993.  		parse_line(label);
  994.  		syntax.curly_count--;
  995.  
  996. -		// for ï¿œIᅵᅵᅵ̃ᅵᅵxᅵᅵᅵtᅵᅵ
  997. +		// End for labeling
  998.  		sprintf(label,"__FR%x_FIN",syntax.curly[pos].index);
  999.  		l=add_str(label);
  1000.  		set_label(l,script_pos,p);
  1001. @@ -2093,13 +2093,13 @@
  1002.  		// while-block end is a new line
  1003.  		parse_nextline(false, p);
  1004.  
  1005. -		// while ᅵᅵᅵᅵᅵᅵᅵfᅵ֔ᅵ΂ᅵ
  1006. +		// Skip to the decision while
  1007.  		sprintf(label,"goto __WL%x_NXT;",syntax.curly[pos].index);
  1008.  		syntax.curly[syntax.curly_count++].type = TYPE_NULL;
  1009.  		parse_line(label);
  1010.  		syntax.curly_count--;
  1011.  
  1012. -		// while ï¿œIᅵᅵᅵ̃ᅵᅵxᅵᅵᅵtᅵᅵ
  1013. +		// End while labeling
  1014.  		sprintf(label,"__WL%x_FIN",syntax.curly[pos].index);
  1015.  		l=add_str(label);
  1016.  		set_label(l,script_pos,p);
  1017. @@ -2109,13 +2109,13 @@
  1018.  		int pos = syntax.curly_count-1;
  1019.  		char label[256];
  1020.  		int l;
  1021. -		// ᅵ߂ᅵ
  1022. +		// Back
  1023.  		sprintf(label,"return;");
  1024.  		syntax.curly[syntax.curly_count++].type = TYPE_NULL;
  1025.  		parse_line(label);
  1026.  		syntax.curly_count--;
  1027.  
  1028. -		// ᅵᅵᅵݒnᅵ̃ᅵᅵxᅵᅵᅵᅵtᅵᅵᅵᅵ
  1029. +		// Put the label of the location
  1030.  		sprintf(label,"__FN%x_FIN",syntax.curly[pos].index);
  1031.  		l=add_str(label);
  1032.  		set_label(l,script_pos,p);
  1033. @@ -2128,7 +2128,7 @@
  1034.  }
  1035.  
  1036.  /*==========================================
  1037. - * ï¿œgᅵݍᅵᅵ݊֐ᅵᅵ̒ljᅵ
  1038. + * Added built-in functions
  1039.   *------------------------------------------*/
  1040.  static void add_buildin_func(void)
  1041.  {
  1042. @@ -2158,10 +2158,10 @@
  1043.  			str_data[n].val = i;
  1044.  			str_data[n].func = buildin_func[i].func;
  1045.  
  1046. -			if( !strcmp(buildin_func[i].name, "set") ) buildin_set_ref = n; else
  1047. -			if( !strcmp(buildin_func[i].name, "callsub") ) buildin_callsub_ref = n; else
  1048. -			if( !strcmp(buildin_func[i].name, "callfunc") ) buildin_callfunc_ref = n; else
  1049. -			if( !strcmp(buildin_func[i].name, "getelementofarray") ) buildin_getelementofarray_ref = n;
  1050. +            if (!strcmp(buildin_func[i].name, "set")) buildin_set_ref = n;
  1051. +            else if (!strcmp(buildin_func[i].name, "callsub")) buildin_callsub_ref = n;
  1052. +            else if (!strcmp(buildin_func[i].name, "callfunc")) buildin_callfunc_ref = n;
  1053. +            else if( !strcmp(buildin_func[i].name, "getelementofarray") ) buildin_getelementofarray_ref = n;
  1054.  		}
  1055.  	}
  1056.  }
  1057. @@ -2201,7 +2201,8 @@
  1058.  }
  1059.  
  1060.  /*==========================================
  1061. - * ᅵ萔ᅵfï¿œ[ï¿œ^ï¿œxï¿œ[ï¿œXᅵ̓ǂݍᅵᅵᅵ
  1062. + * Reading constant databases
  1063. + * const.txt
  1064.   *------------------------------------------*/
  1065.  static void read_constdb(void)
  1066.  {
  1067. @@ -2229,7 +2230,7 @@
  1068.  }
  1069.  
  1070.  /*==========================================
  1071. - * ᅵGᅵᅵᅵ[ᅵ\ᅵᅵ
  1072. + * Display emplacement line of script
  1073.   *------------------------------------------*/
  1074.  static const char* script_print_line(StringBuf* buf, const char* p, const char* mark, int line)
  1075.  {
  1076. @@ -2251,7 +2252,7 @@
  1077.  
  1078.  void script_error(const char* src, const char* file, int start_line, const char* error_msg, const char* error_pos)
  1079.  {
  1080. -	// ï¿œGᅵᅵᅵ[ᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵsᅵᅵᅵᅵᅵ߂ᅵ
  1081. +	// Find the line where the error occurred
  1082.  	int j;
  1083.  	int line = start_line;
  1084.  	const char *p;
  1085. @@ -2286,7 +2287,7 @@
  1086.  }
  1087.  
  1088.  /*==========================================
  1089. - * ï¿œXï¿œNᅵᅵᅵvï¿œgᅵ̉ᅵᅵ
  1090. + * Analysis of the script
  1091.   *------------------------------------------*/
  1092.  struct script_code* parse_script(const char *src,const char *file,int line,int options)
  1093.  {
  1094. @@ -2382,7 +2383,7 @@
  1095.  	{
  1096.  		if( *p == '\0' )
  1097.  			disp_error_message("unexpected end of script",p);
  1098. -		// labelᅵᅵᅵᅵᅵᅵᅵꏈᅵᅵ
  1099. +		// Special handling only label
  1100.  		tmpp=skip_space(skip_word(p));
  1101.  		if(*tmpp==':' && !(!strncasecmp(p,"default:",8) && p + 7 == tmpp)){
  1102.  			i=add_word(p);
  1103. @@ -2394,7 +2395,7 @@
  1104.  			continue;
  1105.  		}
  1106.  
  1107. -		// ᅵᅵᅵ͑Sᅵᅵᅵꏏᅵᅵᅵᅵ
  1108. +		// All other lumped
  1109.  		p=parse_line(p);
  1110.  		p=skip_space(p);
  1111.  
  1112. @@ -2980,7 +2981,7 @@
  1113.  ///
  1114.  
  1115.  /*==========================================
  1116. - * ï¿œXï¿œNᅵᅵᅵvï¿œgᅵˑᅵᅵϐᅵᅵAᅵ֐ᅵᅵˑᅵᅵϐᅵᅵ̉ᅵᅵ
  1117. + * Release script dependent variable, dependent variable of function
  1118.   *------------------------------------------*/
  1119.  void script_free_vars(struct DBMap* storage)
  1120.  {
  1121. @@ -3045,10 +3046,10 @@
  1122.  }
  1123.  
  1124.  //
  1125. -// ᅵᅵᅵsᅵᅵmain
  1126. +// Main execution unit
  1127.  //
  1128.  /*==========================================
  1129. - * ï¿œRï¿œ}ᅵᅵᅵhᅵ̓ǂݎᅵᅵ
  1130. + * Read command
  1131.   *------------------------------------------*/
  1132.  c_op get_com(unsigned char *script,int *pos)
  1133.  {
  1134. @@ -3065,7 +3066,7 @@
  1135.  }
  1136.  
  1137.  /*==========================================
  1138. - * ᅵᅵᅵlᅵ̏ᅵᅵᅵ
  1139. + *  Income figures
  1140.   *------------------------------------------*/
  1141.  int get_num(unsigned char *script,int *pos)
  1142.  {
  1143. @@ -3079,7 +3080,7 @@
  1144.  }
  1145.  
  1146.  /*==========================================
  1147. - * ᅵXᅵ^ᅵbᅵNᅵᅵᅵᅵlᅵᅵᅵᅵᅵoᅵᅵ
  1148. + * Remove the value from the stack
  1149.   *------------------------------------------*/
  1150.  int pop_val(struct script_state* st)
  1151.  {
  1152. @@ -3540,7 +3541,7 @@
  1153.  }
  1154.  
  1155.  /*==========================================
  1156. - * ï¿œwᅵᅵmï¿œ[ï¿œhᅵᅵsleep_dbᅵᅵᅵᅵ폜
  1157. + * Delete the specified node from sleep_db
  1158.   *------------------------------------------*/
  1159.  struct linkdb_node* script_erase_sleepdb(struct linkdb_node *n)
  1160.  {
  1161. @@ -3556,11 +3557,11 @@
  1162.  		n->next->prev = n->prev;
  1163.  	retnode = n->next;
  1164.  	aFree( n );
  1165. -	return retnode;		// ᅵᅵᅵ̃mï¿œ[ï¿œhᅵᅵԂᅵ
  1166. +	return retnode;		// The following; return retnode
  1167.  }
  1168.  
  1169.  /*==========================================
  1170. - * sleepᅵpᅵ^ᅵCᅵ}ᅵ[ᅵ֐ᅵ
  1171. + * Timer function for sleep
  1172.   *------------------------------------------*/
  1173.  int run_script_timer(int tid, unsigned int tick, int id, intptr_t data)
  1174.  {
  1175. @@ -3664,7 +3665,7 @@
  1176.  }
  1177.  
  1178.  /*==========================================
  1179. - * ᅵXᅵNᅵᅵᅵvᅵgᅵ̎ᅵᅵsᅵᅵᅵCᅵᅵᅵᅵᅵᅵ
  1180. + * The main part of the script execution
  1181.   *------------------------------------------*/
  1182.  void run_script_main(struct script_state *st)
  1183.  {
  1184. @@ -4137,7 +4138,7 @@
  1185.  }
  1186.  #endif
  1187.  /*==========================================
  1188. - * ᅵIᅵᅵ
  1189. + * Destructor
  1190.   *------------------------------------------*/
  1191.  int do_final_script() {
  1192.  	int i;
  1193. @@ -4249,7 +4250,7 @@
  1194.  	return 0;
  1195.  }
  1196.  /*==========================================
  1197. - * ᅵᅵᅵᅵ
  1198. + * Initialization
  1199.   *------------------------------------------*/
  1200.  int do_init_script() {
  1201.  	userfunc_db=strdb_alloc(DB_OPT_DUP_KEY,0);
  1202. @@ -4972,7 +4973,7 @@
  1203.  }
  1204.  
  1205.  /*==========================================
  1206. - *
  1207. + * Warp sd to str,x,y or Random or SavePoint/Save 
  1208.   *------------------------------------------*/
  1209.  BUILDIN_FUNC(warp)
  1210.  {
  1211. @@ -5004,7 +5005,7 @@
  1212.  	return 0;
  1213.  }
  1214.  /*==========================================
  1215. - * ï¿œGᅵᅵᅵAï¿œwᅵ胏ᅵ[ï¿œv
  1216. + * Warp a specified area
  1217.   *------------------------------------------*/
  1218.  static int buildin_areawarp_sub(struct block_list *bl,va_list ap)
  1219.  {
  1220. @@ -5293,7 +5294,7 @@
  1221.  	return 0;
  1222.  }
  1223.  /*==========================================
  1224. - *
  1225. + * Force Heal a player (hp and sp)
  1226.   *------------------------------------------*/
  1227.  BUILDIN_FUNC(heal)
  1228.  {
  1229. @@ -5309,7 +5310,7 @@
  1230.  	return 0;
  1231.  }
  1232.  /*==========================================
  1233. - *
  1234. + * Heal a player by item (get vit bonus etc)
  1235.   *------------------------------------------*/
  1236.  BUILDIN_FUNC(itemheal)
  1237.  {
  1238. @@ -6113,7 +6114,11 @@
  1239.  }
  1240.  
  1241.  /*==========================================
  1242. - * ï¿œdᅵʃ`ï¿œFï¿œbï¿œN
  1243. + * Check if item with this amount can fit in inventory
  1244. + * Checking : weight, stack amount >32k, slots amount >(MAX_INVENTORY) 
  1245. + * Return
  1246. + *	0 : fail
  1247. + *	1 : success (npc side only)
  1248.   *------------------------------------------*/
  1249.  BUILDIN_FUNC(checkweight)
  1250.  {
  1251. @@ -6321,7 +6326,7 @@
  1252.  	c3=(short)script_getnum(st,9);
  1253.  	c4=(short)script_getnum(st,10);
  1254.  
  1255. -	if(nameid<0) { // ᅵᅵᅵᅵᅵ_ᅵᅵ
  1256. +	if(nameid<0) { // Invalide nameid
  1257.  		nameid = -nameid;
  1258.  		flag = 1;
  1259.  	}
  1260. @@ -6557,7 +6562,7 @@
  1261.  	} else
  1262.  		m=map_mapname2mapid(mapname);
  1263.  
  1264. -	if(nameid<0) { // ᅵᅵᅵᅵᅵ_ᅵᅵ
  1265. +	if(nameid<0) {
  1266.  		nameid = -nameid;
  1267.  		flag = 1;
  1268.  	}
  1269. @@ -6886,7 +6891,8 @@
  1270.  }
  1271.  
  1272.  /*==========================================
  1273. - *ï¿œLᅵᅵᅵᅵᅵ֌Wᅵ̃pᅵᅵᅵᅵᅵ[ï¿œ^ᅵ擟
  1274. + * return the basic stats of sd
  1275. + * chk pc_readparam for available type
  1276.   *------------------------------------------*/
  1277.  BUILDIN_FUNC(readparam)
  1278.  {
  1279. @@ -6908,8 +6914,15 @@
  1280.  
  1281.  	return 0;
  1282.  }
  1283. +
  1284.  /*==========================================
  1285. - *ï¿œLᅵᅵᅵᅵᅵ֌WᅵᅵIDᅵ擟
  1286. + * Return charid identification
  1287. + * return by @num :
  1288. + *	0 : char_id
  1289. + *	1 : party_id
  1290. + *	2 : guild_id
  1291. + *	3 : account_id
  1292. + *	4 : bg_id
  1293.   *------------------------------------------*/
  1294.  BUILDIN_FUNC(getcharid)
  1295.  {
  1296. @@ -6971,8 +6984,10 @@
  1297.  
  1298.  	return 0;
  1299.  }
  1300. +
  1301.  /*==========================================
  1302. - *ï¿œwᅵᅵIDᅵᅵPTᅵᅵᅵ擟
  1303. + * Return the name of the party_id
  1304. + * null if not found
  1305.   *------------------------------------------*/
  1306.  BUILDIN_FUNC(getpartyname)
  1307.  {
  1308. @@ -6991,8 +7006,14 @@
  1309.  	}
  1310.  	return 0;
  1311.  }
  1312. +
  1313.  /*==========================================
  1314. - *ï¿œwᅵᅵIDᅵᅵPTï¿œlᅵᅵᅵƃᅵᅵᅵᅵoï¿œ[IDᅵ擟
  1315. + * Get the information of the members of a party by type
  1316. + * @party_id, @type
  1317. + * return by @type :
  1318. + *	- : nom des membres
  1319. + *	1 : char_id des membres
  1320. + *	2 : account_id des membres
  1321.   *------------------------------------------*/
  1322.  BUILDIN_FUNC(getpartymember)
  1323.  {
  1324. @@ -7064,7 +7085,8 @@
  1325.  }
  1326.  
  1327.  /*==========================================
  1328. - *ï¿œwᅵᅵIDᅵ̃Mᅵᅵᅵhᅵᅵᅵ擟
  1329. + * Return the name of the @guild_id
  1330. + * null if not found
  1331.   *------------------------------------------*/
  1332.  BUILDIN_FUNC(getguildname)
  1333.  {
  1334. @@ -7085,7 +7107,8 @@
  1335.  }
  1336.  
  1337.  /*==========================================
  1338. - *ï¿œwᅵᅵIDᅵᅵGuildMasterᅵᅵᅵ擟
  1339. + * Return the name of the guild master of @guild_id
  1340. + * null if not found
  1341.   *------------------------------------------*/
  1342.  BUILDIN_FUNC(getguildmaster)
  1343.  {
  1344. @@ -7124,7 +7147,13 @@
  1345.  }
  1346.  
  1347.  /*==========================================
  1348. - * ï¿œLᅵᅵᅵᅵᅵNï¿œ^ᅵ̖ᅵᅵO
  1349. + * Get char string information by type :
  1350. + * Return by @type :
  1351. + *	0 : char_name
  1352. + *	1 : party_name or ""
  1353. + *	2 : guild_name or ""
  1354. + *	3 : map_name
  1355. + *	- : ""
  1356.   *------------------------------------------*/
  1357.  BUILDIN_FUNC(strcharinfo)
  1358.  {
  1359. @@ -7176,7 +7205,13 @@
  1360.  }
  1361.  
  1362.  /*==========================================
  1363. - * ᅵĂяoᅵᅵᅵᅵᅵᅵNPCᅵᅵᅵᅵᅵ擟ᅵᅵᅵᅵ
  1364. + * Get npc string information by type
  1365. + * return by @type:
  1366. + *	0 : name
  1367. + *	1 : str#
  1368. + *	2 : #str
  1369. + *	3 : ::str
  1370. + *	4 : map name
  1371.   *------------------------------------------*/
  1372.  BUILDIN_FUNC(strnpcinfo)
  1373.  {
  1374. @@ -7265,7 +7300,8 @@
  1375.  }
  1376.  
  1377.  /*==========================================
  1378. - * ᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵiᅵᅵᅵBᅵᅵᅵjᅵᅵᅵ[ᅵpᅵj
  1379. + * Get the equipement name at pos
  1380. + * return item jname or ""
  1381.   *------------------------------------------*/
  1382.  BUILDIN_FUNC(getequipname)
  1383.  {
  1384. @@ -7391,7 +7427,7 @@
  1385.  }
  1386.  
  1387.  /*==========================================
  1388. - * ᅵᅵᅵᅵᅵ`ᅵFᅵbᅵN
  1389. + * Chk if player have something equiped at pos
  1390.   *------------------------------------------*/
  1391.  BUILDIN_FUNC(getequipisequiped)
  1392.  {
  1393. @@ -7414,7 +7450,11 @@
  1394.  }
  1395.  
  1396.  /*==========================================
  1397. - * ᅵᅵᅵᅵᅵiᅵᅵᅵBᅵ”\ï¿œ`ï¿œFï¿œbï¿œN
  1398. + * Chk if the player have something equiped at pos
  1399. + * if so chk if this item ain't marked not refinable or rental
  1400. + * return (npc) 
  1401. + *	1 : true 
  1402. + *	0 : false
  1403.   *------------------------------------------*/
  1404.  BUILDIN_FUNC(getequipisenableref)
  1405.  {
  1406. @@ -7437,7 +7477,10 @@
  1407.  }
  1408.  
  1409.  /*==========================================
  1410. - * ᅵᅵᅵᅵᅵiᅵӒᅵ`ï¿œFï¿œbï¿œN
  1411. + * Chk if the item equiped at pos is identify (huh ?)
  1412. + * return (npc) 
  1413. + *	1 : true 
  1414. + *	0 : false
  1415.   *------------------------------------------*/
  1416.  BUILDIN_FUNC(getequipisidentify)
  1417.  {
  1418. @@ -7460,7 +7503,10 @@
  1419.  }
  1420.  
  1421.  /*==========================================
  1422. - * ᅵᅵᅵᅵᅵiᅵᅵᅵBᅵx
  1423. + * Get the item refined value at pos
  1424. + * return (npc) 
  1425. + *	x : refine amount 
  1426. + *	0 : false (not refined)
  1427.   *------------------------------------------*/
  1428.  BUILDIN_FUNC(getequiprefinerycnt)
  1429.  {
  1430. @@ -7483,7 +7529,11 @@
  1431.  }
  1432.  
  1433.  /*==========================================
  1434. - * ᅵᅵᅵᅵᅵiᅵᅵᅵᅵLV
  1435. + * Get the weapon level value at pos
  1436. + * (pos should normally only be EQI_HAND_L or EQI_HAND_R)
  1437. + * return (npc) 
  1438. + *	x : weapon level 
  1439. + *	0 : false
  1440.   *------------------------------------------*/
  1441.  BUILDIN_FUNC(getequipweaponlv)
  1442.  {
  1443. @@ -7506,7 +7556,10 @@
  1444.  }
  1445.  
  1446.  /*==========================================
  1447. - * ᅵᅵᅵᅵᅵiᅵᅵᅵBᅵᅵᅵᅵᅵᅵ
  1448. + * Get the item refine chance (from refine.txt) for item at pos
  1449. + * return (npc) 
  1450. + *	x : refine chance
  1451. + *	0 : false (max refine level or unequip..)
  1452.   *------------------------------------------*/
  1453.  BUILDIN_FUNC(getequippercentrefinery)
  1454.  {
  1455. @@ -7529,7 +7582,7 @@
  1456.  }
  1457.  
  1458.  /*==========================================
  1459. - * ᅵᅵᅵBᅵᅵᅵᅵ
  1460. + * Refine +1 item at pos and log and display refine
  1461.   *------------------------------------------*/
  1462.  BUILDIN_FUNC(successrefitem)
  1463.  {
  1464. @@ -7583,7 +7636,7 @@
  1465.  }
  1466.  
  1467.  /*==========================================
  1468. - * ᅵᅵᅵBᅵᅵᅵs
  1469. + * Show a failed Refine +1 attempt
  1470.   *------------------------------------------*/
  1471.  BUILDIN_FUNC(failedrefitem)
  1472.  {
  1473. @@ -7599,13 +7652,12 @@
  1474.  		i=pc_checkequip(sd,equip[num-1]);
  1475.  	if(i >= 0) {
  1476.  		sd->status.inventory[i].refine = 0;
  1477. -		pc_unequipitem(sd,i,3);
  1478. -		// ᅵᅵᅵBᅵᅵᅵsï¿œGï¿œtï¿œFï¿œNï¿œgᅵ̃pï¿œPï¿œbï¿œg
  1479. -		clif_refine(sd->fd,1,i,sd->status.inventory[i].refine);
  1480. +		pc_unequipitem(sd,i,3); //recalculate bonus	
  1481. +		clif_refine(sd->fd,1,i,sd->status.inventory[i].refine); //notify client of failure
  1482.  
  1483.  		pc_delitem(sd,i,1,0,2,LOG_TYPE_SCRIPT);
  1484. -		// ᅵᅵᅵ̐lᅵɂᅵᅵᅵᅵsᅵᅵʒm
  1485. -		clif_misceffect(&sd->bl,2);
  1486. +	
  1487. +		clif_misceffect(&sd->bl,2); 	// display failure effect
  1488.  	}
  1489.  
  1490.  	return 0;
  1491. @@ -8478,7 +8530,7 @@
  1492.  }
  1493.  
  1494.  /*==========================================
  1495. - * ï¿œJï¿œvᅵᅵᅵqᅵɂᅵᅵJᅵᅵ
  1496. + * Open player storage
  1497.   *------------------------------------------*/
  1498.  BUILDIN_FUNC(openstorage)
  1499.  {
  1500. @@ -8507,7 +8559,7 @@
  1501.  }
  1502.  
  1503.  /*==========================================
  1504. - * ï¿œAï¿œCï¿œeᅵᅵᅵɂᅵᅵXï¿œLᅵᅵᅵᅵᅵᅵ
  1505. + * Make player use a skill trought item usage
  1506.   *------------------------------------------*/
  1507.  /// itemskill <skill id>,<level>
  1508.  /// itemskill "<skill name>",<level>
  1509. @@ -8530,7 +8582,7 @@
  1510.  	return 0;
  1511.  }
  1512.  /*==========================================
  1513. - * ᅵAᅵCᅵeᅵᅵᅵ쐬
  1514. + * Attempt to create an item
  1515.   *------------------------------------------*/
  1516.  BUILDIN_FUNC(produce)
  1517.  {
  1518. @@ -8562,7 +8614,7 @@
  1519.  	return 0;
  1520.  }
  1521.  /*==========================================
  1522. - * NPCᅵŃyï¿œbï¿œgᅵᅵᅵ
  1523. + * Create a pet
  1524.   *------------------------------------------*/
  1525.  BUILDIN_FUNC(makepet)
  1526.  {
  1527. @@ -8590,7 +8642,7 @@
  1528.  	return 0;
  1529.  }
  1530.  /*==========================================
  1531. - * NPCᅵŌoᅵᅵᅵlᅵグᅵᅵ
  1532. + * Give player exp base,job * quest_exp_rate/100
  1533.   *------------------------------------------*/
  1534.  BUILDIN_FUNC(getexp)
  1535.  {
  1536. @@ -8660,7 +8712,12 @@
  1537.  }
  1538.  
  1539.  /*==========================================
  1540. - * ᅵᅵᅵᅵᅵXᅵ^ᅵ[ᅵᅵᅵᅵ
  1541. + * Spawn a monster :
  1542. + @mapn,x,y : location 
  1543. + @str : monster name
  1544. + @class_ : mob_id
  1545. + @amount : nb to spawn
  1546. + @event : event to attach to mob
  1547.   *------------------------------------------*/
  1548.  BUILDIN_FUNC(monster)
  1549.  {
  1550. @@ -8742,7 +8799,7 @@
  1551.  	return 0;
  1552.  }
  1553.  /*==========================================
  1554. - * ᅵᅵᅵᅵᅵXᅵ^ᅵ[ᅵᅵᅵᅵ
  1555. + * Same as monster but randomize location in x0,x1,y0,y1 area
  1556.   *------------------------------------------*/
  1557.  BUILDIN_FUNC(areamonster)
  1558.  {
  1559. @@ -8786,7 +8843,7 @@
  1560.  	return 0;
  1561.  }
  1562.  /*==========================================
  1563. - * ᅵᅵᅵᅵᅵXï¿œ^ï¿œ[ᅵ폜
  1564. + * KillMonster subcheck, verify if mob to kill ain't got an even to handle, could be force kill by allflag
  1565.   *------------------------------------------*/
  1566.   static int buildin_killmonster_sub_strip(struct block_list *bl,va_list ap)
  1567.  { //same fix but with killmonster instead - stripping events from mobs.
  1568. @@ -8941,7 +8998,7 @@
  1569.  	return 0;
  1570.  }
  1571.  /*==========================================
  1572. - * ᅵCᅵxᅵᅵᅵgᅵᅵᅵs
  1573. + * ƒCƒxƒ“ƒgŽÀs
  1574.   *------------------------------------------*/
  1575.  BUILDIN_FUNC(doevent)
  1576.  {
  1577. @@ -8958,7 +9015,7 @@
  1578.  	return 0;
  1579.  }
  1580.  /*==========================================
  1581. - * NPCᅵᅵ̃Cï¿œxᅵᅵᅵgᅵᅵᅵs
  1582. + * NPCŽå‘̃Cƒxƒ“ƒgŽÀs
  1583.   *------------------------------------------*/
  1584.  BUILDIN_FUNC(donpcevent)
  1585.  {
  1586. @@ -8987,7 +9044,7 @@
  1587.  }
  1588.  
  1589.  /*==========================================
  1590. - * ï¿œCï¿œxᅵᅵᅵgï¿œ^ï¿œCï¿œ}ï¿œ[ᅵljᅵ
  1591. + * ƒCƒxƒ“ƒgƒ^ƒCƒ}[’ljÁ
  1592.   *------------------------------------------*/
  1593.  BUILDIN_FUNC(addtimer)
  1594.  {
  1595. @@ -9004,7 +9061,7 @@
  1596.  	return 0;
  1597.  }
  1598.  /*==========================================
  1599. - * ï¿œCï¿œxᅵᅵᅵgï¿œ^ï¿œCï¿œ}ï¿œ[ᅵ폜
  1600. + * ƒCƒxƒ“ƒgƒ^ƒCƒ}[íœ
  1601.   *------------------------------------------*/
  1602.  BUILDIN_FUNC(deltimer)
  1603.  {
  1604. @@ -9021,7 +9078,7 @@
  1605.  	return 0;
  1606.  }
  1607.  /*==========================================
  1608. - * ï¿œCï¿œxᅵᅵᅵgï¿œ^ï¿œCï¿œ}ï¿œ[ᅵ̃Jï¿œEᅵᅵᅵgï¿œlᅵljᅵ
  1609. + * ƒCƒxƒ“ƒgƒ^ƒCƒ}[‚̃JƒEƒ“ƒg’l’ljÁ
  1610.   *------------------------------------------*/
  1611.  BUILDIN_FUNC(addtimercount)
  1612.  {
  1613. @@ -9041,7 +9098,7 @@
  1614.  }
  1615.  
  1616.  /*==========================================
  1617. - * NPCᅵ^ᅵCᅵ}ᅵ[ᅵᅵᅵᅵ
  1618. + * NPCƒ^ƒCƒ}[‰Šú‰»
  1619.   *------------------------------------------*/
  1620.  BUILDIN_FUNC(initnpctimer)
  1621.  {
  1622. @@ -9090,7 +9147,7 @@
  1623.  	return 0;
  1624.  }
  1625.  /*==========================================
  1626. - * NPCᅵ^ᅵCᅵ}ᅵ[ᅵJᅵn
  1627. + * NPCƒ^ƒCƒ}[ŠJŽn
  1628.   *------------------------------------------*/
  1629.  BUILDIN_FUNC(startnpctimer)
  1630.  {
  1631. @@ -9137,7 +9194,7 @@
  1632.  	return 0;
  1633.  }
  1634.  /*==========================================
  1635. - * NPCᅵ^ᅵCᅵ}ᅵ[ᅵᅵ~
  1636. + * NPCƒ^ƒCƒ}[’âŽ~
  1637.   *------------------------------------------*/
  1638.  BUILDIN_FUNC(stopnpctimer)
  1639.  {
  1640. @@ -9179,7 +9236,7 @@
  1641.  	return 0;
  1642.  }
  1643.  /*==========================================
  1644. - * NPCï¿œ^ï¿œCï¿œ}ï¿œ[ᅵᅵñŠ“ï¿œ
  1645. + * NPCƒ^ƒCƒ}[î•ñŠ“Ÿ
  1646.   *------------------------------------------*/
  1647.  BUILDIN_FUNC(getnpctimer)
  1648.  {
  1649. @@ -9224,7 +9281,7 @@
  1650.  	return 0;
  1651.  }
  1652.  /*==========================================
  1653. - * NPCï¿œ^ï¿œCï¿œ}ï¿œ[ï¿œlᅵݒᅵ
  1654. + * NPCƒ^ƒCƒ}[’lÝ’è
  1655.   *------------------------------------------*/
  1656.  BUILDIN_FUNC(setnpctimer)
  1657.  {
  1658. @@ -9320,7 +9377,7 @@
  1659.  }
  1660.  
  1661.  /*==========================================
  1662. - * ᅵVᅵ̐ᅵᅵAᅵiᅵEᅵᅵᅵX
  1663. + * “V‚̐ºƒAƒiƒEƒ“ƒX
  1664.   *------------------------------------------*/
  1665.  BUILDIN_FUNC(announce)
  1666.  {
  1667. @@ -9359,7 +9416,7 @@
  1668.  	return 0;
  1669.  }
  1670.  /*==========================================
  1671. - * ᅵVᅵ̐ᅵᅵAᅵiᅵEᅵᅵᅵXᅵiᅵᅵᅵᅵ}ᅵbᅵvᅵj
  1672. + * “V‚̐ºƒAƒiƒEƒ“ƒXi“Á’èƒ}ƒbƒvj
  1673.   *------------------------------------------*/
  1674.  static int buildin_announce_sub(struct block_list *bl, va_list ap)
  1675.  {
  1676. @@ -9398,7 +9455,7 @@
  1677.  	return 0;
  1678.  }
  1679.  /*==========================================
  1680. - * ᅵVᅵ̐ᅵᅵAᅵiᅵEᅵᅵᅵXᅵiᅵᅵᅵᅵGᅵᅵᅵAᅵj
  1681. + * “V‚̐ºƒAƒiƒEƒ“ƒXi“Á’èƒGƒŠƒAj
  1682.   *------------------------------------------*/
  1683.  BUILDIN_FUNC(areaannounce)
  1684.  {
  1685. @@ -9425,7 +9482,7 @@
  1686.  }
  1687.  
  1688.  /*==========================================
  1689. - * ᅵᅵᅵ[ᅵUᅵ[ᅵᅵᅵᅵᅵᅵ
  1690. + * ƒ†[ƒU[”Š“Ÿ
  1691.   *------------------------------------------*/
  1692.  BUILDIN_FUNC(getusers)
  1693.  {
  1694. @@ -9520,7 +9577,7 @@
  1695.  	return 0;
  1696.  }
  1697.  /*==========================================
  1698. - * ï¿œ}ï¿œbï¿œvï¿œwᅵ胆ᅵ[ï¿œUï¿œ[ᅵᅵᅵᅵᅵᅵ
  1699. + * ƒ}ƒbƒvŽw’胆[ƒU[”Š“Ÿ
  1700.   *------------------------------------------*/
  1701.  BUILDIN_FUNC(getmapusers)
  1702.  {
  1703. @@ -9535,7 +9592,7 @@
  1704.  	return 0;
  1705.  }
  1706.  /*==========================================
  1707. - * ï¿œGᅵᅵᅵAï¿œwᅵ胆ᅵ[ï¿œUï¿œ[ᅵᅵᅵᅵᅵᅵ
  1708. + * ƒGƒŠƒAŽw’胆[ƒU[”Š“Ÿ
  1709.   *------------------------------------------*/
  1710.  static int buildin_getareausers_sub(struct block_list *bl,va_list ap)
  1711.  {
  1712. @@ -9563,7 +9620,7 @@
  1713.  }
  1714.  
  1715.  /*==========================================
  1716. - * ᅵGᅵᅵᅵAᅵwᅵᅵhᅵᅵᅵbᅵvᅵAᅵCᅵeᅵᅵᅵᅵᅵᅵᅵᅵ
  1717. + * ƒGƒŠƒAŽw’èƒhƒƒbƒvƒAƒCƒeƒ€”Š“Ÿ
  1718.   *------------------------------------------*/
  1719.  static int buildin_getareadropitem_sub(struct block_list *bl,va_list ap)
  1720.  {
  1721. @@ -9609,7 +9666,7 @@
  1722.  	return 0;
  1723.  }
  1724.  /*==========================================
  1725. - * NPCᅵ̗Lᅵᅵ
  1726. + * NPC‚Ì—LŒø‰»
  1727.   *------------------------------------------*/
  1728.  BUILDIN_FUNC(enablenpc)
  1729.  {
  1730. @@ -9619,7 +9676,7 @@
  1731.  	return 0;
  1732.  }
  1733.  /*==========================================
  1734. - * NPCᅵ̖ᅵᅵᅵ
  1735. + * NPC‚Ì–³Œø‰»
  1736.   *------------------------------------------*/
  1737.  BUILDIN_FUNC(disablenpc)
  1738.  {
  1739. @@ -9630,7 +9687,7 @@
  1740.  }
  1741.  
  1742.  /*==========================================
  1743. - * ï¿œBᅵᅵĂᅵᅵᅵNPCᅵ̕\ᅵᅵ
  1744. + * ‰B‚ê‚Ä‚¢‚éNPC‚Ì•\ŽŠ
  1745.   *------------------------------------------*/
  1746.  BUILDIN_FUNC(hideoffnpc)
  1747.  {
  1748. @@ -9640,7 +9697,7 @@
  1749.  	return 0;
  1750.  }
  1751.  /*==========================================
  1752. - * NPCᅵᅵᅵnᅵCᅵfᅵBᅵᅵᅵO
  1753. + * NPC‚ðƒnƒCƒfƒBƒ“ƒO
  1754.   *------------------------------------------*/
  1755.  BUILDIN_FUNC(hideonnpc)
  1756.  {
  1757. @@ -9802,7 +9859,7 @@
  1758.  }
  1759.  
  1760.  /*==========================================
  1761. - * ᅵᅵԈُᅵϐᅵᅵᅵᅵvï¿œZᅵᅵᅵᅵᅵmᅵᅵᅵᅵԂᅵ
  1762. + * @FIXME atm will return reduced tick, 0 immune, 1 no tick
  1763.   *------------------------------------------*/
  1764.  BUILDIN_FUNC(getscrate)
  1765.  {
  1766. @@ -9811,7 +9868,7 @@
  1767.  
  1768.  	type=script_getnum(st,2);
  1769.  	rate=script_getnum(st,3);
  1770. -	if( script_hasdata(st,4) ) //ï¿œwᅵ肵ᅵᅵᅵLᅵᅵᅵᅵᅵ̑ϐᅵᅵᅵᅵvï¿œZᅵᅵᅵᅵ
  1771. +	if( script_hasdata(st,4) ) //get for the bl assigned
  1772.  		bl = map_id2bl(script_getnum(st,4));
  1773.  	else
  1774.  		bl = map_id2bl(st->rid);
  1775. @@ -9885,7 +9942,7 @@
  1776.  }
  1777.  
  1778.  /*==========================================
  1779. - *ᅵߊlï¿œAï¿œCï¿œeᅵᅵᅵgï¿œp
  1780. + *•ßŠlƒAƒCƒeƒ€Žg—p
  1781.   *------------------------------------------*/
  1782.  BUILDIN_FUNC(catchpet)
  1783.  {
  1784. @@ -10039,7 +10096,7 @@
  1785.  	return 0;
  1786.  }
  1787.  /*==========================================
  1788. - * ᅵXᅵeᅵ[ᅵ^ᅵXᅵᅵᅵZᅵbᅵg
  1789. + * ƒXƒe[ƒ^ƒXƒŠƒZƒbƒg
  1790.   *------------------------------------------*/
  1791.  BUILDIN_FUNC(resetstatus)
  1792.  {
  1793. @@ -10110,7 +10167,7 @@
  1794.  }
  1795.  
  1796.  /*==========================================
  1797. - * ᅵᅵᅵʕϊᅵ
  1798. + * Unequip all item and request for a changesex to char-serv
  1799.   *------------------------------------------*/
  1800.  BUILDIN_FUNC(changesex)
  1801.  {
  1802. @@ -10135,16 +10192,16 @@
  1803.  	struct npc_data *nd = (struct npc_data *)bl;
  1804.  	const char *name=NULL,*mes;
  1805.  
  1806. -	mes=script_getstr(st,2);	// ᅵᅵᅵbï¿œZï¿œ[ï¿œWᅵ̎擟
  1807. +	mes=script_getstr(st,2);
  1808.  	if(mes==NULL) return 0;
  1809.  
  1810. -	if(script_hasdata(st,3)){	// NPCᅵᅵᅵ̎擟(123#456)
  1811. +	if(script_hasdata(st,3)){	//  npc name to display
  1812.  		name=script_getstr(st,3);
  1813.  	} else {
  1814. -		name=nd->name;
  1815. +		name=nd->name; //use current npc name
  1816.  	}
  1817.  
  1818. -	npc_globalmessage(name,mes);	// ᅵOᅵᅵᅵ[ᅵoᅵᅵᅵᅵᅵbᅵZᅵ[ᅵWᅵᅵᅵM
  1819. +	npc_globalmessage(name,mes);	// broadcast  to all players connected
  1820.  
  1821.  	return 0;
  1822.  }
  1823. @@ -10379,7 +10436,7 @@
  1824.  }
  1825.  
  1826.  /*==========================================
  1827. - * RIDᅵ̃Aï¿œ^ï¿œbï¿œ`
  1828. + * Attach sd char id to script and detach current one if any
  1829.   *------------------------------------------*/
  1830.  BUILDIN_FUNC(attachrid)
  1831.  {
  1832. @@ -10397,7 +10454,7 @@
  1833.  	return 0;
  1834.  }
  1835.  /*==========================================
  1836. - * RIDᅵ̃fï¿œ^ï¿œbï¿œ`
  1837. + * Detach script to rid
  1838.   *------------------------------------------*/
  1839.  BUILDIN_FUNC(detachrid)
  1840.  {
  1841. @@ -10405,7 +10462,7 @@
  1842.  	return 0;
  1843.  }
  1844.  /*==========================================
  1845. - * ᅵᅵᅵ݃`ï¿œFï¿œbï¿œN
  1846. + * Chk if account connected, (and charid from account if specified)
  1847.   *------------------------------------------*/
  1848.  BUILDIN_FUNC(isloggedin)
  1849.  {
  1850. @@ -11029,7 +11086,7 @@
  1851.  }
  1852.  
  1853.  /* =====================================================================
  1854. - * ᅵMᅵᅵᅵhᅵᅵᅵᅵvᅵᅵᅵᅵᅵᅵ
  1855. + * ?¿œM?¿œ?¿œ?¿œh?¿œ?¿œ?¿œ?¿œv?¿œ?¿œ?¿œ?¿œ?¿œ?¿œ
  1856.   * ---------------------------------------------------------------------*/
  1857.  BUILDIN_FUNC(requestguildinfo)
  1858.  {
  1859. @@ -11107,14 +11164,14 @@
  1860.  			item_tmp.nameid   = sd->status.inventory[i].card[c];
  1861.  			item_tmp.identify = 1;
  1862.  
  1863. -			if((flag=pc_additem(sd,&item_tmp,1,LOG_TYPE_SCRIPT))){	// ᅵᅵᅵĂȂᅵᅵȂᅵhᅵᅵᅵbï¿œv
  1864. +			if((flag=pc_additem(sd,&item_tmp,1,LOG_TYPE_SCRIPT))){	// get back the cart in inventory
  1865.  				clif_additem(sd,0,0,flag);
  1866.  				map_addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
  1867.  			}
  1868.  		}
  1869.  	}
  1870.  
  1871. -	if(cardflag == 1) {// ï¿œJï¿œ[ï¿œhᅵᅵᅵᅵ菜ᅵᅵᅵᅵᅵAï¿œCï¿œeᅵᅵᅵᅵᅵᅵ
  1872. +	if(cardflag == 1) {//if card was remove remplace item with no card
  1873.  		int flag;
  1874.  		struct item item_tmp;
  1875.  		memset(&item_tmp,0,sizeof(item_tmp));
  1876. @@ -11129,7 +11186,7 @@
  1877.  			item_tmp.card[j]=sd->status.inventory[i].card[j];
  1878.  
  1879.  		pc_delitem(sd,i,1,0,3,LOG_TYPE_SCRIPT);
  1880. -		if((flag=pc_additem(sd,&item_tmp,1,LOG_TYPE_SCRIPT))){	// ᅵᅵᅵĂȂᅵᅵȂᅵhᅵᅵᅵbï¿œv
  1881. +		if((flag=pc_additem(sd,&item_tmp,1,LOG_TYPE_SCRIPT))){	//chk if can be spawn in inventory otherwise put on floor
  1882.  			clif_additem(sd,0,0,flag);
  1883.  			map_addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
  1884.  		}
  1885. @@ -11183,10 +11240,10 @@
  1886.  	}
  1887.  
  1888.  	if(cardflag == 1) {
  1889. -		if(typefail == 0 || typefail == 2){	// ᅵᅵᅵᅵᅵ
  1890. +		if(typefail == 0 || typefail == 2){	// destroy the item
  1891.  			pc_delitem(sd,i,1,0,2,LOG_TYPE_SCRIPT);
  1892.  		}
  1893. -		if(typefail == 1){	// ï¿œJï¿œ[ï¿œhᅵ̂ݑᅵᅵᅵᅵiᅵᅵᅵᅵᅵԂᅵᅵj
  1894. +		if(typefail == 1){	// destroy the card
  1895.  			int flag;
  1896.  			struct item item_tmp;
  1897.  
  1898. @@ -11590,7 +11647,7 @@
  1899.  }
  1900.  
  1901.  /*==========================================
  1902. - * IDᅵᅵᅵᅵItemᅵᅵ
  1903. + * Get the item name by item_id or null
  1904.   *------------------------------------------*/
  1905.  BUILDIN_FUNC(getitemname)
  1906.  {
  1907. @@ -11830,7 +11887,11 @@
  1908.  	return 0;
  1909.  }
  1910.  /*==========================================
  1911. - * PCᅵ̏ᅵᅵᅵᅵiᅵᅵᅵǂݎᅵᅵ
  1912. + * Set arrays with info of all sd inventory :
  1913. + * @inventorylist_id, @inventorylist_amount, @inventorylist_equip, 
  1914. + * @inventorylist_refine, @inventorylist_identify, @inventorylist_attribute,
  1915. + * @inventorylist_card(0..3), @inventorylist_expire
  1916. + * @inventorylist_count = scalar
  1917.   *------------------------------------------*/
  1918.  BUILDIN_FUNC(getinventorylist)
  1919.  {
  1920. @@ -11928,9 +11989,8 @@
  1921.  }
  1922.  
  1923.  /*==========================================
  1924. - * NPCᅵNᅵᅵᅵXᅵ`ᅵFᅵᅵᅵW
  1925. - * classᅵ͕ςᅵ肜ᅵᅵclass
  1926. - * typeᅵ͒ʏᅵ0ᅵȂ̂ᅵᅵȁH
  1927. + * Transform a bl to another _class, 
  1928. + * @type unused
  1929.   *------------------------------------------*/
  1930.  BUILDIN_FUNC(classchange)
  1931.  {
  1932. @@ -11946,7 +12006,7 @@
  1933.  }
  1934.  
  1935.  /*==========================================
  1936. - * NPCᅵᅵᅵ甭ᅵᅵᅵᅵᅵᅵGï¿œtï¿œFï¿œNï¿œg
  1937. + * Display an effect
  1938.   *------------------------------------------*/
  1939.  BUILDIN_FUNC(misceffect)
  1940.  {
  1941. @@ -12033,7 +12093,7 @@
  1942.  }
  1943.  
  1944.  /*==========================================
  1945. - * ᅵTᅵEᅵᅵᅵhᅵGᅵtᅵFᅵNᅵg
  1946. + * Play a .wav sound for sd
  1947.   *------------------------------------------*/
  1948.  BUILDIN_FUNC(soundeffect)
  1949.  {
  1950. Index: src/map/skill.c
  1951. --- src/map/skill.c Base (BASE)
  1952. +++ src/map/skill.c Locally Modified (Based On LOCAL)
  1953. @@ -615,6 +615,16 @@
  1954.  
  1955.  	if (hd->blockskill[i] > 0)
  1956.  		return 1;
  1957. +    switch(skillid){ //homun special check
  1958. +        case MH_LIGHT_OF_REGENE:
  1959. +            if(hd->homunculus.intimacy <= 750) //if not cordial
  1960. +                return 1;
  1961. +            break;
  1962. +        case MH_OVERED_BOOST:
  1963. +            if(hd->homunculus.hunger <= 1) //if we starving
  1964. +                return 1;
  1965. +            break;
  1966. +    }
  1967.  
  1968.  	//Use master's criteria.
  1969.  	return skillnotok(skillid, hd->master);
  1970. @@ -796,17 +806,18 @@
  1971.  					sc_start(src,SC_COMBO, 15, TK_TURNKICK,
  1972.  						(2000 - 4*sstatus->agi - 2*sstatus->dex)))
  1973.  					; //Stance triggered
  1974. -				else if(sc->data[SC_READYCOUNTER])
  1975. -				{	//additional chance from SG_FRIEND [Komurka]
  1976. +                    else if (sc->data[SC_READYCOUNTER]) { //additional chance from SG_FRIEND [Komurka]
  1977.  					rate = 20;
  1978.  					if (sc->data[SC_SKILLRATE_UP] && sc->data[SC_SKILLRATE_UP]->val1 == TK_COUNTER) {
  1979.  						rate += rate*sc->data[SC_SKILLRATE_UP]->val2/100;
  1980.  						status_change_end(src, SC_SKILLRATE_UP, INVALID_TIMER);
  1981.  					}
  1982. -					sc_start4(src,SC_COMBO, rate, TK_COUNTER, bl->id,0,0,
  1983. +					sc_start2(src, SC_COMBO, rate, TK_COUNTER, bl->id,
  1984.  						(2000 - 4*sstatus->agi - 2*sstatus->dex));
  1985.  				}
  1986.  			}
  1987. +			if(sc && sc->data[SC_PYROCLASTIC] && (rnd() % 1000 <= sstatus->luk * 10 / 3 + 1) )
  1988. +				skill_castend_pos2(src, bl->x, bl->y, BS_HAMMERFALL,sc->data[SC_PYROCLASTIC]->val1, tick, 0);
  1989.  		}
  1990.  
  1991.  		if (sc) {
  1992. @@ -1350,18 +1361,25 @@
  1993.  	case EL_TYPOON_MIS:
  1994.  		sc_start(bl,SC_SILENCE,10*skilllv,skilllv,skill_get_time(skillid,skilllv));
  1995.  		break;
  1996. -	case MH_LAVA_SLIDE:
  1997. -		sc_start4(bl,SC_BURNING,10*skilllv,skilllv,1000,src->id,0,skill_get_time(skillid,skilllv));
  1998. -		break;
  1999. -	case MH_STAHL_HORN:
  2000. -		sc_start(bl,SC_STUN,(20 + 4 * skilllv),skilllv,skill_get_time2(skillid,skilllv));
  2001. -		break;
  2002.  	case KO_JYUMONJIKIRI: // needs more info
  2003.  		sc_start(bl,SC_JYUMONJIKIRI,25,skilllv,skill_get_time(skillid,skilllv));
  2004.  		break;
  2005.  	case KO_MAKIBISHI:
  2006.  		sc_start(bl, SC_STUN, 100, skilllv, skill_get_time2(skillid,skilllv));
  2007.  		break;
  2008. +	case MH_LAVA_SLIDE:
  2009. +		sc_start4(bl, SC_BURNING, 10 * skilllv, skilllv, 1000, src->id, 0, skill_get_time(skillid, skilllv));
  2010. +		break;
  2011. +	case MH_STAHL_HORN:
  2012. +		sc_start(bl, SC_STUN, (20 + 4 * (skilllv-1)), skilllv, skill_get_time2(skillid, skilllv));
  2013. +		break;
  2014. +	case MH_NEEDLE_OF_PARALYZE:
  2015. +		sc_start(bl, SC_PARALYSIS, 40 + (5*skilllv), skilllv, skill_get_time(skillid, skilllv));
  2016. +		break;
  2017. +	case MH_POISON_MIST:
  2018. +		if (tsc && !tsc->data[SC_BLIND])
  2019. +		    status_change_start(bl, SC_BLIND, rnd() % 100 > skilllv * 10, skilllv, skillid, 0, 0, skill_get_time2(skillid, skilllv), 8);
  2020. +		break;
  2021.  	}
  2022.  
  2023.  	if (md && battle_config.summons_trigger_autospells && md->master_id && md->special_state.ai)
  2024. @@ -3483,7 +3501,6 @@
  2025.  	case WM_SEVERE_RAINSTORM_MELEE:
  2026.  	case WM_GREAT_ECHO:
  2027.  	case GN_SLINGITEM_RANGEMELEEATK:
  2028. -	case MH_STAHL_HORN:
  2029.  	case KO_JYUMONJIKIRI:
  2030.  	case KO_SETSUDAN:
  2031.  	case KO_KAIHOU:
  2032. @@ -3720,7 +3737,6 @@
  2033.  	case SO_VARETYR_SPEAR:
  2034.  	case GN_CART_TORNADO:
  2035.  	case GN_CARTCANNON:
  2036. -	case MH_LAVA_SLIDE:
  2037.  	case KO_HAPPOKUNAI:
  2038.  	case KO_HUUMARANKA:
  2039.  	case KO_MUCHANAGE:
  2040. @@ -4528,6 +4544,21 @@
  2041.  		break;
  2042.  
  2043.  
  2044. +    //recursive homon skill
  2045. +    case MH_MAGMA_FLOW:
  2046. +    case MH_XENO_SLASHER:
  2047. +        if(flag & 1)
  2048. +            skill_attack(skill_get_type(skillid), src, src, bl, skillid, skilllv, tick, flag);
  2049. +        else {
  2050. +            map_foreachinrange(skill_area_sub, bl, skill_get_splash(skillid, skilllv), splash_target(src), src, skillid, skilllv, tick, flag | BCT_ENEMY | SD_SPLASH | 1, skill_castend_damage_id);
  2051. +        }
  2052. +        break;
  2053. +    case MH_STAHL_HORN:
  2054. +    case MH_NEEDLE_OF_PARALYZE:
  2055. +    case MH_POISON_MIST:
  2056. +        skill_attack(BF_WEAPON, src, src, bl, skillid, skilllv, tick, flag);
  2057. +        break;
  2058. +
  2059.  	case 0:/* no skill - basic/normal attack */
  2060.  		if(sd) {
  2061.  			if (flag & 3){
  2062. @@ -4545,10 +4576,6 @@
  2063.  		break;
  2064.  
  2065.  	default:
  2066. -		if( skillid >= HM_SKILLBASE && skillid <= HM_SKILLBASE + MAX_HOMUNSKILL ) {
  2067. -			if( src->type == BL_HOM && ((TBL_HOM*)src)->master->fd )
  2068. -				clif_colormes(((TBL_HOM*)src)->master, COLOR_RED, "This skill is not yet supported");
  2069. -		} else /* temporary until all the homun-s skills are supported otherwise console would fill up with pointless warnings */
  2070.  			ShowWarning("skill_castend_damage_id: Unknown skill used:%d\n",skillid);
  2071.  		clif_skill_damage(src, bl, tick, status_get_amotion(src), tstatus->dmotion,
  2072.  			0, abs(skill_get_num(skillid, skilllv)),
  2073. @@ -7203,12 +7230,7 @@
  2074.  				clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0);
  2075.  		}
  2076.  		break;
  2077. -	case MH_STAHL_HORN:
  2078. -		if (sd) {
  2079. -			if( skillid == MH_GOLDENE_FERSE )
  2080. -				clif_skill_fail(sd,skillid,USESKILL_FAIL_CONDITION,0);
  2081. -		}
  2082. -		break;
  2083. +
  2084.  	case HAMI_CASTLE:	//[orn]
  2085.  		if(rnd()%100 < 20*skilllv && src != bl)
  2086.  		{
  2087. @@ -7360,7 +7382,6 @@
  2088.  		break;
  2089.  	case RK_IGNITIONBREAK:
  2090.  	case LG_EARTHDRIVE:
  2091. -	case MH_LAVA_SLIDE:
  2092.  			clif_skill_damage(src,bl,tick, status_get_amotion(src), 0, -30000, 1, skillid, skilllv, 6);
  2093.  			i = skill_get_splash(skillid,skilllv);
  2094.  			if( skillid == LG_EARTHDRIVE ) {
  2095. @@ -8820,6 +8841,94 @@
  2096.  			map_foreachinrange(skill_area_sub, bl, skill_get_splash(skillid, skilllv), splash_target(src), src, skillid, skilllv, tick, flag|BCT_ENEMY|SD_SPLASH|1, skill_castend_nodamage_id);
  2097.  		}
  2098.  		break;
  2099. +        //eira skills
  2100. +       case MH_SILENT_BREEZE: {
  2101. +            struct status_change *ssc = status_get_sc(src);
  2102. +            const enum sc_type scs[] = {
  2103. +                    SC_MANDRAGORA, SC_HARMONIZE, SC_DEEPSLEEP, SC_VOICEOFSIREN, SC_SLEEP, SC_CONFUSION, SC_HALLUCINATION
  2104. +            };
  2105. +            int heal;
  2106. +            if(tsc){
  2107. +                for (i = 0; i < ARRAYLENGTH(scs); i++) {
  2108. +                    if (tsc->data[scs[i]]) status_change_end(bl, scs[i], INVALID_TIMER);
  2109. +                }
  2110. +                if (!tsc->data[SC_SILENCE]) //put inavoidable silence on target
  2111. +                        status_change_start(bl, SC_SILENCE, 100, skilllv, 0,0,0, skill_get_time(skillid, skilllv),1|2|8);
  2112. +                if(ssc && !ssc->data[SC_SILENCE]) //put inavoidable silence on homun
  2113. +                    status_change_start(src, SC_SILENCE, 100, skilllv, 0,0,0, skill_get_time(skillid, skilllv),1|2|8);
  2114. +            }
  2115. +            heal = status_get_matk_min(src)*4;
  2116. +            status_heal(bl, heal, 0, 7);
  2117. +            if (hd)
  2118. +                skill_blockhomun_start(hd, skillid, skill_get_time2(skillid, skilllv));
  2119. +       }
  2120. +       break;
  2121. +       case MH_OVERED_BOOST:
  2122. +            if (hd){
  2123. +                struct block_list *s_bl = battle_get_master(src);
  2124. +                if(hd->homunculus.hunger>50) //reduce hunger
  2125. +                    hd->homunculus.hunger = hd->homunculus.hunger/2;
  2126. +                else
  2127. +                    hd->homunculus.hunger = min(1,hd->homunculus.hunger);
  2128. +                if(s_bl && s_bl->type==BL_PC){
  2129. +                    status_set_sp(s_bl,status_get_max_sp(s_bl)/2,0); //master drain 50% sp
  2130. +                    clif_send_homdata(((TBL_PC *)s_bl), SP_HUNGRY, hd->homunculus.hunger); //refresh hunger info
  2131. +                    sc_start(s_bl, type, 100, skilllv, skill_get_time(skillid, skilllv)); //gene bonus
  2132. +                }
  2133. +                skill_blockhomun_start(hd, skillid, skill_get_time2(skillid, skilllv));
  2134. +                sc_start(bl, type, 100, skilllv, skill_get_time(skillid, skilllv));
  2135. +            }
  2136. +            break;
  2137. +       case MH_GRANITIC_ARMOR:
  2138. +       case MH_PYROCLASTIC:
  2139. +            if (hd){
  2140. +                struct block_list *s_bl = battle_get_master(src);
  2141. +                if(s_bl && s_bl->type==BL_PC){ //start on master
  2142. +                    sc_start2(s_bl, type, 100, skilllv, hd->homunculus.level, skill_get_time(skillid, skilllv)); //gene bonus
  2143. +                }
  2144. +               // skill_blockhomun_start(hd, skillid, skill_get_time2(skillid, skilllv));
  2145. +               sc_start2(bl, type, 100, skilllv, hd->homunculus.level, skill_get_time(skillid, skilllv));
  2146. +            }
  2147. +            break;
  2148. +
  2149. +       //Bayeri skills
  2150. +        case MH_STEINWAND: {
  2151. +            struct block_list *s_bl = battle_get_master(bl);
  2152. +            skill_castend_pos2(bl,bl->x,bl->y,MG_SAFETYWALL,skilllv,tick,flag); //cast on homon
  2153. +            skill_castend_pos2(s_bl,s_bl->x,s_bl->y,MG_SAFETYWALL,skilllv,tick,flag); //cast on master
  2154. +         //   if (hd)
  2155. +         //       skill_blockhomun_start(hd, skillid, skill_get_time2(skillid, skilllv));
  2156. +        }
  2157. +        break;
  2158. +        case MH_LIGHT_OF_REGENE:
  2159. +        case MH_STYLE_CHANGE:
  2160. +        case MH_MAGMA_FLOW:
  2161. +        case MH_PAIN_KILLER:
  2162. +           sc_start(bl, type, 100, skilllv, skill_get_time(skillid, skilllv));
  2163. +       //    if (hd)
  2164. +       //         skill_blockhomun_start(hd, skillid, skill_get_time2(skillid, skilllv));
  2165. +           break;
  2166. +        case MH_SUMMON_LEGION:
  2167. +            {
  2168. +                int summons[5] = {1004, 1303, 1303, 1994, 1994};
  2169. +                int qty[5] =     {3   , 3   , 4   , 4   , 5};
  2170. +                struct mob_data *md;
  2171. +                int i;
  2172. +
  2173. +                for(i=0; i<qty[skilllv - 1]; i++){ //easy way [Lighta]
  2174. +                    md = mob_once_spawn_sub(src, src->m, src->x, src->y, status_get_name(src), summons[skilllv - 1], "");
  2175. +                    if (md) {
  2176. +                        md->master_id = src->id;
  2177. +                        md->special_state.ai = 1; //normal summon, add new type here
  2178. +                        if (md->deletetimer != INVALID_TIMER)
  2179. +                            delete_timer(md->deletetimer, mob_timer_delete);
  2180. +                        md->deletetimer = add_timer(gettick() + skill_get_time(skillid, skilllv), mob_timer_delete, md->bl.id, 0);
  2181. +                        mob_spawn(md); //Now it is ready for spawning.
  2182. + //                       sc_start4(&md->bl, SC_MODECHANGE, 100, 1, 0, MD_CANMOVE|MD_CANATTACK|MD_ASSIST|MD_AGGRESSIVE, 0, 60000);
  2183. +                    }
  2184. +                }
  2185. +            }
  2186. +            break;
  2187.  	default:
  2188.  		if( skillid >= HM_SKILLBASE && skillid <= HM_SKILLBASE + MAX_HOMUNSKILL ) {
  2189.  			if( src->type == BL_HOM && ((TBL_HOM*)src)->master->fd )
  2190. @@ -9009,8 +9118,11 @@
  2191.  
  2192.  			if(inf&BCT_ENEMY && (sc = status_get_sc(target)) &&
  2193.  				sc->data[SC_FOGWALL] &&
  2194. -				rnd()%100 < 75)
  2195. -		  	{	//Fogwall makes all offensive-type targetted skills fail at 75%
  2196. +                    rnd() % 100 < 75) { //Fogwall makes all offensive-type targetted skills fail at 75%
  2197. +                if (sd) clif_skill_fail(sd, ud->skillid, USESKILL_FAIL_LEVEL, 0);
  2198. +                break;
  2199. +            }
  2200. +            if ( (sc = status_get_sc(src)) && sc->data[SC_ASH] && rnd() % 2) { //SC_ASH makes all skills fail at 50%
  2201.  				if (sd) clif_skill_fail(sd,ud->skillid,USESKILL_FAIL_LEVEL,0);
  2202.  				break;
  2203.  			}
  2204. @@ -9538,11 +9650,13 @@
  2205.  	case SO_WATER_INSIGNIA:
  2206.  	case SO_WIND_INSIGNIA:
  2207.  	case SO_EARTH_INSIGNIA:
  2208. -	case MH_POISON_MIST:
  2209.  	case KO_HUUMARANKA:
  2210.  	case KO_MUCHANAGE:
  2211.  	case KO_BAKURETSU:
  2212.  	case KO_ZENKAI:
  2213. +    case MH_LAVA_SLIDE:
  2214. +    case MH_VOLCANIC_ASH:
  2215. +    case MH_POISON_MIST:
  2216.  		flag|=1;//Set flag to 1 to prevent deleting ammo (it will be deleted on group-delete).
  2217.  	case GS_GROUNDDRIFT: //Ammo should be deleted right away.
  2218.  		skill_unitsetting(src,skillid,skilllv,x,y,0);
  2219. @@ -10011,6 +10125,15 @@
  2220.  			skill_unitsetting(src,skillid,skilllv,x,y,0); 
  2221.  		}
  2222.  		break;
  2223. +
  2224. +	case MH_XENO_SLASHER: {
  2225. +            i = skill_get_splash(skillid, skilllv);
  2226. +            map_foreachinarea(skill_area_sub, src->m, x - i, y - i, x + i, y + i, BL_CHAR,
  2227. +                    src, skillid, skilllv, tick, flag | BCT_ENEMY | 1,
  2228. +                    skill_castend_damage_id);
  2229. +            break;
  2230. +        }
  2231. +
  2232.  	default:
  2233.  		if( skillid >= HM_SKILLBASE && skillid <= HM_SKILLBASE + MAX_HOMUNSKILL ) {
  2234.  			if( src->type == BL_HOM && ((TBL_HOM*)src)->master->fd )
  2235. @@ -10980,6 +11103,12 @@
  2236.  			skill_attack(skill_get_type(sg->skill_id), ss, &src->bl, bl, sg->skill_id, sg->skill_lv, tick, 0);
  2237.  		break;
  2238.  
  2239. +	case UNT_VOLCANIC_ASH:
  2240. +		ShowInfo("You've step in volcanic ash, skilllv=%d\n",sg->skill_lv);
  2241. +		if (!sce)
  2242. +		    sc_start(bl, SC_ASH, 50, sg->skill_lv, skill_get_time(MH_VOLCANIC_ASH, sg->skill_lv)); //50% chance
  2243. +		break;
  2244. +
  2245.  	case UNT_GD_LEADERSHIP:
  2246.  	case UNT_GD_GLORYWOUNDS:
  2247.  	case UNT_GD_SOULCOLD:
  2248. @@ -13478,6 +13607,8 @@
  2249.  	if (sc && sc->count) {
  2250.  		if (sc->data[SC_SLOWCAST])
  2251.  			time += time * sc->data[SC_SLOWCAST]->val2 / 100;
  2252. +        if (sc->data[SC_PARALYSIS])
  2253. +            time += sc->data[SC_PARALYSIS]->val3;
  2254.  		if (sc->data[SC_SUFFRAGIUM]) {
  2255.  			time -= time * sc->data[SC_SUFFRAGIUM]->val2 / 100;
  2256.  			status_change_end(bl, SC_SUFFRAGIUM, INVALID_TIMER);
  2257. Index: src/map/skill.h
  2258. --- src/map/skill.h Base (BASE)
  2259. +++ src/map/skill.h Locally Modified (Based On LOCAL)
  2260. Index: src/map/status.c
  2261. --- src/map/status.c Base (BASE)
  2262. +++ src/map/status.c Locally Modified (Based On LOCAL)
  2263. @@ -491,6 +491,25 @@
  2264.  	set_sc( HAMI_DEFENCE         , SC_DEFENCE         , SI_BLANK           , SCB_DEF );
  2265.  	set_sc( HAMI_BLOODLUST       , SC_BLOODLUST       , SI_BLANK           , SCB_BATK|SCB_WATK );
  2266.  
  2267. +    // Homunculus S
  2268. +    add_sc(MH_STAHL_HORN, SC_STUN);
  2269. +    set_sc(MH_ANGRIFFS_MODUS, SC_ANGRIFFS_MODUS, SI_ANGRIFFS_MODUS, SCB_BATK | SCB_DEF | SCB_FLEE | SCB_MAXHP);
  2270. +    set_sc(MH_GOLDENE_FERSE, SC_GOLDENE_FERSE, SI_GOLDENE_FERSE,  SCB_ASPD|SCB_MAXHP);
  2271. +    add_sc(MH_ERASER_CUTTER, SC_ERASER_CUTTER);
  2272. +    set_sc(MH_OVERED_BOOST, SC_OVERED_BOOST, SI_BLANK, SCB_FLEE|SCB_ASPD);
  2273. +    add_sc(MH_LIGHT_OF_REGENE, SC_LIGHT_OF_REGENE);
  2274. +    set_sc(MH_VOLCANIC_ASH, SC_ASH, SI_VOLCANIC_ASH, SCB_DEF|SCB_DEF2|SCB_HIT|SCB_BATK|SCB_FLEE);
  2275. +    set_sc(MH_GRANITIC_ARMOR, SC_GRANITIC_ARMOR, SI_GRANITIC_ARMOR, SCB_NONE);
  2276. +    set_sc(MH_MAGMA_FLOW, SC_MAGMA_FLOW, SI_MAGMA_FLOW, SCB_NONE);
  2277. +    set_sc(MH_PYROCLASTIC, SC_PYROCLASTIC, SI_PYROCLASTIC, SCB_BATK|SCB_ATK_ELE);
  2278. +    add_sc(MH_LAVA_SLIDE, SC_BURNING);
  2279. +    set_sc(MH_NEEDLE_OF_PARALYZE, SC_PARALYSIS, SI_NEEDLE_OF_PARALYZE, SCB_DEF2);
  2280. +    add_sc(MH_POISON_MIST, SC_BLIND);
  2281. +    set_sc(MH_PAIN_KILLER, SC_PAIN_KILLER, SI_PAIN_KILLER, SCB_ASPD);
  2282. +
  2283. +    add_sc(MH_STYLE_CHANGE, SC_STYLE_CHANGE);
  2284. +
  2285. +
  2286.  	add_sc( MER_CRASH            , SC_STUN            );
  2287.  	set_sc( MER_PROVOKE          , SC_PROVOKE         , SI_PROVOKE         , SCB_DEF|SCB_DEF2|SCB_BATK|SCB_WATK );
  2288.  	add_sc( MS_MAGNUM            , SC_WATK_ELEMENT    );
  2289. @@ -728,13 +747,6 @@
  2290.  	set_sc_with_vfx( OB_AKAITSUKI		, SC_AKAITSUKI			 , SI_AKAITSUKI			   , SCB_NONE );
  2291.  	set_sc( OB_OBOROGENSOU		, SC_GENSOU				 , SI_GENSOU			   , SCB_NONE );
  2292.  
  2293. -	add_sc( MH_STAHL_HORN		 , SC_STUN            );
  2294. -	set_sc( MH_ANGRIFFS_MODUS	 , SC_ANGRIFFS_MODUS  , SI_ANGRIFFS_MODUS	, SCB_BATK|SCB_WATK|SCB_DEF|SCB_FLEE );
  2295. -	set_sc( MH_GOLDENE_FERSE	 , SC_GOLDENE_FERSE   , SI_GOLDENE_FERSE	, SCB_SPEED|SCB_FLEE|SCB_ATK_ELE );
  2296. -	add_sc( MH_LAVA_SLIDE		 , SC_BURNING         );
  2297. -	add_sc( MH_POISON_MIST		 , SC_BLIND			  );
  2298. -	set_sc( MH_ERASER_CUTTER	 , SC_ERASER_CUTTER   , SI_BLANK			, SCB_NONE );
  2299. -
  2300.  	// Storing the target job rather than simply SC_SPIRIT simplifies code later on.
  2301.  	SkillStatusChangeTable[SL_ALCHEMIST]   = (sc_type)MAPID_ALCHEMIST,
  2302.  	SkillStatusChangeTable[SL_MONK]        = (sc_type)MAPID_MONK,
  2303. @@ -1034,6 +1046,9 @@
  2304.  	StatusChangeStateTable[SC_CURSEDCIRCLE_TARGET] |= SCS_NOCAST;
  2305.  	StatusChangeStateTable[SC_SILENCE]             |= SCS_NOCAST;
  2306.  
  2307. +	//Homon S
  2308. +	StatusChangeStateTable[SC_PARALYSIS]               |= SCS_NOMOVE;
  2309. +
  2310.  }
  2311.  
  2312.  static void initDummyData(void)
  2313. @@ -1292,14 +1307,25 @@
  2314.  		if( target->type == BL_MOB )
  2315.  			((TBL_MOB*)target)->state.rebirth = 1;
  2316.  
  2317. -		return hp+sp;
  2318. +        return hp + sp;
  2319.  	}
  2320. -
  2321. -	if( target->type == BL_MOB && sc && sc->data[SC_REBIRTH] && !((TBL_MOB*)target)->state.rebirth )
  2322. -	{// Ensure the monster has not already rebirthed before doing so.
  2323. +    if(target->type == BL_PC){
  2324. +        TBL_PC *sd = BL_CAST(BL_PC,target);
  2325. +        TBL_HOM *hd = sd->hd;
  2326. +        if(hd && hd->sc.data[SC_LIGHT_OF_REGENE]){
  2327. +            //rez en fonction de l'intimite
  2328. + //           clif_skillcasting(&hd->bl, hd->bl.id, target->id, 0,0, MH_LIGHT_OF_REGENE, skill_get_ele(MH_LIGHT_OF_REGENE, 1), skill_get_cast(MH_LIGHT_OF_REGENE, 1));
  2329. +            clif_skill_nodamage(&sd->bl, target, ALL_RESURRECTION, 1, status_revive(&sd->bl,10*hd->sc.data[SC_LIGHT_OF_REGENE]->val1,0));
  2330. +            hd->homunculus.intimacy = 251; //change to neutral
  2331. +            clif_send_homdata(sd, SP_INTIMATE, hd->homunculus.intimacy); //refresh intimacy info
  2332. +            status_change_end(&sd->hd->bl,SC_LIGHT_OF_REGENE,INVALID_TIMER);
  2333. +            return hp + sp;
  2334. +        }
  2335. +    }
  2336. +    if (target->type == BL_MOB && sc && sc->data[SC_REBIRTH] && !((TBL_MOB*) target)->state.rebirth) {// Ensure the monster has not already rebirthed before doing so.
  2337.  		status_revive(target, sc->data[SC_REBIRTH]->val2, 0);
  2338. -		status_change_clear(target,0);
  2339. -		((TBL_MOB*)target)->state.rebirth = 1;
  2340. +        status_change_clear(target, 0);
  2341. +        ((TBL_MOB*) target)->state.rebirth = 1;
  2342.  
  2343.  		return hp+sp;
  2344.  	}
  2345. @@ -1692,6 +1718,8 @@
  2346.  			return 0;
  2347.  		if(skill_num == PR_LEXAETERNA && (tsc->data[SC_FREEZE] || (tsc->data[SC_STONE] && tsc->opt1 == OPT1_STONE)))
  2348.  			return 0;
  2349. +        if ((skill_num != SC_SHADOWFORM && skill_num != SC_STRIPACCESSARY) && tsc->data[SC__MANHOLE])
  2350. +            return 0;
  2351.  	}
  2352.  
  2353.  	//If targetting, cloak+hide protect you, otherwise only hiding does.
  2354. @@ -4407,10 +4435,19 @@
  2355.  		batk += sc->data[SC_FULL_SWING_K]->val1;
  2356.  	if(sc->data[SC_ODINS_POWER])
  2357.  		batk += 70;
  2358. -	if(sc->data[SC_ANGRIFFS_MODUS])
  2359. -		batk += batk * sc->data[SC_ANGRIFFS_MODUS]->val2/100;
  2360.  	if( sc->data[SC_ZANGETSU] )
  2361.  		batk += batk * sc->data[SC_ZANGETSU]->val2 / 100;
  2362. +	if(sc->data[SC_ASH] && (bl->type==BL_MOB)){
  2363. +        TBL_MOB *md = BL_CAST(BL_MOB,bl);
  2364. +        if(md && md->status.def_ele == ELE_WATER) //water type 
  2365. +            batk = batk*sc->data[SC_ASH]->val2/100;
  2366. +    }
  2367. +    if(sc->data[SC_PYROCLASTIC])
  2368. +        batk += sc->data[SC_PYROCLASTIC]->val2;
  2369. +    if (sc->data[SC_ANGRIFFS_MODUS])
  2370. +        batk += sc->data[SC_ANGRIFFS_MODUS]->val2;
  2371. +		
  2372. +	
  2373.  	return (unsigned short)cap_value(batk,0,USHRT_MAX);
  2374.  }
  2375.  
  2376. @@ -4527,7 +4564,7 @@
  2377.  	if(sc->data[SC_FIRE_INSIGNIA] && sc->data[SC_FIRE_INSIGNIA]->val1 == 3)
  2378.  		matk += 50;
  2379.  	if(sc->data[SC_ODINS_POWER])
  2380. -		matk += 70;
  2381. +        matk += 40 + 30 * sc->data[SC_ODINS_POWER]->val1; //70 lvl1, 100lvl2
  2382.  	if(sc->data[SC_IZAYOI])
  2383.  		matk += 50 * sc->data[SC_IZAYOI]->val1;
  2384.  	if( sc->data[SC_ZANGETSU] )
  2385. @@ -4597,6 +4634,8 @@
  2386.  		hit -= hit * 20 / 100;
  2387.  	if(sc->data[SC_INSPIRATION])
  2388.  		hit += 5 * sc->data[SC_INSPIRATION]->val1;
  2389. +	if (sc->data[SC_ASH])
  2390. +        hit = hit * sc->data[SC_ASH]->val2 / 100;	
  2391.  
  2392.  	return (short)cap_value(hit,1,SHRT_MAX);
  2393.  }
  2394. @@ -4668,15 +4707,21 @@
  2395.  		flee += flee * sc->data[SC_ZEPHYR]->val2 / 100;
  2396.  	if( sc->data[SC_MARSHOFABYSS] )
  2397.  		flee -= (9 * sc->data[SC_MARSHOFABYSS]->val3 / 10 + sc->data[SC_MARSHOFABYSS]->val2 / 10) * (bl->type == BL_MOB ? 2 : 1);
  2398. -	if( sc->data[SC_ANGRIFFS_MODUS] )
  2399. -		flee -= flee * sc->data[SC_ANGRIFFS_MODUS]->val3 / 100;
  2400. -	if( sc->data[SC_GOLDENE_FERSE ] )
  2401. -		flee -= flee * sc->data[SC_GOLDENE_FERSE ]->val2 / 100;
  2402.  #ifdef RENEWAL
  2403.  	if( sc->data[SC_SPEARQUICKEN] )
  2404.  		flee += 2 * sc->data[SC_SPEARQUICKEN]->val1;
  2405.  #endif
  2406. +    if (sc->data[SC_ANGRIFFS_MODUS])
  2407. +        flee -= sc->data[SC_ANGRIFFS_MODUS]->val3;
  2408. +    if (sc->data[SC_OVERED_BOOST])
  2409. +        flee = max(flee,sc->data[SC_OVERED_BOOST]->val2);
  2410. +	if(sc->data[SC_ASH] && (bl->type==BL_MOB)){
  2411. +        TBL_MOB *md = BL_CAST(BL_MOB,bl);
  2412. +        if(md && md->status.def_ele == ELE_WATER) //water type
  2413. +            flee = flee*sc->data[SC_ASH]->val2/100;
  2414. +    }
  2415.  
  2416. +
  2417.  	return (short)cap_value(flee,1,SHRT_MAX);
  2418.  }
  2419.  
  2420. @@ -4767,6 +4812,12 @@
  2421.  	if( sc->data[SC_ANGRIFFS_MODUS] )
  2422.  		def -= def * sc->data[SC_ANGRIFFS_MODUS]->val4 / 100;
  2423.  
  2424. +    if(sc->data[SC_ASH] && (bl->type==BL_MOB)){
  2425. +        TBL_MOB *md = BL_CAST(BL_MOB,bl);
  2426. +        if(md && md->status.race==RC_PLANT)
  2427. +            def = def*sc->data[SC_ASH]->val2/100;
  2428. +    }
  2429. +
  2430.  	return (defType)cap_value(def,DEFTYPE_MIN,DEFTYPE_MAX);;
  2431.  }
  2432.  
  2433. @@ -4823,6 +4874,13 @@
  2434.  		def2 += (5 + sc->data[SC_BANDING]->val1) * (sc->data[SC_BANDING]->val2);
  2435.  	if( sc->data[SC_GT_REVITALIZE] && sc->data[SC_GT_REVITALIZE]->val4)
  2436.  		def2 += def2 * sc->data[SC_GT_REVITALIZE]->val4 / 100;
  2437. +	if(sc->data[SC_ASH] && (bl->type==BL_MOB)){
  2438. +        TBL_MOB *md = BL_CAST(BL_MOB,bl);
  2439. +        if(md && md->status.race==RC_PLANT)
  2440. +            def2 = def2*sc->data[SC_ASH]->val2/100;
  2441. +    }
  2442. +    if (sc->data[SC_PARALYSIS])
  2443. +        def2 -= def2 * sc->data[SC_PARALYSIS]->val2 / 100;
  2444.  
  2445.  #ifdef RENEWAL
  2446.  	return (short)cap_value(def2,SHRT_MIN,SHRT_MAX);
  2447. @@ -4873,10 +4931,10 @@
  2448.  		mdef -= mdef * sc->data[SC_GT_CHANGE]->val4 / 100;
  2449.  	if(sc->data[SC_WATER_BARRIER])
  2450.  		mdef += sc->data[SC_WATER_BARRIER]->val2;
  2451. +    if (sc->data[SC_ODINS_POWER])
  2452. +        mdef -= 20 * sc->data[SC_ODINS_POWER]->val1;
  2453.  	if(sc->data[SC_EARTH_INSIGNIA] && sc->data[SC_EARTH_INSIGNIA]->val1 == 3)
  2454.  		mdef += 50;
  2455. -	if(sc->data[SC_ODINS_POWER])
  2456. -		mdef -= 20;
  2457.  
  2458.  	return (defType)cap_value(mdef,DEFTYPE_MIN,DEFTYPE_MAX);
  2459.  }
  2460. @@ -5189,6 +5247,8 @@
  2461.  		skills2 -= sc->data[SC__INVISIBILITY]->val2 ;
  2462.  	if( sc->data[SC__GROOMY] )
  2463.  		skills2 -= sc->data[SC__GROOMY]->val2;
  2464. +    if(sc->data[SC_PAIN_KILLER])
  2465. +        skills2 -= sc->data[SC_PAIN_KILLER]->val2;
  2466.  	if( sc->data[SC_SWINGDANCE] )
  2467.  		skills2 += sc->data[SC_SWINGDANCE]->val2;
  2468.  	if( sc->data[SC_DANCEWITHWUG] )
  2469. @@ -5199,6 +5259,8 @@
  2470.  		skills2 -= 25;
  2471.  	if( sc->data[SC_GT_CHANGE] )
  2472.  		skills2 += sc->data[SC_GT_CHANGE]->val3;
  2473. +    if (sc->data[SC_GOLDENE_FERSE])
  2474. +        skills2 += sc->data[SC_GOLDENE_FERSE]->val3;
  2475.  	if( sc->data[SC_MELON_BOMB] )
  2476.  		skills2 -= sc->data[SC_MELON_BOMB]->val1;
  2477.  	if( sc->data[SC_BOOST500] )
  2478. @@ -5258,8 +5320,6 @@
  2479.  			max < sc->data[SC_FLEET]->val2)
  2480.  			max = sc->data[SC_FLEET]->val2;
  2481.  
  2482. -		if( sc->data[SC_GOLDENE_FERSE] && max < sc->data[SC_GOLDENE_FERSE]->val3 )
  2483. -			max = sc->data[SC_GOLDENE_FERSE]->val3;
  2484.  
  2485.  		if(sc->data[SC_ASSNCROS] &&
  2486.  			max < sc->data[SC_ASSNCROS]->val2)
  2487. @@ -5416,6 +5476,8 @@
  2488.  		maxhp -= sc->data[SC_MYSTERIOUS_POWDER]->val1 / 100;
  2489.  	if(sc->data[SC_EARTH_INSIGNIA] && sc->data[SC_EARTH_INSIGNIA]->val1 == 2)
  2490.  		maxhp += 500;
  2491. +    if (sc->data[SC_GOLDENE_FERSE])
  2492. +        maxhp += (maxhp * sc->data[SC_GOLDENE_FERSE]->val2) / 100;
  2493.  
  2494.  	return cap_value(maxhp,1,UINT_MAX);
  2495.  }
  2496. @@ -5516,8 +5578,8 @@
  2497.  		return ELE_GHOST;
  2498.  	if(sc->data[SC_TIDAL_WEAPON_OPTION] || sc->data[SC_TIDAL_WEAPON] )
  2499.  		return ELE_WATER;
  2500. -	if(sc->data[SC_GOLDENE_FERSE] && rand()%100 < sc->data[SC_GOLDENE_FERSE]->val4)
  2501. -		return ELE_HOLY;
  2502. +    if(sc->data[SC_PYROCLASTIC])
  2503. +        return ELE_FIRE;
  2504.  	return (unsigned char)cap_value(element,0,UCHAR_MAX);
  2505.  }
  2506.  
  2507. @@ -6118,6 +6180,9 @@
  2508.  	case SC_KYOUGAKU:
  2509.  		tick -= 30*status->int_;
  2510.  		break;
  2511. +        case SC_PARALYSIS:
  2512. +            tick -= 50 * (status->vit + status->luk); //(1000/20);
  2513. +            break;
  2514.  	default:
  2515.  		//Effect that cannot be reduced? Likely a buff.
  2516.  		if (!(rnd()%10000 < rate))
  2517. @@ -6306,6 +6371,12 @@
  2518.  	undead_flag = battle_check_undead(status->race,status->def_ele);
  2519.  	//Check for inmunities / sc fails
  2520.  	switch (type) {
  2521. +        case SC_ANGRIFFS_MODUS:
  2522. +        case SC_GOLDENE_FERSE:
  2523. +             if ((type==SC_GOLDENE_FERSE && sc->data[SC_ANGRIFFS_MODUS])
  2524. +                     || (type==SC_ANGRIFFS_MODUS && sc->data[SC_GOLDENE_FERSE])
  2525. +                     )
  2526. +                return 0;
  2527.  	case SC_STONE:
  2528.  		if(sc->data[SC_POWER_OF_GAIA])
  2529.  			return 0;
  2530. @@ -6609,6 +6680,7 @@
  2531.  			case SC_BURNING: // Place here until we have info about its behavior on Boss-monsters. [pakpil]
  2532.  			case SC_MARSHOFABYSS:
  2533.  			case SC_ADORAMUS:
  2534. +            case SC_PARALYSIS:
  2535.  
  2536.  			// Exploit prevention - kRO Fix
  2537.  			case SC_PYREXIA:
  2538. @@ -7654,16 +7726,6 @@
  2539.  			val3 = 3*val1; //Leech chance
  2540.  			val4 = 20; //Leech percent
  2541.  			break;
  2542. -		case SC_ANGRIFFS_MODUS:
  2543. -			val2 = 70 + 30*val1; //atk
  2544. -			val3 = 50 + 20*val1; //flee
  2545. -			val4 = 60 + 20*val1; //def
  2546. -			break;
  2547. -		case SC_GOLDENE_FERSE:
  2548. -			val2 = 20 + 10*val1; //flee
  2549. -			val3 = 10 + 4*val1; //aspd
  2550. -			val4 = 2 + 2*val1; //chance to issue holy-ele attack
  2551. -			break;
  2552.  		case SC_FLEET:
  2553.  			val2 = 30*val1; //Aspd change
  2554.  			val3 = 5+5*val1; //bAtk/wAtk rate change
  2555. @@ -8351,6 +8413,44 @@
  2556.  					status_zap(bl, hp * (lv*4) / 100, status_get_sp(bl) * (lv*3) / 100);
  2557.  			}
  2558.  			break;
  2559. +		case SC_ANGRIFFS_MODUS:
  2560. +		    val2 = 50 + 20 * val1; //atk bonus
  2561. +		    val3 = 40 + 20 * val1; // Flee reduction.
  2562. +		    val4 = 30 + 20 * val1; // Def reduction
  2563. +		    break;
  2564. +		case SC_GOLDENE_FERSE:
  2565. +		    val2 = 10 + 10*val1; //max hp bonus
  2566. +		    val3 = 10 + 4 * (val1-1); // Aspd Bonus
  2567. +		    val4 = 2 + 2 * val1; // Chance of holy attack
  2568. +		    break;
  2569. +		case SC_OVERED_BOOST:
  2570. +		    val2 = 300 + 40*val1; //flee bonus 
  2571. +		    val3 = 179 + 2*val1; //aspd bonus
  2572. +		    break;
  2573. +		case SC_ASH:
  2574. +		    val2 = 50; //Def,ATK,Flee,Hit, alteration %
  2575. +		    val3 = 150; //dammage bonus
  2576. +		    break;
  2577. +		case SC_GRANITIC_ARMOR:
  2578. +		    val2 = 2*val1; //dmg reduction
  2579. +		    val3 = 6*val1; //dmg on status end
  2580. +		    break;
  2581. +		case SC_MAGMA_FLOW:
  2582. +		    val2 = 3*val1; //activation chance
  2583. +		    break;
  2584. +		case SC_PYROCLASTIC:
  2585. +		    val2 += 10*val1; //atk bonus
  2586. +		    break;	
  2587. +		case SC_PARALYSIS: //[Lighta] need real info
  2588. +		    val2 = 2*val1; //def reduction 
  2589. +		    val3 = 500*val1; //varcast augmentation
  2590. +		    break;
  2591. +		case SC_PAIN_KILLER:
  2592. +		    val2 = 2*val1; //aspd reduction %
  2593. +		    val3 = 2*val1; //dmg reduction %
  2594. +		    if(sc->data[SC_PARALYSIS])
  2595. +		        sc_start(bl, SC_ENDURE, 100, val1, tick); //start endure for same duration
  2596. +		    break;
  2597.  		default:
  2598.  			if( calc_flag == SCB_NONE && StatusSkillChangeTable[type] == 0 && StatusIconChangeTable[type] == 0 )
  2599.  			{	//Status change with no calc, no icon, and no skill associated...?
  2600. @@ -8407,6 +8507,7 @@
  2601.  		case SC_NETHERWORLD:
  2602.  		case SC_MEIKYOUSISUI:
  2603.  		case SC_KYOUGAKU:
  2604. +        case SC_PARALYSIS:    
  2605.  			unit_stop_walking(bl,1);
  2606.  		break;
  2607.  		case SC_HIDING:
  2608. @@ -8877,6 +8978,17 @@
  2609.  	vd = status_get_viewdata(bl);
  2610.  	calc_flag = StatusChangeFlagTable[type];
  2611.  	switch(type){
  2612. +        case SC_GRANITIC_ARMOR:{
  2613. +            int dammage = status->max_hp*sce->val3/100;
  2614. +            if(status->hp < dammage) //to not kill him
  2615. +                dammage = status->hp-1;
  2616. +            status_damage(NULL, bl, dammage,0,0,1);
  2617. +            break;
  2618. +        }
  2619. +        case SC_PYROCLASTIC:
  2620. +            if(bl->type == BL_PC)
  2621. +                skill_break_equip(bl,EQP_WEAPON,10000,BCT_SELF);
  2622. +            break;
  2623.  		case SC_WEDDING:
  2624.  		case SC_XMAS:
  2625.  		case SC_SUMMER:
  2626. Index: src/map/status.h
  2627. --- src/map/status.h Base (BASE)
  2628. +++ src/map/status.h Locally Modified (Based On LOCAL)
  2629. @@ -613,10 +613,6 @@
  2630.   * To increase the maximum value just add another status type before SC_MAXSPELLBOOK (ex. SC_SPELLBOOK7, SC_SPELLBOOK8 and so on)
  2631.   **/
  2632.  	SC_MAXSPELLBOOK,
  2633. -	/* homun-s */
  2634. -	SC_ANGRIFFS_MODUS,
  2635. -	SC_GOLDENE_FERSE,
  2636. -	SC_ERASER_CUTTER,
  2637.  	/* Max HP & SP */
  2638.  	SC_INCMHP,
  2639.  	SC_INCMSP,
  2640. @@ -635,6 +631,22 @@
  2641.  	SC_ZANGETSU,
  2642.  	SC_GENSOU,
  2643.  	SC_AKAITSUKI,
  2644. +	
  2645. +	//homon S
  2646. +	SC_STYLE_CHANGE,        
  2647. +    SC_GOLDENE_FERSE,
  2648. +    SC_ANGRIFFS_MODUS,
  2649. +    SC_ERASER_CUTTER,
  2650. +    SC_OVERED_BOOST,        
  2651. +    SC_LIGHT_OF_REGENE,
  2652. +    SC_ASH,
  2653. +    SC_GRANITIC_ARMOR,
  2654. +    SC_MAGMA_FLOW,
  2655. +    SC_PYROCLASTIC,
  2656. +    SC_PARALYSIS,
  2657. +    SC_PAIN_KILLER,
  2658. +
  2659. +	
  2660.  #ifdef RENEWAL	
  2661.  	SC_EXTREMITYFIST2,
  2662.  #endif
  2663. Index: src/map/unit.c
  2664. --- src/map/unit.c Base (BASE)
  2665. +++ src/map/unit.c Locally Modified (Based On LOCAL)
  2666. @@ -1249,6 +1249,7 @@
  2667.  	case RA_WUGDASH:
  2668.  		if (sc && sc->data[SC_WUGDASH])
  2669.  			casttime = -1;
  2670. +        break;
  2671.  	}
  2672.  
  2673.  	// moved here to prevent Suffragium from ending if skill fails
  2674. @@ -1325,9 +1326,11 @@
  2675.  			status_change_end(src,SC_CLOAKINGEXCEED, INVALID_TIMER);
  2676.  			if (!src->prev) return 0;
  2677.  		}
  2678. +        if (sc->data[SC__MANHOLE]) {
  2679. +            status_change_end(src, SC__MANHOLE, -1);
  2680. +            if (!src->prev) return 0; //Warped away!
  2681.  	}
  2682. -
  2683. -
  2684. +    }
  2685.  	if( casttime > 0 )
  2686.  	{
  2687.  		ud->skilltimer = add_timer( tick+casttime, skill_castend_id, src->id, 0 );
  2688. @@ -1451,7 +1454,11 @@
  2689.  			status_change_end(src, SC_CLOAKINGEXCEED, INVALID_TIMER);
  2690.  			if (!src->prev) return 0;
  2691.  		}
  2692. +		if (sc->data[SC__MANHOLE]) {
  2693. +			status_change_end(src, SC__MANHOLE, INVALID_TIMER);
  2694. +			if (!src->prev) return 0; //Warped away!
  2695.  	}
  2696. +	}
  2697.  	// in official this is triggered even if no cast time.
  2698.  	clif_skillcasting(src, src->id, 0, skill_x, skill_y, skill_num, skill_get_ele(skill_num, skill_lv), casttime);
  2699.  	if( casttime > 0 )
  2700. @@ -1868,7 +1875,7 @@
  2701.  			return 0;
  2702.  
  2703.  		if (sd && (sd->special_state.no_castcancel2 ||
  2704. -			(sd->special_state.no_castcancel && !map_flag_gvg(bl->m) && !map[bl->m].flag.battleground))) //fixed flags being read the wrong way around [blackhole89]
  2705. +                ((sd->sc.data[SC_UNLIMITEDHUMMINGVOICE] || sd->special_state.no_castcancel) && !map_flag_gvg(bl->m) && !map[bl->m].flag.battleground))) //fixed flags being read the wrong way around [blackhole89]
  2706.  			return 0;
  2707.  	}
  2708.  
  2709. @@ -2023,9 +2030,11 @@
  2710.  		status_change_end(bl, SC_CHANGE, INVALID_TIMER);
  2711.  		status_change_end(bl, SC_STOP, INVALID_TIMER);
  2712.  		status_change_end(bl, SC_WUGDASH, INVALID_TIMER);
  2713. +        status_change_end(bl, SC_CAMOUFLAGE, INVALID_TIMER);
  2714.  		status_change_end(bl, SC__SHADOWFORM, INVALID_TIMER);
  2715.  		status_change_end(bl, SC__MANHOLE, INVALID_TIMER);
  2716. -
  2717. +        status_change_end(bl, SC_VACUUM_EXTREME, INVALID_TIMER);
  2718. +        status_change_end(bl, SC_CURSEDCIRCLE_ATKER, INVALID_TIMER); //callme before warp
  2719.  	}
  2720.  
  2721.  	if (bl->type&(BL_CHAR|BL_PET)) {
Viewed 491 times, submitted by lighta.