Code: Select all
Program Fishing;
type FishR = record
tile:word;
px,py,pz:integer;
end;
var
ItemCount,i:Integer;
FishP: array [0..20] of FishR;
Pole:Cardinal;
Const
ArmBox =$48BBA331;
BankBox =$515B65B4;
{$Include 'all.inc'}
procedure FullDisconnect;
begin
SetARStatus(false);
Disconnect;
end;
Procedure GetFishTiles(s:String;WPos:Integer);
begin
s := s + ' ';
FishP[WPos].tile:=StrToInt(Copy(s,1,Pos(' ',s)-1));
Delete(s,1,Pos(' ',s));
FishP[WPos].px:=StrToInt(Copy(s,1,Pos(' ',s)-1));
Delete(s,1,Pos(' ',s));
FishP[WPos].py:=StrToInt(Copy(s,1,Pos(' ',s)-1));
Delete(s,1,Pos(' ',s));
FishP[WPos].pz:=StrToInt(Copy(s,1,Pos(' ',s)-1));
Delete(s,1,Pos(' ',s));
end;
Procedure GetCoord;
var
List:TStringList;
i:integer;
begin
List:=TStringList.Create;
List.LoadFromFile('Tiles.txt');
for i := 0 to List.Count-1 do
GetFishTiles(List.strings[i],i);
ItemCount:=i;
end;
Procedure DeathR;
begin
if life = 0 then
begin
WaitConnection(1000);
WaitGump('1');
while life = 0 do
wait(1000);
WaitConnection(1000);
UseObject(BankBox);
wait(500);
UseObject(ArmBox);
wait(500);
FindType($13FF,ArmBox);
if FindCount <> 0 then
Grab(finditem,1);
FindType($0F3F,ground);
if FindCount <> 0 then
Grab(finditem,100);
end;
end;
Procedure Kill(Enemy:Cardinal);
var
RTime:Cardinal;
begin
CheckSave;
WaitConnection(1000);
Disarm;
wait(1000);
FindType($13FF,backpack);
if FindCount > 0 then
Equip(RhandLayer,$13FF);
wait(300);
FindType($1B76,backpack);
if FindCount > 0 then
Equip(LhandLayer,$1B76);
wait(300);
WaitConnection(1000);
Attack(Enemy);
RTime:=Timer;
While (GetDistance(Enemy)<15) and (Timer < (RTime + (30 *1000))) do
begin
if life < MaxHp then
UOSay(Chr(39)+'pc heal self');
Wait(3200);
CheckSave;
WaitConnection(1000);
end;
Disarm;
wait(750);
usetype($13FF);
WaitTargetGround($2006)
wait(1000);
SetWarMode(false);
end;
Procedure DangerCheak;
var
Enemy:array[1..4] of Cardinal;
i:Integer;
begin
Enemy[1] := $0190;
Enemy[2] := $0191;
Enemy[3] := $0010;
Enemy[4] := $0096;
Ignore(Self);
for i:=1 to 4 do
begin
CheckSave;
WaitConnection(1000);
FindType(Enemy[i],ground);
if FindCount>0 then
Kill(FindItem);
end;
end;
Procedure Fish(tile:Word;x,y,z:Integer);
var
FBegin:TDateTime;
begin
FBegin:=Now;
while (not InJournalBetweenTimes('seem to be',FBegin,Now)>=0) do
begin
If TargetPresent then
CancelTarget;
If (GetType(Pole) = 0) then
begin
FindType($0DBF,backpack);
if FindCount > 0 then
Pole:=finditem
else
begin
UseObject(ArmBox);
wait(250);
FindType($0DBF,ArmBox);
if FindCount > 0 then
Pole:=finditem
else
Equipt(Pole)
Wait(300)
FullDisconnect;
end;
end;
DeathR;
WaitTargetTile(tile,x,y,z);
Equipt(Pole)
Wait(300)
UseObject(Pole);
WaitConnection(1000);
WaitJournalLine(Now, 'А вот и рыбка!|seem to be|You find a message|an old tattered|Вы выловили всю рыбу в этом месте.', 20000);
DangerCheak;
WaitConnection(1000);
end;
end;
Procedure FishS;
var
i:Integer;
FishT:array[1..65] of Cardinal;
begin
//Лут
//Стволы
FishT[1] := $0E87;
FishT[2] := $0F5C;
FishT[3] := $0F49;
FishT[4] := $0F5E;
FishT[5] := $13E4;
FishT[6] := $143E;
FishT[7] := $13BA;
FishT[8] := $1440;
FishT[9] := $1438;
FishT[10] := $0F4D;
FishT[11] := $13B6;
FishT[12] := $1406;
FishT[13] := $0F45;
FishT[14] := $13B0;
FishT[15] := $13B8;
FishT[16] := $1405;
FishT[17] := $13FB;
FishT[18] := $0F62;
FishT[19] := $143A;
FishT[20] := $1400;
FishT[21] := $0F4B;
FishT[22] := $143C;
// Мусор
FishT[23] := $0EA7;
FishT[24] := $1EA5;
FishT[25] := $13FF;
FishT[26] := $1EA3;
FishT[27] := $0EA8;
FishT[28] := $0EA5;
FishT[29] := $1AE0;
FishT[30] := $0EC8;
FishT[31] := $0EA4;
FishT[35] := $0EA3;
FishT[33] := $0FC7;
FishT[34] := $1AE2;
FishT[35] := $1AE3;
FishT[36] := $0EA6;
FishT[37] := $0FCC;
FishT[38] := $0FC5;
FishT[39] := $0FC9;
FishT[40] := $1B72;
FishT[41] := $0EA0;
FishT[42] := $13B4;
FishT[43] := $0FC6;
FishT[44] := $0E43;
FishT[45] := $1AE1;
FishT[46] := $1AD8;
FishT[47] := $0EA2;
FishT[48] := $0FCC;
FishT[49] := $0F47;
FishT[50] := $0EA1;
FishT[51] := $0FCA;
FishT[52] := $0FC4;
FishT[53] := $0FCB;
FishT[54] := $0E85;
//Армор
FishT[55] := $1416;
FishT[56] := $13C4;
FishT[57] := $1409;
FishT[58] := $13BB;
FishT[59] := $1413;
FishT[60] := $1412;
//Реги Гп.
FishT[61] := $0F7A;
FishT[62] := $0F88;
FishT[63] := $0EED;
FishT[64] := $0F7B;
for i := 1 to 64 do
stack(FishT[i],$0000);
end;
begin
WaitConnection(1000);
UseObject(BankBox);
wait(500);
UseObject(BankBox);
wait(500);
SetArStatus(true);
GetCoord;
Disarm;
while true do
begin
FindDistance := 12;
FindVertical := 255;
for i:=0 to ItemCount-1 do
begin
AddToSystemJournal('Fishing tile #'+IntToStr(i));
Fish(FishP[i].tile,FishP[i].px,FishP[i].py,FishP[i].pz);
if Weight > 360 then FishS;
end;
end;
end.