Gość |
Wysłany: Sob 12:03, 19 Cze 2010 Temat postu: |
|
Const
MinHPPercent = 85; //
var
Creature: TCreature;
function GetItemFromOpenBackpack(ID: integer): TItem;
var
x: integer;
y: integer;
begin
Result := nil;
for x := 0 to Self.Containers.Count - 1 do
begin
if x >= Self.Containers.Count then Break;
for y := 0 to Self.Containers.Container[x].Count - 1 do
begin
if y >= Self.Containers.Container[x].Count then Break;
if Self.Containers.Container[x].Item[y].ID = ID then
begin
Result := Self.Containers.Container[x].Item[y];
Exit;
end;
end;
end;
end;
while not Terminated do
begin
UpdateWorld;
for x := 0 to Creatures.Count - 1 do
begin
if (Creatures.Creature[x].Name=Self.Name) then
begin
if (Creatures.Creature[x].Health <= MinHPPercent) then
begin
Rune := GetItemFromOpenBackpack(3193);
if Rune <> nil then
begin
Rune.UseWithGround(Self.X, Self.Y, Self.Z);
Sleep(50);
end;
end;
end;
end;
Sleep(10);
end |
|