From d62d89d59c8bac947f5404edac831e64073b5455 Mon Sep 17 00:00:00 2001 From: icxbb-xx Date: Wed, 5 Nov 2014 00:10:15 +0700 Subject: [PATCH] Fixed Bug. - Snap dodge bug (bugreport:3510)(Hercules 76662cc) --- conf/battle/battle.conf | 6 +++++- src/map/battle.c | 9 +++++++-- src/map/battle.h | 1 + 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/conf/battle/battle.conf b/conf/battle/battle.conf index da40e3e8bf..39aa806a30 100644 --- a/conf/battle/battle.conf +++ b/conf/battle/battle.conf @@ -1,4 +1,4 @@ -//-------------------------------------------------------------- +//-------------------------------------------------------------- // rAthena Battle Configuration File // Originally Translated by Peter Kieser // Made in to plainer English by Ancyker @@ -149,3 +149,7 @@ knockback_left: yes // Can players use Falcons and Wargs at the same time? (Note 1) // This is not allowed on official servers. warg_can_falcon: no + +// Should the target be able of dodging damage by snapping away to the edge of the screen? +// Official behavior is "no" +snap_dodge: no diff --git a/src/map/battle.c b/src/map/battle.c index 6073b4fc75..75442cd2d0 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -320,12 +320,16 @@ int battle_delay_damage(unsigned int tick, int amotion, struct block_list *src, { struct delay_damage *dat; struct status_change *sc; + struct block_list *d_tbl = NULL; nullpo_ret(src); nullpo_ret(target); sc = status_get_sc(target); - if( sc && sc->data[SC_DEVOTION] && damage > 0 && skill_id != PA_PRESSURE && skill_id != CR_REFLECTSHIELD ) + if (sc && sc->data[SC_DEVOTION] && sc->data[SC_DEVOTION]->val1) + d_tbl = map_id2bl(sc->data[SC_DEVOTION]->val1); + + if( d_tbl && sc && sc->data[SC_DEVOTION] && damage > 0 && skill_id != PA_PRESSURE && skill_id != CR_REFLECTSHIELD ) damage = 0; if ( !battle_config.delay_battle_damage || amotion <= 1 ) { @@ -347,7 +351,7 @@ int battle_delay_damage(unsigned int tick, int amotion, struct block_list *src, dat->damage = damage; dat->dmg_lv = dmg_lv; dat->delay = ddelay; - dat->distance = distance_bl(src, target)+10; //Attack should connect regardless unless you teleported. + dat->distance = distance_bl(src, target) + (battle_config.snap_dodge ? 10 : battle_config.area_size); dat->additional_effects = additional_effects; dat->src_type = src->type; if (src->type != BL_PC && amotion > 1000) @@ -7922,6 +7926,7 @@ static const struct _battle_data { { "monster_chase_refresh", &battle_config.mob_chase_refresh, 1, 0, 30, }, { "mob_icewall_walk_block", &battle_config.mob_icewall_walk_block, 75, 0, 255, }, { "boss_icewall_walk_block", &battle_config.boss_icewall_walk_block, 0, 0, 255, }, + { "snap_dodge", &battle_config.snap_dodge, 0, 0, 1, }, }; #ifndef STATS_OPT_OUT diff --git a/src/map/battle.h b/src/map/battle.h index 997c6ce46f..eea04bfbd8 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -576,6 +576,7 @@ extern struct Battle_Config int mob_chase_refresh; //How often a monster should refresh its chase [Playtester] int mob_icewall_walk_block; //How a normal monster should be trapped in icewall [Playtester] int boss_icewall_walk_block; //How a boss monster should be trapped in icewall [Playtester] + int snap_dodge; // Enable or disable dodging damage snapping away [csnv] } battle_config; void do_init_battle(void);