summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog-Trunk.txt3
-rw-r--r--src/map/skill.c20
2 files changed, 21 insertions, 2 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 624531988..d24add8f3 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -5,6 +5,9 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
09/06/16
* Fixed an exploit that makes guild skill get higher level than the max defined in guild_skill_tree. (bugreport:3241) [Inkfish]
+ * Turn Undead won't apply aftercast delay when casted on a "living" entity. (bugreport:1740) [Inkfish]
+ * Autocasts should always fail if the target is outside the skill range or an obstacle is in between. (bugreport:3201) [Inkfish]
+ * The Lovers should affect the target instead of the caster. (bugreport:3252)[Inkfish]
09/06/15
* Skill through items will not be blocked when 90% overweight. (bugreport:3246) [Inkfish]
* Now you can drop items when hiding. [Inkfish]
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);