Jump to content

Recommended Posts

Posted

//  авто-gracia_final +1.

//  хроники  Грация ФИНАЛ

//  Соцдействие ДА открыть управление скриптом

//  в пати чат пишем уровень заточки

//  можно менять в процесе работы скрипта

//  заточить один предмет чтоб запомнить чем и что точить

//  дальше скрипт сам точит до указаного уровня заточки

//  все предметы ОДИНАКОВЫЕ  с  ПЕРВЫМ  заточеным

//  предметы точатся добавляя по +1 на предмет

//  т.е если у вас предметы с  одинаковым уровнем заточки например 0

//  будет точится первый предмет до +1, потом второй до +1 и т.д

//  если предмет при заточки блесс скрол слетел на 0 или на уровень как у вас на сервере

//  то будет точиться он пока несравняется с остальными

//  и т.д

//  пока недостигнете заданого уровня заточки

//  если предметов более 1 то один остается

//  АВТОР ==>>>> TAMBIK

program Enchant_gracia;

  const

//===========================================

 

  myname='TAMBIK'; //<<== пишем свой НИК

 

  max=80;//<<== колличество ячеек в рюкзаке

 

   

//===========================================

    HTML='<html><body><center>'+

'<img src="L2UI_CH3.herotower_deco width=256 height=32>'+

'<img src="L2UI.SquareWhite" width=260 height=1>'+

'<font color="04fbfb">Cкрипт автозаточка для gracia_final</font><br>'+

'<img src="L2UI.SquareWhite" width=260 height=1>'+

'<img src="L2UI.Squarewidth" width=260 height=1>'+

'<font color="04fbfb">системные сообщения</font><br>'+

'<button value="в к л" action="bypass -3"      width=80 height=15  back="sek.cbui94"  fore="sek.cbui92">'+

'<img src="L2UI.SquareWhite" width=60 height=1>'+

'<img src="L2UI.Squarewidth" width=60 height=4>'+

'<font color="04fbfb">            </font><br>'+

'<button value=" в ы к л " action="bypass -4" width=80 height=15  back="sek.cbui94"  fore="sek.cbui92">'+

'<img src="L2UI.SquareWhite" width=60 height=1>'+

'<img src="L2UI.Squarewidth" width=60 height=4>'+

'<font color="04fbfb">            </font><br>'+

'<img src="L2UI.SquareWhite" width=260 height=1>'+

'<img src="L2UI.Squarewidth" width=260 height=4>'+

'<font color="04fbfb">АВТОЗАТОЧКА</font><br>'+

'<font color="04fbfb">            </font><br>'+

'<button value="П У С К" action="bypass  -pusk"    width=100 height=15 back="sek.cbui94"  fore="sek.cbui92">'+

'<img src="L2UI.SquareWhite" width=60 height=1>'+

'<img src="L2UI.Squarewidth" width=60 height=4>'+

'<font color="04fbfb">          </font><br>'+

'<button value="С Т О П" action="bypass  -stop"    width=100 height=20 back="sek.cbui94"  fore="sek.cbui92">'+

'<img src="L2UI.SquareWhite" width=60 height=1>'+

'<img src="L2UI.Squarewidth" width=60 height=4>'+

'<font color="04fbfb">          </font><br>'+

'<img src="L2UI.SquareWhite" width=260 height=1>'+

'<img src="L2UI.Squarewidth" width=260 height=4>'+

'<img src="L2UI.SquareWhite" width=60 height=1>'+

'<img src="L2UI.Squarewidth" width=60 height=4>'+

'<font color="LEVEL">Автор TAMBIK</font><br>'+

'</center></body></html>';

//==========================================

  var

    BaseItems:array[1..max,1..11] of integer;

    Baselvl:array[0..max] of integer;

    Timer01: TTimer;

    Timer02: TTimer;

    Timer03: TTimer;

 

    mytext:string;

    Bypass:string;

    autostart,start,autoMsg:Boolean;

    flag : Boolean;

    t,l,d,x,y,ii,i:integer;

 

    ListSize,ItemEnch:word;

    textID,itemID:integer;

    enchantObjectID:integer;

    enchantID,skrolObjectID:integer;

    ItemOID,objectOID:integer; 

    sumskrol,sumitemID,sumitem:integer;

    maxlvl,minlvl,enchlvl,selectlvl:integer;

    skrolID,skrolObj:integer;

    minEnchitem:integer;

    object,index : integer;

//==========================================

//  ShowHTML(HTML);

Procedure ShowHTML( _html : string );

begin

  buf:=#$19;

  WriteD(5);

  WriteS(_HTML);

  SendToClientEx(myname);

  end;

//========================

procedure ActionUse;

begin

    Bypass:=ReadS(2);

    case Bypass of

  '-3':begin  autoMsg:=true; end;

  '-4':begin  autoMsg:=false; end;

  '-pusk':begin

  if (autostart=false) then SendMsg2( 'предмет незаточен или пакеты неприняты !' );

  if (maxlvl=0) then SendMsg2( '  Неуказан Уровень Заточки  !' );

    SendMsg2( '_______________________________' );

  if autostart and  (maxlvl>0)  then begin

        buf:=hstr('14');

        SendToServerEx(myname);

      SendMsg2( '        ! ! !  П О Е Х А Л И    ! ! !' );

      SendMsg2( '_______________________________' );

      start:=true;

      Timer01.enabled:=true;// вкл таймер выбора свитка

      end;

    end;

  '-stop':begin

    deleteBase;

    start:=false;

    enchantID:=0;

    ItemEnch:=0;

      minlvl:=0;

    sumitem:=0;

    Timer01.enabled:=false;

    Timer02.enabled:=false;

    Timer03.enabled:=false;

    SendMsg2( '        ! ! !  С Т О П  ! ! ! ' );

    stopselectskrol;

    index :=0;

for ii:=1 to max do

  Baselvl[ii]:=-1;

  end;

end;

end;

//===========================================

procedure SendMsg2(msg:string);

begin

  buf:=#$4A;

  WriteD(0);

  WriteD(3);

  WriteS('');

  WriteS(msg);

  SendToClientEx(myname);

end;

//===========================================

procedure Resultmaxlvl;

var

  i:integer;

begin

    i:=2;

    mytext:=ReadS(i);

    textID:=ReadD(i);

if (textID=3)  then begin

    maxlvl:=StrToInt(mytext);

SendMsg2( '  установлен Уровень Заточки: '+IntToStr(maxlvl)+'' );

end;

end;

//..............................................................................

procedure ItemList;

var

  i, j, k: integer;

  count,x:integer;

begin

  count:=0;

  x:=0;

  y:=0;

  j:=4; //пропускаем дo ListSize

  ListSize:=ReadH(j);

  count:=round((Length(pck)-5) / ListSize);// длина блока

  for i:=1 to ListSize do

  if (i<=ListSize) then begin

      BaseItems[i,1]:=ReadH(j);  //ItemType1- 1:одето броня. 0:бижа. 4:в рюкзаке

      BaseItems[i,2]:=ReadD(j);  //ObjectID

      BaseItems[i,3]:=ReadD(j);  //ItemID

      BaseItems[i,4]:=ReadD(j);  //LocationSlot

      BaseItems[i,5]:=ReadD(j);  //  Amount:

      BaseItems[i,6]:=ReadD(j);  //  Amount:

      BaseItems[i,7]:=ReadH(j);//ItemType2

      BaseItems[i,8]:=ReadH(j);// CustomType1

      BaseItems[i,9]:=ReadH(j);//isEquipped:

      BaseItems[i,10]:=ReadD(j);//BodyPart

      BaseItems[i,11]:=ReadH(j);//EnchantLevel

            inc(x); // счетчик

            //y := пропускаем до следущего блока

    y:=count*x-(j-6);// . 6= длина ListSize + 4 байта пропуска в начале пакета

            inc(j,y);

  end else for k:=1 to 11 do BaseItems[i,k]:=0; // забиваем нулями

        addenchantitemID;

 

if (skrolID>0)  then begin

    sumskrol:=Getitem(skrolID,3,5);//считаем SKROL

if autoMsg  then SendMsg2 ('  SKROL ... c  ID : '+IntToStr(skrolID)+' =  '+IntToStr(sumskrol)+' ШТ ');

if start and (0<sumskrol) then  Timer01.enabled:=true;// вкл таймер выбора свитка

if (sumskrol=0)  then  begin

  SendMsg2 ('........ НЕДОСТАТОЧНО  SKROL........  ');

  SendMsg2 ('___ О С Т А Н О В Л Е Н О ___ ');

  start:=false;

end;

end;

end;

//=============================

procedure EnchantResult;

  begin

  deleteBase;

  index :=0;

for ii:=1 to max do

  Baselvl[ii]:=-1;

  end;

//=============================

procedure deleteBase;

var

  i,j,k:integer; 

begin

    for i:=1 to max do

      BaseItems[i,1]:=0;

      BaseItems[i,2]:=0; //ObjectID 

      BaseItems[i,3]:=0;  //ItemID

      BaseItems[i,4]:=0; 

      BaseItems[i,5]:=0;

      BaseItems[i,6]:=0;

      BaseItems[i,7]:=0;

      BaseItems[i,8]:=0;

      BaseItems[i,9]:=0;

      BaseItems[i,10]:=0;

      BaseItems[i,11]:=0;

      inc(j,y); 

end;       

//===========================

function Getitem(Obj,up,down:integer): integer;

var

  i: integer;

begin

Result:= 0; //В начале у нас 0

  for i:=1 to max do

    if (BaseItems[i,up]=Obj) then begin

      Result:=BaseItems[i,down];

  end;

end;

//===========================

function Getsumitem(Obj,up,down:integer): integer;

var

  i: integer;

begin

Result:= 0; //В начале у нас 0

  for i:=1 to max do

    if (BaseItems[i,up]=Obj)  then begin

      Result:=Result+BaseItems[i,down];

  end;

end;

//=============================

 

// добавляем в базу  ЛВЛ заточки

procedure  addenchantitemID;

begin

        for i:=1 to max do

if (BaseItems[i,3] = ItemOID)  then  begin

        enchlvl:=BaseItems[i,11];

    flag:=false;

          for ii:=1 to max do

  if (Baselvl[ii] = enchlvl) then  begin // текущий  уже есть в массиве,

      flag := true;

        BREAK; { прекращаем цикл }

          end;

if (flag = false) then begin

        for ii:=1 to max do

  if (Baselvl[ii]=-1) then begin // добавим  в массив,

        Baselvl[ii]:=enchlvl; 

          index :=ii;

      BREAK; { прекращаем цикл }

  end;

end;

end;

end;

//==========================

procedure ChooseInventory;

var

OID, lvl:integer;

begin

  if (ItemOID>0) and start then  begin

          sumitemID:=0;

      sumitemID:=Getsumitem(ItemOID,3,5); // считаем предметы для заточки

              minlvl:=Baselvl[1];

      for ii:=2  to  index  do 

  if  Baselvl[ii] < minlvl  then 

        minlvl:=Baselvl[ii];// мин заточка

        objectOID:=0;

if (sumitemID > sumitem) then objectOID:=GetObjectID(ItemOID);//находим по ItemID  предмет с ObjectID

if (objectOID = 0)  then begin

              start:=false;

      SendMsg2('Больше предметов c ID : '+IntToStr(ItemOID)+' для заточки НЕТ ! ! ! ! ');

          lvl:=0;

        for i:=1 to max do

  if (BaseItems[i,3] = ItemOID) then  begin

        OID:=BaseItems[i,2];

        lvl:=BaseItems[i,11];

SendMsg2('Предмет  c ID : '+IntToStr(ItemOID)+'  с ObjectID : '+IntToStr(OID)+'  заточен до : '+IntToStr(lvl)+' ');

  end;

end;

end;

end;

//=========================

//находим enchantID предмета по  ItemID для заточки

function GetObjectID(ItemOID:integer) : integer;

var

  ID,i:integer;

begin

enchantID:= 0;

  ItemEnch:=0; 

  Result:= 0;

if autoMsg  then  SendMsg2( '*******************************************' );

if (ItemOID>0) then begin

if autoMsg  then  SendMsg2 ('    ищем ObjectID предмета с ID  :  ' +IntToStr(ItemOID)+' ');

if autoMsg  then  SendMsg2('------------------------------' );

 

    for i:=1 to max do

if (BaseItems[i,3] = ItemOID) and (BaseItems[i,11] = minlvl) and (BaseItems[i,11] < maxlvl) then begin

    enchantID:=BaseItems[i,2];

      Result:=BaseItems[i,2];

    ItemEnch:=BaseItems[i,11];

if autoMsg  then  SendMsg2('  ..... найден предмет для заточки  ..... ');

if autoMsg  then  SendMsg2(' ID  : '+IntToStr(ItemOID)+' и ObjectID : '+IntToStr(enchantID)+'  заточен до : '+IntToStr(ItemEnch)+'');

if autoMsg  then  SendMsg2('------------------------------' );

    if (enchantID>0) then  Timer02.enabled:=true;

      Break;  // прерываем дальнейший перебор массива.

end;

end;

end;

//==========================

procedure stopselectskrol;

begin

  buf:=hstr('D04E00');

SendToServerEx(myname);

end;

//===================================

procedure OnTimer01(Sender: TObject);

begin

  buf:=#$19;

  WriteD(skrolObjectID);

  WriteD(0);

  SendToServerEx(myname);

Timer01.enabled:=false;

  end;

//--------------------------

procedure OnTimer02(Sender: TObject);

begin

  buf:=hstr('D04C00');

  WriteD(enchantID);

  SendToServerEx(myname);

  Timer02.enabled:=false;

  Timer03.enabled:=true;

  end;

procedure OnTimer03(Sender: TObject);

begin

  buf:=#$5F;

  WriteD(enchantID);

  WriteD(0);

  SendToServerEx(myname);

  Timer03.enabled:=false;

if autoMsg  then SendMsg2('      .....    Точим Предмет    ..... ');

if autoMsg  then SendMsg2( ' ID :  '+IntToStr(ItemOID)+' и ObjectID : '+IntToStr(enchantID)+'  -  до  :  '+IntToStr(maxlvl)+'' );

if autoMsg  then SendMsg2( '_______________________________' );

end;

//-----------------------------------------

procedure Init;

begin

  minlvl:=0;    maxlvl:=0;  enchlvl:=0; ItemEnch:=0;

  sumskrol:=0;  sumitem:=0; sumitemID:=0;

  objectOID:=0; object:=0;  enchantObjectID:=0;

  enchantID:=0; skrolObjectID:=0;

  skrolID:=0;  itemID:=0; ItemOID:=0;

  t:=0;l:=0;d:=0;index :=0;

 

  flag:=false;

  autostart:=false;

  start:=false;

  autoMsg:=true;

 

  Timer01:=TTimer.Create(nil);

  Timer01.OnTimer:=@OnTimer01;

  Timer01.enabled:=false;

  Timer01.interval:=400; //<<== время  выбора свитка

 

  Timer02:=TTimer.Create(nil);

  Timer02.OnTimer:=@OnTimer02;

  Timer02.enabled:=false;

  Timer02.interval:=400; //<<== время  выбора предмета

 

  Timer03:=TTimer.Create(nil);

  Timer03.OnTimer:=@OnTimer03;

  Timer03.enabled:=false;

  Timer03.interval:=4500; //<<== время между заточкой 

 

SendMsg2( '  в пати чат пишем уровень заточки' );

SendMsg2( '    заточить предмет  !  !' );

SendMsg2( '  Соцдействие  ДА - откр окно управления ' );

SendMsg2( '------------------------------------- ' );

  buf:=hstr('14');

  SendToServerEx(myname);

  for ii:=1 to max do

      Baselvl[ii]:=-1;

end;

procedure Free;

begin

  Timer01.free;

  Timer02.free;

  Timer03.free;

end;

//=========================

begin

//не обрабатываем пустые пакеты

  if pck='' then exit;

if FromServer and (pck[1]=#$87) then  EnchantResult;

if FromServer and (pck[1]=#$11) then ItemList;

if FromServer and (pck[1]=#$7C) then ChooseInventory;

if FromClient and (pck[1]=#$49) then begin Resultmaxlvl;pck:='';exit;end;    //

if FromClient and (pck[1]=#$56) and (ReadD(2)=24) then begin

          ShowHTML(HTML); pck:='';exit; end;

if FromClient and (pck[1]=#$23)  then begin ActionUse; pck:='';exit;end;    //

begin

if (start=false) and FromClient then 

    case pck[1] of

#$19:begin

        stopselectskrol;

        buf:=hstr('14');

        SendToServerEx(myname);

      t:=1;

    skrolObjectID:=ReadD(2);

    skrolID:= Getitem(skrolObjectID,2,3);//находим по ObjectID скрол с ItemID

    SendMsg2(' .................' );

    SendMsg2('  активирован SKROL  ID : '+IntToStr(skrolID)+' ' );

    SendMsg2(' .................' );

          end;

#$D0:if  ReadH(2)=76 then  begin

      l:=1;

      SendMsg2('    окно выбора предмета ' );

      SendMsg2(' .................' );

    end;

#$5F:begin

      d:=1;

    enchantObjectID:=ReadD(2);

    if  (t=1) and (l=1) and (d=1) then begin

        autostart:=true;

      ItemOID:= Getitem(enchantObjectID,2,3);//находим по ObjectID предмет с ItemID

    SendMsg2 ('  ID предмета :  '+IntToStr(ItemOID)+'  для заточки');

  sumitemID:=0;

  sumitem:=0;

  sumitemID:=Getsumitem(ItemOID,3,5); // считаем предметы для заточки

  SendMsg2 (' Предметов для заточки с  ID :  '+IntToStr(ItemOID)+'  =  '+IntToStr(sumitemID)+' ШТ ');

      if (sumitemID > 1) then sumitem:=1;

      stopselectskrol;

      end;

    end;

  end;

end;

end.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • Server owners, Top.MaxCheaters.com is now live and accepting Lineage 2 server listings. There is no voting, no rankings manipulation, and no paid advantages. Visibility is clean and equal, and early listings naturally appear at the top while the platform grows. If your server is active, it should already be listed. Submit here https://Top.MaxCheaters.com This platform is part of the MaxCheaters.com network and is being built as a long-term reference point for the Lineage 2 community. — MaxCheaters.com Team
    • ⚙️ General Changed “No Carrier” title to “Disconnected” to avoid confusion after abnormal DC. On-screen Clan War kill notifications will no longer appear during Sieges, Epics, or Events. Bladedancer or SwordSinger classes can now log in even when Max Clients (2) is reached, you cannot have both at the same time. The max is 3 clients. Duels will now be aborted if a monster aggros players during a duel (retail-like behavior). Players can no longer send party requests to blocked players (retail-like). Fixed Researcher Euclie NPC dialogue HTML error. Changed Clan leave/kick penalty from 12 hours to 3 hours. 🧙 Skills Adjusted Decrease Atk. Spd. & Decrease Speed land rates in Varka & FoG. Fixed augmented weapons not getting cooldown when entering Olympiad. 🎉 Events New Team vs Team map added. New Save the King map added (old TvT map). Mounts disabled during Events. Letter Collector Event enabled Monsters drop letters until Feb. 13th Louie the Cat in Giran until Feb. 16th Inventory slots +10 during event period 📜 Quests Fixed “Possessor of a Precious Soul Part 1” rare stuck issue when exceeding max quest items. Fixed Seven Signs applying Strife buff/debuff every Monday until restart. 🏆 Milestones New milestone: “Defeat 700 Monsters in Varka” 🎁 Rewards: 200 Varka’s Mane + Daily Coin 🌍 NEW EXP Bonus Zones Hot Springs added Varka Silenos added (hidden spots excluded) As always, thank you for your support! L2Elixir keeps evolving, improving, and growing every day 💙   Website: https://l2elixir.org/ Discord: https://discord.gg/5ydPHvhbxs
    • https://sms.pro/ — we are an SMS activation platform  seeking partners  mobile number providers  mobile number owners  owners of GSM modems  SIM card owners We process 1,000,000 activations every day.  寻找合作伙伴  手机号码提供商  手机号码持有者  GSM调制解调器持有者  SIM卡持有者 我们每天处理1,000,000次激活。  Ищем партнеров  Владельцы сим карт  провайдеров  владельцев мобильных номеров  владельцев модемов  Обрабатываем от 1 000 000 активаций в день ⚡️ Fast. Reliable.   https://sms.pro/ Support: https://t.me/alismsorg_bot
    • "WHAT I WILL SEE ON NEW SEASON ? *More easy farm and augment than ever before ! *Free VIP characters for everyone for first 2 days after opening ! Improved olympiad engine to work more correctly. 3 New skins / outfits. Fixed raid boss spawns. Fixed olympiad crit errors. New farming Ivory Tower area. Fixed augmentation rate. Increased all mob drops rate by +20%. And much more..."   1. I have clicked VIP 23.01.2026 20:00 a few second after open server. 2 Days is 48h. Now 24.01.2026 I have 17 hours left, so my VIP will expire 08:00 25.01.2026. Where is 12h? SCAM.   2. Where is ivory tower area?   3. When next wipe?   
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..