summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
authortoms <toms@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-07-27 11:56:22 +0000
committertoms <toms@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-07-27 11:56:22 +0000
commitd6477ea054fa860fd44a008172f6da2e5e6a308f (patch)
tree1b82405176e3ba0677918cd554177e45bec87daf /src/map/skill.c
parent5c5b78dc8c26ae02a1b8245a8398c8cffdb314f3 (diff)
downloadhercules-d6477ea054fa860fd44a008172f6da2e5e6a308f.tar.gz
hercules-d6477ea054fa860fd44a008172f6da2e5e6a308f.tar.bz2
hercules-d6477ea054fa860fd44a008172f6da2e5e6a308f.tar.xz
hercules-d6477ea054fa860fd44a008172f6da2e5e6a308f.zip
* Fix homunc & code cleanup [Toms]
- Timer problems on delete_timer - Intimacy problem (overflow & new values) - Homunc deleted if intimacy < 0 - base exp is now given to master - Homunc sometimes not saved git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7913 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c64
1 files changed, 31 insertions, 33 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 1ccb4be2b..e36b39cad 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -5546,56 +5546,54 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
case AM_CALLHOMUN: //[orn]
{
int i = 0;
- if (sd && (sd->status.hom_id == 0 || sd->homunculus.vaporize == 1)) {
- if (sd->status.hom_id == 0) {
- i = pc_search_inventory(sd,7142);
- if(i < 0) {
- clif_skill_fail(sd,skillid,0,0);
- break ;
+ if (sd)
+ {
+ if ((sd->status.hom_id == 0 || sd->homunculus.vaporize == 1)) {
+ if (sd->status.hom_id == 0) {
+ i = pc_search_inventory(sd,7142);
+ if(i < 0) {
+ clif_skill_fail(sd,skillid,0,0);
+ break ;
+ }
+ pc_delitem(sd,i,1,0);
}
- pc_delitem(sd,i,1,0);
+ if (merc_call_homunculus(sd))
+ break;
}
- if (merc_call_homunculus(sd))
- break;
+ clif_skill_fail(sd,skillid,0,0);
}
-
- clif_skill_fail(sd,skillid,0,0);
break;
}
case AM_REST: //[orn]
{
- if (sd && sd->hd && ( sd->hd->battle_status.hp >= (sd->hd->battle_status.max_hp * 80 / 100 ) ) ) {
- sd->homunculus.vaporize = 1;
- clif_hominfo(sd, 0);
- merc_hom_delete(sd->hd, 0) ;
- } else if ( sd )
+ if (sd)
{
+ if (sd->hd && ( sd->hd->battle_status.hp >= (sd->hd->battle_status.max_hp * 80 / 100 ) ) ) {
+ sd->homunculus.vaporize = 1;
+ clif_hominfo(sd, 0);
+ merc_hom_delete(sd->hd, 0) ;
+ }
clif_skill_fail(sd,skillid,0,0);
}
-
break;
}
case AM_RESURRECTHOMUN: //[orn]
{
- if ( sd && sd->status.hom_id ) {
- if( map_flag_gvg(bl->m) )
- { //No reviving in WoE grounds!
- clif_skill_fail(sd,skillid,0,0);
- break;
- }
- if ( sd->homunculus.hp == 0 ) {
- int per = 10 * skilllv;
-
- if (merc_hom_revive(sd, per) )
- {
- clif_skill_nodamage(src,&sd->hd->bl,AM_RESURRECTHOMUN,skilllv,1);
- } else {
+ if (sd)
+ {
+ if (sd->status.hom_id && sd->homunculus.hp == 0)
+ {
+ if( map_flag_gvg(bl->m) )
+ { //No reviving in WoE grounds!
clif_skill_fail(sd,skillid,0,0);
+ break;
}
- } else {
+ if (merc_hom_revive(sd, 10 * skilllv) )
+ clif_skill_nodamage(src,&sd->hd->bl,AM_RESURRECTHOMUN,skilllv,1);
+ else
+ clif_skill_fail(sd,skillid,0,0);
+ } else
clif_skill_fail(sd,skillid,0,0);
- }
-
}
break;
}