Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure CastAbscond(const ID: byte);
- var counterer: byte;
- X,Y: single;
- begin
- If soldier[ID].cool[2] = 0 then begin
- If GetPlayerStat(ID,'Alive') = true then begin
- If (GetPlayerStat(ID,'VelX') <> 0) or (GetPlayerStat(ID,'VelY') <> 0) then begin
- X:=GetPlayerStat(ID,'X');
- Y:=GetPlayerStat(ID,'Y');
- ComplexTeleport(X,Y,GetPlayerStat(ID,'VelX'),GetPlayerStat(ID,'VelY'),AbscondRange[soldier[ID].lvl]);
- If X <> 0 then begin
- soldier[ID].cool[2] := AbscondCooldown[soldier[ID].lvl];
- counterer := CastSpell(ID,0,2);
- If counterer = 0 then begin
- WriteConsole(ID,'Absconded ' + floattostr(round(InMeters(Distance(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),X,Y)) * 10) / 10) + ' meters far',cGood);
- DrawText(ID,'Absconded.',200,cGood,0.08,15,370);
- MovePlayer(ID,X,Y);
- Heal(ID,1000);
- [..]
- procedure ComplexTeleport(var PosX,PosY: single; X,Y,maxrange: single);
- var i: integer;
- dist: single;
- begin
- dist:=X;
- If X = 0 then
- X:=0.0001
- else
- X:=X/sqrt(X*X + Y*Y);
- If Y = 0 then
- Y:=0.0001
- else
- Y:=Y/sqrt(dist*dist + Y*Y);
- PosX:=PosX + maxrange * X;
- PosY:=PosY + maxrange * Y;
- dist:=0;
- i:=round(maxrange / 10);
- while i >= 4 do begin
- If RayCast(PosX,PosY-12,PosX,PosY+12,dist,25) and RayCast(PosX-12,PosY,PosX+12,PosY,dist,25) then begin
- If CurrentMap = 'ctf_Voland' then
- exit
- else
- 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
- else
- exit;
- end;
- PosX:=PosX - 10 * X;
- PosY:=PosY - 10 * Y;
- dec(i,1);
- end;
- PosX:=0;
- end;
Advertisement
Add Comment
Please, Sign In to add comment