summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-15 15:26:51 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-15 15:26:51 +0000
commite4803fa9d29af8a88a20039c636cb47fcb2a898a (patch)
treec2c2b944b02f050d2f2fc41370552c3b3f3c9da9 /src/map/skill.c
parentfa6f60245d391ec204be0cf1a6a8a2fca5bea609 (diff)
downloadhercules-e4803fa9d29af8a88a20039c636cb47fcb2a898a.tar.gz
hercules-e4803fa9d29af8a88a20039c636cb47fcb2a898a.tar.bz2
hercules-e4803fa9d29af8a88a20039c636cb47fcb2a898a.tar.xz
hercules-e4803fa9d29af8a88a20039c636cb47fcb2a898a.zip
- Asura Strike now moves you to the target on fail always (unless the target does not exists or is in another map or there's a obstacle on the way)
- Corrected skill_attack_area hitting dead characters on it's splash range. - Swapped the values for OPTION_XMAS and OPTION_FLYING. This should enable SG to show the fly animation again, even if sometimes others will see him as Santa. As for xmas cloth, it shouldn't make much of a difference since the view class is changed to christmas anyway. - Moved the AM_CALLHOMUN code from castend_id to castend_pos. - Made AM_CALLHOMUN and AM_RESURRECTHOMUN be like the wedding skills, where they automatically pick a spot around you. - Cleaned up some the AM_RESURRECTHOMUN code. Hopefully it works now. - Cleaned up some the hom evolution code. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8292 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c75
1 files changed, 32 insertions, 43 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index cdd6a90ce..d0a2cd8ad 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -5486,37 +5486,11 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
}
break;
- case AM_CALLHOMUN: //[orn]
- if (sd && !merc_call_homunculus(sd))
- clif_skill_fail(sd,skillid,0,0);
- break;
-
case AM_REST: //[orn]
if (sd && !merc_hom_vaporize(sd,1))
clif_skill_fail(sd,skillid,0,0);
break;
- case AM_RESURRECTHOMUN: //[orn]
- {
- 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;
- }
- 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;
- }
-
case HAMI_CASTLE: //[orn]
if(rand()%100 > 20*skilllv || src == bl)
break; //Failed.
@@ -5631,10 +5605,12 @@ int skill_castend_id (int tid, unsigned int tick, int id, int data)
}
switch (ud->skillid) {
- //These three should become skill_castend_pos
+ //These should become skill_castend_pos
case WE_CALLPARTNER:
case WE_CALLPARENT:
- case WE_CALLBABY:
+ case WE_CALLBABY:
+ case AM_CALLHOMUN:
+ case AM_RESURRECTHOMUN:
//Find a random spot to place the skill. [Skotlex]
inf2 = skill_get_splash(ud->skillid, ud->skilllv);
ud->skillx = src->x + inf2;
@@ -5787,9 +5763,8 @@ int skill_castend_id (int tid, unsigned int tick, int id, int data)
if (sc->data[SC_BLADESTOP].timer != -1)
status_change_end(src,SC_BLADESTOP,-1);
}
- if (target && target->m == src->m &&
- (tid == -1 || status_check_skilluse(src, target, ud->skillid, 1))
- ) { //Move character to target anyway.
+ if (target && target->m == src->m)
+ { //Move character to target anyway.
int dx,dy;
dx = target->x - src->x;
dy = target->y - src->y;
@@ -6273,6 +6248,23 @@ int skill_castend_pos2 (struct block_list *src, int x, int y, int skillid, int s
skill_unitsetting(src,skillid,skilllv,src->x,src->y,0);
break;
+ case AM_CALLHOMUN: //[orn]
+ if (sd && !merc_call_homunculus(sd, x, y))
+ clif_skill_fail(sd,skillid,0,0);
+ break;
+
+ case AM_RESURRECTHOMUN: //[orn]
+ if (sd)
+ {
+ if (map_flag_gvg(src->m) || //No reviving in WoE grounds!
+ !merc_revive_homunculus(sd, 10*skilllv, x, y))
+ {
+ clif_skill_fail(sd,skillid,0,0);
+ break;
+ }
+ }
+ break;
+
default:
ShowWarning("skill_castend_pos2: Unknown skill used:%d\n",skillid);
return 1;
@@ -9149,26 +9141,23 @@ int skill_attack_area (struct block_list *bl, va_list ap)
int atk_type,skillid,skilllv,flag,type;
unsigned int tick;
- nullpo_retr(0, bl);
- nullpo_retr(0, ap);
+ if(status_isdead(bl))
+ return 0;
atk_type = va_arg(ap,int);
- if((src=va_arg(ap,struct block_list*)) == NULL)
- return 0;
- if((dsrc=va_arg(ap,struct block_list*)) == NULL)
- return 0;
+ src=va_arg(ap,struct block_list*);
+ dsrc=va_arg(ap,struct block_list*);
skillid=va_arg(ap,int);
skilllv=va_arg(ap,int);
- if(skillid > 0 && skilllv <= 0) return 0; // celest
tick=va_arg(ap,unsigned int);
flag=va_arg(ap,int);
type=va_arg(ap,int);
- if(battle_check_target(dsrc,bl,type) > 0 &&
- status_check_skilluse(NULL, bl, skillid, 2)) //also check if they can be hit.
- skill_attack(atk_type,src,dsrc,bl,skillid,skilllv,tick,flag);
-
- return 0;
+ if(battle_check_target(dsrc,bl,type) <= 0 ||
+ !status_check_skilluse(NULL, bl, skillid, 2))
+ return 0;
+
+ return skill_attack(atk_type,src,dsrc,bl,skillid,skilllv,tick,flag);
}
/*==========================================
*