Guest User

HERE IT IS

a guest
Aug 1st, 2014
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 29.41 KB | None | 0 0
  1. // Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
  2. // Jad home page: http://www.kpdus.com/jad.html
  3. // Decompiler options: packimports(3)
  4. // Source File Name: ItemDef.java
  5.  
  6. import java.io.PrintStream;
  7. import sign.signlink;
  8.  
  9. public final class ItemDef
  10. {
  11.  
  12. public static void nullLoader()
  13. {
  14. mruNodes2 = null;
  15. mruNodes1 = null;
  16. streamIndices = null;
  17. cache = null;
  18. stream = null;
  19. }
  20.  
  21. public static void itemModel()
  22. {
  23. try
  24. {
  25. for(int i = 0; i < 20793; i++)
  26. {
  27. ItemDef itemDef = forID(i);
  28. System.out.println(i);
  29. byte abyte0121[] = FileOperations.ReadFile((new StringBuilder()).append("./items/").append(itemDef.modelID).append(".mdl").toString());
  30. FileOperations.WriteFile((new StringBuilder()).append("./dumped/").append(itemDef.modelID).append(".mdl").toString(), abyte0121);
  31. }
  32.  
  33. }
  34. catch(Exception e)
  35. {
  36. e.printStackTrace();
  37. }
  38. }
  39.  
  40. private void toLend()
  41. {
  42. ItemDef itemDef = forID(lendTemplateID);
  43. itemActions = new String[5];
  44. modelID = itemDef.modelID;
  45. modelOffset1 = itemDef.modelOffset1;
  46. modelRotation2 = itemDef.modelRotation2;
  47. modelOffset2 = itemDef.modelOffset2;
  48. modelZoom = itemDef.modelZoom;
  49. modelRotation1 = itemDef.modelRotation1;
  50. anInt204 = itemDef.anInt204;
  51. value = 0;
  52. ItemDef itemDef_1 = forID(lendID);
  53. anInt166 = itemDef_1.anInt166;
  54. originalModelColors = itemDef_1.originalModelColors;
  55. anInt185 = itemDef_1.anInt185;
  56. anInt200 = itemDef_1.anInt200;
  57. anInt173 = itemDef_1.anInt173;
  58. anInt175 = itemDef_1.anInt175;
  59. groundActions = itemDef_1.groundActions;
  60. anInt165 = itemDef_1.anInt165;
  61. name = itemDef_1.name;
  62. anInt188 = itemDef_1.anInt188;
  63. membersObject = itemDef_1.membersObject;
  64. anInt197 = itemDef_1.anInt197;
  65. anInt164 = itemDef_1.anInt164;
  66. anInt162 = itemDef_1.anInt162;
  67. modifiedModelColors = itemDef_1.modifiedModelColors;
  68. team = itemDef_1.team;
  69. if(itemDef_1.itemActions != null)
  70. {
  71. for(int i_33_ = 0; i_33_ < 4; i_33_++)
  72. itemActions[i_33_] = itemDef_1.itemActions[i_33_];
  73.  
  74. }
  75. itemActions[4] = "Discard";
  76. }
  77.  
  78. public boolean method192(int j)
  79. {
  80. int k = anInt175;
  81. int l = anInt166;
  82. if(j == 1)
  83. {
  84. k = anInt197;
  85. l = anInt173;
  86. }
  87. if(k == -1)
  88. return true;
  89. boolean flag = true;
  90. if(!Model.method463(k))
  91. flag = false;
  92. if(l != -1 && !Model.method463(l))
  93. flag = false;
  94. return flag;
  95. }
  96.  
  97. public Model method194(int j)
  98. {
  99. int k = anInt175;
  100. int l = anInt166;
  101. if(j == 1)
  102. {
  103. k = anInt197;
  104. l = anInt173;
  105. }
  106. if(k == -1)
  107. return null;
  108. Model model = Model.method462(k);
  109. if(l != -1)
  110. {
  111. Model model_1 = Model.method462(l);
  112. Model models[] = {
  113. model, model_1
  114. };
  115. model = new Model(2, models);
  116. }
  117. if(modifiedModelColors != null)
  118. {
  119. for(int i1 = 0; i1 < modifiedModelColors.length; i1++)
  120. model.method476(modifiedModelColors[i1], originalModelColors[i1]);
  121.  
  122. }
  123. return model;
  124. }
  125.  
  126. public boolean method195(int j)
  127. {
  128. int k = anInt165;
  129. int l = anInt188;
  130. int i1 = anInt185;
  131. if(j == 1)
  132. {
  133. k = anInt200;
  134. l = anInt164;
  135. i1 = anInt162;
  136. }
  137. if(k == -1)
  138. return true;
  139. boolean flag = true;
  140. if(!Model.method463(k))
  141. flag = false;
  142. if(l != -1 && !Model.method463(l))
  143. flag = false;
  144. if(i1 != -1 && !Model.method463(i1))
  145. flag = false;
  146. return flag;
  147. }
  148.  
  149. public Model method196(int i)
  150. {
  151. int j = anInt165;
  152. int k = anInt188;
  153. int l = anInt185;
  154. if(i == 1)
  155. {
  156. j = anInt200;
  157. k = anInt164;
  158. l = anInt162;
  159. }
  160. if(j == -1)
  161. return null;
  162. Model model = Model.method462(j);
  163. if(k != -1)
  164. if(l != -1)
  165. {
  166. Model model_1 = Model.method462(k);
  167. Model model_3 = Model.method462(l);
  168. Model model_1s[] = {
  169. model, model_1, model_3
  170. };
  171. model = new Model(3, model_1s);
  172. } else
  173. {
  174. Model model_2 = Model.method462(k);
  175. Model models[] = {
  176. model, model_2
  177. };
  178. model = new Model(2, models);
  179. }
  180. if(i == 0 && aByte205 != 0)
  181. model.method475(0, aByte205, 0);
  182. if(i == 1 && aByte154 != 0)
  183. model.method475(0, aByte154, 0);
  184. if(modifiedModelColors != null)
  185. {
  186. for(int i1 = 0; i1 < modifiedModelColors.length; i1++)
  187. model.method476(modifiedModelColors[i1], originalModelColors[i1]);
  188.  
  189. }
  190. return model;
  191. }
  192.  
  193. private void setDefaults()
  194. {
  195. modelID = 0;
  196. name = null;
  197. description = null;
  198. originalModelColors = null;
  199. modifiedModelColors = null;
  200. modelZoom = 2000;
  201. modelRotation1 = 0;
  202. modelRotation2 = 0;
  203. anInt204 = 0;
  204. modelOffset1 = 0;
  205. modelOffset2 = 0;
  206. stackable = false;
  207. value = 1;
  208. membersObject = false;
  209. groundActions = null;
  210. itemActions = null;
  211. lendID = -1;
  212. lendTemplateID = -1;
  213. anInt165 = -1;
  214. anInt188 = -1;
  215. aByte205 = 0;
  216. anInt200 = -1;
  217. anInt164 = -1;
  218. aByte154 = 0;
  219. anInt185 = -1;
  220. anInt162 = -1;
  221. anInt175 = -1;
  222. anInt166 = -1;
  223. anInt197 = -1;
  224. anInt173 = -1;
  225. stackIDs = null;
  226. stackAmounts = null;
  227. certID = -1;
  228. certTemplateID = -1;
  229. anInt167 = 128;
  230. anInt192 = 128;
  231. anInt191 = 128;
  232. anInt196 = 0;
  233. anInt184 = 0;
  234. team = 0;
  235. }
  236.  
  237. public static byte[] getData(String s)
  238. {
  239. return FileOperations.ReadFile(s);
  240. }
  241.  
  242. public static void unpackConfig(StreamLoader streamLoader)
  243. {
  244. stream = new Stream(getData((new StringBuilder()).append(loc).append("obj.dat").toString()));
  245. Stream stream = new Stream(getData((new StringBuilder()).append(loc).append("obj.idx").toString()));
  246. totalItems = stream.readUnsignedWord();
  247. streamIndices = new int[totalItems];
  248. int i = 2;
  249. for(int j = 0; j < totalItems; j++)
  250. {
  251. streamIndices[j] = i;
  252. i += stream.readUnsignedWord();
  253. }
  254.  
  255. cache = new ItemDef[10];
  256. for(int k = 0; k < 10; k++)
  257. cache[k] = new ItemDef();
  258.  
  259. }
  260.  
  261. public static Sprite getSprite(int i, int j, int k, int zoom)
  262. {
  263. if(k == 0 && zoom != -1)
  264. {
  265. Sprite sprite = (Sprite)mruNodes1.insertFromCache(i);
  266. if(sprite != null && sprite.maxHeight != j && sprite.maxHeight != -1)
  267. {
  268. sprite.unlink();
  269. sprite = null;
  270. }
  271. if(sprite != null)
  272. return sprite;
  273. }
  274. ItemDef itemDef = forID(i);
  275. if(itemDef.stackIDs == null)
  276. j = -1;
  277. if(j > 1)
  278. {
  279. int i1 = -1;
  280. for(int j1 = 0; j1 < 10; j1++)
  281. if(j >= itemDef.stackAmounts[j1] && itemDef.stackAmounts[j1] != 0)
  282. i1 = itemDef.stackIDs[j1];
  283.  
  284. if(i1 != -1)
  285. itemDef = forID(i1);
  286. }
  287. Model model = itemDef.method201(1);
  288. if(model == null)
  289. return null;
  290. Sprite sprite = null;
  291. if(itemDef.certTemplateID != -1)
  292. {
  293. sprite = getSprite(itemDef.certID, 10, -1);
  294. if(sprite == null)
  295. return null;
  296. }
  297. if(itemDef.lendID != -1)
  298. {
  299. sprite = getSprite(itemDef.lendID, 50, 0);
  300. if(sprite == null)
  301. return null;
  302. }
  303. Sprite sprite2 = new Sprite(32, 32);
  304. int k1 = Texture.textureInt1;
  305. int l1 = Texture.textureInt2;
  306. int ai[] = Texture.anIntArray1472;
  307. int ai1[] = DrawingArea.pixels;
  308. int i2 = DrawingArea.width;
  309. int j2 = DrawingArea.height;
  310. int k2 = DrawingArea.topX;
  311. int l2 = DrawingArea.bottomX;
  312. int i3 = DrawingArea.topY;
  313. int j3 = DrawingArea.bottomY;
  314. Texture.aBoolean1464 = false;
  315. DrawingArea.initDrawingArea(32, 32, sprite2.myPixels);
  316. DrawingArea.drawPixels(32, 0, 0, 0, 32);
  317. Texture.method364();
  318. int k3 = itemDef.modelZoom;
  319. if(zoom != -1)
  320. k3 = (itemDef.modelZoom * 100) / zoom;
  321. if(k == -1)
  322. k3 = (int)((double)k3 * 1.5D);
  323. if(k > 0)
  324. k3 = (int)((double)k3 * 1.04D);
  325. int l3 = Texture.anIntArray1470[itemDef.modelRotation1] * k3 >> 16;
  326. int i4 = Texture.anIntArray1471[itemDef.modelRotation1] * k3 >> 16;
  327. model.method482(itemDef.modelRotation2, itemDef.anInt204, itemDef.modelRotation1, itemDef.modelOffset1, l3 + model.modelHeight / 2 + itemDef.modelOffset2, i4 + itemDef.modelOffset2);
  328. for(int i5 = 31; i5 >= 0; i5--)
  329. {
  330. for(int j4 = 31; j4 >= 0; j4--)
  331. {
  332. if(sprite2.myPixels[i5 + j4 * 32] != 0)
  333. continue;
  334. if(i5 > 0 && sprite2.myPixels[(i5 - 1) + j4 * 32] > 1)
  335. {
  336. sprite2.myPixels[i5 + j4 * 32] = 1;
  337. continue;
  338. }
  339. if(j4 > 0 && sprite2.myPixels[i5 + (j4 - 1) * 32] > 1)
  340. {
  341. sprite2.myPixels[i5 + j4 * 32] = 1;
  342. continue;
  343. }
  344. if(i5 < 31 && sprite2.myPixels[i5 + 1 + j4 * 32] > 1)
  345. {
  346. sprite2.myPixels[i5 + j4 * 32] = 1;
  347. continue;
  348. }
  349. if(j4 < 31 && sprite2.myPixels[i5 + (j4 + 1) * 32] > 1)
  350. sprite2.myPixels[i5 + j4 * 32] = 1;
  351. }
  352.  
  353. }
  354.  
  355. if(k > 0)
  356. {
  357. for(int j5 = 31; j5 >= 0; j5--)
  358. {
  359. for(int k4 = 31; k4 >= 0; k4--)
  360. {
  361. if(sprite2.myPixels[j5 + k4 * 32] != 0)
  362. continue;
  363. if(j5 > 0 && sprite2.myPixels[(j5 - 1) + k4 * 32] == 1)
  364. {
  365. sprite2.myPixels[j5 + k4 * 32] = k;
  366. continue;
  367. }
  368. if(k4 > 0 && sprite2.myPixels[j5 + (k4 - 1) * 32] == 1)
  369. {
  370. sprite2.myPixels[j5 + k4 * 32] = k;
  371. continue;
  372. }
  373. if(j5 < 31 && sprite2.myPixels[j5 + 1 + k4 * 32] == 1)
  374. {
  375. sprite2.myPixels[j5 + k4 * 32] = k;
  376. continue;
  377. }
  378. if(k4 < 31 && sprite2.myPixels[j5 + (k4 + 1) * 32] == 1)
  379. sprite2.myPixels[j5 + k4 * 32] = k;
  380. }
  381.  
  382. }
  383.  
  384. } else
  385. if(k == 0)
  386. {
  387. for(int k5 = 31; k5 >= 0; k5--)
  388. {
  389. for(int l4 = 31; l4 >= 0; l4--)
  390. if(sprite2.myPixels[k5 + l4 * 32] == 0 && k5 > 0 && l4 > 0 && sprite2.myPixels[(k5 - 1) + (l4 - 1) * 32] > 0)
  391. sprite2.myPixels[k5 + l4 * 32] = 0x302020;
  392.  
  393. }
  394.  
  395. }
  396. if(itemDef.certTemplateID != -1)
  397. {
  398. int l5 = sprite.maxWidth;
  399. int j6 = sprite.maxHeight;
  400. sprite.maxWidth = 32;
  401. sprite.maxHeight = 32;
  402. sprite.drawSprite(0, 0);
  403. sprite.maxWidth = l5;
  404. sprite.maxHeight = j6;
  405. }
  406. if(itemDef.lendID != -1)
  407. {
  408. int l5 = sprite.maxWidth;
  409. int j6 = sprite.maxHeight;
  410. sprite.maxWidth = 32;
  411. sprite.maxHeight = 32;
  412. sprite.drawSprite(0, 0);
  413. sprite.maxWidth = l5;
  414. sprite.maxHeight = j6;
  415. }
  416. if(k == 0)
  417. mruNodes1.removeFromCache(sprite2, i);
  418. DrawingArea.initDrawingArea(j2, i2, ai1);
  419. DrawingArea.setDrawingArea(j3, k2, l2, i3);
  420. Texture.textureInt1 = k1;
  421. Texture.textureInt2 = l1;
  422. Texture.anIntArray1472 = ai;
  423. Texture.aBoolean1464 = true;
  424. sprite2.maxWidth = itemDef.stackable ? 33 : 32;
  425. sprite2.maxHeight = j;
  426. return sprite2;
  427. }
  428.  
  429. private void readValues(Stream stream)
  430. {
  431. do
  432. {
  433. int i = stream.readUnsignedByte();
  434. if(i == 0)
  435. return;
  436. int lendID_test;
  437. int lendTemplateID_test;
  438. if(i == 1)
  439. modelID = stream.readUnsignedWord();
  440. else
  441. if(i == 2)
  442. name = stream.readString();
  443. else
  444. if(i == 3)
  445. description = stream.readBytes().toString();
  446. else
  447. if(i == 4)
  448. modelZoom = stream.readUnsignedWord();
  449. else
  450. if(i == 5)
  451. modelRotation1 = stream.readUnsignedWord();
  452. else
  453. if(i == 6)
  454. modelRotation2 = stream.readUnsignedWord();
  455. else
  456. if(i == 7)
  457. {
  458. modelOffset1 = stream.readUnsignedWord();
  459. if(modelOffset1 > 32767)
  460. modelOffset1 -= 0x10000;
  461. } else
  462. if(i == 8)
  463. {
  464. modelOffset2 = stream.readUnsignedWord();
  465. if(modelOffset2 > 32767)
  466. modelOffset2 -= 0x10000;
  467. } else
  468. if(i == 10)
  469. stream.readUnsignedWord();
  470. else
  471. if(i == 11)
  472. stackable = true;
  473. else
  474. if(i == 12)
  475. value = stream.readDWord();
  476. else
  477. if(i == 16)
  478. membersObject = true;
  479. else
  480. if(i == 23)
  481. {
  482. anInt165 = stream.readUnsignedWord();
  483. aByte205 = stream.readSignedByte();
  484. } else
  485. if(i == 24)
  486. anInt188 = stream.readUnsignedWord();
  487. else
  488. if(i == 25)
  489. {
  490. anInt200 = stream.readUnsignedWord();
  491. aByte154 = stream.readSignedByte();
  492. } else
  493. if(i == 26)
  494. anInt164 = stream.readUnsignedWord();
  495. else
  496. if(i >= 30 && i < 35)
  497. {
  498. if(groundActions == null)
  499. groundActions = new String[5];
  500. groundActions[i - 30] = stream.readString();
  501. if(groundActions[i - 30].equalsIgnoreCase("hidden"))
  502. groundActions[i - 30] = null;
  503. } else
  504. if(i >= 35 && i < 40)
  505. {
  506. if(itemActions == null)
  507. itemActions = new String[5];
  508. itemActions[i - 35] = stream.readString();
  509. } else
  510. if(i == 40)
  511. {
  512. int j = stream.readUnsignedByte();
  513. modifiedModelColors = new int[j];
  514. originalModelColors = new int[j];
  515. int k = 0;
  516. while(k < j)
  517. {
  518. modifiedModelColors[k] = stream.readUnsignedWord();
  519. originalModelColors[k] = stream.readUnsignedWord();
  520. k++;
  521. }
  522. } else
  523. if(i == 78)
  524. anInt185 = stream.readUnsignedWord();
  525. else
  526. if(i == 79)
  527. anInt162 = stream.readUnsignedWord();
  528. else
  529. if(i == 90)
  530. anInt175 = stream.readUnsignedWord();
  531. else
  532. if(i == 91)
  533. anInt197 = stream.readUnsignedWord();
  534. else
  535. if(i == 92)
  536. anInt166 = stream.readUnsignedWord();
  537. else
  538. if(i == 93)
  539. anInt173 = stream.readUnsignedWord();
  540. else
  541. if(i == 95)
  542. anInt204 = stream.readUnsignedWord();
  543. else
  544. if(i == 97)
  545. certID = stream.readUnsignedWord();
  546. else
  547. if(i == 98)
  548. certTemplateID = stream.readUnsignedWord();
  549. else
  550. if(i >= 100 && i < 110)
  551. {
  552. if(stackIDs == null)
  553. {
  554. stackIDs = new int[10];
  555. stackAmounts = new int[10];
  556. }
  557. stackIDs[i - 100] = stream.readUnsignedWord();
  558. stackAmounts[i - 100] = stream.readUnsignedWord();
  559. } else
  560. if(i == 110)
  561. anInt167 = stream.readUnsignedWord();
  562. else
  563. if(i == 111)
  564. anInt192 = stream.readUnsignedWord();
  565. else
  566. if(i == 112)
  567. anInt191 = stream.readUnsignedWord();
  568. else
  569. if(i == 113)
  570. anInt196 = stream.readSignedByte();
  571. else
  572. if(i == 114)
  573. anInt184 = stream.readSignedByte() * 5;
  574. else
  575. if(i == 115)
  576. team = stream.readUnsignedByte();
  577. else
  578. if(i == 121)
  579. lendID_test = stream.readUnsignedWord();
  580. else
  581. if(i == 122)
  582. lendTemplateID_test = stream.readUnsignedWord();
  583. } while(true);
  584. }
  585.  
  586. public static ItemDef forID(int i)
  587. {
  588. for(int j = 0; j < 10; j++)
  589. if(cache[j].id == i)
  590. return cache[j];
  591.  
  592. cacheIndex = (cacheIndex + 1) % 10;
  593. ItemDef itemDef = cache[cacheIndex];
  594. stream.currentOffset = streamIndices[i];
  595. itemDef.id = i;
  596. itemDef.setDefaults();
  597. itemDef.readValues(stream);
  598. itemDef = ItemDef_2.itemDef(i,itemDef);
  599. if(itemDef.certTemplateID != -1)
  600. itemDef.toNote();
  601. if(itemDef.lendTemplateID != -1)
  602. itemDef.toLend();
  603. if(!isMembers && itemDef.membersObject)
  604. {
  605. itemDef.name = "Members Object";
  606. itemDef.description = "Login to a members' server to use this object.";
  607. itemDef.groundActions = null;
  608. itemDef.itemActions = null;
  609. itemDef.team = 0;
  610. }
  611. return itemDef;
  612. }
  613.  
  614. public void toNote()
  615. {
  616. ItemDef itemDef = forID(certTemplateID);
  617. modelID = itemDef.modelID;
  618. modelZoom = itemDef.modelZoom;
  619. modelRotation1 = itemDef.modelRotation1;
  620. modelRotation2 = itemDef.modelRotation2;
  621. anInt204 = itemDef.anInt204;
  622. modelOffset1 = itemDef.modelOffset1;
  623. modelOffset2 = itemDef.modelOffset2;
  624. modifiedModelColors = itemDef.modifiedModelColors;
  625. originalModelColors = itemDef.originalModelColors;
  626. ItemDef itemDef_1 = forID(certID);
  627. name = itemDef_1.name;
  628. membersObject = itemDef_1.membersObject;
  629. value = itemDef_1.value;
  630. String s = "a";
  631. char c = itemDef_1.name.charAt(0);
  632. if(c == 'A' || c == 'E' || c == 'I' || c == 'O' || c == 'U')
  633. s = "an";
  634. description = (new StringBuilder()).append("Swap this note at any bank for ").append(s).append(" ").append(itemDef_1.name).append(".").toString();
  635. stackable = true;
  636. }
  637.  
  638. public static Sprite getSprite(int i, int j, int k)
  639. {
  640. if(k == 0)
  641. {
  642. Sprite sprite = (Sprite)mruNodes1.insertFromCache(i);
  643. if(sprite != null && sprite.maxHeight != j && sprite.maxHeight != -1)
  644. {
  645. sprite.unlink();
  646. sprite = null;
  647. }
  648. if(sprite != null)
  649. return sprite;
  650. }
  651. ItemDef itemDef = forID(i);
  652. if(itemDef.stackIDs == null)
  653. j = -1;
  654. if(j > 1)
  655. {
  656. int i1 = -1;
  657. for(int j1 = 0; j1 < 10; j1++)
  658. if(j >= itemDef.stackAmounts[j1] && itemDef.stackAmounts[j1] != 0)
  659. i1 = itemDef.stackIDs[j1];
  660.  
  661. if(i1 != -1)
  662. itemDef = forID(i1);
  663. }
  664. Model model = itemDef.method201(1);
  665. if(model == null)
  666. return null;
  667. Sprite sprite = null;
  668. if(itemDef.certTemplateID != -1)
  669. {
  670. sprite = getSprite(itemDef.certID, 10, -1);
  671. if(sprite == null)
  672. return null;
  673. }
  674. if(itemDef.lendTemplateID != -1)
  675. {
  676. sprite = getSprite(itemDef.lendID, 50, 0);
  677. if(sprite == null)
  678. return null;
  679. }
  680. Sprite sprite2 = new Sprite(32, 32);
  681. int k1 = Texture.textureInt1;
  682. int l1 = Texture.textureInt2;
  683. int ai[] = Texture.anIntArray1472;
  684. int ai1[] = DrawingArea.pixels;
  685. int i2 = DrawingArea.width;
  686. int j2 = DrawingArea.height;
  687. int k2 = DrawingArea.topX;
  688. int l2 = DrawingArea.bottomX;
  689. int i3 = DrawingArea.topY;
  690. int j3 = DrawingArea.bottomY;
  691. Texture.aBoolean1464 = false;
  692. DrawingArea.initDrawingArea(32, 32, sprite2.myPixels);
  693. DrawingArea.drawPixels(32, 0, 0, 0, 32);
  694. Texture.method364();
  695. int k3 = itemDef.modelZoom;
  696. if(k == -1)
  697. k3 = (int)((double)k3 * 1.5D);
  698. if(k > 0)
  699. k3 = (int)((double)k3 * 1.04D);
  700. int l3 = Texture.anIntArray1470[itemDef.modelRotation1] * k3 >> 16;
  701. int i4 = Texture.anIntArray1471[itemDef.modelRotation1] * k3 >> 16;
  702. model.method482(itemDef.modelRotation2, itemDef.anInt204, itemDef.modelRotation1, itemDef.modelOffset1, l3 + model.modelHeight / 2 + itemDef.modelOffset2, i4 + itemDef.modelOffset2);
  703. for(int i5 = 31; i5 >= 0; i5--)
  704. {
  705. for(int j4 = 31; j4 >= 0; j4--)
  706. {
  707. if(sprite2.myPixels[i5 + j4 * 32] != 0)
  708. continue;
  709. if(i5 > 0 && sprite2.myPixels[(i5 - 1) + j4 * 32] > 1)
  710. {
  711. sprite2.myPixels[i5 + j4 * 32] = 1;
  712. continue;
  713. }
  714. if(j4 > 0 && sprite2.myPixels[i5 + (j4 - 1) * 32] > 1)
  715. {
  716. sprite2.myPixels[i5 + j4 * 32] = 1;
  717. continue;
  718. }
  719. if(i5 < 31 && sprite2.myPixels[i5 + 1 + j4 * 32] > 1)
  720. {
  721. sprite2.myPixels[i5 + j4 * 32] = 1;
  722. continue;
  723. }
  724. if(j4 < 31 && sprite2.myPixels[i5 + (j4 + 1) * 32] > 1)
  725. sprite2.myPixels[i5 + j4 * 32] = 1;
  726. }
  727.  
  728. }
  729.  
  730. if(k > 0)
  731. {
  732. for(int j5 = 31; j5 >= 0; j5--)
  733. {
  734. for(int k4 = 31; k4 >= 0; k4--)
  735. {
  736. if(sprite2.myPixels[j5 + k4 * 32] != 0)
  737. continue;
  738. if(j5 > 0 && sprite2.myPixels[(j5 - 1) + k4 * 32] == 1)
  739. {
  740. sprite2.myPixels[j5 + k4 * 32] = k;
  741. continue;
  742. }
  743. if(k4 > 0 && sprite2.myPixels[j5 + (k4 - 1) * 32] == 1)
  744. {
  745. sprite2.myPixels[j5 + k4 * 32] = k;
  746. continue;
  747. }
  748. if(j5 < 31 && sprite2.myPixels[j5 + 1 + k4 * 32] == 1)
  749. {
  750. sprite2.myPixels[j5 + k4 * 32] = k;
  751. continue;
  752. }
  753. if(k4 < 31 && sprite2.myPixels[j5 + (k4 + 1) * 32] == 1)
  754. sprite2.myPixels[j5 + k4 * 32] = k;
  755. }
  756.  
  757. }
  758.  
  759. } else
  760. if(k == 0)
  761. {
  762. for(int k5 = 31; k5 >= 0; k5--)
  763. {
  764. for(int l4 = 31; l4 >= 0; l4--)
  765. if(sprite2.myPixels[k5 + l4 * 32] == 0 && k5 > 0 && l4 > 0 && sprite2.myPixels[(k5 - 1) + (l4 - 1) * 32] > 0)
  766. sprite2.myPixels[k5 + l4 * 32] = 0x302020;
  767.  
  768. }
  769.  
  770. }
  771. if(itemDef.certTemplateID != -1)
  772. {
  773. int l5 = sprite.maxWidth;
  774. int j6 = sprite.maxHeight;
  775. sprite.maxWidth = 32;
  776. sprite.maxHeight = 32;
  777. sprite.drawSprite(0, 0);
  778. sprite.maxWidth = l5;
  779. sprite.maxHeight = j6;
  780. }
  781. if(itemDef.lendTemplateID != -1)
  782. {
  783. int l5 = sprite.maxWidth;
  784. int j6 = sprite.maxHeight;
  785. sprite.maxWidth = 32;
  786. sprite.maxHeight = 32;
  787. sprite.drawSprite(0, 0);
  788. sprite.maxWidth = l5;
  789. sprite.maxHeight = j6;
  790. }
  791. if(k == 0)
  792. mruNodes1.removeFromCache(sprite2, i);
  793. DrawingArea.initDrawingArea(j2, i2, ai1);
  794. DrawingArea.setDrawingArea(j3, k2, l2, i3);
  795. Texture.textureInt1 = k1;
  796. Texture.textureInt2 = l1;
  797. Texture.anIntArray1472 = ai;
  798. Texture.aBoolean1464 = true;
  799. if(itemDef.stackable)
  800. sprite2.maxWidth = 33;
  801. else
  802. sprite2.maxWidth = 32;
  803. sprite2.maxHeight = j;
  804. return sprite2;
  805. }
  806.  
  807. public Model method201(int i)
  808. {
  809. if(stackIDs != null && i > 1)
  810. {
  811. int j = -1;
  812. for(int k = 0; k < 10; k++)
  813. if(i >= stackAmounts[k] && stackAmounts[k] != 0)
  814. j = stackIDs[k];
  815.  
  816. if(j != -1)
  817. return forID(j).method201(1);
  818. }
  819. Model model = (Model)mruNodes2.insertFromCache(id);
  820. if(model != null)
  821. return model;
  822. model = Model.method462(modelID);
  823. if(model == null)
  824. return null;
  825. if(anInt167 != 128 || anInt192 != 128 || anInt191 != 128)
  826. model.method478(anInt167, anInt191, anInt192);
  827. if(modifiedModelColors != null)
  828. {
  829. for(int l = 0; l < modifiedModelColors.length; l++)
  830. model.method476(modifiedModelColors[l], originalModelColors[l]);
  831.  
  832. }
  833. model.method479(64 + anInt196, 768 + anInt184, -50, -10, -50, true);
  834. model.aBoolean1659 = true;
  835. mruNodes2.removeFromCache(model, id);
  836. return model;
  837. }
  838.  
  839. public Model method202(int i)
  840. {
  841. if(stackIDs != null && i > 1)
  842. {
  843. int j = -1;
  844. for(int k = 0; k < 10; k++)
  845. if(i >= stackAmounts[k] && stackAmounts[k] != 0)
  846. j = stackIDs[k];
  847.  
  848. if(j != -1)
  849. return forID(j).method202(1);
  850. }
  851. Model model = Model.method462(modelID);
  852. if(model == null)
  853. return null;
  854. if(modifiedModelColors != null)
  855. {
  856. for(int l = 0; l < modifiedModelColors.length; l++)
  857. model.method476(modifiedModelColors[l], originalModelColors[l]);
  858.  
  859. }
  860. return model;
  861. }
  862.  
  863. public ItemDef()
  864. {
  865. id = -1;
  866. }
  867.  
  868. public int lendID;
  869. public int lendTemplateID;
  870. public static String loc = signlink.findcachedir();
  871. public static int ITEMAMOUNT = 18635;
  872. public byte aByte154;
  873. public int value;
  874. public int modifiedModelColors[];
  875. public int id;
  876. static MRUNodes mruNodes1 = new MRUNodes(100);
  877. public static MRUNodes mruNodes2 = new MRUNodes(50);
  878. public int originalModelColors[];
  879. public boolean membersObject;
  880. public int anInt162;
  881. public int certTemplateID;
  882. public int anInt164;
  883. public int anInt165;
  884. public int anInt166;
  885. public int anInt167;
  886. public String groundActions[];
  887. public int modelOffset1;
  888. public String name;
  889. public static ItemDef cache[];
  890. public int anInt173;
  891. public int modelID;
  892. public int anInt175;
  893. public boolean stackable;
  894. public String description;
  895. public int certID;
  896. public static int cacheIndex;
  897. public int modelZoom;
  898. public static boolean isMembers = true;
  899. public static Stream stream;
  900. public int anInt184;
  901. public int anInt185;
  902. public int anInt188;
  903. public String itemActions[];
  904. public int modelRotation1;
  905. public int anInt191;
  906. public int anInt192;
  907. public int stackIDs[];
  908. public int modelOffset2;
  909. public static int streamIndices[];
  910. public int anInt196;
  911. public int anInt197;
  912. public int modelRotation2;
  913. public int anInt200;
  914. public int stackAmounts[];
  915. public int team;
  916. public static int totalItems;
  917. public int anInt204;
  918. public byte aByte205;
  919.  
  920. }
Advertisement
Add Comment
Please, Sign In to add comment