summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-03-17 20:37:32 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-03-17 20:37:32 +0000
commitafb3f4a4c2f9ca1d65e12fa05661b0c3ba8741ae (patch)
treee6307432e70c0b6c5556bc7b1a6b772d99ec9fa3
parent89eceb35f643c7af982fd4d77ecbfd08a2734760 (diff)
downloadhercules-afb3f4a4c2f9ca1d65e12fa05661b0c3ba8741ae.tar.gz
hercules-afb3f4a4c2f9ca1d65e12fa05661b0c3ba8741ae.tar.bz2
hercules-afb3f4a4c2f9ca1d65e12fa05661b0c3ba8741ae.tar.xz
hercules-afb3f4a4c2f9ca1d65e12fa05661b0c3ba8741ae.zip
Fixed Reject Sword, bugreport:4493 it nows applies damage reduction damage properly and rejects dual-wield weapons properly as on official servers. super thanks to daegaladh for his contribution
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15700 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--src/map/battle.c33
1 files changed, 15 insertions, 18 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index e38fd8a37..012877418 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -564,23 +564,6 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
damage = damage > 10 ? damage / 10 : 1;
}
#endif
- // FIXME:
- // So Reject Sword calculates the redirected damage before calculating WoE/BG reduction? This is weird. [Inkfish]
- if((sce=sc->data[SC_REJECTSWORD]) && flag&BF_WEAPON &&
- // Fixed the condition check [Aalye]
- (src->type!=BL_PC || (
- ((TBL_PC *)src)->status.weapon == W_DAGGER ||
- ((TBL_PC *)src)->status.weapon == W_1HSWORD ||
- ((TBL_PC *)src)->status.weapon == W_2HSWORD
- )) &&
- rnd()%100 < sce->val2
- ){
- damage = damage*50/100;
- status_fix_damage(bl,src,damage,clif_damage(bl,src,gettick(),0,0,damage,0,0,0));
- clif_skill_nodamage(bl,bl,ST_REJECTSWORD,sce->val1,1);
- if(--(sce->val3)<=0)
- status_change_end(bl, SC_REJECTSWORD, INVALID_TIMER);
- }
//Finally added to remove the status of immobile when aimedbolt is used. [Jobbie]
if( skill_num == RA_AIMEDBOLT && (sc->data[SC_BITE] || sc->data[SC_ANKLE] || sc->data[SC_ELECTRICSHOCKER]) )
@@ -2824,7 +2807,21 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo
wd.damage-=wd.damage2;
}
}
-
+ //Reject Sword bugreport:4493 by Daegaladh
+ if(wd.damage && tsc && tsc->data[SC_REJECTSWORD] &&
+ (src->type!=BL_PC || (
+ ((TBL_PC *)src)->weapontype1 == W_DAGGER ||
+ ((TBL_PC *)src)->weapontype1 == W_1HSWORD ||
+ ((TBL_PC *)src)->status.weapon == W_2HSWORD
+ )) &&
+ rnd()%100 < tsc->data[SC_REJECTSWORD]->val2
+ ) {
+ wd.damage = wd.damage * 50 / 100;
+ status_fix_damage(target,src,wd.damage,clif_damage(target,src,gettick(),0,0,wd.damage,0,0,0));
+ clif_skill_nodamage(target,target,ST_REJECTSWORD,tsc->data[SC_REJECTSWORD]->val1,1);
+ if( --(tsc->data[SC_REJECTSWORD]->val3) <= 0 )
+ status_change_end(target, SC_REJECTSWORD, INVALID_TIMER);
+ }
if(skill_num == ASC_BREAKER) { //Breaker's int-based damage (a misc attack?)
struct Damage md = battle_calc_misc_attack(src, target, skill_num, skill_lv, wflag);
wd.damage += md.damage;