Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function GetPriorityTarget: boolean;
- const
- DistMax : Extended = 999999999999999999;
- var
- MyInfo, E1, E2, E3, E4, E5, E6, E7, E8, E9, E10, E11, E12 : PLAYER_DATA;
- QntPlayers, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12 : Integer;
- D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12 : Extended;
- begin
- Result := false;
- try
- T1 := $0;
- T2 := $4;
- T3 := $8;
- T4 := $C;
- T5 := $10;
- T6 := $14;
- T7 := $18;
- T8 := $1C;
- T9 := $20;
- T10 := $24;
- T11 := $28;
- T12 := $2C;
- QntPlayers := PBYTE($00CACA1E)^;
- //------------------------------------------------------------------------------
- MyInfo := GetMyInfo;
- E1 := GetEnemy(T1);
- E2 := GetEnemy(T2);
- E3 := GetEnemy(T3);
- E4 := GetEnemy(T4);
- E5 := GetEnemy(T5);
- E6 := GetEnemy(T6);
- E7 := GetEnemy(T7);
- E8 := GetEnemy(T8);
- E9 := GetEnemy(T9);
- E10 := GetEnemy(T10);
- E11 := GetEnemy(T11);
- E12 := GetEnemy(T12);
- //------------------------------------------------------------------------------
- if TargetVisible(T1, $10) = true then begin
- D1 := CalcDistance(MyInfo, E1);
- end else begin
- D1 := DistMax;
- end;
- if TargetVisible(T2, $34) = true then begin
- D2 := CalcDistance(MyInfo, E2);
- end else begin
- D2 := DistMax;
- end;
- if TargetVisible(T3, $58) = true then begin
- D3 := CalcDistance(MyInfo, E3);
- end else begin
- D3 := DistMax;
- end;
- if TargetVisible(T4, $7C) = true then begin
- D4 := CalcDistance(MyInfo, E4);
- end else begin
- D4 := DistMax;
- end;
- if TargetVisible(T5, $A0) = true then begin
- D5 := CalcDistance(MyInfo, E5);
- end else begin
- D5 := DistMax;
- end;
- if TargetVisible(T6, $C4) = true then begin
- D6 := CalcDistance(MyInfo, E6);
- end else begin
- D6 := DistMax;
- end;
- if QntPlayers > 12 then begin
- if TargetVisible(T7, $E8) = true then begin
- D7 := CalcDistance(MyInfo, E7);
- end else begin
- D7 := DistMax;
- end;
- if TargetVisible(T8, $10C) = true then begin
- D8 := CalcDistance(MyInfo, E8);
- end else begin
- D8 := DistMax;
- end;
- end else begin
- D7 := DistMax;
- D8 := DistMax;
- end;
- if QntPlayers = 24 then begin
- if TargetVisible(T9, $130) = true then begin
- D9 := CalcDistance(MyInfo, E9);
- end else begin
- D9 := DistMax;
- end;
- if TargetVisible(T10, $154) = true then begin
- D10 := CalcDistance(MyInfo, E10);
- end else begin
- D10 := DistMax;
- end;
- if TargetVisible(T11, $178) = true then begin
- D11 := CalcDistance(MyInfo, E11);
- end else begin
- D11 := DistMax;
- end;
- if TargetVisible(T12, $19c) = true then begin
- D12 := CalcDistance(MyInfo, E12);
- end else begin
- D12 := DistMax;
- end;
- end else begin
- D9 := DistMax;
- D10 := DistMax;
- D11 := DistMax;
- D12 := DistMax;
- end;
- //------------------------------------------------------------------------------
- if GetMinDist(D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12) = true then begin
- PriorityEnemy := T1;
- Result := true;
- end;
- if GetMinDist(D2, D1, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12) = true then begin
- PriorityEnemy := T2;
- Result := true;
- end;
- if GetMinDist(D3, D1, D2, D4, D5, D6, D7, D8, D9, D10, D11, D12) = true then begin
- PriorityEnemy := T3;
- Result := true;
- end;
- if GetMinDist(D4, D1, D2, D3, D5, D6, D7, D8, D9, D10, D11, D12) = true then begin
- PriorityEnemy := T4;
- Result := true;
- end;
- if GetMinDist(D5, D1, D2, D3, D4, D6, D7, D8, D9, D10, D11, D12) = true then begin
- PriorityEnemy := T5;
- Result := true;
- end;
- if GetMinDist(D6, D1, D2, D3, D4, D5, D7, D8, D9, D10, D11, D12) = true then begin
- PriorityEnemy := T6;
- Result := true;
- end;
- if GetMinDist(D7, D1, D2, D3, D4, D5, D6, D8, D9, D10, D11, D12) = true then begin
- PriorityEnemy := T7;
- Result := true;
- end;
- if GetMinDist(D8, D1, D2, D3, D4, D5, D6, D7, D9, D10, D11, D12) = true then begin
- PriorityEnemy := T8;
- Result := true;
- end;
- if GetMinDist(D9, D1, D2, D3, D4, D5, D6, D7, D8, D10, D11, D12) = true then begin
- PriorityEnemy := T9;
- Result := true;
- end;
- if GetMinDist(D10, D1, D2, D3, D4, D5, D6, D7, D8, D9, D11, D12) = true then begin
- PriorityEnemy := T10;
- Result := true;
- end;
- if GetMinDist(D11, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D12) = true then begin
- PriorityEnemy := T11;
- Result := true;
- end;
- if GetMinDist(D12, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11) = true then begin
- PriorityEnemy := T12;
- Result := true;
- end;
- //------------------------------------------------------------------------------
- except
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement