It's very annoying when in pvp you hit 0 very often
How can i make so you would hit more accurate through defence bonus?
This is the code:
Code:
void getHitDiff(Client Atk) {
int aBonus = 0;
int rand_att = Misc.random(playerLevel[0])*3 +
Misc.random(AtkPray * 8);
int rand_def = (int) (0.65 *
Misc.random(Atk.playerLevel[1]) + Atk.DefPray * 8);
if (Atk.protMelee)
rand_def += Misc.random(100);
if (FightType == 1)
aBonus += (int) (playerBonus[1] / 20);
int random_u = Misc.random(playerBonus[1] + aBonus)
* 2;
int dBonus = 0;
if (Atk.FightType == 4)
dBonus += (int) (Atk.playerBonus[6] / 20);
int random_def = Misc.random(Atk.playerBonus[6] +
dBonus + Atk.AtkPray * 8);
if ((random_u >= random_def) && (rand_att >
rand_def)) {
CalculateMaxHit();
hitDiff = Misc.random(playerMaxHit);
if (Atk.protMelee)
hitDiff /= 2;
} else {
hitDiff = 0;
}
}
Base: Richscape
Thank you if someone will help