summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-02-12 18:02:41 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-02-12 18:02:41 +0000
commit16c5028d6274e5c1a21dfcc0f26f926597ff2edd (patch)
tree18dafae15f96bf4403e492da64ea473513890760 /src/map/skill.c
parent97353c7d82e3537982d2687f3b16a6c92e25b33b (diff)
downloadhercules-16c5028d6274e5c1a21dfcc0f26f926597ff2edd.tar.gz
hercules-16c5028d6274e5c1a21dfcc0f26f926597ff2edd.tar.bz2
hercules-16c5028d6274e5c1a21dfcc0f26f926597ff2edd.tar.xz
hercules-16c5028d6274e5c1a21dfcc0f26f926597ff2edd.zip
- Corrected range of self destruction / bio explosion to be equal to their splash range.
- Corrected Spider Web casting around caster instead of target's position - Corrected a possible crash during login due to checking for the incorrect variable (lets pc_calc_status be invoked when it shouldn't) - Reenabled the base status aspd calculation for homunc (status_calc_bl calculates battle_status, status_calc_homunculus calculates base_status, they are not the same!) - Corrected the meaning of "skill_display_fail&2", made 2 the default setting. - Added bounds checking to map_foreachincell - Opt2 values (poison, blind, and so on) are now resent on warp/map-change - Corrected description of isloggedin script command. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9853 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index f5283b9d8..8f003aa6b 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -5550,24 +5550,6 @@ int skill_castend_id (int tid, unsigned int tick, int id, int data)
return 0;
}
- switch (ud->skillid) {
- //These should become skill_castend_pos
- case WE_CALLPARTNER:
- case WE_CALLPARENT:
- case WE_CALLBABY:
- case AM_RESURRECTHOMUN:
- case PF_SPIDERWEB:
- //Find a random spot to place the skill. [Skotlex]
- inf2 = skill_get_splash(ud->skillid, ud->skilllv);
- ud->skillx = src->x + inf2;
- ud->skilly = src->y + inf2;
- if (inf2 && !map_random_dir(src, &ud->skillx, &ud->skilly)) {
- ud->skillx = src->x;
- ud->skilly = src->y;
- }
- return skill_castend_pos(tid,tick,id,data);
- }
-
if(ud->skillid != SA_CASTCANCEL ) {
if( ud->skilltimer != tid ) {
ShowError("skill_castend_id: Timer mismatch %d!=%d!\n", ud->skilltimer, tid);
@@ -5584,12 +5566,31 @@ int skill_castend_id (int tid, unsigned int tick, int id, int data)
else
target = map_id2bl(ud->skilltarget);
+
// Use a do so that you can break out of it when the skill fails.
do {
if(!target || target->prev==NULL) break;
if(src->m != target->m || status_isdead(src)) break;
+ switch (ud->skillid) {
+ //These should become skill_castend_pos
+ case WE_CALLPARTNER:
+ case WE_CALLPARENT:
+ case WE_CALLBABY:
+ case AM_RESURRECTHOMUN:
+ case PF_SPIDERWEB:
+ //Find a random spot to place the skill. [Skotlex]
+ inf2 = skill_get_splash(ud->skillid, ud->skilllv);
+ ud->skillx = target->x + inf2;
+ ud->skilly = target->y + inf2;
+ if (inf2 && !map_random_dir(target, &ud->skillx, &ud->skilly)) {
+ ud->skillx = target->x;
+ ud->skilly = target->y;
+ }
+ return skill_castend_pos(tid,tick,id,data);
+ }
+
if(ud->skillid == RG_BACKSTAP) {
int dir = map_calc_dir(src,target->x,target->y),t_dir = unit_getdir(target);
if(check_distance_bl(src, target, 0) || map_check_dir(dir,t_dir)) {