SRL Archive - SRL Archives

FindXP Simba Fix


Bad Boy JH

2010-06-01 07:53:33

Simba's Pow needs the 7 and/or 2 in these functions to be 7.0 and 2.0, So I made a few changes to get it working
function ConvertXpToLvl(xp: Integer): Integer;
var
level, exp: Integer;
begin
for level := 0 to 99 do
begin
exp := exp + Trunc(level + 300 * Pow(2.0, level / 7.0));
if ((exp / 4) > xp) then
begin
Result := level;
Exit;
end;
end;
Result := 99;
end;

function ConvertLvlToXP(Level: Integer): Integer;
var
I, exp: Integer;
Power, TPower:Extended;
begin
for i := 1 to Level-1 do
IncEx(Exp, Trunc(i + 300.0 * Pow(2.0, i / 7.0)));
Result := exp / 4;
end;

Bad Boy JH

2010-06-14 01:20:42

Sorry for double posting but this NEEDS to be commited, every times I re-open simba, it updates SRL, and it takes away what I changed, (this fix). This is what is NEEDED to get Simba to use this function.

Wizzup?

2010-06-14 08:28:05

Committed. :)

BraK

2010-06-14 09:01:06

That Function that your fixing looks awfully familar. Good to see that somebody uses it. Nice fix by the way.