Установите контейнеры в которых удочки и луки:
Code: Select all
Const
BowChest = $xxxxxxxx;
PoleChest = $xxxxxxxx;
Тайлы для ловли содержатся в отдельном файле, который распологать в одной папке со скриптом, под именем - Tiles.txt
Их вы можете получить с помощью Injection - ,infotile
Пимер занесения тайлов:
Code: Select all
6041 2970 1025 251
6040 2170 1026 251
6043 2971 1027 251
6044 2971 1028 251
6043 2972 1026 251
6043 2972 1027 251
6040 2972 1028 251
Code: Select all
Program Fishing;
type FishR = record
tile:word;
px,py,pz:integer;
end;
var
ItemCount,i:Integer;
FishP: array [0..150] of FishR;
Pole,Eat:Cardinal;
Const
BowChest = $xxxxxxxx;
PoleChest = $xxxxxxxx;
{$Include 'all.inc'}
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
WaitGump('1');
while life = 0 do
begin
wait(1000);
end;
FindType($13B2,BowChest);
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
Disarm;
FindType($13B2,backpack);
Equip(RhandLayer,finditem);
Attack(Enemy);
RTime:=Timer;
While (GetDistance(Enemy)<15) and (Timer < (RTime + (30 *1000))) do
begin
if life <80 then
UOSay('Heal');
Wait(1000);
end;
Disarm;
SetWarMode(false);
Equip(LHandLayer,Pole);
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
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;
DeathR;
UseObject(Pole);
WaitForTarget(4000);
TargetToTile(tile,x,y,z);
WaitJournalLine(Now, 'a nice fish!|seem to be|You find a message|an old tattered|not a fish!', 20000);
If (GetType(Pole) = 0) then
begin
FindType($0DBF,PoleChest);
if FindCount > 0 then
Pole:=finditem
else
FullDisconnect;
end;
DangerCheak;
CheckSave;
WaitConnection(10);
end;
end;
Procedure FishS;
var
i:Integer;
FishT:array[1..4] of Cardinal;
begin
FishT[1] := $09CC;
FishT[2] := $09CE;
FishT[3] := $09CD;
FishT[4] := $09CF;
for i := 1 to 4 do
stack(FishT[i],$0000);
end;
begin
UseObject(BowChest);
UseObject(PoleChest);
SetArStatus(true);
Eat:=0;
GetCoord;
Disarm;
while true do
begin
FindDistance := 12;
FindVertical := 255;
for i:=0 to ItemCount-1 do
begin
if (Timer > (Eat + (15 *60 *1000))) then
begin
Hungry(1,ground);
Eat :=Timer;
end;
Fish(FishP[i].tile,FishP[i].px,FishP[i].py,FishP[i].pz);
if Weight > 350 then FishS;
end;
end;
end.