summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-19 19:25:41 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-19 19:25:41 +0000
commitda62c8ed7c93b0032975e3683840e22289bfa4f2 (patch)
tree7aaee280c0b81acc0ce7cebeeb5acd73986618e1 /src/map
parent97a04116dfc0347d15ba8f87f4f5ba614b548128 (diff)
downloadhercules-da62c8ed7c93b0032975e3683840e22289bfa4f2.tar.gz
hercules-da62c8ed7c93b0032975e3683840e22289bfa4f2.tar.bz2
hercules-da62c8ed7c93b0032975e3683840e22289bfa4f2.tar.xz
hercules-da62c8ed7c93b0032975e3683840e22289bfa4f2.zip
- Fixed battle_calc_base_damage being called for the left hand even for non-dual-wielding attacks. left-hand damage was being set to 0 later anyway, so no exploit existed.
- Moved the weapon_atk_rate bonus to battle_calc_base_damage so that it'll apply correctly when dual-wielding different types of weapons. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8370 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/battle.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index f4a28b534..d78b83c31 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -713,10 +713,19 @@ static int battle_calc_base_damage(struct status_data *status, struct weapon_atk
damage += status->batk;
//rodatazone says that Overrefine bonuses are part of baseatk
+ //Here we also apply the weapon_atk_rate bonus so it is correctly applied on left/right hands.
if(sd) {
- type = (wa == status->lhw)?sd->left_weapon.overrefine:sd->right_weapon.overrefine;
- if (type > 0)
- damage += rand()%type+1;
+ if (type == EQI_HAND_L) {
+ if(sd->left_weapon.overrefine)
+ damage += rand()%sd->left_weapon.overrefine+1;
+ if (sd->weapon_atk_rate[sd->weapontype2])
+ damage += damage*sd->weapon_atk_rate[sd->weapontype2]/100;;
+ } else { //Right hand
+ if(sd->right_weapon.overrefine)
+ damage += rand()%sd->right_weapon.overrefine+1;
+ if (sd->weapon_atk_rate[sd->weapontype1])
+ damage += damage*sd->weapon_atk_rate[sd->weapontype1]/100;;
+ }
}
return damage;
}
@@ -1216,7 +1225,7 @@ static struct Damage battle_calc_weapon_attack(
i |= 16; // for ex. shuriken must not be influenced by DEX
}
wd.damage = battle_calc_base_damage(sstatus, &sstatus->rhw, sc, tstatus->size, sd, i);
- if (sstatus->lhw)
+ if (sstatus->lhw && flag.lh)
wd.damage2 = battle_calc_base_damage(sstatus, sstatus->lhw, sc, tstatus->size, sd, i);
// Added split damage for Huuma
@@ -1230,8 +1239,8 @@ static struct Damage battle_calc_weapon_attack(
//Add any bonuses that modify the base baseatk+watk (pre-skills)
if(sd)
{
- if ((sd->atk_rate != 100 || sd->weapon_atk_rate[sd->weapontype1] != 0))
- ATK_RATE(sd->atk_rate + sd->weapon_atk_rate[sd->weapontype1]);
+ if (sd->atk_rate != 100)
+ ATK_RATE(sd->atk_rate);
if(flag.cri && sd->crit_atk_rate)
ATK_ADDRATE(sd->crit_atk_rate);