From cbc365d0f2f02ebceece4b6de7d58c8fe487f88f Mon Sep 17 00:00:00 2001 From: aleos89 Date: Sun, 6 Nov 2016 14:14:42 -0500 Subject: [PATCH] Corrected autospell bonuses (fixes #1593) * Resolves the range check when the config is enabled not checking the proper distance between the two targets. * Updated the item bonus documentation. Thanks to @chriser-! --- doc/item_bonus.txt | 3 ++- src/map/skill.c | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/item_bonus.txt b/doc/item_bonus.txt index 24b4adf5a5..bdc6067226 100644 --- a/doc/item_bonus.txt +++ b/doc/item_bonus.txt @@ -329,7 +329,8 @@ bonus2 bWeaponComaRace,r,n; Adds a n/100% chance to cause Coma when attacking | 5. AutoSpell Bonuses | ======================== NOTES: - - For all AutoSpell bonuses, target must be within the spell's range to go off. + - For all AutoSpell bonuses, target does not have be within the spell's range to go off. + -- Enable conf/battle/battle.conf::autospell_check_range to force a range check. - By default, AutoSpell skills are casted on target unless it is a self or support skill (inf = 4/16). bonus3 bAutoSpell,sk,y,n; Adds a n/10% chance to cast skill sk of level y when attacking diff --git a/src/map/skill.c b/src/map/skill.c index 9a3481988d..cf6cc57670 100755 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -2043,7 +2043,7 @@ int skill_additional_effect(struct block_list* src, struct block_list *bl, uint1 } } if (battle_config.autospell_check_range && - !battle_check_range(src, tbl, skill_get_range2(src, skill, autospl_skill_lv, true))) + !battle_check_range(bl, tbl, skill_get_range2(src, skill, autospl_skill_lv, true))) continue; if (skill == AS_SONICBLOW) @@ -2172,7 +2172,7 @@ int skill_onskillusage(struct map_session_data *sd, struct block_list *bl, uint1 } } if (battle_config.autospell_check_range && - !battle_check_range(&sd->bl, tbl, skill_get_range2(&sd->bl, skill, skill_lv, true))) + !battle_check_range(bl, tbl, skill_get_range2(&sd->bl, skill, skill_lv, true))) continue; sd->state.autocast = 1; @@ -2383,7 +2383,7 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list * } } - if (!battle_check_range(src, tbl, skill_get_range2(src, autospl_skill_id, autospl_skill_lv, true)) && battle_config.autospell_check_range) + if (!battle_check_range(bl, tbl, skill_get_range2(src, autospl_skill_id, autospl_skill_lv, true)) && battle_config.autospell_check_range) continue; dstsd->state.autocast = 1;