![]() |
problem With critical Hits - Printable Version +- Mirage Engine (https://mirage-engine.uk/forums) +-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61) +--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18) +---- Forum: Programming (https://mirage-engine.uk/forums/forumdisplay.php?fid=24) +----- Forum: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=27) +----- Thread: problem With critical Hits (/showthread.php?tid=3264) |
problem With critical Hits - jsventor - 30-10-2009 Code: If CanPlayerCriticalHit(Index) = False Then The CanPlayerCriticalHit Function is [code]Function CanPlayerCriticalHit(ByVal Index As Long) As Boolean Dim i As Long, N As Long Dim Num1 As Long Dim Agi As Long Dim Spd As Long Dim lvl As Long Dim STR As Long Dim Rand As Long CanPlayerCriticalHit = False Agi = GetPlayerAgil(Index) Spd = GetPlayerSPEED(Index) lvl = GetPlayerLevel(Index) STR = GetPlayerSTR(Index) Num1 = (500 + lvl) / (Agi + Spd) + (lvl / 90) Rand = Random(1, Num1 + (Num1 * 2)) If GetPlayerWeaponSlot(Index) > 0 Then N = Rand If N > 6 Then CanPlayerCriticalHit = False If N |