Guest User

Untitled

a guest
Apr 22nd, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. function DistanceChecks( byref a_info, byref d_info)
  2. // Core handles distance checks before starting the hook.
  3.  
  4. print ( "a_info: "+a_info+", d_info: "+d_info );
  5. var cur_range := Distance(a_info.mobile, d_info.mobile);
  6. var max_range := GetConfigInt(a_info.cfginfo, a_info.prefix+"MaxRange");
  7. if ( max_range == error )
  8. max_range := 1;
  9. endif
  10.  
  11.  
  12. if ( cur_range > max_range )
  13. CombatMsg(a_info.mobile, "Opponent is too far away. ["+max_range+"]", "Dist");
  14. return 0;
  15. elseif ( cur_range < CInt(GetConfigInt(a_info.cfginfo, a_info.prefix+"MinRange")) )
  16. CombatMsg(a_info.mobile, "Attack.", "Dist");
  17. return 0;
  18. else
  19. return 1;
  20. endif
  21.  
  22. endfunction
Add Comment
Please, Sign In to add comment