Sfoglia il codice sorgente

- Kaahi now triggers every 500ms rather than on every hit (but it only heals if in those 500ms an attack that would previously trigger Kaahi has taken effect). In other words, it works just like before, except damage gets "buffered" into 500ms slots.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6463 54d463be-8e91-2dee-dedb-b68131a5f0ec
skotlex 19 anni fa
parent
commit
0349c76984
3 ha cambiato i file con 35 aggiunte e 16 eliminazioni
  1. 4 0
      Changelog-Trunk.txt
  2. 2 13
      src/map/skill.c
  3. 29 3
      src/map/status.c

+ 4 - 0
Changelog-Trunk.txt

@@ -4,6 +4,10 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
 2006/05/03
+	* Kaahi now triggers every 500ms rather than on every hit (but it only
+	  heals if in those 500ms an attack that would previously trigger Kaahi has
+	  taken effect). In other words, it works just like before, except damage
+	  gets "buffered" into 500ms slots. [Skotlex]
 	* Kaite, Kaute will now show a skill effect when they trigger. [Skotlex
 	* Knowledge will now only trigger if you logon to the memorized map, not
 	  walk into it. [Skotlex]

+ 2 - 13
src/map/skill.c

@@ -1424,19 +1424,8 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
 
 	switch(skillid){
 	case 0: //Normal Attack
-		if(tsc && tsc->data[SC_KAAHI].timer != -1) {
-			if (dstsd && dstsd->status.sp < tsc->data[SC_KAAHI].val3)
-				; //Not enough SP to cast
-			else {
-				int hp = status_get_max_hp(bl) - status_get_hp(bl);
-				if (hp > tsc->data[SC_KAAHI].val2)
-					hp = tsc->data[SC_KAAHI].val2;
-				if (hp) {
-					battle_heal(bl, bl, hp, -tsc->data[SC_KAAHI].val3, 1);
-					clif_skill_nodamage(NULL,bl,AL_HEAL,hp,1);
-				}
-			}
-		}
+		if(tsc && tsc->data[SC_KAAHI].timer != -1)
+			tsc->data[SC_KAAHI].val4++; //Activate heal.
 		break;
 	case MO_EXTREMITYFIST:			/* 阿?C羅覇凰�? */
 		//阿?C羅を使うと5分間自然回復しないようになる

+ 29 - 3
src/map/status.c

@@ -4438,8 +4438,11 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
 			calc_flag = 1;
 			break;
 		case SC_KAAHI:
-			val2 = 200*val1; //HP heal
-			val3 = 5*val1; //SP cost
+			if(flag&4)
+				break;
+			val2 = tick/500;
+			val3 = 200*val1; //HP heal
+			tick = 500;
 			break;
 		case SC_BLESSING:
 			if ((!undead_flag && race!=RC_DEMON) || bl->type == BL_PC)
@@ -5428,7 +5431,30 @@ int status_change_timer(int tid, unsigned int tick, int id, int data)
 			}
 		}
 		break;
-
+		
+	case SC_KAAHI:
+		if(sc->data[type].val4) { //Heal
+			sc->data[type].val4 = 0;
+			if (sd && sd->status.sp < 5*sc->data[SC_KAAHI].val1)
+				; //Not enough SP to cast
+			else {
+				int hp = status_get_max_hp(bl) - status_get_hp(bl);
+				if (hp > sc->data[SC_KAAHI].val2)
+					hp = sc->data[SC_KAAHI].val2;
+				if (hp) {
+					battle_heal(bl, bl, hp, -5*sc->data[SC_KAAHI].val1, 1);
+					clif_skill_nodamage(NULL,bl,AL_HEAL,hp,1);
+				}
+			}
+		}
+		if( (--sc->data[type].val2)>0 ){
+			sc->data[type].timer=add_timer(
+				500+tick, status_change_timer,
+				bl->id, data);
+			return 0;
+		}
+		break;
+		
 	case SC_PROVOKE:	/* プロボック/オ?トバ?サ?ク */
 		if(sc->data[type].val2!=0){	/* オ?トバ?サ?ク(1秒ごとにHPチェック) */
 			if(sd && sd->status.hp>sd->status.max_hp>>2)	/* 停止 */