Guest User

Untitled

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