Advertisement
mrextremez

Item

Apr 22nd, 2014
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.39 KB | None | 0 0
  1. package com.zarketh.model;
  2.  
  3. import java.io.File;
  4. import java.io.FileInputStream;
  5. import java.io.IOException;
  6.  
  7. import com.zarketh.Constants;
  8. import com.zarketh.InstanceDistributor;
  9. import com.zarketh.model.entity.player.PlayerConstants;
  10.  
  11. /**
  12. * A collection of item methods.
  13. *
  14. * @author Daiki
  15. * @author Graham
  16. * @author Lukas
  17. */
  18. public class Item {
  19.  
  20. private int id;
  21. private int amount;
  22.  
  23. // Few item types for equipping
  24. public static int capes[] = { 15352, 20771, 5607, 9948, 9949, 10499, 10498,
  25. 9747, 9748, 9750, 9751, 9753, 9754, 9756, 9757, 9759, 9760, 9762,
  26. 9763, 9765, 9766, 9768, 9769, 9771, 9772, 9774, 9775, 9777, 9778,
  27. 9780, 9781, 9783, 9784, 9786, 9787, 9789, 9790, 9792, 9793, 9795,
  28. 9796, 9798, 9799, 9801, 9802, 9804, 9805, 9807, 9808, 9810, 9811,
  29. 9813, 9747, 9750, 9753, 9756, 9759, 9762, 9765, 9768, 9771, 9774,
  30. 9777, 9780, 9783, 9786, 9789, 9792, 9795, 9798, 9801, 9804, 9807,
  31. 9810, 9948, 12169, 18509, 9747, 3781, 3783, 3785, 3787, 3789, 3777,
  32. 3779, 10448, 3759, 3761, 3763, 3765, 6111, 6570, 6568, 1007, 1019,
  33. 1021, 1023, 19311, 1027, 1029, 1031, 1052, 2412, 2413, 2414, 4304,
  34. 4315, 4317, 4319, 9948, 9949, 10450, 4321, 4323, 4325, 4327, 4329,
  35. 4331, 4333, 4335, 4337, 4339, 4341, 10446, 4343, 4345, 4347, 4349,
  36. 7918, 4351, 4353, 4355, 4357, 4359, 4361, 4363, 19709, 4365, 4367,
  37. 4369, 4371, 4373, 4375, 4377, 4379, 4381, 4383, 4385, 9748, 9751,
  38. 9754, 9757, 9760, 9763, 9766, 9769, 9772, 9775, 9778, 9781, 9784,
  39. 9787, 9790, 9793, 9796, 9799, 9802, 9805, 9808, 9811, 9949, 12170,
  40. 4387, 4389, 4391, 4393, 4395, 4397, 4399, 4401, 4403, 4405, 4407,
  41. 12169, 12170, 4409, 4411, 4413, 4514, 4516, 6070, 6568, 6570,
  42. 15432, 15433, 18508, 19111, 4041, 4042, 15345, 15347, 15349, 19748,
  43. 15449, 15454, 15459, 15464, 14641, 15434, 15432, 14642, 14645,
  44. 15433, 15435, 15474 };
  45.  
  46. public static int boots[] = { 11728, 11732, 7596, 6619, 7159, 7991, 6666,
  47. 6061, 6106, 88, 89, 626, 628, 630, 632, 634, 1061, 1837, 1846,
  48. 10958, 2577, 2579, 2894, 9921, 21787, 21790, 21793, 2904, 2914,
  49. 2924, 2934, 3061, 3105, 3107, 3791, 4097, 4107, 4117, 11016, 13675,
  50. 4119, 15043, 4121, 4123, 4125, 4127, 4129, 4131, 4310, 5064, 5345,
  51. 5557, 21787, 21793, 21791, 10724, 7114, 14605, 6069, 6106, 6143,
  52. 6145, 6147, 10839, 6328, 6920, 6349, 6357, 3393, 16272, 16359, 5796, 16931, 16269,
  53. 16353, 16012, 16115, 17215, 17317 };
  54.  
  55. public static int gloves[] = { 10336, 8842, 7595, 6629, 2491, 1065, 2487,
  56. 15044, 2489, 3060, 1495, 775, 777, 778, 6708, 1059, 1063, 1065,
  57. 1580, 2487, 2489, 9922, 10368, 10376, 2491, 2902, 2912, 2922, 2932,
  58. 2942, 3060, 3799, 4095, 4105, 4115, 18347, 4308, 5556, 6068, 6110,
  59. 6149, 6151, 6153, 6922, 7454, 7455, 7456, 10725, 14602, 11133,
  60. 7457, 7458, 7459, 7460, 7461, 7462, 6330, 3391, 11118, 11126, 11133,
  61. 15946, 16239, 16195, 17171, 15943, 16287 };
  62.  
  63. public static int shields[] = { 12929, 5609, 10352, 8850, 8849, 8848, 8847,
  64. 8846, 8845, 8844, 11284, 7342, 7348, 7354, 7360, 7334, 7340, 7347,
  65. 7352, 7358, 7356, 7350, 7344, 7332, 7338, 7336, 7360, 1171, 1173,
  66. 2890, 9731, 18691, 1175, 1177, 1179, 1181, 1183, 1185, 1187, 1189,
  67. 1191, 1193, 1195, 7053, 19712, 1197, 1199, 1201, 1540, 2589, 2597,
  68. 2603, 2611, 2621, 2629, 2659, 19340, 2667, 2675, 2890, 3122, 3488,
  69. 3758, 3839, 3840, 3841, 3842, 3843, 3844, 4072, 4156, 4224, 4225,
  70. 4226, 4227, 4228, 4229, 4230, 4231, 4232, 4233, 4234, 4302, 4507,
  71. 4512, 6215, 6217, 6219, 6221, 6223, 18747, 6225, 6227, 6229, 6231,
  72. 6233, 6235, 6237, 6239, 6241, 6243, 6245, 6247, 6249, 6251, 6253,
  73. 6255, 6257, 6259, 6261, 6263, 6265, 6267, 6269, 6271, 6273, 6275,
  74. 6277, 6279, 6524, 6889, 20072, 19617, 13740, 14579, 13738, 13742,
  75. 13744, 11283, 13734, 13736, 18359, 18361, 18363, 17273, 15815, 17361, 15818,
  76. 17355 };
  77.  
  78. public static int hats[] = { 11789, 10507, 9672, 12866, 20772, 770, 4041,
  79. 4042, 10836, 10547, 10548, 10549, 10550, 10334, 10342, 10350, 1038,
  80. 11665, 11664, 11663, 9814, 9749, 9752, 9755, 9758, 9761, 9764,
  81. 9767, 9770, 9773, 9776, 9779, 9782, 9785, 9788, 9791, 9794, 9797,
  82. 9800, 9803, 9806, 9809, 9812, 11718, 10828, 4502, 7319, 7321, 7323,
  83. 7325, 18746, 19314, 7327, 1167, 8074, 4168, 1169, 6665, 6665, 7321,
  84. 6886, 6547, 6548, 12171, 2645, 2647, 2649, 4856, 4857, 4858, 4859,
  85. 4880, 4881, 20949, 20950, 20951, 20952, 4882, 4883, 10456, 4904,
  86. 4905, 4906, 4907, 4928, 4929, 4930, 4931, 15039, 4952, 4953, 4954,
  87. 9920, 9950, 4955, 4976, 4977, 4978, 4979, 4732, 4753, 4611, 6188,
  88. 6182, 4511, 10452, 4056, 4071, 4724, 2639, 2641, 2643, 2665, 6109,
  89. 5525, 5527, 5529, 13950, 5531, 5533, 5535, 5537, 8963, 5539, 5541,
  90. 5543, 5545, 5547, 5549, 5551, 10382, 10454, 74, 579, 656, 658, 660,
  91. 662, 664, 740, 1017, 1040, 1042, 13864, 13876, 1044, 1046, 1048,
  92. 1050, 1053, 1055, 1057, 1137, 1139, 1141, 1143, 9925, 1145, 1147,
  93. 1149, 1151, 1153, 1155, 1157, 1159, 1161, 1163, 1165, 13672, 10374,
  94. 1506, 1949, 2422, 2581, 2587, 2595, 2605, 2613, 2619, 2627, 2631,
  95. 15602, 15608, 15614, 15620, 2633, 2635, 2637, 2651, 2657, 2673,
  96. 2900, 2910, 2920, 2930, 2940, 10390, 2978, 2979, 2980, 15509,
  97. 21262, 21258, 21260, 21264, 2981, 2982, 2983, 2984, 2985, 2986,
  98. 2987, 2988, 6656, 2989, 2990, 2991, 2992, 2993, 2994, 2995, 3057,
  99. 3385, 3486, 3748, 3749, 3751, 3753, 3797, 4071, 4089, 3755, 4099,
  100. 4109, 4164, 4302, 4506, 4511, 4513, 4515, 4551, 4567, 4708, 4716,
  101. 4724, 4745, 4753, 1037, 4856, 4857, 4858, 4859, 4880, 4881, 4882,
  102. 4883, 4904, 4905, 4906, 4907, 4952, 4953, 4954, 4955, 4976, 4977,
  103. 4978, 4979, 5013, 5014, 7124, 7130, 7136, 5554, 5574, 6109, 6128,
  104. 6131, 6137, 6182, 6188, 6335, 12595, 12207, 6337, 6339, 2151, 6345,
  105. 6355, 6365, 6375, 6382, 6392, 6400, 6918, 6656, 2581, 7539, 15492,
  106. 8921, 15488, 15490, 7394, 7396, 7534, 5574, 6885, 6858, 6860, 6862,
  107. 6856, 6326, 6128, 14494, 6137, 7400, 7323, 7325, 7327, 7003, 13101,
  108. 13263, 20135, 20147, 16701, 20159, 13896, 18510, 16691, 14499,
  109. 10045, 16697, 13920, 13922, 13950, 12936, 12943, 12950, 12957,
  110. 13938, 16693, 13952, 13940, 16695 };
  111.  
  112. public static int amulets[] = { 10344, 11128, 1654, 1656, 1658, 1660, 1662,
  113. 1664, 8081, 10474, 8033, 7968, 6585, 86, 87, 295, 421, 552, 589,
  114. 15511, 1478, 1692, 1694, 10472, 10470, 1696, 1698, 1700, 1702,
  115. 1704, 1706, 1708, 1710, 1712, 1725, 1727, 9470, 1729, 1731, 4021,
  116. 4081, 4250, 4677, 6040, 6041, 6208, 1718, 1722, 6857, 6859, 6861,
  117. 6863, 6859, 6863, 6857, 18335, 18333, 18334, 15126, 19335 };
  118.  
  119. public static int arrows[] = { 8052, 8065, 7919, 7906, 78, 598, 877, 878,
  120. 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891,
  121. 892, 893, 942, 2532, 2533, 2534, 2535, 2536, 2537, 2538, 2539,
  122. 10384, 2540, 2541, 2866, 4160, 4172, 4173, 4174, 4175, 4740, 5616,
  123. 5617, 9142, 5618, 5619, 5620, 5621, 5622, 5623, 5624, 5625, 5626,
  124. 5627, 6061, 606, 9241, 9242, 9243, 9244, 9245, 11212, 15243, 9140,
  125. 9141, 9142, 9143, 9144, 9240, 15954, 15965, 15976, 15987, 16462, 16517,
  126. 16572, 16627, 15957, 15979, 15990, 16477, 16532, 16587, 16642 };
  127.  
  128.  
  129. public static int rings[] = { 773, 1635, 1637, 1639, 1641, 1643, 1645,
  130. 2550, 2552, 2554, 2556, 2558, 2560, 2562, 2564, 2566, 2568, 2570,
  131. 2572, 4202, 4657, 6465, 6737, 6731, 6735, 6735, 6583, 6733, 19669,
  132. 15220, 15017, 15019, 15020, 15018 };
  133.  
  134. public static int body[] = { 9674, 14600, 12873, 13870, 19787, 767, 581,
  135. 10330, 10338, 10348, 8839, 10551, 11724, 11720, 7362, 7364, 636,
  136. 638, 640, 642, 644, 426, 1005, 1757, 7592, 6617, 7376, 544, 7372,
  137. 7370, 577, 3793, 3775, 10378, 3773, 3771, 3769, 3767, 6139, 1135,
  138. 2499, 2501, 10564, 1035, 540, 5553, 9924, 14936, 10386, 4757, 1833,
  139. 6388, 6384, 4111, 4101, 4091, 6186, 6184, 6180, 3058, 10458, 10460,
  140. 10462, 4509, 15040, 4504, 4069, 4728, 4736, 4712, 6107, 2661, 3140,
  141. 1101, 1103, 6654, 10837, 13858, 15606, 15612, 15618, 15600, 1105,
  142. 1107, 1109, 1111, 1113, 1115, 1117, 1119, 1121, 1123, 1125, 11017,
  143. 13673, 13870, 19785, 1127, 1129, 1131, 1133, 2583, 2591, 2599,
  144. 2607, 2615, 2623, 2653, 7110, 7122, 7128, 7134, 2669, 3481, 4712,
  145. 4720, 4728, 4749, 4892, 4893, 4894, 4895, 4916, 10727, 13944, 4917,
  146. 4918, 4919, 4964, 2896, 2906, 2916, 2926, 2936, 4965, 4966, 4967,
  147. 6107, 6133, 6322, 6322, 10400, 10404, 10408, 15503, 10412, 10416,
  148. 10420, 10424, 10428, 10432, 10436, 6129, 75, 6916, 6916, 4111,
  149. 6654, 6654, 75, 7399, 7390, 7374, 5575, 14479, 14492, 19317, 10370,
  150. 2503, 6341, 6351, 3387, 5030, 5032, 5034, 5030, 5032, 5034, 7392,
  151. 546, 13887, 20139, 20163, 20151, 13944, 13908, 13944, 17241, 13932,
  152. 13911, 13910, 14497, 8956, 13946, 17249, 10043, 13934, 10954,
  153. 13913, 17243, 17239, 13884, 16023, 16090, 16733, 17259, 15847, 17237,
  154. 16020, 16087, 16727, 17253, 16078, 17193 };
  155.  
  156. public static int legs[] = { 9676, 12880, 19786, 769, 10332, 10340, 10346,
  157. 15041, 15042, 8840, 11722, 11726, 7378, 7380, 7382, 7368, 7366,
  158. 14501, 7388, 646, 648, 650, 652, 654, 428, 1097, 1095, 7593, 6625,
  159. 8020, 8015, 7384, 6141, 10464, 10466, 10468, 1835, 538, 1033, 5555,
  160. 4759, 6386, 6390, 2497, 2495, 2493, 1099, 4113, 4103, 4093, 6924,
  161. 6187, 6185, 6181, 9678, 2898, 2908, 2918, 2928, 2938, 3059, 4510,
  162. 4505, 4070, 14938, 13873, 13947, 6108, 538, 542, 548, 1011, 1013,
  163. 1015, 1067, 1069, 1071, 1073, 6655, 13674, 9923, 19320, 10380,
  164. 1075, 1077, 1079, 1081, 1083, 1085, 1087, 1089, 1091, 1093, 2585,
  165. 7116, 7126, 7132, 7138, 10388, 2593, 2601, 2609, 2617, 2625, 2655,
  166. 2663, 2671, 3059, 3389, 3472, 15604, 15610, 15616, 15622, 15505,
  167. 3473, 3474, 3475, 3476, 3477, 3478, 3479, 3480, 3483, 3485, 3795,
  168. 10402, 10406, 10410, 10414, 10418, 10422, 10426, 10430, 10434,
  169. 10956, 10438, 4087, 4585, 4712, 4714, 4722, 4730, 4738, 4751, 4759,
  170. 4874, 4875, 11018, 13861, 4876, 4877, 4898, 4899, 4900, 4901, 4922,
  171. 4923, 4924, 4925, 4946, 10726, 10372, 4947, 4948, 4949, 4970, 4971,
  172. 4972, 4973, 4994, 4995, 4996, 4997, 14603, 5048, 5050, 5052, 5576,
  173. 6107, 6130, 6187, 6390, 6386, 6390, 6396, 6404, 6135, 6809, 6916,
  174. 4091, 10838, 4111, 6655, 6654, 7398, 7398, 7386, 19339, 6324, 6343,
  175. 6353, 3387, 5036, 5038, 5040, 13893, 20143, 20167, 16671, 16679,
  176. 16669, 20155, 16673, 13917, 13919, 13914, 13916, 13914, 13947,
  177. 13935, 13917, 13916, 13949, 13937, 13919, 14490, 13890, 15935,
  178. 16206,1667, 16689, 15807, 16865, 15932, 16203, 16661, 16683, 17339 };
  179.  
  180. public static int platebody[] = { 9924, 9674, 12873, 8956, 19787, 767, 581,
  181. 10330, 17239, 17241, 10338, 10348, 8839, 10551, 11724, 11720, 636,
  182. 638, 640, 642, 644, 426, 8031, 8027, 6617, 544, 577, 3793, 3773,
  183. 3775, 3771, 3769, 3767, 6139, 1035, 540, 5553, 4757, 1833, 1835,
  184. 6388, 6384, 4111, 4101, 4868, 4869, 10370, 4870, 4871, 4892, 4893,
  185. 4894, 4895, 4916, 4917, 4918, 4919, 4940, 19317, 4941, 4942, 4943,
  186. 4964, 4965, 4966, 4967, 4988, 4989, 4990, 14936, 10378, 10386,
  187. 15040, 0x2f9a0eb, 6186, 6184, 14600, 6180, 3058, 4509, 4504, 4069,
  188. 4728, 4736, 10400, 19785, 4712, 6107, 2661, 3140, 1115, 1117, 1119,
  189. 1121, 1123, 1125, 1127, 2583, 2591, 2599, 2607, 2615, 6322, 2623,
  190. 2653, 2669, 3481, 4720, 14479, 19337, 4728, 4749, 2661, 6129, 6916,
  191. 4091, 6654, 6133, 75, 7399, 7390, 5575, 6341, 6351, 3387, 5030,
  192. 5032, 5034, 10837, 7392, 13887, 20139, 20163, 20151, 14497, 13858,
  193. 13944, 13870, 13908, 13944, 13932, 13911, 13910, 13946, 13934,
  194. 13913, 14479, 10564, 14492, 17243, 17249, 13884, 20147 };
  195.  
  196. public static int fullHelm[] = { 9672, 10507, 12866, 10547, 10548, 10549,
  197. 10550, 10334, 10342, 10350, 9814, 9749, 9752, 9755, 9758, 9761,
  198. 9764, 3748, 9767, 9770, 9773, 9776, 9779, 9782, 9785, 9788, 9791,
  199. 9794, 9797, 9800, 9803, 9806, 9809, 9812, 11718, 10828, 1147, 3748,
  200. 6137, 6128, 3753, 3755, 3749, 3751, 1149, 3751, 7594, 4708, 4716,
  201. 4745, 4732, 5554, 1673, 4753, 4732, 4753, 6188, 4511, 4056, 4071,
  202. 4724, 6109, 2665, 1153, 11335, 19336, 13263, 1155, 1157, 1159,
  203. 1161, 1163, 1165, 2587, 2595, 2605, 2613, 2619, 2627, 2657, 2673,
  204. 3486, 6402, 6394, 6131, 74, 7539, 7539, 7534, 14494, 5574, 6326,
  205. 13263, 20135, 13896, 13920, 13922, 13938, 16695, 16693, 16691,
  206. 16701, 16697, 16705, 16707, 16703, 13864, 18510, 15924, 16711,
  207. 15902, 16755, 15921, 16705, 16056, 17061, 16067 };
  208.  
  209. public static int fullMask[] = { 11789, 770, 4502, 6623, 7990, 7594, 1153,
  210. 1155, 1157, 10728, 7112, 9925, 1159, 1161, 1163, 1165, 4732, 5554,
  211. 4753, 4611, 6188, 3507, 4511, 11015, 15492, 1506, 3057, 4056, 4071,
  212. 4724, 2665, 1053, 1055, 1057, 20159, 13950, 13876, 13952, 13940,
  213. 4041, 4042, 20147 };
  214.  
  215. public static boolean[] itemStackable = new boolean[PlayerConstants.MAX_ITEMS];
  216.  
  217. public static boolean[] itemIsNote = new boolean[PlayerConstants.MAX_ITEMS];
  218.  
  219. static {
  220. int counter = 0;
  221. int c;
  222.  
  223. try {
  224. final FileInputStream dataIn = new FileInputStream(new File(
  225. Constants.DATA_DIRECTORY + "item/stackable.dat"));
  226. while ((c = dataIn.read()) != -1) {
  227. if (c == 0)
  228. itemStackable[counter] = false;
  229. else
  230. itemStackable[counter] = true;
  231. counter++;
  232. }
  233. dataIn.close();
  234. for (int i = 6568; i < 6800; i++)
  235. itemStackable[i] = false;
  236. final int[] stackID = { 15389, 6569, 6572, 6574, 6576, 6578, 6580,
  237. 6582, 6584, 6586, 6588, 6590, 6592, 6594, 6596, 6598, 6600,
  238. 6602, 6604, 6606, 6608, 6610, 6612, 6614, 6616, 6618, 6620,
  239. 6622, 6624, 6626, 6628, 6630, 6632, 6634, 6676, 6684, 6686,
  240. 6688, 6690, 6692, 6694, 6698, 6700, 6702, 6704, 6706, 6725,
  241. 6732, 6734, 6736, 6738, 6740, 6742, 6744, 6761, 6763, 6765,
  242. 6795, 6815, 6890, 6892, 6909, 6911, 6913, 6915, 6917, 6919,
  243. 6921, 6923, 6925, 6960, 6972, 6974, 6976, 6978, 6980, 6982,
  244. 6984, 7052, 7055, 7057, 7059, 7061, 7063, 7065, 7067, 7069,
  245. 7071, 7073, 7075, 7077, 7079, 7081, 7083, 7085, 7087, 7089,
  246. 7091, 7093, 7095, 7113, 7115, 7117, 7123, 7125, 7127, 7129,
  247. 7131, 7133, 7135, 7137, 7139, 7161, 7163, 7165, 7167, 7169,
  248. 7171, 7173, 7175, 7177, 7179, 7181, 7183, 7185, 7187, 7189,
  249. 7191, 7193, 7195, 7197, 7199, 7201, 7203, 7205, 7207, 7209,
  250. 7211, 7213, 7215, 7217, 7219, 7221, 7223, 7227, 7229, 7320,
  251. 7322, 15262, 7324, 7326, 7328, 7333, 7335, 7337, 7339,
  252. 7341, 7343, 7345, 7347, 617, 7349, 7351, 7353, 7355, 7357,
  253. 7359, 7361, 7363, 7365, 7367, 12530, 7369, 7371, 7373,
  254. 7375, 7377, 7379, 7381, 7383, 7385, 7387, 12158, 12159,
  255. 12160, 12161, 12539, 7389, 7391, 7393, 7395, 7397, 7414,
  256. 7417, 7419, 7434, 7436, 6319, 9976, 9977, 7438, 7440, 7442,
  257. 7444, 7446, 7448, 7450, 7452, 7467, 7469, 12155, 12183,
  258. 14485, 12048, 12044, 12060, 12020, 12010, 12779, 12095,
  259. 12056, 12809, 12068, 12064, 12092, 12801, 12054, 12066,
  260. 12022, 12819, 12815, 12783, 12799, 12074, 12088, 12072,
  261. 12052, 12096, 12098, 12100, 12102, 12104, 12106, 12108,
  262. 12076, 12817, 12042, 12062, 12008, 12036, 12028, 12532,
  263. 12078, 12811, 12813, 12785, 12024, 12086, 12038, 12016,
  264. 12046, 12124, 12080, 12032, 12030, 12034, 12821, 12058,
  265. 14624, 12793, 14624, 12012, 12070, 12082, 12163, 12014,
  266. 12803, 12805, 12807, 12026, 12018, 12789, 12777, 12084,
  267. 12040, 12787, 12090, 12797, 12823, 12094, 12791, 7522,
  268. 7548, 7549, 7550, 7551, 7552, 7553, 7554, 7555, 7556,
  269. 12425, 12445, 12428, 12459, 12533, 12838, 12460, 12432,
  270. 12839, 12430, 12446, 12440, 12834, 12447, 12433, 12429,
  271. 12443, 12443, 12443, 12443, 12461, 12431, 12422, 12448,
  272. 12458, 12458, 12458, 12458, 12458, 12458, 12458, 12462,
  273. 12829, 12426, 12444, 12441, 12454, 12453, 12424, 12463,
  274. 12835, 12836, 12840, 12455, 12468, 12427, 12436, 12467,
  275. 12452, 12464, 12439, 12438, 12423, 12830, 12451, 14622,
  276. 12826, 12449, 12450, 12841, 12465, 12831, 12457, 12854,
  277. 12854, 12442, 12456, 12837, 12832, 12466, 12434, 12833,
  278. 12827, 12828, 12435, 12825, 12437, 7557, 7558, 7559, 7560,
  279. 7561, 7562, 7563, 7937, 13879, 13880, 13881, 13882, 13883,
  280. 15243, 12434, 12438, 12825, 12158, 12159, 12160, 15242,
  281. 15273, 18831 };
  282. for (int i = 0; i < stackID.length; i++) {
  283. itemStackable[stackID[i]] = true;
  284. counter++;
  285. }
  286. // System.out.println("Loaded " + counter + " stackable data.");
  287. } catch (final IOException e) {
  288. System.out
  289. .println("Critical error while loading stackabledata! Trace:");
  290. e.printStackTrace();
  291. }
  292.  
  293. counter = 0;
  294.  
  295. try {
  296. final FileInputStream dataIn = new FileInputStream(
  297. Constants.DATA_DIRECTORY + "item/notes.dat");
  298. while ((c = dataIn.read()) != -1) {
  299. if (c == 0)
  300. itemIsNote[counter] = true;
  301. else
  302. itemIsNote[counter] = false;
  303. counter++;
  304. }
  305. dataIn.close();
  306. final int[] noteID = { 6569, 6572, 6574, 6576, 6578, 6580, 6582,
  307. 6584, 6586, 6588, 6590, 6592, 6594, 6596, 6598, 6600, 6602,
  308. 6604, 6606, 6608, 6610, 6612, 6614, 6616, 6618, 6620, 6622,
  309. 6624, 6626, 6628, 6630, 6632, 6634, 6676, 6684, 6686, 6688,
  310. 6690, 6692, 6694, 6698, 6700, 6702, 6704, 6706, 6725, 6732,
  311. 6734, 6736, 6738, 6740, 6742, 6744, 6761, 6763, 6765, 6795,
  312. 6815, 6890, 6892, 6909, 6911, 6913, 6915, 6917, 6919, 6921,
  313. 6923, 6925, 6960, 6972, 6974, 6976, 6978, 6980, 6982, 6984,
  314. 7052, 7055, 7057, 7059, 7061, 7063, 7065, 7067, 7069, 7071,
  315. 7073, 7075, 7077, 7079, 7081, 7083, 7085, 7087, 7089, 7091,
  316. 7093, 7095, 7113, 7115, 7117, 7123, 7125, 7127, 7129, 7131,
  317. 7133, 7135, 7137, 7139, 7161, 7163, 7165, 7167, 7169, 7171,
  318. 7173, 7175, 7177, 7179, 7181, 7183, 7185, 7187, 7189, 7191,
  319. 7193, 7195, 7197, 7199, 7201, 7203, 7205, 7207, 7209, 7211,
  320. 7213, 7215, 7217, 7219, 7221, 7223, 7227, 7229, 7320, 7322,
  321. 7324, 7326, 7328, 7333, 7335, 7337, 7339, 7341, 7343, 7345,
  322. 7347, 7349, 7351, 7353, 7355, 7357, 7359, 7361, 7363, 7365,
  323. 7367, 21627, 21625, 21629, 21631, 21633, 21635, 21637,
  324. 7369, 7371, 7373, 7375, 7377, 7379, 7381, 7383, 7385, 7387,
  325. 7407, 7389, 7391, 7393, 7395, 7397, 7414, 7417, 7419, 7434,
  326. 7436, 15273, 7438, 7440, 7442, 7444, 7446, 7448, 7450,
  327. 7452, 7467, 7469, 12048, 14485, 12044, 12060, 12020, 12010,
  328. 12779, 12095, 12056, 12809, 12068, 12092, 12801, 12054,
  329. 12066, 12022, 12819, 12815, 12783, 12799, 12074, 12088,
  330. 12072, 12052, 12096, 12098, 12100, 12102, 12104, 12106,
  331. 12108, 12076, 12817, 12042, 12062, 12008, 12036, 12028,
  332. 12532, 12078, 12811, 12813, 12785, 12024, 12086, 12038,
  333. 12016, 12046, 12124, 12080, 12032, 12030, 12034, 12821,
  334. 12058, 14624, 12793, 14624, 12012, 12070, 12082, 12014,
  335. 12803, 12805, 12807, 12026, 12018, 12789, 12777, 12084,
  336. 12040, 12787, 12090, 12797, 12823, 12094, 12791, 7522,
  337. 7549, 7551, 7553, 7555, 7557, 7559, 7561, 7563, 7567,
  338. 20265, 20267, 20269, 18831, 7569, 7571, 7937, 12048, 12044,
  339. 12020, 12010, 12779, 12095, 12056, 12809, 12068, 12092,
  340. 12801, 12054, 12066, 12022, 12819, 12815, 12783, 12799,
  341. 12074, 12088, 12072, 12052, 12096, 12098, 12100, 12102,
  342. 12104, 12106, 12108, 12076, 12817, 12042, 12062, 12008,
  343. 12036, 12028, 12532, 12078, 12811, 12813, 12785, 12024,
  344. 12086, 12038, 12016, 12046, 12124, 12080, 12032, 12030,
  345. 12034, 12821, 12058, 14624, 12793, 14624, 12012, 12070,
  346. 12082, 12014, 12803, 12805, 12807, 12026, 12018, 12789,
  347. 12777, 12084, 12040, 12787, 12090, 12797, 12823, 12094,
  348. 15273, 15242, 18831, 13361 };
  349. for (int i = 0; i < noteID.length; i++) {
  350. itemIsNote[noteID[i]] = true;
  351. counter++;
  352. }
  353. // System.out.println("Loaded " + counter + " note data.");
  354. } catch (final IOException e) {
  355. System.out.println("Critical error while loading notedata! Trace:");
  356. e.printStackTrace();
  357. }
  358. }
  359.  
  360. public static Item create(int id) {
  361. return new Item(id);
  362. }
  363.  
  364. public static Item create(int id, int amount) {
  365. return new Item(id, amount);
  366. }
  367.  
  368. public static boolean isFullHelm(int itemID) {
  369. for (final int element : fullHelm)
  370. if (element == itemID)
  371. return true;
  372. return false;
  373. }
  374.  
  375. public static boolean isFullMask(int itemID) {
  376. for (final int element : fullMask)
  377. if (element == itemID)
  378. return true;
  379. return false;
  380. }
  381.  
  382. public static boolean isPlate(int itemID) {
  383. for (final int element : platebody)
  384. if (element == itemID)
  385. return true;
  386. return false;
  387. }
  388.  
  389. public static int randomAmulet() {
  390. return amulets[(int) (Math.random() * amulets.length)];
  391. }
  392.  
  393. public static int randomArrows() {
  394. return arrows[(int) (Math.random() * arrows.length)];
  395. }
  396.  
  397. public static int randomBody() {
  398. return body[(int) (Math.random() * body.length)];
  399. }
  400.  
  401. public static int randomBoots() {
  402. return boots[(int) (Math.random() * boots.length)];
  403. }
  404.  
  405. public static int randomCape() {
  406. return capes[(int) (Math.random() * capes.length)];
  407. }
  408.  
  409. public static int randomGloves() {
  410. return gloves[(int) (Math.random() * gloves.length)];
  411. }
  412.  
  413. public static int randomHat() {
  414. return hats[(int) (Math.random() * hats.length)];
  415. }
  416.  
  417. public static int randomLegs() {
  418. return legs[(int) (Math.random() * legs.length)];
  419. }
  420.  
  421. public static int randomRing() {
  422. return rings[(int) (Math.random() * rings.length)];
  423. }
  424.  
  425. public static int randomShield() {
  426. return shields[(int) (Math.random() * shields.length)];
  427. }
  428.  
  429. public Item(int id) {
  430. this(id, 1);
  431. }
  432.  
  433. public Item(int id, int amount) {
  434. this.id = id;
  435. this.amount = amount;
  436. }
  437.  
  438. public int getCount() {
  439. return amount;
  440. }
  441.  
  442. public ItemDefinition getDefinition() {
  443. return InstanceDistributor.getItemManager().getItemDefinition(id);
  444. }
  445.  
  446. public int getId() { // no :D
  447. return id;
  448. }
  449.  
  450. public void setAmount(int amount) {
  451. this.amount = amount;
  452. }
  453.  
  454. public void setId(int id) {
  455. this.id = id;
  456. }
  457. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement