From 42d26584d4b8e0bfb3c50bdd5112a4c29003ea42 Mon Sep 17 00:00:00 2001 From: toms Date: Mon, 21 Aug 2006 19:33:51 +0000 Subject: Fixed AM_RESURRECTION, thanks to RockmanEXE for %HP values git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8409 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/mercenary.c | 4 +++- src/map/skill.c | 10 ++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'src/map') diff --git a/src/map/mercenary.c b/src/map/mercenary.c index 6b508429f..53bc562b7 100644 --- a/src/map/mercenary.c +++ b/src/map/mercenary.c @@ -820,7 +820,9 @@ int merc_revive_homunculus(struct map_session_data *sd, unsigned char per, short map_addblock(&sd->hd->bl); clif_spawn(&sd->hd->bl); } - return status_revive(&hd->bl, per, 0); + status_revive(&hd->bl, per, 0); + sd->homunculus.hp = hd->battle_status.hp; + return 1; } void merc_homun_revive(struct homun_data *hd, unsigned int hp, unsigned int sp) diff --git a/src/map/skill.c b/src/map/skill.c index c00a85a9a..b5853be09 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -6287,8 +6287,14 @@ int skill_castend_pos2 (struct block_list *src, int x, int y, int skillid, int s case AM_RESURRECTHOMUN: //[orn] if (sd) { + int p; + // If skilllv = 1, range = 1~4%, lv 2 : 5~25%, lv 3 : 25~45%, ... + if (skilllv == 1) + p = 1 + rand() % 4; + else + p = 5 + 20 * (skilllv - 2) + rand() % 21; if (map_flag_gvg(src->m) || //No reviving in WoE grounds! - !merc_revive_homunculus(sd, 10*skilllv, x, y)) + !merc_revive_homunculus(sd, p, x, y)) { clif_skill_fail(sd,skillid,0,0); break; @@ -8350,7 +8356,7 @@ int skill_check_condition (struct map_session_data *sd, int skill, int lv, int t } break; case AM_RESURRECTHOMUN: // Can't resurrect homun if you don't have a dead homun - if (!sd->status.hom_id || sd->homunculus.vaporize || !sd->hd || sd->hd->battle_status.hp) + if (!sd->status.hom_id || sd->homunculus.hp) { clif_skill_fail(sd,skill,0,0); return 0; -- cgit v1.2.3-60-g2f50