diff options
author | celest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-03-27 12:53:00 +0000 |
---|---|---|
committer | celest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-03-27 12:53:00 +0000 |
commit | c307cc46b9cb61aec87b899c153fce1b436ec8f3 (patch) | |
tree | 905888ddab67f899bc8fd7eab0189413588ff283 | |
parent | 1c016a1b9997d8e086cb583bf7f82377d6a40d26 (diff) | |
download | hercules-c307cc46b9cb61aec87b899c153fce1b436ec8f3.tar.gz hercules-c307cc46b9cb61aec87b899c153fce1b436ec8f3.tar.bz2 hercules-c307cc46b9cb61aec87b899c153fce1b436ec8f3.tar.xz hercules-c307cc46b9cb61aec87b899c153fce1b436ec8f3.zip |
* Fixed AutospellWhenHit effect to only work on melee attacks
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1311 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r-- | Changelog-SVN.txt | 1 | ||||
-rw-r--r-- | src/map/battle.c | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/Changelog-SVN.txt b/Changelog-SVN.txt index 2ed5abb17..7f7763c37 100644 --- a/Changelog-SVN.txt +++ b/Changelog-SVN.txt @@ -1,6 +1,7 @@ Date Added 03/27 + * Fixed AutospellWhenHit effect to only work on melee attacks [celest] * Fixed AddEffWhenHit effect to only work on melee attacks [celest] * Moved guardian hostility checking and monster_ignore_gm check to battle.c -- processed earlier, and more appropiate [celest] diff --git a/src/map/battle.c b/src/map/battle.c index 9e8f6b578..25aae5ec0 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -3616,7 +3616,8 @@ int battle_weapon_attack( struct block_list *src,struct block_list *target, } if (target->type == BL_PC) { struct map_session_data *tsd = (struct map_session_data *)target; - if(tsd->autospell2_id > 0 && rand()%100 < tsd->autospell2_rate) { + if(tsd && ((sd && !sd->state.arrow_atk) || (status_get_range(src)<=2)) && + tsd->autospell2_id > 0 && rand()%100 < tsd->autospell2_rate) { int skilllv = tsd->autospell_lv,i,f=0,sp; i = rand()%100; if(i >= 50) skilllv -= 2; |