Guest User

player.java

a guest
Apr 26th, 2014
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.06 KB | None | 0 0
  1. // Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
  2. // Jad home page: http://www.kpdus.com/jad.html
  3. // Decompiler options: packimports(3)
  4.  
  5. public final class Player extends Entity {
  6.  
  7. public Model getRotatedModel() {
  8. if(!visible)
  9. return null;
  10. Model model = method452();
  11. if(model == null)
  12. return null;
  13. super.height = model.modelHeight;
  14. model.aBoolean1659 = true;
  15. if(aBoolean1699)
  16. return model;
  17. if(super.anInt1520 != -1 && super.anInt1521 != -1)
  18. {
  19. SpotAnim spotAnim = SpotAnim.cache[super.anInt1520];
  20. Model model_2 = spotAnim.getModel();
  21. if(model_2 != null)
  22. {
  23. Model model_3 = new Model(true, Class36.method532(super.anInt1521), false, model_2);
  24. model_3.method475(0, -super.anInt1524, 0);
  25. model_3.method469();
  26. model_3.method470(spotAnim.aAnimation_407.anIntArray353[super.anInt1521]);
  27. model_3.anIntArrayArray1658 = null;
  28. model_3.anIntArrayArray1657 = null;
  29. if(spotAnim.anInt410 != 128 || spotAnim.anInt411 != 128)
  30. model_3.method478(spotAnim.anInt410, spotAnim.anInt410, spotAnim.anInt411);
  31. model_3.method479(64 + spotAnim.anInt413, 850 + spotAnim.anInt414, -30, -50, -30, true);
  32. Model aclass30_sub2_sub4_sub6_1s[] = {
  33. model, model_3
  34. };
  35. model = new Model(aclass30_sub2_sub4_sub6_1s);
  36. }
  37. }
  38. if(aModel_1714 != null)
  39. {
  40. if(client.loopCycle >= anInt1708)
  41. aModel_1714 = null;
  42. if(client.loopCycle >= anInt1707 && client.loopCycle < anInt1708)
  43. {
  44. Model model_1 = aModel_1714;
  45. model_1.method475(anInt1711 - super.x, anInt1712 - anInt1709, anInt1713 - super.y);
  46. if(super.turnDirection == 512)
  47. {
  48. model_1.method473();
  49. model_1.method473();
  50. model_1.method473();
  51. } else
  52. if(super.turnDirection == 1024)
  53. {
  54. model_1.method473();
  55. model_1.method473();
  56. } else
  57. if(super.turnDirection == 1536)
  58. model_1.method473();
  59. Model aclass30_sub2_sub4_sub6s[] = {
  60. model, model_1
  61. };
  62. model = new Model(aclass30_sub2_sub4_sub6s);
  63. if(super.turnDirection == 512)
  64. model_1.method473();
  65. else
  66. if(super.turnDirection == 1024)
  67. {
  68. model_1.method473();
  69. model_1.method473();
  70. } else
  71. if(super.turnDirection == 1536)
  72. {
  73. model_1.method473();
  74. model_1.method473();
  75. model_1.method473();
  76. }
  77. model_1.method475(super.x - anInt1711, anInt1709 - anInt1712, super.y - anInt1713);
  78. }
  79. }
  80. model.aBoolean1659 = true;
  81. return model;
  82. }
  83.  
  84. public void updatePlayer(Stream stream)
  85. {
  86. stream.currentOffset = 0;
  87. anInt1702 = stream.readUnsignedByte();
  88. headIcon = stream.readUnsignedByte();
  89. skullIcon = stream.readUnsignedByte();
  90. //hintIcon = stream.readUnsignedByte();
  91. modHeadIcon = stream.readUnsignedByte();
  92. desc = null;
  93. team = 0;
  94. for(int j = 0; j < 12; j++)
  95. {
  96. int k = stream.readUnsignedByte();
  97. if(k == 0)
  98. {
  99. equipment[j] = 0;
  100. continue;
  101. }
  102. int i1 = stream.readUnsignedByte();
  103. equipment[j] = (k << 8) + i1;
  104. if(j == 0 && equipment[0] == 65535)
  105. {
  106. desc = EntityDef.forID(stream.readUnsignedWord());
  107. break;
  108. }
  109. if(equipment[j] >= 512 && equipment[j] - 512 < ItemDef.totalItems)
  110. {
  111. int l1 = ItemDef.forID(equipment[j] - 512).team;
  112. if(l1 != 0)
  113. team = l1;
  114. }
  115. }
  116.  
  117. for(int l = 0; l < 5; l++)
  118. {
  119. int j1 = stream.readUnsignedByte();
  120. if(j1 < 0 || j1 >= client.anIntArrayArray1003[l].length)
  121. j1 = 0;
  122. anIntArray1700[l] = j1;
  123. }
  124.  
  125. super.anInt1511 = stream.readUnsignedWord();
  126. if(super.anInt1511 == 65535)
  127. super.anInt1511 = -1;
  128. super.anInt1512 = stream.readUnsignedWord();
  129. if(super.anInt1512 == 65535)
  130. super.anInt1512 = -1;
  131. super.anInt1554 = stream.readUnsignedWord();
  132. if(super.anInt1554 == 65535)
  133. super.anInt1554 = -1;
  134. super.anInt1555 = stream.readUnsignedWord();
  135. if(super.anInt1555 == 65535)
  136. super.anInt1555 = -1;
  137. super.anInt1556 = stream.readUnsignedWord();
  138. if(super.anInt1556 == 65535)
  139. super.anInt1556 = -1;
  140. super.anInt1557 = stream.readUnsignedWord();
  141. if(super.anInt1557 == 65535)
  142. super.anInt1557 = -1;
  143. super.anInt1505 = stream.readUnsignedWord();
  144. if(super.anInt1505 == 65535)
  145. super.anInt1505 = -1;
  146. name = TextClass.fixName(TextClass.nameForLong(stream.readQWord()));
  147. combatLevel = stream.readUnsignedByte();
  148. skill = stream.readUnsignedWord();
  149. visible = true;
  150. aLong1718 = 0L;
  151. for(int k1 = 0; k1 < 12; k1++)
  152. {
  153. aLong1718 <<= 4;
  154. if(equipment[k1] >= 256)
  155. aLong1718 += equipment[k1] - 256;
  156. }
  157.  
  158. if(equipment[0] >= 256)
  159. aLong1718 += equipment[0] - 256 >> 4;
  160. if(equipment[1] >= 256)
  161. aLong1718 += equipment[1] - 256 >> 8;
  162. for(int i2 = 0; i2 < 5; i2++)
  163. {
  164. aLong1718 <<= 3;
  165. aLong1718 += anIntArray1700[i2];
  166. }
  167.  
  168. aLong1718 <<= 1;
  169. aLong1718 += anInt1702;
  170. }
  171.  
  172. public Model method452()
  173. {
  174. if(desc != null)
  175. {
  176. int j = -1;
  177. if(super.anim >= 0 && super.anInt1529 == 0)
  178. j = Animation.anims[super.anim].anIntArray353[super.anInt1527];
  179. else
  180. if(super.anInt1517 >= 0)
  181. j = Animation.anims[super.anInt1517].anIntArray353[super.anInt1518];
  182. Model model = desc.method164(-1, j, null);
  183. return model;
  184. }
  185. long l = aLong1718;
  186. int k = -1;
  187. int i1 = -1;
  188. int j1 = -1;
  189. int k1 = -1;
  190. if(super.anim >= 0 && super.anInt1529 == 0)
  191. {
  192. Animation animation = Animation.anims[super.anim];
  193. k = animation.anIntArray353[super.anInt1527];
  194. if(super.anInt1517 >= 0 && super.anInt1517 != super.anInt1511)
  195. i1 = Animation.anims[super.anInt1517].anIntArray353[super.anInt1518];
  196. if(animation.anInt360 >= 0)
  197. {
  198. j1 = animation.anInt360;
  199. l += j1 - equipment[5] << 40;
  200. }
  201. if(animation.anInt361 >= 0)
  202. {
  203. k1 = animation.anInt361;
  204. l += k1 - equipment[3] << 48;
  205. }
  206. } else
  207. if(super.anInt1517 >= 0)
  208. k = Animation.anims[super.anInt1517].anIntArray353[super.anInt1518];
  209. Model model_1 = (Model) mruNodes.insertFromCache(l);
  210. if(model_1 == null)
  211. {
  212. boolean flag = false;
  213. for(int i2 = 0; i2 < 12; i2++)
  214. {
  215. int k2 = equipment[i2];
  216. if(k1 >= 0 && i2 == 3)
  217. k2 = k1;
  218. if(j1 >= 0 && i2 == 5)
  219. k2 = j1;
  220. if(k2 >= 256 && k2 < 512 && !IDK.cache[k2 - 256].method537())
  221. flag = true;
  222. if(k2 >= 512 && !ItemDef.forID(k2 - 512).method195(anInt1702))
  223. flag = true;
  224. }
  225.  
  226. if(flag)
  227. {
  228. if(aLong1697 != -1L)
  229. model_1 = (Model) mruNodes.insertFromCache(aLong1697);
  230. if(model_1 == null)
  231. return null;
  232. }
  233. }
  234. if(model_1 == null)
  235. {
  236. Model aclass30_sub2_sub4_sub6s[] = new Model[12];
  237. int j2 = 0;
  238. for(int l2 = 0; l2 < 12; l2++)
  239. {
  240. int i3 = equipment[l2];
  241. if(k1 >= 0 && l2 == 3)
  242. i3 = k1;
  243. if(j1 >= 0 && l2 == 5)
  244. i3 = j1;
  245. if(i3 >= 256 && i3 < 512)
  246. {
  247. Model model_3 = IDK.cache[i3 - 256].method538();
  248. if(model_3 != null)
  249. aclass30_sub2_sub4_sub6s[j2++] = model_3;
  250. }
  251. if(i3 >= 512)
  252. {
  253. Model model_4 = ItemDef.forID(i3 - 512).method196(anInt1702);
  254. if(model_4 != null)
  255. aclass30_sub2_sub4_sub6s[j2++] = model_4;
  256. }
  257. }
  258.  
  259. model_1 = new Model(j2, aclass30_sub2_sub4_sub6s);
  260. for(int j3 = 0; j3 < 5; j3++)
  261. if(anIntArray1700[j3] != 0)
  262. {
  263. model_1.method476(client.anIntArrayArray1003[j3][0], client.anIntArrayArray1003[j3][anIntArray1700[j3]]);
  264. if(j3 == 1)
  265. model_1.method476(client.anIntArray1204[0], client.anIntArray1204[anIntArray1700[j3]]);
  266. }
  267.  
  268. model_1.method469();
  269. model_1.method479(64, 850, -30, -50, -30, true);
  270. mruNodes.removeFromCache(model_1, l);
  271. aLong1697 = l;
  272. }
  273. if(aBoolean1699)
  274. return model_1;
  275. Model model_2 = Model.aModel_1621;
  276. model_2.method464(model_1, Class36.method532(k) & Class36.method532(i1));
  277. if(k != -1 && i1 != -1)
  278. model_2.method471(Animation.anims[super.anim].anIntArray357, i1, k);
  279. else
  280. if(k != -1)
  281. model_2.method470(k);
  282. model_2.method466();
  283. model_2.anIntArrayArray1658 = null;
  284. model_2.anIntArrayArray1657 = null;
  285. return model_2;
  286. }
  287.  
  288. public boolean isVisible()
  289. {
  290. return visible;
  291. }
  292.  
  293. public int privelage;
  294. public Model method453()
  295. {
  296. if(!visible)
  297. return null;
  298. if(desc != null)
  299. return desc.method160();
  300. boolean flag = false;
  301. for(int i = 0; i < 12; i++)
  302. {
  303. int j = equipment[i];
  304. if(j >= 256 && j < 512 && !IDK.cache[j - 256].method539())
  305. flag = true;
  306. if(j >= 512 && !ItemDef.forID(j - 512).method192(anInt1702))
  307. flag = true;
  308. }
  309.  
  310. if(flag)
  311. return null;
  312. Model aclass30_sub2_sub4_sub6s[] = new Model[12];
  313. int k = 0;
  314. for(int l = 0; l < 12; l++)
  315. {
  316. int i1 = equipment[l];
  317. if(i1 >= 256 && i1 < 512)
  318. {
  319. Model model_1 = IDK.cache[i1 - 256].method540();
  320. if(model_1 != null)
  321. aclass30_sub2_sub4_sub6s[k++] = model_1;
  322. }
  323. if(i1 >= 512)
  324. {
  325. Model model_2 = ItemDef.forID(i1 - 512).method194(anInt1702);
  326. if(model_2 != null)
  327. aclass30_sub2_sub4_sub6s[k++] = model_2;
  328. }
  329. }
  330.  
  331. Model model = new Model(k, aclass30_sub2_sub4_sub6s);
  332. for(int j1 = 0; j1 < 5; j1++)
  333. if(anIntArray1700[j1] != 0)
  334. {
  335. model.method476(client.anIntArrayArray1003[j1][0], client.anIntArrayArray1003[j1][anIntArray1700[j1]]);
  336. if(j1 == 1)
  337. model.method476(client.anIntArray1204[0], client.anIntArray1204[anIntArray1700[j1]]);
  338. }
  339.  
  340. return model;
  341. }
  342.  
  343. Player()
  344. {
  345. aLong1697 = -1L;
  346. aBoolean1699 = false;
  347. anIntArray1700 = new int[5];
  348. visible = false;
  349. anInt1715 = 9;
  350. equipment = new int[12];
  351. }
  352.  
  353. private long aLong1697;
  354. public EntityDef desc;
  355. boolean aBoolean1699;
  356. final int[] anIntArray1700;
  357. public int team;
  358. private int anInt1702;
  359. public String name;
  360. static MRUNodes mruNodes = new MRUNodes(260);
  361. public int combatLevel;
  362. public int headIcon;
  363. public int modHeadIcon;
  364. public int skullIcon;
  365. public int hintIcon;
  366. public int anInt1707;
  367. int anInt1708;
  368. int anInt1709;
  369. boolean visible;
  370. int anInt1711;
  371. int anInt1712;
  372. int anInt1713;
  373. Model aModel_1714;
  374. private int anInt1715;
  375. public final int[] equipment;
  376. private long aLong1718;
  377. int anInt1719;
  378. int anInt1720;
  379. int anInt1721;
  380. int anInt1722;
  381. int skill;
  382.  
  383. }
Advertisement
Add Comment
Please, Sign In to add comment