View Single Post
Old 03-10-2009, 06:23 PM   #2
gth
Member
 
Join Date: Nov 2003
Posts: 50
gth is on a distinguished road
Re: Having a few issues that need fixed before I can compile WHO CAN HELP?:>

Is there a 'learning to code' forum? It's been quite a few years, but I'll have a stab at it:

val=(int)(100.0*(0.35*exp(0.055*(double)(GetMaxLev el(ch)-GetMaxLevel(vict)))))

The victim's level is subtracted from the caster's level: (GetMaxLevel(ch)-GetMaxLevel(vict))
then type-cast into a type double (double)
then multiplied by (0.055* ....)
the result is then passed to the exp function, I think exp(...)
the return value from the exp function is then multiplied by 0.35, then by 100
finally, the value is type-cast into an INT and assigned to the variable 'val'

After all that, the brackets seem correct and although you have a space in 'GetMaxLevel', your vague description of the error implies that a function isn't getting the right arguments. We'd need the error message text to know which function for sure.

ePart = ((double)(skill)/90.0) * EVEN_CHANCE * exp(SCALER * (double)(diff));

Given that the only function in both lines of code is exp(), I'm guessing that the number of type double that you're passing is either incorrect or that there is an additional parameter required. Check the function definition to see what parameters the code expects to be passed.
gth is offline   Reply With Quote