Advertisement
Guest User

Untitled

a guest
May 5th, 2015
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.71 KB | None | 0 0
  1. function GetPriorityTarget: boolean;
  2. const
  3. DistMax : Extended = 999999999999999999;
  4. var
  5. MyInfo, E1, E2, E3, E4, E5, E6, E7, E8, E9, E10, E11, E12 : PLAYER_DATA;
  6. QntPlayers, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12 : Integer;
  7. D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12 : Extended;
  8. begin
  9. Result := false;
  10. try
  11. T1 := $0;
  12. T2 := $4;
  13. T3 := $8;
  14. T4 := $C;
  15. T5 := $10;
  16. T6 := $14;
  17. T7 := $18;
  18. T8 := $1C;
  19. T9 := $20;
  20. T10 := $24;
  21. T11 := $28;
  22. T12 := $2C;
  23. QntPlayers := PBYTE($00CACA1E)^;
  24. //------------------------------------------------------------------------------
  25. MyInfo := GetMyInfo;
  26. E1 := GetEnemy(T1);
  27. E2 := GetEnemy(T2);
  28. E3 := GetEnemy(T3);
  29. E4 := GetEnemy(T4);
  30. E5 := GetEnemy(T5);
  31. E6 := GetEnemy(T6);
  32. E7 := GetEnemy(T7);
  33. E8 := GetEnemy(T8);
  34. E9 := GetEnemy(T9);
  35. E10 := GetEnemy(T10);
  36. E11 := GetEnemy(T11);
  37. E12 := GetEnemy(T12);
  38. //------------------------------------------------------------------------------
  39. if TargetVisible(T1, $10) = true then begin
  40. D1 := CalcDistance(MyInfo, E1);
  41. end else begin
  42. D1 := DistMax;
  43. end;
  44.  
  45. if TargetVisible(T2, $34) = true then begin
  46. D2 := CalcDistance(MyInfo, E2);
  47. end else begin
  48. D2 := DistMax;
  49. end;
  50.  
  51. if TargetVisible(T3, $58) = true then begin
  52. D3 := CalcDistance(MyInfo, E3);
  53. end else begin
  54. D3 := DistMax;
  55. end;
  56.  
  57. if TargetVisible(T4, $7C) = true then begin
  58. D4 := CalcDistance(MyInfo, E4);
  59. end else begin
  60. D4 := DistMax;
  61. end;
  62.  
  63. if TargetVisible(T5, $A0) = true then begin
  64. D5 := CalcDistance(MyInfo, E5);
  65. end else begin
  66. D5 := DistMax;
  67. end;
  68.  
  69. if TargetVisible(T6, $C4) = true then begin
  70. D6 := CalcDistance(MyInfo, E6);
  71. end else begin
  72. D6 := DistMax;
  73. end;
  74.  
  75. if QntPlayers > 12 then begin
  76.  
  77. if TargetVisible(T7, $E8) = true then begin
  78. D7 := CalcDistance(MyInfo, E7);
  79. end else begin
  80. D7 := DistMax;
  81. end;
  82.  
  83. if TargetVisible(T8, $10C) = true then begin
  84. D8 := CalcDistance(MyInfo, E8);
  85. end else begin
  86. D8 := DistMax;
  87. end;
  88.  
  89. end else begin
  90. D7 := DistMax;
  91. D8 := DistMax;
  92. end;
  93.  
  94. if QntPlayers = 24 then begin
  95.  
  96. if TargetVisible(T9, $130) = true then begin
  97. D9 := CalcDistance(MyInfo, E9);
  98. end else begin
  99. D9 := DistMax;
  100. end;
  101.  
  102. if TargetVisible(T10, $154) = true then begin
  103. D10 := CalcDistance(MyInfo, E10);
  104. end else begin
  105. D10 := DistMax;
  106. end;
  107.  
  108. if TargetVisible(T11, $178) = true then begin
  109. D11 := CalcDistance(MyInfo, E11);
  110. end else begin
  111. D11 := DistMax;
  112. end;
  113.  
  114. if TargetVisible(T12, $19c) = true then begin
  115. D12 := CalcDistance(MyInfo, E12);
  116. end else begin
  117. D12 := DistMax;
  118. end;
  119.  
  120. end else begin
  121. D9 := DistMax;
  122. D10 := DistMax;
  123. D11 := DistMax;
  124. D12 := DistMax;
  125. end;
  126. //------------------------------------------------------------------------------
  127. if GetMinDist(D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12) = true then begin
  128. PriorityEnemy := T1;
  129. Result := true;
  130. end;
  131.  
  132. if GetMinDist(D2, D1, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12) = true then begin
  133. PriorityEnemy := T2;
  134. Result := true;
  135. end;
  136.  
  137. if GetMinDist(D3, D1, D2, D4, D5, D6, D7, D8, D9, D10, D11, D12) = true then begin
  138. PriorityEnemy := T3;
  139. Result := true;
  140. end;
  141.  
  142. if GetMinDist(D4, D1, D2, D3, D5, D6, D7, D8, D9, D10, D11, D12) = true then begin
  143. PriorityEnemy := T4;
  144. Result := true;
  145. end;
  146.  
  147. if GetMinDist(D5, D1, D2, D3, D4, D6, D7, D8, D9, D10, D11, D12) = true then begin
  148. PriorityEnemy := T5;
  149. Result := true;
  150. end;
  151.  
  152. if GetMinDist(D6, D1, D2, D3, D4, D5, D7, D8, D9, D10, D11, D12) = true then begin
  153. PriorityEnemy := T6;
  154. Result := true;
  155. end;
  156.  
  157. if GetMinDist(D7, D1, D2, D3, D4, D5, D6, D8, D9, D10, D11, D12) = true then begin
  158. PriorityEnemy := T7;
  159. Result := true;
  160. end;
  161.  
  162. if GetMinDist(D8, D1, D2, D3, D4, D5, D6, D7, D9, D10, D11, D12) = true then begin
  163. PriorityEnemy := T8;
  164. Result := true;
  165. end;
  166.  
  167. if GetMinDist(D9, D1, D2, D3, D4, D5, D6, D7, D8, D10, D11, D12) = true then begin
  168. PriorityEnemy := T9;
  169. Result := true;
  170. end;
  171.  
  172. if GetMinDist(D10, D1, D2, D3, D4, D5, D6, D7, D8, D9, D11, D12) = true then begin
  173. PriorityEnemy := T10;
  174. Result := true;
  175. end;
  176.  
  177. if GetMinDist(D11, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D12) = true then begin
  178. PriorityEnemy := T11;
  179. Result := true;
  180. end;
  181.  
  182. if GetMinDist(D12, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11) = true then begin
  183. PriorityEnemy := T12;
  184. Result := true;
  185. end;
  186. //------------------------------------------------------------------------------
  187. except
  188. end;
  189. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement