Jump to content

Recommended Posts

Posted

program autotarget;

// Автоматическое взятие в таргет атакующего вас игрока или моба

// Чтобы включить скрипт используйте в игре социальное действие - Yes

// Чтобы выключить скрипт используйте в игре социальное действие - No

// Автор: Furious

// Версия: 0.4

// Для Грации by NLObP 09.08.2009г.

 

const

  Name='NLObP'; //имя чара, с соблюдением регистра букв

 

var

  Attacker, MyOID, ObjectID, MyX, MyY, MyZ, i: Integer;

  Status: boolean;

 

procedure Init; //Вызывается при включении скрипта

begin

  status:=false;

end;

 

procedure TargetAttacker(Attacker: Integer);

begin

  //c1F=Action:d(ObjectID)d(OriginX)d(OriginY)d(OriginZ)c(ActionID)

  buf:=#$1F;

  WriteD(Attacker);

  WriteD(MyX);

  WriteD(MyY);

  WriteD(MyZ);

  WriteC(00);

  SendToServerEx(Name);

end;

 

//******************************************************************************

//основная часть скрипта, вызывается при приходе каждого пакета, если скрипт включен

begin

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

  if pck='' then exit;

 

  if (ConnectName=Name) and FromServer then

  begin

    case pck[1] of

      //32=UserInfo:d(X)d(Y)d(Z)d(isInAirShip)d(ObjectID)...

      #$32: begin

        i:=2;

        MyX:=ReadD(i);

        MyY:=ReadD(i);

        MyZ:=ReadD(i);

        ReadD(i); //пропускаем isInAirShip

        MyOID:=ReadD(i);

      end;

      //33=Attack:d(AttackerID)d(TargetID)...

      //48=MagicSkillUse:d(CharID)d(TargetID)...

      #$33,#$48: begin

        if Status then

        begin

          Attacker:=ReadD(2);

          ObjectID:=ReadD(6);

          if (Attacker<>ObjectID) and (MyOID=ObjectID) then TargetAttacker(Attacker);

        end;

      end;

    end; //case

  end;  //if

 

  if (ConnectName=Name) and FromClient then

  begin

    case pck[1] of

    //34=RequestSocialAction:d(Action:Get.Func09)

      #$34: begin

        case ReadD(2) of

          5: Status:=false;

          6: Status:=true;

        end;

      end;

      //59=ValidatePosition:d(X)d(Y)d(Z)...

      #$59: begin

        MyX:=ReadD(2);  //получаю координату х моего чара

        MyY:=ReadD(6);  //получаю координату у моего чара

        MyZ:=ReadD(10); //получаю координату z моего чара

      end;

    end; //case

  end;  //if

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


×
×
  • 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..