summaryrefslogtreecommitdiff
path: root/src/map/status.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/status.c')
-rw-r--r--src/map/status.c72
1 files changed, 45 insertions, 27 deletions
diff --git a/src/map/status.c b/src/map/status.c
index b1c36fb16..279d2e5f3 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -3915,6 +3915,15 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
//Must not override a casting gospel char.
if (sc->data[type].val4 == BCT_SELF)
return 0;
+ case SC_KAAHI:
+ if(sc->data[type].val1 > val1)
+ return 1;
+ //Delete timer if it exists.
+ if (sc->data[type].val4 != -1) {
+ delete_timer(sc->data[type].val4,kaahi_heal_timer);
+ sc->data[type].val4=-1;
+ }
+ break;
default:
if(sc->data[type].val1 > val1)
return 1; //Return true to not mess up skill animations. [Skotlex
@@ -4438,11 +4447,13 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
calc_flag = 1;
break;
case SC_KAAHI:
- if(flag&4)
+ if(flag&4) {
+ val4 = -1;
break;
- val2 = tick/500;
- val3 = 200*val1; //HP heal
- tick = 500;
+ }
+ val2 = 200*val1; //HP heal
+ val3 = 5*val2; //SP cost
+ val4 = -1; //Kaahi Timer.
break;
case SC_BLESSING:
if ((!undead_flag && race!=RC_DEMON) || bl->type == BL_PC)
@@ -5192,6 +5203,13 @@ int status_change_end( struct block_list* bl , int type,int tid )
skill_delunitgroup(bl, group);
}
break;
+ case SC_KAAHI:
+ //Delete timer if it exists.
+ if (sc->data[type].val4 != -1) {
+ delete_timer(sc->data[type].val4,kaahi_heal_timer);
+ sc->data[type].val4=-1;
+ }
+ break;
//gs_something2 [Vicious]
case SC_MADNESSCANCEL:
@@ -5327,6 +5345,29 @@ int status_change_end( struct block_list* bl , int type,int tid )
return 1;
}
+int kaahi_heal_timer(int tid, unsigned int tick, int id, int data)
+{
+ struct block_list *bl;
+ struct status_change *sc;
+ int hp;
+
+ bl=map_id2bl(id);
+ sc=status_get_sc(bl);
+ if (!sc || data != SC_KAAHI || sc->data[data].timer==-1)
+ return 0;
+
+ if (bl->type == BL_PC && ((TBL_PC*)bl)->status.sp < sc->data[data].val3)
+ return 0;
+
+ hp = status_get_max_hp(bl) - status_get_hp(bl);
+ if (hp > sc->data[data].val2)
+ hp = sc->data[data].val2;
+ if (hp) {
+ battle_heal(bl, bl, hp, -sc->data[data].val3, 1);
+ clif_skill_nodamage(NULL,bl,AL_HEAL,hp,1);
+ }
+ return 1;
+}
/*==========================================
* ステータス異常終了タイマー
@@ -5432,29 +5473,6 @@ 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) /* 停止 */