Advertisement
DraculaxAOE

NTDuranceOfHate.ntj

Nov 26th, 2016
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.65 KB | None | 0 0
  1. function NTMain(){
  2.  
  3. Include("libs/common/NTCommon.ntl");
  4. NTC_IncludeLibs();
  5. NTC_IncludeConfig("NTBot/char_configs");
  6.  
  7. NT_LoadConfig();
  8. NTSI_LoadNIPFiles("NTBot/item_configs");
  9.  
  10. NTA_Initialize();
  11.  
  12. if(!NTTM_CheckAct()){
  13. NTC_SendMsgToScript("NTBotGame.ntj", "NTTM_CheckAct()");
  14. return;
  15. }
  16. NTTMGR_TownManager();
  17. if(!NTTM_TownMove("waypoint")){
  18. NTC_SendMsgToScript("NTBotGame.ntj", "NTTM_TownMove()");
  19. return;
  20. }
  21. if(!NTM_TakeWaypoint(101)){
  22. NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeWaypoint()");
  23. return;
  24. }
  25. NTP_DoPrecast(true);
  26. if(NTConfig_ClearDury > 0){
  27. if(NTConfig_ClearDury == 1) {
  28. NTConfig_SkipRegularMonsters = false;
  29. NTP_DoPrecast();
  30. if(!NTA_ClearLevel()){
  31. NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END");
  32. }
  33. }
  34. if(NTConfig_ClearDury == 2) {
  35. NTConfig_SkipRegularMonsters = true;
  36. NTP_DoPrecast();
  37. if(!NTA_ClearLevel()){
  38. NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END");
  39. }
  40. }
  41. if(!NTM_MoveToStair(me.areaid, 102)){
  42. NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveToStair()");
  43. return;
  44. }
  45. if(!NTM_TakeStair(102)){
  46. NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeStair()");
  47. return;
  48. }
  49. }
  50. if(NTConfig_KillDuryCouncil){
  51. if(me.areaid == 101) {
  52. if(!NTM_MoveToStair(me.areaid, 102)){
  53. NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveToStair()");
  54. return;
  55. }
  56. if(!NTM_TakeStair(102)){
  57. NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeStair()");
  58. return;
  59. }
  60. NTC_Delay(200);
  61. }
  62. NTM_MakeTP();
  63. Delay(5000);
  64. NTP_DoPrecast(true);
  65. var _attackpos = [
  66. 17651, 8066, 17630, 8069, 17625, 8048, 17647, 8040, //bottom council members
  67. 17610, 8124, 17603, 8138, 17623, 8138, 17571, 8121, //left-side council member
  68. 17609, 8022, 17616, 8006, 17592, 8015, 17575, 8012 // right-side council member
  69. ];
  70. for(var i = 0 ; i < _attackpos.length ; i += 2){
  71. NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]);
  72. NTA_ClearPosition();
  73. NTSI_PickItems();
  74. }
  75. }
  76. if(NTConfig_KillMeph){
  77. if(me.areaid != 102){
  78. if(!NTM_MoveToStair(me.areaid, 102)){
  79. NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveToStair()");
  80. return;
  81. }
  82. if(!NTM_TakeStair(102)){
  83. NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeStair()");
  84. return;
  85. }
  86. }
  87. if(!NTM_MoveTo(me.areaid, 17564, 8069)){
  88. NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveTo()");
  89. return;
  90. }
  91. NTC_Delay(200);
  92. if(me.classid != NTC_CHAR_CLASS_PALADIN && me.classid != NTC_CHAR_CLASS_BARBARIAN)
  93. NTM_MoveTo(me.areaid, 17573, 8071);
  94. if (NTConfig_MoatTrick[0] && me.classid == NTC_CHAR_CLASS_SORCERESS){
  95. if (!MyMep_KillMephisto(20, 9))
  96. return "MyMep_KillMephisto()";
  97. NTM_MoveTo(me.areaid, 17588, 8087);
  98. NTSI_PickItems();
  99. }
  100. else{
  101. NTA_KillMonster(242);
  102. // if(!NTA_KillMonster(242)){
  103. // NTC_SendMsgToScript("NTBotGame.ntj", "NTA_KillMonster()");
  104. // return;
  105. // }
  106. }
  107. if(NTConfig_ClearPosition)
  108. NTA_ClearPosition();
  109. NTSI_PickItems();
  110. if(NTConfig_OpenChest){
  111. var _chest;
  112. if(NTM_MoveTo(me.areaid, 17520, 8063)){
  113. NTA_ClearPosition(30, true);
  114. }
  115. _chest = NTC_FindUnit(NTC_UNIT_OBJECT, GetLocaleString(3260), 1);
  116. if(_chest){
  117. do{
  118. if(_chest.x == 17513 && _chest.y == 8063){
  119. if(NTC_OpenChest(_chest)){
  120. NTSI_PickItems();
  121. }
  122. break;
  123. }
  124. } while(_chest.GetNext());
  125. }
  126. }
  127. if(NTConfig_OpenChestsInArea && NTU_DontOpenAreas()){
  128. OpenChestsInArea();
  129. }
  130. }
  131. if(NTConfig_RedPortal){
  132. if(me.areaid == 100) {
  133. for(var i = 1; i < 3; i++) {
  134. if(!NTM_MoveToStair(me.areaid, 100+i)){
  135. NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveToStair()");
  136. return;
  137. }
  138. if(!NTM_TakeStair(100+i)){
  139. NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeStair()");
  140. return;
  141. }
  142. if(me.areaid == 102)
  143. break;
  144. }
  145. }
  146. var _isTelekinesis = NTC_GetSkillLevel(43);
  147. if (NTConfig_Telekinesis && (me.classid == NTC_CHAR_CLASS_SORCERESS) && (_isTelekinesis)) {
  148. NTM_MoveTo(me.areaid, 17586, 8068);
  149. var bridge = GetUnit(NTC_UNIT_OBJECT, 341);
  150. if(bridge){
  151. while(bridge.mode != 2){
  152. Delay(500);
  153. }
  154. }
  155. NTM_MoveTo(me.areaid, 17590, 8068);
  156. var _portal = GetUnit(NTC_UNIT_OBJECT, 342);
  157. if(_portal){
  158. while(_portal.mode != 2){
  159. Delay(500);
  160. }
  161. Delay(1000);
  162. for(var i = 0 ; i < 3 ; i++){
  163. NTC_CastSkill(43, NTC_HAND_RIGHT, _portal);
  164. Delay(500)
  165. if(me.areaid != 102){
  166. break;
  167. }
  168. }
  169. }
  170. }
  171. if(me.areaid == 102) {
  172. NTM_MoveTo(me.areaid, 17590, 8068);
  173. var bridge = GetUnit(NTC_UNIT_OBJECT, 341);
  174. if(bridge){
  175. while(bridge.mode != 2){
  176. Delay(500);
  177. }
  178. }
  179. var _portal = GetUnit(NTC_UNIT_OBJECT, 342);
  180. if(_portal){
  181. while(_portal.mode != 2){
  182. Delay(500);
  183. }
  184. NTM_TakeUnit(NTC_UNIT_OBJECT, 342);
  185. }
  186. }
  187. while(me.areaid == 0){
  188. Delay(500);
  189. }
  190. }
  191. NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END");
  192. }
  193.  
  194. function MyMep_KillMephisto(distance, move)
  195. {
  196. var _iAttack, _targetHp;
  197. var _target = NTC_FindUnit(NTC_UNIT_MONSTER, 242, 10);
  198. if (!_target)
  199. return true;
  200. Delay(200);
  201. MyMep_EnticeTo(_target, distance, move, 17609, 8092);
  202. _iAttack = 0;
  203. _targetHp = _target.hp;
  204. while (_target.hp > 0 && _target.mode != 0 && _target.mode != 12) {
  205. if (GetDistance(me.x, me.y, 17609, 8092) <= 3) {
  206. if (NTA_ClearPosition(10))
  207. NTM_MoveTo(me.areaid, 17609, 8092);
  208. }
  209. NTC_CastSkill(NTConfig_AttackSkill[1], NTC_HAND_RIGHT, _target);
  210. while (_target.hp > 0 && _target.mode != 0 && _target.mode != 12 && me.GetSkillStatus(NTConfig_AttackSkill[1]) == 8){
  211. if (NTConfig_MoatTrick[1]) {
  212. if (me.GetSkillStatus(NTConfig_AttackSkill[2]) != 8)
  213. NTC_CastSkill(NTConfig_AttackSkill[2], NTC_HAND_LEFT, _target);
  214. else
  215. Delay(NTC_DELAY_FRAME);
  216. }
  217. else
  218. Delay(NTC_DELAY_FRAME);
  219. }
  220. if ((++_iAttack % 7) == 0) {
  221. if (_target.hp < _targetHp)
  222. _targetHp = _target.hp;
  223. else
  224. return false;
  225. }
  226. }
  227. return true;
  228. }
  229.  
  230. function MyMep_EnticeTo(target, distance, move, targetX, targetY)
  231. {
  232. var _distance;
  233. var TickCount = 0;
  234.  
  235. TickCount = GetTickCount();
  236.  
  237. while (true) {
  238. if (GetDistance(me, target) <= distance) {
  239. _distance = GetDistance(me.x, me.y, targetX, targetY);
  240. if (_distance <= Math.round(move * 1.5))
  241. return NTM_TeleportTo(targetX, targetY);
  242. if (!NTM_TeleportTo(me.x + Math.round(move * (targetX - me.x) / _distance), me.y + Math.round(move * (targetY - me.y) / _distance)))
  243. return false;
  244. TickCount = GetTickCount();
  245. }
  246. else{
  247. if (GetTickCount() <= (TickCount + 3500))
  248. Delay(200);
  249. else
  250. return false;
  251. }
  252. }
  253. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement