Guest User

Untitled

a guest
Jul 5th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 1.78 KB | None | 0 0
  1. procedure CastAbscond(const ID: byte);
  2. var counterer: byte;
  3.     X,Y: single;
  4. begin
  5.   If soldier[ID].cool[2] = 0 then begin
  6.     If GetPlayerStat(ID,'Alive') = true then begin
  7.       If (GetPlayerStat(ID,'VelX') <> 0) or (GetPlayerStat(ID,'VelY') <> 0) then begin
  8.         X:=GetPlayerStat(ID,'X');
  9.         Y:=GetPlayerStat(ID,'Y');
  10.         ComplexTeleport(X,Y,GetPlayerStat(ID,'VelX'),GetPlayerStat(ID,'VelY'),AbscondRange[soldier[ID].lvl]);
  11.         If X <> 0  then begin
  12.           soldier[ID].cool[2] := AbscondCooldown[soldier[ID].lvl];
  13.           counterer := CastSpell(ID,0,2);
  14.           If counterer = 0 then begin
  15.             WriteConsole(ID,'Absconded ' + floattostr(round(InMeters(Distance(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),X,Y)) * 10) / 10) + ' meters far',cGood);
  16.             DrawText(ID,'Absconded.',200,cGood,0.08,15,370);
  17.             MovePlayer(ID,X,Y);
  18.             Heal(ID,1000);
  19. [..]
  20.  
  21.  
  22. procedure ComplexTeleport(var PosX,PosY: single; X,Y,maxrange: single);
  23. var i: integer;
  24.     dist: single;
  25. begin
  26.   dist:=X;
  27.   If X = 0 then
  28.     X:=0.0001
  29.   else
  30.     X:=X/sqrt(X*X + Y*Y);
  31.   If Y = 0 then
  32.     Y:=0.0001
  33.   else
  34.     Y:=Y/sqrt(dist*dist + Y*Y);
  35.   PosX:=PosX + maxrange * X;
  36.   PosY:=PosY + maxrange * Y;
  37.   dist:=0;
  38.   i:=round(maxrange / 10);
  39.   while i >= 4 do begin
  40.     If RayCast(PosX,PosY-12,PosX,PosY+12,dist,25) and RayCast(PosX-12,PosY,PosX+12,PosY,dist,25) then begin
  41.       If CurrentMap = 'ctf_Voland' then
  42.         exit
  43.       else
  44.       If RayCast(PosX,PosY,PosX,PosY+5000,dist,5005) or RayCast(PosX,PosY,PosX,PosY-5000,dist,5005) or RayCast(PosX,PosY,PosX+5000,PosY,dist,5005) or RayCast(PosX,PosY,PosX-5000,PosY,dist,5005) then
  45.       else
  46.         exit;
  47.     end;
  48.     PosX:=PosX - 10 * X;
  49.     PosY:=PosY - 10 * Y;
  50.     dec(i,1);
  51.   end;
  52.   PosX:=0;
  53. end;
Advertisement
Add Comment
Please, Sign In to add comment