Page 1 of 1

Animal Taming AoP

Posted: 12.05.2020 20:56
by Procosha
Бегает между 2мя точками и тамит зверя. Если приручил зверя, то делает All release.
Подхиливает зверя если меньше 100% здоровья.
Хилит сам себя.
Останавливает прокачку таминга если здоровья мало у животного.
Кушает фишстейки с пака через 15 мин.

коряво Алэ працуЭ!

Code: Select all

Program Taming_AoP;

var

FTime, CTime, SCNTBANDAGE : TDateTime;

const

Animal = $00DA;
FirstPointX = 1000;
FirstPointY = 2000;
SecondPointX = 1003;
SecondPointY = 2003;

Procedure Taming;
begin

  if FindType(Animal,Ground) <> 0 then
  begin
    
      if GetDistance(FindItem) <= 1 then
      begin
        if (GetX(self) = FirstPointX) and (GetY(Self) = FirstPointY) then
        begin
          NewMoveXY(SecondPointX,SecondPointY,true,0,true);
        end;
      end;
      if GetDistance(FindItem) <= 1 then
      begin
        if (GetX(self) = SecondPointX) and (GetY(Self) = SecondPointY) then
        begin
          NewMoveXY(FirstPointX,FirstPointY,true,0,true);
        end;
      end;
      if (100*(GetHP(FindItem))/(GetMaxHP(FindItem))) > 80.0 then
    begin
      if (Now > (CTime + ((1.0/86400) * 3))) then
      begin
        Useskill('Animal Taming');
        WaitForTarget(5000);
        if TargetPresent then
        begin
          TargetToObject(FindItem);
          CTime := Now;
        end;
      end;
    end;
  end;
end;

Procedure Heal;
begin
  If (HP < MaxHP) and (Now > (SCNTBANDAGE + ((1.0/86400) * 8))) then
  begin
    UOSay(Chr(39)+'pc heal self');
    SCNTBANDAGE := Now;
  end;
  if FindType(Animal,Ground) <> 0 then
  begin
    if ((100*(GetHP(FindItem)/GetMaxHP(FindItem))) < 100.0) and (Now > (SCNTBANDAGE + ((1.0/86400) * 8))) then
    begin
      while (Now < (CTime + ((1.0/86400) * 4))) do
      begin
        wait(100);
      end;
      UOSay(Chr(39)+'pc heal '+ IntToHex(FindItem, 8));
      SCNTBANDAGE := Now;
    end;
  end;
end;

Procedure Check;
begin
  if InJournalBetweenTimes('Вы уже контролируете это животное!',CTime,Now) <> -1 then
  begin
    UOSay('All Release');
    ClearJournal;
  end;
end;

Procedure Eat;
begin
  if (Now > (FTime + ((1.0/86400) * 900))) then
  begin
    if (Now > (SCNTBANDAGE + ((1.0/86400) * 9))) then
    begin
      if FindType($097b,backpack) <> 0 then
      begin
        UseObject(FindItem);
        FTime := Now;
      end;
    end;
  end;
end;

begin
  NewMoveXY(FirstPointX,FirstPointY,true,0,true);
  FindDistance := 6;
  FindVertical := 255;
  while Connected and not Dead do
  begin
    Heal;
    Check;
    Taming;
    Eat;
    wait(100);
  end;
end.