Advertisement
DraculaxAOE

NTKurastBazaar.ntj

Nov 20th, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.68 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(80)){
  22. NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeWaypoint()");
  23. return;
  24. }
  25. NTP_DoPrecast(true);
  26. if(NTConfig_ClearBazaar > 0){
  27. NTP_DoPrecast();
  28. if(NTConfig_ClearBazaar == 1){
  29. NTConfig_SkipRegularMonsters = false;
  30. NTP_DoPrecast();
  31. if(!NTA_ClearLevel()){
  32. NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END");
  33. }
  34. }
  35. if(NTConfig_ClearBazaar == 2){
  36. NTConfig_SkipRegularMonsters = true;
  37. NTP_DoPrecast();
  38. if(!NTA_ClearLevel()){
  39. NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END");
  40. }
  41. }
  42. }
  43. if(NTConfig_BazaarChests){
  44. _unit = GetPresetUnits(me.areaid, NTC_UNIT_OBJECT);
  45. if(_unit){
  46. var n;
  47. var _chest;
  48. for(n = 0 ; n < _unit.length ; n++){
  49. if(_unit[n].id == 580){
  50. NTM_MoveTo(me.areaid, _unit[n].roomx*5+_unit[n].x, _unit[n].roomy*5+_unit[n].y);
  51. _chest = NTC_FindUnit(NTC_UNIT_OBJECT, "chest");
  52. if(_chest){
  53. do{
  54. if(NTC_OpenChest(_chest))
  55. NTSI_PickItems();
  56. }while(_chest.GetNext());
  57. }
  58. }
  59. else if(_unit[n].id == 104 || _unit[n].id == 105 || _unit[n].id == 106 || _unit[n].id == 107){
  60. NTM_MoveTo(me.areaid, _unit[n].roomx*5+_unit[n].x, _unit[n].roomy*5+_unit[n].y);
  61. _chest = NTC_FindUnit(NTC_UNIT_OBJECT, GetLocaleString(3247));
  62. if(_chest){
  63. do{
  64. if(NTC_OpenChest(_chest))
  65. NTSI_PickItems();
  66. }while(_chest.GetNext());
  67. }
  68. _chest = NTC_FindUnit(NTC_UNIT_OBJECT, GetLocaleString(3248));
  69. if(_chest){
  70. do{
  71. if(NTC_OpenChest(_chest))
  72. NTSI_PickItems();
  73. }while(_chest.GetNext());
  74. }
  75. }
  76. }
  77. }
  78. }
  79. if(NTConfig_ClearRuinedTemple > -1){
  80. if(!NTM_MoveToStair(80, 94)){
  81. NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveToStair()");
  82. return;
  83. }
  84. if(!NTM_TakeStair(94)){
  85. NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeStair()");
  86. return;
  87. }
  88. NTP_DoPrecast();
  89. if(NTConfig_ClearRuinedTemple == 0){
  90. if(!NTM_MoveToPresetUnit(94, NTC_UNIT_MONSTER, 758, 4, 6)){
  91. NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveToPresetUnit()");
  92. return;
  93. }
  94. if(!NTA_KillMonster(GetLocaleString(2865))){
  95. NTC_SendMsgToScript("NTBotGame.ntj", "NTA_KillMonster()");
  96. return;
  97. }
  98. NTSI_PickItems();
  99. if(NTConfig_ClearPosition){
  100. NTA_ClearPosition(20, true);
  101. }
  102. }
  103. if(NTConfig_ClearRuinedTemple == 1){
  104. NTConfig_SkipRegularMonsters = false;
  105. NTP_DoPrecast();
  106. if(!NTA_ClearLevel()){
  107. NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END");
  108. }
  109. }
  110. if(NTConfig_ClearRuinedTemple == 2){
  111. NTConfig_SkipRegularMonsters = true;
  112. NTP_DoPrecast();
  113. if(!NTA_ClearLevel()){
  114. NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END");
  115. }
  116. }
  117. if(NTConfig_OpenChestsInArea && NTU_DontOpenAreas()){
  118. OpenChestsInArea();
  119. }
  120. if(!NTM_MoveToStair(94, 80)){
  121. NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveToStair()");
  122. return;
  123. }
  124. if(!NTM_TakeStair(80)){
  125. NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeStair()");
  126. return;
  127. }
  128. }
  129. if(NTConfig_ClearDisusedFane > 0){
  130. if(!NTM_MoveToStair(80, 95)){
  131. NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveToStair()");
  132. return;
  133. }
  134. if(!NTM_TakeStair(95)){
  135. NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeStair()");
  136. return;
  137. }
  138. NTP_DoPrecast();
  139. if(NTConfig_ClearDisusedFane == 1){
  140. NTConfig_SkipRegularMonsters = false;
  141. NTP_DoPrecast();
  142. if(!NTA_ClearLevel()){
  143. NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END");
  144. }
  145. }
  146. if(NTConfig_ClearDisusedFane == 2){
  147. NTConfig_SkipRegularMonsters = true;
  148. NTP_DoPrecast();
  149. if(!NTA_ClearLevel()){
  150. NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END");
  151. }
  152. }
  153. if(NTConfig_OpenChestsInArea && NTU_DontOpenAreas()){
  154. OpenChestsInArea();
  155. }
  156. if(!NTM_MoveToStair(95, 80)){
  157. NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveToStair()");
  158. return;
  159. }
  160. if(!NTM_TakeStair(80)){
  161. NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeStair()");
  162. return;
  163. }
  164. }
  165. if(NTConfig_ClearSewersAct3 > -1){
  166. if(!NTM_MoveToStair(80, 92)){
  167. NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveToStair()");
  168. return;
  169. }
  170. if(!NTM_TakeStair(92)){
  171. NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeStair()");
  172. return;
  173. }
  174. NTP_DoPrecast();
  175. if(NTConfig_ClearSewersAct3 == 0){
  176. if(!NTM_MoveToPresetUnit(92, NTC_UNIT_MONSTER, 759, -5, 5)){
  177. NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveToPresetUnit()");
  178. return;
  179. }
  180. if(!NTA_KillMonster(GetLocaleString(2864))){
  181. NTC_SendMsgToScript("NTBotGame.ntj", "NTA_KillMonster()");
  182. return;
  183. }
  184. NTSI_PickItems();
  185. if(NTConfig_ClearPosition){
  186. NTA_ClearPosition(20, true);
  187. }
  188. }
  189. if(NTConfig_ClearSewersAct3 == 1){
  190. NTConfig_SkipRegularMonsters = false;
  191. NTP_DoPrecast();
  192. if(!NTA_ClearLevel()){
  193. NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END");
  194. }
  195. }
  196. if(NTConfig_ClearSewersAct3 == 2){
  197. NTConfig_SkipRegularMonsters = true;
  198. NTP_DoPrecast();
  199. if(!NTA_ClearLevel()){
  200. NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END");
  201. }
  202. }
  203. if(NTConfig_OpenChestsInArea && NTU_DontOpenAreas()){
  204. OpenChestsInArea();
  205. }
  206. if(!NTM_MoveToStair(92, 93)){
  207. NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveToStair()");
  208. return;
  209. }
  210. if(!NTM_TakeStair(93)){
  211. NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeStair()");
  212. return;
  213. }
  214. NTP_DoPrecast();
  215. if(NTConfig_ClearSewersAct3 == 0){
  216. //Town if Sorc finds dolls
  217. if(me.classid == NTC_CHAR_CLASS_SORCERESS && NTC_FindUnit(NTC_UNIT_MONSTER, 215)){
  218. NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END");
  219. return;
  220. }
  221. NTConfig_SkipRegularMonsters = false;
  222. NTM_MakeTP();
  223. Delay(200);
  224. NTP_DoPrecast(true);
  225. if(!NTA_ClearLevel()){
  226. NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END");
  227. }
  228. }
  229. if(NTConfig_ClearSewersAct3 == 1){
  230. NTConfig_SkipRegularMonsters = false;
  231. NTP_DoPrecast();
  232. if(!NTA_ClearLevel()){
  233. NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END");
  234. }
  235. }
  236. if(NTConfig_ClearSewersAct3 == 2){
  237. NTConfig_SkipRegularMonsters = true;
  238. NTP_DoPrecast();
  239. if(!NTA_ClearLevel()){
  240. NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END");
  241. }
  242. }
  243. if(NTConfig_OpenChestsInArea && NTU_DontOpenAreas()){
  244. OpenChestsInArea();
  245. }
  246. }
  247. NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END");
  248. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement