On Wed, Aug 08, 2012 at 10:31:41AM +1200, Ralph Versteegen wrote: > On 8 August 2012 07:52, James Paige <[email protected]> wrote: > >> > >> script, atlevel hook, level, at 0, at 99, hero id, stat number, begin > >> if (level >= 0) then ( > >> return ((.8 + level / 50) * level * ((at 99 -- at 0) / 275.222) + at 0 > >> + .1) > >> ) > >> end > >> > > > > Wait, I think I got it: > > > > script, atlevel hook, level, at 0, at 99, hero id, stat number, begin > > if (level >= 0) then ( > > return (((800 + level * 1000 / 50000) * level * 1000 * ((at 99 -- at > > 0) * 1000 / 275222) + at 0 * 1000 + 100) / 1000) > > ) > > end > > > > > > --- > > James > > Not quite. That had an error or two, and would overflow. > > script, atlevel hook, level, at 0, at 99, hero id, stat number, begin > if (level >= 0) then ( > return ( ( (800 + level * 1000 / 50) * level * (at 99 -- at 0) + 6 * > 27522 ) > / 275222 + at 0) > ) > end > > The 6 * 27522 = (0.1 + 0.5) * 275222 is from the +0.1 plus 0.5 to > make it round properly.
Oh! Haha. I screwed up because x * y <> x * 10 * y * 10 / 10 I'll get this straight in my head sooner or later :) I am regretting all the times in high school math class when I said "I'm never going to use this again after I pass this class" and tuned out. :) --- James _______________________________________________ Ohrrpgce mailing list [email protected] http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
