diff options
Diffstat (limited to 'src/map/mob.c')
-rw-r--r-- | src/map/mob.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/map/mob.c b/src/map/mob.c index 15f06f940..b32db9966 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -2164,8 +2164,7 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type) struct item item; int ret; int drop_rate; - int skill,sp; - + nullpo_retr(0, md); //srcはNULLで呼ばれる場合もあるので、他でチェック max_hp = status_get_max_hp(&md->bl); @@ -2384,14 +2383,20 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type) if(src && src->type == BL_MOB) mob_unlocktarget((struct mob_data *)src,tick); - /* ソウルドレイン */ - if(sd && sd->state.attack_type == BF_MAGIC && (skill=pc_checkskill(sd,HW_SOULDRAIN))>0){ - clif_skill_nodamage(src,&md->bl,HW_SOULDRAIN,skill,1); - sp = (status_get_lv(&md->bl))*(65+15*skill)/100; - if(sd->status.sp + sp > sd->status.max_sp) - sp = sd->status.max_sp - sd->status.sp; - sd->status.sp += sp; - clif_heal(sd->fd,SP_SP,sp); + + if(sd) { + int sp = 0; + if (sd->state.attack_type == BF_MAGIC && (i=pc_checkskill(sd,HW_SOULDRAIN))>0){ /* ソウルドレイン */ + clif_skill_nodamage(src,&md->bl,HW_SOULDRAIN,i,1); + sp += (status_get_lv(&md->bl))*(65+15*i)/100; + } + sp += sd->sp_gain_value; + if (sp > 0) { + if(sd->status.sp + sp > sd->status.max_sp) + sp = sd->status.max_sp - sd->status.sp; + sd->status.sp += sp; + clif_heal(sd->fd,SP_SP,sp); + } } // map外に消えた人は計算から除くので |