PDA

Просмотр полной версии : Маг-Пловец


Lynx
13.05.2009, 19:10
{Скрипт для плаванья магом до берега по прямой.
Инструкция
1)Выделете себя
2)Включите скрипт
3)Тыкните мышкой, в какую сторону плыть
Маг будет плыть и хилить себя. Остановится, когда выйдет из воды.
}
const
Al=0 //Со скриптом Alexsl изменить на 1

var
hp, myid,d:integer;
dd:string;
timer1:ttimer;

procedure Init; //Вызывается при включении скрипта
begin
hp:=725; // чтобы сразу не хилил
timer1:=TTimer.Create(nil);
timer1.OnTimer:=@OnTimer; //
timer1.enabled:=false; //
timer1.interval:=3000; //
end;

procedure Free; //Вызывается при выключении скрипта
begin
timer1.free;
end;
procedure OnTimer(Sender: TObject);
begin //Плывём дальше после хила.
buf:=dd;
SendToServer;
timer1.enabled:=false;
end;

begin
if FromServer and (pck[1]=#$04) then myid:=readd(18);

if FromServer and (pck[1]=#$0E) then
begin
if (myid=ReadD(2))and (pck[10]=#$9)and (ReadD(14)<250)and (timer1.enabled=false)then begin //если hp<250
buf:=hstr('2F F3 03 00 00 00 00 00 00 00'); //хил
SendToServer;
timer1.enabled:=true;
end;
end;

if FromServer and (pck[1]=#$6D) Then begin // Если вышли из воды,
buf:=hstr('04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'); //Выбераем себя
WriteD(myid,2);
SendToServer;
if d=1 Then begin
buf:=dd;
SendToServer;
end;

if (pck[6]=#$0) Then begin
buf:=hstr('2F F3 03 00 00 00 00 00 00 00'); //хилимся
SendToServer;
d:=Al;
end;
end;
if FromClient and (pck[1]=#$01) then dd:=pck; //Сохраняем направление

end.


Можно использовать вместе в бродилкой Alexsl
http://coderx.ru/showthread.php?t=354