Advertisement
kolton

Untitled

Dec 13th, 2011
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. function NTMain()
  2. {
  3. Include("libs/common/NTCommon.ntl");
  4. NTC_IncludeLibs();
  5. NTC_IncludeConfig("NTBot/char_configs");
  6. NT_LoadConfig();
  7. NTA_Initialize();
  8.  
  9. Print("ΓΏc9Hostile watcher v2 by kolton");
  10.  
  11. while(1)
  12. {
  13. NTC_Delay(100);
  14. var _unit = NTC_FindUnit(NTC_UNIT_PLAYER);
  15. if(_unit)
  16. {
  17. do
  18. {
  19. if(GetPlayerFlag(me.gid, _unit.gid, 9) && GetDistance(me.x, me.y, _unit.x, _unit.y) < 40 && !NTC_InTown() && NTA_IsValidTarget(_unit))
  20. {
  21. NTC_SendMsgToScript("NTBotGame.ntj", "HOSTILE");
  22. if(NTA_KillDumbass(_unit.gid))
  23. Say(_unit.name + " got cum blasted.");
  24. NTC_SendMsgToScript("NTBotGame.ntj", "HOSTILE");
  25. }
  26. }while(_unit.GetNext());
  27. }
  28. }
  29. }
  30.  
  31. function NTA_KillDumbass(id)
  32. {
  33. var _target;
  34.  
  35. if(NTConfig_AttackSkill[1] < 1)
  36. return false;
  37.  
  38. _target = NTC_FindUnit(NTC_UNIT_PLAYER, id);
  39.  
  40. if(!_target)
  41. return false;
  42.  
  43. if(_target.IsAttackable())
  44. {
  45. var _attackcount = 0;
  46.  
  47. while(_attackcount < 600 && NTA_IsValidTarget(_target))
  48. {
  49. if(NTA_Attack(_target, (_attackcount%30) == 0) < 2)
  50. return false;
  51.  
  52. if(me.classid == 1 && GetDistance(me.x, me.y, _target.x, _target.y) < 10)
  53. {
  54. _castx = _target.x > me.x ? _target.x+15 : _target.x-15;
  55. _casty = _target.y > me.y ? _target.y+15 : _target.y-15;
  56. NTM_MoveTo(me.areaid, _castx, _casty);
  57. }
  58.  
  59. _attackcount++;
  60. }
  61. }
  62.  
  63. return (_target.hp <= 0 || _target.mode == 0 || _target.mode == 17);
  64. }
  65.  
  66. function NTA_IsValidTarget(target)
  67. {
  68. if(target.mode == 17 || target.mode == 0 || NTC_InTown(target))
  69. return false;
  70.  
  71. return true;
  72. }
  73.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement