math = fun ...sometimes [Archive] - ForumsHQ

Post Reply
syntax53
Posts: 0
Joined: Wed Apr 03, 2002 6:00 am

math = fun ...sometimes [Archive] - ForumsHQ

Post by syntax53 »

my monster exp dividing formula:





If DatFileVersion = v111j Then

If Monsterrec.ExpMulti = 1 Or Monsterrec.ExpMulti = 0 Then

nBase = SLong2ULong(Monsterrec.Experience)

nBase = Round(nBase / divisor)

If nBase 2147483646 Then nBase = 2147483646

Monsterrec.Experience = ULong2SLong(nBase)

Else

nBase = SLong2ULong(Monsterrec.Experience) * SLong2ULong(Monsterrec.ExpMulti)

nBase = Round(nBase / divisor)

If nBase > 2147483646 Then nBase = 2147483646



tryagain:

nMultiMax = 20

For x = 20 To 65538

If x * 32767 >= nBase Then

nMultiMax = x

Exit For

End If

Next x



nMulti = 1

For x = 3 To nMultiMax

temp = nBase Mod x

If temp = 0 Then nMulti = x

Next x



If nMulti = 1 Then

nBase = nBase - 1

GoTo tryagain:

End If



nBase = nBase / nMulti

If nBase <= 0 Then nBase = 1

Monsterrec.Experience = ULong2SLong(nBase)

Monsterrec.ExpMulti = ULong2SLong(nMulti)

End If

Else

nBase = SLong2ULong(Monsterrec.Experience)

nBase = Round(nBase / divisor)

If nBase <= 0 Then nBase = 1

Monsterrec.Experience = ULong2SLong(nBase)

End If
Durin
Posts: 0
Joined: Thu Nov 07, 2002 6:00 am

Re: math = fun ...sometimes [Archive] - ForumsHQ

Post by Durin »

What is that written in? (Nightmare that is)
syntax53
Posts: 0
Joined: Wed Apr 03, 2002 6:00 am

Re: math = fun ...sometimes [Archive] - ForumsHQ

Post by syntax53 »

VB 6
Locke Cole
Posts: 0
Joined: Fri Jun 21, 2002 5:00 am

Re: math = fun ...sometimes [Archive] - ForumsHQ

Post by Locke Cole »

Originally posted by syntax53

my monster exp dividing formula:

I haven't used VB in eons, so maybe all that is really needed, but all I do is multiply the ExpMulti by the old Experience field. The check for 1.11j is important tho. =)
Reckless

Re: math = fun ...sometimes [Archive] - ForumsHQ

Post by Reckless »

how's your term prog coming locke?
Locke Cole
Posts: 0
Joined: Fri Jun 21, 2002 5:00 am

Re: math = fun ...sometimes [Archive] - ForumsHQ

Post by Locke Cole »

Originally posted by Reckless

how's your term prog coming locke?

Slow but sure. =) No ETA or anything though, but with 1.11j out I've got more reason to keep plugging away on it. ;)
Reckless

Re: math = fun ...sometimes [Archive] - ForumsHQ

Post by Reckless »

no kidding....hehe...megapud just isn't gonna cut it much longer
syntax53
Posts: 0
Joined: Wed Apr 03, 2002 6:00 am

Re: math = fun ...sometimes [Archive] - ForumsHQ

Post by syntax53 »

Originally posted by Locke Cole



I haven't used VB in eons, so maybe all that is really needed, but all I do is multiply the ExpMulti by the old Experience field. The check for 1.11j is important tho. =)



yeah that's easy to get how much total exp the monster gives. but i gotta then take that number, do math to it, and then figure out the new best numbers to use for the base and multiplier to write to the dats. that's what all that code is for.



-syn
Post Reply

Return to “Nightmare Redux”