Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 37.93 KB | None | 0 0
  1. var _NTTMGR_BuyPots;
  2. var _NTTMGR_BuyTP;
  3. var _NTTMGR_BuyKey;
  4. var _NTTMGR_DoHeal;
  5. var _NTTMGR_DoID;
  6. var _NTTMGR_DoRepair;
  7. var _NTTMGR_DoRevive;
  8. var _NTTMGR_RemoveCurse;
  9. var _NTTMGR_Simple;
  10. var _NTTMGR_BuyArrows;
  11.  
  12. function NTTMGR_TownManager(simple)
  13. {
  14. NTC_SwapWeapons(0);
  15.  
  16. var _cubing;
  17.  
  18. if(arguments.length < 1)
  19. simple = false;
  20.  
  21. NTC_ClearCursor();
  22. NTT_CleanPotions();
  23.  
  24. _NTTMGR_BuyPots = NTT_CheckBelt();
  25. _NTTMGR_BuyTP = (NTTMGR_CheckScrolls(1) < 4);
  26. _NTTMGR_BuyKey = ((NTConfig_OpenChest || NTConfig_OpenChestsInArea || NTConfig_OpenHallsSuperChests) && NTTMGR_CheckKeys() < NTConfig_keys);
  27. _NTTMGR_DoHeal = NTT_CheckHeal();
  28. _NTTMGR_DoID = NTT_CheckUnids();
  29. _NTTMGR_DoRepair = NTT_CheckRepair(NTConfig_Repair);
  30. _NTTMGR_DoRevive = NTT_CheckMerc();
  31. _NTTMGR_RemoveCurse = NTTMGR_CheckCurse(NTConfig_CheckSelfSafe, NTConfig_CheckMercSafe);
  32. _NTTMGR_Simple = simple;
  33.  
  34. NTCU_InitCubing();
  35.  
  36. NTC_PutSkill(115, NTC_HAND_RIGHT);
  37.  
  38. _haveBOS = NTC_GetSkillLevel(258);
  39.  
  40. if(me.classid == NTC_CHAR_CLASS_ASSASSIN && _haveBOS)
  41. {
  42. NTC_CastSkill(258, NTC_HAND_RIGHT); // Burst of Speed
  43. }
  44.  
  45. if(me.GetSkill(12, false) > 1)
  46. {
  47. _NTTMGR_BuyArrows = true;
  48. if(NTC_InTown())
  49. NTTMGR_CheckAmazonBow();
  50. }
  51.  
  52. switch(me.act)
  53. {
  54. case 1:
  55. if(NTConfig_IdentAtCain && _NTTMGR_DoID && NTTMGR_SkipCainAct())
  56. NTTMGR_VisitCain(simple);
  57.  
  58. _NTTMGR_DoHeal = NTT_CheckHeal(); // put these vars here to reset them after doing cain else it does them again ending with extra pots in inv
  59. _NTTMGR_RemoveCurse = NTTMGR_CheckCurse(NTConfig_CheckSelfSafe, NTConfig_CheckMercSafe);
  60. _NTTMGR_DoID = NTT_CheckUnids();
  61. _NTTMGR_BuyPots = NTT_CheckBelt();
  62. _NTTMGR_BuyTP = (NTTMGR_CheckScrolls(1) < 4);
  63. _NTTMGR_BuyKey = ((NTConfig_OpenChest || NTConfig_OpenChestsInArea || NTConfig_OpenHallsSuperChests) && NTTMGR_CheckKeys() < NTConfig_keys);
  64.  
  65. if(_NTTMGR_DoHeal || _NTTMGR_RemoveCurse || _NTTMGR_DoID || _NTTMGR_BuyPots || _NTTMGR_BuyTP || _NTTMGR_BuyKey) {
  66. NTTMGR_VisitAkara();
  67. }
  68.  
  69. _cubing = (!simple && (NTCU_CheckCubing() || NTRW_CheckRunewords()));
  70.  
  71. if(_cubing || NTT_CheckInventory())
  72. NTTMGR_VisitStash(_cubing);
  73.  
  74. if(_NTTMGR_DoRevive)
  75. NTTMGR_VisitKashya();
  76.  
  77. if(_NTTMGR_DoRepair || _NTTMGR_BuyArrows)
  78. NTTMGR_VisitCharsi();
  79.  
  80. if(!simple && NTConfig_Gamble && NTC_MyGold() > NTConfig_GambleStartGold)
  81. {
  82. NTTMGR_VisitGheed();
  83.  
  84. _cubing = (!simple && (NTCU_CheckCubing() || NTRW_CheckRunewords()));
  85.  
  86. if(_cubing || NTT_CheckInventory())
  87. NTTMGR_VisitStash(_cubing);
  88. }
  89. break;
  90.  
  91. case 2:
  92. if(NTConfig_IdentAtCain && _NTTMGR_DoID && NTTMGR_SkipCainAct())
  93. NTTMGR_VisitCain(simple);
  94.  
  95. _NTTMGR_DoHeal = NTT_CheckHeal();
  96. _NTTMGR_RemoveCurse = NTTMGR_CheckCurse(NTConfig_CheckSelfSafe, NTConfig_CheckMercSafe);
  97. _NTTMGR_DoID = NTT_CheckUnids();
  98. _NTTMGR_BuyPots = NTT_CheckBelt();
  99. _NTTMGR_BuyTP = (NTTMGR_CheckScrolls(1) < 4);
  100. _NTTMGR_BuyKey = ((NTConfig_OpenChest || NTConfig_OpenChestsInArea || NTConfig_OpenHallsSuperChests) && NTTMGR_CheckKeys() < NTConfig_keys);
  101.  
  102. if(_NTTMGR_DoHeal || _NTTMGR_RemoveCurse || _NTTMGR_DoRepair || _NTTMGR_BuyArrows)
  103. NTTMGR_VisitFara();
  104. if(_NTTMGR_BuyPots || _NTTMGR_BuyTP || _NTTMGR_DoID)
  105. NTTMGR_VisitDrognan();
  106. if(_NTTMGR_BuyKey)
  107. NTTMGR_VisitLysander();
  108.  
  109. _cubing = (!simple && (NTCU_CheckCubing() || NTRW_CheckRunewords()));
  110.  
  111. if(_cubing || NTT_CheckInventory())
  112. NTTMGR_VisitStash(_cubing);
  113. if(_NTTMGR_DoRevive)
  114. NTTMGR_VisitGreiz();
  115. if(!simple && NTConfig_Gamble && NTC_MyGold() > NTConfig_GambleStartGold)
  116. {
  117. NTTMGR_VisitElzix();
  118.  
  119. _cubing = (!simple && (NTCU_CheckCubing() || NTRW_CheckRunewords()));
  120.  
  121. if(_cubing || NTT_CheckInventory())
  122. NTTMGR_VisitStash(_cubing);
  123. }
  124. break;
  125.  
  126. case 3:
  127. if(NTConfig_IdentAtCain && _NTTMGR_DoID && NTTMGR_SkipCainAct())
  128. NTTMGR_VisitCain(simple);
  129.  
  130. _NTTMGR_DoHeal = NTT_CheckHeal();
  131. _NTTMGR_RemoveCurse = NTTMGR_CheckCurse(NTConfig_CheckSelfSafe, NTConfig_CheckMercSafe);
  132. _NTTMGR_DoID = NTT_CheckUnids();
  133. _NTTMGR_BuyPots = NTT_CheckBelt();
  134. _NTTMGR_BuyTP = (NTTMGR_CheckScrolls(1) < 4);
  135. _NTTMGR_BuyKey = ((NTConfig_OpenChest || NTConfig_OpenChestsInArea || NTConfig_OpenHallsSuperChests) && NTTMGR_CheckKeys() < NTConfig_keys);
  136.  
  137. if(_NTTMGR_DoHeal || _NTTMGR_RemoveCurse || _NTTMGR_DoID || _NTTMGR_BuyTP || _NTTMGR_BuyPots)
  138. NTTMGR_VisitOrmus();
  139.  
  140. _cubing = (!simple && (NTCU_CheckCubing() || NTRW_CheckRunewords()));
  141.  
  142. if(_cubing || NTT_CheckInventory())
  143. NTTMGR_VisitStash(_cubing);
  144. if(_NTTMGR_DoRevive)
  145. NTTMGR_VisitAsheara();
  146. if(_NTTMGR_DoRepair || _NTTMGR_BuyKey || _NTTMGR_BuyArrows)
  147. NTTMGR_VisitHratli();
  148. if(!simple && NTConfig_Gamble && NTC_MyGold() > NTConfig_GambleStartGold)
  149. {
  150. NTTMGR_VisitAlkor();
  151.  
  152. _cubing = (!simple && (NTCU_CheckCubing() || NTRW_CheckRunewords()));
  153.  
  154. if(_cubing || NTT_CheckInventory())
  155. NTTMGR_VisitStash(_cubing);
  156. }
  157. break;
  158.  
  159. case 4:
  160. if(NTConfig_IdentAtCain && _NTTMGR_DoID && NTTMGR_SkipCainAct())
  161. NTTMGR_VisitCain(simple);
  162.  
  163. _NTTMGR_DoHeal = NTT_CheckHeal();
  164. _NTTMGR_RemoveCurse = NTTMGR_CheckCurse(NTConfig_CheckSelfSafe, NTConfig_CheckMercSafe);
  165. _NTTMGR_DoID = NTT_CheckUnids();
  166. _NTTMGR_BuyPots = NTT_CheckBelt();
  167. _NTTMGR_BuyTP = (NTTMGR_CheckScrolls(1) < 4);
  168. _NTTMGR_BuyKey = ((NTConfig_OpenChest || NTConfig_OpenChestsInArea || NTConfig_OpenHallsSuperChests) && NTTMGR_CheckKeys() < NTConfig_keys);
  169.  
  170. if(_NTTMGR_DoHeal || _NTTMGR_RemoveCurse || _NTTMGR_DoID || _NTTMGR_BuyTP || _NTTMGR_BuyKey || _NTTMGR_BuyPots)
  171. NTTMGR_VisitJamella(false);
  172. if(_NTTMGR_DoRepair || _NTTMGR_BuyArrows)
  173. NTTMGR_VisitHalbu();
  174.  
  175. _cubing = (!simple && (NTCU_CheckCubing() || NTRW_CheckRunewords()));
  176.  
  177. if(_cubing || NTT_CheckInventory())
  178. NTTMGR_VisitStash(_cubing);
  179. if(_NTTMGR_DoRevive)
  180. NTTMGR_VisitTyrael();
  181. if(!simple && NTConfig_Gamble && NTC_MyGold() > NTConfig_GambleStartGold)
  182. {
  183. NTTMGR_VisitJamella(true);
  184.  
  185. _cubing = (!simple && (NTCU_CheckCubing() || NTRW_CheckRunewords()));
  186.  
  187. if(_cubing || NTT_CheckInventory())
  188. NTTMGR_VisitStash(_cubing);
  189. }
  190. break;
  191.  
  192. case 5:
  193. if(NTConfig_IdentAtCain && _NTTMGR_DoID && NTTMGR_SkipCainAct())
  194. NTTMGR_VisitCain(simple);
  195.  
  196. _NTTMGR_DoHeal = NTT_CheckHeal();
  197. _NTTMGR_RemoveCurse = NTTMGR_CheckCurse(NTConfig_CheckSelfSafe, NTConfig_CheckMercSafe);
  198. _NTTMGR_DoID = NTT_CheckUnids();
  199. _NTTMGR_BuyPots = NTT_CheckBelt();
  200. _NTTMGR_BuyTP = (NTTMGR_CheckScrolls(1) < 4);
  201. _NTTMGR_BuyKey = ((NTConfig_OpenChest || NTConfig_OpenChestsInArea || NTConfig_OpenHallsSuperChests) && NTTMGR_CheckKeys() < NTConfig_keys);
  202.  
  203. if(_NTTMGR_DoHeal || _NTTMGR_RemoveCurse || _NTTMGR_DoID || _NTTMGR_BuyTP || _NTTMGR_BuyKey || _NTTMGR_BuyPots)
  204. NTTMGR_VisitMalah();
  205.  
  206. _cubing = (!simple && (NTCU_CheckCubing() || NTRW_CheckRunewords()));
  207.  
  208. if(_cubing || NTT_CheckInventory())
  209. NTTMGR_VisitStash(_cubing);
  210. if(_NTTMGR_DoRepair || _NTTMGR_BuyArrows)
  211. NTTMGR_VisitLarzuk();
  212. if(_NTTMGR_DoRevive)
  213. NTTMGR_VisitQualKehk();
  214. if(!simple && NTConfig_Gamble && NTC_MyGold() > NTConfig_GambleStartGold)
  215. {
  216. NTTMGR_VisitAnya();
  217.  
  218. _cubing = (!simple && (NTCU_CheckCubing() || NTRW_CheckRunewords()));
  219.  
  220. if(_cubing || NTT_CheckInventory())
  221. NTTMGR_VisitStash(_cubing);
  222. }
  223. break;
  224. }
  225.  
  226. if ('NTConfig_AutoMule' in this && NTConfig_AutoMule && NTT_CheckForFullStash()) {
  227. var _script = NTC_FindScript('NTMule.ntj');
  228. if (_script && _script.running) {
  229. NTC_SendMsgToScript('NTMule.ntj', 'StartMuling');
  230. Delay(1000);
  231. NTC_SendMsgToScript('NTBotGame.ntj', 'QuitGame');
  232. Delay(1000);
  233. }
  234. else {
  235. NTC_SendLogToOOG(NTC_LOG_COMMON, 'Automuling requires the NTMule.ntj entry point');
  236. }
  237. }
  238. if(!simple && NTConfig_StopIfStashInventoryFull && NTT_CheckForFullStash()){
  239.  
  240. me.maxgametime = 0;
  241.  
  242. if(NTTM_CheckAct()){
  243.  
  244. while(1){
  245. Say ("!Your Inventory/Stash is full please empty it.");
  246. Delay(3000);
  247. }
  248. }
  249. }
  250.  
  251. }
  252.  
  253. function NTTMGR_VisitTown()
  254. {
  255. var _prearea = me.areaid;
  256.  
  257. if(!NTTM_CheckAct())
  258. return false;
  259.  
  260. NTTMGR_TownManager(true);
  261.  
  262. if(!NTTM_TownMove("portalspot", true))
  263. return false;
  264.  
  265. if(!NTM_UsePortal("BluePortal", _prearea))
  266. return false;
  267.  
  268. if(NTConfig_PublicMode)
  269. NTM_MakeTP();
  270.  
  271. if(me.classid == NTC_CHAR_CLASS_ASSASSIN && NTConfig_UseFade && !me.GetStat(181))
  272. NTC_CastSkill(267, NTC_HAND_RIGHT);
  273.  
  274. return true;
  275. }
  276.  
  277. function NTTMGR_VisitStash(cubing)
  278. {
  279. var _stash;
  280.  
  281. NTTM_TownMove("stash");
  282.  
  283. _stash = NTC_FindUnit(NTC_UNIT_OBJECT, NTC_UNIT_STASH, 5);
  284.  
  285. if(_stash)
  286. {
  287. if(NTT_DoInteract(_stash))
  288. {
  289. if(NTConfig_MakeRunewords)
  290. NTRW_MakeRuneword();
  291.  
  292. NTT_ManageStash();
  293.  
  294. if(cubing)
  295. {
  296. NTCU_DoCubing();
  297.  
  298. if(NTT_DoInteract(_stash))
  299. NTT_ManageStash();
  300.  
  301. me.Cancel(1);
  302. NTT_ClearInventory();
  303. }
  304. else
  305. me.Cancel(1);
  306. }
  307. }
  308. }
  309.  
  310. function NTTMGR_VisitAkara()
  311. {
  312. var _npc;
  313.  
  314. NTTM_TownMove("akara");
  315.  
  316. _npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_AKARA, 5);
  317.  
  318. if(_npc)
  319. {
  320. if(NTT_DoInteract(_npc))
  321. {
  322. if(_NTTMGR_DoID || _NTTMGR_BuyPots || _NTTMGR_BuyTP || _NTTMGR_BuyKey)
  323. {
  324. if(NTT_DoTrade(_npc))
  325. {
  326. if(_NTTMGR_BuyPots)
  327. NTT_FillBelt(_npc);
  328. if(_NTTMGR_BuyTP)
  329. NTT_FillTome(_npc, 1);
  330. if(_NTTMGR_BuyKey)
  331. NTT_FillKey(_npc);
  332. if(_NTTMGR_DoID)
  333. NTTMGR_IDItems(_npc);
  334. }
  335. }
  336.  
  337. me.Cancel(1);
  338. }
  339. }
  340. }
  341.  
  342. function NTTMGR_VisitKashya()
  343. {
  344. var _npc;
  345.  
  346. NTTM_TownMove("kashya");
  347.  
  348. _npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_KASHYA, 5);
  349.  
  350. if(_npc)
  351. {
  352. if(NTT_DoInteract(_npc))
  353. {
  354. NTT_ReviveMerc();
  355. me.Cancel(1);
  356. }
  357. }
  358. }
  359.  
  360. function NTTMGR_VisitCharsi()
  361. {
  362. var _npc;
  363.  
  364. NTTM_TownMove("charsi");
  365.  
  366. _npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_CHARSI, 5);
  367.  
  368. if(_npc)
  369. {
  370. if(NTT_DoInteract(_npc))
  371. {
  372. if(_NTTMGR_DoRepair || _NTTMGR_BuyArrows)
  373. {
  374. if(NTT_DoTrade(_npc))
  375. {
  376. if(_NTTMGR_DoRepair)
  377. NTT_RepairItems(_npc);
  378. if(_NTTMGR_BuyArrows)
  379. NTT_FillArrows(_npc);
  380. }
  381. me.Cancel(1);
  382. }
  383. }
  384. }
  385. }
  386. function NTTMGR_VisitGheed()
  387. {
  388. var _npc;
  389.  
  390. NTTM_TownMove("gheed");
  391.  
  392. _npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_GHEED, 5);
  393.  
  394. if(_npc)
  395. {
  396. while(NTC_MyGold() > NTConfig_GambleStopGold)
  397. {
  398. if(NTT_DoInteract(_npc))
  399. {
  400. if(NTT_DoTrade(_npc, 1))
  401. NTT_GambleIt(_npc);
  402.  
  403. me.Cancel(1);
  404. }
  405. else
  406. break;
  407. }
  408. }
  409. }
  410.  
  411. function NTTMGR_VisitFara()
  412. {
  413. var _npc;
  414.  
  415. NTTM_TownMove("fara");
  416.  
  417. _npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_FARA, 5);
  418.  
  419. if(_npc)
  420. {
  421. if(NTT_DoInteract(_npc))
  422. {
  423. if(_NTTMGR_DoRepair || _NTTMGR_BuyArrows)
  424. {
  425. if(NTT_DoTrade(_npc))
  426. {
  427. if(_NTTMGR_DoRepair)
  428. NTT_RepairItems(_npc);
  429. if(_NTTMGR_BuyArrows)
  430. NTT_FillArrows(_npc);
  431. }
  432. }
  433.  
  434. me.Cancel(1);
  435. }
  436. }
  437. }
  438.  
  439. function NTTMGR_VisitDrognan()
  440. {
  441. var _npc;
  442.  
  443. NTTM_TownMove("drognan");
  444.  
  445. _npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_DROGNAN, 5);
  446.  
  447. if(_npc)
  448. {
  449. if(NTT_DoInteract(_npc))
  450. {
  451. if(NTT_DoTrade(_npc))
  452. {
  453. if(_NTTMGR_BuyPots)
  454. NTT_FillBelt(_npc);
  455. if(_NTTMGR_BuyTP)
  456. NTT_FillTome(_npc, 1);
  457. if(_NTTMGR_DoID)
  458. NTTMGR_IDItems(_npc);
  459. }
  460.  
  461. me.Cancel(1);
  462. }
  463. }
  464. }
  465.  
  466. function NTTMGR_VisitLysander()
  467. {
  468. var _npc;
  469.  
  470. NTTM_TownMove("lysander");
  471.  
  472. _npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_LYSANDER, 5);
  473.  
  474. if(_npc)
  475. {
  476. if(NTT_DoInteract(_npc))
  477. {
  478. if(NTT_DoTrade(_npc))
  479. NTT_FillKey(_npc);
  480.  
  481. me.Cancel(1);
  482. }
  483. }
  484. }
  485.  
  486. function NTTMGR_VisitGreiz()
  487. {
  488. var _npc;
  489.  
  490. NTTM_TownMove("greiz");
  491.  
  492. _npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_GREIZ, 5);
  493.  
  494. if(_npc)
  495. {
  496. if(NTT_DoInteract(_npc))
  497. {
  498. NTT_ReviveMerc();
  499. me.Cancel(1);
  500. }
  501. }
  502. }
  503.  
  504. function NTTMGR_VisitElzix()
  505. {
  506. var _npc;
  507.  
  508. NTTM_TownMove("elzix");
  509.  
  510. _npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_ELZIX, 5);
  511.  
  512. if(_npc)
  513. {
  514. while(NTC_MyGold() > NTConfig_GambleStopGold)
  515. {
  516. if(NTT_DoInteract(_npc))
  517. {
  518. if(NTT_DoTrade(_npc, 1))
  519. NTT_GambleIt(_npc);
  520.  
  521. me.Cancel(1);
  522. }
  523. else
  524. break;
  525. }
  526. }
  527. }
  528.  
  529. function NTTMGR_VisitOrmus()
  530. {
  531. var _npc;
  532.  
  533. NTTM_TownMove("ormus");
  534.  
  535. _npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_ORMUS, 5);
  536.  
  537. if(_npc)
  538. {
  539. if(NTT_DoInteract(_npc))
  540. {
  541. if(_NTTMGR_DoID || _NTTMGR_BuyPots || _NTTMGR_BuyTP)
  542. {
  543. if(NTT_DoTrade(_npc))
  544. {
  545. if(_NTTMGR_BuyPots)
  546. NTT_FillBelt(_npc);
  547. if(_NTTMGR_BuyTP)
  548. NTT_FillTome(_npc, 1);
  549. if(_NTTMGR_DoID)
  550. NTTMGR_IDItems(_npc);
  551. }
  552. }
  553.  
  554. me.Cancel(1);
  555. }
  556. }
  557. }
  558.  
  559. function NTTMGR_VisitAsheara()
  560. {
  561. var _npc;
  562.  
  563. NTTM_TownMove("asheara");
  564.  
  565. _npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_ASHEARA, 5);
  566.  
  567. if(_npc)
  568. {
  569. if(NTT_DoInteract(_npc))
  570. {
  571. NTT_ReviveMerc();
  572. me.Cancel(1);
  573. }
  574. }
  575. }
  576.  
  577. function NTTMGR_VisitHratli()
  578. {
  579. var _npc;
  580.  
  581. NTTM_TownMove("hratli");
  582.  
  583. _npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_HRATLI, 5);
  584.  
  585. if(_npc)
  586. {
  587. if(NTT_DoInteract(_npc))
  588. {
  589. if(NTT_DoTrade(_npc))
  590. {
  591. if(_NTTMGR_DoRepair)
  592. NTT_RepairItems(_npc);
  593. if(_NTTMGR_BuyKey)
  594. NTT_FillKey(_npc);
  595. if(_NTTMGR_BuyArrows)
  596. NTT_FillArrows(_npc);
  597. }
  598.  
  599. me.Cancel(1);
  600. }
  601. }
  602. }
  603. function NTTMGR_VisitAlkor()
  604. {
  605. var _npc;
  606.  
  607. NTTM_TownMove("alkor");
  608.  
  609. _npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_ALKOR, 5);
  610.  
  611. if(_npc)
  612. {
  613. while(NTC_MyGold() > NTConfig_GambleStopGold)
  614. {
  615. if(NTT_DoInteract(_npc))
  616. {
  617. if(NTT_DoTrade(_npc, 1))
  618. NTT_GambleIt(_npc);
  619.  
  620. me.Cancel(1);
  621. }
  622. else
  623. break;
  624. }
  625. }
  626. }
  627.  
  628. function NTTMGR_VisitJamella(gamble)
  629. {
  630. var _npc;
  631.  
  632. NTTM_TownMove("jamella");
  633.  
  634. _npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_JAMELLA, 5);
  635.  
  636. if(_npc)
  637. {
  638. if(gamble)
  639. {
  640. while(NTC_MyGold() > NTConfig_GambleStopGold)
  641. {
  642. if(NTT_DoInteract(_npc))
  643. {
  644. if(NTT_DoTrade(_npc, 1))
  645. NTT_GambleIt(_npc);
  646.  
  647. me.Cancel(1);
  648. }
  649. else
  650. break;
  651. }
  652. }
  653. else
  654. {
  655. if(NTT_DoInteract(_npc))
  656. {
  657. if(_NTTMGR_DoID || _NTTMGR_BuyPots || _NTTMGR_BuyTP || _NTTMGR_BuyKey)
  658. {
  659. if(NTT_DoTrade(_npc))
  660. {
  661. if(_NTTMGR_BuyPots)
  662. NTT_FillBelt(_npc);
  663. if(_NTTMGR_BuyTP)
  664. NTT_FillTome(_npc, 1);
  665. if(_NTTMGR_BuyKey)
  666. NTT_FillKey(_npc);
  667. if(_NTTMGR_DoID)
  668. NTTMGR_IDItems(_npc);
  669. }
  670. }
  671.  
  672. me.Cancel(1);
  673. }
  674. }
  675. }
  676. }
  677.  
  678. function NTTMGR_VisitHalbu()
  679. {
  680. var _npc;
  681.  
  682. NTTM_TownMove("halbu");
  683.  
  684. _npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_HALBU, 5);
  685.  
  686. if(_npc)
  687. {
  688. if(NTT_DoInteract(_npc))
  689. {
  690. if(_NTTMGR_DoRepair || _NTTMGR_BuyArrows)
  691. {
  692. if(NTT_DoTrade(_npc))
  693. {
  694. if(_NTTMGR_DoRepair)
  695. NTT_RepairItems(_npc);
  696. if(_NTTMGR_BuyArrows)
  697. NTT_FillArrows(_npc);
  698. }
  699. me.Cancel(1);
  700. }
  701. }
  702. }
  703. }
  704.  
  705. function NTTMGR_VisitTyrael()
  706. {
  707. var _npc;
  708.  
  709. NTTM_TownMove("tyrael");
  710.  
  711. _npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_TYRAEL_ACT_4, 5);
  712.  
  713. if(_npc)
  714. {
  715. if(NTT_DoInteract(_npc))
  716. {
  717. NTT_ReviveMerc();
  718. me.Cancel(1);
  719. }
  720. }
  721. }
  722.  
  723. function NTTMGR_VisitMalah()
  724. {
  725. var _npc;
  726.  
  727. NTTM_TownMove("malah");
  728.  
  729. _npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_MALAH, 5);
  730.  
  731. if(_npc)
  732. {
  733. if(NTT_DoInteract(_npc))
  734. {
  735. if(_NTTMGR_DoID || _NTTMGR_BuyPots || _NTTMGR_BuyTP || _NTTMGR_BuyKey)
  736. {
  737. if(NTT_DoTrade(_npc))
  738. {
  739. if(_NTTMGR_BuyPots)
  740. NTT_FillBelt(_npc);
  741. if(_NTTMGR_BuyTP)
  742. NTT_FillTome(_npc, 1);
  743. if(_NTTMGR_BuyKey)
  744. NTT_FillKey(_npc);
  745. if(_NTTMGR_DoID)
  746. NTTMGR_IDItems(_npc);
  747. }
  748. }
  749.  
  750. me.Cancel(1);
  751. }
  752. }
  753. }
  754.  
  755. function NTTMGR_VisitLarzuk()
  756. {
  757. var _npc;
  758.  
  759. NTTM_TownMove("larzuk");
  760.  
  761. _npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_LARZUK, 5);
  762.  
  763. if(_npc)
  764. {
  765. if(NTT_DoInteract(_npc))
  766. {
  767. if(NTT_DoTrade(_npc))
  768. {
  769. if(_NTTMGR_DoRepair || _NTTMGR_BuyArrows)
  770. {
  771. if(_NTTMGR_DoRepair)
  772. NTT_RepairItems(_npc);
  773. if(_NTTMGR_BuyArrows)
  774. NTT_FillArrows(_npc);
  775. }
  776. }
  777.  
  778. me.Cancel(1);
  779. }
  780. }
  781. }
  782. function NTTMGR_VisitQualKehk()
  783. {
  784. var _npc;
  785.  
  786. NTTM_TownMove("qual-kehk");
  787.  
  788. _npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_QUALKEHK, 5);
  789.  
  790. if(_npc)
  791. {
  792. if(NTT_DoInteract(_npc))
  793. {
  794. NTT_ReviveMerc();
  795. me.Cancel(1);
  796. }
  797. }
  798. }
  799.  
  800. function NTTMGR_VisitAnya()
  801. {
  802. var _npc;
  803.  
  804. NTTM_TownMove("anya");
  805.  
  806. _npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_ANYA_TOWN, 5);
  807.  
  808. if(_npc)
  809. {
  810. while(NTC_MyGold() > NTConfig_GambleStopGold)
  811. {
  812. if(NTT_DoInteract(_npc))
  813. {
  814. if(NTT_DoTrade(_npc, 1))
  815. NTT_GambleIt(_npc);
  816.  
  817. me.Cancel(1);
  818. }
  819. else
  820. break;
  821. }
  822. }
  823. }
  824.  
  825. function NTTMGR_CheckScrolls(scrolltype)
  826. {
  827. var _tome = NTT_GetTome(scrolltype);
  828.  
  829. if(_tome)
  830. return _tome.GetStat(70);
  831.  
  832. return 0;
  833. }
  834. function NTTMGR_CheckKeys()
  835. {
  836. var _key;
  837.  
  838. if(me.classid == NTC_CHAR_CLASS_ASSASSIN)
  839. return 12;
  840.  
  841. _key = NTT_GetKey();
  842.  
  843. if(_key)
  844. return _key.GetStat(70);
  845.  
  846. return 0;
  847. }
  848.  
  849. function NTTMGR_CheckAmazonBow()
  850. {
  851. if(me.GetSkill(NTC_HAND_LEFT) == 0 || me.GetSkill(NTC_HAND_RIGHT) == 149 || me.GetSkill(NTC_HAND_RIGHT) == 155)
  852. NTC_SwapWeapons();
  853.  
  854. var _weapon = me.GetItems();
  855.  
  856. if(_weapon)
  857. {
  858. for(var i = 0 ; i < _weapon.length ; i++)
  859. {
  860. if(_weapon[i].classid == 526 || _weapon[i].classid == 528)
  861. {
  862. if(_weapon[i].GetStat(70) <= 350 && _weapon[i].itemloc == 5 && _weapon[i].mode == 1)
  863. {
  864. SetUIState(0x01, true);
  865. NTC_PingDelay(200);
  866. NTC_ItemToCursor(_weapon[i]);
  867. NTC_PingDelay(200);
  868. NTC_ClearCursor();
  869. NTC_PingDelay(200);
  870. me.Cancel(1);
  871. break;
  872. }
  873. }
  874. }
  875. }
  876. }
  877.  
  878. function NTTMGR_IDItems(npc)
  879. {
  880. Include("libs/common/NTItemlogger.ntl");
  881. var _location;
  882.  
  883. var _tome, _scroll;
  884. var _result;
  885. var _items = NTT_GetUnidItems();
  886. var _keys;
  887. var _npckeys;
  888.  
  889. if(!_items || _items.length < 1)
  890. return;
  891.  
  892. _tome = NTT_GetTome();
  893.  
  894. if(_tome && _tome.GetStat(70) < _items.length)
  895. NTT_FillTome(npc);
  896.  
  897. for(var i = 0 ; i < _items.length ; i++)
  898. {
  899.  
  900. var _isEthereal = ((_items[i].itemflag & 0x400000) == 0x400000);
  901. _location = NTC_GetLocation(_NTTMGR_Simple);
  902. switch(NTSI_CheckItem(_items[i]))
  903. {
  904. case 1:
  905. if(_items[i].itemflag & 0x10) {// second half of repeating item log fix
  906. if(NTConfig_LogSoldItems && NTConfig_UseXMLItemlog && _items[i].quality >= NTConfig_LogItemQuality) {
  907. if(NTConfig_IndependantLog) {
  908. NTI_WriteILog(_items[i], me, _isEthereal, 12);
  909. } else {
  910. NTI_WriteLog(_items[i], me, _isEthereal, 12);
  911. }
  912. }
  913. NTC_SendLogToOOG(NTC_LOG_ITEM, COLOR_2 + "Kept: " + NTC_ItemQualityToMGRColor[_items[i].quality] + _items[i].name.split("\n")[0]+ ";" + _items[i].itemdesc + COLOR_2 + "\n iLvl: " + _items[i].itemlevel + COLOR_2 + "\n Area: " + _location);
  914. }
  915. case 2:
  916. break;
  917. case -1:
  918. if(_tome)
  919. _result = NTT_IdItem(_tome, _items[i]);
  920. else
  921. {
  922. _scroll = NTT_GetScroll();
  923.  
  924. if(!_scroll)
  925. {
  926. NTT_BuyScrolls(npc);
  927. _scroll = NTT_GetScroll();
  928. }
  929.  
  930. _result = NTT_IdItem(_scroll, _items[i]);
  931. }
  932.  
  933. if(_result)
  934. {
  935. switch(NTSI_CheckItem(_items[i]))
  936. {
  937. case 1:
  938. if(_items[i].itemflag & 0x10){ // second half of repeating item log fix
  939. if(NTConfig_LogSoldItems && NTConfig_UseXMLItemlog && _items[i].quality >= NTConfig_LogItemQuality) {
  940. if(NTConfig_IndependantLog) {
  941. NTI_WriteILog(_items[i], me, _isEthereal, 12);
  942. } else {
  943. NTI_WriteLog(_items[i], me, _isEthereal, 12);
  944. }
  945. }
  946.  
  947. NTC_SendLogToOOG(NTC_LOG_ITEM, COLOR_2 + "Kept: " + NTC_ItemQualityToMGRColor[_items[i].quality] + _items[i].name.split("\n")[0]+ ";" + _items[i].itemdesc + COLOR_2 + "\n iLvl: " + _items[i].itemlevel + COLOR_2 + "\n Area: " + _location);
  948. }
  949. case 2:
  950. break;
  951. default:
  952. if(NTConfig_LogSoldItems && NTConfig_UseXMLItemlog && _items[i].quality >= NTConfig_LogItemQuality) {
  953. if(NTConfig_IndependantLog) {
  954. NTI_WriteILog(_items[i], me, _isEthereal, 13);
  955. } else {
  956. NTI_WriteLog(_items[i], me, _isEthereal, 13);
  957. }
  958. }
  959.  
  960. if(NTConfig_LogSoldItemQuality != 0 && _items[i].quality >= NTConfig_LogSoldItemQuality) {
  961. NTC_SendLogToOOG(NTC_LOG_ITEM, COLOR_1 +"Sold: " + NTC_ItemQualityToMGRColor[_items[i].quality] + _items[i].name.split("\n")[0]+ ";" + _items[i].itemdesc + COLOR_2 + "\n iLvl: " + _items[i].itemlevel + COLOR_2 + "\n Area: " + _location);
  962. }
  963. NTT_ShopItem(_items[i], npc, 1);
  964. break;
  965. }
  966. }
  967. else
  968. {
  969. if(NTConfig_LogSoldItems && NTConfig_UseXMLItemlog && _items[i].quality >= NTConfig_LogItemQuality) {
  970. if(NTConfig_IndependantLog) {
  971. NTI_WriteILog(_items[i], me, _isEthereal, 13);
  972. } else {
  973. NTI_WriteLog(_items[i], me, _isEthereal, 13);
  974. }
  975. }
  976. if(NTConfig_LogSoldItemQuality != 0 && _items[i].quality >= NTConfig_LogSoldItemQuality) {
  977. NTC_SendLogToOOG(NTC_LOG_ITEM, COLOR_1 + "Sold: " + NTC_ItemQualityToMGRColor[_items[i].quality] + _items[i].name.split("\n")[0]+ ";" + _items[i].itemdesc + COLOR_2 + "\n iLvl: " + _items[i].itemlevel + COLOR_2 + "\n Area: " + _location);
  978. }
  979. NTT_ShopItem(_items[i], npc, 1);
  980. }
  981.  
  982. break;
  983. }
  984. }
  985. if(NTConfig_UseKeysForPlaceHolder || NTConfig_OpenChest || NTConfig_OpenChestsInArea || NTConfig_OpenHallsSuperChests){
  986. _npckeys = npc.GetItems(543);
  987. _keys = me.GetItems(543);
  988. if(_keys.length < 1 && _npckeys.length > 0) {
  989. NTT_ShopItem(_npckeys[0], npc, 2);
  990. }
  991. }
  992. }
  993.  
  994. // mask - 02=Poison. 04=Amplify Damage. 08=Weaken. 10=Iron Maiden, 20=Decrepify. 40=Lower Resist. 80=Blood Mana.
  995. function NTTMGR_CheckCurse(selfmask, mercmask, print)
  996. {
  997. if(arguments.length < 3) { var print = false }
  998. if((selfmask.indexOf("02") != -1) && me.GetState(2)) {
  999. if(print) { Print("I need to cure " + COLOR_1 + "Poison!") }
  1000. return true;
  1001. }
  1002. if((selfmask.indexOf("04") != -1) && me.GetState(9)) {
  1003. if(print) { Print("I need to cure " + COLOR_1 + "Amplify Damage!") }
  1004. return true;
  1005. }
  1006. if((selfmask.indexOf("08") != -1) && me.GetState(19)) {
  1007. if(print) { Print("I need to cure " + COLOR_1 + "Weaken!") }
  1008. return true;
  1009. }
  1010. if((selfmask.indexOf("10") != -1) && me.GetState(55)) {
  1011. if(print) { Print("I need to cure " + COLOR_1 + "Iron Maiden!") }
  1012. return true;
  1013. }
  1014. if((selfmask.indexOf("20") != -1) && me.GetState(60)) {
  1015. if(print) { Print("I need to cure " + COLOR_1 + "Decrepify") }
  1016. return true;
  1017. }
  1018. if((selfmask.indexOf("40") != -1) && me.GetState(61)) {
  1019. if(print) { Print("I need to cure " + COLOR_1 + "Lower Resists!") }
  1020. return true;
  1021. }
  1022. if((selfmask.indexOf("40") != -1) && me.GetState(114)) {
  1023. if(print) { Print("I need to cure " + COLOR_1 + "Blood Mana!") }
  1024. return true;
  1025. }
  1026. var _merc = NTC_GetMerc();
  1027. if(_merc) {
  1028. if((mercmask.indexOf("02") != -1) && _merc.GetState(2)) {
  1029. if(print) { Print("I need to cure " + COLOR_2 + "my Merc's " + COLOR_1 + "Poison!") }
  1030. return true;
  1031. }
  1032. if((mercmask.indexOf("04") != -1) && _merc.GetState(9)) {
  1033. if(print) { Print("I need to cure " + COLOR_2 + "my Merc's " + COLOR_1 + "Amplify Damage!") }
  1034. return true;
  1035. }
  1036. if((mercmask.indexOf("08") != -1) && _merc.GetState(19)) {
  1037. if(print) { Print("I need to cure " + COLOR_2 + "my Merc's " + COLOR_1 + "Weaken!") }
  1038. return true;
  1039. }
  1040. if((mercmask.indexOf("10") != -1) && _merc.GetState(55)) {
  1041. if(print) { Print("I need to cure " + COLOR_2 + "my Merc's " + COLOR_1 + "Iron Maiden!") }
  1042. return true;
  1043. }
  1044. if((mercmask.indexOf("20") != -1) && _merc.GetState(60)) {
  1045. if(print) { Print("I need to cure " + COLOR_2 + "my Merc's " + COLOR_1 + "Decrepify!") }
  1046. return true;
  1047. }
  1048. if((mercmask.indexOf("40") != -1) && _merc.GetState(61)) {
  1049. if(print) { Print("I need to cure " + COLOR_2 + "my Merc's " + COLOR_1 + "Lower Resists!") }
  1050. return true;
  1051. }
  1052. }
  1053. return false;
  1054. }
  1055.  
  1056. // self - 0x01 : Potion
  1057. // merc - 0x01 : Death
  1058. // common - 0x02 : Poison, 0x04 : Amplify Damage, 0x08 : Weaken, 0x10 : Iron Maiden, 0x20 : Decrepify, 0x40 : Lower Resist
  1059. function NTTMGR_CheckSafe(selfmask, mercmask)
  1060. {
  1061. if((mercmask.indexOf("01") != -1) && NTT_CheckMerc()) {
  1062. Print("The Merc is dead!");
  1063. return NTTMGR_VisitTown();
  1064. return true;
  1065. }
  1066. else if((selfmask.indexOf("01") != -1) && NTT_NeedPots()) {
  1067. Print("I need some more potions!");
  1068. return NTTMGR_VisitTown();
  1069. return true;
  1070. }
  1071. else if(NTTMGR_CheckCurse(selfmask, mercmask)) {
  1072. return NTTMGR_VisitTown();
  1073. return true;
  1074. } else {
  1075. return false;
  1076. }
  1077. }
  1078.  
  1079. function NTTMGR_SkipCainAct() {
  1080.  
  1081. //var _presentact = me.act
  1082. if(NTConfig_DontCainAct.indexOf(me.act) > -1)
  1083. return false;
  1084. else
  1085. return true;
  1086. }
  1087.  
  1088. function NTTMGR_CheckUnidsGotStashed()
  1089. {
  1090. var _unidcount = 0;
  1091. var _items = me.GetItems();
  1092.  
  1093. if(!_items)
  1094. return _unidcount;
  1095.  
  1096. for(var i = 0 ; i < _items.length ; i++)
  1097. {
  1098. if(_items[i].mode == 0 && _items[i].itemloc == 0 && !(_items[i].itemflag&0x10))
  1099.  
  1100. var _value = NTSI_CheckItem(_items[i]);
  1101.  
  1102. if(_value == 1)
  1103. _unidcount++;
  1104. }
  1105. return _unidcount;
  1106. }
  1107.  
  1108. function NTTMGR_VisitCain(check){
  1109.  
  1110. var _location;//edit for PickIt Location by Jinnay
  1111. var _npc;
  1112. var _items = me.GetItems();
  1113. var _uniditems = new Array();
  1114. var _dropitems = new Array();
  1115. var _itemlist = new Array();
  1116.  
  1117. for(var i = 0 ; i < _items.length ; i++){
  1118.  
  1119. if(_items[i].mode == 0 && _items[i].itemloc == 0 && !(_items[i].itemflag&0x10)){
  1120.  
  1121. var _value = NTSI_CheckItem(_items[i]);
  1122. var _isEthereal = ((_items[i].itemflag & 0x400000) == 0x400000);
  1123.  
  1124. if(_value == 1){// checking for unid kept items here and stash it before we go to cain
  1125. if(_items[i].quality >= 4 && _items[i].itemtype != 4 && (_items[i].itemtype < 76 || _items[i].itemtype > 81)){
  1126. NTTM_TownMove("stash");
  1127. var _stash = NTC_FindUnit(NTC_UNIT_OBJECT, NTC_UNIT_STASH, 5);
  1128. if(_stash){
  1129. if(NTT_DoInteract(_stash)){
  1130. NTTM_StashGold(); // stashgold every time
  1131. NTT_ManageStash(_items[i]);
  1132. }
  1133. }
  1134. }
  1135.  
  1136. //_cubing = (!check && (NTCU_CheckCubing() || NTRW_CheckRunewords()));
  1137.  
  1138. //if(_cubing || NTT_CheckInventory()){
  1139. if(NTT_CheckInventory()){
  1140. //if(NTConfig_MakeRunewords)
  1141. //NTRW_MakeRuneword();
  1142. //NTT_ManageStash();
  1143. //NTCU_DoCubing();
  1144. if(NTT_DoInteract(_stash)){
  1145. NTTM_StashGold(); // stashgold every time
  1146. NTT_ManageStash();
  1147. }
  1148. me.Cancel(1);
  1149. //NTT_ClearInventory();
  1150. }
  1151. me.Cancel(1);
  1152. }
  1153. else // else push it into the to be id'd array
  1154. _uniditems.push(_items[i]);
  1155. }
  1156. }
  1157.  
  1158. if(NTTMGR_CheckUnidsGotStashed() > 0 && !NTConfig_AlwaysUseCain){ // if we have something to be kept unid and it won't fit in stash, and not always use cain, abort and do normal id function
  1159. Print(COLOR_1 + "That is not suppose to get identified...skipping cain.....");
  1160. return;
  1161. }
  1162.  
  1163. if(_uniditems.length > 0){ // if we have something to be id still, go to cain and id
  1164.  
  1165. NTTM_TownMove("cain");
  1166. _npc = NTC_FindUnit(NTC_UNIT_NPC, GetLocaleString(2890), 5);
  1167.  
  1168. if(!_npc)
  1169. return false;
  1170.  
  1171. if(_npc){
  1172. NTM_MoveTo(me.areaid, _npc.x, _npc.y);
  1173. if(NTT_DoInteract(_npc)){
  1174. for(var i = 0 ; i < 4 ; i++){
  1175. if((i % 4) == 0)
  1176. me.SelectNPCMenu(0x0FB4);
  1177. NTC_Delay(250);
  1178. }
  1179. me.Cancel(1);
  1180. }
  1181.  
  1182. }
  1183.  
  1184. for(var i =0 ; i < _uniditems.length ; i++){ // now we check if the items, now id, are to be kept or sold and push them into the appropriate array
  1185.  
  1186. switch(NTSI_CheckItem(_uniditems[i])){
  1187. case 1:
  1188. _itemlist.push(_uniditems[i]);
  1189. break;
  1190. case 2:
  1191. break;
  1192. case 0:
  1193. _dropitems.push(_uniditems[i]);
  1194. break;
  1195. }
  1196. }
  1197. }
  1198.  
  1199. //_cubing = (!check && (NTCU_CheckCubing() || NTRW_CheckRunewords()));
  1200.  
  1201. //if(NTTM_CheckToStash() || _cubing){ // check to see if there is anything to stash and if there is stash them
  1202. if(NTTM_CheckToStash()){ // check to see if there is anything to stash and if there is stash them
  1203. NTTM_TownMove("stash");
  1204. var _stash = NTC_FindUnit(NTC_UNIT_OBJECT, NTC_UNIT_STASH, 5);
  1205.  
  1206. if(_stash){
  1207. NTT_DoInteract(_stash);
  1208. NTTM_StashGold(); // stashgold every time
  1209. }
  1210.  
  1211. if(_itemlist.length > 0){
  1212. for(var i = 0; i < _itemlist.length; i++){ // this puts items into stash and logs them
  1213. if(_itemlist[i].quality >= 4){
  1214. _location = NTC_GetLocation(_NTTMGR_Simple);
  1215. if(NTConfig_UseXMLItemlog) {
  1216. if(NTConfig_IndependantLog) {
  1217. NTI_WriteILog(_itemlist[i], me, _isEthereal, 12);
  1218. }
  1219. else {
  1220. NTI_WriteLog(_itemlist[i], me, _isEthereal, 12);
  1221. }
  1222. }
  1223. NTC_SendLogToOOG(NTC_LOG_ITEM, COLOR_2 + "Kept: " + NTC_ItemQualityToMGRColor[_itemlist[i].quality] + _itemlist[i].name.split("\n")[0]+ ";" + _itemlist[i].itemdesc + COLOR_2 + "\n iLvl: " + _itemlist[i].itemlevel + COLOR_2 + "\n Area: " + _location);
  1224. }
  1225. NTT_ManageStash(_itemlist[i])
  1226. }
  1227. }
  1228.  
  1229. if(NTT_CheckInventory())
  1230. NTT_ManageStash();
  1231.  
  1232. /*if(_cubing){// probably take out the inventory check...but maybe just leave it there
  1233.  
  1234. if(NTConfig_MakeRunewords)
  1235. NTRW_MakeRuneword();
  1236.  
  1237. NTT_ManageStash();
  1238. NTCU_DoCubing();
  1239.  
  1240. if(NTT_DoInteract(_stash)){// might be able to take this out also
  1241. NTTM_StashGold(); // stashgold every time
  1242. NTT_ManageStash();
  1243. }
  1244. me.Cancel(1);
  1245. }*/
  1246. me.Cancel(1);
  1247. }
  1248.  
  1249. if((_dropitems.length > 0 && !NTConfig_DropCainItems) || (_dropitems.length > 0 && NTC_MyGold() <= NTConfig_PocketChange)){ // this will sell instead of dropping items
  1250. switch(me.act){
  1251.  
  1252. case 1: // sell to akara
  1253. var _npc;
  1254.  
  1255. NTTM_TownMove("akara");
  1256. _npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_AKARA, 5);
  1257.  
  1258. if(_npc){
  1259. if(NTT_DoInteract(_npc)){
  1260. NTT_DoTrade(_npc, 1)
  1261. for(var i = 0; i < _dropitems.length; i++){
  1262. _location = NTC_GetLocation(_NTTMGR_Simple);
  1263. if(NTConfig_LogSoldItems && NTConfig_UseXMLItemlog && _dropitems[i].quality >= NTConfig_LogItemQuality) {
  1264. if(NTConfig_IndependantLog) {
  1265. NTI_WriteILog(_dropitems[i], me, _isEthereal, 13);
  1266. }
  1267. else {
  1268. NTI_WriteLog(_dropitems[i], me, _isEthereal, 13);
  1269. }
  1270. }
  1271. if(NTConfig_LogSoldItemQuality != 0 && _dropitems[i].quality >= NTConfig_LogSoldItemQuality){
  1272. NTC_SendLogToOOG(NTC_LOG_ITEM, COLOR_1 + "Sold: " + NTC_ItemQualityToMGRColor[_dropitems[i].quality] + _dropitems[i].name.split("\n")[0]+ ";" + _dropitems[i].itemdesc + COLOR_2 + "\n iLvl: " + _dropitems[i].itemlevel + COLOR_2 + "\n Area: " + _location);
  1273. }
  1274. NTT_ShopItem(_dropitems[i], _npc, 1);
  1275. }
  1276. if(_NTTMGR_BuyPots || _NTTMGR_BuyTP){
  1277. if(_NTTMGR_BuyPots)
  1278. NTT_FillBelt(_npc);
  1279. if(_NTTMGR_BuyTP)
  1280. NTT_FillTome(_npc, 1);
  1281. }
  1282. me.Cancel(1);
  1283. }
  1284. }
  1285. break;
  1286.  
  1287. case 2: //sell to farah or drognan
  1288. var _npc;
  1289. var _buy = false;
  1290.  
  1291. if(_NTTMGR_DoHeal || _NTTMGR_RemoveCurse || _NTTMGR_DoRepair || _NTTMGR_BuyArrows){
  1292. NTTM_TownMove("fara");
  1293. _npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_FARA, 5);
  1294. }
  1295. else if((_NTTMGR_BuyPots || _NTTMGR_BuyTP)){
  1296. NTTM_TownMove("drognan");
  1297. _npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_DROGNAN, 5);
  1298. _buy = true;
  1299. }
  1300. else
  1301. {
  1302. NTTM_TownMove("fara");
  1303. _npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_FARA, 5);
  1304. }
  1305. if(_npc){
  1306. if(NTT_DoInteract(_npc)){
  1307. NTT_DoTrade(_npc, 1)
  1308. for(var i = 0; i < _dropitems.length; i++){ // going to sell here
  1309. _location = NTC_GetLocation(_NTTMGR_Simple);
  1310.  
  1311. if(NTConfig_LogSoldItems && NTConfig_UseXMLItemlog && _dropitems[i].quality >= NTConfig_LogItemQuality) {
  1312. if(NTConfig_IndependantLog) {
  1313. NTI_WriteILog(_dropitems[i], me, _isEthereal, 13);
  1314. }
  1315. else {
  1316. NTI_WriteLog(_dropitems[i], me, _isEthereal, 13);
  1317. }
  1318. }
  1319. if(NTConfig_LogSoldItemQuality != 0 && _dropitems[i].quality >= NTConfig_LogSoldItemQuality){
  1320. NTC_SendLogToOOG(NTC_LOG_ITEM, COLOR_1 + "Sold: " + NTC_ItemQualityToMGRColor[_dropitems[i].quality] + _dropitems[i].name.split("\n")[0]+ ";" + _dropitems[i].itemdesc + COLOR_2 + "\n iLvl: " + _dropitems[i].itemlevel + COLOR_2 + "\n Area: " + _location);
  1321. }
  1322. NTT_ShopItem(_dropitems[i], _npc, 1);
  1323. }
  1324. if(_buy && (_NTTMGR_DoID || _NTTMGR_BuyPots || _NTTMGR_BuyTP || _NTTMGR_BuyKey)){
  1325. if(_NTTMGR_BuyPots)
  1326. NTT_FillBelt(_npc);
  1327. if(_NTTMGR_BuyTP)
  1328. NTT_FillTome(_npc, 1);
  1329. }
  1330. me.Cancel(1);
  1331. }
  1332. }
  1333. break;
  1334.  
  1335. case 3: // sell to ormus
  1336. var _npc;
  1337.  
  1338. NTTM_TownMove("ormus");
  1339. _npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_ORMUS, 5);
  1340.  
  1341. if(_npc){
  1342. if(NTT_DoInteract(_npc)){
  1343. NTT_DoTrade(_npc, 1)
  1344. for(var i = 0; i < _dropitems.length; i++){
  1345. _location = NTC_GetLocation(_NTTMGR_Simple);
  1346. if(NTConfig_LogSoldItems && NTConfig_UseXMLItemlog && _dropitems[i].quality >= NTConfig_LogItemQuality) {
  1347. if(NTConfig_IndependantLog) {
  1348. NTI_WriteILog(_dropitems[i], me, _isEthereal, 13);
  1349. }
  1350. else {
  1351. NTI_WriteLog(_dropitems[i], me, _isEthereal, 13);
  1352. }
  1353. }
  1354. if(NTConfig_LogSoldItemQuality != 0 && _dropitems[i].quality >= NTConfig_LogSoldItemQuality){
  1355. NTC_SendLogToOOG(NTC_LOG_ITEM, COLOR_1 + "Sold: " + NTC_ItemQualityToMGRColor[_dropitems[i].quality] + _dropitems[i].name.split("\n")[0]+ ";" + _dropitems[i].itemdesc + COLOR_2 + "\n iLvl: " + _dropitems[i].itemlevel + COLOR_2 + "\n Area: " + _location);
  1356. }
  1357. NTT_ShopItem(_dropitems[i], _npc, 1);
  1358. }
  1359. if(_NTTMGR_BuyPots || _NTTMGR_BuyTP){
  1360. if(_NTTMGR_BuyPots)
  1361. NTT_FillBelt(_npc);
  1362. if(_NTTMGR_BuyTP)
  1363. NTT_FillTome(_npc, 1);
  1364. }
  1365. me.Cancel(1);
  1366. }
  1367. }
  1368. break;
  1369.  
  1370. case 4:
  1371. var _npc;
  1372.  
  1373. NTTM_TownMove("jamella");
  1374. _npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_JAMELLA, 5);
  1375.  
  1376. if(_npc){
  1377. if(NTT_DoInteract(_npc)) {
  1378. NTT_DoTrade(_npc)
  1379. for(var i = 0; i < _dropitems.length; i++) {
  1380. _location = NTC_GetLocation(_NTTMGR_Simple);
  1381.  
  1382. if(NTConfig_LogSoldItems && NTConfig_UseXMLItemlog && _dropitems[i].quality >= NTConfig_LogItemQuality) {
  1383. if(NTConfig_IndependantLog) {
  1384. NTI_WriteILog(_dropitems[i], me, _isEthereal, 13);
  1385. }
  1386. else {
  1387. NTI_WriteLog(_dropitems[i], me, _isEthereal, 13);
  1388. }
  1389. }
  1390. if(NTConfig_LogSoldItemQuality != 0 && _dropitems[i].quality >= NTConfig_LogSoldItemQuality) {
  1391. NTC_SendLogToOOG(NTC_LOG_ITEM, COLOR_1 + "Sold: " + NTC_ItemQualityToMGRColor[_dropitems[i].quality] + _dropitems[i].name.split("\n")[0]+ ";" + _dropitems[i].itemdesc + COLOR_2 + "\n iLvl: " + _dropitems[i].itemlevel + COLOR_2 + "\n Area: " + _location);
  1392. }
  1393.  
  1394. NTT_ShopItem(_dropitems[i], _npc, 1);
  1395. }
  1396. if(_NTTMGR_BuyPots || _NTTMGR_BuyTP || _NTTMGR_BuyKey) {
  1397. if(_NTTMGR_BuyPots)
  1398. NTT_FillBelt(_npc);
  1399. if(_NTTMGR_BuyTP)
  1400. NTT_FillTome(_npc, 1);
  1401. if(_NTTMGR_BuyKey)
  1402. NTT_FillKey(_npc);
  1403. }
  1404. me.Cancel(1);
  1405. }
  1406. }
  1407. break;
  1408.  
  1409. case 5: // sell to malah
  1410. var _npc;
  1411.  
  1412. NTTM_TownMove("malah");
  1413. _npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_MALAH, 5);
  1414.  
  1415. if(_npc){
  1416. if(NTT_DoInteract(_npc)){
  1417. NTT_DoTrade(_npc, 1)
  1418. for(var i = 0; i < _dropitems.length; i++) {
  1419.  
  1420. _location = NTC_GetLocation(_NTTMGR_Simple);
  1421.  
  1422. if(NTConfig_LogSoldItems && NTConfig_UseXMLItemlog && _dropitems[i].quality >= NTConfig_LogItemQuality) {
  1423. if(NTConfig_IndependantLog) {
  1424. NTI_WriteILog(_dropitems[i], me, _isEthereal, 13);
  1425. }
  1426. else {
  1427. NTI_WriteLog(_dropitems[i], me, _isEthereal, 13);
  1428. }
  1429. }
  1430. if(NTConfig_LogSoldItemQuality != 0 && _dropitems[i].quality >= NTConfig_LogSoldItemQuality) {
  1431. NTC_SendLogToOOG(NTC_LOG_ITEM, COLOR_1 + "Sold: " + NTC_ItemQualityToMGRColor[_dropitems[i].quality] + _dropitems[i].name.split("\n")[0]+ ";" + _dropitems[i].itemdesc + COLOR_2 + "\n iLvl: " + _dropitems[i].itemlevel + COLOR_2 + "\n Area: " + _location);
  1432. }
  1433. NTT_ShopItem(_dropitems[i], _npc, 1);
  1434. }
  1435. if(_NTTMGR_BuyTP || _NTTMGR_BuyKey || _NTTMGR_BuyPots) {
  1436. if(_NTTMGR_BuyPots)
  1437. NTT_FillBelt(_npc);
  1438. if(_NTTMGR_BuyTP)
  1439. NTT_FillTome(_npc, 1);
  1440. if(_NTTMGR_BuyKey)
  1441. NTT_FillKey(_npc);
  1442. }
  1443. me.Cancel(1);
  1444. }
  1445. }
  1446. break;
  1447. }
  1448. }
  1449. else if(_dropitems.length > 0 && NTConfig_DropCainItems){ // defualt value will just drop
  1450. SetUIState(0x01, true);
  1451. for(var i = 0; i < _dropitems.length; i++){
  1452. _location = NTC_GetLocation(_NTTMGR_Simple);
  1453.  
  1454. if (NTConfig_LogIgnoredItems && _dropitems[i].quality >= NTConfig_LogItemQuality && NTConfig_UseXMLItemlog) {
  1455. if(NTConfig_IndependantLog) {
  1456. NTI_WriteILog(_dropitems[i], me, _isEthereal, 14);
  1457. }
  1458. else {
  1459. NTI_WriteLog(_dropitems[i], me, _isEthereal, 14);
  1460. }
  1461. }
  1462. if(NTConfig_LogSoldItemQuality != 0 && _dropitems[i].quality >= NTConfig_LogSoldItemQuality) {
  1463. NTC_SendLogToOOG(NTC_LOG_ITEM, COLOR_1 + "Dropped: " + NTC_ItemQualityToMGRColor[_dropitems[i].quality] + _dropitems[i].name.split("\n")[0]+ ";" + _dropitems[i].itemdesc + COLOR_2 + "\n iLvl: " + _dropitems[i].itemlevel + COLOR_2 + "\n Area: " + _location);
  1464. }
  1465.  
  1466. NTT_DropItem(_dropitems[i])
  1467. }
  1468. }
  1469. if(GetUIState(0x01))
  1470. me.Cancel(1);
  1471.  
  1472. NTT_ClearInventory();
  1473. return;
  1474. }
  1475.  
  1476. function NTTM_StashGold(){
  1477. if(!NTC_StashGoldFull() && NTC_MyGoldCarry() > 0){
  1478. var _mygold = NTC_MyGoldCarry();
  1479. Gold(3, _mygold);
  1480. for(i = 0 ; i < 2 ; i++){
  1481. NTC_Delay(500);
  1482. if(_mygold > NTC_MyGoldCarry())
  1483. break;
  1484. }
  1485. }
  1486. }
  1487.  
  1488. function NTTM_CheckToStash(){
  1489. _checkItems = me.GetItems();
  1490. if(!_checkItems)
  1491. return false;
  1492. for(var i = 0 ; i < _checkItems.length ; i++){
  1493. if(_checkItems[i].mode == 0 && _checkItems[i].itemloc == 0 && NTConfig_Columns[_checkItems[i].y][_checkItems[i].x] > 0
  1494. && NTSI_CheckItem(_checkItems[i]))
  1495. return true;
  1496. }
  1497. return false;
  1498. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement