summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-06-16 14:08:18 +0000
committerInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-06-16 14:08:18 +0000
commit0e7c4d6eec53794c34137dd1b4f540f22772f003 (patch)
tree52ac4509cc1813034508e609e37df595776b179f /src/map
parent9a8fab9f29c7284c23b54e67bdb85a05de9b36eb (diff)
downloadhercules-0e7c4d6eec53794c34137dd1b4f540f22772f003.tar.gz
hercules-0e7c4d6eec53794c34137dd1b4f540f22772f003.tar.bz2
hercules-0e7c4d6eec53794c34137dd1b4f540f22772f003.tar.xz
hercules-0e7c4d6eec53794c34137dd1b4f540f22772f003.zip
* Turn Undead shouldn't apply aftercast delay when casted on a "living" entity. (bugreport:1740)
* Autocasts should always fail if the target is outside the skill range or an obstacle is in between. (bugreport:3201) * The Lovers should affect the target instead of the caster. (bugreport:3252) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13895 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/skill.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 227ae1fe1..f33b7bb59 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -1003,6 +1003,10 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int
if (rand()%1000 > rate)
continue;
+
+ if( !battle_check_range(src, bl, skill_get_range2(src, skill,skilllv) + (skill == RG_CLOSECONFINE?0:1)) )
+ continue; //Autocasts should always fail if the target is outside the skill range or an obstacle is in between.[Inkfish]
+
if (sd->autospell[i].id < 0)
tbl = src;
else
@@ -1102,6 +1106,8 @@ int skill_onskillusage(struct map_session_data *sd, struct block_list *bl, int s
continue; // No target
if( rand()%1000 > sd->autospell3[i].rate )
continue;
+ if( !battle_check_range(&sd->bl, bl, skill_get_range2(&sd->bl, skill,skilllv) + (skill == RG_CLOSECONFINE?0:1)) )
+ continue;
if( sd->autospell3[i].id < 0 )
tbl = &sd->bl;
@@ -1274,6 +1280,8 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
continue;
if (rand()%1000 > rate)
continue;
+ if( !battle_check_range(src, bl, skill_get_range2(src, skillid,skilllv) + (skillid == RG_CLOSECONFINE?0:1)) )
+ continue;
if (dstsd->autospell2[i].id < 0)
tbl = bl;
else
@@ -5316,8 +5324,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
sc_start(bl,SC_INCATKRATE,100,-50,skill_get_time2(skillid,skilllv));
break;
case 5: // 2000HP heal, random teleported
- status_heal(src, 2000, 0, 0);
- unit_warp(src, -1,-1,-1, 3);
+ status_heal(bl, 2000, 0, 0);
+ unit_warp(bl, -1,-1,-1, 3);
break;
case 6: // random 2 other effects
if (count == -1)
@@ -5757,6 +5765,7 @@ int skill_castend_id(int tid, unsigned int tick, int id, intptr data)
break;
}
}
+ else
if( ud->skillid == PR_LEXDIVINA || ud->skillid == MER_LEXDIVINA )
{
sc = status_get_sc(target);
@@ -5767,6 +5776,13 @@ int skill_castend_id(int tid, unsigned int tick, int id, intptr data)
}
}
else
+ if( ud->skillid == PR_TURNUNDEAD )
+ {
+ struct status_data *tstatus = status_get_status_data(target);
+ if( !battle_check_undead(tstatus->race, tstatus->def_ele) )
+ break;
+ }
+ else
{ // Check target validity.
inf = skill_get_inf(ud->skillid);
inf2 = skill_get_inf2(ud->skillid);