Uses SysUtils, Classes;
var Item: TL2Item; Npc: TL2Npc; obj: TL2NPC; L2Skill: TL2Skill; buff:TL2buff;
MYPET: TL2NPC;
procedure Neurotic_Clicks_Thread(d: integer);
begin
while delay(555) do begin
if (Engine.Status = lsOnline) then begin
if (not User.Moved) and (User.InCombat) and (User.Cast.EndTime = 0) then // не движ, в бою и каст закончился
if Engine.DMoveTo(User.X+random(2*d)-d, User.Y+random(2*d)-d, User.Z) then
delay(555+random(1500));
if (not User.Moved) and (not User.InCombat) and (User.Cast.EndTime = 0) and (User.Target = nil) then //не движ, не в бою, нет цели и не кастуем
if Engine.DMoveTo(User.X+random(2*d)-d, User.Y+random(2*d)-d, User.Z) then
delay(555+random(2222));
end;
end;
end;
procedure checkCOUR;
begin
PetList.ByID(16035, MYPET);
Print('кура мертва ресаю');
delay(random(4444)+random(3333));
Engine.Facecontrol(0,False);
CheckAttackingMobs;
Engine.SetTarget(MYPET);
Engine.MoveToTarget;
engine.useitem(737);
Engine.Facecontrol(0,True);
end;
procedure check_death; // если умерли сое в город
begin
if (user.dead) then
begin
print('char death');
delay(5000);
Engine.gohome;
delay(15000);
engine.FaceControl(0, false);
if (MYPET.dead) then begin
Engine.SetTarget(MYPET);
Engine.MoveToTarget;
engine.useitem(737);
delay(15000);
end;
end;
end;
function GetCountMyAttackerNpc:integer;
var
idx:integer;
begin
result:=0;
for idx:=0 to NpcList.Count-1 do begin
if Not(NpcList.Items(idx).Dead)and(NpcList.Items(idx).AtkOID=User.Oid)then begin
inc(result);
end;
end;
end;
procedure CheckAttackingMobs; //если мы в бою и моб у нас в таргете будет бить
//если цель мертва отмена таргета
begin
//print('Проверяем, аттакуют ли нас мобы');
while GetCountMyAttackerNpc<>0 do
begin
if(user.target.incombat) then
Engine.AutoSoulshot(3949,true); // BSSC
Engine.UseSkill(1234); // вампирик
Engine.UseSkill(1239); // ураган
if(user.target.dead) then engine.canceltarget;
delay(100);
end;
//print('Мобы не атакуют
');
end;
procedure check_buff; //нет бафа в город
begin
if not User.Buffs.ById(5637, Obj) then begin
print('check_buff ');
Engine.FaceControl(0,false);
CheckAttackingMobs;
delay(random(2222)+random(3333));
Engine.UseItem(736); // юзаем сое
delay(30000);
if (MYPET.dead) then begin
Engine.SetTarget(MYPET);
Engine.MoveToTarget;
engine.useitem(737);
delay(10000);
end;
end;
end;
procedure path_to_GK; // маршрут к гк
begin
if User.inrange(146811,27109,-2231,500) then
begin
Engine.MoveTo(146811,27109,-2231);
Engine.MoveTo(147289,26926,-2229);
Engine.MoveTo(147267,26400,-2185);
Engine.MoveTo(147266,26195,-2103);
Engine.MoveTo(147250,25969,-2039);
Engine.MoveTo(147206,25899,-2039);
Engine.MoveTo(147138,25906,-2039);
end;
if User.inrange(146810,28059,-2294,500) then
begin
Engine.MoveTo(146810,28059,-2294);
Engine.MoveTo(146847,27874,-2294);
Engine.MoveTo(147004,27611,-2294);
Engine.MoveTo(147004,27611,-2294);
Engine.MoveTo(147004,27611,-2232);
Engine.MoveTo(147244,26822,-2230);
Engine.MoveTo(147267,26400,-2185);
Engine.MoveTo(147266,26195,-2103);
Engine.MoveTo(147250,25969,-2039);
Engine.MoveTo(147206,25899,-2039);
Engine.MoveTo(147138,25906,-2039);
end;
if User.inrange(145686,21112,-2167,500) then
begin
Engine.MoveTo(145686,21112,-2167);
Engine.MoveTo(145697,21616,-2167);
Engine.MoveTo(145050,22609,-2167);
Engine.MoveTo(145218,23947,-2167);
Engine.MoveTo(146377,24455,-2039);
Engine.MoveTo(146484,25685,-2039);
Engine.MoveTo(147130,25700,-2039);
Engine.MoveTo(147112,25921,-2039);
end;
if User.inrange(148076,27069,-2231,500) then
begin
Engine.MoveTo(148076,27069,-2231);
Engine.MoveTo(147666,27110,-2230);
Engine.MoveTo(147308,26954,-2230);
Engine.MoveTo(147267,26400,-2185);
Engine.MoveTo(147266,26195,-2103);
Engine.MoveTo(147250,25969,-2039);
Engine.MoveTo(147206,25899,-2039);
Engine.MoveTo(147138,25906,-2039);
end;
if User.inrange(148949,21125,-2167,500) then
begin
Engine.MoveTo(148949,21125,-2167);
Engine.MoveTo(146122,21227,-2167);
Engine.MoveTo(145697,21616,-2167);
Engine.MoveTo(145050,22609,-2167);
Engine.MoveTo(145218,23947,-2167);
Engine.MoveTo(146377,24455,-2039);
Engine.MoveTo(146484,25685,-2039);
Engine.MoveTo(147130,25700,-2039);
Engine.MoveTo(147112,25921,-2039);
end;
if User.inrange(144549,22828,-2167,500) then
begin
Engine.MoveTo(144549,22828,-2167);
Engine.MoveTo(145697,21616,-2167);
Engine.MoveTo(145050,22609,-2167);
Engine.MoveTo(145218,23947,-2167);
Engine.MoveTo(146377,24455,-2039);
Engine.MoveTo(146484,25685,-2039);
Engine.MoveTo(147130,25700,-2039);
Engine.MoveTo(147112,25921,-2039);
end;
if User.inrange(144543,24666,-2167,500) then
begin
Engine.MoveTo(144543,24666,-2167);
Engine.MoveTo(145279,24307,-2167);
Engine.MoveTo(146377,24455,-2039);
Engine.MoveTo(146484,25685,-2039);
Engine.MoveTo(147130,25700,-2039);
Engine.MoveTo(147112,25921,-2039);
end;
if User.inrange(146497,30582,-2487,500) then
begin
Engine.MoveTo(146497,30582,-2487);
Engine.MoveTo(147058,30323,-2487);
Engine.MoveTo(147427,29959,-2487);
Engine.MoveTo(147427,29339,-2295);
Engine.MoveTo(147373,28351,-2294);
Engine.MoveTo(147100,27643,-2294);
Engine.MoveTo(147246,26930,-2230);
Engine.MoveTo(147267,26400,-2185);
Engine.MoveTo(147266,26195,-2103);
Engine.MoveTo(147250,25969,-2039);
Engine.MoveTo(147206,25899,-2039);
Engine.MoveTo(147138,25906,-2039);
end;
if User.inrange(144648,29158,-2487,500) then
begin
Engine.MoveTo(144648,29158,-2487);
Engine.MoveTo(144966,28868,-2487);
Engine.MoveTo(145110,27659,-2295);
Engine.MoveTo(146220,27622,-2231);
Engine.MoveTo(147108,27272,-2231);
Engine.MoveTo(147224,26929,-2230);
Engine.MoveTo(147267,26400,-2185);
Engine.MoveTo(147266,26195,-2103);
Engine.MoveTo(147250,25969,-2039);
Engine.MoveTo(147206,25899,-2039);
Engine.MoveTo(147138,25906,-2039);
end;
if User.inrange(150247,29109,-2487,500) then
begin
Engine.MoveTo(150247,29109,-2487);
Engine.MoveTo(149921,28836,-2487);
Engine.MoveTo(149859,28063,-2339);
Engine.MoveTo(149776,27675,-2295);
Engine.MoveTo(148731,27683,-2231);
Engine.MoveTo(148224,27383,-2231);
Engine.MoveTo(147306,26932,-2230);
end;
if User.inrange(147848,30309,-2487,500) then
begin
Engine.MoveTo(147848,30309,-2487);
Engine.MoveTo(147677,30089,-2487);
Engine.MoveTo(147462,29870,-2447);
Engine.MoveTo(147462,29413,-2295);
Engine.MoveTo(147335,28272,-2294);
Engine.MoveTo(147108,27664,-2294);
Engine.MoveTo(147194,26961,-2229);
Engine.MoveTo(147267,26400,-2185);
Engine.MoveTo(147266,26195,-2103);
Engine.MoveTo(147250,25969,-2039);
Engine.MoveTo(147206,25899,-2039);
Engine.MoveTo(147138,25906,-2039);
end;
if User.inrange(144651,26680,-2295,500) then
begin
Engine.MoveTo(144651,26680,-2295);
Engine.MoveTo(144681,27050,-2294);
Engine.MoveTo(144936,27135,-2295);
Engine.MoveTo(145145,27605,-2295);
Engine.MoveTo(146182,27682,-2231);
Engine.MoveTo(146921,27360,-2231);
Engine.MoveTo(147218,26948,-2229);
Engine.MoveTo(147267,26400,-2185);
Engine.MoveTo(147266,26195,-2103);
Engine.MoveTo(147250,25969,-2039);
Engine.MoveTo(147206,25899,-2039);
Engine.MoveTo(147138,25906,-2039);
end;
if User.inrange(148557,30461,-2487,500) then
begin
Engine.MoveTo(148557,30461,-2487);
Engine.MoveTo(148114,30076,-2487);
Engine.MoveTo(147453,30049,-2487);
Engine.MoveTo(147474,29710,-2368);
Engine.MoveTo(147397,28461,-2294);
Engine.MoveTo(147044,27389,-2231);
Engine.MoveTo(147242,26823,-2230);
Engine.MoveTo(147267,26400,-2185);
Engine.MoveTo(147266,26195,-2103);
Engine.MoveTo(147250,25969,-2039);
Engine.MoveTo(147206,25899,-2039);
Engine.MoveTo(147138,25906,-2039);
end;
if User.inrange(147971,27982,-2294,500) then
begin
Engine.MoveTo(147971,27982,-2294);
Engine.MoveTo(147846,27354,-2231);
Engine.MoveTo(147265,26878,-2230);
Engine.MoveTo(147267,26400,-2185);
Engine.MoveTo(147266,26195,-2103);
Engine.MoveTo(147250,25969,-2039);
Engine.MoveTo(147206,25899,-2039);
Engine.MoveTo(147138,25906,-2039);
end;
end;
procedure return_path; // от гк, тп и кач до 50
begin
if user.inrange(147138,25906,-2039,100,100) then begin
print('го кач ');
Engine.MoveTo(146778, 25954, -2039);
Engine.MoveTo(147072, 25944, -2039);
Engine.SetTarget(32327);
delay(400);
Engine.DlgOpen();
delay(400);
Engine.DlgSel(1);
delay(400);
Engine.DlgSel(1);
delay(1550);
Engine.MoveTo(146734, 25942, -2039);
Engine.MoveTo(146733, 25840, -2039);
Engine.SetTarget(30848);
delay(400);
Engine.DlgOpen();
delay(400);
Engine.DlgSel(1);
delay(400);
Engine.DlgSel(16);
delay(10000);
Engine.MoveTo(182252, -15164, -2603);
Engine.MoveTo(181512, -14621, -2348);
Engine.MoveTo(180294, -13984, -2293);
Engine.MoveTo(179191, -13754, -2288);
Engine.MoveTo(177900, -13467, -2290);
Engine.MoveTo(177192, -13444, -2290);
Engine.MoveTo(176376, -14092, -2296);
Engine.MoveTo(176034, -14442, -2296);
Engine.MoveTo(175343, -14863, -2745);
Engine.MoveTo(175001, -15807, -2951);
Engine.MoveTo(174263, -16242, -3337);
end;
if user.inrange(174263, -16242, -3337 ,300,300) then begin
Engine.LoadZone('polebrani');
Engine.loadconfig('shfarm');
Engine.Facecontrol(0,True);
end;
end;
begin
Script.NewThread(@Neurotic_Clicks_Thread(78));
while true do begin
if not (User.dead ) and (MYPET.dead) and (User.DistTo(MYPET) < 3000) then checkCOUR;
delay(50);
if (User.Sitting) and not (User.Buffs.ById(5637, Obj) or User.Buffs.ById(22067, Obj)) then begin
Engine.Stand;
check_buff;
path_to_GK;
return_path;
end;
delay(50);
if (user.dead)then begin check_death;
delay(100);
path_to_GK;
delay(100);
return_path;
end;
delay(100);
if not (User.Buffs.ById(5637, Obj) or User.Buffs.ById(22067, Obj)) then begin check_buff;
delay(100);
path_to_GK;
delay(100);
return_path;
end;
end;
end.