Advertisement
Guest User

Untitled

a guest
Apr 11th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 475.31 KB | None | 0 0
  1. private void drawChatArea(RSImageProducer chatback, int paddingX, int paddingY) {
  2. int yPosOffset = 0;
  3. int xPosOffset = 0;
  4. chatback.initDrawingArea();
  5. Texture.anIntArray1472 = anIntArray1180;
  6. if (toggleFullscreen) {
  7. if ((!this.messagePromptRaised) && (this.aString844 == null) && (this.backDialogID == -1) && (this.dialogID == -1) && (this.inputDialogState == 0))
  8. DrawingArea.drawAlphaGradient(7 + paddingX, 7 + paddingY, 505, 130, 11908533, 0, 70);
  9. else
  10. chatArea[1].drawSprite1(paddingX, paddingY, 128);
  11. } else
  12. chatArea[getSpriteID()].drawSprite(0, 0);
  13. if(spriteChanged){
  14. inputTaken = true;
  15. }
  16. if(is459) {
  17. TextDrawingArea textDrawingArea = newRegularFont;
  18. if(messagePromptRaised) {
  19. newBoldFont.drawCenteredString(aString1121, 239, 60, 0, -1);
  20. newBoldFont.drawCenteredString( promptInput + "*", 239, 80, 128, -1);
  21. } else if(inputDialogState == 1) {
  22. newBoldFont.drawCenteredString("Enter amount:", 239, 60, 0, -1);
  23. newBoldFont.drawCenteredString(amountOrNameInput + "*", 239, 80, 128, -1);
  24. } else if(inputDialogState == 2) {
  25. newBoldFont.drawCenteredString("Enter name:", 239, 60, 0, -1);
  26. newBoldFont.drawCenteredString(amountOrNameInput + "*", 239, 80, 128, -1);
  27. } else if(aString844 != null) {
  28. newBoldFont.drawCenteredString(aString844, 239, 60, 0, -1);
  29. newBoldFont.drawCenteredString("Click to continue", 239, 80, 128, -1);
  30. } else if(backDialogID != -1) {
  31. drawInterface(0, 16, RSInterface.interfaceCache[backDialogID], 20);
  32. } else if(dialogID != -1) {
  33. drawInterface(0, 16, RSInterface.interfaceCache[dialogID], 20);
  34. } else {
  35. int j77 = 0;
  36. int j = 0;
  37. DrawingArea.setDrawingArea(93+5, 0, 463, 22);
  38. for(int k = 0; k < 100; k++) {
  39. if(chatMessages[k] != null) {
  40. int chatType = chatTypes[k];
  41. int yPos = (88 - j77 * 14) + anInt1089 + 5;
  42. String s1 = chatNames[k];
  43. byte byte0 = 0;
  44. for (byte is = 0; is < 7; is++) {
  45. if(s1 != null && s1.startsWith("@cr"+is+"@")) {
  46. s1 = s1.substring(5);
  47. byte0 = is == 0 ? 7 : is;
  48. }
  49. }
  50. if(chatType == 0) {
  51. if (chatTypeView == 5 || chatTypeView == 0) {
  52. if(yPos > 0 && yPos < 110)
  53. newRegularFont.drawBasicString(chatMessages[k], 19, yPos, 0, -1);
  54. j++;
  55. j77++;
  56. }
  57. }
  58. /* Draws clickable URL text into chatarea */
  59. if(chatType == 9) {
  60. if (chatTypeView == 5 || chatTypeView == 0) {
  61. if(yPos > 0 && yPos < 110)
  62. newRegularFont.drawBasicString(chatMessages[k] + " <col=13989119>" + s1, 19, yPos, 0x7e3200, -1);
  63. j++;
  64. j77++;
  65. }
  66. }
  67. if((chatType == 1 || chatType == 2) && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
  68. if (chatTypeView == 1 || chatTypeView == 0) {
  69. if(yPos > 0 && yPos < 110) {
  70. int xPos = 19;
  71. switch(byte0) {
  72. case 1:
  73. modIcons[1].drawSprite(xPos, yPos - 12);
  74. xPos += 14;
  75. break;
  76. case 2:
  77. modIcons[2].drawSprite(xPos, yPos - 12);
  78. xPos += 14;
  79. break;
  80. case 3:
  81. modIcons[2].drawSprite(xPos, yPos - 12);
  82. xPos += 14;
  83. break;
  84. case 4:
  85. modIcons[4].drawSprite(xPos, yPos - 12);
  86. xPos += 14;
  87. break;
  88. case 5:
  89. modIcons[5].drawSprite(xPos, yPos - 12);
  90. xPos += 14;
  91. break;
  92. case 6:
  93. modIcons[6].drawSprite(xPos, yPos - 12);
  94. xPos += 14;
  95. break;
  96. case 7:
  97. modIcons[0].drawSprite(xPos, yPos - 12);
  98. xPos += 14;
  99. break;
  100. case 8:
  101. modIcons[3].drawSprite(xPos, yPos - 12);
  102. xPos += 14;
  103. break;
  104. }
  105. newRegularFont.drawBasicString(s1 + ":", xPos, yPos, 0, -1);
  106. xPos += newRegularFont.getTextWidth(s1) + 8;
  107. newRegularFont.drawBasicString(chatMessages[k], xPos, yPos, 255, -1);
  108. }
  109. j++;
  110. j77++;
  111. }
  112. }
  113. if((chatType == 3 || chatType == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1))) {
  114. if (chatTypeView == 2 || chatTypeView == 0) {
  115. if(yPos > 0 && yPos < 110) {
  116. int k1 = 4;
  117. newRegularFont.drawBasicString("From", k1, yPos, 0, -1);
  118. k1 += newRegularFont.getTextWidth("From ");
  119. switch(byte0) {
  120. case 1:
  121. modIcons[1].drawSprite(k1, yPos - 12);
  122. k1 += 14;
  123. break;
  124. case 2:
  125. modIcons[2].drawSprite(k1, yPos - 12);
  126. k1 += 14;
  127. break;
  128. case 3:
  129. modIcons[2].drawSprite(k1, yPos - 12);
  130. k1 += 14;
  131. break;
  132. case 4:
  133. modIcons[4].drawSprite(k1, yPos - 12);
  134. k1 += 14;
  135. break;
  136. case 5:
  137. modIcons[5].drawSprite(k1, yPos - 12);
  138. k1 += 14;
  139. break;
  140. case 6:
  141. modIcons[6].drawSprite(k1, yPos - 12);
  142. k1 += 14;
  143. break;
  144. case 7:
  145. modIcons[0].drawSprite(k1, yPos - 12);
  146. k1 += 14;
  147. break;
  148. case 8:
  149. modIcons[3].drawSprite(k1, yPos - 12);
  150. k1 += 14;
  151. break;
  152. }
  153. newRegularFont.drawBasicString(s1 + ":", k1, yPos, 0, -1);
  154. k1 += newRegularFont.getTextWidth(s1) + 8;
  155. newRegularFont.drawBasicString(chatMessages[k], k1, yPos, 0x800000, -1);
  156. }
  157. j++;
  158. j77++;
  159. }
  160. }
  161. if(chatType == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  162. if (chatTypeView == 3 || chatTypeView == 0) {
  163. if(yPos > 0 && yPos < 110)
  164. newRegularFont.drawBasicString( s1 + " " + chatMessages[k], 19, yPos, 0x800080, -1);
  165. j++;
  166. j77++;
  167. }
  168. }
  169. if(chatType == 5 && splitPrivateChat == 0 && privateChatMode < 2) {
  170. if (chatTypeView == 2 || chatTypeView == 0) {
  171. if(yPos > 0 && yPos < 110)
  172. newRegularFont.drawBasicString(chatMessages[k], 19, yPos, 0x800000, -1);
  173. j++;
  174. j77++;
  175. }
  176. }
  177. if(chatType == 6 && (splitPrivateChat == 0 || chatTypeView == 2) && privateChatMode < 2) {
  178. if (chatTypeView == 2 || chatTypeView == 0) {
  179. if(yPos > 0 && yPos < 110) {
  180. newRegularFont.drawBasicString("To " + s1 + ":", 11, yPos, 0, -1);
  181. newRegularFont.drawBasicString(chatMessages[k], 12 + newRegularFont.getTextWidth("To :" + s1), yPos, 0x800000, -1);
  182. }
  183. j++;
  184. j77++;
  185. }
  186. }
  187. if(chatType == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  188. if (chatTypeView == 3 || chatTypeView == 0) {
  189. if(yPos > 0 && yPos < 110)
  190. newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 19, yPos, 0x7e3200, -1);
  191. j++;
  192. j77++;
  193. }
  194. if(chatType == 11 && (clanChatMode == 0)) {
  195. if (chatTypeView == 11) {
  196. if(yPos > 0 && yPos < 110)
  197. newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 19, yPos, 0x7e3200, -1);
  198. j++;
  199. j77++;
  200. }
  201. }
  202. }
  203. if(chatType == 16) {
  204. int j2 = 40+11;
  205. int clanNameWidth = textDrawingArea.getTextWidth(clanname);
  206. if(chatTypeView == 11 || chatTypeView == 0) {
  207. if(yPos > 0 && yPos < 110)
  208. switch(chatRights[k]) {
  209. case 1:
  210. j2 += clanNameWidth;
  211. modIcons[1].drawSprite(j2 - 18, yPos - 12);
  212. j2 += 14;
  213. break;
  214. case 2:
  215. j2 += clanNameWidth;
  216. modIcons[2].drawSprite(j2 - 18, yPos - 12);
  217. j2 += 14;
  218. break;
  219. case 3:
  220. j2 += clanNameWidth;
  221. modIcons[2].drawSprite(j2 - 18, yPos - 12);
  222. j2 += 14;
  223. break;
  224. case 4:
  225. j2 += clanNameWidth;
  226. modIcons[5].drawSprite(j2 - 18, yPos - 12);
  227. j2 += 14;
  228. break;
  229.  
  230. case 5:
  231. j2 += clanNameWidth;
  232. modIcons[6].drawSprite(j2 - 18, yPos - 12);
  233. j2 += 14;
  234. break;
  235.  
  236. case 6:
  237. j2 += clanNameWidth;
  238. modIcons[7].drawSprite(j2 - 18, yPos - 12);
  239. j2 += 14;
  240. break;
  241.  
  242. case 7:
  243. j2 += clanNameWidth;
  244. modIcons[0].drawSprite(j2 - 18, yPos - 12);
  245. j2 += 14;
  246. break;
  247.  
  248. case 8:
  249. j2 += clanNameWidth;
  250. modIcons[3].drawSprite(j2 - 18, yPos - 12);
  251. j2 += 14;
  252. break;
  253. default:
  254. j2 += clanNameWidth;
  255. break;
  256. }
  257. newRegularFont.drawBasicString("[", 19, yPos, 0, -1);
  258. newRegularFont.drawBasicString("]", clanNameWidth + 16+11, yPos, 0, -1);
  259. newRegularFont.drawBasicString(""+capitalize(clanname)+"", 25, yPos, 255, -1);
  260. newRegularFont.drawBasicString(capitalize(chatNames[k]) + ":", j2-17, yPos);
  261. j2 += newRegularFont.getTextWidth(chatNames[k]) + 7;
  262. //newRegularFont.drawBasicString(capitalize(chatMessages[k]), j2-16, yPos, 0x800000, -1);
  263. newRegularFont.drawBasicString(chatMessages[k], j2-16, yPos, 0x800000, -1);
  264.  
  265. j++;
  266. j77++;
  267. }
  268. }
  269. }
  270. }
  271. DrawingArea.defaultDrawingAreaSize();
  272. chatScrollTotalLength = j * 14 + 7;
  273. if(chatScrollTotalLength < 78)
  274. chatScrollTotalLength = 78;
  275. drawScrollbar(77, chatScrollTotalLength - anInt1089 - 77, 20, 480, chatScrollTotalLength);
  276. String s;
  277. if (myPlayer != null && myPlayer.name != null)
  278. s = loyaltyRank(myPlayer.loyaltyRank) + myPlayer.name;
  279. else
  280. s = TextClass.fixName(capitalize(myUsername));
  281. switch (myPrivilege) {
  282. case 1:
  283. modIcons[0].drawSprite(12 + xPosOffset, 122 + yPosOffset);
  284. xPosOffset += 14;
  285. break;
  286. case 2:
  287. modIcons[1].drawSprite(12 + xPosOffset, 122 + yPosOffset);
  288. xPosOffset += 14;
  289. break;
  290. case 3:
  291. modIcons[1].drawSprite(12 + xPosOffset, 122 + yPosOffset);
  292. xPosOffset += 14;
  293. break;
  294. }
  295. newRegularFont.drawBasicString(s + ":", 19, 110, 0, -1);
  296. newRegularFont.drawChatTextString(inputString + "*", 20 + textDrawingArea.getTextWidth(s + ": "), 110, 255, -1);
  297. DrawingArea.method339(97, 0x000000, 479, 17);
  298. }
  299. } else if(is474 || is480 || is508 || is525 || is562) {
  300. TextDrawingArea textDrawingArea = newRegularFont;
  301. if(messagePromptRaised) {
  302. newBoldFont.drawCenteredString(aString1121, 259, 60, 0, -1);
  303. newBoldFont.drawCenteredString( promptInput + "*", 259, 80, 128, -1);
  304. } else if(inputDialogState == 1) {
  305. newBoldFont.drawCenteredString("Enter amount:", 259, 60, 0, -1);
  306. newBoldFont.drawCenteredString(amountOrNameInput + "*", 259, 80, 128, -1);
  307. } else if(inputDialogState == 2) {
  308. newBoldFont.drawCenteredString("Enter name:", 259, 60, 0, -1);
  309. newBoldFont.drawCenteredString(amountOrNameInput + "*", 259, 80, 128, -1);
  310. } else if(aString844 != null) {
  311. newBoldFont.drawCenteredString(aString844, 259, 60, 0, -1);
  312. newBoldFont.drawCenteredString("Click to continue", 259, 80, 128, -1);
  313. } else if(backDialogID != -1) {
  314. drawInterface(0, 20, RSInterface.interfaceCache[backDialogID], 20);
  315. } else if(dialogID != -1) {
  316. drawInterface(0, 20, RSInterface.interfaceCache[dialogID], 20);
  317. } else {
  318. int j77 = -3;
  319. int j = 0;
  320. DrawingArea.setDrawingArea(122 + paddingY, 8 + paddingX, 497 + paddingX, 7 + paddingY);
  321. for(int k = 0; k < 500; k++)
  322. if(chatMessages[k] != null) {
  323. int chatType = chatTypes[k];
  324. int yPos = (70 - j77 * 14) + anInt1089 + 5;
  325. String s1 = chatNames[k];
  326. byte byte0 = 0;
  327. for (byte is = 0; is < 7; is++) {
  328. if(s1 != null && s1.startsWith("@cr"+is+"@")) {
  329. s1 = s1.substring(5);
  330. byte0 = is == 0 ? 7 : is;
  331. }
  332. }
  333. /* Draws Chat Colored Messages */
  334. if(chatType == 0) {
  335. if (chatTypeView == 5 || chatTypeView == 0) {
  336. if(yPos > 0 && yPos < 210)
  337. newRegularFont.drawBasicString(chatMessages[k], 11, yPos + paddingY, 0, -1);
  338. j++;
  339. j77++;
  340. }
  341. }
  342. /* Draws clickable URL text into chatarea */
  343. if(chatType == 9) {
  344. if (chatTypeView == 5 || chatTypeView == 0) {
  345. if(yPos > 0 && yPos < 210)
  346. newRegularFont.drawBasicString(chatMessages[k] + " <col=255>" + s1, 11,yPos + paddingY, 0x7e3200, -1);
  347. j++;
  348. j77++;
  349. }
  350. }
  351. if((chatType == 1 || chatType == 2) && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {//Publicchat
  352. if (chatTypeView == 1 || chatTypeView == 0) {
  353. if(yPos > 0 && yPos < 210) {
  354. int xPos = 11;
  355. switch(byte0) {
  356. case 1:
  357. modIcons[1].drawSprite(xPos, yPos - 12 + paddingY);
  358. xPos += 14;
  359. break;
  360. case 2:
  361. modIcons[2].drawSprite(xPos, yPos - 12 + paddingY);
  362. xPos += 14;
  363. break;
  364. case 3:
  365. modIcons[2].drawSprite(xPos, yPos - 12 + paddingY);
  366. xPos += 14;
  367. break;
  368. case 4:
  369. modIcons[4].drawSprite(xPos, yPos - 12 + paddingY);
  370. xPos += 14;
  371. break;
  372. case 5:
  373. modIcons[5].drawSprite(xPos, yPos - 12 + paddingY);
  374. xPos += 14;
  375. break;
  376. case 6:
  377. modIcons[6].drawSprite(xPos, yPos - 12 + paddingY);
  378. xPos += 14;
  379. break;
  380. case 7:
  381. modIcons[0].drawSprite(xPos, yPos - 12 + paddingY);
  382. xPos += 14;
  383. break;
  384. case 8:
  385. modIcons[3].drawSprite(xPos, yPos - 12 + paddingY);
  386. xPos += 14;
  387. break;
  388. }
  389.  
  390. newRegularFont.drawBasicString(s1 + ":", xPos, yPos, toggleFullscreen ? 16777215 : 0, -1);
  391. xPos += newRegularFont.getTextWidth(s1) + 8;
  392. newRegularFont.drawChatTextString(chatMessages[k], xPos, yPos, toggleFullscreen ? 16777215 : 255, -1);
  393. }
  394. j++;
  395. j77++;
  396. }
  397. }
  398. if((chatType == 3 || chatType == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1))) {
  399. if (chatTypeView == 2 || chatTypeView == 0) {
  400. if(yPos > 0 && yPos < 210) {
  401. int k1 = 11;
  402. newRegularFont.drawBasicString("From", k1, yPos + paddingY, 0, -1);
  403. k1 += newRegularFont.getTextWidth("From ");
  404. switch(byte0) {
  405. case 1:
  406. modIcons[1].drawSprite(k1, yPos - 12);
  407. k1 += 14;
  408. break;
  409. case 2:
  410. modIcons[2].drawSprite(k1, yPos - 12);
  411. k1 += 14;
  412. break;
  413. case 3:
  414. modIcons[2].drawSprite(k1, yPos - 12);
  415. k1 += 14;
  416. break;
  417. case 4:
  418. modIcons[4].drawSprite(k1, yPos - 12);
  419. k1 += 14;
  420. break;
  421. case 5:
  422. modIcons[5].drawSprite(k1, yPos - 12);
  423. k1 += 14;
  424. break;
  425. case 6:
  426. modIcons[6].drawSprite(k1, yPos - 12);
  427. k1 += 14;
  428. break;
  429. case 7:
  430. modIcons[0].drawSprite(k1, yPos - 12);
  431. k1 += 14;
  432. break;
  433. case 8:
  434. modIcons[3].drawSprite(k1, yPos - 12);
  435. k1 += 14;
  436. break;
  437. }
  438. newRegularFont.drawBasicString(s1 + ":", k1, yPos + paddingY, 0, -1);
  439. k1 += newRegularFont.getTextWidth(s1) + 8;
  440. newRegularFont.drawChatTextString(chatMessages[k], k1, yPos + paddingY, toggleFullscreen ? 16732758 : 8388608, -1);
  441. }
  442. j++;
  443. j77++;
  444. }
  445. }
  446. if(chatType == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  447. if (chatTypeView == 3 || chatTypeView == 0) {
  448. if(yPos > 0 && yPos < 210)
  449. newRegularFont.drawBasicString( s1 + " " + chatMessages[k], 11, yPos + paddingY, 0x800080, -1);
  450. j++;
  451. j77++;
  452. }
  453. }
  454. if(chatType == 5 && splitPrivateChat == 0 && privateChatMode < 2) {
  455. if (chatTypeView == 2 || chatTypeView == 0) {
  456. if(yPos > 0 && yPos < 210)
  457. newRegularFont.drawBasicString(chatMessages[k], 11, yPos + paddingY, toggleFullscreen ? 16732758 : 8388608, -1);
  458. j++;
  459. j77++;
  460. }
  461. }
  462. if(chatType == 6 && (splitPrivateChat == 0 || chatTypeView == 2) && privateChatMode < 2) {
  463. if (chatTypeView == 2 || chatTypeView == 0) {
  464. if(yPos > 0 && yPos < 210) {
  465. newRegularFont.drawBasicString("To " + s1 + ":", 11, yPos + paddingY, 0, -1);
  466. newRegularFont.drawChatTextString(chatMessages[k], 15 + newRegularFont.getTextWidth("To :" + s1), yPos + paddingY, toggleFullscreen ? 16732758 : 8388608, -1);
  467. }
  468. j++;
  469. j77++;
  470. }
  471. }
  472. if(chatType == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  473. if (chatTypeView == 3 || chatTypeView == 0) {
  474. if(yPos > 0 && yPos < 210)
  475. newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 11, yPos + paddingY, 0x7e3200, -1);
  476. j++;
  477. j77++;
  478. }
  479. if(chatType == 11 && (clanChatMode == 0)) {
  480. if (chatTypeView == 11) {
  481. if(yPos > 0 && yPos < 210)
  482. newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 11, yPos + paddingY, 0x7e3200, -1);
  483. j++;
  484. j77++;
  485. }
  486. }
  487. }
  488. if(chatType == 16) {
  489. int j2 = 40;
  490. int clanNameWidth = textDrawingArea.getTextWidth(clanname);
  491. if(chatTypeView == 11 || chatTypeView == 0) {
  492. if(yPos > 3 && yPos < 130) {
  493. switch(chatRights[k]) {
  494. case 1:
  495. j2 += clanNameWidth;
  496. modIcons[1].drawSprite(j2 - 18, yPos - 12);
  497. j2 += 14;
  498. break;
  499. case 2:
  500. j2 += clanNameWidth;
  501. modIcons[2].drawSprite(j2 - 18, yPos - 12);
  502. j2 += 14;
  503. break;
  504. case 3:
  505. j2 += clanNameWidth;
  506. modIcons[2].drawSprite(j2 - 18, yPos - 12);
  507. j2 += 14;
  508. break;
  509. case 4:
  510. j2 += clanNameWidth;
  511. modIcons[4].drawSprite(j2 - 18, yPos - 12);
  512. j2 += 14;
  513. break;
  514.  
  515. case 5:
  516. j2 += clanNameWidth;
  517. modIcons[5].drawSprite(j2 - 18, yPos - 12);
  518. j2 += 14;
  519. break;
  520.  
  521. case 6:
  522. j2 += clanNameWidth;
  523. modIcons[6].drawSprite(j2 - 18, yPos - 12);
  524. j2 += 14;
  525. break;
  526.  
  527. case 7:
  528. j2 += clanNameWidth;
  529. modIcons[0].drawSprite(j2 - 18, yPos - 12);
  530. j2 += 14;
  531. break;
  532.  
  533. case 8:
  534. j2 += clanNameWidth;
  535. modIcons[3].drawSprite(j2 - 18, yPos - 12);
  536. j2 += 14;
  537. break;
  538.  
  539.  
  540. default:
  541. j2 += clanNameWidth;
  542. break;
  543. }
  544. }
  545. newRegularFont.drawBasicString("[", 8, yPos + paddingY, 0, -1);
  546. newRegularFont.drawBasicString("]", clanNameWidth + 16, yPos + paddingY, 0, -1);
  547. newRegularFont.drawBasicString(""+capitalize(clanname)+"", 14, yPos + paddingY, 255, -1);
  548. newRegularFont.drawBasicString(capitalize(chatNames[k]) + ":", j2-17, yPos + paddingY);
  549. j2 += newRegularFont.getTextWidth(chatNames[k]) + 7;
  550. newRegularFont.drawChatTextString(chatMessages[k], j2-16, yPos + paddingY, 0x800000, -1);
  551.  
  552. j++;
  553. j77++;
  554. }
  555. }
  556. }
  557. DrawingArea.defaultDrawingAreaSize();
  558. chatScrollTotalLength = j * 14 + 7 + 5;
  559. if(chatScrollTotalLength < 111)
  560. chatScrollTotalLength = 111;
  561. drawScrollbar(114, chatScrollTotalLength - anInt1089 - 113, 7, 496, chatScrollTotalLength);
  562. String s;
  563. if(myPlayer != null && myPlayer.name != null)
  564. s = "<col=13132800>"+loyaltyRank(myPlayer.loyaltyRank)+"</col>" + myPlayer.name;
  565. else
  566. s = TextClass.fixName(capitalize(myUsername));
  567. if(is508) {
  568. qc.drawSprite(textDrawingArea.getTextWidth(s) + 11, 123);
  569. newRegularFont.drawBasicString(s, 11, 133+paddingY, toggleFullscreen ? 16777215 : 0, -1);
  570. newRegularFont.drawBasicString(":", (25 + textDrawingArea.getTextWidth(s)), 133, 0, -1);
  571. newRegularFont.drawChatTextString(inputString + ((loopCycle % 40 < 20) ? "|" : ""), 23 + textDrawingArea.getTextWidth(s + ": "), 133 ,255 , -1);
  572. DrawingArea.method339(121 + paddingY, toggleFullscreen ? 16777215 : 8418912, 506, 7);
  573. } else {
  574. newRegularFont.drawBasicString(s + ":", 11, 133, 0, -1);
  575. newRegularFont.drawChatTextString(inputString + "*", 12 + textDrawingArea.getTextWidth(s + ": "), 133, 255, -1);
  576. DrawingArea.method339(121, 0x807660, 506, 7);
  577. }
  578. }
  579. }
  580. drawChannelButtons(paddingX, paddingY);
  581. chatback.drawGraphics(338, super.graphics, 0);
  582. main3DArea.initDrawingArea();
  583. Texture.anIntArray1472 = anIntArray1182;
  584. }
  585.  
  586. public void hitmarkDraw(int hitLength, int type, int icon, int damage, int soak, int move, int opacity, int cycle) {
  587. if (damage > 0) {
  588. Sprite end1 = null, middle = null, end2 = null;
  589. int x = 0;
  590. switch (hitLength) {
  591. /* Trial and error shit, terrible hardcoding :( */
  592. case 1: x = 8; break;
  593. case 2: x = 4; break;
  594. case 3: x = 1; break;
  595. }
  596. if (soak > 0)
  597. x -= 16;
  598. end1 = hitMark[(type * 3)];
  599. middle = hitMark[(type * 3) + 1];
  600. end2 = hitMark[(type * 3) + 2];
  601. if (icon != 255) {
  602. hitIcon[icon].drawTransparentSprite(spriteDrawX - 34 + x, spriteDrawY - 14 + move, opacity);
  603. } else {
  604. x -= 4;
  605. }
  606. end1.drawTransparentSprite(spriteDrawX - 12 + x, spriteDrawY - 12 + move, opacity);
  607. x += 4;
  608. for (int i = 0; i < hitLength * 2; i++) {
  609. middle.drawTransparentSprite(spriteDrawX - 12 + x, spriteDrawY - 12 + move, opacity);
  610. x += 4;
  611. }
  612. end2.drawTransparentSprite(spriteDrawX - 12 + x, spriteDrawY - 12 + move, opacity);
  613. if (type == 1)
  614. bigHit.drawOpacityText(0xffffff, String.valueOf(damage), spriteDrawY + (type == 1 ? 2 : 4) + move, spriteDrawX + (icon == 255 ? 0 : 4) + (soak > 0 ? -16 : 0), opacity);
  615. else
  616. smallHit.drawOpacityText(0xffffff, String.valueOf(damage), spriteDrawY + (type == 1 ? 2 : 4) + move, spriteDrawX + (icon == 255 ? 0 : 4) + (soak > 0 ? -16 : 0), opacity);
  617. if (soak > 0)
  618. drawSoak(soak, opacity, move, x);
  619. } else {
  620. int modifyY = type == 10 ? 3 : 0;
  621. combatIcons[3].drawTransparentSprite(spriteDrawX - 12, spriteDrawY - 14 + modifyY + move, opacity);// + modifyY
  622. //block(cycle, spriteDrawX, (spriteDrawY+10));
  623. }
  624. }
  625.  
  626. public void drawSoak(int damage, int opacity, int move, int x) {
  627. x -= 12;
  628. int soakLength = String.valueOf(damage).length();
  629. hitIcon[5].drawTransparentSprite(spriteDrawX + x, spriteDrawY - 12 + move, opacity);
  630. x += 20;
  631. hitMark[15].drawTransparentSprite(spriteDrawX + x, spriteDrawY - 12 + move, opacity);
  632. x += 4;
  633. for (int i = 0; i < soakLength * 2; i++) {
  634. hitMark[16].drawTransparentSprite(spriteDrawX + x, spriteDrawY - 12 + move, opacity);
  635. x += 4;
  636. }
  637. hitMark[17].drawTransparentSprite(spriteDrawX + x, spriteDrawY - 10 + move, opacity);
  638. smallHit.drawOpacityText(0xffffff, String.valueOf(damage), spriteDrawY + 4 + move, spriteDrawX - 8 + x + (soakLength == 1 ? 5 : 0), opacity);
  639. }
  640.  
  641. private TextDrawingArea smallHit;
  642. private TextDrawingArea bigHit;
  643. boolean drawingBlackBox = false;
  644.  
  645. public void drawOnBankInterface(){
  646. if(openInterfaceID == 5292 && RSInterface.interfaceCache[27000].disabledMessage.equals("1")){//Sent on bank opening etc, refresh tabs
  647. int tabs = Integer.parseInt(RSInterface.interfaceCache[27001].disabledMessage);//# of tabs used
  648. int tab = Integer.parseInt(RSInterface.interfaceCache[27002].disabledMessage);//current tab selected
  649. for (int i = 0; i <= tabs; i++) {
  650. RSInterface.interfaceCache[22025+i].disabledSprite = new Sprite("Interfaces/Bank/TAB 3");
  651. RSInterface.interfaceCache[22025+i].tooltip = "Click here to select tab " + (int)(i+1);
  652. }
  653. for (int i = tabs+1; i <= 8; i++) {
  654. RSInterface.interfaceCache[22024+i].disabledSprite = new Sprite("");
  655. RSInterface.interfaceCache[22024+i].tooltip = "";
  656. }
  657. if(tabs != 8) {
  658. RSInterface.interfaceCache[22025+tabs].disabledSprite = new Sprite("Interfaces/Bank/TAB 4");
  659. RSInterface.interfaceCache[22025+tabs].tooltip = "Drag an item here to create a new tab";
  660. }
  661. if(tab == -1)
  662. RSInterface.interfaceCache[22024].disabledSprite = new Sprite("Interfaces/Bank/TAB 1");
  663. else if(tab > 0) {
  664. RSInterface.interfaceCache[22024+tab].disabledSprite = new Sprite("Interfaces/Bank/TAB 2");
  665. RSInterface.interfaceCache[22024].disabledSprite = new Sprite("Interfaces/Bank/TAB 1");
  666. } else
  667. RSInterface.interfaceCache[22024].disabledSprite = new Sprite("Interfaces/Bank/TAB 0");
  668.  
  669. RSInterface.interfaceCache[27000].disabledMessage = "0";
  670. }
  671. }
  672.  
  673. private void drawInterface(int j, int k, RSInterface class9, int l) {
  674. if(class9.interfaceType != 0 || class9.children == null)
  675. return;
  676. if(class9.interfaceShown && anInt1026 != class9.id && anInt1048 != class9.id && anInt1039 != class9.id)
  677. return;
  678. int i1 = DrawingArea.topX;
  679. int j1 = DrawingArea.topY;
  680. int k1 = DrawingArea.bottomX;
  681. int l1 = DrawingArea.bottomY;
  682. DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  683. int i2 = class9.children.length;
  684. boolean drawBlackBox = false;
  685. for(int j2 = 0; j2 < i2; j2++) {
  686. int k2 = class9.childX[j2] + k;
  687. int l2 = (class9.childY[j2] + l) - j;
  688.  
  689. if (drawingBlackBox && (class9.id == 1151 || class9.id == 12855) && class9.children[j2] == 12854) {
  690. continue;
  691. }
  692. for(int r = 0; r < runeChildren.length; r++)
  693. if(class9_1.id == runeChildren[r])
  694. class9_1.modelZoom = 775;
  695.  
  696. if(class9_1.interfaceType == 10) {
  697. Sprite sprite;
  698. if(interfaceIsSelected(class9_1)) {
  699. sprite = class9_1.enabledSprite;
  700. } else {
  701. sprite = class9_1.disabledSprite;
  702. }
  703. if(sprite != null) {
  704. sprite.drawSpriteOpacity(k2, l2, class9_1.opacity);
  705. }
  706. }
  707. if(class9_1.interfaceType == 0) {
  708. drawOnBankInterface();
  709. if(class9_1.scrollPosition > class9_1.scrollMax - class9_1.height)
  710. class9_1.scrollPosition = class9_1.scrollMax - class9_1.height;
  711. if(class9_1.scrollPosition < 0)
  712. class9_1.scrollPosition = 0;
  713. drawInterface(class9_1.scrollPosition, k2, class9_1, l2);
  714. if(class9_1.scrollMax > class9_1.height)
  715. drawScrollbar(class9_1.height, class9_1.scrollPosition, l2, k2 + class9_1.width, class9_1.scrollMax);
  716. } else if(class9_1.interfaceType != 1)
  717. if(class9_1.interfaceType == 2) {
  718. int i3 = 0;
  719. for(int l3 = 0; l3 < class9_1.height; l3++) {
  720. for(int l4 = 0; l4 < class9_1.width; l4++) {
  721. int k5 = k2 + l4 * (32 + class9_1.invSpritePadX);
  722. int j6 = l2 + l3 * (32 + class9_1.invSpritePadY);
  723. if(i3 < 20) {
  724. k5 += class9_1.spritesX[i3];
  725. j6 += class9_1.spritesY[i3];
  726. }
  727.  
  728. if(class9_1.inventory[i3] > 0) {
  729. int k6 = 0;
  730. int j7 = 0;
  731. int j9 = class9_1.inventory[i3] - 1;
  732. if(k5 > DrawingArea.topX - 32 && k5 < DrawingArea.bottomX && j6 > DrawingArea.topY - 32 && j6 < DrawingArea.bottomY || activeInterfaceType != 0 && anInt1085 == i3) {
  733. int l9 = 0;
  734. if(itemSelected == 1 && anInt1283 == i3 && anInt1284 == class9_1.id)
  735. l9 = 0xffffff;
  736. Sprite Sprite_2 = ItemDef.getSprite(j9, class9_1.inventoryValue[i3], l9);
  737. if(Sprite_2 != null) {
  738. if(activeInterfaceType != 0 && anInt1085 == i3 && anInt1084 == class9_1.id) {
  739. k6 = super.mouseX - anInt1087;
  740. j7 = super.mouseY - anInt1088;
  741. if(k6 < 5 && k6 > -5)
  742. k6 = 0;
  743. if(j7 < 5 && j7 > -5)
  744. j7 = 0;
  745. if(anInt989 < 10) {
  746. k6 = 0;
  747. j7 = 0;
  748. }
  749. Sprite_2.drawSprite1(k5 + k6, j6 + j7);
  750. if(j6 + j7 < DrawingArea.topY && class9.scrollPosition > 0) {
  751. int i10 = (anInt945 * (DrawingArea.topY - j6 - j7)) / 3;
  752. if(i10 > anInt945 * 10)
  753. i10 = anInt945 * 10;
  754. if(i10 > class9.scrollPosition)
  755. i10 = class9.scrollPosition;
  756. class9.scrollPosition -= i10;
  757. anInt1088 += i10;
  758. }
  759. if(j6 + j7 + 32 > DrawingArea.bottomY && class9.scrollPosition < class9.scrollMax - class9.height) {
  760. int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  761. if(j10 > anInt945 * 10)
  762. j10 = anInt945 * 10;
  763. if(j10 > class9.scrollMax - class9.height - class9.scrollPosition)
  764. j10 = class9.scrollMax - class9.height - class9.scrollPosition;
  765. class9.scrollPosition += j10;
  766. anInt1088 -= j10;
  767. }
  768. } else if(atInventoryInterfaceType != 0 && atInventoryIndex == i3 && atInventoryInterface == class9_1.id)
  769. Sprite_2.drawSprite1(k5, j6);
  770. else
  771. Sprite_2.drawSprite(k5, j6);
  772. if(Sprite_2.maxWidth == 33 || class9_1.inventoryValue[i3] != 1)
  773. {
  774. int k10 = class9_1.inventoryValue[i3];
  775. smallText.method385(0, intToKOrMil(k10), j6 + 10 + j7, k5 + 1 + k6);
  776. if(k10 >= 1)
  777. smallText.method385(0xFFFF00, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  778. if(k10 >= 100000)
  779. smallText.method385(0xFFFFFF, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  780. if(k10 >= 10000000)
  781. smallText.method385(0x00FF80, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  782. }
  783. }
  784. }
  785. } else if(class9_1.sprites != null && i3 < 20) {
  786. Sprite Sprite_1 = class9_1.sprites[i3];
  787. if(Sprite_1 != null)
  788. Sprite_1.drawSprite(k5, j6);
  789. }
  790. i3++;
  791. }
  792. }
  793. } else if(class9_1.interfaceType == 3) {
  794. boolean flag = false;
  795. if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  796. flag = true;
  797. int j3;
  798. if(interfaceIsSelected(class9_1)) {
  799. j3 = class9_1.enabledColor;
  800. if(flag && class9_1.enabledHoverColor != 0)
  801. j3 = class9_1.enabledHoverColor;
  802. } else {
  803. j3 = class9_1.disabledColor;
  804. if(flag && class9_1.disabledHoverColor != 0)
  805. j3 = class9_1.disabledHoverColor;
  806. }
  807. if(class9_1.opacity == 0) {
  808. if(class9_1.boxFilled)
  809. DrawingArea.drawPixels(class9_1.height, l2, k2, j3, class9_1.width);
  810. else
  811. DrawingArea.fillPixels(k2, class9_1.width, class9_1.height, j3, l2);
  812. } else if(class9_1.boxFilled)
  813. DrawingArea.method335(j3, l2, class9_1.width, class9_1.height, 256 - (class9_1.opacity & 0xff), k2);
  814. else
  815. DrawingArea.method338(l2, class9_1.height, 256 - (class9_1.opacity & 0xff), j3, class9_1.width, k2);
  816. } else if(class9_1.interfaceType == 4) {
  817. RSFont textDrawingArea = class9_1.rsFonts;
  818. String s = class9_1.disabledMessage;
  819. boolean flag1 = false;
  820. if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  821. flag1 = true;
  822. int i4;
  823. if(interfaceIsSelected(class9_1)) {
  824. i4 = class9_1.enabledColor;
  825. if(flag1 && class9_1.enabledHoverColor != 0)
  826. i4 = class9_1.enabledHoverColor;
  827. if(class9_1.enabledMessage.length() > 0)
  828. s = class9_1.enabledMessage;
  829. } else {
  830. i4 = class9_1.disabledColor;
  831. if(flag1 && class9_1.disabledHoverColor != 0)
  832. i4 = class9_1.disabledHoverColor;
  833. }
  834. if(class9_1.atActionType == 6 && aBoolean1149) {
  835. s = "Please wait...";
  836. i4 = class9_1.disabledColor;
  837. }
  838. if(DrawingArea.width == 516) {//519
  839. if(i4 == 0xffff00)
  840. i4 = 255;
  841. if(i4 == 49152)
  842. i4 = 0xffffff;
  843. }
  844. //Magic interface
  845. if((class9_1.parentID == 1151) || (class9_1.parentID == 12855)) {
  846. switch (i4) {
  847. case 16773120: i4 = 0xFE981F; break;
  848. case 7040819: i4 = 0xAF6A1A; break;
  849. }
  850. }
  851. //Skill interface
  852. int id = 4004; int id2 = 4005;
  853. if(class9_1.parentID == 3917 && class9_1.id != id && class9_1.id != id+2 && class9_1.id != id+4 && class9_1.id != id+6
  854. && class9_1.id != id+8 && class9_1.id != id+10 && class9_1.id != id+12 && class9_1.id != id+14 && class9_1.id != id+16
  855. && class9_1.id != id+18 && class9_1.id != id+20 && class9_1.id != id+23 && class9_1.id != id+24 && class9_1.id != id+26
  856. && class9_1.id != id+28 && class9_1.id != id+30 && class9_1.id != id+32 && class9_1.id != id+34 && class9_1.id != 13926
  857. && class9_1.id != 4152 && class9_1.id != 12166 && class9_1.id != id2 && class9_1.id != id2+2 && class9_1.id != id2+4 && class9_1.id != id2+6
  858. && class9_1.id != id2+8 && class9_1.id != id2+10 && class9_1.id != id2+12 && class9_1.id != id2+14 && class9_1.id != id2+16
  859. && class9_1.id != id2+18 && class9_1.id != id2+20 && class9_1.id != id2+23 && class9_1.id != id2+24 && class9_1.id != id2+26
  860. && class9_1.id != id2+28 && class9_1.id != id2+30 && class9_1.id != id2+32 && class9_1.id != id2+34 && class9_1.id != 13927
  861. && class9_1.id != 4153 && class9_1.id != 12167 && class9_1.id != 4026) {
  862. if(i4 == 16776960)
  863. i4 = 0x0000;
  864. class9_1.textShadowed = false;
  865. }
  866. for(int l6 = l2 + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497)
  867. {
  868. if(s.indexOf("%") != -1)
  869. {
  870. do
  871. {
  872. int k7 = s.indexOf("%1");
  873. if(k7 == -1)
  874. break;
  875. if(class9_1.id < 4000 || class9_1.id > 5000 && class9_1.id !=13921 && class9_1.id !=13922 && class9_1.id !=12171 && class9_1.id !=12172)
  876. s = s.substring(0, k7) + methodR(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  877. else
  878. s = s.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  879. } while(true);
  880. do
  881. {
  882. int l7 = s.indexOf("%2");
  883. if(l7 == -1)
  884. break;
  885. s = s.substring(0, l7) + interfaceIntToString(extractInterfaceValues(class9_1, 1)) + s.substring(l7 + 2);
  886. } while(true);
  887. do
  888. {
  889. int i8 = s.indexOf("%3");
  890. if(i8 == -1)
  891. break;
  892. s = s.substring(0, i8) + interfaceIntToString(extractInterfaceValues(class9_1, 2)) + s.substring(i8 + 2);
  893. } while(true);
  894. do
  895. {
  896. int j8 = s.indexOf("%4");
  897. if(j8 == -1)
  898. break;
  899. s = s.substring(0, j8) + interfaceIntToString(extractInterfaceValues(class9_1, 3)) + s.substring(j8 + 2);
  900. } while(true);
  901. do
  902. {
  903. int k8 = s.indexOf("%5");
  904. if(k8 == -1)
  905. break;
  906. s = s.substring(0, k8) + interfaceIntToString(extractInterfaceValues(class9_1, 4)) + s.substring(k8 + 2);
  907. } while(true);
  908. }
  909. int l8 = s.indexOf("\\n");
  910. String s1;
  911. if(l8 != -1)
  912. {
  913. s1 = s.substring(0, l8);
  914. s = s.substring(l8 + 2);
  915. } else
  916. {
  917. s1 = s;
  918. s = "";
  919. }
  920. if ((class9_1.id >= 18144) && (class9_1.id <= 18343)) {
  921. int i22 = 0;
  922. if (s1.startsWith("@cr")) {
  923. i22 = Integer.valueOf(s1.substring(3, 4)).intValue();
  924. s1 = s1.substring(5);
  925. s1 = " " + s1;
  926. //((cz)localObject).a(rsi.an, i2, i11, str4, i17);
  927. //textDrawingArea.method389(class9_1.textShadowed, i2, i4, s1, l6);
  928. if (i22 > 0) {
  929. //DrawingArea.setDrawingArea(256, 0, 463, 100);
  930. clanChatIcons[i22].drawSprite(43, l6 - 10);
  931. }
  932. }
  933. }
  934.  
  935. if (class9.children[j2] == 31159)
  936. s1 = RSInterface.interfaceCache[31160].disabledMessage;
  937.  
  938. if(class9_1.textCentered)
  939. textDrawingArea.method382(i4, k2 + class9_1.width / 2, s1, l6, class9_1.textShadowed);
  940. else
  941. textDrawingArea.method389(class9_1.textShadowed, k2, i4, s1, l6);
  942. }
  943. } else if(class9_1.interfaceType == 5) {
  944. Sprite sprite;
  945. if ((class9_1.itemSpriteId1 != -1) && (class9_1.disabledSprite == null)) {
  946. class9_1.disabledSprite = ItemDef.getSprite(class9_1.itemSpriteId1, 1, class9_1.itemSpriteZoom1 == -1 ? 0 : -1, class9_1.itemSpriteZoom1);
  947. class9_1.enabledSprite = ItemDef.getSprite(class9_1.itemSpriteId2, 1, class9_1.itemSpriteZoom2 == -1 ? 0 : -1, class9_1.itemSpriteZoom2);
  948. //if (class9_1.greyScale)
  949. //if (class9_1.disabledSprite != null) class9_1.disabledSprite.greyScale();
  950. }
  951. if(interfaceIsSelected(class9_1))
  952. sprite = class9_1.enabledSprite;
  953. else
  954. sprite = class9_1.disabledSprite;
  955.  
  956. if(spellSelected == 1 && class9_1.id == spellID && spellID != 0 && sprite != null) {
  957. sprite.drawSprite2(k2, l2, 0xffffff);
  958. } else {
  959. if(Autocast && class9_1.id == autocastId)
  960. magicAuto.drawSprite(k2-1, l2);
  961. if (sprite != null)
  962. sprite.drawSprite(k2, l2);
  963. }
  964. if(sprite != null)
  965. sprite.drawSprite(k2, l2);
  966. } else if(class9_1.interfaceType == 6) {
  967. int k3 = Texture.textureInt1;
  968. int j4 = Texture.textureInt2;
  969. Texture.textureInt1 = k2 + class9_1.width / 2;
  970. Texture.textureInt2 = l2 + class9_1.height / 2;
  971. int i5 = Texture.anIntArray1470[class9_1.modelRotationY] * class9_1.modelZoom >> 16;
  972. int l5 = Texture.anIntArray1471[class9_1.modelRotationY] * class9_1.modelZoom >> 16;
  973. boolean flag2 = interfaceIsSelected(class9_1);
  974. int i7;
  975. if(flag2)
  976. i7 = class9_1.enabledAnimation;
  977. else
  978. i7 = class9_1.disabledAnimation;
  979. Model model;
  980. if(i7 == -1) {
  981. model = class9_1.method209(-1, -1, flag2);
  982. } else {
  983. Animation animation = Animation.anims[i7];
  984. model = class9_1.method209(animation.anIntArray354[class9_1.animationLength], animation.anIntArray353[class9_1.animationLength], flag2);
  985. }
  986. if(model != null)
  987. model.method482(class9_1.modelRotationX, 0, class9_1.modelRotationY, 0, i5, l5);
  988. Texture.textureInt1 = k3;
  989. Texture.textureInt2 = j4;
  990. } else if(class9_1.interfaceType == 7) {
  991. RSFont textDrawingArea_1 = class9_1.rsFonts;
  992. int k4 = 0;
  993. for(int j5 = 0; j5 < class9_1.height; j5++) {
  994. for(int i6 = 0; i6 < class9_1.width; i6++) {
  995. if(class9_1.inventory[k4] > 0) {
  996. ItemDef itemDef = ItemDef.forID(class9_1.inventory[k4] - 1);
  997. String s2 = itemDef.name;
  998. if(itemDef.stackable || class9_1.inventoryValue[k4] != 1)
  999. s2 = s2 + " x" + intToKOrMilLongName(class9_1.inventoryValue[k4]);
  1000. int i9 = k2 + i6 * (115 + class9_1.invSpritePadX);
  1001. int k9 = l2 + j5 * (12 + class9_1.invSpritePadY);
  1002. if(class9_1.textCentered)
  1003. textDrawingArea_1.method382(class9_1.disabledColor, i9 + class9_1.width / 2, s2, k9, class9_1.textShadowed);
  1004. else
  1005. textDrawingArea_1.method389(class9_1.textShadowed, i9, class9_1.disabledColor, s2, k9);
  1006. }
  1007. k4++;
  1008. }
  1009. }
  1010. } else if (class9_1.interfaceType == 8 && (anInt1500 == class9_1.id || anInt1044 == class9_1.id || anInt1129 == class9_1.id) && anInt1501 == 100) {
  1011. int boxWidth = 0;
  1012. int boxHeight = 0;
  1013. RSFont textDrawingArea_2 = aTextDrawingArea_1271;
  1014. for (String s1 = class9_1.disabledMessage; s1.length() > 0;) {
  1015. int l7 = s1.indexOf("\\n");
  1016. String s4;
  1017. if (l7 != -1) {
  1018. s4 = s1.substring(0, l7);
  1019. s1 = s1.substring(l7 + 2);
  1020. } else {
  1021. s4 = s1;
  1022. s1 = "";
  1023. }
  1024. int j10 = textDrawingArea_2.getTextWidth(s4);
  1025. if (j10 > boxWidth) {
  1026. boxWidth = j10;
  1027. }
  1028. boxHeight += textDrawingArea_2.anInt1497 + 1;
  1029. }
  1030. boxWidth += 6;
  1031. boxHeight += 7;
  1032. int xPos = (l2 + class9_1.width) - 5 - boxWidth;
  1033. int yPos = k2 + class9_1.height + 5;
  1034. if (xPos < l2 + 5) {
  1035. xPos = l2 + 5;
  1036. }
  1037. if (xPos + boxWidth > j + class9.width) {
  1038. xPos = (j + class9.width) - boxWidth;
  1039. }
  1040. if (yPos + boxHeight > k + class9.height) {
  1041. yPos = (k + class9.height) - boxHeight;
  1042. }
  1043. DrawingArea.method336(boxHeight, yPos, xPos, 0xFFFFA0, boxWidth);
  1044. DrawingArea.fillPixels(xPos, boxWidth, boxHeight, 0, yPos);
  1045. String s2 = class9_1.disabledMessage;
  1046. for (int j11 = yPos + textDrawingArea_2.anInt1497 + 2; s2.length() > 0; j11 += textDrawingArea_2.anInt1497 + 1) {//anInt1497
  1047. int l11 = s2.indexOf("\\n");
  1048. String s5;
  1049. if (l11 != -1) {
  1050. s5 = s2.substring(0, l11);
  1051. s2 = s2.substring(l11 + 2);
  1052. } else {
  1053. s5 = s2;
  1054. s2 = "";
  1055. }
  1056. textDrawingArea_2.method389(false, xPos + 3, 0, s5, j11);
  1057. }
  1058. } else if (class9_1.interfaceType == 9) {
  1059. drawHoverBox(k2, l2, class9_1.disabledMessage);
  1060. }else if (class9_1.interfaceType == 10 && (anInt1500 == class9_1.id || anInt1044 == class9_1.id || anInt1129 == class9_1.id) && !menuOpen) {
  1061. int boxWidth = 0;
  1062. int boxHeight = 0;
  1063.  
  1064. TextDrawingArea textDrawingArea_2 = newRegularFont;
  1065. for (String s1 = class9_1.disabledMessage; s1.length() > 0;) {
  1066. int l7 = s1.indexOf("\\n");
  1067. String s4;
  1068. if (l7 != -1) {
  1069. s4 = s1.substring(0, l7);
  1070. s1 = s1.substring(l7 + 2);
  1071. } else {
  1072. s4 = s1;
  1073. s1 = "";
  1074. }
  1075. int j10 = textDrawingArea_2.getTextWidth(s4);
  1076. if (j10 > boxWidth) {
  1077. boxWidth = j10;
  1078. }
  1079. boxHeight += textDrawingArea_2.baseCharacterHeight + 1;
  1080. }
  1081. boxWidth += 6;
  1082. boxHeight += 7;
  1083. int xPos = (k2 + class9_1.width) - 5 - boxWidth;
  1084. int yPos = l2 + class9_1.height + 5;
  1085. if (xPos < k2 + 5) {
  1086. xPos = k2 + 5;
  1087. }
  1088. if (xPos + boxWidth > j + class9.width) {
  1089. xPos = (j + class9.width) - boxWidth;
  1090. }
  1091. if (yPos + boxHeight > k + class9.height) {
  1092. yPos = (k + class9.height) - boxHeight;
  1093. }
  1094. if(class9.isInventoryInterface)
  1095. {
  1096.  
  1097. if(xPos + boxWidth + j > 249)
  1098. xPos = 251 - boxWidth - j;
  1099. if(yPos + boxHeight + k > 261)
  1100. yPos = 245 - boxHeight - k;
  1101. }
  1102. DrawingArea.method336(boxHeight, yPos, xPos, 0xFFFFA0, boxWidth);
  1103. DrawingArea.fillPixels(xPos, boxWidth, boxHeight, 0, yPos);
  1104. String s2 = class9_1.disabledMessage;
  1105. for (int j11 = yPos + textDrawingArea_2.baseCharacterHeight + 2; s2.length() > 0; j11 += textDrawingArea_2.baseCharacterHeight + 1) {//anInt1497
  1106. int l11 = s2.indexOf("\\n");
  1107. String s5;
  1108. if (l11 != -1) {
  1109. s5 = s2.substring(0, l11);
  1110. s2 = s2.substring(l11 + 2);
  1111. } else {
  1112. s5 = s2;
  1113. s2 = "";
  1114. }
  1115. // textDrawingArea_2.method389(false, xPos + 3, 0, s5, j11);
  1116. textDrawingArea_2.drawBasicString(s5, xPos+3,j11, 0, -1);
  1117. }
  1118. }
  1119. }
  1120. if ((class9.id == 1151 || class9.id == 12855))
  1121. if (!drawBlackBox) drawingBlackBox = false;
  1122. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  1123. }
  1124.  
  1125. public void init() {
  1126. try {
  1127. System.out.println("Zenith is loading..");
  1128. nodeID = 10;//friends list order
  1129. portOff = 0;
  1130. setHighMem();
  1131. isMembers = true;
  1132. signlink.startpriv(InetAddress.getLocalHost());
  1133. instance = this;
  1134. initClientFrame(503, 765);//this it? 510 770 503 765
  1135. } catch (Exception e) {
  1136. e.printStackTrace();
  1137. }
  1138. }
  1139.  
  1140. public void drawTabHover() {
  1141. if(tabHPos == 0 && tabInterfaceIDs[0] != -1)
  1142. tabHover.drawSprite(3+3, 0);
  1143. else if(tabHPos == 1 && tabInterfaceIDs[1] != -1)
  1144. tabHover.drawSprite(33+3, 0);
  1145. else if(tabHPos == 2 && tabInterfaceIDs[2] != -1)
  1146. tabHover.drawSprite(63+3, 0);
  1147. else if(tabHPos == 3 && tabInterfaceIDs[14] != -1)
  1148. tabHover.drawSprite(93+3, 0);
  1149. else if(tabHPos == 4 && tabInterfaceIDs[3] != -1)
  1150. tabHover.drawSprite(123+3, 0);
  1151. else if(tabHPos == 5 && tabInterfaceIDs[4] != -1)
  1152. tabHover.drawSprite(153+3, 0);
  1153. else if(tabHPos == 6 && tabInterfaceIDs[5] != -1)
  1154. tabHover.drawSprite(183+3, 0);
  1155. else if(tabHPos == 7 && tabInterfaceIDs[6] != -1)
  1156. tabHover.drawSprite(213+3, 0);
  1157. else if(tabHPos == 15 && tabInterfaceIDs[16] != -1)
  1158. tabHover.drawSprite(3+3, 298);
  1159. else if(tabHPos == 8 && tabInterfaceIDs[9] != -1)
  1160. tabHover.drawSprite(33+3, 298);
  1161. else if(tabHPos == 9 && tabInterfaceIDs[8] != -1)
  1162. tabHover.drawSprite(63+3, 298);
  1163. else if(tabHPos == 10 && tabInterfaceIDs[7] != -1)
  1164. tabHover.drawSprite(93+3, 298);
  1165. else if(tabHPos == 11 && tabInterfaceIDs[11] != -1)
  1166. tabHover.drawSprite(123+3, 298);
  1167. else if(tabHPos == 12 && tabInterfaceIDs[12] != -1)
  1168. tabHover.drawSprite(153+3, 298);
  1169. else if(tabHPos == 13 && tabInterfaceIDs[13] != -1)
  1170. tabHover.drawSprite(183+3,298);
  1171. else if(tabHPos == 14 && tabInterfaceIDs[15] != -1)
  1172. tabHover.drawSprite(213+3, 298);
  1173. }
  1174.  
  1175. public void startRunnable(Runnable runnable, int i) {
  1176. if(i > 10)
  1177. i = 10;
  1178. if(signlink.mainapp != null) {
  1179. signlink.startthread(runnable, i);
  1180. } else {
  1181. super.startRunnable(runnable, i);
  1182.  
  1183. }
  1184. }
  1185.  
  1186. public Socket openSocket(int port) throws IOException {
  1187. return new Socket(InetAddress.getByName(server), port);
  1188. }
  1189.  
  1190. private boolean processMenuClick() {
  1191. if(activeInterfaceType != 0)
  1192. return false;
  1193. int j = super.clickMode3;
  1194. if(spellSelected == 1 && super.saveClickX >= 503 && super.saveClickY >= 160 && super.saveClickX <= 765 && super.saveClickY <= 205)
  1195. j = 0;
  1196. if(menuOpen) {
  1197. if(j != 1) {
  1198. int k = super.mouseX;
  1199. int j1 = super.mouseY;
  1200. if(menuScreenArea == 0) {
  1201. k -= 4;
  1202. j1 -= 4;
  1203. }
  1204. if(menuScreenArea == 1) {
  1205. k -= 516;//519
  1206. j1 -= 168;
  1207. }
  1208. if(menuScreenArea == 2) {
  1209. k -= 5;
  1210. j1 -= 338;
  1211. }
  1212. if(menuScreenArea == 3) {
  1213. k -= 516;//519
  1214. j1 -= 0;
  1215. }
  1216. if(k < menuOffsetX - 10 || k > menuOffsetX + menuWidth + 10 || j1 < menuOffsetY - 10 || j1 > menuOffsetY + menuHeight + 10) {
  1217. menuOpen = false;
  1218. if(menuScreenArea == 1) {
  1219. }
  1220. if(menuScreenArea == 2)
  1221. inputTaken = true;
  1222. }
  1223. }
  1224. if (j == 1) {
  1225. int l = menuOffsetX;
  1226. int k1 = menuOffsetY;
  1227. int i2 = menuWidth;
  1228. int k2 = super.saveClickX;
  1229. int l2 = super.saveClickY;
  1230. if (menuScreenArea == 0) {
  1231. k2 -= 4;
  1232. l2 -= 4;
  1233. }
  1234. if (menuScreenArea == 1) {
  1235. k2 -= 516; // 519
  1236. l2 -= 168;
  1237. }
  1238. if (menuScreenArea == 2) {
  1239. k2 -= 5; // 17
  1240. l2 -= 338;
  1241. }
  1242. if (menuScreenArea == 3) {
  1243. k2 -= 516; // 519
  1244. l2 -= 0;
  1245. }
  1246. int i3 = -1;
  1247. for (int j3 = 0; j3 < menuActionRow; j3++) {
  1248. int k3 = k1 + 31 + (menuActionRow - 1 - j3) * 15;
  1249. if (k2 > l && k2 < l + i2 && l2 > k3 - 13 && l2 < k3 + 3)
  1250. i3 = j3;
  1251. }
  1252. if (i3 != -1)
  1253. doAction(i3);
  1254. menuOpen = false;
  1255. if (menuScreenArea == 1)
  1256. needDrawTabArea = true;
  1257. if (menuScreenArea == 2) {
  1258. inputTaken = true;
  1259. }
  1260. }
  1261. return true;
  1262. } else {
  1263. if(j == 1 && menuActionRow > 0) {
  1264. int i1 = menuActionID[menuActionRow - 1];
  1265. if(i1 == 632 || i1 == 78 || i1 == 867 || i1 == 431 || i1 == 53 || i1 == 74 || i1 == 454 || i1 == 539 || i1 == 493 || i1 == 847 || i1 == 447 || i1 == 1125) {
  1266. int l1 = menuActionCmd2[menuActionRow - 1];
  1267. int j2 = menuActionCmd3[menuActionRow - 1];
  1268. RSInterface class9 = RSInterface.interfaceCache[j2];
  1269. if(class9.allowSwapItems || class9.deletesTargetSlot) {
  1270. aBoolean1242 = false;
  1271. anInt989 = 0;
  1272. anInt1084 = j2;
  1273. anInt1085 = l1;
  1274. activeInterfaceType = 2;
  1275. anInt1087 = super.saveClickX;
  1276. anInt1088 = super.saveClickY;
  1277. if(RSInterface.interfaceCache[j2].parentID == openInterfaceID)
  1278. activeInterfaceType = 1;
  1279. if(RSInterface.interfaceCache[j2].parentID == backDialogID)
  1280. activeInterfaceType = 3;
  1281. return true;
  1282. }
  1283. }
  1284. }
  1285. if(j == 1 && (anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  1286. j = 2;
  1287. if(j == 1 && menuActionRow > 0)
  1288. doAction(menuActionRow - 1);
  1289. if(j == 2 && menuActionRow > 0)
  1290. determineMenuSize();
  1291. return false;
  1292. }
  1293. }
  1294.  
  1295.  
  1296. public static int totalRead = 0;
  1297.  
  1298. public static String getFileNameWithoutExtension(String fileName) {
  1299. File tmpFile = new File(fileName);
  1300. tmpFile.getName();
  1301. int whereDot = tmpFile.getName().lastIndexOf('.');
  1302. if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2) {
  1303. return tmpFile.getName().substring(0, whereDot);
  1304. }
  1305. return "";
  1306. }
  1307.  
  1308. public void preloadModels() {
  1309. File file = new File(signlink.findcachedir()+"Raw/");
  1310. File[] fileArray = file.listFiles();
  1311. for(int y = 0; y < fileArray.length; y++) {
  1312. String s = fileArray[y].getName();
  1313. if (!s.contains(".dat"))
  1314. continue;
  1315. byte[] buffer = ReadFile(signlink.findcachedir()+"Raw/"+s);
  1316. Model.method460(buffer,Integer.parseInt(getFileNameWithoutExtension(s)));
  1317. }
  1318. }
  1319.  
  1320. public static final byte[] ReadFile(String s) {
  1321. try {
  1322. byte abyte0[];
  1323. File file = new File(s);
  1324. int i = (int)file.length();
  1325. abyte0 = new byte[i];
  1326. DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new FileInputStream(s)));
  1327. datainputstream.readFully(abyte0, 0, i);
  1328. datainputstream.close();
  1329. return abyte0;
  1330. } catch(Exception e) {
  1331. System.out.println((new StringBuilder()).append("Read Error: ").append(s).toString());
  1332. return null;
  1333. }
  1334. }
  1335.  
  1336. private void saveMidi(boolean flag, byte abyte0[]) {
  1337. signlink.midifade = flag ? 1 : 0;
  1338. signlink.midisave(abyte0, abyte0.length);
  1339. }
  1340.  
  1341. public static void writeFile(byte[] data, String fileName) throws IOException{
  1342. OutputStream out = new FileOutputStream(fileName);
  1343. out.write(data);
  1344. out.close();
  1345. }
  1346.  
  1347. public final void method22() {
  1348. try {
  1349. anInt985 = -1;
  1350. aClass19_1056.removeAll();
  1351. aClass19_1013.removeAll();
  1352. Texture.method366();
  1353. unlinkMRUNodes();
  1354. worldController.initToNull();
  1355. System.gc();
  1356. for(int i = 0; i < 4; i++)
  1357. aClass11Array1230[i].method210();
  1358. for(int l = 0; l < 4; l++) {
  1359. for(int k1 = 0; k1 < 104; k1++) {
  1360. for(int j2 = 0; j2 < 104; j2++)
  1361. byteGroundArray[l][k1][j2] = 0;
  1362. }
  1363. }
  1364. ObjectManager objectManager = new ObjectManager(byteGroundArray, intGroundArray);
  1365. int k2 = aByteArrayArray1183.length;
  1366. int k18 = 64;
  1367. for(int A = 0; A < k2; A++)
  1368. for(int B = 0; B < 2000; B++)
  1369. if(anIntArray1234[A] == positions[B]){
  1370. anIntArray1235[A] = landScapes[B];
  1371. anIntArray1236[A] = objects[B];
  1372. }
  1373. stream.createFrame(0);
  1374. if(!aBoolean1159) {
  1375. for(int i3 = 0; i3 < k2; i3++) {
  1376. int i4 = (anIntArray1234[i3] >> 8) * 64 - baseX;
  1377. int k5 = (anIntArray1234[i3] & 0xff) * 64 - baseY;
  1378. byte abyte0[] = aByteArrayArray1183[i3];
  1379. if (FileOperations.FileExists(signlink.findcachedir()+"Maps/Maps/"+anIntArray1235[i3]+".dat"))
  1380. abyte0 = FileOperations.readFile(signlink.findcachedir()+"Maps/Maps/"+anIntArray1235[i3]+".dat");
  1381. if(abyte0 != null)
  1382. objectManager.method180(abyte0, k5, i4, (anInt1069 - 6) * 8, (anInt1070 - 6) * 8, aClass11Array1230);
  1383. }
  1384. for(int j4 = 0; j4 < k2; j4++) {
  1385. int l5 = (anIntArray1234[j4] >> 8) * k18 - baseX;
  1386. int k7 = (anIntArray1234[j4] & 0xff) * k18 - baseY;
  1387. byte abyte2[] = aByteArrayArray1183[j4];
  1388. if(abyte2 == null && anInt1070 < 800)
  1389. objectManager.method174(k7, 64, 64, l5);
  1390. }
  1391. anInt1097++;
  1392. if(anInt1097 > 160) {
  1393. anInt1097 = 0;
  1394. stream.createFrame(238);
  1395. stream.writeWordBigEndian(96);
  1396. }
  1397. stream.createFrame(0);
  1398. for(int i6 = 0; i6 < k2; i6++) {
  1399. byte abyte1[] = aByteArrayArray1247[i6];
  1400. if (FileOperations.FileExists(signlink.findcachedir()+"Maps/Maps/"+anIntArray1236[i6]+".dat"))
  1401. abyte1 = FileOperations.readFile(signlink.findcachedir()+"Maps/Maps/"+anIntArray1236[i6]+".dat");
  1402. if(abyte1 != null) {
  1403. int l8 = (anIntArray1234[i6] >> 8) * 64 - baseX;
  1404. int k9 = (anIntArray1234[i6] & 0xff) * 64 - baseY;
  1405. objectManager.method190(l8, aClass11Array1230, k9, worldController, abyte1);
  1406. }
  1407. }
  1408. }
  1409. if(aBoolean1159) {
  1410. for(int j3 = 0; j3 < 4; j3++) {
  1411. for(int k4 = 0; k4 < 13; k4++) {
  1412. for(int j6 = 0; j6 < 13; j6++) {
  1413. int l7 = anIntArrayArrayArray1129[j3][k4][j6];
  1414. if(l7 != -1) {
  1415. int i9 = l7 >> 24 & 3;
  1416. int l9 = l7 >> 1 & 3;
  1417. int j10 = l7 >> 14 & 0x3ff;
  1418. int l10 = l7 >> 3 & 0x7ff;
  1419. int j11 = (j10 / 8 << 8) + l10 / 8;
  1420. for(int l11 = 0; l11 < anIntArray1234.length; l11++)
  1421. {
  1422. if(anIntArray1234[l11] != j11 || aByteArrayArray1183[l11] == null)
  1423. continue;
  1424. objectManager.method179(i9, l9, aClass11Array1230, k4 * 8, (j10 & 7) * 8, aByteArrayArray1183[l11], (l10 & 7) * 8, j3, j6 * 8);
  1425. break;
  1426. }
  1427.  
  1428. }
  1429. }
  1430.  
  1431. }
  1432.  
  1433. }
  1434. for(int l4 = 0; l4 < 13; l4++) {
  1435. for(int k6 = 0; k6 < 13; k6++){
  1436. int i8 = anIntArrayArrayArray1129[0][l4][k6];
  1437. if(i8 == -1)
  1438. objectManager.method174(k6 * 8, 8, 8, l4 * 8);
  1439. }
  1440. }
  1441. stream.createFrame(0);
  1442. for(int l6 = 0; l6 < 4; l6++) {
  1443. for(int j8 = 0; j8 < 13; j8++) {
  1444. for(int j9 = 0; j9 < 13; j9++) {
  1445. int i10 = anIntArrayArrayArray1129[l6][j8][j9];
  1446. if(i10 != -1) {
  1447. int k10 = i10 >> 24 & 3;
  1448. int i11 = i10 >> 1 & 3;
  1449. int k11 = i10 >> 14 & 0x3ff;
  1450. int i12 = i10 >> 3 & 0x7ff;
  1451. int j12 = (k11 / 8 << 8) + i12 / 8;
  1452. for(int k12 = 0; k12 < anIntArray1234.length; k12++) {
  1453. if(anIntArray1234[k12] != j12 || aByteArrayArray1247[k12] == null)
  1454. continue;
  1455. objectManager.method183(aClass11Array1230, worldController, k10, j8 * 8, (i12 & 7) * 8, l6, aByteArrayArray1247[k12], (k11 & 7) * 8, i11, j9 * 8);
  1456. break;
  1457. }
  1458. }
  1459. }
  1460. }
  1461. }
  1462. }
  1463. stream.createFrame(0);
  1464. objectManager.method171(aClass11Array1230, worldController);
  1465. main3DArea.initDrawingArea();
  1466. stream.createFrame(0);
  1467. int k3 = ObjectManager.anInt145;
  1468. if(k3 > plane)
  1469. k3 = plane;
  1470. if(k3 < plane - 1)
  1471. k3 = plane - 1;
  1472. if(lowMem)
  1473. worldController.method275(ObjectManager.anInt145);
  1474. else
  1475. worldController.method275(0);
  1476. for(int i5 = 0; i5 < 104; i5++) {
  1477. for(int i7 = 0; i7 < 104; i7++)
  1478. spawnGroundItem(i5, i7);
  1479. }
  1480. anInt1051++;
  1481. if(anInt1051 > 98) {
  1482. anInt1051 = 0;
  1483. stream.createFrame(150);
  1484. }
  1485. method63();
  1486. } catch(Exception exception) { }
  1487. ObjectDef.mruNodes1.unlinkAll();
  1488. if(super.gameFrame != null) {
  1489. stream.createFrame(210);
  1490. stream.writeDWord(0x3f008edd);
  1491. }
  1492. System.gc();
  1493. Texture.method367();
  1494. onDemandFetcher.method566();
  1495. int k = (anInt1069 - 6) / 8 - 1;
  1496. int j1 = (anInt1069 + 6) / 8 + 1;
  1497. int i2 = (anInt1070 - 6) / 8 - 1;
  1498. int l2 = (anInt1070 + 6) / 8 + 1;
  1499. if(aBoolean1141) {
  1500. k = 49;
  1501. j1 = 50;
  1502. i2 = 49;
  1503. l2 = 50;
  1504. }
  1505. for(int l3 = k; l3 <= j1; l3++) {
  1506. for(int j5 = i2; j5 <= l2; j5++)
  1507. if(l3 == k || l3 == j1 || j5 == i2 || j5 == l2) {
  1508. int j7 = onDemandFetcher.method562(0, j5, l3);
  1509. if(j7 != -1)
  1510. onDemandFetcher.method560(j7, 3);
  1511. int k8 = onDemandFetcher.method562(1, j5, l3);
  1512. if(k8 != -1)
  1513. onDemandFetcher.method560(k8, 3);
  1514. }
  1515. }
  1516. }
  1517.  
  1518.  
  1519. private void unlinkMRUNodes()
  1520. {
  1521. ObjectDef.mruNodes1.unlinkAll();
  1522. ObjectDef.mruNodes2.unlinkAll();
  1523. EntityDef.mruNodes.unlinkAll();
  1524. ItemDef.mruNodes2.unlinkAll();
  1525. ItemDef.mruNodes1.unlinkAll();
  1526. Player.mruNodes.unlinkAll();
  1527. SpotAnim.aMRUNodes_415.unlinkAll();
  1528. }
  1529.  
  1530. private void method24(int i)
  1531. {
  1532. int ai[] = aSprite_1263.myPixels;
  1533. int j = ai.length;
  1534. for(int k = 0; k < j; k++)
  1535. ai[k] = 0;
  1536.  
  1537. for(int l = 1; l < 103; l++)
  1538. {
  1539. int i1 = 24628 + (103 - l) * 512 * 4;
  1540. for(int k1 = 1; k1 < 103; k1++)
  1541. {
  1542.  
  1543. if((byteGroundArray[i][k1][l] & 0x18) == 0)
  1544. worldController.method309(ai, i1, i, k1, l);
  1545. if(i < 3 && (byteGroundArray[i + 1][k1][l] & 8) != 0)
  1546. worldController.method309(ai, i1, i + 1, k1, l);
  1547. i1 += 4;
  1548. }
  1549.  
  1550. }
  1551.  
  1552. //int j1 = ((238 + (int)(Math.random() * 20D)) - 10 << 16) + ((238 + (int)(Math.random() * 20D)) - 10 << 8) + ((238 + (int)(Math.random() * 20D)) - 10);
  1553. //int l1 = (238 + (int)(Math.random() * 20D)) - 10 << 16;
  1554.  
  1555. int j1 = 0xFFFFFF;
  1556. int l1 = 0xee0000;
  1557. aSprite_1263.method343();
  1558. for(int i2 = 1; i2 < 103; i2++)
  1559. {
  1560. for(int j2 = 1; j2 < 103; j2++)
  1561. {
  1562. if((byteGroundArray[i][j2][i2] & 0x18) == 0)
  1563. method50(i2, j1, j2, l1, i);
  1564. if(i < 3 && (byteGroundArray[i + 1][j2][i2] & 8) != 0)
  1565. method50(i2, j1, j2, l1, i + 1);
  1566. }
  1567.  
  1568. }
  1569.  
  1570. main3DArea.initDrawingArea();
  1571. anInt1071 = 0;
  1572. for(int k2 = 0; k2 < 104; k2++)
  1573. {
  1574. for(int l2 = 0; l2 < 104; l2++)
  1575. {
  1576. int i3 = worldController.method303(plane, k2, l2);
  1577. if(i3 != 0)
  1578. {
  1579. i3 = i3 >> 14 & 0x7fff;
  1580. int j3 = ObjectDef.forID(i3).anInt746;
  1581. if(j3 >= 0)
  1582. {
  1583. int k3 = k2;
  1584. int l3 = l2;
  1585. if(j3 != 22 && j3 != 29 && j3 != 34 && j3 != 36 && j3 != 46 && j3 != 47 && j3 != 48)
  1586. {
  1587. byte byte0 = 104;
  1588. byte byte1 = 104;
  1589. int ai1[][] = aClass11Array1230[plane].anIntArrayArray294;
  1590. for(int i4 = 0; i4 < 10; i4++)
  1591. {
  1592. int j4 = (int)(Math.random() * 4D);
  1593. if(j4 == 0 && k3 > 0 && k3 > k2 - 3 && (ai1[k3 - 1][l3] & 0x1280108) == 0)
  1594. k3--;
  1595. if(j4 == 1 && k3 < byte0 - 1 && k3 < k2 + 3 && (ai1[k3 + 1][l3] & 0x1280180) == 0)
  1596. k3++;
  1597. if(j4 == 2 && l3 > 0 && l3 > l2 - 3 && (ai1[k3][l3 - 1] & 0x1280102) == 0)
  1598. l3--;
  1599. if(j4 == 3 && l3 < byte1 - 1 && l3 < l2 + 3 && (ai1[k3][l3 + 1] & 0x1280120) == 0)
  1600. l3++;
  1601. }
  1602.  
  1603. }
  1604. aSpriteArray1140[anInt1071] = mapFunctions[j3];
  1605. anIntArray1072[anInt1071] = k3;
  1606. anIntArray1073[anInt1071] = l3;
  1607. anInt1071++;
  1608. }
  1609. }
  1610. }
  1611.  
  1612. }
  1613.  
  1614. }
  1615.  
  1616. private void spawnGroundItem(int i, int j)
  1617. {
  1618. NodeList class19 = groundArray[plane][i][j];
  1619. if(class19 == null)
  1620. {
  1621. worldController.method295(plane, i, j);
  1622. return;
  1623. }
  1624. int k = 0xfa0a1f01;
  1625. Object obj = null;
  1626. for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  1627. {
  1628. ItemDef itemDef = ItemDef.forID(item.ID);
  1629. int l = itemDef.value;
  1630. if(itemDef.stackable)
  1631. l *= item.anInt1559 + 1;
  1632. // notifypawn(item, i + baseX, j + baseY);
  1633. if(l > k)
  1634. {
  1635. k = l;
  1636. obj = item;
  1637. }
  1638. }
  1639. class19.insertTail(((Node) (obj)));
  1640. Object obj1 = null;
  1641. Object obj2 = null;
  1642. for(Item class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetFirst(); class30_sub2_sub4_sub2_1 != null; class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetNext())
  1643. {
  1644. if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && obj1 == null)
  1645. obj1 = class30_sub2_sub4_sub2_1;
  1646. if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && class30_sub2_sub4_sub2_1.ID != ((Item) (obj1)).ID && obj2 == null)
  1647. obj2 = class30_sub2_sub4_sub2_1;
  1648. }
  1649. int i1 = i + (j << 7) + 0x60000000;
  1650. worldController.method281(i, i1, ((Animable) (obj1)), method42(plane, j * 128 + 64, i * 128 + 64), ((Animable) (obj2)), ((Animable) (obj)), plane, j);
  1651. }
  1652.  
  1653. private void method26(boolean flag)
  1654. {
  1655. for(int j = 0; j < npcCount; j++)
  1656. {
  1657. NPC npc = npcArray[npcIndices[j]];
  1658. int k = 0x20000000 + (npcIndices[j] << 14);
  1659. if(npc == null || !npc.isVisible() || npc.desc.aBoolean93 != flag)
  1660. continue;
  1661. int l = npc.x >> 7;
  1662. int i1 = npc.y >> 7;
  1663. if(l < 0 || l >= 104 || i1 < 0 || i1 >= 104)
  1664. continue;
  1665. if(npc.anInt1540 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  1666. {
  1667. if(anIntArrayArray929[l][i1] == anInt1265)
  1668. continue;
  1669. anIntArrayArray929[l][i1] = anInt1265;
  1670. }
  1671. if(!npc.desc.aBoolean84)
  1672. k += 0x80000000;
  1673. worldController.method285(plane, npc.anInt1552, method42(plane, npc.y, npc.x), k, npc.y, (npc.anInt1540 - 1) * 64 + 60, npc.x, npc, npc.aBoolean1541);
  1674. }
  1675. }
  1676.  
  1677. private boolean replayWave()
  1678. {
  1679. return signlink.wavereplay();
  1680. }
  1681.  
  1682. public void drawHoverBox(int xPos, int yPos, String text) {
  1683. String[] results = text.split("\n");
  1684. int height = (results.length * 16) + 3;
  1685. int width;
  1686. width = aTextDrawingArea_1271.getTextWidth(results[0]) + 6;
  1687. for(int i = 1; i < results.length; i++)
  1688. if(width <= aTextDrawingArea_1271.getTextWidth(results[i]) + 6)
  1689. width = aTextDrawingArea_1271.getTextWidth(results[i]) + 6;
  1690. DrawingArea.drawPixels(height, yPos, xPos, 0xFFFFA0, width);
  1691. DrawingArea.fillPixels(xPos, width, height, 0, yPos);
  1692. yPos += 14;
  1693. for(int i = 0; i < results.length; i++) {
  1694. aTextDrawingArea_1271.method389(false, xPos + 3, 0, results[i], yPos);
  1695. yPos += 16;
  1696. }
  1697. }
  1698.  
  1699. public void drawBlackBox(int xPos, int yPos) {
  1700. DrawingArea.drawPixels(71, yPos - 1, xPos - 2, 0x726451, 1);
  1701. DrawingArea.drawPixels(69, yPos, xPos + 174, 0x726451, 1);
  1702. DrawingArea.drawPixels(1, yPos - 2, xPos - 2, 0x726451, 178);
  1703. DrawingArea.drawPixels(1, yPos + 68, xPos, 0x726451, 174);
  1704. DrawingArea.drawPixels(71, yPos - 1, xPos - 1, 0x2E2B23, 1);
  1705. DrawingArea.drawPixels(71, yPos - 1, xPos + 175, 0x2E2B23, 1);
  1706. DrawingArea.drawPixels(1, yPos - 1, xPos, 0x2E2B23, 175);
  1707. DrawingArea.drawPixels(1, yPos + 69, xPos, 0x2E2B23, 175);
  1708. DrawingArea.method335(0, yPos, 174, 68, 220, xPos);
  1709. }
  1710.  
  1711. private void buildInterfaceMenu(int i, RSInterface class9, int k, int l, int i1, int j1) {
  1712. if(class9.interfaceType != 0 || class9.children == null || class9.interfaceShown)
  1713. return;
  1714. if(k < i || i1 < l || k > i + class9.width || i1 > l + class9.height)
  1715. return;
  1716. int k1 = class9.children.length;
  1717. for(int l1 = 0; l1 < k1; l1++)
  1718. {
  1719. int i2 = class9.childX[l1] + i;
  1720. int j2 = (class9.childY[l1] + l) - j1;
  1721. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[l1]];
  1722. i2 += class9_1.xOffset;
  1723. j2 += class9_1.yOffset;
  1724. if((class9_1.hoverType >= 0 || class9_1.disabledHoverColor != 0) && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1725. if(class9_1.hoverType >= 0)
  1726. anInt886 = class9_1.hoverType;
  1727. else
  1728. anInt886 = class9_1.id;
  1729. if (class9_1.interfaceType == 8 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1730. anInt1315 = class9_1.id;
  1731. }
  1732. if(class9_1.interfaceType == 0)
  1733. {
  1734. buildInterfaceMenu(i2, class9_1, k, j2, i1, class9_1.scrollPosition);
  1735. if(class9_1.scrollMax > class9_1.height)
  1736. method65(i2 + class9_1.width, class9_1.height, k, i1, class9_1, j2, true, class9_1.scrollMax);
  1737. } else
  1738. {
  1739. if(class9_1.atActionType == 1 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1740. {
  1741. boolean flag = false;
  1742. if(class9_1.contentType != 0)
  1743. flag = buildFriendsListMenu(class9_1);
  1744. if(!flag)
  1745. {
  1746. //System.out.println("1"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1747. if(idToggle == true) {
  1748. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1749. menuActionID[menuActionRow] = 315;
  1750. menuActionCmd3[menuActionRow] = class9_1.id;
  1751. menuActionRow++;
  1752. } else {
  1753. menuActionName[menuActionRow] = class9_1.tooltip;
  1754. menuActionID[menuActionRow] = 315;
  1755. menuActionCmd3[menuActionRow] = class9_1.id;
  1756. menuActionRow++;
  1757. }
  1758. }
  1759. }
  1760. if(class9_1.atActionType == 2 && spellSelected == 0 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1761. {
  1762. String s = class9_1.selectedActionName;
  1763. if(s.indexOf(" ") != -1)
  1764. s = s.substring(0, s.indexOf(" "));
  1765. if (class9_1.spellName.endsWith("Rush") || class9_1.spellName.endsWith("Burst") || class9_1.spellName.endsWith("Blitz") || class9_1.spellName.endsWith("Barrage") || class9_1.spellName.endsWith("strike") || class9_1.spellName.endsWith("bolt") || class9_1.spellName.equals("Crumble undead") || class9_1.spellName.endsWith("blast") || class9_1.spellName.endsWith("wave") || class9_1.spellName.equals("Claws of Guthix") || class9_1.spellName.equals("Flames of Zamorak") || class9_1.spellName.equals("Magic Dart")) {
  1766. menuActionName[menuActionRow] = "Autocast @gre@" + class9_1.spellName;
  1767. menuActionID[menuActionRow] = 104;
  1768. menuActionCmd3[menuActionRow] = class9_1.id;
  1769. menuActionRow++;
  1770. }
  1771. menuActionName[menuActionRow] = s + " @gre@" + class9_1.spellName;
  1772. menuActionID[menuActionRow] = 626;
  1773. menuActionCmd3[menuActionRow] = class9_1.id;
  1774. menuActionRow++;
  1775. }
  1776. if(class9_1.atActionType == 3 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1777. {
  1778. menuActionName[menuActionRow] = "Close";
  1779. menuActionID[menuActionRow] = 200;
  1780. menuActionCmd3[menuActionRow] = class9_1.id;
  1781. menuActionRow++;
  1782. }
  1783. if(class9_1.atActionType == 4 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1784. {
  1785. //System.out.println("2"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1786. if(idToggle == true) {
  1787. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1788. menuActionID[menuActionRow] = 169;
  1789. menuActionCmd3[menuActionRow] = class9_1.id;
  1790. menuActionRow++;
  1791. } else {
  1792. menuActionName[menuActionRow] = class9_1.tooltip;
  1793. menuActionID[menuActionRow] = 169;
  1794. menuActionCmd3[menuActionRow] = class9_1.id;
  1795. menuActionRow++;
  1796. }
  1797. if (class9_1.hoverText != null) {
  1798. //drawHoverBox(k, l, class9_1.hoverText);
  1799. //System.out.println("DING INTERFACE: " + class9_1.hoverText);
  1800. }
  1801. }
  1802. if(class9_1.atActionType == 5 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1803. //System.out.println("3"+class9_1.tooltip + ", " + class9_1.interfaceID);burasineef
  1804. if ( class9_1.amountActions > 0) {
  1805. for (int z = 0; z < class9_1.amountActions; z++) {
  1806. menuActionName[menuActionRow] = class9_1.actionsInfo[z];
  1807. menuActionID[menuActionRow] = (-z - 1);
  1808. menuActionCmd3[menuActionRow] = class9_1.id;
  1809. menuActionRow++;
  1810. }
  1811. } else {
  1812. if(idToggle == true) {
  1813. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1814. menuActionID[menuActionRow] = 646;
  1815. menuActionCmd3[menuActionRow] = class9_1.id;
  1816. menuActionRow++;
  1817. } else {
  1818. menuActionName[menuActionRow] = class9_1.tooltip;
  1819. menuActionID[menuActionRow] = 646;
  1820. menuActionCmd3[menuActionRow] = class9_1.id;
  1821. menuActionRow++;
  1822. }
  1823. }
  1824. }
  1825. if(class9_1.atActionType == 6 && !aBoolean1149 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1826. //System.out.println("4"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1827. if(idToggle == true) {
  1828. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1829. menuActionID[menuActionRow] = 679;
  1830. menuActionCmd3[menuActionRow] = class9_1.id;
  1831. menuActionRow++;
  1832. } else {
  1833. menuActionName[menuActionRow] = class9_1.tooltip;
  1834. menuActionID[menuActionRow] = 679;
  1835. menuActionCmd3[menuActionRow] = class9_1.id;
  1836. menuActionRow++;
  1837. }
  1838. }
  1839. if(class9_1.interfaceType == 2)
  1840. {
  1841. int k2 = 0;
  1842. for(int l2 = 0; l2 < class9_1.height; l2++) {
  1843. for(int i3 = 0; i3 < class9_1.width; i3++)
  1844. {
  1845. int j3 = i2 + i3 * (32 + class9_1.invSpritePadX);
  1846. int k3 = j2 + l2 * (32 + class9_1.invSpritePadY);
  1847. if(k2 < 20)
  1848. {
  1849. j3 += class9_1.spritesX[k2];
  1850. k3 += class9_1.spritesY[k2];
  1851. }
  1852. if(k >= j3 && i1 >= k3 && k < j3 + 32 && i1 < k3 + 32)
  1853. {
  1854. mouseInvInterfaceIndex = k2;//the item your mouse is on after dragging, so it works for first two rows but after the first two rows it doesnt
  1855. lastActiveInvInterface = class9_1.id;
  1856. if(class9_1.inventory[k2] > 0) {
  1857. ItemDef itemDef = ItemDef.forID(class9_1.inventory[k2] - 1);
  1858. if(itemSelected == 1 && class9_1.isInventoryInterface)
  1859. {
  1860. if(class9_1.id != anInt1284 || k2 != anInt1283)
  1861. {
  1862. menuActionName[menuActionRow] = "Use " + selectedItemName + " -> @lre@" + itemDef.name;
  1863. menuActionID[menuActionRow] = 870;
  1864. menuActionCmd1[menuActionRow] = itemDef.id;
  1865. menuActionCmd2[menuActionRow] = k2;
  1866. menuActionCmd3[menuActionRow] = class9_1.id;
  1867. menuActionRow++;
  1868. }
  1869. } else
  1870. if(spellSelected == 1 && class9_1.isInventoryInterface) {
  1871. if((spellUsableOn & 0x10) == 16)
  1872. {
  1873. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  1874. menuActionID[menuActionRow] = 543;
  1875. menuActionCmd1[menuActionRow] = itemDef.id;
  1876. menuActionCmd2[menuActionRow] = k2;
  1877. menuActionCmd3[menuActionRow] = class9_1.id;
  1878. menuActionRow++;
  1879. }
  1880. } else
  1881. {
  1882. if(class9_1.isInventoryInterface)
  1883. {
  1884. for(int l3 = 4; l3 >= 3; l3--)
  1885. if(itemDef.itemActions != null && itemDef.itemActions[l3] != null)
  1886. {
  1887. menuActionName[menuActionRow] = itemDef.itemActions[l3] + " @lre@" + itemDef.name;
  1888. if(l3 == 3)
  1889. menuActionID[menuActionRow] = 493;
  1890. if(l3 == 4)
  1891. menuActionID[menuActionRow] = 847;
  1892. menuActionCmd1[menuActionRow] = itemDef.id;
  1893. menuActionCmd2[menuActionRow] = k2;
  1894. menuActionCmd3[menuActionRow] = class9_1.id;
  1895. menuActionRow++;
  1896. } else
  1897. if(l3 == 4)
  1898. {
  1899. menuActionName[menuActionRow] = "Drop @lre@" + itemDef.name;
  1900. menuActionID[menuActionRow] = 847;
  1901. menuActionCmd1[menuActionRow] = itemDef.id;
  1902. menuActionCmd2[menuActionRow] = k2;
  1903. menuActionCmd3[menuActionRow] = class9_1.id;
  1904. menuActionRow++;
  1905. }
  1906.  
  1907. }
  1908. if(class9_1.usableItemInterface)
  1909. {
  1910. menuActionName[menuActionRow] = "Use @lre@" + itemDef.name;
  1911. menuActionID[menuActionRow] = 447;
  1912. menuActionCmd1[menuActionRow] = itemDef.id;
  1913. //k2 = inventory spot
  1914. //System.out.println(k2);
  1915. menuActionCmd2[menuActionRow] = k2;
  1916. menuActionCmd3[menuActionRow] = class9_1.id;
  1917. menuActionRow++;
  1918. }
  1919. if(class9_1.isInventoryInterface && itemDef.itemActions != null)
  1920. {
  1921. for(int i4 = 2; i4 >= 0; i4--)
  1922. if(itemDef.itemActions[i4] != null)
  1923. {
  1924. menuActionName[menuActionRow] = itemDef.itemActions[i4] + " @lre@" + itemDef.name;
  1925. if(i4 == 0)
  1926. menuActionID[menuActionRow] = 74;
  1927. if(i4 == 1)
  1928. menuActionID[menuActionRow] = 454;
  1929. if(i4 == 2)
  1930. menuActionID[menuActionRow] = 539;
  1931. menuActionCmd1[menuActionRow] = itemDef.id;
  1932. menuActionCmd2[menuActionRow] = k2;
  1933. menuActionCmd3[menuActionRow] = class9_1.id;
  1934. menuActionRow++;
  1935. }
  1936.  
  1937. }
  1938. if(class9_1.itemActions != null)
  1939. {
  1940. for(int j4 = 4; j4 >= 0; j4--)
  1941. if(class9_1.itemActions[j4] != null)
  1942. {
  1943. menuActionName[menuActionRow] = class9_1.itemActions[j4] + " @lre@" + itemDef.name;
  1944. if(j4 == 0)
  1945. menuActionID[menuActionRow] = 632;
  1946. if(j4 == 1)
  1947. menuActionID[menuActionRow] = 78;
  1948. if(j4 == 2)
  1949. menuActionID[menuActionRow] = 867;
  1950. if(j4 == 3)
  1951. menuActionID[menuActionRow] = 431;
  1952. if(j4 == 4)
  1953. menuActionID[menuActionRow] = 53;
  1954. menuActionCmd1[menuActionRow] = itemDef.id;
  1955. menuActionCmd2[menuActionRow] = k2;
  1956. menuActionCmd3[menuActionRow] = class9_1.id;
  1957. menuActionRow++;
  1958. }
  1959.  
  1960. }
  1961. if(idToggle == true) {
  1962. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + (class9_1.inventory[k2] - 1) + "@gre@)";
  1963. } else {
  1964. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  1965. }
  1966. menuActionID[menuActionRow] = 1125;
  1967. menuActionCmd1[menuActionRow] = itemDef.id;
  1968. menuActionCmd2[menuActionRow] = k2;
  1969. menuActionCmd3[menuActionRow] = class9_1.id;
  1970. menuActionRow++;
  1971. }
  1972. }
  1973. }
  1974. k2++;
  1975. }
  1976.  
  1977. }
  1978.  
  1979. }
  1980. }
  1981. }
  1982.  
  1983. }
  1984.  
  1985. public void drawScrollbar(int j, int k, int l, int i1, int j1) {
  1986. if(is474 || is480 || is508 || is525 || is562) {
  1987. scrollBar1.drawSprite(i1, l);
  1988. scrollBar2.drawSprite(i1, (l + j) - 16);
  1989. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 16);
  1990. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x3d3426, 15);
  1991. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x342d21, 13);
  1992. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x2e281d, 11);
  1993. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x29241b, 10);
  1994. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x252019, 9);
  1995. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 1);
  1996. int k1 = ((j - 32) * j) / j1;
  1997. if(k1 < 8)
  1998. k1 = 8;
  1999. int l1 = ((j - 32 - k1) * k) / (j1 - j);
  2000. DrawingArea.drawPixels(k1, l + 16 + l1, i1, barFillColor, 16);
  2001. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1);
  2002. DrawingArea.method341(l + 16 + l1, 0x817051, k1, i1 + 1);
  2003. DrawingArea.method341(l + 16 + l1, 0x73654a, k1, i1 + 2);
  2004. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 3);
  2005. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 4);
  2006. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 5);
  2007. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 6);
  2008. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 7);
  2009. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 8);
  2010. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 9);
  2011. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 10);
  2012. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 11);
  2013. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 12);
  2014. DrawingArea.method341(l + 16 + l1, 0x514635, k1, i1 + 13);
  2015. DrawingArea.method341(l + 16 + l1, 0x4b4131, k1, i1 + 14);
  2016. DrawingArea.method339(l + 16 + l1, 0x000001, 15, i1);
  2017. DrawingArea.method339(l + 17 + l1, 0x000001, 15, i1);
  2018. DrawingArea.method339(l + 17 + l1, 0x655841, 14, i1);
  2019. DrawingArea.method339(l + 17 + l1, 0x6a5c43, 13, i1);
  2020. DrawingArea.method339(l + 17 + l1, 0x6d5f48, 11, i1);
  2021. DrawingArea.method339(l + 17 + l1, 0x73654a, 10, i1);
  2022. DrawingArea.method339(l + 17 + l1, 0x76684b, 7, i1);
  2023. DrawingArea.method339(l + 17 + l1, 0x7b6a4d, 5, i1);
  2024. DrawingArea.method339(l + 17 + l1, 0x7e6e50, 4, i1);
  2025. DrawingArea.method339(l + 17 + l1, 0x817051, 3, i1);
  2026. DrawingArea.method339(l + 17 + l1, 0x000001, 2, i1);
  2027. DrawingArea.method339(l + 18 + l1, 0x000001, 16, i1);
  2028. DrawingArea.method339(l + 18 + l1, 0x564b38, 15, i1);
  2029. DrawingArea.method339(l + 18 + l1, 0x5d513c, 14, i1);
  2030. DrawingArea.method339(l + 18 + l1, 0x625640, 11, i1);
  2031. DrawingArea.method339(l + 18 + l1, 0x655841, 10, i1);
  2032. DrawingArea.method339(l + 18 + l1, 0x6a5c43, 7, i1);
  2033. DrawingArea.method339(l + 18 + l1, 0x6e6046, 5, i1);
  2034. DrawingArea.method339(l + 18 + l1, 0x716247, 4, i1);
  2035. DrawingArea.method339(l + 18 + l1, 0x7b6a4d, 3, i1);
  2036. DrawingArea.method339(l + 18 + l1, 0x817051, 2, i1);
  2037. DrawingArea.method339(l + 18 + l1, 0x000001, 1, i1);
  2038. DrawingArea.method339(l + 19 + l1, 0x000001, 16, i1);
  2039. DrawingArea.method339(l + 19 + l1, 0x514635, 15, i1);
  2040. DrawingArea.method339(l + 19 + l1, 0x564b38, 14, i1);
  2041. DrawingArea.method339(l + 19 + l1, 0x5d513c, 11, i1);
  2042. DrawingArea.method339(l + 19 + l1, 0x61553e, 9, i1);
  2043. DrawingArea.method339(l + 19 + l1, 0x655841, 7, i1);
  2044. DrawingArea.method339(l + 19 + l1, 0x6a5c43, 5, i1);
  2045. DrawingArea.method339(l + 19 + l1, 0x6e6046, 4, i1);
  2046. DrawingArea.method339(l + 19 + l1, 0x73654a, 3, i1);
  2047. DrawingArea.method339(l + 19 + l1, 0x817051, 2, i1);
  2048. DrawingArea.method339(l + 19 + l1, 0x000001, 1, i1);
  2049. DrawingArea.method339(l + 20 + l1, 0x000001, 16, i1);
  2050. DrawingArea.method339(l + 20 + l1, 0x4b4131, 15, i1);
  2051. DrawingArea.method339(l + 20 + l1, 0x544936, 14, i1);
  2052. DrawingArea.method339(l + 20 + l1, 0x594e3a, 13, i1);
  2053. DrawingArea.method339(l + 20 + l1, 0x5d513c, 10, i1);
  2054. DrawingArea.method339(l + 20 + l1, 0x61553e, 8, i1);
  2055. DrawingArea.method339(l + 20 + l1, 0x655841, 6, i1);
  2056. DrawingArea.method339(l + 20 + l1, 0x6a5c43, 4, i1);
  2057. DrawingArea.method339(l + 20 + l1, 0x73654a, 3, i1);
  2058. DrawingArea.method339(l + 20 + l1, 0x817051, 2, i1);
  2059. DrawingArea.method339(l + 20 + l1, 0x000001, 1, i1);
  2060. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1 + 15);
  2061. DrawingArea.method339(l + 15 + l1 + k1, 0x000001, 16, i1);
  2062. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 15, i1);
  2063. DrawingArea.method339(l + 14 + l1 + k1, 0x3f372a, 14, i1);
  2064. DrawingArea.method339(l + 14 + l1 + k1, 0x443c2d, 10, i1);
  2065. DrawingArea.method339(l + 14 + l1 + k1, 0x483e2f, 9, i1);
  2066. DrawingArea.method339(l + 14 + l1 + k1, 0x4a402f, 7, i1);
  2067. DrawingArea.method339(l + 14 + l1 + k1, 0x4b4131, 4, i1);
  2068. DrawingArea.method339(l + 14 + l1 + k1, 0x564b38, 3, i1);
  2069. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 2, i1);
  2070. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 16, i1);
  2071. DrawingArea.method339(l + 13 + l1 + k1, 0x443c2d, 15, i1);
  2072. DrawingArea.method339(l + 13 + l1 + k1, 0x4b4131, 11, i1);
  2073. DrawingArea.method339(l + 13 + l1 + k1, 0x514635, 9, i1);
  2074. DrawingArea.method339(l + 13 + l1 + k1, 0x544936, 7, i1);
  2075. DrawingArea.method339(l + 13 + l1 + k1, 0x564b38, 6, i1);
  2076. DrawingArea.method339(l + 13 + l1 + k1, 0x594e3a, 4, i1);
  2077. DrawingArea.method339(l + 13 + l1 + k1, 0x625640, 3, i1);
  2078. DrawingArea.method339(l + 13 + l1 + k1, 0x6a5c43, 2, i1);
  2079. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 1, i1);
  2080. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 16, i1);
  2081. DrawingArea.method339(l + 12 + l1 + k1, 0x443c2d, 15, i1);
  2082. DrawingArea.method339(l + 12 + l1 + k1, 0x4b4131, 14, i1);
  2083. DrawingArea.method339(l + 12 + l1 + k1, 0x544936, 12, i1);
  2084. DrawingArea.method339(l + 12 + l1 + k1, 0x564b38, 11, i1);
  2085. DrawingArea.method339(l + 12 + l1 + k1, 0x594e3a, 10, i1);
  2086. DrawingArea.method339(l + 12 + l1 + k1, 0x5d513c, 7, i1);
  2087. DrawingArea.method339(l + 12 + l1 + k1, 0x61553e, 4, i1);
  2088. DrawingArea.method339(l + 12 + l1 + k1, 0x6e6046, 3, i1);
  2089. DrawingArea.method339(l + 12 + l1 + k1, 0x7b6a4d, 2, i1);
  2090. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 1, i1);
  2091. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 16, i1);
  2092. DrawingArea.method339(l + 11 + l1 + k1, 0x4b4131, 15, i1);
  2093. DrawingArea.method339(l + 11 + l1 + k1, 0x514635, 14, i1);
  2094. DrawingArea.method339(l + 11 + l1 + k1, 0x564b38, 13, i1);
  2095. DrawingArea.method339(l + 11 + l1 + k1, 0x594e3a, 11, i1);
  2096. DrawingArea.method339(l + 11 + l1 + k1, 0x5d513c, 9, i1);
  2097. DrawingArea.method339(l + 11 + l1 + k1, 0x61553e, 7, i1);
  2098. DrawingArea.method339(l + 11 + l1 + k1, 0x655841, 5, i1);
  2099. DrawingArea.method339(l + 11 + l1 + k1, 0x6a5c43, 4, i1);
  2100. DrawingArea.method339(l + 11 + l1 + k1, 0x73654a, 3, i1);
  2101. DrawingArea.method339(l + 11 + l1 + k1, 0x7b6a4d, 2, i1);
  2102. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 1, i1);
  2103. } else {
  2104. scrollBar3.drawSprite(i1, l);
  2105. scrollBar4.drawSprite(i1, (l + j) - 16);
  2106. DrawingArea.method336(j - 32, l + 16, i1, anInt1002, 16);
  2107. int k1 = ((j - 32) * j) / j1;
  2108. if(k1 < 8)
  2109. k1 = 8;
  2110. int l1 = ((j - 32 - k1) * k) / (j1 - j);
  2111. DrawingArea.method336(k1, l + 16 + l1, i1, barFillColor, 16);
  2112. DrawingArea.method341(l + 16 + l1, anInt902, k1, i1);
  2113. DrawingArea.method341(l + 16 + l1, anInt902, k1, i1 + 1);
  2114. DrawingArea.method339(l + 16 + l1, anInt902, 16, i1);
  2115. DrawingArea.method339(l + 17 + l1, anInt902, 16, i1);
  2116. DrawingArea.method341(l + 16 + l1, anInt927, k1, i1 + 15);
  2117. DrawingArea.method341(l + 17 + l1, anInt927, k1 - 1, i1 + 14);
  2118. DrawingArea.method339(l + 15 + l1 + k1, anInt927, 16, i1);
  2119. DrawingArea.method339(l + 14 + l1 + k1, anInt927, 15, i1 + 1);
  2120. }
  2121. }
  2122.  
  2123. private boolean summoningTab = false;
  2124.  
  2125. private void updateNPCs(Stream stream, int i)
  2126. {
  2127. anInt839 = 0;
  2128. anInt893 = 0;
  2129. method139(stream);
  2130. method46(i, stream);
  2131. method86(stream);
  2132. for(int k = 0; k < anInt839; k++)
  2133. {
  2134. int l = anIntArray840[k];
  2135. if(npcArray[l].anInt1537 != loopCycle)
  2136. {
  2137. npcArray[l].desc = null;
  2138. npcArray[l] = null;
  2139. }
  2140. }
  2141. if(stream.currentOffset != i)
  2142. {
  2143. signlink.reporterror(myUsername + " size mismatch in getnpcpos - pos:" + stream.currentOffset + " psize:" + i);
  2144. throw new RuntimeException("eek");
  2145. }
  2146. for(int i1 = 0; i1 < npcCount; i1++)
  2147. if(npcArray[npcIndices[i1]] == null)
  2148. {
  2149. signlink.reporterror(myUsername + " null entry in npc list - pos:" + i1 + " size:" + npcCount);
  2150. throw new RuntimeException("eek");
  2151. }
  2152. }
  2153.  
  2154. private int cButtonHPos;
  2155. private int cButtonCPos;
  2156.  
  2157. private void processChatModeClick() {
  2158. if(is474 == true || is480 == true || is508 == true || is525 == true || is562 == true) {
  2159. if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  2160. cButtonHPos = 0;
  2161. inputTaken = true;
  2162. } else if(super.mouseX >= 62 && super.mouseX <= 117 && super.mouseY >= 482 && super.mouseY <= 503) {
  2163. cButtonHPos = 1;
  2164. inputTaken = true;
  2165. } else if(super.mouseX >= 119 && super.mouseX <= 174 && super.mouseY >= 482 && super.mouseY <= 503) {
  2166. cButtonHPos = 2;
  2167. inputTaken = true;
  2168. } else if(super.mouseX >= 176 && super.mouseX <= 231 && super.mouseY >= 482 && super.mouseY <= 503) {
  2169. cButtonHPos = 3;
  2170. inputTaken = true;
  2171. } else if(super.mouseX >= 233 && super.mouseX <= 288 && super.mouseY >= 482 && super.mouseY <= 503) {
  2172. cButtonHPos = 4;
  2173. inputTaken = true;
  2174. } else if(super.mouseX >= 290 && super.mouseX <= 345 && super.mouseY >= 482 && super.mouseY <= 503) {
  2175. cButtonHPos = 5;
  2176. inputTaken = true;
  2177. } else if(super.mouseX >= 347 && super.mouseX <= 402 && super.mouseY >= 482 && super.mouseY <= 503) {
  2178. cButtonHPos = 7;
  2179. inputTaken = true;
  2180. } else if(super.mouseX >= 404 && super.mouseX <= 514 && super.mouseY >= 480 && super.mouseY <= 501) {
  2181. cButtonHPos = 6;
  2182. inputTaken = true;
  2183. } else {
  2184. cButtonHPos = -1;
  2185. inputTaken = true;
  2186. }
  2187. if(super.clickMode3 == 1) {
  2188. if(super.saveClickX >= 5 && super.saveClickX <= 61 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2189. cButtonCPos = 0;
  2190. chatTypeView = 0;
  2191. inputTaken = true;
  2192. } else if(super.saveClickX >= 62 && super.saveClickX <= 117 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2193. cButtonCPos = 1;
  2194. chatTypeView = 5;
  2195. inputTaken = true;
  2196. } else if(super.saveClickX >= 119 && super.saveClickX <= 174 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2197. cButtonCPos = 2;
  2198. chatTypeView = 1;
  2199. inputTaken = true;
  2200. } else if(super.saveClickX >= 176 && super.saveClickX <= 231 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2201. cButtonCPos = 3;
  2202. chatTypeView = 2;
  2203. inputTaken = true;
  2204. } else if(super.saveClickX >= 233 && super.saveClickX <= 288 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2205. cButtonCPos = 4;
  2206. chatTypeView = 11;
  2207. inputTaken = true;
  2208. } else if(super.saveClickX >= 290 && super.saveClickX <= 345 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2209. cButtonCPos = 5;
  2210. chatTypeView = 3;
  2211. inputTaken = true;
  2212. } else if(super.saveClickX >= 347 && super.saveClickX <= 402 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2213. cButtonCPos = 6;
  2214. inputTaken = true;
  2215. } else if(super.saveClickX >= 404 && super.saveClickX <= 515 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2216. if(openInterfaceID == -1) {
  2217. clearTopInterfaces();
  2218. reportAbuseInput = "";
  2219. canMute = false;
  2220. for(int i = 0; i < RSInterface.interfaceCache.length; i++) {
  2221. if(RSInterface.interfaceCache[i] == null || RSInterface.interfaceCache[i].contentType != 600)
  2222. continue;
  2223. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  2224. break;
  2225. }
  2226. } else {
  2227. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  2228. }
  2229. }
  2230. }
  2231. } else if(is474) {
  2232. if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  2233. cButtonHPos = 0;
  2234. inputTaken = true;
  2235. } else if(super.mouseX >= 71 && super.mouseX <= 127 && super.mouseY >= 482 && super.mouseY <= 503) {
  2236. cButtonHPos = 1;
  2237. inputTaken = true;
  2238. } else if(super.mouseX >= 137 && super.mouseX <= 193 && super.mouseY >= 482 && super.mouseY <= 503) {
  2239. cButtonHPos = 2;
  2240. inputTaken = true;
  2241. } else if(super.mouseX >= 203 && super.mouseX <= 259 && super.mouseY >= 482 && super.mouseY <= 503) {
  2242. cButtonHPos = 3;
  2243. inputTaken = true;
  2244. } else if(super.mouseX >= 269 && super.mouseX <= 325 && super.mouseY >= 482 && super.mouseY <= 503) {
  2245. cButtonHPos = 4;
  2246. inputTaken = true;
  2247. } else if(super.mouseX >= 335 && super.mouseX <= 391 && super.mouseY >= 482 && super.mouseY <= 503) {
  2248. cButtonHPos = 5;
  2249. inputTaken = true;
  2250. } else if(super.mouseX >= 404 && super.mouseX <= 515 && super.mouseY >= 482 && super.mouseY <= 503) {
  2251. cButtonHPos = 6;
  2252. inputTaken = true;
  2253. } else {
  2254. cButtonHPos = -1;
  2255. inputTaken = true;
  2256. }
  2257. if(super.clickMode3 == 1) {
  2258. if(super.saveClickX >= 5 && super.saveClickX <= 61 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2259. cButtonCPos = 0;
  2260. chatTypeView = 0;
  2261. inputTaken = true;
  2262. } else if(super.saveClickX >= 71 && super.saveClickX <= 127 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2263. cButtonCPos = 1;
  2264. chatTypeView = 5;
  2265. inputTaken = true;
  2266. } else if(super.saveClickX >= 137 && super.saveClickX <= 193 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2267. cButtonCPos = 2;
  2268. chatTypeView = 1;
  2269. inputTaken = true;
  2270. } else if(super.saveClickX >= 203 && super.saveClickX <= 259 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2271. cButtonCPos = 3;
  2272. chatTypeView = 2;
  2273. inputTaken = true;
  2274. } else if(super.saveClickX >= 269 && super.saveClickX <= 325 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2275. cButtonCPos = 4;
  2276. chatTypeView = 11;
  2277. inputTaken = true;
  2278. } else if(super.saveClickX >= 335 && super.saveClickX <= 391 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2279. cButtonCPos = 5;
  2280. chatTypeView = 3;
  2281. inputTaken = true;
  2282. } else if(super.saveClickX >= 404 && super.saveClickX <= 515 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2283. if(openInterfaceID == -1) {
  2284. clearTopInterfaces();
  2285. reportAbuseInput = "";
  2286. canMute = false;
  2287. for(int i = 0; i < RSInterface.interfaceCache.length; i++) {
  2288. if(RSInterface.interfaceCache[i] == null || RSInterface.interfaceCache[i].contentType != 600)
  2289. continue;
  2290. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  2291. break;
  2292. }
  2293. } else {
  2294. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  2295. }
  2296. }
  2297. }
  2298. } else {
  2299. if(super.clickMode3 == 1) {
  2300. if(super.saveClickX >= 6 && super.saveClickX <= 106 && super.saveClickY >= 467 && super.saveClickY <= 499)
  2301. {
  2302. publicChatMode = (publicChatMode + 1) % 4;
  2303. inputTaken = true;
  2304. stream.createFrame(95);
  2305. stream.writeWordBigEndian(publicChatMode);
  2306. stream.writeWordBigEndian(privateChatMode);
  2307. stream.writeWordBigEndian(tradeMode);
  2308. }
  2309. if(super.saveClickX >= 135 && super.saveClickX <= 235 && super.saveClickY >= 467 && super.saveClickY <= 499)
  2310. {
  2311. privateChatMode = (privateChatMode + 1) % 3;
  2312. inputTaken = true;
  2313. stream.createFrame(95);
  2314. stream.writeWordBigEndian(publicChatMode);
  2315. stream.writeWordBigEndian(privateChatMode);
  2316. stream.writeWordBigEndian(tradeMode);
  2317. }
  2318. if(super.saveClickX >= 273 && super.saveClickX <= 373 && super.saveClickY >= 467 && super.saveClickY <= 499)
  2319. {
  2320. tradeMode = (tradeMode + 1) % 3;
  2321. inputTaken = true;
  2322. stream.createFrame(95);
  2323. stream.writeWordBigEndian(publicChatMode);
  2324. stream.writeWordBigEndian(privateChatMode);
  2325. stream.writeWordBigEndian(tradeMode);
  2326. }
  2327. if(super.saveClickX >= 404 && super.saveClickX <= 515 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2328. if(openInterfaceID == -1) {
  2329. clearTopInterfaces();
  2330. reportAbuseInput = "";
  2331. canMute = false;
  2332. for(int i = 0; i < RSInterface.interfaceCache.length; i++) {
  2333. if(RSInterface.interfaceCache[i] == null || RSInterface.interfaceCache[i].contentType != 600)
  2334. continue;
  2335. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  2336. break;
  2337. }
  2338. } else {
  2339. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  2340. }
  2341. }
  2342. }
  2343. }
  2344. }
  2345.  
  2346. private void method33(int i)
  2347. {
  2348. int j = Varp.cache[i].anInt709;
  2349. if(j == 0)
  2350. return;
  2351. int k = variousSettings[i];
  2352. if(j == 1)
  2353. {
  2354. if(k == 1)
  2355. Texture.method372(0.90000000000000002D);
  2356. if(k == 2)
  2357. Texture.method372(0.80000000000000004D);
  2358. if(k == 3)
  2359. Texture.method372(0.69999999999999996D);
  2360. if(k == 4)
  2361. Texture.method372(0.59999999999999998D);
  2362. ItemDef.mruNodes1.unlinkAll();
  2363. welcomeScreenRaised = true;
  2364. }
  2365. if(j == 3)
  2366. {
  2367. boolean flag1 = musicEnabled;
  2368. if(k == 0)
  2369. {
  2370. adjustVolume(musicEnabled, 0);
  2371. musicEnabled = true;
  2372. }
  2373. if(k == 1)
  2374. {
  2375. adjustVolume(musicEnabled, -400);
  2376. musicEnabled = true;
  2377. }
  2378. if(k == 2)
  2379. {
  2380. adjustVolume(musicEnabled, -800);
  2381. musicEnabled = true;
  2382. }
  2383. if(k == 3)
  2384. {
  2385. adjustVolume(musicEnabled, -1200);
  2386. musicEnabled = true;
  2387. }
  2388. if(k == 4)
  2389. musicEnabled = false;
  2390. if(musicEnabled != flag1 && !lowMem)
  2391. {
  2392. if(musicEnabled)
  2393. {
  2394. nextSong = currentSong;
  2395. songChanging = true;
  2396. onDemandFetcher.loadToCache(2, nextSong);
  2397. } else
  2398. {
  2399. stopMidi();
  2400. }
  2401. prevSong = 0;
  2402. }
  2403. }
  2404. if(j == 4)
  2405. {
  2406. if(k == 0)
  2407. {
  2408. aBoolean848 = true;
  2409. setWaveVolume(0);
  2410. }
  2411. if(k == 1)
  2412. {
  2413. aBoolean848 = true;
  2414. setWaveVolume(-400);
  2415. }
  2416. if(k == 2)
  2417. {
  2418. aBoolean848 = true;
  2419. setWaveVolume(-800);
  2420. }
  2421. if(k == 3)
  2422. {
  2423. aBoolean848 = true;
  2424. setWaveVolume(-1200);
  2425. }
  2426. if(k == 4)
  2427. aBoolean848 = false;
  2428. }
  2429. if(j == 5)
  2430. anInt1253 = k;
  2431. if(j == 6)
  2432. anInt1249 = k;
  2433. if(j == 8)
  2434. {
  2435. splitPrivateChat = k;
  2436. inputTaken = true;
  2437. }
  2438. if(j == 9)
  2439. anInt913 = k;
  2440. }
  2441.  
  2442. void block(int cycle, int x, int y) {
  2443. if (cycle > loopCycle) {
  2444. y -= 30;
  2445. int difference = (cycle - loopCycle);
  2446. int trans = (int) Math.round((double) difference * 3.5);
  2447. int height = (int) Math.round(difference / 6);
  2448. combatIcons[3].drawTransparent((x - 12), (y - 12 + height), trans);
  2449. }
  2450. }
  2451.  
  2452.  
  2453. void hit10(int cycle, int x, int y, int type, int type2, String damage) {
  2454. if (cycle > loopCycle) {
  2455. y -= 30;
  2456. int difference = (cycle - loopCycle);
  2457. int trans = (int) Math.round((double) difference * 3.5);
  2458. int height = (int) Math.round(difference / 6);
  2459. combatIcons[type2].drawTransparent((x - 30), (y - 12 + height), trans);
  2460. hitMark[type].drawTransparent((x - 12), (y - 12 + height), trans);
  2461. smallText.drawText(0, damage, (y + 4 + height), x);
  2462. smallText.drawText(0xffffff, damage, (y + 3 + height), (x - 1));
  2463. }
  2464. }
  2465.  
  2466. void hit100(int cycle, int x, int y, int type, int type2, String damage) {
  2467. if (cycle > loopCycle) {
  2468. y -= 30;
  2469. int difference = (cycle - loopCycle);
  2470. int trans = (int) Math.round((double) difference * 3.5);
  2471. int height = (int) Math.round(difference / 6);
  2472. combatIcons[type2].drawTransparent((x - 35), (y - 11 + height), trans);
  2473. hitMark[0].drawTransparent((x - 20), (y - 13 + height), trans);
  2474. smallText.drawText(0, damage, (y + 4 + height), x);
  2475. smallText.drawText(0xffffff, damage, (y + 3 + height), (x - 1));
  2476. }
  2477. }
  2478.  
  2479. void hit400(int cycle, int x, int y, int type, int type2, String damage) {
  2480. if (cycle > loopCycle) {
  2481. y -= 30;
  2482. int difference = (cycle - loopCycle);
  2483. int trans = (int) Math.round((double) difference * 3.5);
  2484. int height = (int) Math.round(difference / 6);
  2485. combatIcons[type2].drawTransparent((x - 35), (y - 11 + height), trans);
  2486. hitMark[2].drawTransparent((x - 20), (y - 13 + height), trans);
  2487. smallText.drawText(0, damage, (y + 4 + height), x);
  2488. smallText.drawText(0xffffff, damage, (y + 3 + height), (x - 1));
  2489. }
  2490. }
  2491.  
  2492. private Sprite HPBarFull;
  2493. private Sprite HPBarEmpty;
  2494.  
  2495. private String getCombatLevel(Player otherPlayer) {
  2496. return otherPlayer.combatLevel + "+" +Math.round((otherPlayer.skill * 0.121212));
  2497. }
  2498.  
  2499. private void updateEntities() {
  2500.  
  2501. try{
  2502. int anInt974 = 0;
  2503. for(int j = -1; j < playerCount + npcCount; j++) {
  2504. Object obj;
  2505. if(j == -1)
  2506. obj = myPlayer;
  2507. else
  2508. if(j < playerCount)
  2509. obj = playerArray[playerIndices[j]];
  2510. else
  2511. obj = npcArray[npcIndices[j - playerCount]];
  2512. if(obj == null || !((Entity) (obj)).isVisible())
  2513. continue;
  2514. if(obj instanceof NPC) {
  2515. EntityDef entityDef = ((NPC)obj).desc;
  2516.  
  2517. if(namesToggle == true) {
  2518. String s = entityDef.name;
  2519. s = s + combatDiffColor(myPlayer.combatLevel, entityDef.combatLevel) + " (level: " + entityDef.combatLevel + ")";
  2520. if(entityDef.combatLevel != 0) {
  2521. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height+15);
  2522. smallText.method382(0xFFFF33, spriteDrawX, s, spriteDrawY-8, true);
  2523. } else if(entityDef.combatLevel == 0) {
  2524. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height+15);
  2525. smallText.method382(0xFFFF33, spriteDrawX, entityDef.name, spriteDrawY-8, true);
  2526. }
  2527. } else if(namesToggle == false) {
  2528.  
  2529. }
  2530.  
  2531. if(entityDef.childrenIDs != null)
  2532. entityDef = entityDef.method161();
  2533. if(entityDef == null)
  2534. continue;
  2535. }
  2536. if(namesToggle == true) {
  2537. if(j < playerCount) {
  2538. int l = 45;
  2539. Player player = (Player)obj;
  2540. if(player.headIcon >= 0) {
  2541. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2542. if(spriteDrawX > -1) {
  2543. if (player.skullIcon < 2) {
  2544. skullIcons[player.skullIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2545. l += 25;//25
  2546. }
  2547. /*if (player.headIcon < 7) {
  2548. headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2549. l += 20;//20
  2550. }*/
  2551. if(player.headIcon < 18) {
  2552. headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2553. l += 26;
  2554. }
  2555. }
  2556. }
  2557. if(j >= 0 && anInt855 == 10 && anInt933 == playerIndices[j]) {
  2558. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2559. if(spriteDrawX > -1)
  2560. headIconsHint[player.hintIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2561. l += 30;
  2562. }
  2563. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2564. int col = 0x3399ff;
  2565. newSmallFont.drawCenteredString(player.name, spriteDrawX, spriteDrawY-8, col, 100);
  2566.  
  2567. } else {
  2568. EntityDef entityDef_1 = ((NPC)obj).desc;
  2569. if(entityDef_1.anInt75 >= 0 && entityDef_1.anInt75 < headIcons.length) {
  2570. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2571. if(spriteDrawX > -1)
  2572. headIcons[entityDef_1.anInt75].drawSprite(spriteDrawX - 12, spriteDrawY - 50);
  2573. }
  2574. if(anInt855 == 1 && anInt1222 == npcIndices[j - playerCount] && loopCycle % 20 < 10) {
  2575. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2576. if(spriteDrawX > -1)
  2577. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 50);
  2578. }
  2579. }
  2580. } else if(namesToggle == false) {
  2581. if(j < playerCount) {
  2582. int l = 30;
  2583. Player player = (Player)obj;
  2584. if(player.headIcon >= 0) {
  2585. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2586. if(spriteDrawX > -1) {
  2587. if (player.skullIcon < 2) {
  2588. skullIcons[player.skullIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2589. l += 25;
  2590. }
  2591. /*if (player.headIcon < 7) {
  2592. headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2593. l += 18;
  2594. }*/
  2595. if(player.headIcon < 18) {
  2596. headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2597. l += 26;
  2598. }
  2599. }
  2600. }
  2601. if(j >= 0 && anInt855 == 10 && anInt933 == playerIndices[j]) {
  2602. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2603. if(spriteDrawX > -1)
  2604. headIconsHint[player.hintIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2605. }
  2606. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2607.  
  2608. } else {
  2609. EntityDef entityDef_1 = ((NPC)obj).desc;
  2610. if(entityDef_1.anInt75 >= 0 && entityDef_1.anInt75 < headIcons.length) {
  2611. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2612. if(spriteDrawX > -1)
  2613. headIcons[entityDef_1.anInt75].drawSprite(spriteDrawX - 12, spriteDrawY - 30);
  2614. }
  2615. if(anInt855 == 1 && anInt1222 == npcIndices[j - playerCount] && loopCycle % 20 < 10) {
  2616. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2617. if(spriteDrawX > -1)
  2618. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 30);
  2619. }
  2620. }
  2621. }
  2622. if(((Entity) (obj)).textSpoken != null && (j >= playerCount || publicChatMode == 0 || publicChatMode == 3 || publicChatMode == 1 && isFriendOrSelf(((Player)obj).name)))
  2623. {
  2624. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height);
  2625. if(spriteDrawX > -1 && anInt974 < anInt975)
  2626. {
  2627. anIntArray979[anInt974] = chatTextDrawingArea.method384(((Entity) (obj)).textSpoken) / 2;
  2628. anIntArray978[anInt974] = chatTextDrawingArea.anInt1497;
  2629. anIntArray976[anInt974] = spriteDrawX;
  2630. anIntArray977[anInt974] = spriteDrawY;
  2631. anIntArray980[anInt974] = ((Entity) (obj)).anInt1513;
  2632. anIntArray981[anInt974] = ((Entity) (obj)).anInt1531;
  2633. anIntArray982[anInt974] = ((Entity) (obj)).textCycle;
  2634. aStringArray983[anInt974++] = ((Entity) (obj)).textSpoken;
  2635. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 >= 1 && ((Entity) (obj)).anInt1531 <= 3)
  2636. {
  2637. anIntArray978[anInt974] += 10;
  2638. anIntArray977[anInt974] += 5;
  2639. }
  2640. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 4)
  2641. anIntArray979[anInt974] = 60;
  2642. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 5)
  2643. anIntArray978[anInt974] += 5;
  2644. }
  2645. }
  2646. if(((Entity) (obj)).loopCycleStatus > loopCycle) {
  2647. try {
  2648. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2649. if(spriteDrawX > -1) {
  2650. int i1 = (((Entity) (obj)).currentHealth * 30) / ((Entity) (obj)).maxHealth;
  2651. if(i1 > 30)
  2652. i1 = 30;
  2653. int HpPercent = (((Entity) (obj)).currentHealth * 56) / ((Entity) (obj)).maxHealth;
  2654. if (HpPercent > 56)
  2655. HpPercent = 56;
  2656. if(!hitbarToggle){
  2657. DrawingArea.method336(5, spriteDrawY - 3, spriteDrawX - 15, 65280, i1);
  2658. DrawingArea.method336(5, spriteDrawY - 3, (spriteDrawX - 15) + i1, 0xff0000, 30 - i1);
  2659. } else {
  2660. HPBarEmpty.drawSprite(spriteDrawX - 28, spriteDrawY - 5);//3
  2661. HPBarFull = new Sprite(sign.signlink.findcachedir() + "Sprites/Player/HP 0.PNG", HpPercent, 7);
  2662. HPBarFull.drawSprite(spriteDrawX - 28, spriteDrawY - 5);
  2663. }
  2664. }
  2665. }catch(Exception e) {
  2666. }
  2667. }
  2668. for(int j1 = 0; j1 < 4; j1++)
  2669. if(((Entity) (obj)).hitsLoopCycle[j1] > loopCycle) {
  2670. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height / 2);
  2671. if (hitmarks) {
  2672. if(spriteDrawX > -1) {
  2673. Entity e = ((Entity) (obj));
  2674. switch (j1) {
  2675. case 1:
  2676. spriteDrawY += 18;
  2677. break;
  2678. case 2:
  2679. spriteDrawY += 36;
  2680. if (e.hitArray[j1] <= 0)
  2681. spriteDrawY += 4;
  2682. break;
  2683. case 3:
  2684. spriteDrawY += 54;
  2685. break;
  2686. }
  2687. if (e.moveTimer[j1] == 0) {
  2688. if (e.hitmarkMove[j1] > -14)
  2689. e.hitmarkMove[j1]--;
  2690. e.moveTimer[j1] = 2;
  2691. } else {
  2692. e.moveTimer[j1]--;
  2693. }
  2694. if (e.hitmarkMove[j1] <= -14)
  2695. e.hitmarkTrans[j1] -= 10;
  2696. //System.out.println("hit: "+j1);
  2697. hitmarkDraw(String.valueOf(e.hitArray[j1]).length(), e.hitMarkTypes[j1], e.hitIcon[j1], e.hitArray[j1], e.soakDamage[j1], e.hitmarkMove[j1], e.hitmarkTrans[j1], ((Entity) (obj)).hitsLoopCycle[j1]);
  2698. }
  2699. } else {
  2700. //hitMarks[((Entity) (obj)).hitMarkTypes[j1]].drawTranSprite(spriteDrawX - 12, spriteDrawY - 12, 0);
  2701. //smallText.drawText(0, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 4, spriteDrawX);
  2702. //smallText.drawText(0xffffff, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 3, spriteDrawX - 1);
  2703. hitMarks[((Entity) (obj)).hitMarkTypes[j1]].drawSprite(spriteDrawX - 12, spriteDrawY - 12);
  2704. smallText.drawText(0, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 4, spriteDrawX);
  2705. smallText.drawText(0xffffff, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 3, spriteDrawX - 1);
  2706. }
  2707. }
  2708. }
  2709. for(int k = 0; k < anInt974; k++) {
  2710. int k1 = anIntArray976[k];
  2711. int l1 = anIntArray977[k];
  2712. int j2 = anIntArray979[k];
  2713. int k2 = anIntArray978[k];
  2714. boolean flag = true;
  2715. while(flag)
  2716. {
  2717. flag = false;
  2718. for(int l2 = 0; l2 < k; l2++)
  2719. if(l1 + 2 > anIntArray977[l2] - anIntArray978[l2] && l1 - k2 < anIntArray977[l2] + 2 && k1 - j2 < anIntArray976[l2] + anIntArray979[l2] && k1 + j2 > anIntArray976[l2] - anIntArray979[l2] && anIntArray977[l2] - anIntArray978[l2] < l1)
  2720. {
  2721. l1 = anIntArray977[l2] - anIntArray978[l2];
  2722. flag = true;
  2723. }
  2724.  
  2725. }
  2726. spriteDrawX = anIntArray976[k];
  2727. spriteDrawY = anIntArray977[k] = l1;
  2728. String s = aStringArray983[k];
  2729. if(anInt1249 == 0)
  2730. {
  2731. int i3 = 0xffff00;
  2732. if(anIntArray980[k] < 6)
  2733. i3 = anIntArray965[anIntArray980[k]];
  2734. if(anIntArray980[k] == 6)
  2735. i3 = anInt1265 % 20 >= 10 ? 0xffff00 : 0xff0000;
  2736. if(anIntArray980[k] == 7)
  2737. i3 = anInt1265 % 20 >= 10 ? 65535 : 255;
  2738. if(anIntArray980[k] == 8)
  2739. i3 = anInt1265 % 20 >= 10 ? 0x80ff80 : 45056;
  2740. if(anIntArray980[k] == 9) {
  2741. int j3 = 150 - anIntArray982[k];
  2742. if(j3 < 50)
  2743. i3 = 0xff0000 + 1280 * j3;
  2744. else
  2745. if(j3 < 100)
  2746. i3 = 0xffff00 - 0x50000 * (j3 - 50);
  2747. else
  2748. if(j3 < 150)
  2749. i3 = 65280 + 5 * (j3 - 100);
  2750. }
  2751. if(anIntArray980[k] == 10) {
  2752. int k3 = 150 - anIntArray982[k];
  2753. if(k3 < 50)
  2754. i3 = 0xff0000 + 5 * k3;
  2755. else
  2756. if(k3 < 100)
  2757. i3 = 0xff00ff - 0x50000 * (k3 - 50);
  2758. else
  2759. if(k3 < 150)
  2760. i3 = (255 + 0x50000 * (k3 - 100)) - 5 * (k3 - 100);
  2761. }
  2762. if(anIntArray980[k] == 11) {
  2763. int l3 = 150 - anIntArray982[k];
  2764. if(l3 < 50)
  2765. i3 = 0xffffff - 0x50005 * l3;
  2766. else
  2767. if(l3 < 100)
  2768. i3 = 65280 + 0x50005 * (l3 - 50);
  2769. else
  2770. if(l3 < 150)
  2771. i3 = 0xffffff - 0x50000 * (l3 - 100);
  2772. }
  2773. if(anIntArray981[k] == 0) {
  2774. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  2775. chatTextDrawingArea.drawText(i3, s, spriteDrawY, spriteDrawX);
  2776. }
  2777. if(anIntArray981[k] == 1) {
  2778. chatTextDrawingArea.method386(0, s, spriteDrawX, anInt1265, spriteDrawY + 1);
  2779. chatTextDrawingArea.method386(i3, s, spriteDrawX, anInt1265, spriteDrawY);
  2780. }
  2781. if(anIntArray981[k] == 2) {
  2782. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY + 1, 0);
  2783. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY, i3);
  2784. }
  2785. if(anIntArray981[k] == 3) {
  2786. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY + 1, spriteDrawX, 0);
  2787. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY, spriteDrawX, i3);
  2788. }
  2789. if(anIntArray981[k] == 4) {
  2790. int i4 = chatTextDrawingArea.method384(s);
  2791. int k4 = ((150 - anIntArray982[k]) * (i4 + 100)) / 150;
  2792. DrawingArea.setDrawingArea(334, spriteDrawX - 50, spriteDrawX + 50, 0);
  2793. chatTextDrawingArea.method385(0, s, spriteDrawY + 1, (spriteDrawX + 50) - k4);
  2794. chatTextDrawingArea.method385(i3, s, spriteDrawY, (spriteDrawX + 50) - k4);
  2795. DrawingArea.defaultDrawingAreaSize();
  2796. }
  2797. if(anIntArray981[k] == 5) {
  2798. int j4 = 150 - anIntArray982[k];
  2799. int l4 = 0;
  2800. if(j4 < 25)
  2801. l4 = j4 - 25;
  2802. else
  2803. if(j4 > 125)
  2804. l4 = j4 - 125;
  2805. DrawingArea.setDrawingArea(spriteDrawY + 5, 0, 512, spriteDrawY - chatTextDrawingArea.anInt1497 - 1);
  2806. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1 + l4, spriteDrawX);
  2807. chatTextDrawingArea.drawText(i3, s, spriteDrawY + l4, spriteDrawX);
  2808. DrawingArea.defaultDrawingAreaSize();
  2809. }
  2810. } else {
  2811. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  2812. chatTextDrawingArea.drawText(0xffff00, s, spriteDrawY, spriteDrawX);
  2813. }
  2814. }
  2815. } catch(Exception e){ }
  2816. }
  2817.  
  2818. private void delFriend(long l)
  2819. {
  2820. try
  2821. {
  2822. if(l == 0L)
  2823. return;
  2824. for(int i = 0; i < friendsCount; i++)
  2825. {
  2826. if(friendsListAsLongs[i] != l)
  2827. continue;
  2828. friendsCount--;
  2829. for(int j = i; j < friendsCount; j++)
  2830. {
  2831. friendsList[j] = friendsList[j + 1];
  2832. friendsNodeIDs[j] = friendsNodeIDs[j + 1];
  2833. friendsListAsLongs[j] = friendsListAsLongs[j + 1];
  2834. }
  2835.  
  2836. stream.createFrame(215);
  2837. stream.writeQWord(l);
  2838. break;
  2839. }
  2840. }
  2841. catch(RuntimeException runtimeexception)
  2842. {
  2843. signlink.reporterror("18622, " + false + ", " + l + ", " + runtimeexception.toString());
  2844. throw new RuntimeException();
  2845. }
  2846. }
  2847.  
  2848. public void drawSideIcons(int paddingX, int paddingY) {
  2849. if(is480 || is508 || is525 || is474) {
  2850. /* Top sideIcons */
  2851. if(tabInterfaceIDs[0] != -1)//attack
  2852. sideIcons[0].drawSprite(10+3, 4);
  2853. if(tabInterfaceIDs[1] != -1)//stat
  2854. sideIcons[1].drawSprite(43+3, 4);
  2855. if(tabInterfaceIDs[2] != -1)//quest
  2856. sideIcons[2].drawSprite(76+3, 3);
  2857. if(tabInterfaceIDs[3] != -1)//inventory
  2858. sideIcons[3].drawSprite(111+3, 5);
  2859. if(tabInterfaceIDs[4] != -1)//equipment
  2860. sideIcons[4].drawSprite(140+3, 1);
  2861. if(tabInterfaceIDs[5] != -1)//prayer
  2862. //sideIcons[5].drawSprite(174+3, 1);
  2863. newSideIcons[6].drawSprite(181, 6);
  2864. if(tabInterfaceIDs[6] != -1)//magic
  2865. sideIcons[6].drawSprite(208+3, 4);
  2866. /* Bottom sideIcons */
  2867. if(tabInterfaceIDs[7] != -1)//summoning
  2868. newSideIcons[15].drawSprite(11+3, 303);
  2869. if(tabInterfaceIDs[8] != -1)//friends
  2870. sideIcons[8].drawSprite(46+3, 306);
  2871. if(tabInterfaceIDs[9] != -1)//ignore
  2872. sideIcons[9].drawSprite(79+3, 306);
  2873. if(tabInterfaceIDs[10] != -1)//logout
  2874. sideIcons[7].drawSprite(113+3, 302);
  2875. if(tabInterfaceIDs[11] != -1)//options
  2876. sideIcons[11].drawSprite(145+3, 304);
  2877. if(tabInterfaceIDs[12] != -1)//emotes
  2878. sideIcons[12].drawSprite(181+3, 302);
  2879. /*if(tabInterfaceIDs[13] != -1)//music
  2880. sideIcons[13].drawSprite(213+3, 303);*/
  2881. } else if(is562) {
  2882. if (tabInterfaceIDs[0] != -1)
  2883. newSideIcons[0].drawSprite(11, 8);
  2884. if (tabInterfaceIDs[1] != -1)
  2885. newSideIcons[1].drawSprite(40, 8);
  2886. if (tabInterfaceIDs[2] != -1)
  2887. newSideIcons[2].drawSprite(70, 8);
  2888. if (tabInterfaceIDs[14] != -1)
  2889. newSideIcons[3].drawSprite(99, 8);
  2890. if (tabInterfaceIDs[3] != -1)
  2891. newSideIcons[4].drawSprite(130, 8);
  2892. if (tabInterfaceIDs[4] != -1)
  2893. newSideIcons[5].drawSprite(162, 8);
  2894. if (tabInterfaceIDs[5] != -1)
  2895. newSideIcons[6].drawSprite(189, 8);
  2896. if (tabInterfaceIDs[6] != -1)
  2897. newSideIcons[7].drawSprite(219, 8);
  2898. /* Bottom sideIcons */
  2899. if (tabInterfaceIDs[9] != -1)
  2900. newSideIcons[8].drawSprite(40, 306);
  2901. if (tabInterfaceIDs[8] != -1)
  2902. newSideIcons[9].drawSprite(72, 306);
  2903. if (tabInterfaceIDs[7] != -1)
  2904. newSideIcons[13].drawSprite(99, 306);
  2905. if (tabInterfaceIDs[11] != -1)
  2906. newSideIcons[10].drawSprite(129, 306);
  2907. if (tabInterfaceIDs[12] != -1)
  2908. newSideIcons[11].drawSprite(157, 306);
  2909. if (tabInterfaceIDs[13] != -1)
  2910. newSideIcons[12].drawSprite(188, 306);
  2911. if (tabInterfaceIDs[15] != -1)
  2912. newSideIcons[14].drawSprite(218, 307);
  2913. if (tabInterfaceIDs[16] != -1)
  2914.  
  2915. newSideIcons[15].drawSprite(7+2, 305);
  2916. }
  2917.  
  2918. }
  2919. public void drawRedStones(int paddingX, int paddingY) {
  2920. paddingX += 2;
  2921.  
  2922. if (toggleFullscreen) {
  2923. redStones[4].drawSprite(1 + paddingX, 261 + paddingY);
  2924. redStones[4].drawSprite(31 + paddingX, 261 + paddingY);
  2925. redStones[4].drawSprite(61 + paddingX, 261 + paddingY);
  2926. redStones[4].drawSprite(91 + paddingX, 261 + paddingY);
  2927. redStones[4].drawSprite(121 + paddingX, 261 + paddingY);
  2928. redStones[4].drawSprite(151 + paddingX, 261 + paddingY);
  2929. redStones[4].drawSprite(181 + paddingX, 261 + paddingY);
  2930. redStones[4].drawSprite(211 + paddingX, 261 + paddingY);
  2931.  
  2932. redStones[4].drawSprite(1 + paddingX, 298 + paddingY);
  2933. redStones[4].drawSprite(31 + paddingX, 298 + paddingY);
  2934. redStones[4].drawSprite(61 + paddingX, 298 + paddingY);
  2935. redStones[4].drawSprite(91 + paddingX, 298 + paddingY);
  2936. redStones[4].drawSprite(121 + paddingX, 298 + paddingY);
  2937. redStones[4].drawSprite(151 + paddingX, 298 + paddingY);
  2938. redStones[4].drawSprite(181 + paddingX, 298 + paddingY);
  2939. redStones[4].drawSprite(211 + paddingX, 298 + paddingY);
  2940. }
  2941.  
  2942. if(is474 || is480 || is508 || is525) {
  2943. if(tabInterfaceIDs[tabID] != -1) {
  2944. switch(tabID) {
  2945. case 0:
  2946. redStones[0].drawSprite(3+3, (toggleFullscreen ? 261 : 0));
  2947. break;
  2948. case 1:
  2949. redStones[4].drawSprite(41+3, (toggleFullscreen ? 261 : 0));
  2950. break;
  2951. case 2:
  2952. redStones[4].drawSprite(74+3, (toggleFullscreen ? 261 : 0));
  2953. break;
  2954. case 3:
  2955. redStones[4].drawSprite(107+3, (toggleFullscreen ? 261 : 0));
  2956. break;
  2957. case 4:
  2958. redStones[4].drawSprite(140+3, (toggleFullscreen ? 261 : 0));
  2959. break;
  2960. case 5:
  2961. redStones[4].drawSprite(173+3, (toggleFullscreen ? 261 : 0));
  2962. break;
  2963. case 6:
  2964. redStones[1].drawSprite(206+3, (toggleFullscreen ? 261 : 0));
  2965. break;
  2966. case 7:
  2967. if (!is480 && !is508 && !is525)
  2968. redStones[2].drawSprite(3+3, 298);
  2969. else
  2970. redStones[4].drawSprite(107+3, 298);
  2971. break;
  2972. case 8:
  2973. redStones[4].drawSprite(41+3, 298);
  2974. break;
  2975. case 9:
  2976. redStones[4].drawSprite(74+3, 298);
  2977. break;
  2978. case 10:
  2979. if (!is480 && !is508 && !is525)
  2980. redStones[4].drawSprite(107+3, 298);
  2981. else
  2982. redStones[2].drawSprite(3+3, 298);
  2983. break;
  2984. case 11:
  2985. redStones[4].drawSprite(140+3, 298);
  2986. break;
  2987. case 12:
  2988. redStones[4].drawSprite(173+3, 298);
  2989. break;
  2990. /*case 13:
  2991. redStones[3].drawSprite(206+3, 298);
  2992. break;*/
  2993. }
  2994. }
  2995. } else if(is562){
  2996. drawTabHover();
  2997. if(tabInterfaceIDs[tabID] != -1)
  2998. {
  2999. if(tabID == 0)
  3000. tabClicked.drawSprite(2+3, 0);
  3001. if(tabID == 1)
  3002. tabClicked.drawSprite(32+3, 0);
  3003. if(tabID == 2)
  3004. tabClicked.drawSprite(62+3, 0);
  3005. if(tabID == 14)
  3006. tabClicked.drawSprite(92+3, 0);
  3007. if(tabID == 3)
  3008. tabClicked.drawSprite(122+3, 0);
  3009. if(tabID == 4)
  3010. tabClicked.drawSprite(152+3, 0);
  3011. if(tabID == 5)
  3012. tabClicked.drawSprite(182+3, 0);
  3013. if(tabID == 6)
  3014. tabClicked.drawSprite(212+3, 0);
  3015. if(tabID == 16)
  3016. tabClicked.drawSprite(2+3, 298);
  3017. if(tabID == 8)
  3018. tabClicked.drawSprite(32+3, 298);
  3019. if(tabID == 9)
  3020. tabClicked.drawSprite(62+3, 298);
  3021. if(tabID == 7)
  3022. tabClicked.drawSprite(92+3, 298);
  3023. if(tabID == 11)
  3024. tabClicked.drawSprite(122+3, 298);
  3025. if(tabID == 12)
  3026. tabClicked.drawSprite(152+3, 298);
  3027. if(tabID == 13)
  3028. tabClicked.drawSprite(182+3, 298);
  3029. if(tabID == 15)
  3030. tabClicked.drawSprite(212+3, 298);
  3031. }
  3032. } else {
  3033. if(tabInterfaceIDs[tabID] != -1) {
  3034. switch(tabID) {
  3035. case 0:
  3036. redStones[5].drawSprite(1 + paddingX, (toggleFullscreen ? 261 : 0) + paddingY);
  3037. break;
  3038. case 1:
  3039. redStones[13].drawSprite(61 + paddingX, (toggleFullscreen ? 261 : 0) + paddingY);
  3040. break;
  3041. case 2:
  3042. redStones[13].drawSprite(91 + paddingX, (toggleFullscreen ? 261 : 0) + paddingY);
  3043. break;
  3044. case 3:
  3045. redStones[7].drawSprite(121 + paddingX, (toggleFullscreen ? 261 : 0) + paddingY);
  3046. break;
  3047. case 4:
  3048. redStones[14].drawSprite(151 + paddingX, (toggleFullscreen ? 261 : 0) + paddingY);
  3049. break;
  3050. case 5:
  3051. redStones[14].drawSprite(181 + paddingX, (toggleFullscreen ? 261 : 0) + paddingY);
  3052. break;
  3053. case 6:
  3054. redStones[6].drawSprite(211 + paddingX, (toggleFullscreen ? 261 : 0) + paddingY);
  3055. break;
  3056.  
  3057. case 7:
  3058. redStones[12].drawSprite(91 + paddingX, 298 + paddingY);
  3059. break;
  3060. case 8:
  3061. redStones[9].drawSprite(31 + paddingX, 298 + paddingY);
  3062. break;
  3063. case 9:
  3064. redStones[9].drawSprite(61 + paddingX, 298 + paddingY);
  3065. break;
  3066. case 10:
  3067. redStones[10].drawSprite(110, 299);
  3068. break;
  3069. case 11:
  3070. redStones[8].drawSprite(121 + paddingX, 298 + paddingY);
  3071. break;
  3072. case 12:
  3073. redStones[8].drawSprite(151 + paddingX, 298 + paddingY);
  3074. break;
  3075. case 13:
  3076. redStones[11].drawSprite(181 + paddingX, 298 + paddingY);
  3077. break;
  3078. }
  3079. }
  3080. }
  3081. }
  3082. private void drawTabArea(RSImageProducer tabImage, int paddingX, int paddingY) {
  3083. //tabImage.initDrawingArea();
  3084. inventoryBackImage.initDrawingArea();
  3085. Texture.anIntArray1472 = anIntArray1181;
  3086.  
  3087. if (toggleFullscreen)
  3088. tabArea[getSpriteID()].drawSprite1(22 + paddingX, 32 + paddingY - (toggleFullscreen ? 46 : 0), 192);
  3089. else
  3090. tabArea[getSpriteID()].drawSprite(0, 0);
  3091. //} else
  3092. //tabArea[0].drawSprite(0 + paddingX, 0 + paddingY);
  3093.  
  3094. if(spriteChanged) {
  3095. }
  3096. tabAreaAltered = true;
  3097. if(invOverlayInterfaceID == -1) {
  3098. drawRedStones(paddingX, paddingY);
  3099. drawSideIcons(paddingX, paddingY);
  3100. }
  3101. if(is474 || is480 || is508 || is525 || is562) {
  3102. if(invOverlayInterfaceID != -1)
  3103. drawInterface(0, 32, RSInterface.interfaceCache[invOverlayInterfaceID], 37);
  3104. else if(tabInterfaceIDs[tabID] != -1)
  3105. drawInterface(0, 32, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 37)
  3106.  
  3107. } else if(is562){
  3108. if(tabHPos == 0 && tabInterfaceIDs[0] != -1)
  3109. tabHover.drawSprite(3, 0);
  3110. else if(tabHPos == 1 && tabInterfaceIDs[1] != -1)
  3111. tabHover.drawSprite(33, 0);
  3112. else if(tabHPos == 2 && tabInterfaceIDs[2] != -1)
  3113. tabHover.drawSprite(63, 0);
  3114. else if(tabHPos == 3 && tabInterfaceIDs[14] != -1)
  3115. tabHover.drawSprite(93, 0);
  3116. else if(tabHPos == 4 && tabInterfaceIDs[3] != -1)
  3117. tabHover.drawSprite(123, 0);
  3118. else if(tabHPos == 5 && tabInterfaceIDs[4] != -1)
  3119. tabHover.drawSprite(153, 0);
  3120. else if(tabHPos == 6 && tabInterfaceIDs[5] != -1)
  3121. tabHover.drawSprite(183, 0);
  3122. else if(tabHPos == 7 && tabInterfaceIDs[6] != -1)
  3123. tabHover.drawSprite(213, 0);
  3124. else if(tabHPos == 15 && tabInterfaceIDs[16] != -1)
  3125. tabHover.drawSprite(3, 298);
  3126. else if(tabHPos == 8 && tabInterfaceIDs[9] != -1)
  3127. tabHover.drawSprite(33, 298);
  3128. else if(tabHPos == 9 && tabInterfaceIDs[8] != -1)
  3129. tabHover.drawSprite(63, 298);
  3130. else if(tabHPos == 10 && tabInterfaceIDs[7] != -1)
  3131. tabHover.drawSprite(93, 298);
  3132. else if(tabHPos == 11 && tabInterfaceIDs[11] != -1)
  3133. tabHover.drawSprite(123, 298);
  3134. else if(tabHPos == 12 && tabInterfaceIDs[12] != -1)
  3135. tabHover.drawSprite(153, 298);
  3136. else if(tabHPos == 13 && tabInterfaceIDs[13] != -1)
  3137. tabHover.drawSprite(183,298);
  3138. else if(tabHPos == 14 && tabInterfaceIDs[15] != -1)
  3139. tabHover.drawSprite(213, 298);
  3140. } else {
  3141. if(invOverlayInterfaceID != -1)
  3142. drawInterface(0, 38, RSInterface.interfaceCache[invOverlayInterfaceID], 37);
  3143. else if(tabInterfaceIDs[tabID] != -1)
  3144. drawInterface(0, 38, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 37);
  3145. }
  3146. if(menuOpen && (!toggleFullscreen))
  3147. drawMenu(516, 168);
  3148. inventoryBackImage.drawGraphics(168, super.graphics, 516);//519 inventoryBackImage
  3149. main3DArea.initDrawingArea();
  3150. Texture.anIntArray1472 = anIntArray1182;
  3151. }
  3152.  
  3153. private void method37(int j) {
  3154. if(!lowMem) {
  3155. if(Texture.anIntArray1480[17] >= j) {
  3156.  
  3157. Background background = Texture.aBackgroundArray1474s[17];
  3158. int k = background.anInt1452 * background.anInt1453 - 1;
  3159. //fire cape apparently?
  3160. int j1 = background.anInt1452 * anInt945 * 2;
  3161. byte abyte0[] = background.aByteArray1450;
  3162. byte abyte3[] = aByteArray912;
  3163. for(int i2 = 0; i2 <= k; i2++)
  3164. abyte3[i2] = abyte0[i2 - j1 & k];
  3165.  
  3166. background.aByteArray1450 = abyte3;
  3167. aByteArray912 = abyte0;
  3168. Texture.method370(17);
  3169. }
  3170. if(Texture.anIntArray1480[24] >= j) {
  3171. Background background_1 = Texture.aBackgroundArray1474s[24];
  3172. int l = background_1.anInt1452 * background_1.anInt1453 - 1;
  3173. int k1 = background_1.anInt1452 * anInt945 * 2;
  3174. byte abyte1[] = background_1.aByteArray1450;
  3175. byte abyte4[] = aByteArray912;
  3176. for(int j2 = 0; j2 <= l; j2++)
  3177. abyte4[j2] = abyte1[j2 - k1 & l];
  3178.  
  3179. background_1.aByteArray1450 = abyte4;
  3180. aByteArray912 = abyte1;
  3181. Texture.method370(24);
  3182. }
  3183. if(Texture.anIntArray1480[34] >= j) {
  3184. Background background_2 = Texture.aBackgroundArray1474s[34];
  3185. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  3186. int l1 = background_2.anInt1452 * anInt945 * 2;
  3187. byte abyte2[] = background_2.aByteArray1450;
  3188. byte abyte5[] = aByteArray912;
  3189. for(int k2 = 0; k2 <= i1; k2++)
  3190. abyte5[k2] = abyte2[k2 - l1 & i1];
  3191.  
  3192. background_2.aByteArray1450 = abyte5;
  3193. aByteArray912 = abyte2;
  3194. Texture.method370(34);
  3195. }
  3196. if(Texture.anIntArray1480[40] >= j)
  3197. {
  3198. Background background_2 = Texture.aBackgroundArray1474s[40];
  3199. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  3200. int l1 = background_2.anInt1452 * anInt945 * 2;
  3201. byte abyte2[] = background_2.aByteArray1450;
  3202. byte abyte5[] = aByteArray912;
  3203. for(int k2 = 0; k2 <= i1; k2++)
  3204. abyte5[k2] = abyte2[k2 - l1 & i1];
  3205.  
  3206. background_2.aByteArray1450 = abyte5;
  3207. aByteArray912 = abyte2;
  3208. Texture.method370(40);
  3209.  
  3210. }
  3211. }
  3212. }
  3213.  
  3214. private void method38() {
  3215. for(int i = -1; i < playerCount; i++) {
  3216. int j;
  3217. if(i == -1)
  3218. j = myPlayerIndex;
  3219. else
  3220. j = playerIndices[i];
  3221. Player player = playerArray[j];
  3222. if(player != null && player.textCycle > 0) {
  3223. player.textCycle--;
  3224. if(player.textCycle == 0)
  3225. player.textSpoken = null;
  3226. }
  3227. }
  3228. for(int k = 0; k < npcCount; k++) {
  3229. int l = npcIndices[k];
  3230. NPC npc = npcArray[l];
  3231. if(npc != null && npc.textCycle > 0) {
  3232. npc.textCycle--;
  3233. if(npc.textCycle == 0)
  3234. npc.textSpoken = null;
  3235. }
  3236. }
  3237. }
  3238.  
  3239. private void calcCameraPos() {
  3240.  
  3241. int i = anInt1098 * 128 + 64;
  3242. int j = anInt1099 * 128 + 64;
  3243. int k = method42(plane, j, i) - anInt1100;
  3244. if(xCameraPos < i) {
  3245. xCameraPos += anInt1101 + ((i - xCameraPos) * anInt1102) / 1000;
  3246. if(xCameraPos > i)
  3247. xCameraPos = i;
  3248. }
  3249. if(xCameraPos > i) {
  3250. xCameraPos -= anInt1101 + ((xCameraPos - i) * anInt1102) / 1000;
  3251. if(xCameraPos < i)
  3252. xCameraPos = i;
  3253. }
  3254. if(zCameraPos < k) {
  3255. zCameraPos += anInt1101 + ((k - zCameraPos) * anInt1102) / 1000;
  3256. if(zCameraPos > k)
  3257. zCameraPos = k;
  3258. }
  3259. if(zCameraPos > k) {
  3260. zCameraPos -= anInt1101 + ((zCameraPos - k) * anInt1102) / 1000;
  3261. if(zCameraPos < k)
  3262. zCameraPos = k;
  3263. }
  3264. if(yCameraPos < j) {
  3265. yCameraPos += anInt1101 + ((j - yCameraPos) * anInt1102) / 1000;
  3266. if(yCameraPos > j)
  3267. yCameraPos = j;
  3268. }
  3269. if(yCameraPos > j) {
  3270. yCameraPos -= anInt1101 + ((yCameraPos - j) * anInt1102) / 1000;
  3271. if(yCameraPos < j)
  3272. yCameraPos = j;
  3273. }
  3274. i = anInt995 * 128 + 64;
  3275. j = anInt996 * 128 + 64;
  3276. k = method42(plane, j, i) - anInt997;
  3277. int l = i - xCameraPos;
  3278. int i1 = k - zCameraPos;
  3279. int j1 = j - yCameraPos;
  3280. int k1 = (int)Math.sqrt(l * l + j1 * j1);
  3281. int l1 = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  3282. int i2 = (int)(Math.atan2(l, j1) * -325.94900000000001D) & 0x7ff;
  3283. if(l1 < 128)
  3284. l1 = 128;
  3285. if(l1 > 383)
  3286. l1 = 383;
  3287. if(yCameraCurve < l1) {
  3288. yCameraCurve += anInt998 + ((l1 - yCameraCurve) * anInt999) / 1000;
  3289. if(yCameraCurve > l1)
  3290. yCameraCurve = l1;
  3291. }
  3292. if(yCameraCurve > l1) {
  3293. yCameraCurve -= anInt998 + ((yCameraCurve - l1) * anInt999) / 1000;
  3294. if(yCameraCurve < l1)
  3295. yCameraCurve = l1;
  3296. }
  3297. int j2 = i2 - xCameraCurve;
  3298. if(j2 > 1024)
  3299. j2 -= 2048;
  3300. if(j2 < -1024)
  3301. j2 += 2048;
  3302. if(j2 > 0) {
  3303. xCameraCurve += anInt998 + (j2 * anInt999) / 1000;
  3304. xCameraCurve &= 0x7ff;
  3305. }
  3306. if(j2 < 0) {
  3307. xCameraCurve -= anInt998 + (-j2 * anInt999) / 1000;
  3308. xCameraCurve &= 0x7ff;
  3309. }
  3310. int k2 = i2 - xCameraCurve;
  3311. if(k2 > 1024)
  3312. k2 -= 2048;
  3313. if(k2 < -1024)
  3314. k2 += 2048;
  3315. if(k2 < 0 && j2 > 0 || k2 > 0 && j2 < 0)
  3316. xCameraCurve = i2;
  3317. }
  3318.  
  3319. private void drawMenu(int xOffSet, int yOffSet) {
  3320. int xPos = menuOffsetX - (xOffSet - 4);
  3321. int yPos = (-yOffSet + 4) + menuOffsetY;
  3322. int menuW = menuWidth;
  3323. int menuH = menuHeight + 1;
  3324. inputTaken = true;
  3325. tabAreaAltered = true;
  3326. DrawingArea.method338(yPos + 2, menuH - 4, 250, 0x706a5e, menuW, xPos);
  3327. DrawingArea.method338(yPos + 1, menuH - 2, 250, 0x706a5e, menuW - 2, xPos + 1);
  3328. DrawingArea.method338(yPos, menuH, 200, 0x706a5e, menuW - 4, xPos + 2);
  3329. DrawingArea.method338(yPos + 1, menuH - 2, 250, 0x2d2822, menuW - 6, xPos + 3);
  3330. DrawingArea.method338(yPos + 2, menuH - 4, 250, 0x2d2822, menuW - 4, xPos + 2);
  3331. DrawingArea.method338(yPos + 3, menuH - 6, 250, 0x2d2822, menuW - 2, xPos + 1);
  3332. DrawingArea.method338(yPos + 19, menuH - 22, 250, 0x524a3d, menuW - 4, xPos + 2);
  3333. DrawingArea.method338(yPos + 20, menuH - 22, 250, 0x524a3d, menuW - 6, xPos + 3);
  3334. DrawingArea.method335(0x112329, yPos + 20, menuW - 6, menuH - 23, 230, xPos + 3);
  3335. DrawingArea.fillPixels(xPos + 3, menuW - 6, 1, 0x2a291b, yPos + 2);
  3336. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x2a261b, yPos + 3);
  3337. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x252116, yPos + 4);
  3338. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x211e15, yPos + 5);
  3339. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x1e1b12, yPos + 6);
  3340. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x1a170e, yPos + 7);
  3341. DrawingArea.fillPixels(xPos + 2, menuW - 4, 2, 0x15120b, yPos + 8);
  3342. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x100d08, yPos + 10);
  3343. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 11);
  3344. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x080703, yPos + 12);
  3345. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 13);
  3346. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x070802, yPos + 14);
  3347. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 15);
  3348. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x070802, yPos + 16);
  3349. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 17);
  3350. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x2a291b, yPos + 18);
  3351. DrawingArea.fillPixels(xPos + 3, menuW - 6, 1, 0x564943, yPos + 19);
  3352. aTextDrawingArea_1271.method385(0xc6b895, "Choose Option", yPos + 14, xPos + 3);
  3353. int mouseX = super.mouseX - (xOffSet);
  3354. int mouseY = (-yOffSet) + super.mouseY;
  3355. for(int l1 = 0; l1 < menuActionRow; l1++) {
  3356. int textY = yPos + 31 + (menuActionRow - 1 - l1) * 15;
  3357. int disColor = 0xc6b895;
  3358. if(mouseX > xPos && mouseX < xPos + menuW && mouseY > textY - 13 && mouseY < textY + 3) {
  3359. DrawingArea.method335(0x26566C, textY - 11, menuWidth - 6, 15, 150, xPos + 3);
  3360. disColor = 0xeee5c6;
  3361. }
  3362. aTextDrawingArea_1271.method389(true, xPos + 3, disColor, menuActionName[l1], textY);
  3363. }
  3364. }
  3365.  
  3366. private void addFriend(long l) {
  3367. try {
  3368. if(l == 0L)
  3369. return;
  3370. if(friendsCount >= 100 && anInt1046 != 1) {
  3371. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  3372. return;
  3373. }
  3374. if(friendsCount >= 200) {
  3375. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  3376. return;
  3377. }
  3378. String s = TextClass.fixName(TextClass.nameForLong(l));
  3379. for(int i = 0; i < friendsCount; i++)
  3380. if(friendsListAsLongs[i] == l) {
  3381. pushMessage(s + " is already on your friend list", 0, "");
  3382. return;
  3383. }
  3384. for(int j = 0; j < ignoreCount; j++)
  3385. if(ignoreListAsLongs[j] == l) {
  3386. pushMessage("Please remove " + s + " from your ignore list first", 0, "");
  3387. return;
  3388. }
  3389.  
  3390. if(s.equals(myPlayer.name)) {
  3391. return;
  3392. } else {
  3393. friendsList[friendsCount] = s;
  3394. friendsListAsLongs[friendsCount] = l;
  3395. friendsNodeIDs[friendsCount] = 0;
  3396. friendsCount++;
  3397. stream.createFrame(188);
  3398. stream.writeQWord(l);
  3399. return;
  3400. }
  3401. } catch(RuntimeException runtimeexception) {
  3402. signlink.reporterror("15283, " + (byte)68 + ", " + l + ", " + runtimeexception.toString());
  3403. }
  3404. throw new RuntimeException();
  3405. }
  3406.  
  3407. private int method42(int i, int j, int k) {
  3408. int l = k >> 7;
  3409. int i1 = j >> 7;
  3410. if(l < 0 || i1 < 0 || l > 103 || i1 > 103)
  3411. return 0;
  3412. int j1 = i;
  3413. if(j1 < 3 && (byteGroundArray[1][l][i1] & 2) == 2)
  3414. j1++;
  3415. int k1 = k & 0x7f;
  3416. int l1 = j & 0x7f;
  3417. int i2 = intGroundArray[j1][l][i1] * (128 - k1) + intGroundArray[j1][l + 1][i1] * k1 >> 7;
  3418. int j2 = intGroundArray[j1][l][i1 + 1] * (128 - k1) + intGroundArray[j1][l + 1][i1 + 1] * k1 >> 7;
  3419. return i2 * (128 - l1) + j2 * l1 >> 7;
  3420. }
  3421.  
  3422. private static String intToKOrMil(int j) {
  3423. if(j < 0x186a0)
  3424. return String.valueOf(j);
  3425. if(j < 0x989680)
  3426. return j / 1000 + "K";
  3427. else
  3428. return j / 0xf4240 + "M";
  3429. }
  3430. public int canWalkDelay = 0;
  3431. public int getDis(int coordX1, int coordY1, int coordX2, int coordY2)
  3432. {
  3433. int deltaX = coordX2 - coordX1;
  3434. int deltaY = coordY2 - coordY1;
  3435. return ((int)Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2)));
  3436. }
  3437. public int random(int range)
  3438. {
  3439. return (int)(Math.random() * range);
  3440. }
  3441. public boolean withinDistance(int x1, int y1, int x2, int y2, int dis)
  3442. {
  3443. for (int i = 0; i <= dis; i++)
  3444. {
  3445. try{
  3446. if ((x1 + i) == x2 && ((y1 + i) == y2 || (y1 - i) == y2 || y1 == y2))
  3447. return true;
  3448. else
  3449. if ((x1 - i) == x2 && ((x1 + i) == y2 || (y1 - i) == y2 || y1 == y2))
  3450. return true;
  3451. else
  3452. if (x1 == x2 && ((x1 + i) == y2 || (y1 - i) == y2 || y1 == y2))
  3453. return true;
  3454. } catch(Exception ex){
  3455. System.out.println("Exception in following, method : WithingDistance");
  3456. }
  3457. }
  3458. return false;
  3459. }
  3460.  
  3461. private void resetLogout() {
  3462. try {
  3463. if(socketStream != null)
  3464. socketStream.close();
  3465. }
  3466. catch(Exception _ex) { }
  3467. socketStream = null;
  3468. loggedIn = false;
  3469. runClicked = true;
  3470. musicOrb = false;
  3471. restOrb = false;
  3472. familiarType = -1;
  3473. leftClickOption = 0;
  3474. prayClicked = false;
  3475. xpClicked = false;
  3476. drawXpBar = false;
  3477. Autocast = false;
  3478. autocastId = 0;
  3479.  
  3480. magicAuto.drawSprite(1000, 1000);
  3481. loginScreenState = 0;
  3482. //myUsername = "";
  3483. //myPassword = "";
  3484. familiarType = -1;
  3485. unlinkMRUNodes();
  3486. worldController.initToNull();
  3487. for(int i = 0; i < 4; i++)
  3488. aClass11Array1230[i].method210();
  3489. System.gc();
  3490. stopMidi();
  3491. currentSong = -1;
  3492. nextSong = -1;
  3493. prevSong = 0;
  3494. if (toggleFullscreen)
  3495. switchToNormal();
  3496. }
  3497.  
  3498. private void method45() {
  3499. aBoolean1031 = true;
  3500. for(int j = 0; j < 7; j++) {
  3501. anIntArray1065[j] = -1;
  3502. for(int k = 0; k < IdentityKit.length; k++) {
  3503. if(IdentityKit.cache[k].aBoolean662 || IdentityKit.cache[k].anInt657 != j + (aBoolean1047 ? 0 : 7))
  3504. continue;
  3505. anIntArray1065[j] = k;
  3506. break;
  3507. }
  3508. }
  3509. }
  3510.  
  3511. private void method46(int i, Stream stream) {
  3512. while(stream.bitPosition + 21 < i * 8) {
  3513. int k = stream.readBits(14);
  3514. if(k == 16383)
  3515. break;
  3516. if(npcArray[k] == null)
  3517. npcArray[k] = new NPC();
  3518. NPC npc = npcArray[k];
  3519. npcIndices[npcCount++] = k;
  3520. npc.anInt1537 = loopCycle;
  3521. int l = stream.readBits(5);
  3522. if(l > 15)
  3523. l -= 32;
  3524. int i1 = stream.readBits(5);
  3525. if(i1 > 15)
  3526. i1 -= 32;
  3527. int j1 = stream.readBits(1);
  3528. npc.desc = EntityDef.forID(stream.readBits(14));//NPC FIX
  3529. int k1 = stream.readBits(1);
  3530. if(k1 == 1)
  3531. anIntArray894[anInt893++] = k;
  3532. npc.anInt1540 = npc.desc.aByte68;
  3533. npc.anInt1504 = npc.desc.anInt79;
  3534. npc.anInt1554 = npc.desc.anInt67;
  3535. npc.anInt1555 = npc.desc.anInt58;
  3536. npc.anInt1556 = npc.desc.anInt83;
  3537. npc.anInt1557 = npc.desc.anInt55;
  3538. npc.anInt1511 = npc.desc.anInt77;
  3539. npc.setPos(myPlayer.smallX[0] + i1, myPlayer.smallY[0] + l, j1 == 1);
  3540. }
  3541. stream.finishBitAccess();
  3542. }
  3543.  
  3544. public void processGameLoop() {
  3545.  
  3546.  
  3547. if(rsAlreadyLoaded || loadingError || genericLoadingError)
  3548. return;
  3549. loopCycle++;
  3550. if(!loggedIn)
  3551. processLoginScreenInput();
  3552. else
  3553. mainGameProcessor();
  3554. processOnDemandQueue();
  3555. }
  3556.  
  3557. private void method47(boolean flag) {
  3558. if(myPlayer.x >> 7 == destX && myPlayer.y >> 7 == destY)
  3559. destX = 0;
  3560. int j = playerCount;
  3561. if(flag)
  3562. j = 1;
  3563. for(int l = 0; l < j; l++) {
  3564. Player player;
  3565. int i1;
  3566. if(flag) {
  3567. player = myPlayer;
  3568. i1 = myPlayerIndex << 14;
  3569. } else {
  3570. player = playerArray[playerIndices[l]];
  3571. i1 = playerIndices[l] << 14;
  3572. }
  3573. if(player == null || !player.isVisible())
  3574. continue;
  3575. player.aBoolean1699 = (lowMem && playerCount > 50 || playerCount > 200) && !flag && player.anInt1517 == player.anInt1511;
  3576. int j1 = player.x >> 7;
  3577. int k1 = player.y >> 7;
  3578. if(j1 < 0 || j1 >= 104 || k1 < 0 || k1 >= 104)
  3579. continue;
  3580. if(player.aModel_1714 != null && loopCycle >= player.anInt1707 && loopCycle < player.anInt1708) {
  3581. player.aBoolean1699 = false;
  3582. player.anInt1709 = method42(plane, player.y, player.x);
  3583. worldController.method286(plane, player.y, player, player.anInt1552, player.anInt1722, player.x, player.anInt1709, player.anInt1719, player.anInt1721, i1, player.anInt1720);
  3584. continue;
  3585. }
  3586. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  3587. if(anIntArrayArray929[j1][k1] == anInt1265)
  3588. continue;
  3589. anIntArrayArray929[j1][k1] = anInt1265;
  3590. }
  3591. player.anInt1709 = method42(plane, player.y, player.x);
  3592. worldController.method285(plane, player.anInt1552, player.anInt1709, i1, player.y, 60, player.x, player, player.aBoolean1541);
  3593. }
  3594. }
  3595.  
  3596. private boolean promptUserForInput(RSInterface class9) {
  3597. int j = class9.contentType;
  3598. if(anInt900 == 2) {
  3599. if(j == 201) {
  3600. inputTaken = true;
  3601. inputDialogState = 0;
  3602. messagePromptRaised = true;
  3603. promptInput = "";
  3604. friendsListAction = 1;
  3605. aString1121 = "Enter name of friend to add to list";
  3606. }
  3607. if(j == 202) {
  3608. inputTaken = true;
  3609. inputDialogState = 0;
  3610. messagePromptRaised = true;
  3611. promptInput = "";
  3612. friendsListAction = 2;
  3613. aString1121 = "Enter name of friend to delete from list";
  3614. }
  3615. }
  3616. if(j == 205) {
  3617. anInt1011 = 250;
  3618. return true;
  3619. }
  3620. if(j == 501) {
  3621. inputTaken = true;
  3622. inputDialogState = 0;
  3623. messagePromptRaised = true;
  3624. promptInput = "";
  3625. friendsListAction = 4;
  3626. aString1121 = "Enter name of player to add to list";
  3627. }
  3628. if(j == 502) {
  3629. inputTaken = true;
  3630. inputDialogState = 0;
  3631. messagePromptRaised = true;
  3632. promptInput = "";
  3633. friendsListAction = 5;
  3634. aString1121 = "Enter name of player to delete from list";
  3635. }
  3636. if(j == 550) {
  3637. inputTaken = true;
  3638. inputDialogState = 0;
  3639. messagePromptRaised = true;
  3640. promptInput = "";
  3641. friendsListAction = 6;
  3642. aString1121 = "Enter the name of the chat you wish to join";
  3643. }
  3644. if(j == 549) {
  3645. inputTaken = true;
  3646. inputDialogState = 0;
  3647. messagePromptRaised = true;
  3648. promptInput = "";
  3649. friendsListAction = 7;
  3650. aString1121 = "Enter a new name for your clanchat";
  3651. }
  3652. if(j >= 300 && j <= 313) {
  3653. int k = (j - 300) / 2;
  3654. int j1 = j & 1;
  3655. int i2 = anIntArray1065[k];
  3656. if(i2 != -1) {
  3657. do {
  3658. if(j1 == 0 && --i2 < 0)
  3659. i2 = IdentityKit.length - 1;
  3660. if(j1 == 1 && ++i2 >= IdentityKit.length)
  3661. i2 = 0;
  3662. } while(IdentityKit.cache[i2].aBoolean662 || IdentityKit.cache[i2].anInt657 != k + (aBoolean1047 ? 0 : 7));
  3663. anIntArray1065[k] = i2;
  3664. aBoolean1031 = true;
  3665. }
  3666. }
  3667. if(j >= 314 && j <= 323) {
  3668. int l = (j - 314) / 2;
  3669. int k1 = j & 1;
  3670. int j2 = anIntArray990[l];
  3671. if(k1 == 0 && --j2 < 0)
  3672. j2 = anIntArrayArray1003[l].length - 1;
  3673. if(k1 == 1 && ++j2 >= anIntArrayArray1003[l].length)
  3674. j2 = 0;
  3675. anIntArray990[l] = j2;
  3676. aBoolean1031 = true;
  3677. }
  3678. if(j == 324 && !aBoolean1047) {
  3679. aBoolean1047 = true;
  3680. method45();
  3681. }
  3682. if(j == 325 && aBoolean1047) {
  3683. aBoolean1047 = false;
  3684. method45();
  3685. }
  3686. if(j == 326) {
  3687. stream.createFrame(101);
  3688. stream.writeWordBigEndian(aBoolean1047 ? 0 : 1);
  3689. for(int i1 = 0; i1 < 7; i1++)
  3690. stream.writeWordBigEndian(anIntArray1065[i1]);
  3691.  
  3692. for(int l1 = 0; l1 < 5; l1++)
  3693. stream.writeWordBigEndian(anIntArray990[l1]);
  3694.  
  3695. return true;
  3696. }
  3697. if(j == 613)
  3698. canMute = !canMute;
  3699. if(j >= 601 && j <= 612) {
  3700. clearTopInterfaces();
  3701. if(reportAbuseInput.length() > 0) {
  3702. stream.createFrame(218);
  3703. stream.writeQWord(TextClass.longForName(reportAbuseInput));
  3704. stream.writeWordBigEndian(j - 601);
  3705. stream.writeWordBigEndian(canMute ? 1 : 0);
  3706. }
  3707. }
  3708. return false;
  3709. }
  3710.  
  3711. private void method49(Stream stream) {
  3712. for(int j = 0; j < anInt893; j++) {
  3713. int k = anIntArray894[j];
  3714. Player player = playerArray[k];
  3715. int l = stream.readUnsignedByte();
  3716. if((l & 0x40) != 0)
  3717. l += stream.readUnsignedByte() << 8;
  3718. method107(l, k, stream, player);
  3719. }
  3720. }
  3721.  
  3722. private void method50(int i, int k, int l, int i1, int j1) {
  3723. int k1 = worldController.method300(j1, l, i);
  3724. if(k1 != 0) {
  3725. int l1 = worldController.method304(j1, l, i, k1);
  3726. int k2 = l1 >> 6 & 3;
  3727. int i3 = l1 & 0x1f;
  3728. int k3 = k;
  3729. if(k1 > 0)
  3730. k3 = i1;
  3731. int ai[] = aSprite_1263.myPixels;
  3732. int k4 = 24624 + l * 4 + (103 - i) * 512 * 4;
  3733. int i5 = k1 >> 14 & 0x7fff;
  3734. ObjectDef class46_2 = ObjectDef.forID(i5);
  3735. if(class46_2.anInt758 != -1) {
  3736. Background background_2 = mapScenes[class46_2.anInt758];
  3737. if(background_2 != null) {
  3738. int i6 = (class46_2.anInt744 * 4 - background_2.anInt1452) / 2;
  3739. int j6 = (class46_2.anInt761 * 4 - background_2.anInt1453) / 2;
  3740. background_2.drawBackground(48 + l * 4 + i6, 48 + (104 - i - class46_2.anInt761) * 4 + j6);
  3741. }
  3742. } else {
  3743. if(i3 == 0 || i3 == 2)
  3744. if(k2 == 0) {
  3745. ai[k4] = k3;
  3746. ai[k4 + 512] = k3;
  3747. ai[k4 + 1024] = k3;
  3748. ai[k4 + 1536] = k3;
  3749. } else if(k2 == 1) {
  3750. ai[k4] = k3;
  3751. ai[k4 + 1] = k3;
  3752. ai[k4 + 2] = k3;
  3753. ai[k4 + 3] = k3;
  3754. } else if(k2 == 2) {
  3755. ai[k4 + 3] = k3;
  3756. ai[k4 + 3 + 512] = k3;
  3757. ai[k4 + 3 + 1024] = k3;
  3758. ai[k4 + 3 + 1536] = k3;
  3759. } else if(k2 == 3) {
  3760. ai[k4 + 1536] = k3;
  3761. ai[k4 + 1536 + 1] = k3;
  3762. ai[k4 + 1536 + 2] = k3;
  3763. ai[k4 + 1536 + 3] = k3;
  3764. }
  3765. if(i3 == 3)
  3766. if(k2 == 0)
  3767. ai[k4] = k3;
  3768. else if(k2 == 1)
  3769. ai[k4 + 3] = k3;
  3770. else if(k2 == 2)
  3771. ai[k4 + 3 + 1536] = k3;
  3772. else if(k2 == 3)
  3773. ai[k4 + 1536] = k3;
  3774. if(i3 == 2)
  3775. if(k2 == 3) {
  3776. ai[k4] = k3;
  3777. ai[k4 + 512] = k3;
  3778. ai[k4 + 1024] = k3;
  3779. ai[k4 + 1536] = k3;
  3780. } else if(k2 == 0) {
  3781. ai[k4] = k3;
  3782. ai[k4 + 1] = k3;
  3783. ai[k4 + 2] = k3;
  3784. ai[k4 + 3] = k3;
  3785. } else if(k2 == 1) {
  3786. ai[k4 + 3] = k3;
  3787. ai[k4 + 3 + 512] = k3;
  3788. ai[k4 + 3 + 1024] = k3;
  3789. ai[k4 + 3 + 1536] = k3;
  3790. } else if(k2 == 2) {
  3791. ai[k4 + 1536] = k3;
  3792. ai[k4 + 1536 + 1] = k3;
  3793. ai[k4 + 1536 + 2] = k3;
  3794. ai[k4 + 1536 + 3] = k3;
  3795. }
  3796. }
  3797. }
  3798. k1 = worldController.method302(j1, l, i);
  3799. if(k1 != 0) {
  3800. int i2 = worldController.method304(j1, l, i, k1);
  3801. int l2 = i2 >> 6 & 3;
  3802. int j3 = i2 & 0x1f;
  3803. int l3 = k1 >> 14 & 0x7fff;
  3804. ObjectDef class46_1 = ObjectDef.forID(l3);
  3805. if(class46_1.anInt758 != -1) {
  3806. Background background_1 = mapScenes[class46_1.anInt758];
  3807. if(background_1 != null) {
  3808. int j5 = (class46_1.anInt744 * 4 - background_1.anInt1452) / 2;
  3809. int k5 = (class46_1.anInt761 * 4 - background_1.anInt1453) / 2;
  3810. background_1.drawBackground(48 + l * 4 + j5, 48 + (104 - i - class46_1.anInt761) * 4 + k5);
  3811. }
  3812. } else if(j3 == 9) {
  3813. int l4 = 0xeeeeee;
  3814. if(k1 > 0)
  3815. l4 = 0xee0000;
  3816. int ai1[] = aSprite_1263.myPixels;
  3817. int l5 = 24624 + l * 4 + (103 - i) * 512 * 4;
  3818. if(l2 == 0 || l2 == 2) {
  3819. ai1[l5 + 1536] = l4;
  3820. ai1[l5 + 1024 + 1] = l4;
  3821. ai1[l5 + 512 + 2] = l4;
  3822. ai1[l5 + 3] = l4;
  3823. } else {
  3824. ai1[l5] = l4;
  3825. ai1[l5 + 512 + 1] = l4;
  3826. ai1[l5 + 1024 + 2] = l4;
  3827. ai1[l5 + 1536 + 3] = l4;
  3828. }
  3829. }
  3830. }
  3831. k1 = worldController.method303(j1, l, i);
  3832. if(k1 != 0) {
  3833. int j2 = k1 >> 14 & 0x7fff;
  3834. ObjectDef class46 = ObjectDef.forID(j2);
  3835. if(class46.anInt758 != -1) {
  3836. Background background = mapScenes[class46.anInt758];
  3837. if(background != null) {
  3838. int i4 = (class46.anInt744 * 4 - background.anInt1452) / 2;
  3839. int j4 = (class46.anInt761 * 4 - background.anInt1453) / 2;
  3840. background.drawBackground(48 + l * 4 + i4, 48 + (104 - i - class46.anInt761) * 4 + j4);
  3841. }
  3842. }
  3843. }
  3844. }
  3845.  
  3846. private void loadTitleScreen() {
  3847. //titleBox = new Background(titleStreamLoader, "titlebox", 0);
  3848. //deflate();
  3849. //models();
  3850. //renameFiles();
  3851. //unpackModels();
  3852.  
  3853. titleBox = new Sprite("Login/titleBox");
  3854. boxHover = new Sprite("Login/boxHover");
  3855. new Sprite("Login/titleButton");
  3856. loginHover = new Sprite("Login/loginHover");
  3857. backgroundWorld1 = new Sprite("world1");
  3858. backgroundWorld2 = new Sprite("world2");
  3859.  
  3860. aBackgroundArray1152s = new Background[12];
  3861. int j = 0;
  3862. try {
  3863. j = Integer.parseInt(getParameter("fl_icon"));
  3864. } catch(Exception _ex) {
  3865. }
  3866. if(j == 0) {
  3867. for(int k = 0; k < 12; k++)
  3868. aBackgroundArray1152s[k] = new Background(titleStreamLoader, "runes", k);
  3869.  
  3870. } else {
  3871. for(int l = 0; l < 12; l++)
  3872. aBackgroundArray1152s[l] = new Background(titleStreamLoader, "runes", 12 + (l & 3));
  3873.  
  3874. }
  3875. new Sprite(128, 265);
  3876. new Sprite(128, 265);
  3877.  
  3878. anIntArray851 = new int[256];
  3879. for(int k1 = 0; k1 < 64; k1++)
  3880. anIntArray851[k1] = k1 * 0x40000;
  3881.  
  3882. for(int l1 = 0; l1 < 64; l1++)
  3883. anIntArray851[l1 + 64] = 0xff0000 + 1024 * l1;
  3884.  
  3885. for(int i2 = 0; i2 < 64; i2++)
  3886. anIntArray851[i2 + 128] = 0xffff00 + 4 * i2;
  3887.  
  3888. for(int j2 = 0; j2 < 64; j2++)
  3889. anIntArray851[j2 + 192] = 0xffffff;
  3890.  
  3891. anIntArray852 = new int[256];
  3892. for(int k2 = 0; k2 < 64; k2++)
  3893. anIntArray852[k2] = k2 * 1024;
  3894.  
  3895. for(int l2 = 0; l2 < 64; l2++)
  3896. anIntArray852[l2 + 64] = 65280 + 4 * l2;
  3897.  
  3898. for(int i3 = 0; i3 < 64; i3++)
  3899. anIntArray852[i3 + 128] = 65535 + 0x40000 * i3;
  3900.  
  3901. for(int j3 = 0; j3 < 64; j3++)
  3902. anIntArray852[j3 + 192] = 0xffffff;
  3903.  
  3904. anIntArray853 = new int[256];
  3905. for(int k3 = 0; k3 < 64; k3++)
  3906. anIntArray853[k3] = k3 * 4;
  3907.  
  3908. for(int l3 = 0; l3 < 64; l3++)
  3909. anIntArray853[l3 + 64] = 255 + 0x40000 * l3;
  3910.  
  3911. for(int i4 = 0; i4 < 64; i4++)
  3912. anIntArray853[i4 + 128] = 0xff00ff + 1024 * i4;
  3913.  
  3914. for(int j4 = 0; j4 < 64; j4++)
  3915. anIntArray853[j4 + 192] = 0xffffff;
  3916.  
  3917. anIntArray1190 = new int[32768];
  3918. anIntArray1191 = new int[32768];
  3919. randomizeBackground(null);
  3920. if(!aBoolean831) {
  3921. drawFlames = true;
  3922. aBoolean831 = true;
  3923. startRunnable(this, 2);
  3924. }
  3925. }
  3926.  
  3927. private static void setHighMem() {
  3928. WorldController.lowMem = false;
  3929. Texture.lowMem = false;
  3930. lowMem = false;
  3931. ObjectManager.lowMem = false;
  3932. ObjectDef.lowMem = false;
  3933. }
  3934.  
  3935. public static void main(String args[]) {
  3936. try {
  3937. nodeID = 10;
  3938. portOff = 0;
  3939. setHighMem(); //sets high or low detail
  3940. isMembers = true;
  3941. signlink.storeid = 32;
  3942. signlink.startpriv(InetAddress.getLocalHost());
  3943. instance = new client();
  3944. instance.createClientFrame(503, 765);//client frame size
  3945. } catch(Exception e) {
  3946. e.printStackTrace();
  3947. }
  3948. }
  3949.  
  3950. public static int clientWidth = 765;
  3951. public static int clientHeight = 503;
  3952.  
  3953. public static client instance;
  3954.  
  3955. private void loadingStages()
  3956. {
  3957. if(lowMem && loadingStage == 2 && ObjectManager.anInt131 != plane)
  3958. {
  3959. main3DArea.initDrawingArea();
  3960. loadingPleaseWait.drawSprite(8,9);;
  3961. main3DArea.drawGraphics(toggleFullscreen ? 0 : 4, super.graphics, toggleFullscreen ? 0 : 4);
  3962. loadingStage = 1;
  3963. aLong824 = System.currentTimeMillis();
  3964. }
  3965. if(loadingStage == 1)
  3966. {
  3967. int j = method54();
  3968. if(j != 0 && System.currentTimeMillis() - aLong824 > 0x57e40L)
  3969. {
  3970. signlink.reporterror(myUsername + " glcfb " + aLong1215 + "," + j + "," + lowMem + "," + decompressors[0] + "," + onDemandFetcher.getNodeCount() + "," + plane + "," + anInt1069 + "," + anInt1070);
  3971. aLong824 = System.currentTimeMillis();
  3972. }
  3973. }
  3974. if(loadingStage == 2 && plane != anInt985)
  3975. {
  3976. anInt985 = plane;
  3977. method24(plane);
  3978. }
  3979. }
  3980.  
  3981. private int method54() {
  3982. for(int i = 0; i < aByteArrayArray1183.length; i++) {
  3983. if(aByteArrayArray1183[i] == null && anIntArray1235[i] != -1)
  3984. return -1;
  3985. if(aByteArrayArray1247[i] == null && anIntArray1236[i] != -1)
  3986. return -2;
  3987. }
  3988. boolean flag = true;
  3989. for(int j = 0; j < aByteArrayArray1183.length; j++) {
  3990. byte abyte0[] = aByteArrayArray1247[j];
  3991. if(abyte0 != null) {
  3992. int k = (anIntArray1234[j] >> 8) * 64 - baseX;
  3993. int l = (anIntArray1234[j] & 0xff) * 64 - baseY;
  3994. if(aBoolean1159) {
  3995. k = 10;
  3996. l = 10;
  3997. }
  3998. flag &= ObjectManager.method189(k, abyte0, l);
  3999. }
  4000. }
  4001. if(!flag)
  4002. return -3;
  4003. if(aBoolean1080) {
  4004. return -4;
  4005. } else {
  4006. loadingStage = 2;
  4007. ObjectManager.anInt131 = plane;
  4008. method22();
  4009. stream.createFrame(121);
  4010. return 0;
  4011. }
  4012. }
  4013.  
  4014. private void method55()
  4015. {
  4016. for(Animable_Sub4 class30_sub2_sub4_sub4 = (Animable_Sub4)aClass19_1013.reverseGetFirst(); class30_sub2_sub4_sub4 != null; class30_sub2_sub4_sub4 = (Animable_Sub4)aClass19_1013.reverseGetNext())
  4017. if(class30_sub2_sub4_sub4.anInt1597 != plane || loopCycle > class30_sub2_sub4_sub4.anInt1572)
  4018. class30_sub2_sub4_sub4.unlink();
  4019. else
  4020. if(loopCycle >= class30_sub2_sub4_sub4.anInt1571)
  4021. {
  4022. if(class30_sub2_sub4_sub4.anInt1590 > 0)
  4023. {
  4024. NPC npc = npcArray[class30_sub2_sub4_sub4.anInt1590 - 1];
  4025. if(npc != null && npc.x >= 0 && npc.x < 13312 && npc.y >= 0 && npc.y < 13312)
  4026. class30_sub2_sub4_sub4.method455(loopCycle, npc.y, method42(class30_sub2_sub4_sub4.anInt1597, npc.y, npc.x) - class30_sub2_sub4_sub4.anInt1583, npc.x);
  4027. }
  4028. if(class30_sub2_sub4_sub4.anInt1590 < 0)
  4029. {
  4030. int j = -class30_sub2_sub4_sub4.anInt1590 - 1;
  4031. Player player;
  4032. if(j == unknownInt10)
  4033. player = myPlayer;
  4034. else
  4035. player = playerArray[j];
  4036. if(player != null && player.x >= 0 && player.x < 13312 && player.y >= 0 && player.y < 13312)
  4037. class30_sub2_sub4_sub4.method455(loopCycle, player.y, method42(class30_sub2_sub4_sub4.anInt1597, player.y, player.x) - class30_sub2_sub4_sub4.anInt1583, player.x);
  4038. }
  4039. class30_sub2_sub4_sub4.method456(anInt945);
  4040. worldController.method285(plane, class30_sub2_sub4_sub4.anInt1595, (int)class30_sub2_sub4_sub4.aDouble1587, -1, (int)class30_sub2_sub4_sub4.aDouble1586, 60, (int)class30_sub2_sub4_sub4.aDouble1585, class30_sub2_sub4_sub4, false);
  4041. }
  4042.  
  4043. }
  4044.  
  4045. public AppletContext getAppletContext()
  4046. {
  4047. if(signlink.mainapp != null)
  4048. return signlink.mainapp.getAppletContext();
  4049. else
  4050. return super.getAppletContext();
  4051. }
  4052.  
  4053. private void drawLogo() {
  4054. byte abyte0[] = titleStreamLoader.getDataForName("title.dat");
  4055. new Sprite(abyte0, this);
  4056. System.gc();
  4057. }
  4058.  
  4059.  
  4060. private void processOnDemandQueue() {
  4061. do {
  4062. OnDemandData onDemandData;
  4063. do {
  4064. onDemandData = onDemandFetcher.getNextNode();
  4065. if(onDemandData == null)
  4066. return;
  4067. if(onDemandData.dataType == 0)
  4068. {
  4069. Model.method460(onDemandData.buffer, onDemandData.ID);
  4070. if(backDialogID != -1)
  4071. inputTaken = true;
  4072. }
  4073. if (onDemandData.dataType == 1)
  4074. AnimFrame.load(onDemandData.ID, onDemandData.buffer);
  4075. //if (onDemandData.dataType == 1)//Animations never gets here tho.
  4076.  
  4077. if(onDemandData.dataType == 2 && onDemandData.ID == nextSong && onDemandData.buffer != null)
  4078. saveMidi(songChanging, onDemandData.buffer);
  4079. if(onDemandData.dataType == 3 && loadingStage == 1) {
  4080. //System.out.println(onDemandData.ID);
  4081. try {
  4082. writeFile(onDemandData.buffer, "./maps/" + onDemandData.ID + ".dat");
  4083. } catch (Exception e) {}
  4084. for(int i = 0; i < aByteArrayArray1183.length; i++)
  4085. {
  4086. if(anIntArray1235[i] == onDemandData.ID)
  4087. {
  4088. aByteArrayArray1183[i] = onDemandData.buffer;
  4089. if(onDemandData.buffer == null) {
  4090. anIntArray1235[i] = -1;
  4091. }
  4092. break;
  4093. }
  4094. if(anIntArray1236[i] != onDemandData.ID)
  4095. continue;
  4096. aByteArrayArray1247[i] = onDemandData.buffer;
  4097. if(onDemandData.buffer == null) {
  4098. anIntArray1236[i] = -1;
  4099. }
  4100. break;
  4101. }
  4102.  
  4103. }
  4104. } while(onDemandData.dataType != 93 || !onDemandFetcher.method564(onDemandData.ID));
  4105. ObjectManager.method173(new Stream(onDemandData.buffer), onDemandFetcher);
  4106. } while(true);
  4107. }
  4108.  
  4109. private boolean saveWave(byte abyte0[], int i)
  4110. {
  4111. return abyte0 == null || signlink.wavesave(abyte0, i);
  4112. }
  4113.  
  4114. private void method60(int i)
  4115. {
  4116. RSInterface class9 = RSInterface.interfaceCache[i];
  4117. for(int j = 0; j < class9.children.length; j++)
  4118. {
  4119. if(class9.children[j] == -1)
  4120. break;
  4121. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j]];
  4122. if(class9_1.interfaceType == 1)
  4123. method60(class9_1.id);
  4124. class9_1.animationLength = 0;
  4125. class9_1.animationDelay = 0;
  4126. }
  4127. }
  4128.  
  4129. private void drawHeadIcon()
  4130. {
  4131. if(anInt855 != 2)
  4132. return;
  4133. calcEntityScreenPos((anInt934 - baseX << 7) + anInt937, anInt936 * 2, (anInt935 - baseY << 7) + anInt938);
  4134. if(spriteDrawX > -1 && loopCycle % 20 < 10)
  4135. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  4136. }
  4137.  
  4138. private void mainGameProcessor()
  4139. {
  4140. if(anInt1104 > 1)
  4141. anInt1104--;
  4142. if(anInt1011 > 0)
  4143. anInt1011--;
  4144. if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  4145. if (anInt1501 < 100) {
  4146. anInt1501++;
  4147. if (anInt1501 == 100) {
  4148. if (anInt1500 != 0) {
  4149. inputTaken = true;
  4150. }
  4151. if (anInt1044 != 0) {
  4152. }
  4153. }
  4154. }
  4155. } else if (anInt1501 > 0) {
  4156. anInt1501--;
  4157. }
  4158. for(int j = 0; j < 5; j++)
  4159. if(!parsePacket())
  4160. break;
  4161. if(!loggedIn)
  4162. return;
  4163. synchronized(mouseDetection.syncObject) {
  4164. if(flagged) {
  4165. if(super.clickMode3 != 0 || mouseDetection.coordsIndex >= 40) {
  4166. stream.createFrame(45);
  4167. stream.writeWordBigEndian(0);
  4168. int j2 = stream.currentOffset;
  4169. int j3 = 0;
  4170. for(int j4 = 0; j4 < mouseDetection.coordsIndex; j4++) {
  4171. if(j2 - stream.currentOffset >= 240)
  4172. break;
  4173. j3++;
  4174. int l4 = mouseDetection.coordsY[j4];
  4175. if(l4 < 0)
  4176. l4 = 0;
  4177. else
  4178. if(l4 > 502)
  4179. l4 = 502;
  4180. int k5 = mouseDetection.coordsX[j4];
  4181. if(k5 < 0)
  4182. k5 = 0;
  4183. else
  4184. if(k5 > 764)
  4185. k5 = 764;
  4186. int i6 = l4 * 765 + k5;
  4187. if(mouseDetection.coordsY[j4] == -1 && mouseDetection.coordsX[j4] == -1)
  4188. {
  4189. k5 = -1;
  4190. l4 = -1;
  4191. i6 = 0x7ffff;
  4192. }
  4193. if(k5 == anInt1237 && l4 == anInt1238)
  4194. {
  4195. if(anInt1022 < 2047)
  4196. anInt1022++;
  4197. } else
  4198. {
  4199. int j6 = k5 - anInt1237;
  4200. anInt1237 = k5;
  4201. int k6 = l4 - anInt1238;
  4202. anInt1238 = l4;
  4203. if(anInt1022 < 8 && j6 >= -32 && j6 <= 31 && k6 >= -32 && k6 <= 31)
  4204. {
  4205. j6 += 32;
  4206. k6 += 32;
  4207. stream.writeWord((anInt1022 << 12) + (j6 << 6) + k6);
  4208. anInt1022 = 0;
  4209. } else
  4210. if(anInt1022 < 8)
  4211. {
  4212. stream.writeDWordBigEndian(0x800000 + (anInt1022 << 19) + i6);
  4213. anInt1022 = 0;
  4214. } else
  4215. {
  4216. stream.writeDWord(0xc0000000 + (anInt1022 << 19) + i6);
  4217. anInt1022 = 0;
  4218. }
  4219. }
  4220. }
  4221.  
  4222. stream.writeBytes(stream.currentOffset - j2);
  4223. if(j3 >= mouseDetection.coordsIndex)
  4224. {
  4225. mouseDetection.coordsIndex = 0;
  4226. } else
  4227. {
  4228. mouseDetection.coordsIndex -= j3;
  4229. for(int i5 = 0; i5 < mouseDetection.coordsIndex; i5++)
  4230. {
  4231. mouseDetection.coordsX[i5] = mouseDetection.coordsX[i5 + j3];
  4232. mouseDetection.coordsY[i5] = mouseDetection.coordsY[i5 + j3];
  4233. }
  4234.  
  4235. }
  4236. }
  4237. } else
  4238. {
  4239. mouseDetection.coordsIndex = 0;
  4240. }
  4241. }
  4242. if(super.clickMode3 != 0)
  4243. {
  4244. long l = (super.aLong29 - aLong1220) / 50L;
  4245. if(l > 4095L)
  4246. l = 4095L;
  4247. aLong1220 = super.aLong29;
  4248. int k2 = super.saveClickY;
  4249. if(k2 < 0)
  4250. k2 = 0;
  4251. else
  4252. if(k2 > 502)
  4253. k2 = 502;
  4254. int k3 = super.saveClickX;
  4255. if(k3 < 0)
  4256. k3 = 0;
  4257. else
  4258. if(k3 > 764)
  4259. k3 = 764;
  4260. int k4 = k2 * 765 + k3;
  4261. int j5 = 0;
  4262. if(super.clickMode3 == 2)
  4263. j5 = 1;
  4264. int l5 = (int)l;
  4265. stream.createFrame(241);
  4266. stream.writeDWord((l5 << 20) + (j5 << 19) + k4);
  4267. }
  4268. if(anInt1016 > 0)
  4269. anInt1016--;
  4270. if(super.keyArray[1] == 1 || super.keyArray[2] == 1 || super.keyArray[3] == 1 || super.keyArray[4] == 1)
  4271. aBoolean1017 = true;
  4272. if(aBoolean1017 && anInt1016 <= 0)
  4273. {
  4274. anInt1016 = 20;
  4275. aBoolean1017 = false;
  4276. stream.createFrame(86);
  4277. stream.writeWord(anInt1184);
  4278. stream.method432(minimapInt1);
  4279. }
  4280. if(super.awtFocus && !aBoolean954)
  4281. {
  4282. aBoolean954 = true;
  4283. stream.createFrame(3);
  4284. stream.writeWordBigEndian(1);
  4285. }
  4286. if(!super.awtFocus && aBoolean954)
  4287. {
  4288. aBoolean954 = false;
  4289. stream.createFrame(3);
  4290. stream.writeWordBigEndian(0);
  4291. }
  4292. loadingStages();
  4293. method115();
  4294. method90();
  4295. anInt1009++;
  4296. if(anInt1009 > 750)
  4297. dropClient();
  4298. method114();
  4299. method95();
  4300. method38();
  4301.  
  4302. anInt945++;
  4303. if(crossType != 0)
  4304. {
  4305. crossIndex += 20;
  4306. if(crossIndex >= 400)
  4307. crossType = 0;
  4308. }
  4309. if(atInventoryInterfaceType != 0)
  4310. {
  4311. atInventoryLoopCycle++;
  4312. if(atInventoryLoopCycle >= 15)
  4313. {
  4314. if(atInventoryInterfaceType == 2) {
  4315. }
  4316. if(atInventoryInterfaceType == 3)
  4317. inputTaken = true;
  4318. atInventoryInterfaceType = 0;
  4319. }
  4320. }
  4321. if(activeInterfaceType != 0)
  4322. {
  4323. anInt989++;
  4324. if(super.mouseX > anInt1087 + 5 || super.mouseX < anInt1087 - 5 || super.mouseY > anInt1088 + 5 || super.mouseY < anInt1088 - 5)
  4325. aBoolean1242 = true;
  4326. if(super.clickMode2 == 0)
  4327. {
  4328. if(activeInterfaceType == 2) {
  4329. }
  4330. if(activeInterfaceType == 3)
  4331. inputTaken = true;
  4332. activeInterfaceType = 0;
  4333. if(aBoolean1242 && anInt989 >= 10)
  4334. {
  4335. lastActiveInvInterface = -1;
  4336.  
  4337. processRightClick();
  4338. if(anInt1084 == 5382 && super.mouseY >= 40 && super.mouseY <= 77){//check if bank interface
  4339. if (super.mouseX >= 28 && super.mouseX <= 74){// tab 1
  4340. System.out.println("here 1"+anInt1084);
  4341. stream.createFrame(214);
  4342. stream.method433(5);//5 = maintab
  4343. stream.method424(0);
  4344. stream.method433(anInt1085);//Selected item slot
  4345. stream.method431(mouseInvInterfaceIndex);//unused
  4346.  
  4347. }
  4348. if (super.mouseX >= 75 && super.mouseX <= 121){// tab 1
  4349. stream.createFrame(214);
  4350. stream.method433(13);//tab # x 13 (originally movewindow)
  4351. stream.method424(0);
  4352. stream.method433(anInt1085);//Selected item slot
  4353. stream.method431(mouseInvInterfaceIndex);//unused
  4354.  
  4355. }
  4356. if (super.mouseX >= 122 && super.mouseX <= 168){// tab 2
  4357. stream.createFrame(214);
  4358. stream.method433(26);//tab # x 13 (originally movewindow)
  4359. stream.method424(0);
  4360. stream.method433(anInt1085);//Selected item slot
  4361. stream.method431(mouseInvInterfaceIndex);//unused
  4362.  
  4363. }
  4364. if (super.mouseX >= 169 && super.mouseX <= 215){// tab 3
  4365. stream.createFrame(214);
  4366. stream.method433(39);//tab # x 13 (originally movewindow)
  4367. stream.method424(0);
  4368. stream.method433(anInt1085);//Selected item slot
  4369. stream.method431(mouseInvInterfaceIndex);//unused
  4370.  
  4371. }
  4372. if (super.mouseX >= 216 && super.mouseX <= 262){// tab 4
  4373. stream.createFrame(214);
  4374. stream.method433(52);//tab # x 13 (originally movewindow)
  4375. stream.method424(0);
  4376. stream.method433(anInt1085);//Selected item slot
  4377. stream.method431(mouseInvInterfaceIndex);//unused
  4378.  
  4379. }
  4380. if (super.mouseX >= 263 && super.mouseX <= 309){// tab 5
  4381. stream.createFrame(214);
  4382. stream.method433(65);//tab # x 13 (originally movewindow)
  4383. stream.method424(0);
  4384. stream.method433(anInt1085);//Selected item slot
  4385. stream.method431(mouseInvInterfaceIndex);//unused
  4386.  
  4387. }
  4388. if (super.mouseX >= 310 && super.mouseX <= 356){// tab 6
  4389. stream.createFrame(214);
  4390. stream.method433(78);//tab # x 13 (originally movewindow)
  4391. stream.method424(0);
  4392. stream.method433(anInt1085);//Selected item slot
  4393. stream.method431(mouseInvInterfaceIndex);//unused
  4394.  
  4395. }
  4396. if (super.mouseX >= 357 && super.mouseX <= 403){// tab 7
  4397. stream.createFrame(214);
  4398. stream.method433(91);//tab # x 13 (originally movewindow)
  4399. stream.method424(0);
  4400. stream.method433(anInt1085);//Selected item slot
  4401. stream.method431(mouseInvInterfaceIndex);//unused
  4402.  
  4403. }
  4404. if (super.mouseX >= 404 && super.mouseX <= 450){// tab 8
  4405. stream.createFrame(214);
  4406. stream.method433(104);//tab # x 13 (originally movewindow)
  4407. stream.method424(0);
  4408. stream.method433(anInt1085);//Selected item slot
  4409. stream.method431(mouseInvInterfaceIndex);//unused
  4410.  
  4411. }
  4412. }
  4413. if (anInt1084 == 5382) {
  4414. RSInterface class9 = RSInterface.interfaceCache[anInt1084];
  4415. int j1 = 0;
  4416. if(anInt913 == 1 && class9.contentType == 206)
  4417. j1 = 1;
  4418. if(class9.inventory[mouseInvInterfaceIndex] <= 0)
  4419. j1 = 0;
  4420. stream.createFrame(214);
  4421. stream.method433(anInt1084);
  4422. stream.method424(j1);
  4423. stream.method433(anInt1085);
  4424. stream.method431(mouseInvInterfaceIndex);
  4425. } else if(lastActiveInvInterface == anInt1084 && mouseInvInterfaceIndex != anInt1085)
  4426. {
  4427. RSInterface class9 = RSInterface.interfaceCache[anInt1084];
  4428. int j1 = 0;
  4429. if(anInt913 == 1 && class9.contentType == 206)
  4430. j1 = 1;
  4431. if(class9.inventory[mouseInvInterfaceIndex] <= 0)
  4432. j1 = 0;
  4433. if(class9.deletesTargetSlot)
  4434. {
  4435. int l2 = anInt1085;
  4436. int l3 = mouseInvInterfaceIndex;
  4437. class9.inventory[l3] = class9.inventory[l2];
  4438. class9.inventoryValue[l3] = class9.inventoryValue[l2];
  4439. class9.inventory[l2] = -1;
  4440. class9.inventoryValue[l2] = 0;
  4441. } else
  4442. if(j1 == 1)
  4443. {
  4444. int i3 = anInt1085;
  4445. for(int i4 = mouseInvInterfaceIndex; i3 != i4;)
  4446. if(i3 > i4)
  4447. {
  4448. class9.swapInventoryItems(i3, i3 - 1);
  4449. i3--;
  4450. } else
  4451. if(i3 < i4)
  4452. {
  4453. class9.swapInventoryItems(i3, i3 + 1);
  4454. i3++;
  4455. }
  4456.  
  4457. } else
  4458. {
  4459. class9.swapInventoryItems(anInt1085, mouseInvInterfaceIndex);
  4460. }
  4461. stream.createFrame(214);
  4462. stream.method433(anInt1084);
  4463. stream.method424(j1);
  4464. stream.method433(anInt1085);
  4465. stream.method431(mouseInvInterfaceIndex);
  4466. }
  4467. } else
  4468. if((anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  4469. determineMenuSize();
  4470. else
  4471. if(menuActionRow > 0)
  4472. doAction(menuActionRow - 1);
  4473. atInventoryLoopCycle = 10;
  4474. super.clickMode3 = 0;
  4475. }
  4476. }
  4477. if(WorldController.anInt470 != -1)
  4478. {
  4479. int k = WorldController.anInt470;
  4480. int k1 = WorldController.anInt471;
  4481. boolean flag = doWalkTo(0, 0, 0, 0, myPlayer.smallY[0], 0, 0, k1, myPlayer.smallX[0], true, k);
  4482. WorldController.anInt470 = -1;
  4483. if(flag)
  4484. {
  4485. crossX = super.saveClickX;
  4486. crossY = super.saveClickY;
  4487. crossType = 1;
  4488. crossIndex = 0;
  4489. }
  4490. }
  4491. if(super.clickMode3 == 1 && aString844 != null)
  4492. {
  4493. aString844 = null;
  4494. inputTaken = true;
  4495. super.clickMode3 = 0;
  4496. }
  4497. if (!processMenuClick()) {
  4498. processMainScreenClick();
  4499. processTabClick();
  4500. processChatModeClick();
  4501. }
  4502. if(super.clickMode2 == 1 || super.clickMode3 == 1)
  4503. anInt1213++;
  4504. if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  4505. if (anInt1501 < 100) {
  4506. anInt1501++;
  4507. if (anInt1501 == 100) {
  4508. if (anInt1500 != 0) {
  4509. inputTaken = true;
  4510. }
  4511. if (anInt1044 != 0) {
  4512. }
  4513. }
  4514. }
  4515. } else if (anInt1501 > 0) {
  4516. anInt1501--;
  4517. }
  4518. if(loadingStage == 2)
  4519. method108();
  4520. if(loadingStage == 2 && aBoolean1160)
  4521. calcCameraPos();
  4522. for(int i1 = 0; i1 < 5; i1++)
  4523. anIntArray1030[i1]++;
  4524.  
  4525. method73();
  4526. super.idleTime++;
  4527. if(super.idleTime > 4500)
  4528. {
  4529. anInt1011 = 250;
  4530. super.idleTime -= 500;
  4531. stream.createFrame(202);
  4532. }
  4533. anInt1010++;
  4534. if(anInt1010 > 50)
  4535. stream.createFrame(0);
  4536. try
  4537. {
  4538. if(socketStream != null && stream.currentOffset > 0)
  4539. {
  4540. socketStream.queueBytes(stream.currentOffset, stream.buffer);
  4541. stream.currentOffset = 0;
  4542. anInt1010 = 0;
  4543. }
  4544. } catch(IOException _ex) {
  4545. dropClient();
  4546. } catch(Exception exception) {
  4547. resetLogout();
  4548. }
  4549. }
  4550.  
  4551. private void method63()
  4552. {
  4553. Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst();
  4554. for(; class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  4555. if(class30_sub1.anInt1294 == -1) {
  4556. class30_sub1.anInt1302 = 0;
  4557. method89(class30_sub1);
  4558. } else {
  4559. class30_sub1.unlink();
  4560. }
  4561.  
  4562. }
  4563.  
  4564. private void resetImageProducers() {
  4565. if(aRSImageProducer_1107 != null)
  4566. return;
  4567. super.fullGameScreen = null;
  4568. chatBackImage = null;
  4569. mapBackImage = null;
  4570. inventoryBackImage = null;
  4571. main3DArea = null;
  4572. aRSImageProducer_1125 = null;
  4573.  
  4574. aRSImageProducer_1107 = new RSImageProducer(509, 171, getGameComponent());
  4575. DrawingArea.setAllPixelsToZero();
  4576. new RSImageProducer(360, 132, getGameComponent());
  4577. DrawingArea.setAllPixelsToZero();
  4578. loginScreenArea = new RSImageProducer(765, 503, getGameComponent());
  4579. DrawingArea.setAllPixelsToZero();
  4580. new RSImageProducer(200, 100, getGameComponent());
  4581. DrawingArea.setAllPixelsToZero();
  4582. new RSImageProducer(202, 238, getGameComponent());
  4583. DrawingArea.setAllPixelsToZero();
  4584. new RSImageProducer(203, 238, getGameComponent());
  4585. DrawingArea.setAllPixelsToZero();
  4586. new RSImageProducer(74, 94, getGameComponent());
  4587. DrawingArea.setAllPixelsToZero();
  4588. new RSImageProducer(75, 94, getGameComponent());
  4589. DrawingArea.setAllPixelsToZero();
  4590. if(titleStreamLoader != null) {
  4591. drawLogo();
  4592. loadTitleScreen();
  4593. }
  4594. welcomeScreenRaised = true;
  4595. }
  4596.  
  4597. void drawLoadingText(int i, String s) {
  4598. anInt1079 = i;
  4599. aString1049 = s;
  4600. resetImageProducers();
  4601. if(titleStreamLoader == null) {
  4602. super.drawLoadingText(i, s);
  4603. return;
  4604. }
  4605. loginScreenArea.initDrawingArea();
  4606. //backgroundWorld1 = new Sprite("background");
  4607. backgroundWorld1.drawSprite(0, 0);
  4608. loadingBarEmpty = new Sprite("Login/Loading 1");
  4609. loadingBarFull = new Sprite(sign.signlink.findcachedir() + "Sprites/Login/Loading 2.png", (int)Math.round(i*2.02), 12);
  4610. loadingBarEmpty.drawSprite(230, 212);
  4611. loadingBarFull.drawSprite(292, 236);
  4612. newRegularFont.drawCenteredString(s + " - "+i+"%", 380, 228, 0xFFFFFD, 0);
  4613. loginScreenArea.drawGraphics(0, super.graphics, 0);//171, super.graphics, 202);
  4614. if(welcomeScreenRaised) welcomeScreenRaised = false;
  4615. }
  4616.  
  4617.  
  4618. private void method65(int i, int j, int k, int l, RSInterface class9, int i1, boolean flag, int j1) {
  4619. int anInt992;
  4620. if(aBoolean972)
  4621. anInt992 = 32;
  4622. else
  4623. anInt992 = 0;
  4624. aBoolean972 = false;
  4625. if(k >= i && k < i + 16 && l >= i1 && l < i1 + 16)
  4626. {
  4627. class9.scrollPosition -= anInt1213 * 4;
  4628. if(flag)
  4629. {
  4630. }
  4631. } else
  4632. if(k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j)
  4633. {
  4634. class9.scrollPosition += anInt1213 * 4;
  4635. if(flag)
  4636. {
  4637. }
  4638. } else
  4639. if(k >= i - anInt992 && k < i + 16 + anInt992 && l >= i1 + 16 && l < (i1 + j) - 16 && anInt1213 > 0)
  4640. {
  4641. int l1 = ((j - 32) * j) / j1;
  4642. if(l1 < 8)
  4643. l1 = 8;
  4644. int i2 = l - i1 - 16 - l1 / 2;
  4645. int j2 = j - 32 - l1;
  4646. class9.scrollPosition = ((j1 - j) * i2) / j2;
  4647. if(flag) {
  4648. }
  4649. aBoolean972 = true;
  4650. }
  4651. }
  4652.  
  4653. private boolean method66(int i, int j, int k)
  4654. {
  4655. int i1 = i >> 14 & 0x7fff;
  4656. int j1 = worldController.method304(plane, k, j, i);
  4657. if(j1 == -1)
  4658. return false;
  4659. int k1 = j1 & 0x1f;
  4660. int l1 = j1 >> 6 & 3;
  4661. if(k1 == 10 || k1 == 11 || k1 == 22)
  4662. {
  4663. ObjectDef class46 = ObjectDef.forID(i1);
  4664. int i2;
  4665. int j2;
  4666. if(l1 == 0 || l1 == 2)
  4667. {
  4668. i2 = class46.anInt744;
  4669. j2 = class46.anInt761;
  4670. } else
  4671. {
  4672. i2 = class46.anInt761;
  4673. j2 = class46.anInt744;
  4674. }
  4675. int k2 = class46.anInt768;
  4676. if(l1 != 0)
  4677. k2 = (k2 << l1 & 0xf) + (k2 >> 4 - l1);
  4678. doWalkTo(2, 0, j2, 0, myPlayer.smallY[0], i2, k2, j, myPlayer.smallX[0], false, k);
  4679. } else
  4680. {
  4681. doWalkTo(2, l1, 0, k1 + 1, myPlayer.smallY[0], 0, 0, j, myPlayer.smallX[0], false, k);
  4682. }
  4683. crossX = super.saveClickX;
  4684. crossY = super.saveClickY;
  4685. crossType = 2;
  4686. crossIndex = 0;
  4687. return true;
  4688. }
  4689.  
  4690. private boolean downloadingCache = false;
  4691. public int interfaceButtonAction = 0;
  4692. private NamedArchive streamLoaderForName(int i, String s, String s1) {
  4693. byte abyte0[] = null;
  4694. if (!downloadingCache) {
  4695. new CacheDownloader(this).downloadCache();
  4696. downloadingCache = true;
  4697. }
  4698. try {
  4699. if(decompressors[0] != null) {
  4700. abyte0 = decompressors[0].decompress(i);
  4701. }
  4702. if(abyte0 == null) {
  4703. drawLoadingText(0, "Connecting to File Server...");
  4704. abyte0 = decompressors[0].decompress(i);
  4705. }
  4706. } catch (Exception e) {
  4707. e.printStackTrace();
  4708. }
  4709. if(abyte0 != null) {
  4710. NamedArchive archive = new NamedArchive(abyte0, s);
  4711. return archive;
  4712. } else
  4713. new CacheDownloader(this).downloadCache();
  4714. while (true) {
  4715. drawLoadingText(0, "Error loading... Please report!");
  4716. try {
  4717. Thread.sleep(1000);
  4718. } catch (Exception e) {
  4719. e.printStackTrace();
  4720. }
  4721. }
  4722. }
  4723.  
  4724. private void dropClient()
  4725. {
  4726. if(anInt1011 > 0)
  4727. {
  4728. resetLogout();
  4729. return;
  4730. }
  4731. main3DArea.initDrawingArea();
  4732. reestablish.drawSprite(8,9);
  4733. main3DArea.drawGraphics(toggleFullscreen ? 0 : 4, super.graphics, toggleFullscreen ? 0 : 4);
  4734. anInt1021 = 0;
  4735. destX = 0;
  4736. familiarType = -1;
  4737. leftClickOption = 0;
  4738. RSSocket rsSocket = socketStream;
  4739. loggedIn = false;
  4740. loginFailures = 0;
  4741. login(myUsername, myPassword, true);
  4742. if(!loggedIn)
  4743. resetLogout();
  4744. try
  4745. {
  4746. rsSocket.close();
  4747. }
  4748. catch(Exception _ex)
  4749. {
  4750. }
  4751. }
  4752.  
  4753. void sendPacket(int packet) {
  4754. if (packet == 103) {
  4755. stream.createFrame(103);
  4756. stream.writeWordBigEndian(inputString.length() - 1);
  4757. stream.writeString(inputString.substring(2));
  4758. inputString = "";
  4759. promptInput = "";
  4760. interfaceButtonAction = 0;
  4761. }
  4762. }
  4763.  
  4764. private void doAction(int i)
  4765. {
  4766. if(i < 0)
  4767. return;
  4768. if(inputDialogState != 0)
  4769. {
  4770. inputDialogState = 0;
  4771. inputTaken = true;
  4772. }
  4773. int j = menuActionCmd2[i];
  4774. int k = menuActionCmd3[i];
  4775. int l = menuActionID[i];
  4776. int i1 = menuActionCmd1[i];
  4777. if(l >= 2000)
  4778. l -= 2000;
  4779. if (l == 712) {
  4780. coinToggle = !coinToggle;
  4781. }
  4782. if (l == 713) {
  4783. inputTaken = true;
  4784. messagePromptRaised = true;
  4785. amountOrNameInput = "";
  4786. inputDialogState = 0;
  4787. interfaceButtonAction = 557;
  4788. aString1121 = "Enter amount";
  4789. }
  4790. if (l == 714) {
  4791. pushMessage("Your money pouch currently contains "+RSInterface.interfaceCache[8135].disabledMessage+" coins.", 0, "");
  4792. }
  4793. if (l == 715) {
  4794. pushMessage("Price checker is not yet available.", 0, "");
  4795. }
  4796. if(l == 582)
  4797. {
  4798. NPC npc = npcArray[i1];
  4799. if(npc != null)
  4800. {
  4801. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0], myPlayer.smallX[0], false, npc.smallX[0]);
  4802. crossX = super.saveClickX;
  4803. crossY = super.saveClickY;
  4804. crossType = 2;
  4805. crossIndex = 0;
  4806. stream.createFrame(57);
  4807. stream.method432(anInt1285);
  4808. stream.method432(i1);
  4809. stream.method431(anInt1283);
  4810. stream.method432(anInt1284);
  4811. }
  4812. }
  4813. if (l == 1994) {
  4814. stream.createFrame(185);
  4815. stream.writeWord(66122);
  4816. }
  4817. if (l == 1995) {
  4818. stream.createFrame(185);
  4819. stream.writeWord(66117);
  4820. }
  4821. if (l == 1996) {
  4822. stream.createFrame(185);
  4823. stream.writeWord(66126);
  4824. }
  4825. if (l == 1997) {
  4826. stream.createFrame(185);
  4827. stream.writeWord(66127);
  4828. }
  4829. if (l == 1998) {
  4830. stream.createFrame(185);
  4831. stream.writeWord(66118);
  4832. }
  4833. if (l == 1999) {
  4834. tabID = 10;
  4835. tabAreaAltered = true;
  4836. }
  4837. if (l == 1993) {
  4838. stream.createFrame(185);
  4839. stream.writeWord(66119);
  4840. }
  4841. if (l == 2000) {
  4842. pushMessage("Coming soon..", 0, "");
  4843. }
  4844. if (l == 477) {
  4845. anInt1278 = 0;
  4846. anInt1131 = 0;
  4847. anInt896 = 0;
  4848. minimapInt2 = 0;
  4849. minimapInt3 = 0;
  4850. minimapInt1 = 0;
  4851. }
  4852. if(l == 234)
  4853. {
  4854. boolean flag1 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4855. if(!flag1)
  4856. flag1 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4857. crossX = super.saveClickX;
  4858. crossY = super.saveClickY;
  4859. crossType = 2;
  4860. crossIndex = 0;
  4861. stream.createFrame(236);
  4862. stream.method431(k + baseY);
  4863. stream.writeWord(i1);
  4864. stream.method431(j + baseX);
  4865. }
  4866. if(l == 62 && method66(i1, k, j))
  4867. {
  4868. stream.createFrame(192);
  4869. stream.writeWord(anInt1284);
  4870. stream.method431(i1 >> 14 & 0x7fff);
  4871. stream.method433(k + baseY);
  4872. stream.method431(anInt1283);
  4873. stream.method433(j + baseX);
  4874. stream.writeWord(anInt1285);
  4875. }
  4876. if(l == 511)
  4877. {
  4878. boolean flag2 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4879. if(!flag2)
  4880. flag2 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4881. crossX = super.saveClickX;
  4882. crossY = super.saveClickY;
  4883. crossType = 2;
  4884. crossIndex = 0;
  4885. stream.createFrame(25);
  4886. stream.method431(anInt1284);
  4887. stream.method432(anInt1285);
  4888. stream.writeWord(i1);
  4889. stream.method432(k + baseY);
  4890. stream.method433(anInt1283);
  4891. stream.writeWord(j + baseX);
  4892. }
  4893. if(l == 74) {
  4894. stream.createFrame(122);
  4895. stream.method433(k);
  4896. stream.method432(j);
  4897. stream.method431(i1);
  4898. atInventoryLoopCycle = 0;
  4899. atInventoryInterface = k;
  4900. atInventoryIndex = j;
  4901. atInventoryInterfaceType = 2;
  4902. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4903. atInventoryInterfaceType = 1;
  4904. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4905. atInventoryInterfaceType = 3;
  4906. }
  4907. if(l == 169) {
  4908. if (k != 152) {
  4909. stream.createFrame(185);
  4910. stream.writeWord(k);
  4911. RSInterface class9_3 = RSInterface.interfaceCache[k];
  4912. if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5) {
  4913. int l2 = class9_3.valueIndexArray[0][1];
  4914. variousSettings[l2] = 1 - variousSettings[l2];
  4915. method33(l2);
  4916. }
  4917. }
  4918. }
  4919. //System.out.println("id: "+l+" - K: "+k);
  4920. switch(l) {
  4921. case 169:
  4922. case 1050:
  4923. if (l == 169 && k != 152) break;
  4924. runState = 1;
  4925. if(!runClicked) {
  4926. runClicked = true;
  4927. restOrb = false;
  4928. stream.createFrame(185);
  4929. stream.writeWord(153);
  4930. variousSettings[173] = 0;
  4931. method33(173);
  4932. } else {
  4933. runClicked = false;
  4934. stream.createFrame(185);
  4935. stream.writeWord(152);
  4936. variousSettings[173] = 1;
  4937. method33(173);
  4938. }
  4939. break;
  4940. case 1500:
  4941. int currentXp = Integer.parseInt(RSInterface.interfaceCache[31134].disabledMessage);
  4942. int maxXp = Integer.parseInt(RSInterface.interfaceCache[31135].disabledMessage);
  4943. int prayer = (int)(((double)currentXp / (double)maxXp) * 100D);
  4944. if (prayer <= 0) {
  4945. pushMessage("You need to recharge your Prayer at an altar.", 0, "");
  4946. break;
  4947. }
  4948. if(!prayClicked) {
  4949. prayClicked = true;
  4950. } else {
  4951. prayClicked = false;
  4952. }
  4953. stream.createFrame(185);
  4954. stream.writeWord(2014);
  4955. break;
  4956. case 1502:
  4957. if (tabInterfaceIDs[5] == 18400 || tabInterfaceIDs[5] == 17200) {
  4958. stream.createFrame(185);
  4959. stream.writeWord(2015);
  4960. }
  4961. if (tabInterfaceIDs[5] == 22500) {
  4962. setSidebarInterface(5, 18400);
  4963. }
  4964. if (tabInterfaceIDs[5] == 5608) {
  4965. setSidebarInterface(5, 17200);
  4966. }
  4967. break;
  4968.  
  4969. case 1501:
  4970. runState = 2;
  4971. if(!restOrb) {
  4972. restOrb = true;
  4973. }
  4974. stream.createFrame(185);
  4975. stream.writeWord(2012);
  4976. break;
  4977. case 1503:
  4978. if(!drawXpBar) {
  4979. drawXpBar = true;
  4980. } else {
  4981. drawXpBar = false;
  4982. }
  4983. break;
  4984. case 1504:
  4985. testXp = 0;
  4986. stream.createFrame(185);
  4987. stream.writeWord(2013);
  4988. break;
  4989. }
  4990. if (l == 315) {
  4991. RSInterface class9 = RSInterface.interfaceCache[k];
  4992. boolean flag8 = true;
  4993. if (class9.contentType > 0) {
  4994. if (inClan && k == 18129) {
  4995.  
  4996. } else {
  4997. flag8 = promptUserForInput(class9);
  4998. }
  4999. }
  5000. if (flag8) {
  5001. if (k > 17201 && k < 17229) {
  5002. RSInterface class9_3 = RSInterface.interfaceCache[k];
  5003. if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5) {
  5004. int configId = class9_3.valueIndexArray[0][1];
  5005. //System.out.println(configId+", ");
  5006. variousSettings[configId] = 1 - variousSettings[configId];
  5007. method33(configId);
  5008. }
  5009. }
  5010. switch(k){
  5011. case 36004: // Fixed screen button
  5012. pushMessage("Coming soon!", 0, "");
  5013. break;
  5014. case 36007: // Resizable screen button
  5015. pushMessage("Coming soon!", 0, "");
  5016. break;
  5017. case 36010: // Fullscreen screen button
  5018. pushMessage("Coming soon!", 0, "");
  5019. break;
  5020. case 19144:
  5021. sendFrame248(15106,3213);
  5022. method60(15106);
  5023. inputTaken = true;
  5024. break;
  5025. case 27615:
  5026. setSidebarInterface(4, 1644);
  5027. break;
  5028. case 25843://arrow
  5029. setSidebarInterface(11, 24500);
  5030. break;
  5031. case 27610://return
  5032. setSidebarInterface(11, 904);
  5033. break;
  5034. case 36100:
  5035. setSidebarInterface(11, 17300);
  5036. break;
  5037. case 17311://hp
  5038.  
  5039. if (hitbarToggle) {
  5040. hitbarToggle = false;
  5041. sendFrame126("New HP bar: @red@OFF", 17312); //sendFrame126("", 27524);
  5042. } else {
  5043. hitbarToggle = true;
  5044. sendFrame126("New HP bar: @gr3@ON", 17312); //sendFrame126("", 27528);
  5045. }
  5046. break;
  5047. case 17305://names
  5048.  
  5049. if (namesToggle) {
  5050. namesToggle = false;
  5051. sendFrame126("@whi@Player Names: @red@OFF", 17306); //sendFrame126("", 27526);
  5052. } else {
  5053. namesToggle = true;
  5054. sendFrame126("@whi@Player Names: @gr3@ON", 17306); //sendFrame126("", 27530);
  5055. }
  5056. break;
  5057. case 17303://gameframe
  5058. if(anInt1021 == 2) {
  5059. pushMessage("Switching gameframes is disabled while in barrows.", 0, "");
  5060. } else {
  5061. //sendFrame126("459", 27531);
  5062. if(is459) {
  5063. is459 = false; is474 = true;
  5064. //sendFrame126("474", 27536);
  5065. //sendFrame126("", 27533); sendFrame126("", 27537); sendFrame126("", 27538); sendFrame126("", 27531);
  5066. } else if(is474) {
  5067. is474 = false; is480 = true;
  5068. sendFrame126("@whi@Gameframe: @gre@480", 17304);
  5069. //sendFrame126("", 27533); sendFrame126("", 27537); sendFrame126("", 27538); sendFrame126("", 27531);
  5070. } else if (is480) {
  5071. is480 = false; is508 = true;
  5072. sendFrame126("@whi@Gameframe: @gre@508", 17304);
  5073.  
  5074. //sendFrame126("508", 27537);
  5075. //sendFrame126("", 27533); sendFrame126("", 27536); sendFrame126("", 27538); sendFrame126("", 27531);
  5076. } else if(is508) {
  5077. is508 = false; is525 = true;
  5078. sendFrame126("@whi@Gameframe: @gre@525", 17304);
  5079.  
  5080. //sendFrame126("525", 27538);
  5081. //sendFrame126("", 27536); sendFrame126("", 27537); sendFrame126("", 27533); sendFrame126("", 27531);
  5082. } else if(is525) {
  5083. is525 = false; is562 = true;
  5084. sendFrame126("@whi@Gameframe: @gre@562", 17304);
  5085.  
  5086. //sendFrame126("562", 27536);
  5087. //sendFrame126("", 27533); sendFrame126("", 27537); sendFrame126("", 27538); sendFrame126("", 27531);
  5088. } else if(is562) {
  5089. is562 = false; is508 = false; is525 = false; is480 = false; is474 = true; is459 = false;
  5090. sendFrame126("@whi@Gameframe: @gre@474", 17304);
  5091.  
  5092. //sendFrame126("", 27533); sendFrame126("", 27536); sendFrame126("", 27537); sendFrame126("", 27538);
  5093. //sendFrame126("377", 27531);
  5094. }
  5095. }
  5096. break;
  5097. case 17309://x10
  5098. sendFrame126("@whi@X10 Damage: @gre@ON", 17310);
  5099. if (newDamage) {
  5100. newDamage = false;
  5101. sendFrame126("@whi@X10 Damage: @gre@ON", 17310);
  5102. //sendFrame126("", 27604);
  5103. } else {
  5104. newDamage = true;
  5105. sendFrame126("@whi@X10 Damage: @red@OFF", 17310);
  5106. //sendFrame126("", 27605);
  5107. }
  5108. break;
  5109. case 17307://hitmarks
  5110.  
  5111. if (hitmarks) {
  5112. hitmarks = false;
  5113. sendFrame126("@whi@Hitsplats: @red@OFF", 17308);
  5114. //sendFrame126("", 27602);
  5115. } else {
  5116. hitmarks = true;
  5117. sendFrame126("@whi@Hitsplats: @gre@ON", 17308);
  5118. //sendFrame126("", 27603);
  5119. }
  5120. break;
  5121. case 29156://achievement
  5122. setSidebarInterface(2, 29265);
  5123. break;
  5124. case 29267://Quest
  5125. setSidebarInterface(2, 638);
  5126. break;
  5127.  
  5128. default:
  5129. stream.createFrame(185);
  5130. stream.writeWord(k);
  5131. break;
  5132.  
  5133. }
  5134. }
  5135. }
  5136. if(l == 561)
  5137. {
  5138. Player player = playerArray[i1];
  5139. if(player != null)
  5140. {
  5141. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, player.smallY[0], myPlayer.smallX[0], false, player.smallX[0]);
  5142. crossX = super.saveClickX;
  5143. crossY = super.saveClickY;
  5144. crossType = 2;
  5145. crossIndex = 0;
  5146. anInt1188 += i1;
  5147. if(anInt1188 >= 90)
  5148. {
  5149. stream.createFrame(136);
  5150. anInt1188 = 0;
  5151. }
  5152. stream.createFrame(128);
  5153. stream.writeWord(i1);
  5154. }
  5155. }
  5156. if(l == 20)
  5157. {
  5158. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[i1];
  5159. if(class30_sub2_sub4_sub1_sub1_1 != null)
  5160. {
  5161. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_1.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_1.smallX[0]);
  5162. crossX = super.saveClickX;
  5163. crossY = super.saveClickY;
  5164. crossType = 2;
  5165. crossIndex = 0;
  5166. stream.createFrame(155);
  5167. stream.method431(i1);
  5168. }
  5169. }
  5170. if(l == 779)
  5171. {
  5172. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[i1];
  5173. if(class30_sub2_sub4_sub1_sub2_1 != null)
  5174. {
  5175. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_1.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_1.smallX[0]);
  5176. crossX = super.saveClickX;
  5177. crossY = super.saveClickY;
  5178. crossType = 2;
  5179. crossIndex = 0;
  5180. stream.createFrame(153);
  5181. stream.method431(i1);
  5182. }
  5183. }
  5184. if(l == 516)
  5185. if(!menuOpen)
  5186. worldController.method312(super.saveClickY - 4, super.saveClickX - 4);
  5187. else
  5188. worldController.method312(k - 4, j - 4);
  5189. if(l == 1062)
  5190. {
  5191. anInt924 += baseX;
  5192. if(anInt924 >= 113)
  5193. {
  5194. stream.createFrame(183);
  5195. stream.writeDWordBigEndian(0xe63271);
  5196. anInt924 = 0;
  5197. }
  5198. method66(i1, k, j);
  5199. stream.createFrame(228);
  5200. stream.method432(i1 >> 14 & 0x7fff);
  5201. stream.method432(k + baseY);
  5202. stream.writeWord(j + baseX);
  5203. }
  5204.  
  5205. if(l == 679 && !aBoolean1149)
  5206. {
  5207. stream.createFrame(40);
  5208. stream.writeWord(k);
  5209. aBoolean1149 = true;
  5210. }
  5211. if(l == 431)
  5212. {
  5213. stream.createFrame(129);
  5214. stream.method432(j);
  5215. stream.writeWord(k);
  5216. stream.method432(i1);
  5217. atInventoryLoopCycle = 0;
  5218. atInventoryInterface = k;
  5219. atInventoryIndex = j;
  5220. atInventoryInterfaceType = 2;
  5221. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5222. atInventoryInterfaceType = 1;
  5223. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5224. atInventoryInterfaceType = 3;
  5225. }
  5226. if(l == 337 || l == 42 || l == 792 || l == 322)
  5227. {
  5228. String s = menuActionName[i];
  5229. int k1 = s.indexOf("@whi@");
  5230. if(k1 != -1)
  5231. {
  5232. long l3 = TextClass.longForName(s.substring(k1 + 5).trim());
  5233. if(l == 337)
  5234. addFriend(l3);
  5235. if(l == 42)
  5236. addIgnore(l3);
  5237. if(l == 792)
  5238. delFriend(l3);
  5239. if(l == 322)
  5240. delIgnore(l3);
  5241. }
  5242. }
  5243. if(l == 53)
  5244. {
  5245. stream.createFrame(135);
  5246. stream.method431(j);
  5247. stream.method432(k);
  5248. stream.method431(i1);
  5249. atInventoryLoopCycle = 0;
  5250. atInventoryInterface = k;
  5251. atInventoryIndex = j;
  5252. atInventoryInterfaceType = 2;
  5253. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5254. atInventoryInterfaceType = 1;
  5255. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5256. atInventoryInterfaceType = 3;
  5257. }
  5258. if(l == 539)
  5259. {
  5260. stream.createFrame(16);
  5261. stream.method432(i1);
  5262. stream.method433(j);
  5263. stream.method433(k);
  5264. atInventoryLoopCycle = 0;
  5265. atInventoryInterface = k;
  5266. atInventoryIndex = j;
  5267. atInventoryInterfaceType = 2;
  5268. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5269. atInventoryInterfaceType = 1;
  5270. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5271. atInventoryInterfaceType = 3;
  5272. }
  5273. if(l == 927) {
  5274. String s1 = menuActionName[i];
  5275. int l1 = s1.indexOf("@lre@");
  5276. s1 = s1.substring(l1 + 5).trim();
  5277. launchURL(s1);//Launches the URL in a web browser when clicked
  5278. }
  5279. if(l == 484 || l == 6)
  5280. {
  5281. String s1 = menuActionName[i];
  5282. int l1 = s1.indexOf("@whi@");
  5283. if(l1 != -1)
  5284. {
  5285. s1 = s1.substring(l1 + 5).trim();
  5286. String s7 = TextClass.fixName(TextClass.nameForLong(TextClass.longForName(s1)));
  5287. boolean flag9 = false;
  5288. for(int j3 = 0; j3 < playerCount; j3++)
  5289. {
  5290. Player class30_sub2_sub4_sub1_sub2_7 = playerArray[playerIndices[j3]];
  5291. if(class30_sub2_sub4_sub1_sub2_7 == null || class30_sub2_sub4_sub1_sub2_7.name == null || !class30_sub2_sub4_sub1_sub2_7.name.equalsIgnoreCase(s7))
  5292. continue;
  5293. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_7.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_7.smallX[0]);
  5294. if(l == 484)
  5295. {
  5296. stream.createFrame(39);
  5297. stream.method431(playerIndices[j3]);
  5298. }
  5299. if(l == 6)
  5300. {
  5301. anInt1188 += i1;
  5302. if(anInt1188 >= 90)
  5303. {
  5304. stream.createFrame(136);
  5305. anInt1188 = 0;
  5306. }
  5307. stream.createFrame(128);
  5308. stream.writeWord(playerIndices[j3]);
  5309. }
  5310. flag9 = true;
  5311. break;
  5312. }
  5313.  
  5314. if(!flag9)
  5315. pushMessage("Unable to find " + s7, 0, "");
  5316. }
  5317. }
  5318. if(l == 870)
  5319. {
  5320. stream.createFrame(53);
  5321. stream.writeWord(j);
  5322. stream.method432(anInt1283);
  5323. stream.method433(i1);
  5324. stream.writeWord(anInt1284);
  5325. stream.method431(anInt1285);
  5326. stream.writeWord(k);
  5327. atInventoryLoopCycle = 0;
  5328. atInventoryInterface = k;
  5329. atInventoryIndex = j;
  5330. atInventoryInterfaceType = 2;
  5331. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5332. atInventoryInterfaceType = 1;
  5333. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5334. atInventoryInterfaceType = 3;
  5335. }
  5336. if(l == 847)
  5337. {
  5338. stream.createFrame(87);
  5339. stream.method432(i1);
  5340. stream.writeWord(k);
  5341. stream.method432(j);
  5342. atInventoryLoopCycle = 0;
  5343. atInventoryInterface = k;
  5344. atInventoryIndex = j;
  5345. atInventoryInterfaceType = 2;
  5346. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5347. atInventoryInterfaceType = 1;
  5348. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5349. atInventoryInterfaceType = 3;
  5350. }
  5351. if(l == 626)
  5352. {
  5353. RSInterface class9_1 = RSInterface.interfaceCache[k];
  5354. spellSelected = 1;
  5355. spellID = class9_1.id;
  5356. anInt1137 = k;
  5357. spellUsableOn = class9_1.spellUsableOn;
  5358. itemSelected = 0;
  5359. spellID = class9_1.id;
  5360. String s4 = class9_1.selectedActionName;
  5361. if(s4.indexOf(" ") != -1)
  5362. s4 = s4.substring(0, s4.indexOf(" "));
  5363. String s8 = class9_1.selectedActionName;
  5364. if(s8.indexOf(" ") != -1)
  5365. s8 = s8.substring(s8.indexOf(" ") + 1);
  5366. if(s8.equals("on")) s8 = "@whi@->";
  5367. spellTooltip = s4 + " " + "@gre@" + class9_1.spellName + " " + s8;
  5368.  
  5369. //spellTooltip = s4 + " " + class9_1.spellName + " " + s8;
  5370. //class9_1.disabledSprite.drawSprite(class9_1.xOffset, class9_1.yOffset, 0xffffff);
  5371. //class9_1.disabledSprite.drawSprite(200,200);
  5372. //System.out.println("Sprite: " + class9_1.disabledSprite.toString());
  5373. if(spellUsableOn == 16)
  5374. {
  5375. tabID = 3;
  5376. tabAreaAltered = true;
  5377. }
  5378. return;
  5379. }
  5380. if(l == 78)
  5381. {
  5382. stream.createFrame(117);
  5383. stream.method433(k);
  5384. stream.method433(i1);
  5385. stream.method431(j);
  5386. atInventoryLoopCycle = 0;
  5387. atInventoryInterface = k;
  5388. atInventoryIndex = j;
  5389. atInventoryInterfaceType = 2;
  5390. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5391. atInventoryInterfaceType = 1;
  5392. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5393. atInventoryInterfaceType = 3;
  5394. }
  5395. if(l == 27)
  5396. {
  5397. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[i1];
  5398. if(class30_sub2_sub4_sub1_sub2_2 != null)
  5399. {
  5400. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_2.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_2.smallX[0]);
  5401. crossX = super.saveClickX;
  5402. crossY = super.saveClickY;
  5403. crossType = 2;
  5404. crossIndex = 0;
  5405. anInt986 += i1;
  5406. if(anInt986 >= 54)
  5407. {
  5408. stream.createFrame(189);
  5409. stream.writeWordBigEndian(234);
  5410. anInt986 = 0;
  5411. }
  5412. stream.createFrame(73);
  5413. stream.method431(i1);
  5414. }
  5415. }
  5416.  
  5417.  
  5418.  
  5419. if(l == 213)
  5420. {
  5421. boolean flag3 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  5422. if(!flag3)
  5423. flag3 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  5424. crossX = super.saveClickX;
  5425. crossY = super.saveClickY;
  5426. crossType = 2;
  5427. crossIndex = 0;
  5428. stream.createFrame(79);
  5429. stream.method431(k + baseY);
  5430. stream.writeWord(i1);
  5431. stream.method432(j + baseX);
  5432. }
  5433. if(l == 632)
  5434. {
  5435. stream.createFrame(145);
  5436. stream.method432(k);
  5437. stream.method432(j);
  5438. stream.method432(i1);
  5439. atInventoryLoopCycle = 0;
  5440. atInventoryInterface = k;
  5441. atInventoryIndex = j;
  5442. atInventoryInterfaceType = 2;
  5443. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5444. atInventoryInterfaceType = 1;
  5445. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5446. atInventoryInterfaceType = 3;
  5447. }
  5448. if(l == 1005) {
  5449. //launchURL("WM.bat");
  5450. //pushMessage("Loading worldmap.", 0, "");
  5451. stream.createFrame(185);
  5452. stream.writeWord(155);
  5453. }
  5454. if(l == 1004) {
  5455. if(tabInterfaceIDs[10] != -1) {
  5456. tabID = 10;
  5457. tabAreaAltered = true;
  5458. }
  5459. }
  5460. if(l == 1003) {
  5461. clanChatMode = 2;
  5462. inputTaken = true;
  5463. }
  5464. if(l == 1002) {
  5465. clanChatMode = 1;
  5466. inputTaken = true;
  5467. }
  5468. if(l == 1001) {
  5469. clanChatMode = 0;
  5470. inputTaken = true;
  5471. }
  5472. if(l == 1000) {
  5473. cButtonCPos = 4;
  5474. chatTypeView = 11;
  5475. inputTaken = true;
  5476. }
  5477. if(l == 999) {
  5478. cButtonCPos = 0;
  5479. chatTypeView = 0;
  5480. inputTaken = true;
  5481. }
  5482. if(l == 998) {
  5483. cButtonCPos = 1;
  5484. chatTypeView = 5;
  5485. inputTaken = true;
  5486. }
  5487. if(l == 997) {
  5488. publicChatMode = 3;
  5489. inputTaken = true;
  5490. }
  5491. if(l == 996) {
  5492. publicChatMode = 2;
  5493. inputTaken = true;
  5494. }
  5495. if(l == 995) {
  5496. publicChatMode = 1;
  5497. inputTaken = true;
  5498. }
  5499. if(l == 994) {
  5500. publicChatMode = 0;
  5501. inputTaken = true;
  5502. }
  5503. if(l == 993) {
  5504. cButtonCPos = 2;
  5505. chatTypeView = 1;
  5506. inputTaken = true;
  5507. }
  5508. if(l == 992) {
  5509. privateChatMode = 2;
  5510. inputTaken = true;
  5511. }
  5512. if(l == 991) {
  5513. privateChatMode = 1;
  5514. inputTaken = true;
  5515. }
  5516. if(l == 990) {
  5517. privateChatMode = 0;
  5518. inputTaken = true;
  5519. }
  5520. if(l == 989) {
  5521. cButtonCPos = 3;
  5522. chatTypeView = 2;
  5523. inputTaken = true;
  5524. }
  5525. if(l == 987) {
  5526. tradeMode = 2;
  5527. inputTaken = true;
  5528. }
  5529. if(l == 986) {
  5530. tradeMode = 1;
  5531. inputTaken = true;
  5532. }
  5533. if(l == 985) {
  5534. tradeMode = 0;
  5535. inputTaken = true;
  5536. }
  5537. if(l == 984) {
  5538. cButtonCPos = 5;
  5539. chatTypeView = 3;
  5540. inputTaken = true;
  5541. }
  5542. if(l == 983) {
  5543. duelMode = 2;
  5544. inputTaken = true;
  5545. }
  5546. if(l == 982) {
  5547. duelMode = 1;
  5548. inputTaken = true;
  5549. }
  5550. if(l == 981) {
  5551. duelMode = 0;
  5552. inputTaken = true;
  5553. }
  5554. if(l == 980) {
  5555. cButtonCPos = 6;
  5556. chatTypeView = 4;
  5557. inputTaken = true;
  5558. }
  5559. if(l == 493)
  5560. {
  5561. stream.createFrame(75);
  5562. stream.method433(k);
  5563. stream.method431(j);
  5564. stream.method432(i1);
  5565. atInventoryLoopCycle = 0;
  5566. atInventoryInterface = k;
  5567. atInventoryIndex = j;
  5568. atInventoryInterfaceType = 2;
  5569. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5570. atInventoryInterfaceType = 1;
  5571. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5572. atInventoryInterfaceType = 3;
  5573. }
  5574. if(l == 652)
  5575. {
  5576. boolean flag4 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  5577. if(!flag4)
  5578. flag4 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  5579. crossX = super.saveClickX;
  5580. crossY = super.saveClickY;
  5581. crossType = 2;
  5582. crossIndex = 0;
  5583. stream.createFrame(156);
  5584. stream.method432(j + baseX);
  5585. stream.method431(k + baseY);
  5586. stream.method433(i1);
  5587. }
  5588. if(l == 94)
  5589. {
  5590. boolean flag5 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  5591. if(!flag5)
  5592. flag5 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  5593. crossX = super.saveClickX;
  5594. crossY = super.saveClickY;
  5595. crossType = 2;
  5596. crossIndex = 0;
  5597. stream.createFrame(181);
  5598. stream.method431(k + baseY);
  5599. stream.writeWord(i1);
  5600. stream.method431(j + baseX);
  5601. stream.method432(anInt1137);
  5602. }
  5603. if ((l == 646) || ((l >= -9) && (l <= -1))) {
  5604. if ((l >= -9) && (l <= -1))
  5605. executeCommand("::btnzvder " +-l+ " "+ k);
  5606. RSInterface class9_2 = RSInterface.interfaceCache[k];
  5607. if (k == 17252 && l == -2) {
  5608. promptUserForInput(class9_2);
  5609. return;
  5610. }
  5611. stream.createFrame(185);
  5612. stream.writeWord(k);
  5613. if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5)
  5614. {
  5615. int i2 = class9_2.valueIndexArray[0][1];
  5616. if(variousSettings[i2] != class9_2.requiredValues[0])
  5617. {
  5618. variousSettings[i2] = class9_2.requiredValues[0];
  5619. method33(i2);
  5620. }
  5621. }
  5622. }
  5623. if(l == 225)
  5624. {
  5625. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[i1];
  5626. if(class30_sub2_sub4_sub1_sub1_2 != null)
  5627. {
  5628. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_2.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_2.smallX[0]);
  5629. crossX = super.saveClickX;
  5630. crossY = super.saveClickY;
  5631. crossType = 2;
  5632. crossIndex = 0;
  5633. anInt1226 += i1;
  5634. if(anInt1226 >= 85)
  5635. {
  5636. stream.createFrame(230);
  5637. stream.writeWordBigEndian(239);
  5638. anInt1226 = 0;
  5639. }
  5640. stream.createFrame(17);
  5641. stream.method433(i1);
  5642. }
  5643. }
  5644. if(l == 965)
  5645. {
  5646. NPC class30_sub2_sub4_sub1_sub1_3 = npcArray[i1];
  5647. if(class30_sub2_sub4_sub1_sub1_3 != null)
  5648. {
  5649. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_3.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_3.smallX[0]);
  5650. crossX = super.saveClickX;
  5651. crossY = super.saveClickY;
  5652. crossType = 2;
  5653. crossIndex = 0;
  5654. anInt1134++;
  5655. if(anInt1134 >= 96)
  5656. {
  5657. stream.createFrame(152);
  5658. stream.writeWordBigEndian(88);
  5659. anInt1134 = 0;
  5660. }
  5661. stream.createFrame(21);
  5662. stream.writeWord(i1);
  5663. }
  5664. }
  5665. if(l == 413)
  5666. {
  5667. NPC class30_sub2_sub4_sub1_sub1_4 = npcArray[i1];
  5668. if(class30_sub2_sub4_sub1_sub1_4 != null)
  5669. {
  5670. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_4.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_4.smallX[0]);
  5671. crossX = super.saveClickX;
  5672. crossY = super.saveClickY;
  5673. crossType = 2;
  5674. crossIndex = 0;
  5675. stream.createFrame(131);
  5676. stream.method433(i1);
  5677. stream.method432(anInt1137);
  5678. }
  5679. }
  5680. if(l == 200)
  5681. clearTopInterfaces();
  5682. if(l == 1025)
  5683. {
  5684. NPC class30_sub2_sub4_sub1_sub1_5 = npcArray[i1];
  5685. if(class30_sub2_sub4_sub1_sub1_5 != null)
  5686. {
  5687. EntityDef entityDef = class30_sub2_sub4_sub1_sub1_5.desc;
  5688. if(entityDef.childrenIDs != null)
  5689. entityDef = entityDef.method161();
  5690. if(entityDef != null)
  5691. {
  5692. String s9;
  5693. if(entityDef.description != null)
  5694. s9 = new String(entityDef.description);
  5695. else
  5696. s9 = "It's a " + entityDef.name + ".";
  5697. pushMessage(s9, 0, "");
  5698. }
  5699. }
  5700. }
  5701. if(l == 900)
  5702. {
  5703. method66(i1, k, j);
  5704. stream.createFrame(252);
  5705. stream.method433(i1 >> 14 & 0x7fff);
  5706. stream.method431(k + baseY);
  5707. stream.method432(j + baseX);
  5708. }
  5709. if(l == 412)
  5710. {
  5711. NPC class30_sub2_sub4_sub1_sub1_6 = npcArray[i1];
  5712. System.out.println("npcid: "+i1);
  5713. if(class30_sub2_sub4_sub1_sub1_6 != null)
  5714. {
  5715. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_6.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_6.smallX[0]);
  5716. crossX = super.saveClickX;
  5717. crossY = super.saveClickY;
  5718. crossType = 2;
  5719. crossIndex = 0;
  5720. stream.createFrame(72);
  5721. stream.method432(i1);
  5722. }
  5723. }
  5724. if(l == 365)
  5725. {
  5726. Player class30_sub2_sub4_sub1_sub2_3 = playerArray[i1];
  5727. if(class30_sub2_sub4_sub1_sub2_3 != null)
  5728. {
  5729. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_3.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_3.smallX[0]);
  5730. crossX = super.saveClickX;
  5731. crossY = super.saveClickY;
  5732. crossType = 2;
  5733. crossIndex = 0;
  5734. stream.createFrame(249);
  5735. stream.method432(i1);
  5736. stream.method431(anInt1137);
  5737. }
  5738. }
  5739. if(l == 729)
  5740. {
  5741. Player class30_sub2_sub4_sub1_sub2_4 = playerArray[i1];
  5742. if(class30_sub2_sub4_sub1_sub2_4 != null)
  5743. {
  5744. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_4.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_4.smallX[0]);
  5745. crossX = super.saveClickX;
  5746. crossY = super.saveClickY;
  5747. crossType = 2;
  5748. crossIndex = 0;
  5749. stream.createFrame(39);
  5750. stream.method431(i1);
  5751. }
  5752. }
  5753. if(l == 577)
  5754. {
  5755. Player class30_sub2_sub4_sub1_sub2_5 = playerArray[i1];
  5756. if(class30_sub2_sub4_sub1_sub2_5 != null)
  5757. {
  5758. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_5.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_5.smallX[0]);
  5759. crossX = super.saveClickX;
  5760. crossY = super.saveClickY;
  5761. crossType = 2;
  5762. crossIndex = 0;
  5763. stream.createFrame(139);
  5764. stream.method431(i1);
  5765. }
  5766. }
  5767. if(l == 956 && method66(i1, k, j))
  5768. {
  5769. stream.createFrame(35);
  5770. stream.method431(j + baseX);
  5771. stream.method432(anInt1137);
  5772. stream.method432(k + baseY);
  5773. stream.method431(i1 >> 14 & 0x7fff);
  5774. }
  5775. if(l == 567)
  5776. {
  5777. boolean flag6 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  5778. if(!flag6)
  5779. flag6 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  5780. crossX = super.saveClickX;
  5781. crossY = super.saveClickY;
  5782. crossType = 2;
  5783. crossIndex = 0;
  5784. stream.createFrame(23);
  5785. stream.method431(k + baseY);
  5786. stream.method431(i1);
  5787. stream.method431(j + baseX);
  5788. }
  5789. if(l == 867)
  5790. {
  5791. if((i1 & 3) == 0)
  5792. anInt1175++;
  5793. if(anInt1175 >= 59)
  5794. {
  5795. stream.createFrame(200);
  5796. stream.writeWord(25501);
  5797. anInt1175 = 0;
  5798. }
  5799. stream.createFrame(43);
  5800. stream.method431(k);
  5801. stream.method432(i1);
  5802. stream.method432(j);
  5803. atInventoryLoopCycle = 0;
  5804. atInventoryInterface = k;
  5805. atInventoryIndex = j;
  5806. atInventoryInterfaceType = 2;
  5807. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5808. atInventoryInterfaceType = 1;
  5809. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5810. atInventoryInterfaceType = 3;
  5811. }
  5812. if(l == 543)
  5813. {
  5814. stream.createFrame(237);
  5815. stream.writeWord(j);
  5816. stream.method432(i1);
  5817. stream.writeWord(k);
  5818. stream.method432(anInt1137);
  5819. atInventoryLoopCycle = 0;
  5820. atInventoryInterface = k;
  5821. atInventoryIndex = j;
  5822. atInventoryInterfaceType = 2;
  5823. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5824. atInventoryInterfaceType = 1;
  5825. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5826. atInventoryInterfaceType = 3;
  5827. }
  5828. if(l == 606)
  5829. {
  5830. String s2 = menuActionName[i];
  5831. int j2 = s2.indexOf("@whi@");
  5832. if(j2 != -1)
  5833. if(openInterfaceID == -1)
  5834. {
  5835. clearTopInterfaces();
  5836. reportAbuseInput = s2.substring(j2 + 5).trim();
  5837. canMute = false;
  5838. for(int i3 = 0; i3 < RSInterface.interfaceCache.length; i3++)
  5839. {
  5840. if(RSInterface.interfaceCache[i3] == null || RSInterface.interfaceCache[i3].contentType != 600)
  5841. continue;
  5842. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i3].parentID;
  5843. break;
  5844. }
  5845.  
  5846. } else
  5847. {
  5848. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  5849. }
  5850. }
  5851. if(l == 491)
  5852. {
  5853. Player class30_sub2_sub4_sub1_sub2_6 = playerArray[i1];
  5854. if(class30_sub2_sub4_sub1_sub2_6 != null)
  5855. {
  5856. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_6.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_6.smallX[0]);
  5857. crossX = super.saveClickX;
  5858. crossY = super.saveClickY;
  5859. crossType = 2;
  5860. crossIndex = 0;
  5861. stream.createFrame(14);
  5862. stream.method432(anInt1284);
  5863. stream.writeWord(i1);
  5864. stream.writeWord(anInt1285);
  5865. stream.method431(anInt1283);
  5866. }
  5867. }
  5868. if(l == 104) {
  5869. RSInterface class9_1 = RSInterface.interfaceCache[k];
  5870. spellID = class9_1.id;
  5871. if(!Autocast) {
  5872. Autocast = true;
  5873. autocastId = class9_1.id;
  5874. stream.createFrame(185);
  5875. stream.writeWord(class9_1.id);
  5876. } else
  5877. if(autocastId == class9_1.id) {
  5878. Autocast = false;
  5879. autocastId = 0;
  5880. stream.createFrame(185);
  5881. stream.writeWord(class9_1.id);
  5882. } else
  5883. if(autocastId != class9_1.id) {
  5884. Autocast = true;
  5885. autocastId = class9_1.id;
  5886. stream.createFrame(185);
  5887. stream.writeWord(class9_1.id);
  5888. }
  5889. }
  5890. if(l == 639)
  5891. {
  5892. String s3 = menuActionName[i];
  5893. int k2 = s3.indexOf("@whi@");
  5894. if(k2 != -1)
  5895. {
  5896. long l4 = TextClass.longForName(s3.substring(k2 + 5).trim());
  5897. int k3 = -1;
  5898. for(int i4 = 0; i4 < friendsCount; i4++)
  5899. {
  5900. if(friendsListAsLongs[i4] != l4)
  5901. continue;
  5902. k3 = i4;
  5903. break;
  5904. }
  5905.  
  5906. if(k3 != -1 && friendsNodeIDs[k3] > 0)
  5907. {
  5908. inputTaken = true;
  5909. inputDialogState = 0;
  5910. messagePromptRaised = true;
  5911. promptInput = "";
  5912. friendsListAction = 3;
  5913. aLong953 = friendsListAsLongs[k3];
  5914. aString1121 = "Enter message to send to " + friendsList[k3];
  5915. }
  5916. }
  5917. }
  5918. if(l == 454) {
  5919. if (i1 != 15098) {
  5920. try {
  5921. stream.createFrame(41);
  5922. stream.writeWord(i1);
  5923. stream.method432(j);
  5924. stream.method432(k);
  5925. atInventoryLoopCycle = 0;
  5926. atInventoryInterface = k;
  5927. atInventoryIndex = j;
  5928. atInventoryInterfaceType = 2;
  5929. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5930. atInventoryInterfaceType = 1;
  5931. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5932. atInventoryInterfaceType = 3;
  5933. } catch (Exception e) {
  5934. e.printStackTrace();
  5935. }
  5936. } /*else {
  5937. stream.createFrame(41);
  5938. int wearId = stream.writeWord(i1);
  5939. stream.method432(j);
  5940. stream.method432(k);*/
  5941. }
  5942. if(l == 478)
  5943. {
  5944. NPC class30_sub2_sub4_sub1_sub1_7 = npcArray[i1];
  5945. if(class30_sub2_sub4_sub1_sub1_7 != null)
  5946. {
  5947. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_7.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_7.smallX[0]);
  5948. crossX = super.saveClickX;
  5949. crossY = super.saveClickY;
  5950. crossType = 2;
  5951. crossIndex = 0;
  5952. if((i1 & 3) == 0)
  5953. anInt1155++;
  5954. if(anInt1155 >= 53)
  5955. {
  5956. stream.createFrame(85);
  5957. stream.writeWordBigEndian(66);
  5958. anInt1155 = 0;
  5959. }
  5960. stream.createFrame(18);
  5961. stream.method431(i1);
  5962. }
  5963. }
  5964. if(l == 113)
  5965. {
  5966. method66(i1, k, j);
  5967. stream.createFrame(70);
  5968. stream.method431(j + baseX);
  5969. stream.writeWord(k + baseY);
  5970. stream.method433(i1 >> 14 & 0x7fff);
  5971. }
  5972. if(l == 872)
  5973. {
  5974. method66(i1, k, j);
  5975. stream.createFrame(234);
  5976. stream.method433(j + baseX);
  5977. stream.method432(i1 >> 14 & 0x7fff);
  5978. stream.method433(k + baseY);
  5979. }
  5980. if(l == 502)
  5981. {
  5982. method66(i1, k, j);
  5983. stream.createFrame(132);
  5984. stream.method433(j + baseX);
  5985. stream.writeWord(i1 >> 14 & 0x7fff);
  5986. stream.method432(k + baseY);
  5987. }
  5988. if(l == 1125) {
  5989. atInventoryLoopCycle = 0;
  5990. atInventoryInterface = k;
  5991. atInventoryIndex = j;
  5992. atInventoryInterfaceType = 2;
  5993. ItemDef itemDef = ItemDef.forID(i1);
  5994. RSInterface class9_4 = RSInterface.interfaceCache[k];
  5995. String s5;
  5996. if(class9_4 != null && class9_4.inventoryValue[j] >= 0x186a0)
  5997. s5 = class9_4.inventoryValue[j] + " x " + itemDef.name;
  5998. else
  5999. if(itemDef.description != null)
  6000. s5 = new String(itemDef.description);
  6001. else
  6002. s5 = "It's a " + itemDef.name + ".";
  6003. pushMessage(s5, 0, "");
  6004. }
  6005. if(l == 447)
  6006. {
  6007. itemSelected = 1;
  6008. anInt1283 = j;
  6009. anInt1284 = k;
  6010. anInt1285 = i1;
  6011. selectedItemName = ItemDef.forID(i1).name;
  6012. spellSelected = 0;
  6013. return;
  6014. }
  6015. if(l == 1226) {
  6016. int j1 = i1 >> 14 & 0x7fff;
  6017. ObjectDef class46 = ObjectDef.forID(j1);
  6018. String s10;
  6019. if(class46.description != null)
  6020. s10 = new String(class46.description);
  6021. else
  6022. s10 = "It's a " + class46.name + ".";
  6023. pushMessage(s10, 0, "");
  6024. }
  6025. if(l == 244) {
  6026. boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  6027. if(!flag7)
  6028. flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  6029. crossX = super.saveClickX;
  6030. crossY = super.saveClickY;
  6031. crossType = 2;
  6032. crossIndex = 0;
  6033. stream.createFrame(253);
  6034. stream.method431(j + baseX);
  6035. stream.method433(k + baseY);
  6036. stream.method432(i1);
  6037. }
  6038. if(l == 1448) {
  6039. ItemDef itemDef_1 = ItemDef.forID(i1);
  6040. String s6;
  6041. if(itemDef_1.description != null)
  6042. s6 = new String(itemDef_1.description);
  6043. else
  6044. s6 = "It's a " + itemDef_1.name + ".";
  6045. pushMessage(s6, 0, "");
  6046. }
  6047. itemSelected = 0;
  6048. spellSelected = 0;
  6049.  
  6050. }
  6051.  
  6052. private void method70()
  6053. {
  6054. anInt1251 = 0;
  6055. int j = (myPlayer.x >> 7) + baseX;
  6056. int k = (myPlayer.y >> 7) + baseY;
  6057. if(j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
  6058. anInt1251 = 1;
  6059. if(j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
  6060. anInt1251 = 1;
  6061. if(anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
  6062. anInt1251 = 0;
  6063. }
  6064.  
  6065. public void run() {
  6066. if(drawFlames) {
  6067. } else {
  6068. super.run();
  6069. }
  6070. }
  6071.  
  6072. private void build3dScreenMenu() {
  6073. if(itemSelected == 0 && spellSelected == 0) {
  6074. menuActionName[menuActionRow] = "Walk here";
  6075. menuActionID[menuActionRow] = 516;
  6076. menuActionCmd2[menuActionRow] = super.mouseX;
  6077. menuActionCmd3[menuActionRow] = super.mouseY;
  6078. menuActionRow++;
  6079. }
  6080. int j = -1;
  6081. for(int k = 0; k < Model.anInt1687; k++) {
  6082. int l = Model.anIntArray1688[k];
  6083. int i1 = l & 0x7f;
  6084. int j1 = l >> 7 & 0x7f;
  6085. int k1 = l >> 29 & 3;
  6086. int l1 = l >> 14 & 0x7fff;
  6087. if(l == j)
  6088. continue;
  6089. j = l;
  6090. if(k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0)
  6091. {
  6092. ObjectDef class46 = ObjectDef.forID(l1);
  6093. if(class46.childrenIDs != null)
  6094. class46 = class46.method580();
  6095. if(class46 == null)
  6096. continue;
  6097. if(itemSelected == 1) {
  6098. menuActionName[menuActionRow] = "Use " + selectedItemName + " -> @cya@" + class46.name;
  6099. menuActionID[menuActionRow] = 62;
  6100. menuActionCmd1[menuActionRow] = l;
  6101. menuActionCmd2[menuActionRow] = i1;
  6102. menuActionCmd3[menuActionRow] = j1;
  6103. menuActionRow++;
  6104. } else
  6105. if(spellSelected == 1) {
  6106. if((spellUsableOn & 4) == 4) {
  6107. menuActionName[menuActionRow] = spellTooltip + " @cya@" + class46.name;
  6108. menuActionID[menuActionRow] = 956;
  6109. menuActionCmd1[menuActionRow] = l;
  6110. menuActionCmd2[menuActionRow] = i1;
  6111. menuActionCmd3[menuActionRow] = j1;
  6112. menuActionRow++;
  6113. }
  6114. } else
  6115. {
  6116. if(class46.itemActions != null)
  6117. {
  6118. for(int i2 = 4; i2 >= 0; i2--)
  6119. if(class46.itemActions[i2] != null)
  6120. {
  6121. menuActionName[menuActionRow] = class46.itemActions[i2] + " @cya@" + class46.name;
  6122. if(i2 == 0)
  6123. menuActionID[menuActionRow] = 502;
  6124. if(i2 == 1)
  6125. menuActionID[menuActionRow] = 900;
  6126. if(i2 == 2)
  6127. menuActionID[menuActionRow] = 113;
  6128. if(i2 == 3)
  6129. menuActionID[menuActionRow] = 872;
  6130. if(i2 == 4)
  6131. menuActionID[menuActionRow] = 1062;
  6132. menuActionCmd1[menuActionRow] = l;
  6133. menuActionCmd2[menuActionRow] = i1;
  6134. menuActionCmd3[menuActionRow] = j1;
  6135. menuActionRow++;
  6136. }
  6137.  
  6138. }
  6139. if(idToggle == true) {
  6140. menuActionName[menuActionRow] = "Examine @cya@" + class46.name + " @gre@(ID)@whi@" + l1 + "@whi@(Model)@gre@" + class46.anIntArray773[k];
  6141. } else {
  6142. menuActionName[menuActionRow] = "Examine @cya@" + class46.name;
  6143. }
  6144. menuActionID[menuActionRow] = 1226;
  6145. menuActionCmd1[menuActionRow] = class46.type << 14;
  6146. menuActionCmd2[menuActionRow] = i1;
  6147. menuActionCmd3[menuActionRow] = j1;
  6148. menuActionRow++;
  6149. }
  6150. }
  6151. if(k1 == 1)
  6152. {
  6153. NPC npc = npcArray[l1];
  6154. if(npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  6155. {
  6156. for(int j2 = 0; j2 < npcCount; j2++)
  6157. {
  6158. NPC npc2 = npcArray[npcIndices[j2]];
  6159. if (npc2 == null)
  6160. continue;
  6161. if (npc2 != npc && npc2.desc.aByte68 == 1 && npc2.x == npc.x && npc2.y == npc.y)
  6162. buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
  6163. }
  6164.  
  6165. for(int l2 = 0; l2 < playerCount; l2++)
  6166. {
  6167. Player player = playerArray[playerIndices[l2]];
  6168. if(player != null && player.x == npc.x && player.y == npc.y)
  6169. buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
  6170. }
  6171.  
  6172. }
  6173. buildAtNPCMenu(npc.desc, l1, j1, i1);
  6174. }
  6175. if(k1 == 0)
  6176. {
  6177. Player player = playerArray[l1];
  6178. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64)
  6179. {
  6180. for(int k2 = 0; k2 < npcCount; k2++)
  6181. {
  6182. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
  6183. if(class30_sub2_sub4_sub1_sub1_2 == null)
  6184. continue;
  6185. if (class30_sub2_sub4_sub1_sub1_2.desc.aByte68 == 1 && class30_sub2_sub4_sub1_sub1_2.x == player.x && class30_sub2_sub4_sub1_sub1_2.y == player.y)
  6186. buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc, npcIndices[k2], j1, i1);
  6187. }
  6188.  
  6189. for(int i3 = 0; i3 < playerCount; i3++)
  6190. {
  6191. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
  6192. if(class30_sub2_sub4_sub1_sub2_2 != null && class30_sub2_sub4_sub1_sub2_2 != player && class30_sub2_sub4_sub1_sub2_2.x == player.x && class30_sub2_sub4_sub1_sub2_2.y == player.y)
  6193. buildAtPlayerMenu(i1, playerIndices[i3], class30_sub2_sub4_sub1_sub2_2, j1);
  6194. }
  6195.  
  6196. }
  6197. buildAtPlayerMenu(i1, l1, player, j1);
  6198. }
  6199. if(k1 == 3)
  6200. {
  6201. NodeList class19 = groundArray[plane][i1][j1];
  6202. if(class19 != null)
  6203. {
  6204. for(Item item = (Item)class19.getFirst(); item != null; item = (Item)class19.getNext())
  6205. {
  6206. ItemDef itemDef = ItemDef.forID(item.ID);
  6207. if(itemSelected == 1)
  6208. {
  6209. menuActionName[menuActionRow] = "Use " + selectedItemName + " -> @lre@" + itemDef.name;
  6210. menuActionID[menuActionRow] = 511;
  6211. menuActionCmd1[menuActionRow] = item.ID;
  6212. menuActionCmd2[menuActionRow] = i1;
  6213. menuActionCmd3[menuActionRow] = j1;
  6214. menuActionRow++;
  6215. } else
  6216. if(spellSelected == 1)
  6217. {
  6218. if((spellUsableOn & 1) == 1)
  6219. {
  6220. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  6221. menuActionID[menuActionRow] = 94;
  6222. menuActionCmd1[menuActionRow] = item.ID;
  6223. menuActionCmd2[menuActionRow] = i1;
  6224. menuActionCmd3[menuActionRow] = j1;
  6225. menuActionRow++;
  6226. }
  6227. } else
  6228. {
  6229. for(int j3 = 4; j3 >= 0; j3--)
  6230. if(itemDef.groundActions != null && itemDef.groundActions[j3] != null)
  6231. {
  6232. menuActionName[menuActionRow] = itemDef.groundActions[j3] + " @lre@" + itemDef.name;
  6233. if(j3 == 0)
  6234. menuActionID[menuActionRow] = 652;
  6235. if(j3 == 1)
  6236. menuActionID[menuActionRow] = 567;
  6237. if(j3 == 2)
  6238. menuActionID[menuActionRow] = 234;
  6239. if(j3 == 3)
  6240. menuActionID[menuActionRow] = 244;
  6241. if(j3 == 4)
  6242. menuActionID[menuActionRow] = 213;
  6243. menuActionCmd1[menuActionRow] = item.ID;
  6244. menuActionCmd2[menuActionRow] = i1;
  6245. menuActionCmd3[menuActionRow] = j1;
  6246. menuActionRow++;
  6247. } else
  6248. if(j3 == 2)
  6249. {
  6250. menuActionName[menuActionRow] = "Take @lre@" + itemDef.name;
  6251. menuActionID[menuActionRow] = 234;
  6252. menuActionCmd1[menuActionRow] = item.ID;
  6253. menuActionCmd2[menuActionRow] = i1;
  6254. menuActionCmd3[menuActionRow] = j1;
  6255. menuActionRow++;
  6256. }
  6257. if(idToggle == true) {
  6258. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + item.ID + "@gre@)";
  6259. } else {
  6260. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  6261. }
  6262. menuActionID[menuActionRow] = 1448;
  6263. menuActionCmd1[menuActionRow] = item.ID;
  6264. menuActionCmd2[menuActionRow] = i1;
  6265. menuActionCmd3[menuActionRow] = j1;
  6266. menuActionRow++;
  6267. }
  6268. }
  6269.  
  6270. }
  6271. }
  6272. }
  6273. }
  6274.  
  6275. public void cleanUpForQuit()
  6276. {
  6277. signlink.reporterror = false;
  6278. try
  6279. {
  6280. if(socketStream != null)
  6281. socketStream.close();
  6282. System.out.println("Here6");
  6283. }
  6284. catch(Exception _ex) { }
  6285. socketStream = null;
  6286. stopMidi();
  6287. if(mouseDetection != null)
  6288. mouseDetection.running = false;
  6289. mouseDetection = null;
  6290. onDemandFetcher.disable();
  6291. onDemandFetcher = null;
  6292. aStream_834 = null;
  6293. stream = null;
  6294. aStream_847 = null;
  6295. inStream = null;
  6296. anIntArray1234 = null;
  6297. aByteArrayArray1183 = null;
  6298. aByteArrayArray1247 = null;
  6299. anIntArray1235 = null;
  6300. anIntArray1236 = null;
  6301. intGroundArray = null;
  6302. byteGroundArray = null;
  6303. worldController = null;
  6304. aClass11Array1230 = null;
  6305. anIntArrayArray901 = null;
  6306. anIntArrayArray825 = null;
  6307. bigX = null;
  6308. bigY = null;
  6309. aByteArray912 = null;
  6310. inventoryBackImage = null;
  6311. leftFrame = null;
  6312. topFrame = null;
  6313. mapBackImage = null;
  6314. main3DArea = null;
  6315. chatBackImage = null;
  6316. aRSImageProducer_1125 = null;
  6317.  
  6318. /* Null pointers for custom sprites */
  6319. chatArea = null;
  6320. loadingPleaseWait = null;
  6321. reestablish = null;
  6322. loadingBarFull = null;
  6323. loadingBarEmpty = null;
  6324. chatButtons = null;
  6325. tabArea = null;
  6326. HPBarFull = null;
  6327. HPBarEmpty = null;
  6328. magicAuto = null;
  6329. tabHover = null;
  6330. tabClicked = null;
  6331. newSideIcons = null;
  6332. /**/
  6333. mapBack = null;
  6334. CustomMapback = null;
  6335.  
  6336. sideIcons = null;
  6337. sIcons483 = null;
  6338. sIcons459 = null;
  6339.  
  6340. redStones = null;
  6341. compass = null;
  6342. hitMarks = null;
  6343. hitMark = null;
  6344. //block = null;
  6345. headIcons = null;
  6346. skullIcons = null;
  6347. headIconsHint = null;
  6348. crosses = null;
  6349. mapDotItem = null;
  6350. mapDotNPC = null;
  6351. mapDotPlayer = null;
  6352. mapDotFriend = null;
  6353. mapDotTeam = null;
  6354. mapScenes = null;
  6355. mapFunctions = null;
  6356. anIntArrayArray929 = null;
  6357. playerArray = null;
  6358. playerIndices = null;
  6359. anIntArray894 = null;
  6360. aStreamArray895s = null;
  6361. anIntArray840 = null;
  6362. npcArray = null;
  6363. npcIndices = null;
  6364. groundArray = null;
  6365. aClass19_1179 = null;
  6366. aClass19_1013 = null;
  6367. aClass19_1056 = null;
  6368. menuActionCmd2 = null;
  6369. menuActionCmd3 = null;
  6370. menuActionID = null;
  6371. menuActionCmd1 = null;
  6372. menuActionName = null;
  6373. variousSettings = null;
  6374. anIntArray1072 = null;
  6375. anIntArray1073 = null;
  6376. aSpriteArray1140 = null;
  6377. aSprite_1263 = null;
  6378. friendsList = null;
  6379. friendsListAsLongs = null;
  6380. friendsNodeIDs = null;
  6381. //leftSideFlame = null;
  6382. //rightSideFlame = null;
  6383. aRSImageProducer_1107 = null;
  6384. loginScreenArea = null;
  6385. multiOverlay = null;
  6386. nullLoader();
  6387. ObjectDef.nullLoader();
  6388. EntityDef.nullLoader();
  6389. ItemDef.nullLoader();
  6390. Flo.cache = null;
  6391. IdentityKit.cache = null;
  6392. RSInterface.interfaceCache = null;
  6393. DummyClass.cache = null;
  6394. Animation.anims = null;
  6395. SpotAnim.cache = null;
  6396. SpotAnim.aMRUNodes_415 = null;
  6397. Varp.cache = null;
  6398. super.fullGameScreen = null;
  6399. Player.mruNodes = null;
  6400. Texture.nullLoader();
  6401. WorldController.nullLoader();
  6402. Model.nullLoader();
  6403. AnimFrame.nullLoader();
  6404. System.gc();
  6405. }
  6406.  
  6407. private void printDebug()
  6408. {
  6409. System.out.println("============");
  6410. System.out.println("flame-cycle:" + anInt1208);
  6411. if(onDemandFetcher != null)
  6412. System.out.println("Od-cycle:" + onDemandFetcher.onDemandCycle);
  6413. System.out.println("loop-cycle:" + loopCycle);
  6414. System.out.println("draw-cycle:" + anInt1061);
  6415. System.out.println("ptype:" + pktType);
  6416. System.out.println("psize:" + pktSize);
  6417. if(socketStream != null)
  6418. socketStream.printDebug();
  6419. super.shouldDebug = true;
  6420. }
  6421.  
  6422. Component getGameComponent() {
  6423. if(signlink.mainapp != null)
  6424. return signlink.mainapp;
  6425. if(super.gameFrame != null)
  6426. return super.gameFrame;
  6427. else
  6428. return this;
  6429. }
  6430.  
  6431. private void method73() {
  6432. do {
  6433. int j = readChar(-796);
  6434. if(j == -1)
  6435. break;
  6436. if(openInterfaceID != -1 && openInterfaceID == reportAbuseInterfaceID) {
  6437. if(j == 8 && reportAbuseInput.length() > 0)
  6438. reportAbuseInput = reportAbuseInput.substring(0, reportAbuseInput.length() - 1);
  6439. if((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48 && j <= 57 || j == 32) && reportAbuseInput.length() < 12)
  6440. reportAbuseInput += (char)j;
  6441. } else if(messagePromptRaised) {
  6442. if(j >= 32 && j <= 122 && promptInput.length() < 80) {
  6443. promptInput += (char)j;
  6444. inputTaken = true;
  6445. }
  6446. if(j == 8 && promptInput.length() > 0) {
  6447. promptInput = promptInput.substring(0, promptInput.length() - 1);
  6448. inputTaken = true;
  6449. }
  6450. if(j == 13 || j == 10) {
  6451. messagePromptRaised = false;
  6452. inputTaken = true;
  6453. if(friendsListAction == 1) {
  6454. long l = TextClass.longForName(promptInput);
  6455. addFriend(l);
  6456. }
  6457. if(friendsListAction == 2 && friendsCount > 0) {
  6458. long l1 = TextClass.longForName(promptInput);
  6459. delFriend(l1);
  6460. }
  6461. if(interfaceButtonAction == 557 && promptInput.length() > 0) {
  6462. inputString = "::withdraw "+promptInput;
  6463. sendPacket(103);
  6464. if (amountOrNameInput.toLowerCase().contains("k")) {
  6465. amountOrNameInput = amountOrNameInput.replaceAll("k", "000");
  6466. } else if (amountOrNameInput.toLowerCase().contains("m")) {
  6467. amountOrNameInput = amountOrNameInput.replaceAll("m", "000000");
  6468. } else if (amountOrNameInput.toLowerCase().contains("b")) {
  6469. amountOrNameInput = amountOrNameInput.replaceAll("b", "000000000");
  6470. }
  6471. }
  6472. if(friendsListAction == 3 && promptInput.length() > 0) {
  6473. stream.createFrame(126);
  6474. stream.writeWordBigEndian(0);
  6475. int k = stream.currentOffset;
  6476. stream.writeQWord(aLong953);
  6477. TextInput.method526(promptInput, stream);
  6478. stream.writeBytes(stream.currentOffset - k);
  6479. promptInput = TextInput.processText(promptInput);
  6480. //promptInput = Censor.doCensor(promptInput);
  6481. pushMessage(promptInput, 6, TextClass.fixName(TextClass.nameForLong(aLong953)));
  6482. if(privateChatMode == 2) {
  6483. privateChatMode = 1;
  6484. stream.createFrame(95);
  6485. stream.writeWordBigEndian(publicChatMode);
  6486. stream.writeWordBigEndian(privateChatMode);
  6487. stream.writeWordBigEndian(tradeMode);
  6488. }
  6489. }
  6490. if(friendsListAction == 4 && ignoreCount < 100) {
  6491. long l2 = TextClass.longForName(promptInput);
  6492. addIgnore(l2);
  6493. }
  6494. if(friendsListAction == 5 && ignoreCount > 0) {
  6495. long l3 = TextClass.longForName(promptInput);
  6496. delIgnore(l3);
  6497. }
  6498. if(friendsListAction == 6) {
  6499. long l3 = TextClass.longForName(promptInput);
  6500. chatJoin(l3);
  6501. }
  6502. if(friendsListAction == 7) {
  6503. long l3 = TextClass.longForName(promptInput);
  6504. executeCommand("::btmder " +l3);
  6505. if(j >= 48 && j <= 57 && amountOrNameInput.length() < 10) {
  6506. amountOrNameInput += (char) j;
  6507. inputTaken = true;
  6508. }
  6509. if ((!amountOrNameInput.toLowerCase().contains("k") && !amountOrNameInput.toLowerCase().contains("m") && !amountOrNameInput.toLowerCase().contains("b")) && (j == 107 || j == 109) || j == 98) {
  6510. amountOrNameInput += (char) j;
  6511. inputTaken = true;
  6512. }
  6513. if(j == 8 && amountOrNameInput.length() > 0) {
  6514. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  6515. inputTaken = true;
  6516. }
  6517. if(j == 13 || j == 10) {
  6518. if(amountOrNameInput.length() > 0) {
  6519. int inputAmount = 0;
  6520. if (amountOrNameInput.toLowerCase().contains("k")) {
  6521. amountOrNameInput = amountOrNameInput.replaceAll("k", "000");
  6522. } else if (amountOrNameInput.toLowerCase().contains("m")) {
  6523. amountOrNameInput = amountOrNameInput.replaceAll("m", "000000");
  6524. } else if (amountOrNameInput.toLowerCase().contains("b")) {
  6525. amountOrNameInput = amountOrNameInput.replaceAll("b", "000000000");
  6526. }
  6527. try {
  6528. inputAmount = Integer.parseInt(amountOrNameInput);
  6529. }
  6530. catch(Exception _ex) { }
  6531. stream.createFrame(208);
  6532. stream.writeDWord(inputAmount);
  6533. }
  6534. inputDialogState = 0;
  6535. inputTaken = true;
  6536. }
  6537. }
  6538. }
  6539. } else if(inputDialogState == 1) {
  6540. if(j >= 48 && j <= 57 && amountOrNameInput.length() < 10) {
  6541. amountOrNameInput += (char) j;
  6542. inputTaken = true;
  6543. }
  6544. if ((!amountOrNameInput.toLowerCase().contains("k") && !amountOrNameInput.toLowerCase().contains("m") && !amountOrNameInput.toLowerCase().contains("b")) && (j == 107 || j == 109) || j == 98) {
  6545. amountOrNameInput += (char) j;
  6546. inputTaken = true;
  6547. }
  6548. if(j == 8 && amountOrNameInput.length() > 0) {
  6549. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  6550. inputTaken = true;
  6551. }
  6552. if(j == 13 || j == 10) {
  6553. if(amountOrNameInput.length() > 0) {
  6554. int inputAmount = 0;
  6555. if (amountOrNameInput.toLowerCase().contains("k")) {
  6556. amountOrNameInput = amountOrNameInput.replaceAll("k", "000");
  6557. } else if (amountOrNameInput.toLowerCase().contains("m")) {
  6558. amountOrNameInput = amountOrNameInput.replaceAll("m", "000000");
  6559. } else if (amountOrNameInput.toLowerCase().contains("b")) {
  6560. amountOrNameInput = amountOrNameInput.replaceAll("b", "000000000");
  6561. }
  6562. try {
  6563. inputAmount = Integer.parseInt(amountOrNameInput);
  6564. }
  6565. catch(Exception _ex) { }
  6566. stream.createFrame(208);
  6567. stream.writeDWord(inputAmount);
  6568. }
  6569. inputDialogState = 0;
  6570. inputTaken = true;
  6571. }
  6572. } else if(inputDialogState == 2) {
  6573. if(j >= 32 && j <= 122 && amountOrNameInput.length() < 12) {
  6574. amountOrNameInput += (char)j;
  6575. inputTaken = true;
  6576. }
  6577. if(j == 8 && amountOrNameInput.length() > 0) {
  6578. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  6579. inputTaken = true;
  6580. }
  6581. if(j == 13 || j == 10) {
  6582. if(amountOrNameInput.length() > 0) {
  6583. stream.createFrame(60);
  6584. stream.writeQWord(TextClass.longForName(amountOrNameInput));
  6585. }
  6586. inputDialogState = 0;
  6587. inputTaken = true;
  6588. }
  6589. } else if(backDialogID == -1) {
  6590. if(j >= 32 && j <= 122 && inputString.length() < 80) {
  6591. inputString += (char)j;
  6592. inputTaken = true;
  6593. }
  6594. if(j == 8 && inputString.length() > 0) {
  6595. inputString = inputString.substring(0, inputString.length() - 1);
  6596. inputTaken = true;
  6597. }
  6598. if((j == 13 || j == 10) && inputString.length() > 0)
  6599. {
  6600. //if(myPrivilege == 2) {
  6601. // if(inputString.equals("::donate")){
  6602. // launchURL("http://www.lrv3.info/index.php");
  6603. // }
  6604. // if(inputString.equals("::vote4cash")) {
  6605. // launchURL("http://www.lrv3.info/index.php");
  6606. // }
  6607. // if(inputString.equals("::vote")) {
  6608. // launchURL("http://www.lrv3.info/index.php");
  6609. // }
  6610. // if(inputString.equals("::forums") || inputString.equals("::forum") || inputString.equals("::register")) {
  6611. // launchURL("http://www.lrv3.info/index.php");
  6612. //}
  6613. // if(inputString.equals("::website")) {
  6614. // launchURL("http://www.lrv3.info/index.php");
  6615. //}
  6616. //}
  6617.  
  6618.  
  6619. if(inputString.startsWith("::modelsitem"))
  6620. pushMessage(ItemDef.itemModels(Integer.parseInt(inputString.substring(13))), 0, "");
  6621.  
  6622. if(inputString.startsWith("::")) {
  6623. if(inputString.equals("::newhits") && newDamage == false) {
  6624. newDamage = true;
  6625. } else if(inputString.equals("::newhits") && newDamage == true) {
  6626. newDamage = false;
  6627. }
  6628. if (inputString.startsWith("full")) {
  6629. try {
  6630. String[] args = inputString.split(" ");
  6631. int id1 = Integer.parseInt(args[1]);
  6632. int id2 = Integer.parseInt(args[2]);
  6633. fullscreenInterfaceID = id1;
  6634. openInterfaceID = id2;
  6635. pushMessage("Opened Interface", 0, "");
  6636. } catch (Exception e) {
  6637. pushMessage("Interface Failed to load", 0, "");
  6638. }
  6639. }
  6640. if(inputString.startsWith("::item")){
  6641.  
  6642. try {
  6643.  
  6644. String[] args = inputString.split(" ");
  6645.  
  6646. int itemID = Integer.parseInt(args[1]);
  6647.  
  6648. stream.createFrame(129);
  6649.  
  6650. stream.method432(10);
  6651.  
  6652. stream.writeWord(3322);
  6653.  
  6654. stream.method432(itemID);
  6655.  
  6656. System.out.println("Added: "+itemID);
  6657.  
  6658. } catch (Exception e) { }
  6659.  
  6660. }
  6661. if(inputString.equals("::lag"))
  6662. printDebug();
  6663. if(inputString.equals("::fpson"))
  6664. fpsOn = true;
  6665. if(inputString.equals("::fpsoff"))
  6666. fpsOn = false;
  6667. if(inputString.equals("::dataon"))
  6668. clientData = true;
  6669. if(inputString.equals("::switchis"))
  6670. switchToFullScreen();
  6671. if(inputString.equals("::dataoff"))
  6672. clientData = false;
  6673. if(inputString.equals("::noclip")) {
  6674. for(int k1 = 0; k1 < 4; k1++) {
  6675. for(int i2 = 1; i2 < 103; i2++) {
  6676. for(int k2 = 1; k2 < 103; k2++)
  6677. aClass11Array1230[k1].anIntArrayArray294[i2][k2] = 0;
  6678.  
  6679. }
  6680. }
  6681. }
  6682. }
  6683. if(inputString.startsWith("/"))
  6684. inputString = "::" + inputString;
  6685. if(inputString.startsWith("/"))
  6686. inputString = "::" + inputString;
  6687. if(inputString.startsWith("::")) {
  6688. stream.createFrame(103);
  6689. stream.writeWordBigEndian(inputString.length() - 1);
  6690. stream.writeString(inputString.substring(2));
  6691. } else {
  6692. String s = inputString.toLowerCase();
  6693. int j2 = 0;
  6694. if(s.startsWith("yellow:"))
  6695. {
  6696. j2 = 0;
  6697. inputString = inputString.substring(7);
  6698. } else if(s.startsWith("red:"))
  6699. {
  6700. j2 = 1;
  6701. inputString = inputString.substring(4);
  6702. } else if(s.startsWith("green:"))
  6703. {
  6704. j2 = 2;
  6705. inputString = inputString.substring(6);
  6706. } else if(s.startsWith("cyan:"))
  6707. {
  6708. j2 = 3;
  6709. inputString = inputString.substring(5);
  6710. } else if(s.startsWith("purple:"))
  6711. {
  6712. j2 = 4;
  6713. inputString = inputString.substring(7);
  6714. } else if(s.startsWith("white:"))
  6715. {
  6716. j2 = 5;
  6717. inputString = inputString.substring(6);
  6718. } else if(s.startsWith("flash1:"))
  6719. {
  6720. j2 = 6;
  6721. inputString = inputString.substring(7);
  6722. } else if(s.startsWith("flash2:"))
  6723. {
  6724. j2 = 7;
  6725. inputString = inputString.substring(7);
  6726. } else if(s.startsWith("flash3:"))
  6727. {
  6728. j2 = 8;
  6729. inputString = inputString.substring(7);
  6730. } else if(s.startsWith("glow1:"))
  6731. {
  6732. j2 = 9;
  6733. inputString = inputString.substring(6);
  6734. } else if(s.startsWith("glow2:"))
  6735. {
  6736. j2 = 10;
  6737. inputString = inputString.substring(6);
  6738. } else if(s.startsWith("glow3:"))
  6739. {
  6740. j2 = 11;
  6741. inputString = inputString.substring(6);
  6742. }
  6743. s = inputString.toLowerCase();
  6744. int i3 = 0;
  6745. if(s.startsWith("wave:"))
  6746. {
  6747. i3 = 1;
  6748. inputString = inputString.substring(5);
  6749. } else if(s.startsWith("wave2:"))
  6750. {
  6751. i3 = 2;
  6752. inputString = inputString.substring(6);
  6753. } else if(s.startsWith("shake:"))
  6754. {
  6755. i3 = 3;
  6756. inputString = inputString.substring(6);
  6757. } else if(s.startsWith("scroll:"))
  6758. {
  6759. i3 = 4;
  6760. inputString = inputString.substring(7);
  6761. } else if(s.startsWith("slide:"))
  6762. {
  6763. i3 = 5;
  6764. inputString = inputString.substring(6);
  6765. }
  6766. stream.createFrame(4);
  6767. stream.writeWordBigEndian(0);
  6768. int j3 = stream.currentOffset;
  6769. stream.method425(i3);
  6770. stream.method425(j2);
  6771. aStream_834.currentOffset = 0;
  6772. TextInput.method526(inputString, aStream_834);
  6773. stream.method441(0, aStream_834.buffer, aStream_834.currentOffset);
  6774. stream.writeBytes(stream.currentOffset - j3);
  6775. inputString = TextInput.processText(inputString);
  6776. myPlayer.textSpoken = inputString;
  6777. myPlayer.anInt1513 = j2;
  6778. myPlayer.anInt1531 = i3;
  6779. myPlayer.textCycle = 150;
  6780. //My players icons showing up when I speak
  6781. if (myPrivilege == 7) {
  6782. pushMessage(myPlayer.textSpoken, 2, "@cr0@" + "<col=13132800>"+loyaltyRank(myPlayer.loyaltyRank)+"</col>" + myPlayer.name);
  6783. } else if (myPrivilege == 8) {
  6784. pushMessage(myPlayer.textSpoken, 2, "<img=3>" + "<col=13132800>"+loyaltyRank(myPlayer.loyaltyRank)+"</col>" + myPlayer.name);
  6785. } else if(myPrivilege == 6) {
  6786. pushMessage(myPlayer.textSpoken, 2, "@cr6@" + "<col=13132800>"+loyaltyRank(myPlayer.loyaltyRank)+"</col>" + myPlayer.name);
  6787. } else if(myPrivilege == 5) {
  6788. pushMessage(myPlayer.textSpoken, 2, "@cr5@" + "<col=13132800>"+loyaltyRank(myPlayer.loyaltyRank)+"</col>" + myPlayer.name);
  6789. } else if(myPrivilege == 4) {
  6790. pushMessage(myPlayer.textSpoken, 2, "@cr4@" + "<col=13132800>"+loyaltyRank(myPlayer.loyaltyRank)+"</col>" + myPlayer.name);
  6791. } else if(myPrivilege == 3) {
  6792. pushMessage(myPlayer.textSpoken, 2, "@cr2@" + "<col=13132800>"+loyaltyRank(myPlayer.loyaltyRank)+"</col>" + myPlayer.name);
  6793. } else if(myPrivilege == 2) {
  6794. pushMessage(myPlayer.textSpoken, 2, "@cr2@" + "<col=13132800>"+loyaltyRank(myPlayer.loyaltyRank)+"</col>" + myPlayer.name);
  6795. } else if(myPrivilege == 1) {
  6796. pushMessage(myPlayer.textSpoken, 2, "@cr1@" + "<col=13132800>"+loyaltyRank(myPlayer.loyaltyRank)+"</col>" + myPlayer.name);
  6797. } else {
  6798. pushMessage(myPlayer.textSpoken, 2, "<col=13132800>"+loyaltyRank(myPlayer.loyaltyRank)+"</col>" + myPlayer.name);
  6799. }
  6800. if(publicChatMode == 2)
  6801. {
  6802. publicChatMode = 3;
  6803. stream.createFrame(95);
  6804. stream.writeWordBigEndian(publicChatMode);
  6805. stream.writeWordBigEndian(privateChatMode);
  6806. stream.writeWordBigEndian(tradeMode);
  6807. }
  6808. }
  6809. inputString = "";
  6810. inputTaken = true;
  6811. }
  6812. }
  6813. } while(true);
  6814. }
  6815.  
  6816. private void executeCommand(String command) {
  6817. stream.createFrame(103);
  6818. stream.writeWordBigEndian(command.length() - 1);
  6819. stream.writeString(command.substring(2));
  6820. }
  6821.  
  6822. private void buildPublicChat(int j) {
  6823. int l = 0;
  6824. for(int i1 = 0; i1 < 500; i1++)
  6825. {
  6826. if(chatMessages[i1] == null)
  6827. continue;
  6828. if(chatTypeView != 1)
  6829. continue;
  6830. int j1 = chatTypes[i1];
  6831. if (j1 == 16)
  6832. continue;
  6833. String s = chatNames[i1];
  6834. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6835. if(k1 < -23)
  6836. break;
  6837. for (byte is = 0; is < 7; is++) {
  6838. if(s != null && s.startsWith("@cr"+is+"@")) {
  6839. s = s.substring(5);
  6840. }
  6841. }
  6842. s = s.replaceAll("<col=(.*)?>(.*)</col>", "");
  6843. if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  6844. if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  6845. if(myPrivilege >= 1) {
  6846. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  6847. menuActionID[menuActionRow] = 606;
  6848. menuActionRow++;
  6849. }
  6850. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6851. menuActionID[menuActionRow] = 42;
  6852. menuActionRow++;
  6853. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6854. menuActionID[menuActionRow] = 337;
  6855. menuActionRow++;
  6856. }
  6857. l++;
  6858. }
  6859. }
  6860. }
  6861.  
  6862. private void buildFriendChat(int j)
  6863. {
  6864. int l = 0;
  6865. for(int i1 = 0; i1 < 500; i1++) {
  6866. if(chatMessages[i1] == null)
  6867. continue;
  6868. if(chatTypeView != 2)
  6869. continue;
  6870. int j1 = chatTypes[i1];
  6871. String s = chatNames[i1];
  6872. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6873. if(k1 < -23)
  6874. break;
  6875. for (byte is = 0; is < 7; is++) {
  6876. if(s != null && s.startsWith("@cr"+is+"@")) {
  6877. s = s.substring(5);
  6878. }
  6879. }
  6880. s = s.replaceAll("<col=(.*)?>(.*)</col>", "");
  6881. if((j1 == 5 || j1 == 6) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 6 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  6882. l++;
  6883. if((j1 == 3 || j1 == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  6884. {
  6885. if(j > k1 - 14 && j <= k1) {
  6886. if(myPrivilege >= 1) {
  6887. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  6888. menuActionID[menuActionRow] = 606;
  6889. menuActionRow++;
  6890. }
  6891. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6892. menuActionID[menuActionRow] = 42;
  6893. menuActionRow++;
  6894. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6895. menuActionID[menuActionRow] = 337;
  6896. menuActionRow++;
  6897. }
  6898. l++;
  6899. }
  6900. }
  6901. }
  6902.  
  6903. private void buildDuelorTrade(int j) {
  6904. int l = 0;
  6905. for(int i1 = 0; i1 < 500; i1++) {
  6906. if(chatMessages[i1] == null)
  6907. continue;
  6908. if(chatTypeView != 3 && chatTypeView != 4)
  6909. continue;
  6910. int j1 = chatTypes[i1];
  6911. String s = chatNames[i1];
  6912. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6913. if(k1 < -23)
  6914. break;
  6915. for (byte is = 0; is < 7; is++) {
  6916. if(s != null && s.startsWith("@cr"+is+"@")) {
  6917. s = s.substring(5);
  6918. }
  6919. }
  6920. if(chatTypeView == 3 && j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6921. if(j > k1 - 14 && j <= k1) {
  6922. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  6923. menuActionID[menuActionRow] = 484;
  6924. menuActionRow++;
  6925. }
  6926. l++;
  6927. }
  6928. if(chatTypeView == 4 && j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6929. if(j > k1 - 14 && j <= k1) {
  6930. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  6931. menuActionID[menuActionRow] = 6;
  6932. menuActionRow++;
  6933. }
  6934. l++;
  6935. }
  6936. if(j1 == 12) {
  6937. if(j > k1 - 14 && j <= k1) {
  6938. menuActionName[menuActionRow] = "Go-to @cya@" + s;
  6939. menuActionID[menuActionRow] = 915;
  6940. menuActionRow++;
  6941. }
  6942. l++;
  6943. }
  6944. }
  6945. }
  6946.  
  6947. private void buildChatAreaMenu(int j) {
  6948. int l = 0;
  6949. for(int i1 = 0; i1 < 500; i1++) {
  6950. if(chatMessages[i1] == null)
  6951. continue;
  6952. int j1 = chatTypes[i1];
  6953. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6954. if(k1 < -23)
  6955. break;
  6956. String s = chatNames[i1];
  6957. if(chatTypeView == 1) {
  6958. buildPublicChat(j);
  6959. break;
  6960. }
  6961. if(chatTypeView == 2) {
  6962. buildFriendChat(j);
  6963. break;
  6964. }
  6965. if(chatTypeView == 3 || chatTypeView == 4) {
  6966. buildDuelorTrade(j);
  6967. break;
  6968. }
  6969. if(chatTypeView == 5) {
  6970. break;
  6971. }
  6972. for (byte is = 0; is < 7; is++) {
  6973. if(s != null && s.startsWith("@cr"+is+"@")) {
  6974. s = s.substring(5);
  6975. }
  6976. }
  6977. if(j1 == 0)
  6978. l++;
  6979. s = s.replaceAll("<col=(.*)?>(.*)</col>", "");
  6980. if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  6981. if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  6982. if(myPrivilege >= 1) {
  6983. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  6984. menuActionID[menuActionRow] = 606;
  6985. menuActionRow++;
  6986. }
  6987. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6988. menuActionID[menuActionRow] = 42;
  6989. menuActionRow++;
  6990. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6991. menuActionID[menuActionRow] = 337;
  6992. menuActionRow++;
  6993. }
  6994. l++;
  6995. }
  6996. if((j1 == 3 || j1 == 7) && splitPrivateChat == 0 && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  6997. if(j > k1 - 14 && j <= k1) {
  6998. if(myPrivilege >= 1) {
  6999. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  7000. menuActionID[menuActionRow] = 606;
  7001. menuActionRow++;
  7002. }
  7003. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  7004. menuActionID[menuActionRow] = 42;
  7005. menuActionRow++;
  7006. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  7007. menuActionID[menuActionRow] = 337;
  7008. menuActionRow++;
  7009. }
  7010. l++;
  7011. }
  7012. if(j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  7013. if(j > k1 - 14 && j <= k1) {
  7014. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  7015. menuActionID[menuActionRow] = 484;
  7016. menuActionRow++;
  7017. }
  7018. l++;
  7019. }
  7020. if((j1 == 5 || j1 == 6) && splitPrivateChat == 0 && privateChatMode < 2)
  7021. l++;
  7022. if(j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  7023. if(j > k1 - 14 && j <= k1) {
  7024. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  7025. menuActionID[menuActionRow] = 6;
  7026. menuActionRow++;
  7027. }
  7028. l++;
  7029. }
  7030. if(j1 == 9) {
  7031. if(j > k1 - 14 && j <= k1) {
  7032. menuActionName[menuActionRow] = "Go-to @cya@" + s;
  7033. menuActionID[menuActionRow] = 927;
  7034. menuActionRow++;
  7035. }
  7036. l++;
  7037. }
  7038. if(j1 == 10) {
  7039. if(j > k1 - 14 && j <= k1) {
  7040. menuActionName[menuActionRow] = s;
  7041. menuActionID[menuActionRow] = 1090;
  7042. menuActionRow++;
  7043. }
  7044. l++;
  7045. }
  7046. }
  7047.  
  7048. }
  7049.  
  7050.  
  7051.  
  7052. private void drawFriendsListOrWelcomeScreen(RSInterface class9)
  7053. {
  7054. int j = class9.contentType;
  7055. int id = class9.id;
  7056. if(id == 31113) {
  7057. if(maxStats[0] < 99){
  7058. class9.disabledMessage = "Attack: "+currentStats[0]+"/"+maxStats[0]+"\nCurrent XP: "+currentExp[0]+"\nNext level: "+getXPForLevel(maxStats[0]+1)+"\nRemainder: "+(getXPForLevel(maxStats[0]+1) - currentExp[0]);
  7059. return;
  7060. } else {
  7061. class9.disabledMessage = "Attack: "+currentStats[0]+"/"+maxStats[0]+"\nExperience: "+currentExp[0];
  7062. return;
  7063. }
  7064. }
  7065. if(id == 31158) {
  7066. if(maxStats[3] < 99){
  7067. class9.disabledMessage = "Hitpoints: "+currentStats[3]+"/"+maxStats[3]+"\nCurrent XP: "+currentExp[3]+"\nNext level: "+getXPForLevel(maxStats[3]+1)+"\nRemainder: "+(getXPForLevel(maxStats[3]+1) - currentExp[3]);
  7068. return;
  7069. } else {
  7070. class9.disabledMessage = "Hitpoints: "+currentStats[3]+"/"+maxStats[3]+"\nExperience: "+currentExp[3];
  7071. return;
  7072. }
  7073. }
  7074. if(id == 31203) {
  7075. if(maxStats[14] < 99){
  7076. class9.disabledMessage = "Mining: "+currentStats[14]+"/"+maxStats[14]+"\nCurrent XP: "+currentExp[14]+"\nNext level: "+getXPForLevel(maxStats[14]+1)+"\nRemainder: "+(getXPForLevel(maxStats[14]+1) - currentExp[14]);
  7077. return;
  7078. } else {
  7079. class9.disabledMessage = "Mining: "+currentStats[14]+"/"+maxStats[14]+"\nExperience: "+currentExp[14];
  7080. return;
  7081. }
  7082. }
  7083. if(id == 31118){
  7084. if(maxStats[2] < 99){
  7085. class9.disabledMessage = "Strength: "+currentStats[2]+"/"+maxStats[2]+"\nCurrent XP: "+currentExp[2]+"\nNext level: "+getXPForLevel(maxStats[2]+1)+"\nRemainder: "+(getXPForLevel(maxStats[2]+1) - currentExp[2]);
  7086. return;
  7087. } else {
  7088. class9.disabledMessage = "Strength: "+currentStats[2]+"/"+maxStats[2]+"\nExperience: "+currentExp[2];
  7089. return;
  7090. }
  7091. }
  7092. if(id == 31163){
  7093. if(maxStats[16] < 99){
  7094. class9.disabledMessage = "Agility: "+currentStats[16]+"/"+maxStats[16]+"\nCurrent XP: "+currentExp[16]+"\nNext level: "+getXPForLevel(maxStats[16]+1)+"\nRemainder: "+(getXPForLevel(maxStats[16]+1) - currentExp[16]);
  7095. return;
  7096. } else {
  7097. class9.disabledMessage = "Agility: "+currentStats[16]+"/"+maxStats[16]+"\nExperience: "+currentExp[16];
  7098. return;
  7099. }
  7100. }
  7101. if(id == 31208){
  7102. if(maxStats[13] < 99){
  7103. class9.disabledMessage = "Smithing: "+currentStats[13]+"/"+maxStats[13]+"\nCurrent XP: "+currentExp[13]+"\nNext level: "+getXPForLevel(maxStats[13]+1)+"\nRemainder: "+(getXPForLevel(maxStats[13]+1) - currentExp[13]);
  7104. return;
  7105. } else {
  7106. class9.disabledMessage = "Smithing: "+currentStats[13]+"/"+maxStats[13]+"\nExperience: "+currentExp[13];
  7107. return;
  7108. }
  7109. }
  7110. if(id == 31123) {
  7111. if(maxStats[1] < 99) {
  7112. class9.disabledMessage = "Defence: "+currentStats[1]+"/"+maxStats[1]+"\nCurrent XP: "+currentExp[1]+"\nNext level: "+getXPForLevel(maxStats[1]+1)+"\nRemainder: "+(getXPForLevel(maxStats[1]+1) - currentExp[1]);
  7113. return;
  7114. } else {
  7115. class9.disabledMessage = "Defence: "+currentStats[1]+"/"+maxStats[1]+"\nExperience: "+currentExp[1];
  7116. return;
  7117. }
  7118. }
  7119. if(id == 31168) {
  7120. if(maxStats[15] < 99){
  7121. class9.disabledMessage = "Herblore: "+currentStats[15]+"/"+maxStats[15]+"\nCurrent XP: "+currentExp[15]+"\nNext level: "+getXPForLevel(maxStats[15]+1)+"\nRemainder: "+(getXPForLevel(maxStats[15]+1) - currentExp[15]);
  7122. return;
  7123. } else {
  7124. class9.disabledMessage = "Herblore: "+currentStats[15]+"/"+maxStats[15]+"\nExperience: "+currentExp[15];
  7125. return;
  7126. }
  7127. }
  7128. if(id == 31213) {
  7129. if(maxStats[10] < 99){
  7130. class9.disabledMessage = "Fishing: "+currentStats[10]+"/"+maxStats[10]+"\nCurrent XP: "+currentExp[10]+"\nNext level: "+getXPForLevel(maxStats[10]+1)+"\nRemainder: "+(getXPForLevel(maxStats[10]+1) - currentExp[10]);
  7131. return;
  7132. } else {
  7133. class9.disabledMessage = "Fishing: "+currentStats[10]+"/"+maxStats[10]+"\nExperience: "+currentExp[10];
  7134. return;
  7135. }
  7136. }
  7137. if(id == 31128){
  7138. if(maxStats[4] < 99){
  7139. class9.disabledMessage = "Ranged: "+currentStats[4]+"/"+maxStats[4]+"\nCurrent XP: "+currentExp[4]+"\nNext level: "+getXPForLevel(maxStats[4]+1)+"\nRemainder: "+(getXPForLevel(maxStats[4]+1) - currentExp[4]);
  7140. return;
  7141. } else {
  7142. class9.disabledMessage = "Ranged: "+currentStats[4]+"/"+maxStats[4]+"\nExperience: "+currentExp[4];
  7143. return;
  7144. }
  7145. }
  7146. if(id == 31173){
  7147. if(maxStats[17] < 99){
  7148. class9.disabledMessage = "Thieving: "+currentStats[17]+"/"+maxStats[17]+"\nCurrent XP: "+currentExp[17]+"\nNext level: "+getXPForLevel(maxStats[17]+1)+"\nRemainder: "+(getXPForLevel(maxStats[17]+1) - currentExp[17]);
  7149. return;
  7150. } else {
  7151. class9.disabledMessage = "Thieving: "+currentStats[17]+"/"+maxStats[17]+"\nExperience: "+currentExp[17];
  7152. return;
  7153. }
  7154. }
  7155. if(id == 31218){
  7156. if(maxStats[7] < 99){
  7157. class9.disabledMessage = "Cooking: "+currentStats[7]+"/"+maxStats[7]+"\nCurrent XP: "+currentExp[7]+"\nNext level: "+getXPForLevel(maxStats[7]+1)+"\nRemainder: "+(getXPForLevel(maxStats[7]+1) - currentExp[7]);
  7158. return;
  7159. } else {
  7160. class9.disabledMessage = "Cooking: "+currentStats[7]+"/"+maxStats[7]+"\nExperience: "+currentExp[7];
  7161. return;
  7162. }
  7163. }
  7164. if(id == 31133){
  7165. if(maxStats[5] < 99){
  7166. class9.disabledMessage = "Prayer: "+currentStats[5]+"/"+maxStats[5]+"\nCurrent XP: "+currentExp[5]+"\nNext level: "+getXPForLevel(maxStats[5]+1)+"\nRemainder: "+(getXPForLevel(maxStats[5]+1) - currentExp[5]);
  7167. return;
  7168. } else {
  7169. class9.disabledMessage = "Prayer: "+currentStats[5]+"/"+maxStats[5]+"\nExperience: "+currentExp[5];
  7170. return;
  7171. }
  7172. }
  7173. if(id == 31178){
  7174. if(maxStats[12] < 99){
  7175. class9.disabledMessage = "Crafting: "+currentStats[12]+"/"+maxStats[12]+"\nCurrent XP: "+currentExp[12]+"\nNext level: "+getXPForLevel(maxStats[12]+1)+"\nRemainder: "+(getXPForLevel(maxStats[12]+1) - currentExp[12]);
  7176. return;
  7177. } else {
  7178. class9.disabledMessage = "Crafting: "+currentStats[12]+"/"+maxStats[12]+"\nExperience: "+currentExp[12];
  7179. return;
  7180. }
  7181. }
  7182. if(id == 31223){
  7183. if(maxStats[11] < 99){
  7184. class9.disabledMessage = "Firemaking: "+currentStats[11]+"/"+maxStats[11]+"\nCurrent XP: "+currentExp[11]+"\nNext level: "+getXPForLevel(maxStats[11]+1)+"\nRemainder: "+(getXPForLevel(maxStats[11]+1) - currentExp[11]);
  7185. return;
  7186. } else {
  7187. class9.disabledMessage = "Firemaking: "+currentStats[11]+"/"+maxStats[11]+"\nExperience: "+currentExp[11];
  7188. return;
  7189. }
  7190. }
  7191. if(id == 31138){
  7192. if(maxStats[6] < 99){
  7193. class9.disabledMessage = "Magic: "+currentStats[6]+"/"+maxStats[6]+"\nCurrent XP: "+currentExp[6]+"\nNext level: "+getXPForLevel(maxStats[6]+1)+"\nRemainder: "+(getXPForLevel(maxStats[6]+1) - currentExp[6]);
  7194. return;
  7195. } else {
  7196. class9.disabledMessage = "Magic: "+currentStats[6]+"/"+maxStats[6]+"\nExperience: "+currentExp[6];
  7197. return;
  7198. }
  7199. }
  7200. if(id == 31183){
  7201. if(maxStats[9] < 99){
  7202. class9.disabledMessage = "Fletching: "+currentStats[9]+"/"+maxStats[9]+"\nCurrent XP: "+currentExp[9]+"\nNext level: "+getXPForLevel(maxStats[9]+1)+"\nRemainder: "+(getXPForLevel(maxStats[9]+1) - currentExp[9]);
  7203. return;
  7204. } else {
  7205. class9.disabledMessage = "Fletching: "+currentStats[6]+"/"+maxStats[6]+"\nExperience: "+currentExp[9];
  7206. return;
  7207. }
  7208. }
  7209. if(id == 31228){
  7210. if(maxStats[8] < 99){
  7211. class9.disabledMessage = "Woodcutting: "+currentStats[8]+"/"+maxStats[8]+"\nCurrent XP: "+currentExp[8]+"\nNext level: "+getXPForLevel(maxStats[8]+1)+"\nRemainder: "+(getXPForLevel(maxStats[8]+1) - currentExp[8]);
  7212. return;
  7213. } else {
  7214. class9.disabledMessage = "Woodcutting: "+currentStats[8]+"/"+maxStats[8]+"\nExperience: "+currentExp[8];
  7215. return;
  7216. }
  7217. }
  7218. if (id == 31143){
  7219. if(maxStats[20] < 99){
  7220. class9.disabledMessage = "Runecrafting: "+currentStats[20]+"/"+maxStats[20]+"\nCurrent XP: "+currentExp[20]+"\nNext level: "+getXPForLevel(maxStats[20]+1)+"\nRemainder: "+(getXPForLevel(maxStats[20]+1) - currentExp[20]);
  7221. return;
  7222. } else {
  7223. class9.disabledMessage = "Runecrafting: "+currentStats[20]+"/"+maxStats[20]+"\nExperience: "+currentExp[20];
  7224. return;
  7225. }
  7226. }
  7227. if(id == 31188){
  7228. if(maxStats[18] < 99){
  7229. class9.disabledMessage = "Slayer: "+currentStats[18]+"/"+maxStats[18]+"\nCurrent XP: "+currentExp[18]+"\nNext level: "+getXPForLevel(maxStats[18]+1)+"\nRemainder: "+(getXPForLevel(maxStats[18]+1) - currentExp[18]);
  7230. return;
  7231. } else {
  7232. class9.disabledMessage = "Slayer: "+currentStats[18]+"/"+maxStats[18]+"\nExperience: "+currentExp[18];
  7233. return;
  7234. }
  7235. }
  7236. if(id == 31233){
  7237. if(maxStats[19] < 99){
  7238. class9.disabledMessage = "Farming: "+currentStats[19]+"/"+maxStats[19]+"\nCurrent XP: "+currentExp[19]+"\nNext level: "+getXPForLevel(maxStats[19]+1)+"\nRemainder: "+(getXPForLevel(maxStats[19]+1) - currentExp[19]);
  7239. return;
  7240. } else {
  7241. class9.disabledMessage = "Farming: "+currentStats[19]+"/"+maxStats[19]+"\nExperience: "+currentExp[19];
  7242. return;
  7243. }
  7244. }
  7245. if(id == 31193){
  7246. if(maxStats[22] < 99){
  7247. class9.disabledMessage = "Hunter: "+currentStats[22]+"/"+maxStats[22]+"\nCurrent XP: "+currentExp[22]+"\nNext level: "+getXPForLevel(maxStats[22]+1)+"\nRemainder: "+(getXPForLevel(maxStats[22]+1) - currentExp[22]);
  7248. return;
  7249. } else {
  7250. class9.disabledMessage = "Hunter: "+currentStats[22]+"/"+maxStats[22]+"\nExperience: "+currentExp[22];
  7251. return;
  7252. }
  7253. }
  7254. if(id == 31238){
  7255. if(maxStats[23] < 99){
  7256. class9.disabledMessage = "Summoning: "+currentStats[23]+"/"+maxStats[23]+"\nCurrent XP: "+currentExp[23]+"\nNext level: "+getXPForLevel(maxStats[23]+1)+"\nRemainder: "+(getXPForLevel(maxStats[23]+1) - currentExp[23]);
  7257. return;
  7258. } else {
  7259. class9.disabledMessage = "Summoning: "+currentStats[23]+"/"+maxStats[23]+"\nExperience: "+currentExp[23];
  7260. return;
  7261. }
  7262. }
  7263. if(j >= 1 && j <= 100 || j >= 701 && j <= 800)
  7264. {
  7265. if(j == 1 && anInt900 == 0)
  7266. {
  7267. class9.disabledMessage = "Loading friend list";
  7268. class9.atActionType = 0;
  7269. return;
  7270. }
  7271. if(j == 1 && anInt900 == 1)
  7272. {
  7273. class9.disabledMessage = "Connecting to friendserver";
  7274. class9.atActionType = 0;
  7275. return;
  7276. }
  7277. if(j == 2 && anInt900 != 2)
  7278. {
  7279. class9.disabledMessage = "Please wait...";
  7280. class9.atActionType = 0;
  7281. return;
  7282. }
  7283. int k = friendsCount;
  7284. if(anInt900 != 2)
  7285. k = 0;
  7286. if(j > 700)
  7287. j -= 601;
  7288. else
  7289. j--;
  7290. if(j >= k)
  7291. {
  7292. class9.disabledMessage = "";
  7293. class9.atActionType = 0;
  7294. return;
  7295. } else
  7296. {
  7297. class9.disabledMessage = friendsList[j];
  7298. class9.atActionType = 1;
  7299. return;
  7300. }
  7301. }
  7302. if(j >= 101 && j <= 200 || j >= 801 && j <= 900)
  7303. {
  7304. int l = friendsCount;
  7305. if(anInt900 != 2)
  7306. l = 0;
  7307. if(j > 800)
  7308. j -= 701;
  7309. else
  7310. j -= 101;
  7311. if(j >= l)
  7312. {
  7313. class9.disabledMessage = "";
  7314. class9.atActionType = 0;
  7315. return;
  7316. }
  7317. if(friendsNodeIDs[j] == 10)
  7318. class9.disabledMessage = "@gre@Online";
  7319. else
  7320. if(friendsNodeIDs[j] == nodeID)
  7321. class9.disabledMessage = "@red@Offline";
  7322. else
  7323. class9.disabledMessage = "@red@Offline";
  7324. class9.atActionType = 1;
  7325. return;
  7326. }
  7327. if(j == 203)
  7328. {
  7329. int i1 = friendsCount;
  7330. if(anInt900 != 2)
  7331. i1 = 0;
  7332. class9.scrollMax = i1 * 15 + 20;
  7333. if(class9.scrollMax <= class9.height)
  7334. class9.scrollMax = class9.height + 1;
  7335. return;
  7336. }
  7337. if(j >= 401 && j <= 500)
  7338. {
  7339. if((j -= 401) == 0 && anInt900 == 0)
  7340. {
  7341. class9.disabledMessage = "Loading ignore list";
  7342. class9.atActionType = 0;
  7343. return;
  7344. }
  7345. if(j == 1 && anInt900 == 0)
  7346. {
  7347. class9.disabledMessage = "Please wait...";
  7348. class9.atActionType = 0;
  7349. return;
  7350. }
  7351. int j1 = ignoreCount;
  7352. if(anInt900 == 0)
  7353. j1 = 0;
  7354. if(j >= j1)
  7355. {
  7356. class9.disabledMessage = "";
  7357. class9.atActionType = 0;
  7358. return;
  7359. } else
  7360. {
  7361. class9.disabledMessage = TextClass.fixName(TextClass.nameForLong(ignoreListAsLongs[j]));
  7362. class9.atActionType = 1;
  7363. return;
  7364. }
  7365. }
  7366. if(j == 503)
  7367. {
  7368. class9.scrollMax = ignoreCount * 15 + 20;
  7369. if(class9.scrollMax <= class9.height)
  7370. class9.scrollMax = class9.height + 1;
  7371. return;
  7372. }
  7373. if(j == 327)
  7374. {
  7375. class9.modelRotationY = 150;
  7376. class9.modelRotationX = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  7377. if(aBoolean1031)
  7378. {
  7379. for(int k1 = 0; k1 < 7; k1++)
  7380. {
  7381. int l1 = anIntArray1065[k1];
  7382. if(l1 >= 0 && !IdentityKit.cache[l1].method537())
  7383. return;
  7384. }
  7385.  
  7386. aBoolean1031 = false;
  7387. Model aclass30_sub2_sub4_sub6s[] = new Model[7];
  7388. int i2 = 0;
  7389. for(int j2 = 0; j2 < 7; j2++)
  7390. {
  7391. int k2 = anIntArray1065[j2];
  7392. if(k2 >= 0)
  7393. aclass30_sub2_sub4_sub6s[i2++] = IdentityKit.cache[k2].method538();
  7394. }
  7395.  
  7396. Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
  7397. for(int l2 = 0; l2 < 5; l2++)
  7398. if(anIntArray990[l2] != 0)
  7399. {
  7400. model.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  7401. if(l2 == 1)
  7402. model.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  7403. }
  7404.  
  7405. model.method469();
  7406. model.method470(Animation.anims[myPlayer.anInt1511].anIntArray353[0]);
  7407. model.method479(64, 850, -30, -50, -30, true);
  7408. class9.disabledMediaType = 5;
  7409. class9.disabledMediaID = 0;
  7410. RSInterface.method208(aBoolean994, model);
  7411. }
  7412. return;
  7413. }
  7414. if(j == 328) {
  7415. RSInterface rsInterface = class9;
  7416. int verticleTilt = 150;
  7417. int animationSpeed = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  7418. rsInterface.modelRotationY = verticleTilt;
  7419. rsInterface.modelRotationX = animationSpeed;
  7420. if(aBoolean1031) {
  7421. Model characterDisplay = myPlayer.method452();
  7422. for(int l2 = 0; l2 < 5; l2++)
  7423. if(anIntArray990[l2] != 0) {
  7424. characterDisplay.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  7425. if(l2 == 1)
  7426. characterDisplay.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  7427. }
  7428. int staticFrame = myPlayer.anInt1511;
  7429. characterDisplay.method469();
  7430. characterDisplay.method470(Animation.anims[staticFrame].anIntArray353[0]);
  7431. //characterDisplay.method479(64, 850, -30, -50, -30, true);
  7432. rsInterface.disabledMediaType = 5;
  7433. rsInterface.disabledMediaID = 0;
  7434. RSInterface.method208(aBoolean994, characterDisplay);
  7435. }
  7436. return;
  7437. }
  7438. if(j == 324)
  7439. {
  7440. if(aSprite_931 == null)
  7441. {
  7442. aSprite_931 = class9.disabledSprite;
  7443. aSprite_932 = class9.enabledSprite;
  7444. }
  7445. if(aBoolean1047)
  7446. {
  7447. class9.disabledSprite = aSprite_932;
  7448. return;
  7449. } else
  7450. {
  7451. class9.disabledSprite = aSprite_931;
  7452. return;
  7453. }
  7454. }
  7455. if(j == 325)
  7456. {
  7457. if(aSprite_931 == null)
  7458. {
  7459. aSprite_931 = class9.disabledSprite;
  7460. aSprite_932 = class9.enabledSprite;
  7461. }
  7462. if(aBoolean1047)
  7463. {
  7464. class9.disabledSprite = aSprite_931;
  7465. return;
  7466. } else
  7467. {
  7468. class9.disabledSprite = aSprite_932;
  7469. return;
  7470. }
  7471. }
  7472. if(j == 600)
  7473. {
  7474. class9.disabledMessage = reportAbuseInput;
  7475. if(loopCycle % 20 < 10)
  7476. {
  7477. class9.disabledMessage += "|";
  7478. return;
  7479. } else
  7480. {
  7481. class9.disabledMessage += " ";
  7482. return;
  7483. }
  7484. }
  7485. if(j == 613)
  7486. if(myPrivilege >= 1)
  7487. {
  7488. if(canMute) {
  7489. class9.disabledColor = 0xff0000;
  7490. class9.disabledMessage = "Moderator option: Mute player for 48 hours: <ON>";
  7491. } else {
  7492. class9.disabledColor = 0xffffff;
  7493. class9.disabledMessage = "Moderator option: Mute player for 48 hours: <OFF>";
  7494. }
  7495. } else {
  7496. class9.disabledMessage = "";
  7497. }
  7498. if(j == 650 || j == 655)
  7499. if(anInt1193 != 0)
  7500. {
  7501. String s;
  7502. if(daysSinceLastLogin == 0)
  7503. s = "earlier today";
  7504. else
  7505. if(daysSinceLastLogin == 1)
  7506. s = "yesterday";
  7507. else
  7508. s = daysSinceLastLogin + " days ago";
  7509. class9.disabledMessage = "You last logged in " + s + " from: " + signlink.dns;
  7510. } else
  7511. {
  7512. class9.disabledMessage = "";
  7513. }
  7514. if(j == 651)
  7515. {
  7516. if(unreadMessages == 0)
  7517. {
  7518. class9.disabledMessage = "0 unread messages";
  7519. class9.disabledColor = 0xffff00;
  7520. }
  7521. if(unreadMessages == 1)
  7522. {
  7523. class9.disabledMessage = "1 unread disabledMessage";
  7524. class9.disabledColor = 65280;
  7525. }
  7526. if(unreadMessages > 1)
  7527. {
  7528. class9.disabledMessage = unreadMessages + " unread messages";
  7529. class9.disabledColor = 65280;
  7530. }
  7531. }
  7532. if(j == 652)
  7533. if(daysSinceRecovChange == 201)
  7534. {
  7535. if(membersInt == 1)
  7536. class9.disabledMessage = "@yel@This is a non-members world: @whi@Since you are a member we";
  7537. else
  7538. class9.disabledMessage = "";
  7539. } else
  7540. if(daysSinceRecovChange == 200)
  7541. {
  7542. class9.disabledMessage = "You have not yet set any password recovery questions.";
  7543. } else
  7544. {
  7545. String s1;
  7546. if(daysSinceRecovChange == 0)
  7547. s1 = "Earlier today";
  7548. else
  7549. if(daysSinceRecovChange == 1)
  7550. s1 = "Yesterday";
  7551. else
  7552. s1 = daysSinceRecovChange + " days ago";
  7553. class9.disabledMessage = s1 + " you changed your recovery questions";
  7554. }
  7555. if(j == 653)
  7556. if(daysSinceRecovChange == 201)
  7557. {
  7558. if(membersInt == 1)
  7559. class9.disabledMessage = "@whi@recommend you use a members world instead. You may use";
  7560. else
  7561. class9.disabledMessage = "";
  7562. } else
  7563. if(daysSinceRecovChange == 200)
  7564. class9.disabledMessage = "We strongly recommend you do so now to secure your account.";
  7565. else
  7566. class9.disabledMessage = "If you do not remember making this change then cancel it immediately";
  7567. if(j == 654)
  7568. {
  7569. if(daysSinceRecovChange == 201)
  7570. if(membersInt == 1)
  7571. {
  7572. class9.disabledMessage = "@whi@this world but member benefits are unavailable whilst here.";
  7573. return;
  7574. } else
  7575. {
  7576. class9.disabledMessage = "";
  7577. return;
  7578. }
  7579. if(daysSinceRecovChange == 200)
  7580. {
  7581. class9.disabledMessage = "Do this from the 'account management' area on our front webpage";
  7582. return;
  7583. }
  7584. class9.disabledMessage = "Do this from the 'account management' area on our front webpage";
  7585. }
  7586. }
  7587.  
  7588. private void drawSplitPrivateChat()
  7589. {
  7590. if(splitPrivateChat == 0)
  7591. return;
  7592. RSFont textDrawingArea = aTextDrawingArea_1271;
  7593. int i = 0;
  7594. if(anInt1104 != 0)
  7595. i = 1;
  7596. for(int j = 0; j < 100; j++)
  7597. if(chatMessages[j] != null)
  7598. {
  7599. int k = chatTypes[j];
  7600. String s = chatNames[j];
  7601. byte byte1 = 0;
  7602. for (byte is = 0; is < 7; is++) {
  7603. if(s != null && s.startsWith("@cr"+is+"@")) {
  7604. s = s.substring(5);
  7605. byte1 = is == 0 ? 7 : is;
  7606. }
  7607. }
  7608. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  7609. {
  7610. int l = 329 - i * 13;
  7611. int k1 = 4;
  7612. textDrawingArea.method385(0, "From", l, k1);
  7613. textDrawingArea.method385(65535, "From", l - 1, k1);
  7614. k1 += textDrawingArea.getTextWidth("From ");
  7615. if (byte1 != 0) {
  7616. modIcons[byte1 == 7 ? 0 : byte1].drawSprite(k1, l - 12);
  7617. k1 += 12;
  7618. }
  7619. textDrawingArea.method385(0, s + ": " + chatMessages[j], l, k1);
  7620. textDrawingArea.method385(65535, s + ": " + chatMessages[j], l - 1, k1);
  7621. if(++i >= 5)
  7622. return;
  7623. }
  7624. if(k == 5 && privateChatMode < 2)
  7625. {
  7626. int i1 = 329 - i * 13;
  7627. textDrawingArea.method385(0, chatMessages[j], i1, 4);
  7628. textDrawingArea.method385(65535, chatMessages[j], i1 - 1, 4);
  7629. if(++i >= 5)
  7630. return;
  7631. }
  7632. if(k == 6 && privateChatMode < 2)
  7633. {
  7634. int j1 = 329 - i * 13;
  7635. textDrawingArea.method385(0, "To " + s + ": " + chatMessages[j], j1, 4);
  7636. textDrawingArea.method385(65535, "To " + s + ": " + chatMessages[j], j1 - 1, 4);
  7637. if(++i >= 5)
  7638. return;
  7639. }
  7640. }
  7641.  
  7642. }
  7643.  
  7644. public void pushMessage(String s, int i, String s1) {
  7645. if(i == 0 && dialogID != -1) {
  7646. aString844 = s;
  7647. super.clickMode3 = 0;
  7648. }
  7649. if(backDialogID == -1)
  7650. inputTaken = true;
  7651. for(int j = 499; j > 0; j--) {
  7652. chatTypes[j] = chatTypes[j - 1];
  7653. chatNames[j] = chatNames[j - 1];
  7654. chatMessages[j] = chatMessages[j - 1];
  7655. chatRights[j] = chatRights[j - 1];
  7656. }
  7657. chatTypes[0] = i;
  7658. chatNames[0] = s1;
  7659. chatMessages[0] = s;
  7660. chatRights[0] = rights;
  7661. }
  7662.  
  7663. public static void setTab(int id) {
  7664. tabID = id;
  7665. tabAreaAltered = true;
  7666. }
  7667. public int tabHPos;
  7668. private void processTabClick() {
  7669. if (super.mouseX >= 695 && super.mouseX <= 751 && super.mouseY >= 134 && super.mouseY < 165) {
  7670. summHover = true;
  7671. } else {
  7672. summHover = false;
  7673. }
  7674. if(is474 == true || is480 == true || is508 == true || is525 == true || is562 == true) {
  7675. if(super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 95 && super.mouseY < 128){
  7676. runHover = true;
  7677. } else {
  7678. runHover = false;
  7679. }
  7680. if(super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 52 && super.mouseY < 87){
  7681. prayHover = true;
  7682. } else {
  7683. prayHover = false;
  7684. }
  7685. if(super.mouseX >= 765-24 && super.mouseX <= 765 && super.mouseY >= 3 && super.mouseY <= 25){
  7686. logHover = true;
  7687. } else {
  7688. logHover = false;
  7689. }
  7690. }
  7691.  
  7692. if(is562 == false){
  7693. if(super.clickMode3 == 1) {
  7694. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[0] != -1)
  7695. {
  7696. tabID = 0;
  7697. tabAreaAltered = true;
  7698. }
  7699. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[1] != -1)
  7700. {
  7701. tabID = 1;
  7702. tabAreaAltered = true;
  7703. }
  7704. if(super.saveClickX >= 595 && super.saveClickX <= 626 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[2] != -1)
  7705. {
  7706. tabID = 2;
  7707. tabAreaAltered = true;
  7708. }
  7709. if(super.saveClickX >= 627 && super.saveClickX <= 660 && super.saveClickY >= 168 && super.saveClickY < 203 && tabInterfaceIDs[3] != -1)
  7710. {
  7711. tabID = 3;
  7712. tabAreaAltered = true;
  7713. }
  7714. if(super.saveClickX >= 661 && super.saveClickX <= 693 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[4] != -1)
  7715. {
  7716. tabID = 4;
  7717. tabAreaAltered = true;
  7718. }
  7719. if(super.saveClickX >= 694 && super.saveClickX <= 725 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[5] != -1)
  7720. {
  7721. tabID = 5;
  7722. tabAreaAltered = true;
  7723. }
  7724. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[6] != -1)
  7725. {
  7726. tabID = 6;
  7727. tabAreaAltered = true;
  7728. }
  7729. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[7] != -1)
  7730. {
  7731. tabID = 7;
  7732. if (is474 || is480 || is508 || is525) {
  7733. tabID = 10;
  7734. }
  7735. tabAreaAltered = true;
  7736. }
  7737. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[8] != -1)
  7738. {
  7739. tabID = 8;
  7740. tabAreaAltered = true;
  7741. }
  7742. if(super.saveClickX >= 595 && super.saveClickX <= 627 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[9] != -1)
  7743. {
  7744. tabID = 9;
  7745. tabAreaAltered = true;
  7746. }
  7747. if(super.saveClickX >= 627 && super.saveClickX <= 664 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[10] != -1)
  7748. {
  7749. tabID = 10;
  7750. if (is474 == true ||is480 == true || is508 == true || is525 == true) {
  7751. tabID = 7;
  7752. }
  7753. tabAreaAltered = true;
  7754. }
  7755. if(super.saveClickX >= 661 && super.saveClickX <= 694 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[11] != -1)
  7756. {
  7757. tabID = 11;
  7758. tabAreaAltered = true;
  7759. }
  7760. if(super.saveClickX >= 695 && super.saveClickX <= 725 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[12] != -1)
  7761. {
  7762. tabID = 12;
  7763. tabAreaAltered = true;
  7764. }
  7765. /*if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[13] != -1)
  7766. {
  7767. tabID = 13;
  7768. tabAreaAltered = true;
  7769. }*/
  7770. if(super.saveClickX >= 742 && super.saveClickX <= 764 && super.saveClickY >= 1 && super.saveClickY < 24 && tabInterfaceIDs[10] != -1) {
  7771. if (tabInterfaceIDs[10] == 17011) {
  7772. tabInterfaceIDs[14] = 2449;
  7773. tabID = 14;
  7774. } else {
  7775. System.out.println(tabInterfaceIDs[10]+"");
  7776. tabID = 10;
  7777. if (is474) {
  7778. tabID = 7;
  7779. }
  7780. tabAreaAltered = true;
  7781. }
  7782. }
  7783. }
  7784. } else {
  7785. if(super.mouseX >= 521 && super.mouseX <= 550 && super.mouseY >= 169 && super.mouseY < 205) {
  7786. tabHPos = 0;
  7787. tabAreaAltered = true;
  7788. } else if(super.mouseX >= 552 && super.mouseX <= 581 && super.mouseY >= 168 && super.mouseY < 205) {
  7789. tabHPos = 1;
  7790. tabAreaAltered = true;
  7791. } else if(super.mouseX >= 582 && super.mouseX <= 611 && super.mouseY >= 168 && super.mouseY < 205) {
  7792. tabHPos = 2;
  7793. tabAreaAltered = true;
  7794. } else if(super.mouseX >= 612 && super.mouseX <= 641 && super.mouseY >= 168 && super.mouseY < 203) {
  7795. //tabHPos = 3;
  7796. //needDrawTabArea = true;
  7797. //tabAreaAltered = true;
  7798. } else if(super.mouseX >= 642 && super.mouseX <= 671 && super.mouseY >= 168 && super.mouseY < 205) {
  7799. tabHPos = 4;
  7800. tabAreaAltered = true;
  7801. } else if(super.mouseX >= 672 && super.mouseX <= 701 && super.mouseY >= 168 && super.mouseY < 205) {
  7802. tabHPos = 5;
  7803. tabAreaAltered = true;
  7804. } else if(super.mouseX >= 702 && super.mouseX <= 731 && super.mouseY >= 169 && super.mouseY < 205) {
  7805. tabHPos = 6;
  7806. tabAreaAltered = true;
  7807. } else if(super.mouseX >= 732 && super.mouseX <= 761 && super.mouseY >= 169 && super.mouseY < 205) {
  7808. tabHPos = 7;
  7809. tabAreaAltered = true;
  7810. } else if(super.mouseX >= 522 && super.mouseX <= 551 && super.mouseY >= 466 && super.mouseY < 503) {
  7811. tabHPos = 15;
  7812. tabAreaAltered = true;
  7813. } else if(super.mouseX >= 552 && super.mouseX <= 581 && super.mouseY >= 466 && super.mouseY < 503) {
  7814. tabHPos = 8;
  7815. tabAreaAltered = true;
  7816. } else if(super.mouseX >= 582 && super.mouseX <= 611 && super.mouseY >= 466 && super.mouseY < 503) {
  7817. tabHPos = 9;
  7818. tabAreaAltered = true;
  7819. } else if(super.mouseX >= 612 && super.mouseX <= 641 && super.mouseY >= 466 && super.mouseY < 503) {
  7820. tabHPos = 10;
  7821. tabAreaAltered = true;
  7822. } else if(super.mouseX >= 642 && super.mouseX <= 671 && super.mouseY >= 466 && super.mouseY < 503) {
  7823. tabHPos = 11;
  7824. tabAreaAltered = true;
  7825. } else if(super.mouseX >= 672 && super.mouseX <= 701 && super.mouseY >= 466 && super.mouseY < 503) {
  7826. tabHPos = 12;
  7827. tabAreaAltered = true;
  7828. } else if(super.mouseX >= 702 && super.mouseX <= 731 && super.mouseY >= 466 && super.mouseY < 502) {
  7829. tabHPos = 13;
  7830. tabAreaAltered = true;
  7831. } else if(super.mouseX >= 732 && super.mouseX <= 761 && super.mouseY >= 466 && super.mouseY < 502) {
  7832. tabHPos = 14;
  7833. tabAreaAltered = true;
  7834. } else {
  7835. tabHPos = -1;
  7836. tabAreaAltered = true;
  7837. }
  7838. if(super.clickMode3 == 1) {
  7839. if(super.saveClickX >= 522 && super.saveClickX <= 551 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[0] != -1) {
  7840. tabID = 0;
  7841. tabAreaAltered = true;
  7842. } else if(super.saveClickX >= 552 && super.saveClickX <= 581 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[1] != -1) {
  7843. tabID = 1;
  7844. tabAreaAltered = true;
  7845. } else if(super.saveClickX >= 582 && super.saveClickX <= 611 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[2] != -1) {
  7846. tabID = 2;
  7847. tabAreaAltered = true;
  7848. } else if(super.saveClickX >= 612 && super.saveClickX <= 641 && super.saveClickY >= 168 && super.saveClickY < 203 && tabInterfaceIDs[14] != -1) {
  7849. //needDrawTabArea = true;
  7850. //tabID = 14;
  7851. //tabAreaAltered = true;
  7852. } else if(super.saveClickX >= 642 && super.saveClickX <= 671 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[3] != -1) {
  7853. tabID = 3;
  7854. tabAreaAltered = true;
  7855. } else if(super.saveClickX >= 672 && super.saveClickX <= 701 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[4] != -1) {
  7856. tabID = 4;
  7857. tabAreaAltered = true;
  7858. } else if(super.saveClickX >= 702 && super.saveClickX <= 731 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[5] != -1) {
  7859. tabID = 5;
  7860. tabAreaAltered = true;
  7861. } else if(super.saveClickX >= 732 && super.saveClickX <= 761 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[6] != -1) {
  7862. tabID = 6;
  7863. tabAreaAltered = true;
  7864. } else if(super.saveClickX >= 522 && super.saveClickX <= 551 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[16] != -1) {
  7865. tabID = 16;
  7866. tabAreaAltered = true;
  7867. } else if(super.saveClickX >= 552 && super.saveClickX <= 581 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[8] != -1) {
  7868. tabID = 8;
  7869. tabAreaAltered = true;
  7870. } else if(super.saveClickX >= 582 && super.saveClickX <= 611 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[9] != -1) {
  7871. tabID = 9;
  7872. tabAreaAltered = true;
  7873. } else if(super.saveClickX >= 612 && super.saveClickX <= 641 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[7] != -1) {
  7874. tabID = 7;
  7875. tabAreaAltered = true;
  7876. } else if(super.saveClickX >= 642 && super.saveClickX <= 671 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[11] != -1) {
  7877. tabID = 11;
  7878. tabAreaAltered = true;
  7879. } else if(super.saveClickX >= 672 && super.saveClickX <= 701 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[12] != -1) {
  7880. tabID = 12;
  7881. tabAreaAltered = true;
  7882. } else if(super.saveClickX >= 702 && super.saveClickX <= 731 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[13] != -1) {
  7883. tabID = 13;
  7884. tabAreaAltered = true;
  7885. } else if(super.saveClickX >= 732 && super.saveClickX <= 761 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[15] != -1) {
  7886. tabID = 15;
  7887. tabAreaAltered = true;
  7888. }
  7889. /* Logout X */
  7890. else if(super.saveClickX >= 742 && super.saveClickX <= 764 && super.saveClickY >= 1 && super.saveClickY < 24 && tabInterfaceIDs[10] != -1) {
  7891. if (tabInterfaceIDs[10] == 17011) {
  7892. //invOverlayInterfaceID = 2449;
  7893. //setSidebarInterface(12, 2449);
  7894. tabInterfaceIDs[14] = 2449;
  7895. tabID = 14;
  7896. //needDrawTabArea = true;
  7897. //tabAreaAltered = true;
  7898. } else {
  7899. tabID = 10;
  7900. tabAreaAltered = true;
  7901. }
  7902. }
  7903.  
  7904. }
  7905. }
  7906.  
  7907. }
  7908.  
  7909. private void resetImageProducers2() {
  7910. if(chatBackImage != null)
  7911. return;
  7912. nullLoader();
  7913. super.fullGameScreen = null;
  7914. aRSImageProducer_1107 = null;
  7915. loginScreenArea = null;
  7916. loadingBarFull = null;
  7917. loadingBarEmpty = null;
  7918. loadingBarFull = null;
  7919. loadingBarEmpty = null;
  7920. backgroundWorld1 = null;
  7921. backgroundWorld2 = null;
  7922. chatBackImage = new RSImageProducer(516, 165, getGameComponent());//519
  7923. mapBackImage = new RSImageProducer(249, 168, getGameComponent());//
  7924. DrawingArea.setAllPixelsToZero();
  7925. //mapBack.drawBackground(0, 0);
  7926. CustomMapback[getSpriteID()].drawSprite(0, 0);
  7927. new RSImageProducer(3, 170, getGameComponent());
  7928. inventoryBackImage = new RSImageProducer(250, 335, getGameComponent());
  7929. main3DArea = new RSImageProducer(512, 334, getGameComponent());
  7930. DrawingArea.setAllPixelsToZero();
  7931. new RSImageProducer(269, 37, getGameComponent());
  7932. aRSImageProducer_1125 = new RSImageProducer(249, 45, getGameComponent());
  7933. welcomeScreenRaised = true;
  7934. }
  7935.  
  7936. public String getDocumentBaseHost() {
  7937. if (signlink.mainapp != null) {
  7938. return signlink.mainapp.getDocumentBase().getHost().toLowerCase();
  7939. }
  7940. return null;
  7941. }
  7942.  
  7943. private void method81(Sprite sprite, int x, int y) {
  7944. int xPadding = 0; int yPadding = 0;
  7945. if (toggleFullscreen) {
  7946. xPadding = this.xPaddingmapBackImage + getMapIncreaseX();
  7947. yPadding = this.yPaddingmapBackImage + getMapIncreaseY();
  7948. }
  7949. int l = y * y + x * x;
  7950. if(l > 4225 && l < 0x15f90) {
  7951. int rotation = minimapInt1 + minimapInt2 & 0x7ff;
  7952. int spriteX = Model.modelIntArray1[rotation];
  7953. int spriteY = Model.modelIntArray2[rotation];
  7954. spriteX = (spriteX * 256) / (minimapInt3 + 256);
  7955. spriteY = (spriteY * 256) / (minimapInt3 + 256);
  7956. int drawX = x * spriteX + y * spriteY >> 16;
  7957. int drawY = x * spriteY - y * spriteX >> 16;
  7958. double d = Math.atan2(drawX, drawY);
  7959. int j2 = (int)(Math.sin(d) * 63D);
  7960. int k2 = (int)(Math.cos(d) * 57D);
  7961. mapEdge.method353(83 - k2 - 20, d, (94 + j2 + 4) - 10);
  7962. CustomMapback[getSpriteID()].drawSprite(0+xPadding, 0+yPadding);
  7963. return;
  7964. } else {
  7965. markMinimap(sprite, y, x, false);
  7966. CustomMapback[getSpriteID()].drawSprite(0+xPadding, 0+yPadding);
  7967. }
  7968. }
  7969.  
  7970. public void processRightClick() {
  7971. if (activeInterfaceType != 0) {
  7972. return;
  7973. }
  7974. menuActionName[0] = "Cancel";
  7975. menuActionID[0] = 1107;
  7976. menuActionRow = 1;
  7977. if (fullscreenInterfaceID != -1) {
  7978. anInt886 = 0;
  7979. anInt1315 = 0;
  7980. buildInterfaceMenu(8, RSInterface.interfaceCache[fullscreenInterfaceID], super.mouseX, 8, super.mouseY, 0);
  7981. if (anInt886 != anInt1026) {
  7982. anInt1026 = anInt886;
  7983. }
  7984. if (anInt1315 != anInt1129) {
  7985. anInt1129 = anInt1315;
  7986. }
  7987. return;
  7988. }
  7989. buildSplitPrivateChatMenu(0, getChatBackIncreaseY());
  7990. anInt886 = 0;
  7991. anInt1315 = 0;
  7992. int width = toggleFullscreen ? getScreenWidth() : 516;
  7993. int height = toggleFullscreen ? getScreenHeight() : 338;
  7994. if ((super.mouseX > 0) && (super.mouseY > 0) && (super.mouseX < width) && (super.mouseY < height) &&
  7995. ((toggleFullscreen) || (super.mouseX <= 519 + getTabIncreaseX()) || (super.mouseY <= 168 + getTabIncreaseY()) || (super.mouseX >= 765 + getTabIncreaseX()) || (super.mouseY >= 503 + getTabIncreaseY())) && (
  7996. (!toggleFullscreen) ||
  7997. (super.mouseX <= 22 + xPaddingtabBack + getTabIncreaseX()) ||
  7998. (super.mouseY <= -14 + yPaddingtabBack + getTabIncreaseY()) ||
  7999. (super.mouseX >= 22 + xPaddingtabBack + getTabIncreaseX() + 204) ||
  8000. (super.mouseY >= -14 + yPaddingtabBack + getTabIncreaseY() + 275))) {
  8001. if ((super.mouseX <= 0) || (super.mouseY <= 338 + getChatBackIncreaseY()) || (super.mouseX >= 517) || (super.mouseY >= 503 + getChatBackIncreaseY()))
  8002. if ((super.mouseX <= xPaddingmapBackImage + getMapIncreaseX() + (toggleFullscreen ? -25 : 0)) || (super.mouseY <= 0) || (super.mouseX >= xPaddingmapBackImage + getMapIncreaseX() + 249) || (super.mouseY >= yPaddingmapBackImage + getMapIncreaseY() + 168))
  8003. {
  8004. if (openInterfaceID != -1) {
  8005. RSInterface rsInterface = RSInterface.interfaceCache[openInterfaceID];
  8006. if (toggleFullscreen) {
  8007. int interfaceWidth = toggleFullscreen ? getScreenWidth() : 516;
  8008. int interfaceHeight = toggleFullscreen ? getScreenHeight() : 338;
  8009. buildInterfaceMenu(4 + (interfaceWidth - rsInterface.width) / 2, rsInterface, super.mouseX, 4 + (interfaceHeight - rsInterface.height) / 2, super.mouseY, 0);
  8010. } else {
  8011. buildInterfaceMenu(4, rsInterface, super.mouseX, 4, super.mouseY, 0);
  8012. }
  8013. } else {
  8014. build3dScreenMenu();
  8015. }
  8016. }
  8017. }
  8018. if (anInt886 != anInt1026) {
  8019. anInt1026 = anInt886;
  8020. }
  8021. if (anInt1315 != anInt1129) {
  8022. anInt1129 = anInt1315;
  8023. }
  8024. anInt886 = 0;
  8025. anInt1315 = 0;
  8026. if (super.mouseX > 548 + getTabIncreaseX()) if ((super.mouseY > 207 - (toggleFullscreen ? 46 : 0) + getTabIncreaseY()) && (super.mouseX < 740 + getTabIncreaseX()) && (super.mouseY < 468 + getTabIncreaseY())) {
  8027. if (this.invOverlayInterfaceID != -1)
  8028. buildInterfaceMenu(547 + getTabIncreaseX(), RSInterface.interfaceCache[this.invOverlayInterfaceID], super.mouseX, 207 - (toggleFullscreen ? 46 : 0) + getTabIncreaseY(), super.mouseY, 0);
  8029. else if (tabInterfaceIDs[tabID] != -1) {
  8030. buildInterfaceMenu(547 + getTabIncreaseX(), RSInterface.interfaceCache[tabInterfaceIDs[tabID]], super.mouseX, 207 - (toggleFullscreen ? 46 : 0) + getTabIncreaseY(), super.mouseY, 0);
  8031. }
  8032. }
  8033. if (anInt886 != anInt1048) {
  8034. tabAreaAltered = true;
  8035. anInt1048 = anInt886;
  8036. }
  8037. if (anInt1315 != anInt1044) {
  8038. tabAreaAltered = true;
  8039. anInt1044 = anInt1315;
  8040. }
  8041. anInt886 = 0;
  8042. anInt1315 = 0;
  8043. if(super.mouseX > 0 && super.mouseY > 338 && super.mouseX < 490 && super.mouseY < 463) {
  8044. if(backDialogID != -1) {
  8045. buildInterfaceMenu(20, RSInterface.interfaceCache[backDialogID], super.mouseX, 358, super.mouseY, 0);
  8046. } else if(super.mouseY < 463 && super.mouseX < 490) {
  8047. buildChatAreaMenu(super.mouseY - 338);
  8048. }
  8049. }
  8050. if (backDialogID != -1 && anInt886 != anInt1039) {
  8051. inputTaken = true;
  8052. anInt1039 = anInt886;
  8053. }
  8054. if (backDialogID != -1 && anInt1315 != anInt1500) {
  8055. inputTaken = true;
  8056. anInt1500 = anInt1315;
  8057. }
  8058. /** Custom menu drawing */
  8059. rightClickChatButtons();
  8060. determineTopTabs();
  8061. determineBottomTabs();
  8062.  
  8063. if(is474 == true ||is480 == true || is508 == true || is525 == true || is562 == true) {
  8064. processMinimapActions();
  8065. }
  8066.  
  8067. boolean flag = false;
  8068. while (!flag) {
  8069. flag = true;
  8070. for (int j = 0; j < menuActionRow - 1; j++) {
  8071. if (menuActionID[j] < 1000 && menuActionID[j + 1] > 1000) {
  8072. String s = menuActionName[j];
  8073. menuActionName[j] = menuActionName[j + 1];
  8074. menuActionName[j + 1] = s;
  8075. int k = menuActionID[j];
  8076. menuActionID[j] = menuActionID[j + 1];
  8077. menuActionID[j + 1] = k;
  8078. k = menuActionCmd2[j];
  8079. menuActionCmd2[j] = menuActionCmd2[j + 1];
  8080. menuActionCmd2[j + 1] = k;
  8081. k = menuActionCmd3[j];
  8082. menuActionCmd3[j] = menuActionCmd3[j + 1];
  8083. menuActionCmd3[j + 1] = k;
  8084. k = menuActionCmd1[j];
  8085. menuActionCmd1[j] = menuActionCmd1[j + 1];
  8086. menuActionCmd1[j + 1] = k;
  8087. flag = false;
  8088. }
  8089. }
  8090. }
  8091. }
  8092.  
  8093. private static int port = 43594;
  8094.  
  8095. private void login(String s, String s1, boolean flag)
  8096. {
  8097. signlink.errorname = s;
  8098. try {
  8099. if(!flag) {
  8100. loginMessage1 = "";
  8101. loginMessage2 = "Connecting to server...";
  8102. drawLoginScreen(true);
  8103. }
  8104. if(myUsername.length() < 1){
  8105. loginMessage1 = "";
  8106. loginMessage2 = "Please enter a valid username.";
  8107. return;
  8108. }
  8109. socketStream = new RSSocket(this, openSocket(port));
  8110. long l = TextClass.longForName(s);
  8111. int i = (int)(l >> 16 & 31L);
  8112. stream.currentOffset = 0;
  8113. stream.writeWordBigEndian(14);
  8114. stream.writeWordBigEndian(i);
  8115. socketStream.queueBytes(2, stream.buffer);
  8116. for(int j = 0; j < 8; j++)
  8117. socketStream.read();
  8118.  
  8119. int k = socketStream.read();
  8120. int i1 = k;
  8121. if(k == 0)
  8122. {
  8123. socketStream.flushInputStream(inStream.buffer, 8);
  8124. inStream.currentOffset = 0;
  8125. aLong1215 = inStream.readQWord();
  8126. int ai[] = new int[4];
  8127. ai[0] = (int)(Math.random() * 99999999D);
  8128. ai[1] = (int)(Math.random() * 99999999D);
  8129. ai[2] = (int)(aLong1215 >> 32);
  8130. ai[3] = (int)aLong1215;
  8131. stream.currentOffset = 0;
  8132. stream.writeWordBigEndian(10);
  8133. stream.writeDWord(ai[0]);
  8134. stream.writeDWord(ai[1]);
  8135. stream.writeDWord(ai[2]);
  8136. stream.writeDWord(ai[3]);
  8137. stream.writeDWord(123456);
  8138. stream.writeString(s);
  8139. stream.writeString(s1);
  8140. stream.doKeys();
  8141. aStream_847.currentOffset = 0;
  8142. if(flag)
  8143. aStream_847.writeWordBigEndian(18);
  8144. else
  8145. aStream_847.writeWordBigEndian(16);
  8146. System.out.println(""+stream.currentOffset);
  8147. aStream_847.writeWordBigEndian(stream.currentOffset + 36 + 1 + 1 + 2);
  8148. aStream_847.writeWordBigEndian(255);
  8149. aStream_847.writeWord(0);
  8150. aStream_847.writeWordBigEndian(lowMem ? 1 : 0);
  8151. for(int l1 = 0; l1 < 9; l1++)
  8152. aStream_847.writeDWord(expectedCRCs[l1]);
  8153.  
  8154. aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
  8155. stream.encryption = new ISAACRandomGen(ai);
  8156. for(int j2 = 0; j2 < 4; j2++)
  8157. ai[j2] += 50;
  8158.  
  8159. encryption = new ISAACRandomGen(ai);
  8160. socketStream.queueBytes(aStream_847.currentOffset, aStream_847.buffer);
  8161. k = socketStream.read();
  8162. }
  8163. System.out.println(""+k);
  8164. if(k == 1)
  8165. {
  8166. try
  8167. {
  8168. Thread.sleep(2000L);
  8169. }
  8170. catch(Exception _ex) { }
  8171. login(s, s1, flag);
  8172. return;
  8173. }
  8174. if(k == 2)
  8175. {
  8176. myPrivilege = socketStream.read();
  8177. flagged = socketStream.read() == 1;
  8178. aLong1220 = 0L;
  8179. anInt1022 = 0;
  8180. mouseDetection.coordsIndex = 0;
  8181. super.awtFocus = true;
  8182. aBoolean954 = true;
  8183. loggedIn = true;
  8184. stream.currentOffset = 0;
  8185. inStream.currentOffset = 0;
  8186. pktType = -1;
  8187. anInt841 = -1;
  8188. anInt842 = -1;
  8189. anInt843 = -1;
  8190. pktSize = 0;
  8191. anInt1009 = 0;
  8192. anInt1104 = 0;
  8193. anInt1011 = 0;
  8194. anInt855 = 0;
  8195. menuActionRow = 0;
  8196. menuOpen = false;
  8197. super.idleTime = 0;
  8198. for(int j1 = 0; j1 < 100; j1++)
  8199. chatMessages[j1] = null;
  8200.  
  8201. itemSelected = 0;
  8202. spellSelected = 0;
  8203. loadingStage = 0;
  8204. anInt1062 = 0;
  8205. anInt1278 = (int)(Math.random() * 100D) - 50;
  8206. anInt1131 = (int)(Math.random() * 110D) - 55;
  8207. anInt896 = (int)(Math.random() * 80D) - 40;
  8208. minimapInt2 = (int)(Math.random() * 120D) - 60;
  8209. minimapInt3 = (int)(Math.random() * 30D) - 20;
  8210. minimapInt1 = (int) (Math.random() * 20D) - 10 & 0x7ff;
  8211. anInt1021 = 0;
  8212. anInt985 = -1;
  8213. destX = 0;
  8214. destY = 0;
  8215. playerCount = 0;
  8216. npcCount = 0;
  8217. for(int i2 = 0; i2 < maxPlayers; i2++)
  8218. {
  8219. playerArray[i2] = null;
  8220. aStreamArray895s[i2] = null;
  8221. }
  8222.  
  8223. for(int k2 = 0; k2 < 16384; k2++)
  8224. npcArray[k2] = null;
  8225.  
  8226. myPlayer = playerArray[myPlayerIndex] = new Player();
  8227. aClass19_1013.removeAll();
  8228. aClass19_1056.removeAll();
  8229. for(int l2 = 0; l2 < 4; l2++)
  8230. {
  8231. for(int i3 = 0; i3 < 104; i3++)
  8232. {
  8233. for(int k3 = 0; k3 < 104; k3++)
  8234. groundArray[l2][i3][k3] = null;
  8235.  
  8236. }
  8237.  
  8238. }
  8239. aClass19_1179 = new NodeList();
  8240. fullscreenInterfaceID = -1;
  8241. anInt900 = 0;
  8242. friendsCount = 0;
  8243. dialogID = -1;
  8244. backDialogID = -1;
  8245. openInterfaceID = -1;
  8246. invOverlayInterfaceID = -1;
  8247. anInt1018 = -1;
  8248. aBoolean1149 = false;
  8249. tabID = 3;
  8250. inputDialogState = 0;
  8251. menuOpen = false;
  8252. messagePromptRaised = false;
  8253. aString844 = null;
  8254. anInt1055 = 0;
  8255. anInt1054 = -1;
  8256. aBoolean1047 = true;
  8257. method45();
  8258. welcome();
  8259. for(int j3 = 0; j3 < 5; j3++)
  8260. anIntArray990[j3] = 0;
  8261.  
  8262. for(int l3 = 0; l3 < 5; l3++)
  8263. {
  8264. atPlayerActions[l3] = null;
  8265. atPlayerArray[l3] = false;
  8266. }
  8267.  
  8268. anInt1175 = 0;
  8269. anInt1134 = 0;
  8270. anInt986 = 0;
  8271. anInt1288 = 0;
  8272. anInt924 = 0;
  8273. anInt1188 = 0;
  8274. anInt1155 = 0;
  8275. anInt1226 = 0;
  8276. resetImageProducers2();
  8277. //if (port != 43594)
  8278. RSInterface.changeLunar();
  8279. //port = 0;
  8280. loginMessage1 = "";
  8281. loginMessage2 = "";
  8282. return;
  8283. }
  8284. if(k == 3)
  8285. {
  8286. loginMessage1 = "";
  8287. loginMessage2 = "Invalid username or password.";
  8288. return;
  8289. }
  8290. if(k == 4)
  8291. {
  8292. loginMessage1 = "Your account has been disabled.";
  8293. loginMessage2 = "Please check your disabledMessage-center for details.";
  8294. return;
  8295. }
  8296. if(k == 5)
  8297. {
  8298. loginMessage1 = "Your account is already logged in.";
  8299. loginMessage2 = "Try again in 60 secs...";
  8300. return;
  8301. }
  8302. if(k == 6)
  8303. {
  8304. loginMessage1 = "Zenith has been updated!";
  8305. loginMessage2 = "Please reload this page.";
  8306. return;
  8307. }
  8308. if(k == 7)
  8309. {
  8310. loginMessage1 = "This world is full.";
  8311. loginMessage2 = "Please use a different world.";
  8312. return;
  8313. }
  8314. if(k == 8)
  8315. {
  8316. loginMessage1 = "Unable to connect.";
  8317. loginMessage2 = "Login server offline.";
  8318. return;
  8319. }
  8320. if(k == 9)
  8321. {
  8322. loginMessage1 = "Login limit exceeded.";
  8323. loginMessage2 = "Too many connections from your address.";
  8324. return;
  8325. }
  8326. if(k == 10)
  8327. {
  8328. loginMessage1 = "Unable to connect.";
  8329. loginMessage2 = "Bad session id.";
  8330. return;
  8331. }
  8332. if(k == 11)
  8333. {
  8334. loginMessage2 = "Login server rejected session.";
  8335. loginMessage2 = "Please try again.";
  8336. return;
  8337. }
  8338. if(k == 12)
  8339. {
  8340. loginMessage1 = "You need a members account to login to this world.";
  8341. loginMessage2 = "Please subscribe, or use a different world.";
  8342. return;
  8343. }
  8344. if(k == 13)
  8345. {
  8346. loginMessage1 = "Could not complete login.";
  8347. loginMessage2 = "Please try using a different world.";
  8348. return;
  8349. }
  8350. if(k == 14)
  8351. {
  8352. loginMessage1 = "The server is being updated.";
  8353. loginMessage2 = "Please wait 1 minute and try again.";
  8354. return;
  8355. }
  8356. if(k == 15)
  8357. {
  8358. loggedIn = true;
  8359. stream.currentOffset = 0;
  8360. inStream.currentOffset = 0;
  8361. pktType = -1;
  8362. anInt841 = -1;
  8363. anInt842 = -1;
  8364. anInt843 = -1;
  8365. pktSize = 0;
  8366. anInt1009 = 0;
  8367. anInt1104 = 0;
  8368. menuActionRow = 0;
  8369. menuOpen = false;
  8370. aLong824 = System.currentTimeMillis();
  8371. return;
  8372. }
  8373. if(k == 16) {
  8374. loginMessage1 = "Login attempts exceeded.";
  8375. loginMessage2 = "Please wait 1 minute and try again.";
  8376. return;
  8377. }
  8378. if(k == 17)
  8379. {
  8380. loginMessage1 = "You are standing in a members-only area.";
  8381. loginMessage2 = "To play on this world move to a free area first";
  8382. return;
  8383. }
  8384. if(k == 20)
  8385. {
  8386. loginMessage1 = "Invalid loginserver requested";
  8387. loginMessage2 = "Please try using a different world.";
  8388. return;
  8389. }
  8390. if(k == 21)
  8391. {
  8392. for(int k1 = socketStream.read(); k1 >= 0; k1--)
  8393. {
  8394. loginMessage1 = "You have only just left another world";
  8395. loginMessage2 = "Your profile will be transferred in: " + k1 + " seconds";
  8396. drawLoginScreen(true);
  8397. try
  8398. {
  8399. Thread.sleep(1000L);
  8400. }
  8401. catch(Exception _ex) { }
  8402. }
  8403.  
  8404. login(s, s1, flag);
  8405. return;
  8406. }
  8407. if(k == -1)
  8408. {
  8409. if(i1 == 0) {
  8410. if(loginFailures < 2) {
  8411. try {
  8412. Thread.sleep(2000L);
  8413. }
  8414. catch(Exception _ex) { }
  8415. loginFailures++;
  8416. login(s, s1, flag);
  8417. return;
  8418. } else {
  8419. loginMessage1 = "You must download The latest";
  8420. loginMessage2 = "client at www.Zenith.webs.com";
  8421. return;
  8422. }
  8423. } else
  8424. {
  8425. loginMessage1 = "No response from server";
  8426. loginMessage2 = "Please try using a different world.";
  8427. return;
  8428. }
  8429. } else {
  8430. System.out.println("response:" + k);
  8431. loginMessage1 = "Unexpected server response";
  8432. loginMessage2 = "Please try using a different world.";
  8433. return;
  8434. }
  8435. }
  8436. catch(IOException _ex)
  8437. {
  8438. loginMessage1 = "";
  8439. }
  8440. loginMessage2 = "Error connecting to server.";
  8441. }
  8442.  
  8443. private boolean doWalkTo(int i, int j, int k, int i1, int j1, int k1, int l1, int i2, int j2, boolean flag, int k2) {
  8444. byte byte0 = 104;
  8445. byte byte1 = 104;
  8446. for(int l2 = 0; l2 < byte0; l2++) {
  8447. for(int i3 = 0; i3 < byte1; i3++) {
  8448. anIntArrayArray901[l2][i3] = 0;
  8449. anIntArrayArray825[l2][i3] = 0x5f5e0ff;
  8450. }
  8451. }
  8452. int j3 = j2;
  8453. int k3 = j1;
  8454. anIntArrayArray901[j2][j1] = 99;
  8455. anIntArrayArray825[j2][j1] = 0;
  8456. int l3 = 0;
  8457. int i4 = 0;
  8458. bigX[l3] = j2;
  8459. bigY[l3++] = j1;
  8460. boolean flag1 = false;
  8461. int j4 = bigX.length;
  8462. int ai[][] = aClass11Array1230[plane].anIntArrayArray294;
  8463. while(i4 != l3)
  8464. {
  8465. j3 = bigX[i4];
  8466. k3 = bigY[i4];
  8467. i4 = (i4 + 1) % j4;
  8468. if(j3 == k2 && k3 == i2)
  8469. {
  8470. flag1 = true;
  8471. break;
  8472. }
  8473. if(i1 != 0)
  8474. {
  8475. if((i1 < 5 || i1 == 10) && aClass11Array1230[plane].method219(k2, j3, k3, j, i1 - 1, i2))
  8476. {
  8477. flag1 = true;
  8478. break;
  8479. }
  8480. if(i1 < 10 && aClass11Array1230[plane].method220(k2, i2, k3, i1 - 1, j, j3))
  8481. {
  8482. flag1 = true;
  8483. break;
  8484. }
  8485. }
  8486. if(k1 != 0 && k != 0 && aClass11Array1230[plane].method221(i2, k2, j3, k, l1, k1, k3))
  8487. {
  8488. flag1 = true;
  8489. break;
  8490. }
  8491. int l4 = anIntArrayArray825[j3][k3] + 1;
  8492. if(j3 > 0 && anIntArrayArray901[j3 - 1][k3] == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0)
  8493. {
  8494. bigX[l3] = j3 - 1;
  8495. bigY[l3] = k3;
  8496. l3 = (l3 + 1) % j4;
  8497. anIntArrayArray901[j3 - 1][k3] = 2;
  8498. anIntArrayArray825[j3 - 1][k3] = l4;
  8499. }
  8500. if(j3 < byte0 - 1 && anIntArrayArray901[j3 + 1][k3] == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0)
  8501. {
  8502. bigX[l3] = j3 + 1;
  8503. bigY[l3] = k3;
  8504. l3 = (l3 + 1) % j4;
  8505. anIntArrayArray901[j3 + 1][k3] = 8;
  8506. anIntArrayArray825[j3 + 1][k3] = l4;
  8507. }
  8508. if(k3 > 0 && anIntArrayArray901[j3][k3 - 1] == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0)
  8509. {
  8510. bigX[l3] = j3;
  8511. bigY[l3] = k3 - 1;
  8512. l3 = (l3 + 1) % j4;
  8513. anIntArrayArray901[j3][k3 - 1] = 1;
  8514. anIntArrayArray825[j3][k3 - 1] = l4;
  8515. }
  8516. if(k3 < byte1 - 1 && anIntArrayArray901[j3][k3 + 1] == 0 && (ai[j3][k3 + 1] & 0x1280120) == 0)
  8517. {
  8518. bigX[l3] = j3;
  8519. bigY[l3] = k3 + 1;
  8520. l3 = (l3 + 1) % j4;
  8521. anIntArrayArray901[j3][k3 + 1] = 4;
  8522. anIntArrayArray825[j3][k3 + 1] = l4;
  8523. }
  8524. if(j3 > 0 && k3 > 0 && anIntArrayArray901[j3 - 1][k3 - 1] == 0 && (ai[j3 - 1][k3 - 1] & 0x128010e) == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0)
  8525. {
  8526. bigX[l3] = j3 - 1;
  8527. bigY[l3] = k3 - 1;
  8528. l3 = (l3 + 1) % j4;
  8529. anIntArrayArray901[j3 - 1][k3 - 1] = 3;
  8530. anIntArrayArray825[j3 - 1][k3 - 1] = l4;
  8531. }
  8532. if(j3 < byte0 - 1 && k3 > 0 && anIntArrayArray901[j3 + 1][k3 - 1] == 0 && (ai[j3 + 1][k3 - 1] & 0x1280183) == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0)
  8533. {
  8534. bigX[l3] = j3 + 1;
  8535. bigY[l3] = k3 - 1;
  8536. l3 = (l3 + 1) % j4;
  8537. anIntArrayArray901[j3 + 1][k3 - 1] = 9;
  8538. anIntArrayArray825[j3 + 1][k3 - 1] = l4;
  8539. }
  8540. if(j3 > 0 && k3 < byte1 - 1 && anIntArrayArray901[j3 - 1][k3 + 1] == 0 && (ai[j3 - 1][k3 + 1] & 0x1280138) == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0 && (ai[j3][k3 + 1] & 0x1280120) == 0)
  8541. {
  8542. bigX[l3] = j3 - 1;
  8543. bigY[l3] = k3 + 1;
  8544. l3 = (l3 + 1) % j4;
  8545. anIntArrayArray901[j3 - 1][k3 + 1] = 6;
  8546. anIntArrayArray825[j3 - 1][k3 + 1] = l4;
  8547. }
  8548. if(j3 < byte0 - 1 && k3 < byte1 - 1 && anIntArrayArray901[j3 + 1][k3 + 1] == 0 && (ai[j3 + 1][k3 + 1] & 0x12801e0) == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0 && (ai[j3][k3 + 1] & 0x1280120) == 0)
  8549. {
  8550. bigX[l3] = j3 + 1;
  8551. bigY[l3] = k3 + 1;
  8552. l3 = (l3 + 1) % j4;
  8553. anIntArrayArray901[j3 + 1][k3 + 1] = 12;
  8554. anIntArrayArray825[j3 + 1][k3 + 1] = l4;
  8555. }
  8556. }
  8557. anInt1264 = 0;
  8558. if(!flag1)
  8559. {
  8560. if(flag)
  8561. {
  8562. int i5 = 100;
  8563. for(int k5 = 1; k5 < 2; k5++)
  8564. {
  8565. for(int i6 = k2 - k5; i6 <= k2 + k5; i6++)
  8566. {
  8567. for(int l6 = i2 - k5; l6 <= i2 + k5; l6++)
  8568. if(i6 >= 0 && l6 >= 0 && i6 < 104 && l6 < 104 && anIntArrayArray825[i6][l6] < i5)
  8569. {
  8570. i5 = anIntArrayArray825[i6][l6];
  8571. j3 = i6;
  8572. k3 = l6;
  8573. anInt1264 = 1;
  8574. flag1 = true;
  8575. }
  8576.  
  8577. }
  8578.  
  8579. if(flag1)
  8580. break;
  8581. }
  8582.  
  8583. }
  8584. if(!flag1)
  8585. return false;
  8586. }
  8587. i4 = 0;
  8588. bigX[i4] = j3;
  8589. bigY[i4++] = k3;
  8590. int l5;
  8591. for(int j5 = l5 = anIntArrayArray901[j3][k3]; j3 != j2 || k3 != j1; j5 = anIntArrayArray901[j3][k3])
  8592. {
  8593. if(j5 != l5)
  8594. {
  8595. l5 = j5;
  8596. bigX[i4] = j3;
  8597. bigY[i4++] = k3;
  8598. }
  8599. if((j5 & 2) != 0)
  8600. j3++;
  8601. else
  8602. if((j5 & 8) != 0)
  8603. j3--;
  8604. if((j5 & 1) != 0)
  8605. k3++;
  8606. else
  8607. if((j5 & 4) != 0)
  8608. k3--;
  8609. }
  8610. // if(cancelWalk) { return i4 > 0; }
  8611.  
  8612.  
  8613. if(i4 > 0)
  8614. {
  8615. int k4 = i4;
  8616. if(k4 > 25)
  8617. k4 = 25;
  8618. i4--;
  8619. int k6 = bigX[i4];
  8620. int i7 = bigY[i4];
  8621. anInt1288 += k4;
  8622. if(anInt1288 >= 92)
  8623. {
  8624. stream.createFrame(36);
  8625. stream.writeDWord(0);
  8626. anInt1288 = 0;
  8627. }
  8628. if(i == 0)
  8629. {
  8630. stream.createFrame(164);
  8631. stream.writeWordBigEndian(k4 + k4 + 3);
  8632. }
  8633. if(i == 1)
  8634. {
  8635. stream.createFrame(248);
  8636. stream.writeWordBigEndian(k4 + k4 + 3 + 14);
  8637. }
  8638. if(i == 2)
  8639. {
  8640. stream.createFrame(98);
  8641. stream.writeWordBigEndian(k4 + k4 + 3);
  8642. }
  8643. stream.method433(k6 + baseX);
  8644. destX = bigX[0];
  8645. destY = bigY[0];
  8646. for(int j7 = 1; j7 < k4; j7++)
  8647. {
  8648. i4--;
  8649. stream.writeWordBigEndian(bigX[i4] - k6);
  8650. stream.writeWordBigEndian(bigY[i4] - i7);
  8651. }
  8652.  
  8653. stream.method431(i7 + baseY);
  8654. stream.method424(super.keyArray[5] != 1 ? 0 : 1);
  8655. return true;
  8656. }
  8657. return i != 1;
  8658. }
  8659.  
  8660. private void method86(Stream stream)
  8661. {
  8662. for(int j = 0; j < anInt893; j++)
  8663. {
  8664. int k = anIntArray894[j];
  8665. NPC npc = npcArray[k];
  8666. int l = stream.readUnsignedByte();
  8667. if((l & 0x10) != 0)
  8668. {
  8669. int i1 = stream.method434();
  8670. if(i1 == 65535)
  8671. i1 = -1;
  8672. int i2 = stream.readUnsignedByte();
  8673. if(i1 == npc.anim && i1 != -1)
  8674. {
  8675. int l2 = Animation.anims[i1].anInt365;
  8676. if(l2 == 1)
  8677. {
  8678. npc.anInt1527 = 0;
  8679. npc.anInt1528 = 0;
  8680. npc.anInt1529 = i2;
  8681. npc.anInt1530 = 0;
  8682. }
  8683. if(l2 == 2)
  8684. npc.anInt1530 = 0;
  8685. } else
  8686. if(i1 == -1 || npc.anim == -1 || Animation.anims[i1].anInt359 >= Animation.anims[npc.anim].anInt359)
  8687. {
  8688. npc.anim = i1;
  8689. npc.anInt1527 = 0;
  8690. npc.anInt1528 = 0;
  8691. npc.anInt1529 = i2;
  8692. npc.anInt1530 = 0;
  8693. npc.anInt1542 = npc.smallXYIndex;
  8694. }
  8695. }
  8696. if((l & 8) != 0) {//Hit update
  8697. int j1 = stream.readWordA();
  8698. int j2 = stream.method427();
  8699. int icon = stream.readUnsignedByte();
  8700. npc.updateHitData(j2, j1, loopCycle, icon, 0);
  8701. npc.loopCycleStatus = loopCycle + 300;
  8702. npc.currentHealth = stream.readWordA();
  8703. npc.maxHealth = stream.readWordA();
  8704. }
  8705. if((l & 0x80) != 0) {//Hit update
  8706. npc.anInt1520 = stream.readUnsignedWord();
  8707. int k1 = stream.readDWord();
  8708. npc.anInt1524 = k1 >> 16;
  8709. npc.anInt1523 = loopCycle + (k1 & 0xffff);
  8710. npc.anInt1521 = 0;
  8711. npc.anInt1522 = 0;
  8712. if(npc.anInt1523 > loopCycle)
  8713. npc.anInt1521 = -1;
  8714. if(npc.anInt1520 == 65535)
  8715. npc.anInt1520 = -1;
  8716. }
  8717. if((l & 0x20) != 0) {
  8718. npc.interactingEntity = stream.readUnsignedWord();
  8719. if(npc.interactingEntity == 65535)
  8720. npc.interactingEntity = -1;
  8721. }
  8722. if((l & 1) != 0) {
  8723. npc.textSpoken = stream.readString();
  8724. npc.textCycle = 100;
  8725. // entityMessage(npc);
  8726.  
  8727. }
  8728. if((l & 0x40) != 0) {
  8729. int l1 = stream.readWordA();
  8730. int k2 = stream.method428();
  8731. int icon = stream.readUnsignedByte();
  8732. npc.updateHitData(k2, l1, loopCycle, icon, 0);
  8733. npc.loopCycleStatus = loopCycle + 300;
  8734. npc.currentHealth = stream.readWordA();
  8735. npc.maxHealth = stream.readWordA();
  8736. }
  8737. if((l & 2) != 0)
  8738. {
  8739. npc.desc = EntityDef.forID(stream.method436());
  8740. npc.anInt1540 = npc.desc.aByte68;
  8741. npc.anInt1504 = npc.desc.anInt79;
  8742. npc.anInt1554 = npc.desc.anInt67;
  8743. npc.anInt1555 = npc.desc.anInt58;
  8744. npc.anInt1556 = npc.desc.anInt83;
  8745. npc.anInt1557 = npc.desc.anInt55;
  8746. npc.anInt1511 = npc.desc.anInt77;
  8747. }
  8748. if((l & 4) != 0)
  8749. {
  8750. npc.anInt1538 = stream.method434();
  8751. npc.anInt1539 = stream.method434();
  8752. }
  8753. }
  8754. }
  8755.  
  8756. private void buildAtNPCMenu(EntityDef entityDef, int i, int j, int k)
  8757. {
  8758. if(menuActionRow >= 400)
  8759. return;
  8760. if(entityDef.childrenIDs != null)
  8761. entityDef = entityDef.method161();
  8762. if(entityDef == null)
  8763. return;
  8764. if(!entityDef.aBoolean84)
  8765. return;
  8766. String s = entityDef.name;
  8767. if(entityDef.combatLevel != 0)
  8768. s = s + combatDiffColor(myPlayer.combatLevel, entityDef.combatLevel) + " (level: " + entityDef.combatLevel + ")";
  8769. if(itemSelected == 1)
  8770. {
  8771. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @yel@" + s;
  8772. menuActionID[menuActionRow] = 582;
  8773. menuActionCmd1[menuActionRow] = i;
  8774. menuActionCmd2[menuActionRow] = k;
  8775. menuActionCmd3[menuActionRow] = j;
  8776. menuActionRow++;
  8777. return;
  8778. }
  8779. if(spellSelected == 1)
  8780. {
  8781. if((spellUsableOn & 2) == 2)
  8782. {
  8783. menuActionName[menuActionRow] = spellTooltip + " @yel@" + s;
  8784. menuActionID[menuActionRow] = 413;
  8785. menuActionCmd1[menuActionRow] = i;
  8786. menuActionCmd2[menuActionRow] = k;
  8787. menuActionCmd3[menuActionRow] = j;
  8788. menuActionRow++;
  8789. }
  8790. } else
  8791. {
  8792. if(entityDef.itemActions != null)
  8793. {
  8794. for(int l = 4; l >= 0; l--)
  8795. if(entityDef.itemActions[l] != null && !entityDef.itemActions[l].equalsIgnoreCase("attack"))
  8796. {
  8797. menuActionName[menuActionRow] = entityDef.itemActions[l] + " @yel@" + s;
  8798. if(l == 0)
  8799. menuActionID[menuActionRow] = 20;
  8800. if(l == 1)
  8801. menuActionID[menuActionRow] = 412;
  8802. if(l == 2)
  8803. menuActionID[menuActionRow] = 225;
  8804. if(l == 3)
  8805. menuActionID[menuActionRow] = 965;
  8806. if(l == 4)
  8807. menuActionID[menuActionRow] = 478;
  8808. menuActionCmd1[menuActionRow] = i;
  8809. menuActionCmd2[menuActionRow] = k;
  8810. menuActionCmd3[menuActionRow] = j;
  8811. menuActionRow++;
  8812. }
  8813.  
  8814. }
  8815. if(entityDef.itemActions != null)
  8816. {
  8817. for(int i1 = 4; i1 >= 0; i1--)
  8818. if(entityDef.itemActions[i1] != null && entityDef.itemActions[i1].equalsIgnoreCase("attack"))
  8819. {
  8820. char c = '\0';
  8821. //if(entityDef.combatLevel > myPlayer.combatLevel)
  8822. // c = '\u07D0';
  8823. if (!isOneClick) {
  8824. if (entityDef.combatLevel > myPlayer.combatLevel)
  8825. c = '\u07D0';
  8826. }
  8827. menuActionName[menuActionRow] = entityDef.itemActions[i1] + " @yel@" + s;
  8828. if(i1 == 0)
  8829. menuActionID[menuActionRow] = 20 + c;
  8830. if(i1 == 1)
  8831. menuActionID[menuActionRow] = 412 + c;
  8832. if(i1 == 2)
  8833. menuActionID[menuActionRow] = 225 + c;
  8834. if(i1 == 3)
  8835. menuActionID[menuActionRow] = 965 + c;
  8836. if(i1 == 4)
  8837. menuActionID[menuActionRow] = 478 + c;
  8838. menuActionCmd1[menuActionRow] = i;
  8839. menuActionCmd2[menuActionRow] = k;
  8840. menuActionCmd3[menuActionRow] = j;
  8841. menuActionRow++;
  8842. }
  8843.  
  8844. }
  8845. if(idToggle == true) {
  8846. menuActionName[menuActionRow] = "Examine @yel@" + s + " @gre@(@whi@" + entityDef.interfaceType + "@gre@)";
  8847. } else {
  8848. menuActionName[menuActionRow] = "Examine @yel@" + s;
  8849. }
  8850. menuActionID[menuActionRow] = 1025;
  8851. menuActionCmd1[menuActionRow] = i;
  8852. menuActionCmd2[menuActionRow] = k;
  8853. menuActionCmd3[menuActionRow] = j;
  8854. menuActionRow++;
  8855. }
  8856. }
  8857.  
  8858. public String loyaltyRank(int i){
  8859. switch(i) {
  8860. case 1:
  8861. return "Recruit ";
  8862. case 2:
  8863. return "Novice ";
  8864. case 3:
  8865. return "Pvmer ";
  8866. case 4:
  8867. return "Skiller ";
  8868. case 5:
  8869. return "<col=65280>The Rich ";
  8870. case 6:
  8871. return "The Pker ";
  8872. case 7:
  8873. return "Slayer ";
  8874. case 8:
  8875. return "God ";
  8876. case 9:
  8877. return "<col=65535>Overlord ";
  8878. case 10:
  8879. return "The Great ";
  8880. case 11:
  8881. return "Mr Killstreak ";
  8882. case 12:
  8883. return "Death ";
  8884. case 13:
  8885. return "Live ";
  8886. case 14:
  8887. return "Unbeatable ";
  8888. case 15:
  8889. return "Greatest ";
  8890. case 16:
  8891. return "Staker ";
  8892. case 17:
  8893. return "King ";
  8894. case 18:
  8895. return "Queen ";
  8896. case 19:
  8897. return "Unbeatable ";
  8898. case 20:
  8899. return "3 Hunna ";
  8900. case 21:
  8901. return "Legend ";
  8902. case 22:
  8903. return "Boss ";
  8904. case 23:
  8905. return "Duchess ";
  8906. case 24:
  8907. return "Queen ";
  8908. }
  8909. return "";
  8910. }
  8911.  
  8912. private void buildAtPlayerMenu(int i, int j, Player player, int k)
  8913. {
  8914. if(player == myPlayer)
  8915. return;
  8916. if(menuActionRow >= 400)
  8917. return;
  8918. String s;
  8919. if(player.skill < 8) {
  8920.  
  8921. s = "@or2@" + loyaltyRank(player.loyaltyRank) + "@whi@" + player.name + combatDiffColor(myPlayer.combatLevel, player.combatLevel) + " (level: " + player.combatLevel + ")";
  8922.  
  8923. } else {
  8924. s = "@or2@" + loyaltyRank(player.loyaltyRank) + "@whi@" + player.name + combatDiffColor(myPlayer.combatLevel, player.combatLevel) + " (level: " + getCombatLevel(player)+ ")";
  8925. }
  8926.  
  8927. if(itemSelected == 1)
  8928. {
  8929. menuActionName[menuActionRow] = "Use " + selectedItemName + " -> @whi@" + s;
  8930. menuActionID[menuActionRow] = 491;
  8931. menuActionCmd1[menuActionRow] = j;
  8932. menuActionCmd2[menuActionRow] = i;
  8933. menuActionCmd3[menuActionRow] = k;
  8934. menuActionRow++;
  8935. } else
  8936. if(spellSelected == 1)
  8937. {
  8938. if((spellUsableOn & 8) == 8)
  8939. {
  8940. menuActionName[menuActionRow] = spellTooltip + " @whi@" + s;
  8941. menuActionID[menuActionRow] = 365;
  8942. menuActionCmd1[menuActionRow] = j;
  8943. menuActionCmd2[menuActionRow] = i;
  8944. menuActionCmd3[menuActionRow] = k;
  8945. menuActionRow++;
  8946. }
  8947. } else
  8948. {
  8949. for(int l = 4; l >= 0; l--)
  8950. if(atPlayerActions[l] != null)
  8951. {
  8952. menuActionName[menuActionRow] = atPlayerActions[l] + " @whi@" + s;
  8953. char c = '\0';
  8954. if(atPlayerActions[l].equalsIgnoreCase("attack")) {
  8955. //if(player.combatLevel > myPlayer.combatLevel)
  8956. // c = '\u07D0';
  8957. if (!isOneClick) {
  8958. if (player.combatLevel > myPlayer.combatLevel)
  8959. c = '\u07D0';
  8960. }
  8961. if(myPlayer.team != 0 && player.team != 0)
  8962. if(myPlayer.team == player.team)
  8963. c = '\u07D0';
  8964. else
  8965. c = '\0';
  8966. } else
  8967. if(atPlayerArray[l])
  8968. c = '\u07D0';
  8969. if(l == 0)
  8970. menuActionID[menuActionRow] = 561 + c;
  8971. if(l == 1)
  8972. menuActionID[menuActionRow] = 779 + c;
  8973. if(l == 2)
  8974. menuActionID[menuActionRow] = 27 + c;
  8975. if(l == 3)
  8976. menuActionID[menuActionRow] = 577 + c;
  8977. if(l == 4)
  8978. menuActionID[menuActionRow] = 729 + c;
  8979. menuActionCmd1[menuActionRow] = j;
  8980. menuActionCmd2[menuActionRow] = i;
  8981. menuActionCmd3[menuActionRow] = k;
  8982. menuActionRow++;
  8983. }
  8984.  
  8985. }
  8986. for(int i1 = 0; i1 < menuActionRow; i1++)
  8987. if(menuActionID[i1] == 516)
  8988. {
  8989. menuActionName[i1] = "Walk here @whi@" + s;
  8990. return;
  8991. }
  8992.  
  8993. }
  8994.  
  8995. private void method89(Class30_Sub1 class30_sub1)
  8996. {
  8997. int i = 0;
  8998. int j = -1;
  8999. int k = 0;
  9000. int l = 0;
  9001. if(class30_sub1.anInt1296 == 0)
  9002. i = worldController.method300(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  9003. if(class30_sub1.anInt1296 == 1)
  9004. i = worldController.method301(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  9005. if(class30_sub1.anInt1296 == 2)
  9006. i = worldController.method302(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  9007. if(class30_sub1.anInt1296 == 3)
  9008. i = worldController.method303(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  9009. if(i != 0)
  9010. {
  9011. int i1 = worldController.method304(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298, i);
  9012. j = i >> 14 & 0x7fff;
  9013. k = i1 & 0x1f;
  9014. l = i1 >> 6;
  9015. }
  9016. class30_sub1.anInt1299 = j;
  9017. class30_sub1.anInt1301 = k;
  9018. class30_sub1.anInt1300 = l;
  9019. }
  9020.  
  9021. private void method90()
  9022. {
  9023. for(int i = 0; i < anInt1062; i++)
  9024. if(anIntArray1250[i] <= 0)
  9025. {
  9026. boolean flag1 = false;
  9027. try
  9028. {
  9029. if(anIntArray1207[i] == anInt874 && anIntArray1241[i] == anInt1289)
  9030. {
  9031. if(!replayWave())
  9032. flag1 = true;
  9033. } else
  9034. {
  9035. Stream stream = Sounds.method241(anIntArray1241[i], anIntArray1207[i]);
  9036. if(System.currentTimeMillis() + (long)(stream.currentOffset / 22) > aLong1172 + (long)(anInt1257 / 22))
  9037. {
  9038. anInt1257 = stream.currentOffset;
  9039. aLong1172 = System.currentTimeMillis();
  9040. if(saveWave(stream.buffer, stream.currentOffset))
  9041. {
  9042. anInt874 = anIntArray1207[i];
  9043. anInt1289 = anIntArray1241[i];
  9044. } else
  9045. {
  9046. flag1 = true;
  9047. }
  9048. }
  9049. }
  9050. }
  9051. catch(Exception exception) { }
  9052. if(!flag1 || anIntArray1250[i] == -5)
  9053. {
  9054. anInt1062--;
  9055. for(int j = i; j < anInt1062; j++)
  9056. {
  9057. anIntArray1207[j] = anIntArray1207[j + 1];
  9058. anIntArray1241[j] = anIntArray1241[j + 1];
  9059. anIntArray1250[j] = anIntArray1250[j + 1];
  9060. }
  9061.  
  9062. i--;
  9063. } else
  9064. {
  9065. anIntArray1250[i] = -5;
  9066. }
  9067. } else
  9068. {
  9069. anIntArray1250[i]--;
  9070. }
  9071.  
  9072. if(prevSong > 0)
  9073. {
  9074. prevSong -= 20;
  9075. if(prevSong < 0)
  9076. prevSong = 0;
  9077. if(prevSong == 0 && musicEnabled && !lowMem)
  9078. {
  9079. nextSong = currentSong;
  9080. songChanging = true;
  9081. onDemandFetcher.loadToCache(2, nextSong);
  9082. }
  9083. }
  9084. }
  9085.  
  9086. public boolean summHover = false;
  9087.  
  9088. /*
  9089. ** Fullscreen
  9090. ** Zerix
  9091. ** Maker: Brkownz
  9092. */
  9093.  
  9094. private int yPaddingmapBackImage = 0; private int xPaddingmapBackImage = 516;
  9095. private int xPaddingtabBack = 519; private int yPaddingtabBack = 168;
  9096. public static int chatIncreaseY = 0; public static int chatIncreaseX = 0;
  9097. public static boolean toggleFullscreen;
  9098. private int main3DAreaWidth = 512; private int main3DAreaHeight = 334;
  9099. private void switchToNormal() {
  9100. toggleFullscreen = false;
  9101. sendFrame36(652, 0);
  9102. recreateClientFrame(false, 765, 503, false, 1, false);
  9103. this.welcomeScreenRaised = true;
  9104. }
  9105.  
  9106. private void switchToFullScreen() {
  9107. toggleFullscreen = !toggleFullscreen;
  9108. sendFrame36(652, toggleFullscreen ? 1 : 0);
  9109. if (toggleFullscreen) {
  9110. recreateClientFrame(true, getScreenWidth(), getScreenHeight(), false, 0, true);
  9111. } else {
  9112. recreateClientFrame(false, 765, 503, false, 1, false);
  9113. this.welcomeScreenRaised = true;
  9114. }
  9115. }
  9116.  
  9117. public void recreateClientFrame(boolean undecorative, int width, int height, boolean resizable, int displayMode, boolean toggle)
  9118. {
  9119. this.main3DAreaWidth = (displayMode == 1 ? 512 : instance.getScreenWidth());
  9120. this.main3DAreaHeight = (displayMode == 1 ? 334 : getScreenHeight());
  9121. //load3DArea();
  9122. instance.recreateClientFrame(undecorative, width, height, resizable);
  9123. System.out.println("displayMode: " + displayMode);
  9124.  
  9125. main3DArea = new RSImageProducer(this.main3DAreaWidth, this.main3DAreaHeight, getGameComponent());
  9126.  
  9127. this.mouseX = (this.mouseY = -1);
  9128. }
  9129.  
  9130. public static int getChatBackIncreaseY() {
  9131. return client.chatIncreaseY = toggleFullscreen ? getScreenHeight() - 503 : 0;
  9132. }
  9133.  
  9134. private int getMapIncreaseX() {
  9135. return toggleFullscreen ? getScreenWidth() - 765 + 52 : 0;
  9136. }
  9137.  
  9138. private int getMapIncreaseY() {
  9139. return toggleFullscreen ? 4 : 0;
  9140. }
  9141.  
  9142. private int getTabIncreaseX() {
  9143. return toggleFullscreen ? getScreenWidth() - 765 : 0;
  9144. }
  9145.  
  9146. private int getTabIncreaseY() {
  9147. return toggleFullscreen ? getScreenHeight() - 503 : 0;
  9148. }
  9149.  
  9150. private int getScreenWidth() {
  9151. int i = 0;
  9152. if (toggleFullscreen) {
  9153. toolkit = Toolkit.getDefaultToolkit();
  9154. screenSize = toolkit.getScreenSize();
  9155. i = (int)screenSize.getWidth();
  9156. } else {
  9157. i = 765;
  9158. }
  9159. return i;
  9160. }
  9161.  
  9162. private static int getScreenHeight()
  9163. {
  9164. int i = 0;
  9165. if (toggleFullscreen) {
  9166. toolkit = Toolkit.getDefaultToolkit();
  9167. screenSize = toolkit.getScreenSize();
  9168. i = (int)screenSize.getHeight();
  9169. } else {
  9170. i = 503;
  9171. }
  9172. return i;
  9173. }
  9174.  
  9175. void startUp(){
  9176.  
  9177. drawLoadingText(20, "Starting up");
  9178. //new CacheDownloader(this).downloadCache();
  9179.  
  9180. //ClientUpdate.checkVersion();
  9181. if(signlink.sunjava)
  9182. super.minDelay = 5;
  9183. getDocumentBaseHost();
  9184. if(signlink.cache_dat != null) {
  9185. for(int i = 0; i < 5; i++)
  9186. decompressors[i] = new Decompressor(signlink.cache_dat, signlink.cache_idx[i], i + 1);
  9187. }
  9188. try {
  9189. titleStreamLoader = streamLoaderForName(1, "title screen", "title");
  9190. smallText = new RSFont(false, "p11_full", titleStreamLoader);
  9191. aTextDrawingArea_1271 = new RSFont(false, "p12_full", titleStreamLoader);
  9192. chatTextDrawingArea = new RSFont(false, "b12_full", titleStreamLoader);
  9193. RSFont aTextDrawingArea_1273 = new RSFont(true, "q8_full", titleStreamLoader);
  9194. newSmallFont = new TextDrawingArea(false, "p11_full", titleStreamLoader);
  9195. newRegularFont = new TextDrawingArea(false, "p12_full", titleStreamLoader);
  9196. newBoldFont = new TextDrawingArea(false, "b12_full", titleStreamLoader);
  9197. newFancyFont = new TextDrawingArea(true, "q8_full", titleStreamLoader);
  9198. //UserInterface.fonts = newFonts;
  9199. newSmallFont.unpackChatImages(chatImages);
  9200. newRegularFont.unpackChatImages(chatImages);
  9201. newBoldFont.unpackChatImages(chatImages);
  9202. newFancyFont.unpackChatImages(chatImages);
  9203. backgroundWorld1 = new Sprite("world1");
  9204. backgroundWorld2 = new Sprite("world2");
  9205. drawLogo();
  9206. loadTitleScreen();
  9207. NamedArchive archive = streamLoaderForName(2, "config", "config");
  9208. NamedArchive streamLoader_1 = streamLoaderForName(3, "interface", "interface");
  9209. NamedArchive mediaArchive = streamLoaderForName(4, "2d graphics", "media");
  9210. NamedArchive streamLoader_3 = streamLoaderForName(6, "textures", "textures");
  9211. NamedArchive streamLoader_4 = streamLoaderForName(7, "chat system", "wordenc");
  9212. streamLoaderForName(8, "sound effects", "sounds");
  9213. byteGroundArray = new byte[4][104][104];
  9214. intGroundArray = new int[4][105][105];
  9215. worldController = new WorldController(intGroundArray);
  9216. for(int j = 0; j < 4; j++)
  9217. aClass11Array1230[j] = new Class11();
  9218. aSprite_1263 = new Sprite(512, 512);
  9219. NamedArchive streamLoader_6 = streamLoaderForName(5, "update list", "versionlist");
  9220. drawLoadingText(60, "Unpacking media");
  9221. onDemandFetcher = new OnDemandFetcher();
  9222. onDemandFetcher.start(streamLoader_6, this);
  9223. AnimFrame.method528(onDemandFetcher.getAnimCount());
  9224. Model.method459(onDemandFetcher.getModelCount(), onDemandFetcher);
  9225. /* All 525 Models */
  9226. ModelDecompressor.hdgfx();
  9227. //ModelDecompressor.raw();
  9228. preloadModels();
  9229. System.out.println("Loaded 525 graphics");
  9230. drawLoadingText(70, "Loading models");
  9231. ModelDecompressor.loadModelDataFile();
  9232. //DataBase.loadAnimations();
  9233. //DataBase.unpackAnimations();
  9234. //DataBase.packAnimations();
  9235.  
  9236. /* Custom sprite unpacking */
  9237. loadExtraSprites();
  9238. loadingPleaseWait = new Sprite("loadingPleaseWait");
  9239. reestablish = new Sprite("reestablish");
  9240. compass = new Sprite(mediaArchive, "compass", 0);
  9241. new Sprite("maparea");
  9242. multiOverlay = new Sprite(mediaArchive, "overlay_multiway", 0);
  9243. HPBarFull = new Sprite(sign.signlink.findcachedir() + "Sprites/Player/HP 0.PNG", 1);
  9244. HPBarEmpty = new Sprite(sign.signlink.findcachedir() + "Sprites/Player/HP 1.PNG", 1);
  9245. mapBack = new Background(mediaArchive, "mapback", 0);
  9246. new Sprite(mediaArchive, "screenframe", 2);
  9247. for(int i = 0; i <= 3; i++) {
  9248. combatIcons[i] = new Sprite("Player/combatIcon "+i+"");
  9249. }
  9250. for(int c1 = 0; c1 <= 3; c1++)
  9251. chatButtons[c1] = new Sprite(mediaArchive, "chatbuttons", c1);
  9252.  
  9253. for(int j3 = 0; j3 <= 13; j3++)
  9254. sideIcons[j3] = new Sprite(mediaArchive, "sideicons", j3);
  9255.  
  9256. for(int j3 = 0; j3 <= 13; j3++) {
  9257. if (j3 == 13) sideIcons[j3] = new Sprite("Gameframe/SIcons/483/"+j3+"");
  9258. sIcons483[j3] = new Sprite("Gameframe/SIcons/483/"+j3+"");
  9259. }
  9260.  
  9261. for(int j3 = 0; j3 <= 12; j3++)
  9262. sIcons459[j3] = new Sprite("Gameframe/SIcons/459/SIDEICONS "+j3+"");
  9263.  
  9264. smallHit = newRegularFont;
  9265. bigHit = newRegularFont;//new TextDrawingArea(signlink.findcachedir()+ "Sprites/Fonts/critical.rsf");
  9266. //bigHit = newTextDrawingArea(signlink.findcachedir()+ "Sprites/Fonts/critical.rsf");
  9267.  
  9268. // block = new Sprite("Player/hitmarks/0.png");
  9269. int hitMarkSlot = -1;
  9270. for(int i4 = 1; i4 < 19; i4++) {
  9271. hitMarkSlot++;
  9272. if(i4 < 4)
  9273. hitMark[hitMarkSlot] = new Sprite("Player/hitmarks/"+i4);
  9274. else
  9275. hitMark[hitMarkSlot] = new Sprite("Player/hitmarks2/"+(i4-4));
  9276. }
  9277. for(int i4 = 0; i4 < 6; i4++)
  9278. hitIcon[i4] = new Sprite("Player/hiticons/"+i4);
  9279.  
  9280. for(int nSI = 0; nSI <= 15; nSI++)
  9281. newSideIcons[nSI] = new Sprite("Gameframe/SIcons/562/icon "+nSI);
  9282. tabHover = new Sprite("Gameframe/SIcons/562/tabhover");
  9283. tabClicked = new Sprite("Gameframe/SIcons/562/tabclicked1");
  9284. for(int i = 0; i <= 3; i++) {
  9285. combatIcons[i] = new Sprite("Player/combatIcon "+i+"");
  9286. }
  9287.  
  9288. for(int r1 = 0; r1 < 15; r1++)
  9289. redStones[r1] = new Sprite("redstones " + r1);
  9290. mapEdge = new Sprite(mediaArchive, "mapedge", 0);
  9291. mapEdge.method345();
  9292. try {
  9293. for(int k3 = 0; k3 < 100; k3++)
  9294. mapScenes[k3] = new Background(mediaArchive, "mapscene", k3);
  9295. }
  9296. catch(Exception _ex) { }
  9297. try {
  9298. for(int l3 = 0; l3 < 100; l3++)
  9299. mapFunctions[l3] = new Sprite(mediaArchive, "mapfunction", l3);
  9300. }
  9301. catch(Exception _ex) { }
  9302. try
  9303. {
  9304. for(int i4 = 0; i4 < 20; i4++)
  9305. hitMarks[i4] = new Sprite(mediaArchive, "hitmarks", i4);
  9306. }
  9307. catch(Exception _ex) { }
  9308. try
  9309. {
  9310. for(int h1 = 0; h1 < 6; h1++)
  9311. headIconsHint[h1] = new Sprite(mediaArchive, "headicons_hint", h1);
  9312. } catch(Exception _ex) { }
  9313. try {
  9314. for(int j4 = 0; j4 < 8; j4++)
  9315. headIcons[j4] = new Sprite(mediaArchive, "headicons_prayer", j4);
  9316. for(int idx = 0; idx < 18; idx++)
  9317. headIcons[idx] = new Sprite("Player/Prayer/Prayer "+idx);
  9318. for(int j45 = 0; j45 < 3; j45++)
  9319. skullIcons[j45] = new Sprite(mediaArchive, "headicons_pk", j45 );
  9320. }
  9321. catch(Exception _ex) { }
  9322. mapFlag = new Sprite(mediaArchive, "mapmarker", 0);
  9323. mapMarker = new Sprite(mediaArchive, "mapmarker", 1);
  9324. for(int k4 = 0; k4 < 8; k4++)
  9325. crosses[k4] = new Sprite(mediaArchive, "cross", k4);
  9326.  
  9327. mapDotItem = new Sprite(mediaArchive, "mapdots", 0);
  9328. mapDotNPC = new Sprite(mediaArchive, "mapdots", 1);
  9329. mapDotPlayer = new Sprite(mediaArchive, "mapdots", 2);
  9330. mapDotFriend = new Sprite(mediaArchive, "mapdots", 3);
  9331. mapDotTeam = new Sprite(mediaArchive, "mapdots", 4);
  9332. mapDotClan = new Sprite(mediaArchive, "mapdots", 5);
  9333.  
  9334. scrollBar1 = new Sprite(mediaArchive, "scrollbar", 0);
  9335. scrollBar2 = new Sprite(mediaArchive, "scrollbar", 1);
  9336.  
  9337. scrollBar3 = new Sprite("Gameframe/SCROLLBAR 0");
  9338. scrollBar4 = new Sprite("Gameframe/SCROLLBAR 1");
  9339.  
  9340. Sprite sprite = new Sprite(mediaArchive, "screenframe", 0);
  9341. leftFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  9342. sprite.method346(0, 0);
  9343. sprite = new Sprite(mediaArchive, "screenframe", 1);
  9344. topFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  9345. sprite.method346(0, 0);
  9346. sprite = new Sprite(mediaArchive, "screenframe", 2);
  9347. new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  9348. sprite.method346(0, 0);
  9349. sprite = new Sprite(mediaArchive, "mapedge", 0);
  9350. new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  9351. sprite.method346(0, 0);
  9352.  
  9353.  
  9354. /*for(int i6 = 0; i6 < 100; i6++)
  9355. {
  9356. if(mapFunctions[i6] != null)
  9357. mapFunctions[i6].method344(l5, j5 + l5, k5 + l5);
  9358. if(mapScenes[i6] != null)
  9359. mapScenes[i6].method360(i5 + l5, j5 + l5, k5 + l5);
  9360. }*/
  9361. drawLoadingText(83, "Unpacking textures");
  9362. Texture.method368(streamLoader_3);
  9363. Texture.method372(0.80000000000000004D);
  9364. Texture.method367();
  9365. drawLoadingText(86, "Unpacking config");
  9366. try {
  9367. Animation.unpackConfig(archive);
  9368. ObjectDef.unpackConfig(archive);
  9369. Flo.unpackConfig(archive);
  9370. ItemDef.unpackConfig(archive);
  9371. EntityDef.unpackConfig(archive);
  9372. IdentityKit.unpackConfig(archive);
  9373. SpotAnim.unpackConfig(archive);
  9374. Varp.unpackConfig(archive);
  9375. VarBit.unpackConfig(archive);
  9376. ItemDef.isMembers = true;
  9377. } catch(Exception e) {
  9378. e.printStackTrace();
  9379. }
  9380. drawLoadingText(95, "Unpacking interfaces");
  9381. RSFont aclass30_sub2_sub1_sub4s[] = {
  9382. smallText, aTextDrawingArea_1271, chatTextDrawingArea, aTextDrawingArea_1273
  9383. };
  9384. RSInterface.fonts = aclass30_sub2_sub1_sub4s;
  9385. RSInterface.unpack(streamLoader_1, aclass30_sub2_sub1_sub4s, mediaArchive);
  9386. drawLoadingText(100, "Preparing game engine");
  9387. for(int j6 = 0; j6 < 33; j6++)
  9388. {
  9389. int k6 = 999;
  9390. int i7 = 0;
  9391. for(int k7 = 0; k7 < 34; k7++)
  9392. {
  9393. if(mapBack.aByteArray1450[k7 + j6 * mapBack.anInt1452] == 0)
  9394. {
  9395. if(k6 == 999)
  9396. k6 = k7;
  9397. continue;
  9398. }
  9399. if(k6 == 999)
  9400. continue;
  9401. i7 = k7;
  9402. break;
  9403. }
  9404.  
  9405. anIntArray968[j6] = k6;
  9406. anIntArray1057[j6] = i7 - k6;
  9407. }
  9408. for (int l6 = 1; l6 < 153; l6++) {
  9409. int j7 = 999;
  9410. int l7 = 0;
  9411. for (int j8 = 24; j8 < 177; j8++) {
  9412. if (mapBack.aByteArray1450[j8 + l6 * mapBack.anInt1452] == 0 && (j8 > 34 || l6 > 34)) {
  9413. if (j7 == 999) {
  9414. j7 = j8;
  9415. }
  9416. continue;
  9417. }
  9418. if (j7 == 999) {
  9419. continue;
  9420. }
  9421. l7 = j8;
  9422. break;
  9423. }
  9424.  
  9425. anIntArray1052[l6 - 1] = j7 - 24;
  9426. anIntArray1229[l6 - 1] = l7 - j7;
  9427. }
  9428. Texture.method365(765, 503);
  9429. fullScreenTextureArray = Texture.anIntArray1472;
  9430. Texture.method365(516, 165);//519
  9431. anIntArray1180 = Texture.anIntArray1472;
  9432. Texture.method365(250, 335);
  9433. anIntArray1181 = Texture.anIntArray1472;
  9434. Texture.method365(512, 334);//512 334
  9435. anIntArray1182 = Texture.anIntArray1472;
  9436.  
  9437. int ai[] = new int[9];
  9438. for(int i8 = 0; i8 < 9; i8++)
  9439. {
  9440. int k8 = 128 + i8 * 32 + 15;
  9441. int l8 = 600 + k8 * 3;
  9442. int i9 = Texture.anIntArray1470[k8];
  9443. ai[i8] = l8 * i9 >> 16;
  9444. }
  9445.  
  9446. WorldController.method310(500, 800, 512, 334, ai);
  9447.  
  9448. Censor.loadConfig(streamLoader_4);
  9449. mouseDetection = new MouseDetection(this);
  9450. startRunnable(mouseDetection, 10);
  9451. Animable_Sub5.clientInstance = this;
  9452. ObjectDef.clientInstance = this;
  9453. EntityDef.clientInstance = this;
  9454. return;
  9455. }
  9456. catch(Exception exception)
  9457. {
  9458. exception.printStackTrace();
  9459. signlink.reporterror("loaderror " + aString1049 + " " + anInt1079);
  9460. }
  9461. loadingError = true;
  9462. }
  9463.  
  9464. private void method91(Stream stream, int i)
  9465. {
  9466. while(stream.bitPosition + 10 < i * 8)
  9467. {
  9468. int j = stream.readBits(11);
  9469. if(j == 2047)
  9470. break;
  9471. if(playerArray[j] == null)
  9472. {
  9473. playerArray[j] = new Player();
  9474. if(aStreamArray895s[j] != null)
  9475. playerArray[j].updatePlayer(aStreamArray895s[j]);
  9476. }
  9477. playerIndices[playerCount++] = j;
  9478. Player player = playerArray[j];
  9479. player.anInt1537 = loopCycle;
  9480. int k = stream.readBits(1);
  9481. if(k == 1)
  9482. anIntArray894[anInt893++] = j;
  9483. int l = stream.readBits(1);
  9484. int i1 = stream.readBits(5);
  9485. if(i1 > 15)
  9486. i1 -= 32;
  9487. int j1 = stream.readBits(5);
  9488. if(j1 > 15)
  9489. j1 -= 32;
  9490. player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1, l == 1);
  9491. }
  9492. stream.finishBitAccess();
  9493. }
  9494.  
  9495. private void processMainScreenClick() {
  9496. if(anInt1021 != 0)
  9497. return;
  9498. if(super.clickMode3 == 1) {
  9499. if(is474 == true || is480 == true || is508 == true || is525 == true || is562 == true) {
  9500. int i = super.saveClickX - 25 - 530;//
  9501. int j = super.saveClickY - 8;
  9502. if(i >= 0 && j >= 0 && i < 146 && j < 151) {
  9503. i -= 73;
  9504. j -= 75;
  9505. int k = minimapInt1 + minimapInt2 & 0x7ff;
  9506. int i1 = Texture.anIntArray1470[k];
  9507. int j1 = Texture.anIntArray1471[k];
  9508. i1 = i1 * (minimapInt3 + 256) >> 8;
  9509. j1 = j1 * (minimapInt3 + 256) >> 8;
  9510. int k1 = j * i1 + i * j1 >> 11;
  9511. int l1 = j * j1 - i * i1 >> 11;
  9512. int i2 = myPlayer.x + k1 >> 7;
  9513. int j2 = myPlayer.y - l1 >> 7;
  9514. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0, j2, myPlayer.smallX[0], true, i2);
  9515. if(flag1) {
  9516. stream.writeWordBigEndian(i);
  9517. stream.writeWordBigEndian(j);
  9518. stream.writeWord(minimapInt1);
  9519. stream.writeWordBigEndian(57);
  9520. stream.writeWordBigEndian(minimapInt2);
  9521. stream.writeWordBigEndian(minimapInt3);
  9522. stream.writeWordBigEndian(89);
  9523. stream.writeWord(myPlayer.x);
  9524. stream.writeWord(myPlayer.y);
  9525. stream.writeWordBigEndian(anInt1264);
  9526. stream.writeWordBigEndian(63);
  9527. }
  9528. }
  9529. } else {
  9530. int i = super.saveClickX - 25 - 545;//545
  9531. int j = super.saveClickY - 5 - 4;
  9532. if(i >= 0 && j >= 0 && i < 146 && j < 151) {
  9533. i -= 73;
  9534. j -= 75;
  9535. int k = minimapInt1 + minimapInt2 & 0x7ff;
  9536. int i1 = Texture.anIntArray1470[k];
  9537. int j1 = Texture.anIntArray1471[k];
  9538. i1 = i1 * (minimapInt3 + 256) >> 8;
  9539. j1 = j1 * (minimapInt3 + 256) >> 8;
  9540. int k1 = j * i1 + i * j1 >> 11;
  9541. int l1 = j * j1 - i * i1 >> 11;
  9542. int i2 = myPlayer.x + k1 >> 7;
  9543. int j2 = myPlayer.y - l1 >> 7;
  9544. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0, j2, myPlayer.smallX[0], true, i2);
  9545. if(flag1) {
  9546. stream.writeWordBigEndian(i);
  9547. stream.writeWordBigEndian(j);
  9548. stream.writeWord(minimapInt1);
  9549. stream.writeWordBigEndian(57);
  9550. stream.writeWordBigEndian(minimapInt2);
  9551. stream.writeWordBigEndian(minimapInt3);
  9552. stream.writeWordBigEndian(89);
  9553. stream.writeWord(myPlayer.x);
  9554. stream.writeWord(myPlayer.y);
  9555. stream.writeWordBigEndian(anInt1264);
  9556. stream.writeWordBigEndian(63);
  9557. }
  9558. }
  9559. }
  9560.  
  9561. private String interfaceIntToString(int j) {
  9562. if(j < 0x3b9ac9ff)
  9563. return String.valueOf(j);
  9564. else
  9565. return "*";
  9566. }
  9567.  
  9568. private void showErrorScreen()
  9569. {
  9570. Graphics g = getGameComponent().getGraphics();
  9571. g.setColor(Color.black);
  9572. g.fillRect(0, 0, 765, 503);
  9573. method4(1);
  9574. if(loadingError)
  9575. {
  9576. aBoolean831 = false;
  9577. g.setFont(new Font("Helvetica", 1, 16));
  9578. g.setColor(Color.yellow);
  9579. int k = 35;
  9580. g.drawString("Sorry, an error has occured whilst loading Zenith.", 30, k);
  9581. k += 50;
  9582. g.setColor(Color.white);
  9583. g.drawString("To fix this try the following (in order):", 30, k);
  9584. k += 50;
  9585. g.setColor(Color.white);
  9586. g.setFont(new Font("Helvetica", 1, 12));
  9587. g.drawString("1: Try closing and reopening the client and/or web browser", 30, k);
  9588. k += 30;
  9589. g.drawString("2: Try clearing your web-browsers cache from tools->internet options", 30, k);
  9590. k += 30;
  9591. g.drawString("3: Try rebooting your computer", 30, k);
  9592. k += 30;
  9593. g.drawString(" ", 30, k);
  9594. k += 30;
  9595. g.drawString("If problems still occur, visit the forums at www.Zenith.webs.com and request help", 30, k);
  9596. }
  9597. if(genericLoadingError)
  9598. {
  9599. aBoolean831 = false;
  9600. g.setFont(new Font("Helvetica", 1, 20));
  9601. g.setColor(Color.white);
  9602. g.drawString("Error - unable to load game!", 50, 50);
  9603. g.drawString("To play Zenith make sure you play from", 50, 100);
  9604. g.drawString("http://www.Zenith.webs.com", 50, 150);
  9605. }
  9606. if(rsAlreadyLoaded)
  9607. {
  9608. aBoolean831 = false;
  9609. g.setColor(Color.yellow);
  9610. int l = 35;
  9611. g.drawString("Error a copy of Zenith already appears to be loaded", 30, l);
  9612. l += 50;
  9613. g.setColor(Color.white);
  9614. g.drawString("To fix this try the following (in order):", 30, l);
  9615. l += 50;
  9616. g.setColor(Color.white);
  9617. g.setFont(new Font("Helvetica", 1, 12));
  9618. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, l);
  9619. l += 30;
  9620. g.drawString("2: Try rebooting your computer, and reloading", 30, l);
  9621. l += 30;
  9622. }
  9623. }
  9624.  
  9625. public URL getCodeBase() {
  9626. try {
  9627. return new URL(server +":" + (80 + portOff));
  9628. } catch(Exception _ex) {
  9629. }
  9630. return null;
  9631. }
  9632.  
  9633. private void method95() {
  9634. for(int j = 0; j < npcCount; j++) {
  9635. int k = npcIndices[j];
  9636. NPC npc = npcArray[k];
  9637. if(npc != null)
  9638. method96(npc);
  9639. }
  9640. }
  9641.  
  9642. private void method96(Entity entity)
  9643. {
  9644. if(entity.x < 128 || entity.y < 128 || entity.x >= 13184 || entity.y >= 13184)
  9645. {
  9646. entity.anim = -1;
  9647. entity.anInt1520 = -1;
  9648. entity.anInt1547 = 0;
  9649. entity.anInt1548 = 0;
  9650. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  9651. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  9652. entity.method446();
  9653. }
  9654. if(entity == myPlayer && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776))
  9655. {
  9656. entity.anim = -1;
  9657. entity.anInt1520 = -1;
  9658. entity.anInt1547 = 0;
  9659. entity.anInt1548 = 0;
  9660. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  9661. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  9662. entity.method446();
  9663. }
  9664. if(entity.anInt1547 > loopCycle)
  9665. method97(entity);
  9666. else
  9667. if(entity.anInt1548 >= loopCycle)
  9668. method98(entity);
  9669. else
  9670. method99(entity);
  9671. method100(entity);
  9672. method101(entity);
  9673. }
  9674.  
  9675. private void method97(Entity entity)
  9676. {
  9677. int i = entity.anInt1547 - loopCycle;
  9678. int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  9679. int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  9680. entity.x += (j - entity.x) / i;
  9681. entity.y += (k - entity.y) / i;
  9682. entity.anInt1503 = 0;
  9683. if(entity.anInt1549 == 0)
  9684. entity.turnDirection = 1024;
  9685. if(entity.anInt1549 == 1)
  9686. entity.turnDirection = 1536;
  9687. if(entity.anInt1549 == 2)
  9688. entity.turnDirection = 0;
  9689. if(entity.anInt1549 == 3)
  9690. entity.turnDirection = 512;
  9691. }
  9692.  
  9693. private void method98(Entity entity)
  9694. {
  9695. if(entity.anInt1548 == loopCycle || entity.anim == -1 || entity.anInt1529 != 0 || entity.anInt1528 + 1 > Animation.anims[entity.anim].method258(entity.anInt1527))
  9696. {
  9697. int i = entity.anInt1548 - entity.anInt1547;
  9698. int j = loopCycle - entity.anInt1547;
  9699. int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  9700. int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  9701. int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
  9702. int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
  9703. entity.x = (k * (i - j) + i1 * j) / i;
  9704. entity.y = (l * (i - j) + j1 * j) / i;
  9705. }
  9706. entity.anInt1503 = 0;
  9707. if(entity.anInt1549 == 0)
  9708. entity.turnDirection = 1024;
  9709. if(entity.anInt1549 == 1)
  9710. entity.turnDirection = 1536;
  9711. if(entity.anInt1549 == 2)
  9712. entity.turnDirection = 0;
  9713. if(entity.anInt1549 == 3)
  9714. entity.turnDirection = 512;
  9715. entity.anInt1552 = entity.turnDirection;
  9716. }
  9717.  
  9718. private void method99(Entity entity)
  9719. {
  9720. entity.anInt1517 = entity.anInt1511;
  9721. if(entity.smallXYIndex == 0)
  9722. {
  9723. entity.anInt1503 = 0;
  9724. return;
  9725. }
  9726. if(entity.anim != -1 && entity.anInt1529 == 0)
  9727. {
  9728. Animation animation = Animation.anims[entity.anim];
  9729. /*for (int i = 0; i < animation.anIntArray357.length; i++) {
  9730. animation.anIntArray357[i] = -1;
  9731. }*/
  9732. if(entity.anInt1542 > 0 && animation.anInt363 == 0)
  9733. {
  9734. entity.anInt1503++;
  9735. return;
  9736. }
  9737. if(entity.anInt1542 <= 0 && animation.anInt364 == 0)
  9738. {
  9739. entity.anInt1503++;
  9740. return;
  9741. }
  9742. }
  9743. int i = entity.x;
  9744. int j = entity.y;
  9745. int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  9746. int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  9747. if(k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256)
  9748. {
  9749. entity.x = k;
  9750. entity.y = l;
  9751. return;
  9752. }
  9753. if(i < k)
  9754. {
  9755. if(j < l)
  9756. entity.turnDirection = 1280;
  9757. else
  9758. if(j > l)
  9759. entity.turnDirection = 1792;
  9760. else
  9761. entity.turnDirection = 1536;
  9762. } else
  9763. if(i > k)
  9764. {
  9765. if(j < l)
  9766. entity.turnDirection = 768;
  9767. else
  9768. if(j > l)
  9769. entity.turnDirection = 256;
  9770. else
  9771. entity.turnDirection = 512;
  9772. } else
  9773. if(j < l)
  9774. entity.turnDirection = 1024;
  9775. else
  9776. entity.turnDirection = 0;
  9777. int i1 = entity.turnDirection - entity.anInt1552 & 0x7ff;
  9778. if(i1 > 1024)
  9779. i1 -= 2048;
  9780. int j1 = entity.anInt1555;
  9781. if(i1 >= -256 && i1 <= 256)
  9782. j1 = entity.anInt1554;
  9783. else
  9784. if(i1 >= 256 && i1 < 768)
  9785. j1 = entity.anInt1557;
  9786. else
  9787. if(i1 >= -768 && i1 <= -256)
  9788. j1 = entity.anInt1556;
  9789. if(j1 == -1)
  9790. j1 = entity.anInt1554;
  9791. entity.anInt1517 = j1;
  9792. int k1 = 4;
  9793. if(entity.anInt1552 != entity.turnDirection && entity.interactingEntity == -1 && entity.anInt1504 != 0)
  9794. k1 = 2;
  9795. if(entity.smallXYIndex > 2)
  9796. k1 = 6;
  9797. if(entity.smallXYIndex > 3)
  9798. k1 = 8;
  9799. if(entity.anInt1503 > 0 && entity.smallXYIndex > 1)
  9800. {
  9801. k1 = 8;
  9802. entity.anInt1503--;
  9803. }
  9804. if(entity.aBooleanArray1553[entity.smallXYIndex - 1])
  9805. k1 <<= 1;
  9806. if(k1 >= 8 && entity.anInt1517 == entity.anInt1554 && entity.anInt1505 != -1)
  9807. entity.anInt1517 = entity.anInt1505;
  9808. if(i < k)
  9809. {
  9810. entity.x += k1;
  9811. if(entity.x > k)
  9812. entity.x = k;
  9813. } else
  9814. if(i > k)
  9815. {
  9816. entity.x -= k1;
  9817. if(entity.x < k)
  9818. entity.x = k;
  9819. }
  9820. if(j < l)
  9821. {
  9822. entity.y += k1;
  9823. if(entity.y > l)
  9824. entity.y = l;
  9825. } else
  9826. if(j > l)
  9827. {
  9828. entity.y -= k1;
  9829. if(entity.y < l)
  9830. entity.y = l;
  9831. }
  9832. if(entity.x == k && entity.y == l)
  9833. {
  9834. entity.smallXYIndex--;
  9835. if(entity.anInt1542 > 0)
  9836. entity.anInt1542--;
  9837. }
  9838. }
  9839.  
  9840. private void method100(Entity entity)
  9841. {
  9842. if(entity.anInt1504 == 0)
  9843. return;
  9844. if(entity.interactingEntity != -1 && entity.interactingEntity < 32768)
  9845. {
  9846. NPC npc = npcArray[entity.interactingEntity];
  9847. if(npc != null)
  9848. {
  9849. int i1 = entity.x - npc.x;
  9850. int k1 = entity.y - npc.y;
  9851. if(i1 != 0 || k1 != 0)
  9852. entity.turnDirection = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  9853. }
  9854. }
  9855. if(entity.interactingEntity >= 32768)
  9856. {
  9857. int j = entity.interactingEntity - 32768;
  9858. if(j == unknownInt10)
  9859. j = myPlayerIndex;
  9860. Player player = playerArray[j];
  9861. if(player != null)
  9862. {
  9863. int l1 = entity.x - player.x;
  9864. int i2 = entity.y - player.y;
  9865. if(l1 != 0 || i2 != 0)
  9866. entity.turnDirection = (int)(Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  9867. }
  9868. }
  9869. if((entity.anInt1538 != 0 || entity.anInt1539 != 0) && (entity.smallXYIndex == 0 || entity.anInt1503 > 0))
  9870. {
  9871. int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
  9872. int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
  9873. if(k != 0 || j1 != 0)
  9874. entity.turnDirection = (int)(Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  9875. entity.anInt1538 = 0;
  9876. entity.anInt1539 = 0;
  9877. }
  9878. int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
  9879. if(l != 0)
  9880. {
  9881. if(l < entity.anInt1504 || l > 2048 - entity.anInt1504)
  9882. entity.anInt1552 = entity.turnDirection;
  9883. else
  9884. if(l > 1024)
  9885. entity.anInt1552 -= entity.anInt1504;
  9886. else
  9887. entity.anInt1552 += entity.anInt1504;
  9888. entity.anInt1552 &= 0x7ff;
  9889. if(entity.anInt1517 == entity.anInt1511 && entity.anInt1552 != entity.turnDirection)
  9890. {
  9891. if(entity.anInt1512 != -1)
  9892. {
  9893. entity.anInt1517 = entity.anInt1512;
  9894. return;
  9895. }
  9896. entity.anInt1517 = entity.anInt1554;
  9897. }
  9898. }
  9899. }
  9900.  
  9901. private void method101(Entity entity) {
  9902. entity.aBoolean1541 = false;
  9903. if (entity.anInt1517 != -1) {
  9904. Animation animation = Animation.anims[entity.anInt1517];
  9905. entity.anInt1519++;
  9906. if (entity.anInt1518 < animation.anInt352 && entity.anInt1519 > animation.method258(entity.anInt1518)) {
  9907. entity.anInt1519 = 1;//this is the frame delay. 0 is what it's normally at. higher number = faster animations.
  9908. entity.anInt1518++;
  9909. }
  9910. if (entity.anInt1518 >= animation.anInt352) {
  9911. entity.anInt1519 = 1;
  9912. entity.anInt1518 = 0;
  9913. }
  9914. }
  9915. if(entity.anInt1520 != -1 && loopCycle >= entity.anInt1523)
  9916. {
  9917. if(entity.anInt1521 < 0)
  9918. entity.anInt1521 = 0;
  9919. Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  9920. for(entity.anInt1522++; entity.anInt1521 < animation_1.anInt352 && entity.anInt1522 > animation_1.method258(entity.anInt1521); entity.anInt1521++)//huhhhhh
  9921. entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  9922.  
  9923. if(entity.anInt1521 >= animation_1.anInt352 && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352))
  9924. entity.anInt1520 = -1;
  9925. }
  9926. if(entity.anim != -1 && entity.anInt1529 <= 1)
  9927. {
  9928. Animation animation_2 = Animation.anims[entity.anim];
  9929. if(animation_2.anInt363 == 1 && entity.anInt1542 > 0 && entity.anInt1547 <= loopCycle && entity.anInt1548 < loopCycle)
  9930. {
  9931. entity.anInt1529 = 1;
  9932. return;
  9933. }
  9934. }
  9935. if(entity.anim != -1 && entity.anInt1529 == 0 && entity.anim < 14000)
  9936. {
  9937. Animation animation_3 = Animation.anims[entity.anim];
  9938. for(entity.anInt1528++; entity.anInt1527 < animation_3.anInt352 && entity.anInt1528 > animation_3.method258(entity.anInt1527); entity.anInt1527++)
  9939. entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  9940.  
  9941. if(entity.anInt1527 >= animation_3.anInt352)
  9942. {
  9943. entity.anInt1527 -= animation_3.anInt356;
  9944. entity.anInt1530++;
  9945. if(entity.anInt1530 >= animation_3.anInt362)
  9946. entity.anim = -1;
  9947. if(entity.anInt1527 < 0 || entity.anInt1527 >= animation_3.anInt352)
  9948. entity.anim = -1;
  9949. }
  9950. entity.aBoolean1541 = animation_3.aBoolean358;
  9951. }
  9952. if(entity.anInt1529 > 0)
  9953. entity.anInt1529--;
  9954. }
  9955.  
  9956. private void drawGameScreen() {
  9957. if (fullscreenInterfaceID != -1 && (loadingStage == 2 || super.fullGameScreen != null)) {
  9958. if (loadingStage == 2) {
  9959. method119(anInt945, fullscreenInterfaceID);
  9960. if (openInterfaceID != -1) {
  9961. method119(anInt945, openInterfaceID);
  9962. }
  9963. anInt945 = 0;
  9964. resetAllImageProducers();
  9965. super.fullGameScreen.initDrawingArea();
  9966. Texture.anIntArray1472 = fullScreenTextureArray;
  9967. DrawingArea.setAllPixelsToZero();
  9968. welcomeScreenRaised = true;
  9969. if (openInterfaceID != -1) {
  9970. RSInterface class9_1 = RSInterface.interfaceCache[openInterfaceID];
  9971. if (class9_1.width == 512 && class9_1.height == 334 && class9_1.interfaceType == 0) {
  9972. class9_1.width = 765;
  9973. class9_1.height = 503;
  9974. }
  9975. drawInterface(0, 0, class9_1, 8);
  9976. }
  9977. RSInterface rsInterface = RSInterface.interfaceCache[fullscreenInterfaceID];
  9978. if (rsInterface.width == 512 && rsInterface.height == 334 && rsInterface.interfaceType == 0) {
  9979. rsInterface.width = 765;
  9980. rsInterface.height = 503;
  9981. }
  9982. drawInterface(0, 0, rsInterface, 8);
  9983.  
  9984. if (!menuOpen) {
  9985. processRightClick();
  9986. drawTooltip();
  9987. } else {
  9988. drawMenu(0, 0);
  9989. }
  9990. }
  9991. drawCount++;
  9992. super.fullGameScreen.drawGraphics(0, super.graphics, 0);
  9993. return;
  9994. } else {
  9995. if (drawCount != 0) {
  9996. resetImageProducers2();
  9997. }
  9998. }
  9999. if(welcomeScreenRaised) {
  10000. welcomeScreenRaised = false;
  10001. if (!toggleFullscreen) {
  10002. topFrame.drawGraphics(0, super.graphics, 0);
  10003. leftFrame.drawGraphics(4, super.graphics, 0);
  10004. }
  10005. inputTaken = true;
  10006. tabAreaAltered = true;
  10007. if(loadingStage != 2) {
  10008. main3DArea.drawGraphics(4, super.graphics, 4);
  10009. mapBackImage.drawGraphics(0, super.graphics, 516);//545
  10010.  
  10011. }
  10012. }
  10013. if(menuOpen) {
  10014. }
  10015. if(menuOpen)
  10016. drawMenu(4,4);
  10017.  
  10018. if (invOverlayInterfaceID != -1) {
  10019. boolean flag1 = method119(anInt945, invOverlayInterfaceID);
  10020. if (flag1) {
  10021. needDrawTabArea = true;
  10022. }
  10023. }
  10024.  
  10025. // if(invOverlayInterfaceID != -1)
  10026. // {
  10027. // boolean flag1 = method119(anInt945, invOverlayInterfaceID);
  10028. // if(flag1) {
  10029. // }
  10030. // }
  10031. if(atInventoryInterfaceType == 2) {
  10032. }
  10033. if(activeInterfaceType == 2) {
  10034. }
  10035. if (!toggleFullscreen) {
  10036. //drawRightFrameArea();
  10037. drawTabArea(inventoryBackImage, 0, 0);
  10038. //inventoryBackImage.drawGraphics(this.yPaddingtabBack, this.graphics, this.xPaddingtabBack);
  10039. main3DArea.initDrawingArea();
  10040. }
  10041. if(loadingStage == 2) {
  10042. method146();
  10043. }
  10044. if(backDialogID == -1) {
  10045. if(is474 || is480 || is508 || is525 || is562) {
  10046. aClass9_1059.scrollPosition = (chatScrollTotalLength - anInt1089 - 110);
  10047. if ((this.mouseX > 497) && (this.mouseX < 512) && (this.mouseY > 342 + getChatBackIncreaseY()))
  10048. method65(494, 110, super.mouseX - 0, super.mouseY - 348 - getChatBackIncreaseY(), aClass9_1059, 0, false, chatScrollTotalLength);
  10049. int i = chatScrollTotalLength - 110 - this.aClass9_1059.scrollPosition;
  10050. if(i < 0)
  10051. i = 0;
  10052. if (i > chatScrollTotalLength - 110)
  10053. i = chatScrollTotalLength - 110;
  10054. if(anInt1089 != i) {
  10055. anInt1089 = i;
  10056. inputTaken = true;
  10057. }
  10058. } else {
  10059. aClass9_1059.scrollPosition = chatScrollTotalLength - anInt1089 - 77;
  10060. if(super.mouseX > 448 && super.mouseX < 560 && super.mouseY > 332)
  10061. method65(463, 77, super.mouseX - 17, super.mouseY - 357, aClass9_1059, 0, false, chatScrollTotalLength);
  10062. int i = chatScrollTotalLength - 77 - aClass9_1059.scrollPosition;
  10063. if(i < 0)
  10064. i = 0;
  10065. if(i > chatScrollTotalLength - 77)
  10066. i = chatScrollTotalLength - 77;
  10067. if(anInt1089 != i) {
  10068. anInt1089 = i;
  10069. inputTaken = true;
  10070. }
  10071. }
  10072. }
  10073. if(backDialogID != -1) {// || (tabID == 10 && tabInterfaceIDs[10] == 17011)
  10074. //System.out.println("tabID:"+tabID);
  10075. boolean flag2 = method119(anInt945, backDialogID == -1 ? 17011 : backDialogID);
  10076. if(flag2)
  10077. inputTaken = true;
  10078. }
  10079. if(atInventoryInterfaceType == 3)
  10080. inputTaken = true;
  10081. if(activeInterfaceType == 3)
  10082. inputTaken = true;
  10083. if(aString844 != null)
  10084. inputTaken = true;
  10085. if(menuOpen && menuScreenArea == 2)
  10086. inputTaken = true;
  10087. if (inputTaken) {
  10088. if (!toggleFullscreen) {
  10089. drawChatArea(toggleFullscreen ? this.main3DArea : this.chatBackImage, 0, 0);
  10090. //chatBackImage.drawGraphics(this.yPaddingchatBackImage, this.graphics, this.xPaddingchatBackImage);
  10091. main3DArea.initDrawingArea();
  10092. }
  10093. inputTaken = false;
  10094. }
  10095. if ((this.loadingStage == 2) && (!toggleFullscreen)) {
  10096. drawMinimap(this.mapBackImage, 0, 0);
  10097. mapBackImage.drawGraphics(this.yPaddingmapBackImage + getMapIncreaseY(), super.graphics, this.xPaddingmapBackImage + getMapIncreaseX());//545
  10098. }
  10099. if(anInt1054 != -1)
  10100. tabAreaAltered = true;
  10101. if(tabAreaAltered)
  10102. {
  10103. if(anInt1054 != -1 && anInt1054 == tabID)
  10104. {
  10105. anInt1054 = -1;
  10106. stream.createFrame(120);
  10107. stream.writeWordBigEndian(tabID);
  10108. System.out.println("ASDSAD: "+tabID);
  10109. }
  10110. tabAreaAltered = false;
  10111. aRSImageProducer_1125.initDrawingArea();
  10112. main3DArea.initDrawingArea();
  10113. }
  10114. if(menuOpen){
  10115. drawMenu(516, 466);
  10116. }
  10117. anInt945 = 0;
  10118. }
  10119.  
  10120. private boolean buildFriendsListMenu(RSInterface class9)
  10121. {
  10122. int i = class9.contentType;
  10123. if(i >= 1 && i <= 200 || i >= 701 && i <= 900)
  10124. {
  10125. if(i >= 801)
  10126. i -= 701;
  10127. else
  10128. if(i >= 701)
  10129. i -= 601;
  10130. else
  10131. if(i >= 101)
  10132. i -= 101;
  10133. else
  10134. i--;
  10135. menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
  10136. menuActionID[menuActionRow] = 792;
  10137. menuActionRow++;
  10138. menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
  10139. menuActionID[menuActionRow] = 639;
  10140. menuActionRow++;
  10141. return true;
  10142. }
  10143. if(i >= 401 && i <= 500)
  10144. {
  10145. menuActionName[menuActionRow] = "Remove @whi@" + class9.disabledMessage;
  10146. menuActionID[menuActionRow] = 322;
  10147. menuActionRow++;
  10148. return true;
  10149. } else
  10150. {
  10151. return false;
  10152. }
  10153. }
  10154.  
  10155. private void method104()
  10156. {
  10157. Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetFirst();
  10158. for(; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetNext())
  10159. if(class30_sub2_sub4_sub3.anInt1560 != plane || class30_sub2_sub4_sub3.aBoolean1567)
  10160. class30_sub2_sub4_sub3.unlink();
  10161. else
  10162. if(loopCycle >= class30_sub2_sub4_sub3.anInt1564)
  10163. {
  10164. class30_sub2_sub4_sub3.method454(anInt945);
  10165. if(class30_sub2_sub4_sub3.aBoolean1567)
  10166. class30_sub2_sub4_sub3.unlink();
  10167. else
  10168. worldController.method285(class30_sub2_sub4_sub3.anInt1560, 0, class30_sub2_sub4_sub3.anInt1563, -1, class30_sub2_sub4_sub3.anInt1562, 60, class30_sub2_sub4_sub3.anInt1561, class30_sub2_sub4_sub3, false);
  10169. }
  10170.  
  10171. }
  10172.  
  10173.  
  10174.  
  10175. private void randomizeBackground(Background background) {
  10176. int j = 256;
  10177. for(int k = 0; k < anIntArray1190.length; k++)
  10178. anIntArray1190[k] = 0;
  10179.  
  10180. for(int l = 0; l < 5000; l++) {
  10181. int i1 = (int)(Math.random() * 128D * (double)j);
  10182. anIntArray1190[i1] = (int)(Math.random() * 256D);
  10183. }
  10184. for(int j1 = 0; j1 < 20; j1++) {
  10185. for(int k1 = 1; k1 < j - 1; k1++) {
  10186. for(int i2 = 1; i2 < 127; i2++) {
  10187. int k2 = i2 + (k1 << 7);
  10188. anIntArray1191[k2] = (anIntArray1190[k2 - 1] + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128] + anIntArray1190[k2 + 128]) / 4;
  10189. }
  10190.  
  10191. }
  10192. int ai[] = anIntArray1190;
  10193. anIntArray1190 = anIntArray1191;
  10194. anIntArray1191 = ai;
  10195. }
  10196. if(background != null) {
  10197. int l1 = 0;
  10198. for(int j2 = 0; j2 < background.anInt1453; j2++) {
  10199. for(int l2 = 0; l2 < background.anInt1452; l2++)
  10200. if(background.aByteArray1450[l1++] != 0) {
  10201. int i3 = l2 + 16 + background.anInt1454;
  10202. int j3 = j2 + 16 + background.anInt1455;
  10203. int k3 = i3 + (j3 << 7);
  10204. anIntArray1190[k3] = 0;
  10205. }
  10206. }
  10207. }
  10208. }
  10209.  
  10210. private void method107(int i, int j, Stream stream, Player player)
  10211. {
  10212. if((i & 0x400) != 0)
  10213. {
  10214. player.anInt1543 = stream.method428();
  10215. player.anInt1545 = stream.method428();
  10216. player.anInt1544 = stream.method428();
  10217. player.anInt1546 = stream.method428();
  10218. player.anInt1547 = stream.method436() + loopCycle;
  10219. player.anInt1548 = stream.readWordA() + loopCycle;
  10220. player.anInt1549 = stream.method428();
  10221. player.method446();
  10222. }
  10223. if((i & 0x100) != 0)
  10224. {
  10225. player.anInt1520 = stream.method434();
  10226. int k = stream.readDWord();
  10227. player.anInt1524 = k >> 16;
  10228. player.anInt1523 = loopCycle + (k & 0xffff);
  10229. player.anInt1521 = 0;
  10230. player.anInt1522 = 0;
  10231. if(player.anInt1523 > loopCycle)
  10232. player.anInt1521 = -1;
  10233. if(player.anInt1520 == 65535)
  10234. player.anInt1520 = -1;
  10235. }
  10236. if((i & 8) != 0)
  10237. {
  10238. int l = stream.method434();
  10239. if(l == 65535)
  10240. l = -1;
  10241. int i2 = stream.method427();
  10242. if(l == player.anim && l != -1)
  10243. {
  10244. int i3 = Animation.anims[l].anInt365;
  10245. if(i3 == 1)
  10246. {
  10247. player.anInt1527 = 0;
  10248. player.anInt1528 = 0;
  10249. player.anInt1529 = i2;
  10250. player.anInt1530 = 0;
  10251. }
  10252. if(i3 == 2)
  10253. player.anInt1530 = 0;
  10254. } else
  10255. if(l == -1 || player.anim == -1 || Animation.anims[l].anInt359 >= Animation.anims[player.anim].anInt359)
  10256. {
  10257. player.anim = l;
  10258. player.anInt1527 = 0;
  10259. player.anInt1528 = 0;
  10260. player.anInt1529 = i2;
  10261. player.anInt1530 = 0;
  10262. player.anInt1542 = player.smallXYIndex;
  10263. }
  10264. }
  10265. if((i & 4) != 0)
  10266. {
  10267. player.textSpoken = stream.readString();
  10268. if(player.textSpoken.charAt(0) == '~')
  10269. {
  10270. player.textSpoken = player.textSpoken.substring(1);
  10271. pushMessage(player.textSpoken, 2, player.name);
  10272. } else
  10273. if(player == myPlayer)
  10274. pushMessage(player.textSpoken, 2, player.name);
  10275. player.anInt1513 = 0;
  10276. player.anInt1531 = 0;
  10277. player.textCycle = 150;
  10278. }
  10279. if((i & 0x80) != 0)
  10280. {
  10281. //right fucking here
  10282. int i1 = stream.method434();
  10283. int rights = stream.readUnsignedByte();
  10284. int j3 = stream.method427();
  10285. int k3 = stream.currentOffset;
  10286. if(player.name != null && player.visible)
  10287. {
  10288. TextClass.longForName(player.name);
  10289. boolean flag = false;
  10290. /*if(rights <= 1)
  10291. {
  10292. for(int i4 = 0; i4 < ignoreCount; i4++)
  10293. {
  10294. if(ignoreListAsLongs[i4] != l3)
  10295. continue;
  10296. flag = true;
  10297. break;
  10298. }
  10299. }*/
  10300. if(!flag && anInt1251 == 0)
  10301. try
  10302. {
  10303. aStream_834.currentOffset = 0;
  10304. stream.method442(j3, 0, aStream_834.buffer);
  10305. aStream_834.currentOffset = 0;
  10306. String s = TextInput.method525(j3, aStream_834);
  10307. //s = Censor.doCensor(s);
  10308. player.textSpoken = s;
  10309. player.anInt1513 = i1 >> 8;
  10310. player.privelage = rights;
  10311. player.anInt1531 = i1 & 0xff;
  10312. player.textCycle = 150;
  10313. //Other players see your icon
  10314. if (rights == 7) {
  10315. pushMessage(s, 1, "@cr0@<col=13132800>"+loyaltyRank(player.loyaltyRank)+"</col>" + player.name);
  10316. } else if (rights == 6) {
  10317. pushMessage(s, 1, "@cr6@<col=13132800>"+loyaltyRank(player.loyaltyRank)+"</col>" + player.name);
  10318. } else if (rights == 8) {
  10319. pushMessage(s, 1, "<img=3><col=13132800>"+loyaltyRank(player.loyaltyRank)+"</col>" + player.name);
  10320. } else if (rights == 5) {
  10321. pushMessage(s, 1, "@cr5@<col=13132800>"+loyaltyRank(player.loyaltyRank)+"</col>" + player.name);
  10322. } else if (rights == 4)
  10323. pushMessage(s, 1, "@cr4@<col=13132800>"+loyaltyRank(player.loyaltyRank)+"</col>" + player.name);
  10324. else if(rights == 3)
  10325. pushMessage(s, 1, "@cr2@<col=13132800>"+loyaltyRank(player.loyaltyRank)+"</col>" + player.name);
  10326. else if(rights == 2)
  10327. pushMessage(s, 1, "@cr2@<col=13132800>"+loyaltyRank(player.loyaltyRank)+"</col>" + player.name);
  10328. else if (rights == 1)
  10329. pushMessage(s, 1, "@cr1@<col=13132800>"+loyaltyRank(player.loyaltyRank)+"</col>" + player.name);
  10330. else
  10331. pushMessage(s, 2, "<col=13132800>"+loyaltyRank(player.loyaltyRank)+"</col>" + player.name);
  10332. } catch(Exception exception) {
  10333. signlink.reporterror("cde2");
  10334. }
  10335. }
  10336. stream.currentOffset = k3 + j3;
  10337. }
  10338. if((i & 1) != 0)
  10339. {
  10340. player.interactingEntity = stream.method434();
  10341. if(player.interactingEntity == 65535)
  10342. player.interactingEntity = -1;
  10343. }
  10344. if((i & 0x10) != 0)
  10345. {
  10346. int j1 = stream.method427();
  10347. byte abyte0[] = new byte[j1];
  10348. Stream stream_1 = new Stream(abyte0);
  10349. stream.readBytes(j1, 0, abyte0);
  10350. aStreamArray895s[j] = stream_1;
  10351. player.updatePlayer(stream_1);
  10352. }
  10353. if((i & 2) != 0)
  10354. {
  10355. player.anInt1538 = stream.method436();
  10356. player.anInt1539 = stream.method434();
  10357. }
  10358. if((i & 0x20) != 0) {//1
  10359. int k1 = stream.readWordA();
  10360. int k2 = stream.readUnsignedByte();
  10361. int icon = stream.readUnsignedByte();
  10362. int soakDamage = stream.readWordA();
  10363. player.updateHitData(k2, k1, loopCycle, icon, soakDamage);
  10364. player.loopCycleStatus = loopCycle + 300;
  10365. player.currentHealth = stream.readWordA();
  10366. player.maxHealth = stream.readWordA();
  10367. //System.out.println("HP: "+player.currentHealth+" - maxHealth: "+player.maxHealth);
  10368. }
  10369. if((i & 0x200) != 0) {//2
  10370. int l1 = stream.readWordA();
  10371. int l2 = stream.readUnsignedByte();
  10372. int icon = stream.readUnsignedByte();
  10373. int soakDamage = stream.readWordA();
  10374. player.updateHitData(l2, l1, loopCycle, icon, soakDamage);
  10375. player.loopCycleStatus = loopCycle + 300;
  10376. player.currentHealth = stream.readWordA();
  10377. player.maxHealth = stream.readWordA();
  10378. //player.currentHealth = stream.readUnsignedByte();//readWordA
  10379. //player.maxHealth = stream.method427();//readWordA
  10380. }
  10381. }
  10382.  
  10383. private void method108()
  10384. {
  10385. try
  10386. {
  10387. int j = myPlayer.x + anInt1278;
  10388. int k = myPlayer.y + anInt1131;
  10389. if(anInt1014 - j < -500 || anInt1014 - j > 500 || anInt1015 - k < -500 || anInt1015 - k > 500)
  10390. {
  10391. anInt1014 = j;
  10392. anInt1015 = k;
  10393. }
  10394. if(anInt1014 != j)
  10395. anInt1014 += (j - anInt1014) / 16;
  10396. if(anInt1015 != k)
  10397. anInt1015 += (k - anInt1015) / 16;
  10398. if(super.keyArray[1] == 1)
  10399. anInt1186 += (-24 - anInt1186) / 2;
  10400. else
  10401. if(super.keyArray[2] == 1)
  10402. anInt1186 += (24 - anInt1186) / 2;
  10403. else
  10404. anInt1186 /= 2;
  10405. if(super.keyArray[3] == 1)
  10406. anInt1187 += (12 - anInt1187) / 2;
  10407. else
  10408. if(super.keyArray[4] == 1)
  10409. anInt1187 += (-12 - anInt1187) / 2;
  10410. else
  10411. anInt1187 /= 2;
  10412. minimapInt1 = minimapInt1 + anInt1186 / 2 & 0x7ff;
  10413. anInt1184 += anInt1187 / 2;
  10414. if(anInt1184 < 128)
  10415. anInt1184 = 128;
  10416. if(anInt1184 > 383)
  10417. anInt1184 = 383;
  10418. int l = anInt1014 >> 7;
  10419. int i1 = anInt1015 >> 7;
  10420. int j1 = method42(plane, anInt1015, anInt1014);
  10421. int k1 = 0;
  10422. if(l > 3 && i1 > 3 && l < 100 && i1 < 100)
  10423. {
  10424. for(int l1 = l - 4; l1 <= l + 4; l1++)
  10425. {
  10426. for(int k2 = i1 - 4; k2 <= i1 + 4; k2++)
  10427. {
  10428. int l2 = plane;
  10429. if(l2 < 3 && (byteGroundArray[1][l1][k2] & 2) == 2)
  10430. l2++;
  10431. int i3 = j1 - intGroundArray[l2][l1][k2];
  10432. if(i3 > k1)
  10433. k1 = i3;
  10434. }
  10435.  
  10436. }
  10437.  
  10438. }
  10439. anInt1005++;
  10440. if(anInt1005 > 1512)
  10441. {
  10442. anInt1005 = 0;
  10443. stream.createFrame(77);
  10444. stream.writeWordBigEndian(0);
  10445. int i2 = stream.currentOffset;
  10446. stream.writeWordBigEndian((int)(Math.random() * 256D));
  10447. stream.writeWordBigEndian(101);
  10448. stream.writeWordBigEndian(233);
  10449. stream.writeWord(45092);
  10450. if((int)(Math.random() * 2D) == 0)
  10451. stream.writeWord(35784);
  10452. stream.writeWordBigEndian((int)(Math.random() * 256D));
  10453. stream.writeWordBigEndian(64);
  10454. stream.writeWordBigEndian(38);
  10455. stream.writeWord((int)(Math.random() * 65536D));
  10456. stream.writeWord((int)(Math.random() * 65536D));
  10457. stream.writeBytes(stream.currentOffset - i2);
  10458. }
  10459. int j2 = k1 * 192;
  10460. if(j2 > 0x17f00)
  10461. j2 = 0x17f00;
  10462. if(j2 < 32768)
  10463. j2 = 32768;
  10464. if(j2 > anInt984)
  10465. {
  10466. anInt984 += (j2 - anInt984) / 24;
  10467. return;
  10468. }
  10469. if(j2 < anInt984)
  10470. {
  10471. anInt984 += (j2 - anInt984) / 80;
  10472. }
  10473. }
  10474. catch(Exception _ex)
  10475. {
  10476. signlink.reporterror("glfc_ex " + myPlayer.x + "," + myPlayer.y + "," + anInt1014 + "," + anInt1015 + "," + anInt1069 + "," + anInt1070 + "," + baseX + "," + baseY);
  10477. throw new RuntimeException("eek");
  10478. }
  10479. }
  10480.  
  10481. public void processDrawing()
  10482. {
  10483. if(rsAlreadyLoaded || loadingError || genericLoadingError)
  10484. {
  10485. showErrorScreen();
  10486. return;
  10487. }
  10488. anInt1061++;
  10489. if(!loggedIn) {
  10490. drawLoginScreen(false);
  10491. }else{
  10492. drawGameScreen();
  10493. }
  10494. anInt1213 = 0;
  10495. }
  10496.  
  10497. private boolean isFriendOrSelf(String s)
  10498. {
  10499. if(s == null)
  10500. return false;
  10501. for(int i = 0; i < friendsCount; i++)
  10502. if(s.equalsIgnoreCase(friendsList[i]))
  10503. return true;
  10504. return s.equalsIgnoreCase(myPlayer.name);
  10505. }
  10506.  
  10507. private static String combatDiffColor(int i, int j)
  10508. {
  10509. int k = i - j;
  10510. if(k < -9)
  10511. return "@red@";
  10512. if(k < -6)
  10513. return "@or3@";
  10514. if(k < -3)
  10515. return "@or2@";
  10516. if(k < 0)
  10517. return "@or1@";
  10518. if(k > 9)
  10519. return "@gre@";
  10520. if(k > 6)
  10521. return "@gr3@";
  10522. if(k > 3)
  10523. return "@gr2@";
  10524. if(k > 0)
  10525. return "@gr1@";
  10526. else
  10527. return "@yel@";
  10528. }
  10529.  
  10530. private void setWaveVolume(int i)
  10531. {
  10532. signlink.wavevol = i;
  10533. }
  10534.  
  10535. private void draw3dScreen() {
  10536. drawSplitPrivateChat();
  10537. if(crossType == 1)
  10538. {
  10539. crosses[crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  10540. anInt1142++;
  10541. if(anInt1142 > 67)
  10542. {
  10543. anInt1142 = 0;
  10544. stream.createFrame(78);
  10545. }
  10546. }
  10547. if(crossType == 2)
  10548. crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  10549. if(anInt1018 != -1)
  10550. {
  10551. method119(anInt945, anInt1018);
  10552. //drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 0);
  10553. if ((anInt1018 == 197) && (toggleFullscreen))
  10554. drawInterface(0, 0 + getMapIncreaseX(), RSInterface.interfaceCache[anInt1018], -205 + getMapIncreaseY());
  10555. else
  10556. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 0);
  10557. }
  10558. if (openInterfaceID != -1) {
  10559. method119(this.anInt945, openInterfaceID);
  10560. RSInterface rsInterface = RSInterface.interfaceCache[openInterfaceID];
  10561. int width = toggleFullscreen ? getScreenWidth() : 516;
  10562. int height = toggleFullscreen ? getScreenHeight() : 338;
  10563. if (toggleFullscreen)
  10564. drawInterface(0, 0 + (width - rsInterface.width) / 2, rsInterface, 0 + (height - rsInterface.height) / 2);
  10565. else
  10566. drawInterface(0, 0, rsInterface, 0);
  10567. }
  10568. method70();
  10569. if(!menuOpen) {
  10570. processRightClick();
  10571. drawTooltip();
  10572. } else
  10573. drawMenu(4, 4);
  10574. if(anInt1055 == 1)
  10575. multiOverlay.drawSprite(472, 296);
  10576. if(fpsOn) {
  10577. char c = '\u01FB';
  10578. int k = 20;
  10579. int i1 = 0xffff00;
  10580. if(super.fps < 15)
  10581. i1 = 0xff0000;
  10582. aTextDrawingArea_1271.method380("Fps:" + super.fps, c, i1, k);
  10583. k += 15;
  10584. Runtime runtime = Runtime.getRuntime();
  10585. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  10586. i1 = 0xffff00;
  10587. if(j1 > 0x2000000 && lowMem)
  10588. i1 = 0xff0000;
  10589. aTextDrawingArea_1271.method380("Mem:" + j1 + "k", c, 0xffff00, k);
  10590. k += 15;
  10591. aTextDrawingArea_1271.method380("Mouse X:" + super.mouseX, c, 0xffff00, k);
  10592. k += 15;
  10593. aTextDrawingArea_1271.method380("Mouse Y:" + super.mouseY, c, 0xffff00, k);
  10594. k += 15;
  10595. int x1 = baseX + (myPlayer.x - 6 >> 7);
  10596. int y1 = baseY + (myPlayer.y - 6 >> 7);
  10597. aTextDrawingArea_1271.method380("Coords: " + x1 + ", " + y1, c, 0xffff00, k);
  10598. }
  10599. if(anInt1104 != 0) {
  10600. int j = anInt1104 / 50;
  10601. int l = j / 60;
  10602. j %= 60;
  10603. if(j < 10)
  10604. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":0" + j, 329, 4);
  10605. else
  10606. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":" + j, 329, 4);
  10607. anInt849++;
  10608. if(anInt849 > 75)
  10609. {
  10610. anInt849 = 0;
  10611. stream.createFrame(148);
  10612. }
  10613. }
  10614. }
  10615.  
  10616. private void addIgnore(long l)
  10617. {
  10618. try
  10619. {
  10620. if(l == 0L)
  10621. return;
  10622. if(ignoreCount >= 100)
  10623. {
  10624. pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
  10625. return;
  10626. }
  10627. String s = TextClass.fixName(TextClass.nameForLong(l));
  10628. for(int j = 0; j < ignoreCount; j++)
  10629. if(ignoreListAsLongs[j] == l)
  10630. {
  10631. pushMessage(s + " is already on your ignore list", 0, "");
  10632. return;
  10633. }
  10634. for(int k = 0; k < friendsCount; k++)
  10635. if(friendsListAsLongs[k] == l)
  10636. {
  10637. pushMessage("Please remove " + s + " from your friend list first", 0, "");
  10638. return;
  10639. }
  10640.  
  10641. ignoreListAsLongs[ignoreCount++] = l;
  10642. stream.createFrame(133);
  10643. stream.writeQWord(l);
  10644. return;
  10645. }
  10646. catch(RuntimeException runtimeexception)
  10647. {
  10648. signlink.reporterror("45688, " + l + ", " + 4 + ", " + runtimeexception.toString());
  10649. }
  10650. throw new RuntimeException();
  10651. }
  10652.  
  10653. private void method114()
  10654. {
  10655. for(int i = -1; i < playerCount; i++)
  10656. {
  10657. int j;
  10658. if(i == -1)
  10659. j = myPlayerIndex;
  10660. else
  10661. j = playerIndices[i];
  10662. Player player = playerArray[j];
  10663. if(player != null)
  10664. method96(player);
  10665. }
  10666.  
  10667. }
  10668.  
  10669. private void method115()
  10670. {
  10671. if(loadingStage == 2)
  10672. {
  10673. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  10674. {
  10675. if(class30_sub1.anInt1294 > 0)
  10676. class30_sub1.anInt1294--;
  10677. if(class30_sub1.anInt1294 == 0)
  10678. {
  10679. if(class30_sub1.anInt1299 < 0 || ObjectManager.method178(class30_sub1.anInt1299, class30_sub1.anInt1301))
  10680. {
  10681. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1300, class30_sub1.anInt1301, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1299);
  10682. class30_sub1.unlink();
  10683. }
  10684. } else
  10685. {
  10686. if(class30_sub1.anInt1302 > 0)
  10687. class30_sub1.anInt1302--;
  10688. if(class30_sub1.anInt1302 == 0 && class30_sub1.anInt1297 >= 1 && class30_sub1.anInt1298 >= 1 && class30_sub1.anInt1297 <= 102 && class30_sub1.anInt1298 <= 102 && (class30_sub1.anInt1291 < 0 || ObjectManager.method178(class30_sub1.anInt1291, class30_sub1.anInt1293)))
  10689. {
  10690. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1292, class30_sub1.anInt1293, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1291);
  10691. class30_sub1.anInt1302 = -1;
  10692. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1299 == -1)
  10693. class30_sub1.unlink();
  10694. else
  10695. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1292 == class30_sub1.anInt1300 && class30_sub1.anInt1293 == class30_sub1.anInt1301)
  10696. class30_sub1.unlink();
  10697. }
  10698. }
  10699. }
  10700.  
  10701. }
  10702. }
  10703.  
  10704.  
  10705. private void determineMenuSize() {
  10706. int i = chatTextDrawingArea.getTextWidth("Choose Option");
  10707. for(int j = 0; j < menuActionRow; j++) {
  10708. int k = chatTextDrawingArea.getTextWidth(menuActionName[j]);
  10709. if(k > i)
  10710. i = k;
  10711. }
  10712. i += 8;
  10713. int l = 15 * menuActionRow + 21;
  10714. if(super.saveClickX > 0 && super.saveClickY > 0 && super.saveClickX < 765 && super.saveClickY < 503) {
  10715. int i1 = super.saveClickX - i / 2;
  10716. if(i1 + i > 765){
  10717. i1 = 765 - i;
  10718. }
  10719. if(i1 < 0){
  10720. i1 = 0;
  10721. }
  10722. int l1 = super.saveClickY - 0;
  10723. if(l1 + l > 503){
  10724. l1 = 503 - l;
  10725. }
  10726. if(l1 < 0){
  10727. l1 = 0;
  10728. }
  10729. menuOpen = true;
  10730. menuOffsetX = i1;
  10731. menuOffsetY = l1;
  10732. menuWidth = i;
  10733. menuHeight = 15 * menuActionRow + 22;
  10734. }
  10735. }
  10736.  
  10737. private void method117(Stream stream)
  10738. {
  10739. stream.initBitAccess();
  10740. int j = stream.readBits(1);
  10741. if(j == 0)
  10742. return;
  10743. int k = stream.readBits(2);
  10744. if(k == 0)
  10745. {
  10746. anIntArray894[anInt893++] = myPlayerIndex;
  10747. return;
  10748. }
  10749. if(k == 1)
  10750. {
  10751. int l = stream.readBits(3);
  10752. myPlayer.moveInDir(false, l);
  10753. int k1 = stream.readBits(1);
  10754. if(k1 == 1)
  10755. anIntArray894[anInt893++] = myPlayerIndex;
  10756. return;
  10757. }
  10758. if(k == 2)
  10759. {
  10760. int i1 = stream.readBits(3);
  10761. myPlayer.moveInDir(true, i1);
  10762. int l1 = stream.readBits(3);
  10763. myPlayer.moveInDir(true, l1);
  10764. int j2 = stream.readBits(1);
  10765. if(j2 == 1)
  10766. anIntArray894[anInt893++] = myPlayerIndex;
  10767. return;
  10768. }
  10769. if(k == 3)
  10770. {
  10771. plane = stream.readBits(2);
  10772. int j1 = stream.readBits(1);
  10773. int i2 = stream.readBits(1);
  10774. if(i2 == 1)
  10775. anIntArray894[anInt893++] = myPlayerIndex;
  10776. int k2 = stream.readBits(7);
  10777. int l2 = stream.readBits(7);
  10778. myPlayer.setPos(l2, k2, j1 == 1);
  10779. }
  10780. }
  10781.  
  10782. private void nullLoader()
  10783. {
  10784. aBoolean831 = false;
  10785. while(drawingFlames)
  10786. {
  10787. aBoolean831 = false;
  10788. try
  10789. {
  10790. Thread.sleep(50L);
  10791. }
  10792. catch(Exception _ex) { }
  10793. }
  10794. titleBox = null;
  10795. aBackgroundArray1152s = null;
  10796. anIntArray851 = null;
  10797. anIntArray852 = null;
  10798. anIntArray853 = null;
  10799. anIntArray1190 = null;
  10800. anIntArray1191 = null;
  10801. }
  10802.  
  10803. private boolean method119(int i, int j)
  10804. {
  10805. boolean flag1 = false;
  10806. RSInterface class9 = RSInterface.interfaceCache[j];
  10807. for(int k = 0; k < class9.children.length; k++)
  10808. {
  10809. if(class9.children[k] == -1)
  10810. break;
  10811. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
  10812. if(class9_1.interfaceType == 1)
  10813. flag1 |= method119(i, class9_1.id);
  10814. if(class9_1.interfaceType == 6 && (class9_1.disabledAnimation != -1 || class9_1.enabledAnimation != -1))
  10815. {
  10816. boolean flag2 = interfaceIsSelected(class9_1);
  10817. int l;
  10818. if(flag2)
  10819. l = class9_1.enabledAnimation;
  10820. else
  10821. l = class9_1.disabledAnimation;
  10822. if(l != -1)
  10823. {
  10824. Animation animation = Animation.anims[l];
  10825. for(class9_1.animationDelay += i; class9_1.animationDelay > animation.method258(class9_1.animationLength);)
  10826. {
  10827. class9_1.animationDelay -= animation.method258(class9_1.animationLength) + 1;
  10828. class9_1.animationLength++;
  10829. if(class9_1.animationLength >= animation.anInt352)
  10830. {
  10831. class9_1.animationLength -= animation.anInt356;
  10832. if(class9_1.animationLength < 0 || class9_1.animationLength >= animation.anInt352)
  10833. class9_1.animationLength = 0;
  10834. }
  10835. flag1 = true;
  10836. }
  10837.  
  10838. }
  10839. }
  10840. }
  10841.  
  10842. return flag1;
  10843. }
  10844.  
  10845. private int method120()
  10846. {
  10847. int j = 3;
  10848. if(yCameraCurve < 310)
  10849. {
  10850. int k = xCameraPos >> 7;
  10851. int l = yCameraPos >> 7;
  10852. int i1 = myPlayer.x >> 7;
  10853. int j1 = myPlayer.y >> 7;
  10854. if((byteGroundArray[plane][k][l] & 4) != 0)
  10855. j = plane;
  10856. int k1;
  10857. if(i1 > k)
  10858. k1 = i1 - k;
  10859. else
  10860. k1 = k - i1;
  10861. int l1;
  10862. if(j1 > l)
  10863. l1 = j1 - l;
  10864. else
  10865. l1 = l - j1;
  10866. if(k1 > l1)
  10867. {
  10868. int i2 = (l1 * 0x10000) / k1;
  10869. int k2 = 32768;
  10870. while(k != i1)
  10871. {
  10872. if(k < i1)
  10873. k++;
  10874. else
  10875. if(k > i1)
  10876. k--;
  10877. if((byteGroundArray[plane][k][l] & 4) != 0)
  10878. j = plane;
  10879. k2 += i2;
  10880. if(k2 >= 0x10000)
  10881. {
  10882. k2 -= 0x10000;
  10883. if(l < j1)
  10884. l++;
  10885. else
  10886. if(l > j1)
  10887. l--;
  10888. if((byteGroundArray[plane][k][l] & 4) != 0)
  10889. j = plane;
  10890. }
  10891. }
  10892. } else
  10893. {
  10894. int j2 = (k1 * 0x10000) / l1;
  10895. int l2 = 32768;
  10896. while(l != j1)
  10897. {
  10898. if(l < j1)
  10899. l++;
  10900. else
  10901. if(l > j1)
  10902. l--;
  10903. if((byteGroundArray[plane][k][l] & 4) != 0)
  10904. j = plane;
  10905. l2 += j2;
  10906. if(l2 >= 0x10000)
  10907. {
  10908. l2 -= 0x10000;
  10909. if(k < i1)
  10910. k++;
  10911. else
  10912. if(k > i1)
  10913. k--;
  10914. if((byteGroundArray[plane][k][l] & 4) != 0)
  10915. j = plane;
  10916. }
  10917. }
  10918. }
  10919. }
  10920. if((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
  10921. j = plane;
  10922. return j;
  10923. }
  10924.  
  10925. private int method121()
  10926. {
  10927. int j = method42(plane, yCameraPos, xCameraPos);
  10928. if(j - zCameraPos < 800 && (byteGroundArray[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
  10929. return plane;
  10930. else
  10931. return 3;
  10932. }
  10933.  
  10934. private void delIgnore(long l)
  10935. {
  10936. try
  10937. {
  10938. if(l == 0L)
  10939. return;
  10940. for(int j = 0; j < ignoreCount; j++)
  10941. if(ignoreListAsLongs[j] == l)
  10942. {
  10943. ignoreCount--;
  10944. System.arraycopy(ignoreListAsLongs, j + 1, ignoreListAsLongs, j, ignoreCount - j);
  10945.  
  10946. stream.createFrame(74);
  10947. stream.writeQWord(l);
  10948. return;
  10949. }
  10950.  
  10951. return;
  10952. }
  10953. catch(RuntimeException runtimeexception)
  10954. {
  10955. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  10956. }
  10957. throw new RuntimeException();
  10958. }
  10959.  
  10960.  
  10961. private void chatJoin(long l) {
  10962. try {
  10963. if(l == 0L)
  10964. return;
  10965. stream.createFrame(60);
  10966. stream.writeQWord(l);
  10967. return;
  10968. }
  10969. catch(RuntimeException runtimeexception)
  10970. {
  10971. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  10972. }
  10973. throw new RuntimeException();
  10974.  
  10975. }
  10976.  
  10977. public String getParameter(String s)
  10978. {
  10979. if(signlink.mainapp != null)
  10980. return signlink.mainapp.getParameter(s);
  10981. else
  10982. return super.getParameter(s);
  10983. }
  10984.  
  10985. private void adjustVolume(boolean flag, int i)
  10986. {
  10987. signlink.midivol = i;
  10988. if(flag)
  10989. signlink.midi = "voladjust";
  10990. }
  10991.  
  10992. private int extractInterfaceValues(RSInterface class9, int j)
  10993. {
  10994. if(class9.valueIndexArray == null || j >= class9.valueIndexArray.length)
  10995. return -2;
  10996. try
  10997. {
  10998. int ai[] = class9.valueIndexArray[j];
  10999. int k = 0;
  11000. int l = 0;
  11001. int i1 = 0;
  11002. do
  11003. {
  11004. int j1 = ai[l++];
  11005. int k1 = 0;
  11006. byte byte0 = 0;
  11007. if(j1 == 0)
  11008. return k;
  11009. if(j1 == 1)
  11010. k1 = currentStats[ai[l++]];
  11011. if(j1 == 2)
  11012. k1 = maxStats[ai[l++]];
  11013. if(j1 == 3)
  11014. k1 = currentExp[ai[l++]];
  11015. if(j1 == 4)
  11016. {
  11017. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  11018. int k2 = ai[l++];
  11019. if(k2 >= 0 && k2 < ItemDef.totalItems && (!ItemDef.forID(k2).membersObject || isMembers))
  11020. {
  11021. for(int j3 = 0; j3 < class9_1.inventory.length; j3++)
  11022. if(class9_1.inventory[j3] == k2 + 1)
  11023. k1 += class9_1.inventoryValue[j3];
  11024.  
  11025. }
  11026. }
  11027. if(j1 == 5)
  11028. k1 = variousSettings[ai[l++]];
  11029. if(j1 == 6)
  11030. k1 = anIntArray1019[maxStats[ai[l++]] - 1];
  11031. if(j1 == 7)
  11032. k1 = (variousSettings[ai[l++]] * 100) / 46875;
  11033. if(j1 == 8)
  11034. k1 = myPlayer.combatLevel;
  11035. if(j1 == 9)
  11036. {
  11037. for(int l1 = 0; l1 < Skills.skillsCount; l1++)
  11038. if(Skills.skillEnabled[l1])
  11039. k1 += maxStats[l1];
  11040.  
  11041. }
  11042. if(j1 == 10)
  11043. {
  11044. RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
  11045. int l2 = ai[l++] + 1;
  11046. if(l2 >= 0 && l2 < ItemDef.totalItems && (!ItemDef.forID(l2).membersObject || isMembers))
  11047. {
  11048. for(int k3 = 0; k3 < class9_2.inventory.length; k3++)
  11049. {
  11050. if(class9_2.inventory[k3] != l2)
  11051. continue;
  11052. k1 = 0x3b9ac9ff;
  11053. break;
  11054. }
  11055.  
  11056. }
  11057. }
  11058. if(j1 == 11)
  11059. k1 = energy;
  11060. if(j1 == 12)
  11061. k1 = weight;
  11062. if(j1 == 13)
  11063. {
  11064. int i2 = variousSettings[ai[l++]];
  11065. int i3 = ai[l++];
  11066. k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  11067. }
  11068. if(j1 == 14)
  11069. {
  11070. int j2 = ai[l++];
  11071. VarBit varBit = VarBit.cache[j2];
  11072. int l3 = varBit.anInt648;
  11073. int i4 = varBit.anInt649;
  11074. int j4 = varBit.anInt650;
  11075. int k4 = anIntArray1232[j4 - i4];
  11076. k1 = variousSettings[l3] >> i4 & k4;
  11077. }
  11078. if(j1 == 15)
  11079. byte0 = 1;
  11080. if(j1 == 16)
  11081. byte0 = 2;
  11082. if(j1 == 17)
  11083. byte0 = 3;
  11084. if(j1 == 18)
  11085. k1 = (myPlayer.x >> 7) + baseX;
  11086. if(j1 == 19)
  11087. k1 = (myPlayer.y >> 7) + baseY;
  11088. if(j1 == 20)
  11089. k1 = ai[l++];
  11090. if(byte0 == 0)
  11091. {
  11092. if(i1 == 0)
  11093. k += k1;
  11094. if(i1 == 1)
  11095. k -= k1;
  11096. if(i1 == 2 && k1 != 0)
  11097. k /= k1;
  11098. if(i1 == 3)
  11099. k *= k1;
  11100. i1 = 0;
  11101. } else
  11102. {
  11103. i1 = byte0;
  11104. }
  11105. } while(true);
  11106. }
  11107. catch(Exception _ex)
  11108. {
  11109. return -1;
  11110. }
  11111. }
  11112.  
  11113. private void drawTooltip() {
  11114. if(menuActionRow < 2 && itemSelected == 0 && spellSelected == 0)
  11115. return;
  11116. String s;
  11117. if(itemSelected == 1 && menuActionRow < 2)
  11118. s = "Use " + selectedItemName + " with...";
  11119. else if(spellSelected == 1 && menuActionRow < 2)
  11120. s = spellTooltip + "...";
  11121. else
  11122. s = menuActionName[menuActionRow - 1];
  11123. if(menuActionRow > 2)
  11124. s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
  11125. aTextDrawingArea_1271.method390(4, 0xffffff, s, loopCycle / 1000, 15);
  11126. }
  11127.  
  11128. private void drawMinimap(RSImageProducer mapImage, int paddingX, int paddingY) {
  11129. int compassX, compassY, MapY, MapX;
  11130. if(is480 == true || is508 == true || is525 == true || is562 == true) {
  11131. compassX = 11;
  11132. compassY = 8;
  11133. MapY = 9;
  11134. MapX = 38;
  11135. } else if(is474) {
  11136. compassX = 30;
  11137. compassY = 4;
  11138. MapY = 9;
  11139. MapX = 50;
  11140. } else {
  11141. compassX = 30+5;
  11142. compassY = 4;
  11143. MapY = 9;
  11144. MapX = 50+6;
  11145. }
  11146. mapBackImage.initDrawingArea();
  11147. if (anInt1021 == 2) {
  11148. Black[getSpriteID()].drawSprite(0, 0);
  11149. if(is474 == true ||is480 == true || is508 == true || is525 == true || is562 == true) {
  11150. loadOrbs();
  11151. }
  11152. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, (toggleFullscreen ? 9 : 8) + paddingY, (toggleFullscreen ? 30 : 11) + paddingX, 33, 25);
  11153. if(menuOpen){
  11154. drawMenu(516, 0);
  11155. }
  11156. main3DArea.initDrawingArea();
  11157. return;
  11158. }
  11159. int i = minimapInt1 + minimapInt2 & 0x7ff;
  11160. int j = 48 + myPlayer.x / 32;
  11161. int l2 = 464 - myPlayer.y / 32;
  11162.  
  11163. for(int j1 = 0; j1 < anIntArray1229.length; j1++){
  11164. anIntArray1229[j1] = 172;
  11165. anIntArray1052[j1] = -22;
  11166. }
  11167. aSprite_1263.method352(152, i, anIntArray1229, 256 + minimapInt3, anIntArray1052, l2, MapY, MapX, 146, j);
  11168. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, compassY, compassX-1, 33, 25);
  11169.  
  11170. for(int j5 = 0; j5 < anInt1071; j5++) {
  11171. try {
  11172. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  11173. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  11174. markMinimap(aSpriteArray1140[j5], k, i3, false);
  11175. } catch(Exception exception) {
  11176. }
  11177. }
  11178.  
  11179. for(int k5 = 0; k5 < 104; k5++) {
  11180. for(int l5 = 0; l5 < 104; l5++) {
  11181. NodeList class19 = groundArray[plane][k5][l5];
  11182. if(class19 != null) {
  11183. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  11184. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  11185. markMinimap(mapDotItem, l, j3, false);
  11186. }
  11187. }
  11188. }
  11189.  
  11190. for(int i6 = 0; i6 < npcCount; i6++) {
  11191. NPC npc = npcArray[npcIndices[i6]];
  11192. if(npc != null && npc.isVisible()) {
  11193. EntityDef entityDef = npc.desc;
  11194. if(entityDef.childrenIDs != null)
  11195. entityDef = entityDef.method161();
  11196. if(entityDef != null && entityDef.aBoolean87 && entityDef.aBoolean84) {
  11197. int i1 = npc.x / 32 - myPlayer.x / 32;
  11198. int k3 = npc.y / 32 - myPlayer.y / 32;
  11199. markMinimap(mapDotNPC, i1, k3, false);
  11200. }
  11201. }
  11202. }
  11203. for(int j6 = 0; j6 < playerCount; j6++) {
  11204. Player player = playerArray[playerIndices[j6]];
  11205. if(player != null && player.isVisible()) {
  11206. int j1 = player.x / 32 - myPlayer.x / 32;
  11207. int l3 = player.y / 32 - myPlayer.y / 32;
  11208. boolean flag1 = false;
  11209. boolean flag3 = false;
  11210. for (int j3 = 0; j3 < clanList.length; j3++) {
  11211. if (clanList[j3] == null)
  11212. continue;
  11213. if (!clanList[j3].equalsIgnoreCase(player.name))
  11214. continue;
  11215. flag3 = true;
  11216. break;
  11217. }
  11218. long l6 = TextClass.longForName(player.name);
  11219. for(int k6 = 0; k6 < friendsCount; k6++) {
  11220. if(l6 != friendsListAsLongs[k6] || friendsNodeIDs[k6] == 0)
  11221. continue;
  11222. flag1 = true;
  11223. break;
  11224. }
  11225. boolean flag2 = false;
  11226. if(myPlayer.team != 0 && player.team != 0 && myPlayer.team == player.team)
  11227. flag2 = true;
  11228. if(flag1)
  11229. markMinimap(mapDotFriend, j1, l3, false);
  11230. else if(flag3)
  11231. markMinimap(mapDotClan, j1, l3, false);
  11232. else if(flag2)
  11233. markMinimap(mapDotTeam, j1, l3, false);
  11234. else
  11235. markMinimap(mapDotPlayer, j1, l3, false);
  11236. }
  11237. }
  11238. if(anInt855 != 0 && loopCycle % 20 < 10) {
  11239. if(anInt855 == 1 && anInt1222 >= 0 && anInt1222 < npcArray.length) {
  11240. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  11241. if(class30_sub2_sub4_sub1_sub1_1 != null) {
  11242. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32 - myPlayer.x / 32;
  11243. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32 - myPlayer.y / 32;
  11244. method81(mapMarker, i4, k1);
  11245. }
  11246. }
  11247. if(anInt855 == 2) {
  11248. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  11249. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  11250. method81(mapMarker, j4, l1);
  11251. }
  11252. if(anInt855 == 10 && anInt933 >= 0 && anInt933 < playerArray.length) {
  11253. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  11254. if(class30_sub2_sub4_sub1_sub2_1 != null) {
  11255. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32 - myPlayer.x / 32;
  11256. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32 - myPlayer.y / 32;
  11257. method81(mapMarker, k4, i2);
  11258. }
  11259. }
  11260. }
  11261. if(destX != 0) {
  11262. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  11263. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  11264. markMinimap(mapFlag, j2, l4, false);
  11265. }
  11266. if (!toggleFullscreen) {
  11267. CustomMapback[getSpriteID()].drawSprite(0, 0);
  11268. } else {
  11269. CustomMapback[getSpriteID()].drawSprite(30 + paddingX, 4 + paddingY);
  11270. CustomMapback[getSpriteID()].drawSprite(25 + paddingX, 4 + paddingY);
  11271. CustomMapback[getSpriteID()].drawSprite(150 + paddingX, 133 + paddingY);
  11272. }
  11273. if(is474 == true ||is480 == true || is508 == true|| is525 == true || is562 == true) {
  11274. loadOrbs();
  11275. DrawingArea.drawPixels(3, 84, 108, 16777215, 3);
  11276. } else {
  11277. DrawingArea.drawPixels(3, 84, 124, 16777215, 3);
  11278. }
  11279. if((menuOpen) && (!toggleFullscreen))
  11280. drawMenu(516, 0);
  11281. main3DArea.initDrawingArea();
  11282. }
  11283.  
  11284. private void npcScreenPos(Entity entity, int i) {
  11285. calcEntityScreenPos(entity.x, i, entity.y);
  11286. }
  11287.  
  11288. private void calcEntityScreenPos(int i, int j, int l) {
  11289. if(i < 128 || l < 128 || i > 13056 || l > 13056) {
  11290. spriteDrawX = -1;
  11291. spriteDrawY = -1;
  11292. return;
  11293. }
  11294. int i1 = method42(plane, l, i) - j;
  11295. i -= xCameraPos;
  11296. i1 -= zCameraPos;
  11297. l -= yCameraPos;
  11298. int j1 = Model.modelIntArray1[yCameraCurve];
  11299. int k1 = Model.modelIntArray2[yCameraCurve];
  11300. int l1 = Model.modelIntArray1[xCameraCurve];
  11301. int i2 = Model.modelIntArray2[xCameraCurve];
  11302. int j2 = l * l1 + i * i2 >> 16;
  11303. l = l * i2 - i * l1 >> 16;
  11304. i = j2;
  11305. j2 = i1 * k1 - l * j1 >> 16;
  11306. l = i1 * j1 + l * k1 >> 16;
  11307. i1 = j2;
  11308. if(l >= 50) {
  11309. spriteDrawX = Texture.textureInt1 + (i << 9) / l;
  11310. spriteDrawY = Texture.textureInt2 + (i1 << 9) / l;
  11311. } else {
  11312. spriteDrawX = -1;
  11313. spriteDrawY = -1;
  11314. }
  11315. }
  11316.  
  11317. private void buildSplitPrivateChatMenu(int paddingX, int paddingY)
  11318. {
  11319. if(splitPrivateChat == 0)
  11320. return;
  11321. int i = 0;
  11322. if(anInt1104 != 0)
  11323. i = 1;
  11324. for(int j = 0; j < 100; j++)
  11325. if(chatMessages[j] != null) {
  11326. int k = chatTypes[j];
  11327. String s = chatNames[j];
  11328. for (byte is = 0; is < 7; is++) {
  11329. if(s != null && s.startsWith("@cr"+is+"@")) {
  11330. s = s.substring(5);
  11331. }
  11332. }
  11333. s = s.replaceAll("<col=(.*)?>(.*)</col>", "");
  11334. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  11335. int l = 329 - i * 13;
  11336. if(super.mouseX > 4 && super.mouseY - 4 > l - 10 && super.mouseY - 4 <= l + 3)
  11337. {
  11338. int i1 = aTextDrawingArea_1271.getTextWidth("From: " + s + chatMessages[j]) + 25;
  11339. if(i1 > 450)
  11340. i1 = 450;
  11341. if(super.mouseX < 4 + i1)
  11342. {
  11343. if(myPrivilege >= 1)
  11344. {
  11345. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  11346. menuActionID[menuActionRow] = 2606;
  11347. menuActionRow++;
  11348. }
  11349. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  11350. menuActionID[menuActionRow] = 2042;
  11351. menuActionRow++;
  11352. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  11353. menuActionID[menuActionRow] = 2337;
  11354. menuActionRow++;
  11355. }
  11356. }
  11357. if(++i >= 5)
  11358. return;
  11359. }
  11360. if((k == 5 || k == 6) && privateChatMode < 2 && ++i >= 5)
  11361. return;
  11362. }
  11363. }
  11364.  
  11365. private void method130(int j, int k, int l, int i1, int j1, int k1,
  11366. int l1, int i2, int j2)
  11367. {
  11368. Class30_Sub1 class30_sub1 = null;
  11369. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  11370. {
  11371. if(class30_sub1_1.anInt1295 != l1 || class30_sub1_1.anInt1297 != i2 || class30_sub1_1.anInt1298 != j1 || class30_sub1_1.anInt1296 != i1)
  11372. continue;
  11373. class30_sub1 = class30_sub1_1;
  11374. break;
  11375. }
  11376.  
  11377. if(class30_sub1 == null)
  11378. {
  11379. class30_sub1 = new Class30_Sub1();
  11380. class30_sub1.anInt1295 = l1;
  11381. class30_sub1.anInt1296 = i1;
  11382. class30_sub1.anInt1297 = i2;
  11383. class30_sub1.anInt1298 = j1;
  11384. method89(class30_sub1);
  11385. aClass19_1179.insertHead(class30_sub1);
  11386. }
  11387. class30_sub1.anInt1291 = k;
  11388. class30_sub1.anInt1293 = k1;
  11389. class30_sub1.anInt1292 = l;
  11390. class30_sub1.anInt1302 = j2;
  11391. class30_sub1.anInt1294 = j;
  11392. }
  11393.  
  11394. private boolean interfaceIsSelected(RSInterface class9)
  11395. {
  11396. if(class9.valueCompareType == null)
  11397. return false;
  11398. for(int i = 0; i < class9.valueCompareType.length; i++)
  11399. {
  11400. int j = extractInterfaceValues(class9, i);
  11401. int k = class9.requiredValues[i];
  11402. if(class9.valueCompareType[i] == 2)
  11403. {
  11404. if(j >= k)
  11405. return false;
  11406. } else
  11407. if(class9.valueCompareType[i] == 3)
  11408. {
  11409. if(j <= k)
  11410. return false;
  11411. } else
  11412. if(class9.valueCompareType[i] == 4)
  11413. {
  11414. if(j == k)
  11415. return false;
  11416. } else
  11417. if(j != k)
  11418. return false;
  11419. }
  11420.  
  11421. return true;
  11422. }
  11423.  
  11424. private void method134(Stream stream)
  11425. {
  11426. int j = stream.readBits(8);
  11427. if(j < playerCount)
  11428. {
  11429. for(int k = j; k < playerCount; k++)
  11430. anIntArray840[anInt839++] = playerIndices[k];
  11431.  
  11432. }
  11433. if(j > playerCount)
  11434. {
  11435. signlink.reporterror(myUsername + " Too many players");
  11436. throw new RuntimeException("eek");
  11437. }
  11438. playerCount = 0;
  11439. for(int l = 0; l < j; l++)
  11440. {
  11441. int i1 = playerIndices[l];
  11442. Player player = playerArray[i1];
  11443. int j1 = stream.readBits(1);
  11444. if(j1 == 0)
  11445. {
  11446. playerIndices[playerCount++] = i1;
  11447. player.anInt1537 = loopCycle;
  11448. } else
  11449. {
  11450. int k1 = stream.readBits(2);
  11451. if(k1 == 0)
  11452. {
  11453. playerIndices[playerCount++] = i1;
  11454. player.anInt1537 = loopCycle;
  11455. anIntArray894[anInt893++] = i1;
  11456. } else
  11457. if(k1 == 1)
  11458. {
  11459. playerIndices[playerCount++] = i1;
  11460. player.anInt1537 = loopCycle;
  11461. int l1 = stream.readBits(3);
  11462. player.moveInDir(false, l1);
  11463. int j2 = stream.readBits(1);
  11464. if(j2 == 1)
  11465. anIntArray894[anInt893++] = i1;
  11466. } else
  11467. if(k1 == 2)
  11468. {
  11469. playerIndices[playerCount++] = i1;
  11470. player.anInt1537 = loopCycle;
  11471. int i2 = stream.readBits(3);
  11472. player.moveInDir(true, i2);
  11473. int k2 = stream.readBits(3);
  11474. player.moveInDir(true, k2);
  11475. int l2 = stream.readBits(1);
  11476. if(l2 == 1)
  11477. anIntArray894[anInt893++] = i1;
  11478. } else
  11479. if(k1 == 3)
  11480. anIntArray840[anInt839++] = i1;
  11481. }
  11482. }
  11483. }
  11484.  
  11485. private Sprite backgroundWorld1;
  11486. private Sprite backgroundWorld2;
  11487.  
  11488. int saveClickX = 0;
  11489. int saveClickY = 0;
  11490. private void drawLoginScreen(boolean flag) {
  11491. resetImageProducers();
  11492. if (super.saveClickX >= 17 && super.saveClickX <= 121 && super.saveClickY >= 428 && super.saveClickY <= 456)
  11493. port = 43594;
  11494. else if(super.saveClickX >= 17 && super.saveClickX <= 121 && super.saveClickY >= 466 && super.saveClickY <= 494)
  11495. port = 43595;
  11496. (port == 43594 ? backgroundWorld1 : backgroundWorld2).drawSprite(0, 0);
  11497. loginScreenArea.initDrawingArea();
  11498. titleBox.drawSprite(254, 140);
  11499. char c = '\u0168';
  11500. if (loginScreenState == 0) {
  11501. int i = 100;
  11502. aTextDrawingArea_1271.method382(0x75a9a9, c / 190,
  11503. onDemandFetcher.statusString, i, true);
  11504. if ((this.mouseX >= 276) && (this.mouseX <= 493) && (this.mouseY >= 199) && (this.mouseY <= 224)) {
  11505. this.boxHover.drawSprite(276, 198);
  11506. }
  11507. else if ((this.mouseX >= 276) && (this.mouseX <= 492) && (this.mouseY >= 245) && (this.mouseY <= 272)) {
  11508. this.boxHover.drawSprite(276, 244);
  11509. }
  11510. this.smallText.method382(16777215, 385, this.loginMessage1, 283, true);
  11511. this.smallText.method382(16777215, 385, this.loginMessage2, 297, true);
  11512. this.aTextDrawingArea_1271.method389(false, 281, 16777215, new StringBuilder().append("").append(capitalize(myUsername)).append(((this.loginScreenCursorPos == 0 ? 1 : 0) & (loopCycle % 40 < 20 ? 1 : 0)) != 0 ? "|" : "").toString(), 217);
  11513. this.aTextDrawingArea_1271.method389(true, 281, 16777215, new StringBuilder().append("").append(TextClass.passwordAsterisks(myPassword)).append(((this.loginScreenCursorPos == 1 ? 1 : 0) & (loopCycle % 40 < 20 ? 1 : 0)) != 0 ? "|" : "").toString(), 263);
  11514. if ((this.mouseX >= 293) && (this.mouseX <= 474) && (this.mouseY >= 302) && (this.mouseY <= 327))
  11515. this.loginHover.drawSprite(296, 301);
  11516. }
  11517. loginScreenArea.drawGraphics(0, super.graphics, 0);
  11518. if (welcomeScreenRaised) {
  11519. /*welcomeScreenRaised = false;
  11520. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  11521. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  11522. gameLogo.drawGraphics(265, super.graphics, 0);
  11523. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  11524. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  11525. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);*/
  11526. }
  11527. }
  11528.  
  11529. public void raiseWelcomeScreen()
  11530. {
  11531. welcomeScreenRaised = true;
  11532. }
  11533.  
  11534. private void method137(Stream stream, int j)
  11535. {
  11536. if(j == 84)
  11537. {
  11538. int k = stream.readUnsignedByte();
  11539. int j3 = localY + (k >> 4 & 7);
  11540. int i6 = localX + (k & 7);
  11541. int l8 = stream.readUnsignedWord();
  11542. int k11 = stream.readUnsignedWord();
  11543. int l13 = stream.readUnsignedWord();
  11544. if(j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104)
  11545. {
  11546. NodeList class19_1 = groundArray[plane][j3][i6];
  11547. if(class19_1 != null)
  11548. {
  11549. for(Item class30_sub2_sub4_sub2_3 = (Item)class19_1.reverseGetFirst(); class30_sub2_sub4_sub2_3 != null; class30_sub2_sub4_sub2_3 = (Item)class19_1.reverseGetNext())
  11550. {
  11551. if(class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff) || class30_sub2_sub4_sub2_3.anInt1559 != k11)
  11552. continue;
  11553. class30_sub2_sub4_sub2_3.anInt1559 = l13;
  11554. break;
  11555. }
  11556.  
  11557. spawnGroundItem(j3, i6);
  11558. }
  11559. }
  11560. return;
  11561. }
  11562. if(j == 105)
  11563. {
  11564. int l = stream.readUnsignedByte();
  11565. int k3 = localY + (l >> 4 & 7);
  11566. int j6 = localX + (l & 7);
  11567. int i9 = stream.readUnsignedWord();
  11568. int l11 = stream.readUnsignedByte();
  11569. int i14 = l11 >> 4 & 0xf;
  11570. int i16 = l11 & 7;
  11571. if(myPlayer.smallX[0] >= k3 - i14 && myPlayer.smallX[0] <= k3 + i14 && myPlayer.smallY[0] >= j6 - i14 && myPlayer.smallY[0] <= j6 + i14 && aBoolean848 && !lowMem && anInt1062 < 50)
  11572. {
  11573. anIntArray1207[anInt1062] = i9;
  11574. anIntArray1241[anInt1062] = i16;
  11575. anIntArray1250[anInt1062] = Sounds.anIntArray326[i9];
  11576. anInt1062++;
  11577. }
  11578. }
  11579. if(j == 215)
  11580. {
  11581. int i1 = stream.readWordA();
  11582. int l3 = stream.method428();
  11583. int k6 = localY + (l3 >> 4 & 7);
  11584. int j9 = localX + (l3 & 7);
  11585. int i12 = stream.readWordA();
  11586. int j14 = stream.readUnsignedWord();
  11587. if(k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104 && i12 != unknownInt10)
  11588. {
  11589. Item class30_sub2_sub4_sub2_2 = new Item();
  11590. class30_sub2_sub4_sub2_2.ID = i1;
  11591. class30_sub2_sub4_sub2_2.anInt1559 = j14;
  11592. if(groundArray[plane][k6][j9] == null)
  11593. groundArray[plane][k6][j9] = new NodeList();
  11594. groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
  11595. spawnGroundItem(k6, j9);
  11596. }
  11597. return;
  11598. }
  11599. if(j == 156)
  11600. {
  11601. int j1 = stream.method426();
  11602. int i4 = localY + (j1 >> 4 & 7);
  11603. int l6 = localX + (j1 & 7);
  11604. int k9 = stream.readUnsignedWord();
  11605. if(i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104)
  11606. {
  11607. NodeList class19 = groundArray[plane][i4][l6];
  11608. if(class19 != null)
  11609. {
  11610. for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  11611. {
  11612. if(item.ID != (k9 & 0x7fff))
  11613. continue;
  11614. item.unlink();
  11615. break;
  11616. }
  11617.  
  11618. if(class19.reverseGetFirst() == null)
  11619. groundArray[plane][i4][l6] = null;
  11620. spawnGroundItem(i4, l6);
  11621. }
  11622. }
  11623. return;
  11624. }
  11625. if(j == 160)
  11626. {
  11627. int k1 = stream.method428();
  11628. int j4 = localY + (k1 >> 4 & 7);
  11629. int i7 = localX + (k1 & 7);
  11630. int l9 = stream.method428();
  11631. int j12 = l9 >> 2;
  11632. int k14 = l9 & 3;
  11633. int j16 = anIntArray1177[j12];
  11634. int j17 = stream.readWordA();
  11635. if(j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103)
  11636. {
  11637. int j18 = intGroundArray[plane][j4][i7];
  11638. int i19 = intGroundArray[plane][j4 + 1][i7];
  11639. int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
  11640. int k20 = intGroundArray[plane][j4][i7 + 1];
  11641. if(j16 == 0)
  11642. {
  11643. Object1 class10 = worldController.method296(plane, j4, i7);
  11644. if(class10 != null)
  11645. {
  11646. int k21 = class10.uid >> 14 & 0x7fff;
  11647. if(j12 == 2)
  11648. {
  11649. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, 4 + k14, 2, i19, l19, j18, k20, j17, false);
  11650. class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(k21, k14 + 1 & 3, 2, i19, l19, j18, k20, j17, false);
  11651. } else
  11652. {
  11653. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, k14, j12, i19, l19, j18, k20, j17, false);
  11654. }
  11655. }
  11656. }
  11657. if(j16 == 1)
  11658. {
  11659. Object2 class26 = worldController.method297(j4, i7, plane);
  11660. if(class26 != null)
  11661. class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(class26.uid >> 14 & 0x7fff, 0, 4, i19, l19, j18, k20, j17, false);
  11662. }
  11663. if(j16 == 2)
  11664. {
  11665. Object5 class28 = worldController.method298(j4, i7, plane);
  11666. if(j12 == 11)
  11667. j12 = 10;
  11668. if(class28 != null)
  11669. class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(class28.uid >> 14 & 0x7fff, k14, j12, i19, l19, j18, k20, j17, false);
  11670. }
  11671. if(j16 == 3)
  11672. {
  11673. Object3 class49 = worldController.method299(i7, j4, plane);
  11674. if(class49 != null)
  11675. class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(class49.uid >> 14 & 0x7fff, k14, 22, i19, l19, j18, k20, j17, false);
  11676. }
  11677. }
  11678. return;
  11679. }
  11680. if(j == 147)
  11681. {
  11682. int l1 = stream.method428();
  11683. int k4 = localY + (l1 >> 4 & 7);
  11684. int j7 = localX + (l1 & 7);
  11685. int i10 = stream.readUnsignedWord();
  11686. byte byte0 = stream.method430();
  11687. int l14 = stream.method434();
  11688. byte byte1 = stream.method429();
  11689. int k17 = stream.readUnsignedWord();
  11690. int k18 = stream.method428();
  11691. int j19 = k18 >> 2;
  11692. int i20 = k18 & 3;
  11693. int l20 = anIntArray1177[j19];
  11694. byte byte2 = stream.readSignedByte();
  11695. int l21 = stream.readUnsignedWord();
  11696. byte byte3 = stream.method429();
  11697. Player player;
  11698. if(i10 == unknownInt10)
  11699. player = myPlayer;
  11700. else
  11701. player = playerArray[i10];
  11702. if(player != null)
  11703. {
  11704. ObjectDef class46 = ObjectDef.forID(l21);
  11705. int i22 = intGroundArray[plane][k4][j7];
  11706. int j22 = intGroundArray[plane][k4 + 1][j7];
  11707. int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
  11708. int l22 = intGroundArray[plane][k4][j7 + 1];
  11709. Model model = class46.method578(j19, i20, i22, j22, k22, l22, -1);
  11710. if(model != null)
  11711. {
  11712. method130(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
  11713. player.anInt1707 = l14 + loopCycle;
  11714. player.anInt1708 = k17 + loopCycle;
  11715. player.aModel_1714 = model;
  11716. int i23 = class46.anInt744;
  11717. int j23 = class46.anInt761;
  11718. if(i20 == 1 || i20 == 3)
  11719. {
  11720. i23 = class46.anInt761;
  11721. j23 = class46.anInt744;
  11722. }
  11723. player.anInt1711 = k4 * 128 + i23 * 64;
  11724. player.anInt1713 = j7 * 128 + j23 * 64;
  11725. player.anInt1712 = method42(plane, player.anInt1713, player.anInt1711);
  11726. if(byte2 > byte0)
  11727. {
  11728. byte byte4 = byte2;
  11729. byte2 = byte0;
  11730. byte0 = byte4;
  11731. }
  11732. if(byte3 > byte1)
  11733. {
  11734. byte byte5 = byte3;
  11735. byte3 = byte1;
  11736. byte1 = byte5;
  11737. }
  11738. player.anInt1719 = k4 + byte2;
  11739. player.anInt1721 = k4 + byte0;
  11740. player.anInt1720 = j7 + byte3;
  11741. player.anInt1722 = j7 + byte1;
  11742. }
  11743. }
  11744. }
  11745. if(j == 151)
  11746. {
  11747. int i2 = stream.method426();
  11748. int l4 = localY + (i2 >> 4 & 7);
  11749. int k7 = localX + (i2 & 7);
  11750. int j10 = stream.method434();
  11751. int k12 = stream.method428();
  11752. int i15 = k12 >> 2;
  11753. int k16 = k12 & 3;
  11754. int l17 = anIntArray1177[i15];
  11755. if(l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104)
  11756. method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
  11757. return;
  11758. }
  11759. if(j == 101)
  11760. {
  11761. int l2 = stream.method427();
  11762. int k5 = l2 >> 2;
  11763. int j8 = l2 & 3;
  11764. int i11 = anIntArray1177[k5];
  11765. int j13 = stream.readUnsignedByte();
  11766. int k15 = localY + (j13 >> 4 & 7);
  11767. int l16 = localX + (j13 & 7);
  11768. if(k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
  11769. method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
  11770. return;
  11771. }
  11772. if(j == 4)
  11773. {
  11774. int j2 = stream.readUnsignedByte();
  11775. int i5 = localY + (j2 >> 4 & 7);
  11776. int l7 = localX + (j2 & 7);
  11777. int k10 = stream.readUnsignedWord();
  11778. int l12 = stream.readUnsignedByte();
  11779. int j15 = stream.readUnsignedWord();
  11780. if(i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104)
  11781. {
  11782. i5 = i5 * 128 + 64;
  11783. l7 = l7 * 128 + 64;
  11784. Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane, loopCycle, j15, k10, method42(plane, l7, i5) - l12, l7, i5);
  11785. aClass19_1056.insertHead(class30_sub2_sub4_sub3);
  11786. }
  11787. return;
  11788. }
  11789. if(j == 44) {
  11790. int k2 = stream.method436();
  11791. int j5 = stream.readUnsignedWord();
  11792. int i8 = stream.readUnsignedByte();
  11793. int l10 = localY + (i8 >> 4 & 7);
  11794. int i13 = localX + (i8 & 7);
  11795. if(l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104)
  11796. {
  11797. Item class30_sub2_sub4_sub2_1 = new Item();
  11798. class30_sub2_sub4_sub2_1.ID = k2;
  11799. class30_sub2_sub4_sub2_1.anInt1559 = j5;
  11800. if(groundArray[plane][l10][i13] == null)
  11801. groundArray[plane][l10][i13] = new NodeList();
  11802. groundArray[plane][l10][i13].insertHead(class30_sub2_sub4_sub2_1);
  11803. spawnGroundItem(l10, i13);
  11804. }
  11805. return;
  11806. }
  11807. if(j == 117)
  11808. {
  11809. int angle = stream.readUnsignedByte();
  11810. int startY = localY + (angle >> 4 & 7);
  11811. int startX = localX + (angle & 7);
  11812. int offY = startY + stream.readSignedByte();
  11813. int offX = startX + stream.readSignedByte();
  11814. int lockOn = stream.readSignedWord();
  11815. int i17 = stream.readUnsignedWord();
  11816. int startHeight = stream.readUnsignedByte() * 4;
  11817. int endHeight = stream.readUnsignedByte() * 4;
  11818. int k19 = stream.readUnsignedWord();
  11819. int j20 = stream.readUnsignedWord();
  11820. int i21 = stream.readUnsignedByte();
  11821. int j21 = stream.readUnsignedByte();
  11822. if(startX >= 0 && startY >= 0 && startX < 104 && startY < 104 && offY >= 0 && offX >= 0 && offY < 104 && offX < 104 && i17 != 65535)
  11823. {
  11824. startY = startY * 128 + 64;
  11825. startX = startX * 128 + 64;
  11826. offY = offY * 128 + 64;
  11827. offX = offX * 128 + 64;
  11828. Animable_Sub4 class30_sub2_sub4_sub4 = new Animable_Sub4(i21, endHeight, k19 + loopCycle, j20 + loopCycle, j21, plane, method42(plane, startX, startY) - startHeight, startX, startY, lockOn, i17);
  11829. class30_sub2_sub4_sub4.method455(k19 + loopCycle, offX, method42(plane, offX, offY) - endHeight, offY);
  11830. aClass19_1013.insertHead(class30_sub2_sub4_sub4);
  11831. }
  11832. }
  11833. }
  11834.  
  11835. private void method139(Stream stream)
  11836. {
  11837. stream.initBitAccess();
  11838. int k = stream.readBits(8);
  11839. if(k < npcCount)
  11840. {
  11841. for(int l = k; l < npcCount; l++)
  11842. anIntArray840[anInt839++] = npcIndices[l];
  11843.  
  11844. }
  11845. if(k > npcCount)
  11846. {
  11847. signlink.reporterror(myUsername + " Too many npcs");
  11848. throw new RuntimeException("eek");
  11849. }
  11850. npcCount = 0;
  11851. for(int i1 = 0; i1 < k; i1++)
  11852. {
  11853. int j1 = npcIndices[i1];
  11854. NPC npc = npcArray[j1];
  11855. int k1 = stream.readBits(1);
  11856. if(k1 == 0)
  11857. {
  11858. npcIndices[npcCount++] = j1;
  11859. npc.anInt1537 = loopCycle;
  11860. } else
  11861. {
  11862. int l1 = stream.readBits(2);
  11863. if(l1 == 0)
  11864. {
  11865. npcIndices[npcCount++] = j1;
  11866. npc.anInt1537 = loopCycle;
  11867. anIntArray894[anInt893++] = j1;
  11868. } else
  11869. if(l1 == 1)
  11870. {
  11871. npcIndices[npcCount++] = j1;
  11872. npc.anInt1537 = loopCycle;
  11873. int i2 = stream.readBits(3);
  11874. npc.moveInDir(false, i2);
  11875. int k2 = stream.readBits(1);
  11876. if(k2 == 1)
  11877. anIntArray894[anInt893++] = j1;
  11878. } else
  11879. if(l1 == 2)
  11880. {
  11881. npcIndices[npcCount++] = j1;
  11882. npc.anInt1537 = loopCycle;
  11883. int j2 = stream.readBits(3);
  11884. npc.moveInDir(true, j2);
  11885. int l2 = stream.readBits(3);
  11886. npc.moveInDir(true, l2);
  11887. int i3 = stream.readBits(1);
  11888. if(i3 == 1)
  11889. anIntArray894[anInt893++] = j1;
  11890. } else
  11891. if(l1 == 3)
  11892. anIntArray840[anInt839++] = j1;
  11893. }
  11894. }
  11895.  
  11896. }
  11897.  
  11898. private void resetImage() {
  11899. DrawingArea.setAllPixelsToZero();
  11900. }
  11901.  
  11902. private void processLoginScreenInput() {
  11903. if (this.loginScreenState == 0) {
  11904. resetImage();
  11905. if (super.clickMode3 == 1 && super.saveClickX >= 276
  11906. && super.saveClickX <= 490 && super.saveClickY >= 194
  11907. && super.saveClickY <= 223)
  11908. loginScreenCursorPos = 0;
  11909. if (super.clickMode3 == 1 && super.mouseX >= 276
  11910. && super.mouseX <= 490 && super.mouseY >= 240
  11911. && super.mouseY <= 270)
  11912. loginScreenCursorPos = 1;
  11913. if (super.clickMode3 == 1 && super.saveClickX >= 295
  11914. && super.saveClickX <= 474 && super.saveClickY >= 301
  11915. && super.saveClickY <= 325) {
  11916. loginFailures = 0;
  11917. if ((myUsername.length() > 0) && (myPassword.length() > 0)) {
  11918. login(myUsername, myPassword, false);
  11919. } else {
  11920. this.loginScreenCursorPos = 0;
  11921. this.loginMessage1 = "Username & Password";
  11922. this.loginMessage2 = "Must be more than 1 character";
  11923. }
  11924. if (this.loggedIn)
  11925. return;
  11926. }
  11927. do {
  11928. int l1 = readChar(-796);
  11929. if (l1 == -1)
  11930. break;
  11931. boolean flag1 = false;
  11932. for (int i2 = 0; i2 < validUserPassChars.length(); i2++) {
  11933. if (l1 != validUserPassChars.charAt(i2))
  11934. continue;
  11935. flag1 = true;
  11936. break;
  11937. }
  11938.  
  11939. if (loginScreenCursorPos == 0) {
  11940. if (l1 == 8 && myUsername.length() > 0)
  11941. myUsername = myUsername.substring(0,
  11942. myUsername.length() - 1);
  11943. if (l1 == 9 || l1 == 10 || l1 == 13)
  11944. loginScreenCursorPos = 1;
  11945. if (flag1)
  11946. myUsername += (char) l1;
  11947. if (myUsername.length() > 12)
  11948. myUsername = myUsername.substring(0, 12);
  11949. } else if (loginScreenCursorPos == 1) {
  11950. if (l1 == 8 && myPassword.length() > 0)
  11951. myPassword = myPassword.substring(0,
  11952. myPassword.length() - 1);
  11953. if(l1 == 9 || l1 == 10 || l1 == 13)
  11954. login(myUsername, myPassword, false);
  11955. if (flag1)
  11956. myPassword += (char) l1;
  11957. if (myPassword.length() > 20)
  11958. myPassword = myPassword.substring(0, 20);
  11959. }
  11960. } while (true);
  11961. return;
  11962. }
  11963. if (loginScreenState == 3) {
  11964. int k = super.myWidth / 2;
  11965. int j1 = super.myHeight / 2 + 50;
  11966. j1 += 20;
  11967. if (super.clickMode3 == 1 && super.saveClickX >= k - 75
  11968. && super.saveClickX <= k + 75
  11969. && super.saveClickY >= j1 - 20
  11970. && super.saveClickY <= j1 + 20)
  11971. loginScreenState = 0;
  11972. }
  11973. }
  11974.  
  11975. private void markMinimap(Sprite sprite, int i, int j, boolean flag) {
  11976. int k = minimapInt1 + minimapInt2 & 0x7ff;
  11977. int l = i * i + j * j;
  11978. if(flag)
  11979. return;
  11980. if(l > 6400)
  11981. return;
  11982. int i1 = Model.modelIntArray1[k];
  11983. int j1 = Model.modelIntArray2[k];
  11984. i1 = (i1 * 256) / (minimapInt3 + 256);
  11985. j1 = (j1 * 256) / (minimapInt3 + 256);
  11986. int k1 = j * i1 + i * j1 >> 16;
  11987. int l1 = j * j1 - i * i1 >> 16;
  11988. if(is474 == true || is480 == true || is508 == true || is525 == true || is562 == true) {
  11989. sprite.drawSprite(((106 + k1) - sprite.maxWidth / 2) + 4 , 89 - l1 - sprite.maxHeight / 2 - 4);
  11990. } else {
  11991. sprite.drawSprite(((122 + k1) - sprite.maxWidth / 2) + 4 , 89 - l1 - sprite.maxHeight / 2 - 4);
  11992. }
  11993. CustomMapback[getSpriteID()].drawSprite(0, 0);
  11994. }
  11995.  
  11996. public int flagPos = 72;
  11997. public int runState = 1;
  11998. public boolean logHover = false;
  11999. public boolean xpHover = false;
  12000. public boolean xpClicked = false;
  12001. public boolean drawXpBar = false;
  12002. public boolean drawFlag = false;
  12003. public int xpToDraw = 0;
  12004. public int testXp = 0;
  12005. public Sprite[] globe = new Sprite[3];
  12006. public Sprite[] ORBS = new Sprite[24];
  12007. public Sprite[] LOGOUT = new Sprite[5];
  12008. public Sprite xpOrb;
  12009. public Sprite sprite1;
  12010. public Sprite xpFlag;
  12011.  
  12012. public static boolean globeState[] = {
  12013. false, false
  12014. };
  12015. public void drawXpOrb() {
  12016. if(super.mouseX >= 516 && super.mouseX <= 550 && super.mouseY >= 46 && super.mouseY <= 80){
  12017. xpHover = true;
  12018. } else {
  12019. xpHover = false;
  12020. }
  12021. if(super.clickMode3 == 1 && super.saveClickX >= 516 && super.saveClickX <= 550 && super.saveClickY >= 46 && super.saveClickY <= 80) {
  12022. if(!xpClicked) {
  12023. xpClicked = true;
  12024. drawXpBar = true;
  12025. } else {
  12026. xpClicked = false;
  12027. drawXpBar = false;
  12028. }
  12029. }
  12030. if(!xpClicked) {
  12031. if(!xpHover) {
  12032. ORBS[17].drawSprite(0, 46);
  12033. } else {
  12034. ORBS[16].drawSprite(0, 46);
  12035. }
  12036. } else {
  12037. if(!xpHover) {
  12038. ORBS[17].drawSprite(0, 46);
  12039. } else {
  12040. ORBS[16].drawSprite(0, 46);
  12041. }
  12042. }
  12043. }
  12044. public void drawGlobe(){
  12045. if(is508 == true || is525 == true || is562 == true) {
  12046. if(super.clickMode3 == 1){
  12047. if(super.saveClickX >= 522 && super.saveClickX <= 558 && super.saveClickY >= 124 && super.saveClickY < 161){
  12048. if(globeState[0]){
  12049. globeState[0] = false;
  12050. } else {
  12051. globeState[0] = true;
  12052. }
  12053. }
  12054. }
  12055. if(super.mouseX >= 522 && super.mouseX <= 558 && super.mouseY >= 124 && super.mouseY < 161){
  12056. globeState[1] = true;
  12057. } else {
  12058. globeState[1] = false;
  12059. }
  12060. } else {
  12061. }
  12062. }
  12063.  
  12064. public void drawLogout(){
  12065. if(is508 || is525 || is562) {
  12066. if(!logHover){
  12067. LOGOUT[0].drawSprite(226, 1);
  12068. } else {
  12069. LOGOUT[1].drawSprite(226, 1);
  12070. }
  12071. if(super.clickMode2 == 1 && super.mouseX >= 765-24 && super.mouseX <= 765 && super.mouseY >= 1 && super.mouseY <= 25){
  12072. LOGOUT[2].drawSprite(226, 1);
  12073. }
  12074. } else if(is480 || is474) {
  12075. if(tabID == 14) {
  12076. LOGOUT[4].drawSprite(226, 1);
  12077. } if(tabID != 14) {
  12078. LOGOUT[3].drawSprite(226, 1);
  12079. }
  12080. }
  12081. }
  12082.  
  12083. public void loadOrbs() {
  12084. drawCoinOrb();
  12085. drawLogout();
  12086. drawXpOrb();
  12087. applySpecialAttackOrb();
  12088.  
  12089.  
  12090. if (!RSInterface.interfaceCache[31240].disabledMessage.equals("1"))
  12091.  
  12092.  
  12093. if(is480 || is508 || is525 || is562)
  12094.  
  12095. //drawSumm();
  12096. applySpecialAttackOrb();
  12097. drawHP();
  12098. drawPrayer();
  12099. drawRunOrb();
  12100. //drawSumm();
  12101. if(is508 == true) {
  12102. globe[0].drawSprite(10, 123);
  12103. } else if(is525 == true || is562 == true) {
  12104. drawGlobe();
  12105. if (globeState[0] && globeState[1]) {
  12106. globe[2].drawSprite(10, 123);
  12107. } else if (globeState[1]) {
  12108. globe[2].drawSprite(10, 123);
  12109. } else if (globeState[0]) {
  12110. globe[1].drawSprite(10, 123);
  12111. } else {
  12112. globe[1].drawSprite(10, 123);
  12113. }
  12114. }
  12115. }
  12116. public Sprite[] Black = new Sprite[5];
  12117. public Sprite[] clanChatIcons = new Sprite[9];
  12118.  
  12119. public void loadExtraSprites(){
  12120. magicAuto = new Sprite("Misc/magicAuto");
  12121. sprite1 = new Sprite("Gameframe/sprite1");
  12122. xpFlag = new Sprite("Gameframe/xpFlag");
  12123. for(int i = 1; i <= 23; i++) {
  12124. ORBS[i] = new Sprite("Gameframe/Orbs/ORBS "+i+"");
  12125. }
  12126. for(int i = 0; i <= 4;i++) {
  12127. LOGOUT[i] = new Sprite("Gameframe/Orbs/X "+i+"");
  12128. }
  12129. for (int j3 = 0; j3 <= 26; j3++) {
  12130. LOGIN[j3] = new Sprite("Login/Buttons/BUTTON "+j3+"");
  12131. }
  12132. for (int i = 0; i <= 2; i++) {
  12133. globe[i] = new Sprite("Gameframe/Globe "+i+"");
  12134. }
  12135. for(int i = 0; i <= 4; i++){
  12136. chatArea[i] = new Sprite("Gameframe/Gameframes/chatArea "+i+"");
  12137. }
  12138. for(int i = 0; i <= 4; i++){
  12139. tabArea[i] = new Sprite("Gameframe/Gameframes/tabArea "+i+"");
  12140. }
  12141. for(int i = 0; i <= 4; i++){
  12142. CustomMapback[i] = new Sprite("Gameframe/Gameframes/Mapback "+i+"");
  12143. }
  12144. for(int i = 0; i <= 6; i++){
  12145. modIcons[i] = new Sprite("Player/MODICONS "+i+"");
  12146. }
  12147.  
  12148. for(int i = 0; i <= 6; i++){
  12149. chatImages[i] = new Sprite("Player/MODICONS "+i+"");
  12150. }
  12151. for (int i = 1; i <= 8; i++)
  12152. clanChatIcons[i] = new Sprite("Player/CLANCHATICONS " + i);
  12153. for(int i = 0; i <= 4; i++){
  12154. Black[i] = new Sprite("Gameframe/Gameframes/Black "+i+"");
  12155. }
  12156. for(int i4 = 0; i4 < 3; i4++) {
  12157. hitMark[i4] = new Sprite("Player/Hits "+i4+"");
  12158. }
  12159. qc = new Sprite("Gameframe/Quickchat");
  12160. }
  12161.  
  12162. public boolean restOrb = false;
  12163. public boolean musicOrb = false;
  12164. public boolean prayClicked = false;
  12165. public boolean prayHover = false;
  12166. public boolean runClicked = true;
  12167. public boolean runHover = false;
  12168. public Sprite magicAuto;
  12169. public boolean Autocast = false;
  12170. public int autocastId = 0;
  12171.  
  12172. private void rightClickChatButtons() {
  12173. if(is474 == true || is480 == true || is508 == true || is525 == true || is562 == true) {
  12174. if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  12175. menuActionName[1] = "View All";
  12176. menuActionID[1] = 999;
  12177. menuActionRow = 2;
  12178. } else if(super.mouseX >= 62 && super.mouseX <= 117 && super.mouseY >= 482 && super.mouseY <= 503) {
  12179. menuActionName[1] = "View Game";
  12180. menuActionID[1] = 998;
  12181. menuActionRow = 2;
  12182. } else if(super.mouseX >= 119 && super.mouseX <= 174 && super.mouseY >= 482 && super.mouseY <= 503) {
  12183. menuActionName[1] = "Hide public";
  12184. menuActionID[1] = 997;
  12185. menuActionName[2] = "Off public";
  12186. menuActionID[2] = 996;
  12187. menuActionName[3] = "Friends public";
  12188. menuActionID[3] = 995;
  12189. menuActionName[4] = "On public";
  12190. menuActionID[4] = 994;
  12191. menuActionName[5] = "View public";
  12192. menuActionID[5] = 993;
  12193. menuActionRow = 6;
  12194. } else if(super.mouseX >= 176 && super.mouseX <= 231 && super.mouseY >= 482 && super.mouseY <= 503) {
  12195. menuActionName[1] = "Off private";
  12196. menuActionID[1] = 992;
  12197. menuActionName[2] = "Friends private";
  12198. menuActionID[2] = 991;
  12199. menuActionName[3] = "On private";
  12200. menuActionID[3] = 990;
  12201. menuActionName[4] = "View private";
  12202. menuActionID[4] = 989;
  12203. menuActionRow = 5;
  12204. } else if(super.mouseX >= 233 && super.mouseX <= 288 && super.mouseY >= 482 && super.mouseY <= 503) {
  12205. menuActionName[1] = "Off clan chat";
  12206. menuActionID[1] = 1003;
  12207. menuActionName[2] = "Friends clan chat";
  12208. menuActionID[2] = 1002;
  12209. menuActionName[3] = "On clan chat";
  12210. menuActionID[3] = 1001;
  12211. menuActionName[4] = "View clan chat";
  12212. menuActionID[4] = 1000;
  12213. menuActionRow = 5;
  12214. } else if(super.mouseX >= 290 && super.mouseX <= 345 && super.mouseY >= 482 && super.mouseY <= 503) {
  12215. menuActionName[1] = "Off trade";
  12216. menuActionID[1] = 987;
  12217. menuActionName[2] = "Friends trade";
  12218. menuActionID[2] = 986;
  12219. menuActionName[3] = "On trade";
  12220. menuActionID[3] = 985;
  12221. menuActionName[4] = "View trade";
  12222. menuActionID[4] = 984;
  12223. menuActionRow = 5;
  12224. } else if(super.mouseX >= 347 && super.mouseX <= 402 && super.mouseY >= 482 && super.mouseY <= 503) {
  12225. menuActionName[1] = "Off assist";
  12226. menuActionID[1] = -1;
  12227. menuActionName[2] = "Friends assist";
  12228. menuActionID[2] = -1;
  12229. menuActionName[3] = "On assist";
  12230. menuActionID[3] = -1;
  12231. menuActionName[4] = "View assist";
  12232. menuActionID[4] = -1;
  12233. menuActionRow = 5;
  12234. } else if(super.mouseX >= 404 && super.mouseX <= 514 && super.mouseY >= 480 && super.mouseY <= 501) {
  12235. menuActionName[1] = "Report Abuse";
  12236. menuActionID[1] = 606;
  12237. menuActionRow = 2;
  12238. }
  12239. } else if(is474) {
  12240. if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  12241. menuActionName[1] = "View All";
  12242. menuActionID[1] = 999;
  12243. menuActionRow = 2;
  12244. } else if(super.mouseX >= 71 && super.mouseX <= 127 && super.mouseY >= 482 && super.mouseY <= 503) {
  12245. menuActionName[1] = "View Game";
  12246. menuActionID[1] = 998;
  12247. menuActionRow = 2;
  12248. } else if(super.mouseX >= 137 && super.mouseX <= 193 && super.mouseY >= 482 && super.mouseY <= 503) {
  12249. menuActionName[1] = "Hide public";
  12250. menuActionID[1] = 997;
  12251. menuActionName[2] = "Off public";
  12252. menuActionID[2] = 996;
  12253. menuActionName[3] = "Friends public";
  12254. menuActionID[3] = 995;
  12255. menuActionName[4] = "On public";
  12256. menuActionID[4] = 994;
  12257. menuActionName[5] = "View public";
  12258. menuActionID[5] = 993;
  12259. menuActionRow = 6;
  12260. } else if(super.mouseX >= 203 && super.mouseX <= 259 && super.mouseY >= 482 && super.mouseY <= 503) {
  12261. menuActionName[1] = "Off private";
  12262. menuActionID[1] = 992;
  12263. menuActionName[2] = "Friends private";
  12264. menuActionID[2] = 991;
  12265. menuActionName[3] = "On private";
  12266. menuActionID[3] = 990;
  12267. menuActionName[4] = "View private";
  12268. menuActionID[4] = 989;
  12269. menuActionRow = 5;
  12270. } else if(super.mouseX >= 269 && super.mouseX <= 325 && super.mouseY >= 482 && super.mouseY <= 503) {
  12271. menuActionName[1] = "Off clan chat";
  12272. menuActionID[1] = 1003;
  12273. menuActionName[2] = "Friends clan chat";
  12274. menuActionID[2] = 1002;
  12275. menuActionName[3] = "On clan chat";
  12276. menuActionID[3] = 1001;
  12277. menuActionName[4] = "View clan chat";
  12278. menuActionID[4] = 1000;
  12279. menuActionRow = 5;
  12280. } else if(super.mouseX >= 335 && super.mouseX <= 391 && super.mouseY >= 482 && super.mouseY <= 503) {
  12281. menuActionName[1] = "Off trade";
  12282. menuActionID[1] = 987;
  12283. menuActionName[2] = "Friends trade";
  12284. menuActionID[2] = 986;
  12285. menuActionName[3] = "On trade";
  12286. menuActionID[3] = 985;
  12287. menuActionName[4] = "View trade";
  12288. menuActionID[4] = 984;
  12289. menuActionRow = 5;
  12290. } else if(super.mouseX >= 404 && super.mouseX <= 514 && super.mouseY >= 480 && super.mouseY <= 501) {
  12291. menuActionName[1] = "Report Abuse";
  12292. menuActionID[1] = 606;
  12293. menuActionRow = 2;
  12294. }
  12295. } else {
  12296.  
  12297. }
  12298.  
  12299. }
  12300.  
  12301. public void determineTopTabs(){
  12302. if(is474 || is480 || is508 || is525) {
  12303. if(super.mouseX >= 522 && super.mouseX <= 559 && super.mouseY >= 168 && super.mouseY < 203) {
  12304. menuActionName[1] = "Combat Options";
  12305. menuActionID[1] = 1021;
  12306. menuActionRow = 2;
  12307. } else if(super.mouseX >= 560 && super.mouseX <= 592 && super.mouseY >= 168 && super.mouseY < 203) {
  12308. menuActionName[1] = "Stats";
  12309. menuActionID[1] = 1022;
  12310. menuActionRow = 2;
  12311. } else if(super.mouseX >= 593 && super.mouseX <= 625 && super.mouseY >= 168 && super.mouseY < 203) {
  12312. menuActionName[1] = "Quest List";
  12313. menuActionID[1] = 1023;
  12314. menuActionRow = 2;
  12315. } else if(super.mouseX >= 626 && super.mouseX <= 658 && super.mouseY >= 168 && super.mouseY < 203) {
  12316. menuActionName[1] = "Inventory";
  12317. menuActionID[1] = 1024;
  12318. menuActionRow = 2;
  12319. } else if(super.mouseX >= 659 && super.mouseX <= 691 && super.mouseY >= 168 && super.mouseY < 203) {
  12320. menuActionName[1] = "Worn Equipment";
  12321. menuActionID[1] = 1030;
  12322. menuActionRow = 2;
  12323. } else if(super.mouseX >= 692 && super.mouseX <= 724 && super.mouseY >= 168 && super.mouseY < 203) {
  12324. menuActionName[1] = "Prayer";
  12325. menuActionID[1] = 1026;
  12326. menuActionRow = 2;
  12327. } else if(super.mouseX >= 725 && super.mouseX <= 762 && super.mouseY >= 168 && super.mouseY < 203) {
  12328. menuActionName[1] = "Magic";
  12329. menuActionID[1] = 1027;
  12330. menuActionRow = 2;
  12331. }
  12332. } else if(is562) {
  12333.  
  12334. }
  12335. }
  12336.  
  12337. public void determineBottomTabs(){
  12338. if(is480 || is508 || is525) {
  12339. if(super.mouseX >= 522 && super.mouseX <= 559 && super.mouseY >= 466 && super.mouseY < 503) {
  12340. if (!summoningTab)
  12341. menuActionName[1] = "Logout";
  12342. else
  12343. menuActionName[1] = "Summoning";
  12344. menuActionID[1] = 1011;
  12345. menuActionRow = 2;
  12346. } else if(super.mouseX >= 626 && super.mouseX <= 658 && super.mouseY >= 466 && super.mouseY < 503) {
  12347. menuActionName[1] = "Clan Chat";
  12348. menuActionID[1] = 1008;
  12349. menuActionRow = 2;
  12350. } else if(super.mouseX >= 742 && super.mouseX <= 764 && super.mouseY >= 1 && super.mouseY <= 23) {
  12351. menuActionName[1] = "Logout";
  12352. menuActionID[1] = 1011;
  12353. menuActionRow = 2;
  12354. }
  12355. } else if(is474 && !is562) {
  12356. if(super.mouseX >= 522 && super.mouseX <= 559 && super.mouseY >= 466 && super.mouseY < 503) {
  12357. menuActionName[1] = "Clan Chat";
  12358. menuActionID[1] = 1008;
  12359. menuActionRow = 2;
  12360. } else if(super.mouseX >= 626 && super.mouseX <= 658 && super.mouseY >= 466 && super.mouseY < 503) {
  12361. menuActionName[1] = "Logout";
  12362. menuActionID[1] = 1011;
  12363. menuActionRow = 2;
  12364. }
  12365. } else if(is562){
  12366. if(super.mouseX >= 521 && super.mouseX <= 550 && super.mouseY >= 169 && super.mouseY < 205) {
  12367. tabHPos = 0;
  12368. tabAreaAltered = true;
  12369. } else if(super.mouseX >= 552 && super.mouseX <= 581 && super.mouseY >= 168 && super.mouseY < 205) {
  12370. tabHPos = 1;
  12371. tabAreaAltered = true;
  12372. } else if(super.mouseX >= 582 && super.mouseX <= 611 && super.mouseY >= 168 && super.mouseY < 205) {
  12373. tabHPos = 2;
  12374. tabAreaAltered = true;
  12375. } else if(super.mouseX >= 612 && super.mouseX <= 641 && super.mouseY >= 168 && super.mouseY < 203) {
  12376. //tabHPos = 3;
  12377. //needDrawTabArea = true;
  12378. //tabAreaAltered = true;
  12379. } else if(super.mouseX >= 642 && super.mouseX <= 671 && super.mouseY >= 168 && super.mouseY < 205) {
  12380. tabHPos = 4;
  12381. tabAreaAltered = true;
  12382. } else if(super.mouseX >= 672 && super.mouseX <= 701 && super.mouseY >= 168 && super.mouseY < 205) {
  12383. tabHPos = 5;
  12384. tabAreaAltered = true;
  12385. } else if(super.mouseX >= 702 && super.mouseX <= 731 && super.mouseY >= 169 && super.mouseY < 205) {
  12386. tabHPos = 6;
  12387. tabAreaAltered = true;
  12388. } else if(super.mouseX >= 732 && super.mouseX <= 761 && super.mouseY >= 169 && super.mouseY < 205) {
  12389. tabHPos = 7;
  12390. tabAreaAltered = true;
  12391. } else if(super.mouseX >= 522 && super.mouseX <= 551 && super.mouseY >= 466 && super.mouseY < 503) {
  12392. tabHPos = 15;
  12393. tabAreaAltered = true;
  12394. } else if(super.mouseX >= 552 && super.mouseX <= 581 && super.mouseY >= 466 && super.mouseY < 503) {
  12395. tabHPos = 8;
  12396. tabAreaAltered = true;
  12397. } else if(super.mouseX >= 582 && super.mouseX <= 611 && super.mouseY >= 466 && super.mouseY < 503) {
  12398. tabHPos = 9;
  12399. tabAreaAltered = true;
  12400. } else if(super.mouseX >= 612 && super.mouseX <= 641 && super.mouseY >= 466 && super.mouseY < 503) {
  12401. tabHPos = 10;
  12402. tabAreaAltered = true;
  12403. } else if(super.mouseX >= 642 && super.mouseX <= 671 && super.mouseY >= 466 && super.mouseY < 503) {
  12404. tabHPos = 11;
  12405. tabAreaAltered = true;
  12406. } else if(super.mouseX >= 672 && super.mouseX <= 701 && super.mouseY >= 466 && super.mouseY < 503) {
  12407. tabHPos = 12;
  12408. tabAreaAltered = true;
  12409. } else if(super.mouseX >= 702 && super.mouseX <= 731 && super.mouseY >= 466 && super.mouseY < 502) {
  12410. tabHPos = 13;
  12411. tabAreaAltered = true;
  12412. } else if(super.mouseX >= 732 && super.mouseX <= 761 && super.mouseY >= 466 && super.mouseY < 502) {
  12413. tabHPos = 14;
  12414. tabAreaAltered = true;
  12415. } else {
  12416. tabHPos = -1;
  12417. tabAreaAltered = true;
  12418. }
  12419. if(super.clickMode3 == 1) {
  12420. if(super.saveClickX >= 522 && super.saveClickX <= 551 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[0] != -1) {
  12421. tabID = 0;
  12422. tabAreaAltered = true;
  12423. } else if(super.saveClickX >= 552 && super.saveClickX <= 581 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[1] != -1) {
  12424. tabID = 1;
  12425. tabAreaAltered = true;
  12426. } else if(super.saveClickX >= 582 && super.saveClickX <= 611 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[2] != -1) {
  12427. tabID = 2;
  12428. tabAreaAltered = true;
  12429. } else if(super.saveClickX >= 612 && super.saveClickX <= 641 && super.saveClickY >= 168 && super.saveClickY < 203 && tabInterfaceIDs[14] != -1) {
  12430. //needDrawTabArea = true;
  12431. //tabID = 14;
  12432. //tabAreaAltered = true;
  12433. } else if(super.saveClickX >= 642 && super.saveClickX <= 671 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[3] != -1) {
  12434. tabID = 3;
  12435. tabAreaAltered = true;
  12436. } else if(super.saveClickX >= 672 && super.saveClickX <= 701 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[4] != -1) {
  12437. tabID = 4;
  12438. tabAreaAltered = true;
  12439. } else if(super.saveClickX >= 702 && super.saveClickX <= 731 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[5] != -1) {
  12440. tabID = 5;
  12441. tabAreaAltered = true;
  12442. } else if(super.saveClickX >= 732 && super.saveClickX <= 761 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[6] != -1) {
  12443. tabID = 6;
  12444. tabAreaAltered = true;
  12445. } else if(super.saveClickX >= 522 && super.saveClickX <= 551 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[16] != -1) {
  12446. tabID = 16;
  12447. tabAreaAltered = true;
  12448. } else if(super.saveClickX >= 552 && super.saveClickX <= 581 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[8] != -1) {
  12449. tabID = 8;
  12450. tabAreaAltered = true;
  12451. } else if(super.saveClickX >= 582 && super.saveClickX <= 611 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[9] != -1) {
  12452. tabID = 9;
  12453. tabAreaAltered = true;
  12454. } else if(super.saveClickX >= 612 && super.saveClickX <= 641 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[7] != -1) {
  12455. tabID = 7;
  12456. tabAreaAltered = true;
  12457. } else if(super.saveClickX >= 642 && super.saveClickX <= 671 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[11] != -1) {
  12458. tabID = 11;
  12459. tabAreaAltered = true;
  12460. } else if(super.saveClickX >= 672 && super.saveClickX <= 701 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[12] != -1) {
  12461. tabID = 12;
  12462. tabAreaAltered = true;
  12463. } else if(super.saveClickX >= 702 && super.saveClickX <= 731 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[13] != -1) {
  12464. tabID = 13;
  12465. tabAreaAltered = true;
  12466. } else if(super.saveClickX >= 732 && super.saveClickX <= 761 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[15] != -1) {
  12467. tabID = 15;
  12468. tabAreaAltered = true;
  12469. }
  12470. }
  12471.  
  12472. }
  12473. if(is474 || is480 || is508 || is525) {
  12474. if(super.mouseX >= 560 && super.mouseX <= 592 && super.mouseY >= 466 && super.mouseY < 503) {
  12475. menuActionName[1] = "Friend List";
  12476. menuActionID[1] = 1009;
  12477. menuActionRow = 2;
  12478. } else if(super.mouseX >= 593 && super.mouseX <= 625 && super.mouseY >= 466 && super.mouseY < 503) {
  12479. menuActionName[1] = "Ignore List";
  12480. menuActionID[1] = 1010;
  12481. menuActionRow = 2;
  12482. } else if(super.mouseX >= 659 && super.mouseX <= 691 && super.mouseY >= 466 && super.mouseY < 503) {
  12483. menuActionName[1] = "Options";
  12484. menuActionID[1] = 1012;
  12485. menuActionRow = 2;
  12486. } else if(super.mouseX >= 692 && super.mouseX <= 724 && super.mouseY >= 466 && super.mouseY < 503) {
  12487. menuActionName[1] = "Emotes";
  12488. menuActionID[1] = 1013;
  12489. menuActionRow = 2;
  12490. } else if(super.mouseX >= 725 && super.mouseX <= 762 && super.mouseY >= 466 && super.mouseY < 503) {
  12491. menuActionName[1] = "Music Player";
  12492. menuActionID[1] = 1014;
  12493. menuActionRow = 2;
  12494. }
  12495. }
  12496. }
  12497.  
  12498. private void processMinimapActions() {
  12499. int x = super.mouseX;
  12500. int y = super.mouseY;
  12501. if (x >= 531 && x <= 557 && y >= 7 && y <= 40) {
  12502. menuActionName[1] = "Face North";
  12503. menuActionID[1] = 477;
  12504. menuActionRow = 2;
  12505. }
  12506. if(!coinToggle){
  12507. if (super.mouseX >= 512 && super.mouseX <= 546 && super.mouseY >= 87 && super.mouseY <= 118) {
  12508. menuActionName[4] = coinToggle ? "Toggle money pouch" : "Toggle money pouch";
  12509. menuActionID[4] = 712;
  12510. menuActionName[3] = "Withdraw money pouch";
  12511. menuActionID[3] = 713;
  12512. menuActionName[2] = "Examine money pouch";
  12513. menuActionID[2] = 714;
  12514. menuActionName[1] = "Price checker";
  12515. menuActionID[1] = 715;
  12516. menuActionRow = 5;
  12517. }
  12518. } else if(coinToggle){
  12519. if (super.mouseX >= 436 && super.mouseX <= 546 && super.mouseY >= 87 && super.mouseY <= 118) {
  12520. menuActionName[4] = coinToggle ? "Toggle money pouch" : "Toggle money pouch";
  12521. menuActionID[4] = 712;
  12522. menuActionName[3] = "Withdraw money pouch";
  12523. menuActionID[3] = 713;
  12524. menuActionName[2] = "Examine money pouch";
  12525. menuActionID[2] = 714;
  12526. menuActionName[1] = "Price checker";
  12527. menuActionID[1] = 715;
  12528. menuActionRow = 5;
  12529. }
  12530. }
  12531. if (super.mouseX >= 695 && super.mouseX <= 751 && super.mouseY >= 134 && super.mouseY < 165) {
  12532. if (familiarType > -1) {
  12533.  
  12534. menuActionName[leftClickOption == 0 ? 7 :5] = "Cast @gre@"+RSInterface.scrollNames[familiarType];
  12535. menuActionID[leftClickOption == 0 ? 7 :5] = 1995;
  12536. menuActionRow = leftClickOption == 0 ? 2 : 4;
  12537. menuActionName[leftClickOption == 1 ? 7 : 6] = "Take BoB";
  12538. menuActionID[leftClickOption == 1 ? 7 : 6] = 1994;
  12539. menuActionRow = leftClickOption == 1 ? 2 :3;
  12540. menuActionName[leftClickOption == 2 ? 7 : (leftClickOption == 1 ? 6 : 5)] = "Call Follower";
  12541. menuActionID[leftClickOption == 2 ? 7 : (leftClickOption == 1 ? 6 : 5)] = 1996;
  12542. menuActionRow = leftClickOption == 2 ? 2 : (leftClickOption == 1 ? 3 : 4);
  12543. menuActionName[4] = "Dismiss";
  12544. menuActionID[4] = 1997;
  12545. menuActionRow = 5;
  12546. menuActionName[3] = "Renew Familiar";
  12547. menuActionID[3] = 1998;
  12548. menuActionRow = 6;
  12549. menuActionName[2] = "Follower Details";
  12550. menuActionID[2] = 1999;
  12551. menuActionRow = 7;
  12552. menuActionName[1] = "Select left-click option";
  12553. menuActionID[1] = 1993;
  12554. menuActionRow = 8;
  12555. } else {
  12556. menuActionName[1] = "Select left-click option";
  12557. menuActionID[1] = 1993;
  12558. menuActionRow = 2;
  12559. }
  12560. }
  12561. if(is508 == true || is525 == true || is562 == true) {
  12562. if(super.mouseX >= 527 && super.mouseX <= 560 && super.mouseY >= 126 && super.mouseY <= 159) {
  12563. }
  12564. if(super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 95 && super.mouseY < 128){
  12565. if(!runClicked){
  12566. menuActionName[2] = "Turn run mode on";
  12567. } else if(runClicked){
  12568. menuActionName[2] = "Turn run mode off";
  12569. }
  12570. menuActionID[2] = 1050;
  12571. menuActionRow = 2;
  12572. menuActionName[1] = "Rest";
  12573. menuActionID[1] = 1501;
  12574. menuActionRow = 3;
  12575. }
  12576. if(super.mouseX >= 516 && super.mouseX <= 550 && super.mouseY >= 46 && super.mouseY < 80){
  12577. menuActionName[3] = counterOn ? "Hide" : "Show";
  12578. menuActionID[3] = 474;
  12579. menuActionName[2] = "Reset";
  12580. menuActionID[2] = 475;
  12581. menuActionName[1] = xpLock ? "Unlock XP" : "Lock XP";
  12582. menuActionID[1] = 476;
  12583. menuActionRow = 4;
  12584. }
  12585. }
  12586. if(super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 52 && super.mouseY < 87){
  12587. if (tabInterfaceIDs[5] == 22500 || tabInterfaceIDs[5] == 18200) {
  12588. if(!prayClicked){
  12589. menuActionName[2] = "Turn quick curses on";
  12590. } else if(prayClicked){
  12591. menuActionName[2] = "Turn quick curses off";
  12592. }
  12593. menuActionID[2] = 1500;
  12594. menuActionRow = 2;
  12595. if (tabInterfaceIDs[5] == 22500)
  12596. menuActionName[1] = "Select quick curses";
  12597. else
  12598. menuActionName[1] = "Finish quick curses selection";
  12599. menuActionID[1] = 1502;
  12600. menuActionRow = 3;
  12601. }
  12602. if (tabInterfaceIDs[5] == 5608 || tabInterfaceIDs[5] == 17200) {
  12603. if(!prayClicked){
  12604. menuActionName[2] = "Turn quick prayers on";
  12605. } else if(prayClicked){
  12606. menuActionName[2] = "Turn quick prayers off";
  12607. }
  12608. menuActionID[2] = 1500;
  12609. menuActionRow = 2;
  12610. if (tabInterfaceIDs[5] == 5608)
  12611. menuActionName[1] = "Select quick prayers";
  12612. else
  12613. menuActionName[1] = "Finish quick prayers selection";
  12614. menuActionID[1] = 1502;
  12615. menuActionRow = 3;
  12616. }
  12617. }
  12618. }
  12619.  
  12620. public int getOrbTextColor(int statusInt){
  12621. if(statusInt >= 75 && statusInt <= 164){
  12622. return 0x00FF00;
  12623. } else if(statusInt >= 50 && statusInt <= 74){
  12624. return 0xFFFF00;
  12625. } else if(statusInt >= 25 && statusInt <= 49){
  12626. return 0xFF981F;
  12627. } else {
  12628. return 0xFF0000;
  12629. }
  12630. }
  12631.  
  12632. public int getOrbFill(int statusInt){
  12633. if(statusInt <= 100 && statusInt >= 97) {
  12634. return 0;
  12635. } else if(statusInt <= 96 && statusInt >= 93) {
  12636. return 1;
  12637. } else if(statusInt <= 92 && statusInt >= 89) {
  12638. return 2;
  12639. } else if(statusInt <= 88 && statusInt >= 85) {
  12640. return 3;
  12641. } else if(statusInt <= 84 && statusInt >= 81) {
  12642. return 4;
  12643. } else if(statusInt <= 80 && statusInt >= 77) {
  12644. return 5;
  12645. } else if(statusInt <= 76 && statusInt >= 73) {
  12646. return 6;
  12647. } else if(statusInt <= 72 && statusInt >= 69) {
  12648. return 7;
  12649. } else if(statusInt <= 68 && statusInt >= 65) {
  12650. return 8;
  12651. } else if(statusInt <= 64 && statusInt >= 61) {
  12652. return 9;
  12653. } else if(statusInt <= 60 && statusInt >= 57) {
  12654. return 10;
  12655. } else if(statusInt <= 56 && statusInt >= 53) {
  12656. return 11;
  12657. } else if(statusInt <= 52 && statusInt >= 49) {
  12658. return 12;
  12659. } else if(statusInt <= 48 && statusInt >= 45) {
  12660. return 13;
  12661. } else if(statusInt <= 44 && statusInt >= 41) {
  12662. return 14;
  12663. } else if(statusInt <= 40 && statusInt >= 37) {
  12664. return 15;
  12665. } else if(statusInt <= 36 && statusInt >= 33) {
  12666. return 16;
  12667. } else if(statusInt <= 32 && statusInt >= 29) {
  12668. return 17;
  12669. } else if(statusInt <= 28 && statusInt >= 25) {
  12670. return 18;
  12671. } else if(statusInt <= 24 && statusInt >= 21) {
  12672. return 19;
  12673. } else if(statusInt <= 20 && statusInt >= 17) {
  12674. return 20;
  12675. } else if(statusInt <= 16 && statusInt >= 13) {
  12676. return 21;
  12677. } else if(statusInt <= 12 && statusInt >= 9) {
  12678. return 22;
  12679. } else if(statusInt <= 8 && statusInt >= 7) {
  12680. return 23;
  12681. } else if(statusInt <= 6 && statusInt >= 5) {
  12682. return 24;
  12683. } else if(statusInt <= 4 && statusInt >= 3) {
  12684. return 25;
  12685. } else if(statusInt <= 2 && statusInt >= 1) {
  12686. return 26;
  12687. } else if(statusInt <= 0) {
  12688. return 27;
  12689. }
  12690. return 0;
  12691. }
  12692.  
  12693. public void drawHP() {
  12694. int health;
  12695. String OrbDirectory = signlink.findcachedir()+"/Sprites/Gameframe/Orbs/";
  12696. String cHP = RSInterface.interfaceCache[31159].disabledMessage; cHP = cHP.replaceAll("%","");
  12697. int currentHP = Integer.parseInt(cHP);
  12698. String mHP = RSInterface.interfaceCache[31160].disabledMessage; mHP = mHP.replaceAll("%","");
  12699. int maxHP2 = Integer.parseInt(mHP)*10;
  12700. health = (int)(((double)currentHP / (double)maxHP2) * 100D);
  12701. ORBS[0] = new Sprite(OrbDirectory+"ORBS 0.PNG", 27, getOrbFill(health));
  12702. if(is480){
  12703. ORBS[14].drawSprite(174, 14);
  12704. } else {
  12705. ORBS[1].drawSprite(174, 14);
  12706. }
  12707. ORBS[2].drawSprite(177, 17);
  12708. ORBS[0].drawSprite(177, 17);
  12709. if(health <= 20){
  12710. if(loopCycle % 20 < 10){
  12711. ORBS[3].drawSprite(183, 25);
  12712. }
  12713. } else {
  12714. ORBS[3].drawSprite(183, 25);
  12715. }
  12716. int Y = 40;
  12717. if(is480){
  12718. Y = 43;
  12719. }
  12720.  
  12721. smallText.method382(getOrbTextColor(health), 216, RSInterface.interfaceCache[31159].disabledMessage, Y, true);
  12722. }
  12723.  
  12724. public void drawPrayer() {
  12725. int prayer;
  12726. String OD = signlink.findcachedir()+"/Sprites/Gameframe/Orbs/";
  12727. String cPR = RSInterface.interfaceCache[31134].disabledMessage;
  12728. int currentPR = Integer.parseInt(cPR);
  12729. String mPR = RSInterface.interfaceCache[31135].disabledMessage;
  12730. int maxPR2 = Integer.parseInt(mPR);
  12731. prayer = (int)(((double)currentPR / (double)maxPR2) * 100D);
  12732. ORBS[0] = new Sprite(OD+"ORBS 0.PNG", 27, getOrbFill(prayer));
  12733. if(!prayClicked){
  12734. if(!is480){
  12735. if(prayHover){
  12736. ORBS[7].drawSprite(190, 53);
  12737. }else if(!prayHover){
  12738. ORBS[1].drawSprite(190, 53);
  12739. }
  12740. } else {
  12741. if(prayHover){
  12742. ORBS[15].drawSprite(190, 53);
  12743. } else {
  12744. ORBS[14].drawSprite(190, 53);
  12745. }
  12746. }
  12747. ORBS[4].drawSprite(193, 56);
  12748. } else if(prayClicked){
  12749. if(!is480){
  12750. if(prayHover){
  12751. ORBS[7].drawSprite(190, 53);
  12752. } else if(!prayHover){
  12753. ORBS[1].drawSprite(190, 53);
  12754. }
  12755. } else {
  12756. if(prayHover){
  12757. ORBS[15].drawSprite(190, 53);
  12758. } else {
  12759. ORBS[14].drawSprite(190, 53);
  12760. }
  12761. }
  12762. if (prayer <= 0)
  12763. prayClicked = false;
  12764. ORBS[5].drawSprite(193, 56);
  12765. }
  12766. ORBS[0].drawSprite(194, 56);
  12767. ORBS[6].drawSprite(197, 60);
  12768. int Y = 79;
  12769. if(is480){
  12770. Y = 82;
  12771. }
  12772. smallText.method382(getOrbTextColor(prayer), 233, RSInterface.interfaceCache[31134].disabledMessage, Y, true);
  12773. }
  12774.  
  12775. public void drawRunOrb(){
  12776. String OD = signlink.findcachedir()+"/Sprites/Gameframe/Orbs/";
  12777. String cEn = RSInterface.interfaceCache[149].disabledMessage; cEn = cEn.replaceAll("%","");
  12778. int currentEner = Integer.parseInt(cEn);
  12779. energy = (int)(((double)currentEner / 100) * 100D);
  12780. ORBS[0] = new Sprite(OD+"ORBS 0.PNG", 27, getOrbFill(energy));
  12781. if(!runClicked){
  12782. if(!is480){
  12783. if(runHover){
  12784. ORBS[7].drawSprite(190, 92);
  12785. } else{
  12786. ORBS[1].drawSprite(190, 92);
  12787. }
  12788. } else {
  12789. ORBS[14].drawSprite(190, 92);
  12790. }
  12791. ORBS[10].drawSprite(193, 95);
  12792. if(energy != 100){
  12793. ORBS[0].drawSprite(193, 95);
  12794. }
  12795. if (restOrb)
  12796. ORBS[8].drawSprite(199, 100);
  12797. else
  12798. ORBS[18].drawSprite(199, 100);
  12799. } else {
  12800. if(!is480){
  12801. if(runHover){
  12802. ORBS[7].drawSprite(190, 92);
  12803. } else {
  12804. ORBS[1].drawSprite(190, 92);
  12805. }
  12806. } else {
  12807. ORBS[14].drawSprite(190, 92);
  12808. }
  12809. ORBS[11].drawSprite(193, 95);
  12810. if(energy != 100){
  12811. ORBS[0].drawSprite(193, 95);
  12812. }
  12813. if (restOrb)
  12814. ORBS[8].drawSprite(199, 100);
  12815. else
  12816. ORBS[19].drawSprite(199, 100);
  12817. }
  12818. int Y = 117;
  12819. if(is480){
  12820. Y = 120;
  12821. }
  12822. smallText.method382(getOrbTextColor(energy), 233, ""+energy, Y, true);
  12823. }
  12824.  
  12825. private void applySpecialAttackOrb() {
  12826. int x = 25;
  12827. int y = 2;
  12828. //ORBS[7].drawSprite(25, 120);
  12829. //ORBS[7].drawSprite(173, 128);
  12830.  
  12831. //ORBS[23].drawSprite(182, 120);
  12832. ORBS[23].drawSprite(176, 131);
  12833. //ORBS[20].drawSprite(182 + 4, 120 + 4);
  12834. ORBS[20].drawSprite(181, 136);
  12835. smallText.drawTextWithColour(getOrbTextColor(specialAttack), 218, specialAttack + "", 157, true);
  12836. }
  12837.  
  12838. /* private void applySpecialAttackOrb() {
  12839. int x = 25;
  12840. int y = 2;
  12841. ORBS[7].drawSprite(25, 120);
  12842.  
  12843. ORBS[23].drawSprite(182, 120);
  12844. ORBS[20].drawSprite(182 + 4, 120 + 4);
  12845. String OrbDirectory = sign.signlink.findcachedir() + "/Sprites/Gameframe/Orbs/";
  12846. //ORBS[0] = new Sprite(OrbDirectory + "ORBS 23.PNG", 27, getOrbFill(value));
  12847. ORBS[0].drawSprite(212, 123);
  12848. ORBS[15].drawSprite(216, 127);
  12849. smallText.drawTextWithColour(getOrbTextColor(specialAttack), 224, specialAttack + "", 146, true);
  12850. } */
  12851.  
  12852. /*public void drawSumm() {
  12853. int summ;
  12854. String OD = signlink.findcachedir() + "Sprites/Gameframe/Orbs/";
  12855. String cPR = RSInterface.interfaceCache[31239].disabledMessage;
  12856. int currentPR = Integer.parseInt(cPR);
  12857. String mPR = RSInterface.interfaceCache[31240].disabledMessage;
  12858. int maxPR2 = Integer.parseInt(mPR);
  12859. summ = (int) (((double) currentPR / (double) maxPR2) * 100D);
  12860. ORBS[0] = new Sprite(OD + "ORBS 0.PNG", 27, getOrbFill(summ));
  12861. if (summHover) {
  12862. ORBS[7].drawSprite(173, 128);
  12863. } else if (!summHover) {
  12864. ORBS[1].drawSprite(173, 128);
  12865. }
  12866. if (familiarType == -1) {
  12867. ORBS[22].drawSprite(176, 131);
  12868. } else {
  12869. ORBS[23].drawSprite(176, 131);
  12870. }
  12871. ORBS[0].drawSprite(176, 131);
  12872. ORBS[20].drawSprite(181, 136);
  12873. if (tabID == 10 && tabInterfaceIDs[10] == 17011) {
  12874. RSInterface.interfaceCache[17025].disabledMessage = cPR+"/"+mPR;
  12875. }
  12876. smallText.method382(getOrbTextColor(summ), 215, ""+RSInterface.interfaceCache[31239].disabledMessage, 155, true);
  12877. }*/
  12878.  
  12879. private int scrollAmount = 0;
  12880. private void method142(int i, int j, int k, int l, int i1, int j1, int k1
  12881. )
  12882. {
  12883. if(i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102)
  12884. {
  12885. if(lowMem && j != plane)
  12886. return;
  12887. int i2 = 0;
  12888. if(j1 == 0)
  12889. i2 = worldController.method300(j, i1, i);
  12890. if(j1 == 1)
  12891. i2 = worldController.method301(j, i1, i);
  12892. if(j1 == 2)
  12893. i2 = worldController.method302(j, i1, i);
  12894. if(j1 == 3)
  12895. i2 = worldController.method303(j, i1, i);
  12896. if(i2 != 0)
  12897. {
  12898. int i3 = worldController.method304(j, i1, i, i2);
  12899. int j2 = i2 >> 14 & 0x7fff;
  12900. int k2 = i3 & 0x1f;
  12901. int l2 = i3 >> 6;
  12902. if(j1 == 0)
  12903. {
  12904. worldController.method291(i1, j, i, (byte)-119);
  12905. ObjectDef class46 = ObjectDef.forID(j2);
  12906. if(class46.aBoolean767)
  12907. aClass11Array1230[j].method215(l2, k2, class46.aBoolean757, i1, i);
  12908. }
  12909. if(j1 == 1)
  12910. worldController.method292(i, j, i1);
  12911. if(j1 == 2)
  12912. {
  12913. worldController.method293(j, i1, i);
  12914. ObjectDef class46_1 = ObjectDef.forID(j2);
  12915. if(i1 + class46_1.anInt744 > 103 || i + class46_1.anInt744 > 103 || i1 + class46_1.anInt761 > 103 || i + class46_1.anInt761 > 103)
  12916. return;
  12917. if(class46_1.aBoolean767)
  12918. aClass11Array1230[j].method216(l2, class46_1.anInt744, i1, i, class46_1.anInt761, class46_1.aBoolean757);
  12919. }
  12920. if(j1 == 3)
  12921. {
  12922. worldController.method294(j, i, i1);
  12923. ObjectDef class46_2 = ObjectDef.forID(j2);
  12924. if(class46_2.aBoolean767 && class46_2.hasActions)
  12925. aClass11Array1230[j].method218(i, i1);
  12926. }
  12927. }
  12928. if(k1 >= 0)
  12929. {
  12930. int j3 = j;
  12931. if(j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
  12932. j3++;
  12933. ObjectManager.method188(worldController, k, i, l, j3, aClass11Array1230[j], intGroundArray, i1, k1, j);
  12934. }
  12935. }
  12936. }
  12937.  
  12938. private void updatePlayers(int i, Stream stream)
  12939. {
  12940. anInt839 = 0;
  12941. anInt893 = 0;
  12942. method117(stream);
  12943. method134(stream);
  12944. method91(stream, i);
  12945. method49(stream);
  12946. for(int k = 0; k < anInt839; k++)
  12947. {
  12948. int l = anIntArray840[k];
  12949. if(playerArray[l].anInt1537 != loopCycle)
  12950. playerArray[l] = null;
  12951. }
  12952.  
  12953. if(stream.currentOffset != i)
  12954. {
  12955. signlink.reporterror("Error packet size mismatch in getplayer pos:" + stream.currentOffset + " psize:" + i);
  12956. throw new RuntimeException("eek");
  12957. }
  12958. for(int i1 = 0; i1 < playerCount; i1++)
  12959. if(playerArray[playerIndices[i1]] == null)
  12960. {
  12961. signlink.reporterror(myUsername + " null entry in pl list - pos:" + i1 + " size:" + playerCount);
  12962. throw new RuntimeException("eek");
  12963. }
  12964.  
  12965. }
  12966.  
  12967. private void setCameraPos(int j, int k, int l, int i1, int j1, int k1)
  12968. {
  12969. int l1 = 2048 - k & 0x7ff;
  12970. int i2 = 2048 - j1 & 0x7ff;
  12971. int j2 = 0;
  12972. int k2 = 0;
  12973. int l2 = j;
  12974. if(l1 != 0) {
  12975. int i3 = Model.modelIntArray1[l1];
  12976. int k3 = Model.modelIntArray2[l1];
  12977. int i4 = k2 * k3 - l2 * i3 >> 16;
  12978. l2 = k2 * i3 + l2 * k3 >> 16;
  12979. k2 = i4;
  12980. }
  12981. if(i2 != 0) {
  12982. int j3 = Model.modelIntArray1[i2];
  12983. int l3 = Model.modelIntArray2[i2];
  12984. int j4 = l2 * j3 + j2 * l3 >> 16;
  12985. l2 = l2 * l3 - j2 * j3 >> 16;
  12986. j2 = j4;
  12987. }
  12988. xCameraPos = l - j2;
  12989. zCameraPos = i1 - k2;
  12990. yCameraPos = k1 - l2;
  12991. yCameraCurve = k;
  12992. xCameraCurve = j1;
  12993. }
  12994.  
  12995. public void updateStrings(String str, int i) {
  12996. switch(i) {
  12997. case 1675: sendFrame126(str, 17508); break;//Stab
  12998. case 1676: sendFrame126(str, 17509); break;//Slash
  12999. case 1677: sendFrame126(str, 17510); break;//Cursh
  13000. case 1678: sendFrame126(str, 17511); break;//Magic
  13001. case 1679: sendFrame126(str, 17512); break;//Range
  13002. case 1680: sendFrame126(str, 17513); break;//Stab
  13003. case 1681: sendFrame126(str, 17514); break;//Slash
  13004. case 1682: sendFrame126(str, 17515); break;//Crush
  13005. case 1683: sendFrame126(str, 17516); break;//Magic
  13006. case 1684: sendFrame126(str, 17517); break;//Range
  13007. case 1686: sendFrame126(str, 17518); break;//Strength
  13008. case 1687: sendFrame126(str, 17519); break;//Prayer
  13009. }
  13010. }
  13011.  
  13012. public void sendFrame126(String str,int i) {
  13013. RSInterface.interfaceCache[i].disabledMessage = str;
  13014. if(RSInterface.interfaceCache[i].parentID == tabInterfaceIDs[tabID]) {
  13015. }
  13016. }
  13017.  
  13018. public void sendPacket185(int button,int toggle,int interfaceType) {
  13019. switch(interfaceType) {
  13020. case 135:
  13021. RSInterface class9 = RSInterface.interfaceCache[button];
  13022. boolean flag8 = true;
  13023. if(class9.contentType > 0)
  13024. flag8 = promptUserForInput(class9);
  13025. if(flag8) {
  13026. stream.createFrame(185);
  13027. stream.writeWord(button);
  13028. }
  13029. break;
  13030. case 646:
  13031. stream.createFrame(185);
  13032. stream.writeWord(button);
  13033. RSInterface class9_2 = RSInterface.interfaceCache[button];
  13034. if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5) {
  13035. if(variousSettings[toggle] != class9_2.requiredValues[0]) {
  13036. variousSettings[toggle] = class9_2.requiredValues[0];
  13037. method33(toggle);
  13038. }
  13039. }
  13040. break;
  13041. case 169:
  13042. stream.createFrame(185);
  13043. stream.writeWord(button);
  13044. RSInterface class9_3 = RSInterface.interfaceCache[button];
  13045. if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5) {
  13046. variousSettings[toggle] = 1 - variousSettings[toggle];
  13047. method33(toggle);
  13048. }
  13049. switch(button) {
  13050. case 19136:
  13051. if(toggle == 0)
  13052. sendFrame36(173,toggle);
  13053. if(toggle == 1)
  13054. sendPacket185(153,173,646);
  13055. break;
  13056. }
  13057. break;
  13058. }
  13059. }
  13060.  
  13061. public void sendFrame36(int id,int state) {
  13062. anIntArray1045[id] = state;
  13063. if(variousSettings[id] != state) {
  13064. variousSettings[id] = state;
  13065. method33(id);
  13066. if(dialogID != -1)
  13067. inputTaken = true;
  13068. }
  13069. }
  13070.  
  13071. public void sendFrame219() {
  13072.  
  13073.  
  13074. if(invOverlayInterfaceID != -1) {
  13075. invOverlayInterfaceID = -1;
  13076. tabAreaAltered = true;
  13077. }
  13078. if(backDialogID != -1) {
  13079. backDialogID = -1;
  13080. inputTaken = true;
  13081. }
  13082. if(inputDialogState != 0) {
  13083. inputDialogState = 0;
  13084. inputTaken = true;
  13085. }
  13086. openInterfaceID = -1;
  13087. aBoolean1149 = false;
  13088. }
  13089.  
  13090. public void sendFrame248(int interfaceID,int sideInterfaceID) {
  13091. if(backDialogID != -1) {
  13092. backDialogID = -1;
  13093. inputTaken = true;
  13094. }
  13095. if(inputDialogState != 0) {
  13096. inputDialogState = 0;
  13097. inputTaken = true;
  13098. }
  13099. openInterfaceID = interfaceID;
  13100. invOverlayInterfaceID = sideInterfaceID;
  13101. tabAreaAltered = true;
  13102. aBoolean1149 = false;
  13103. }
  13104.  
  13105. private boolean parsePacket() {
  13106.  
  13107.  
  13108. if(socketStream == null)
  13109. return false;
  13110. try {
  13111. int i = socketStream.available();
  13112. if(i == 0)
  13113. return false;
  13114. if(pktType == -1) {
  13115. socketStream.flushInputStream(inStream.buffer, 1);
  13116. pktType = inStream.buffer[0] & 0xff;
  13117. if(encryption != null)
  13118. pktType = pktType - encryption.getNextKey() & 0xff;
  13119. pktSize = SizeConstants.packetSizes[pktType];
  13120. i--;
  13121. }
  13122. if(pktSize == -1)
  13123. if(i > 0) {
  13124. socketStream.flushInputStream(inStream.buffer, 1);
  13125. pktSize = inStream.buffer[0] & 0xff;
  13126. i--;
  13127. } else {
  13128. return false;
  13129. }
  13130. if(pktSize == -2)
  13131. if(i > 1) {
  13132. socketStream.flushInputStream(inStream.buffer, 2);
  13133. inStream.currentOffset = 0;
  13134. pktSize = inStream.readUnsignedWord();
  13135. i -= 2;
  13136. } else {
  13137. return false;
  13138. }
  13139. if(i < pktSize)
  13140. return false;
  13141. inStream.currentOffset = 0;
  13142. socketStream.flushInputStream(inStream.buffer, pktSize);
  13143. anInt1009 = 0;
  13144. anInt843 = anInt842;
  13145. anInt842 = anInt841;
  13146. anInt841 = pktType;
  13147. switch(pktType) {
  13148. case 81:
  13149. updatePlayers(pktSize, inStream);
  13150. aBoolean1080 = false;
  13151. pktType = -1;
  13152. return true;
  13153.  
  13154. case 176:
  13155. daysSinceRecovChange = inStream.method427();
  13156. unreadMessages = inStream.readWordA();
  13157. membersInt = inStream.readUnsignedByte();
  13158. anInt1193 = inStream.method440();
  13159. daysSinceLastLogin = inStream.readUnsignedWord();
  13160. if(anInt1193 != 0 && openInterfaceID == -1) {
  13161. signlink.dnslookup(TextClass.method586(anInt1193));
  13162. clearTopInterfaces();
  13163. char c = '\u028A';
  13164. if(daysSinceRecovChange != 201 || membersInt == 1)
  13165. c = '\u028F';
  13166. reportAbuseInput = "";
  13167. canMute = false;
  13168. for(int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
  13169. if(RSInterface.interfaceCache[k9] == null || RSInterface.interfaceCache[k9].contentType != c)
  13170. continue;
  13171. openInterfaceID = RSInterface.interfaceCache[k9].parentID;
  13172.  
  13173. }
  13174. }
  13175. pktType = -1;
  13176. return true;
  13177.  
  13178. case 64:
  13179. localY = inStream.method427();
  13180. localX = inStream.method428();
  13181. for(int j = localY; j < localY + 8; j++) {
  13182. for(int l9 = localX; l9 < localX + 8; l9++)
  13183. if(groundArray[plane][j][l9] != null) {
  13184. groundArray[plane][j][l9] = null;
  13185. spawnGroundItem(j, l9);
  13186. }
  13187. }
  13188. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  13189. if(class30_sub1.anInt1297 >= localY && class30_sub1.anInt1297 < localY + 8 && class30_sub1.anInt1298 >= localX && class30_sub1.anInt1298 < localX + 8 && class30_sub1.anInt1295 == plane)
  13190. class30_sub1.anInt1294 = 0;
  13191. pktType = -1;
  13192. return true;
  13193.  
  13194. case 185:
  13195. int k = inStream.method436();
  13196. //if (k > 22000 && k < 240000) {
  13197. //sendFrame185(
  13198. RSInterface.interfaceCache[k].disabledMediaType = 3;
  13199. if(myPlayer.desc == null)
  13200. RSInterface.interfaceCache[k].disabledMediaID = (myPlayer.anIntArray1700[0] << 25) + (myPlayer.anIntArray1700[4] << 20) + (myPlayer.equipment[0] << 15) + (myPlayer.equipment[8] << 10) + (myPlayer.equipment[11] << 5) + myPlayer.equipment[1];
  13201. else
  13202. RSInterface.interfaceCache[k].disabledMediaID = (int)(0x12345678L + myPlayer.desc.interfaceType);
  13203. pktType = -1;
  13204. return true;
  13205.  
  13206. /* Clan chat packet */
  13207. case 217:
  13208. try {
  13209. name = inStream.readString();
  13210. disabledMessage = inStream.readString();
  13211. clanname = inStream.readString();
  13212. rights = inStream.readUnsignedWord();
  13213. pushMessage(disabledMessage, 16, name);
  13214. } catch(Exception e) {
  13215. e.printStackTrace();
  13216. }
  13217. pktType = -1;
  13218. return true;
  13219.  
  13220. case 107:
  13221. aBoolean1160 = false;
  13222. for(int l = 0; l < 5; l++)
  13223. aBooleanArray876[l] = false;
  13224. pktType = -1;
  13225. return true;
  13226.  
  13227. case 72:
  13228. int i1 = inStream.method434();
  13229. RSInterface class9 = RSInterface.interfaceCache[i1];
  13230. for(int k15 = 0; k15 < class9.inventory.length; k15++) {
  13231. class9.inventory[k15] = -1;
  13232. class9.inventory[k15] = 0;
  13233. }
  13234. pktType = -1;
  13235. return true;
  13236.  
  13237. case 214:
  13238. ignoreCount = pktSize / 8;
  13239. for(int j1 = 0; j1 < ignoreCount; j1++)
  13240. ignoreListAsLongs[j1] = inStream.readQWord();
  13241. pktType = -1;
  13242. return true;
  13243.  
  13244. case 166:
  13245. aBoolean1160 = true;
  13246. anInt1098 = inStream.readUnsignedByte();
  13247. anInt1099 = inStream.readUnsignedByte();
  13248. anInt1100 = inStream.readUnsignedWord();
  13249. anInt1101 = inStream.readUnsignedByte();
  13250. anInt1102 = inStream.readUnsignedByte();
  13251. if(anInt1102 >= 100) {
  13252. xCameraPos = anInt1098 * 128 + 64;
  13253. yCameraPos = anInt1099 * 128 + 64;
  13254. zCameraPos = method42(plane, yCameraPos, xCameraPos) - anInt1100;
  13255. }
  13256. pktType = -1;
  13257. return true;
  13258.  
  13259. case 134:
  13260. int k1 = inStream.readUnsignedByte();
  13261. int i10 = inStream.method439();
  13262. int l15 = inStream.readUnsignedByte();
  13263. int oldXp = currentExp[k1];
  13264. if(drawXpBar) {
  13265. drawFlag = true;
  13266. }
  13267. currentExp[k1] = i10;
  13268. currentStats[k1] = l15;
  13269. maxStats[k1] = 1;
  13270. testXp += i10-oldXp;
  13271. xpToDraw += i10-oldXp;
  13272. if(testXp == currentExp[k1]) {
  13273. testXp = 0;
  13274. xpToDraw = 0;
  13275. }
  13276. for(int k20 = 0; k20 < 98; k20++)
  13277. if(i10 >= anIntArray1019[k20])
  13278. maxStats[k1] = k20 + 2;
  13279. pktType = -1;
  13280. return true;
  13281.  
  13282. case 71:
  13283. int l1 = inStream.readUnsignedWord();//tabclicking
  13284. int j10 = inStream.method426();
  13285. if(l1 == 65535)
  13286. l1 = -1;
  13287. if (j10 == 10) {
  13288. if (l1 == 17011)
  13289. summoningTab = true;
  13290. else {
  13291. summoningTab = false;
  13292. tabID = 3;
  13293. tabHPos = 3;
  13294. }
  13295. }
  13296. tabInterfaceIDs[j10] = l1;
  13297. tabAreaAltered = true;
  13298. pktType = -1;
  13299. return true;
  13300.  
  13301. case 74:
  13302. int i2 = inStream.method434();
  13303. if(i2 == 65535)
  13304. i2 = -1;
  13305. if(i2 != currentSong && musicEnabled && !lowMem && prevSong == 0) {
  13306. nextSong = i2;
  13307. songChanging = true;
  13308. onDemandFetcher.loadToCache(2, nextSong);
  13309. }
  13310. currentSong = i2;
  13311. pktType = -1;
  13312. return true;
  13313.  
  13314. case 121:
  13315. int j2 = inStream.method436();
  13316. int k10 = inStream.readWordA();
  13317. if(musicEnabled && !lowMem) {
  13318. nextSong = j2;
  13319. songChanging = false;
  13320. onDemandFetcher.loadToCache(2, nextSong);
  13321. prevSong = k10;
  13322. }
  13323. pktType = -1;
  13324. return true;
  13325.  
  13326. case 109:
  13327. resetLogout();
  13328. pktType = -1;
  13329. return false;
  13330.  
  13331.  
  13332. case 70:
  13333. int k2 = inStream.readSignedWord();
  13334. int l10 = inStream.method437();
  13335. int i16 = inStream.method434();
  13336. int counter = 0;
  13337. specialAttack = k2;
  13338. System.out.println("k2: " + k2 + " - l10: " + l10 + " - " + i16);
  13339. if (i16 != -1 && i16 != 65535) {
  13340. for (int specBarId = 10; specBarId > 0; specBarId--) {
  13341. RSInterface class9_5 = RSInterface.interfaceCache[i16 - counter];
  13342. counter++;
  13343. class9_5.xOffset = (k2 / 10) >= specBarId ? 500 : 0;
  13344. class9_5.yOffset = l10;
  13345. }
  13346. }
  13347. pktType = -1;
  13348. return true;
  13349.  
  13350.  
  13351. /*case 70:
  13352. int k2 = inStream.readSignedWord();
  13353. int l10 = inStream.method437();
  13354. int i16 = inStream.method434();
  13355. RSInterface class9_5 = RSInterface.interfaceCache[i16];
  13356. class9_5.xOffset = k2;
  13357. class9_5.yOffset = l10;
  13358. pktType = -1;
  13359. return true;
  13360. int k2 = inStream.readSignedWord();
  13361. int l10 = inStream.method437();
  13362. int i16 = inStream.method434();
  13363. RSInterface class9_5 = RSInterface.interfaceCache[i16];
  13364. class9_5.xOffset = k2;
  13365. class9_5.yOffset = l10;
  13366. pktType = -1;
  13367. return true; */
  13368.  
  13369.  
  13370. case 73:
  13371. case 241:
  13372. int l2 = anInt1069;
  13373. int i11 = anInt1070;
  13374. if(pktType == 73) {
  13375. l2 = inStream.readWordA();
  13376. i11 = inStream.readUnsignedWord();
  13377. aBoolean1159 = false;
  13378. }
  13379. if(pktType == 241) {
  13380. i11 = inStream.readWordA();
  13381. inStream.initBitAccess();
  13382. for(int j16 = 0; j16 < 4; j16++) {
  13383. for(int l20 = 0; l20 < 13; l20++) {
  13384. for(int j23 = 0; j23 < 13; j23++) {
  13385. int i26 = inStream.readBits(1);
  13386. if(i26 == 1)
  13387. anIntArrayArrayArray1129[j16][l20][j23] = inStream.readBits(26);
  13388. else
  13389. anIntArrayArrayArray1129[j16][l20][j23] = -1;
  13390. }
  13391. }
  13392. }
  13393. inStream.finishBitAccess();
  13394. l2 = inStream.readUnsignedWord();
  13395. aBoolean1159 = true;
  13396. }
  13397. if(anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2)
  13398. {
  13399. pktType = -1;
  13400. return true;
  13401. }
  13402. anInt1069 = l2;
  13403. anInt1070 = i11;
  13404. baseX = (anInt1069 - 6) * 8;
  13405. baseY = (anInt1070 - 6) * 8;
  13406. aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49) && anInt1070 / 8 == 48;
  13407. if(anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
  13408. aBoolean1141 = true;
  13409. loadingStage = 1;
  13410. aLong824 = System.currentTimeMillis();
  13411. main3DArea.initDrawingArea();
  13412. loadingPleaseWait.drawSprite(8,9);;
  13413. main3DArea.drawGraphics(toggleFullscreen ? 0 : 4, super.graphics, toggleFullscreen ? 0 : 4);
  13414. if(pktType == 73) {
  13415. int k16 = 0;
  13416. for(int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++) {
  13417. for(int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
  13418. k16++;
  13419. }
  13420. aByteArrayArray1183 = new byte[k16][];
  13421. aByteArrayArray1247 = new byte[k16][];
  13422. anIntArray1234 = new int[k16];
  13423. anIntArray1235 = new int[k16];
  13424. anIntArray1236 = new int[k16];
  13425. k16 = 0;
  13426. for(int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++) {
  13427. for(int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++) {
  13428. anIntArray1234[k16] = (l23 << 8) + j26;
  13429. if(aBoolean1141 && (j26 == 49 || j26 == 149 || j26 == 147 || l23 == 50 || l23 == 49 && j26 == 47)) {
  13430. anIntArray1235[k16] = -1;
  13431. anIntArray1236[k16] = -1;
  13432. k16++;
  13433. } else {
  13434. int k28 = anIntArray1235[k16] = onDemandFetcher.method562(0, j26, l23);
  13435. if(k28 != -1)
  13436. onDemandFetcher.loadToCache(3, k28);
  13437. int j30 = anIntArray1236[k16] = onDemandFetcher.method562(1, j26, l23);
  13438. if(j30 != -1)
  13439. onDemandFetcher.loadToCache(3, j30);
  13440. k16++;
  13441. }
  13442. }
  13443. }
  13444. }
  13445. if(pktType == 241) {
  13446. int l16 = 0;
  13447. int ai[] = new int[676];
  13448. for(int i24 = 0; i24 < 4; i24++) {
  13449. for(int k26 = 0; k26 < 13; k26++) {
  13450. for(int l28 = 0; l28 < 13; l28++) {
  13451. int k30 = anIntArrayArrayArray1129[i24][k26][l28];
  13452. if(k30 != -1) {
  13453. int k31 = k30 >> 14 & 0x3ff;
  13454. int i32 = k30 >> 3 & 0x7ff;
  13455. int k32 = (k31 / 8 << 8) + i32 / 8;
  13456. for(int j33 = 0; j33 < l16; j33++) {
  13457. if(ai[j33] != k32)
  13458. continue;
  13459. k32 = -1;
  13460.  
  13461. }
  13462. if(k32 != -1)
  13463. ai[l16++] = k32;
  13464. }
  13465. }
  13466. }
  13467. }
  13468. aByteArrayArray1183 = new byte[l16][];
  13469. aByteArrayArray1247 = new byte[l16][];
  13470. anIntArray1234 = new int[l16];
  13471. anIntArray1235 = new int[l16];
  13472. anIntArray1236 = new int[l16];
  13473. for(int l26 = 0; l26 < l16; l26++) {
  13474. int i29 = anIntArray1234[l26] = ai[l26];
  13475. int l30 = i29 >> 8 & 0xff;
  13476. int l31 = i29 & 0xff;
  13477. int j32 = anIntArray1235[l26] = onDemandFetcher.method562(0, l31, l30);
  13478. if(j32 != -1)
  13479. onDemandFetcher.loadToCache(3, j32);
  13480. int i33 = anIntArray1236[l26] = onDemandFetcher.method562(1, l31, l30);
  13481. if(i33 != -1)
  13482. onDemandFetcher.loadToCache(3, i33);
  13483. }
  13484. }
  13485. int i17 = baseX - anInt1036;
  13486. int j21 = baseY - anInt1037;
  13487. anInt1036 = baseX;
  13488. anInt1037 = baseY;
  13489. for(int j24 = 0; j24 < 16384; j24++) {
  13490. NPC npc = npcArray[j24];
  13491. if(npc != null) {
  13492. for(int j29 = 0; j29 < 10; j29++) {
  13493. npc.smallX[j29] -= i17;
  13494. npc.smallY[j29] -= j21;
  13495. }
  13496. npc.x -= i17 * 128;
  13497. npc.y -= j21 * 128;
  13498. }
  13499. }
  13500. for(int i27 = 0; i27 < maxPlayers; i27++) {
  13501. Player player = playerArray[i27];
  13502. if(player != null) {
  13503. for(int i31 = 0; i31 < 10; i31++) {
  13504. player.smallX[i31] -= i17;
  13505. player.smallY[i31] -= j21;
  13506. }
  13507. player.x -= i17 * 128;
  13508. player.y -= j21 * 128;
  13509. }
  13510. }
  13511. aBoolean1080 = true;
  13512. byte byte1 = 0;
  13513. byte byte2 = 104;
  13514. byte byte3 = 1;
  13515. if(i17 < 0) {
  13516. byte1 = 103;
  13517. byte2 = -1;
  13518. byte3 = -1;
  13519. }
  13520. byte byte4 = 0;
  13521. byte byte5 = 104;
  13522. byte byte6 = 1;
  13523. if(j21 < 0) {
  13524. byte4 = 103;
  13525. byte5 = -1;
  13526. byte6 = -1;
  13527. }
  13528. for(int k33 = byte1; k33 != byte2; k33 += byte3) {
  13529. for(int l33 = byte4; l33 != byte5; l33 += byte6) {
  13530. int i34 = k33 + i17;
  13531. int j34 = l33 + j21;
  13532. for(int k34 = 0; k34 < 4; k34++)
  13533. if(i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
  13534. groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
  13535. else
  13536. groundArray[k34][k33][l33] = null;
  13537. }
  13538. }
  13539. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext()) {
  13540. class30_sub1_1.anInt1297 -= i17;
  13541. class30_sub1_1.anInt1298 -= j21;
  13542. if(class30_sub1_1.anInt1297 < 0 || class30_sub1_1.anInt1298 < 0 || class30_sub1_1.anInt1297 >= 104 || class30_sub1_1.anInt1298 >= 104)
  13543. class30_sub1_1.unlink();
  13544. }
  13545. if(destX != 0) {
  13546. destX -= i17;
  13547. destY -= j21;
  13548. }
  13549. aBoolean1160 = false;
  13550. pktType = -1;
  13551. return true;
  13552.  
  13553. case 208:
  13554. int i3 = inStream.method437();
  13555. if(i3 >= 0)
  13556. method60(i3);
  13557. anInt1018 = i3;
  13558. pktType = -1;
  13559. return true;
  13560.  
  13561. case 99:
  13562. /*
  13563. * Black map, mape state 2, causes blackness
  13564. */
  13565. anInt1021 = inStream.readUnsignedByte();
  13566. pktType = -1;
  13567. return true;
  13568.  
  13569. case 75:
  13570. int j3 = inStream.method436();
  13571. int j11 = inStream.method436();
  13572. RSInterface.interfaceCache[j11].disabledMediaType = 2;
  13573. RSInterface.interfaceCache[j11].disabledMediaID = j3;
  13574. pktType = -1;
  13575. return true;
  13576.  
  13577. case 114:
  13578. anInt1104 = inStream.method434() * 30;
  13579. pktType = -1;
  13580. return true;
  13581.  
  13582. case 60:
  13583. localX = inStream.readUnsignedByte();
  13584. localY = inStream.method427();
  13585. while(inStream.currentOffset < pktSize) {
  13586. int k3 = inStream.readUnsignedByte();
  13587. method137(inStream, k3);
  13588. }
  13589. pktType = -1;
  13590. return true;
  13591.  
  13592. case 35:
  13593. int l3 = inStream.readUnsignedByte();
  13594. int k11 = inStream.readUnsignedByte();
  13595. int j17 = inStream.readUnsignedByte();
  13596. int k21 = inStream.readUnsignedByte();
  13597. aBooleanArray876[l3] = true;
  13598. anIntArray873[l3] = k11;
  13599. anIntArray1203[l3] = j17;
  13600. anIntArray928[l3] = k21;
  13601. anIntArray1030[l3] = 0;
  13602. pktType = -1;
  13603. return true;
  13604.  
  13605. case 174:
  13606. inStream.readUnsignedWord();
  13607. inStream.readUnsignedByte();
  13608. inStream.readUnsignedWord();
  13609. pktType = -1;
  13610. return true;
  13611.  
  13612. case 104:
  13613. int j4 = inStream.method427();
  13614. int i12 = inStream.method426();
  13615. String s6 = inStream.readString();
  13616. if(j4 >= 1 && j4 <= 5) {
  13617. if(s6.equalsIgnoreCase("null"))
  13618. s6 = null;
  13619. atPlayerActions[j4 - 1] = s6;
  13620. atPlayerArray[j4 - 1] = i12 == 0;
  13621. }
  13622. pktType = -1;
  13623. return true;
  13624.  
  13625. case 78:
  13626. destX = 0;
  13627. pktType = -1;
  13628. return true;
  13629.  
  13630. case 253:
  13631. String s = inStream.readString();
  13632. if (s.startsWith(":inclan::")) {
  13633. String[] status = s.split("::");
  13634. inClan = status[1].equals("true");
  13635. if (!inClan) {
  13636. for(int zz = 18144; zz <= 18343; zz++) {
  13637. clanList[zz - 18144] = "";
  13638. sendFrame126("", zz);
  13639. }
  13640. }
  13641. pktType = -1;
  13642. return true;
  13643. }
  13644. if(s.endsWith(":tradereq:")) {
  13645. String s3 = s.substring(0, s.indexOf(":"));
  13646. long l17 = TextClass.longForName(s3);
  13647. boolean flag2 = false;
  13648. for(int j27 = 0; j27 < ignoreCount; j27++) {
  13649. if(ignoreListAsLongs[j27] != l17)
  13650. continue;
  13651. flag2 = true;
  13652. }
  13653. if(!flag2 && anInt1251 == 0)
  13654. pushMessage("wishes to trade with you.", 4, s3);
  13655. } else if (s.endsWith(":clan:")) {
  13656. String s4 = s.substring(0, s.indexOf(":"));
  13657. TextClass.longForName(s4);
  13658. pushMessage("Clan: ", 8, s4);
  13659. } else if(s.endsWith("#url#")) {
  13660. String text = s.substring(0, s.indexOf("-"));
  13661. s = s.substring(text.length()+1).trim();
  13662. String link = s.substring(0, s.indexOf("#"));
  13663. pushMessage(text, 9, link);
  13664. } else if(s.endsWith(":resetautocast:")) {
  13665. Autocast = false;
  13666. autocastId = 0;
  13667. magicAuto.drawSprite(1000, 1000);
  13668. } else if(s.endsWith(":duelreq:")) {
  13669. String s4 = s.substring(0, s.indexOf(":"));
  13670. long l18 = TextClass.longForName(s4);
  13671. boolean flag3 = false;
  13672. for(int k27 = 0; k27 < ignoreCount; k27++) {
  13673. if(ignoreListAsLongs[k27] != l18)
  13674. continue;
  13675. flag3 = true;
  13676.  
  13677. }
  13678. if(!flag3 && anInt1251 == 0)
  13679. pushMessage("wishes to duel with you.", 8, s4);
  13680. } else if(s.endsWith(":chalreq:")) {
  13681. String s5 = s.substring(0, s.indexOf(":"));
  13682. long l19 = TextClass.longForName(s5);
  13683. boolean flag4 = false;
  13684. for(int l27 = 0; l27 < ignoreCount; l27++) {
  13685. if(ignoreListAsLongs[l27] != l19)
  13686. continue;
  13687. flag4 = true;
  13688.  
  13689. }
  13690. if(!flag4 && anInt1251 == 0) {
  13691. String s8 = s.substring(s.indexOf(":") + 1, s.length() - 9);
  13692. pushMessage(s8, 8, s5);
  13693. }
  13694. } else {
  13695. pushMessage(s, 0, "");
  13696. }
  13697. pktType = -1;
  13698. return true;
  13699.  
  13700. case 1:
  13701. for(int k4 = 0; k4 < playerArray.length; k4++)
  13702. if(playerArray[k4] != null)
  13703. playerArray[k4].anim = -1;
  13704. for(int j12 = 0; j12 < npcArray.length; j12++)
  13705. if(npcArray[j12] != null)
  13706. npcArray[j12].anim = -1;
  13707. pktType = -1;
  13708. return true;
  13709.  
  13710. case 50:
  13711. long l4 = inStream.readQWord();
  13712. int i18 = inStream.readUnsignedByte();
  13713. String s7 = TextClass.fixName(TextClass.nameForLong(l4));
  13714. for(int k24 = 0; k24 < friendsCount; k24++) {
  13715. if(l4 != friendsListAsLongs[k24])
  13716. continue;
  13717. if(friendsNodeIDs[k24] != i18) {
  13718. friendsNodeIDs[k24] = i18;
  13719. if(i18 >= 2) {
  13720. pushMessage(s7 + " has logged in.", 5, "");
  13721. }
  13722. if(i18 <= 1) {
  13723. pushMessage(s7 + " has logged out.", 5, "");
  13724. }
  13725. }
  13726. s7 = null;
  13727.  
  13728. }
  13729. if(s7 != null && friendsCount < 200) {
  13730. friendsListAsLongs[friendsCount] = l4;
  13731. friendsList[friendsCount] = s7;
  13732. friendsNodeIDs[friendsCount] = i18;
  13733. friendsCount++;
  13734. }
  13735. for(boolean flag6 = false; !flag6;) {
  13736. flag6 = true;
  13737. for(int index = 0; index < friendsCount - 1; index++)
  13738. if(friendsNodeIDs[index] != nodeID && friendsNodeIDs[index + 1] == nodeID || friendsNodeIDs[index] == 0 && friendsNodeIDs[index + 1] != 0) {
  13739. int j31 = friendsNodeIDs[index];
  13740. friendsNodeIDs[index] = friendsNodeIDs[index + 1];
  13741. friendsNodeIDs[index + 1] = j31;
  13742. String s10 = friendsList[index];
  13743. friendsList[index] = friendsList[index + 1];
  13744. friendsList[index + 1] = s10;
  13745. long l32 = friendsListAsLongs[index];
  13746. friendsListAsLongs[index] = friendsListAsLongs[index + 1];
  13747. friendsListAsLongs[index + 1] = l32;
  13748. flag6 = false;
  13749. }
  13750. }//friends list sorting
  13751. pktType = -1;
  13752. return true;
  13753.  
  13754. case 110:
  13755. if(tabID == 12) {
  13756. }
  13757. energy = inStream.readUnsignedByte();
  13758. pktType = -1;
  13759. return true;
  13760.  
  13761. case 254:
  13762. anInt855 = inStream.readUnsignedByte();
  13763. if(anInt855 == 1)
  13764. anInt1222 = inStream.readUnsignedWord();
  13765. if(anInt855 >= 2 && anInt855 <= 6) {
  13766. if(anInt855 == 2) {
  13767. anInt937 = 64;
  13768. anInt938 = 64;
  13769. }
  13770. if(anInt855 == 3) {
  13771. anInt937 = 0;
  13772. anInt938 = 64;
  13773. }
  13774. if(anInt855 == 4) {
  13775. anInt937 = 128;
  13776. anInt938 = 64;
  13777. }
  13778. if(anInt855 == 5) {
  13779. anInt937 = 64;
  13780. anInt938 = 0;
  13781. }
  13782. if(anInt855 == 6) {
  13783. anInt937 = 64;
  13784. anInt938 = 128;
  13785. }
  13786. anInt855 = 2;
  13787. anInt934 = inStream.readUnsignedWord();
  13788. anInt935 = inStream.readUnsignedWord();
  13789. anInt936 = inStream.readUnsignedByte();
  13790. }
  13791. if(anInt855 == 10)
  13792. anInt933 = inStream.readUnsignedWord();
  13793. pktType = -1;
  13794. return true;
  13795.  
  13796. case 248:
  13797. int i5 = inStream.readWordA();
  13798. int k12 = inStream.readUnsignedWord();
  13799. if(backDialogID != -1) {
  13800. backDialogID = -1;
  13801. inputTaken = true;
  13802. }
  13803. if(inputDialogState != 0) {
  13804. inputDialogState = 0;
  13805. inputTaken = true;
  13806. }
  13807. openInterfaceID = i5;
  13808. invOverlayInterfaceID = k12;
  13809. tabAreaAltered = true;
  13810. aBoolean1149 = false;
  13811. pktType = -1;
  13812. return true;
  13813.  
  13814. case 79:
  13815. int j5 = inStream.method434();
  13816. int l12 = inStream.readWordA();
  13817. RSInterface class9_3 = RSInterface.interfaceCache[j5];
  13818. if(class9_3 != null && class9_3.interfaceType == 0) {
  13819. if(l12 < 0)
  13820. l12 = 0;
  13821. if(l12 > class9_3.scrollMax - class9_3.height)
  13822. l12 = class9_3.scrollMax - class9_3.height;
  13823. class9_3.scrollPosition = l12;
  13824. }
  13825. pktType = -1;
  13826. return true;
  13827.  
  13828. case 68:
  13829. for(int k5 = 0; k5 < variousSettings.length; k5++)
  13830. if(variousSettings[k5] != anIntArray1045[k5]) {
  13831. variousSettings[k5] = anIntArray1045[k5];
  13832. method33(k5);
  13833. }
  13834. pktType = -1;
  13835. return true;
  13836.  
  13837. case 196:
  13838. long l5 = inStream.readQWord();
  13839. int j18 = inStream.readDWord();
  13840. int rights = inStream.readUnsignedByte();
  13841. boolean flag5 = false;
  13842. for(int i28 = 0; i28 < 100; i28++) {
  13843. if(anIntArray1240[i28] != j18)
  13844. continue;
  13845. flag5 = true;
  13846. }
  13847. if(rights <= 1) {
  13848. for(int l29 = 0; l29 < ignoreCount; l29++) {
  13849. if(ignoreListAsLongs[l29] != l5)
  13850. continue;
  13851. flag5 = true;
  13852. }
  13853. }
  13854. if(!flag5 && anInt1251 == 0)
  13855. try {
  13856. anIntArray1240[anInt1169] = j18;
  13857. anInt1169 = (anInt1169 + 1) % 100;
  13858. String s9 = TextInput.method525(pktSize - 13, inStream);
  13859. //if(rights != 3)
  13860. //s9 = Censor.doCensor(s9);
  13861. if (rights == 7) {
  13862. pushMessage(s9, 7, "@cr0@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13863. } else if (rights == 8) {
  13864. pushMessage(s9, 7, "<img=3>" + TextClass.fixName(TextClass.nameForLong(l5)));
  13865. } else if (rights == 6) {
  13866. pushMessage(s9, 7, "@cr6@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13867. } else if (rights == 5) {
  13868. pushMessage(s9, 7, "@cr5@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13869. } else if (rights == 4) {
  13870. pushMessage(s9, 7, "@cr4@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13871. } else if (rights == 3) {
  13872. pushMessage(s9, 7, "@cr2@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13873. } else if (rights == 2) {
  13874. pushMessage(s9, 7, "@cr2@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13875. } else if (rights == 1) {
  13876. pushMessage(s9, 7, "@cr1@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13877. } else {
  13878. pushMessage(s9, 7, TextClass.fixName(TextClass.nameForLong(l5)));
  13879. }
  13880. } catch(Exception exception1) {
  13881. exception1.printStackTrace();
  13882. }
  13883. pktType = -1;
  13884. return true;
  13885.  
  13886. case 85:
  13887. localX = inStream.method427();
  13888. localY = inStream.method427();
  13889. pktType = -1;
  13890. return true;
  13891.  
  13892. case 24:
  13893. anInt1054 = inStream.method428();
  13894. if(anInt1054 == tabID) {
  13895. if(anInt1054 == 3)
  13896. tabID = 1;
  13897. else
  13898. tabID = 3;
  13899. }
  13900. pktType = -1;
  13901. return true;
  13902.  
  13903. case 246:
  13904. int i6 = inStream.method434();
  13905. int i13 = inStream.readUnsignedWord();
  13906. int k18 = inStream.readUnsignedWord();
  13907. if(k18 == 65535) {
  13908. RSInterface.interfaceCache[i6].disabledMediaType = 0;
  13909. pktType = -1;
  13910. return true;
  13911. } else {
  13912. ItemDef itemDef = ItemDef.forID(k18);
  13913. RSInterface.interfaceCache[i6].disabledMediaType = 4;
  13914. RSInterface.interfaceCache[i6].disabledMediaID = k18;
  13915. RSInterface.interfaceCache[i6].modelRotationY = itemDef.modelRotationY;
  13916. RSInterface.interfaceCache[i6].modelRotationX = itemDef.modelRotationX;
  13917. RSInterface.interfaceCache[i6].modelZoom = (itemDef.modelZoom * 100) / i13;
  13918. pktType = -1;
  13919. return true;
  13920. }
  13921.  
  13922. case 171:
  13923. boolean flag1 = inStream.readUnsignedByte() == 1;
  13924. int j13 = inStream.readUnsignedWord();
  13925. RSInterface.interfaceCache[j13].interfaceShown = flag1;
  13926. pktType = -1;
  13927. return true;
  13928.  
  13929. case 142:
  13930. int j6 = inStream.method434();
  13931. method60(j6);
  13932. if(backDialogID != -1) {
  13933. backDialogID = -1;
  13934. inputTaken = true;
  13935. }
  13936. if(inputDialogState != 0) {
  13937. inputDialogState = 0;
  13938. inputTaken = true;
  13939. }
  13940. invOverlayInterfaceID = j6;
  13941. tabAreaAltered = true;
  13942. openInterfaceID = -1;
  13943. aBoolean1149 = false;
  13944. pktType = -1;
  13945. return true;
  13946.  
  13947. case 126:
  13948. String text = inStream.readString();
  13949. int frame = inStream.readWordA();
  13950. if (text.startsWith("www.")) {
  13951. launchURL(text);
  13952. pktType = -1;
  13953. return true;
  13954. }
  13955. if (text.startsWith("resting")) {
  13956. restOrb = false;
  13957. pktType = -1;
  13958. return true;
  13959. }
  13960. if (text.startsWith("familiarid:")) {
  13961. String[] args = text.split(":", 2);
  13962. familiarType = Integer.parseInt(args[1]);
  13963. pktType = -1;
  13964. return true;
  13965. }
  13966. if (text.startsWith("leftClickOption:")) {
  13967. String[] args = text.split(":", 2);
  13968. leftClickOption = Integer.parseInt(args[1]);
  13969. pktType = -1;
  13970. return true;
  13971. }
  13972. if (text.startsWith("prayoff")) {
  13973. prayClicked = false;
  13974. pktType = -1;
  13975. return true;
  13976. }
  13977. if (frame >= 18144 && frame <= 18244) {
  13978. String clanName = "";
  13979. if (text.startsWith("@cr"))
  13980. clanName = text.substring(5);
  13981. else if (!text.equals(""))
  13982. clanName = text.substring(2);
  13983. clanList[frame - 18144] = clanName;
  13984. sendFrame126(text, frame);
  13985. pktType = -1;
  13986. return true;
  13987. }
  13988. updateStrings(text, frame);
  13989. sendFrame126(text, frame);
  13990. if (frame >= 18144 && frame <= 18244) {
  13991. clanList[frame - 18144] = text;
  13992. }
  13993. pktType = -1;
  13994. return true;
  13995.  
  13996. case 206:
  13997. publicChatMode = inStream.readUnsignedByte();
  13998. privateChatMode = inStream.readUnsignedByte();
  13999. tradeMode = inStream.readUnsignedByte();
  14000. inputTaken = true;
  14001. pktType = -1;
  14002. return true;
  14003.  
  14004. case 240:
  14005. if(tabID == 12) {
  14006. }
  14007. weight = inStream.readSignedWord();
  14008. pktType = -1;
  14009. return true;
  14010.  
  14011. case 8:
  14012. int k6 = inStream.method436();
  14013. int l13 = inStream.readUnsignedWord();
  14014. RSInterface.interfaceCache[k6].disabledMediaType = 1;
  14015. RSInterface.interfaceCache[k6].disabledMediaID = l13;
  14016. pktType = -1;
  14017. return true;
  14018.  
  14019. case 122:
  14020. int l6 = inStream.method436();
  14021. int i14 = inStream.method436();
  14022. int i19 = i14 >> 10 & 0x1f;
  14023. int i22 = i14 >> 5 & 0x1f;
  14024. int l24 = i14 & 0x1f;
  14025. RSInterface.interfaceCache[l6].disabledColor = (i19 << 19) + (i22 << 11) + (l24 << 3);
  14026. pktType = -1;
  14027. return true;
  14028.  
  14029. case 53:
  14030. int i7 = inStream.readUnsignedWord();
  14031. RSInterface class9_1 = RSInterface.interfaceCache[i7];
  14032. int j19 = inStream.readUnsignedWord();
  14033. boolean foundScroll = false;
  14034. for(int j22 = 0; j22 < j19; j22++) {
  14035. int i25 = inStream.readUnsignedByte();
  14036. if(i25 == 255)
  14037. i25 = inStream.method440();
  14038. class9_1.inventory[j22] = inStream.method436();
  14039. class9_1.inventoryValue[j22] = i25;
  14040. if (!foundScroll && familiarType > -1 && (class9_1.inventory[j22] > 0 && class9_1.inventoryValue[j22] > 0)) {
  14041. String itemName = ItemDef.forID(class9_1.inventory[j22] - 1).name;
  14042. if (itemName.contains("scroll")) {
  14043. itemName = itemName.replace(" scroll", "");
  14044. if (itemName.equalsIgnoreCase(RSInterface.scrollNames[familiarType])) {
  14045. // scrollAmount = i25;
  14046. foundScroll = true;
  14047. }
  14048. }
  14049. }
  14050. }
  14051. if (familiarType > -1) {
  14052. if (!foundScroll)
  14053. scrollAmount = 0;
  14054. RSInterface.interfaceCache[17026].disabledMessage = scrollAmount == 0 ? "0" : ("@gre@"+scrollAmount);
  14055. }
  14056. for(int j25 = j19; j25 < class9_1.inventory.length; j25++) {
  14057. class9_1.inventory[j25] = 0;
  14058. class9_1.inventoryValue[j25] = 0;
  14059. }
  14060. pktType = -1;
  14061. return true;
  14062.  
  14063. case 230:
  14064. int j7 = inStream.readWordA();
  14065. int j14 = inStream.readUnsignedWord();
  14066. int k19 = inStream.readUnsignedWord();
  14067. int k22 = inStream.method436();
  14068. RSInterface.interfaceCache[j14].modelRotationY = k19;
  14069. RSInterface.interfaceCache[j14].modelRotationX = k22;
  14070. RSInterface.interfaceCache[j14].modelZoom = j7;
  14071. pktType = -1;
  14072. return true;
  14073.  
  14074. case 221:
  14075. anInt900 = inStream.readUnsignedByte();
  14076. pktType = -1;
  14077. return true;
  14078.  
  14079. case 177:
  14080. aBoolean1160 = true;
  14081. anInt995 = inStream.readUnsignedByte();
  14082. anInt996 = inStream.readUnsignedByte();
  14083. anInt997 = inStream.readUnsignedWord();
  14084. anInt998 = inStream.readUnsignedByte();
  14085. anInt999 = inStream.readUnsignedByte();
  14086. if(anInt999 >= 100) {
  14087. int k7 = anInt995 * 128 + 64;
  14088. int k14 = anInt996 * 128 + 64;
  14089. int i20 = method42(plane, k14, k7) - anInt997;
  14090. int l22 = k7 - xCameraPos;
  14091. int k25 = i20 - zCameraPos;
  14092. int j28 = k14 - yCameraPos;
  14093. int i30 = (int)Math.sqrt(l22 * l22 + j28 * j28);
  14094. yCameraCurve = (int)(Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  14095. xCameraCurve = (int)(Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  14096. if(yCameraCurve < 128)
  14097. yCameraCurve = 128;
  14098. if(yCameraCurve > 383)
  14099. yCameraCurve = 383;
  14100. }
  14101. pktType = -1;
  14102. return true;
  14103.  
  14104. case 249:
  14105. anInt1046 = inStream.method426();
  14106. unknownInt10 = inStream.method436();
  14107. pktType = -1;
  14108. return true;
  14109.  
  14110. case 65:
  14111. updateNPCs(inStream, pktSize);
  14112. pktType = -1;
  14113. return true;
  14114.  
  14115. case 27:
  14116. messagePromptRaised = false;
  14117. inputDialogState = 1;
  14118. amountOrNameInput = "";
  14119. inputTaken = true;
  14120. pktType = -1;
  14121. return true;
  14122.  
  14123. case 187:
  14124. messagePromptRaised = false;
  14125. inputDialogState = 2;
  14126. amountOrNameInput = "";
  14127. inputTaken = true;
  14128. pktType = -1;
  14129. return true;
  14130. case 97:
  14131. int l7 = inStream.readUnsignedWord();
  14132. method60(l7);
  14133. if (invOverlayInterfaceID != -1) {
  14134. invOverlayInterfaceID = -1;
  14135. tabAreaAltered = true;
  14136. }
  14137. if (backDialogID != -1) {
  14138. backDialogID = -1;
  14139. inputTaken = true;
  14140. }
  14141. if (inputDialogState != 0) {
  14142. inputDialogState = 0;
  14143. inputTaken = true;
  14144. }
  14145. //17511 = Question Type
  14146. //15819 = Christmas Type
  14147. //15812 = Security Type
  14148. //15801 = Item Scam Type
  14149. //15791 = Password Safety ?
  14150. //15774 = Good/Bad Password
  14151. //15767 = Drama Type ????
  14152. if (l7 == 15244) {
  14153. openInterfaceID = 15774;
  14154. fullscreenInterfaceID = 15244;
  14155. } else {
  14156. openInterfaceID = l7;
  14157. }
  14158. aBoolean1149 = false;
  14159. pktType = -1;
  14160. return true;
  14161. case 218:
  14162. int i8 = inStream.method438();
  14163. dialogID = i8;
  14164. inputTaken = true;
  14165. pktType = -1;
  14166. return true;
  14167.  
  14168. case 87:
  14169. int j8 = inStream.method434();
  14170. int l14 = inStream.method439();
  14171. anIntArray1045[j8] = l14;
  14172. if(variousSettings[j8] != l14) {
  14173. variousSettings[j8] = l14;
  14174. method33(j8);
  14175. if(dialogID != -1)
  14176. inputTaken = true;
  14177. }
  14178. pktType = -1;
  14179. return true;
  14180.  
  14181. case 36:
  14182. int k8 = inStream.method434();
  14183. byte byte0 = inStream.readSignedByte();
  14184. anIntArray1045[k8] = byte0;
  14185. if(variousSettings[k8] != byte0) {
  14186. variousSettings[k8] = byte0;
  14187. method33(k8);
  14188. if(dialogID != -1)
  14189. inputTaken = true;
  14190. }
  14191. pktType = -1;
  14192. return true;
  14193.  
  14194. case 61:
  14195. anInt1055 = inStream.readUnsignedByte();
  14196. pktType = -1;
  14197. return true;
  14198.  
  14199. case 200:
  14200. int l8 = inStream.readUnsignedWord();
  14201. int i15 = inStream.readSignedWord();
  14202. RSInterface class9_4 = RSInterface.interfaceCache[l8];
  14203. class9_4.disabledAnimation = i15;
  14204. if (l8 == 17027)
  14205. class9_4.modelZoom = 2000;
  14206. else
  14207. class9_4.modelZoom = 2000;
  14208. if(i15 == -1) {
  14209. class9_4.animationLength = 0;
  14210. class9_4.animationDelay = 0;
  14211. }
  14212. pktType = -1;
  14213. return true;
  14214.  
  14215. case 219:
  14216. if(invOverlayInterfaceID != -1) {
  14217. invOverlayInterfaceID = -1;
  14218. tabAreaAltered = true;
  14219. }
  14220. if(backDialogID != -1) {
  14221. backDialogID = -1;
  14222. inputTaken = true;
  14223. }
  14224. if(inputDialogState != 0) {
  14225. inputDialogState = 0;
  14226. inputTaken = true;
  14227. }
  14228. openInterfaceID = -1;
  14229. aBoolean1149 = false;
  14230. pktType = -1;
  14231. return true;
  14232.  
  14233. case 34:
  14234. int i9 = inStream.readUnsignedWord();
  14235. RSInterface class9_2 = RSInterface.interfaceCache[i9];
  14236. while(inStream.currentOffset < pktSize) {
  14237. int j20 = inStream.method422();
  14238. int i23 = inStream.readUnsignedWord();
  14239. int l25 = inStream.readUnsignedByte();
  14240. if(l25 == 255)
  14241. l25 = inStream.readDWord();
  14242. if(j20 >= 0 && j20 < class9_2.inventory.length) {
  14243. class9_2.inventory[j20] = i23;
  14244. class9_2.inventoryValue[j20] = l25;
  14245. }
  14246. }
  14247. pktType = -1;
  14248. return true;
  14249.  
  14250. case 4:
  14251. case 44:
  14252. case 84:
  14253. case 101:
  14254. case 105:
  14255. case 117:
  14256. case 147:
  14257. case 151:
  14258. case 156:
  14259. case 160:
  14260. case 215:
  14261. method137(inStream, pktType);
  14262. pktType = -1;
  14263. return true;
  14264.  
  14265. case 106:
  14266. tabID = inStream.method427();
  14267. tabAreaAltered = true;
  14268. pktType = -1;
  14269. return true;
  14270.  
  14271. case 164:
  14272. int j9 = inStream.method434();
  14273. method60(j9);
  14274. if(invOverlayInterfaceID != -1) {
  14275. invOverlayInterfaceID = -1;
  14276. tabAreaAltered = true;
  14277. }
  14278. backDialogID = j9;
  14279. inputTaken = true;
  14280. openInterfaceID = -1;
  14281. aBoolean1149 = false;
  14282. pktType = -1;
  14283. return true;
  14284.  
  14285. }
  14286. signlink.reporterror("T1 - " + pktType + "," + pktSize + " - " + anInt842 + "," + anInt843);
  14287. //resetLogout();
  14288. } catch(IOException _ex) {
  14289. dropClient();
  14290. } catch(Exception exception) {
  14291. //String s2 = "T2 - " + pktType + "," + anInt842 + "," + anInt843 + " - " + pktSize + "," + (baseX + myPlayer.smallX[0]) + "," + (baseY + myPlayer.smallY[0]) + " - ";
  14292. //for(int j15 = 0; j15 < pktSize && j15 < 50; j15++)
  14293. //s2 = s2 + inStream.buffer[j15] + ",";
  14294. //signlink.reporterror(s2);
  14295. //resetLogout();
  14296. }
  14297. pktType = -1;
  14298. return true;
  14299. }
  14300.  
  14301. private void method146() {
  14302.  
  14303.  
  14304. anInt1265++;
  14305. method47(true);
  14306. method26(true);
  14307. method47(false);
  14308. method26(false);
  14309. method55();
  14310. method104();
  14311. if(!aBoolean1160) {
  14312. int i = anInt1184;
  14313. if(anInt984 / 256 > i)
  14314. i = anInt984 / 256;
  14315. if(aBooleanArray876[4] && anIntArray1203[4] + 128 > i)
  14316. i = anIntArray1203[4] + 128;
  14317. int k = minimapInt1 + anInt896 & 0x7ff;
  14318. setCameraPos(600 + i * 3, i, anInt1014, method42(plane, myPlayer.y, myPlayer.x) - 50, k, anInt1015);
  14319.  
  14320.  
  14321.  
  14322. }
  14323. int j;
  14324. if(!aBoolean1160)
  14325. j = method120();
  14326. else
  14327. j = method121();
  14328. int l = xCameraPos;
  14329. int i1 = zCameraPos;
  14330. int j1 = yCameraPos;
  14331. int k1 = yCameraCurve;
  14332. int l1 = xCameraCurve;
  14333. for(int i2 = 0; i2 < 5; i2++)
  14334. if(aBooleanArray876[i2]) {
  14335. int j2 = (int)((Math.random() * (double)(anIntArray873[i2] * 2 + 1) - (double)anIntArray873[i2]) + Math.sin((double)anIntArray1030[i2] * ((double)anIntArray928[i2] / 100D)) * (double)anIntArray1203[i2]);
  14336. if(i2 == 0)
  14337. xCameraPos += j2;
  14338. if(i2 == 1)
  14339. zCameraPos += j2;
  14340. if(i2 == 2)
  14341. yCameraPos += j2;
  14342. if(i2 == 3)
  14343. xCameraCurve = xCameraCurve + j2 & 0x7ff;
  14344. if(i2 == 4) {
  14345. yCameraCurve += j2;
  14346. if(yCameraCurve < 128)
  14347. yCameraCurve = 128;
  14348. if(yCameraCurve > 383)
  14349. yCameraCurve = 383;
  14350. }
  14351. }
  14352. int k2 = Texture.anInt1481;
  14353. Model.aBoolean1684 = true;
  14354. Model.anInt1687 = 0;
  14355. Model.anInt1685 = super.mouseX - 4;
  14356. Model.anInt1686 = super.mouseY - 4;
  14357. DrawingArea.setAllPixelsToZero();
  14358. worldController.method313(xCameraPos, yCameraPos, xCameraCurve, zCameraPos, j, yCameraCurve);
  14359. worldController.clearObj5Cache();
  14360. updateEntities();
  14361. drawHeadIcon();
  14362. method37(k2);
  14363. draw3dScreen();
  14364. drawCoinParts();
  14365. if(coinToggle){
  14366. int cash;
  14367. String Cash = RSInterface.interfaceCache[8135].disabledMessage;
  14368. cash = Integer.parseInt(Cash);
  14369. coinPart.drawSprite(400+11+32, 87);
  14370. smallText.method382(getMoneyOrbColor(cash), 485, RSInterface.interfaceCache[8134].disabledMessage+"", 102, true);
  14371. }
  14372. if(drawFlag) {
  14373. if(xpToDraw != 0) {
  14374. if(flagPos < 125) {
  14375. if(flagPos < 100) {
  14376. flagPos += 2;
  14377. } else {
  14378. flagPos += 1;
  14379. }
  14380. xpFlag.drawSprite(423, flagPos);
  14381. newSmallFont.drawBasicString(""+xpToDraw+"xp", 470, flagPos+20, 0xCC6600, 1);
  14382. } else { }
  14383. if(flagPos >= 125) {
  14384. drawFlag = false;
  14385. flagPos = 72;
  14386. xpToDraw = 0;
  14387. }
  14388. }
  14389. }
  14390. if(drawXpBar) {
  14391. String text = ""+testXp;
  14392. int txtWidth = newRegularFont.getTextWidth(text);
  14393. int drawX = 505-txtWidth;
  14394. sprite1.drawSprite(419, 51);
  14395. newRegularFont.drawBasicString("XP:", 421, 64, 0xFFFFFD, 0);
  14396. newRegularFont.drawBasicString(text, drawX, 64, 0xFFFFFD, 0);
  14397. }
  14398. main3DArea.drawGraphics(4, super.graphics, 4);
  14399. xCameraPos = l;
  14400. zCameraPos = i1;
  14401. yCameraPos = j1;
  14402. yCameraCurve = k1;
  14403. xCameraCurve = l1;
  14404. }
  14405.  
  14406. public int getMoneyOrbColor(int cashAmount){
  14407. if(cashAmount >= 100000 && cashAmount <= 999999){
  14408. return 0xffffff;
  14409. } else {
  14410. return 65280;
  14411. }
  14412. }
  14413. private int specialAttack;
  14414.  
  14415. /* Packets that opens interfaces */
  14416. public void sendFrame97(int interfaceID) {
  14417. method60(interfaceID);
  14418. if (invOverlayInterfaceID != -1) {
  14419. invOverlayInterfaceID = -1;
  14420. tabAreaAltered = true;
  14421. }
  14422. if (backDialogID != -1) {
  14423. backDialogID = -1;
  14424. inputTaken = true;
  14425. }
  14426. if (inputDialogState != 0) {
  14427. inputDialogState = 0;
  14428. inputTaken = true;
  14429. }
  14430. openInterfaceID = interfaceID;
  14431. aBoolean1149 = false;
  14432. fullscreenInterfaceID = -1;
  14433. }
  14434. public void clearTopInterfaces() {
  14435.  
  14436. stream.createFrame(130);
  14437. if (invOverlayInterfaceID != -1) {
  14438. invOverlayInterfaceID = -1;
  14439. aBoolean1149 = false;
  14440. tabAreaAltered = true;
  14441. }
  14442. if (backDialogID != -1) {
  14443. backDialogID = -1;
  14444. inputTaken = true;
  14445. aBoolean1149 = false;
  14446. }
  14447. openInterfaceID = -1;
  14448. fullscreenInterfaceID = -1;
  14449. }
  14450.  
  14451. private boolean localHost = true;
  14452. public client() {
  14453. tabHPos = -1;
  14454. xpLock = false;
  14455. fullscreenInterfaceID = -1;
  14456. chatRights = new int[500];
  14457. chatTypeView = 0;
  14458. clanChatMode = 0;
  14459. cButtonHPos = -1;
  14460. fullscreenInterfaceID = -1;
  14461. cButtonCPos = 0;
  14462. //server = localHost ? "localhost" : "Zerix.no-ip.biz";//
  14463. server = "127.0.0.1";
  14464. anIntArrayArray825 = new int[104][104];
  14465. friendsNodeIDs = new int[200];
  14466. groundArray = new NodeList[4][104][104];
  14467. aBoolean831 = false;
  14468. aStream_834 = new Stream(new byte[17000]);
  14469. npcArray = new NPC[16384];
  14470. npcIndices = new int[16384];
  14471. anIntArray840 = new int[1000];
  14472. aStream_847 = Stream.create();
  14473. aBoolean848 = true;
  14474. openInterfaceID = -1;
  14475. currentExp = new int[Skills.skillsCount];
  14476. anIntArray873 = new int[5];
  14477. anInt874 = -1;
  14478. aBooleanArray876 = new boolean[5];
  14479. drawFlames = false;
  14480. reportAbuseInput = "";
  14481. unknownInt10 = -1;
  14482. menuOpen = false;
  14483. inputString = "";
  14484. maxPlayers = 2048;
  14485. myPlayerIndex = 2047;
  14486. playerArray = new Player[maxPlayers];
  14487. playerIndices = new int[maxPlayers];
  14488. anIntArray894 = new int[maxPlayers];
  14489. aStreamArray895s = new Stream[maxPlayers];
  14490. anIntArrayArray901 = new int[104][104];
  14491. anInt902 = 0x766654;
  14492. aByteArray912 = new byte[16384];
  14493. currentStats = new int[Skills.skillsCount];
  14494. ignoreListAsLongs = new long[100];
  14495. loadingError = false;
  14496. anInt927 = 0x332d25;
  14497. anIntArray928 = new int[5];
  14498. anIntArrayArray929 = new int[104][104];
  14499. chatTypes = new int[500];
  14500. chatNames = new String[500];
  14501. chatMessages = new String[500];
  14502. chatButtons = new Sprite[4];
  14503. sideIcons = new Sprite[14];
  14504. sIcons483 = new Sprite[14];
  14505. newSideIcons = new Sprite[16];
  14506. sIcons459 = new Sprite[13];
  14507.  
  14508. redStones = new Sprite[16];
  14509. aBoolean954 = true;
  14510. friendsListAsLongs = new long[200];
  14511. currentSong = -1;
  14512. drawingFlames = false;
  14513. spriteDrawX = -1;
  14514. spriteDrawY = -1;
  14515. anIntArray968 = new int[33];
  14516. decompressors = new Decompressor[5];
  14517. variousSettings = new int[2000];
  14518. aBoolean972 = false;
  14519. anInt975 = 50;
  14520. anIntArray976 = new int[anInt975];
  14521. anIntArray977 = new int[anInt975];
  14522. anIntArray978 = new int[anInt975];
  14523. anIntArray979 = new int[anInt975];
  14524. anIntArray980 = new int[anInt975];
  14525. anIntArray981 = new int[anInt975];
  14526. anIntArray982 = new int[anInt975];
  14527. aStringArray983 = new String[anInt975];
  14528. anInt985 = -1;
  14529. hitMarks = new Sprite[20];
  14530. hitMark = new Sprite[20];
  14531.  
  14532. hitIcon = new Sprite[20];
  14533. anIntArray990 = new int[5];
  14534. aBoolean994 = false;
  14535. anInt1002 = 0x23201b;
  14536. amountOrNameInput = "";
  14537. aClass19_1013 = new NodeList();
  14538. aBoolean1017 = false;
  14539. anInt1018 = -1;
  14540. anIntArray1030 = new int[5];
  14541. aBoolean1031 = false;
  14542. mapFunctions = new Sprite[100];
  14543. dialogID = -1;
  14544. applyTrans = 0;
  14545. maxStats = new int[Skills.skillsCount];
  14546. anIntArray1045 = new int[2000];
  14547. aBoolean1047 = true;
  14548. anIntArray1052 = new int[152];//map
  14549. anInt1054 = -1;
  14550. aClass19_1056 = new NodeList();
  14551. anIntArray1057 = new int[33];
  14552. aClass9_1059 = new RSInterface();
  14553. mapScenes = new Background[100];
  14554. barFillColor = 0x4d4233;
  14555. anIntArray1065 = new int[7];
  14556. anIntArray1072 = new int[1000];
  14557. anIntArray1073 = new int[1000];
  14558. aBoolean1080 = false;
  14559. friendsList = new String[200];
  14560. inStream = Stream.create();
  14561. expectedCRCs = new int[9];
  14562. menuActionCmd2 = new int[500];
  14563. menuActionCmd3 = new int[500];
  14564. menuActionID = new int[500];
  14565. menuActionCmd1 = new int[500];
  14566. headIcons = new Sprite[29];
  14567. skullIcons = new Sprite[20];
  14568. headIconsHint = new Sprite[20];
  14569. tabAreaAltered = false;
  14570. aString1121 = "";
  14571. atPlayerActions = new String[5];
  14572. atPlayerArray = new boolean[5];
  14573. anIntArrayArrayArray1129 = new int[4][13][13];
  14574. aSpriteArray1140 = new Sprite[1000];
  14575. aBoolean1141 = false;
  14576. aBoolean1149 = false;
  14577. crosses = new Sprite[8];
  14578. musicEnabled = true;
  14579. loggedIn = false;
  14580. canMute = false;
  14581. aBoolean1159 = false;
  14582. aBoolean1160 = false;
  14583. needDrawTabArea = false;
  14584. myUsername = "";
  14585. myPassword = "";
  14586. genericLoadingError = false;
  14587. reportAbuseInterfaceID = -1;
  14588. aClass19_1179 = new NodeList();
  14589. anInt1184 = 128;
  14590. invOverlayInterfaceID = -1;
  14591. stream = Stream.create();
  14592. menuActionName = new String[500];
  14593. anIntArray1203 = new int[5];
  14594. anIntArray1207 = new int[50];
  14595. chatScrollTotalLength = 78;
  14596. promptInput = "";
  14597. //modIcons = new Background[2];
  14598. modIcons = new Sprite[7];
  14599. chatImages = new Sprite[7];
  14600. tabID = 3;
  14601. inputTaken = false;
  14602. songChanging = true;
  14603. anIntArray1229 = new int[152];//map
  14604. aClass11Array1230 = new Class11[4];
  14605. anIntArray1240 = new int[100];
  14606. anIntArray1241 = new int[50];
  14607. aBoolean1242 = false;
  14608. anIntArray1250 = new int[50];
  14609. rsAlreadyLoaded = false;
  14610. welcomeScreenRaised = true;
  14611. messagePromptRaised = false;
  14612. loginMessage1 = "";
  14613. loginMessage2 = "";
  14614. backDialogID = -1;
  14615. bigX = new int[4000];
  14616. bigY = new int[4000];
  14617. anInt1289 = -1;
  14618. }
  14619.  
  14620. public int rights;
  14621.  
  14622.  
  14623. public String name;
  14624. public String disabledMessage;
  14625. public String clanname;
  14626. private final int[] chatRights;
  14627. public int chatTypeView;
  14628. public int clanChatMode;
  14629. public int duelMode;
  14630. /* Declare custom sprites */
  14631. private Sprite loadingPleaseWait;
  14632. private Sprite reestablish;
  14633. private Sprite loadingBarFull;
  14634. private Sprite loadingBarEmpty;
  14635. private Sprite[] chatButtons;
  14636. private Sprite tabHover;
  14637. private Sprite tabClicked;
  14638. private Sprite[] newSideIcons;
  14639. public Sprite[] CustomMapback = new Sprite[5];
  14640. public Sprite[] chatArea = new Sprite[5];
  14641. public Sprite[] tabArea = new Sprite[5];
  14642. /**/
  14643. private RSImageProducer leftFrame;
  14644. private RSImageProducer topFrame;
  14645. private int ignoreCount;
  14646. private long aLong824;
  14647. private int[][] anIntArrayArray825;
  14648. private int[] friendsNodeIDs;
  14649. private NodeList[][][] groundArray;
  14650. private volatile boolean aBoolean831;
  14651. private int loginScreenState;
  14652. private Stream aStream_834;
  14653. private NPC[] npcArray;
  14654. private int npcCount;
  14655. private int[] npcIndices;
  14656. private int anInt839;
  14657. private int[] anIntArray840;
  14658. private int anInt841;
  14659. private int anInt842;
  14660. private int anInt843;
  14661. private String aString844;
  14662. private int privateChatMode;
  14663. private Stream aStream_847;
  14664. private boolean aBoolean848;
  14665. private static int anInt849;
  14666. private int[] anIntArray851;
  14667. private int[] anIntArray852;
  14668. private int[] anIntArray853;
  14669. private int anInt855;
  14670. public static int openInterfaceID;
  14671. private int xCameraPos;
  14672. private int zCameraPos;
  14673. private int yCameraPos;
  14674. private int yCameraCurve;
  14675. private int xCameraCurve;
  14676. public int myPrivilege;
  14677. private final int[] currentExp;
  14678. private Sprite[] redStones;
  14679. private Sprite mapFlag;
  14680. private Sprite mapMarker;
  14681. private final int[] anIntArray873;
  14682. private int anInt874;
  14683. private final boolean[] aBooleanArray876;
  14684. private int weight;
  14685. private MouseDetection mouseDetection;
  14686. private volatile boolean drawFlames;
  14687. private String reportAbuseInput;
  14688. private int unknownInt10;
  14689. private boolean menuOpen;
  14690. private int anInt886;
  14691. private String inputString;
  14692. private final int maxPlayers;
  14693. private final int myPlayerIndex;
  14694. private Player[] playerArray;
  14695. private int playerCount;
  14696. private int[] playerIndices;
  14697. private int anInt893;
  14698. private int[] anIntArray894;
  14699. private Stream[] aStreamArray895s;
  14700. private int anInt896;
  14701. private int friendsCount;
  14702. private int anInt900;
  14703. private int[][] anIntArrayArray901;
  14704. private final int anInt902;
  14705. private byte[] aByteArray912;
  14706. private int anInt913;
  14707. private int crossX;
  14708. private int crossY;
  14709. private int crossIndex;
  14710. private int crossType;
  14711. private int plane;
  14712. private final int[] currentStats;
  14713. private static int anInt924;
  14714. private final long[] ignoreListAsLongs;
  14715. private boolean loadingError;
  14716. private final int anInt927;
  14717. private final int[] anIntArray928;
  14718. private int[][] anIntArrayArray929;
  14719. private Sprite aSprite_931;
  14720. private Sprite aSprite_932;
  14721. private int anInt933;
  14722. private int anInt934;
  14723. private int anInt935;
  14724. private int anInt936;
  14725. private int anInt937;
  14726. private int anInt938;
  14727. private final int[] chatTypes;
  14728. private final String[] chatNames;
  14729. private final String[] chatMessages;
  14730. private int anInt945;
  14731. private WorldController worldController;
  14732. private Sprite[] sideIcons;
  14733. private Sprite[] sIcons483;
  14734. private Sprite[] sIcons459;
  14735. private int menuScreenArea;
  14736. private int menuOffsetX;
  14737. private int menuOffsetY;
  14738. private int menuWidth;
  14739. private int menuHeight;
  14740. private long aLong953;
  14741. private boolean aBoolean954;
  14742. private static boolean needDrawTabArea;
  14743. private long[] friendsListAsLongs;
  14744. private String[] clanList = new String[100];
  14745. private int currentSong;
  14746. private static int nodeID = 10;
  14747. static int portOff;
  14748. static boolean clientData;
  14749. private static boolean isMembers = true;
  14750. private static boolean lowMem;
  14751. private volatile boolean drawingFlames;
  14752. private int spriteDrawX;
  14753. private int spriteDrawY;
  14754. private final int[] anIntArray965 = {
  14755. 0xffff00, 0xff0000, 65280, 65535, 0xff00ff, 0xffffff
  14756. };
  14757.  
  14758. private final int[] anIntArray968;
  14759. final Decompressor[] decompressors;
  14760. public int variousSettings[];
  14761. private boolean aBoolean972;
  14762. private final int anInt975;
  14763. private final int[] anIntArray976;
  14764. private final int[] anIntArray977;
  14765. private final int[] anIntArray978;
  14766. private final int[] anIntArray979;
  14767. private final int[] anIntArray980;
  14768. private final int[] anIntArray981;
  14769. private final int[] anIntArray982;
  14770. private final String[] aStringArray983;
  14771. private int anInt984;
  14772. private int anInt985;
  14773. private static int anInt986;
  14774. private Sprite[] hitMarks;
  14775. private Sprite[] hitMark;
  14776. private int anInt989;
  14777. private final int[] anIntArray990;
  14778. private Sprite[] hitIcon;
  14779. private final boolean aBoolean994;
  14780. private int anInt995;
  14781. private int anInt996;
  14782. private int anInt997;
  14783. private int anInt998;
  14784. private int anInt999;
  14785. private ISAACRandomGen encryption;
  14786. private Sprite mapEdge;
  14787. private Sprite multiOverlay;
  14788. private final int anInt1002;
  14789. static final int[][] anIntArrayArray1003 = {
  14790. {
  14791. 6798, 107, 10283, 16, 4797, 7744, 5799, 4634, 33697, 22433,
  14792. 2983, 54193
  14793. }, {
  14794. 8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153,
  14795. 56621, 4783, 1341, 16578, 35003, 25239
  14796. }, {
  14797. 25238, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094,
  14798. 10153, 56621, 4783, 1341, 16578, 35003
  14799. }, {
  14800. 4626, 11146, 6439, 12, 4758, 10270
  14801. }, {
  14802. 4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574
  14803. }
  14804. };
  14805. private String amountOrNameInput;
  14806. private static int anInt1005;
  14807. private int daysSinceLastLogin;
  14808. private int pktSize;
  14809. private int pktType;
  14810. private int anInt1009;
  14811. private int anInt1010;
  14812. private int anInt1011;
  14813. private NodeList aClass19_1013;
  14814. private int anInt1014;
  14815. private int anInt1015;
  14816. private int anInt1016;
  14817. private boolean aBoolean1017;
  14818. private int anInt1018;
  14819. private static final int[] anIntArray1019;
  14820. private int anInt1021;
  14821. private int anInt1022;
  14822. private int loadingStage;
  14823. private Sprite scrollBar1;
  14824. private Sprite scrollBar2;
  14825. private Sprite scrollBar3;
  14826. private Sprite scrollBar4;
  14827. private int anInt1026;
  14828. private final int[] anIntArray1030;
  14829. private boolean aBoolean1031;
  14830. private Sprite[] mapFunctions;
  14831. private int baseX;
  14832. private int baseY;
  14833. private int anInt1036;
  14834. private int anInt1037;
  14835. private int loginFailures;
  14836. private int anInt1039;
  14837. private int dialogID;
  14838. private final int[] maxStats;
  14839. private final int[] anIntArray1045;
  14840. private int anInt1046;
  14841. private boolean aBoolean1047;
  14842. private int anInt1048;
  14843. private String aString1049;
  14844. private static int anInt1051;
  14845. private final int[] anIntArray1052;
  14846. private NamedArchive titleStreamLoader;
  14847. private int anInt1054;
  14848. private int anInt1055;
  14849. private NodeList aClass19_1056;
  14850. private final int[] anIntArray1057;
  14851. public final RSInterface aClass9_1059;
  14852. private Background[] mapScenes;
  14853. private static int anInt1061;
  14854. private int anInt1062;
  14855. private final int barFillColor;
  14856. private int friendsListAction;
  14857. private final int[] anIntArray1065;
  14858. private int mouseInvInterfaceIndex;
  14859. private int lastActiveInvInterface;
  14860. public OnDemandFetcher onDemandFetcher;
  14861. private int anInt1069;
  14862. private int anInt1070;
  14863. private int anInt1071;
  14864. private int[] anIntArray1072;
  14865. private int[] anIntArray1073;
  14866. private Sprite mapDotItem;
  14867. private Sprite mapDotNPC;
  14868. private Sprite mapDotPlayer;
  14869. private Sprite mapDotFriend;
  14870. private Sprite mapDotTeam;
  14871. private Sprite mapDotClan;
  14872. private int anInt1079;
  14873. private boolean aBoolean1080;
  14874. private String[] friendsList;
  14875. private Stream inStream;
  14876. private int anInt1084;
  14877. private int anInt1085;
  14878. private int activeInterfaceType;
  14879. private int anInt1087;
  14880. private int anInt1088;
  14881. public static int anInt1089;
  14882. private final int[] expectedCRCs;
  14883. public int[] menuActionCmd2;
  14884. public int[] menuActionCmd3;
  14885. public int[] menuActionID;
  14886. public int[] menuActionCmd1;
  14887. private Sprite[] headIcons;
  14888. private Sprite[] skullIcons;
  14889. private Sprite[] headIconsHint;
  14890. private static int anInt1097;
  14891. private int anInt1098;
  14892. private int anInt1099;
  14893. private int anInt1100;
  14894. private int anInt1101;
  14895. private int anInt1102;
  14896. private static boolean tabAreaAltered;
  14897. private int anInt1104;
  14898. private RSImageProducer aRSImageProducer_1107;
  14899. private RSImageProducer loginScreenArea;
  14900. private int membersInt;
  14901. private String aString1121;
  14902. private Sprite compass;
  14903. private RSImageProducer aRSImageProducer_1125;
  14904. public static Player myPlayer;
  14905. private final String[] atPlayerActions;
  14906. private final boolean[] atPlayerArray;
  14907. private final int[][][] anIntArrayArrayArray1129;
  14908. public static final int[] tabInterfaceIDs = {
  14909. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  14910. -1, -1, -1, -1, -1, -1, -1
  14911. };
  14912. private int anInt1131;
  14913. public int menuActionRow;
  14914. private static int anInt1134;
  14915. private int spellSelected;
  14916. private int anInt1137;
  14917. private int spellUsableOn;
  14918. private String spellTooltip;
  14919. private Sprite[] aSpriteArray1140;
  14920. private boolean aBoolean1141;
  14921. private static int anInt1142;
  14922. public int energy;
  14923. private boolean aBoolean1149;
  14924. private Sprite[] crosses;
  14925. private boolean musicEnabled;
  14926. private Background[] aBackgroundArray1152s;
  14927. private int unreadMessages;
  14928. private static int anInt1155;
  14929. private static boolean fpsOn;
  14930. public boolean loggedIn;
  14931. private boolean canMute;
  14932. private boolean aBoolean1159;
  14933. private boolean aBoolean1160;
  14934. static int loopCycle;
  14935. private static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  14936. private RSImageProducer inventoryBackImage;
  14937. private RSImageProducer mapBackImage;
  14938. private RSImageProducer main3DArea;
  14939. private RSImageProducer chatBackImage;
  14940. private int daysSinceRecovChange;
  14941. private RSSocket socketStream;
  14942. private int anInt1169;
  14943. public int applyTrans;
  14944. private int minimapInt3;
  14945. private long aLong1172;
  14946. private String myUsername;
  14947. private String myPassword;
  14948. private static int anInt1175;
  14949. private boolean genericLoadingError;
  14950. private final int[] anIntArray1177 = {
  14951. 0, 0, 0, 0, 1, 1, 1, 1, 1, 2,
  14952. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  14953. 2, 2, 3
  14954. };
  14955. private int reportAbuseInterfaceID;
  14956. private NodeList aClass19_1179;
  14957. private int[] anIntArray1180;
  14958. private int[] anIntArray1181;
  14959. private int[] anIntArray1182;
  14960. private byte[][] aByteArrayArray1183;
  14961. private int anInt1184;
  14962. private int minimapInt1;
  14963. private int anInt1186;
  14964. private int anInt1187;
  14965. private static int anInt1188;
  14966. private int invOverlayInterfaceID;
  14967. private int[] anIntArray1190;
  14968. private int[] anIntArray1191;
  14969. public Stream stream;
  14970. private int anInt1193;
  14971. private int splitPrivateChat;
  14972. private Background mapBack;
  14973. public String[] menuActionName;
  14974. private final int[] anIntArray1203;
  14975. static final int[] anIntArray1204 = {
  14976. 9104, 10275, 7595, 3610, 7975, 8526, 918, 38802, 24466, 10145,
  14977. 58654, 5027, 1457, 16565, 34991, 25486
  14978. };
  14979. private static boolean flagged;
  14980. private final int[] anIntArray1207;
  14981. private int anInt1208;
  14982. private int minimapInt2;
  14983. public static int chatScrollTotalLength;
  14984. private String promptInput;
  14985. private int anInt1213;
  14986. private int[][][] intGroundArray;
  14987. private long aLong1215;
  14988. private int loginScreenCursorPos;
  14989. //private final Background[] modIcons;
  14990. public final Sprite[] modIcons;
  14991. private long aLong1220;
  14992. public static int tabID;
  14993. private int anInt1222;
  14994. public static boolean inputTaken;
  14995. public int inputDialogState;
  14996. private static int anInt1226;
  14997. private int nextSong;
  14998. private boolean songChanging;
  14999. private final int[] anIntArray1229;
  15000. private Class11[] aClass11Array1230;
  15001. public static int anIntArray1232[];
  15002. private int[] anIntArray1234;
  15003. private int[] anIntArray1235;
  15004. private int[] anIntArray1236;
  15005. private int anInt1237;
  15006. private int anInt1238;
  15007. public final int anInt1239 = 100;
  15008. private final int[] anIntArray1240;
  15009. private final int[] anIntArray1241;
  15010. private boolean aBoolean1242;
  15011. private int atInventoryLoopCycle;
  15012. private int atInventoryInterface;
  15013. private int atInventoryIndex;
  15014. private int atInventoryInterfaceType;
  15015. private byte[][] aByteArrayArray1247;
  15016. private int tradeMode;
  15017. private int anInt1249;
  15018. private final int[] anIntArray1250;
  15019. private int anInt1251;
  15020. private final boolean rsAlreadyLoaded;
  15021. private int anInt1253;
  15022. private boolean welcomeScreenRaised;
  15023. private boolean messagePromptRaised;
  15024. private int anInt1257;
  15025. private byte[][][] byteGroundArray;
  15026. private int prevSong;
  15027. private int destX;
  15028. private int destY;
  15029. private Sprite aSprite_1263;
  15030. private int anInt1264;
  15031. private int anInt1265;
  15032. private String loginMessage1;
  15033. private String loginMessage2;
  15034. private int localY;
  15035. private int localX;
  15036. public RSFont smallText;
  15037. public RSFont aTextDrawingArea_1271;
  15038. private RSFont chatTextDrawingArea;
  15039. private int backDialogID;
  15040. private int anInt1278;
  15041. private int[] bigX;
  15042. private int[] bigY;
  15043. private int itemSelected;
  15044. private int anInt1283;
  15045. private int anInt1284;
  15046. private int anInt1285;
  15047. private String selectedItemName;
  15048. private int publicChatMode;
  15049. private static int anInt1288;
  15050. private int anInt1289;
  15051. public static int anInt1290;
  15052. public static String server = "162.212.252.179";
  15053.  
  15054. public int drawCount;
  15055. public int fullscreenInterfaceID;
  15056. public int anInt1044;//377
  15057. public int anInt1129;//377
  15058. public int anInt1315;//377
  15059. public int anInt1500;//377
  15060. public int anInt1501;//377
  15061. public int[] fullScreenTextureArray;
  15062.  
  15063. public void resetAllImageProducers() {
  15064. if (super.fullGameScreen != null) {
  15065. return;
  15066. }
  15067. chatBackImage = null;
  15068. mapBackImage = null;
  15069. inventoryBackImage = null;
  15070. main3DArea = null;
  15071. aRSImageProducer_1125 = null;
  15072. backgroundWorld1 = null;
  15073. backgroundWorld2 = null;
  15074. aRSImageProducer_1107 = null;
  15075. loadingBarFull = null;
  15076. loadingBarEmpty = null;
  15077. loginScreenArea = null;
  15078. super.fullGameScreen = new RSImageProducer(765, 503, getGameComponent());
  15079. welcomeScreenRaised = true;
  15080. }
  15081. public boolean spriteChanged = false;
  15082. public int getSpriteID(){
  15083. spriteChanged = true;
  15084. if(is562)
  15085. return 4;
  15086. if(is459)
  15087. return 3;
  15088. if(is480)
  15089. return 2;
  15090. if(is508 || is525)
  15091. return 1;
  15092. if(is474)
  15093. return 0;
  15094. else
  15095. return 0;
  15096. }
  15097. public void launchURL(String url) {
  15098. String osName = System.getProperty("os.name");
  15099. try {
  15100. if (osName.startsWith("Mac OS")) {
  15101. Class<?> fileMgr = Class.forName("com.apple.eio.FileManager");
  15102. Method openURL = fileMgr.getDeclaredMethod("openURL", new Class[] {String.class});
  15103. openURL.invoke(null, new Object[] {url});
  15104. } else if (osName.startsWith("Windows"))
  15105. Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
  15106. else { //assume Unix or Linux
  15107. String[] browsers = { "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape", "safari" };
  15108. String browser = null;
  15109. for (int count = 0; count < browsers.length && browser == null; count++)
  15110. if (Runtime.getRuntime().exec(new String[] {"which", browsers[count]}).waitFor() == 0)
  15111. browser = browsers[count];
  15112. if (browser == null) {
  15113. throw new Exception("Could not find web browser");
  15114. } else
  15115. Runtime.getRuntime().exec(new String[] {browser, url});
  15116. }
  15117. } catch (Exception e) {
  15118. pushMessage("Failed to open URL.", 0, "");
  15119. }
  15120. }
  15121.  
  15122. static {
  15123. anIntArray1019 = new int[99];
  15124. int i = 0;
  15125. for(int j = 0; j < 99; j++) {
  15126. int l = j + 1;
  15127. int i1 = (int)((double)l + 300D * Math.pow(2D, (double)l / 7D));
  15128. i += i1;
  15129. anIntArray1019[j] = i / 4;
  15130. }
  15131. anIntArray1232 = new int[32];
  15132. i = 2;
  15133. for(int k = 0; k < 32; k++) {
  15134. anIntArray1232[k] = i - 1;
  15135. i += i;
  15136. }
  15137. }
  15138. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement