Advertisement
Guest User

Untitled

a guest
May 8th, 2019
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 462.12 KB | None | 0 0
  1. // Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
  2. // Jad home page: http://www.kpdus.com/jad.html
  3. // Decompiler options: packimports(3)
  4.  
  5. import java.applet.AppletContext;
  6. import java.awt.*;
  7. import java.io.*;
  8. import java.math.BigInteger;
  9. import java.net.*;
  10. import java.util.zip.CRC32;
  11.  
  12. import sign.signlink;
  13.  
  14. public final class client extends RSApplet {
  15.  
  16. private static String intToKOrMilLongName(int i)
  17. {
  18. String s = String.valueOf(i);
  19. for(int k = s.length() - 3; k > 0; k -= 3)
  20. s = s.substring(0, k) + "," + s.substring(k);
  21. if(s.length() > 8)
  22. s = "@gre@" + s.substring(0, s.length() - 8) + " million @whi@(" + s + ")";
  23. else
  24. if(s.length() > 4)
  25. s = "@cya@" + s.substring(0, s.length() - 4) + "K @whi@(" + s + ")";
  26. return " " + s;
  27. }
  28.  
  29. private void stopMidi()
  30. {
  31. signlink.midifade = 0;
  32. signlink.midi = "stop";
  33. }
  34.  
  35. private void connectServer()
  36. {
  37. /* int j = 5;
  38. expectedCRCs[8] = 0;
  39. int k = 0;
  40. while(expectedCRCs[8] == 0)
  41. {
  42. String s = "Unknown problem";
  43. drawLoadingText(20, (byte)4, "Connecting to web server");
  44. try
  45. {
  46. DataInputStream datainputstream = openJagGrabInputStream("crc" + (int)(Math.random() * 99999999D) + "-" + 317);
  47. Stream class30_sub2_sub2 = new Stream(new byte[40], 891);
  48. datainputstream.readFully(class30_sub2_sub2.buffer, 0, 40);
  49. datainputstream.close();
  50. for(int i1 = 0; i1 < 9; i1++)
  51. expectedCRCs[i1] = class30_sub2_sub2.readDWord();
  52.  
  53. int j1 = class30_sub2_sub2.readDWord();
  54. int k1 = 1234;
  55. for(int l1 = 0; l1 < 9; l1++)
  56. k1 = (k1 << 1) + expectedCRCs[l1];
  57.  
  58. if(j1 != k1)
  59. {
  60. s = "checksum problem";
  61. expectedCRCs[8] = 0;
  62. }
  63. }
  64. catch(EOFException _ex)
  65. {
  66. s = "EOF problem";
  67. expectedCRCs[8] = 0;
  68. }
  69. catch(IOException _ex)
  70. {
  71. s = "connection problem";
  72. expectedCRCs[8] = 0;
  73. }
  74. catch(Exception _ex)
  75. {
  76. s = "logic problem";
  77. expectedCRCs[8] = 0;
  78. if(!signlink.reporterror)
  79. return;
  80. }
  81. if(expectedCRCs[8] == 0)
  82. {
  83. k++;
  84. for(int l = j; l > 0; l--)
  85. {
  86. if(k >= 10)
  87. {
  88. drawLoadingText(10, (byte)4, "Game updated - please reload page");
  89. l = 10;
  90. } else
  91. {
  92. drawLoadingText(10, (byte)4, s + " - Will retry in " + l + " secs.");
  93. }
  94. try
  95. {
  96. Thread.sleep(1000L);
  97. }
  98. catch(Exception _ex) { }
  99. }
  100.  
  101. j *= 2;
  102. if(j > 60)
  103. j = 60;
  104. aBoolean872 = !aBoolean872;
  105. }
  106. }
  107. */
  108. }
  109.  
  110. private boolean menuHasAddFriend(int j)
  111. {
  112. if(j < 0)
  113. return false;
  114. int k = menuActionID[j];
  115. if(k >= 2000)
  116. k -= 2000;
  117. return k == 337;
  118. }
  119.  
  120. private void drawChatArea()
  121. {
  122. aRSImageProducer_1166.initDrawingArea();
  123. Texture.anIntArray1472 = anIntArray1180;
  124. chatBack.method361(0, 0);
  125. if(messagePromptRaised)
  126. {
  127. chatTextDrawingArea.drawText(0, aString1121, 40, 239);
  128. chatTextDrawingArea.drawText(128, promptInput + "*", 60, 239);
  129. } else
  130. if(inputDialogState == 1)
  131. {
  132. chatTextDrawingArea.drawText(0, "Enter amount:", 40, 239);
  133. chatTextDrawingArea.drawText(128, amountOrNameInput + "*", 60, 239);
  134. } else
  135. if(inputDialogState == 2)
  136. {
  137. chatTextDrawingArea.drawText(0, "Enter name:", 40, 239);
  138. chatTextDrawingArea.drawText(128, amountOrNameInput + "*", 60, 239);
  139. } else
  140. if(aString844 != null)
  141. {
  142. chatTextDrawingArea.drawText(0, aString844, 40, 239);
  143. chatTextDrawingArea.drawText(128, "Click to continue", 60, 239);
  144. } else
  145. if(backDialogID != -1)
  146. drawInterface(0, 0, RSInterface.interfaceCache[backDialogID], 0);
  147. else
  148. if(dialogID != -1)
  149. {
  150. drawInterface(0, 0, RSInterface.interfaceCache[dialogID], 0);
  151. } else
  152. {
  153. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  154. int j = 0;
  155. DrawingArea.setDrawingArea(77, 0, 463, 0);
  156. for(int k = 0; k < 100; k++)
  157. if(chatMessages[k] != null)
  158. {
  159. int l = chatTypes[k];
  160. int i1 = (70 - j * 14) + anInt1089;
  161. String s1 = chatNames[k];
  162. byte byte0 = 0;
  163. if(s1 != null && s1.startsWith("@cr1@"))
  164. {
  165. s1 = s1.substring(5);
  166. byte0 = 1;
  167. }
  168. if(s1 != null && s1.startsWith("@cr2@"))
  169. {
  170. s1 = s1.substring(5);
  171. byte0 = 2;
  172. }
  173. if(l == 0)
  174. {
  175. if(i1 > 0 && i1 < 110)
  176. textDrawingArea.method385(0, chatMessages[k], i1, 4);
  177. j++;
  178. }
  179. if((l == 1 || l == 2) && (l == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1)))
  180. {
  181. if(i1 > 0 && i1 < 110)
  182. {
  183. int j1 = 4;
  184. if(byte0 == 1)
  185. {
  186. modIcons[0].method361(j1, i1 - 12);
  187. j1 += 14;
  188. }
  189. if(byte0 == 2)
  190. {
  191. modIcons[1].method361(j1, i1 - 12);
  192. j1 += 14;
  193. }
  194. textDrawingArea.method385(0, s1 + ":", i1, j1);
  195. j1 += textDrawingArea.getTextWidth(s1) + 8;
  196. textDrawingArea.method385(255, chatMessages[k], i1, j1);
  197. }
  198. j++;
  199. }
  200. if((l == 3 || l == 7) && splitPrivateChat == 0 && (l == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1)))
  201. {
  202. if(i1 > 0 && i1 < 110)
  203. {
  204. int k1 = 4;
  205. textDrawingArea.method385(0, "From", i1, k1);
  206. k1 += textDrawingArea.getTextWidth("From ");
  207. if(byte0 == 1)
  208. {
  209. modIcons[0].method361(k1, i1 - 12);
  210. k1 += 14;
  211. }
  212. if(byte0 == 2)
  213. {
  214. modIcons[1].method361(k1, i1 - 12);
  215. k1 += 14;
  216. }
  217. textDrawingArea.method385(0, s1 + ":", i1, k1);
  218. k1 += textDrawingArea.getTextWidth(s1) + 8;
  219. textDrawingArea.method385(0x800000, chatMessages[k], i1, k1);
  220. }
  221. j++;
  222. }
  223. if(l == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1)))
  224. {
  225. if(i1 > 0 && i1 < 110)
  226. textDrawingArea.method385(0x800080, s1 + " " + chatMessages[k], i1, 4);
  227. j++;
  228. }
  229. if(l == 5 && splitPrivateChat == 0 && privateChatMode < 2)
  230. {
  231. if(i1 > 0 && i1 < 110)
  232. textDrawingArea.method385(0x800000, chatMessages[k], i1, 4);
  233. j++;
  234. }
  235. if(l == 6 && splitPrivateChat == 0 && privateChatMode < 2)
  236. {
  237. if(i1 > 0 && i1 < 110)
  238. {
  239. textDrawingArea.method385(0, "To " + s1 + ":", i1, 4);
  240. textDrawingArea.method385(0x800000, chatMessages[k], i1, 12 + textDrawingArea.getTextWidth("To " + s1));
  241. }
  242. j++;
  243. }
  244. if(l == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1)))
  245. {
  246. if(i1 > 0 && i1 < 110)
  247. textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], i1, 4);
  248. j++;
  249. }
  250. }
  251.  
  252. DrawingArea.defaultDrawingAreaSize();
  253. anInt1211 = j * 14 + 7;
  254. if(anInt1211 < 78)
  255. anInt1211 = 78;
  256. method30(77, anInt1211 - anInt1089 - 77, 0, 463, anInt1211);
  257. String s;
  258. if(myPlayer != null && myPlayer.name != null)
  259. s = myPlayer.name;
  260. else
  261. s = TextClass.fixName(myUsername);
  262. textDrawingArea.method385(0, s + ":", 90, 4);
  263. textDrawingArea.method385(255, inputString + "*", 90, 6 + textDrawingArea.getTextWidth(s + ": "));
  264. DrawingArea.method339(77, 0, 479, 0);
  265. }
  266. if(menuOpen && menuScreenArea == 2)
  267. drawMenu();
  268. aRSImageProducer_1166.drawGraphics(357, super.graphics, 17);
  269. aRSImageProducer_1165.initDrawingArea();
  270. Texture.anIntArray1472 = anIntArray1182;
  271. }
  272.  
  273. public void init()
  274. {
  275. nodeID = Integer.parseInt(getParameter("nodeid"));
  276. portOff = Integer.parseInt(getParameter("portoff"));
  277. String s = getParameter("lowmem");
  278. if(s != null && s.equals("1"))
  279. setLowMem();
  280. else
  281. setHighMem();
  282. String s1 = getParameter("free");
  283. isMembers = !(s1 != null && s1.equals("1"));
  284. initClientFrame(503, 765);
  285. }
  286.  
  287. public void startRunnable(Runnable runnable, int i)
  288. {
  289. if(i > 10)
  290. i = 10;
  291. if(signlink.mainapp != null)
  292. {
  293. signlink.startthread(runnable, i);
  294. } else
  295. {
  296. super.startRunnable(runnable, i);
  297. }
  298. }
  299.  
  300. public Socket openSocket(int i)
  301. throws IOException
  302. {
  303. if(signlink.mainapp != null)
  304. return signlink.opensocket(i);
  305. else
  306. return new Socket(InetAddress.getByName(getCodeBase().getHost()), i);
  307. }
  308.  
  309. private void processMenuClick()
  310. {
  311. if(activeInterfaceType != 0)
  312. return;
  313. int j = super.clickMode3;
  314. if(spellSelected == 1 && super.saveClickX >= 516 && super.saveClickY >= 160 && super.saveClickX <= 765 && super.saveClickY <= 205)
  315. j = 0;
  316. if(menuOpen)
  317. {
  318. if(j != 1)
  319. {
  320. int k = super.mouseX;
  321. int j1 = super.mouseY;
  322. if(menuScreenArea == 0)
  323. {
  324. k -= 4;
  325. j1 -= 4;
  326. }
  327. if(menuScreenArea == 1)
  328. {
  329. k -= 553;
  330. j1 -= 205;
  331. }
  332. if(menuScreenArea == 2)
  333. {
  334. k -= 17;
  335. j1 -= 357;
  336. }
  337. if(k < menuOffsetX - 10 || k > menuOffsetX + menuWidth + 10 || j1 < menuOffsetY - 10 || j1 > menuOffsetY + anInt952 + 10)
  338. {
  339. menuOpen = false;
  340. if(menuScreenArea == 1)
  341. needDrawTabArea = true;
  342. if(menuScreenArea == 2)
  343. inputTaken = true;
  344. }
  345. }
  346. if(j == 1)
  347. {
  348. int l = menuOffsetX;
  349. int k1 = menuOffsetY;
  350. int i2 = menuWidth;
  351. int k2 = super.saveClickX;
  352. int l2 = super.saveClickY;
  353. if(menuScreenArea == 0)
  354. {
  355. k2 -= 4;
  356. l2 -= 4;
  357. }
  358. if(menuScreenArea == 1)
  359. {
  360. k2 -= 553;
  361. l2 -= 205;
  362. }
  363. if(menuScreenArea == 2)
  364. {
  365. k2 -= 17;
  366. l2 -= 357;
  367. }
  368. int i3 = -1;
  369. for(int j3 = 0; j3 < menuActionRow; j3++)
  370. {
  371. int k3 = k1 + 31 + (menuActionRow - 1 - j3) * 15;
  372. if(k2 > l && k2 < l + i2 && l2 > k3 - 13 && l2 < k3 + 3)
  373. i3 = j3;
  374. }
  375.  
  376. if(i3 != -1)
  377. doAction(i3);
  378. menuOpen = false;
  379. if(menuScreenArea == 1)
  380. needDrawTabArea = true;
  381. if(menuScreenArea == 2)
  382. {
  383. inputTaken = true;
  384. }
  385. }
  386. } else
  387. {
  388. if(j == 1 && menuActionRow > 0)
  389. {
  390. int i1 = menuActionID[menuActionRow - 1];
  391. 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)
  392. {
  393. int l1 = menuActionCmd2[menuActionRow - 1];
  394. int j2 = menuActionCmd3[menuActionRow - 1];
  395. RSInterface class9 = RSInterface.interfaceCache[j2];
  396. if(class9.aBoolean259 || class9.aBoolean235)
  397. {
  398. aBoolean1242 = false;
  399. anInt989 = 0;
  400. anInt1084 = j2;
  401. anInt1085 = l1;
  402. activeInterfaceType = 2;
  403. anInt1087 = super.saveClickX;
  404. anInt1088 = super.saveClickY;
  405. if(RSInterface.interfaceCache[j2].parentID == openInterfaceID)
  406. activeInterfaceType = 1;
  407. if(RSInterface.interfaceCache[j2].parentID == backDialogID)
  408. activeInterfaceType = 3;
  409. return;
  410. }
  411. }
  412. }
  413. if(j == 1 && (anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  414. j = 2;
  415. if(j == 1 && menuActionRow > 0)
  416. doAction(menuActionRow - 1);
  417. if(j == 2 && menuActionRow > 0)
  418. determineMenuSize();
  419. }
  420. }
  421.  
  422. private void saveMidi(boolean flag, byte abyte0[])
  423. {
  424. signlink.midifade = flag ? 1 : 0;
  425. signlink.midisave(abyte0, abyte0.length);
  426. }
  427.  
  428. private void method22()
  429. {
  430. try
  431. {
  432. anInt985 = -1;
  433. aClass19_1056.removeAll();
  434. aClass19_1013.removeAll();
  435. Texture.method366();
  436. unlinkMRUNodes();
  437. worldController.initToNull();
  438. System.gc();
  439. for(int i = 0; i < 4; i++)
  440. aClass11Array1230[i].method210();
  441.  
  442. for(int l = 0; l < 4; l++)
  443. {
  444. for(int k1 = 0; k1 < 104; k1++)
  445. {
  446. for(int j2 = 0; j2 < 104; j2++)
  447. byteGroundArray[l][k1][j2] = 0;
  448.  
  449. }
  450.  
  451. }
  452.  
  453. ObjectManager objectManager = new ObjectManager(byteGroundArray, intGroundArray);
  454. int k2 = aByteArrayArray1183.length;
  455. stream.sendPacket(0);
  456. if(!aBoolean1159)
  457. {
  458. for(int i3 = 0; i3 < k2; i3++)
  459. {
  460. int i4 = (anIntArray1234[i3] >> 8) * 64 - baseX;
  461. int k5 = (anIntArray1234[i3] & 0xff) * 64 - baseY;
  462. byte abyte0[] = aByteArrayArray1183[i3];
  463. if(abyte0 != null)
  464. objectManager.method180(abyte0, k5, i4, (anInt1069 - 6) * 8, (anInt1070 - 6) * 8, aClass11Array1230);
  465. }
  466.  
  467. for(int j4 = 0; j4 < k2; j4++)
  468. {
  469. int l5 = (anIntArray1234[j4] >> 8) * 64 - baseX;
  470. int k7 = (anIntArray1234[j4] & 0xff) * 64 - baseY;
  471. byte abyte2[] = aByteArrayArray1183[j4];
  472. if(abyte2 == null && anInt1070 < 800)
  473. objectManager.method174(k7, 64, 64, l5);
  474. }
  475.  
  476. anInt1097++;
  477. if(anInt1097 > 160)
  478. {
  479. anInt1097 = 0;
  480. stream.sendPacket(238);
  481. stream.addByte(96);
  482. }
  483. stream.sendPacket(0);
  484. for(int i6 = 0; i6 < k2; i6++)
  485. {
  486. byte abyte1[] = aByteArrayArray1247[i6];
  487. if(abyte1 != null)
  488. {
  489. int l8 = (anIntArray1234[i6] >> 8) * 64 - baseX;
  490. int k9 = (anIntArray1234[i6] & 0xff) * 64 - baseY;
  491. objectManager.method190(l8, aClass11Array1230, k9, worldController, abyte1);
  492. }
  493. }
  494.  
  495. }
  496. if(aBoolean1159)
  497. {
  498. for(int j3 = 0; j3 < 4; j3++)
  499. {
  500. for(int k4 = 0; k4 < 13; k4++)
  501. {
  502. for(int j6 = 0; j6 < 13; j6++)
  503. {
  504. int l7 = anIntArrayArrayArray1129[j3][k4][j6];
  505. if(l7 != -1)
  506. {
  507. int i9 = l7 >> 24 & 3;
  508. int l9 = l7 >> 1 & 3;
  509. int j10 = l7 >> 14 & 0x3ff;
  510. int l10 = l7 >> 3 & 0x7ff;
  511. int j11 = (j10 / 8 << 8) + l10 / 8;
  512. for(int l11 = 0; l11 < anIntArray1234.length; l11++)
  513. {
  514. if(anIntArray1234[l11] != j11 || aByteArrayArray1183[l11] == null)
  515. continue;
  516. objectManager.method179(i9, l9, aClass11Array1230, k4 * 8, (j10 & 7) * 8, aByteArrayArray1183[l11], (l10 & 7) * 8, j3, j6 * 8);
  517. break;
  518. }
  519.  
  520. }
  521. }
  522.  
  523. }
  524.  
  525. }
  526.  
  527. for(int l4 = 0; l4 < 13; l4++)
  528. {
  529. for(int k6 = 0; k6 < 13; k6++)
  530. {
  531. int i8 = anIntArrayArrayArray1129[0][l4][k6];
  532. if(i8 == -1)
  533. objectManager.method174(k6 * 8, 8, 8, l4 * 8);
  534. }
  535.  
  536. }
  537.  
  538. stream.sendPacket(0);
  539. for(int l6 = 0; l6 < 4; l6++)
  540. {
  541. for(int j8 = 0; j8 < 13; j8++)
  542. {
  543. for(int j9 = 0; j9 < 13; j9++)
  544. {
  545. int i10 = anIntArrayArrayArray1129[l6][j8][j9];
  546. if(i10 != -1)
  547. {
  548. int k10 = i10 >> 24 & 3;
  549. int i11 = i10 >> 1 & 3;
  550. int k11 = i10 >> 14 & 0x3ff;
  551. int i12 = i10 >> 3 & 0x7ff;
  552. int j12 = (k11 / 8 << 8) + i12 / 8;
  553. for(int k12 = 0; k12 < anIntArray1234.length; k12++)
  554. {
  555. if(anIntArray1234[k12] != j12 || aByteArrayArray1247[k12] == null)
  556. continue;
  557. objectManager.method183(aClass11Array1230, worldController, k10, j8 * 8, (i12 & 7) * 8, l6, aByteArrayArray1247[k12], (k11 & 7) * 8, i11, j9 * 8);
  558. break;
  559. }
  560.  
  561. }
  562. }
  563.  
  564. }
  565.  
  566. }
  567.  
  568. }
  569. stream.sendPacket(0);
  570. objectManager.method171(aClass11Array1230, worldController);
  571. aRSImageProducer_1165.initDrawingArea();
  572. stream.sendPacket(0);
  573. int k3 = ObjectManager.anInt145;
  574. if(k3 > plane)
  575. k3 = plane;
  576. if(k3 < plane - 1)
  577. k3 = plane - 1;
  578. if(lowMem)
  579. worldController.method275(ObjectManager.anInt145);
  580. else
  581. worldController.method275(0);
  582. for(int i5 = 0; i5 < 104; i5++)
  583. {
  584. for(int i7 = 0; i7 < 104; i7++)
  585. spawnGroundItem(i5, i7);
  586.  
  587. }
  588.  
  589. anInt1051++;
  590. if(anInt1051 > 98)
  591. {
  592. anInt1051 = 0;
  593. stream.sendPacket(150);
  594. }
  595. method63();
  596. }
  597. catch(Exception exception) { }
  598. ObjectDef.mruNodes1.unlinkAll();
  599. if(super.gameFrame != null)
  600. {
  601. stream.sendPacket(210);
  602. stream.addInt(0x3f008edd);
  603. }
  604. if(lowMem && signlink.cache_dat != null)
  605. {
  606. int j = onDemandFetcher.getVersionCount(0);
  607. for(int i1 = 0; i1 < j; i1++)
  608. {
  609. int l1 = onDemandFetcher.getModelIndex(i1);
  610. if((l1 & 0x79) == 0)
  611. Model.method461(i1);
  612. }
  613.  
  614. }
  615. System.gc();
  616. Texture.method367();
  617. onDemandFetcher.method566();
  618. int k = (anInt1069 - 6) / 8 - 1;
  619. int j1 = (anInt1069 + 6) / 8 + 1;
  620. int i2 = (anInt1070 - 6) / 8 - 1;
  621. int l2 = (anInt1070 + 6) / 8 + 1;
  622. if(aBoolean1141)
  623. {
  624. k = 49;
  625. j1 = 50;
  626. i2 = 49;
  627. l2 = 50;
  628. }
  629. for(int l3 = k; l3 <= j1; l3++)
  630. {
  631. for(int j5 = i2; j5 <= l2; j5++)
  632. if(l3 == k || l3 == j1 || j5 == i2 || j5 == l2)
  633. {
  634. int j7 = onDemandFetcher.method562(0, j5, l3);
  635. if(j7 != -1)
  636. onDemandFetcher.method560(j7, 3);
  637. int k8 = onDemandFetcher.method562(1, j5, l3);
  638. if(k8 != -1)
  639. onDemandFetcher.method560(k8, 3);
  640. }
  641.  
  642. }
  643.  
  644. }
  645.  
  646. private void unlinkMRUNodes()
  647. {
  648. ObjectDef.mruNodes1.unlinkAll();
  649. ObjectDef.mruNodes2.unlinkAll();
  650. EntityDef.mruNodes.unlinkAll();
  651. ItemDef.mruNodes2.unlinkAll();
  652. ItemDef.mruNodes1.unlinkAll();
  653. Player.mruNodes.unlinkAll();
  654. SpotAnim.aMRUNodes_415.unlinkAll();
  655. }
  656.  
  657. private void method24(int i)
  658. {
  659. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  660. int j = ai.length;
  661. for(int k = 0; k < j; k++)
  662. ai[k] = 0;
  663.  
  664. for(int l = 1; l < 103; l++)
  665. {
  666. int i1 = 24628 + (103 - l) * 512 * 4;
  667. for(int k1 = 1; k1 < 103; k1++)
  668. {
  669. if((byteGroundArray[i][k1][l] & 0x18) == 0)
  670. worldController.method309(ai, i1, i, k1, l);
  671. if(i < 3 && (byteGroundArray[i + 1][k1][l] & 8) != 0)
  672. worldController.method309(ai, i1, i + 1, k1, l);
  673. i1 += 4;
  674. }
  675.  
  676. }
  677.  
  678. int j1 = ((238 + (int)(Math.random() * 20D)) - 10 << 16) + ((238 + (int)(Math.random() * 20D)) - 10 << 8) + ((238 + (int)(Math.random() * 20D)) - 10);
  679. int l1 = (238 + (int)(Math.random() * 20D)) - 10 << 16;
  680. aClass30_Sub2_Sub1_Sub1_1263.method343();
  681. for(int i2 = 1; i2 < 103; i2++)
  682. {
  683. for(int j2 = 1; j2 < 103; j2++)
  684. {
  685. if((byteGroundArray[i][j2][i2] & 0x18) == 0)
  686. method50(i2, j1, j2, l1, i);
  687. if(i < 3 && (byteGroundArray[i + 1][j2][i2] & 8) != 0)
  688. method50(i2, j1, j2, l1, i + 1);
  689. }
  690.  
  691. }
  692.  
  693. aRSImageProducer_1165.initDrawingArea();
  694. anInt1071 = 0;
  695. for(int k2 = 0; k2 < 104; k2++)
  696. {
  697. for(int l2 = 0; l2 < 104; l2++)
  698. {
  699. int i3 = worldController.method303(plane, k2, l2);
  700. if(i3 != 0)
  701. {
  702. i3 = i3 >> 14 & 0x7fff;
  703. int j3 = ObjectDef.forID(i3).anInt746;
  704. if(j3 >= 0)
  705. {
  706. int k3 = k2;
  707. int l3 = l2;
  708. if(j3 != 22 && j3 != 29 && j3 != 34 && j3 != 36 && j3 != 46 && j3 != 47 && j3 != 48)
  709. {
  710. byte byte0 = 104;
  711. byte byte1 = 104;
  712. int ai1[][] = aClass11Array1230[plane].anIntArrayArray294;
  713. for(int i4 = 0; i4 < 10; i4++)
  714. {
  715. int j4 = (int)(Math.random() * 4D);
  716. if(j4 == 0 && k3 > 0 && k3 > k2 - 3 && (ai1[k3 - 1][l3] & 0x1280108) == 0)
  717. k3--;
  718. if(j4 == 1 && k3 < byte0 - 1 && k3 < k2 + 3 && (ai1[k3 + 1][l3] & 0x1280180) == 0)
  719. k3++;
  720. if(j4 == 2 && l3 > 0 && l3 > l2 - 3 && (ai1[k3][l3 - 1] & 0x1280102) == 0)
  721. l3--;
  722. if(j4 == 3 && l3 < byte1 - 1 && l3 < l2 + 3 && (ai1[k3][l3 + 1] & 0x1280120) == 0)
  723. l3++;
  724. }
  725.  
  726. }
  727. aClass30_Sub2_Sub1_Sub1Array1140[anInt1071] = mapFunctions[j3];
  728. anIntArray1072[anInt1071] = k3;
  729. anIntArray1073[anInt1071] = l3;
  730. anInt1071++;
  731. }
  732. }
  733. }
  734.  
  735. }
  736.  
  737. }
  738.  
  739. private void spawnGroundItem(int i, int j)
  740. {
  741. NodeList class19 = groundArray[plane][i][j];
  742. if(class19 == null)
  743. {
  744. worldController.method295(plane, i, j);
  745. return;
  746. }
  747. int k = 0xfa0a1f01;
  748. Object obj = null;
  749. for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  750. {
  751. ItemDef itemDef = ItemDef.forID(item.ID);
  752. int l = itemDef.value;
  753. if(itemDef.stackable)
  754. l *= item.anInt1559 + 1;
  755. // notifyItemSpawn(item, i + baseX, j + baseY);
  756.  
  757. if(l > k)
  758. {
  759. k = l;
  760. obj = item;
  761. }
  762. }
  763.  
  764. class19.insertTail(((Node) (obj)));
  765. Object obj1 = null;
  766. Object obj2 = null;
  767. for(Item class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetFirst(); class30_sub2_sub4_sub2_1 != null; class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetNext())
  768. {
  769. if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && obj1 == null)
  770. obj1 = class30_sub2_sub4_sub2_1;
  771. if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && class30_sub2_sub4_sub2_1.ID != ((Item) (obj1)).ID && obj2 == null)
  772. obj2 = class30_sub2_sub4_sub2_1;
  773. }
  774.  
  775. int i1 = i + (j << 7) + 0x60000000;
  776. worldController.method281(i, i1, ((Animable) (obj1)), method42(plane, j * 128 + 64, i * 128 + 64), ((Animable) (obj2)), ((Animable) (obj)), plane, j);
  777. }
  778.  
  779. private void method26(boolean flag)
  780. {
  781. for(int j = 0; j < npcCount; j++)
  782. {
  783. NPC npc = npcArray[npcIndices[j]];
  784. int k = 0x20000000 + (npcIndices[j] << 14);
  785. if(npc == null || !npc.isVisible() || npc.desc.aBoolean93 != flag)
  786. continue;
  787. int l = npc.x >> 7;
  788. int i1 = npc.y >> 7;
  789. if(l < 0 || l >= 104 || i1 < 0 || i1 >= 104)
  790. continue;
  791. if(npc.anInt1540 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  792. {
  793. if(anIntArrayArray929[l][i1] == anInt1265)
  794. continue;
  795. anIntArrayArray929[l][i1] = anInt1265;
  796. }
  797. if(!npc.desc.aBoolean84)
  798. k += 0x80000000;
  799. worldController.method285(plane, npc.anInt1552, method42(plane, npc.y, npc.x), k, npc.y, (npc.anInt1540 - 1) * 64 + 60, npc.x, npc, npc.aBoolean1541);
  800. }
  801. }
  802.  
  803. private boolean replayWave()
  804. {
  805. return signlink.wavereplay();
  806. }
  807.  
  808. private void loadError()
  809. {
  810. String s = "ondemand";//was a constant parameter
  811. System.out.println(s);
  812. try
  813. {
  814. getAppletContext().showDocument(new URL(getCodeBase(), "loaderror_" + s + ".html"));
  815. }
  816. catch(Exception exception)
  817. {
  818. exception.printStackTrace();
  819. }
  820. do
  821. try
  822. {
  823. Thread.sleep(1000L);
  824. }
  825. catch(Exception _ex) { }
  826. while(true);
  827. }
  828.  
  829. private void buildInterfaceMenu(int i, RSInterface class9, int k, int l, int i1, int j1)
  830. {
  831. if(class9.type != 0 || class9.children == null || class9.aBoolean266)
  832. return;
  833. if(k < i || i1 < l || k > i + class9.width || i1 > l + class9.height)
  834. return;
  835. int k1 = class9.children.length;
  836. for(int l1 = 0; l1 < k1; l1++)
  837. {
  838. int i2 = class9.childX[l1] + i;
  839. int j2 = (class9.childY[l1] + l) - j1;
  840. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[l1]];
  841. i2 += class9_1.anInt263;
  842. j2 += class9_1.anInt265;
  843. if((class9_1.anInt230 >= 0 || class9_1.anInt216 != 0) && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  844. if(class9_1.anInt230 >= 0)
  845. anInt886 = class9_1.anInt230;
  846. else
  847. anInt886 = class9_1.id;
  848. if(class9_1.type == 0)
  849. {
  850. buildInterfaceMenu(i2, class9_1, k, j2, i1, class9_1.scrollPosition);
  851. if(class9_1.scrollMax > class9_1.height)
  852. method65(i2 + class9_1.width, class9_1.height, k, i1, class9_1, j2, true, class9_1.scrollMax);
  853. } else
  854. {
  855. if(class9_1.atActionType == 1 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  856. {
  857. boolean flag = false;
  858. if(class9_1.anInt214 != 0)
  859. flag = buildFriendsListMenu(class9_1);
  860. if(!flag)
  861. {
  862. //System.out.println("1"+class9_1.tooltip + ", " + class9_1.interfaceID);
  863. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  864. menuActionID[menuActionRow] = 315;
  865. menuActionCmd3[menuActionRow] = class9_1.id;
  866. menuActionRow++;
  867. }
  868. }
  869. if(class9_1.atActionType == 2 && spellSelected == 0 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  870. {
  871. String s = class9_1.selectedActionName;
  872. if(s.indexOf(" ") != -1)
  873. s = s.substring(0, s.indexOf(" "));
  874. menuActionName[menuActionRow] = s + " @gre@" + class9_1.spellName;
  875. menuActionID[menuActionRow] = 626;
  876. menuActionCmd3[menuActionRow] = class9_1.id;
  877. menuActionRow++;
  878. }
  879. if(class9_1.atActionType == 3 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  880. {
  881. menuActionName[menuActionRow] = "Close";
  882. menuActionID[menuActionRow] = 200;
  883. menuActionCmd3[menuActionRow] = class9_1.id;
  884. menuActionRow++;
  885. }
  886. if(class9_1.atActionType == 4 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  887. {
  888. //System.out.println("2"+class9_1.tooltip + ", " + class9_1.interfaceID);
  889. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  890. menuActionID[menuActionRow] = 169;
  891. menuActionCmd3[menuActionRow] = class9_1.id;
  892. menuActionRow++;
  893. }
  894. if(class9_1.atActionType == 5 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  895. {
  896. //System.out.println("3"+class9_1.tooltip + ", " + class9_1.interfaceID);
  897. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  898. menuActionID[menuActionRow] = 646;
  899. menuActionCmd3[menuActionRow] = class9_1.id;
  900. menuActionRow++;
  901. }
  902. if(class9_1.atActionType == 6 && !aBoolean1149 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  903. {
  904. //System.out.println("4"+class9_1.tooltip + ", " + class9_1.interfaceID);
  905. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  906. menuActionID[menuActionRow] = 679;
  907. menuActionCmd3[menuActionRow] = class9_1.id;
  908. menuActionRow++;
  909. }
  910. if(class9_1.type == 2)
  911. {
  912. int k2 = 0;
  913. for(int l2 = 0; l2 < class9_1.height; l2++)
  914. {
  915. for(int i3 = 0; i3 < class9_1.width; i3++)
  916. {
  917. int j3 = i2 + i3 * (32 + class9_1.invSpritePadX);
  918. int k3 = j2 + l2 * (32 + class9_1.invSpritePadY);
  919. if(k2 < 20)
  920. {
  921. j3 += class9_1.spritesX[k2];
  922. k3 += class9_1.spritesY[k2];
  923. }
  924. if(k >= j3 && i1 >= k3 && k < j3 + 32 && i1 < k3 + 32)
  925. {
  926. mouseInvInterfaceIndex = k2;
  927. lastActiveInvInterface = class9_1.id;
  928. if(class9_1.inv[k2] > 0)
  929. {
  930. ItemDef itemDef = ItemDef.forID(class9_1.inv[k2] - 1);
  931. if(itemSelected == 1 && class9_1.isInventoryInterface)
  932. {
  933. if(class9_1.id != anInt1284 || k2 != anInt1283)
  934. {
  935. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  936. menuActionID[menuActionRow] = 870;
  937. menuActionCmd1[menuActionRow] = itemDef.id;
  938. menuActionCmd2[menuActionRow] = k2;
  939. menuActionCmd3[menuActionRow] = class9_1.id;
  940. menuActionRow++;
  941. }
  942. } else
  943. if(spellSelected == 1 && class9_1.isInventoryInterface)
  944. {
  945. if((spellUsableOn & 0x10) == 16)
  946. {
  947. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  948. menuActionID[menuActionRow] = 543;
  949. menuActionCmd1[menuActionRow] = itemDef.id;
  950. menuActionCmd2[menuActionRow] = k2;
  951. menuActionCmd3[menuActionRow] = class9_1.id;
  952. menuActionRow++;
  953. }
  954. } else
  955. {
  956. if(class9_1.isInventoryInterface)
  957. {
  958. for(int l3 = 4; l3 >= 3; l3--)
  959. if(itemDef.actions != null && itemDef.actions[l3] != null)
  960. {
  961. menuActionName[menuActionRow] = itemDef.actions[l3] + " @lre@" + itemDef.name;
  962. if(l3 == 3)
  963. menuActionID[menuActionRow] = 493;
  964. if(l3 == 4)
  965. menuActionID[menuActionRow] = 847;
  966. menuActionCmd1[menuActionRow] = itemDef.id;
  967. menuActionCmd2[menuActionRow] = k2;
  968. menuActionCmd3[menuActionRow] = class9_1.id;
  969. menuActionRow++;
  970. } else
  971. if(l3 == 4)
  972. {
  973. menuActionName[menuActionRow] = "Drop @lre@" + itemDef.name;
  974. menuActionID[menuActionRow] = 847;
  975. menuActionCmd1[menuActionRow] = itemDef.id;
  976. menuActionCmd2[menuActionRow] = k2;
  977. menuActionCmd3[menuActionRow] = class9_1.id;
  978. menuActionRow++;
  979. }
  980.  
  981. }
  982. if(class9_1.usableItemInterface)
  983. {
  984. menuActionName[menuActionRow] = "Use @lre@" + itemDef.name;
  985. menuActionID[menuActionRow] = 447;
  986. menuActionCmd1[menuActionRow] = itemDef.id;
  987. menuActionCmd2[menuActionRow] = k2;
  988. menuActionCmd3[menuActionRow] = class9_1.id;
  989. menuActionRow++;
  990. }
  991. if(class9_1.isInventoryInterface && itemDef.actions != null)
  992. {
  993. for(int i4 = 2; i4 >= 0; i4--)
  994. if(itemDef.actions[i4] != null)
  995. {
  996. menuActionName[menuActionRow] = itemDef.actions[i4] + " @lre@" + itemDef.name;
  997. if(i4 == 0)
  998. menuActionID[menuActionRow] = 74;
  999. if(i4 == 1)
  1000. menuActionID[menuActionRow] = 454;
  1001. if(i4 == 2)
  1002. menuActionID[menuActionRow] = 539;
  1003. menuActionCmd1[menuActionRow] = itemDef.id;
  1004. menuActionCmd2[menuActionRow] = k2;
  1005. menuActionCmd3[menuActionRow] = class9_1.id;
  1006. menuActionRow++;
  1007. }
  1008.  
  1009. }
  1010. if(class9_1.actions != null)
  1011. {
  1012. for(int j4 = 4; j4 >= 0; j4--)
  1013. if(class9_1.actions[j4] != null)
  1014. {
  1015. menuActionName[menuActionRow] = class9_1.actions[j4] + " @lre@" + itemDef.name;
  1016. if(j4 == 0)
  1017. menuActionID[menuActionRow] = 632;
  1018. if(j4 == 1)
  1019. menuActionID[menuActionRow] = 78;
  1020. if(j4 == 2)
  1021. menuActionID[menuActionRow] = 867;
  1022. if(j4 == 3)
  1023. menuActionID[menuActionRow] = 431;
  1024. if(j4 == 4)
  1025. menuActionID[menuActionRow] = 53;
  1026. menuActionCmd1[menuActionRow] = itemDef.id;
  1027. menuActionCmd2[menuActionRow] = k2;
  1028. menuActionCmd3[menuActionRow] = class9_1.id;
  1029. menuActionRow++;
  1030. }
  1031.  
  1032. }
  1033. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + (class9_1.inv[k2] - 1) + "@gre@)";
  1034. menuActionID[menuActionRow] = 1125;
  1035. menuActionCmd1[menuActionRow] = itemDef.id;
  1036. menuActionCmd2[menuActionRow] = k2;
  1037. menuActionCmd3[menuActionRow] = class9_1.id;
  1038. menuActionRow++;
  1039. }
  1040. }
  1041. }
  1042. k2++;
  1043. }
  1044.  
  1045. }
  1046.  
  1047. }
  1048. }
  1049. }
  1050.  
  1051. }
  1052.  
  1053. private void method30(int j, int k, int l, int i1, int j1)
  1054. {
  1055. scrollBar1.method361(i1, l);
  1056. scrollBar2.method361(i1, (l + j) - 16);
  1057. DrawingArea.method336(j - 32, l + 16, i1, anInt1002, 16);
  1058. int k1 = ((j - 32) * j) / j1;
  1059. if(k1 < 8)
  1060. k1 = 8;
  1061. int l1 = ((j - 32 - k1) * k) / (j1 - j);
  1062. DrawingArea.method336(k1, l + 16 + l1, i1, anInt1063, 16);
  1063. DrawingArea.method341(l + 16 + l1, anInt902, k1, i1);
  1064. DrawingArea.method341(l + 16 + l1, anInt902, k1, i1 + 1);
  1065. DrawingArea.method339(l + 16 + l1, anInt902, 16, i1);
  1066. DrawingArea.method339(l + 17 + l1, anInt902, 16, i1);
  1067. DrawingArea.method341(l + 16 + l1, anInt927, k1, i1 + 15);
  1068. DrawingArea.method341(l + 17 + l1, anInt927, k1 - 1, i1 + 14);
  1069. DrawingArea.method339(l + 15 + l1 + k1, anInt927, 16, i1);
  1070. DrawingArea.method339(l + 14 + l1 + k1, anInt927, 15, i1 + 1);
  1071. }
  1072.  
  1073. private void updateNPCs(Stream stream, int i)
  1074. {
  1075. anInt839 = 0;
  1076. anInt893 = 0;
  1077. method139(stream);
  1078. method46(i, stream);
  1079. method86(stream);
  1080. for(int k = 0; k < anInt839; k++)
  1081. {
  1082. int l = anIntArray840[k];
  1083. if(npcArray[l].anInt1537 != loopCycle)
  1084. {
  1085. npcArray[l].desc = null;
  1086. npcArray[l] = null;
  1087. }
  1088. }
  1089.  
  1090. if(stream.currentOffset != i)
  1091. {
  1092. signlink.reporterror(myUsername + " size mismatch in getnpcpos - pos:" + stream.currentOffset + " psize:" + i);
  1093. throw new RuntimeException("eek");
  1094. }
  1095. for(int i1 = 0; i1 < npcCount; i1++)
  1096. if(npcArray[npcIndices[i1]] == null)
  1097. {
  1098. signlink.reporterror(myUsername + " null entry in npc list - pos:" + i1 + " size:" + npcCount);
  1099. throw new RuntimeException("eek");
  1100. }
  1101.  
  1102. }
  1103.  
  1104. private void processChatModeClick()
  1105. {
  1106. if(super.clickMode3 == 1)
  1107. {
  1108. if(super.saveClickX >= 6 && super.saveClickX <= 106 && super.saveClickY >= 467 && super.saveClickY <= 499)
  1109. {
  1110. publicChatMode = (publicChatMode + 1) % 4;
  1111. aBoolean1233 = true;
  1112. inputTaken = true;
  1113. stream.sendPacket(95);
  1114. stream.addByte(publicChatMode);
  1115. stream.addByte(privateChatMode);
  1116. stream.addByte(tradeMode);
  1117. }
  1118. if(super.saveClickX >= 135 && super.saveClickX <= 235 && super.saveClickY >= 467 && super.saveClickY <= 499)
  1119. {
  1120. privateChatMode = (privateChatMode + 1) % 3;
  1121. aBoolean1233 = true;
  1122. inputTaken = true;
  1123. stream.sendPacket(95);
  1124. stream.addByte(publicChatMode);
  1125. stream.addByte(privateChatMode);
  1126. stream.addByte(tradeMode);
  1127. }
  1128. if(super.saveClickX >= 273 && super.saveClickX <= 373 && super.saveClickY >= 467 && super.saveClickY <= 499)
  1129. {
  1130. tradeMode = (tradeMode + 1) % 3;
  1131. aBoolean1233 = true;
  1132. inputTaken = true;
  1133. stream.sendPacket(95);
  1134. stream.addByte(publicChatMode);
  1135. stream.addByte(privateChatMode);
  1136. stream.addByte(tradeMode);
  1137. }
  1138. if(super.saveClickX >= 412 && super.saveClickX <= 512 && super.saveClickY >= 467 && super.saveClickY <= 499)
  1139. if(openInterfaceID == -1)
  1140. {
  1141. clearTopInterfaces();
  1142. reportAbuseInput = "";
  1143. canMute = false;
  1144. for(int i = 0; i < RSInterface.interfaceCache.length; i++)
  1145. {
  1146. if(RSInterface.interfaceCache[i] == null || RSInterface.interfaceCache[i].anInt214 != 600)
  1147. continue;
  1148. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  1149. break;
  1150. }
  1151.  
  1152. } else
  1153. {
  1154. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  1155. }
  1156. anInt940++;
  1157. if(anInt940 > 1386)
  1158. {
  1159. anInt940 = 0;
  1160. stream.sendPacket(165);
  1161. stream.addByte(0);
  1162. int j = stream.currentOffset;
  1163. stream.addByte(139);
  1164. stream.addByte(150);
  1165. stream.addShort(32131);
  1166. stream.addByte((int)(Math.random() * 256D));
  1167. stream.addShort(3250);
  1168. stream.addByte(177);
  1169. stream.addShort(24859);
  1170. stream.addByte(119);
  1171. if((int)(Math.random() * 2D) == 0)
  1172. stream.addShort(47234);
  1173. if((int)(Math.random() * 2D) == 0)
  1174. stream.addByte(21);
  1175. stream.writeBytes(stream.currentOffset - j);
  1176. }
  1177. }
  1178. }
  1179.  
  1180. private void method33(int i)
  1181. {
  1182. int j = Varp.cache[i].anInt709;
  1183. if(j == 0)
  1184. return;
  1185. int k = variousSettings[i];
  1186. if(j == 1)
  1187. {
  1188. if(k == 1)
  1189. Texture.method372(0.90000000000000002D);
  1190. if(k == 2)
  1191. Texture.method372(0.80000000000000004D);
  1192. if(k == 3)
  1193. Texture.method372(0.69999999999999996D);
  1194. if(k == 4)
  1195. Texture.method372(0.59999999999999998D);
  1196. ItemDef.mruNodes1.unlinkAll();
  1197. welcomeScreenRaised = true;
  1198. }
  1199. if(j == 3)
  1200. {
  1201. boolean flag1 = musicEnabled;
  1202. if(k == 0)
  1203. {
  1204. adjustVolume(musicEnabled, 0);
  1205. musicEnabled = true;
  1206. }
  1207. if(k == 1)
  1208. {
  1209. adjustVolume(musicEnabled, -400);
  1210. musicEnabled = true;
  1211. }
  1212. if(k == 2)
  1213. {
  1214. adjustVolume(musicEnabled, -800);
  1215. musicEnabled = true;
  1216. }
  1217. if(k == 3)
  1218. {
  1219. adjustVolume(musicEnabled, -1200);
  1220. musicEnabled = true;
  1221. }
  1222. if(k == 4)
  1223. musicEnabled = false;
  1224. if(musicEnabled != flag1 && !lowMem)
  1225. {
  1226. if(musicEnabled)
  1227. {
  1228. nextSong = currentSong;
  1229. songChanging = true;
  1230. onDemandFetcher.method558(2, nextSong);
  1231. } else
  1232. {
  1233. stopMidi();
  1234. }
  1235. prevSong = 0;
  1236. }
  1237. }
  1238. if(j == 4)
  1239. {
  1240. if(k == 0)
  1241. {
  1242. aBoolean848 = true;
  1243. setWaveVolume(0);
  1244. }
  1245. if(k == 1)
  1246. {
  1247. aBoolean848 = true;
  1248. setWaveVolume(-400);
  1249. }
  1250. if(k == 2)
  1251. {
  1252. aBoolean848 = true;
  1253. setWaveVolume(-800);
  1254. }
  1255. if(k == 3)
  1256. {
  1257. aBoolean848 = true;
  1258. setWaveVolume(-1200);
  1259. }
  1260. if(k == 4)
  1261. aBoolean848 = false;
  1262. }
  1263. if(j == 5)
  1264. anInt1253 = k;
  1265. if(j == 6)
  1266. anInt1249 = k;
  1267. if(j == 8)
  1268. {
  1269. splitPrivateChat = k;
  1270. inputTaken = true;
  1271. }
  1272. if(j == 9)
  1273. anInt913 = k;
  1274. }
  1275.  
  1276. private void updateEntities()
  1277. {
  1278. try{
  1279. int anInt974 = 0;
  1280. for(int j = -1; j < playerCount + npcCount; j++)
  1281. {
  1282. Object obj;
  1283. if(j == -1)
  1284. obj = myPlayer;
  1285. else
  1286. if(j < playerCount)
  1287. obj = playerArray[playerIndices[j]];
  1288. else
  1289. obj = npcArray[npcIndices[j - playerCount]];
  1290. if(obj == null || !((Entity) (obj)).isVisible())
  1291. continue;
  1292. if(obj instanceof NPC)
  1293. {
  1294. EntityDef entityDef = ((NPC)obj).desc;
  1295. if(entityDef.childrenIDs != null)
  1296. entityDef = entityDef.method161();
  1297. if(entityDef == null)
  1298. continue;
  1299. }
  1300. if(j < playerCount)
  1301. {
  1302. int l = 30;
  1303. Player player = (Player)obj;
  1304. if(player.headIcon != 0)
  1305. {
  1306. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1307. if(spriteDrawX > -1)
  1308. {
  1309. for(int i2 = 0; i2 < 8; i2++)
  1310. if((player.headIcon & 1 << i2) != 0)
  1311. {
  1312. headIcons[i2].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1313. l -= 25;
  1314. }
  1315.  
  1316. }
  1317. }
  1318. if(j >= 0 && anInt855 == 10 && anInt933 == playerIndices[j])
  1319. {
  1320. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1321. if(spriteDrawX > -1)
  1322. headIcons[7].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1323. }
  1324. } else
  1325. {
  1326. EntityDef entityDef_1 = ((NPC)obj).desc;
  1327. if(entityDef_1.anInt75 >= 0 && entityDef_1.anInt75 < headIcons.length)
  1328. {
  1329. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1330. if(spriteDrawX > -1)
  1331. headIcons[entityDef_1.anInt75].drawSprite(spriteDrawX - 12, spriteDrawY - 30);
  1332. }
  1333. if(anInt855 == 1 && anInt1222 == npcIndices[j - playerCount] && loopCycle % 20 < 10)
  1334. {
  1335. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1336. if(spriteDrawX > -1)
  1337. headIcons[2].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  1338. }
  1339. }
  1340. if(((Entity) (obj)).textSpoken != null && (j >= playerCount || publicChatMode == 0 || publicChatMode == 3 || publicChatMode == 1 && isFriendOrSelf(((Player)obj).name)))
  1341. {
  1342. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height);
  1343. if(spriteDrawX > -1 && anInt974 < anInt975)
  1344. {
  1345. anIntArray979[anInt974] = chatTextDrawingArea.method384(((Entity) (obj)).textSpoken) / 2;
  1346. anIntArray978[anInt974] = chatTextDrawingArea.anInt1497;
  1347. anIntArray976[anInt974] = spriteDrawX;
  1348. anIntArray977[anInt974] = spriteDrawY;
  1349. anIntArray980[anInt974] = ((Entity) (obj)).anInt1513;
  1350. anIntArray981[anInt974] = ((Entity) (obj)).anInt1531;
  1351. anIntArray982[anInt974] = ((Entity) (obj)).textCycle;
  1352. aStringArray983[anInt974++] = ((Entity) (obj)).textSpoken;
  1353. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 >= 1 && ((Entity) (obj)).anInt1531 <= 3)
  1354. {
  1355. anIntArray978[anInt974] += 10;
  1356. anIntArray977[anInt974] += 5;
  1357. }
  1358. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 4)
  1359. anIntArray979[anInt974] = 60;
  1360. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 5)
  1361. anIntArray978[anInt974] += 5;
  1362. }
  1363. }
  1364. if(((Entity) (obj)).loopCycleStatus > loopCycle)
  1365. { try{
  1366. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1367. if(spriteDrawX > -1)
  1368. {
  1369. int i1 = (((Entity) (obj)).currentHealth * 30) / ((Entity) (obj)).maxHealth;
  1370. if(i1 > 30)
  1371. i1 = 30;
  1372. DrawingArea.method336(5, spriteDrawY - 3, spriteDrawX - 15, 65280, i1);
  1373. DrawingArea.method336(5, spriteDrawY - 3, (spriteDrawX - 15) + i1, 0xff0000, 30 - i1);
  1374. }
  1375. }catch(Exception e){ }
  1376. }
  1377. for(int j1 = 0; j1 < 4; j1++)
  1378. if(((Entity) (obj)).hitsLoopCycle[j1] > loopCycle)
  1379. {
  1380. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height / 2);
  1381. if(spriteDrawX > -1)
  1382. {
  1383. if(j1 == 1)
  1384. spriteDrawY -= 20;
  1385. if(j1 == 2)
  1386. {
  1387. spriteDrawX -= 15;
  1388. spriteDrawY -= 10;
  1389. }
  1390. if(j1 == 3)
  1391. {
  1392. spriteDrawX += 15;
  1393. spriteDrawY -= 10;
  1394. }
  1395. hitMarks[((Entity) (obj)).hitMarkTypes[j1]].drawSprite(spriteDrawX - 12, spriteDrawY - 12);
  1396. aTextDrawingArea_1270.drawText(0, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 4, spriteDrawX);
  1397. aTextDrawingArea_1270.drawText(0xffffff, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 3, spriteDrawX - 1);
  1398. }
  1399. }
  1400.  
  1401. }
  1402. for(int k = 0; k < anInt974; k++)
  1403. {
  1404. int k1 = anIntArray976[k];
  1405. int l1 = anIntArray977[k];
  1406. int j2 = anIntArray979[k];
  1407. int k2 = anIntArray978[k];
  1408. boolean flag = true;
  1409. while(flag)
  1410. {
  1411. flag = false;
  1412. for(int l2 = 0; l2 < k; l2++)
  1413. 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)
  1414. {
  1415. l1 = anIntArray977[l2] - anIntArray978[l2];
  1416. flag = true;
  1417. }
  1418.  
  1419. }
  1420. spriteDrawX = anIntArray976[k];
  1421. spriteDrawY = anIntArray977[k] = l1;
  1422. String s = aStringArray983[k];
  1423. if(anInt1249 == 0)
  1424. {
  1425. int i3 = 0xffff00;
  1426. if(anIntArray980[k] < 6)
  1427. i3 = anIntArray965[anIntArray980[k]];
  1428. if(anIntArray980[k] == 6)
  1429. i3 = anInt1265 % 20 >= 10 ? 0xffff00 : 0xff0000;
  1430. if(anIntArray980[k] == 7)
  1431. i3 = anInt1265 % 20 >= 10 ? 65535 : 255;
  1432. if(anIntArray980[k] == 8)
  1433. i3 = anInt1265 % 20 >= 10 ? 0x80ff80 : 45056;
  1434. if(anIntArray980[k] == 9)
  1435. {
  1436. int j3 = 150 - anIntArray982[k];
  1437. if(j3 < 50)
  1438. i3 = 0xff0000 + 1280 * j3;
  1439. else
  1440. if(j3 < 100)
  1441. i3 = 0xffff00 - 0x50000 * (j3 - 50);
  1442. else
  1443. if(j3 < 150)
  1444. i3 = 65280 + 5 * (j3 - 100);
  1445. }
  1446. if(anIntArray980[k] == 10)
  1447. {
  1448. int k3 = 150 - anIntArray982[k];
  1449. if(k3 < 50)
  1450. i3 = 0xff0000 + 5 * k3;
  1451. else
  1452. if(k3 < 100)
  1453. i3 = 0xff00ff - 0x50000 * (k3 - 50);
  1454. else
  1455. if(k3 < 150)
  1456. i3 = (255 + 0x50000 * (k3 - 100)) - 5 * (k3 - 100);
  1457. }
  1458. if(anIntArray980[k] == 11)
  1459. {
  1460. int l3 = 150 - anIntArray982[k];
  1461. if(l3 < 50)
  1462. i3 = 0xffffff - 0x50005 * l3;
  1463. else
  1464. if(l3 < 100)
  1465. i3 = 65280 + 0x50005 * (l3 - 50);
  1466. else
  1467. if(l3 < 150)
  1468. i3 = 0xffffff - 0x50000 * (l3 - 100);
  1469. }
  1470. if(anIntArray981[k] == 0)
  1471. {
  1472. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  1473. chatTextDrawingArea.drawText(i3, s, spriteDrawY, spriteDrawX);
  1474. }
  1475. if(anIntArray981[k] == 1)
  1476. {
  1477. chatTextDrawingArea.method386(0, s, spriteDrawX, anInt1265, spriteDrawY + 1);
  1478. chatTextDrawingArea.method386(i3, s, spriteDrawX, anInt1265, spriteDrawY);
  1479. }
  1480. if(anIntArray981[k] == 2)
  1481. {
  1482. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY + 1, 0);
  1483. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY, i3);
  1484. }
  1485. if(anIntArray981[k] == 3)
  1486. {
  1487. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY + 1, spriteDrawX, 0);
  1488. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY, spriteDrawX, i3);
  1489. }
  1490. if(anIntArray981[k] == 4)
  1491. {
  1492. int i4 = chatTextDrawingArea.method384(s);
  1493. int k4 = ((150 - anIntArray982[k]) * (i4 + 100)) / 150;
  1494. DrawingArea.setDrawingArea(334, spriteDrawX - 50, spriteDrawX + 50, 0);
  1495. chatTextDrawingArea.method385(0, s, spriteDrawY + 1, (spriteDrawX + 50) - k4);
  1496. chatTextDrawingArea.method385(i3, s, spriteDrawY, (spriteDrawX + 50) - k4);
  1497. DrawingArea.defaultDrawingAreaSize();
  1498. }
  1499. if(anIntArray981[k] == 5)
  1500. {
  1501. int j4 = 150 - anIntArray982[k];
  1502. int l4 = 0;
  1503. if(j4 < 25)
  1504. l4 = j4 - 25;
  1505. else
  1506. if(j4 > 125)
  1507. l4 = j4 - 125;
  1508. DrawingArea.setDrawingArea(spriteDrawY + 5, 0, 512, spriteDrawY - chatTextDrawingArea.anInt1497 - 1);
  1509. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1 + l4, spriteDrawX);
  1510. chatTextDrawingArea.drawText(i3, s, spriteDrawY + l4, spriteDrawX);
  1511. DrawingArea.defaultDrawingAreaSize();
  1512. }
  1513. } else
  1514. {
  1515. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  1516. chatTextDrawingArea.drawText(0xffff00, s, spriteDrawY, spriteDrawX);
  1517. }
  1518. }
  1519. }catch(Exception e){ }
  1520.  
  1521. }
  1522.  
  1523. private void delFriend(long l)
  1524. {
  1525. try
  1526. {
  1527. if(l == 0L)
  1528. return;
  1529. for(int i = 0; i < friendsCount; i++)
  1530. {
  1531. if(friendsListAsLongs[i] != l)
  1532. continue;
  1533. friendsCount--;
  1534. needDrawTabArea = true;
  1535. for(int j = i; j < friendsCount; j++)
  1536. {
  1537. friendsList[j] = friendsList[j + 1];
  1538. friendsNodeIDs[j] = friendsNodeIDs[j + 1];
  1539. friendsListAsLongs[j] = friendsListAsLongs[j + 1];
  1540. }
  1541.  
  1542. stream.sendPacket(215);
  1543. stream.addLong(l);
  1544. break;
  1545. }
  1546. }
  1547. catch(RuntimeException runtimeexception)
  1548. {
  1549. signlink.reporterror("18622, " + false + ", " + l + ", " + runtimeexception.toString());
  1550. throw new RuntimeException();
  1551. }
  1552. }
  1553.  
  1554. private void drawTabArea()
  1555. {
  1556. aRSImageProducer_1163.initDrawingArea();
  1557. Texture.anIntArray1472 = anIntArray1181;
  1558. invBack.method361(0, 0);
  1559. if(invOverlayInterfaceID != -1)
  1560. drawInterface(0, 0, RSInterface.interfaceCache[invOverlayInterfaceID], 0);
  1561. else
  1562. if(tabInterfaceIDs[tabID] != -1)
  1563. drawInterface(0, 0, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 0);
  1564. if(menuOpen && menuScreenArea == 1)
  1565. drawMenu();
  1566. aRSImageProducer_1163.drawGraphics(205, super.graphics, 553);
  1567. aRSImageProducer_1165.initDrawingArea();
  1568. Texture.anIntArray1472 = anIntArray1182;
  1569. }
  1570.  
  1571. private void method37(int j)
  1572. {
  1573. if(!lowMem)
  1574. {
  1575. if(Texture.anIntArray1480[17] >= j)
  1576. {
  1577. Background background = Texture.aBackgroundArray1474s[17];
  1578. int k = background.anInt1452 * background.anInt1453 - 1;
  1579. int j1 = background.anInt1452 * anInt945 * 2;
  1580. byte abyte0[] = background.aByteArray1450;
  1581. byte abyte3[] = aByteArray912;
  1582. for(int i2 = 0; i2 <= k; i2++)
  1583. abyte3[i2] = abyte0[i2 - j1 & k];
  1584.  
  1585. background.aByteArray1450 = abyte3;
  1586. aByteArray912 = abyte0;
  1587. Texture.method370(17);
  1588. anInt854++;
  1589. if(anInt854 > 1235)
  1590. {
  1591. anInt854 = 0;
  1592. stream.sendPacket(226);
  1593. stream.addByte(0);
  1594. int l2 = stream.currentOffset;
  1595. stream.addShort(58722);
  1596. stream.addByte(240);
  1597. stream.addShort((int)(Math.random() * 65536D));
  1598. stream.addByte((int)(Math.random() * 256D));
  1599. if((int)(Math.random() * 2D) == 0)
  1600. stream.addShort(51825);
  1601. stream.addByte((int)(Math.random() * 256D));
  1602. stream.addShort((int)(Math.random() * 65536D));
  1603. stream.addShort(7130);
  1604. stream.addShort((int)(Math.random() * 65536D));
  1605. stream.addShort(61657);
  1606. stream.writeBytes(stream.currentOffset - l2);
  1607. }
  1608. }
  1609. if(Texture.anIntArray1480[24] >= j)
  1610. {
  1611. Background background_1 = Texture.aBackgroundArray1474s[24];
  1612. int l = background_1.anInt1452 * background_1.anInt1453 - 1;
  1613. int k1 = background_1.anInt1452 * anInt945 * 2;
  1614. byte abyte1[] = background_1.aByteArray1450;
  1615. byte abyte4[] = aByteArray912;
  1616. for(int j2 = 0; j2 <= l; j2++)
  1617. abyte4[j2] = abyte1[j2 - k1 & l];
  1618.  
  1619. background_1.aByteArray1450 = abyte4;
  1620. aByteArray912 = abyte1;
  1621. Texture.method370(24);
  1622. }
  1623. if(Texture.anIntArray1480[34] >= j)
  1624. {
  1625. Background background_2 = Texture.aBackgroundArray1474s[34];
  1626. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  1627. int l1 = background_2.anInt1452 * anInt945 * 2;
  1628. byte abyte2[] = background_2.aByteArray1450;
  1629. byte abyte5[] = aByteArray912;
  1630. for(int k2 = 0; k2 <= i1; k2++)
  1631. abyte5[k2] = abyte2[k2 - l1 & i1];
  1632.  
  1633. background_2.aByteArray1450 = abyte5;
  1634. aByteArray912 = abyte2;
  1635. Texture.method370(34);
  1636. }
  1637. }
  1638. }
  1639.  
  1640. private void method38()
  1641. {
  1642. for(int i = -1; i < playerCount; i++)
  1643. {
  1644. int j;
  1645. if(i == -1)
  1646. j = myPlayerIndex;
  1647. else
  1648. j = playerIndices[i];
  1649. Player player = playerArray[j];
  1650. if(player != null && player.textCycle > 0)
  1651. {
  1652. player.textCycle--;
  1653. if(player.textCycle == 0)
  1654. player.textSpoken = null;
  1655. }
  1656. }
  1657.  
  1658. for(int k = 0; k < npcCount; k++)
  1659. {
  1660. int l = npcIndices[k];
  1661. NPC npc = npcArray[l];
  1662. if(npc != null && npc.textCycle > 0)
  1663. {
  1664. npc.textCycle--;
  1665. if(npc.textCycle == 0)
  1666. npc.textSpoken = null;
  1667. }
  1668. }
  1669.  
  1670. }
  1671.  
  1672. private void calcCameraPos()
  1673. {
  1674. int i = anInt1098 * 128 + 64;
  1675. int j = anInt1099 * 128 + 64;
  1676. int k = method42(plane, j, i) - anInt1100;
  1677. if(xCameraPos < i)
  1678. {
  1679. xCameraPos += anInt1101 + ((i - xCameraPos) * anInt1102) / 1000;
  1680. if(xCameraPos > i)
  1681. xCameraPos = i;
  1682. }
  1683. if(xCameraPos > i)
  1684. {
  1685. xCameraPos -= anInt1101 + ((xCameraPos - i) * anInt1102) / 1000;
  1686. if(xCameraPos < i)
  1687. xCameraPos = i;
  1688. }
  1689. if(zCameraPos < k)
  1690. {
  1691. zCameraPos += anInt1101 + ((k - zCameraPos) * anInt1102) / 1000;
  1692. if(zCameraPos > k)
  1693. zCameraPos = k;
  1694. }
  1695. if(zCameraPos > k)
  1696. {
  1697. zCameraPos -= anInt1101 + ((zCameraPos - k) * anInt1102) / 1000;
  1698. if(zCameraPos < k)
  1699. zCameraPos = k;
  1700. }
  1701. if(yCameraPos < j)
  1702. {
  1703. yCameraPos += anInt1101 + ((j - yCameraPos) * anInt1102) / 1000;
  1704. if(yCameraPos > j)
  1705. yCameraPos = j;
  1706. }
  1707. if(yCameraPos > j)
  1708. {
  1709. yCameraPos -= anInt1101 + ((yCameraPos - j) * anInt1102) / 1000;
  1710. if(yCameraPos < j)
  1711. yCameraPos = j;
  1712. }
  1713. i = anInt995 * 128 + 64;
  1714. j = anInt996 * 128 + 64;
  1715. k = method42(plane, j, i) - anInt997;
  1716. int l = i - xCameraPos;
  1717. int i1 = k - zCameraPos;
  1718. int j1 = j - yCameraPos;
  1719. int k1 = (int)Math.sqrt(l * l + j1 * j1);
  1720. int l1 = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  1721. int i2 = (int)(Math.atan2(l, j1) * -325.94900000000001D) & 0x7ff;
  1722. if(l1 < 128)
  1723. l1 = 128;
  1724. if(l1 > 383)
  1725. l1 = 383;
  1726. if(yCameraCurve < l1)
  1727. {
  1728. yCameraCurve += anInt998 + ((l1 - yCameraCurve) * anInt999) / 1000;
  1729. if(yCameraCurve > l1)
  1730. yCameraCurve = l1;
  1731. }
  1732. if(yCameraCurve > l1)
  1733. {
  1734. yCameraCurve -= anInt998 + ((yCameraCurve - l1) * anInt999) / 1000;
  1735. if(yCameraCurve < l1)
  1736. yCameraCurve = l1;
  1737. }
  1738. int j2 = i2 - xCameraCurve;
  1739. if(j2 > 1024)
  1740. j2 -= 2048;
  1741. if(j2 < -1024)
  1742. j2 += 2048;
  1743. if(j2 > 0)
  1744. {
  1745. xCameraCurve += anInt998 + (j2 * anInt999) / 1000;
  1746. xCameraCurve &= 0x7ff;
  1747. }
  1748. if(j2 < 0)
  1749. {
  1750. xCameraCurve -= anInt998 + (-j2 * anInt999) / 1000;
  1751. xCameraCurve &= 0x7ff;
  1752. }
  1753. int k2 = i2 - xCameraCurve;
  1754. if(k2 > 1024)
  1755. k2 -= 2048;
  1756. if(k2 < -1024)
  1757. k2 += 2048;
  1758. if(k2 < 0 && j2 > 0 || k2 > 0 && j2 < 0)
  1759. xCameraCurve = i2;
  1760. }
  1761.  
  1762. private void drawMenu()
  1763. {
  1764. int i = menuOffsetX;
  1765. int j = menuOffsetY;
  1766. int k = menuWidth;
  1767. int l = anInt952;
  1768. int i1 = 0x5d5447;
  1769. DrawingArea.method336(l, j, i, i1, k);
  1770. DrawingArea.method336(16, j + 1, i + 1, 0, k - 2);
  1771. DrawingArea.fillPixels(i + 1, k - 2, l - 19, 0, j + 18);
  1772. chatTextDrawingArea.method385(i1, "Choose Option", j + 14, i + 3);
  1773. int j1 = super.mouseX;
  1774. int k1 = super.mouseY;
  1775. if(menuScreenArea == 0)
  1776. {
  1777. j1 -= 4;
  1778. k1 -= 4;
  1779. }
  1780. if(menuScreenArea == 1)
  1781. {
  1782. j1 -= 553;
  1783. k1 -= 205;
  1784. }
  1785. if(menuScreenArea == 2)
  1786. {
  1787. j1 -= 17;
  1788. k1 -= 357;
  1789. }
  1790. for(int l1 = 0; l1 < menuActionRow; l1++)
  1791. {
  1792. int i2 = j + 31 + (menuActionRow - 1 - l1) * 15;
  1793. int j2 = 0xffffff;
  1794. if(j1 > i && j1 < i + k && k1 > i2 - 13 && k1 < i2 + 3)
  1795. j2 = 0xffff00;
  1796. chatTextDrawingArea.method389(true, i + 3, j2, menuActionName[l1], i2);
  1797. }
  1798.  
  1799. }
  1800.  
  1801. private void addFriend(long l)
  1802. {
  1803. try
  1804. {
  1805. if(l == 0L)
  1806. return;
  1807. if(friendsCount >= 100 && anInt1046 != 1)
  1808. {
  1809. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  1810. return;
  1811. }
  1812. if(friendsCount >= 200)
  1813. {
  1814. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  1815. return;
  1816. }
  1817. String s = TextClass.fixName(TextClass.nameForLong(l));
  1818. for(int i = 0; i < friendsCount; i++)
  1819. if(friendsListAsLongs[i] == l)
  1820. {
  1821. pushMessage(s + " is already on your friend list", 0, "");
  1822. return;
  1823. }
  1824. for(int j = 0; j < ignoreCount; j++)
  1825. if(ignoreListAsLongs[j] == l)
  1826. {
  1827. pushMessage("Please remove " + s + " from your ignore list first", 0, "");
  1828. return;
  1829. }
  1830.  
  1831. if(s.equals(myPlayer.name))
  1832. {
  1833. return;
  1834. } else
  1835. {
  1836. friendsList[friendsCount] = s;
  1837. friendsListAsLongs[friendsCount] = l;
  1838. friendsNodeIDs[friendsCount] = 0;
  1839. friendsCount++;
  1840. needDrawTabArea = true;
  1841. stream.sendPacket(188);
  1842. stream.addLong(l);
  1843. return;
  1844. }
  1845. }
  1846. catch(RuntimeException runtimeexception)
  1847. {
  1848. signlink.reporterror("15283, " + (byte)68 + ", " + l + ", " + runtimeexception.toString());
  1849. }
  1850. throw new RuntimeException();
  1851. }
  1852.  
  1853. private int method42(int i, int j, int k)
  1854. {
  1855. int l = k >> 7;
  1856. int i1 = j >> 7;
  1857. if(l < 0 || i1 < 0 || l > 103 || i1 > 103)
  1858. return 0;
  1859. int j1 = i;
  1860. if(j1 < 3 && (byteGroundArray[1][l][i1] & 2) == 2)
  1861. j1++;
  1862. int k1 = k & 0x7f;
  1863. int l1 = j & 0x7f;
  1864. int i2 = intGroundArray[j1][l][i1] * (128 - k1) + intGroundArray[j1][l + 1][i1] * k1 >> 7;
  1865. int j2 = intGroundArray[j1][l][i1 + 1] * (128 - k1) + intGroundArray[j1][l + 1][i1 + 1] * k1 >> 7;
  1866. return i2 * (128 - l1) + j2 * l1 >> 7;
  1867. }
  1868.  
  1869. private static String intToKOrMil(int j)
  1870. {
  1871. if(j < 0x186a0)
  1872. return String.valueOf(j);
  1873. if(j < 0x989680)
  1874. return j / 1000 + "K";
  1875. else
  1876. return j / 0xf4240 + "M";
  1877. }
  1878.  
  1879. private void resetLogout()
  1880. {
  1881. try
  1882. {
  1883. if(socketStream != null)
  1884. socketStream.close();
  1885. }
  1886. catch(Exception _ex) { }
  1887. socketStream = null;
  1888. loggedIn = false;
  1889. loginScreenState = 0;
  1890. // myUsername = "";
  1891. // myPassword = "";
  1892. unlinkMRUNodes();
  1893. worldController.initToNull();
  1894. for(int i = 0; i < 4; i++)
  1895. aClass11Array1230[i].method210();
  1896.  
  1897. System.gc();
  1898. stopMidi();
  1899. currentSong = -1;
  1900. nextSong = -1;
  1901. prevSong = 0;
  1902. }
  1903.  
  1904. private void method45()
  1905. {
  1906. aBoolean1031 = true;
  1907. for(int j = 0; j < 7; j++)
  1908. {
  1909. anIntArray1065[j] = -1;
  1910. for(int k = 0; k < IDK.length; k++)
  1911. {
  1912. if(IDK.cache[k].aBoolean662 || IDK.cache[k].anInt657 != j + (aBoolean1047 ? 0 : 7))
  1913. continue;
  1914. anIntArray1065[j] = k;
  1915. break;
  1916. }
  1917.  
  1918. }
  1919.  
  1920. }
  1921.  
  1922. private void method46(int i, Stream stream)
  1923. {
  1924. while(stream.bitPosition + 21 < i * 8)
  1925. {
  1926. int k = stream.readBits(14);
  1927. if(k == 16383)
  1928. break;
  1929. if(npcArray[k] == null)
  1930. npcArray[k] = new NPC();
  1931. NPC npc = npcArray[k];
  1932. npcIndices[npcCount++] = k;
  1933. npc.anInt1537 = loopCycle;
  1934. int l = stream.readBits(5);
  1935. if(l > 15)
  1936. l -= 32;
  1937. int i1 = stream.readBits(5);
  1938. if(i1 > 15)
  1939. i1 -= 32;
  1940. int j1 = stream.readBits(1);
  1941. npc.desc = EntityDef.forID(stream.readBits(12));
  1942. int k1 = stream.readBits(1);
  1943. if(k1 == 1)
  1944. anIntArray894[anInt893++] = k;
  1945. npc.anInt1540 = npc.desc.aByte68;
  1946. npc.anInt1504 = npc.desc.anInt79;
  1947. npc.anInt1554 = npc.desc.anInt67;
  1948. npc.anInt1555 = npc.desc.anInt58;
  1949. npc.anInt1556 = npc.desc.anInt83;
  1950. npc.anInt1557 = npc.desc.anInt55;
  1951. npc.anInt1511 = npc.desc.anInt77;
  1952. npc.setPos(myPlayer.smallX[0] + i1, myPlayer.smallY[0] + l, j1 == 1);
  1953. }
  1954. stream.finishBitAccess();
  1955. }
  1956.  
  1957. public void processGameLoop()
  1958. {
  1959. if(rsAlreadyLoaded || loadingError || genericLoadingError)
  1960. return;
  1961. loopCycle++;
  1962. if(!loggedIn)
  1963. processLoginScreenInput();
  1964. else
  1965. mainGameProcessor();
  1966. processOnDemandQueue();
  1967. }
  1968.  
  1969. private void method47(boolean flag)
  1970. {
  1971. if(myPlayer.x >> 7 == destX && myPlayer.y >> 7 == destY)
  1972. destX = 0;
  1973. int j = playerCount;
  1974. if(flag)
  1975. j = 1;
  1976. for(int l = 0; l < j; l++)
  1977. {
  1978. Player player;
  1979. int i1;
  1980. if(flag)
  1981. {
  1982. player = myPlayer;
  1983. i1 = myPlayerIndex << 14;
  1984. } else
  1985. {
  1986. player = playerArray[playerIndices[l]];
  1987. i1 = playerIndices[l] << 14;
  1988. }
  1989. if(player == null || !player.isVisible())
  1990. continue;
  1991. player.aBoolean1699 = (lowMem && playerCount > 50 || playerCount > 200) && !flag && player.anInt1517 == player.anInt1511;
  1992. int j1 = player.x >> 7;
  1993. int k1 = player.y >> 7;
  1994. if(j1 < 0 || j1 >= 104 || k1 < 0 || k1 >= 104)
  1995. continue;
  1996. if(player.aModel_1714 != null && loopCycle >= player.anInt1707 && loopCycle < player.anInt1708)
  1997. {
  1998. player.aBoolean1699 = false;
  1999. player.anInt1709 = method42(plane, player.y, player.x);
  2000. worldController.method286(plane, player.y, player, player.anInt1552, player.anInt1722, player.x, player.anInt1709, player.anInt1719, player.anInt1721, i1, player.anInt1720);
  2001. continue;
  2002. }
  2003. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64)
  2004. {
  2005. if(anIntArrayArray929[j1][k1] == anInt1265)
  2006. continue;
  2007. anIntArrayArray929[j1][k1] = anInt1265;
  2008. }
  2009. player.anInt1709 = method42(plane, player.y, player.x);
  2010. worldController.method285(plane, player.anInt1552, player.anInt1709, i1, player.y, 60, player.x, player, player.aBoolean1541);
  2011. }
  2012.  
  2013. }
  2014.  
  2015. private boolean promptUserForInput(RSInterface class9)
  2016. {
  2017. int j = class9.anInt214;
  2018. if(anInt900 == 2)
  2019. {
  2020. if(j == 201)
  2021. {
  2022. inputTaken = true;
  2023. inputDialogState = 0;
  2024. messagePromptRaised = true;
  2025. promptInput = "";
  2026. friendsListAction = 1;
  2027. aString1121 = "Enter name of friend to add to list";
  2028. }
  2029. if(j == 202)
  2030. {
  2031. inputTaken = true;
  2032. inputDialogState = 0;
  2033. messagePromptRaised = true;
  2034. promptInput = "";
  2035. friendsListAction = 2;
  2036. aString1121 = "Enter name of friend to delete from list";
  2037. }
  2038. }
  2039. if(j == 205)
  2040. {
  2041. anInt1011 = 250;
  2042. return true;
  2043. }
  2044. if(j == 501)
  2045. {
  2046. inputTaken = true;
  2047. inputDialogState = 0;
  2048. messagePromptRaised = true;
  2049. promptInput = "";
  2050. friendsListAction = 4;
  2051. aString1121 = "Enter name of player to add to list";
  2052. }
  2053. if(j == 502)
  2054. {
  2055. inputTaken = true;
  2056. inputDialogState = 0;
  2057. messagePromptRaised = true;
  2058. promptInput = "";
  2059. friendsListAction = 5;
  2060. aString1121 = "Enter name of player to delete from list";
  2061. }
  2062. if(j >= 300 && j <= 313)
  2063. {
  2064. int k = (j - 300) / 2;
  2065. int j1 = j & 1;
  2066. int i2 = anIntArray1065[k];
  2067. if(i2 != -1)
  2068. {
  2069. do
  2070. {
  2071. if(j1 == 0 && --i2 < 0)
  2072. i2 = IDK.length - 1;
  2073. if(j1 == 1 && ++i2 >= IDK.length)
  2074. i2 = 0;
  2075. } while(IDK.cache[i2].aBoolean662 || IDK.cache[i2].anInt657 != k + (aBoolean1047 ? 0 : 7));
  2076. anIntArray1065[k] = i2;
  2077. aBoolean1031 = true;
  2078. }
  2079. }
  2080. if(j >= 314 && j <= 323)
  2081. {
  2082. int l = (j - 314) / 2;
  2083. int k1 = j & 1;
  2084. int j2 = anIntArray990[l];
  2085. if(k1 == 0 && --j2 < 0)
  2086. j2 = anIntArrayArray1003[l].length - 1;
  2087. if(k1 == 1 && ++j2 >= anIntArrayArray1003[l].length)
  2088. j2 = 0;
  2089. anIntArray990[l] = j2;
  2090. aBoolean1031 = true;
  2091. }
  2092. if(j == 324 && !aBoolean1047)
  2093. {
  2094. aBoolean1047 = true;
  2095. method45();
  2096. }
  2097. if(j == 325 && aBoolean1047)
  2098. {
  2099. aBoolean1047 = false;
  2100. method45();
  2101. }
  2102. if(j == 326)
  2103. {
  2104. stream.sendPacket(101);
  2105. stream.addByte(aBoolean1047 ? 0 : 1);
  2106. for(int i1 = 0; i1 < 7; i1++)
  2107. stream.addByte(anIntArray1065[i1]);
  2108.  
  2109. for(int l1 = 0; l1 < 5; l1++)
  2110. stream.addByte(anIntArray990[l1]);
  2111.  
  2112. return true;
  2113. }
  2114. if(j == 613)
  2115. canMute = !canMute;
  2116. if(j >= 601 && j <= 612)
  2117. {
  2118. clearTopInterfaces();
  2119. if(reportAbuseInput.length() > 0)
  2120. {
  2121. stream.sendPacket(218);
  2122. stream.addLong(TextClass.longForName(reportAbuseInput));
  2123. stream.addByte(j - 601);
  2124. stream.addByte(canMute ? 1 : 0);
  2125. }
  2126. }
  2127. return false;
  2128. }
  2129.  
  2130. private void updateMasks(Stream stream)
  2131. {
  2132. for(int j = 0; j < anInt893; j++)
  2133. {
  2134. int k = anIntArray894[j];
  2135. Player player = playerArray[k];
  2136. int l = stream.readUnsignedByte();
  2137. if((l & 0x40) != 0)
  2138. l += stream.readUnsignedByte() << 8;
  2139. method107(l, k, stream, player);
  2140. }
  2141.  
  2142. }
  2143.  
  2144. private void method50(int i, int k, int l, int i1, int j1)
  2145. {
  2146. int k1 = worldController.method300(j1, l, i);
  2147. if(k1 != 0)
  2148. {
  2149. int l1 = worldController.method304(j1, l, i, k1);
  2150. int k2 = l1 >> 6 & 3;
  2151. int i3 = l1 & 0x1f;
  2152. int k3 = k;
  2153. if(k1 > 0)
  2154. k3 = i1;
  2155. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  2156. int k4 = 24624 + l * 4 + (103 - i) * 512 * 4;
  2157. int i5 = k1 >> 14 & 0x7fff;
  2158. ObjectDef class46_2 = ObjectDef.forID(i5);
  2159. if(class46_2.anInt758 != -1)
  2160. {
  2161. Background background_2 = mapScenes[class46_2.anInt758];
  2162. if(background_2 != null)
  2163. {
  2164. int i6 = (class46_2.anInt744 * 4 - background_2.anInt1452) / 2;
  2165. int j6 = (class46_2.anInt761 * 4 - background_2.anInt1453) / 2;
  2166. background_2.method361(48 + l * 4 + i6, 48 + (104 - i - class46_2.anInt761) * 4 + j6);
  2167. }
  2168. } else
  2169. {
  2170. if(i3 == 0 || i3 == 2)
  2171. if(k2 == 0)
  2172. {
  2173. ai[k4] = k3;
  2174. ai[k4 + 512] = k3;
  2175. ai[k4 + 1024] = k3;
  2176. ai[k4 + 1536] = k3;
  2177. } else
  2178. if(k2 == 1)
  2179. {
  2180. ai[k4] = k3;
  2181. ai[k4 + 1] = k3;
  2182. ai[k4 + 2] = k3;
  2183. ai[k4 + 3] = k3;
  2184. } else
  2185. if(k2 == 2)
  2186. {
  2187. ai[k4 + 3] = k3;
  2188. ai[k4 + 3 + 512] = k3;
  2189. ai[k4 + 3 + 1024] = k3;
  2190. ai[k4 + 3 + 1536] = k3;
  2191. } else
  2192. if(k2 == 3)
  2193. {
  2194. ai[k4 + 1536] = k3;
  2195. ai[k4 + 1536 + 1] = k3;
  2196. ai[k4 + 1536 + 2] = k3;
  2197. ai[k4 + 1536 + 3] = k3;
  2198. }
  2199. if(i3 == 3)
  2200. if(k2 == 0)
  2201. ai[k4] = k3;
  2202. else
  2203. if(k2 == 1)
  2204. ai[k4 + 3] = k3;
  2205. else
  2206. if(k2 == 2)
  2207. ai[k4 + 3 + 1536] = k3;
  2208. else
  2209. if(k2 == 3)
  2210. ai[k4 + 1536] = k3;
  2211. if(i3 == 2)
  2212. if(k2 == 3)
  2213. {
  2214. ai[k4] = k3;
  2215. ai[k4 + 512] = k3;
  2216. ai[k4 + 1024] = k3;
  2217. ai[k4 + 1536] = k3;
  2218. } else
  2219. if(k2 == 0)
  2220. {
  2221. ai[k4] = k3;
  2222. ai[k4 + 1] = k3;
  2223. ai[k4 + 2] = k3;
  2224. ai[k4 + 3] = k3;
  2225. } else
  2226. if(k2 == 1)
  2227. {
  2228. ai[k4 + 3] = k3;
  2229. ai[k4 + 3 + 512] = k3;
  2230. ai[k4 + 3 + 1024] = k3;
  2231. ai[k4 + 3 + 1536] = k3;
  2232. } else
  2233. if(k2 == 2)
  2234. {
  2235. ai[k4 + 1536] = k3;
  2236. ai[k4 + 1536 + 1] = k3;
  2237. ai[k4 + 1536 + 2] = k3;
  2238. ai[k4 + 1536 + 3] = k3;
  2239. }
  2240. }
  2241. }
  2242. k1 = worldController.method302(j1, l, i);
  2243. if(k1 != 0)
  2244. {
  2245. int i2 = worldController.method304(j1, l, i, k1);
  2246. int l2 = i2 >> 6 & 3;
  2247. int j3 = i2 & 0x1f;
  2248. int l3 = k1 >> 14 & 0x7fff;
  2249. ObjectDef class46_1 = ObjectDef.forID(l3);
  2250. if(class46_1.anInt758 != -1)
  2251. {
  2252. Background background_1 = mapScenes[class46_1.anInt758];
  2253. if(background_1 != null)
  2254. {
  2255. int j5 = (class46_1.anInt744 * 4 - background_1.anInt1452) / 2;
  2256. int k5 = (class46_1.anInt761 * 4 - background_1.anInt1453) / 2;
  2257. background_1.method361(48 + l * 4 + j5, 48 + (104 - i - class46_1.anInt761) * 4 + k5);
  2258. }
  2259. } else
  2260. if(j3 == 9)
  2261. {
  2262. int l4 = 0xeeeeee;
  2263. if(k1 > 0)
  2264. l4 = 0xee0000;
  2265. int ai1[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  2266. int l5 = 24624 + l * 4 + (103 - i) * 512 * 4;
  2267. if(l2 == 0 || l2 == 2)
  2268. {
  2269. ai1[l5 + 1536] = l4;
  2270. ai1[l5 + 1024 + 1] = l4;
  2271. ai1[l5 + 512 + 2] = l4;
  2272. ai1[l5 + 3] = l4;
  2273. } else
  2274. {
  2275. ai1[l5] = l4;
  2276. ai1[l5 + 512 + 1] = l4;
  2277. ai1[l5 + 1024 + 2] = l4;
  2278. ai1[l5 + 1536 + 3] = l4;
  2279. }
  2280. }
  2281. }
  2282. k1 = worldController.method303(j1, l, i);
  2283. if(k1 != 0)
  2284. {
  2285. int j2 = k1 >> 14 & 0x7fff;
  2286. ObjectDef class46 = ObjectDef.forID(j2);
  2287. if(class46.anInt758 != -1)
  2288. {
  2289. Background background = mapScenes[class46.anInt758];
  2290. if(background != null)
  2291. {
  2292. int i4 = (class46.anInt744 * 4 - background.anInt1452) / 2;
  2293. int j4 = (class46.anInt761 * 4 - background.anInt1453) / 2;
  2294. background.method361(48 + l * 4 + i4, 48 + (104 - i - class46.anInt761) * 4 + j4);
  2295. }
  2296. }
  2297. }
  2298. }
  2299.  
  2300. private void loadTitleScreen()
  2301. {
  2302. aBackground_966 = new Background(titleStreamLoader, "titlebox", 0);
  2303. aBackground_967 = new Background(titleStreamLoader, "titlebutton", 0);
  2304. aBackgroundArray1152s = new Background[12];
  2305. int j = 0;
  2306. try
  2307. {
  2308. j = Integer.parseInt(getParameter("fl_icon"));
  2309. }
  2310. catch(Exception _ex) { }
  2311. if(j == 0)
  2312. {
  2313. for(int k = 0; k < 12; k++)
  2314. aBackgroundArray1152s[k] = new Background(titleStreamLoader, "runes", k);
  2315.  
  2316. } else
  2317. {
  2318. for(int l = 0; l < 12; l++)
  2319. aBackgroundArray1152s[l] = new Background(titleStreamLoader, "runes", 12 + (l & 3));
  2320.  
  2321. }
  2322. aClass30_Sub2_Sub1_Sub1_1201 = new Sprite(128, 265);
  2323. aClass30_Sub2_Sub1_Sub1_1202 = new Sprite(128, 265);
  2324. System.arraycopy(aRSImageProducer_1110.anIntArray315, 0, aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, 33920);
  2325.  
  2326. System.arraycopy(aRSImageProducer_1111.anIntArray315, 0, aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, 33920);
  2327.  
  2328. anIntArray851 = new int[256];
  2329. for(int k1 = 0; k1 < 64; k1++)
  2330. anIntArray851[k1] = k1 * 0x40000;
  2331.  
  2332. for(int l1 = 0; l1 < 64; l1++)
  2333. anIntArray851[l1 + 64] = 0xff0000 + 1024 * l1;
  2334.  
  2335. for(int i2 = 0; i2 < 64; i2++)
  2336. anIntArray851[i2 + 128] = 0xffff00 + 4 * i2;
  2337.  
  2338. for(int j2 = 0; j2 < 64; j2++)
  2339. anIntArray851[j2 + 192] = 0xffffff;
  2340.  
  2341. anIntArray852 = new int[256];
  2342. for(int k2 = 0; k2 < 64; k2++)
  2343. anIntArray852[k2] = k2 * 1024;
  2344.  
  2345. for(int l2 = 0; l2 < 64; l2++)
  2346. anIntArray852[l2 + 64] = 65280 + 4 * l2;
  2347.  
  2348. for(int i3 = 0; i3 < 64; i3++)
  2349. anIntArray852[i3 + 128] = 65535 + 0x40000 * i3;
  2350.  
  2351. for(int j3 = 0; j3 < 64; j3++)
  2352. anIntArray852[j3 + 192] = 0xffffff;
  2353.  
  2354. anIntArray853 = new int[256];
  2355. for(int k3 = 0; k3 < 64; k3++)
  2356. anIntArray853[k3] = k3 * 4;
  2357.  
  2358. for(int l3 = 0; l3 < 64; l3++)
  2359. anIntArray853[l3 + 64] = 255 + 0x40000 * l3;
  2360.  
  2361. for(int i4 = 0; i4 < 64; i4++)
  2362. anIntArray853[i4 + 128] = 0xff00ff + 1024 * i4;
  2363.  
  2364. for(int j4 = 0; j4 < 64; j4++)
  2365. anIntArray853[j4 + 192] = 0xffffff;
  2366.  
  2367. anIntArray850 = new int[256];
  2368. anIntArray1190 = new int[32768];
  2369. anIntArray1191 = new int[32768];
  2370. randomizeBackground(null);
  2371. anIntArray828 = new int[32768];
  2372. anIntArray829 = new int[32768];
  2373. drawLoadingText(10, "Connecting to fileserver");
  2374. if(!aBoolean831)
  2375. {
  2376. drawFlames = true;
  2377. aBoolean831 = true;
  2378. startRunnable(this, 2);
  2379. }
  2380. }
  2381.  
  2382. private static void setHighMem()
  2383. {
  2384. WorldController.lowMem = false;
  2385. Texture.lowMem = false;
  2386. lowMem = false;
  2387. ObjectManager.lowMem = false;
  2388. ObjectDef.lowMem = false;
  2389. }
  2390.  
  2391. public static void main(String args[])
  2392. {
  2393. try
  2394. {
  2395. System.out.println("RS2 user client - release #" + 317);
  2396. if(args.length != 5)
  2397. {
  2398. System.out.println("Usage: node-id, port-offset, [lowmem/highmem], [free/members], storeid");
  2399. return;
  2400. }
  2401. nodeID = Integer.parseInt(args[0]);
  2402. portOff = Integer.parseInt(args[1]);
  2403. if(args[2].equals("lowmem"))
  2404. setLowMem();
  2405. else
  2406. if(args[2].equals("highmem"))
  2407. {
  2408. setHighMem();
  2409. } else
  2410. {
  2411. System.out.println("Usage: node-id, port-offset, [lowmem/highmem], [free/members], storeid");
  2412. return;
  2413. }
  2414. if(args[3].equals("free"))
  2415. isMembers = false;
  2416. else
  2417. if(args[3].equals("members"))
  2418. {
  2419. isMembers = true;
  2420. } else
  2421. {
  2422. System.out.println("Usage: node-id, port-offset, [lowmem/highmem], [free/members], storeid");
  2423. return;
  2424. }
  2425. signlink.storeid = Integer.parseInt(args[4]);
  2426. signlink.startpriv(InetAddress.getLocalHost());
  2427. client client1 = new client();
  2428. client1.createClientFrame(503, 765);
  2429. }
  2430. catch(Exception exception)
  2431. {
  2432. }
  2433. }
  2434.  
  2435. private void loadingStages()
  2436. {
  2437. if(lowMem && loadingStage == 2 && ObjectManager.anInt131 != plane)
  2438. {
  2439. aRSImageProducer_1165.initDrawingArea();
  2440. aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151, 257);
  2441. aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.", 150, 256);
  2442. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  2443. loadingStage = 1;
  2444. aLong824 = System.currentTimeMillis();
  2445. }
  2446. if(loadingStage == 1)
  2447. {
  2448. int j = method54();
  2449. if(j != 0 && System.currentTimeMillis() - aLong824 > 0x57e40L)
  2450. {
  2451. signlink.reporterror(myUsername + " glcfb " + aLong1215 + "," + j + "," + lowMem + "," + decompressors[0] + "," + onDemandFetcher.getNodeCount() + "," + plane + "," + anInt1069 + "," + anInt1070);
  2452. aLong824 = System.currentTimeMillis();
  2453. }
  2454. }
  2455. if(loadingStage == 2 && plane != anInt985)
  2456. {
  2457. anInt985 = plane;
  2458. method24(plane);
  2459. }
  2460. }
  2461.  
  2462. private int method54()
  2463. {
  2464. for(int i = 0; i < aByteArrayArray1183.length; i++)
  2465. {
  2466. if(aByteArrayArray1183[i] == null && anIntArray1235[i] != -1)
  2467. return -1;
  2468. if(aByteArrayArray1247[i] == null && anIntArray1236[i] != -1)
  2469. return -2;
  2470. }
  2471.  
  2472. boolean flag = true;
  2473. for(int j = 0; j < aByteArrayArray1183.length; j++)
  2474. {
  2475. byte abyte0[] = aByteArrayArray1247[j];
  2476. if(abyte0 != null)
  2477. {
  2478. int k = (anIntArray1234[j] >> 8) * 64 - baseX;
  2479. int l = (anIntArray1234[j] & 0xff) * 64 - baseY;
  2480. if(aBoolean1159)
  2481. {
  2482. k = 10;
  2483. l = 10;
  2484. }
  2485. flag &= ObjectManager.method189(k, abyte0, l);
  2486. }
  2487. }
  2488.  
  2489. if(!flag)
  2490. return -3;
  2491. if(aBoolean1080)
  2492. {
  2493. return -4;
  2494. } else
  2495. {
  2496. loadingStage = 2;
  2497. ObjectManager.anInt131 = plane;
  2498. method22();
  2499. stream.sendPacket(121);
  2500. return 0;
  2501. }
  2502. }
  2503.  
  2504. private void method55()
  2505. {
  2506. 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())
  2507. if(class30_sub2_sub4_sub4.anInt1597 != plane || loopCycle > class30_sub2_sub4_sub4.anInt1572)
  2508. class30_sub2_sub4_sub4.unlink();
  2509. else
  2510. if(loopCycle >= class30_sub2_sub4_sub4.anInt1571)
  2511. {
  2512. if(class30_sub2_sub4_sub4.anInt1590 > 0)
  2513. {
  2514. NPC npc = npcArray[class30_sub2_sub4_sub4.anInt1590 - 1];
  2515. if(npc != null && npc.x >= 0 && npc.x < 13312 && npc.y >= 0 && npc.y < 13312)
  2516. 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);
  2517. }
  2518. if(class30_sub2_sub4_sub4.anInt1590 < 0)
  2519. {
  2520. int j = -class30_sub2_sub4_sub4.anInt1590 - 1;
  2521. Player player;
  2522. if(j == unknownInt10)
  2523. player = myPlayer;
  2524. else
  2525. player = playerArray[j];
  2526. if(player != null && player.x >= 0 && player.x < 13312 && player.y >= 0 && player.y < 13312)
  2527. 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);
  2528. }
  2529. class30_sub2_sub4_sub4.method456(anInt945);
  2530. 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);
  2531. }
  2532.  
  2533. }
  2534.  
  2535. public AppletContext getAppletContext()
  2536. {
  2537. if(signlink.mainapp != null)
  2538. return signlink.mainapp.getAppletContext();
  2539. else
  2540. return super.getAppletContext();
  2541. }
  2542.  
  2543. private void drawLogo()
  2544. {
  2545. byte abyte0[] = titleStreamLoader.getDataForName("title.dat");
  2546. Sprite sprite = new Sprite(abyte0, this);
  2547. aRSImageProducer_1110.initDrawingArea();
  2548. sprite.method346(0, 0);
  2549. aRSImageProducer_1111.initDrawingArea();
  2550. sprite.method346(-637, 0);
  2551. aRSImageProducer_1107.initDrawingArea();
  2552. sprite.method346(-128, 0);
  2553. aRSImageProducer_1108.initDrawingArea();
  2554. sprite.method346(-202, -371);
  2555. aRSImageProducer_1109.initDrawingArea();
  2556. sprite.method346(-202, -171);
  2557. aRSImageProducer_1112.initDrawingArea();
  2558. sprite.method346(0, -265);
  2559. aRSImageProducer_1113.initDrawingArea();
  2560. sprite.method346(-562, -265);
  2561. aRSImageProducer_1114.initDrawingArea();
  2562. sprite.method346(-128, -171);
  2563. aRSImageProducer_1115.initDrawingArea();
  2564. sprite.method346(-562, -171);
  2565. int ai[] = new int[sprite.myWidth];
  2566. for(int j = 0; j < sprite.myHeight; j++)
  2567. {
  2568. for(int k = 0; k < sprite.myWidth; k++)
  2569. ai[k] = sprite.myPixels[(sprite.myWidth - k - 1) + sprite.myWidth * j];
  2570.  
  2571. System.arraycopy(ai, 0, sprite.myPixels, sprite.myWidth * j, sprite.myWidth);
  2572.  
  2573. }
  2574.  
  2575. aRSImageProducer_1110.initDrawingArea();
  2576. sprite.method346(382, 0);
  2577. aRSImageProducer_1111.initDrawingArea();
  2578. sprite.method346(-255, 0);
  2579. aRSImageProducer_1107.initDrawingArea();
  2580. sprite.method346(254, 0);
  2581. aRSImageProducer_1108.initDrawingArea();
  2582. sprite.method346(180, -371);
  2583. aRSImageProducer_1109.initDrawingArea();
  2584. sprite.method346(180, -171);
  2585. aRSImageProducer_1112.initDrawingArea();
  2586. sprite.method346(382, -265);
  2587. aRSImageProducer_1113.initDrawingArea();
  2588. sprite.method346(-180, -265);
  2589. aRSImageProducer_1114.initDrawingArea();
  2590. sprite.method346(254, -171);
  2591. aRSImageProducer_1115.initDrawingArea();
  2592. sprite.method346(-180, -171);
  2593. sprite = new Sprite(titleStreamLoader, "logo", 0);
  2594. aRSImageProducer_1107.initDrawingArea();
  2595. sprite.drawSprite(382 - sprite.myWidth / 2 - 128, 18);
  2596. sprite = null;
  2597. Object obj = null;
  2598. Object obj1 = null;
  2599. System.gc();
  2600.  
  2601. }
  2602.  
  2603. private void processOnDemandQueue()
  2604. {
  2605. do
  2606. {
  2607. OnDemandData onDemandData;
  2608. do
  2609. {
  2610. onDemandData = onDemandFetcher.getNextNode();
  2611. if(onDemandData == null)
  2612. return;
  2613. if(onDemandData.dataType == 0)
  2614. {
  2615. Model.method460(onDemandData.buffer, onDemandData.ID);
  2616. if((onDemandFetcher.getModelIndex(onDemandData.ID) & 0x62) != 0)
  2617. {
  2618. needDrawTabArea = true;
  2619. if(backDialogID != -1)
  2620. inputTaken = true;
  2621. }
  2622. }
  2623. if(onDemandData.dataType == 1 && onDemandData.buffer != null)
  2624. Class36.method529(onDemandData.buffer);
  2625. if(onDemandData.dataType == 2 && onDemandData.ID == nextSong && onDemandData.buffer != null)
  2626. saveMidi(songChanging, onDemandData.buffer);
  2627. if(onDemandData.dataType == 3 && loadingStage == 1)
  2628. {
  2629. for(int i = 0; i < aByteArrayArray1183.length; i++)
  2630. {
  2631. if(anIntArray1235[i] == onDemandData.ID)
  2632. {
  2633. aByteArrayArray1183[i] = onDemandData.buffer;
  2634. if(onDemandData.buffer == null)
  2635. anIntArray1235[i] = -1;
  2636. break;
  2637. }
  2638. if(anIntArray1236[i] != onDemandData.ID)
  2639. continue;
  2640. aByteArrayArray1247[i] = onDemandData.buffer;
  2641. if(onDemandData.buffer == null)
  2642. anIntArray1236[i] = -1;
  2643. break;
  2644. }
  2645.  
  2646. }
  2647. } while(onDemandData.dataType != 93 || !onDemandFetcher.method564(onDemandData.ID));
  2648. ObjectManager.method173(new Stream(onDemandData.buffer), onDemandFetcher);
  2649. } while(true);
  2650. }
  2651.  
  2652. private void calcFlamesPosition()
  2653. {
  2654. char c = '\u0100';
  2655. for(int j = 10; j < 117; j++)
  2656. {
  2657. int k = (int)(Math.random() * 100D);
  2658. if(k < 50)
  2659. anIntArray828[j + (c - 2 << 7)] = 255;
  2660. }
  2661. for(int l = 0; l < 100; l++)
  2662. {
  2663. int i1 = (int)(Math.random() * 124D) + 2;
  2664. int k1 = (int)(Math.random() * 128D) + 128;
  2665. int k2 = i1 + (k1 << 7);
  2666. anIntArray828[k2] = 192;
  2667. }
  2668.  
  2669. for(int j1 = 1; j1 < c - 1; j1++)
  2670. {
  2671. for(int l1 = 1; l1 < 127; l1++)
  2672. {
  2673. int l2 = l1 + (j1 << 7);
  2674. anIntArray829[l2] = (anIntArray828[l2 - 1] + anIntArray828[l2 + 1] + anIntArray828[l2 - 128] + anIntArray828[l2 + 128]) / 4;
  2675. }
  2676.  
  2677. }
  2678.  
  2679. anInt1275 += 128;
  2680. if(anInt1275 > anIntArray1190.length)
  2681. {
  2682. anInt1275 -= anIntArray1190.length;
  2683. int i2 = (int)(Math.random() * 12D);
  2684. randomizeBackground(aBackgroundArray1152s[i2]);
  2685. }
  2686. for(int j2 = 1; j2 < c - 1; j2++)
  2687. {
  2688. for(int i3 = 1; i3 < 127; i3++)
  2689. {
  2690. int k3 = i3 + (j2 << 7);
  2691. int i4 = anIntArray829[k3 + 128] - anIntArray1190[k3 + anInt1275 & anIntArray1190.length - 1] / 5;
  2692. if(i4 < 0)
  2693. i4 = 0;
  2694. anIntArray828[k3] = i4;
  2695. }
  2696.  
  2697. }
  2698.  
  2699. System.arraycopy(anIntArray969, 1, anIntArray969, 0, c - 1);
  2700.  
  2701. anIntArray969[c - 1] = (int)(Math.sin((double)loopCycle / 14D) * 16D + Math.sin((double)loopCycle / 15D) * 14D + Math.sin((double)loopCycle / 16D) * 12D);
  2702. if(anInt1040 > 0)
  2703. anInt1040 -= 4;
  2704. if(anInt1041 > 0)
  2705. anInt1041 -= 4;
  2706. if(anInt1040 == 0 && anInt1041 == 0)
  2707. {
  2708. int l3 = (int)(Math.random() * 2000D);
  2709. if(l3 == 0)
  2710. anInt1040 = 1024;
  2711. if(l3 == 1)
  2712. anInt1041 = 1024;
  2713. }
  2714. }
  2715.  
  2716. private boolean saveWave(byte abyte0[], int i)
  2717. {
  2718. return abyte0 == null || signlink.wavesave(abyte0, i);
  2719. }
  2720.  
  2721. private void method60(int i)
  2722. {
  2723. RSInterface class9 = RSInterface.interfaceCache[i];
  2724. for(int j = 0; j < class9.children.length; j++)
  2725. {
  2726. if(class9.children[j] == -1)
  2727. break;
  2728. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j]];
  2729. if(class9_1.type == 1)
  2730. method60(class9_1.id);
  2731. class9_1.anInt246 = 0;
  2732. class9_1.anInt208 = 0;
  2733. }
  2734. }
  2735.  
  2736. private void drawHeadIcon()
  2737. {
  2738. if(anInt855 != 2)
  2739. return;
  2740. calcEntityScreenPos((anInt934 - baseX << 7) + anInt937, anInt936 * 2, (anInt935 - baseY << 7) + anInt938);
  2741. if(spriteDrawX > -1 && loopCycle % 20 < 10)
  2742. headIcons[2].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  2743. }
  2744.  
  2745. private void mainGameProcessor()
  2746. {
  2747. if(anInt1104 > 1)
  2748. anInt1104--;
  2749. if(anInt1011 > 0)
  2750. anInt1011--;
  2751. for(int j = 0; j < 5; j++)
  2752. if(!parsePacket())
  2753. break;
  2754.  
  2755. if(!loggedIn)
  2756. return;
  2757. synchronized(mouseDetection.syncObject)
  2758. {
  2759. if(flagged)
  2760. {
  2761. if(super.clickMode3 != 0 || mouseDetection.coordsIndex >= 40)
  2762. {
  2763. stream.sendPacket(45);
  2764. stream.addByte(0);
  2765. int j2 = stream.currentOffset;
  2766. int j3 = 0;
  2767. for(int j4 = 0; j4 < mouseDetection.coordsIndex; j4++)
  2768. {
  2769. if(j2 - stream.currentOffset >= 240)
  2770. break;
  2771. j3++;
  2772. int l4 = mouseDetection.coordsY[j4];
  2773. if(l4 < 0)
  2774. l4 = 0;
  2775. else
  2776. if(l4 > 502)
  2777. l4 = 502;
  2778. int k5 = mouseDetection.coordsX[j4];
  2779. if(k5 < 0)
  2780. k5 = 0;
  2781. else
  2782. if(k5 > 764)
  2783. k5 = 764;
  2784. int i6 = l4 * 765 + k5;
  2785. if(mouseDetection.coordsY[j4] == -1 && mouseDetection.coordsX[j4] == -1)
  2786. {
  2787. k5 = -1;
  2788. l4 = -1;
  2789. i6 = 0x7ffff;
  2790. }
  2791. if(k5 == anInt1237 && l4 == anInt1238)
  2792. {
  2793. if(anInt1022 < 2047)
  2794. anInt1022++;
  2795. } else
  2796. {
  2797. int j6 = k5 - anInt1237;
  2798. anInt1237 = k5;
  2799. int k6 = l4 - anInt1238;
  2800. anInt1238 = l4;
  2801. if(anInt1022 < 8 && j6 >= -32 && j6 <= 31 && k6 >= -32 && k6 <= 31)
  2802. {
  2803. j6 += 32;
  2804. k6 += 32;
  2805. stream.addShort((anInt1022 << 12) + (j6 << 6) + k6);
  2806. anInt1022 = 0;
  2807. } else
  2808. if(anInt1022 < 8)
  2809. {
  2810. stream.addTriByte(0x800000 + (anInt1022 << 19) + i6);
  2811. anInt1022 = 0;
  2812. } else
  2813. {
  2814. stream.addInt(0xc0000000 + (anInt1022 << 19) + i6);
  2815. anInt1022 = 0;
  2816. }
  2817. }
  2818. }
  2819.  
  2820. stream.writeBytes(stream.currentOffset - j2);
  2821. if(j3 >= mouseDetection.coordsIndex)
  2822. {
  2823. mouseDetection.coordsIndex = 0;
  2824. } else
  2825. {
  2826. mouseDetection.coordsIndex -= j3;
  2827. for(int i5 = 0; i5 < mouseDetection.coordsIndex; i5++)
  2828. {
  2829. mouseDetection.coordsX[i5] = mouseDetection.coordsX[i5 + j3];
  2830. mouseDetection.coordsY[i5] = mouseDetection.coordsY[i5 + j3];
  2831. }
  2832.  
  2833. }
  2834. }
  2835. } else
  2836. {
  2837. mouseDetection.coordsIndex = 0;
  2838. }
  2839. }
  2840. if(super.clickMode3 != 0)
  2841. {
  2842. long l = (super.aLong29 - aLong1220) / 50L;
  2843. if(l > 4095L)
  2844. l = 4095L;
  2845. aLong1220 = super.aLong29;
  2846. int k2 = super.saveClickY;
  2847. if(k2 < 0)
  2848. k2 = 0;
  2849. else
  2850. if(k2 > 502)
  2851. k2 = 502;
  2852. int k3 = super.saveClickX;
  2853. if(k3 < 0)
  2854. k3 = 0;
  2855. else
  2856. if(k3 > 764)
  2857. k3 = 764;
  2858. int k4 = k2 * 765 + k3;
  2859. int j5 = 0;
  2860. if(super.clickMode3 == 2)
  2861. j5 = 1;
  2862. int l5 = (int)l;
  2863. stream.sendPacket(241);
  2864. stream.addInt((l5 << 20) + (j5 << 19) + k4);
  2865. }
  2866. if(anInt1016 > 0)
  2867. anInt1016--;
  2868. if(super.keyArray[1] == 1 || super.keyArray[2] == 1 || super.keyArray[3] == 1 || super.keyArray[4] == 1)
  2869. aBoolean1017 = true;
  2870. if(aBoolean1017 && anInt1016 <= 0)
  2871. {
  2872. anInt1016 = 20;
  2873. aBoolean1017 = false;
  2874. stream.sendPacket(86);
  2875. stream.addShort(anInt1184);
  2876. stream.method432(minimapInt1);
  2877. }
  2878. if(super.awtFocus && !aBoolean954)
  2879. {
  2880. aBoolean954 = true;
  2881. stream.sendPacket(3);
  2882. stream.addByte(1);
  2883. }
  2884. if(!super.awtFocus && aBoolean954)
  2885. {
  2886. aBoolean954 = false;
  2887. stream.sendPacket(3);
  2888. stream.addByte(0);
  2889. }
  2890. loadingStages();
  2891. method115();
  2892. method90();
  2893. anInt1009++;
  2894. if(anInt1009 > 750)
  2895. dropClient();
  2896. method114();
  2897. method95();
  2898. method38();
  2899. anInt945++;
  2900. if(crossType != 0)
  2901. {
  2902. crossIndex += 20;
  2903. if(crossIndex >= 400)
  2904. crossType = 0;
  2905. }
  2906. if(atInventoryInterfaceType != 0)
  2907. {
  2908. atInventoryLoopCycle++;
  2909. if(atInventoryLoopCycle >= 15)
  2910. {
  2911. if(atInventoryInterfaceType == 2)
  2912. needDrawTabArea = true;
  2913. if(atInventoryInterfaceType == 3)
  2914. inputTaken = true;
  2915. atInventoryInterfaceType = 0;
  2916. }
  2917. }
  2918. if(activeInterfaceType != 0)
  2919. {
  2920. anInt989++;
  2921. if(super.mouseX > anInt1087 + 5 || super.mouseX < anInt1087 - 5 || super.mouseY > anInt1088 + 5 || super.mouseY < anInt1088 - 5)
  2922. aBoolean1242 = true;
  2923. if(super.clickMode2 == 0)
  2924. {
  2925. if(activeInterfaceType == 2)
  2926. needDrawTabArea = true;
  2927. if(activeInterfaceType == 3)
  2928. inputTaken = true;
  2929. activeInterfaceType = 0;
  2930. if(aBoolean1242 && anInt989 >= 5)
  2931. {
  2932. lastActiveInvInterface = -1;
  2933. processRightClick();
  2934. if(lastActiveInvInterface == anInt1084 && mouseInvInterfaceIndex != anInt1085)
  2935. {
  2936. RSInterface class9 = RSInterface.interfaceCache[anInt1084];
  2937. int j1 = 0;
  2938. if(anInt913 == 1 && class9.anInt214 == 206)
  2939. j1 = 1;
  2940. if(class9.inv[mouseInvInterfaceIndex] <= 0)
  2941. j1 = 0;
  2942. if(class9.aBoolean235)
  2943. {
  2944. int l2 = anInt1085;
  2945. int l3 = mouseInvInterfaceIndex;
  2946. class9.inv[l3] = class9.inv[l2];
  2947. class9.invStackSizes[l3] = class9.invStackSizes[l2];
  2948. class9.inv[l2] = -1;
  2949. class9.invStackSizes[l2] = 0;
  2950. } else
  2951. if(j1 == 1)
  2952. {
  2953. int i3 = anInt1085;
  2954. for(int i4 = mouseInvInterfaceIndex; i3 != i4;)
  2955. if(i3 > i4)
  2956. {
  2957. class9.swapInventoryItems(i3, i3 - 1);
  2958. i3--;
  2959. } else
  2960. if(i3 < i4)
  2961. {
  2962. class9.swapInventoryItems(i3, i3 + 1);
  2963. i3++;
  2964. }
  2965.  
  2966. } else
  2967. {
  2968. class9.swapInventoryItems(anInt1085, mouseInvInterfaceIndex);
  2969. }
  2970. stream.sendPacket(214);
  2971. stream.addLEShortA(anInt1084);
  2972. stream.readByteC(j1);
  2973. stream.addLEShortA(anInt1085);
  2974. stream.addLEShort_2(mouseInvInterfaceIndex);
  2975. }
  2976. } else
  2977. if((anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  2978. determineMenuSize();
  2979. else
  2980. if(menuActionRow > 0)
  2981. doAction(menuActionRow - 1);
  2982. atInventoryLoopCycle = 10;
  2983. super.clickMode3 = 0;
  2984. }
  2985. }
  2986. if(WorldController.anInt470 != -1)
  2987. {
  2988. int k = WorldController.anInt470;
  2989. int k1 = WorldController.anInt471;
  2990. boolean flag = doWalkTo(0, 0, 0, 0, myPlayer.smallY[0], 0, 0, k1, myPlayer.smallX[0], true, k);
  2991. WorldController.anInt470 = -1;
  2992. if(flag)
  2993. {
  2994. crossX = super.saveClickX;
  2995. crossY = super.saveClickY;
  2996. crossType = 1;
  2997. crossIndex = 0;
  2998. }
  2999. }
  3000. if(super.clickMode3 == 1 && aString844 != null)
  3001. {
  3002. aString844 = null;
  3003. inputTaken = true;
  3004. super.clickMode3 = 0;
  3005. }
  3006. processMenuClick();
  3007. processMainScreenClick();
  3008. processTabClick();
  3009. processChatModeClick();
  3010. if(super.clickMode2 == 1 || super.clickMode3 == 1)
  3011. anInt1213++;
  3012. if(loadingStage == 2)
  3013. method108();
  3014. if(loadingStage == 2 && aBoolean1160)
  3015. calcCameraPos();
  3016. for(int i1 = 0; i1 < 5; i1++)
  3017. anIntArray1030[i1]++;
  3018.  
  3019. method73();
  3020. super.idleTime++;
  3021. if(super.idleTime > 4500)
  3022. {
  3023. anInt1011 = 250;
  3024. super.idleTime -= 500;
  3025. stream.sendPacket(202);
  3026. }
  3027. anInt988++;
  3028. if(anInt988 > 500)
  3029. {
  3030. anInt988 = 0;
  3031. int l1 = (int)(Math.random() * 8D);
  3032. if((l1 & 1) == 1)
  3033. anInt1278 += anInt1279;
  3034. if((l1 & 2) == 2)
  3035. anInt1131 += anInt1132;
  3036. if((l1 & 4) == 4)
  3037. anInt896 += anInt897;
  3038. }
  3039. if(anInt1278 < -50)
  3040. anInt1279 = 2;
  3041. if(anInt1278 > 50)
  3042. anInt1279 = -2;
  3043. if(anInt1131 < -55)
  3044. anInt1132 = 2;
  3045. if(anInt1131 > 55)
  3046. anInt1132 = -2;
  3047. if(anInt896 < -40)
  3048. anInt897 = 1;
  3049. if(anInt896 > 40)
  3050. anInt897 = -1;
  3051. anInt1254++;
  3052. if(anInt1254 > 500)
  3053. {
  3054. anInt1254 = 0;
  3055. int i2 = (int)(Math.random() * 8D);
  3056. if((i2 & 1) == 1)
  3057. minimapInt2 += anInt1210;
  3058. if((i2 & 2) == 2)
  3059. minimapInt3 += anInt1171;
  3060. }
  3061. if(minimapInt2 < -60)
  3062. anInt1210 = 2;
  3063. if(minimapInt2 > 60)
  3064. anInt1210 = -2;
  3065. if(minimapInt3 < -20)
  3066. anInt1171 = 1;
  3067. if(minimapInt3 > 10)
  3068. anInt1171 = -1;
  3069. anInt1010++;
  3070. if(anInt1010 > 50)
  3071. stream.sendPacket(0);
  3072. try
  3073. {
  3074. if(socketStream != null && stream.currentOffset > 0)
  3075. {
  3076. socketStream.queueBytes(stream.currentOffset, stream.buffer);
  3077. stream.currentOffset = 0;
  3078. anInt1010 = 0;
  3079. }
  3080. }
  3081. catch(IOException _ex)
  3082. {
  3083. dropClient();
  3084. }
  3085. catch(Exception exception)
  3086. {
  3087. resetLogout();
  3088. }
  3089. }
  3090.  
  3091. private void method63()
  3092. {
  3093. Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst();
  3094. for(; class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  3095. if(class30_sub1.anInt1294 == -1)
  3096. {
  3097. class30_sub1.anInt1302 = 0;
  3098. method89(class30_sub1);
  3099. } else
  3100. {
  3101. class30_sub1.unlink();
  3102. }
  3103.  
  3104. }
  3105.  
  3106. private void resetImageProducers()
  3107. {
  3108. if(aRSImageProducer_1107 != null)
  3109. return;
  3110. super.fullGameScreen = null;
  3111. aRSImageProducer_1166 = null;
  3112. aRSImageProducer_1164 = null;
  3113. aRSImageProducer_1163 = null;
  3114. aRSImageProducer_1165 = null;
  3115. aRSImageProducer_1123 = null;
  3116. aRSImageProducer_1124 = null;
  3117. aRSImageProducer_1125 = null;
  3118. aRSImageProducer_1110 = new RSImageProducer(128, 265, getGameComponent());
  3119. DrawingArea.setAllPixelsToZero();
  3120. aRSImageProducer_1111 = new RSImageProducer(128, 265, getGameComponent());
  3121. DrawingArea.setAllPixelsToZero();
  3122. aRSImageProducer_1107 = new RSImageProducer(509, 171, getGameComponent());
  3123. DrawingArea.setAllPixelsToZero();
  3124. aRSImageProducer_1108 = new RSImageProducer(360, 132, getGameComponent());
  3125. DrawingArea.setAllPixelsToZero();
  3126. aRSImageProducer_1109 = new RSImageProducer(360, 200, getGameComponent());
  3127. DrawingArea.setAllPixelsToZero();
  3128. aRSImageProducer_1112 = new RSImageProducer(202, 238, getGameComponent());
  3129. DrawingArea.setAllPixelsToZero();
  3130. aRSImageProducer_1113 = new RSImageProducer(203, 238, getGameComponent());
  3131. DrawingArea.setAllPixelsToZero();
  3132. aRSImageProducer_1114 = new RSImageProducer(74, 94, getGameComponent());
  3133. DrawingArea.setAllPixelsToZero();
  3134. aRSImageProducer_1115 = new RSImageProducer(75, 94, getGameComponent());
  3135. DrawingArea.setAllPixelsToZero();
  3136. if(titleStreamLoader != null)
  3137. {
  3138. drawLogo();
  3139. loadTitleScreen();
  3140. }
  3141. welcomeScreenRaised = true;
  3142. }
  3143.  
  3144. void drawLoadingText(int i, String s)
  3145. {
  3146. anInt1079 = i;
  3147. aString1049 = s;
  3148. resetImageProducers();
  3149. if(titleStreamLoader == null)
  3150. {
  3151. super.drawLoadingText(i, s);
  3152. return;
  3153. }
  3154. aRSImageProducer_1109.initDrawingArea();
  3155. char c = '\u0168';
  3156. char c1 = '\310';
  3157. byte byte1 = 20;
  3158. chatTextDrawingArea.drawText(0xffffff, "RuneScape is loading - please wait...", c1 / 2 - 26 - byte1, c / 2);
  3159. int j = c1 / 2 - 18 - byte1;
  3160. DrawingArea.fillPixels(c / 2 - 152, 304, 34, 0x8c1111, j);
  3161. DrawingArea.fillPixels(c / 2 - 151, 302, 32, 0, j + 1);
  3162. DrawingArea.method336(30, j + 2, c / 2 - 150, 0x8c1111, i * 3);
  3163. DrawingArea.method336(30, j + 2, (c / 2 - 150) + i * 3, 0, 300 - i * 3);
  3164. chatTextDrawingArea.drawText(0xffffff, s, (c1 / 2 + 5) - byte1, c / 2);
  3165. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  3166. if(welcomeScreenRaised)
  3167. {
  3168. welcomeScreenRaised = false;
  3169. if(!aBoolean831)
  3170. {
  3171. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  3172. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  3173. }
  3174. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  3175. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  3176. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  3177. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  3178. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  3179. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  3180. }
  3181. }
  3182.  
  3183. private void method65(int i, int j, int k, int l, RSInterface class9, int i1, boolean flag,
  3184. int j1)
  3185. {
  3186. int anInt992;
  3187. if(aBoolean972)
  3188. anInt992 = 32;
  3189. else
  3190. anInt992 = 0;
  3191. aBoolean972 = false;
  3192. if(k >= i && k < i + 16 && l >= i1 && l < i1 + 16)
  3193. {
  3194. class9.scrollPosition -= anInt1213 * 4;
  3195. if(flag)
  3196. {
  3197. needDrawTabArea = true;
  3198. }
  3199. } else
  3200. if(k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j)
  3201. {
  3202. class9.scrollPosition += anInt1213 * 4;
  3203. if(flag)
  3204. {
  3205. needDrawTabArea = true;
  3206. }
  3207. } else
  3208. if(k >= i - anInt992 && k < i + 16 + anInt992 && l >= i1 + 16 && l < (i1 + j) - 16 && anInt1213 > 0)
  3209. {
  3210. int l1 = ((j - 32) * j) / j1;
  3211. if(l1 < 8)
  3212. l1 = 8;
  3213. int i2 = l - i1 - 16 - l1 / 2;
  3214. int j2 = j - 32 - l1;
  3215. class9.scrollPosition = ((j1 - j) * i2) / j2;
  3216. if(flag)
  3217. needDrawTabArea = true;
  3218. aBoolean972 = true;
  3219. }
  3220. }
  3221.  
  3222. private boolean method66(int i, int j, int k)
  3223. {
  3224. int i1 = i >> 14 & 0x7fff;
  3225. int j1 = worldController.method304(plane, k, j, i);
  3226. if(j1 == -1)
  3227. return false;
  3228. int k1 = j1 & 0x1f;
  3229. int l1 = j1 >> 6 & 3;
  3230. if(k1 == 10 || k1 == 11 || k1 == 22)
  3231. {
  3232. ObjectDef class46 = ObjectDef.forID(i1);
  3233. int i2;
  3234. int j2;
  3235. if(l1 == 0 || l1 == 2)
  3236. {
  3237. i2 = class46.anInt744;
  3238. j2 = class46.anInt761;
  3239. } else
  3240. {
  3241. i2 = class46.anInt761;
  3242. j2 = class46.anInt744;
  3243. }
  3244. int k2 = class46.anInt768;
  3245. if(l1 != 0)
  3246. k2 = (k2 << l1 & 0xf) + (k2 >> 4 - l1);
  3247. doWalkTo(2, 0, j2, 0, myPlayer.smallY[0], i2, k2, j, myPlayer.smallX[0], false, k);
  3248. } else
  3249. {
  3250. doWalkTo(2, l1, 0, k1 + 1, myPlayer.smallY[0], 0, 0, j, myPlayer.smallX[0], false, k);
  3251. }
  3252. crossX = super.saveClickX;
  3253. crossY = super.saveClickY;
  3254. crossType = 2;
  3255. crossIndex = 0;
  3256. return true;
  3257. }
  3258.  
  3259. private StreamLoader streamLoaderForName(int i, String s, String s1, int j, int k)
  3260. {
  3261. byte abyte0[] = null;
  3262. int l = 5;
  3263. try
  3264. {
  3265. if(decompressors[0] != null)
  3266. abyte0 = decompressors[0].decompress(i);
  3267. }
  3268. catch(Exception _ex) { }
  3269. if(abyte0 != null)
  3270. {
  3271. // aCRC32_930.reset();
  3272. // aCRC32_930.update(abyte0);
  3273. // int i1 = (int)aCRC32_930.getValue();
  3274. // if(i1 != j)
  3275. }
  3276. if(abyte0 != null)
  3277. {
  3278. StreamLoader streamLoader = new StreamLoader(abyte0);
  3279. return streamLoader;
  3280. }
  3281. int j1 = 0;
  3282. while(abyte0 == null)
  3283. {
  3284. String s2 = "Unknown error";
  3285. drawLoadingText(k, "Requesting " + s);
  3286. Object obj = null;
  3287. try
  3288. {
  3289. int k1 = 0;
  3290. DataInputStream datainputstream = openJagGrabInputStream(s1 + j);
  3291. byte abyte1[] = new byte[6];
  3292. datainputstream.readFully(abyte1, 0, 6);
  3293. Stream stream = new Stream(abyte1);
  3294. stream.currentOffset = 3;
  3295. int i2 = stream.read3Bytes() + 6;
  3296. int j2 = 6;
  3297. abyte0 = new byte[i2];
  3298. System.arraycopy(abyte1, 0, abyte0, 0, 6);
  3299.  
  3300. while(j2 < i2)
  3301. {
  3302. int l2 = i2 - j2;
  3303. if(l2 > 1000)
  3304. l2 = 1000;
  3305. int j3 = datainputstream.read(abyte0, j2, l2);
  3306. if(j3 < 0)
  3307. {
  3308. s2 = "Length error: " + j2 + "/" + i2;
  3309. throw new IOException("EOF");
  3310. }
  3311. j2 += j3;
  3312. int k3 = (j2 * 100) / i2;
  3313. if(k3 != k1)
  3314. drawLoadingText(k, "Loading " + s + " - " + k3 + "%");
  3315. k1 = k3;
  3316. }
  3317. datainputstream.close();
  3318. try
  3319. {
  3320. if(decompressors[0] != null)
  3321. decompressors[0].method234(abyte0.length, abyte0, i);
  3322. }
  3323. catch(Exception _ex)
  3324. {
  3325. decompressors[0] = null;
  3326. }
  3327. /* if(abyte0 != null)
  3328. {
  3329. aCRC32_930.reset();
  3330. aCRC32_930.update(abyte0);
  3331. int i3 = (int)aCRC32_930.getValue();
  3332. if(i3 != j)
  3333. {
  3334. abyte0 = null;
  3335. j1++;
  3336. s2 = "Checksum error: " + i3;
  3337. }
  3338. }
  3339. */
  3340. }
  3341. catch(IOException ioexception)
  3342. {
  3343. if(s2.equals("Unknown error"))
  3344. s2 = "Connection error";
  3345. abyte0 = null;
  3346. }
  3347. catch(NullPointerException _ex)
  3348. {
  3349. s2 = "Null error";
  3350. abyte0 = null;
  3351. if(!signlink.reporterror)
  3352. return null;
  3353. }
  3354. catch(ArrayIndexOutOfBoundsException _ex)
  3355. {
  3356. s2 = "Bounds error";
  3357. abyte0 = null;
  3358. if(!signlink.reporterror)
  3359. return null;
  3360. }
  3361. catch(Exception _ex)
  3362. {
  3363. s2 = "Unexpected error";
  3364. abyte0 = null;
  3365. if(!signlink.reporterror)
  3366. return null;
  3367. }
  3368. if(abyte0 == null)
  3369. {
  3370. for(int l1 = l; l1 > 0; l1--)
  3371. {
  3372. if(j1 >= 3)
  3373. {
  3374. drawLoadingText(k, "Game updated - please reload page");
  3375. l1 = 10;
  3376. } else
  3377. {
  3378. drawLoadingText(k, s2 + " - Retrying in " + l1);
  3379. }
  3380. try
  3381. {
  3382. Thread.sleep(1000L);
  3383. }
  3384. catch(Exception _ex) { }
  3385. }
  3386.  
  3387. l *= 2;
  3388. if(l > 60)
  3389. l = 60;
  3390. aBoolean872 = !aBoolean872;
  3391. }
  3392.  
  3393. }
  3394.  
  3395. StreamLoader streamLoader_1 = new StreamLoader(abyte0);
  3396. return streamLoader_1;
  3397. }
  3398.  
  3399. private void dropClient()
  3400. {
  3401. if(anInt1011 > 0)
  3402. {
  3403. resetLogout();
  3404. return;
  3405. }
  3406. aRSImageProducer_1165.initDrawingArea();
  3407. aTextDrawingArea_1271.drawText(0, "Connection lost", 144, 257);
  3408. aTextDrawingArea_1271.drawText(0xffffff, "Connection lost", 143, 256);
  3409. aTextDrawingArea_1271.drawText(0, "Please wait - attempting to reestablish", 159, 257);
  3410. aTextDrawingArea_1271.drawText(0xffffff, "Please wait - attempting to reestablish", 158, 256);
  3411. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  3412. anInt1021 = 0;
  3413. destX = 0;
  3414. RSSocket rsSocket = socketStream;
  3415. loggedIn = false;
  3416. loginFailures = 0;
  3417. login(myUsername, myPassword, true);
  3418. if(!loggedIn)
  3419. resetLogout();
  3420. try
  3421. {
  3422. rsSocket.close();
  3423. }
  3424. catch(Exception _ex)
  3425. {
  3426. }
  3427. }
  3428.  
  3429. private void doAction(int i)
  3430. {
  3431. if(i < 0)
  3432. return;
  3433. if(inputDialogState != 0)
  3434. {
  3435. inputDialogState = 0;
  3436. inputTaken = true;
  3437. }
  3438. int j = menuActionCmd2[i];
  3439. int k = menuActionCmd3[i];
  3440. int l = menuActionID[i];
  3441. int i1 = menuActionCmd1[i];
  3442. if(l >= 2000)
  3443. l -= 2000;
  3444. if(l == 582)
  3445. {
  3446. NPC npc = npcArray[i1];
  3447. if(npc != null)
  3448. {
  3449. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0], myPlayer.smallX[0], false, npc.smallX[0]);
  3450. crossX = super.saveClickX;
  3451. crossY = super.saveClickY;
  3452. crossType = 2;
  3453. crossIndex = 0;
  3454. stream.sendPacket(57);
  3455. stream.method432(anInt1285);
  3456. stream.method432(i1);
  3457. stream.addLEShort_2(anInt1283);
  3458. stream.method432(anInt1284);
  3459. }
  3460. }
  3461. if(l == 234)
  3462. {
  3463. boolean flag1 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  3464. if(!flag1)
  3465. flag1 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  3466. crossX = super.saveClickX;
  3467. crossY = super.saveClickY;
  3468. crossType = 2;
  3469. crossIndex = 0;
  3470. stream.sendPacket(236);
  3471. stream.addLEShort_2(k + baseY);
  3472. stream.addShort(i1);
  3473. stream.addLEShort_2(j + baseX);
  3474. }
  3475. if(l == 62 && method66(i1, k, j))
  3476. {
  3477. stream.sendPacket(192);
  3478. stream.addShort(anInt1284);
  3479. stream.addLEShort_2(i1 >> 14 & 0x7fff);
  3480. stream.addLEShortA(k + baseY);
  3481. stream.addLEShort_2(anInt1283);
  3482. stream.addLEShortA(j + baseX);
  3483. stream.addShort(anInt1285);
  3484. }
  3485. if(l == 511)
  3486. {
  3487. boolean flag2 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  3488. if(!flag2)
  3489. flag2 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  3490. crossX = super.saveClickX;
  3491. crossY = super.saveClickY;
  3492. crossType = 2;
  3493. crossIndex = 0;
  3494. stream.sendPacket(25);
  3495. stream.addLEShort_2(anInt1284);
  3496. stream.method432(anInt1285);
  3497. stream.addShort(i1);
  3498. stream.method432(k + baseY);
  3499. stream.addLEShortA(anInt1283);
  3500. stream.addShort(j + baseX);
  3501. }
  3502. if(l == 74)
  3503. {
  3504. stream.sendPacket(122);
  3505. stream.addLEShortA(k);
  3506. stream.method432(j);
  3507. stream.addLEShort_2(i1);
  3508. atInventoryLoopCycle = 0;
  3509. atInventoryInterface = k;
  3510. atInventoryIndex = j;
  3511. atInventoryInterfaceType = 2;
  3512. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3513. atInventoryInterfaceType = 1;
  3514. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3515. atInventoryInterfaceType = 3;
  3516. }
  3517. if(l == 315)
  3518. {
  3519. RSInterface class9 = RSInterface.interfaceCache[k];
  3520. boolean flag8 = true;
  3521. if(class9.anInt214 > 0)
  3522. flag8 = promptUserForInput(class9);
  3523. if(flag8)
  3524. {
  3525. stream.sendPacket(185);
  3526. stream.addShort(k);
  3527. }
  3528. }
  3529. if(l == 561)
  3530. {
  3531. Player player = playerArray[i1];
  3532. if(player != null)
  3533. {
  3534. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, player.smallY[0], myPlayer.smallX[0], false, player.smallX[0]);
  3535. crossX = super.saveClickX;
  3536. crossY = super.saveClickY;
  3537. crossType = 2;
  3538. crossIndex = 0;
  3539. anInt1188 += i1;
  3540. if(anInt1188 >= 90)
  3541. {
  3542. stream.sendPacket(136);
  3543. anInt1188 = 0;
  3544. }
  3545. stream.sendPacket(128);
  3546. stream.addShort(i1);
  3547. }
  3548. }
  3549. if(l == 20)
  3550. {
  3551. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[i1];
  3552. if(class30_sub2_sub4_sub1_sub1_1 != null)
  3553. {
  3554. 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]);
  3555. crossX = super.saveClickX;
  3556. crossY = super.saveClickY;
  3557. crossType = 2;
  3558. crossIndex = 0;
  3559. stream.sendPacket(155);
  3560. stream.addLEShort_2(i1);
  3561. }
  3562. }
  3563. if(l == 779)
  3564. {
  3565. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[i1];
  3566. if(class30_sub2_sub4_sub1_sub2_1 != null)
  3567. {
  3568. 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]);
  3569. crossX = super.saveClickX;
  3570. crossY = super.saveClickY;
  3571. crossType = 2;
  3572. crossIndex = 0;
  3573. stream.sendPacket(153);
  3574. stream.addLEShort_2(i1);
  3575. }
  3576. }
  3577. if(l == 516)
  3578. if(!menuOpen)
  3579. worldController.method312(super.saveClickY - 4, super.saveClickX - 4);
  3580. else
  3581. worldController.method312(k - 4, j - 4);
  3582. if(l == 1062)
  3583. {
  3584. anInt924 += baseX;
  3585. if(anInt924 >= 113)
  3586. {
  3587. stream.sendPacket(183);
  3588. stream.addTriByte(0xe63271);
  3589. anInt924 = 0;
  3590. }
  3591. method66(i1, k, j);
  3592. stream.sendPacket(228);
  3593. stream.method432(i1 >> 14 & 0x7fff);
  3594. stream.method432(k + baseY);
  3595. stream.addShort(j + baseX);
  3596. }
  3597. if(l == 679 && !aBoolean1149)
  3598. {
  3599. stream.sendPacket(40);
  3600. stream.addShort(k);
  3601. aBoolean1149 = true;
  3602. }
  3603. if(l == 431)
  3604. {
  3605. stream.sendPacket(129);
  3606. stream.method432(j);
  3607. stream.addShort(k);
  3608. stream.method432(i1);
  3609. atInventoryLoopCycle = 0;
  3610. atInventoryInterface = k;
  3611. atInventoryIndex = j;
  3612. atInventoryInterfaceType = 2;
  3613. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3614. atInventoryInterfaceType = 1;
  3615. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3616. atInventoryInterfaceType = 3;
  3617. }
  3618. if(l == 337 || l == 42 || l == 792 || l == 322)
  3619. {
  3620. String s = menuActionName[i];
  3621. int k1 = s.indexOf("@whi@");
  3622. if(k1 != -1)
  3623. {
  3624. long l3 = TextClass.longForName(s.substring(k1 + 5).trim());
  3625. if(l == 337)
  3626. addFriend(l3);
  3627. if(l == 42)
  3628. addIgnore(l3);
  3629. if(l == 792)
  3630. delFriend(l3);
  3631. if(l == 322)
  3632. delIgnore(l3);
  3633. }
  3634. }
  3635. if(l == 53)
  3636. {
  3637. stream.sendPacket(135);
  3638. stream.addLEShort_2(j);
  3639. stream.method432(k);
  3640. stream.addLEShort_2(i1);
  3641. atInventoryLoopCycle = 0;
  3642. atInventoryInterface = k;
  3643. atInventoryIndex = j;
  3644. atInventoryInterfaceType = 2;
  3645. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3646. atInventoryInterfaceType = 1;
  3647. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3648. atInventoryInterfaceType = 3;
  3649. }
  3650. if(l == 539)
  3651. {
  3652. stream.sendPacket(16);
  3653. stream.method432(i1);
  3654. stream.addLEShortA(j);
  3655. stream.addLEShortA(k);
  3656. atInventoryLoopCycle = 0;
  3657. atInventoryInterface = k;
  3658. atInventoryIndex = j;
  3659. atInventoryInterfaceType = 2;
  3660. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3661. atInventoryInterfaceType = 1;
  3662. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3663. atInventoryInterfaceType = 3;
  3664. }
  3665. if(l == 484 || l == 6)
  3666. {
  3667. String s1 = menuActionName[i];
  3668. int l1 = s1.indexOf("@whi@");
  3669. if(l1 != -1)
  3670. {
  3671. s1 = s1.substring(l1 + 5).trim();
  3672. String s7 = TextClass.fixName(TextClass.nameForLong(TextClass.longForName(s1)));
  3673. boolean flag9 = false;
  3674. for(int j3 = 0; j3 < playerCount; j3++)
  3675. {
  3676. Player class30_sub2_sub4_sub1_sub2_7 = playerArray[playerIndices[j3]];
  3677. 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))
  3678. continue;
  3679. 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]);
  3680. if(l == 484)
  3681. {
  3682. stream.sendPacket(139);
  3683. stream.addLEShort_2(playerIndices[j3]);
  3684. }
  3685. if(l == 6)
  3686. {
  3687. anInt1188 += i1;
  3688. if(anInt1188 >= 90)
  3689. {
  3690. stream.sendPacket(136);
  3691. anInt1188 = 0;
  3692. }
  3693. stream.sendPacket(128);
  3694. stream.addShort(playerIndices[j3]);
  3695. }
  3696. flag9 = true;
  3697. break;
  3698. }
  3699.  
  3700. if(!flag9)
  3701. pushMessage("Unable to find " + s7, 0, "");
  3702. }
  3703. }
  3704. if(l == 870)
  3705. {
  3706. stream.sendPacket(53);
  3707. stream.addShort(j);
  3708. stream.method432(anInt1283);
  3709. stream.addLEShortA(i1);
  3710. stream.addShort(anInt1284);
  3711. stream.addLEShort_2(anInt1285);
  3712. stream.addShort(k);
  3713. atInventoryLoopCycle = 0;
  3714. atInventoryInterface = k;
  3715. atInventoryIndex = j;
  3716. atInventoryInterfaceType = 2;
  3717. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3718. atInventoryInterfaceType = 1;
  3719. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3720. atInventoryInterfaceType = 3;
  3721. }
  3722. if(l == 847)
  3723. {
  3724. stream.sendPacket(87);
  3725. stream.method432(i1);
  3726. stream.addShort(k);
  3727. stream.method432(j);
  3728. atInventoryLoopCycle = 0;
  3729. atInventoryInterface = k;
  3730. atInventoryIndex = j;
  3731. atInventoryInterfaceType = 2;
  3732. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3733. atInventoryInterfaceType = 1;
  3734. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3735. atInventoryInterfaceType = 3;
  3736. }
  3737. if(l == 626)
  3738. {
  3739. RSInterface class9_1 = RSInterface.interfaceCache[k];
  3740. spellSelected = 1;
  3741. anInt1137 = k;
  3742. spellUsableOn = class9_1.spellUsableOn;
  3743. itemSelected = 0;
  3744. needDrawTabArea = true;
  3745. String s4 = class9_1.selectedActionName;
  3746. if(s4.indexOf(" ") != -1)
  3747. s4 = s4.substring(0, s4.indexOf(" "));
  3748. String s8 = class9_1.selectedActionName;
  3749. if(s8.indexOf(" ") != -1)
  3750. s8 = s8.substring(s8.indexOf(" ") + 1);
  3751. spellTooltip = s4 + " " + class9_1.spellName + " " + s8;
  3752. if(spellUsableOn == 16)
  3753. {
  3754. needDrawTabArea = true;
  3755. tabID = 3;
  3756. tabAreaAltered = true;
  3757. }
  3758. return;
  3759. }
  3760. if(l == 78)
  3761. {
  3762. stream.sendPacket(117);
  3763. stream.addLEShortA(k);
  3764. stream.addLEShortA(i1);
  3765. stream.addLEShort_2(j);
  3766. atInventoryLoopCycle = 0;
  3767. atInventoryInterface = k;
  3768. atInventoryIndex = j;
  3769. atInventoryInterfaceType = 2;
  3770. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3771. atInventoryInterfaceType = 1;
  3772. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3773. atInventoryInterfaceType = 3;
  3774. }
  3775. if(l == 27)
  3776. {
  3777. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[i1];
  3778. if(class30_sub2_sub4_sub1_sub2_2 != null)
  3779. {
  3780. 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]);
  3781. crossX = super.saveClickX;
  3782. crossY = super.saveClickY;
  3783. crossType = 2;
  3784. crossIndex = 0;
  3785. anInt986 += i1;
  3786. if(anInt986 >= 54)
  3787. {
  3788. stream.sendPacket(189);
  3789. stream.addByte(234);
  3790. anInt986 = 0;
  3791. }
  3792. stream.sendPacket(73);
  3793. stream.addLEShort_2(i1);
  3794. }
  3795. }
  3796. if(l == 213)
  3797. {
  3798. boolean flag3 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  3799. if(!flag3)
  3800. flag3 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  3801. crossX = super.saveClickX;
  3802. crossY = super.saveClickY;
  3803. crossType = 2;
  3804. crossIndex = 0;
  3805. stream.sendPacket(79);
  3806. stream.addLEShort_2(k + baseY);
  3807. stream.addShort(i1);
  3808. stream.method432(j + baseX);
  3809. }
  3810. if(l == 632)
  3811. {
  3812. stream.sendPacket(145);
  3813. stream.method432(k);
  3814. stream.method432(j);
  3815. stream.method432(i1);
  3816. atInventoryLoopCycle = 0;
  3817. atInventoryInterface = k;
  3818. atInventoryIndex = j;
  3819. atInventoryInterfaceType = 2;
  3820. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3821. atInventoryInterfaceType = 1;
  3822. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3823. atInventoryInterfaceType = 3;
  3824. }
  3825. if(l == 493)
  3826. {
  3827. stream.sendPacket(75);
  3828. stream.addLEShortA(k);
  3829. stream.addLEShort_2(j);
  3830. stream.method432(i1);
  3831. atInventoryLoopCycle = 0;
  3832. atInventoryInterface = k;
  3833. atInventoryIndex = j;
  3834. atInventoryInterfaceType = 2;
  3835. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3836. atInventoryInterfaceType = 1;
  3837. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3838. atInventoryInterfaceType = 3;
  3839. }
  3840. if(l == 652)
  3841. {
  3842. boolean flag4 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  3843. if(!flag4)
  3844. flag4 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  3845. crossX = super.saveClickX;
  3846. crossY = super.saveClickY;
  3847. crossType = 2;
  3848. crossIndex = 0;
  3849. stream.sendPacket(156);
  3850. stream.method432(j + baseX);
  3851. stream.addLEShort_2(k + baseY);
  3852. stream.addLEShortA(i1);
  3853. }
  3854. if(l == 94)
  3855. {
  3856. boolean flag5 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  3857. if(!flag5)
  3858. flag5 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  3859. crossX = super.saveClickX;
  3860. crossY = super.saveClickY;
  3861. crossType = 2;
  3862. crossIndex = 0;
  3863. stream.sendPacket(181);
  3864. stream.addLEShort_2(k + baseY);
  3865. stream.addShort(i1);
  3866. stream.addLEShort_2(j + baseX);
  3867. stream.method432(anInt1137);
  3868. }
  3869. if(l == 646)
  3870. {
  3871. stream.sendPacket(185);
  3872. stream.addShort(k);
  3873. RSInterface class9_2 = RSInterface.interfaceCache[k];
  3874. if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5)
  3875. {
  3876. int i2 = class9_2.valueIndexArray[0][1];
  3877. if(variousSettings[i2] != class9_2.anIntArray212[0])
  3878. {
  3879. variousSettings[i2] = class9_2.anIntArray212[0];
  3880. method33(i2);
  3881. needDrawTabArea = true;
  3882. }
  3883. }
  3884. }
  3885. if(l == 225)
  3886. {
  3887. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[i1];
  3888. if(class30_sub2_sub4_sub1_sub1_2 != null)
  3889. {
  3890. 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]);
  3891. crossX = super.saveClickX;
  3892. crossY = super.saveClickY;
  3893. crossType = 2;
  3894. crossIndex = 0;
  3895. anInt1226 += i1;
  3896. if(anInt1226 >= 85)
  3897. {
  3898. stream.sendPacket(230);
  3899. stream.addByte(239);
  3900. anInt1226 = 0;
  3901. }
  3902. stream.sendPacket(17);
  3903. stream.addLEShortA(i1);
  3904. }
  3905. }
  3906. if(l == 965)
  3907. {
  3908. NPC class30_sub2_sub4_sub1_sub1_3 = npcArray[i1];
  3909. if(class30_sub2_sub4_sub1_sub1_3 != null)
  3910. {
  3911. 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]);
  3912. crossX = super.saveClickX;
  3913. crossY = super.saveClickY;
  3914. crossType = 2;
  3915. crossIndex = 0;
  3916. anInt1134++;
  3917. if(anInt1134 >= 96)
  3918. {
  3919. stream.sendPacket(152);
  3920. stream.addByte(88);
  3921. anInt1134 = 0;
  3922. }
  3923. stream.sendPacket(21);
  3924. stream.addShort(i1);
  3925. }
  3926. }
  3927. if(l == 413)
  3928. {
  3929. NPC class30_sub2_sub4_sub1_sub1_4 = npcArray[i1];
  3930. if(class30_sub2_sub4_sub1_sub1_4 != null)
  3931. {
  3932. 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]);
  3933. crossX = super.saveClickX;
  3934. crossY = super.saveClickY;
  3935. crossType = 2;
  3936. crossIndex = 0;
  3937. stream.sendPacket(131);
  3938. stream.addLEShortA(i1);
  3939. stream.method432(anInt1137);
  3940. }
  3941. }
  3942. if(l == 200)
  3943. clearTopInterfaces();
  3944. if(l == 1025)
  3945. {
  3946. NPC class30_sub2_sub4_sub1_sub1_5 = npcArray[i1];
  3947. if(class30_sub2_sub4_sub1_sub1_5 != null)
  3948. {
  3949. EntityDef entityDef = class30_sub2_sub4_sub1_sub1_5.desc;
  3950. if(entityDef.childrenIDs != null)
  3951. entityDef = entityDef.method161();
  3952. if(entityDef != null)
  3953. {
  3954. String s9;
  3955. if(entityDef.description != null)
  3956. s9 = new String(entityDef.description);
  3957. else
  3958. s9 = "It's a " + entityDef.name + ".";
  3959. pushMessage(s9, 0, "");
  3960. }
  3961. }
  3962. }
  3963. if(l == 900)
  3964. {
  3965. method66(i1, k, j);
  3966. stream.sendPacket(252);
  3967. stream.addLEShortA(i1 >> 14 & 0x7fff);
  3968. stream.addLEShort_2(k + baseY);
  3969. stream.method432(j + baseX);
  3970. }
  3971. if(l == 412)
  3972. {
  3973. NPC class30_sub2_sub4_sub1_sub1_6 = npcArray[i1];
  3974. if(class30_sub2_sub4_sub1_sub1_6 != null)
  3975. {
  3976. 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]);
  3977. crossX = super.saveClickX;
  3978. crossY = super.saveClickY;
  3979. crossType = 2;
  3980. crossIndex = 0;
  3981. stream.sendPacket(72);
  3982. stream.method432(i1);
  3983. }
  3984. }
  3985. if(l == 365)
  3986. {
  3987. Player class30_sub2_sub4_sub1_sub2_3 = playerArray[i1];
  3988. if(class30_sub2_sub4_sub1_sub2_3 != null)
  3989. {
  3990. 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]);
  3991. crossX = super.saveClickX;
  3992. crossY = super.saveClickY;
  3993. crossType = 2;
  3994. crossIndex = 0;
  3995. stream.sendPacket(249);
  3996. stream.method432(i1);
  3997. stream.addLEShort_2(anInt1137);
  3998. }
  3999. }
  4000. if(l == 729)
  4001. {
  4002. Player class30_sub2_sub4_sub1_sub2_4 = playerArray[i1];
  4003. if(class30_sub2_sub4_sub1_sub2_4 != null)
  4004. {
  4005. 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]);
  4006. crossX = super.saveClickX;
  4007. crossY = super.saveClickY;
  4008. crossType = 2;
  4009. crossIndex = 0;
  4010. stream.sendPacket(39);
  4011. stream.addLEShort_2(i1);
  4012. }
  4013. }
  4014. if(l == 577)
  4015. {
  4016. Player class30_sub2_sub4_sub1_sub2_5 = playerArray[i1];
  4017. if(class30_sub2_sub4_sub1_sub2_5 != null)
  4018. {
  4019. 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]);
  4020. crossX = super.saveClickX;
  4021. crossY = super.saveClickY;
  4022. crossType = 2;
  4023. crossIndex = 0;
  4024. stream.sendPacket(139);
  4025. stream.addLEShort_2(i1);
  4026. }
  4027. }
  4028. if(l == 956 && method66(i1, k, j))
  4029. {
  4030. stream.sendPacket(35);
  4031. stream.addLEShort_2(j + baseX);
  4032. stream.method432(anInt1137);
  4033. stream.method432(k + baseY);
  4034. stream.addLEShort_2(i1 >> 14 & 0x7fff);
  4035. }
  4036. if(l == 567)
  4037. {
  4038. boolean flag6 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4039. if(!flag6)
  4040. flag6 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4041. crossX = super.saveClickX;
  4042. crossY = super.saveClickY;
  4043. crossType = 2;
  4044. crossIndex = 0;
  4045. stream.sendPacket(23);
  4046. stream.addLEShort_2(k + baseY);
  4047. stream.addLEShort_2(i1);
  4048. stream.addLEShort_2(j + baseX);
  4049. }
  4050. if(l == 867)
  4051. {
  4052. if((i1 & 3) == 0)
  4053. anInt1175++;
  4054. if(anInt1175 >= 59)
  4055. {
  4056. stream.sendPacket(200);
  4057. stream.addShort(25501);
  4058. anInt1175 = 0;
  4059. }
  4060. stream.sendPacket(43);
  4061. stream.addLEShort_2(k);
  4062. stream.method432(i1);
  4063. stream.method432(j);
  4064. atInventoryLoopCycle = 0;
  4065. atInventoryInterface = k;
  4066. atInventoryIndex = j;
  4067. atInventoryInterfaceType = 2;
  4068. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4069. atInventoryInterfaceType = 1;
  4070. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4071. atInventoryInterfaceType = 3;
  4072. }
  4073. if(l == 543)
  4074. {
  4075. stream.sendPacket(237);
  4076. stream.addShort(j);
  4077. stream.method432(i1);
  4078. stream.addShort(k);
  4079. stream.method432(anInt1137);
  4080. atInventoryLoopCycle = 0;
  4081. atInventoryInterface = k;
  4082. atInventoryIndex = j;
  4083. atInventoryInterfaceType = 2;
  4084. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4085. atInventoryInterfaceType = 1;
  4086. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4087. atInventoryInterfaceType = 3;
  4088. }
  4089. if(l == 606)
  4090. {
  4091. String s2 = menuActionName[i];
  4092. int j2 = s2.indexOf("@whi@");
  4093. if(j2 != -1)
  4094. if(openInterfaceID == -1)
  4095. {
  4096. clearTopInterfaces();
  4097. reportAbuseInput = s2.substring(j2 + 5).trim();
  4098. canMute = false;
  4099. for(int i3 = 0; i3 < RSInterface.interfaceCache.length; i3++)
  4100. {
  4101. if(RSInterface.interfaceCache[i3] == null || RSInterface.interfaceCache[i3].anInt214 != 600)
  4102. continue;
  4103. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i3].parentID;
  4104. break;
  4105. }
  4106.  
  4107. } else
  4108. {
  4109. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  4110. }
  4111. }
  4112. if(l == 491)
  4113. {
  4114. Player class30_sub2_sub4_sub1_sub2_6 = playerArray[i1];
  4115. if(class30_sub2_sub4_sub1_sub2_6 != null)
  4116. {
  4117. 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]);
  4118. crossX = super.saveClickX;
  4119. crossY = super.saveClickY;
  4120. crossType = 2;
  4121. crossIndex = 0;
  4122. stream.sendPacket(14);
  4123. stream.method432(anInt1284);
  4124. stream.addShort(i1);
  4125. stream.addShort(anInt1285);
  4126. stream.addLEShort_2(anInt1283);
  4127. }
  4128. }
  4129. if(l == 639)
  4130. {
  4131. String s3 = menuActionName[i];
  4132. int k2 = s3.indexOf("@whi@");
  4133. if(k2 != -1)
  4134. {
  4135. long l4 = TextClass.longForName(s3.substring(k2 + 5).trim());
  4136. int k3 = -1;
  4137. for(int i4 = 0; i4 < friendsCount; i4++)
  4138. {
  4139. if(friendsListAsLongs[i4] != l4)
  4140. continue;
  4141. k3 = i4;
  4142. break;
  4143. }
  4144.  
  4145. if(k3 != -1 && friendsNodeIDs[k3] > 0)
  4146. {
  4147. inputTaken = true;
  4148. inputDialogState = 0;
  4149. messagePromptRaised = true;
  4150. promptInput = "";
  4151. friendsListAction = 3;
  4152. aLong953 = friendsListAsLongs[k3];
  4153. aString1121 = "Enter message to send to " + friendsList[k3];
  4154. }
  4155. }
  4156. }
  4157. if(l == 454)
  4158. {
  4159. stream.sendPacket(41);
  4160. stream.addShort(i1);
  4161. stream.method432(j);
  4162. stream.method432(k);
  4163. atInventoryLoopCycle = 0;
  4164. atInventoryInterface = k;
  4165. atInventoryIndex = j;
  4166. atInventoryInterfaceType = 2;
  4167. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4168. atInventoryInterfaceType = 1;
  4169. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4170. atInventoryInterfaceType = 3;
  4171. }
  4172. if(l == 478)
  4173. {
  4174. NPC class30_sub2_sub4_sub1_sub1_7 = npcArray[i1];
  4175. if(class30_sub2_sub4_sub1_sub1_7 != null)
  4176. {
  4177. 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]);
  4178. crossX = super.saveClickX;
  4179. crossY = super.saveClickY;
  4180. crossType = 2;
  4181. crossIndex = 0;
  4182. if((i1 & 3) == 0)
  4183. anInt1155++;
  4184. if(anInt1155 >= 53)
  4185. {
  4186. stream.sendPacket(85);
  4187. stream.addByte(66);
  4188. anInt1155 = 0;
  4189. }
  4190. stream.sendPacket(18);
  4191. stream.addLEShort_2(i1);
  4192. }
  4193. }
  4194. if(l == 113)
  4195. {
  4196. method66(i1, k, j);
  4197. stream.sendPacket(70);
  4198. stream.addLEShort_2(j + baseX);
  4199. stream.addShort(k + baseY);
  4200. stream.addLEShortA(i1 >> 14 & 0x7fff);
  4201. }
  4202. if(l == 872)
  4203. {
  4204. method66(i1, k, j);
  4205. stream.sendPacket(234);
  4206. stream.addLEShortA(j + baseX);
  4207. stream.method432(i1 >> 14 & 0x7fff);
  4208. stream.addLEShortA(k + baseY);
  4209. }
  4210. if(l == 502)
  4211. {
  4212. method66(i1, k, j);
  4213. stream.sendPacket(132);
  4214. stream.addLEShortA(j + baseX);
  4215. stream.addShort(i1 >> 14 & 0x7fff);
  4216. stream.method432(k + baseY);
  4217. }
  4218. if(l == 1125)
  4219. {
  4220. ItemDef itemDef = ItemDef.forID(i1);
  4221. RSInterface class9_4 = RSInterface.interfaceCache[k];
  4222. String s5;
  4223. if(class9_4 != null && class9_4.invStackSizes[j] >= 0x186a0)
  4224. s5 = class9_4.invStackSizes[j] + " x " + itemDef.name;
  4225. else
  4226. if(itemDef.description != null)
  4227. s5 = new String(itemDef.description);
  4228. else
  4229. s5 = "It's a " + itemDef.name + ".";
  4230. pushMessage(s5, 0, "");
  4231. }
  4232. if(l == 169)
  4233. {
  4234. stream.sendPacket(185);
  4235. stream.addShort(k);
  4236. RSInterface class9_3 = RSInterface.interfaceCache[k];
  4237. if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5)
  4238. {
  4239. int l2 = class9_3.valueIndexArray[0][1];
  4240. variousSettings[l2] = 1 - variousSettings[l2];
  4241. method33(l2);
  4242. needDrawTabArea = true;
  4243. }
  4244. }
  4245. if(l == 447)
  4246. {
  4247. itemSelected = 1;
  4248. anInt1283 = j;
  4249. anInt1284 = k;
  4250. anInt1285 = i1;
  4251. selectedItemName = ItemDef.forID(i1).name;
  4252. spellSelected = 0;
  4253. needDrawTabArea = true;
  4254. return;
  4255. }
  4256. if(l == 1226)
  4257. {
  4258. int j1 = i1 >> 14 & 0x7fff;
  4259. ObjectDef class46 = ObjectDef.forID(j1);
  4260. String s10;
  4261. if(class46.description != null)
  4262. s10 = new String(class46.description);
  4263. else
  4264. s10 = "It's a " + class46.name + ".";
  4265. pushMessage(s10, 0, "");
  4266. }
  4267. if(l == 244)
  4268. {
  4269. boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4270. if(!flag7)
  4271. flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4272. crossX = super.saveClickX;
  4273. crossY = super.saveClickY;
  4274. crossType = 2;
  4275. crossIndex = 0;
  4276. stream.sendPacket(253);
  4277. stream.addLEShort_2(j + baseX);
  4278. stream.addLEShortA(k + baseY);
  4279. stream.method432(i1);
  4280. }
  4281. if(l == 1448)
  4282. {
  4283. ItemDef itemDef_1 = ItemDef.forID(i1);
  4284. String s6;
  4285. if(itemDef_1.description != null)
  4286. s6 = new String(itemDef_1.description);
  4287. else
  4288. s6 = "It's a " + itemDef_1.name + ".";
  4289. pushMessage(s6, 0, "");
  4290. }
  4291. itemSelected = 0;
  4292. spellSelected = 0;
  4293. needDrawTabArea = true;
  4294.  
  4295. }
  4296.  
  4297. private void method70()
  4298. {
  4299. anInt1251 = 0;
  4300. int j = (myPlayer.x >> 7) + baseX;
  4301. int k = (myPlayer.y >> 7) + baseY;
  4302. if(j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
  4303. anInt1251 = 1;
  4304. if(j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
  4305. anInt1251 = 1;
  4306. if(anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
  4307. anInt1251 = 0;
  4308. }
  4309.  
  4310. public void run()
  4311. {
  4312. if(drawFlames)
  4313. {
  4314. drawFlames();
  4315. } else
  4316. {
  4317. super.run();
  4318. }
  4319. }
  4320.  
  4321. private void build3dScreenMenu()
  4322. {
  4323. if(itemSelected == 0 && spellSelected == 0)
  4324. {
  4325. menuActionName[menuActionRow] = "Walk here";
  4326. menuActionID[menuActionRow] = 516;
  4327. menuActionCmd2[menuActionRow] = super.mouseX;
  4328. menuActionCmd3[menuActionRow] = super.mouseY;
  4329. menuActionRow++;
  4330. }
  4331. int j = -1;
  4332. for(int k = 0; k < Model.anInt1687; k++)
  4333. {
  4334. int l = Model.anIntArray1688[k];
  4335. int i1 = l & 0x7f;
  4336. int j1 = l >> 7 & 0x7f;
  4337. int k1 = l >> 29 & 3;
  4338. int l1 = l >> 14 & 0x7fff;
  4339. if(l == j)
  4340. continue;
  4341. j = l;
  4342. if(k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0)
  4343. {
  4344. ObjectDef class46 = ObjectDef.forID(l1);
  4345. if(class46.childrenIDs != null)
  4346. class46 = class46.method580();
  4347. if(class46 == null)
  4348. continue;
  4349. if(itemSelected == 1)
  4350. {
  4351. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @cya@" + class46.name;
  4352. menuActionID[menuActionRow] = 62;
  4353. menuActionCmd1[menuActionRow] = l;
  4354. menuActionCmd2[menuActionRow] = i1;
  4355. menuActionCmd3[menuActionRow] = j1;
  4356. menuActionRow++;
  4357. } else
  4358. if(spellSelected == 1)
  4359. {
  4360. if((spellUsableOn & 4) == 4)
  4361. {
  4362. menuActionName[menuActionRow] = spellTooltip + " @cya@" + class46.name;
  4363. menuActionID[menuActionRow] = 956;
  4364. menuActionCmd1[menuActionRow] = l;
  4365. menuActionCmd2[menuActionRow] = i1;
  4366. menuActionCmd3[menuActionRow] = j1;
  4367. menuActionRow++;
  4368. }
  4369. } else
  4370. {
  4371. if(class46.actions != null)
  4372. {
  4373. for(int i2 = 4; i2 >= 0; i2--)
  4374. if(class46.actions[i2] != null)
  4375. {
  4376. menuActionName[menuActionRow] = class46.actions[i2] + " @cya@" + class46.name;
  4377. if(i2 == 0)
  4378. menuActionID[menuActionRow] = 502;
  4379. if(i2 == 1)
  4380. menuActionID[menuActionRow] = 900;
  4381. if(i2 == 2)
  4382. menuActionID[menuActionRow] = 113;
  4383. if(i2 == 3)
  4384. menuActionID[menuActionRow] = 872;
  4385. if(i2 == 4)
  4386. menuActionID[menuActionRow] = 1062;
  4387. menuActionCmd1[menuActionRow] = l;
  4388. menuActionCmd2[menuActionRow] = i1;
  4389. menuActionCmd3[menuActionRow] = j1;
  4390. menuActionRow++;
  4391. }
  4392.  
  4393. }
  4394. menuActionName[menuActionRow] = "Examine @cya@" + class46.name + " @gre@(@whi@" + l1 + "@gre@) (@whi@" + (i1 + baseX) + "," + (j1 + baseY) + "@gre@)";
  4395. menuActionID[menuActionRow] = 1226;
  4396. menuActionCmd1[menuActionRow] = class46.type << 14;
  4397. menuActionCmd2[menuActionRow] = i1;
  4398. menuActionCmd3[menuActionRow] = j1;
  4399. menuActionRow++;
  4400. }
  4401. }
  4402. if(k1 == 1)
  4403. {
  4404. NPC npc = npcArray[l1];
  4405. if(npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  4406. {
  4407. for(int j2 = 0; j2 < npcCount; j2++)
  4408. {
  4409. NPC npc2 = npcArray[npcIndices[j2]];
  4410. if(npc2 != null && npc2 != npc && npc2.desc.aByte68 == 1 && npc2.x == npc.x && npc2.y == npc.y)
  4411. buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
  4412. }
  4413.  
  4414. for(int l2 = 0; l2 < playerCount; l2++)
  4415. {
  4416. Player player = playerArray[playerIndices[l2]];
  4417. if(player != null && player.x == npc.x && player.y == npc.y)
  4418. buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
  4419. }
  4420.  
  4421. }
  4422. buildAtNPCMenu(npc.desc, l1, j1, i1);
  4423. }
  4424. if(k1 == 0)
  4425. {
  4426. Player player = playerArray[l1];
  4427. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64)
  4428. {
  4429. for(int k2 = 0; k2 < npcCount; k2++)
  4430. {
  4431. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
  4432. if(class30_sub2_sub4_sub1_sub1_2 != null && 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)
  4433. buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc, npcIndices[k2], j1, i1);
  4434. }
  4435.  
  4436. for(int i3 = 0; i3 < playerCount; i3++)
  4437. {
  4438. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
  4439. 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)
  4440. buildAtPlayerMenu(i1, playerIndices[i3], class30_sub2_sub4_sub1_sub2_2, j1);
  4441. }
  4442.  
  4443. }
  4444. buildAtPlayerMenu(i1, l1, player, j1);
  4445. }
  4446. if(k1 == 3)
  4447. {
  4448. NodeList class19 = groundArray[plane][i1][j1];
  4449. if(class19 != null)
  4450. {
  4451. for(Item item = (Item)class19.getFirst(); item != null; item = (Item)class19.getNext())
  4452. {
  4453. ItemDef itemDef = ItemDef.forID(item.ID);
  4454. if(itemSelected == 1)
  4455. {
  4456. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  4457. menuActionID[menuActionRow] = 511;
  4458. menuActionCmd1[menuActionRow] = item.ID;
  4459. menuActionCmd2[menuActionRow] = i1;
  4460. menuActionCmd3[menuActionRow] = j1;
  4461. menuActionRow++;
  4462. } else
  4463. if(spellSelected == 1)
  4464. {
  4465. if((spellUsableOn & 1) == 1)
  4466. {
  4467. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  4468. menuActionID[menuActionRow] = 94;
  4469. menuActionCmd1[menuActionRow] = item.ID;
  4470. menuActionCmd2[menuActionRow] = i1;
  4471. menuActionCmd3[menuActionRow] = j1;
  4472. menuActionRow++;
  4473. }
  4474. } else
  4475. {
  4476. for(int j3 = 4; j3 >= 0; j3--)
  4477. if(itemDef.groundActions != null && itemDef.groundActions[j3] != null)
  4478. {
  4479. menuActionName[menuActionRow] = itemDef.groundActions[j3] + " @lre@" + itemDef.name;
  4480. if(j3 == 0)
  4481. menuActionID[menuActionRow] = 652;
  4482. if(j3 == 1)
  4483. menuActionID[menuActionRow] = 567;
  4484. if(j3 == 2)
  4485. menuActionID[menuActionRow] = 234;
  4486. if(j3 == 3)
  4487. menuActionID[menuActionRow] = 244;
  4488. if(j3 == 4)
  4489. menuActionID[menuActionRow] = 213;
  4490. menuActionCmd1[menuActionRow] = item.ID;
  4491. menuActionCmd2[menuActionRow] = i1;
  4492. menuActionCmd3[menuActionRow] = j1;
  4493. menuActionRow++;
  4494. } else
  4495. if(j3 == 2)
  4496. {
  4497. menuActionName[menuActionRow] = "Take @lre@" + itemDef.name;
  4498. menuActionID[menuActionRow] = 234;
  4499. menuActionCmd1[menuActionRow] = item.ID;
  4500. menuActionCmd2[menuActionRow] = i1;
  4501. menuActionCmd3[menuActionRow] = j1;
  4502. menuActionRow++;
  4503. }
  4504.  
  4505. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + item.ID + "@gre@)";
  4506. menuActionID[menuActionRow] = 1448;
  4507. menuActionCmd1[menuActionRow] = item.ID;
  4508. menuActionCmd2[menuActionRow] = i1;
  4509. menuActionCmd3[menuActionRow] = j1;
  4510. menuActionRow++;
  4511. }
  4512. }
  4513.  
  4514. }
  4515. }
  4516. }
  4517. }
  4518.  
  4519. public void cleanUpForQuit()
  4520. {
  4521. signlink.reporterror = false;
  4522. try
  4523. {
  4524. if(socketStream != null)
  4525. socketStream.close();
  4526. }
  4527. catch(Exception _ex) { }
  4528. socketStream = null;
  4529. stopMidi();
  4530. if(mouseDetection != null)
  4531. mouseDetection.running = false;
  4532. mouseDetection = null;
  4533. onDemandFetcher.disable();
  4534. onDemandFetcher = null;
  4535. aStream_834 = null;
  4536. stream = null;
  4537. aStream_847 = null;
  4538. inStream = null;
  4539. anIntArray1234 = null;
  4540. aByteArrayArray1183 = null;
  4541. aByteArrayArray1247 = null;
  4542. anIntArray1235 = null;
  4543. anIntArray1236 = null;
  4544. intGroundArray = null;
  4545. byteGroundArray = null;
  4546. worldController = null;
  4547. aClass11Array1230 = null;
  4548. anIntArrayArray901 = null;
  4549. anIntArrayArray825 = null;
  4550. bigX = null;
  4551. bigY = null;
  4552. aByteArray912 = null;
  4553. aRSImageProducer_1163 = null;
  4554. aRSImageProducer_1164 = null;
  4555. aRSImageProducer_1165 = null;
  4556. aRSImageProducer_1166 = null;
  4557. aRSImageProducer_1123 = null;
  4558. aRSImageProducer_1124 = null;
  4559. aRSImageProducer_1125 = null;
  4560. backLeftIP1 = null;
  4561. backLeftIP2 = null;
  4562. backRightIP1 = null;
  4563. backRightIP2 = null;
  4564. backTopIP1 = null;
  4565. backVmidIP1 = null;
  4566. backVmidIP2 = null;
  4567. backVmidIP3 = null;
  4568. backVmidIP2_2 = null;
  4569. invBack = null;
  4570. mapBack = null;
  4571. chatBack = null;
  4572. backBase1 = null;
  4573. backBase2 = null;
  4574. backHmid1 = null;
  4575. sideIcons = null;
  4576. redStone1 = null;
  4577. redStone2 = null;
  4578. redStone3 = null;
  4579. redStone1_2 = null;
  4580. redStone2_2 = null;
  4581. redStone1_3 = null;
  4582. redStone2_3 = null;
  4583. redStone3_2 = null;
  4584. redStone1_4 = null;
  4585. redStone2_4 = null;
  4586. compass = null;
  4587. hitMarks = null;
  4588. headIcons = null;
  4589. crosses = null;
  4590. mapDotItem = null;
  4591. mapDotNPC = null;
  4592. mapDotPlayer = null;
  4593. mapDotFriend = null;
  4594. mapDotTeam = null;
  4595. mapScenes = null;
  4596. mapFunctions = null;
  4597. anIntArrayArray929 = null;
  4598. playerArray = null;
  4599. playerIndices = null;
  4600. anIntArray894 = null;
  4601. aStreamArray895s = null;
  4602. anIntArray840 = null;
  4603. npcArray = null;
  4604. npcIndices = null;
  4605. groundArray = null;
  4606. aClass19_1179 = null;
  4607. aClass19_1013 = null;
  4608. aClass19_1056 = null;
  4609. menuActionCmd2 = null;
  4610. menuActionCmd3 = null;
  4611. menuActionID = null;
  4612. menuActionCmd1 = null;
  4613. menuActionName = null;
  4614. variousSettings = null;
  4615. anIntArray1072 = null;
  4616. anIntArray1073 = null;
  4617. aClass30_Sub2_Sub1_Sub1Array1140 = null;
  4618. aClass30_Sub2_Sub1_Sub1_1263 = null;
  4619. friendsList = null;
  4620. friendsListAsLongs = null;
  4621. friendsNodeIDs = null;
  4622. aRSImageProducer_1110 = null;
  4623. aRSImageProducer_1111 = null;
  4624. aRSImageProducer_1107 = null;
  4625. aRSImageProducer_1108 = null;
  4626. aRSImageProducer_1109 = null;
  4627. aRSImageProducer_1112 = null;
  4628. aRSImageProducer_1113 = null;
  4629. aRSImageProducer_1114 = null;
  4630. aRSImageProducer_1115 = null;
  4631. nullLoader();
  4632. ObjectDef.nullLoader();
  4633. EntityDef.nullLoader();
  4634. ItemDef.nullLoader();
  4635. Flo.cache = null;
  4636. IDK.cache = null;
  4637. RSInterface.interfaceCache = null;
  4638. DummyClass.cache = null;
  4639. Animation.anims = null;
  4640. SpotAnim.cache = null;
  4641. SpotAnim.aMRUNodes_415 = null;
  4642. Varp.cache = null;
  4643. super.fullGameScreen = null;
  4644. Player.mruNodes = null;
  4645. Texture.nullLoader();
  4646. WorldController.nullLoader();
  4647. Model.nullLoader();
  4648. Class36.nullLoader();
  4649. System.gc();
  4650. }
  4651.  
  4652. private void printDebug()
  4653. {
  4654. System.out.println("============");
  4655. System.out.println("flame-cycle:" + anInt1208);
  4656. if(onDemandFetcher != null)
  4657. System.out.println("Od-cycle:" + onDemandFetcher.onDemandCycle);
  4658. System.out.println("loop-cycle:" + loopCycle);
  4659. System.out.println("draw-cycle:" + anInt1061);
  4660. System.out.println("ptype:" + pktType);
  4661. System.out.println("psize:" + pktSize);
  4662. if(socketStream != null)
  4663. socketStream.printDebug();
  4664. super.shouldDebug = true;
  4665. }
  4666.  
  4667. Component getGameComponent()
  4668. {
  4669. if(signlink.mainapp != null)
  4670. return signlink.mainapp;
  4671. if(super.gameFrame != null)
  4672. return super.gameFrame;
  4673. else
  4674. return this;
  4675. }
  4676.  
  4677. private void method73()
  4678. {
  4679. do
  4680. {
  4681. int j = readChar(-796);
  4682. if(j == -1)
  4683. break;
  4684. if(openInterfaceID != -1 && openInterfaceID == reportAbuseInterfaceID)
  4685. {
  4686. if(j == 8 && reportAbuseInput.length() > 0)
  4687. reportAbuseInput = reportAbuseInput.substring(0, reportAbuseInput.length() - 1);
  4688. if((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48 && j <= 57 || j == 32) && reportAbuseInput.length() < 12)
  4689. reportAbuseInput += (char)j;
  4690. } else
  4691. if(messagePromptRaised)
  4692. {
  4693. if(j >= 32 && j <= 122 && promptInput.length() < 80)
  4694. {
  4695. promptInput += (char)j;
  4696. inputTaken = true;
  4697. }
  4698. if(j == 8 && promptInput.length() > 0)
  4699. {
  4700. promptInput = promptInput.substring(0, promptInput.length() - 1);
  4701. inputTaken = true;
  4702. }
  4703. if(j == 13 || j == 10)
  4704. {
  4705. messagePromptRaised = false;
  4706. inputTaken = true;
  4707. if(friendsListAction == 1)
  4708. {
  4709. long l = TextClass.longForName(promptInput);
  4710. addFriend(l);
  4711. }
  4712. if(friendsListAction == 2 && friendsCount > 0)
  4713. {
  4714. long l1 = TextClass.longForName(promptInput);
  4715. delFriend(l1);
  4716. }
  4717. if(friendsListAction == 3 && promptInput.length() > 0)
  4718. {
  4719. stream.sendPacket(126);
  4720. stream.addByte(0);
  4721. int k = stream.currentOffset;
  4722. stream.addLong(aLong953);
  4723. TextInput.method526(promptInput, stream);
  4724. stream.writeBytes(stream.currentOffset - k);
  4725. promptInput = TextInput.processText(promptInput);
  4726. promptInput = Censor.doCensor(promptInput);
  4727. pushMessage(promptInput, 6, TextClass.fixName(TextClass.nameForLong(aLong953)));
  4728. if(privateChatMode == 2)
  4729. {
  4730. privateChatMode = 1;
  4731. aBoolean1233 = true;
  4732. stream.sendPacket(95);
  4733. stream.addByte(publicChatMode);
  4734. stream.addByte(privateChatMode);
  4735. stream.addByte(tradeMode);
  4736. }
  4737. }
  4738. if(friendsListAction == 4 && ignoreCount < 100)
  4739. {
  4740. long l2 = TextClass.longForName(promptInput);
  4741. addIgnore(l2);
  4742. }
  4743. if(friendsListAction == 5 && ignoreCount > 0)
  4744. {
  4745. long l3 = TextClass.longForName(promptInput);
  4746. delIgnore(l3);
  4747. }
  4748. }
  4749. } else
  4750. if(inputDialogState == 1)
  4751. {
  4752. if(j >= 48 && j <= 57 && amountOrNameInput.length() < 10)
  4753. {
  4754. amountOrNameInput += (char)j;
  4755. inputTaken = true;
  4756. }
  4757. if(j == 8 && amountOrNameInput.length() > 0)
  4758. {
  4759. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  4760. inputTaken = true;
  4761. }
  4762. if(j == 13 || j == 10)
  4763. {
  4764. if(amountOrNameInput.length() > 0)
  4765. {
  4766. int i1 = 0;
  4767. try
  4768. {
  4769. i1 = Integer.parseInt(amountOrNameInput);
  4770. }
  4771. catch(Exception _ex) { }
  4772. stream.sendPacket(208);
  4773. stream.addInt(i1);
  4774. }
  4775. inputDialogState = 0;
  4776. inputTaken = true;
  4777. }
  4778. } else
  4779. if(inputDialogState == 2)
  4780. {
  4781. if(j >= 32 && j <= 122 && amountOrNameInput.length() < 12)
  4782. {
  4783. amountOrNameInput += (char)j;
  4784. inputTaken = true;
  4785. }
  4786. if(j == 8 && amountOrNameInput.length() > 0)
  4787. {
  4788. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  4789. inputTaken = true;
  4790. }
  4791. if(j == 13 || j == 10)
  4792. {
  4793. if(amountOrNameInput.length() > 0)
  4794. {
  4795. stream.sendPacket(60);
  4796. stream.addLong(TextClass.longForName(amountOrNameInput));
  4797. }
  4798. inputDialogState = 0;
  4799. inputTaken = true;
  4800. }
  4801. } else
  4802. if(backDialogID == -1)
  4803. {
  4804. if(j >= 32 && j <= 122 && inputString.length() < 80)
  4805. {
  4806. inputString += (char)j;
  4807. inputTaken = true;
  4808. }
  4809. if(j == 8 && inputString.length() > 0)
  4810. {
  4811. inputString = inputString.substring(0, inputString.length() - 1);
  4812. inputTaken = true;
  4813. }
  4814. if((j == 13 || j == 10) && inputString.length() > 0)
  4815. {
  4816. if(myPrivilege == 2)
  4817. {
  4818. if(inputString.equals("::clientdrop"))
  4819. dropClient();
  4820. if(inputString.equals("::lag"))
  4821. printDebug();
  4822. if(inputString.equals("::prefetchmusic"))
  4823. {
  4824. for(int j1 = 0; j1 < onDemandFetcher.getVersionCount(2); j1++)
  4825. onDemandFetcher.method563((byte)1, 2, j1);
  4826.  
  4827. }
  4828. if(inputString.equals("::fpson"))
  4829. fpsOn = true;
  4830. if(inputString.equals("::fpsoff"))
  4831. fpsOn = false;
  4832. if(inputString.equals("::noclip"))
  4833. {
  4834. for(int k1 = 0; k1 < 4; k1++)
  4835. {
  4836. for(int i2 = 1; i2 < 103; i2++)
  4837. {
  4838. for(int k2 = 1; k2 < 103; k2++)
  4839. aClass11Array1230[k1].anIntArrayArray294[i2][k2] = 0;
  4840.  
  4841. }
  4842.  
  4843. }
  4844.  
  4845. }
  4846. }
  4847. if(inputString.startsWith("::"))
  4848. {
  4849. stream.sendPacket(103);
  4850. stream.addByte(inputString.length() - 1);
  4851. stream.writeString(inputString.substring(2));
  4852. } else
  4853. {
  4854. String s = inputString.toLowerCase();
  4855. int j2 = 0;
  4856. if(s.startsWith("yellow:"))
  4857. {
  4858. j2 = 0;
  4859. inputString = inputString.substring(7);
  4860. } else
  4861. if(s.startsWith("red:"))
  4862. {
  4863. j2 = 1;
  4864. inputString = inputString.substring(4);
  4865. } else
  4866. if(s.startsWith("green:"))
  4867. {
  4868. j2 = 2;
  4869. inputString = inputString.substring(6);
  4870. } else
  4871. if(s.startsWith("cyan:"))
  4872. {
  4873. j2 = 3;
  4874. inputString = inputString.substring(5);
  4875. } else
  4876. if(s.startsWith("purple:"))
  4877. {
  4878. j2 = 4;
  4879. inputString = inputString.substring(7);
  4880. } else
  4881. if(s.startsWith("white:"))
  4882. {
  4883. j2 = 5;
  4884. inputString = inputString.substring(6);
  4885. } else
  4886. if(s.startsWith("flash1:"))
  4887. {
  4888. j2 = 6;
  4889. inputString = inputString.substring(7);
  4890. } else
  4891. if(s.startsWith("flash2:"))
  4892. {
  4893. j2 = 7;
  4894. inputString = inputString.substring(7);
  4895. } else
  4896. if(s.startsWith("flash3:"))
  4897. {
  4898. j2 = 8;
  4899. inputString = inputString.substring(7);
  4900. } else
  4901. if(s.startsWith("glow1:"))
  4902. {
  4903. j2 = 9;
  4904. inputString = inputString.substring(6);
  4905. } else
  4906. if(s.startsWith("glow2:"))
  4907. {
  4908. j2 = 10;
  4909. inputString = inputString.substring(6);
  4910. } else
  4911. if(s.startsWith("glow3:"))
  4912. {
  4913. j2 = 11;
  4914. inputString = inputString.substring(6);
  4915. }
  4916. s = inputString.toLowerCase();
  4917. int i3 = 0;
  4918. if(s.startsWith("wave:"))
  4919. {
  4920. i3 = 1;
  4921. inputString = inputString.substring(5);
  4922. } else
  4923. if(s.startsWith("wave2:"))
  4924. {
  4925. i3 = 2;
  4926. inputString = inputString.substring(6);
  4927. } else
  4928. if(s.startsWith("shake:"))
  4929. {
  4930. i3 = 3;
  4931. inputString = inputString.substring(6);
  4932. } else
  4933. if(s.startsWith("scroll:"))
  4934. {
  4935. i3 = 4;
  4936. inputString = inputString.substring(7);
  4937. } else
  4938. if(s.startsWith("slide:"))
  4939. {
  4940. i3 = 5;
  4941. inputString = inputString.substring(6);
  4942. }
  4943. stream.sendPacket(4);
  4944. stream.addByte(0);
  4945. int j3 = stream.currentOffset;
  4946. stream.readByteS(i3);
  4947. stream.readByteS(j2);
  4948. aStream_834.currentOffset = 0;
  4949. TextInput.method526(inputString, aStream_834);
  4950. stream.method441(0, aStream_834.buffer, aStream_834.currentOffset);
  4951. stream.writeBytes(stream.currentOffset - j3);
  4952. inputString = TextInput.processText(inputString);
  4953. inputString = Censor.doCensor(inputString);
  4954. myPlayer.textSpoken = inputString;
  4955. myPlayer.anInt1513 = j2;
  4956. myPlayer.anInt1531 = i3;
  4957. myPlayer.textCycle = 150;
  4958. if(myPrivilege == 2)
  4959. pushMessage(myPlayer.textSpoken, 2, "@cr2@" + myPlayer.name);
  4960. else
  4961. if(myPrivilege == 1)
  4962. pushMessage(myPlayer.textSpoken, 2, "@cr1@" + myPlayer.name);
  4963. else
  4964. pushMessage(myPlayer.textSpoken, 2, myPlayer.name);
  4965. if(publicChatMode == 2)
  4966. {
  4967. publicChatMode = 3;
  4968. aBoolean1233 = true;
  4969. stream.sendPacket(95);
  4970. stream.addByte(publicChatMode);
  4971. stream.addByte(privateChatMode);
  4972. stream.addByte(tradeMode);
  4973. }
  4974. }
  4975. inputString = "";
  4976. inputTaken = true;
  4977. }
  4978. }
  4979. } while(true);
  4980. }
  4981.  
  4982. private void buildChatAreaMenu(int j)
  4983. {
  4984. int l = 0;
  4985. for(int i1 = 0; i1 < 100; i1++)
  4986. {
  4987. if(chatMessages[i1] == null)
  4988. continue;
  4989. int j1 = chatTypes[i1];
  4990. int k1 = (70 - l * 14) + anInt1089 + 4;
  4991. if(k1 < -20)
  4992. break;
  4993. String s = chatNames[i1];
  4994. boolean flag = false;
  4995. if(s != null && s.startsWith("@cr1@"))
  4996. {
  4997. s = s.substring(5);
  4998. boolean flag1 = true;
  4999. }
  5000. if(s != null && s.startsWith("@cr2@"))
  5001. {
  5002. s = s.substring(5);
  5003. byte byte0 = 2;
  5004. }
  5005. if(j1 == 0)
  5006. l++;
  5007. if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s)))
  5008. {
  5009. if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name))
  5010. {
  5011. if(myPrivilege >= 1)
  5012. {
  5013. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5014. menuActionID[menuActionRow] = 606;
  5015. menuActionRow++;
  5016. }
  5017. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5018. menuActionID[menuActionRow] = 42;
  5019. menuActionRow++;
  5020. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5021. menuActionID[menuActionRow] = 337;
  5022. menuActionRow++;
  5023. }
  5024. l++;
  5025. }
  5026. if((j1 == 3 || j1 == 7) && splitPrivateChat == 0 && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5027. {
  5028. if(j > k1 - 14 && j <= k1)
  5029. {
  5030. if(myPrivilege >= 1)
  5031. {
  5032. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5033. menuActionID[menuActionRow] = 606;
  5034. menuActionRow++;
  5035. }
  5036. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5037. menuActionID[menuActionRow] = 42;
  5038. menuActionRow++;
  5039. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5040. menuActionID[menuActionRow] = 337;
  5041. menuActionRow++;
  5042. }
  5043. l++;
  5044. }
  5045. if(j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s)))
  5046. {
  5047. if(j > k1 - 14 && j <= k1)
  5048. {
  5049. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  5050. menuActionID[menuActionRow] = 484;
  5051. menuActionRow++;
  5052. }
  5053. l++;
  5054. }
  5055. if((j1 == 5 || j1 == 6) && splitPrivateChat == 0 && privateChatMode < 2)
  5056. l++;
  5057. if(j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s)))
  5058. {
  5059. if(j > k1 - 14 && j <= k1)
  5060. {
  5061. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  5062. menuActionID[menuActionRow] = 6;
  5063. menuActionRow++;
  5064. }
  5065. l++;
  5066. }
  5067. }
  5068.  
  5069. }
  5070.  
  5071. private void drawFriendsListOrWelcomeScreen(RSInterface class9)
  5072. {
  5073. int j = class9.anInt214;
  5074. if(j >= 1 && j <= 100 || j >= 701 && j <= 800)
  5075. {
  5076. if(j == 1 && anInt900 == 0)
  5077. {
  5078. class9.message = "Loading friend list";
  5079. class9.atActionType = 0;
  5080. return;
  5081. }
  5082. if(j == 1 && anInt900 == 1)
  5083. {
  5084. class9.message = "Connecting to friendserver";
  5085. class9.atActionType = 0;
  5086. return;
  5087. }
  5088. if(j == 2 && anInt900 != 2)
  5089. {
  5090. class9.message = "Please wait...";
  5091. class9.atActionType = 0;
  5092. return;
  5093. }
  5094. int k = friendsCount;
  5095. if(anInt900 != 2)
  5096. k = 0;
  5097. if(j > 700)
  5098. j -= 601;
  5099. else
  5100. j--;
  5101. if(j >= k)
  5102. {
  5103. class9.message = "";
  5104. class9.atActionType = 0;
  5105. return;
  5106. } else
  5107. {
  5108. class9.message = friendsList[j];
  5109. class9.atActionType = 1;
  5110. return;
  5111. }
  5112. }
  5113. if(j >= 101 && j <= 200 || j >= 801 && j <= 900)
  5114. {
  5115. int l = friendsCount;
  5116. if(anInt900 != 2)
  5117. l = 0;
  5118. if(j > 800)
  5119. j -= 701;
  5120. else
  5121. j -= 101;
  5122. if(j >= l)
  5123. {
  5124. class9.message = "";
  5125. class9.atActionType = 0;
  5126. return;
  5127. }
  5128. if(friendsNodeIDs[j] == 0)
  5129. class9.message = "@red@Offline";
  5130. else
  5131. if(friendsNodeIDs[j] == nodeID)
  5132. class9.message = "@gre@World-" + (friendsNodeIDs[j] - 9);
  5133. else
  5134. class9.message = "@yel@World-" + (friendsNodeIDs[j] - 9);
  5135. class9.atActionType = 1;
  5136. return;
  5137. }
  5138. if(j == 203)
  5139. {
  5140. int i1 = friendsCount;
  5141. if(anInt900 != 2)
  5142. i1 = 0;
  5143. class9.scrollMax = i1 * 15 + 20;
  5144. if(class9.scrollMax <= class9.height)
  5145. class9.scrollMax = class9.height + 1;
  5146. return;
  5147. }
  5148. if(j >= 401 && j <= 500)
  5149. {
  5150. if((j -= 401) == 0 && anInt900 == 0)
  5151. {
  5152. class9.message = "Loading ignore list";
  5153. class9.atActionType = 0;
  5154. return;
  5155. }
  5156. if(j == 1 && anInt900 == 0)
  5157. {
  5158. class9.message = "Please wait...";
  5159. class9.atActionType = 0;
  5160. return;
  5161. }
  5162. int j1 = ignoreCount;
  5163. if(anInt900 == 0)
  5164. j1 = 0;
  5165. if(j >= j1)
  5166. {
  5167. class9.message = "";
  5168. class9.atActionType = 0;
  5169. return;
  5170. } else
  5171. {
  5172. class9.message = TextClass.fixName(TextClass.nameForLong(ignoreListAsLongs[j]));
  5173. class9.atActionType = 1;
  5174. return;
  5175. }
  5176. }
  5177. if(j == 503)
  5178. {
  5179. class9.scrollMax = ignoreCount * 15 + 20;
  5180. if(class9.scrollMax <= class9.height)
  5181. class9.scrollMax = class9.height + 1;
  5182. return;
  5183. }
  5184. if(j == 327)
  5185. {
  5186. class9.anInt270 = 150;
  5187. class9.anInt271 = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  5188. if(aBoolean1031)
  5189. {
  5190. for(int k1 = 0; k1 < 7; k1++)
  5191. {
  5192. int l1 = anIntArray1065[k1];
  5193. if(l1 >= 0 && !IDK.cache[l1].method537())
  5194. return;
  5195. }
  5196.  
  5197. aBoolean1031 = false;
  5198. Model aclass30_sub2_sub4_sub6s[] = new Model[7];
  5199. int i2 = 0;
  5200. for(int j2 = 0; j2 < 7; j2++)
  5201. {
  5202. int k2 = anIntArray1065[j2];
  5203. if(k2 >= 0)
  5204. aclass30_sub2_sub4_sub6s[i2++] = IDK.cache[k2].method538();
  5205. }
  5206.  
  5207. Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
  5208. for(int l2 = 0; l2 < 5; l2++)
  5209. if(anIntArray990[l2] != 0)
  5210. {
  5211. model.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  5212. if(l2 == 1)
  5213. model.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  5214. }
  5215.  
  5216. model.method469();
  5217. model.method470(Animation.anims[myPlayer.anInt1511].anIntArray353[0]);
  5218. model.method479(64, 850, -30, -50, -30, true);
  5219. class9.anInt233 = 5;
  5220. class9.mediaID = 0;
  5221. RSInterface.method208(aBoolean994, model);
  5222. }
  5223. return;
  5224. }
  5225. if(j == 324)
  5226. {
  5227. if(aClass30_Sub2_Sub1_Sub1_931 == null)
  5228. {
  5229. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  5230. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  5231. }
  5232. if(aBoolean1047)
  5233. {
  5234. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  5235. return;
  5236. } else
  5237. {
  5238. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  5239. return;
  5240. }
  5241. }
  5242. if(j == 325)
  5243. {
  5244. if(aClass30_Sub2_Sub1_Sub1_931 == null)
  5245. {
  5246. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  5247. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  5248. }
  5249. if(aBoolean1047)
  5250. {
  5251. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  5252. return;
  5253. } else
  5254. {
  5255. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  5256. return;
  5257. }
  5258. }
  5259. if(j == 600)
  5260. {
  5261. class9.message = reportAbuseInput;
  5262. if(loopCycle % 20 < 10)
  5263. {
  5264. class9.message += "|";
  5265. return;
  5266. } else
  5267. {
  5268. class9.message += " ";
  5269. return;
  5270. }
  5271. }
  5272. if(j == 613)
  5273. if(myPrivilege >= 1)
  5274. {
  5275. if(canMute)
  5276. {
  5277. class9.textColor = 0xff0000;
  5278. class9.message = "Moderator option: Mute player for 48 hours: <ON>";
  5279. } else
  5280. {
  5281. class9.textColor = 0xffffff;
  5282. class9.message = "Moderator option: Mute player for 48 hours: <OFF>";
  5283. }
  5284. } else
  5285. {
  5286. class9.message = "";
  5287. }
  5288. if(j == 650 || j == 655)
  5289. if(anInt1193 != 0)
  5290. {
  5291. String s;
  5292. if(daysSinceLastLogin == 0)
  5293. s = "earlier today";
  5294. else
  5295. if(daysSinceLastLogin == 1)
  5296. s = "yesterday";
  5297. else
  5298. s = daysSinceLastLogin + " days ago";
  5299. class9.message = "You last logged in " + s + " from: " + signlink.dns;
  5300. } else
  5301. {
  5302. class9.message = "";
  5303. }
  5304. if(j == 651)
  5305. {
  5306. if(unreadMessages == 0)
  5307. {
  5308. class9.message = "0 unread messages";
  5309. class9.textColor = 0xffff00;
  5310. }
  5311. if(unreadMessages == 1)
  5312. {
  5313. class9.message = "1 unread message";
  5314. class9.textColor = 65280;
  5315. }
  5316. if(unreadMessages > 1)
  5317. {
  5318. class9.message = unreadMessages + " unread messages";
  5319. class9.textColor = 65280;
  5320. }
  5321. }
  5322. if(j == 652)
  5323. if(daysSinceRecovChange == 201)
  5324. {
  5325. if(membersInt == 1)
  5326. class9.message = "@yel@This is a non-members world: @whi@Since you are a member we";
  5327. else
  5328. class9.message = "";
  5329. } else
  5330. if(daysSinceRecovChange == 200)
  5331. {
  5332. class9.message = "You have not yet set any password recovery questions.";
  5333. } else
  5334. {
  5335. String s1;
  5336. if(daysSinceRecovChange == 0)
  5337. s1 = "Earlier today";
  5338. else
  5339. if(daysSinceRecovChange == 1)
  5340. s1 = "Yesterday";
  5341. else
  5342. s1 = daysSinceRecovChange + " days ago";
  5343. class9.message = s1 + " you changed your recovery questions";
  5344. }
  5345. if(j == 653)
  5346. if(daysSinceRecovChange == 201)
  5347. {
  5348. if(membersInt == 1)
  5349. class9.message = "@whi@recommend you use a members world instead. You may use";
  5350. else
  5351. class9.message = "";
  5352. } else
  5353. if(daysSinceRecovChange == 200)
  5354. class9.message = "We strongly recommend you do so now to secure your account.";
  5355. else
  5356. class9.message = "If you do not remember making this change then cancel it immediately";
  5357. if(j == 654)
  5358. {
  5359. if(daysSinceRecovChange == 201)
  5360. if(membersInt == 1)
  5361. {
  5362. class9.message = "@whi@this world but member benefits are unavailable whilst here.";
  5363. return;
  5364. } else
  5365. {
  5366. class9.message = "";
  5367. return;
  5368. }
  5369. if(daysSinceRecovChange == 200)
  5370. {
  5371. class9.message = "Do this from the 'account management' area on our front webpage";
  5372. return;
  5373. }
  5374. class9.message = "Do this from the 'account management' area on our front webpage";
  5375. }
  5376. }
  5377.  
  5378. private void drawSplitPrivateChat()
  5379. {
  5380. if(splitPrivateChat == 0)
  5381. return;
  5382. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  5383. int i = 0;
  5384. if(anInt1104 != 0)
  5385. i = 1;
  5386. for(int j = 0; j < 100; j++)
  5387. if(chatMessages[j] != null)
  5388. {
  5389. int k = chatTypes[j];
  5390. String s = chatNames[j];
  5391. byte byte1 = 0;
  5392. if(s != null && s.startsWith("@cr1@"))
  5393. {
  5394. s = s.substring(5);
  5395. byte1 = 1;
  5396. }
  5397. if(s != null && s.startsWith("@cr2@"))
  5398. {
  5399. s = s.substring(5);
  5400. byte1 = 2;
  5401. }
  5402. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5403. {
  5404. int l = 329 - i * 13;
  5405. int k1 = 4;
  5406. textDrawingArea.method385(0, "From", l, k1);
  5407. textDrawingArea.method385(65535, "From", l - 1, k1);
  5408. k1 += textDrawingArea.getTextWidth("From ");
  5409. if(byte1 == 1)
  5410. {
  5411. modIcons[0].method361(k1, l - 12);
  5412. k1 += 14;
  5413. }
  5414. if(byte1 == 2)
  5415. {
  5416. modIcons[1].method361(k1, l - 12);
  5417. k1 += 14;
  5418. }
  5419. textDrawingArea.method385(0, s + ": " + chatMessages[j], l, k1);
  5420. textDrawingArea.method385(65535, s + ": " + chatMessages[j], l - 1, k1);
  5421. if(++i >= 5)
  5422. return;
  5423. }
  5424. if(k == 5 && privateChatMode < 2)
  5425. {
  5426. int i1 = 329 - i * 13;
  5427. textDrawingArea.method385(0, chatMessages[j], i1, 4);
  5428. textDrawingArea.method385(65535, chatMessages[j], i1 - 1, 4);
  5429. if(++i >= 5)
  5430. return;
  5431. }
  5432. if(k == 6 && privateChatMode < 2)
  5433. {
  5434. int j1 = 329 - i * 13;
  5435. textDrawingArea.method385(0, "To " + s + ": " + chatMessages[j], j1, 4);
  5436. textDrawingArea.method385(65535, "To " + s + ": " + chatMessages[j], j1 - 1, 4);
  5437. if(++i >= 5)
  5438. return;
  5439. }
  5440. }
  5441.  
  5442. }
  5443.  
  5444. private void pushMessage(String s, int i, String s1)
  5445. {
  5446. if(i == 0 && dialogID != -1)
  5447. {
  5448. aString844 = s;
  5449. super.clickMode3 = 0;
  5450. }
  5451. if(backDialogID == -1)
  5452. inputTaken = true;
  5453. for(int j = 99; j > 0; j--)
  5454. {
  5455. chatTypes[j] = chatTypes[j - 1];
  5456. chatNames[j] = chatNames[j - 1];
  5457. chatMessages[j] = chatMessages[j - 1];
  5458. }
  5459.  
  5460. chatTypes[0] = i;
  5461. chatNames[0] = s1;
  5462. chatMessages[0] = s;
  5463. }
  5464.  
  5465. private void processTabClick()
  5466. {
  5467. if(super.clickMode3 == 1)
  5468. {
  5469. if(super.saveClickX >= 539 && super.saveClickX <= 573 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[0] != -1)
  5470. {
  5471. needDrawTabArea = true;
  5472. tabID = 0;
  5473. tabAreaAltered = true;
  5474. }
  5475. if(super.saveClickX >= 569 && super.saveClickX <= 599 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[1] != -1)
  5476. {
  5477. needDrawTabArea = true;
  5478. tabID = 1;
  5479. tabAreaAltered = true;
  5480. }
  5481. if(super.saveClickX >= 597 && super.saveClickX <= 627 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[2] != -1)
  5482. {
  5483. needDrawTabArea = true;
  5484. tabID = 2;
  5485. tabAreaAltered = true;
  5486. }
  5487. if(super.saveClickX >= 625 && super.saveClickX <= 669 && super.saveClickY >= 168 && super.saveClickY < 203 && tabInterfaceIDs[3] != -1)
  5488. {
  5489. needDrawTabArea = true;
  5490. tabID = 3;
  5491. tabAreaAltered = true;
  5492. }
  5493. if(super.saveClickX >= 666 && super.saveClickX <= 696 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[4] != -1)
  5494. {
  5495. needDrawTabArea = true;
  5496. tabID = 4;
  5497. tabAreaAltered = true;
  5498. }
  5499. if(super.saveClickX >= 694 && super.saveClickX <= 724 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[5] != -1)
  5500. {
  5501. needDrawTabArea = true;
  5502. tabID = 5;
  5503. tabAreaAltered = true;
  5504. }
  5505. if(super.saveClickX >= 722 && super.saveClickX <= 756 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[6] != -1)
  5506. {
  5507. needDrawTabArea = true;
  5508. tabID = 6;
  5509. tabAreaAltered = true;
  5510. }
  5511. if(super.saveClickX >= 540 && super.saveClickX <= 574 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[7] != -1)
  5512. {
  5513. needDrawTabArea = true;
  5514. tabID = 7;
  5515. tabAreaAltered = true;
  5516. }
  5517. if(super.saveClickX >= 572 && super.saveClickX <= 602 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[8] != -1)
  5518. {
  5519. needDrawTabArea = true;
  5520. tabID = 8;
  5521. tabAreaAltered = true;
  5522. }
  5523. if(super.saveClickX >= 599 && super.saveClickX <= 629 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[9] != -1)
  5524. {
  5525. needDrawTabArea = true;
  5526. tabID = 9;
  5527. tabAreaAltered = true;
  5528. }
  5529. if(super.saveClickX >= 627 && super.saveClickX <= 671 && super.saveClickY >= 467 && super.saveClickY < 502 && tabInterfaceIDs[10] != -1)
  5530. {
  5531. needDrawTabArea = true;
  5532. tabID = 10;
  5533. tabAreaAltered = true;
  5534. }
  5535. if(super.saveClickX >= 669 && super.saveClickX <= 699 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[11] != -1)
  5536. {
  5537. needDrawTabArea = true;
  5538. tabID = 11;
  5539. tabAreaAltered = true;
  5540. }
  5541. if(super.saveClickX >= 696 && super.saveClickX <= 726 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[12] != -1)
  5542. {
  5543. needDrawTabArea = true;
  5544. tabID = 12;
  5545. tabAreaAltered = true;
  5546. }
  5547. if(super.saveClickX >= 724 && super.saveClickX <= 758 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[13] != -1)
  5548. {
  5549. needDrawTabArea = true;
  5550. tabID = 13;
  5551. tabAreaAltered = true;
  5552. }
  5553. }
  5554. }
  5555.  
  5556. private void resetImageProducers2()
  5557. {
  5558. if(aRSImageProducer_1166 != null)
  5559. return;
  5560. nullLoader();
  5561. super.fullGameScreen = null;
  5562. aRSImageProducer_1107 = null;
  5563. aRSImageProducer_1108 = null;
  5564. aRSImageProducer_1109 = null;
  5565. aRSImageProducer_1110 = null;
  5566. aRSImageProducer_1111 = null;
  5567. aRSImageProducer_1112 = null;
  5568. aRSImageProducer_1113 = null;
  5569. aRSImageProducer_1114 = null;
  5570. aRSImageProducer_1115 = null;
  5571. aRSImageProducer_1166 = new RSImageProducer(479, 96, getGameComponent());
  5572. aRSImageProducer_1164 = new RSImageProducer(172, 156, getGameComponent());
  5573. DrawingArea.setAllPixelsToZero();
  5574. mapBack.method361(0, 0);
  5575. aRSImageProducer_1163 = new RSImageProducer(190, 261, getGameComponent());
  5576. aRSImageProducer_1165 = new RSImageProducer(512, 334, getGameComponent());
  5577. DrawingArea.setAllPixelsToZero();
  5578. aRSImageProducer_1123 = new RSImageProducer(496, 50, getGameComponent());
  5579. aRSImageProducer_1124 = new RSImageProducer(269, 37, getGameComponent());
  5580. aRSImageProducer_1125 = new RSImageProducer(249, 45, getGameComponent());
  5581. welcomeScreenRaised = true;
  5582. }
  5583.  
  5584. private String getDocumentBaseHost()
  5585. {
  5586. if(signlink.mainapp != null)
  5587. return signlink.mainapp.getDocumentBase().getHost().toLowerCase();
  5588. if(super.gameFrame != null)
  5589. return "runescape.com";
  5590. else
  5591. return super.getDocumentBase().getHost().toLowerCase();
  5592. }
  5593.  
  5594. private void method81(Sprite sprite, int j, int k)
  5595. {
  5596. int l = k * k + j * j;
  5597. if(l > 4225 && l < 0x15f90)
  5598. {
  5599. int i1 = minimapInt1 + minimapInt2 & 0x7ff;
  5600. int j1 = Model.modelIntArray1[i1];
  5601. int k1 = Model.modelIntArray2[i1];
  5602. j1 = (j1 * 256) / (minimapInt3 + 256);
  5603. k1 = (k1 * 256) / (minimapInt3 + 256);
  5604. int l1 = j * j1 + k * k1 >> 16;
  5605. int i2 = j * k1 - k * j1 >> 16;
  5606. double d = Math.atan2(l1, i2);
  5607. int j2 = (int)(Math.sin(d) * 63D);
  5608. int k2 = (int)(Math.cos(d) * 57D);
  5609. mapEdge.method353(83 - k2 - 20, d, (94 + j2 + 4) - 10);
  5610. } else
  5611. {
  5612. markMinimap(sprite, k, j);
  5613. }
  5614. }
  5615.  
  5616. private void processRightClick()
  5617. {
  5618. if(activeInterfaceType != 0)
  5619. return;
  5620. menuActionName[0] = "Cancel";
  5621. menuActionID[0] = 1107;
  5622. menuActionRow = 1;
  5623. buildSplitPrivateChatMenu();
  5624. anInt886 = 0;
  5625. if(super.mouseX > 4 && super.mouseY > 4 && super.mouseX < 516 && super.mouseY < 338)
  5626. if(openInterfaceID != -1)
  5627. buildInterfaceMenu(4, RSInterface.interfaceCache[openInterfaceID], super.mouseX, 4, super.mouseY, 0);
  5628. else
  5629. build3dScreenMenu();
  5630. if(anInt886 != anInt1026)
  5631. anInt1026 = anInt886;
  5632. anInt886 = 0;
  5633. if(super.mouseX > 553 && super.mouseY > 205 && super.mouseX < 743 && super.mouseY < 466)
  5634. if(invOverlayInterfaceID != -1)
  5635. buildInterfaceMenu(553, RSInterface.interfaceCache[invOverlayInterfaceID], super.mouseX, 205, super.mouseY, 0);
  5636. else
  5637. if(tabInterfaceIDs[tabID] != -1)
  5638. buildInterfaceMenu(553, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], super.mouseX, 205, super.mouseY, 0);
  5639. if(anInt886 != anInt1048)
  5640. {
  5641. needDrawTabArea = true;
  5642. anInt1048 = anInt886;
  5643. }
  5644. anInt886 = 0;
  5645. if(super.mouseX > 17 && super.mouseY > 357 && super.mouseX < 496 && super.mouseY < 453)
  5646. if(backDialogID != -1)
  5647. buildInterfaceMenu(17, RSInterface.interfaceCache[backDialogID], super.mouseX, 357, super.mouseY, 0);
  5648. else
  5649. if(super.mouseY < 434 && super.mouseX < 426)
  5650. buildChatAreaMenu(super.mouseY - 357);
  5651. if(backDialogID != -1 && anInt886 != anInt1039)
  5652. {
  5653. inputTaken = true;
  5654. anInt1039 = anInt886;
  5655. }
  5656. boolean flag = false;
  5657. while(!flag)
  5658. {
  5659. flag = true;
  5660. for(int j = 0; j < menuActionRow - 1; j++)
  5661. if(menuActionID[j] < 1000 && menuActionID[j + 1] > 1000)
  5662. {
  5663. String s = menuActionName[j];
  5664. menuActionName[j] = menuActionName[j + 1];
  5665. menuActionName[j + 1] = s;
  5666. int k = menuActionID[j];
  5667. menuActionID[j] = menuActionID[j + 1];
  5668. menuActionID[j + 1] = k;
  5669. k = menuActionCmd2[j];
  5670. menuActionCmd2[j] = menuActionCmd2[j + 1];
  5671. menuActionCmd2[j + 1] = k;
  5672. k = menuActionCmd3[j];
  5673. menuActionCmd3[j] = menuActionCmd3[j + 1];
  5674. menuActionCmd3[j + 1] = k;
  5675. k = menuActionCmd1[j];
  5676. menuActionCmd1[j] = menuActionCmd1[j + 1];
  5677. menuActionCmd1[j + 1] = k;
  5678. flag = false;
  5679. }
  5680.  
  5681. }
  5682. }
  5683.  
  5684. private int method83(int i, int j, int k)
  5685. {
  5686. int l = 256 - k;
  5687. return ((i & 0xff00ff) * l + (j & 0xff00ff) * k & 0xff00ff00) + ((i & 0xff00) * l + (j & 0xff00) * k & 0xff0000) >> 8;
  5688. }
  5689.  
  5690. private void login(String s, String s1, boolean flag)
  5691. {
  5692. signlink.errorname = s;
  5693. try
  5694. {
  5695. if(!flag)
  5696. {
  5697. loginMessage1 = "";
  5698. loginMessage2 = "Connecting to server...";
  5699. drawLoginScreen(true);
  5700. }
  5701. socketStream = new RSSocket(this, openSocket(43594 + portOff));
  5702. long l = TextClass.longForName(s);
  5703. int i = (int)(l >> 16 & 31L);
  5704. stream.currentOffset = 0;
  5705. stream.addByte(14);
  5706. stream.addByte(i);
  5707. socketStream.queueBytes(2, stream.buffer);
  5708. for(int j = 0; j < 8; j++)
  5709. socketStream.read();
  5710.  
  5711. int k = socketStream.read();
  5712. int i1 = k;
  5713. if(k == 0)
  5714. {
  5715. socketStream.flushInputStream(inStream.buffer, 8);
  5716. inStream.currentOffset = 0;
  5717. aLong1215 = inStream.readQWord();
  5718. int ai[] = new int[4];
  5719. ai[0] = (int)(Math.random() * 99999999D);
  5720. ai[1] = (int)(Math.random() * 99999999D);
  5721. ai[2] = (int)(aLong1215 >> 32);
  5722. ai[3] = (int)aLong1215;
  5723. stream.currentOffset = 0;
  5724. stream.addByte(10);
  5725. stream.addInt(ai[0]);
  5726. stream.addInt(ai[1]);
  5727. stream.addInt(ai[2]);
  5728. stream.addInt(ai[3]);
  5729. stream.addInt(signlink.uid);
  5730. stream.writeString(s);
  5731. stream.writeString(s1);
  5732. stream.doKeys();
  5733. aStream_847.currentOffset = 0;
  5734. if(flag)
  5735. aStream_847.addByte(18);
  5736. else
  5737. aStream_847.addByte(16);
  5738. aStream_847.addByte(stream.currentOffset + 36 + 1 + 1 + 2);
  5739. aStream_847.addByte(255);
  5740. aStream_847.addShort(317);
  5741. aStream_847.addByte(lowMem ? 1 : 0);
  5742. for(int l1 = 0; l1 < 9; l1++)
  5743. aStream_847.addInt(expectedCRCs[l1]);
  5744.  
  5745. aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
  5746. stream.encryption = new ISAACRandomGen(ai);
  5747. for(int j2 = 0; j2 < 4; j2++)
  5748. ai[j2] += 50;
  5749.  
  5750. encryption = new ISAACRandomGen(ai);
  5751. socketStream.queueBytes(aStream_847.currentOffset, aStream_847.buffer);
  5752. k = socketStream.read();
  5753. }
  5754. if(k == 1)
  5755. {
  5756. try
  5757. {
  5758. Thread.sleep(2000L);
  5759. }
  5760. catch(Exception _ex) { }
  5761. login(s, s1, flag);
  5762. return;
  5763. }
  5764. if(k == 2)
  5765. {
  5766. myPrivilege = socketStream.read();
  5767. flagged = socketStream.read() == 1;
  5768. aLong1220 = 0L;
  5769. anInt1022 = 0;
  5770. mouseDetection.coordsIndex = 0;
  5771. super.awtFocus = true;
  5772. aBoolean954 = true;
  5773. loggedIn = true;
  5774. stream.currentOffset = 0;
  5775. inStream.currentOffset = 0;
  5776. pktType = -1;
  5777. anInt841 = -1;
  5778. anInt842 = -1;
  5779. anInt843 = -1;
  5780. pktSize = 0;
  5781. anInt1009 = 0;
  5782. anInt1104 = 0;
  5783. anInt1011 = 0;
  5784. anInt855 = 0;
  5785. menuActionRow = 0;
  5786. menuOpen = false;
  5787. super.idleTime = 0;
  5788. for(int j1 = 0; j1 < 100; j1++)
  5789. chatMessages[j1] = null;
  5790.  
  5791. itemSelected = 0;
  5792. spellSelected = 0;
  5793. loadingStage = 0;
  5794. anInt1062 = 0;
  5795. anInt1278 = (int)(Math.random() * 100D) - 50;
  5796. anInt1131 = (int)(Math.random() * 110D) - 55;
  5797. anInt896 = (int)(Math.random() * 80D) - 40;
  5798. minimapInt2 = (int)(Math.random() * 120D) - 60;
  5799. minimapInt3 = (int)(Math.random() * 30D) - 20;
  5800. minimapInt1 = (int)(Math.random() * 20D) - 10 & 0x7ff;
  5801. anInt1021 = 0;
  5802. anInt985 = -1;
  5803. destX = 0;
  5804. destY = 0;
  5805. playerCount = 0;
  5806. npcCount = 0;
  5807. for(int i2 = 0; i2 < maxPlayers; i2++)
  5808. {
  5809. playerArray[i2] = null;
  5810. aStreamArray895s[i2] = null;
  5811. }
  5812.  
  5813. for(int k2 = 0; k2 < 16384; k2++)
  5814. npcArray[k2] = null;
  5815.  
  5816. myPlayer = playerArray[myPlayerIndex] = new Player();
  5817. aClass19_1013.removeAll();
  5818. aClass19_1056.removeAll();
  5819. for(int l2 = 0; l2 < 4; l2++)
  5820. {
  5821. for(int i3 = 0; i3 < 104; i3++)
  5822. {
  5823. for(int k3 = 0; k3 < 104; k3++)
  5824. groundArray[l2][i3][k3] = null;
  5825.  
  5826. }
  5827.  
  5828. }
  5829.  
  5830. aClass19_1179 = new NodeList();
  5831. anInt900 = 0;
  5832. friendsCount = 0;
  5833. dialogID = -1;
  5834. backDialogID = -1;
  5835. openInterfaceID = -1;
  5836. invOverlayInterfaceID = -1;
  5837. anInt1018 = -1;
  5838. aBoolean1149 = false;
  5839. tabID = 3;
  5840. inputDialogState = 0;
  5841. menuOpen = false;
  5842. messagePromptRaised = false;
  5843. aString844 = null;
  5844. anInt1055 = 0;
  5845. anInt1054 = -1;
  5846. aBoolean1047 = true;
  5847. method45();
  5848. for(int j3 = 0; j3 < 5; j3++)
  5849. anIntArray990[j3] = 0;
  5850.  
  5851. for(int l3 = 0; l3 < 5; l3++)
  5852. {
  5853. atPlayerActions[l3] = null;
  5854. atPlayerArray[l3] = false;
  5855. }
  5856.  
  5857. anInt1175 = 0;
  5858. anInt1134 = 0;
  5859. anInt986 = 0;
  5860. anInt1288 = 0;
  5861. anInt924 = 0;
  5862. anInt1188 = 0;
  5863. anInt1155 = 0;
  5864. anInt1226 = 0;
  5865. int anInt941 = 0;
  5866. int anInt1260 = 0;
  5867. resetImageProducers2();
  5868. return;
  5869. }
  5870. if(k == 3)
  5871. {
  5872. loginMessage1 = "";
  5873. loginMessage2 = "Invalid username or password.";
  5874. return;
  5875. }
  5876. if(k == 4)
  5877. {
  5878. loginMessage1 = "Your account has been disabled.";
  5879. loginMessage2 = "Please check your message-center for details.";
  5880. return;
  5881. }
  5882. if(k == 5)
  5883. {
  5884. loginMessage1 = "Your account is already logged in.";
  5885. loginMessage2 = "Try again in 60 secs...";
  5886. return;
  5887. }
  5888. if(k == 6)
  5889. {
  5890. loginMessage1 = "RuneScape has been updated!";
  5891. loginMessage2 = "Please reload this page.";
  5892. return;
  5893. }
  5894. if(k == 7)
  5895. {
  5896. loginMessage1 = "This world is full.";
  5897. loginMessage2 = "Please use a different world.";
  5898. return;
  5899. }
  5900. if(k == 8)
  5901. {
  5902. loginMessage1 = "Unable to connect.";
  5903. loginMessage2 = "Login server offline.";
  5904. return;
  5905. }
  5906. if(k == 9)
  5907. {
  5908. loginMessage1 = "Login limit exceeded.";
  5909. loginMessage2 = "Too many connections from your address.";
  5910. return;
  5911. }
  5912. if(k == 10)
  5913. {
  5914. loginMessage1 = "Unable to connect.";
  5915. loginMessage2 = "Bad session id.";
  5916. return;
  5917. }
  5918. if(k == 11)
  5919. {
  5920. loginMessage2 = "Login server rejected session.";
  5921. loginMessage2 = "Please try again.";
  5922. return;
  5923. }
  5924. if(k == 12)
  5925. {
  5926. loginMessage1 = "You need a members account to login to this world.";
  5927. loginMessage2 = "Please subscribe, or use a different world.";
  5928. return;
  5929. }
  5930. if(k == 13)
  5931. {
  5932. loginMessage1 = "Could not complete login.";
  5933. loginMessage2 = "Please try using a different world.";
  5934. return;
  5935. }
  5936. if(k == 14)
  5937. {
  5938. loginMessage1 = "The server is being updated.";
  5939. loginMessage2 = "Please wait 1 minute and try again.";
  5940. return;
  5941. }
  5942. if(k == 15)
  5943. {
  5944. loggedIn = true;
  5945. stream.currentOffset = 0;
  5946. inStream.currentOffset = 0;
  5947. pktType = -1;
  5948. anInt841 = -1;
  5949. anInt842 = -1;
  5950. anInt843 = -1;
  5951. pktSize = 0;
  5952. anInt1009 = 0;
  5953. anInt1104 = 0;
  5954. menuActionRow = 0;
  5955. menuOpen = false;
  5956. aLong824 = System.currentTimeMillis();
  5957. return;
  5958. }
  5959. if(k == 16)
  5960. {
  5961. loginMessage1 = "Login attempts exceeded.";
  5962. loginMessage2 = "Please wait 1 minute and try again.";
  5963. return;
  5964. }
  5965. if(k == 17)
  5966. {
  5967. loginMessage1 = "You are standing in a members-only area.";
  5968. loginMessage2 = "To play on this world move to a free area first";
  5969. return;
  5970. }
  5971. if(k == 20)
  5972. {
  5973. loginMessage1 = "Invalid loginserver requested";
  5974. loginMessage2 = "Please try using a different world.";
  5975. return;
  5976. }
  5977. if(k == 21)
  5978. {
  5979. for(int k1 = socketStream.read(); k1 >= 0; k1--)
  5980. {
  5981. loginMessage1 = "You have only just left another world";
  5982. loginMessage2 = "Your profile will be transferred in: " + k1 + " seconds";
  5983. drawLoginScreen(true);
  5984. try
  5985. {
  5986. Thread.sleep(1000L);
  5987. }
  5988. catch(Exception _ex) { }
  5989. }
  5990.  
  5991. login(s, s1, flag);
  5992. return;
  5993. }
  5994. if(k == -1)
  5995. {
  5996. if(i1 == 0)
  5997. {
  5998. if(loginFailures < 2)
  5999. {
  6000. try
  6001. {
  6002. Thread.sleep(2000L);
  6003. }
  6004. catch(Exception _ex) { }
  6005. loginFailures++;
  6006. login(s, s1, flag);
  6007. return;
  6008. } else
  6009. {
  6010. loginMessage1 = "No response from loginserver";
  6011. loginMessage2 = "Please wait 1 minute and try again.";
  6012. return;
  6013. }
  6014. } else
  6015. {
  6016. loginMessage1 = "No response from server";
  6017. loginMessage2 = "Please try using a different world.";
  6018. return;
  6019. }
  6020. } else
  6021. {
  6022. System.out.println("response:" + k);
  6023. loginMessage1 = "Unexpected server response";
  6024. loginMessage2 = "Please try using a different world.";
  6025. return;
  6026. }
  6027. }
  6028. catch(IOException _ex)
  6029. {
  6030. loginMessage1 = "";
  6031. }
  6032. loginMessage2 = "Error connecting to server.";
  6033. }
  6034.  
  6035. private boolean doWalkTo(int i, int j, int k, int i1, int j1, int k1,
  6036. int l1, int i2, int j2, boolean flag, int k2)
  6037. {
  6038. byte byte0 = 104;
  6039. byte byte1 = 104;
  6040. for(int l2 = 0; l2 < byte0; l2++)
  6041. {
  6042. for(int i3 = 0; i3 < byte1; i3++)
  6043. {
  6044. anIntArrayArray901[l2][i3] = 0;
  6045. anIntArrayArray825[l2][i3] = 0x5f5e0ff;
  6046. }
  6047.  
  6048. }
  6049.  
  6050. int j3 = j2;
  6051. int k3 = j1;
  6052. anIntArrayArray901[j2][j1] = 99;
  6053. anIntArrayArray825[j2][j1] = 0;
  6054. int l3 = 0;
  6055. int i4 = 0;
  6056. bigX[l3] = j2;
  6057. bigY[l3++] = j1;
  6058. boolean flag1 = false;
  6059. int j4 = bigX.length;
  6060. int ai[][] = aClass11Array1230[plane].anIntArrayArray294;
  6061. while(i4 != l3)
  6062. {
  6063. j3 = bigX[i4];
  6064. k3 = bigY[i4];
  6065. i4 = (i4 + 1) % j4;
  6066. if(j3 == k2 && k3 == i2)
  6067. {
  6068. flag1 = true;
  6069. break;
  6070. }
  6071. if(i1 != 0)
  6072. {
  6073. if((i1 < 5 || i1 == 10) && aClass11Array1230[plane].method219(k2, j3, k3, j, i1 - 1, i2))
  6074. {
  6075. flag1 = true;
  6076. break;
  6077. }
  6078. if(i1 < 10 && aClass11Array1230[plane].method220(k2, i2, k3, i1 - 1, j, j3))
  6079. {
  6080. flag1 = true;
  6081. break;
  6082. }
  6083. }
  6084. if(k1 != 0 && k != 0 && aClass11Array1230[plane].method221(i2, k2, j3, k, l1, k1, k3))
  6085. {
  6086. flag1 = true;
  6087. break;
  6088. }
  6089. int l4 = anIntArrayArray825[j3][k3] + 1;
  6090. if(j3 > 0 && anIntArrayArray901[j3 - 1][k3] == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0)
  6091. {
  6092. bigX[l3] = j3 - 1;
  6093. bigY[l3] = k3;
  6094. l3 = (l3 + 1) % j4;
  6095. anIntArrayArray901[j3 - 1][k3] = 2;
  6096. anIntArrayArray825[j3 - 1][k3] = l4;
  6097. }
  6098. if(j3 < byte0 - 1 && anIntArrayArray901[j3 + 1][k3] == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0)
  6099. {
  6100. bigX[l3] = j3 + 1;
  6101. bigY[l3] = k3;
  6102. l3 = (l3 + 1) % j4;
  6103. anIntArrayArray901[j3 + 1][k3] = 8;
  6104. anIntArrayArray825[j3 + 1][k3] = l4;
  6105. }
  6106. if(k3 > 0 && anIntArrayArray901[j3][k3 - 1] == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0)
  6107. {
  6108. bigX[l3] = j3;
  6109. bigY[l3] = k3 - 1;
  6110. l3 = (l3 + 1) % j4;
  6111. anIntArrayArray901[j3][k3 - 1] = 1;
  6112. anIntArrayArray825[j3][k3 - 1] = l4;
  6113. }
  6114. if(k3 < byte1 - 1 && anIntArrayArray901[j3][k3 + 1] == 0 && (ai[j3][k3 + 1] & 0x1280120) == 0)
  6115. {
  6116. bigX[l3] = j3;
  6117. bigY[l3] = k3 + 1;
  6118. l3 = (l3 + 1) % j4;
  6119. anIntArrayArray901[j3][k3 + 1] = 4;
  6120. anIntArrayArray825[j3][k3 + 1] = l4;
  6121. }
  6122. 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)
  6123. {
  6124. bigX[l3] = j3 - 1;
  6125. bigY[l3] = k3 - 1;
  6126. l3 = (l3 + 1) % j4;
  6127. anIntArrayArray901[j3 - 1][k3 - 1] = 3;
  6128. anIntArrayArray825[j3 - 1][k3 - 1] = l4;
  6129. }
  6130. 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)
  6131. {
  6132. bigX[l3] = j3 + 1;
  6133. bigY[l3] = k3 - 1;
  6134. l3 = (l3 + 1) % j4;
  6135. anIntArrayArray901[j3 + 1][k3 - 1] = 9;
  6136. anIntArrayArray825[j3 + 1][k3 - 1] = l4;
  6137. }
  6138. 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)
  6139. {
  6140. bigX[l3] = j3 - 1;
  6141. bigY[l3] = k3 + 1;
  6142. l3 = (l3 + 1) % j4;
  6143. anIntArrayArray901[j3 - 1][k3 + 1] = 6;
  6144. anIntArrayArray825[j3 - 1][k3 + 1] = l4;
  6145. }
  6146. 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)
  6147. {
  6148. bigX[l3] = j3 + 1;
  6149. bigY[l3] = k3 + 1;
  6150. l3 = (l3 + 1) % j4;
  6151. anIntArrayArray901[j3 + 1][k3 + 1] = 12;
  6152. anIntArrayArray825[j3 + 1][k3 + 1] = l4;
  6153. }
  6154. }
  6155. anInt1264 = 0;
  6156. if(!flag1)
  6157. {
  6158. if(flag)
  6159. {
  6160. int i5 = 100;
  6161. for(int k5 = 1; k5 < 2; k5++)
  6162. {
  6163. for(int i6 = k2 - k5; i6 <= k2 + k5; i6++)
  6164. {
  6165. for(int l6 = i2 - k5; l6 <= i2 + k5; l6++)
  6166. if(i6 >= 0 && l6 >= 0 && i6 < 104 && l6 < 104 && anIntArrayArray825[i6][l6] < i5)
  6167. {
  6168. i5 = anIntArrayArray825[i6][l6];
  6169. j3 = i6;
  6170. k3 = l6;
  6171. anInt1264 = 1;
  6172. flag1 = true;
  6173. }
  6174.  
  6175. }
  6176.  
  6177. if(flag1)
  6178. break;
  6179. }
  6180.  
  6181. }
  6182. if(!flag1)
  6183. return false;
  6184. }
  6185. i4 = 0;
  6186. bigX[i4] = j3;
  6187. bigY[i4++] = k3;
  6188. int l5;
  6189. for(int j5 = l5 = anIntArrayArray901[j3][k3]; j3 != j2 || k3 != j1; j5 = anIntArrayArray901[j3][k3])
  6190. {
  6191. if(j5 != l5)
  6192. {
  6193. l5 = j5;
  6194. bigX[i4] = j3;
  6195. bigY[i4++] = k3;
  6196. }
  6197. if((j5 & 2) != 0)
  6198. j3++;
  6199. else
  6200. if((j5 & 8) != 0)
  6201. j3--;
  6202. if((j5 & 1) != 0)
  6203. k3++;
  6204. else
  6205. if((j5 & 4) != 0)
  6206. k3--;
  6207. }
  6208. // if(cancelWalk) { return i4 > 0; }
  6209.  
  6210.  
  6211. if(i4 > 0)
  6212. {
  6213. int k4 = i4;
  6214. if(k4 > 25)
  6215. k4 = 25;
  6216. i4--;
  6217. int k6 = bigX[i4];
  6218. int i7 = bigY[i4];
  6219. anInt1288 += k4;
  6220. if(anInt1288 >= 92)
  6221. {
  6222. stream.sendPacket(36);
  6223. stream.addInt(0);
  6224. anInt1288 = 0;
  6225. }
  6226. if(i == 0)
  6227. {
  6228. stream.sendPacket(164);
  6229. stream.addByte(k4 + k4 + 3);
  6230. }
  6231. if(i == 1)
  6232. {
  6233. stream.sendPacket(248);
  6234. stream.addByte(k4 + k4 + 3 + 14);
  6235. }
  6236. if(i == 2)
  6237. {
  6238. stream.sendPacket(98);
  6239. stream.addByte(k4 + k4 + 3);
  6240. }
  6241. stream.addLEShortA(k6 + baseX);
  6242. destX = bigX[0];
  6243. destY = bigY[0];
  6244. for(int j7 = 1; j7 < k4; j7++)
  6245. {
  6246. i4--;
  6247. stream.addByte(bigX[i4] - k6);
  6248. stream.addByte(bigY[i4] - i7);
  6249. }
  6250.  
  6251. stream.addLEShort_2(i7 + baseY);
  6252. stream.readByteC(super.keyArray[5] != 1 ? 0 : 1);
  6253. return true;
  6254. }
  6255. return i != 1;
  6256. }
  6257.  
  6258. private void method86(Stream stream)
  6259. {
  6260. for(int j = 0; j < anInt893; j++)
  6261. {
  6262. int k = anIntArray894[j];
  6263. NPC npc = npcArray[k];
  6264. int l = stream.readUnsignedByte();
  6265. if((l & 0x10) != 0)
  6266. {
  6267. int i1 = stream.method434();
  6268. if(i1 == 65535)
  6269. i1 = -1;
  6270. int i2 = stream.readUnsignedByte();
  6271. if(i1 == npc.anim && i1 != -1)
  6272. {
  6273. int l2 = Animation.anims[i1].anInt365;
  6274. if(l2 == 1)
  6275. {
  6276. npc.anInt1527 = 0;
  6277. npc.anInt1528 = 0;
  6278. npc.anInt1529 = i2;
  6279. npc.anInt1530 = 0;
  6280. }
  6281. if(l2 == 2)
  6282. npc.anInt1530 = 0;
  6283. } else
  6284. if(i1 == -1 || npc.anim == -1 || Animation.anims[i1].anInt359 >= Animation.anims[npc.anim].anInt359)
  6285. {
  6286. npc.anim = i1;
  6287. npc.anInt1527 = 0;
  6288. npc.anInt1528 = 0;
  6289. npc.anInt1529 = i2;
  6290. npc.anInt1530 = 0;
  6291. npc.anInt1542 = npc.smallXYIndex;
  6292. }
  6293. }
  6294. if((l & 8) != 0)
  6295. {
  6296. int j1 = stream.method426();
  6297. int j2 = stream.method427();
  6298. npc.updateHitData(j2, j1, loopCycle);
  6299. npc.loopCycleStatus = loopCycle + 300;
  6300. npc.currentHealth = stream.method426();
  6301. npc.maxHealth = stream.readUnsignedByte();
  6302. }
  6303. if((l & 0x80) != 0)
  6304. {
  6305. npc.anInt1520 = stream.readUnsignedWord();
  6306. int k1 = stream.readInt();
  6307. npc.anInt1524 = k1 >> 16;
  6308. npc.anInt1523 = loopCycle + (k1 & 0xffff);
  6309. npc.anInt1521 = 0;
  6310. npc.anInt1522 = 0;
  6311. if(npc.anInt1523 > loopCycle)
  6312. npc.anInt1521 = -1;
  6313. if(npc.anInt1520 == 65535)
  6314. npc.anInt1520 = -1;
  6315. }
  6316. if((l & 0x20) != 0)
  6317. {
  6318. npc.interactingEntity = stream.readUnsignedWord();
  6319. if(npc.interactingEntity == 65535)
  6320. npc.interactingEntity = -1;
  6321. }
  6322. if((l & 1) != 0)
  6323. {
  6324. npc.textSpoken = stream.readString();
  6325. npc.textCycle = 100;
  6326. // entityMessage(npc);
  6327.  
  6328. }
  6329. if((l & 0x40) != 0)
  6330. {
  6331. int l1 = stream.method427();
  6332. int k2 = stream.method428();
  6333. npc.updateHitData(k2, l1, loopCycle);
  6334. npc.loopCycleStatus = loopCycle + 300;
  6335. npc.currentHealth = stream.method428();
  6336. npc.maxHealth = stream.method427();
  6337. }
  6338. if((l & 2) != 0)
  6339. {
  6340. npc.desc = EntityDef.forID(stream.method436());
  6341. npc.anInt1540 = npc.desc.aByte68;
  6342. npc.anInt1504 = npc.desc.anInt79;
  6343. npc.anInt1554 = npc.desc.anInt67;
  6344. npc.anInt1555 = npc.desc.anInt58;
  6345. npc.anInt1556 = npc.desc.anInt83;
  6346. npc.anInt1557 = npc.desc.anInt55;
  6347. npc.anInt1511 = npc.desc.anInt77;
  6348. }
  6349. if((l & 4) != 0)
  6350. {
  6351. npc.anInt1538 = stream.method434();
  6352. npc.anInt1539 = stream.method434();
  6353. }
  6354. }
  6355. }
  6356.  
  6357. private void buildAtNPCMenu(EntityDef entityDef, int i, int j, int k)
  6358. {
  6359. if(menuActionRow >= 400)
  6360. return;
  6361. if(entityDef.childrenIDs != null)
  6362. entityDef = entityDef.method161();
  6363. if(entityDef == null)
  6364. return;
  6365. if(!entityDef.aBoolean84)
  6366. return;
  6367. String s = entityDef.name;
  6368. if(entityDef.combatLevel != 0)
  6369. s = s + combatDiffColor(myPlayer.combatLevel, entityDef.combatLevel) + " (level-" + entityDef.combatLevel + ")";
  6370. if(itemSelected == 1)
  6371. {
  6372. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @yel@" + s;
  6373. menuActionID[menuActionRow] = 582;
  6374. menuActionCmd1[menuActionRow] = i;
  6375. menuActionCmd2[menuActionRow] = k;
  6376. menuActionCmd3[menuActionRow] = j;
  6377. menuActionRow++;
  6378. return;
  6379. }
  6380. if(spellSelected == 1)
  6381. {
  6382. if((spellUsableOn & 2) == 2)
  6383. {
  6384. menuActionName[menuActionRow] = spellTooltip + " @yel@" + s;
  6385. menuActionID[menuActionRow] = 413;
  6386. menuActionCmd1[menuActionRow] = i;
  6387. menuActionCmd2[menuActionRow] = k;
  6388. menuActionCmd3[menuActionRow] = j;
  6389. menuActionRow++;
  6390. }
  6391. } else
  6392. {
  6393. if(entityDef.actions != null)
  6394. {
  6395. for(int l = 4; l >= 0; l--)
  6396. if(entityDef.actions[l] != null && !entityDef.actions[l].equalsIgnoreCase("attack"))
  6397. {
  6398. menuActionName[menuActionRow] = entityDef.actions[l] + " @yel@" + s;
  6399. if(l == 0)
  6400. menuActionID[menuActionRow] = 20;
  6401. if(l == 1)
  6402. menuActionID[menuActionRow] = 412;
  6403. if(l == 2)
  6404. menuActionID[menuActionRow] = 225;
  6405. if(l == 3)
  6406. menuActionID[menuActionRow] = 965;
  6407. if(l == 4)
  6408. menuActionID[menuActionRow] = 478;
  6409. menuActionCmd1[menuActionRow] = i;
  6410. menuActionCmd2[menuActionRow] = k;
  6411. menuActionCmd3[menuActionRow] = j;
  6412. menuActionRow++;
  6413. }
  6414.  
  6415. }
  6416. if(entityDef.actions != null)
  6417. {
  6418. for(int i1 = 4; i1 >= 0; i1--)
  6419. if(entityDef.actions[i1] != null && entityDef.actions[i1].equalsIgnoreCase("attack"))
  6420. {
  6421. char c = '\0';
  6422. if(entityDef.combatLevel > myPlayer.combatLevel)
  6423. c = '\u07D0';
  6424. menuActionName[menuActionRow] = entityDef.actions[i1] + " @yel@" + s;
  6425. if(i1 == 0)
  6426. menuActionID[menuActionRow] = 20 + c;
  6427. if(i1 == 1)
  6428. menuActionID[menuActionRow] = 412 + c;
  6429. if(i1 == 2)
  6430. menuActionID[menuActionRow] = 225 + c;
  6431. if(i1 == 3)
  6432. menuActionID[menuActionRow] = 965 + c;
  6433. if(i1 == 4)
  6434. menuActionID[menuActionRow] = 478 + c;
  6435. menuActionCmd1[menuActionRow] = i;
  6436. menuActionCmd2[menuActionRow] = k;
  6437. menuActionCmd3[menuActionRow] = j;
  6438. menuActionRow++;
  6439. }
  6440.  
  6441. }
  6442. menuActionName[menuActionRow] = "Examine @yel@" + s + " @gre@(@whi@" + entityDef.type + "@gre@)";
  6443. menuActionID[menuActionRow] = 1025;
  6444. menuActionCmd1[menuActionRow] = i;
  6445. menuActionCmd2[menuActionRow] = k;
  6446. menuActionCmd3[menuActionRow] = j;
  6447. menuActionRow++;
  6448. }
  6449. }
  6450.  
  6451. private void buildAtPlayerMenu(int i, int j, Player player, int k)
  6452. {
  6453. if(player == myPlayer)
  6454. return;
  6455. if(menuActionRow >= 400)
  6456. return;
  6457. String s;
  6458. if(player.skill == 0)
  6459. s = player.name + combatDiffColor(myPlayer.combatLevel, player.combatLevel) + " (level-" + player.combatLevel + ")";
  6460. else
  6461. s = player.name + " (skill-" + player.skill + ")";
  6462. if(itemSelected == 1)
  6463. {
  6464. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @whi@" + s;
  6465. menuActionID[menuActionRow] = 491;
  6466. menuActionCmd1[menuActionRow] = j;
  6467. menuActionCmd2[menuActionRow] = i;
  6468. menuActionCmd3[menuActionRow] = k;
  6469. menuActionRow++;
  6470. } else
  6471. if(spellSelected == 1)
  6472. {
  6473. if((spellUsableOn & 8) == 8)
  6474. {
  6475. menuActionName[menuActionRow] = spellTooltip + " @whi@" + s;
  6476. menuActionID[menuActionRow] = 365;
  6477. menuActionCmd1[menuActionRow] = j;
  6478. menuActionCmd2[menuActionRow] = i;
  6479. menuActionCmd3[menuActionRow] = k;
  6480. menuActionRow++;
  6481. }
  6482. } else
  6483. {
  6484. for(int l = 4; l >= 0; l--)
  6485. if(atPlayerActions[l] != null)
  6486. {
  6487. menuActionName[menuActionRow] = atPlayerActions[l] + " @whi@" + s;
  6488. char c = '\0';
  6489. if(atPlayerActions[l].equalsIgnoreCase("attack"))
  6490. {
  6491. if(player.combatLevel > myPlayer.combatLevel)
  6492. c = '\u07D0';
  6493. if(myPlayer.team != 0 && player.team != 0)
  6494. if(myPlayer.team == player.team)
  6495. c = '\u07D0';
  6496. else
  6497. c = '\0';
  6498. } else
  6499. if(atPlayerArray[l])
  6500. c = '\u07D0';
  6501. if(l == 0)
  6502. menuActionID[menuActionRow] = 561 + c;
  6503. if(l == 1)
  6504. menuActionID[menuActionRow] = 779 + c;
  6505. if(l == 2)
  6506. menuActionID[menuActionRow] = 27 + c;
  6507. if(l == 3)
  6508. menuActionID[menuActionRow] = 577 + c;
  6509. if(l == 4)
  6510. menuActionID[menuActionRow] = 729 + c;
  6511. menuActionCmd1[menuActionRow] = j;
  6512. menuActionCmd2[menuActionRow] = i;
  6513. menuActionCmd3[menuActionRow] = k;
  6514. menuActionRow++;
  6515. }
  6516.  
  6517. }
  6518. for(int i1 = 0; i1 < menuActionRow; i1++)
  6519. if(menuActionID[i1] == 516)
  6520. {
  6521. menuActionName[i1] = "Walk here @whi@" + s;
  6522. return;
  6523. }
  6524.  
  6525. }
  6526.  
  6527. private void method89(Class30_Sub1 class30_sub1)
  6528. {
  6529. int i = 0;
  6530. int j = -1;
  6531. int k = 0;
  6532. int l = 0;
  6533. if(class30_sub1.anInt1296 == 0)
  6534. i = worldController.method300(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  6535. if(class30_sub1.anInt1296 == 1)
  6536. i = worldController.method301(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  6537. if(class30_sub1.anInt1296 == 2)
  6538. i = worldController.method302(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  6539. if(class30_sub1.anInt1296 == 3)
  6540. i = worldController.method303(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  6541. if(i != 0)
  6542. {
  6543. int i1 = worldController.method304(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298, i);
  6544. j = i >> 14 & 0x7fff;
  6545. k = i1 & 0x1f;
  6546. l = i1 >> 6;
  6547. }
  6548. class30_sub1.anInt1299 = j;
  6549. class30_sub1.anInt1301 = k;
  6550. class30_sub1.anInt1300 = l;
  6551. }
  6552.  
  6553. private void method90()
  6554. {
  6555. for(int i = 0; i < anInt1062; i++)
  6556. if(anIntArray1250[i] <= 0)
  6557. {
  6558. boolean flag1 = false;
  6559. try
  6560. {
  6561. if(anIntArray1207[i] == anInt874 && anIntArray1241[i] == anInt1289)
  6562. {
  6563. if(!replayWave())
  6564. flag1 = true;
  6565. } else
  6566. {
  6567. Stream stream = Sounds.method241(anIntArray1241[i], anIntArray1207[i]);
  6568. if(System.currentTimeMillis() + (long)(stream.currentOffset / 22) > aLong1172 + (long)(anInt1257 / 22))
  6569. {
  6570. anInt1257 = stream.currentOffset;
  6571. aLong1172 = System.currentTimeMillis();
  6572. if(saveWave(stream.buffer, stream.currentOffset))
  6573. {
  6574. anInt874 = anIntArray1207[i];
  6575. anInt1289 = anIntArray1241[i];
  6576. } else
  6577. {
  6578. flag1 = true;
  6579. }
  6580. }
  6581. }
  6582. }
  6583. catch(Exception exception) { }
  6584. if(!flag1 || anIntArray1250[i] == -5)
  6585. {
  6586. anInt1062--;
  6587. for(int j = i; j < anInt1062; j++)
  6588. {
  6589. anIntArray1207[j] = anIntArray1207[j + 1];
  6590. anIntArray1241[j] = anIntArray1241[j + 1];
  6591. anIntArray1250[j] = anIntArray1250[j + 1];
  6592. }
  6593.  
  6594. i--;
  6595. } else
  6596. {
  6597. anIntArray1250[i] = -5;
  6598. }
  6599. } else
  6600. {
  6601. anIntArray1250[i]--;
  6602. }
  6603.  
  6604. if(prevSong > 0)
  6605. {
  6606. prevSong -= 20;
  6607. if(prevSong < 0)
  6608. prevSong = 0;
  6609. if(prevSong == 0 && musicEnabled && !lowMem)
  6610. {
  6611. nextSong = currentSong;
  6612. songChanging = true;
  6613. onDemandFetcher.method558(2, nextSong);
  6614. }
  6615. }
  6616. }
  6617.  
  6618. void startUp()
  6619. {
  6620. drawLoadingText(20, "Starting up");
  6621. if(signlink.sunjava)
  6622. super.minDelay = 5;
  6623. if(aBoolean993)
  6624. {
  6625. // rsAlreadyLoaded = true;
  6626. // return;
  6627. }
  6628. aBoolean993 = true;
  6629. boolean flag = true;
  6630. String s = getDocumentBaseHost();
  6631. if(s.endsWith("jagex.com"))
  6632. flag = true;
  6633. if(s.endsWith("runescape.com"))
  6634. flag = true;
  6635. if(s.endsWith("192.168.1.2"))
  6636. flag = true;
  6637. if(s.endsWith("192.168.1.229"))
  6638. flag = true;
  6639. if(s.endsWith("192.168.1.228"))
  6640. flag = true;
  6641. if(s.endsWith("192.168.1.227"))
  6642. flag = true;
  6643. if(s.endsWith("192.168.1.226"))
  6644. flag = true;
  6645. if(s.endsWith("127.0.0.1"))
  6646. flag = true;
  6647. if(!flag)
  6648. {
  6649. genericLoadingError = true;
  6650. return;
  6651. }
  6652. if(signlink.cache_dat != null)
  6653. {
  6654. for(int i = 0; i < 5; i++)
  6655. decompressors[i] = new Decompressor(signlink.cache_dat, signlink.cache_idx[i], i + 1);
  6656.  
  6657. }
  6658. try
  6659. {
  6660. connectServer();
  6661. titleStreamLoader = streamLoaderForName(1, "title screen", "title", expectedCRCs[1], 25);
  6662. aTextDrawingArea_1270 = new TextDrawingArea(false, "p11_full", titleStreamLoader);
  6663. aTextDrawingArea_1271 = new TextDrawingArea(false, "p12_full", titleStreamLoader);
  6664. chatTextDrawingArea = new TextDrawingArea(false, "b12_full", titleStreamLoader);
  6665. TextDrawingArea aTextDrawingArea_1273 = new TextDrawingArea(true, "q8_full", titleStreamLoader);
  6666. drawLogo();
  6667. loadTitleScreen();
  6668. StreamLoader streamLoader = streamLoaderForName(2, "config", "config", expectedCRCs[2], 30);
  6669. StreamLoader streamLoader_1 = streamLoaderForName(3, "interface", "interface", expectedCRCs[3], 35);
  6670. StreamLoader streamLoader_2 = streamLoaderForName(4, "2d graphics", "media", expectedCRCs[4], 40);
  6671. StreamLoader streamLoader_3 = streamLoaderForName(6, "textures", "textures", expectedCRCs[6], 45);
  6672. StreamLoader streamLoader_4 = streamLoaderForName(7, "chat system", "wordenc", expectedCRCs[7], 50);
  6673. StreamLoader streamLoader_5 = streamLoaderForName(8, "sound effects", "sounds", expectedCRCs[8], 55);
  6674. byteGroundArray = new byte[4][104][104];
  6675. intGroundArray = new int[4][105][105];
  6676. worldController = new WorldController(intGroundArray);
  6677. for(int j = 0; j < 4; j++)
  6678. aClass11Array1230[j] = new Class11();
  6679.  
  6680. aClass30_Sub2_Sub1_Sub1_1263 = new Sprite(512, 512);
  6681. StreamLoader streamLoader_6 = streamLoaderForName(5, "update list", "versionlist", expectedCRCs[5], 60);
  6682. drawLoadingText(60, "Connecting to update server");
  6683. onDemandFetcher = new OnDemandFetcher();
  6684. onDemandFetcher.start(streamLoader_6, this);
  6685. Class36.method528(onDemandFetcher.getAnimCount());
  6686. Model.method459(onDemandFetcher.getVersionCount(0), onDemandFetcher);
  6687. if(!lowMem)
  6688. {
  6689. nextSong = 0;
  6690. try
  6691. {
  6692. nextSong = Integer.parseInt(getParameter("music"));
  6693. }
  6694. catch(Exception _ex) { }
  6695. songChanging = true;
  6696. onDemandFetcher.method558(2, nextSong);
  6697. while(onDemandFetcher.getNodeCount() > 0)
  6698. {
  6699. processOnDemandQueue();
  6700. try
  6701. {
  6702. Thread.sleep(100L);
  6703. }
  6704. catch(Exception _ex) { }
  6705. if(onDemandFetcher.anInt1349 > 3)
  6706. {
  6707. loadError();
  6708. return;
  6709. }
  6710. }
  6711. }
  6712. drawLoadingText(65, "Requesting animations");
  6713. int k = onDemandFetcher.getVersionCount(1);
  6714. for(int i1 = 0; i1 < k; i1++)
  6715. onDemandFetcher.method558(1, i1);
  6716.  
  6717. while(onDemandFetcher.getNodeCount() > 0)
  6718. {
  6719. int j1 = k - onDemandFetcher.getNodeCount();
  6720. if(j1 > 0)
  6721. drawLoadingText(65, "Loading animations - " + (j1 * 100) / k + "%");
  6722. processOnDemandQueue();
  6723. try
  6724. {
  6725. Thread.sleep(100L);
  6726. }
  6727. catch(Exception _ex) { }
  6728. if(onDemandFetcher.anInt1349 > 3)
  6729. {
  6730. loadError();
  6731. return;
  6732. }
  6733. }
  6734. drawLoadingText(70, "Requesting models");
  6735. k = onDemandFetcher.getVersionCount(0);
  6736. for(int k1 = 0; k1 < k; k1++)
  6737. {
  6738. int l1 = onDemandFetcher.getModelIndex(k1);
  6739. if((l1 & 1) != 0)
  6740. onDemandFetcher.method558(0, k1);
  6741. }
  6742.  
  6743. k = onDemandFetcher.getNodeCount();
  6744. while(onDemandFetcher.getNodeCount() > 0)
  6745. {
  6746. int i2 = k - onDemandFetcher.getNodeCount();
  6747. if(i2 > 0)
  6748. drawLoadingText(70, "Loading models - " + (i2 * 100) / k + "%");
  6749. processOnDemandQueue();
  6750. try
  6751. {
  6752. Thread.sleep(100L);
  6753. }
  6754. catch(Exception _ex) { }
  6755. }
  6756. if(decompressors[0] != null)
  6757. {
  6758. drawLoadingText(75, "Requesting maps");
  6759. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 47));
  6760. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 47));
  6761. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 48));
  6762. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 48));
  6763. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 49));
  6764. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 49));
  6765. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 47, 47));
  6766. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 47, 47));
  6767. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 47, 48));
  6768. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 47, 48));
  6769. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 148, 48));
  6770. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 148, 48));
  6771. k = onDemandFetcher.getNodeCount();
  6772. while(onDemandFetcher.getNodeCount() > 0)
  6773. {
  6774. int j2 = k - onDemandFetcher.getNodeCount();
  6775. if(j2 > 0)
  6776. drawLoadingText(75, "Loading maps - " + (j2 * 100) / k + "%");
  6777. processOnDemandQueue();
  6778. try
  6779. {
  6780. Thread.sleep(100L);
  6781. }
  6782. catch(Exception _ex) { }
  6783. }
  6784. }
  6785. k = onDemandFetcher.getVersionCount(0);
  6786. for(int k2 = 0; k2 < k; k2++)
  6787. {
  6788. int l2 = onDemandFetcher.getModelIndex(k2);
  6789. byte byte0 = 0;
  6790. if((l2 & 8) != 0)
  6791. byte0 = 10;
  6792. else
  6793. if((l2 & 0x20) != 0)
  6794. byte0 = 9;
  6795. else
  6796. if((l2 & 0x10) != 0)
  6797. byte0 = 8;
  6798. else
  6799. if((l2 & 0x40) != 0)
  6800. byte0 = 7;
  6801. else
  6802. if((l2 & 0x80) != 0)
  6803. byte0 = 6;
  6804. else
  6805. if((l2 & 2) != 0)
  6806. byte0 = 5;
  6807. else
  6808. if((l2 & 4) != 0)
  6809. byte0 = 4;
  6810. if((l2 & 1) != 0)
  6811. byte0 = 3;
  6812. if(byte0 != 0)
  6813. onDemandFetcher.method563(byte0, 0, k2);
  6814. }
  6815.  
  6816. onDemandFetcher.method554(isMembers);
  6817. if(!lowMem)
  6818. {
  6819. int l = onDemandFetcher.getVersionCount(2);
  6820. for(int i3 = 1; i3 < l; i3++)
  6821. if(onDemandFetcher.method569(i3))
  6822. onDemandFetcher.method563((byte)1, 2, i3);
  6823.  
  6824. }
  6825. drawLoadingText(80, "Unpacking media");
  6826. invBack = new Background(streamLoader_2, "invback", 0);
  6827. chatBack = new Background(streamLoader_2, "chatback", 0);
  6828. mapBack = new Background(streamLoader_2, "mapback", 0);
  6829. backBase1 = new Background(streamLoader_2, "backbase1", 0);
  6830. backBase2 = new Background(streamLoader_2, "backbase2", 0);
  6831. backHmid1 = new Background(streamLoader_2, "backhmid1", 0);
  6832. for(int j3 = 0; j3 < 13; j3++)
  6833. sideIcons[j3] = new Background(streamLoader_2, "sideicons", j3);
  6834.  
  6835. compass = new Sprite(streamLoader_2, "compass", 0);
  6836. mapEdge = new Sprite(streamLoader_2, "mapedge", 0);
  6837. mapEdge.method345();
  6838. try
  6839. {
  6840. for(int k3 = 0; k3 < 100; k3++)
  6841. mapScenes[k3] = new Background(streamLoader_2, "mapscene", k3);
  6842.  
  6843. }
  6844. catch(Exception _ex) { }
  6845. try
  6846. {
  6847. for(int l3 = 0; l3 < 100; l3++)
  6848. mapFunctions[l3] = new Sprite(streamLoader_2, "mapfunction", l3);
  6849.  
  6850. }
  6851. catch(Exception _ex) { }
  6852. try
  6853. {
  6854. for(int i4 = 0; i4 < 20; i4++)
  6855. hitMarks[i4] = new Sprite(streamLoader_2, "hitmarks", i4);
  6856.  
  6857. }
  6858. catch(Exception _ex) { }
  6859. try
  6860. {
  6861. for(int j4 = 0; j4 < 20; j4++)
  6862. headIcons[j4] = new Sprite(streamLoader_2, "headicons", j4);
  6863.  
  6864. }
  6865. catch(Exception _ex) { }
  6866. mapFlag = new Sprite(streamLoader_2, "mapmarker", 0);
  6867. mapMarker = new Sprite(streamLoader_2, "mapmarker", 1);
  6868. for(int k4 = 0; k4 < 8; k4++)
  6869. crosses[k4] = new Sprite(streamLoader_2, "cross", k4);
  6870.  
  6871. mapDotItem = new Sprite(streamLoader_2, "mapdots", 0);
  6872. mapDotNPC = new Sprite(streamLoader_2, "mapdots", 1);
  6873. mapDotPlayer = new Sprite(streamLoader_2, "mapdots", 2);
  6874. mapDotFriend = new Sprite(streamLoader_2, "mapdots", 3);
  6875. mapDotTeam = new Sprite(streamLoader_2, "mapdots", 4);
  6876. scrollBar1 = new Background(streamLoader_2, "scrollbar", 0);
  6877. scrollBar2 = new Background(streamLoader_2, "scrollbar", 1);
  6878. redStone1 = new Background(streamLoader_2, "redstone1", 0);
  6879. redStone2 = new Background(streamLoader_2, "redstone2", 0);
  6880. redStone3 = new Background(streamLoader_2, "redstone3", 0);
  6881. redStone1_2 = new Background(streamLoader_2, "redstone1", 0);
  6882. redStone1_2.method358();
  6883. redStone2_2 = new Background(streamLoader_2, "redstone2", 0);
  6884. redStone2_2.method358();
  6885. redStone1_3 = new Background(streamLoader_2, "redstone1", 0);
  6886. redStone1_3.method359();
  6887. redStone2_3 = new Background(streamLoader_2, "redstone2", 0);
  6888. redStone2_3.method359();
  6889. redStone3_2 = new Background(streamLoader_2, "redstone3", 0);
  6890. redStone3_2.method359();
  6891. redStone1_4 = new Background(streamLoader_2, "redstone1", 0);
  6892. redStone1_4.method358();
  6893. redStone1_4.method359();
  6894. redStone2_4 = new Background(streamLoader_2, "redstone2", 0);
  6895. redStone2_4.method358();
  6896. redStone2_4.method359();
  6897. for(int l4 = 0; l4 < 2; l4++)
  6898. modIcons[l4] = new Background(streamLoader_2, "mod_icons", l4);
  6899.  
  6900. Sprite sprite = new Sprite(streamLoader_2, "backleft1", 0);
  6901. backLeftIP1 = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  6902. sprite.method346(0, 0);
  6903. sprite = new Sprite(streamLoader_2, "backleft2", 0);
  6904. backLeftIP2 = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  6905. sprite.method346(0, 0);
  6906. sprite = new Sprite(streamLoader_2, "backright1", 0);
  6907. backRightIP1 = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  6908. sprite.method346(0, 0);
  6909. sprite = new Sprite(streamLoader_2, "backright2", 0);
  6910. backRightIP2 = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  6911. sprite.method346(0, 0);
  6912. sprite = new Sprite(streamLoader_2, "backtop1", 0);
  6913. backTopIP1 = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  6914. sprite.method346(0, 0);
  6915. sprite = new Sprite(streamLoader_2, "backvmid1", 0);
  6916. backVmidIP1 = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  6917. sprite.method346(0, 0);
  6918. sprite = new Sprite(streamLoader_2, "backvmid2", 0);
  6919. backVmidIP2 = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  6920. sprite.method346(0, 0);
  6921. sprite = new Sprite(streamLoader_2, "backvmid3", 0);
  6922. backVmidIP3 = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  6923. sprite.method346(0, 0);
  6924. sprite = new Sprite(streamLoader_2, "backhmid2", 0);
  6925. backVmidIP2_2 = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  6926. sprite.method346(0, 0);
  6927. int i5 = (int)(Math.random() * 21D) - 10;
  6928. int j5 = (int)(Math.random() * 21D) - 10;
  6929. int k5 = (int)(Math.random() * 21D) - 10;
  6930. int l5 = (int)(Math.random() * 41D) - 20;
  6931. for(int i6 = 0; i6 < 100; i6++)
  6932. {
  6933. if(mapFunctions[i6] != null)
  6934. mapFunctions[i6].method344(i5 + l5, j5 + l5, k5 + l5);
  6935. if(mapScenes[i6] != null)
  6936. mapScenes[i6].method360(i5 + l5, j5 + l5, k5 + l5);
  6937. }
  6938.  
  6939. drawLoadingText(83, "Unpacking textures");
  6940. Texture.method368(streamLoader_3);
  6941. Texture.method372(0.80000000000000004D);
  6942. Texture.method367();
  6943. drawLoadingText(86, "Unpacking config");
  6944. Animation.unpackConfig(streamLoader);
  6945. ObjectDef.unpackConfig(streamLoader);
  6946. Flo.unpackConfig(streamLoader);
  6947. ItemDef.unpackConfig(streamLoader);
  6948. EntityDef.unpackConfig(streamLoader);
  6949. IDK.unpackConfig(streamLoader);
  6950. SpotAnim.unpackConfig(streamLoader);
  6951. Varp.unpackConfig(streamLoader);
  6952. VarBit.unpackConfig(streamLoader);
  6953. ItemDef.isMembers = isMembers;
  6954. if(!lowMem)
  6955. {
  6956. drawLoadingText(90, "Unpacking sounds");
  6957. byte abyte0[] = streamLoader_5.getDataForName("sounds.dat");
  6958. Stream stream = new Stream(abyte0);
  6959. Sounds.unpack(stream);
  6960. }
  6961. drawLoadingText(95, "Unpacking interfaces");
  6962. TextDrawingArea aclass30_sub2_sub1_sub4s[] = {
  6963. aTextDrawingArea_1270, aTextDrawingArea_1271, chatTextDrawingArea, aTextDrawingArea_1273
  6964. };
  6965. RSInterface.unpack(streamLoader_1, aclass30_sub2_sub1_sub4s, streamLoader_2);
  6966. drawLoadingText(100, "Preparing game engine");
  6967. for(int j6 = 0; j6 < 33; j6++)
  6968. {
  6969. int k6 = 999;
  6970. int i7 = 0;
  6971. for(int k7 = 0; k7 < 34; k7++)
  6972. {
  6973. if(mapBack.aByteArray1450[k7 + j6 * mapBack.anInt1452] == 0)
  6974. {
  6975. if(k6 == 999)
  6976. k6 = k7;
  6977. continue;
  6978. }
  6979. if(k6 == 999)
  6980. continue;
  6981. i7 = k7;
  6982. break;
  6983. }
  6984.  
  6985. anIntArray968[j6] = k6;
  6986. anIntArray1057[j6] = i7 - k6;
  6987. }
  6988.  
  6989. for(int l6 = 5; l6 < 156; l6++)
  6990. {
  6991. int j7 = 999;
  6992. int l7 = 0;
  6993. for(int j8 = 25; j8 < 172; j8++)
  6994. {
  6995. if(mapBack.aByteArray1450[j8 + l6 * mapBack.anInt1452] == 0 && (j8 > 34 || l6 > 34))
  6996. {
  6997. if(j7 == 999)
  6998. j7 = j8;
  6999. continue;
  7000. }
  7001. if(j7 == 999)
  7002. continue;
  7003. l7 = j8;
  7004. break;
  7005. }
  7006.  
  7007. anIntArray1052[l6 - 5] = j7 - 25;
  7008. anIntArray1229[l6 - 5] = l7 - j7;
  7009. }
  7010.  
  7011. Texture.method365(479, 96);
  7012. anIntArray1180 = Texture.anIntArray1472;
  7013. Texture.method365(190, 261);
  7014. anIntArray1181 = Texture.anIntArray1472;
  7015. Texture.method365(512, 334);
  7016. anIntArray1182 = Texture.anIntArray1472;
  7017. int ai[] = new int[9];
  7018. for(int i8 = 0; i8 < 9; i8++)
  7019. {
  7020. int k8 = 128 + i8 * 32 + 15;
  7021. int l8 = 600 + k8 * 3;
  7022. int i9 = Texture.anIntArray1470[k8];
  7023. ai[i8] = l8 * i9 >> 16;
  7024. }
  7025.  
  7026. WorldController.method310(500, 800, 512, 334, ai);
  7027. Censor.loadConfig(streamLoader_4);
  7028. mouseDetection = new MouseDetection(this);
  7029. startRunnable(mouseDetection, 10);
  7030. Animable_Sub5.clientInstance = this;
  7031. ObjectDef.clientInstance = this;
  7032. EntityDef.clientInstance = this;
  7033. return;
  7034. }
  7035. catch(Exception exception)
  7036. {
  7037. signlink.reporterror("loaderror " + aString1049 + " " + anInt1079);
  7038. }
  7039. loadingError = true;
  7040. }
  7041.  
  7042. private void addNewPlayer(Stream stream, int i)
  7043. {
  7044. while(stream.bitPosition + 10 < i * 8)
  7045. {
  7046. int j = stream.readBits(11);
  7047. if(j == 2047)
  7048. break;
  7049. if(playerArray[j] == null)
  7050. {
  7051. playerArray[j] = new Player();
  7052. if(aStreamArray895s[j] != null)
  7053. playerArray[j].updatePlayer(aStreamArray895s[j]);
  7054. }
  7055. playerIndices[playerCount++] = j;
  7056. Player player = playerArray[j];
  7057. player.anInt1537 = loopCycle;
  7058. int k = stream.readBits(1);
  7059. if(k == 1)
  7060. anIntArray894[anInt893++] = j;
  7061. int l = stream.readBits(1);
  7062. int i1 = stream.readBits(5);
  7063. if(i1 > 15)
  7064. i1 -= 32;
  7065. int j1 = stream.readBits(5);
  7066. if(j1 > 15)
  7067. j1 -= 32;
  7068. player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1, l == 1);
  7069. }
  7070. stream.finishBitAccess();
  7071. }
  7072.  
  7073. private void processMainScreenClick()
  7074. {
  7075. if(anInt1021 != 0)
  7076. return;
  7077. if(super.clickMode3 == 1)
  7078. {
  7079. int i = super.saveClickX - 25 - 550;
  7080. int j = super.saveClickY - 5 - 4;
  7081. if(i >= 0 && j >= 0 && i < 146 && j < 151)
  7082. {
  7083. i -= 73;
  7084. j -= 75;
  7085. int k = minimapInt1 + minimapInt2 & 0x7ff;
  7086. int i1 = Texture.anIntArray1470[k];
  7087. int j1 = Texture.anIntArray1471[k];
  7088. i1 = i1 * (minimapInt3 + 256) >> 8;
  7089. j1 = j1 * (minimapInt3 + 256) >> 8;
  7090. int k1 = j * i1 + i * j1 >> 11;
  7091. int l1 = j * j1 - i * i1 >> 11;
  7092. int i2 = myPlayer.x + k1 >> 7;
  7093. int j2 = myPlayer.y - l1 >> 7;
  7094. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0, j2, myPlayer.smallX[0], true, i2);
  7095. if(flag1)
  7096. {
  7097. stream.addByte(i);
  7098. stream.addByte(j);
  7099. stream.addShort(minimapInt1);
  7100. stream.addByte(57);
  7101. stream.addByte(minimapInt2);
  7102. stream.addByte(minimapInt3);
  7103. stream.addByte(89);
  7104. stream.addShort(myPlayer.x);
  7105. stream.addShort(myPlayer.y);
  7106. stream.addByte(anInt1264);
  7107. stream.addByte(63);
  7108. }
  7109. }
  7110. anInt1117++;
  7111. if(anInt1117 > 1151)
  7112. {
  7113. anInt1117 = 0;
  7114. stream.sendPacket(246);
  7115. stream.addByte(0);
  7116. int l = stream.currentOffset;
  7117. if((int)(Math.random() * 2D) == 0)
  7118. stream.addByte(101);
  7119. stream.addByte(197);
  7120. stream.addShort((int)(Math.random() * 65536D));
  7121. stream.addByte((int)(Math.random() * 256D));
  7122. stream.addByte(67);
  7123. stream.addShort(14214);
  7124. if((int)(Math.random() * 2D) == 0)
  7125. stream.addShort(29487);
  7126. stream.addShort((int)(Math.random() * 65536D));
  7127. if((int)(Math.random() * 2D) == 0)
  7128. stream.addByte(220);
  7129. stream.addByte(180);
  7130. stream.writeBytes(stream.currentOffset - l);
  7131. }
  7132. }
  7133. }
  7134.  
  7135. private String interfaceIntToString(int j)
  7136. {
  7137. if(j < 0x3b9ac9ff)
  7138. return String.valueOf(j);
  7139. else
  7140. return "*";
  7141. }
  7142.  
  7143. private void showErrorScreen()
  7144. {
  7145. Graphics g = getGameComponent().getGraphics();
  7146. g.setColor(Color.black);
  7147. g.fillRect(0, 0, 765, 503);
  7148. method4(1);
  7149. if(loadingError)
  7150. {
  7151. aBoolean831 = false;
  7152. g.setFont(new Font("Helvetica", 1, 16));
  7153. g.setColor(Color.yellow);
  7154. int k = 35;
  7155. g.drawString("Sorry, an error has occured whilst loading RuneScape", 30, k);
  7156. k += 50;
  7157. g.setColor(Color.white);
  7158. g.drawString("To fix this try the following (in order):", 30, k);
  7159. k += 50;
  7160. g.setColor(Color.white);
  7161. g.setFont(new Font("Helvetica", 1, 12));
  7162. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, k);
  7163. k += 30;
  7164. g.drawString("2: Try clearing your web-browsers cache from tools->internet options", 30, k);
  7165. k += 30;
  7166. g.drawString("3: Try using a different game-world", 30, k);
  7167. k += 30;
  7168. g.drawString("4: Try rebooting your computer", 30, k);
  7169. k += 30;
  7170. g.drawString("5: Try selecting a different version of Java from the play-game menu", 30, k);
  7171. }
  7172. if(genericLoadingError)
  7173. {
  7174. aBoolean831 = false;
  7175. g.setFont(new Font("Helvetica", 1, 20));
  7176. g.setColor(Color.white);
  7177. g.drawString("Error - unable to load game!", 50, 50);
  7178. g.drawString("To play RuneScape make sure you play from", 50, 100);
  7179. g.drawString("http://www.runescape.com", 50, 150);
  7180. }
  7181. if(rsAlreadyLoaded)
  7182. {
  7183. aBoolean831 = false;
  7184. g.setColor(Color.yellow);
  7185. int l = 35;
  7186. g.drawString("Error a copy of RuneScape already appears to be loaded", 30, l);
  7187. l += 50;
  7188. g.setColor(Color.white);
  7189. g.drawString("To fix this try the following (in order):", 30, l);
  7190. l += 50;
  7191. g.setColor(Color.white);
  7192. g.setFont(new Font("Helvetica", 1, 12));
  7193. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, l);
  7194. l += 30;
  7195. g.drawString("2: Try rebooting your computer, and reloading", 30, l);
  7196. l += 30;
  7197. }
  7198. }
  7199.  
  7200. public URL getCodeBase()
  7201. {
  7202. if(signlink.mainapp != null)
  7203. return signlink.mainapp.getCodeBase();
  7204. try
  7205. {
  7206. if(super.gameFrame != null)
  7207. return new URL("http://127.0.0.1:" + (80 + portOff));
  7208. }
  7209. catch(Exception _ex) { }
  7210. return super.getCodeBase();
  7211. }
  7212.  
  7213. private void method95()
  7214. {
  7215. for(int j = 0; j < npcCount; j++)
  7216. {
  7217. int k = npcIndices[j];
  7218. NPC npc = npcArray[k];
  7219. if(npc != null)
  7220. method96(npc);
  7221. }
  7222. }
  7223.  
  7224. private void method96(Entity entity)
  7225. {
  7226. if(entity.x < 128 || entity.y < 128 || entity.x >= 13184 || entity.y >= 13184)
  7227. {
  7228. entity.anim = -1;
  7229. entity.anInt1520 = -1;
  7230. entity.anInt1547 = 0;
  7231. entity.anInt1548 = 0;
  7232. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  7233. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  7234. entity.method446();
  7235. }
  7236. if(entity == myPlayer && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776))
  7237. {
  7238. entity.anim = -1;
  7239. entity.anInt1520 = -1;
  7240. entity.anInt1547 = 0;
  7241. entity.anInt1548 = 0;
  7242. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  7243. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  7244. entity.method446();
  7245. }
  7246. if(entity.anInt1547 > loopCycle)
  7247. method97(entity);
  7248. else
  7249. if(entity.anInt1548 >= loopCycle)
  7250. method98(entity);
  7251. else
  7252. method99(entity);
  7253. method100(entity);
  7254. method101(entity);
  7255. }
  7256.  
  7257. private void method97(Entity entity)
  7258. {
  7259. int i = entity.anInt1547 - loopCycle;
  7260. int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  7261. int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  7262. entity.x += (j - entity.x) / i;
  7263. entity.y += (k - entity.y) / i;
  7264. entity.anInt1503 = 0;
  7265. if(entity.anInt1549 == 0)
  7266. entity.turnDirection = 1024;
  7267. if(entity.anInt1549 == 1)
  7268. entity.turnDirection = 1536;
  7269. if(entity.anInt1549 == 2)
  7270. entity.turnDirection = 0;
  7271. if(entity.anInt1549 == 3)
  7272. entity.turnDirection = 512;
  7273. }
  7274.  
  7275. private void method98(Entity entity)
  7276. {
  7277. if(entity.anInt1548 == loopCycle || entity.anim == -1 || entity.anInt1529 != 0 || entity.anInt1528 + 1 > Animation.anims[entity.anim].method258(entity.anInt1527))
  7278. {
  7279. int i = entity.anInt1548 - entity.anInt1547;
  7280. int j = loopCycle - entity.anInt1547;
  7281. int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  7282. int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  7283. int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
  7284. int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
  7285. entity.x = (k * (i - j) + i1 * j) / i;
  7286. entity.y = (l * (i - j) + j1 * j) / i;
  7287. }
  7288. entity.anInt1503 = 0;
  7289. if(entity.anInt1549 == 0)
  7290. entity.turnDirection = 1024;
  7291. if(entity.anInt1549 == 1)
  7292. entity.turnDirection = 1536;
  7293. if(entity.anInt1549 == 2)
  7294. entity.turnDirection = 0;
  7295. if(entity.anInt1549 == 3)
  7296. entity.turnDirection = 512;
  7297. entity.anInt1552 = entity.turnDirection;
  7298. }
  7299.  
  7300. private void method99(Entity entity)
  7301. {
  7302. entity.anInt1517 = entity.anInt1511;
  7303. if(entity.smallXYIndex == 0)
  7304. {
  7305. entity.anInt1503 = 0;
  7306. return;
  7307. }
  7308. if(entity.anim != -1 && entity.anInt1529 == 0)
  7309. {
  7310. Animation animation = Animation.anims[entity.anim];
  7311. if(entity.anInt1542 > 0 && animation.anInt363 == 0)
  7312. {
  7313. entity.anInt1503++;
  7314. return;
  7315. }
  7316. if(entity.anInt1542 <= 0 && animation.anInt364 == 0)
  7317. {
  7318. entity.anInt1503++;
  7319. return;
  7320. }
  7321. }
  7322. int i = entity.x;
  7323. int j = entity.y;
  7324. int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  7325. int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  7326. if(k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256)
  7327. {
  7328. entity.x = k;
  7329. entity.y = l;
  7330. return;
  7331. }
  7332. if(i < k)
  7333. {
  7334. if(j < l)
  7335. entity.turnDirection = 1280;
  7336. else
  7337. if(j > l)
  7338. entity.turnDirection = 1792;
  7339. else
  7340. entity.turnDirection = 1536;
  7341. } else
  7342. if(i > k)
  7343. {
  7344. if(j < l)
  7345. entity.turnDirection = 768;
  7346. else
  7347. if(j > l)
  7348. entity.turnDirection = 256;
  7349. else
  7350. entity.turnDirection = 512;
  7351. } else
  7352. if(j < l)
  7353. entity.turnDirection = 1024;
  7354. else
  7355. entity.turnDirection = 0;
  7356. int i1 = entity.turnDirection - entity.anInt1552 & 0x7ff;
  7357. if(i1 > 1024)
  7358. i1 -= 2048;
  7359. int j1 = entity.anInt1555;
  7360. if(i1 >= -256 && i1 <= 256)
  7361. j1 = entity.anInt1554;
  7362. else
  7363. if(i1 >= 256 && i1 < 768)
  7364. j1 = entity.anInt1557;
  7365. else
  7366. if(i1 >= -768 && i1 <= -256)
  7367. j1 = entity.anInt1556;
  7368. if(j1 == -1)
  7369. j1 = entity.anInt1554;
  7370. entity.anInt1517 = j1;
  7371. int k1 = 4;
  7372. if(entity.anInt1552 != entity.turnDirection && entity.interactingEntity == -1 && entity.anInt1504 != 0)
  7373. k1 = 2;
  7374. if(entity.smallXYIndex > 2)
  7375. k1 = 6;
  7376. if(entity.smallXYIndex > 3)
  7377. k1 = 8;
  7378. if(entity.anInt1503 > 0 && entity.smallXYIndex > 1)
  7379. {
  7380. k1 = 8;
  7381. entity.anInt1503--;
  7382. }
  7383. if(entity.aBooleanArray1553[entity.smallXYIndex - 1])
  7384. k1 <<= 1;
  7385. if(k1 >= 8 && entity.anInt1517 == entity.anInt1554 && entity.anInt1505 != -1)
  7386. entity.anInt1517 = entity.anInt1505;
  7387. if(i < k)
  7388. {
  7389. entity.x += k1;
  7390. if(entity.x > k)
  7391. entity.x = k;
  7392. } else
  7393. if(i > k)
  7394. {
  7395. entity.x -= k1;
  7396. if(entity.x < k)
  7397. entity.x = k;
  7398. }
  7399. if(j < l)
  7400. {
  7401. entity.y += k1;
  7402. if(entity.y > l)
  7403. entity.y = l;
  7404. } else
  7405. if(j > l)
  7406. {
  7407. entity.y -= k1;
  7408. if(entity.y < l)
  7409. entity.y = l;
  7410. }
  7411. if(entity.x == k && entity.y == l)
  7412. {
  7413. entity.smallXYIndex--;
  7414. if(entity.anInt1542 > 0)
  7415. entity.anInt1542--;
  7416. }
  7417. }
  7418.  
  7419. private void method100(Entity entity)
  7420. {
  7421. if(entity.anInt1504 == 0)
  7422. return;
  7423. if(entity.interactingEntity != -1 && entity.interactingEntity < 32768)
  7424. {
  7425. NPC npc = npcArray[entity.interactingEntity];
  7426. if(npc != null)
  7427. {
  7428. int i1 = entity.x - npc.x;
  7429. int k1 = entity.y - npc.y;
  7430. if(i1 != 0 || k1 != 0)
  7431. entity.turnDirection = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  7432. }
  7433. }
  7434. if(entity.interactingEntity >= 32768)
  7435. {
  7436. int j = entity.interactingEntity - 32768;
  7437. if(j == unknownInt10)
  7438. j = myPlayerIndex;
  7439. Player player = playerArray[j];
  7440. if(player != null)
  7441. {
  7442. int l1 = entity.x - player.x;
  7443. int i2 = entity.y - player.y;
  7444. if(l1 != 0 || i2 != 0)
  7445. entity.turnDirection = (int)(Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  7446. }
  7447. }
  7448. if((entity.anInt1538 != 0 || entity.anInt1539 != 0) && (entity.smallXYIndex == 0 || entity.anInt1503 > 0))
  7449. {
  7450. int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
  7451. int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
  7452. if(k != 0 || j1 != 0)
  7453. entity.turnDirection = (int)(Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  7454. entity.anInt1538 = 0;
  7455. entity.anInt1539 = 0;
  7456. }
  7457. int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
  7458. if(l != 0)
  7459. {
  7460. if(l < entity.anInt1504 || l > 2048 - entity.anInt1504)
  7461. entity.anInt1552 = entity.turnDirection;
  7462. else
  7463. if(l > 1024)
  7464. entity.anInt1552 -= entity.anInt1504;
  7465. else
  7466. entity.anInt1552 += entity.anInt1504;
  7467. entity.anInt1552 &= 0x7ff;
  7468. if(entity.anInt1517 == entity.anInt1511 && entity.anInt1552 != entity.turnDirection)
  7469. {
  7470. if(entity.anInt1512 != -1)
  7471. {
  7472. entity.anInt1517 = entity.anInt1512;
  7473. return;
  7474. }
  7475. entity.anInt1517 = entity.anInt1554;
  7476. }
  7477. }
  7478. }
  7479.  
  7480. private void method101(Entity entity)
  7481. {
  7482. entity.aBoolean1541 = false;
  7483. if(entity.anInt1517 != -1)
  7484. {
  7485. Animation animation = Animation.anims[entity.anInt1517];
  7486. entity.anInt1519++;
  7487. if(entity.anInt1518 < animation.anInt352 && entity.anInt1519 > animation.method258(entity.anInt1518))
  7488. {
  7489. entity.anInt1519 = 0;
  7490. entity.anInt1518++;
  7491. }
  7492. if(entity.anInt1518 >= animation.anInt352)
  7493. {
  7494. entity.anInt1519 = 0;
  7495. entity.anInt1518 = 0;
  7496. }
  7497. }
  7498. if(entity.anInt1520 != -1 && loopCycle >= entity.anInt1523)
  7499. {
  7500. if(entity.anInt1521 < 0)
  7501. entity.anInt1521 = 0;
  7502. Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  7503. for(entity.anInt1522++; entity.anInt1521 < animation_1.anInt352 && entity.anInt1522 > animation_1.method258(entity.anInt1521); entity.anInt1521++)
  7504. entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  7505.  
  7506. if(entity.anInt1521 >= animation_1.anInt352 && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352))
  7507. entity.anInt1520 = -1;
  7508. }
  7509. if(entity.anim != -1 && entity.anInt1529 <= 1)
  7510. {
  7511. Animation animation_2 = Animation.anims[entity.anim];
  7512. if(animation_2.anInt363 == 1 && entity.anInt1542 > 0 && entity.anInt1547 <= loopCycle && entity.anInt1548 < loopCycle)
  7513. {
  7514. entity.anInt1529 = 1;
  7515. return;
  7516. }
  7517. }
  7518. if(entity.anim != -1 && entity.anInt1529 == 0)
  7519. {
  7520. Animation animation_3 = Animation.anims[entity.anim];
  7521. for(entity.anInt1528++; entity.anInt1527 < animation_3.anInt352 && entity.anInt1528 > animation_3.method258(entity.anInt1527); entity.anInt1527++)
  7522. entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  7523.  
  7524. if(entity.anInt1527 >= animation_3.anInt352)
  7525. {
  7526. entity.anInt1527 -= animation_3.anInt356;
  7527. entity.anInt1530++;
  7528. if(entity.anInt1530 >= animation_3.anInt362)
  7529. entity.anim = -1;
  7530. if(entity.anInt1527 < 0 || entity.anInt1527 >= animation_3.anInt352)
  7531. entity.anim = -1;
  7532. }
  7533. entity.aBoolean1541 = animation_3.aBoolean358;
  7534. }
  7535. if(entity.anInt1529 > 0)
  7536. entity.anInt1529--;
  7537. }
  7538.  
  7539. private void drawGameScreen()
  7540. {
  7541. if(welcomeScreenRaised)
  7542. {
  7543. welcomeScreenRaised = false;
  7544. backLeftIP1.drawGraphics(4, super.graphics, 0);
  7545. backLeftIP2.drawGraphics(357, super.graphics, 0);
  7546. backRightIP1.drawGraphics(4, super.graphics, 722);
  7547. backRightIP2.drawGraphics(205, super.graphics, 743);
  7548. backTopIP1.drawGraphics(0, super.graphics, 0);
  7549. backVmidIP1.drawGraphics(4, super.graphics, 516);
  7550. backVmidIP2.drawGraphics(205, super.graphics, 516);
  7551. backVmidIP3.drawGraphics(357, super.graphics, 496);
  7552. backVmidIP2_2.drawGraphics(338, super.graphics, 0);
  7553. needDrawTabArea = true;
  7554. inputTaken = true;
  7555. tabAreaAltered = true;
  7556. aBoolean1233 = true;
  7557. if(loadingStage != 2)
  7558. {
  7559. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  7560. aRSImageProducer_1164.drawGraphics(4, super.graphics, 550);
  7561. }
  7562. }
  7563. if(loadingStage == 2)
  7564. method146();
  7565. if(menuOpen && menuScreenArea == 1)
  7566. needDrawTabArea = true;
  7567. if(invOverlayInterfaceID != -1)
  7568. {
  7569. boolean flag1 = method119(anInt945, invOverlayInterfaceID);
  7570. if(flag1)
  7571. needDrawTabArea = true;
  7572. }
  7573. if(atInventoryInterfaceType == 2)
  7574. needDrawTabArea = true;
  7575. if(activeInterfaceType == 2)
  7576. needDrawTabArea = true;
  7577. if(needDrawTabArea)
  7578. {
  7579. drawTabArea();
  7580. needDrawTabArea = false;
  7581. }
  7582. if(backDialogID == -1)
  7583. {
  7584. aClass9_1059.scrollPosition = anInt1211 - anInt1089 - 77;
  7585. if(super.mouseX > 448 && super.mouseX < 560 && super.mouseY > 332)
  7586. method65(463, 77, super.mouseX - 17, super.mouseY - 357, aClass9_1059, 0, false, anInt1211);
  7587. int i = anInt1211 - 77 - aClass9_1059.scrollPosition;
  7588. if(i < 0)
  7589. i = 0;
  7590. if(i > anInt1211 - 77)
  7591. i = anInt1211 - 77;
  7592. if(anInt1089 != i)
  7593. {
  7594. anInt1089 = i;
  7595. inputTaken = true;
  7596. }
  7597. }
  7598. if(backDialogID != -1)
  7599. {
  7600. boolean flag2 = method119(anInt945, backDialogID);
  7601. if(flag2)
  7602. inputTaken = true;
  7603. }
  7604. if(atInventoryInterfaceType == 3)
  7605. inputTaken = true;
  7606. if(activeInterfaceType == 3)
  7607. inputTaken = true;
  7608. if(aString844 != null)
  7609. inputTaken = true;
  7610. if(menuOpen && menuScreenArea == 2)
  7611. inputTaken = true;
  7612. if(inputTaken)
  7613. {
  7614. drawChatArea();
  7615. inputTaken = false;
  7616. }
  7617. if(loadingStage == 2)
  7618. {
  7619. drawMinimap();
  7620. aRSImageProducer_1164.drawGraphics(4, super.graphics, 550);
  7621. }
  7622. if(anInt1054 != -1)
  7623. tabAreaAltered = true;
  7624. if(tabAreaAltered)
  7625. {
  7626. if(anInt1054 != -1 && anInt1054 == tabID)
  7627. {
  7628. anInt1054 = -1;
  7629. stream.sendPacket(120);
  7630. stream.addByte(tabID);
  7631. }
  7632. tabAreaAltered = false;
  7633. aRSImageProducer_1125.initDrawingArea();
  7634. backHmid1.method361(0, 0);
  7635. if(invOverlayInterfaceID == -1)
  7636. {
  7637. if(tabInterfaceIDs[tabID] != -1)
  7638. {
  7639. if(tabID == 0)
  7640. redStone1.method361(22, 10);
  7641. if(tabID == 1)
  7642. redStone2.method361(54, 8);
  7643. if(tabID == 2)
  7644. redStone2.method361(82, 8);
  7645. if(tabID == 3)
  7646. redStone3.method361(110, 8);
  7647. if(tabID == 4)
  7648. redStone2_2.method361(153, 8);
  7649. if(tabID == 5)
  7650. redStone2_2.method361(181, 8);
  7651. if(tabID == 6)
  7652. redStone1_2.method361(209, 9);
  7653. }
  7654. if(tabInterfaceIDs[0] != -1 && (anInt1054 != 0 || loopCycle % 20 < 10))
  7655. sideIcons[0].method361(29, 13);
  7656. if(tabInterfaceIDs[1] != -1 && (anInt1054 != 1 || loopCycle % 20 < 10))
  7657. sideIcons[1].method361(53, 11);
  7658. if(tabInterfaceIDs[2] != -1 && (anInt1054 != 2 || loopCycle % 20 < 10))
  7659. sideIcons[2].method361(82, 11);
  7660. if(tabInterfaceIDs[3] != -1 && (anInt1054 != 3 || loopCycle % 20 < 10))
  7661. sideIcons[3].method361(115, 12);
  7662. if(tabInterfaceIDs[4] != -1 && (anInt1054 != 4 || loopCycle % 20 < 10))
  7663. sideIcons[4].method361(153, 13);
  7664. if(tabInterfaceIDs[5] != -1 && (anInt1054 != 5 || loopCycle % 20 < 10))
  7665. sideIcons[5].method361(180, 11);
  7666. if(tabInterfaceIDs[6] != -1 && (anInt1054 != 6 || loopCycle % 20 < 10))
  7667. sideIcons[6].method361(208, 13);
  7668. }
  7669. aRSImageProducer_1125.drawGraphics(160, super.graphics, 516);
  7670. aRSImageProducer_1124.initDrawingArea();
  7671. backBase2.method361(0, 0);
  7672. if(invOverlayInterfaceID == -1)
  7673. {
  7674. if(tabInterfaceIDs[tabID] != -1)
  7675. {
  7676. if(tabID == 7)
  7677. redStone1_3.method361(42, 0);
  7678. if(tabID == 8)
  7679. redStone2_3.method361(74, 0);
  7680. if(tabID == 9)
  7681. redStone2_3.method361(102, 0);
  7682. if(tabID == 10)
  7683. redStone3_2.method361(130, 1);
  7684. if(tabID == 11)
  7685. redStone2_4.method361(173, 0);
  7686. if(tabID == 12)
  7687. redStone2_4.method361(201, 0);
  7688. if(tabID == 13)
  7689. redStone1_4.method361(229, 0);
  7690. }
  7691. if(tabInterfaceIDs[8] != -1 && (anInt1054 != 8 || loopCycle % 20 < 10))
  7692. sideIcons[7].method361(74, 2);
  7693. if(tabInterfaceIDs[9] != -1 && (anInt1054 != 9 || loopCycle % 20 < 10))
  7694. sideIcons[8].method361(102, 3);
  7695. if(tabInterfaceIDs[10] != -1 && (anInt1054 != 10 || loopCycle % 20 < 10))
  7696. sideIcons[9].method361(137, 4);
  7697. if(tabInterfaceIDs[11] != -1 && (anInt1054 != 11 || loopCycle % 20 < 10))
  7698. sideIcons[10].method361(174, 2);
  7699. if(tabInterfaceIDs[12] != -1 && (anInt1054 != 12 || loopCycle % 20 < 10))
  7700. sideIcons[11].method361(201, 2);
  7701. if(tabInterfaceIDs[13] != -1 && (anInt1054 != 13 || loopCycle % 20 < 10))
  7702. sideIcons[12].method361(226, 2);
  7703. }
  7704. aRSImageProducer_1124.drawGraphics(466, super.graphics, 496);
  7705. aRSImageProducer_1165.initDrawingArea();
  7706. }
  7707. if(aBoolean1233)
  7708. {
  7709. aBoolean1233 = false;
  7710. aRSImageProducer_1123.initDrawingArea();
  7711. backBase1.method361(0, 0);
  7712. aTextDrawingArea_1271.method382(0xffffff, 55, "Public chat", 28, true);
  7713. if(publicChatMode == 0)
  7714. aTextDrawingArea_1271.method382(65280, 55, "On", 41, true);
  7715. if(publicChatMode == 1)
  7716. aTextDrawingArea_1271.method382(0xffff00, 55, "Friends", 41, true);
  7717. if(publicChatMode == 2)
  7718. aTextDrawingArea_1271.method382(0xff0000, 55, "Off", 41, true);
  7719. if(publicChatMode == 3)
  7720. aTextDrawingArea_1271.method382(65535, 55, "Hide", 41, true);
  7721. aTextDrawingArea_1271.method382(0xffffff, 184, "Private chat", 28, true);
  7722. if(privateChatMode == 0)
  7723. aTextDrawingArea_1271.method382(65280, 184, "On", 41, true);
  7724. if(privateChatMode == 1)
  7725. aTextDrawingArea_1271.method382(0xffff00, 184, "Friends", 41, true);
  7726. if(privateChatMode == 2)
  7727. aTextDrawingArea_1271.method382(0xff0000, 184, "Off", 41, true);
  7728. aTextDrawingArea_1271.method382(0xffffff, 324, "Trade/compete", 28, true);
  7729. if(tradeMode == 0)
  7730. aTextDrawingArea_1271.method382(65280, 324, "On", 41, true);
  7731. if(tradeMode == 1)
  7732. aTextDrawingArea_1271.method382(0xffff00, 324, "Friends", 41, true);
  7733. if(tradeMode == 2)
  7734. aTextDrawingArea_1271.method382(0xff0000, 324, "Off", 41, true);
  7735. aTextDrawingArea_1271.method382(0xffffff, 458, "Report abuse", 33, true);
  7736. aRSImageProducer_1123.drawGraphics(453, super.graphics, 0);
  7737. aRSImageProducer_1165.initDrawingArea();
  7738. }
  7739. anInt945 = 0;
  7740. }
  7741.  
  7742. private boolean buildFriendsListMenu(RSInterface class9)
  7743. {
  7744. int i = class9.anInt214;
  7745. if(i >= 1 && i <= 200 || i >= 701 && i <= 900)
  7746. {
  7747. if(i >= 801)
  7748. i -= 701;
  7749. else
  7750. if(i >= 701)
  7751. i -= 601;
  7752. else
  7753. if(i >= 101)
  7754. i -= 101;
  7755. else
  7756. i--;
  7757. menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
  7758. menuActionID[menuActionRow] = 792;
  7759. menuActionRow++;
  7760. menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
  7761. menuActionID[menuActionRow] = 639;
  7762. menuActionRow++;
  7763. return true;
  7764. }
  7765. if(i >= 401 && i <= 500)
  7766. {
  7767. menuActionName[menuActionRow] = "Remove @whi@" + class9.message;
  7768. menuActionID[menuActionRow] = 322;
  7769. menuActionRow++;
  7770. return true;
  7771. } else
  7772. {
  7773. return false;
  7774. }
  7775. }
  7776.  
  7777. private void method104()
  7778. {
  7779. Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetFirst();
  7780. for(; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetNext())
  7781. if(class30_sub2_sub4_sub3.anInt1560 != plane || class30_sub2_sub4_sub3.aBoolean1567)
  7782. class30_sub2_sub4_sub3.unlink();
  7783. else
  7784. if(loopCycle >= class30_sub2_sub4_sub3.anInt1564)
  7785. {
  7786. class30_sub2_sub4_sub3.method454(anInt945);
  7787. if(class30_sub2_sub4_sub3.aBoolean1567)
  7788. class30_sub2_sub4_sub3.unlink();
  7789. else
  7790. 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);
  7791. }
  7792.  
  7793. }
  7794.  
  7795. private void drawInterface(int j, int k, RSInterface class9, int l)
  7796. {
  7797. if(class9.type != 0 || class9.children == null)
  7798. return;
  7799. if(class9.aBoolean266 && anInt1026 != class9.id && anInt1048 != class9.id && anInt1039 != class9.id)
  7800. return;
  7801. int i1 = DrawingArea.topX;
  7802. int j1 = DrawingArea.topY;
  7803. int k1 = DrawingArea.bottomX;
  7804. int l1 = DrawingArea.bottomY;
  7805. DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  7806. int i2 = class9.children.length;
  7807. for(int j2 = 0; j2 < i2; j2++)
  7808. {
  7809. int k2 = class9.childX[j2] + k;
  7810. int l2 = (class9.childY[j2] + l) - j;
  7811. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j2]];
  7812. k2 += class9_1.anInt263;
  7813. l2 += class9_1.anInt265;
  7814. if(class9_1.anInt214 > 0)
  7815. drawFriendsListOrWelcomeScreen(class9_1);
  7816. if(class9_1.type == 0)
  7817. {
  7818. if(class9_1.scrollPosition > class9_1.scrollMax - class9_1.height)
  7819. class9_1.scrollPosition = class9_1.scrollMax - class9_1.height;
  7820. if(class9_1.scrollPosition < 0)
  7821. class9_1.scrollPosition = 0;
  7822. drawInterface(class9_1.scrollPosition, k2, class9_1, l2);
  7823. if(class9_1.scrollMax > class9_1.height)
  7824. method30(class9_1.height, class9_1.scrollPosition, l2, k2 + class9_1.width, class9_1.scrollMax);
  7825. } else
  7826. if(class9_1.type != 1)
  7827. if(class9_1.type == 2)
  7828. {
  7829. int i3 = 0;
  7830. for(int l3 = 0; l3 < class9_1.height; l3++)
  7831. {
  7832. for(int l4 = 0; l4 < class9_1.width; l4++)
  7833. {
  7834. int k5 = k2 + l4 * (32 + class9_1.invSpritePadX);
  7835. int j6 = l2 + l3 * (32 + class9_1.invSpritePadY);
  7836. if(i3 < 20)
  7837. {
  7838. k5 += class9_1.spritesX[i3];
  7839. j6 += class9_1.spritesY[i3];
  7840. }
  7841. if(class9_1.inv[i3] > 0)
  7842. {
  7843. int k6 = 0;
  7844. int j7 = 0;
  7845. int j9 = class9_1.inv[i3] - 1;
  7846. if(k5 > DrawingArea.topX - 32 && k5 < DrawingArea.bottomX && j6 > DrawingArea.topY - 32 && j6 < DrawingArea.bottomY || activeInterfaceType != 0 && anInt1085 == i3)
  7847. {
  7848. int l9 = 0;
  7849. if(itemSelected == 1 && anInt1283 == i3 && anInt1284 == class9_1.id)
  7850. l9 = 0xffffff;
  7851. Sprite class30_sub2_sub1_sub1_2 = ItemDef.getSprite(j9, class9_1.invStackSizes[i3], l9);
  7852. if(class30_sub2_sub1_sub1_2 != null)
  7853. {
  7854. if(activeInterfaceType != 0 && anInt1085 == i3 && anInt1084 == class9_1.id)
  7855. {
  7856. k6 = super.mouseX - anInt1087;
  7857. j7 = super.mouseY - anInt1088;
  7858. if(k6 < 5 && k6 > -5)
  7859. k6 = 0;
  7860. if(j7 < 5 && j7 > -5)
  7861. j7 = 0;
  7862. if(anInt989 < 5)
  7863. {
  7864. k6 = 0;
  7865. j7 = 0;
  7866. }
  7867. class30_sub2_sub1_sub1_2.drawSprite1(k5 + k6, j6 + j7);
  7868. if(j6 + j7 < DrawingArea.topY && class9.scrollPosition > 0)
  7869. {
  7870. int i10 = (anInt945 * (DrawingArea.topY - j6 - j7)) / 3;
  7871. if(i10 > anInt945 * 10)
  7872. i10 = anInt945 * 10;
  7873. if(i10 > class9.scrollPosition)
  7874. i10 = class9.scrollPosition;
  7875. class9.scrollPosition -= i10;
  7876. anInt1088 += i10;
  7877. }
  7878. if(j6 + j7 + 32 > DrawingArea.bottomY && class9.scrollPosition < class9.scrollMax - class9.height)
  7879. {
  7880. int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  7881. if(j10 > anInt945 * 10)
  7882. j10 = anInt945 * 10;
  7883. if(j10 > class9.scrollMax - class9.height - class9.scrollPosition)
  7884. j10 = class9.scrollMax - class9.height - class9.scrollPosition;
  7885. class9.scrollPosition += j10;
  7886. anInt1088 -= j10;
  7887. }
  7888. } else
  7889. if(atInventoryInterfaceType != 0 && atInventoryIndex == i3 && atInventoryInterface == class9_1.id)
  7890. class30_sub2_sub1_sub1_2.drawSprite1(k5, j6);
  7891. else
  7892. class30_sub2_sub1_sub1_2.drawSprite(k5, j6);
  7893. if(class30_sub2_sub1_sub1_2.anInt1444 == 33 || class9_1.invStackSizes[i3] != 1)
  7894. {
  7895. int k10 = class9_1.invStackSizes[i3];
  7896. aTextDrawingArea_1270.method385(0, intToKOrMil(k10), j6 + 10 + j7, k5 + 1 + k6);
  7897. aTextDrawingArea_1270.method385(0xffff00, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  7898. }
  7899. }
  7900. }
  7901. } else
  7902. if(class9_1.sprites != null && i3 < 20)
  7903. {
  7904. Sprite class30_sub2_sub1_sub1_1 = class9_1.sprites[i3];
  7905. if(class30_sub2_sub1_sub1_1 != null)
  7906. class30_sub2_sub1_sub1_1.drawSprite(k5, j6);
  7907. }
  7908. i3++;
  7909. }
  7910.  
  7911. }
  7912.  
  7913. } else
  7914. if(class9_1.type == 3)
  7915. {
  7916. boolean flag = false;
  7917. if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  7918. flag = true;
  7919. int j3;
  7920. if(interfaceIsSelected(class9_1))
  7921. {
  7922. j3 = class9_1.anInt219;
  7923. if(flag && class9_1.anInt239 != 0)
  7924. j3 = class9_1.anInt239;
  7925. } else
  7926. {
  7927. j3 = class9_1.textColor;
  7928. if(flag && class9_1.anInt216 != 0)
  7929. j3 = class9_1.anInt216;
  7930. }
  7931. if(class9_1.aByte254 == 0)
  7932. {
  7933. if(class9_1.aBoolean227)
  7934. DrawingArea.method336(class9_1.height, l2, k2, j3, class9_1.width);
  7935. else
  7936. DrawingArea.fillPixels(k2, class9_1.width, class9_1.height, j3, l2);
  7937. } else
  7938. if(class9_1.aBoolean227)
  7939. DrawingArea.method335(j3, l2, class9_1.width, class9_1.height, 256 - (class9_1.aByte254 & 0xff), k2);
  7940. else
  7941. DrawingArea.method338(l2, class9_1.height, 256 - (class9_1.aByte254 & 0xff), j3, class9_1.width, k2);
  7942. } else
  7943. if(class9_1.type == 4)
  7944. {
  7945. TextDrawingArea textDrawingArea = class9_1.textDrawingAreas;
  7946. String s = class9_1.message;
  7947. boolean flag1 = false;
  7948. if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  7949. flag1 = true;
  7950. int i4;
  7951. if(interfaceIsSelected(class9_1))
  7952. {
  7953. i4 = class9_1.anInt219;
  7954. if(flag1 && class9_1.anInt239 != 0)
  7955. i4 = class9_1.anInt239;
  7956. if(class9_1.aString228.length() > 0)
  7957. s = class9_1.aString228;
  7958. } else
  7959. {
  7960. i4 = class9_1.textColor;
  7961. if(flag1 && class9_1.anInt216 != 0)
  7962. i4 = class9_1.anInt216;
  7963. }
  7964. if(class9_1.atActionType == 6 && aBoolean1149)
  7965. {
  7966. s = "Please wait...";
  7967. i4 = class9_1.textColor;
  7968. }
  7969. if(DrawingArea.width == 479)
  7970. {
  7971. if(i4 == 0xffff00)
  7972. i4 = 255;
  7973. if(i4 == 49152)
  7974. i4 = 0xffffff;
  7975. }
  7976. for(int l6 = l2 + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497)
  7977. {
  7978. if(s.indexOf("%") != -1)
  7979. {
  7980. do
  7981. {
  7982. int k7 = s.indexOf("%1");
  7983. if(k7 == -1)
  7984. break;
  7985. s = s.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  7986. } while(true);
  7987. do
  7988. {
  7989. int l7 = s.indexOf("%2");
  7990. if(l7 == -1)
  7991. break;
  7992. s = s.substring(0, l7) + interfaceIntToString(extractInterfaceValues(class9_1, 1)) + s.substring(l7 + 2);
  7993. } while(true);
  7994. do
  7995. {
  7996. int i8 = s.indexOf("%3");
  7997. if(i8 == -1)
  7998. break;
  7999. s = s.substring(0, i8) + interfaceIntToString(extractInterfaceValues(class9_1, 2)) + s.substring(i8 + 2);
  8000. } while(true);
  8001. do
  8002. {
  8003. int j8 = s.indexOf("%4");
  8004. if(j8 == -1)
  8005. break;
  8006. s = s.substring(0, j8) + interfaceIntToString(extractInterfaceValues(class9_1, 3)) + s.substring(j8 + 2);
  8007. } while(true);
  8008. do
  8009. {
  8010. int k8 = s.indexOf("%5");
  8011. if(k8 == -1)
  8012. break;
  8013. s = s.substring(0, k8) + interfaceIntToString(extractInterfaceValues(class9_1, 4)) + s.substring(k8 + 2);
  8014. } while(true);
  8015. }
  8016. int l8 = s.indexOf("\\n");
  8017. String s1;
  8018. if(l8 != -1)
  8019. {
  8020. s1 = s.substring(0, l8);
  8021. s = s.substring(l8 + 2);
  8022. } else
  8023. {
  8024. s1 = s;
  8025. s = "";
  8026. }
  8027. if(class9_1.aBoolean223)
  8028. textDrawingArea.method382(i4, k2 + class9_1.width / 2, s1, l6, class9_1.aBoolean268);
  8029. else
  8030. textDrawingArea.method389(class9_1.aBoolean268, k2, i4, s1, l6);
  8031. }
  8032.  
  8033. } else
  8034. if(class9_1.type == 5)
  8035. {
  8036. Sprite sprite;
  8037. if(interfaceIsSelected(class9_1))
  8038. sprite = class9_1.sprite2;
  8039. else
  8040. sprite = class9_1.sprite1;
  8041. if(sprite != null)
  8042. sprite.drawSprite(k2, l2);
  8043. } else
  8044. if(class9_1.type == 6)
  8045. {
  8046. int k3 = Texture.textureInt1;
  8047. int j4 = Texture.textureInt2;
  8048. Texture.textureInt1 = k2 + class9_1.width / 2;
  8049. Texture.textureInt2 = l2 + class9_1.height / 2;
  8050. int i5 = Texture.anIntArray1470[class9_1.anInt270] * class9_1.anInt269 >> 16;
  8051. int l5 = Texture.anIntArray1471[class9_1.anInt270] * class9_1.anInt269 >> 16;
  8052. boolean flag2 = interfaceIsSelected(class9_1);
  8053. int i7;
  8054. if(flag2)
  8055. i7 = class9_1.anInt258;
  8056. else
  8057. i7 = class9_1.anInt257;
  8058. Model model;
  8059. if(i7 == -1)
  8060. {
  8061. model = class9_1.method209(-1, -1, flag2);
  8062. } else
  8063. {
  8064. Animation animation = Animation.anims[i7];
  8065. model = class9_1.method209(animation.anIntArray354[class9_1.anInt246], animation.anIntArray353[class9_1.anInt246], flag2);
  8066. }
  8067. if(model != null)
  8068. model.method482(class9_1.anInt271, 0, class9_1.anInt270, 0, i5, l5);
  8069. Texture.textureInt1 = k3;
  8070. Texture.textureInt2 = j4;
  8071. } else
  8072. if(class9_1.type == 7)
  8073. {
  8074. TextDrawingArea textDrawingArea_1 = class9_1.textDrawingAreas;
  8075. int k4 = 0;
  8076. for(int j5 = 0; j5 < class9_1.height; j5++)
  8077. {
  8078. for(int i6 = 0; i6 < class9_1.width; i6++)
  8079. {
  8080. if(class9_1.inv[k4] > 0)
  8081. {
  8082. ItemDef itemDef = ItemDef.forID(class9_1.inv[k4] - 1);
  8083. String s2 = itemDef.name;
  8084. if(itemDef.stackable || class9_1.invStackSizes[k4] != 1)
  8085. s2 = s2 + " x" + intToKOrMilLongName(class9_1.invStackSizes[k4]);
  8086. int i9 = k2 + i6 * (115 + class9_1.invSpritePadX);
  8087. int k9 = l2 + j5 * (12 + class9_1.invSpritePadY);
  8088. if(class9_1.aBoolean223)
  8089. textDrawingArea_1.method382(class9_1.textColor, i9 + class9_1.width / 2, s2, k9, class9_1.aBoolean268);
  8090. else
  8091. textDrawingArea_1.method389(class9_1.aBoolean268, i9, class9_1.textColor, s2, k9);
  8092. }
  8093. k4++;
  8094. }
  8095.  
  8096. }
  8097.  
  8098. }
  8099. }
  8100.  
  8101. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  8102. }
  8103.  
  8104. private void randomizeBackground(Background background)
  8105. {
  8106. int j = 256;
  8107. for(int k = 0; k < anIntArray1190.length; k++)
  8108. anIntArray1190[k] = 0;
  8109.  
  8110. for(int l = 0; l < 5000; l++)
  8111. {
  8112. int i1 = (int)(Math.random() * 128D * (double)j);
  8113. anIntArray1190[i1] = (int)(Math.random() * 256D);
  8114. }
  8115.  
  8116. for(int j1 = 0; j1 < 20; j1++)
  8117. {
  8118. for(int k1 = 1; k1 < j - 1; k1++)
  8119. {
  8120. for(int i2 = 1; i2 < 127; i2++)
  8121. {
  8122. int k2 = i2 + (k1 << 7);
  8123. anIntArray1191[k2] = (anIntArray1190[k2 - 1] + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128] + anIntArray1190[k2 + 128]) / 4;
  8124. }
  8125.  
  8126. }
  8127.  
  8128. int ai[] = anIntArray1190;
  8129. anIntArray1190 = anIntArray1191;
  8130. anIntArray1191 = ai;
  8131. }
  8132.  
  8133. if(background != null)
  8134. {
  8135. int l1 = 0;
  8136. for(int j2 = 0; j2 < background.anInt1453; j2++)
  8137. {
  8138. for(int l2 = 0; l2 < background.anInt1452; l2++)
  8139. if(background.aByteArray1450[l1++] != 0)
  8140. {
  8141. int i3 = l2 + 16 + background.anInt1454;
  8142. int j3 = j2 + 16 + background.anInt1455;
  8143. int k3 = i3 + (j3 << 7);
  8144. anIntArray1190[k3] = 0;
  8145. }
  8146.  
  8147. }
  8148.  
  8149. }
  8150. }
  8151.  
  8152. private void method107(int i, int j, Stream stream, Player player)
  8153. {
  8154. if((i & 0x400) != 0) // movement
  8155. {
  8156. player.anInt1543 = stream.method428();
  8157. player.anInt1545 = stream.method428();
  8158. player.anInt1544 = stream.method428();
  8159. player.anInt1546 = stream.method428();
  8160. player.anInt1547 = stream.method436() + loopCycle;
  8161. player.anInt1548 = stream.method435() + loopCycle;
  8162. player.anInt1549 = stream.method428();
  8163. player.method446();
  8164. }
  8165. if((i & 0x100) != 0)
  8166. {
  8167. player.anInt1520 = stream.method434();
  8168. int k = stream.readInt();
  8169. player.anInt1524 = k >> 16;
  8170. player.anInt1523 = loopCycle + (k & 0xffff);
  8171. player.anInt1521 = 0;
  8172. player.anInt1522 = 0;
  8173. if(player.anInt1523 > loopCycle)
  8174. player.anInt1521 = -1;
  8175. if(player.anInt1520 == 65535)
  8176. player.anInt1520 = -1;
  8177. }
  8178. if((i & 8) != 0)
  8179. {
  8180. int l = stream.method434();
  8181. if(l == 65535)
  8182. l = -1;
  8183. int i2 = stream.method427();
  8184. if(l == player.anim && l != -1)
  8185. {
  8186. int i3 = Animation.anims[l].anInt365;
  8187. if(i3 == 1)
  8188. {
  8189. player.anInt1527 = 0;
  8190. player.anInt1528 = 0;
  8191. player.anInt1529 = i2;
  8192. player.anInt1530 = 0;
  8193. }
  8194. if(i3 == 2)
  8195. player.anInt1530 = 0;
  8196. } else
  8197. if(l == -1 || player.anim == -1 || Animation.anims[l].anInt359 >= Animation.anims[player.anim].anInt359)
  8198. {
  8199. player.anim = l;
  8200. player.anInt1527 = 0;
  8201. player.anInt1528 = 0;
  8202. player.anInt1529 = i2;
  8203. player.anInt1530 = 0;
  8204. player.anInt1542 = player.smallXYIndex;
  8205. }
  8206. }
  8207. if((i & 4) != 0)
  8208. {
  8209. player.textSpoken = stream.readString();
  8210. if(player.textSpoken.charAt(0) == '~')
  8211. {
  8212. player.textSpoken = player.textSpoken.substring(1);
  8213. pushMessage(player.textSpoken, 2, player.name);
  8214. } else
  8215. if(player == myPlayer)
  8216. pushMessage(player.textSpoken, 2, player.name);
  8217. player.anInt1513 = 0;
  8218. player.anInt1531 = 0;
  8219. player.textCycle = 150;
  8220. }
  8221. if((i & 0x80) != 0)
  8222. {
  8223. int i1 = stream.method434();
  8224. int j2 = stream.readUnsignedByte();
  8225. int j3 = stream.method427();
  8226. int k3 = stream.currentOffset;
  8227. if(player.name != null && player.visible)
  8228. {
  8229. long l3 = TextClass.longForName(player.name);
  8230. boolean flag = false;
  8231. if(j2 <= 1)
  8232. {
  8233. for(int i4 = 0; i4 < ignoreCount; i4++)
  8234. {
  8235. if(ignoreListAsLongs[i4] != l3)
  8236. continue;
  8237. flag = true;
  8238. break;
  8239. }
  8240.  
  8241. }
  8242. if(!flag && anInt1251 == 0)
  8243. try
  8244. {
  8245. aStream_834.currentOffset = 0;
  8246. stream.method442(j3, 0, aStream_834.buffer);
  8247. aStream_834.currentOffset = 0;
  8248. String s = TextInput.method525(j3, aStream_834);
  8249. s = Censor.doCensor(s);
  8250. player.textSpoken = s;
  8251. player.anInt1513 = i1 >> 8;
  8252. player.privelage = j2;
  8253.  
  8254. //entityMessage(player);
  8255.  
  8256. player.anInt1531 = i1 & 0xff;
  8257. player.textCycle = 150;
  8258. if(j2 == 2 || j2 == 3)
  8259. pushMessage(s, 1, "@cr2@" + player.name);
  8260. else
  8261. if(j2 == 1)
  8262. pushMessage(s, 1, "@cr1@" + player.name);
  8263. else
  8264. pushMessage(s, 2, player.name);
  8265. }
  8266. catch(Exception exception)
  8267. {
  8268. signlink.reporterror("cde2");
  8269. }
  8270. }
  8271. stream.currentOffset = k3 + j3;
  8272. }
  8273. if((i & 1) != 0)
  8274. {
  8275. player.interactingEntity = stream.method434();
  8276. if(player.interactingEntity == 65535)
  8277. player.interactingEntity = -1;
  8278. }
  8279. if((i & 0x10) != 0)
  8280. {
  8281. int j1 = stream.method427();
  8282. byte abyte0[] = new byte[j1];
  8283. Stream stream_1 = new Stream(abyte0);
  8284. stream.readBytes(j1, 0, abyte0);
  8285. aStreamArray895s[j] = stream_1;
  8286. player.updatePlayer(stream_1);
  8287. }
  8288. if((i & 2) != 0)
  8289. {
  8290. player.anInt1538 = stream.method436();
  8291. player.anInt1539 = stream.method434();
  8292. }
  8293. if((i & 0x20) != 0)
  8294. {
  8295. int k1 = stream.readUnsignedByte();
  8296. int k2 = stream.method426();
  8297. player.updateHitData(k2, k1, loopCycle);
  8298. player.loopCycleStatus = loopCycle + 300;
  8299. player.currentHealth = stream.method427();
  8300. player.maxHealth = stream.readUnsignedByte();
  8301. }
  8302. if((i & 0x200) != 0)
  8303. {
  8304. int l1 = stream.readUnsignedByte();
  8305. int l2 = stream.method428();
  8306. player.updateHitData(l2, l1, loopCycle);
  8307. player.loopCycleStatus = loopCycle + 300;
  8308. player.currentHealth = stream.readUnsignedByte();
  8309. player.maxHealth = stream.method427();
  8310. }
  8311. }
  8312.  
  8313. private void method108()
  8314. {
  8315. try
  8316. {
  8317. int j = myPlayer.x + anInt1278;
  8318. int k = myPlayer.y + anInt1131;
  8319. if(anInt1014 - j < -500 || anInt1014 - j > 500 || anInt1015 - k < -500 || anInt1015 - k > 500)
  8320. {
  8321. anInt1014 = j;
  8322. anInt1015 = k;
  8323. }
  8324. if(anInt1014 != j)
  8325. anInt1014 += (j - anInt1014) / 16;
  8326. if(anInt1015 != k)
  8327. anInt1015 += (k - anInt1015) / 16;
  8328. if(super.keyArray[1] == 1)
  8329. anInt1186 += (-24 - anInt1186) / 2;
  8330. else
  8331. if(super.keyArray[2] == 1)
  8332. anInt1186 += (24 - anInt1186) / 2;
  8333. else
  8334. anInt1186 /= 2;
  8335. if(super.keyArray[3] == 1)
  8336. anInt1187 += (12 - anInt1187) / 2;
  8337. else
  8338. if(super.keyArray[4] == 1)
  8339. anInt1187 += (-12 - anInt1187) / 2;
  8340. else
  8341. anInt1187 /= 2;
  8342. minimapInt1 = minimapInt1 + anInt1186 / 2 & 0x7ff;
  8343. anInt1184 += anInt1187 / 2;
  8344. if(anInt1184 < 128)
  8345. anInt1184 = 128;
  8346. if(anInt1184 > 383)
  8347. anInt1184 = 383;
  8348. int l = anInt1014 >> 7;
  8349. int i1 = anInt1015 >> 7;
  8350. int j1 = method42(plane, anInt1015, anInt1014);
  8351. int k1 = 0;
  8352. if(l > 3 && i1 > 3 && l < 100 && i1 < 100)
  8353. {
  8354. for(int l1 = l - 4; l1 <= l + 4; l1++)
  8355. {
  8356. for(int k2 = i1 - 4; k2 <= i1 + 4; k2++)
  8357. {
  8358. int l2 = plane;
  8359. if(l2 < 3 && (byteGroundArray[1][l1][k2] & 2) == 2)
  8360. l2++;
  8361. int i3 = j1 - intGroundArray[l2][l1][k2];
  8362. if(i3 > k1)
  8363. k1 = i3;
  8364. }
  8365.  
  8366. }
  8367.  
  8368. }
  8369. anInt1005++;
  8370. if(anInt1005 > 1512)
  8371. {
  8372. anInt1005 = 0;
  8373. stream.sendPacket(77);
  8374. stream.addByte(0);
  8375. int i2 = stream.currentOffset;
  8376. stream.addByte((int)(Math.random() * 256D));
  8377. stream.addByte(101);
  8378. stream.addByte(233);
  8379. stream.addShort(45092);
  8380. if((int)(Math.random() * 2D) == 0)
  8381. stream.addShort(35784);
  8382. stream.addByte((int)(Math.random() * 256D));
  8383. stream.addByte(64);
  8384. stream.addByte(38);
  8385. stream.addShort((int)(Math.random() * 65536D));
  8386. stream.addShort((int)(Math.random() * 65536D));
  8387. stream.writeBytes(stream.currentOffset - i2);
  8388. }
  8389. int j2 = k1 * 192;
  8390. if(j2 > 0x17f00)
  8391. j2 = 0x17f00;
  8392. if(j2 < 32768)
  8393. j2 = 32768;
  8394. if(j2 > anInt984)
  8395. {
  8396. anInt984 += (j2 - anInt984) / 24;
  8397. return;
  8398. }
  8399. if(j2 < anInt984)
  8400. {
  8401. anInt984 += (j2 - anInt984) / 80;
  8402. }
  8403. }
  8404. catch(Exception _ex)
  8405. {
  8406. signlink.reporterror("glfc_ex " + myPlayer.x + "," + myPlayer.y + "," + anInt1014 + "," + anInt1015 + "," + anInt1069 + "," + anInt1070 + "," + baseX + "," + baseY);
  8407. throw new RuntimeException("eek");
  8408. }
  8409. }
  8410.  
  8411. public void processDrawing()
  8412. {
  8413. if(rsAlreadyLoaded || loadingError || genericLoadingError)
  8414. {
  8415. showErrorScreen();
  8416. return;
  8417. }
  8418. anInt1061++;
  8419. if(!loggedIn)
  8420. drawLoginScreen(false);
  8421. else
  8422. drawGameScreen();
  8423. anInt1213 = 0;
  8424. }
  8425.  
  8426. private boolean isFriendOrSelf(String s)
  8427. {
  8428. if(s == null)
  8429. return false;
  8430. for(int i = 0; i < friendsCount; i++)
  8431. if(s.equalsIgnoreCase(friendsList[i]))
  8432. return true;
  8433. return s.equalsIgnoreCase(myPlayer.name);
  8434. }
  8435.  
  8436. private static String combatDiffColor(int i, int j)
  8437. {
  8438. int k = i - j;
  8439. if(k < -9)
  8440. return "@red@";
  8441. if(k < -6)
  8442. return "@or3@";
  8443. if(k < -3)
  8444. return "@or2@";
  8445. if(k < 0)
  8446. return "@or1@";
  8447. if(k > 9)
  8448. return "@gre@";
  8449. if(k > 6)
  8450. return "@gr3@";
  8451. if(k > 3)
  8452. return "@gr2@";
  8453. if(k > 0)
  8454. return "@gr1@";
  8455. else
  8456. return "@yel@";
  8457. }
  8458.  
  8459. private void setWaveVolume(int i)
  8460. {
  8461. signlink.wavevol = i;
  8462. }
  8463.  
  8464. private void draw3dScreen()
  8465. {
  8466. drawSplitPrivateChat();
  8467. if(crossType == 1)
  8468. {
  8469. crosses[crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  8470. anInt1142++;
  8471. if(anInt1142 > 67)
  8472. {
  8473. anInt1142 = 0;
  8474. stream.sendPacket(78);
  8475. }
  8476. }
  8477. if(crossType == 2)
  8478. crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  8479. if(anInt1018 != -1)
  8480. {
  8481. method119(anInt945, anInt1018);
  8482. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 0);
  8483. }
  8484. if(openInterfaceID != -1)
  8485. {
  8486. method119(anInt945, openInterfaceID);
  8487. drawInterface(0, 0, RSInterface.interfaceCache[openInterfaceID], 0);
  8488. }
  8489. method70();
  8490. if(!menuOpen)
  8491. {
  8492. processRightClick();
  8493. drawTooltip();
  8494. } else
  8495. if(menuScreenArea == 0)
  8496. drawMenu();
  8497. if(anInt1055 == 1)
  8498. headIcons[1].drawSprite(472, 296);
  8499. if(fpsOn)
  8500. {
  8501. char c = '\u01FB';
  8502. int k = 20;
  8503. int i1 = 0xffff00;
  8504. if(super.fps < 15)
  8505. i1 = 0xff0000;
  8506. aTextDrawingArea_1271.method380("Fps:" + super.fps, c, i1, k);
  8507. k += 15;
  8508. Runtime runtime = Runtime.getRuntime();
  8509. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  8510. i1 = 0xffff00;
  8511. if(j1 > 0x2000000 && lowMem)
  8512. i1 = 0xff0000;
  8513. aTextDrawingArea_1271.method380("Mem:" + j1 + "k", c, 0xffff00, k);
  8514. k += 15;
  8515. }
  8516. if(anInt1104 != 0)
  8517. {
  8518. int j = anInt1104 / 50;
  8519. int l = j / 60;
  8520. j %= 60;
  8521. if(j < 10)
  8522. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":0" + j, 329, 4);
  8523. else
  8524. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":" + j, 329, 4);
  8525. anInt849++;
  8526. if(anInt849 > 75)
  8527. {
  8528. anInt849 = 0;
  8529. stream.sendPacket(148);
  8530. }
  8531. }
  8532. }
  8533.  
  8534. private void addIgnore(long l)
  8535. {
  8536. try
  8537. {
  8538. if(l == 0L)
  8539. return;
  8540. if(ignoreCount >= 100)
  8541. {
  8542. pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
  8543. return;
  8544. }
  8545. String s = TextClass.fixName(TextClass.nameForLong(l));
  8546. for(int j = 0; j < ignoreCount; j++)
  8547. if(ignoreListAsLongs[j] == l)
  8548. {
  8549. pushMessage(s + " is already on your ignore list", 0, "");
  8550. return;
  8551. }
  8552. for(int k = 0; k < friendsCount; k++)
  8553. if(friendsListAsLongs[k] == l)
  8554. {
  8555. pushMessage("Please remove " + s + " from your friend list first", 0, "");
  8556. return;
  8557. }
  8558.  
  8559. ignoreListAsLongs[ignoreCount++] = l;
  8560. needDrawTabArea = true;
  8561. stream.sendPacket(133);
  8562. stream.addLong(l);
  8563. return;
  8564. }
  8565. catch(RuntimeException runtimeexception)
  8566. {
  8567. signlink.reporterror("45688, " + l + ", " + 4 + ", " + runtimeexception.toString());
  8568. }
  8569. throw new RuntimeException();
  8570. }
  8571.  
  8572. private void method114()
  8573. {
  8574. for(int i = -1; i < playerCount; i++)
  8575. {
  8576. int j;
  8577. if(i == -1)
  8578. j = myPlayerIndex;
  8579. else
  8580. j = playerIndices[i];
  8581. Player player = playerArray[j];
  8582. if(player != null)
  8583. method96(player);
  8584. }
  8585.  
  8586. }
  8587.  
  8588. private void method115()
  8589. {
  8590. if(loadingStage == 2)
  8591. {
  8592. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  8593. {
  8594. if(class30_sub1.anInt1294 > 0)
  8595. class30_sub1.anInt1294--;
  8596. if(class30_sub1.anInt1294 == 0)
  8597. {
  8598. if(class30_sub1.anInt1299 < 0 || ObjectManager.method178(class30_sub1.anInt1299, class30_sub1.anInt1301))
  8599. {
  8600. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1300, class30_sub1.anInt1301, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1299);
  8601. class30_sub1.unlink();
  8602. }
  8603. } else
  8604. {
  8605. if(class30_sub1.anInt1302 > 0)
  8606. class30_sub1.anInt1302--;
  8607. 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)))
  8608. {
  8609. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1292, class30_sub1.anInt1293, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1291);
  8610. class30_sub1.anInt1302 = -1;
  8611. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1299 == -1)
  8612. class30_sub1.unlink();
  8613. else
  8614. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1292 == class30_sub1.anInt1300 && class30_sub1.anInt1293 == class30_sub1.anInt1301)
  8615. class30_sub1.unlink();
  8616. }
  8617. }
  8618. }
  8619.  
  8620. }
  8621. }
  8622.  
  8623. private void determineMenuSize()
  8624. {
  8625. int i = chatTextDrawingArea.getTextWidth("Choose Option");
  8626. for(int j = 0; j < menuActionRow; j++)
  8627. {
  8628. int k = chatTextDrawingArea.getTextWidth(menuActionName[j]);
  8629. if(k > i)
  8630. i = k;
  8631. }
  8632.  
  8633. i += 8;
  8634. int l = 15 * menuActionRow + 21;
  8635. if(super.saveClickX > 4 && super.saveClickY > 4 && super.saveClickX < 516 && super.saveClickY < 338)
  8636. {
  8637. int i1 = super.saveClickX - 4 - i / 2;
  8638. if(i1 + i > 512)
  8639. i1 = 512 - i;
  8640. if(i1 < 0)
  8641. i1 = 0;
  8642. int l1 = super.saveClickY - 4;
  8643. if(l1 + l > 334)
  8644. l1 = 334 - l;
  8645. if(l1 < 0)
  8646. l1 = 0;
  8647. menuOpen = true;
  8648. menuScreenArea = 0;
  8649. menuOffsetX = i1;
  8650. menuOffsetY = l1;
  8651. menuWidth = i;
  8652. anInt952 = 15 * menuActionRow + 22;
  8653. }
  8654. if(super.saveClickX > 553 && super.saveClickY > 205 && super.saveClickX < 743 && super.saveClickY < 466)
  8655. {
  8656. int j1 = super.saveClickX - 553 - i / 2;
  8657. if(j1 < 0)
  8658. j1 = 0;
  8659. else
  8660. if(j1 + i > 190)
  8661. j1 = 190 - i;
  8662. int i2 = super.saveClickY - 205;
  8663. if(i2 < 0)
  8664. i2 = 0;
  8665. else
  8666. if(i2 + l > 261)
  8667. i2 = 261 - l;
  8668. menuOpen = true;
  8669. menuScreenArea = 1;
  8670. menuOffsetX = j1;
  8671. menuOffsetY = i2;
  8672. menuWidth = i;
  8673. anInt952 = 15 * menuActionRow + 22;
  8674. }
  8675. if(super.saveClickX > 17 && super.saveClickY > 357 && super.saveClickX < 496 && super.saveClickY < 453)
  8676. {
  8677. int k1 = super.saveClickX - 17 - i / 2;
  8678. if(k1 < 0)
  8679. k1 = 0;
  8680. else
  8681. if(k1 + i > 479)
  8682. k1 = 479 - i;
  8683. int j2 = super.saveClickY - 357;
  8684. if(j2 < 0)
  8685. j2 = 0;
  8686. else
  8687. if(j2 + l > 96)
  8688. j2 = 96 - l;
  8689. menuOpen = true;
  8690. menuScreenArea = 2;
  8691. menuOffsetX = k1;
  8692. menuOffsetY = j2;
  8693. menuWidth = i;
  8694. anInt952 = 15 * menuActionRow + 22;
  8695. }
  8696. }
  8697.  
  8698. private void updateThisPlayerMovement(Stream stream)
  8699. {
  8700. stream.initBitAccess();
  8701. int j = stream.readBits(1);
  8702. if(j == 0)
  8703. return;
  8704. int k = stream.readBits(2);
  8705. if(k == 0)
  8706. {
  8707. anIntArray894[anInt893++] = myPlayerIndex;
  8708. return;
  8709. }
  8710. if(k == 1)
  8711. {
  8712. int l = stream.readBits(3);
  8713. myPlayer.moveInDir(false, l);
  8714. int k1 = stream.readBits(1);
  8715. if(k1 == 1)
  8716. anIntArray894[anInt893++] = myPlayerIndex;
  8717. return;
  8718. }
  8719. if(k == 2)
  8720. {
  8721. int i1 = stream.readBits(3);
  8722. myPlayer.moveInDir(true, i1);
  8723. int l1 = stream.readBits(3);
  8724. myPlayer.moveInDir(true, l1);
  8725. int j2 = stream.readBits(1);
  8726. if(j2 == 1)
  8727. anIntArray894[anInt893++] = myPlayerIndex;
  8728. return;
  8729. }
  8730. if(k == 3)
  8731. {
  8732. plane = stream.readBits(2);
  8733. int j1 = stream.readBits(1);
  8734. int i2 = stream.readBits(1);
  8735. if(i2 == 1)
  8736. anIntArray894[anInt893++] = myPlayerIndex;
  8737. int k2 = stream.readBits(7);
  8738. int l2 = stream.readBits(7);
  8739. myPlayer.setPos(l2, k2, j1 == 1);
  8740. }
  8741. }
  8742.  
  8743. private void nullLoader()
  8744. {
  8745. aBoolean831 = false;
  8746. while(drawingFlames)
  8747. {
  8748. aBoolean831 = false;
  8749. try
  8750. {
  8751. Thread.sleep(50L);
  8752. }
  8753. catch(Exception _ex) { }
  8754. }
  8755. aBackground_966 = null;
  8756. aBackground_967 = null;
  8757. aBackgroundArray1152s = null;
  8758. anIntArray850 = null;
  8759. anIntArray851 = null;
  8760. anIntArray852 = null;
  8761. anIntArray853 = null;
  8762. anIntArray1190 = null;
  8763. anIntArray1191 = null;
  8764. anIntArray828 = null;
  8765. anIntArray829 = null;
  8766. aClass30_Sub2_Sub1_Sub1_1201 = null;
  8767. aClass30_Sub2_Sub1_Sub1_1202 = null;
  8768. }
  8769.  
  8770. private boolean method119(int i, int j)
  8771. {
  8772. boolean flag1 = false;
  8773. RSInterface class9 = RSInterface.interfaceCache[j];
  8774. for(int k = 0; k < class9.children.length; k++)
  8775. {
  8776. if(class9.children[k] == -1)
  8777. break;
  8778. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
  8779. if(class9_1.type == 1)
  8780. flag1 |= method119(i, class9_1.id);
  8781. if(class9_1.type == 6 && (class9_1.anInt257 != -1 || class9_1.anInt258 != -1))
  8782. {
  8783. boolean flag2 = interfaceIsSelected(class9_1);
  8784. int l;
  8785. if(flag2)
  8786. l = class9_1.anInt258;
  8787. else
  8788. l = class9_1.anInt257;
  8789. if(l != -1)
  8790. {
  8791. Animation animation = Animation.anims[l];
  8792. for(class9_1.anInt208 += i; class9_1.anInt208 > animation.method258(class9_1.anInt246);)
  8793. {
  8794. class9_1.anInt208 -= animation.method258(class9_1.anInt246) + 1;
  8795. class9_1.anInt246++;
  8796. if(class9_1.anInt246 >= animation.anInt352)
  8797. {
  8798. class9_1.anInt246 -= animation.anInt356;
  8799. if(class9_1.anInt246 < 0 || class9_1.anInt246 >= animation.anInt352)
  8800. class9_1.anInt246 = 0;
  8801. }
  8802. flag1 = true;
  8803. }
  8804.  
  8805. }
  8806. }
  8807. }
  8808.  
  8809. return flag1;
  8810. }
  8811.  
  8812. private int method120()
  8813. {
  8814. int j = 3;
  8815. if(yCameraCurve < 310)
  8816. {
  8817. int k = xCameraPos >> 7;
  8818. int l = yCameraPos >> 7;
  8819. int i1 = myPlayer.x >> 7;
  8820. int j1 = myPlayer.y >> 7;
  8821. if((byteGroundArray[plane][k][l] & 4) != 0)
  8822. j = plane;
  8823. int k1;
  8824. if(i1 > k)
  8825. k1 = i1 - k;
  8826. else
  8827. k1 = k - i1;
  8828. int l1;
  8829. if(j1 > l)
  8830. l1 = j1 - l;
  8831. else
  8832. l1 = l - j1;
  8833. if(k1 > l1)
  8834. {
  8835. int i2 = (l1 * 0x10000) / k1;
  8836. int k2 = 32768;
  8837. while(k != i1)
  8838. {
  8839. if(k < i1)
  8840. k++;
  8841. else
  8842. if(k > i1)
  8843. k--;
  8844. if((byteGroundArray[plane][k][l] & 4) != 0)
  8845. j = plane;
  8846. k2 += i2;
  8847. if(k2 >= 0x10000)
  8848. {
  8849. k2 -= 0x10000;
  8850. if(l < j1)
  8851. l++;
  8852. else
  8853. if(l > j1)
  8854. l--;
  8855. if((byteGroundArray[plane][k][l] & 4) != 0)
  8856. j = plane;
  8857. }
  8858. }
  8859. } else
  8860. {
  8861. int j2 = (k1 * 0x10000) / l1;
  8862. int l2 = 32768;
  8863. while(l != j1)
  8864. {
  8865. if(l < j1)
  8866. l++;
  8867. else
  8868. if(l > j1)
  8869. l--;
  8870. if((byteGroundArray[plane][k][l] & 4) != 0)
  8871. j = plane;
  8872. l2 += j2;
  8873. if(l2 >= 0x10000)
  8874. {
  8875. l2 -= 0x10000;
  8876. if(k < i1)
  8877. k++;
  8878. else
  8879. if(k > i1)
  8880. k--;
  8881. if((byteGroundArray[plane][k][l] & 4) != 0)
  8882. j = plane;
  8883. }
  8884. }
  8885. }
  8886. }
  8887. if((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
  8888. j = plane;
  8889. return j;
  8890. }
  8891.  
  8892. private int method121()
  8893. {
  8894. int j = method42(plane, yCameraPos, xCameraPos);
  8895. if(j - zCameraPos < 800 && (byteGroundArray[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
  8896. return plane;
  8897. else
  8898. return 3;
  8899. }
  8900.  
  8901. private void delIgnore(long l)
  8902. {
  8903. try
  8904. {
  8905. if(l == 0L)
  8906. return;
  8907. for(int j = 0; j < ignoreCount; j++)
  8908. if(ignoreListAsLongs[j] == l)
  8909. {
  8910. ignoreCount--;
  8911. needDrawTabArea = true;
  8912. System.arraycopy(ignoreListAsLongs, j + 1, ignoreListAsLongs, j, ignoreCount - j);
  8913.  
  8914. stream.sendPacket(74);
  8915. stream.addLong(l);
  8916. return;
  8917. }
  8918.  
  8919. return;
  8920. }
  8921. catch(RuntimeException runtimeexception)
  8922. {
  8923. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  8924. }
  8925. throw new RuntimeException();
  8926. }
  8927.  
  8928. public String getParameter(String s)
  8929. {
  8930. if(signlink.mainapp != null)
  8931. return signlink.mainapp.getParameter(s);
  8932. else
  8933. return super.getParameter(s);
  8934. }
  8935.  
  8936. private void adjustVolume(boolean flag, int i)
  8937. {
  8938. signlink.midivol = i;
  8939. if(flag)
  8940. signlink.midi = "voladjust";
  8941. }
  8942.  
  8943. private int extractInterfaceValues(RSInterface class9, int j)
  8944. {
  8945. if(class9.valueIndexArray == null || j >= class9.valueIndexArray.length)
  8946. return -2;
  8947. try
  8948. {
  8949. int ai[] = class9.valueIndexArray[j];
  8950. int k = 0;
  8951. int l = 0;
  8952. int i1 = 0;
  8953. do
  8954. {
  8955. int j1 = ai[l++];
  8956. int k1 = 0;
  8957. byte byte0 = 0;
  8958. if(j1 == 0)
  8959. return k;
  8960. if(j1 == 1)
  8961. k1 = currentStats[ai[l++]];
  8962. if(j1 == 2)
  8963. k1 = maxStats[ai[l++]];
  8964. if(j1 == 3)
  8965. k1 = currentExp[ai[l++]];
  8966. if(j1 == 4)
  8967. {
  8968. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  8969. int k2 = ai[l++];
  8970. if(k2 >= 0 && k2 < ItemDef.totalItems && (!ItemDef.forID(k2).membersObject || isMembers))
  8971. {
  8972. for(int j3 = 0; j3 < class9_1.inv.length; j3++)
  8973. if(class9_1.inv[j3] == k2 + 1)
  8974. k1 += class9_1.invStackSizes[j3];
  8975.  
  8976. }
  8977. }
  8978. if(j1 == 5)
  8979. k1 = variousSettings[ai[l++]];
  8980. if(j1 == 6)
  8981. k1 = anIntArray1019[maxStats[ai[l++]] - 1];
  8982. if(j1 == 7)
  8983. k1 = (variousSettings[ai[l++]] * 100) / 46875;
  8984. if(j1 == 8)
  8985. k1 = myPlayer.combatLevel;
  8986. if(j1 == 9)
  8987. {
  8988. for(int l1 = 0; l1 < Skills.skillsCount; l1++)
  8989. if(Skills.skillEnabled[l1])
  8990. k1 += maxStats[l1];
  8991.  
  8992. }
  8993. if(j1 == 10)
  8994. {
  8995. RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
  8996. int l2 = ai[l++] + 1;
  8997. if(l2 >= 0 && l2 < ItemDef.totalItems && (!ItemDef.forID(l2).membersObject || isMembers))
  8998. {
  8999. for(int k3 = 0; k3 < class9_2.inv.length; k3++)
  9000. {
  9001. if(class9_2.inv[k3] != l2)
  9002. continue;
  9003. k1 = 0x3b9ac9ff;
  9004. break;
  9005. }
  9006.  
  9007. }
  9008. }
  9009. if(j1 == 11)
  9010. k1 = energy;
  9011. if(j1 == 12)
  9012. k1 = weight;
  9013. if(j1 == 13)
  9014. {
  9015. int i2 = variousSettings[ai[l++]];
  9016. int i3 = ai[l++];
  9017. k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  9018. }
  9019. if(j1 == 14)
  9020. {
  9021. int j2 = ai[l++];
  9022. VarBit varBit = VarBit.cache[j2];
  9023. int l3 = varBit.anInt648;
  9024. int i4 = varBit.anInt649;
  9025. int j4 = varBit.anInt650;
  9026. int k4 = anIntArray1232[j4 - i4];
  9027. k1 = variousSettings[l3] >> i4 & k4;
  9028. }
  9029. if(j1 == 15)
  9030. byte0 = 1;
  9031. if(j1 == 16)
  9032. byte0 = 2;
  9033. if(j1 == 17)
  9034. byte0 = 3;
  9035. if(j1 == 18)
  9036. k1 = (myPlayer.x >> 7) + baseX;
  9037. if(j1 == 19)
  9038. k1 = (myPlayer.y >> 7) + baseY;
  9039. if(j1 == 20)
  9040. k1 = ai[l++];
  9041. if(byte0 == 0)
  9042. {
  9043. if(i1 == 0)
  9044. k += k1;
  9045. if(i1 == 1)
  9046. k -= k1;
  9047. if(i1 == 2 && k1 != 0)
  9048. k /= k1;
  9049. if(i1 == 3)
  9050. k *= k1;
  9051. i1 = 0;
  9052. } else
  9053. {
  9054. i1 = byte0;
  9055. }
  9056. } while(true);
  9057. }
  9058. catch(Exception _ex)
  9059. {
  9060. return -1;
  9061. }
  9062. }
  9063.  
  9064. private void drawTooltip()
  9065. {
  9066. if(menuActionRow < 2 && itemSelected == 0 && spellSelected == 0)
  9067. return;
  9068. String s;
  9069. if(itemSelected == 1 && menuActionRow < 2)
  9070. s = "Use " + selectedItemName + " with...";
  9071. else
  9072. if(spellSelected == 1 && menuActionRow < 2)
  9073. s = spellTooltip + "...";
  9074. else
  9075. s = menuActionName[menuActionRow - 1];
  9076. if(menuActionRow > 2)
  9077. s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
  9078. chatTextDrawingArea.method390(4, 0xffffff, s, loopCycle / 1000, 15);
  9079. }
  9080.  
  9081. private void drawMinimap()
  9082. {
  9083. aRSImageProducer_1164.initDrawingArea();
  9084. if(anInt1021 == 2)
  9085. {
  9086. byte abyte0[] = mapBack.aByteArray1450;
  9087. int ai[] = DrawingArea.pixels;
  9088. int k2 = abyte0.length;
  9089. for(int i5 = 0; i5 < k2; i5++)
  9090. if(abyte0[i5] == 0)
  9091. ai[i5] = 0;
  9092.  
  9093. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, 0, 0, 33, 25);
  9094. aRSImageProducer_1165.initDrawingArea();
  9095. return;
  9096. }
  9097. int i = minimapInt1 + minimapInt2 & 0x7ff;
  9098. int j = 48 + myPlayer.x / 32;
  9099. int l2 = 464 - myPlayer.y / 32;
  9100. aClass30_Sub2_Sub1_Sub1_1263.method352(151, i, anIntArray1229, 256 + minimapInt3, anIntArray1052, l2, 5, 25, 146, j);
  9101. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, 0, 0, 33, 25);
  9102. for(int j5 = 0; j5 < anInt1071; j5++)
  9103. {
  9104. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  9105. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  9106. markMinimap(aClass30_Sub2_Sub1_Sub1Array1140[j5], k, i3);
  9107. }
  9108.  
  9109. for(int k5 = 0; k5 < 104; k5++)
  9110. {
  9111. for(int l5 = 0; l5 < 104; l5++)
  9112. {
  9113. NodeList class19 = groundArray[plane][k5][l5];
  9114. if(class19 != null)
  9115. {
  9116. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  9117. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  9118. markMinimap(mapDotItem, l, j3);
  9119. }
  9120. }
  9121.  
  9122. }
  9123.  
  9124. for(int i6 = 0; i6 < npcCount; i6++)
  9125. {
  9126. NPC npc = npcArray[npcIndices[i6]];
  9127. if(npc != null && npc.isVisible())
  9128. {
  9129. EntityDef entityDef = npc.desc;
  9130. if(entityDef.childrenIDs != null)
  9131. entityDef = entityDef.method161();
  9132. if(entityDef != null && entityDef.aBoolean87 && entityDef.aBoolean84)
  9133. {
  9134. int i1 = npc.x / 32 - myPlayer.x / 32;
  9135. int k3 = npc.y / 32 - myPlayer.y / 32;
  9136. markMinimap(mapDotNPC, i1, k3);
  9137. }
  9138. }
  9139. }
  9140.  
  9141. for(int j6 = 0; j6 < playerCount; j6++)
  9142. {
  9143. Player player = playerArray[playerIndices[j6]];
  9144. if(player != null && player.isVisible())
  9145. {
  9146. int j1 = player.x / 32 - myPlayer.x / 32;
  9147. int l3 = player.y / 32 - myPlayer.y / 32;
  9148. boolean flag1 = false;
  9149. long l6 = TextClass.longForName(player.name);
  9150. for(int k6 = 0; k6 < friendsCount; k6++)
  9151. {
  9152. if(l6 != friendsListAsLongs[k6] || friendsNodeIDs[k6] == 0)
  9153. continue;
  9154. flag1 = true;
  9155. break;
  9156. }
  9157.  
  9158. boolean flag2 = false;
  9159. if(myPlayer.team != 0 && player.team != 0 && myPlayer.team == player.team)
  9160. flag2 = true;
  9161. if(flag1)
  9162. markMinimap(mapDotFriend, j1, l3);
  9163. else
  9164. if(flag2)
  9165. markMinimap(mapDotTeam, j1, l3);
  9166. else
  9167. markMinimap(mapDotPlayer, j1, l3);
  9168. }
  9169. }
  9170.  
  9171. if(anInt855 != 0 && loopCycle % 20 < 10)
  9172. {
  9173. if(anInt855 == 1 && anInt1222 >= 0 && anInt1222 < npcArray.length)
  9174. {
  9175. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  9176. if(class30_sub2_sub4_sub1_sub1_1 != null)
  9177. {
  9178. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32 - myPlayer.x / 32;
  9179. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32 - myPlayer.y / 32;
  9180. method81(mapMarker, i4, k1);
  9181. }
  9182. }
  9183. if(anInt855 == 2)
  9184. {
  9185. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  9186. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  9187. method81(mapMarker, j4, l1);
  9188. }
  9189. if(anInt855 == 10 && anInt933 >= 0 && anInt933 < playerArray.length)
  9190. {
  9191. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  9192. if(class30_sub2_sub4_sub1_sub2_1 != null)
  9193. {
  9194. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32 - myPlayer.x / 32;
  9195. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32 - myPlayer.y / 32;
  9196. method81(mapMarker, k4, i2);
  9197. }
  9198. }
  9199. }
  9200. if(destX != 0)
  9201. {
  9202. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  9203. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  9204. markMinimap(mapFlag, j2, l4);
  9205. }
  9206. DrawingArea.method336(3, 78, 97, 0xffffff, 3);
  9207. aRSImageProducer_1165.initDrawingArea();
  9208. }
  9209.  
  9210. private void npcScreenPos(Entity entity, int i)
  9211. {
  9212. calcEntityScreenPos(entity.x, i, entity.y);
  9213.  
  9214. //aryan entity.entScreenX = spriteDrawX; entity.entScreenY = spriteDrawY;
  9215. }
  9216.  
  9217. private void calcEntityScreenPos(int i, int j, int l)
  9218. {
  9219. if(i < 128 || l < 128 || i > 13056 || l > 13056)
  9220. {
  9221. spriteDrawX = -1;
  9222. spriteDrawY = -1;
  9223. return;
  9224. }
  9225. int i1 = method42(plane, l, i) - j;
  9226. i -= xCameraPos;
  9227. i1 -= zCameraPos;
  9228. l -= yCameraPos;
  9229. int j1 = Model.modelIntArray1[yCameraCurve];
  9230. int k1 = Model.modelIntArray2[yCameraCurve];
  9231. int l1 = Model.modelIntArray1[xCameraCurve];
  9232. int i2 = Model.modelIntArray2[xCameraCurve];
  9233. int j2 = l * l1 + i * i2 >> 16;
  9234. l = l * i2 - i * l1 >> 16;
  9235. i = j2;
  9236. j2 = i1 * k1 - l * j1 >> 16;
  9237. l = i1 * j1 + l * k1 >> 16;
  9238. i1 = j2;
  9239. if(l >= 50)
  9240. {
  9241. spriteDrawX = Texture.textureInt1 + (i << 9) / l;
  9242. spriteDrawY = Texture.textureInt2 + (i1 << 9) / l;
  9243. } else
  9244. {
  9245. spriteDrawX = -1;
  9246. spriteDrawY = -1;
  9247. }
  9248. }
  9249.  
  9250. private void buildSplitPrivateChatMenu()
  9251. {
  9252. if(splitPrivateChat == 0)
  9253. return;
  9254. int i = 0;
  9255. if(anInt1104 != 0)
  9256. i = 1;
  9257. for(int j = 0; j < 100; j++)
  9258. if(chatMessages[j] != null)
  9259. {
  9260. int k = chatTypes[j];
  9261. String s = chatNames[j];
  9262. boolean flag1 = false;
  9263. if(s != null && s.startsWith("@cr1@"))
  9264. {
  9265. s = s.substring(5);
  9266. boolean flag2 = true;
  9267. }
  9268. if(s != null && s.startsWith("@cr2@"))
  9269. {
  9270. s = s.substring(5);
  9271. byte byte0 = 2;
  9272. }
  9273. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  9274. {
  9275. int l = 329 - i * 13;
  9276. if(super.mouseX > 4 && super.mouseY - 4 > l - 10 && super.mouseY - 4 <= l + 3)
  9277. {
  9278. int i1 = aTextDrawingArea_1271.getTextWidth("From: " + s + chatMessages[j]) + 25;
  9279. if(i1 > 450)
  9280. i1 = 450;
  9281. if(super.mouseX < 4 + i1)
  9282. {
  9283. if(myPrivilege >= 1)
  9284. {
  9285. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  9286. menuActionID[menuActionRow] = 2606;
  9287. menuActionRow++;
  9288. }
  9289. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  9290. menuActionID[menuActionRow] = 2042;
  9291. menuActionRow++;
  9292. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  9293. menuActionID[menuActionRow] = 2337;
  9294. menuActionRow++;
  9295. }
  9296. }
  9297. if(++i >= 5)
  9298. return;
  9299. }
  9300. if((k == 5 || k == 6) && privateChatMode < 2 && ++i >= 5)
  9301. return;
  9302. }
  9303.  
  9304. }
  9305.  
  9306. private void method130(int j, int k, int l, int i1, int j1, int k1,
  9307. int l1, int i2, int j2)
  9308. {
  9309. Class30_Sub1 class30_sub1 = null;
  9310. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  9311. {
  9312. if(class30_sub1_1.anInt1295 != l1 || class30_sub1_1.anInt1297 != i2 || class30_sub1_1.anInt1298 != j1 || class30_sub1_1.anInt1296 != i1)
  9313. continue;
  9314. class30_sub1 = class30_sub1_1;
  9315. break;
  9316. }
  9317.  
  9318. if(class30_sub1 == null)
  9319. {
  9320. class30_sub1 = new Class30_Sub1();
  9321. class30_sub1.anInt1295 = l1;
  9322. class30_sub1.anInt1296 = i1;
  9323. class30_sub1.anInt1297 = i2;
  9324. class30_sub1.anInt1298 = j1;
  9325. method89(class30_sub1);
  9326. aClass19_1179.insertHead(class30_sub1);
  9327. }
  9328. class30_sub1.anInt1291 = k;
  9329. class30_sub1.anInt1293 = k1;
  9330. class30_sub1.anInt1292 = l;
  9331. class30_sub1.anInt1302 = j2;
  9332. class30_sub1.anInt1294 = j;
  9333. }
  9334.  
  9335. private boolean interfaceIsSelected(RSInterface class9)
  9336. {
  9337. if(class9.anIntArray245 == null)
  9338. return false;
  9339. for(int i = 0; i < class9.anIntArray245.length; i++)
  9340. {
  9341. int j = extractInterfaceValues(class9, i);
  9342. int k = class9.anIntArray212[i];
  9343. if(class9.anIntArray245[i] == 2)
  9344. {
  9345. if(j >= k)
  9346. return false;
  9347. } else
  9348. if(class9.anIntArray245[i] == 3)
  9349. {
  9350. if(j <= k)
  9351. return false;
  9352. } else
  9353. if(class9.anIntArray245[i] == 4)
  9354. {
  9355. if(j == k)
  9356. return false;
  9357. } else
  9358. if(j != k)
  9359. return false;
  9360. }
  9361.  
  9362. return true;
  9363. }
  9364.  
  9365. private DataInputStream openJagGrabInputStream(String s)
  9366. throws IOException
  9367. {
  9368. // if(!aBoolean872)
  9369. // if(signlink.mainapp != null)
  9370. // return signlink.openurl(s);
  9371. // else
  9372. // return new DataInputStream((new URL(getCodeBase(), s)).openStream());
  9373. if(aSocket832 != null)
  9374. {
  9375. try
  9376. {
  9377. aSocket832.close();
  9378. }
  9379. catch(Exception _ex) { }
  9380. aSocket832 = null;
  9381. }
  9382. aSocket832 = openSocket(43595);
  9383. aSocket832.setSoTimeout(10000);
  9384. java.io.InputStream inputstream = aSocket832.getInputStream();
  9385. OutputStream outputstream = aSocket832.getOutputStream();
  9386. outputstream.write(("JAGGRAB /" + s + "\n\n").getBytes());
  9387. return new DataInputStream(inputstream);
  9388. }
  9389.  
  9390. private void doFlamesDrawing()
  9391. {
  9392. char c = '\u0100';
  9393. if(anInt1040 > 0)
  9394. {
  9395. for(int i = 0; i < 256; i++)
  9396. if(anInt1040 > 768)
  9397. anIntArray850[i] = method83(anIntArray851[i], anIntArray852[i], 1024 - anInt1040);
  9398. else
  9399. if(anInt1040 > 256)
  9400. anIntArray850[i] = anIntArray852[i];
  9401. else
  9402. anIntArray850[i] = method83(anIntArray852[i], anIntArray851[i], 256 - anInt1040);
  9403.  
  9404. } else
  9405. if(anInt1041 > 0)
  9406. {
  9407. for(int j = 0; j < 256; j++)
  9408. if(anInt1041 > 768)
  9409. anIntArray850[j] = method83(anIntArray851[j], anIntArray853[j], 1024 - anInt1041);
  9410. else
  9411. if(anInt1041 > 256)
  9412. anIntArray850[j] = anIntArray853[j];
  9413. else
  9414. anIntArray850[j] = method83(anIntArray853[j], anIntArray851[j], 256 - anInt1041);
  9415.  
  9416. } else
  9417. {
  9418. System.arraycopy(anIntArray851, 0, anIntArray850, 0, 256);
  9419.  
  9420. }
  9421. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, aRSImageProducer_1110.anIntArray315, 0, 33920);
  9422.  
  9423. int i1 = 0;
  9424. int j1 = 1152;
  9425. for(int k1 = 1; k1 < c - 1; k1++)
  9426. {
  9427. int l1 = (anIntArray969[k1] * (c - k1)) / c;
  9428. int j2 = 22 + l1;
  9429. if(j2 < 0)
  9430. j2 = 0;
  9431. i1 += j2;
  9432. for(int l2 = j2; l2 < 128; l2++)
  9433. {
  9434. int j3 = anIntArray828[i1++];
  9435. if(j3 != 0)
  9436. {
  9437. int l3 = j3;
  9438. int j4 = 256 - j3;
  9439. j3 = anIntArray850[j3];
  9440. int l4 = aRSImageProducer_1110.anIntArray315[j1];
  9441. aRSImageProducer_1110.anIntArray315[j1++] = ((j3 & 0xff00ff) * l3 + (l4 & 0xff00ff) * j4 & 0xff00ff00) + ((j3 & 0xff00) * l3 + (l4 & 0xff00) * j4 & 0xff0000) >> 8;
  9442. } else
  9443. {
  9444. j1++;
  9445. }
  9446. }
  9447.  
  9448. j1 += j2;
  9449. }
  9450.  
  9451. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  9452. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, aRSImageProducer_1111.anIntArray315, 0, 33920);
  9453.  
  9454. i1 = 0;
  9455. j1 = 1176;
  9456. for(int k2 = 1; k2 < c - 1; k2++)
  9457. {
  9458. int i3 = (anIntArray969[k2] * (c - k2)) / c;
  9459. int k3 = 103 - i3;
  9460. j1 += i3;
  9461. for(int i4 = 0; i4 < k3; i4++)
  9462. {
  9463. int k4 = anIntArray828[i1++];
  9464. if(k4 != 0)
  9465. {
  9466. int i5 = k4;
  9467. int j5 = 256 - k4;
  9468. k4 = anIntArray850[k4];
  9469. int k5 = aRSImageProducer_1111.anIntArray315[j1];
  9470. aRSImageProducer_1111.anIntArray315[j1++] = ((k4 & 0xff00ff) * i5 + (k5 & 0xff00ff) * j5 & 0xff00ff00) + ((k4 & 0xff00) * i5 + (k5 & 0xff00) * j5 & 0xff0000) >> 8;
  9471. } else
  9472. {
  9473. j1++;
  9474. }
  9475. }
  9476.  
  9477. i1 += 128 - k3;
  9478. j1 += 128 - k3 - i3;
  9479. }
  9480.  
  9481. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  9482. }
  9483.  
  9484. private void updatePlayerMovement(Stream stream)
  9485. {
  9486. int j = stream.readBits(8);
  9487. if(j < playerCount)
  9488. {
  9489. for(int k = j; k < playerCount; k++)
  9490. anIntArray840[anInt839++] = playerIndices[k];
  9491.  
  9492. }
  9493. if(j > playerCount)
  9494. {
  9495. signlink.reporterror(myUsername + " Too many players");
  9496. throw new RuntimeException("eek");
  9497. }
  9498. playerCount = 0;
  9499. for(int l = 0; l < j; l++)
  9500. {
  9501. int i1 = playerIndices[l];
  9502. Player player = playerArray[i1];
  9503. int j1 = stream.readBits(1);
  9504. if(j1 == 0)
  9505. {
  9506. playerIndices[playerCount++] = i1;
  9507. player.anInt1537 = loopCycle;
  9508. } else
  9509. {
  9510. int k1 = stream.readBits(2);
  9511. if(k1 == 0)
  9512. {
  9513. playerIndices[playerCount++] = i1;
  9514. player.anInt1537 = loopCycle;
  9515. anIntArray894[anInt893++] = i1;
  9516. } else
  9517. if(k1 == 1)
  9518. {
  9519. playerIndices[playerCount++] = i1;
  9520. player.anInt1537 = loopCycle;
  9521. int l1 = stream.readBits(3);
  9522. player.moveInDir(false, l1);
  9523. int j2 = stream.readBits(1);
  9524. if(j2 == 1)
  9525. anIntArray894[anInt893++] = i1;
  9526. } else
  9527. if(k1 == 2)
  9528. {
  9529. playerIndices[playerCount++] = i1;
  9530. player.anInt1537 = loopCycle;
  9531. int i2 = stream.readBits(3);
  9532. player.moveInDir(true, i2);
  9533. int k2 = stream.readBits(3);
  9534. player.moveInDir(true, k2);
  9535. int l2 = stream.readBits(1);
  9536. if(l2 == 1)
  9537. anIntArray894[anInt893++] = i1;
  9538. } else
  9539. if(k1 == 3)
  9540. anIntArray840[anInt839++] = i1;
  9541. }
  9542. }
  9543. }
  9544.  
  9545. private void drawLoginScreen(boolean flag)
  9546. {
  9547. resetImageProducers();
  9548. aRSImageProducer_1109.initDrawingArea();
  9549. aBackground_966.method361(0, 0);
  9550. char c = '\u0168';
  9551. char c1 = '\310';
  9552. if(loginScreenState == 0)
  9553. {
  9554. int i = c1 / 2 + 80;
  9555. aTextDrawingArea_1270.method382(0x75a9a9, c / 2, onDemandFetcher.statusString, i, true);
  9556. i = c1 / 2 - 20;
  9557. chatTextDrawingArea.method382(0xffff00, c / 2, "Welcome to RuneScape", i, true);
  9558. i += 30;
  9559. int l = c / 2 - 80;
  9560. int k1 = c1 / 2 + 20;
  9561. aBackground_967.method361(l - 73, k1 - 20);
  9562. chatTextDrawingArea.method382(0xffffff, l, "New User", k1 + 5, true);
  9563. l = c / 2 + 80;
  9564. aBackground_967.method361(l - 73, k1 - 20);
  9565. chatTextDrawingArea.method382(0xffffff, l, "Existing User", k1 + 5, true);
  9566. }
  9567. if(loginScreenState == 2)
  9568. {
  9569. int j = c1 / 2 - 40;
  9570. if(loginMessage1.length() > 0)
  9571. {
  9572. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage1, j - 15, true);
  9573. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2, j, true);
  9574. j += 30;
  9575. } else
  9576. {
  9577. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2, j - 7, true);
  9578. j += 30;
  9579. }
  9580. chatTextDrawingArea.method389(true, c / 2 - 90, 0xffffff, "Username: " + myUsername + ((loginScreenCursorPos == 0) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  9581. j += 15;
  9582. chatTextDrawingArea.method389(true, c / 2 - 88, 0xffffff, "Password: " + TextClass.passwordAsterisks(myPassword) + ((loginScreenCursorPos == 1) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  9583. j += 15;
  9584. if(!flag)
  9585. {
  9586. int i1 = c / 2 - 80;
  9587. int l1 = c1 / 2 + 50;
  9588. aBackground_967.method361(i1 - 73, l1 - 20);
  9589. chatTextDrawingArea.method382(0xffffff, i1, "Login", l1 + 5, true);
  9590. i1 = c / 2 + 80;
  9591. aBackground_967.method361(i1 - 73, l1 - 20);
  9592. chatTextDrawingArea.method382(0xffffff, i1, "Cancel", l1 + 5, true);
  9593. }
  9594. }
  9595. if(loginScreenState == 3)
  9596. {
  9597. chatTextDrawingArea.method382(0xffff00, c / 2, "Create a free account", c1 / 2 - 60, true);
  9598. int k = c1 / 2 - 35;
  9599. chatTextDrawingArea.method382(0xffffff, c / 2, "To create a new account you need to", k, true);
  9600. k += 15;
  9601. chatTextDrawingArea.method382(0xffffff, c / 2, "go back to the main RuneScape webpage", k, true);
  9602. k += 15;
  9603. chatTextDrawingArea.method382(0xffffff, c / 2, "and choose the red 'create account'", k, true);
  9604. k += 15;
  9605. chatTextDrawingArea.method382(0xffffff, c / 2, "button at the top right of that page.", k, true);
  9606. k += 15;
  9607. int j1 = c / 2;
  9608. int i2 = c1 / 2 + 50;
  9609. aBackground_967.method361(j1 - 73, i2 - 20);
  9610. chatTextDrawingArea.method382(0xffffff, j1, "Cancel", i2 + 5, true);
  9611. }
  9612. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  9613. if(welcomeScreenRaised)
  9614. {
  9615. welcomeScreenRaised = false;
  9616. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  9617. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  9618. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  9619. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  9620. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  9621. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  9622. }
  9623. }
  9624.  
  9625. private void drawFlames()
  9626. {
  9627. drawingFlames = true;
  9628. try
  9629. {
  9630. long l = System.currentTimeMillis();
  9631. int i = 0;
  9632. int j = 20;
  9633. while(aBoolean831)
  9634. {
  9635. anInt1208++;
  9636. calcFlamesPosition();
  9637. calcFlamesPosition();
  9638. doFlamesDrawing();
  9639. if(++i > 10)
  9640. {
  9641. long l1 = System.currentTimeMillis();
  9642. int k = (int)(l1 - l) / 10 - j;
  9643. j = 40 - k;
  9644. if(j < 5)
  9645. j = 5;
  9646. i = 0;
  9647. l = l1;
  9648. }
  9649. try
  9650. {
  9651. Thread.sleep(j);
  9652. }
  9653. catch(Exception _ex) { }
  9654. }
  9655. }
  9656. catch(Exception _ex) { }
  9657. drawingFlames = false;
  9658. }
  9659.  
  9660. public void raiseWelcomeScreen()
  9661. {
  9662. welcomeScreenRaised = true;
  9663. }
  9664.  
  9665. private void method137(Stream stream, int j)
  9666. {
  9667. if(j == 84)
  9668. {
  9669. int k = stream.readUnsignedByte();
  9670. int j3 = anInt1268 + (k >> 4 & 7);
  9671. int i6 = anInt1269 + (k & 7);
  9672. int l8 = stream.readUnsignedWord();
  9673. int k11 = stream.readUnsignedWord();
  9674. int l13 = stream.readUnsignedWord();
  9675. if(j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104)
  9676. {
  9677. NodeList class19_1 = groundArray[plane][j3][i6];
  9678. if(class19_1 != null)
  9679. {
  9680. 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())
  9681. {
  9682. if(class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff) || class30_sub2_sub4_sub2_3.anInt1559 != k11)
  9683. continue;
  9684. class30_sub2_sub4_sub2_3.anInt1559 = l13;
  9685. break;
  9686. }
  9687.  
  9688. spawnGroundItem(j3, i6);
  9689. }
  9690. }
  9691. return;
  9692. }
  9693. if(j == 105)
  9694. {
  9695. int l = stream.readUnsignedByte();
  9696. int k3 = anInt1268 + (l >> 4 & 7);
  9697. int j6 = anInt1269 + (l & 7);
  9698. int i9 = stream.readUnsignedWord();
  9699. int l11 = stream.readUnsignedByte();
  9700. int i14 = l11 >> 4 & 0xf;
  9701. int i16 = l11 & 7;
  9702. 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)
  9703. {
  9704. anIntArray1207[anInt1062] = i9;
  9705. anIntArray1241[anInt1062] = i16;
  9706. anIntArray1250[anInt1062] = Sounds.anIntArray326[i9];
  9707. anInt1062++;
  9708. }
  9709. }
  9710. if(j == 215)
  9711. {
  9712. int i1 = stream.method435();
  9713. int l3 = stream.method428();
  9714. int k6 = anInt1268 + (l3 >> 4 & 7);
  9715. int j9 = anInt1269 + (l3 & 7);
  9716. int i12 = stream.method435();
  9717. int j14 = stream.readUnsignedWord();
  9718. if(k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104 && i12 != unknownInt10)
  9719. {
  9720. Item class30_sub2_sub4_sub2_2 = new Item();
  9721. class30_sub2_sub4_sub2_2.ID = i1;
  9722. class30_sub2_sub4_sub2_2.anInt1559 = j14;
  9723. if(groundArray[plane][k6][j9] == null)
  9724. groundArray[plane][k6][j9] = new NodeList();
  9725. groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
  9726. spawnGroundItem(k6, j9);
  9727. }
  9728. return;
  9729. }
  9730. if(j == 156)
  9731. {
  9732. int j1 = stream.method426();
  9733. int i4 = anInt1268 + (j1 >> 4 & 7);
  9734. int l6 = anInt1269 + (j1 & 7);
  9735. int k9 = stream.readUnsignedWord();
  9736. if(i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104)
  9737. {
  9738. NodeList class19 = groundArray[plane][i4][l6];
  9739. if(class19 != null)
  9740. {
  9741. for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  9742. {
  9743. if(item.ID != (k9 & 0x7fff))
  9744. continue;
  9745. item.unlink();
  9746. break;
  9747. }
  9748.  
  9749. if(class19.reverseGetFirst() == null)
  9750. groundArray[plane][i4][l6] = null;
  9751. spawnGroundItem(i4, l6);
  9752. }
  9753. }
  9754. return;
  9755. }
  9756. if(j == 160)
  9757. {
  9758. int k1 = stream.method428();
  9759. int j4 = anInt1268 + (k1 >> 4 & 7);
  9760. int i7 = anInt1269 + (k1 & 7);
  9761. int l9 = stream.method428();
  9762. int j12 = l9 >> 2;
  9763. int k14 = l9 & 3;
  9764. int j16 = anIntArray1177[j12];
  9765. int j17 = stream.method435();
  9766. if(j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103)
  9767. {
  9768. int j18 = intGroundArray[plane][j4][i7];
  9769. int i19 = intGroundArray[plane][j4 + 1][i7];
  9770. int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
  9771. int k20 = intGroundArray[plane][j4][i7 + 1];
  9772. if(j16 == 0)
  9773. {
  9774. Object1 class10 = worldController.method296(plane, j4, i7);
  9775. if(class10 != null)
  9776. {
  9777. int k21 = class10.uid >> 14 & 0x7fff;
  9778. if(j12 == 2)
  9779. {
  9780. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, 4 + k14, 2, i19, l19, j18, k20, j17, false);
  9781. class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(k21, k14 + 1 & 3, 2, i19, l19, j18, k20, j17, false);
  9782. } else
  9783. {
  9784. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, k14, j12, i19, l19, j18, k20, j17, false);
  9785. }
  9786. }
  9787. }
  9788. if(j16 == 1)
  9789. {
  9790. Object2 class26 = worldController.method297(j4, i7, plane);
  9791. if(class26 != null)
  9792. class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(class26.uid >> 14 & 0x7fff, 0, 4, i19, l19, j18, k20, j17, false);
  9793. }
  9794. if(j16 == 2)
  9795. {
  9796. Object5 class28 = worldController.method298(j4, i7, plane);
  9797. if(j12 == 11)
  9798. j12 = 10;
  9799. if(class28 != null)
  9800. class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(class28.uid >> 14 & 0x7fff, k14, j12, i19, l19, j18, k20, j17, false);
  9801. }
  9802. if(j16 == 3)
  9803. {
  9804. Object3 class49 = worldController.method299(i7, j4, plane);
  9805. if(class49 != null)
  9806. class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(class49.uid >> 14 & 0x7fff, k14, 22, i19, l19, j18, k20, j17, false);
  9807. }
  9808. }
  9809. return;
  9810. }
  9811. if(j == 147)
  9812. {
  9813. int l1 = stream.method428();
  9814. int k4 = anInt1268 + (l1 >> 4 & 7);
  9815. int j7 = anInt1269 + (l1 & 7);
  9816. int i10 = stream.readUnsignedWord();
  9817. byte byte0 = stream.method430();
  9818. int l14 = stream.method434();
  9819. byte byte1 = stream.method429();
  9820. int k17 = stream.readUnsignedWord();
  9821. int k18 = stream.method428();
  9822. int j19 = k18 >> 2;
  9823. int i20 = k18 & 3;
  9824. int l20 = anIntArray1177[j19];
  9825. byte byte2 = stream.readSignedByte();
  9826. int l21 = stream.readUnsignedWord();
  9827. byte byte3 = stream.method429();
  9828. Player player;
  9829. if(i10 == unknownInt10)
  9830. player = myPlayer;
  9831. else
  9832. player = playerArray[i10];
  9833. if(player != null)
  9834. {
  9835. ObjectDef class46 = ObjectDef.forID(l21);
  9836. int i22 = intGroundArray[plane][k4][j7];
  9837. int j22 = intGroundArray[plane][k4 + 1][j7];
  9838. int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
  9839. int l22 = intGroundArray[plane][k4][j7 + 1];
  9840. Model model = class46.method578(j19, i20, i22, j22, k22, l22, -1);
  9841. if(model != null)
  9842. {
  9843. method130(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
  9844. player.anInt1707 = l14 + loopCycle;
  9845. player.anInt1708 = k17 + loopCycle;
  9846. player.aModel_1714 = model;
  9847. int i23 = class46.anInt744;
  9848. int j23 = class46.anInt761;
  9849. if(i20 == 1 || i20 == 3)
  9850. {
  9851. i23 = class46.anInt761;
  9852. j23 = class46.anInt744;
  9853. }
  9854. player.anInt1711 = k4 * 128 + i23 * 64;
  9855. player.anInt1713 = j7 * 128 + j23 * 64;
  9856. player.anInt1712 = method42(plane, player.anInt1713, player.anInt1711);
  9857. if(byte2 > byte0)
  9858. {
  9859. byte byte4 = byte2;
  9860. byte2 = byte0;
  9861. byte0 = byte4;
  9862. }
  9863. if(byte3 > byte1)
  9864. {
  9865. byte byte5 = byte3;
  9866. byte3 = byte1;
  9867. byte1 = byte5;
  9868. }
  9869. player.anInt1719 = k4 + byte2;
  9870. player.anInt1721 = k4 + byte0;
  9871. player.anInt1720 = j7 + byte3;
  9872. player.anInt1722 = j7 + byte1;
  9873. }
  9874. }
  9875. }
  9876. if(j == 151)
  9877. {
  9878. int i2 = stream.method426();
  9879. int l4 = anInt1268 + (i2 >> 4 & 7);
  9880. int k7 = anInt1269 + (i2 & 7);
  9881. int j10 = stream.method434();
  9882. int k12 = stream.method428();
  9883. int i15 = k12 >> 2;
  9884. int k16 = k12 & 3;
  9885. int l17 = anIntArray1177[i15];
  9886. if(l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104)
  9887. method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
  9888. return;
  9889. }
  9890. if(j == 4)
  9891. {
  9892. int j2 = stream.readUnsignedByte();
  9893. int i5 = anInt1268 + (j2 >> 4 & 7);
  9894. int l7 = anInt1269 + (j2 & 7);
  9895. int k10 = stream.readUnsignedWord();
  9896. int l12 = stream.readUnsignedByte();
  9897. int j15 = stream.readUnsignedWord();
  9898. if(i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104)
  9899. {
  9900. i5 = i5 * 128 + 64;
  9901. l7 = l7 * 128 + 64;
  9902. Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane, loopCycle, j15, k10, method42(plane, l7, i5) - l12, l7, i5);
  9903. aClass19_1056.insertHead(class30_sub2_sub4_sub3);
  9904. }
  9905. return;
  9906. }
  9907. if(j == 44)
  9908. {
  9909. int k2 = stream.method436();
  9910. int j5 = stream.readUnsignedWord();
  9911. int i8 = stream.readUnsignedByte();
  9912. int l10 = anInt1268 + (i8 >> 4 & 7);
  9913. int i13 = anInt1269 + (i8 & 7);
  9914. if(l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104)
  9915. {
  9916. Item class30_sub2_sub4_sub2_1 = new Item();
  9917. class30_sub2_sub4_sub2_1.ID = k2;
  9918. class30_sub2_sub4_sub2_1.anInt1559 = j5;
  9919. if(groundArray[plane][l10][i13] == null)
  9920. groundArray[plane][l10][i13] = new NodeList();
  9921. groundArray[plane][l10][i13].insertHead(class30_sub2_sub4_sub2_1);
  9922. spawnGroundItem(l10, i13);
  9923. }
  9924. return;
  9925. }
  9926. if(j == 101)
  9927. {
  9928. int l2 = stream.method427();
  9929. int k5 = l2 >> 2;
  9930. int j8 = l2 & 3;
  9931. int i11 = anIntArray1177[k5];
  9932. int j13 = stream.readUnsignedByte();
  9933. int k15 = anInt1268 + (j13 >> 4 & 7);
  9934. int l16 = anInt1269 + (j13 & 7);
  9935. if(k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
  9936. method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
  9937. return;
  9938. }
  9939. if(j == 117)
  9940. {
  9941. int i3 = stream.readUnsignedByte();
  9942. int l5 = anInt1268 + (i3 >> 4 & 7);
  9943. int k8 = anInt1269 + (i3 & 7);
  9944. int j11 = l5 + stream.readSignedByte();
  9945. int k13 = k8 + stream.readSignedByte();
  9946. int l15 = stream.readSignedWord();
  9947. int i17 = stream.readUnsignedWord();
  9948. int i18 = stream.readUnsignedByte() * 4;
  9949. int l18 = stream.readUnsignedByte() * 4;
  9950. int k19 = stream.readUnsignedWord();
  9951. int j20 = stream.readUnsignedWord();
  9952. int i21 = stream.readUnsignedByte();
  9953. int j21 = stream.readUnsignedByte();
  9954. if(l5 >= 0 && k8 >= 0 && l5 < 104 && k8 < 104 && j11 >= 0 && k13 >= 0 && j11 < 104 && k13 < 104 && i17 != 65535)
  9955. {
  9956. l5 = l5 * 128 + 64;
  9957. k8 = k8 * 128 + 64;
  9958. j11 = j11 * 128 + 64;
  9959. k13 = k13 * 128 + 64;
  9960. Animable_Sub4 class30_sub2_sub4_sub4 = new Animable_Sub4(i21, l18, k19 + loopCycle, j20 + loopCycle, j21, plane, method42(plane, k8, l5) - i18, k8, l5, l15, i17);
  9961. class30_sub2_sub4_sub4.method455(k19 + loopCycle, k13, method42(plane, k13, j11) - l18, j11);
  9962. aClass19_1013.insertHead(class30_sub2_sub4_sub4);
  9963. }
  9964. }
  9965. }
  9966.  
  9967. private static void setLowMem()
  9968. {
  9969. WorldController.lowMem = true;
  9970. Texture.lowMem = true;
  9971. lowMem = true;
  9972. ObjectManager.lowMem = true;
  9973. ObjectDef.lowMem = true;
  9974. }
  9975.  
  9976. private void method139(Stream stream)
  9977. {
  9978. stream.initBitAccess();
  9979. int k = stream.readBits(8);
  9980. if(k < npcCount)
  9981. {
  9982. for(int l = k; l < npcCount; l++)
  9983. anIntArray840[anInt839++] = npcIndices[l];
  9984.  
  9985. }
  9986. if(k > npcCount)
  9987. {
  9988. signlink.reporterror(myUsername + " Too many npcs");
  9989. throw new RuntimeException("eek");
  9990. }
  9991. npcCount = 0;
  9992. for(int i1 = 0; i1 < k; i1++)
  9993. {
  9994. int j1 = npcIndices[i1];
  9995. NPC npc = npcArray[j1];
  9996. int k1 = stream.readBits(1);
  9997. if(k1 == 0)
  9998. {
  9999. npcIndices[npcCount++] = j1;
  10000. npc.anInt1537 = loopCycle;
  10001. } else
  10002. {
  10003. int l1 = stream.readBits(2);
  10004. if(l1 == 0)
  10005. {
  10006. npcIndices[npcCount++] = j1;
  10007. npc.anInt1537 = loopCycle;
  10008. anIntArray894[anInt893++] = j1;
  10009. } else
  10010. if(l1 == 1)
  10011. {
  10012. npcIndices[npcCount++] = j1;
  10013. npc.anInt1537 = loopCycle;
  10014. int i2 = stream.readBits(3);
  10015. npc.moveInDir(false, i2);
  10016. int k2 = stream.readBits(1);
  10017. if(k2 == 1)
  10018. anIntArray894[anInt893++] = j1;
  10019. } else
  10020. if(l1 == 2)
  10021. {
  10022. npcIndices[npcCount++] = j1;
  10023. npc.anInt1537 = loopCycle;
  10024. int j2 = stream.readBits(3);
  10025. npc.moveInDir(true, j2);
  10026. int l2 = stream.readBits(3);
  10027. npc.moveInDir(true, l2);
  10028. int i3 = stream.readBits(1);
  10029. if(i3 == 1)
  10030. anIntArray894[anInt893++] = j1;
  10031. } else
  10032. if(l1 == 3)
  10033. anIntArray840[anInt839++] = j1;
  10034. }
  10035. }
  10036.  
  10037. }
  10038.  
  10039. private void processLoginScreenInput()
  10040. {
  10041. if(loginScreenState == 0)
  10042. {
  10043. int i = super.myWidth / 2 - 80;
  10044. int l = super.myHeight / 2 + 20;
  10045. l += 20;
  10046. if(super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20)
  10047. {
  10048. loginScreenState = 3;
  10049. loginScreenCursorPos = 0;
  10050. }
  10051. i = super.myWidth / 2 + 80;
  10052. if(super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20)
  10053. {
  10054. loginMessage1 = "";
  10055. loginMessage2 = "Enter your username & password.";
  10056. loginScreenState = 2;
  10057. loginScreenCursorPos = 0;
  10058. }
  10059. } else
  10060. {
  10061. if(loginScreenState == 2)
  10062. {
  10063. int j = super.myHeight / 2 - 40;
  10064. j += 30;
  10065. j += 25;
  10066. if(super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  10067. loginScreenCursorPos = 0;
  10068. j += 15;
  10069. if(super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  10070. loginScreenCursorPos = 1;
  10071. j += 15;
  10072. int i1 = super.myWidth / 2 - 80;
  10073. int k1 = super.myHeight / 2 + 50;
  10074. k1 += 20;
  10075. if(super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20)
  10076. {
  10077. loginFailures = 0;
  10078. login(myUsername, myPassword, false);
  10079. if(loggedIn)
  10080. return;
  10081. }
  10082. i1 = super.myWidth / 2 + 80;
  10083. if(super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20)
  10084. {
  10085. loginScreenState = 0;
  10086. // myUsername = "";
  10087. // myPassword = "";
  10088. }
  10089. do
  10090. {
  10091. int l1 = readChar(-796);
  10092. if(l1 == -1)
  10093. break;
  10094. boolean flag1 = false;
  10095. for(int i2 = 0; i2 < validUserPassChars.length(); i2++)
  10096. {
  10097. if(l1 != validUserPassChars.charAt(i2))
  10098. continue;
  10099. flag1 = true;
  10100. break;
  10101. }
  10102.  
  10103. if(loginScreenCursorPos == 0)
  10104. {
  10105. if(l1 == 8 && myUsername.length() > 0)
  10106. myUsername = myUsername.substring(0, myUsername.length() - 1);
  10107. if(l1 == 9 || l1 == 10 || l1 == 13)
  10108. loginScreenCursorPos = 1;
  10109. if(flag1)
  10110. myUsername += (char)l1;
  10111. if(myUsername.length() > 12)
  10112. myUsername = myUsername.substring(0, 12);
  10113. } else
  10114. if(loginScreenCursorPos == 1)
  10115. {
  10116. if(l1 == 8 && myPassword.length() > 0)
  10117. myPassword = myPassword.substring(0, myPassword.length() - 1);
  10118. if(l1 == 9 || l1 == 10 || l1 == 13)
  10119. loginScreenCursorPos = 0;
  10120. if(flag1)
  10121. myPassword += (char)l1;
  10122. if(myPassword.length() > 20)
  10123. myPassword = myPassword.substring(0, 20);
  10124. }
  10125. } while(true);
  10126. return;
  10127. }
  10128. if(loginScreenState == 3)
  10129. {
  10130. int k = super.myWidth / 2;
  10131. int j1 = super.myHeight / 2 + 50;
  10132. j1 += 20;
  10133. if(super.clickMode3 == 1 && super.saveClickX >= k - 75 && super.saveClickX <= k + 75 && super.saveClickY >= j1 - 20 && super.saveClickY <= j1 + 20)
  10134. loginScreenState = 0;
  10135. }
  10136. }
  10137. }
  10138.  
  10139. private void markMinimap(Sprite sprite, int i, int j)
  10140. {
  10141. int k = minimapInt1 + minimapInt2 & 0x7ff;
  10142. int l = i * i + j * j;
  10143. if(l > 6400)
  10144. return;
  10145. int i1 = Model.modelIntArray1[k];
  10146. int j1 = Model.modelIntArray2[k];
  10147. i1 = (i1 * 256) / (minimapInt3 + 256);
  10148. j1 = (j1 * 256) / (minimapInt3 + 256);
  10149. int k1 = j * i1 + i * j1 >> 16;
  10150. int l1 = j * j1 - i * i1 >> 16;
  10151. if(l > 2500)
  10152. {
  10153. sprite.method354(mapBack, 83 - l1 - sprite.anInt1445 / 2 - 4, ((94 + k1) - sprite.anInt1444 / 2) + 4);
  10154. } else
  10155. {
  10156. sprite.drawSprite(((94 + k1) - sprite.anInt1444 / 2) + 4, 83 - l1 - sprite.anInt1445 / 2 - 4);
  10157. }
  10158. }
  10159.  
  10160. private void method142(int i, int j, int k, int l, int i1, int j1, int k1
  10161. )
  10162. {
  10163. if(i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102)
  10164. {
  10165. if(lowMem && j != plane)
  10166. return;
  10167. int i2 = 0;
  10168. if(j1 == 0)
  10169. i2 = worldController.method300(j, i1, i);
  10170. if(j1 == 1)
  10171. i2 = worldController.method301(j, i1, i);
  10172. if(j1 == 2)
  10173. i2 = worldController.method302(j, i1, i);
  10174. if(j1 == 3)
  10175. i2 = worldController.method303(j, i1, i);
  10176. if(i2 != 0)
  10177. {
  10178. int i3 = worldController.method304(j, i1, i, i2);
  10179. int j2 = i2 >> 14 & 0x7fff;
  10180. int k2 = i3 & 0x1f;
  10181. int l2 = i3 >> 6;
  10182. if(j1 == 0)
  10183. {
  10184. worldController.method291(i1, j, i, (byte)-119);
  10185. ObjectDef class46 = ObjectDef.forID(j2);
  10186. if(class46.aBoolean767)
  10187. aClass11Array1230[j].method215(l2, k2, class46.aBoolean757, i1, i);
  10188. }
  10189. if(j1 == 1)
  10190. worldController.method292(i, j, i1);
  10191. if(j1 == 2)
  10192. {
  10193. worldController.method293(j, i1, i);
  10194. ObjectDef class46_1 = ObjectDef.forID(j2);
  10195. if(i1 + class46_1.anInt744 > 103 || i + class46_1.anInt744 > 103 || i1 + class46_1.anInt761 > 103 || i + class46_1.anInt761 > 103)
  10196. return;
  10197. if(class46_1.aBoolean767)
  10198. aClass11Array1230[j].method216(l2, class46_1.anInt744, i1, i, class46_1.anInt761, class46_1.aBoolean757);
  10199. }
  10200. if(j1 == 3)
  10201. {
  10202. worldController.method294(j, i, i1);
  10203. ObjectDef class46_2 = ObjectDef.forID(j2);
  10204. if(class46_2.aBoolean767 && class46_2.hasActions)
  10205. aClass11Array1230[j].method218(i, i1);
  10206. }
  10207. }
  10208. if(k1 >= 0)
  10209. {
  10210. int j3 = j;
  10211. if(j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
  10212. j3++;
  10213. ObjectManager.method188(worldController, k, i, l, j3, aClass11Array1230[j], intGroundArray, i1, k1, j);
  10214. }
  10215. }
  10216. }
  10217.  
  10218. private void updatePlayers(int i, Stream stream)
  10219. {
  10220. anInt839 = 0;
  10221. anInt893 = 0;
  10222. updateThisPlayerMovement(stream);
  10223. updatePlayerMovement(stream);
  10224. addNewPlayer(stream, i);
  10225. updateMasks(stream);
  10226. for(int k = 0; k < anInt839; k++)
  10227. {
  10228. int l = anIntArray840[k];
  10229. if(playerArray[l].anInt1537 != loopCycle)
  10230. playerArray[l] = null;
  10231. }
  10232. if(stream.currentOffset != i)
  10233. {
  10234. signlink.reporterror("Error packet size mismatch in getplayer pos:" + stream.currentOffset + " psize:" + i);
  10235. throw new RuntimeException("eek");
  10236. }
  10237. for(int i1 = 0; i1 < playerCount; i1++)
  10238. if(playerArray[playerIndices[i1]] == null)
  10239. {
  10240. signlink.reporterror(myUsername + " null entry in pl list - pos:" + i1 + " size:" + playerCount);
  10241. throw new RuntimeException("eek");
  10242. }
  10243.  
  10244. }
  10245.  
  10246. private void setCameraPos(int j, int k, int l, int i1, int j1, int k1)
  10247. {
  10248. int l1 = 2048 - k & 0x7ff;
  10249. int i2 = 2048 - j1 & 0x7ff;
  10250. int j2 = 0;
  10251. int k2 = 0;
  10252. int l2 = j;
  10253. if(l1 != 0)
  10254. {
  10255. int i3 = Model.modelIntArray1[l1];
  10256. int k3 = Model.modelIntArray2[l1];
  10257. int i4 = k2 * k3 - l2 * i3 >> 16;
  10258. l2 = k2 * i3 + l2 * k3 >> 16;
  10259. k2 = i4;
  10260. }
  10261. if(i2 != 0)
  10262. {
  10263. /* xxx if(cameratoggle){
  10264. if(zoom == 0)
  10265. zoom = k2;
  10266. if(lftrit == 0)
  10267. lftrit = j2;
  10268. if(fwdbwd == 0)
  10269. fwdbwd = l2;
  10270. k2 = zoom;
  10271. j2 = lftrit;
  10272. l2 = fwdbwd;
  10273. }
  10274. */
  10275. int j3 = Model.modelIntArray1[i2];
  10276. int l3 = Model.modelIntArray2[i2];
  10277. int j4 = l2 * j3 + j2 * l3 >> 16;
  10278. l2 = l2 * l3 - j2 * j3 >> 16;
  10279. j2 = j4;
  10280. }
  10281. xCameraPos = l - j2;
  10282. zCameraPos = i1 - k2;
  10283. yCameraPos = k1 - l2;
  10284. yCameraCurve = k;
  10285. xCameraCurve = j1;
  10286. }
  10287.  
  10288. private boolean parsePacket()
  10289. {
  10290. if(socketStream == null)
  10291. return false;
  10292. try
  10293. {
  10294. int i = socketStream.available();
  10295. if(i == 0)
  10296. return false;
  10297. if(pktType == -1)
  10298. {
  10299. socketStream.flushInputStream(inStream.buffer, 1);
  10300. pktType = inStream.buffer[0] & 0xff;
  10301. if(encryption != null)
  10302. pktType = pktType - encryption.getNextKey() & 0xff;
  10303. pktSize = SizeConstants.packetSizes[pktType];
  10304. i--;
  10305. }
  10306. if(pktSize == -1)
  10307. if(i > 0)
  10308. {
  10309. socketStream.flushInputStream(inStream.buffer, 1);
  10310. pktSize = inStream.buffer[0] & 0xff;
  10311. i--;
  10312. } else
  10313. {
  10314. return false;
  10315. }
  10316. if(pktSize == -2)
  10317. if(i > 1)
  10318. {
  10319. socketStream.flushInputStream(inStream.buffer, 2);
  10320. inStream.currentOffset = 0;
  10321. pktSize = inStream.readUnsignedWord();
  10322. i -= 2;
  10323. } else
  10324. {
  10325. return false;
  10326. }
  10327. if(i < pktSize)
  10328. return false;
  10329. inStream.currentOffset = 0;
  10330. socketStream.flushInputStream(inStream.buffer, pktSize);
  10331. anInt1009 = 0;
  10332. anInt843 = anInt842;
  10333. anInt842 = anInt841;
  10334. anInt841 = pktType;
  10335. if(pktType == 81)
  10336. {
  10337. updatePlayers(pktSize, inStream);
  10338. aBoolean1080 = false;
  10339. pktType = -1;
  10340. return true;
  10341. }
  10342. if(pktType == 176)
  10343. {
  10344. daysSinceRecovChange = inStream.method427();
  10345. unreadMessages = inStream.method435();
  10346. membersInt = inStream.readUnsignedByte();
  10347. anInt1193 = inStream.method440();
  10348. daysSinceLastLogin = inStream.readUnsignedWord();
  10349. if(anInt1193 != 0 && openInterfaceID == -1)
  10350. {
  10351. signlink.dnslookup(TextClass.method586(anInt1193));
  10352. clearTopInterfaces();
  10353. char c = '\u028A';
  10354. if(daysSinceRecovChange != 201 || membersInt == 1)
  10355. c = '\u028F';
  10356. reportAbuseInput = "";
  10357. canMute = false;
  10358. for(int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++)
  10359. {
  10360. if(RSInterface.interfaceCache[k9] == null || RSInterface.interfaceCache[k9].anInt214 != c)
  10361. continue;
  10362. openInterfaceID = RSInterface.interfaceCache[k9].parentID;
  10363. break;
  10364. }
  10365.  
  10366. }
  10367. pktType = -1;
  10368. return true;
  10369. }
  10370. if(pktType == 64)
  10371. {
  10372. anInt1268 = inStream.method427();
  10373. anInt1269 = inStream.method428();
  10374. for(int j = anInt1268; j < anInt1268 + 8; j++)
  10375. {
  10376. for(int l9 = anInt1269; l9 < anInt1269 + 8; l9++)
  10377. if(groundArray[plane][j][l9] != null)
  10378. {
  10379. groundArray[plane][j][l9] = null;
  10380. spawnGroundItem(j, l9);
  10381. }
  10382.  
  10383. }
  10384.  
  10385. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  10386. if(class30_sub1.anInt1297 >= anInt1268 && class30_sub1.anInt1297 < anInt1268 + 8 && class30_sub1.anInt1298 >= anInt1269 && class30_sub1.anInt1298 < anInt1269 + 8 && class30_sub1.anInt1295 == plane)
  10387. class30_sub1.anInt1294 = 0;
  10388.  
  10389. pktType = -1;
  10390. return true;
  10391. }
  10392. if(pktType == 185)
  10393. {
  10394. int k = inStream.method436();
  10395. RSInterface.interfaceCache[k].anInt233 = 3;
  10396. if(myPlayer.desc == null)
  10397. RSInterface.interfaceCache[k].mediaID = (myPlayer.anIntArray1700[0] << 25) + (myPlayer.anIntArray1700[4] << 20) + (myPlayer.equipment[0] << 15) + (myPlayer.equipment[8] << 10) + (myPlayer.equipment[11] << 5) + myPlayer.equipment[1];
  10398. else
  10399. RSInterface.interfaceCache[k].mediaID = (int)(0x12345678L + myPlayer.desc.type);
  10400. pktType = -1;
  10401. return true;
  10402. }
  10403. if(pktType == 107)
  10404. {
  10405. aBoolean1160 = false;
  10406. for(int l = 0; l < 5; l++)
  10407. aBooleanArray876[l] = false;
  10408.  
  10409. pktType = -1;
  10410. return true;
  10411. }
  10412. if(pktType == 72)
  10413. {
  10414. int i1 = inStream.method434();
  10415. RSInterface class9 = RSInterface.interfaceCache[i1];
  10416. for(int k15 = 0; k15 < class9.inv.length; k15++)
  10417. {
  10418. class9.inv[k15] = -1;
  10419. class9.inv[k15] = 0;
  10420. }
  10421.  
  10422. pktType = -1;
  10423. return true;
  10424. }
  10425. if(pktType == 214)
  10426. {
  10427. ignoreCount = pktSize / 8;
  10428. for(int j1 = 0; j1 < ignoreCount; j1++)
  10429. ignoreListAsLongs[j1] = inStream.readQWord();
  10430.  
  10431. pktType = -1;
  10432. return true;
  10433. }
  10434. if(pktType == 166)
  10435. {
  10436. aBoolean1160 = true;
  10437. anInt1098 = inStream.readUnsignedByte();
  10438. anInt1099 = inStream.readUnsignedByte();
  10439. anInt1100 = inStream.readUnsignedWord();
  10440. anInt1101 = inStream.readUnsignedByte();
  10441. anInt1102 = inStream.readUnsignedByte();
  10442. if(anInt1102 >= 100)
  10443. {
  10444. xCameraPos = anInt1098 * 128 + 64;
  10445. yCameraPos = anInt1099 * 128 + 64;
  10446. zCameraPos = method42(plane, yCameraPos, xCameraPos) - anInt1100;
  10447. }
  10448. pktType = -1;
  10449. return true;
  10450. }
  10451. if(pktType == 134)
  10452. {
  10453. needDrawTabArea = true;
  10454. int k1 = inStream.readUnsignedByte();
  10455. int i10 = inStream.method439();
  10456. int l15 = inStream.readUnsignedByte();
  10457. currentExp[k1] = i10;
  10458. currentStats[k1] = l15;
  10459. maxStats[k1] = 1;
  10460. for(int k20 = 0; k20 < 98; k20++)
  10461. if(i10 >= anIntArray1019[k20])
  10462. maxStats[k1] = k20 + 2;
  10463.  
  10464. pktType = -1;
  10465. return true;
  10466. }
  10467. if(pktType == 71)
  10468. {
  10469. int l1 = inStream.readUnsignedWord();
  10470. int j10 = inStream.method426();
  10471. if(l1 == 65535)
  10472. l1 = -1;
  10473. tabInterfaceIDs[j10] = l1;
  10474. needDrawTabArea = true;
  10475. tabAreaAltered = true;
  10476. pktType = -1;
  10477. return true;
  10478. }
  10479. if(pktType == 74)
  10480. {
  10481. int i2 = inStream.method434();
  10482. if(i2 == 65535)
  10483. i2 = -1;
  10484. if(i2 != currentSong && musicEnabled && !lowMem && prevSong == 0)
  10485. {
  10486. nextSong = i2;
  10487. songChanging = true;
  10488. onDemandFetcher.method558(2, nextSong);
  10489. }
  10490. currentSong = i2;
  10491. pktType = -1;
  10492. return true;
  10493. }
  10494. if(pktType == 121)
  10495. {
  10496. int j2 = inStream.method436();
  10497. int k10 = inStream.method435();
  10498. if(musicEnabled && !lowMem)
  10499. {
  10500. nextSong = j2;
  10501. songChanging = false;
  10502. onDemandFetcher.method558(2, nextSong);
  10503. prevSong = k10;
  10504. }
  10505. pktType = -1;
  10506. return true;
  10507. }
  10508. if(pktType == 109)
  10509. {
  10510. resetLogout();
  10511. pktType = -1;
  10512. return false;
  10513. }
  10514. if(pktType == 70)
  10515. {
  10516. int k2 = inStream.readSignedWord();
  10517. int l10 = inStream.method437();
  10518. int i16 = inStream.method434();
  10519. RSInterface class9_5 = RSInterface.interfaceCache[i16];
  10520. class9_5.anInt263 = k2;
  10521. class9_5.anInt265 = l10;
  10522. pktType = -1;
  10523. return true;
  10524. }
  10525. if(pktType == 73 || pktType == 241)
  10526. {
  10527.  
  10528. //mapReset();
  10529. int l2 = anInt1069;
  10530. int i11 = anInt1070;
  10531. if(pktType == 73)
  10532. {
  10533. l2 = inStream.method435();
  10534. i11 = inStream.readUnsignedWord();
  10535. aBoolean1159 = false;
  10536. }
  10537. if(pktType == 241)
  10538. {
  10539. i11 = inStream.method435();
  10540. inStream.initBitAccess();
  10541. for(int j16 = 0; j16 < 4; j16++)
  10542. {
  10543. for(int l20 = 0; l20 < 13; l20++)
  10544. {
  10545. for(int j23 = 0; j23 < 13; j23++)
  10546. {
  10547. int i26 = inStream.readBits(1);
  10548. if(i26 == 1)
  10549. anIntArrayArrayArray1129[j16][l20][j23] = inStream.readBits(26);
  10550. else
  10551. anIntArrayArrayArray1129[j16][l20][j23] = -1;
  10552. }
  10553.  
  10554. }
  10555.  
  10556. }
  10557.  
  10558. inStream.finishBitAccess();
  10559. l2 = inStream.readUnsignedWord();
  10560. aBoolean1159 = true;
  10561. }
  10562. if(anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2)
  10563. {
  10564. pktType = -1;
  10565. return true;
  10566. }
  10567. anInt1069 = l2;
  10568. anInt1070 = i11;
  10569. baseX = (anInt1069 - 6) * 8;
  10570. baseY = (anInt1070 - 6) * 8;
  10571. aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49) && anInt1070 / 8 == 48;
  10572. if(anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
  10573. aBoolean1141 = true;
  10574. loadingStage = 1;
  10575. aLong824 = System.currentTimeMillis();
  10576. aRSImageProducer_1165.initDrawingArea();
  10577. aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151, 257);
  10578. aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.", 150, 256);
  10579. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  10580. if(pktType == 73)
  10581. {
  10582. int k16 = 0;
  10583. for(int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++)
  10584. {
  10585. for(int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
  10586. k16++;
  10587.  
  10588. }
  10589.  
  10590. aByteArrayArray1183 = new byte[k16][];
  10591. aByteArrayArray1247 = new byte[k16][];
  10592. anIntArray1234 = new int[k16];
  10593. anIntArray1235 = new int[k16];
  10594. anIntArray1236 = new int[k16];
  10595. k16 = 0;
  10596. for(int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++)
  10597. {
  10598. for(int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++)
  10599. {
  10600. anIntArray1234[k16] = (l23 << 8) + j26;
  10601. if(aBoolean1141 && (j26 == 49 || j26 == 149 || j26 == 147 || l23 == 50 || l23 == 49 && j26 == 47))
  10602. {
  10603. anIntArray1235[k16] = -1;
  10604. anIntArray1236[k16] = -1;
  10605. k16++;
  10606. } else
  10607. {
  10608. int k28 = anIntArray1235[k16] = onDemandFetcher.method562(0, j26, l23);
  10609. if(k28 != -1)
  10610. onDemandFetcher.method558(3, k28);
  10611. int j30 = anIntArray1236[k16] = onDemandFetcher.method562(1, j26, l23);
  10612. if(j30 != -1)
  10613. onDemandFetcher.method558(3, j30);
  10614. k16++;
  10615. }
  10616. }
  10617.  
  10618. }
  10619.  
  10620. }
  10621. if(pktType == 241)
  10622. {
  10623. int l16 = 0;
  10624. int ai[] = new int[676];
  10625. for(int i24 = 0; i24 < 4; i24++)
  10626. {
  10627. for(int k26 = 0; k26 < 13; k26++)
  10628. {
  10629. for(int l28 = 0; l28 < 13; l28++)
  10630. {
  10631. int k30 = anIntArrayArrayArray1129[i24][k26][l28];
  10632. if(k30 != -1)
  10633. {
  10634. int k31 = k30 >> 14 & 0x3ff;
  10635. int i32 = k30 >> 3 & 0x7ff;
  10636. int k32 = (k31 / 8 << 8) + i32 / 8;
  10637. for(int j33 = 0; j33 < l16; j33++)
  10638. {
  10639. if(ai[j33] != k32)
  10640. continue;
  10641. k32 = -1;
  10642. break;
  10643. }
  10644.  
  10645. if(k32 != -1)
  10646. ai[l16++] = k32;
  10647. }
  10648. }
  10649.  
  10650. }
  10651.  
  10652. }
  10653.  
  10654. aByteArrayArray1183 = new byte[l16][];
  10655. aByteArrayArray1247 = new byte[l16][];
  10656. anIntArray1234 = new int[l16];
  10657. anIntArray1235 = new int[l16];
  10658. anIntArray1236 = new int[l16];
  10659. for(int l26 = 0; l26 < l16; l26++)
  10660. {
  10661. int i29 = anIntArray1234[l26] = ai[l26];
  10662. int l30 = i29 >> 8 & 0xff;
  10663. int l31 = i29 & 0xff;
  10664. int j32 = anIntArray1235[l26] = onDemandFetcher.method562(0, l31, l30);
  10665. if(j32 != -1)
  10666. onDemandFetcher.method558(3, j32);
  10667. int i33 = anIntArray1236[l26] = onDemandFetcher.method562(1, l31, l30);
  10668. if(i33 != -1)
  10669. onDemandFetcher.method558(3, i33);
  10670. }
  10671.  
  10672. }
  10673. int i17 = baseX - anInt1036;
  10674. int j21 = baseY - anInt1037;
  10675. anInt1036 = baseX;
  10676. anInt1037 = baseY;
  10677. for(int j24 = 0; j24 < 16384; j24++)
  10678. {
  10679. NPC npc = npcArray[j24];
  10680. if(npc != null)
  10681. {
  10682. for(int j29 = 0; j29 < 10; j29++)
  10683. {
  10684. npc.smallX[j29] -= i17;
  10685. npc.smallY[j29] -= j21;
  10686. }
  10687.  
  10688. npc.x -= i17 * 128;
  10689. npc.y -= j21 * 128;
  10690. }
  10691. }
  10692.  
  10693. for(int i27 = 0; i27 < maxPlayers; i27++)
  10694. {
  10695. Player player = playerArray[i27];
  10696. if(player != null)
  10697. {
  10698. for(int i31 = 0; i31 < 10; i31++)
  10699. {
  10700. player.smallX[i31] -= i17;
  10701. player.smallY[i31] -= j21;
  10702. }
  10703.  
  10704. player.x -= i17 * 128;
  10705. player.y -= j21 * 128;
  10706. }
  10707. }
  10708.  
  10709. aBoolean1080 = true;
  10710. byte byte1 = 0;
  10711. byte byte2 = 104;
  10712. byte byte3 = 1;
  10713. if(i17 < 0)
  10714. {
  10715. byte1 = 103;
  10716. byte2 = -1;
  10717. byte3 = -1;
  10718. }
  10719. byte byte4 = 0;
  10720. byte byte5 = 104;
  10721. byte byte6 = 1;
  10722. if(j21 < 0)
  10723. {
  10724. byte4 = 103;
  10725. byte5 = -1;
  10726. byte6 = -1;
  10727. }
  10728. for(int k33 = byte1; k33 != byte2; k33 += byte3)
  10729. {
  10730. for(int l33 = byte4; l33 != byte5; l33 += byte6)
  10731. {
  10732. int i34 = k33 + i17;
  10733. int j34 = l33 + j21;
  10734. for(int k34 = 0; k34 < 4; k34++)
  10735. if(i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
  10736. groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
  10737. else
  10738. groundArray[k34][k33][l33] = null;
  10739.  
  10740. }
  10741.  
  10742. }
  10743.  
  10744. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  10745. {
  10746. class30_sub1_1.anInt1297 -= i17;
  10747. class30_sub1_1.anInt1298 -= j21;
  10748. if(class30_sub1_1.anInt1297 < 0 || class30_sub1_1.anInt1298 < 0 || class30_sub1_1.anInt1297 >= 104 || class30_sub1_1.anInt1298 >= 104)
  10749. class30_sub1_1.unlink();
  10750. }
  10751.  
  10752. if(destX != 0)
  10753. {
  10754. destX -= i17;
  10755. destY -= j21;
  10756. }
  10757. aBoolean1160 = false;
  10758. pktType = -1;
  10759. return true;
  10760. }
  10761. if(pktType == 208)
  10762. {
  10763. int i3 = inStream.method437();
  10764. if(i3 >= 0)
  10765. method60(i3);
  10766. anInt1018 = i3;
  10767. pktType = -1;
  10768. return true;
  10769. }
  10770. if(pktType == 99)
  10771. {
  10772. anInt1021 = inStream.readUnsignedByte();
  10773. pktType = -1;
  10774. return true;
  10775. }
  10776. if(pktType == 75)
  10777. {
  10778. int j3 = inStream.method436();
  10779. int j11 = inStream.method436();
  10780. RSInterface.interfaceCache[j11].anInt233 = 2;
  10781. RSInterface.interfaceCache[j11].mediaID = j3;
  10782. pktType = -1;
  10783. return true;
  10784. }
  10785. if(pktType == 114)
  10786. {
  10787. anInt1104 = inStream.method434() * 30;
  10788. pktType = -1;
  10789. return true;
  10790. }
  10791. if(pktType == 60)
  10792. {
  10793. anInt1269 = inStream.readUnsignedByte();
  10794. anInt1268 = inStream.method427();
  10795. while(inStream.currentOffset < pktSize)
  10796. {
  10797. int k3 = inStream.readUnsignedByte();
  10798. method137(inStream, k3);
  10799. }
  10800. pktType = -1;
  10801. return true;
  10802. }
  10803. if(pktType == 35)
  10804. {
  10805. int l3 = inStream.readUnsignedByte();
  10806. int k11 = inStream.readUnsignedByte();
  10807. int j17 = inStream.readUnsignedByte();
  10808. int k21 = inStream.readUnsignedByte();
  10809. aBooleanArray876[l3] = true;
  10810. anIntArray873[l3] = k11;
  10811. anIntArray1203[l3] = j17;
  10812. anIntArray928[l3] = k21;
  10813. anIntArray1030[l3] = 0;
  10814. pktType = -1;
  10815. return true;
  10816. }
  10817. if(pktType == 174)
  10818. {
  10819. int i4 = inStream.readUnsignedWord();
  10820. int l11 = inStream.readUnsignedByte();
  10821. int k17 = inStream.readUnsignedWord();
  10822. if(aBoolean848 && !lowMem && anInt1062 < 50)
  10823. {
  10824. anIntArray1207[anInt1062] = i4;
  10825. anIntArray1241[anInt1062] = l11;
  10826. anIntArray1250[anInt1062] = k17 + Sounds.anIntArray326[i4];
  10827. anInt1062++;
  10828. }
  10829. pktType = -1;
  10830. return true;
  10831. }
  10832. if(pktType == 104)
  10833. {
  10834. int j4 = inStream.method427();
  10835. int i12 = inStream.method426();
  10836. String s6 = inStream.readString();
  10837. if(j4 >= 1 && j4 <= 5)
  10838. {
  10839. if(s6.equalsIgnoreCase("null"))
  10840. s6 = null;
  10841. atPlayerActions[j4 - 1] = s6;
  10842. atPlayerArray[j4 - 1] = i12 == 0;
  10843. }
  10844. pktType = -1;
  10845. return true;
  10846. }
  10847. if(pktType == 78)
  10848. {
  10849. destX = 0;
  10850. pktType = -1;
  10851. return true;
  10852. }
  10853. if(pktType == 253)
  10854. {
  10855. String s = inStream.readString();
  10856. if(s.endsWith(":tradereq:"))
  10857. {
  10858. String s3 = s.substring(0, s.indexOf(":"));
  10859. long l17 = TextClass.longForName(s3);
  10860. boolean flag2 = false;
  10861. for(int j27 = 0; j27 < ignoreCount; j27++)
  10862. {
  10863. if(ignoreListAsLongs[j27] != l17)
  10864. continue;
  10865. flag2 = true;
  10866. break;
  10867. }
  10868.  
  10869. if(!flag2 && anInt1251 == 0)
  10870. pushMessage("wishes to trade with you.", 4, s3);
  10871. } else
  10872. if(s.endsWith(":duelreq:"))
  10873. {
  10874. String s4 = s.substring(0, s.indexOf(":"));
  10875. long l18 = TextClass.longForName(s4);
  10876. boolean flag3 = false;
  10877. for(int k27 = 0; k27 < ignoreCount; k27++)
  10878. {
  10879. if(ignoreListAsLongs[k27] != l18)
  10880. continue;
  10881. flag3 = true;
  10882. break;
  10883. }
  10884.  
  10885. if(!flag3 && anInt1251 == 0)
  10886. pushMessage("wishes to duel with you.", 8, s4);
  10887. } else
  10888. if(s.endsWith(":chalreq:"))
  10889. {
  10890. String s5 = s.substring(0, s.indexOf(":"));
  10891. long l19 = TextClass.longForName(s5);
  10892. boolean flag4 = false;
  10893. for(int l27 = 0; l27 < ignoreCount; l27++)
  10894. {
  10895. if(ignoreListAsLongs[l27] != l19)
  10896. continue;
  10897. flag4 = true;
  10898. break;
  10899. }
  10900.  
  10901. if(!flag4 && anInt1251 == 0)
  10902. {
  10903. String s8 = s.substring(s.indexOf(":") + 1, s.length() - 9);
  10904. pushMessage(s8, 8, s5);
  10905. }
  10906. } else
  10907. {
  10908. pushMessage(s, 0, "");
  10909. }
  10910. pktType = -1;
  10911. //serverMessage(s);
  10912.  
  10913. return true;
  10914. }
  10915. if(pktType == 1)
  10916. {
  10917. for(int k4 = 0; k4 < playerArray.length; k4++)
  10918. if(playerArray[k4] != null)
  10919. playerArray[k4].anim = -1;
  10920.  
  10921. for(int j12 = 0; j12 < npcArray.length; j12++)
  10922. if(npcArray[j12] != null)
  10923. npcArray[j12].anim = -1;
  10924.  
  10925. pktType = -1;
  10926. return true;
  10927. }
  10928. if(pktType == 50)
  10929. {
  10930. long l4 = inStream.readQWord();
  10931. int i18 = inStream.readUnsignedByte();
  10932. String s7 = TextClass.fixName(TextClass.nameForLong(l4));
  10933. for(int k24 = 0; k24 < friendsCount; k24++)
  10934. {
  10935. if(l4 != friendsListAsLongs[k24])
  10936. continue;
  10937. if(friendsNodeIDs[k24] != i18)
  10938. {
  10939. friendsNodeIDs[k24] = i18;
  10940. needDrawTabArea = true;
  10941. if(i18 > 0)
  10942. pushMessage(s7 + " has logged in.", 5, "");
  10943. if(i18 == 0)
  10944. pushMessage(s7 + " has logged out.", 5, "");
  10945. }
  10946. s7 = null;
  10947. break;
  10948. }
  10949.  
  10950. if(s7 != null && friendsCount < 200)
  10951. {
  10952. friendsListAsLongs[friendsCount] = l4;
  10953. friendsList[friendsCount] = s7;
  10954. friendsNodeIDs[friendsCount] = i18;
  10955. friendsCount++;
  10956. needDrawTabArea = true;
  10957. }
  10958. for(boolean flag6 = false; !flag6;)
  10959. {
  10960. flag6 = true;
  10961. for(int k29 = 0; k29 < friendsCount - 1; k29++)
  10962. if(friendsNodeIDs[k29] != nodeID && friendsNodeIDs[k29 + 1] == nodeID || friendsNodeIDs[k29] == 0 && friendsNodeIDs[k29 + 1] != 0)
  10963. {
  10964. int j31 = friendsNodeIDs[k29];
  10965. friendsNodeIDs[k29] = friendsNodeIDs[k29 + 1];
  10966. friendsNodeIDs[k29 + 1] = j31;
  10967. String s10 = friendsList[k29];
  10968. friendsList[k29] = friendsList[k29 + 1];
  10969. friendsList[k29 + 1] = s10;
  10970. long l32 = friendsListAsLongs[k29];
  10971. friendsListAsLongs[k29] = friendsListAsLongs[k29 + 1];
  10972. friendsListAsLongs[k29 + 1] = l32;
  10973. needDrawTabArea = true;
  10974. flag6 = false;
  10975. }
  10976.  
  10977. }
  10978.  
  10979. pktType = -1;
  10980. return true;
  10981. }
  10982. if(pktType == 110)
  10983. {
  10984. if(tabID == 12)
  10985. needDrawTabArea = true;
  10986. energy = inStream.readUnsignedByte();
  10987. pktType = -1;
  10988. return true;
  10989. }
  10990. if(pktType == 254)
  10991. {
  10992. anInt855 = inStream.readUnsignedByte();
  10993. if(anInt855 == 1)
  10994. anInt1222 = inStream.readUnsignedWord();
  10995. if(anInt855 >= 2 && anInt855 <= 6)
  10996. {
  10997. if(anInt855 == 2)
  10998. {
  10999. anInt937 = 64;
  11000. anInt938 = 64;
  11001. }
  11002. if(anInt855 == 3)
  11003. {
  11004. anInt937 = 0;
  11005. anInt938 = 64;
  11006. }
  11007. if(anInt855 == 4)
  11008. {
  11009. anInt937 = 128;
  11010. anInt938 = 64;
  11011. }
  11012. if(anInt855 == 5)
  11013. {
  11014. anInt937 = 64;
  11015. anInt938 = 0;
  11016. }
  11017. if(anInt855 == 6)
  11018. {
  11019. anInt937 = 64;
  11020. anInt938 = 128;
  11021. }
  11022. anInt855 = 2;
  11023. anInt934 = inStream.readUnsignedWord();
  11024. anInt935 = inStream.readUnsignedWord();
  11025. anInt936 = inStream.readUnsignedByte();
  11026. }
  11027. if(anInt855 == 10)
  11028. anInt933 = inStream.readUnsignedWord();
  11029. pktType = -1;
  11030. return true;
  11031. }
  11032. if(pktType == 248)
  11033. {
  11034. int i5 = inStream.method435();
  11035. int k12 = inStream.readUnsignedWord();
  11036. if(backDialogID != -1)
  11037. {
  11038. backDialogID = -1;
  11039. inputTaken = true;
  11040. }
  11041. if(inputDialogState != 0)
  11042. {
  11043. inputDialogState = 0;
  11044. inputTaken = true;
  11045. }
  11046. openInterfaceID = i5;
  11047. invOverlayInterfaceID = k12;
  11048. needDrawTabArea = true;
  11049. tabAreaAltered = true;
  11050. aBoolean1149 = false;
  11051. pktType = -1;
  11052. return true;
  11053. }
  11054. if(pktType == 79)
  11055. {
  11056. int j5 = inStream.method434();
  11057. int l12 = inStream.method435();
  11058. RSInterface class9_3 = RSInterface.interfaceCache[j5];
  11059. if(class9_3 != null && class9_3.type == 0)
  11060. {
  11061. if(l12 < 0)
  11062. l12 = 0;
  11063. if(l12 > class9_3.scrollMax - class9_3.height)
  11064. l12 = class9_3.scrollMax - class9_3.height;
  11065. class9_3.scrollPosition = l12;
  11066. }
  11067. pktType = -1;
  11068. return true;
  11069. }
  11070. if(pktType == 68)
  11071. {
  11072. for(int k5 = 0; k5 < variousSettings.length; k5++)
  11073. if(variousSettings[k5] != anIntArray1045[k5])
  11074. {
  11075. variousSettings[k5] = anIntArray1045[k5];
  11076. method33(k5);
  11077. needDrawTabArea = true;
  11078. }
  11079.  
  11080. pktType = -1;
  11081. return true;
  11082. }
  11083. if(pktType == 196)
  11084. {
  11085. long l5 = inStream.readQWord();
  11086. int j18 = inStream.readInt();
  11087. int l21 = inStream.readUnsignedByte();
  11088. boolean flag5 = false;
  11089. for(int i28 = 0; i28 < 100; i28++)
  11090. {
  11091. if(anIntArray1240[i28] != j18)
  11092. continue;
  11093. flag5 = true;
  11094. break;
  11095. }
  11096.  
  11097. if(l21 <= 1)
  11098. {
  11099. for(int l29 = 0; l29 < ignoreCount; l29++)
  11100. {
  11101. if(ignoreListAsLongs[l29] != l5)
  11102. continue;
  11103. flag5 = true;
  11104. break;
  11105. }
  11106.  
  11107. }
  11108. if(!flag5 && anInt1251 == 0)
  11109. try
  11110. {
  11111. anIntArray1240[anInt1169] = j18;
  11112. anInt1169 = (anInt1169 + 1) % 100;
  11113. String s9 = TextInput.method525(pktSize - 13, inStream);
  11114. if(l21 != 3)
  11115. s9 = Censor.doCensor(s9);
  11116. if(l21 == 2 || l21 == 3)
  11117. pushMessage(s9, 7, "@cr2@" + TextClass.fixName(TextClass.nameForLong(l5)));
  11118. else
  11119. if(l21 == 1)
  11120. pushMessage(s9, 7, "@cr1@" + TextClass.fixName(TextClass.nameForLong(l5)));
  11121. else
  11122. pushMessage(s9, 3, TextClass.fixName(TextClass.nameForLong(l5)));
  11123. }
  11124. catch(Exception exception1)
  11125. {
  11126. signlink.reporterror("cde1");
  11127. }
  11128. pktType = -1;
  11129. return true;
  11130. }
  11131. if(pktType == 85)
  11132. {
  11133. anInt1269 = inStream.method427();
  11134. anInt1268 = inStream.method427();
  11135. pktType = -1;
  11136. return true;
  11137. }
  11138. if(pktType == 24)
  11139. {
  11140. anInt1054 = inStream.method428();
  11141. if(anInt1054 == tabID)
  11142. {
  11143. if(anInt1054 == 3)
  11144. tabID = 1;
  11145. else
  11146. tabID = 3;
  11147. needDrawTabArea = true;
  11148. }
  11149. pktType = -1;
  11150. return true;
  11151. }
  11152. if(pktType == 246)
  11153. {
  11154. int i6 = inStream.method434();
  11155. int i13 = inStream.readUnsignedWord();
  11156. int k18 = inStream.readUnsignedWord();
  11157. if(k18 == 65535)
  11158. {
  11159. RSInterface.interfaceCache[i6].anInt233 = 0;
  11160. pktType = -1;
  11161. return true;
  11162. } else
  11163. {
  11164. ItemDef itemDef = ItemDef.forID(k18);
  11165. RSInterface.interfaceCache[i6].anInt233 = 4;
  11166. RSInterface.interfaceCache[i6].mediaID = k18;
  11167. RSInterface.interfaceCache[i6].anInt270 = itemDef.modelRotation1;
  11168. RSInterface.interfaceCache[i6].anInt271 = itemDef.modelRotation2;
  11169. RSInterface.interfaceCache[i6].anInt269 = (itemDef.modelZoom * 100) / i13;
  11170. pktType = -1;
  11171. return true;
  11172. }
  11173. }
  11174. if(pktType == 171)
  11175. {
  11176. boolean flag1 = inStream.readUnsignedByte() == 1;
  11177. int j13 = inStream.readUnsignedWord();
  11178. RSInterface.interfaceCache[j13].aBoolean266 = flag1;
  11179. pktType = -1;
  11180. return true;
  11181. }
  11182. if(pktType == 142)
  11183. {
  11184. int j6 = inStream.method434();
  11185. method60(j6);
  11186. if(backDialogID != -1)
  11187. {
  11188. backDialogID = -1;
  11189. inputTaken = true;
  11190. }
  11191. if(inputDialogState != 0)
  11192. {
  11193. inputDialogState = 0;
  11194. inputTaken = true;
  11195. }
  11196. invOverlayInterfaceID = j6;
  11197. needDrawTabArea = true;
  11198. tabAreaAltered = true;
  11199. openInterfaceID = -1;
  11200. aBoolean1149 = false;
  11201. pktType = -1;
  11202. return true;
  11203. }
  11204. if(pktType == 126)
  11205. {
  11206. String s1 = inStream.readString();
  11207. int k13 = inStream.method435();
  11208. RSInterface.interfaceCache[k13].message = s1;
  11209. if(RSInterface.interfaceCache[k13].parentID == tabInterfaceIDs[tabID])
  11210. needDrawTabArea = true;
  11211. pktType = -1;
  11212. return true;
  11213. }
  11214. if(pktType == 206)
  11215. {
  11216. publicChatMode = inStream.readUnsignedByte();
  11217. privateChatMode = inStream.readUnsignedByte();
  11218. tradeMode = inStream.readUnsignedByte();
  11219. aBoolean1233 = true;
  11220. inputTaken = true;
  11221. pktType = -1;
  11222. return true;
  11223. }
  11224. if(pktType == 240)
  11225. {
  11226. if(tabID == 12)
  11227. needDrawTabArea = true;
  11228. weight = inStream.readSignedWord();
  11229. pktType = -1;
  11230. return true;
  11231. }
  11232. if(pktType == 8)
  11233. {
  11234. int k6 = inStream.method436();
  11235. int l13 = inStream.readUnsignedWord();
  11236. RSInterface.interfaceCache[k6].anInt233 = 1;
  11237. RSInterface.interfaceCache[k6].mediaID = l13;
  11238. pktType = -1;
  11239. return true;
  11240. }
  11241. if(pktType == 122)
  11242. {
  11243. int l6 = inStream.method436();
  11244. int i14 = inStream.method436();
  11245. int i19 = i14 >> 10 & 0x1f;
  11246. int i22 = i14 >> 5 & 0x1f;
  11247. int l24 = i14 & 0x1f;
  11248. RSInterface.interfaceCache[l6].textColor = (i19 << 19) + (i22 << 11) + (l24 << 3);
  11249. pktType = -1;
  11250. return true;
  11251. }
  11252. if(pktType == 53)
  11253. {
  11254. needDrawTabArea = true;
  11255. int i7 = inStream.readUnsignedWord();
  11256. RSInterface class9_1 = RSInterface.interfaceCache[i7];
  11257. int j19 = inStream.readUnsignedWord();
  11258. for(int j22 = 0; j22 < j19; j22++)
  11259. {
  11260. int i25 = inStream.readUnsignedByte();
  11261. if(i25 == 255)
  11262. i25 = inStream.method440();
  11263. class9_1.inv[j22] = inStream.method436();
  11264. class9_1.invStackSizes[j22] = i25;
  11265. }
  11266.  
  11267. for(int j25 = j19; j25 < class9_1.inv.length; j25++)
  11268. {
  11269. class9_1.inv[j25] = 0;
  11270. class9_1.invStackSizes[j25] = 0;
  11271. }
  11272.  
  11273. pktType = -1;
  11274. return true;
  11275. }
  11276. if(pktType == 230)
  11277. {
  11278. int j7 = inStream.method435();
  11279. int j14 = inStream.readUnsignedWord();
  11280. int k19 = inStream.readUnsignedWord();
  11281. int k22 = inStream.method436();
  11282. RSInterface.interfaceCache[j14].anInt270 = k19;
  11283. RSInterface.interfaceCache[j14].anInt271 = k22;
  11284. RSInterface.interfaceCache[j14].anInt269 = j7;
  11285. pktType = -1;
  11286. return true;
  11287. }
  11288. if(pktType == 221)
  11289. {
  11290. anInt900 = inStream.readUnsignedByte();
  11291. needDrawTabArea = true;
  11292. pktType = -1;
  11293. return true;
  11294. }
  11295. if(pktType == 177)
  11296. {
  11297. aBoolean1160 = true;
  11298. anInt995 = inStream.readUnsignedByte();
  11299. anInt996 = inStream.readUnsignedByte();
  11300. anInt997 = inStream.readUnsignedWord();
  11301. anInt998 = inStream.readUnsignedByte();
  11302. anInt999 = inStream.readUnsignedByte();
  11303. if(anInt999 >= 100)
  11304. {
  11305. int k7 = anInt995 * 128 + 64;
  11306. int k14 = anInt996 * 128 + 64;
  11307. int i20 = method42(plane, k14, k7) - anInt997;
  11308. int l22 = k7 - xCameraPos;
  11309. int k25 = i20 - zCameraPos;
  11310. int j28 = k14 - yCameraPos;
  11311. int i30 = (int)Math.sqrt(l22 * l22 + j28 * j28);
  11312. yCameraCurve = (int)(Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  11313. xCameraCurve = (int)(Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  11314. if(yCameraCurve < 128)
  11315. yCameraCurve = 128;
  11316. if(yCameraCurve > 383)
  11317. yCameraCurve = 383;
  11318. }
  11319. pktType = -1;
  11320. return true;
  11321. }
  11322. if(pktType == 249)
  11323. {
  11324. anInt1046 = inStream.method426();
  11325. unknownInt10 = inStream.method436();
  11326. pktType = -1;
  11327. return true;
  11328. }
  11329. if(pktType == 65)
  11330. {
  11331. updateNPCs(inStream, pktSize);
  11332. pktType = -1;
  11333. return true;
  11334. }
  11335. if(pktType == 27)
  11336. {
  11337. messagePromptRaised = false;
  11338. inputDialogState = 1;
  11339. amountOrNameInput = "";
  11340. inputTaken = true;
  11341. pktType = -1;
  11342. return true;
  11343. }
  11344. if(pktType == 187)
  11345. {
  11346. messagePromptRaised = false;
  11347. inputDialogState = 2;
  11348. amountOrNameInput = "";
  11349. inputTaken = true;
  11350. pktType = -1;
  11351. return true;
  11352. }
  11353. if(pktType == 97)
  11354. {
  11355. int l7 = inStream.readUnsignedWord();
  11356. method60(l7);
  11357. if(invOverlayInterfaceID != -1)
  11358. {
  11359. invOverlayInterfaceID = -1;
  11360. needDrawTabArea = true;
  11361. tabAreaAltered = true;
  11362. }
  11363. if(backDialogID != -1)
  11364. {
  11365. backDialogID = -1;
  11366. inputTaken = true;
  11367. }
  11368. if(inputDialogState != 0)
  11369. {
  11370. inputDialogState = 0;
  11371. inputTaken = true;
  11372. }
  11373. openInterfaceID = l7;
  11374. aBoolean1149 = false;
  11375. pktType = -1;
  11376. return true;
  11377. }
  11378. if(pktType == 218)
  11379. {
  11380. int i8 = inStream.method438();
  11381. dialogID = i8;
  11382. inputTaken = true;
  11383. pktType = -1;
  11384. return true;
  11385. }
  11386. if(pktType == 87)
  11387. {
  11388. int j8 = inStream.method434();
  11389. int l14 = inStream.method439();
  11390. anIntArray1045[j8] = l14;
  11391. if(variousSettings[j8] != l14)
  11392. {
  11393. variousSettings[j8] = l14;
  11394. method33(j8);
  11395. needDrawTabArea = true;
  11396. if(dialogID != -1)
  11397. inputTaken = true;
  11398. }
  11399. pktType = -1;
  11400. return true;
  11401. }
  11402. if(pktType == 36)
  11403. {
  11404. int k8 = inStream.method434();
  11405. byte byte0 = inStream.readSignedByte();
  11406. anIntArray1045[k8] = byte0;
  11407. if(variousSettings[k8] != byte0)
  11408. {
  11409. variousSettings[k8] = byte0;
  11410. method33(k8);
  11411. needDrawTabArea = true;
  11412. if(dialogID != -1)
  11413. inputTaken = true;
  11414. }
  11415. pktType = -1;
  11416. return true;
  11417. }
  11418. if(pktType == 61)
  11419. {
  11420. anInt1055 = inStream.readUnsignedByte();
  11421. pktType = -1;
  11422. return true;
  11423. }
  11424. if(pktType == 200)
  11425. {
  11426. int l8 = inStream.readUnsignedWord();
  11427. int i15 = inStream.readSignedWord();
  11428. RSInterface class9_4 = RSInterface.interfaceCache[l8];
  11429. class9_4.anInt257 = i15;
  11430. if(i15 == -1)
  11431. {
  11432. class9_4.anInt246 = 0;
  11433. class9_4.anInt208 = 0;
  11434. }
  11435. pktType = -1;
  11436. return true;
  11437. }
  11438. if(pktType == 219)
  11439. {
  11440. if(invOverlayInterfaceID != -1)
  11441. {
  11442. invOverlayInterfaceID = -1;
  11443. needDrawTabArea = true;
  11444. tabAreaAltered = true;
  11445. }
  11446. if(backDialogID != -1)
  11447. {
  11448. backDialogID = -1;
  11449. inputTaken = true;
  11450. }
  11451. if(inputDialogState != 0)
  11452. {
  11453. inputDialogState = 0;
  11454. inputTaken = true;
  11455. }
  11456. openInterfaceID = -1;
  11457. aBoolean1149 = false;
  11458. pktType = -1;
  11459. return true;
  11460. }
  11461. if(pktType == 34)
  11462. {
  11463. needDrawTabArea = true;
  11464. int i9 = inStream.readUnsignedWord();
  11465. RSInterface class9_2 = RSInterface.interfaceCache[i9];
  11466. while(inStream.currentOffset < pktSize)
  11467. {
  11468. int j20 = inStream.method422();
  11469. int i23 = inStream.readUnsignedWord();
  11470. int l25 = inStream.readUnsignedByte();
  11471. if(l25 == 255)
  11472. l25 = inStream.readInt();
  11473. if(j20 >= 0 && j20 < class9_2.inv.length)
  11474. {
  11475. class9_2.inv[j20] = i23;
  11476. class9_2.invStackSizes[j20] = l25;
  11477. }
  11478. }
  11479. pktType = -1;
  11480. return true;
  11481. }
  11482. if(pktType == 105 || pktType == 84 || pktType == 147 || pktType == 215 || pktType == 4 || pktType == 117 || pktType == 156 || pktType == 44 || pktType == 160 || pktType == 101 || pktType == 151)
  11483. {
  11484. method137(inStream, pktType);
  11485. pktType = -1;
  11486. return true;
  11487. }
  11488. if(pktType == 106)
  11489. {
  11490. tabID = inStream.method427();
  11491. needDrawTabArea = true;
  11492. tabAreaAltered = true;
  11493. pktType = -1;
  11494. return true;
  11495. }
  11496. if(pktType == 164)
  11497. {
  11498. int j9 = inStream.method434();
  11499. method60(j9);
  11500. if(invOverlayInterfaceID != -1)
  11501. {
  11502. invOverlayInterfaceID = -1;
  11503. needDrawTabArea = true;
  11504. tabAreaAltered = true;
  11505. }
  11506. backDialogID = j9;
  11507. inputTaken = true;
  11508. openInterfaceID = -1;
  11509. aBoolean1149 = false;
  11510. pktType = -1;
  11511. return true;
  11512. }
  11513. signlink.reporterror("T1 - " + pktType + "," + pktSize + " - " + anInt842 + "," + anInt843);
  11514. resetLogout();
  11515. }
  11516. catch(IOException _ex)
  11517. {
  11518. dropClient();
  11519. }
  11520. catch(Exception exception)
  11521. {
  11522. String s2 = "T2 - " + pktType + "," + anInt842 + "," + anInt843 + " - " + pktSize + "," + (baseX + myPlayer.smallX[0]) + "," + (baseY + myPlayer.smallY[0]) + " - ";
  11523. for(int j15 = 0; j15 < pktSize && j15 < 50; j15++)
  11524. s2 = s2 + inStream.buffer[j15] + ",";
  11525.  
  11526. signlink.reporterror(s2);
  11527. resetLogout();
  11528. }
  11529. return true;
  11530. }
  11531.  
  11532. private void method146()
  11533. {
  11534. anInt1265++;
  11535. method47(true);
  11536. method26(true);
  11537. method47(false);
  11538. method26(false);
  11539. method55();
  11540. method104();
  11541. if(!aBoolean1160)
  11542. {
  11543. int i = anInt1184;
  11544. if(anInt984 / 256 > i)
  11545. i = anInt984 / 256;
  11546. if(aBooleanArray876[4] && anIntArray1203[4] + 128 > i)
  11547. i = anIntArray1203[4] + 128;
  11548. int k = minimapInt1 + anInt896 & 0x7ff;
  11549. setCameraPos(600 + i * 3, i, anInt1014, method42(plane, myPlayer.y, myPlayer.x) - 50, k, anInt1015);
  11550. }
  11551. int j;
  11552. if(!aBoolean1160)
  11553. j = method120();
  11554. else
  11555. j = method121();
  11556. int l = xCameraPos;
  11557. int i1 = zCameraPos;
  11558. int j1 = yCameraPos;
  11559. int k1 = yCameraCurve;
  11560. int l1 = xCameraCurve;
  11561. for(int i2 = 0; i2 < 5; i2++)
  11562. if(aBooleanArray876[i2])
  11563. {
  11564. 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]);
  11565. if(i2 == 0)
  11566. xCameraPos += j2;
  11567. if(i2 == 1)
  11568. zCameraPos += j2;
  11569. if(i2 == 2)
  11570. yCameraPos += j2;
  11571. if(i2 == 3)
  11572. xCameraCurve = xCameraCurve + j2 & 0x7ff;
  11573. if(i2 == 4)
  11574. {
  11575. yCameraCurve += j2;
  11576. if(yCameraCurve < 128)
  11577. yCameraCurve = 128;
  11578. if(yCameraCurve > 383)
  11579. yCameraCurve = 383;
  11580. }
  11581. }
  11582.  
  11583. int k2 = Texture.anInt1481;
  11584. Model.aBoolean1684 = true;
  11585. Model.anInt1687 = 0;
  11586. Model.anInt1685 = super.mouseX - 4;
  11587. Model.anInt1686 = super.mouseY - 4;
  11588. DrawingArea.setAllPixelsToZero();
  11589. //xxx disables graphics if(graphicsEnabled){
  11590. worldController.method313(xCameraPos, yCameraPos, xCameraCurve, zCameraPos, j, yCameraCurve);
  11591. worldController.clearObj5Cache();
  11592. updateEntities();
  11593. drawHeadIcon();
  11594. method37(k2);
  11595. draw3dScreen();
  11596. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  11597. xCameraPos = l;
  11598. zCameraPos = i1;
  11599. yCameraPos = j1;
  11600. yCameraCurve = k1;
  11601. xCameraCurve = l1;
  11602. // }
  11603. }
  11604.  
  11605. private void clearTopInterfaces()
  11606. {
  11607. stream.sendPacket(130);
  11608. if(invOverlayInterfaceID != -1)
  11609. {
  11610. invOverlayInterfaceID = -1;
  11611. needDrawTabArea = true;
  11612. aBoolean1149 = false;
  11613. tabAreaAltered = true;
  11614. }
  11615. if(backDialogID != -1)
  11616. {
  11617. backDialogID = -1;
  11618. inputTaken = true;
  11619. aBoolean1149 = false;
  11620. }
  11621. openInterfaceID = -1;
  11622. }
  11623.  
  11624. private client()
  11625. {
  11626. anIntArrayArray825 = new int[104][104];
  11627. friendsNodeIDs = new int[200];
  11628. groundArray = new NodeList[4][104][104];
  11629. aBoolean831 = false;
  11630. aStream_834 = new Stream(new byte[5000]);
  11631. npcArray = new NPC[16384];
  11632. npcIndices = new int[16384];
  11633. anIntArray840 = new int[1000];
  11634. aStream_847 = Stream.create();
  11635. aBoolean848 = true;
  11636. openInterfaceID = -1;
  11637. currentExp = new int[Skills.skillsCount];
  11638. aBoolean872 = false;
  11639. anIntArray873 = new int[5];
  11640. anInt874 = -1;
  11641. aBooleanArray876 = new boolean[5];
  11642. drawFlames = false;
  11643. reportAbuseInput = "";
  11644. unknownInt10 = -1;
  11645. menuOpen = false;
  11646. inputString = "";
  11647. maxPlayers = 2048;
  11648. myPlayerIndex = 2047;
  11649. playerArray = new Player[maxPlayers];
  11650. playerIndices = new int[maxPlayers];
  11651. anIntArray894 = new int[maxPlayers];
  11652. aStreamArray895s = new Stream[maxPlayers];
  11653. anInt897 = 1;
  11654. anIntArrayArray901 = new int[104][104];
  11655. anInt902 = 0x766654;
  11656. aByteArray912 = new byte[16384];
  11657. currentStats = new int[Skills.skillsCount];
  11658. ignoreListAsLongs = new long[100];
  11659. loadingError = false;
  11660. anInt927 = 0x332d25;
  11661. anIntArray928 = new int[5];
  11662. anIntArrayArray929 = new int[104][104];
  11663. chatTypes = new int[100];
  11664. chatNames = new String[100];
  11665. chatMessages = new String[100];
  11666. sideIcons = new Background[13];
  11667. aBoolean954 = true;
  11668. friendsListAsLongs = new long[200];
  11669. currentSong = -1;
  11670. drawingFlames = false;
  11671. spriteDrawX = -1;
  11672. spriteDrawY = -1;
  11673. anIntArray968 = new int[33];
  11674. anIntArray969 = new int[256];
  11675. decompressors = new Decompressor[5];
  11676. variousSettings = new int[2000];
  11677. aBoolean972 = false;
  11678. anInt975 = 50;
  11679. anIntArray976 = new int[anInt975];
  11680. anIntArray977 = new int[anInt975];
  11681. anIntArray978 = new int[anInt975];
  11682. anIntArray979 = new int[anInt975];
  11683. anIntArray980 = new int[anInt975];
  11684. anIntArray981 = new int[anInt975];
  11685. anIntArray982 = new int[anInt975];
  11686. aStringArray983 = new String[anInt975];
  11687. anInt985 = -1;
  11688. hitMarks = new Sprite[20];
  11689. anIntArray990 = new int[5];
  11690. aBoolean994 = false;
  11691. anInt1002 = 0x23201b;
  11692. amountOrNameInput = "";
  11693. aClass19_1013 = new NodeList();
  11694. aBoolean1017 = false;
  11695. anInt1018 = -1;
  11696. anIntArray1030 = new int[5];
  11697. aBoolean1031 = false;
  11698. mapFunctions = new Sprite[100];
  11699. dialogID = -1;
  11700. maxStats = new int[Skills.skillsCount];
  11701. anIntArray1045 = new int[2000];
  11702. aBoolean1047 = true;
  11703. anIntArray1052 = new int[151];
  11704. anInt1054 = -1;
  11705. aClass19_1056 = new NodeList();
  11706. anIntArray1057 = new int[33];
  11707. aClass9_1059 = new RSInterface();
  11708. mapScenes = new Background[100];
  11709. anInt1063 = 0x4d4233;
  11710. anIntArray1065 = new int[7];
  11711. anIntArray1072 = new int[1000];
  11712. anIntArray1073 = new int[1000];
  11713. aBoolean1080 = false;
  11714. friendsList = new String[200];
  11715. inStream = Stream.create();
  11716. expectedCRCs = new int[9];
  11717. menuActionCmd2 = new int[500];
  11718. menuActionCmd3 = new int[500];
  11719. menuActionID = new int[500];
  11720. menuActionCmd1 = new int[500];
  11721. headIcons = new Sprite[20];
  11722. tabAreaAltered = false;
  11723. aString1121 = "";
  11724. atPlayerActions = new String[5];
  11725. atPlayerArray = new boolean[5];
  11726. anIntArrayArrayArray1129 = new int[4][13][13];
  11727. anInt1132 = 2;
  11728. aClass30_Sub2_Sub1_Sub1Array1140 = new Sprite[1000];
  11729. aBoolean1141 = false;
  11730. aBoolean1149 = false;
  11731. crosses = new Sprite[8];
  11732. musicEnabled = true;
  11733. needDrawTabArea = false;
  11734. loggedIn = false;
  11735. canMute = false;
  11736. aBoolean1159 = false;
  11737. aBoolean1160 = false;
  11738. anInt1171 = 1;
  11739. myUsername = "Luke";
  11740. myPassword = "bob";
  11741. genericLoadingError = false;
  11742. reportAbuseInterfaceID = -1;
  11743. aClass19_1179 = new NodeList();
  11744. anInt1184 = 128;
  11745. invOverlayInterfaceID = -1;
  11746. stream = Stream.create();
  11747. menuActionName = new String[500];
  11748. anIntArray1203 = new int[5];
  11749. anIntArray1207 = new int[50];
  11750. anInt1210 = 2;
  11751. anInt1211 = 78;
  11752. promptInput = "";
  11753. modIcons = new Background[2];
  11754. tabID = 3;
  11755. inputTaken = false;
  11756. songChanging = true;
  11757. anIntArray1229 = new int[151];
  11758. aClass11Array1230 = new Class11[4];
  11759. aBoolean1233 = false;
  11760. anIntArray1240 = new int[100];
  11761. anIntArray1241 = new int[50];
  11762. aBoolean1242 = false;
  11763. anIntArray1250 = new int[50];
  11764. rsAlreadyLoaded = false;
  11765. welcomeScreenRaised = false;
  11766. messagePromptRaised = false;
  11767. loginMessage1 = "";
  11768. loginMessage2 = "";
  11769. backDialogID = -1;
  11770. anInt1279 = 2;
  11771. bigX = new int[4000];
  11772. bigY = new int[4000];
  11773. anInt1289 = -1;
  11774. }
  11775.  
  11776. private int ignoreCount;
  11777. private long aLong824;
  11778. private int[][] anIntArrayArray825;
  11779. private int[] friendsNodeIDs;
  11780. private NodeList[][][] groundArray;
  11781. private int[] anIntArray828;
  11782. private int[] anIntArray829;
  11783. private volatile boolean aBoolean831;
  11784. private Socket aSocket832;
  11785. private int loginScreenState;
  11786. private Stream aStream_834;
  11787. private NPC[] npcArray;
  11788. private int npcCount;
  11789. private int[] npcIndices;
  11790. private int anInt839;
  11791. private int[] anIntArray840;
  11792. private int anInt841;
  11793. private int anInt842;
  11794. private int anInt843;
  11795. private String aString844;
  11796. private int privateChatMode;
  11797. private Stream aStream_847;
  11798. private boolean aBoolean848;
  11799. private static int anInt849;
  11800. private int[] anIntArray850;
  11801. private int[] anIntArray851;
  11802. private int[] anIntArray852;
  11803. private int[] anIntArray853;
  11804. private static int anInt854;
  11805. private int anInt855;
  11806. private int openInterfaceID;
  11807. private int xCameraPos;
  11808. private int zCameraPos;
  11809. private int yCameraPos;
  11810. private int yCameraCurve;
  11811. private int xCameraCurve;
  11812. private int myPrivilege;
  11813. private final int[] currentExp;
  11814. private Background redStone1_3;
  11815. private Background redStone2_3;
  11816. private Background redStone3_2;
  11817. private Background redStone1_4;
  11818. private Background redStone2_4;
  11819. private Sprite mapFlag;
  11820. private Sprite mapMarker;
  11821. private boolean aBoolean872;
  11822. private final int[] anIntArray873;
  11823. private int anInt874;
  11824. private final boolean[] aBooleanArray876;
  11825. private int weight;
  11826. private MouseDetection mouseDetection;
  11827. private volatile boolean drawFlames;
  11828. private String reportAbuseInput;
  11829. private int unknownInt10;
  11830. private boolean menuOpen;
  11831. private int anInt886;
  11832. private String inputString;
  11833. private final int maxPlayers;
  11834. private final int myPlayerIndex;
  11835. private Player[] playerArray;
  11836. private int playerCount;
  11837. private int[] playerIndices;
  11838. private int anInt893;
  11839. private int[] anIntArray894;
  11840. private Stream[] aStreamArray895s;
  11841. private int anInt896;
  11842. private int anInt897;
  11843. private int friendsCount;
  11844. private int anInt900;
  11845. private int[][] anIntArrayArray901;
  11846. private final int anInt902;
  11847. private RSImageProducer backLeftIP1;
  11848. private RSImageProducer backLeftIP2;
  11849. private RSImageProducer backRightIP1;
  11850. private RSImageProducer backRightIP2;
  11851. private RSImageProducer backTopIP1;
  11852. private RSImageProducer backVmidIP1;
  11853. private RSImageProducer backVmidIP2;
  11854. private RSImageProducer backVmidIP3;
  11855. private RSImageProducer backVmidIP2_2;
  11856. private byte[] aByteArray912;
  11857. private int anInt913;
  11858. private int crossX;
  11859. private int crossY;
  11860. private int crossIndex;
  11861. private int crossType;
  11862. private int plane;
  11863. private final int[] currentStats;
  11864. private static int anInt924;
  11865. private final long[] ignoreListAsLongs;
  11866. private boolean loadingError;
  11867. private final int anInt927;
  11868. private final int[] anIntArray928;
  11869. private int[][] anIntArrayArray929;
  11870. private Sprite aClass30_Sub2_Sub1_Sub1_931;
  11871. private Sprite aClass30_Sub2_Sub1_Sub1_932;
  11872. private int anInt933;
  11873. private int anInt934;
  11874. private int anInt935;
  11875. private int anInt936;
  11876. private int anInt937;
  11877. private int anInt938;
  11878. private static int anInt940;
  11879. private final int[] chatTypes;
  11880. private final String[] chatNames;
  11881. private final String[] chatMessages;
  11882. private int anInt945;
  11883. private WorldController worldController;
  11884. private Background[] sideIcons;
  11885. private int menuScreenArea;
  11886. private int menuOffsetX;
  11887. private int menuOffsetY;
  11888. private int menuWidth;
  11889. private int anInt952;
  11890. private long aLong953;
  11891. private boolean aBoolean954;
  11892. private long[] friendsListAsLongs;
  11893. private int currentSong;
  11894. private static int nodeID = 10;
  11895. static int portOff;
  11896. private static boolean isMembers = true;
  11897. private static boolean lowMem;
  11898. private volatile boolean drawingFlames;
  11899. private int spriteDrawX;
  11900. private int spriteDrawY;
  11901. private final int[] anIntArray965 = {
  11902. 0xffff00, 0xff0000, 65280, 65535, 0xff00ff, 0xffffff
  11903. };
  11904. private Background aBackground_966;
  11905. private Background aBackground_967;
  11906. private final int[] anIntArray968;
  11907. private final int[] anIntArray969;
  11908. final Decompressor[] decompressors;
  11909. public int variousSettings[];
  11910. private boolean aBoolean972;
  11911. private final int anInt975;
  11912. private final int[] anIntArray976;
  11913. private final int[] anIntArray977;
  11914. private final int[] anIntArray978;
  11915. private final int[] anIntArray979;
  11916. private final int[] anIntArray980;
  11917. private final int[] anIntArray981;
  11918. private final int[] anIntArray982;
  11919. private final String[] aStringArray983;
  11920. private int anInt984;
  11921. private int anInt985;
  11922. private static int anInt986;
  11923. private Sprite[] hitMarks;
  11924. private int anInt988;
  11925. private int anInt989;
  11926. private final int[] anIntArray990;
  11927. private static boolean aBoolean993;
  11928. private final boolean aBoolean994;
  11929. private int anInt995;
  11930. private int anInt996;
  11931. private int anInt997;
  11932. private int anInt998;
  11933. private int anInt999;
  11934. private ISAACRandomGen encryption;
  11935. private Sprite mapEdge;
  11936. private final int anInt1002;
  11937. static final int[][] anIntArrayArray1003 = {
  11938. {
  11939. 6798, 107, 10283, 16, 4797, 7744, 5799, 4634, 33697, 22433,
  11940. 2983, 54193
  11941. }, {
  11942. 8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153,
  11943. 56621, 4783, 1341, 16578, 35003, 25239
  11944. }, {
  11945. 25238, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094,
  11946. 10153, 56621, 4783, 1341, 16578, 35003
  11947. }, {
  11948. 4626, 11146, 6439, 12, 4758, 10270
  11949. }, {
  11950. 4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574
  11951. }
  11952. };
  11953. private String amountOrNameInput;
  11954. private static int anInt1005;
  11955. private int daysSinceLastLogin;
  11956. private int pktSize;
  11957. private int pktType;
  11958. private int anInt1009;
  11959. private int anInt1010;
  11960. private int anInt1011;
  11961. private NodeList aClass19_1013;
  11962. private int anInt1014;
  11963. private int anInt1015;
  11964. private int anInt1016;
  11965. private boolean aBoolean1017;
  11966. private int anInt1018;
  11967. private static final int[] anIntArray1019;
  11968. private int anInt1021;
  11969. private int anInt1022;
  11970. private int loadingStage;
  11971. private Background scrollBar1;
  11972. private Background scrollBar2;
  11973. private int anInt1026;
  11974. private Background backBase1;
  11975. private Background backBase2;
  11976. private Background backHmid1;
  11977. private final int[] anIntArray1030;
  11978. private boolean aBoolean1031;
  11979. private Sprite[] mapFunctions;
  11980. private int baseX;
  11981. private int baseY;
  11982. private int anInt1036;
  11983. private int anInt1037;
  11984. private int loginFailures;
  11985. private int anInt1039;
  11986. private int anInt1040;
  11987. private int anInt1041;
  11988. private int dialogID;
  11989. private final int[] maxStats;
  11990. private final int[] anIntArray1045;
  11991. private int anInt1046;
  11992. private boolean aBoolean1047;
  11993. private int anInt1048;
  11994. private String aString1049;
  11995. private static int anInt1051;
  11996. private final int[] anIntArray1052;
  11997. private StreamLoader titleStreamLoader;
  11998. private int anInt1054;
  11999. private int anInt1055;
  12000. private NodeList aClass19_1056;
  12001. private final int[] anIntArray1057;
  12002. private final RSInterface aClass9_1059;
  12003. private Background[] mapScenes;
  12004. private static int anInt1061;
  12005. private int anInt1062;
  12006. private final int anInt1063;
  12007. private int friendsListAction;
  12008. private final int[] anIntArray1065;
  12009. private int mouseInvInterfaceIndex;
  12010. private int lastActiveInvInterface;
  12011. private OnDemandFetcher onDemandFetcher;
  12012. private int anInt1069;
  12013. private int anInt1070;
  12014. private int anInt1071;
  12015. private int[] anIntArray1072;
  12016. private int[] anIntArray1073;
  12017. private Sprite mapDotItem;
  12018. private Sprite mapDotNPC;
  12019. private Sprite mapDotPlayer;
  12020. private Sprite mapDotFriend;
  12021. private Sprite mapDotTeam;
  12022. private int anInt1079;
  12023. private boolean aBoolean1080;
  12024. private String[] friendsList;
  12025. private Stream inStream;
  12026. private int anInt1084;
  12027. private int anInt1085;
  12028. private int activeInterfaceType;
  12029. private int anInt1087;
  12030. private int anInt1088;
  12031. private int anInt1089;
  12032. private final int[] expectedCRCs;
  12033. private int[] menuActionCmd2;
  12034. private int[] menuActionCmd3;
  12035. private int[] menuActionID;
  12036. private int[] menuActionCmd1;
  12037. private Sprite[] headIcons;
  12038. private static int anInt1097;
  12039. private int anInt1098;
  12040. private int anInt1099;
  12041. private int anInt1100;
  12042. private int anInt1101;
  12043. private int anInt1102;
  12044. private boolean tabAreaAltered;
  12045. private int anInt1104;
  12046. private RSImageProducer aRSImageProducer_1107;
  12047. private RSImageProducer aRSImageProducer_1108;
  12048. private RSImageProducer aRSImageProducer_1109;
  12049. private RSImageProducer aRSImageProducer_1110;
  12050. private RSImageProducer aRSImageProducer_1111;
  12051. private RSImageProducer aRSImageProducer_1112;
  12052. private RSImageProducer aRSImageProducer_1113;
  12053. private RSImageProducer aRSImageProducer_1114;
  12054. private RSImageProducer aRSImageProducer_1115;
  12055. private static int anInt1117;
  12056. private int membersInt;
  12057. private String aString1121;
  12058. private Sprite compass;
  12059. private RSImageProducer aRSImageProducer_1123;
  12060. private RSImageProducer aRSImageProducer_1124;
  12061. private RSImageProducer aRSImageProducer_1125;
  12062. public static Player myPlayer;
  12063. private final String[] atPlayerActions;
  12064. private final boolean[] atPlayerArray;
  12065. private final int[][][] anIntArrayArrayArray1129;
  12066. private final int[] tabInterfaceIDs = {
  12067. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  12068. -1, -1, -1, -1, -1
  12069. };
  12070. private int anInt1131;
  12071. private int anInt1132;
  12072. private int menuActionRow;
  12073. private static int anInt1134;
  12074. private int spellSelected;
  12075. private int anInt1137;
  12076. private int spellUsableOn;
  12077. private String spellTooltip;
  12078. private Sprite[] aClass30_Sub2_Sub1_Sub1Array1140;
  12079. private boolean aBoolean1141;
  12080. private static int anInt1142;
  12081. private Background redStone1;
  12082. private Background redStone2;
  12083. private Background redStone3;
  12084. private Background redStone1_2;
  12085. private Background redStone2_2;
  12086. private int energy;
  12087. private boolean aBoolean1149;
  12088. private Sprite[] crosses;
  12089. private boolean musicEnabled;
  12090. private Background[] aBackgroundArray1152s;
  12091. private boolean needDrawTabArea;
  12092. private int unreadMessages;
  12093. private static int anInt1155;
  12094. private static boolean fpsOn;
  12095. public boolean loggedIn;
  12096. private boolean canMute;
  12097. private boolean aBoolean1159;
  12098. private boolean aBoolean1160;
  12099. static int loopCycle;
  12100. private static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  12101. private RSImageProducer aRSImageProducer_1163;
  12102. private RSImageProducer aRSImageProducer_1164;
  12103. private RSImageProducer aRSImageProducer_1165;
  12104. private RSImageProducer aRSImageProducer_1166;
  12105. private int daysSinceRecovChange;
  12106. private RSSocket socketStream;
  12107. private int anInt1169;
  12108. private int minimapInt3;
  12109. private int anInt1171;
  12110. private long aLong1172;
  12111. private String myUsername;
  12112. private String myPassword;
  12113. private static int anInt1175;
  12114. private boolean genericLoadingError;
  12115. private final int[] anIntArray1177 = {
  12116. 0, 0, 0, 0, 1, 1, 1, 1, 1, 2,
  12117. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  12118. 2, 2, 3
  12119. };
  12120. private int reportAbuseInterfaceID;
  12121. private NodeList aClass19_1179;
  12122. private int[] anIntArray1180;
  12123. private int[] anIntArray1181;
  12124. private int[] anIntArray1182;
  12125. private byte[][] aByteArrayArray1183;
  12126. private int anInt1184;
  12127. private int minimapInt1;
  12128. private int anInt1186;
  12129. private int anInt1187;
  12130. private static int anInt1188;
  12131. private int invOverlayInterfaceID;
  12132. private int[] anIntArray1190;
  12133. private int[] anIntArray1191;
  12134. private Stream stream;
  12135. private int anInt1193;
  12136. private int splitPrivateChat;
  12137. private Background invBack;
  12138. private Background mapBack;
  12139. private Background chatBack;
  12140. private String[] menuActionName;
  12141. private Sprite aClass30_Sub2_Sub1_Sub1_1201;
  12142. private Sprite aClass30_Sub2_Sub1_Sub1_1202;
  12143. private final int[] anIntArray1203;
  12144. static final int[] anIntArray1204 = {
  12145. 9104, 10275, 7595, 3610, 7975, 8526, 918, 38802, 24466, 10145,
  12146. 58654, 5027, 1457, 16565, 34991, 25486
  12147. };
  12148. private static boolean flagged;
  12149. private final int[] anIntArray1207;
  12150. private int anInt1208;
  12151. private int minimapInt2;
  12152. private int anInt1210;
  12153. private int anInt1211;
  12154. private String promptInput;
  12155. private int anInt1213;
  12156. private int[][][] intGroundArray;
  12157. private long aLong1215;
  12158. private int loginScreenCursorPos;
  12159. private final Background[] modIcons;
  12160. private long aLong1220;
  12161. private int tabID;
  12162. private int anInt1222;
  12163. private boolean inputTaken;
  12164. private int inputDialogState;
  12165. private static int anInt1226;
  12166. private int nextSong;
  12167. private boolean songChanging;
  12168. private final int[] anIntArray1229;
  12169. private Class11[] aClass11Array1230;
  12170. public static int anIntArray1232[];
  12171. private boolean aBoolean1233;
  12172. private int[] anIntArray1234;
  12173. private int[] anIntArray1235;
  12174. private int[] anIntArray1236;
  12175. private int anInt1237;
  12176. private int anInt1238;
  12177. public final int anInt1239 = 100;
  12178. private final int[] anIntArray1240;
  12179. private final int[] anIntArray1241;
  12180. private boolean aBoolean1242;
  12181. private int atInventoryLoopCycle;
  12182. private int atInventoryInterface;
  12183. private int atInventoryIndex;
  12184. private int atInventoryInterfaceType;
  12185. private byte[][] aByteArrayArray1247;
  12186. private int tradeMode;
  12187. private int anInt1249;
  12188. private final int[] anIntArray1250;
  12189. private int anInt1251;
  12190. private final boolean rsAlreadyLoaded;
  12191. private int anInt1253;
  12192. private int anInt1254;
  12193. private boolean welcomeScreenRaised;
  12194. private boolean messagePromptRaised;
  12195. private int anInt1257;
  12196. private byte[][][] byteGroundArray;
  12197. private int prevSong;
  12198. private int destX;
  12199. private int destY;
  12200. private Sprite aClass30_Sub2_Sub1_Sub1_1263;
  12201. private int anInt1264;
  12202. private int anInt1265;
  12203. private String loginMessage1;
  12204. private String loginMessage2;
  12205. private int anInt1268;
  12206. private int anInt1269;
  12207. private TextDrawingArea aTextDrawingArea_1270;
  12208. private TextDrawingArea aTextDrawingArea_1271;
  12209. private TextDrawingArea chatTextDrawingArea;
  12210. private int anInt1275;
  12211. private int backDialogID;
  12212. private int anInt1278;
  12213. private int anInt1279;
  12214. private int[] bigX;
  12215. private int[] bigY;
  12216. private int itemSelected;
  12217. private int anInt1283;
  12218. private int anInt1284;
  12219. private int anInt1285;
  12220. private String selectedItemName;
  12221. private int publicChatMode;
  12222. private static int anInt1288;
  12223. private int anInt1289;
  12224. public static int anInt1290;
  12225.  
  12226. static
  12227. {
  12228. anIntArray1019 = new int[99];
  12229. int i = 0;
  12230. for(int j = 0; j < 99; j++)
  12231. {
  12232. int l = j + 1;
  12233. int i1 = (int)((double)l + 300D * Math.pow(2D, (double)l / 7D));
  12234. i += i1;
  12235. anIntArray1019[j] = i / 4;
  12236. }
  12237.  
  12238. anIntArray1232 = new int[32];
  12239. i = 2;
  12240. for(int k = 0; k < 32; k++)
  12241. {
  12242. anIntArray1232[k] = i - 1;
  12243. i += i;
  12244. }
  12245.  
  12246. }
  12247. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement