diff options
Diffstat (limited to 'src/map/status.c')
-rw-r--r-- | src/map/status.c | 39 |
1 files changed, 12 insertions, 27 deletions
diff --git a/src/map/status.c b/src/map/status.c index 86fc8fb29..336b9165d 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -4113,21 +4113,12 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val int hp = status_get_hp(bl);
int mhp = status_get_max_hp(bl);
- // MHP?1/4????????
+ //Lose 10/15% of your life as long as it doesn't brings life below 25%
if (hp > mhp>>2) {
- if(bl->type == BL_PC) {
- int diff = mhp*10/100;
- if (hp - diff < mhp>>2)
- diff = hp - (mhp>>2);
- pc_heal((struct map_session_data *)bl, -diff, 0);
- } else if(bl->type == BL_MOB) {
- struct mob_data *md = (struct mob_data *)bl;
- hp -= mhp*15/100;
- if (hp > mhp>>2)
- md->hp = hp;
- else
- md->hp = mhp>>2;
- }
+ int diff = mhp*(bl->type==BL_PC?10:15)/100;
+ if (hp - diff < mhp>>2)
+ diff = hp - (mhp>>2);
+ battle_damage(NULL, bl, diff, 1);
}
} // fall through
case SC_POISON: /* “Å */
@@ -4355,7 +4346,7 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val }
case SC_COMA: //Coma. Sends a char to 1HP
- battle_damage(NULL, bl, status_get_hp(bl)-1, 0);
+ battle_damage(NULL, bl, status_get_hp(bl)-1, 1);
return 1;
case SC_CLOSECONFINE2:
@@ -5441,7 +5432,7 @@ int status_change_timer(int tid, unsigned int tick, int id, int data) if((++sc->data[type].val4)%5 == 0 && status_get_hp(bl) > hp>>2) {
hp = hp/100;
if(hp < 1) hp = 1;
- battle_heal(NULL, bl, -hp, 0, 0);
+ battle_damage(NULL, bl, hp, 1);
}
sc->data[type].timer=add_timer(1000+tick,status_change_timer, bl->id, data );
return 0;
@@ -5453,7 +5444,7 @@ int status_change_timer(int tid, unsigned int tick, int id, int data) break;
case SC_DPOISON:
if ((--sc->data[type].val3) > 0 && sc->data[SC_SLOWPOISON].timer == -1)
- battle_heal(NULL, bl, -sc->data[type].val4, 0, 1);
+ battle_damage(NULL, bl, sc->data[type].val4, 1);
if (sc->data[type].val3 > 0 && !status_isdead(bl))
{
sc->data[type].timer = add_timer (1000 + tick, status_change_timer, bl->id, data );
@@ -5484,13 +5475,9 @@ int status_change_timer(int tid, unsigned int tick, int id, int data) // To-do: bleeding effect increases damage taken?
if ((sc->data[type].val4 -= 10000) >= 0) {
int hp = rand()%600 + 200;
- battle_heal(NULL,bl,-hp,0,1);
- if (!status_isdead(bl)) {
- // walking and casting effect is lost
- unit_stop_walking (bl, 1);
- unit_skillcastcancel (bl, 2);
+ battle_damage(NULL,bl,hp,0);
+ if (!status_isdead(bl))
sc->data[type].timer = add_timer(10000 + tick, status_change_timer, bl->id, data );
- }
return 0;
}
break;
@@ -5655,10 +5642,8 @@ int status_change_timer(int tid, unsigned int tick, int id, int data) (sd == NULL || sd->status.sp - sp> 0))
{
if (sd)
- pc_heal(sd,-hp,-sp);
- else if (bl->type == BL_MOB)
- mob_heal((struct mob_data *)bl,-hp);
-
+ pc_damage_sp(sd, sp, 0);
+ battle_damage(NULL, bl, hp, 1);
if ((sc->data[type].val2 -= 10000) > 0) {
sc->data[type].timer = add_timer(
10000+tick, status_change_timer,
|