Zzbrandon Posted November 26, 2012 Author Share Posted November 26, 2012 Solved Link to comment Share on other sites More sharing options...
Matt Posted November 26, 2012 Share Posted November 26, 2012 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 Functionerrorhandler: HandleError "Rand", "modGeneral", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit FunctionEnd Function``` Link to comment Share on other sites More sharing options...
Zzbrandon Posted November 26, 2012 Author Share Posted November 26, 2012 Solved Link to comment Share on other sites More sharing options...
Matt Posted November 26, 2012 Share Posted November 26, 2012 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 BooleanDim rate As LongDim rndNum As LongCanPlayerDodge = Falserate = GetPlayerStat(index, Agility) / 83.3'RIGHT UNDER HERE'rndNum = rand(1, 100)If rndNum <= rate Then CanPlayerDodge = TrueEnd IfEnd Function```It gets a random number from 1 to 100. Link to comment Share on other sites More sharing options...
Zzbrandon Posted November 26, 2012 Author Share Posted November 26, 2012 Solved Link to comment Share on other sites More sharing options...
Matt Posted November 26, 2012 Share Posted November 26, 2012 Correct. Link to comment Share on other sites More sharing options...
Zzbrandon Posted November 26, 2012 Author Share Posted November 26, 2012 Solved Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now