diff options
author | AnnieRuru <jeankof@ymail.com> | 2014-09-02 05:28:46 +0800 |
---|---|---|
committer | AnnieRuru <jeankof@ymail.com> | 2014-09-02 05:28:46 +0800 |
commit | fa6d3eb080a69ba5b0ee5d73ddfdf67ccf9018a6 (patch) | |
tree | 02661124d22d2190886fa87e14b9f5571489dae2 /src/map | |
parent | 4677ae74054a6a110e27a7c1be68b35a1dad249b (diff) | |
parent | dd907688635add8a4652f67593cc4e8977bdaa04 (diff) | |
download | hercules-fa6d3eb080a69ba5b0ee5d73ddfdf67ccf9018a6.tar.gz hercules-fa6d3eb080a69ba5b0ee5d73ddfdf67ccf9018a6.tar.bz2 hercules-fa6d3eb080a69ba5b0ee5d73ddfdf67ccf9018a6.tar.xz hercules-fa6d3eb080a69ba5b0ee5d73ddfdf67ccf9018a6.zip |
Merge branch 'master' of https://github.com/HerculesWS/Hercules
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/battle.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index 945d52c64..30b358492 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -2692,22 +2692,11 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam d->dmg_lv = ATK_BLOCK; return 0; } - if( (sce=sc->data[SC_AUTOGUARD]) && flag&BF_WEAPON && !(skill->get_nk(skill_id)&NK_NO_CARDFIX_ATK) && rnd()%100 < sce->val2 ) - { + if ((sce=sc->data[SC_AUTOGUARD]) && flag&BF_WEAPON && !(skill->get_nk(skill_id)&NK_NO_CARDFIX_ATK) && rnd()%100 < sce->val2) { int delay; - struct block_list *d_bl; - struct status_change_entry *sce_d; - bool devoted = false; - - if ((sce_d = sc->data[SC_DEVOTION]) && (d_bl = map->id2bl(sce_d->val1)) && - ((d_bl->type == BL_MER && ((TBL_MER*)d_bl)->master && ((TBL_MER*)d_bl)->master->bl.id == bl->id) || // - (d_bl->type == BL_PC && ((TBL_PC*)d_bl)->devotion[sce_d->val2] == bl->id))) { - // if player is target of devotion, show guard effect on the devotion caster rather than the target - devoted = true; - clif->skill_nodamage(d_bl, d_bl, CR_AUTOGUARD, sce->val1, 1); - } else - clif->skill_nodamage(bl, bl, CR_AUTOGUARD,sce->val1, 1); - + struct block_list *d_bl = NULL; + struct status_change_entry *sce_d = sc->data[SC_DEVOTION]; + // different delay depending on skill level [celest] if (sce->val1 <= 5) delay = 300; @@ -2716,7 +2705,17 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam else delay = 100; - unit->set_walkdelay((devoted ? d_bl : bl), timer->gettick(), delay, 1); + if (sce_d && (d_bl = map->id2bl(sce_d->val1)) + && ((d_bl->type == BL_MER && ((TBL_MER*)d_bl)->master && ((TBL_MER*)d_bl)->master->bl.id == bl->id) + || (d_bl->type == BL_PC && ((TBL_PC*)d_bl)->devotion[sce_d->val2] == bl->id)) + ) { + // if player is target of devotion, show guard effect on the devotion caster rather than the target + clif->skill_nodamage(d_bl, d_bl, CR_AUTOGUARD, sce->val1, 1); + unit->set_walkdelay(d_bl, timer->gettick(), delay, 1); + } else { + clif->skill_nodamage(bl, bl, CR_AUTOGUARD, sce->val1, 1); + unit->set_walkdelay(bl, timer->gettick(), delay, 1); + } if(sc->data[SC_CR_SHRINK] && rnd()%100<5*sce->val1) skill->blown(bl,src,skill->get_blewcount(CR_SHRINK,1),-1,0); |