Guest User

Untitled

a guest
Jul 16th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.65 KB | None | 0 0
  1. const NTCU_GEM = 0;
  2.  
  3. const NTCU_MAGIC = 1;
  4. const NTCU_MAGIC_CHARM = 2;
  5.  
  6. const NTCU_CRAFT_HITPOWER_HELM = 10;
  7. const NTCU_CRAFT_HITPOWER_BOOTS = 11;
  8. const NTCU_CRAFT_HITPOWER_GLOVES = 12;
  9. const NTCU_CRAFT_HITPOWER_BELT = 13;
  10. const NTCU_CRAFT_HITPOWER_SHIELD = 14;
  11. const NTCU_CRAFT_HITPOWER_BODY = 15;
  12. const NTCU_CRAFT_HITPOWER_AMULET = 16;
  13. const NTCU_CRAFT_HITPOWER_RING = 17;
  14. const NTCU_CRAFT_HITPOWER_WEAPON = 18;
  15.  
  16. const NTCU_CRAFT_BLOOD_HELM = 19;
  17. const NTCU_CRAFT_BLOOD_BOOTS = 20;
  18. const NTCU_CRAFT_BLOOD_GLOVES = 21;
  19. const NTCU_CRAFT_BLOOD_BELT = 22;
  20. const NTCU_CRAFT_BLOOD_SHIELD = 23;
  21. const NTCU_CRAFT_BLOOD_BODY = 24;
  22. const NTCU_CRAFT_BLOOD_AMULET = 25;
  23. const NTCU_CRAFT_BLOOD_RING = 26;
  24. const NTCU_CRAFT_BLOOD_WEAPON = 27;
  25.  
  26. const NTCU_CRAFT_CASTER_HELM = 28;
  27. const NTCU_CRAFT_CASTER_BOOTS = 29;
  28. const NTCU_CRAFT_CASTER_GLOVES = 30;
  29. const NTCU_CRAFT_CASTER_BELT = 31;
  30. const NTCU_CRAFT_CASTER_SHIELD = 32;
  31. const NTCU_CRAFT_CASTER_BODY = 33;
  32. const NTCU_CRAFT_CASTER_AMULET = 34;
  33. const NTCU_CRAFT_CASTER_RING = 35;
  34. const NTCU_CRAFT_CASTER_WEAPON = 36;
  35.  
  36. const NTCU_CRAFT_SAFETY_HELM = 37;
  37. const NTCU_CRAFT_SAFETY_BOOTS = 38;
  38. const NTCU_CRAFT_SAFETY_GLOVES = 39;
  39. const NTCU_CRAFT_SAFETY_BELT = 40;
  40. const NTCU_CRAFT_SAFETY_SHIELD = 41;
  41. const NTCU_CRAFT_SAFETY_BODY = 42;
  42. const NTCU_CRAFT_SAFETY_AMULET = 43;
  43. const NTCU_CRAFT_SAFETY_RING = 44;
  44. const NTCU_CRAFT_SAFETY_WEAPON = 45;
  45.  
  46. const NTCU_SOCKET_BODYARMOR = 50;
  47. const NTCU_SOCKET_WEAPON = 51;
  48. const NTCU_SOCKET_HELM = 52;
  49. const NTCU_SOCKET_SHIELD = 53;
  50.  
  51. const NTCU_UPGRADE_N_UNIQUE_WEAPON = 60;
  52. const NTCU_UPGRADE_N_UNIQUE_ARMOR = 61;
  53. const NTCU_UPGRADE_E_UNIQUE_WEAPON = 62;
  54. const NTCU_UPGRADE_E_UNIQUE_ARMOR = 63;
  55.  
  56. const NTCU_UPGRADE_N_RARE_WEAPON = 64;
  57. const NTCU_UPGRADE_N_RARE_ARMOR = 65;
  58. const NTCU_UPGRADE_E_RARE_WEAPON = 66;
  59. const NTCU_UPGRADE_E_RARE_ARMOR = 67;
  60.  
  61. const NTCU_ESSENSE = 70;
  62.  
  63. const NTCU_RUNE_EL = 610;
  64. const NTCU_RUNE_ELD = 611;
  65. const NTCU_RUNE_TIR = 612;
  66. const NTCU_RUNE_NEF = 613;
  67. const NTCU_RUNE_ETH = 614;
  68. const NTCU_RUNE_ITH = 615;
  69. const NTCU_RUNE_TAL = 616;
  70. const NTCU_RUNE_RAL = 617;
  71. const NTCU_RUNE_ORT = 618;
  72. const NTCU_RUNE_THUL = 619;
  73. const NTCU_RUNE_AMN = 620;
  74. const NTCU_RUNE_SOL = 621;
  75. const NTCU_RUNE_SHAEL = 622;
  76. const NTCU_RUNE_DOL = 623;
  77. const NTCU_RUNE_HEL = 624;
  78. const NTCU_RUNE_IO = 625;
  79. const NTCU_RUNE_LUM = 626;
  80. const NTCU_RUNE_KO = 627;
  81. const NTCU_RUNE_FAL = 628;
  82. const NTCU_RUNE_LEM = 629;
  83. const NTCU_RUNE_PUL = 630;
  84. const NTCU_RUNE_UM = 631;
  85. const NTCU_RUNE_MAL = 632;
  86. const NTCU_RUNE_IST = 633;
  87. const NTCU_RUNE_GUL = 634;
  88. const NTCU_RUNE_VEX = 635;
  89. const NTCU_RUNE_OHM = 636;
  90. const NTCU_RUNE_LO = 637;
  91. const NTCU_RUNE_SUR = 638;
  92. const NTCU_RUNE_BER = 639;
  93. const NTCU_RUNE_JAH = 640;
  94. const NTCU_RUNE_CHAM = 641;
  95.  
  96. var _NTCU_CraftRecipe = new Array();
  97. _NTCU_CraftRecipe.push([84, 615, 571]);
  98. _NTCU_CraftRecipe.push([85, 617, 571]);
  99. _NTCU_CraftRecipe.push([79, 618, 571]);
  100. _NTCU_CraftRecipe.push([85, 616, 571]);
  101. _NTCU_CraftRecipe.push([82, 614, 571]);
  102. _NTCU_CraftRecipe.push([85, 613, 571]);
  103. _NTCU_CraftRecipe.push([90, 619, 571]);
  104. _NTCU_CraftRecipe.push([86, 620, 571]);
  105. _NTCU_CraftRecipe.push([85, 612, 571]);
  106.  
  107. _NTCU_CraftRecipe.push([84, 617, 581]);
  108. _NTCU_CraftRecipe.push([85, 614, 581]);
  109. _NTCU_CraftRecipe.push([79, 613, 581]);
  110. _NTCU_CraftRecipe.push([85, 616, 581]);
  111. _NTCU_CraftRecipe.push([82, 615, 581]);
  112. _NTCU_CraftRecipe.push([85, 619, 581]);
  113. _NTCU_CraftRecipe.push([90, 620, 581]);
  114. _NTCU_CraftRecipe.push([86, 621, 581]);
  115. _NTCU_CraftRecipe.push([85, 618, 581]);
  116.  
  117. _NTCU_CraftRecipe.push([84, 613, 561]);
  118. _NTCU_CraftRecipe.push([85, 619, 561]);
  119. _NTCU_CraftRecipe.push([79, 618, 561]);
  120. _NTCU_CraftRecipe.push([85, 615, 561]);
  121. _NTCU_CraftRecipe.push([82, 614, 561]);
  122. _NTCU_CraftRecipe.push([85, 616, 561]);
  123. _NTCU_CraftRecipe.push([92, 617, 561]);
  124. _NTCU_CraftRecipe.push([86, 620, 561]);
  125. _NTCU_CraftRecipe.push([85, 612, 561]);
  126.  
  127. _NTCU_CraftRecipe.push([84, 615, 576]);
  128. _NTCU_CraftRecipe.push([85, 618, 576]);
  129. _NTCU_CraftRecipe.push([79, 617, 576]);
  130. _NTCU_CraftRecipe.push([85, 616, 576]);
  131. _NTCU_CraftRecipe.push([82, 613, 576]);
  132. _NTCU_CraftRecipe.push([85, 614, 576]);
  133. _NTCU_CraftRecipe.push([90, 619, 576]);
  134. _NTCU_CraftRecipe.push([86, 620, 576]);
  135. _NTCU_CraftRecipe.push([85, 621, 576]);
  136.  
  137. var _NTCU_SocketRecipe = new Array();
  138. _NTCU_SocketRecipe.push([616, 619, 566]);
  139. _NTCU_SocketRecipe.push([617, 620, 561]);
  140. _NTCU_SocketRecipe.push([617, 619, 571]);
  141. _NTCU_SocketRecipe.push([616, 620, 581]);
  142.  
  143. var _NTCU_UpgradeRecipe = new Array();
  144. _NTCU_UpgradeRecipe.push([7, 617, 621, 576]);
  145. _NTCU_UpgradeRecipe.push([7, 616, 622, 586]);
  146. _NTCU_UpgradeRecipe.push([7, 626, 630, 576]);
  147. _NTCU_UpgradeRecipe.push([7, 627, 629, 586]);
  148.  
  149. _NTCU_UpgradeRecipe.push([6, 618, 620, 571]);
  150. _NTCU_UpgradeRecipe.push([6, 617, 619, 561]);
  151. _NTCU_UpgradeRecipe.push([6, 628, 631, 571]);
  152. _NTCU_UpgradeRecipe.push([6, 627, 630, 561]);
  153.  
  154. var _NTCU_Inventory = new Array(4);
  155. _NTCU_Inventory[0] = new Array(10);
  156. _NTCU_Inventory[1] = new Array(10);
  157. _NTCU_Inventory[2] = new Array(10);
  158. _NTCU_Inventory[3] = new Array(10);
  159.  
  160. var _NTCU_LogString;
  161.  
  162. function NTCU_CheckItem(item, result)
  163. {
  164. var i, n, _index;
  165. var _classid, _gid, _calclevel;
  166. var _result = false;
  167. var _isEthereal = ((item.itemflag & 0x400000) == 0x400000);
  168.  
  169. if(!NTConfig_Cubing)
  170. return false;
  171.  
  172. _classid = item.classid;
  173. _gid = item.gid;
  174. _calclevel = parseInt(me.GetStat(12)/2) + parseInt(item.itemlevel/2);
  175.  
  176. for(i = 0 ; i < NTConfig_CubingItem.length ; i++)
  177. {
  178. if(NTConfig_CubingItem[i][0] == NTCU_GEM)
  179. {
  180. if(_classid == NTConfig_CubingItem[i][1])
  181. {
  182. for(n = 0 ; n < 3 ; n++)
  183. {
  184. if(NTConfig_CubingItem[i][2+n] == null)
  185. {
  186. NTConfig_CubingItem[i][2+n] = _gid;
  187. break;
  188. }
  189. else if(NTConfig_CubingItem[i][2+n] == _gid)
  190. break;
  191. }
  192.  
  193. _result = true;
  194. }
  195. }
  196. else if(NTConfig_CubingItem[i][0] == NTCU_MAGIC || NTConfig_CubingItem[i][0] == NTCU_MAGIC_CHARM)
  197. {
  198. if(_classid == NTConfig_CubingItem[i][1])
  199. {
  200. if(result == 0 && item.quality == 4)
  201. {
  202. if(NTConfig_CubingItem[i][0] == NTCU_MAGIC_CHARM)
  203. {
  204. if(item.itemlevel >= 95)
  205. {
  206. if(NTConfig_CubingItem[i][2] == null)
  207. {
  208. NTConfig_CubingItem[i][2] = _gid;
  209. _result = true;
  210. }
  211. else if(NTConfig_CubingItem[i][2] == _gid)
  212. _result = true;
  213. }
  214. }
  215. //Begin Jav code
  216. else if( NTConfig_CubingItem[i][1] == 285 ) // maiden javelin
  217. {
  218. if(item.itemlevel >= 71 && item.itemlevel <= 75)
  219. {
  220. if(NTConfig_CubingItem[i][2] == null)
  221. {
  222. NTConfig_CubingItem[i][2] = _gid;
  223. _result = true;
  224. }
  225. else if(NTConfig_CubingItem[i][2] == _gid)
  226. _result = true;
  227. }
  228. }
  229. else if( NTConfig_CubingItem[i][1] == 295 ) // ceremonial javelin
  230. {
  231. if(item.itemlevel >= 77 && item.itemlevel <= 81)
  232. {
  233. if(NTConfig_CubingItem[i][2] == null)
  234. {
  235. NTConfig_CubingItem[i][2] = _gid;
  236. _result = true;
  237. }
  238. else if(NTConfig_CubingItem[i][2] == _gid)
  239. _result = true;
  240. }
  241. }
  242. else if( NTConfig_CubingItem[i][1] == 305 ) // maiden javelin
  243. {
  244. if(item.itemlevel >= 80 && item.itemlevel <= 84)
  245. {
  246. if(NTConfig_CubingItem[i][2] == null)
  247. {
  248. NTConfig_CubingItem[i][2] = _gid;
  249. _result = true;
  250. }
  251. else if(NTConfig_CubingItem[i][2] == _gid)
  252. _result = true;
  253. }
  254. }
  255. // End Jav Code
  256. else
  257. {
  258. if(item.itemlevel >= 85)
  259. {
  260. if(NTConfig_CubingItem[i][2] == null)
  261. {
  262. NTConfig_CubingItem[i][2] = _gid;
  263. _result = true;
  264. }
  265. else if(NTConfig_CubingItem[i][2] == _gid)
  266. _result = true;
  267. }
  268. }
  269. }
  270. }
  271. else if(_classid == 566 || _classid == 586 || _classid == 601)
  272. {
  273. if(NTConfig_CubingItem[i][2] != null)
  274. {
  275. for(n = 0 ; n < 3 ; n++)
  276. {
  277. if(NTConfig_CubingItem[i][3+n] == null)
  278. {
  279. NTConfig_CubingItem[i][3+n] = _gid;
  280. break;
  281. }
  282. else if(NTConfig_CubingItem[i][3+n] == _gid)
  283. break;
  284. }
  285.  
  286. _result = true;
  287. }
  288. }
  289. else if(_classid == 565)
  290. {
  291. if(NTConfig_CubingItem[i][2] != null)
  292. {
  293. for(n = 0 ; n < 3 ; n++)
  294. {
  295. if(NTConfig_CubingItem[i][6+n] == null)
  296. {
  297. NTConfig_CubingItem[i][6+n] = _gid;
  298. break;
  299. }
  300. else if(NTConfig_CubingItem[i][6+n] == _gid)
  301. break;
  302. }
  303.  
  304. _result = true;
  305. }
  306. }
  307. else if(_classid == 585)
  308. {
  309. if(NTConfig_CubingItem[i][2] != null)
  310. {
  311. for(n = 0 ; n < 3 ; n++)
  312. {
  313. if(NTConfig_CubingItem[i][9+n] == null)
  314. {
  315. NTConfig_CubingItem[i][9+n] = _gid;
  316. break;
  317. }
  318. else if(NTConfig_CubingItem[i][9+n] == _gid)
  319. break;
  320. }
  321.  
  322. _result = true;
  323. }
  324. }
  325. else if(_classid == 600)
  326. {
  327. if(NTConfig_CubingItem[i][2] != null)
  328. {
  329. for(n = 0 ; n < 3 ; n++)
  330. {
  331. if(NTConfig_CubingItem[i][12+n] == null)
  332. {
  333. NTConfig_CubingItem[i][12+n] = _gid;
  334. break;
  335. }
  336. else if(NTConfig_CubingItem[i][12+n] == _gid)
  337. break;
  338. }
  339.  
  340. _result = true;
  341. }
  342. }
  343. }
  344. else if(NTConfig_CubingItem[i][0] >= NTCU_CRAFT_HITPOWER_HELM && NTConfig_CubingItem[i][0] <= NTCU_CRAFT_SAFETY_WEAPON)
  345. {
  346. _index = NTConfig_CubingItem[i][0] - NTCU_CRAFT_HITPOWER_HELM;
  347.  
  348. if(_classid == NTConfig_CubingItem[i][1])
  349. {
  350. if(result == 0 && item.quality == 4 && _calclevel >= _NTCU_CraftRecipe[_index][0])
  351. {
  352. if(NTConfig_CubingItem[i][2] == null)
  353. {
  354. NTConfig_CubingItem[i][2] = _gid;
  355. _result = true;
  356. }
  357. else if(NTConfig_CubingItem[i][2] == _gid)
  358. _result = true;
  359. }
  360. }
  361. else if(_classid == 643)
  362. {
  363. if(result == 0 && NTConfig_CubingItem[i][2] != null)
  364. {
  365. if(NTConfig_CubingItem[i][3] == null)
  366. {
  367. NTConfig_CubingItem[i][3] = _gid;
  368. _result = true;
  369. }
  370. else if(NTConfig_CubingItem[i][3] == _gid)
  371. _result = true;
  372. }
  373. }
  374. else if(_classid == _NTCU_CraftRecipe[_index][1])
  375. {
  376. if(NTConfig_CubingItem[i][2] != null)
  377. {
  378. if(NTConfig_CubingItem[i][4] == null)
  379. {
  380. NTConfig_CubingItem[i][4] = _gid;
  381. _result = true;
  382. }
  383. else if(NTConfig_CubingItem[i][4] == _gid)
  384. _result = true;
  385. }
  386. }
  387. else if(_classid == _NTCU_CraftRecipe[_index][2])
  388. {
  389. if(NTConfig_CubingItem[i][2] != null)
  390. {
  391. if(NTConfig_CubingItem[i][5] == null)
  392. {
  393. NTConfig_CubingItem[i][5] = _gid;
  394. _result = true;
  395. }
  396. else if(NTConfig_CubingItem[i][5] == _gid)
  397. _result = true;
  398. }
  399. }
  400. else if(_classid == _NTCU_CraftRecipe[_index][2]-1)
  401. {
  402. if(NTConfig_CubingItem[i][2] != null && NTConfig_CubingItem[i][5] == null)
  403. {
  404. for(n = 0 ; n < 3 ; n++)
  405. {
  406. if(NTConfig_CubingItem[i][6+n] == null)
  407. {
  408. NTConfig_CubingItem[i][6+n] = _gid;
  409. _result = true;
  410.  
  411. break;
  412. }
  413. else if(NTConfig_CubingItem[i][6+n] == _gid)
  414. {
  415. _result = true;
  416.  
  417. break;
  418. }
  419. }
  420. }
  421. }
  422. }
  423. else if(NTConfig_CubingItem[i][0] >= NTCU_SOCKET_BODYARMOR && NTConfig_CubingItem[i][0] <= NTCU_SOCKET_SHIELD)
  424. {
  425. _index = NTConfig_CubingItem[i][0] - NTCU_SOCKET_BODYARMOR;
  426.  
  427. if(_classid == NTConfig_CubingItem[i][1])
  428. {
  429. if(result == 1 && item.quality <= 2 && item.GetStat(194) == 0)
  430. {
  431. if(NTConfig_CubingItem[i][2] == null)
  432. {
  433. NTConfig_CubingItem[i][2] = _gid;
  434. _result = true;
  435. }
  436. else if(NTConfig_CubingItem[i][2] == _gid)
  437. _result = true;
  438. }
  439. }
  440. else if(_classid == _NTCU_SocketRecipe[_index][0])
  441. {
  442. if(NTConfig_CubingItem[i][2] != null)
  443. {
  444. if(NTConfig_CubingItem[i][3] == null)
  445. {
  446. NTConfig_CubingItem[i][3] = _gid;
  447. _result = true;
  448. }
  449. else if(NTConfig_CubingItem[i][3] == _gid)
  450. _result = true;
  451. }
  452. }
  453. else if(_classid == _NTCU_SocketRecipe[_index][1])
  454. {
  455. if(NTConfig_CubingItem[i][2] != null)
  456. {
  457. if(NTConfig_CubingItem[i][4] == null)
  458. {
  459. NTConfig_CubingItem[i][4] = _gid;
  460. _result = true;
  461. }
  462. else if(NTConfig_CubingItem[i][4] == _gid)
  463. _result = true;
  464. }
  465. }
  466. else if(_classid == _NTCU_SocketRecipe[_index][2])
  467. {
  468. if(NTConfig_CubingItem[i][2] != null)
  469. {
  470. if(NTConfig_CubingItem[i][5] == null)
  471. {
  472. NTConfig_CubingItem[i][5] = _gid;
  473. _result = true;
  474. }
  475. else if(NTConfig_CubingItem[i][5] == _gid)
  476. _result = true;
  477. }
  478. }
  479. else if(_classid == _NTCU_SocketRecipe[_index][2]-1)
  480. {
  481. if(NTConfig_CubingItem[i][2] != null && NTConfig_CubingItem[i][5] == null)
  482. {
  483. for(n = 0 ; n < 3 ; n++)
  484. {
  485. if(NTConfig_CubingItem[i][6+n] == null)
  486. {
  487. NTConfig_CubingItem[i][6+n] = _gid;
  488. _result = true;
  489.  
  490. break;
  491. }
  492. else if(NTConfig_CubingItem[i][6+n] == _gid)
  493. {
  494. _result = true;
  495.  
  496. break;
  497. }
  498. }
  499. }
  500. }
  501. }
  502. else if(NTConfig_CubingItem[i][0] >= NTCU_UPGRADE_N_UNIQUE_WEAPON && NTConfig_CubingItem[i][0] <= NTCU_UPGRADE_E_RARE_ARMOR)
  503. {
  504. _index = NTConfig_CubingItem[i][0] - NTCU_UPGRADE_N_UNIQUE_WEAPON;
  505.  
  506. if(_classid == NTConfig_CubingItem[i][1])
  507. {
  508. if(result == 1 && item.quality == _NTCU_UpgradeRecipe[_index][0])
  509. {
  510. if(NTConfig_CubingItem[i][2] == null)
  511. {
  512. NTConfig_CubingItem[i][2] = _gid;
  513. _result = true;
  514. }
  515. else if(NTConfig_CubingItem[i][2] == _gid)
  516. _result = true;
  517. }
  518. }
  519. else if(_classid == _NTCU_UpgradeRecipe[_index][1])
  520. {
  521. if(NTConfig_CubingItem[i][2] != null)
  522. {
  523. if(NTConfig_CubingItem[i][3] == null)
  524. {
  525. NTConfig_CubingItem[i][3] = _gid;
  526. _result = true;
  527. }
  528. else if(NTConfig_CubingItem[i][3] == _gid)
  529. _result = true;
  530. }
  531. }
  532. else if(_classid == _NTCU_UpgradeRecipe[_index][2])
  533. {
  534. if(NTConfig_CubingItem[i][2] != null)
  535. {
  536. if(NTConfig_CubingItem[i][4] == null)
  537. {
  538. NTConfig_CubingItem[i][4] = _gid;
  539. _result = true;
  540. }
  541. else if(NTConfig_CubingItem[i][4] == _gid)
  542. _result = true;
  543. }
  544. }
  545. else if(_classid == _NTCU_UpgradeRecipe[_index][3])
  546. {
  547. if(NTConfig_CubingItem[i][2] != null)
  548. {
  549. if(NTConfig_CubingItem[i][5] == null)
  550. {
  551. NTConfig_CubingItem[i][5] = _gid;
  552. _result = true;
  553. }
  554. else if(NTConfig_CubingItem[i][5] == _gid)
  555. _result = true;
  556. }
  557. }
  558. else if(_classid == _NTCU_UpgradeRecipe[_index][3]-1)
  559. {
  560. if(NTConfig_CubingItem[i][2] != null && NTConfig_CubingItem[i][5] == null)
  561. {
  562. for(n = 0 ; n < 3 ; n++)
  563. {
  564. if(NTConfig_CubingItem[i][6+n] == null)
  565. {
  566. NTConfig_CubingItem[i][6+n] = _gid;
  567. _result = true;
  568.  
  569. break;
  570. }
  571. else if(NTConfig_CubingItem[i][6+n] == _gid)
  572. {
  573. _result = true;
  574.  
  575. break;
  576. }
  577. }
  578. }
  579. }
  580. }
  581. else if(NTConfig_CubingItem[i][0] == NTCU_ESSENSE)
  582. {
  583. if(_classid >= 654 && _classid <= 657)
  584. {
  585. if(NTConfig_CubingItem[i][2+_classid-654] == null)
  586. {
  587. NTConfig_CubingItem[i][2+_classid-654] = _gid;
  588. _result = true;
  589. }
  590. else if(NTConfig_CubingItem[i][2+_classid-654] == _gid)
  591. _result = true;
  592. }
  593. }
  594. else if(NTConfig_CubingItem[i][0] >= NTCU_RUNE_EL && NTConfig_CubingItem[i][0] <= NTCU_RUNE_CHAM)
  595. {
  596. if(_classid == NTConfig_CubingItem[i][0])
  597. {
  598. for(n = 0 ; n < 2 ; n++)
  599. {
  600. if(NTConfig_CubingItem[i][1+n] == null)
  601. {
  602. NTConfig_CubingItem[i][1+n] = _gid;
  603. break;
  604. }
  605. else if(NTConfig_CubingItem[i][1+n] == _gid)
  606. break;
  607. }
  608.  
  609. _result = true;
  610. }
  611. }
  612. }
  613.  
  614. return _result;
  615. }
  616.  
  617. function NTCU_InitCubing()
  618. {
  619. var i, n;
  620. var _count;
  621. var _items;
  622.  
  623. if(!NTConfig_Cubing)
  624. return false;
  625.  
  626. for(i = 0 ; i < NTConfig_CubingItem.length ; i++)
  627. {
  628. if(NTConfig_CubingItem[i][0] < NTCU_MAGIC)
  629. _count = 5;
  630. else if(NTConfig_CubingItem[i][0] < NTCU_CRAFT_HITPOWER_HELM)
  631. _count = 15;
  632. else if(NTConfig_CubingItem[i][0] < NTCU_ESSENSE)
  633. _count = 9;
  634. else if(NTConfig_CubingItem[i][0] == NTCU_ESSENSE)
  635. _count = 6;
  636. else if(NTConfig_CubingItem[i][0] < NTCU_RUNE_THUL)
  637. _count = 5;
  638. else if(NTConfig_CubingItem[i][0] < NTCU_RUNE_PUL)
  639. _count = 6;
  640. else
  641. _count = 5;
  642.  
  643. for(n = 2 ; n < _count ; n++)
  644. NTConfig_CubingItem[i][n] = null;
  645. }
  646.  
  647. _items = me.GetItems();
  648.  
  649. if(!_items)
  650. return false;
  651.  
  652. for(i = 0 ; i < _items.length ; i++)
  653. {
  654. if(_items[i].mode == 0)
  655. {
  656. if(_items[i].itemloc != 0 || NTConfig_Columns[_items[i].y][_items[i].x])
  657. NTSI_CheckItem(_items[i])[0];
  658. }
  659. }
  660.  
  661. for(i = 0 ; i < _items.length ; i++)
  662. {
  663. if(_items[i].mode == 0)
  664. {
  665. if(_items[i].itemloc != 0 || NTConfig_Columns[_items[i].y][_items[i].x])
  666. NTSI_CheckItem(_items[i])[0];
  667. }
  668. }
  669.  
  670. return true;
  671. }
  672.  
  673. function NTCU_CheckCubing()
  674. {
  675. var i, n;
  676.  
  677. if(!NTConfig_Cubing)
  678. return false;
  679.  
  680. for(i = 0 ; i < NTConfig_CubingItem.length ; i++)
  681. {
  682. if(NTConfig_CubingItem[i][0] == NTCU_MAGIC || NTConfig_CubingItem[i][0] == NTCU_MAGIC_CHARM)
  683. {
  684. for(n = 2 ; n < 6 ; n++)
  685. {
  686. if(NTConfig_CubingItem[i][n] == null)
  687. break;
  688. }
  689.  
  690. if(n >= 6)
  691. break;
  692.  
  693. for(n = 6 ; n < 9 ; n++)
  694. {
  695. if(NTConfig_CubingItem[i][n] == null)
  696. break;
  697. }
  698.  
  699. if(n >= 9)
  700. break;
  701.  
  702. for(n = 9 ; n < 12 ; n++)
  703. {
  704. if(NTConfig_CubingItem[i][n] == null)
  705. break;
  706. }
  707.  
  708. if(n >= 12)
  709. break;
  710.  
  711. for(n = 12 ; n < 15 ; n++)
  712. {
  713. if(NTConfig_CubingItem[i][n] == null)
  714. break;
  715. }
  716.  
  717. if(n >= 15)
  718. break;
  719. }
  720. else if(NTConfig_CubingItem[i][0] >= NTCU_CRAFT_HITPOWER_HELM && NTConfig_CubingItem[i][0] <= NTCU_UPGRADE_E_RARE_ARMOR)
  721. {
  722. for(n = 2 ; n < 6 ; n++)
  723. {
  724. if(NTConfig_CubingItem[i][n] == null)
  725. break;
  726. }
  727.  
  728. if(n >= 6)
  729. break;
  730.  
  731. for(n = 6 ; n < 9 ; n++)
  732. {
  733. if(NTConfig_CubingItem[i][n] == null)
  734. break;
  735. }
  736.  
  737. if(n >= 9)
  738. break;
  739. }
  740. else
  741. {
  742. for(n = 2 ; n < NTConfig_CubingItem[i].length ; n++)
  743. {
  744. if(NTConfig_CubingItem[i][n] == null)
  745. break;
  746. }
  747.  
  748. if(n >= NTConfig_CubingItem[i].length)
  749. break;
  750. }
  751. }
  752.  
  753. return (i < NTConfig_CubingItem.length);
  754. }
  755.  
  756. function NTCU_DoCubing()
  757. {
  758. var i, n;
  759. var _items, result;
  760. var resultArray = new Array();
  761.  
  762. if(!NTConfig_Cubing){
  763. return false;
  764. }
  765.  
  766. _items = me.GetItems(NTC_UNIT_CUBE);
  767.  
  768. if(!_items || _items.length < 1)
  769. return false;
  770.  
  771. if(NTCU_CheckCubeInventoryInt() > 0)
  772. {
  773. if(!NTCU_OpenCubeInt(_items[0]))
  774. return false;
  775.  
  776. if(NTCU_ClearCubeInt() < 1)
  777. return false;
  778.  
  779. NTCU_CloseCubeInt();
  780. }
  781.  
  782. do
  783. {
  784. for(i = 0 ; i < NTConfig_CubingItem.length ; i++)
  785. {
  786. if(NTConfig_CubingItem[i][0] == NTCU_MAGIC || NTConfig_CubingItem[i][0] == NTCU_MAGIC_CHARM)
  787. {
  788. for(n = 2 ; n < 6 ; n++)
  789. {
  790. if(NTConfig_CubingItem[i][n] == null)
  791. break;
  792. }
  793.  
  794. if(n >= 6)
  795. {
  796. if(!NTCU_MoveItemsToCubeInt(_items[0], i, 2, 5))
  797. return false;
  798.  
  799. break;
  800. }
  801.  
  802. for(n = 6 ; n < 9 ; n++)
  803. {
  804. if(NTConfig_CubingItem[i][n] == null)
  805. break;
  806. }
  807.  
  808. if(n >= 9)
  809. {
  810. if(!NTCU_MoveItemsToCubeInt(_items[0], i, 6, 8))
  811. return false;
  812.  
  813. break;
  814. }
  815.  
  816. for(n = 9 ; n < 12 ; n++)
  817. {
  818. if(NTConfig_CubingItem[i][n] == null)
  819. break;
  820. }
  821.  
  822. if(n >= 12)
  823. {
  824. if(!NTCU_MoveItemsToCubeInt(_items[0], i, 9, 11))
  825. return false;
  826.  
  827. break;
  828. }
  829.  
  830. for(n = 12 ; n < 15 ; n++)
  831. {
  832. if(NTConfig_CubingItem[i][n] == null)
  833. break;
  834. }
  835.  
  836. if(n >= 15)
  837. {
  838. if(!NTCU_MoveItemsToCubeInt(_items[0], i, 12, 14))
  839. return false;
  840.  
  841. break;
  842. }
  843. }
  844. else if(NTConfig_CubingItem[i][0] >= NTCU_CRAFT_HITPOWER_HELM && NTConfig_CubingItem[i][0] <= NTCU_UPGRADE_E_RARE_ARMOR)
  845. {
  846. for(n = 2 ; n < 6 ; n++)
  847. {
  848. if(NTConfig_CubingItem[i][n] == null)
  849. break;
  850. }
  851.  
  852. if(n >= 6)
  853. {
  854. if(!NTCU_MoveItemsToCubeInt(_items[0], i, 2, 5))
  855. return false;
  856.  
  857. break;
  858. }
  859.  
  860. for(n = 6 ; n < 9 ; n++)
  861. {
  862. if(NTConfig_CubingItem[i][n] == null)
  863. break;
  864. }
  865.  
  866. if(n >= 9)
  867. {
  868. if(!NTCU_MoveItemsToCubeInt(_items[0], i, 6, 8))
  869. return false;
  870.  
  871. break;
  872. }
  873. }
  874. else
  875. {
  876. for(n = 2 ; n < NTConfig_CubingItem[i].length ; n++)
  877. {
  878. if(NTConfig_CubingItem[i][n] == null)
  879. break;
  880. }
  881.  
  882. if(n >= NTConfig_CubingItem[i].length)
  883. {
  884. if(!NTCU_MoveItemsToCubeInt(_items[0], i, 2, NTConfig_CubingItem[i].length-1))
  885. return false;
  886.  
  887. break;
  888. }
  889. }
  890. }
  891.  
  892. if(i < NTConfig_CubingItem.length)
  893. {
  894. if(!NTCU_OpenCubeInt(_items[0]))
  895. return false;
  896.  
  897. if(!Transmute())
  898. return false;
  899.  
  900. NTC_PingDelay(800);
  901. if(NTConfig_CubeProcessToManager > 0){
  902. if(NTConfig_CubeProcessToManager == 1){
  903. NTC_SendLogToOOG(NTC_LOG_ITEM, _NTCU_LogString);
  904. }
  905. else if (NTConfig_CubeProcessToManager == 2) {
  906. NTC_SendLogToOOG(NTC_LOG_COMMON, _NTCU_LogString);
  907. }
  908. }
  909. var crafted_itm = NTCU_GetCubeContents();
  910. if(crafted_itm.length == 1)
  911. {
  912. if(crafted_itm[0].quality == 8 || crafted_itm[0].itemflag&0x400000 || crafted_itm[0].quality == 7 && crafted_itm[0].class == 2)
  913. {
  914. var _isEthereal = ((crafted_itm[0].itemflag & 0x400000) == 0x400000);
  915. resultArray = NTSI_CheckItem(crafted_itm[0]);
  916. result = resultArray[0];
  917. if(result != 0)
  918. {
  919. if(NTConfig_LogCraftedItems && NTConfig_UseXMLItemlog) {
  920. if(NTConfig_IndependantLog) {
  921. NTI_WriteILog(crafted_itm[0], me, _isEthereal, 12, false, '', true);
  922. } else {
  923. NTI_WriteLog(crafted_itm[0], me, _isEthereal, 12, false, '', true);
  924. }
  925. }
  926. NTC_SendLogToOOG(NTC_LOG_ITEM, COLOR_2 + "Kept: " + NTC_ItemQualityToMGRColor[crafted_itm[0].quality] + crafted_itm[0].name.split("\n")[0]+ ";" + crafted_itm[0].itemdesc + "\n" + COLOR_2 + "iLvl: " + crafted_itm[0].itemlevel + COLOR_2 + "\n Crafted"+ "\n" + COLOR_2 +resultArray[1]+", "+resultArray[2]);
  927. }
  928. else
  929. {
  930. if(NTConfig_LogCraftedItems && NTConfig_UseXMLItemlog) {
  931. if(NTConfig_IndependantLog) {
  932. NTI_WriteILog(crafted_itm[0], me, _isEthereal, 13, false, '', true);
  933. } else {
  934. NTI_WriteLog(crafted_itm[0], me, _isEthereal, 13, false, '', true);
  935. }
  936. }
  937. if(NTConfig_LogSoldItemQuality != 0) {
  938. NTC_SendLogToOOG(NTC_LOG_ITEM, COLOR_1 + "Sold: " + NTC_ItemQualityToMGRColor[crafted_itm[0].quality] + crafted_itm[0].name.split("\n")[0]+ ";" + crafted_itm[0].itemdesc + "\n" + COLOR_2 + "iLvl: " + crafted_itm[0].itemlevel + COLOR_2 + "\n Crafted");
  939. }
  940. }
  941. }
  942. }
  943. if(NTConfig_LogCraftingString)
  944. NTU_LogPrint("logs/CraftLog/"+me.charname+"-CraftingString.txt", _NTCU_LogString);
  945. var crafted_itm = NTCU_GetCubeContents();
  946. if (crafted_itm.length == 1)
  947. {
  948. if (crafted_itm[0].quality == 8)
  949. {
  950. var _isEthereal = ((crafted_itm[0].itemflag & 0x400000) == 0x400000);
  951. if ( NTSI_CheckItem(crafted_itm[0])[0] != 0 ) {
  952. if(NTConfig_LogCraftedItems && NTConfig_UseXMLItemlog) {
  953. if(NTConfig_IndependantLog) {
  954. NTI_WriteILog(crafted_itm[0], me, _isEthereal, 12, false, '', true);
  955. } else {
  956. NTI_WriteLog(crafted_itm[0], me, _isEthereal, 12, false, '', true);
  957. }
  958. }
  959. //NTC_SendLogToOOG(NTC_LOG_ITEM, COLOR_1 + "Kept Cubed Item " + NTC_ItemQualityToMGRColor[crafted_itm[0].quality] + crafted_itm[0].name.split("\n")[0] + ";" + crafted_itm[0].itemdesc + "\n" + COLOR_2 + "iLvl: " + crafted_itm[0].itemlevel+ "\n" + COLOR_2 +resultArray[1]+", "+resultArray[2]);
  960. }
  961. else
  962. {
  963. if(NTConfig_LogCraftedItems && NTConfig_UseXMLItemlog) {
  964. if(NTConfig_IndependantLog) {
  965. NTI_WriteILog(crafted_itm[0], me, _isEthereal, 14, false, '', true);
  966. } else {
  967. NTI_WriteLog(crafted_itm[0], me, _isEthereal, 14, false, '', true);
  968. }
  969. }
  970. //NTC_SendLogToOOG(NTC_LOG_ITEM, "Trashed Cubed Item " + NTC_ItemQualityToMGRColor[crafted_itm[0].quality] + crafted_itm[0].name.split("\n")[0] + ";" + crafted_itm[0].itemdesc + "\n" + COLOR_2 + "iLvl: " + crafted_itm[0].itemlevel);
  971. }
  972. }
  973.  
  974. }
  975.  
  976. if(NTCU_ClearCubeInt() == 1)
  977. NTCU_CloseCubeInt();
  978. else
  979. {
  980. NTCU_CloseCubeInt();
  981.  
  982. return false;
  983. }
  984. }
  985. } while(NTCU_InitCubing() && NTCU_CheckCubing());
  986.  
  987. return true;
  988. }
  989.  
  990. // Internal function
  991. function NTCU_CheckCubeInventoryInt()
  992. {
  993. var i, x, y;
  994. var _itemcounts = 0;
  995. var _items;
  996.  
  997. for(y = 0 ; y < 4 ; y++)
  998. {
  999. for(x = 0 ; x < 10 ; x++)
  1000. _NTCU_Inventory[y][x] = 0;
  1001. }
  1002.  
  1003. _items = me.GetItems();
  1004.  
  1005. if(!_items)
  1006. return 0;
  1007.  
  1008. for(i = 0 ; i < _items.length ; i++)
  1009. {
  1010. if(_items[i].mode == 0)
  1011. {
  1012. if(_items[i].itemloc == 0)
  1013. {
  1014. for(y = 0 ; y < _items[i].ysize ; y++)
  1015. {
  1016. for(x = 0 ; x < _items[i].xsize ; x++)
  1017. _NTCU_Inventory[_items[i].y+y][_items[i].x+x] = 1;
  1018. }
  1019. }
  1020. else if(_items[i].itemloc == 3)
  1021. _itemcounts++;
  1022. }
  1023. }
  1024.  
  1025. return _itemcounts;
  1026. }
  1027.  
  1028. function NTCU_MoveItemsToCubeInt(cube, index, start, end)
  1029. {
  1030. var i, n;
  1031. var _items;
  1032.  
  1033. _items = me.GetItems();
  1034.  
  1035. if(!_items)
  1036. return false;
  1037.  
  1038. _NTCU_LogString = COLOR_8 + "Transmuted ";
  1039.  
  1040. for(i = start ; i <= end ; i++)
  1041. {
  1042. for(n = 0 ; n < _items.length ; n++)
  1043. {
  1044. if(_items[n].gid == NTConfig_CubingItem[index][i])
  1045. {
  1046. if(!NTCU_MoveItemToCubeInt(cube, _items[n]))
  1047. return false;
  1048.  
  1049. if(i > start)
  1050. _NTCU_LogString += "+";
  1051.  
  1052. _NTCU_LogString += _items[n].name.split("\n")[0];
  1053.  
  1054. break;
  1055. }
  1056. }
  1057.  
  1058. if(n >= _items.length)
  1059. return false;
  1060. }
  1061.  
  1062. return true;
  1063. }
  1064.  
  1065. function NTCU_MoveItemToCubeInt(cube, item)
  1066. {
  1067. var x, y;
  1068. var _itemx, _itemy;
  1069.  
  1070. if(item.itemloc == 3)
  1071. return true;
  1072.  
  1073. _itemx = item.x;
  1074. _itemy = item.y;
  1075.  
  1076. if(!NTC_ItemToCursor(item))
  1077. return false;
  1078.  
  1079. if(item.itemloc == 0)
  1080. {
  1081. for(y = 0 ; y < item.ysize ; y++)
  1082. {
  1083. for(x = 0 ; x < item.xsize ; x++)
  1084. _NTCU_Inventory[_itemy+y][_itemx+x] = 0;
  1085. }
  1086. }
  1087.  
  1088. for(x = 0 ; x < 80 ; x++)
  1089. {
  1090. if((x % 40) == 0)
  1091. {
  1092. if(item.ysize < 3)
  1093. me.ClickItem(0, cube.x, cube.y, cube.itemloc);
  1094. else if(item.ysize == 3)
  1095. me.ClickItem(0, cube.x, cube.y-1, cube.itemloc);
  1096. else
  1097. {
  1098. if(cube.y == 0)
  1099. me.ClickItem(0, cube.x, -1, cube.itemloc);
  1100. else
  1101. me.ClickItem(0, cube.x, cube.y-2, cube.itemloc);
  1102. }
  1103. }
  1104.  
  1105. NTC_Delay(100);
  1106.  
  1107. if(!me.itemoncursor)
  1108. break;
  1109. }
  1110.  
  1111. if(x >= 80)
  1112. return false;
  1113.  
  1114. NTC_PingDelay(200);
  1115.  
  1116. return true;
  1117. }
  1118.  
  1119. function NTCU_MoveItemToInventoryInt(item)
  1120. {
  1121. var x, y, m, n;
  1122. var _havespace;
  1123.  
  1124. for(y = 0 ; y < 4 ; y++)
  1125. {
  1126. for(x = 0 ; x < 10 ; x++)
  1127. {
  1128. _havespace = true;
  1129.  
  1130. for(m = 0 ; m < item.ysize ; m++)
  1131. {
  1132. for(n = 0 ; n < item.xsize ; n++)
  1133. {
  1134. if(_NTCU_Inventory[y+m][x+n] == 1)
  1135. {
  1136. _havespace = false;
  1137. m = 4;
  1138. break;
  1139. }
  1140. }
  1141. }
  1142.  
  1143. if(_havespace)
  1144. {
  1145. if(!NTC_ItemToCursor(item))
  1146. return false;
  1147.  
  1148. for(m = 0 ; m < 80 ; m++)
  1149. {
  1150. if((m % 40) == 0)
  1151. me.ClickItem(0, x, y, 0);
  1152.  
  1153. NTC_Delay(100);
  1154.  
  1155. if(!me.itemoncursor)
  1156. break;
  1157. }
  1158.  
  1159. if(m >= 80)
  1160. return false;
  1161.  
  1162. for(m = 0 ; m < item.ysize ; m++)
  1163. {
  1164. for(n = 0 ; n < item.xsize ; n++)
  1165. _NTCU_Inventory[y+m][x+n] = 1;
  1166. }
  1167.  
  1168. NTC_PingDelay(200);
  1169.  
  1170. return true;
  1171. }
  1172. }
  1173. }
  1174.  
  1175. return false;
  1176. }
  1177.  
  1178. function NTCU_OpenCubeInt(_cube)
  1179. {
  1180. if(_cube.itemloc == 4 && !GetUIState(0x19))
  1181. {
  1182. var _stash = NTC_FindUnit(NTC_UNIT_OBJECT, NTC_UNIT_STASH, 1);
  1183.  
  1184. if(!_stash)
  1185. return false;
  1186.  
  1187. if(!NTT_DoInteract(_stash))
  1188. return false;
  1189. }
  1190.  
  1191. if(!GetUIState(0x1A))
  1192. return NTT_DoInteract(_cube);
  1193.  
  1194. return true;
  1195. }
  1196.  
  1197. function NTCU_CloseCubeInt()
  1198. {
  1199. var i;
  1200.  
  1201. if(!GetUIState(0x1A))
  1202. return true;
  1203.  
  1204. for(i = 0 ; i < 20 ; i++)
  1205. {
  1206. if((i % 10) == 0)
  1207. me.Cancel(0);
  1208.  
  1209. NTC_Delay(200);
  1210.  
  1211. if(!GetUIState(0x1A))
  1212. {
  1213. NTC_PingDelay(200);
  1214. return true;
  1215. }
  1216. }
  1217.  
  1218. return false;
  1219. }
  1220.  
  1221. function NTCU_ClearCubeInt()
  1222. {
  1223. var i;
  1224. var _itemcounts = 0;
  1225. var _items = me.GetItems();
  1226.  
  1227. if(!_items)
  1228. return 0;
  1229.  
  1230. for(i = 0 ; i < _items.length ; i++)
  1231. {
  1232. if(_items[i].mode == 0 && _items[i].itemloc == 3)
  1233. {
  1234. if(!NTCU_MoveItemToInventoryInt(_items[i]))
  1235. return _itemcounts;
  1236.  
  1237. _itemcounts++;
  1238. }
  1239. }
  1240.  
  1241. return _itemcounts;
  1242. }
  1243.  
  1244. function NTCU_GetCubeContents()
  1245. {
  1246. var _items = me.GetItems();
  1247. var _cube_items = new Array();
  1248.  
  1249. for(i = 0 ; i < _items.length ; i++)
  1250. {
  1251. if(_items[i].mode == 0 && _items[i].itemloc == 3)
  1252. {
  1253. _cube_items.push(_items[i]);
  1254. }
  1255. }
  1256.  
  1257. return _cube_items;
  1258. }
Add Comment
Please, Sign In to add comment