Rick
2009-08-18 22:07:48
The rest function restores Hitpoints at twice the normal rate. I couldn't find a rest for Hitpoint healing, so I modded the RestUntil [Run Energy] quite a bit and this is the result.
This will make the player rest until the Hitpoint percentage is equal to what was defined. Useful for auto-fighters with no food left.
Please comment :)
{*******************************************************************************
function RestHPUntil(Percent: Integer): Boolean;
By: r!ch!e [RestHPUntil]. Based off of ZephyrsFury [RestUntil].
Description: Rests until HP is equal to Percent. Results True if successful.
Modded RestUntil. Restores Hitpoints instead of run.
*******************************************************************************}
function RestHPUntil(Percent: Integer): Boolean;
var
s: string;
i,ii, Mark: integer;
begin
//Result := True;
if Percent > 100 then
begin
WriteLn('Invalid HP Percent');
Exit;
end;
ii:= GetSkillInfo('hp',false)
i := Round(GetMMLevels('hp', s) * 100 / ii)
if (i >= Percent) then Exit;
SetRest;
MarkTime(Mark);
while (i < Percent) do
begin
if (TimeFromMark(Mark) > 600000) then Exit;
wait(2000 + random(300));
i := Round(GetMMLevels('hp', s) * 100 / ii);
end;
case i of
Percent: Result:= True;
end;
if (not(Result)) then Exit;
Wait(100 + Random(50));
end;This will make the player rest until the Hitpoint percentage is equal to what was defined. Useful for auto-fighters with no food left.
Please comment :)