Registruotis    Prisijungti    Forumas    Ieškoti    DUK




[Share] Script for branded catacombs

Įvairūs serverio failai, gidai, skriptai

[Share] Script for branded catacombs

Standartinė ptslike » Lapkritis 20th, 2018, 7:16 pm

var
Buff:Tl2Buff;
item:TL2Item;

const
//TEXT for x
inviteText = 'beniz45cm';

function SetForegroundWindow(hwnd: integer) : Boolean; stdcall;
external 'user32.dll';
function captcha:boolean; begin
if engine.dlgtext.contains('Refresh') or
engine.dlgtext.contains('Captcha') or
engine.dlgtext.contains('60 seconds') or
engine.dlgtext.contains('Bot') then begin
SetForegroundWindow(Engine.GameWindow);
PlaySound(exepath+'\sounds\'+'PlayerAlarm'+'.wav');
delay(2500);
StopSound;
end;
end;
function CheckDeath(Obj: TL2Live = nil): boolean;
begin
if (Obj = nil) then Obj:= User;
result:= false;
if (Obj.Dead) then begin
result:= true;
Engine.FaceControl(0, false);
while (User.Dead) and delay(999) do Engine.GoHome;
delay(5555);
end;
end;
function HaveAgroMobs(): boolean;
var i: integer;
begin
result:= false;
for i:= 0 to NpcList.Count-1 do begin
if (IsAgr(NpcList(i))) then begin
result:= true;
exit;
end;
end;
end;

function IsAgr(Mob: TL2Npc): boolean;
begin
result:= (Mob.AtkOID = User.OID) and (not Mob.Dead);
end;

procedure checkbuff;
begin

CheckDeath();
if not (User.Buffs.ByID(1323, buff)) or (buff.EndTime < 300000) then begin
print('NEED REBUFF ');
delay(10000);

Engine.BypassToServer('_bbshome', True);
delay(500);
Engine.BypassToServer('_bbsgetfav', True);
delay(500);
Engine.BypassToServer('_bbsbuffer', True);
delay(500);
Engine.BypassToServer('_bbsbufferbypass_giveBuffSet figher 0 0', True);
if (User.Buffs.ByID(1323, buff)) and (buff.EndTime < 300000) then
print('REBUFF DONE');
delay(1500);



end;
end;
procedure restock;
begin
CheckDeath();
// IF SS less then 1000
if (inventory.user.byid(1464, item) and (item.count<1000)) then begin //3951 id of SSC
print('RESTOCK SS');
Engine.FaceControl(0, false);
delay(1000);
if (HaveAgroMobs) then begin
print('Killing aggro mobs');
Engine.FaceControl(0, true);
while (HaveAgroMobs) do delay(10);
Engine.FaceControl(0, false);
while (User.InCombat) do delay(555);
end;


// PORT to town
Engine.bypasstoserver('_bbshome', true);
delay(500);
Engine.BypassToServer('_bbsgetfav', True);
delay(500);
Engine.BypassToServer('_bbsgatekeeper', True);
delay(500);
Engine.BypassToServer('13', True);
delay(3500);
// OPEN GM SHOP
if user.InRange(-44683, -113079, -224,10000) then begin // XYZ of ORC Village
engine.bypasstoserver('_bbshome', true);
delay(500);
engine.bypasstoserver('_bbsgetfav', true);
delay(500);

engine.bypasstoserver('_bbsfile:smallNpcs/gmshop', true);
delay(500);

engine.bypasstoserver('110', true);
delay(500);
Engine.NPCExchange (1464, 25000); // Buy SSC
print('RESTOCK BSSS DONE');
delay(1000);
Engine.BypassToServer('_bbshome', True);
delay(500);
Engine.BypassToServer('_bbsgetfav', True);
delay(500);
Engine.BypassToServer('_bbsgatekeeper', True);
delay(500);
Engine.BypassToServer('19', True);
delay(3500);
end;
end;
// IF MP pots less then 50
if (inventory.user.byid(728, item) and (item.count<50)) then begin // 728 id of mp pot
// while user.incombat do delay(1000);

print('RESTOCK MP');
Engine.FaceControl(0, false);
delay(1000);
if (HaveAgroMobs) then begin
print('Killing aggro mobs');
Engine.FaceControl(0, true);
while (HaveAgroMobs) do delay(10);
Engine.FaceControl(0, false);
while (User.InCombat) do delay(555);
end;
// PORT to town
Engine.BypassToServer('_bbshome', True);
delay(500);
Engine.BypassToServer('_bbsgetfav', True);
delay(500);
Engine.BypassToServer('_bbsgatekeeper', True);
delay(500);
Engine.BypassToServer('13', True);
delay(3500);
// OPEN GM SHOP
if user.InRange(-44683, -113079, -224,10000) then begin // XYZ of ORC Village
engine.bypasstoserver('_bbshome', true);
delay(500);
engine.bypasstoserver('_bbsgetfav', true);
delay(500);

engine.bypasstoserver('_bbsfile:smallNpcs/gmshop', true);
delay(500);

engine.bypasstoserver('1c', true);
delay(500);
Engine.NPCExchange (728, 500); //buy mp pot
print('RESTOCK MP POTS DONE');
delay(1000);
Engine.BypassToServer('_bbshome', True);
delay(500);
Engine.BypassToServer('_bbsgetfav', True);
delay(500);
Engine.BypassToServer('_bbsgatekeeper', True);
delay(500);
Engine.BypassToServer('19', True);
delay(3500);
end;
end;
end;





begin
delay(500);
//load settings | Change name or comment
Engine.LoadConfig(exepath+'\Settings\'+'branded'+'.xml');


delay(500);


while true do begin

restock();
checkbuff();
delay(1000);
Engine.FaceControl(0,false);


if User.InRange (81062, 148144, -3456, 20000) then begin // Giran
restock();
print('PORT Branded');
Engine.BypassToServer('_bbshome', True);
delay(500);
Engine.BypassToServer('_bbsgetfav', True);
delay(500);
Engine.bypasstoserver('_bbsgatekeeper');
delay(500);
Engine.BypassToServer('_bbsgatekeeper_main-26.htm', True);
delay(500);
Engine.BypassToServer('11', True);
end;
// Start Branded
if User.InRange(46480, 170227, -4960, 500) then begin
print('ROOM 0');
Engine.FaceControl(0,false);
checkdeath();
restock();
checkbuff();
delay(1000);
Engine.MoveTo(47352, 170280, -4960);
Engine.MoveTo(47352, 171336, -4960);

print('ROOM 1');
end;



while User.InRange(47112, 171576, -4960, 1150) do begin
Engine.loadzone('branded1');
Engine.FaceControl(0,true);
delay(1000);
if user.target.dead then begin
delay(1000);
if user.target.dead then begin
delay(1000);
if user.target.dead then begin
delay(1000);
checkdeath();
restock();
checkbuff();
delay(1000);
Engine.MoveTo(47096, 171704, -4960);
Engine.MoveTo(47096, 172232, -4960);
Engine.MoveTo(47096, 172776, -4960);
Engine.MoveTo(47528, 172808, -4960);
Engine.MoveTo(47576, 173240, -4960);
Engine.MoveTo(48296, 173272, -4960);

print('ROOM 2');
end;
end;
end;
end;




while User.InRange(48488, 173560, -4960, 900) do begin
Engine.loadzone('branded2');
Engine.FaceControl(0,true);
delay(1000);
if user.target.dead then begin
delay(1000);
if user.target.dead then begin
delay(1000);
if user.target.dead then begin
delay(1000);
checkdeath();
restock();
checkbuff();
Engine.FaceControl(0,false);
delay(1000);
Engine.MoveTo(48456, 173976, -4960);
Engine.MoveTo(48456, 174616, -4960);
Engine.MoveTo(49016, 174616, -4960);
Engine.MoveTo(49496, 174616, -4960);

print('ROOM 3');
end;
end;
end;
end;



while User.InRange(49752, 174264, -4960, 1100) do begin
Engine.loadzone('branded3');
Engine.FaceControl(0,true);
delay(1000);
if user.target.dead then begin
delay(1000);
if user.target.dead then begin
delay(1000);
if user.target.dead then begin
delay(1000);
checkdeath();
restock();
checkbuff();
Engine.FaceControl(0,false);
delay(1000);
Engine.MoveTo(49912, 173880, -4960);
Engine.MoveTo(50648, 173864, -4960);
Engine.MoveTo(50872, 173752, -4960);
Engine.MoveTo(50936, 172856, -4960);


print('ROOM 4');
end;
end;
end;
end;



while User.InRange(51176, 172584, -4960, 900) do begin
Engine.loadzone('branded4');
Engine.FaceControl(0,true);
delay(1000);
if user.target.dead then begin
delay(1000);
if user.target.dead then begin
delay(1000);
if user.target.dead then begin
delay(1000);
checkdeath();
restock();
checkbuff();
Engine.FaceControl(0,false);
delay(1000);
Engine.MoveTo(50872, 172216, -4960);
Engine.MoveTo(50872, 171400, -4960);
Engine.MoveTo(51176, 171272, -4960);
Engine.MoveTo(51176, 170408, -4960);

print('ROOM 5');
end;
end;
end;
end;


while User.InRange(51192, 170312, -4960, 450) do begin
Engine.loadzone('branded5');
Engine.FaceControl(0,true);
delay(1000);
if user.target.dead then begin
delay(1000);
if user.target.dead then begin
delay(1000);
if user.target.dead then begin
delay(1000);
checkdeath();
restock();
checkbuff();
Engine.FaceControl(0,false);
delay(1000);
Engine.MoveTo(50888, 170312, -4960);
Engine.MoveTo(50088, 170280, -4960);
Engine.MoveTo(49720, 170264, -4960);


print('ROOM 6');
end;
end;
end;

end;



while User.InRange(49496, 170296, -4960, 800) do begin
Engine.loadzone('branded6');
Engine.FaceControl(0,true);
delay(1000);
if user.target.dead then begin
delay(1000);
if user.target.dead then begin
delay(1000);
if user.target.dead then begin
delay(1000);
checkdeath();
restock();
checkbuff();
Engine.FaceControl(0,false);
delay(1000);
Engine.MoveTo(48904, 170296, -4960);
Engine.MoveTo(48216, 170296, -4960);
Engine.MoveTo(48184, 170600, -4960);
Engine.MoveTo(47464, 170632, -4960);
Engine.MoveTo(47336, 171192, -4960);

print('ROOM 1');
end;
end;
end;
end;
end;
end.
ptslike
Naujokas
Naujokas
 
Pranešimai: 3
Užsiregistravo: Lapkritis 20th, 2018, 7:08 pm
Karma:
Karma:
Increase user’s karma Decrease user’s karma

Grįžti į L2j serverio failai, gidai, skriptai

Dabar prisijungę

Vartotojai naršantys šį forumą: Registruotų vartotojų nėra ir 0 svečių