summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVicious <Vicious@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-07-27 02:55:21 +0000
committerVicious <Vicious@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-07-27 02:55:21 +0000
commit9e5844193ac03b80f69e5a3d8ef8775e30d93915 (patch)
tree92d19d67bb26c50f543eafcc997bf243dba79181 /src
parent7d0670e755c689eed12af0f8b89b936557f897c9 (diff)
downloadhercules-9e5844193ac03b80f69e5a3d8ef8775e30d93915.tar.gz
hercules-9e5844193ac03b80f69e5a3d8ef8775e30d93915.tar.bz2
hercules-9e5844193ac03b80f69e5a3d8ef8775e30d93915.tar.xz
hercules-9e5844193ac03b80f69e5a3d8ef8775e30d93915.zip
* Changed the way hit bonus is applied.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10916 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/battle.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index b6d9dfd89..047e3229d 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -1110,18 +1110,19 @@ static struct Damage battle_calc_weapon_attack(
if(wd.flag&BF_LONG && !skill_num && //Fogwall's hit penalty is only for normal ranged attacks.
tsc && tsc->data[SC_FOGWALL].timer!=-1)
- hitrate-=50;
+ hitrate -= 50;
if(sd && flag.arrow)
hitrate += sd->arrow_hit;
if(skill_num)
switch(skill_num)
{ //Hit skill modifiers
+ //It is proven that bonus is applied on final hitrate, not hit.
case SM_BASH:
- hitrate += 5*skill_lv;
+ hitrate += hitrate * 5 * skill_lv / 100;
break;
case SM_MAGNUM:
- hitrate += 10*skill_lv;
+ hitrate += hitrate * 10 * skill_lv / 100;
break;
case KN_AUTOCOUNTER:
case PA_SHIELDCHAIN:
@@ -1134,20 +1135,20 @@ static struct Damage battle_calc_weapon_attack(
case NPC_DARKNESSATTACK:
case NPC_UNDEADATTACK:
case NPC_TELEKINESISATTACK:
- hitrate += 20;
+ hitrate += hitrate * 20 / 100;
break;
case KN_PIERCE:
- hitrate += hitrate*(5*skill_lv)/100;
+ hitrate += hitrate * 5 * skill_lv / 100;
break;
case AS_SONICBLOW:
if(sd && pc_checkskill(sd,AS_SONICACCEL)>0)
- hitrate += 50;
+ hitrate += hitrate * 50 / 100;
break;
}
// Weaponry Research hidden bonus
if (sd && (skill = pc_checkskill(sd,BS_WEAPONRESEARCH)) > 0)
- hitrate += hitrate*(2*skill)/100;
+ hitrate += hitrate * ( 2 * skill ) / 100;
if (hitrate > battle_config.max_hitrate)
hitrate = battle_config.max_hitrate;
@@ -1157,7 +1158,7 @@ static struct Damage battle_calc_weapon_attack(
if(rand()%100 >= hitrate)
wd.dmg_lv = ATK_FLEE;
else
- flag.hit =1;
+ flag.hit = 1;
} //End hit/miss calculation
if (flag.hit && !flag.infdef) //No need to do the math for plants