Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[Solved]


Zzbrandon
 Share

Recommended Posts

Dodging and parrying do the same thing. They generate the chance that a player can avoid the attack. Dodging is based on agility, and parrying is based on strength.

As for Rand….

```

Public Function Rand(ByVal Low As Long, ByVal High As Long) As Long

' If debug mode, handle error then exit out

If Options.Debug = 1 Then On Error GoTo errorhandler

Rand = Int((High - Low + 1) * Rnd) + Low

' Error handler

Exit Function

errorhandler:

HandleError "Rand", "modGeneral", Err.Number, Err.Description, Err.Source, Err.HelpContext

Err.Clear

Exit Function

End Function

```
Link to comment
Share on other sites

If you type in your code```

rand(

```You'll see it needs two numbers. It needs them because it gets a random number between the lowest one, and the highest one. For example,

```

Public Function CanPlayerDodge(ByVal index As Long) As Boolean

Dim rate As Long

Dim rndNum As Long

CanPlayerDodge = False

rate = GetPlayerStat(index, Agility) / 83.3

'RIGHT UNDER HERE'

rndNum = rand(1, 100)

If rndNum <= rate Then

CanPlayerDodge = True

End If

End Function

```

It gets a random number from 1 to 100.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...