summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
authorcelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-04-07 13:42:03 +0000
committercelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-04-07 13:42:03 +0000
commita37f1982ac7b798b1a696908d96059ed15d62065 (patch)
tree40a46eddd8be507719840a33a22017234a613ec7 /src/map/skill.c
parent72131e08166ade4883ed5be548060030f7fe1ba6 (diff)
downloadhercules-a37f1982ac7b798b1a696908d96059ed15d62065.tar.gz
hercules-a37f1982ac7b798b1a696908d96059ed15d62065.tar.bz2
hercules-a37f1982ac7b798b1a696908d96059ed15d62065.tar.xz
hercules-a37f1982ac7b798b1a696908d96059ed15d62065.zip
* Fixed HP Conversion to properly not reduce HP if SP is full
* Updated Defender git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1427 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 1111ed293..c53a7a9d6 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -4380,17 +4380,17 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
case PF_HPCONVERSION: /* ライフ置き換え */
clif_skill_nodamage(src, bl, skillid, skilllv, 1);
if (sd) {
- int conv_hp, conv_sp;
- conv_hp = sd->status.max_hp / 10; //基本はHPの10%
- //sd->status.hp -= conv_hp; //HPを減らす
- conv_sp = conv_hp * 10 * skilllv / 100;
- if (sd->status.sp + conv_sp > sd->status.max_sp)
- conv_hp = sd->status.max_sp - sd->status.sp;
- if (pc_checkoversp(sd))
- conv_hp = conv_sp = 0;
- //sd->status.sp += conv_sp; //SPを?やす
- pc_heal(sd, -conv_hp, conv_sp);
- clif_heal(sd->fd, SP_SP, conv_sp);
+ int hp, sp;
+ hp = sd->status.max_hp / 10; //基本はHPの10%
+ sp = hp * 10 * skilllv / 100;
+ if (sd->status.sp + sp > sd->status.max_sp)
+ sp = sd->status.max_sp - sd->status.sp;
+ // we need to check with the sp that was taken away when casting too
+ if (sd->status.sp + skill_get_sp(skillid, skilllv) >= sd->status.max_sp)
+ hp = sp = 0;
+ pc_heal(sd, -hp, sp);
+ clif_heal(sd->fd, SP_SP, sp);
+ clif_updatestatus(sd, SP_SP);
}
break;
case HT_REMOVETRAP: /* リム?ブトラップ */