Quote:
Yesterday at 11:47 PM lioncool1589 said this in Post #2228
bitsys if i want decrease percent miss in battle without decrease def armor, etc.. which codes i change in battleupdate.php
|
The following code handle the % chance to hit.
It should be pretty self-explanatory.
PHP Code:
// ############ % Chance to hit code ############
if ($oevade > 0)
{
$hitchance = 0.6 + log10($uspeed / $oevade);
}
else
{
$hitchance = .9;
}
if ($hitchance < .4)
{
$aphitchance = ($user[ap] - 40) / 100;
if ($aphitchance < 0)
{
$aphitchance = 0;
}
$hitchance = .4 + $aphitchance;
}
if ($hitchance > .9)
{
$hitchance = .9;
}
$debugvariables .= "Hit Chance (\$hitchance): $hitchance\n";