SCAR Code:
function CombatLevel(Attack, Defence, Strength, Hitpoints, Prayer, Ranged, Magic, Summoning : integer) : integer;
var
E1, E2, E3 : extended;
I1, I2, I3 : integer;
Base, Maxx : extended;
begin
Base := (Defence + Hitpoints + Floor(Prayer /2) + Floor(Summoning / 2)) * 0.25;
E1 := (Attack + Strength) * 0.325;
E2 := Floor(Ranged * 1.5) * 0.325;
E3 := Floor(Magic * 1.5) * 0.325;
Maxx := MaxE(I1, MaxE(I2, I3));
Result := (Round(Base + Maxx) * 100) / 100;
end;
There you go, ported from JavaScript (mormonman's post) to SCAR/Pascal
.