Jump to content

Скрипт Автотаргет для Грации


Recommended Posts

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.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now


×
×
  • Create New...