From d704f26907c104336bc47fde4e27448dcfa38444 Mon Sep 17 00:00:00 2001 From: celest Date: Wed, 16 Feb 2005 12:46:21 +0000 Subject: Added 3 more of the new card effects git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1117 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/mob.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'src/map/mob.c') 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外に消えた人は計算から除くので -- cgit v1.2.3-70-g09d2