From 4e8b55b30bdfd9c3a71ef3c21b40fd22f11320e6 Mon Sep 17 00:00:00 2001 From: toms Date: Sat, 19 Aug 2006 21:04:17 +0000 Subject: - Fixed @homlvup bug - Fixed AM_REST & AM_RESU consumming SP if they fail - Fixed homunc spawning bug git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8375 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/atcommand.c | 2 +- src/map/clif.c | 2 +- src/map/pc.c | 2 +- src/map/skill.c | 14 ++++++++++++++ 4 files changed, 17 insertions(+), 3 deletions(-) (limited to 'src/map') diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 00bc9dd39..5c9983700 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -9783,7 +9783,7 @@ int atcommand_homlevel( if (!message || !*message) return -1; - if ( sd->status.hom_id == 0 || !sd->homunculus.hp || sd->homunculus.vaporize ) + if ( !merc_is_hom_active(sd->hd) ) return 1 ; level = atoi(message); diff --git a/src/map/clif.c b/src/map/clif.c index 4537deb26..bbf7370ce 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -8289,7 +8289,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd) } //homunculus [blackhole89] - if(sd->hd && sd->hd->battle_status.hp) { + if(merc_is_hom_active(sd->hd)) { map_addblock(&sd->hd->bl); clif_spawn(&sd->hd->bl); // clif_homunack(sd); diff --git a/src/map/pc.c b/src/map/pc.c index 6dc4ad33a..a241f8c9e 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -3368,7 +3368,7 @@ int pc_setpos(struct map_session_data *sd,unsigned short mapindex,int x,int y,in sd->pd->ud.dir = sd->ud.dir; } - if(sd->status.hom_id > 0 && sd->hd ) { //orn + if(sd->status.hom_id > 0 && merc_is_hom_active(sd->hd)) { //orn sd->hd->bl.m = m; sd->hd->bl.x = sd->hd->ud.to_x = x; sd->hd->bl.y = sd->hd->ud.to_y = y; diff --git a/src/map/skill.c b/src/map/skill.c index beaa78e08..feaa6b026 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -8349,6 +8349,20 @@ int skill_check_condition (struct map_session_data *sd, int skill, int lv, int t if (sd->status.hom_id) //Don't delete items when hom is already out. checkitem_flag = delitem_flag = 0; break; + case AM_REST: //Can't vapo homun if you don't have an active homunc or it's hp is < 80% + if (!merc_is_hom_active(sd->hd) || sd->hd->battle_status.hp < (sd->hd->battle_status.max_hp*80/100)) + { + clif_skill_fail(sd,skill,0,0); + return 0; + } + 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) + { + clif_skill_fail(sd,skill,0,0); + return 0; + } + break; } if(!(type&2)){ -- cgit v1.2.3-70-g09d2