Guest User

asd

a guest
Nov 24th, 2015
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 357.25 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 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 boolean menuHasAddFriend(int j)
  36. {
  37. if(j < 0)
  38. return false;
  39. int k = menuActionID[j];
  40. if(k >= 2000)
  41. k -= 2000;
  42. return k == 337;
  43. }
  44.  
  45. public void drawChannelButtons() {
  46. String text[] = { "On", "Friends", "Off", "Hide" };
  47. int textColor[] = { 65280, 0xffff00, 0xff0000, 65535 };
  48. /* Draws main buttons sprite */
  49. chatButtons.drawSprite(5, 143);
  50. /* Button hovering */
  51. if(cButtonHPos == 7) {
  52. reportH.drawSprite(404, 143);
  53. }
  54. if(cButtonCPos == 0)
  55. chatButtonC.drawSprite(5, 143);
  56. else if(cButtonCPos == 1)
  57. chatButtonC.drawSprite(62, 143);
  58. else if(cButtonCPos == 2)
  59. chatButtonC.drawSprite(119, 143);
  60. else if(cButtonCPos == 3)
  61. chatButtonC.drawSprite(176, 143);
  62. else if(cButtonCPos == 4)
  63. chatButtonC.drawSprite(233, 143);
  64. else if(cButtonCPos == 5)
  65. chatButtonC.drawSprite(290, 143);
  66. else if(cButtonCPos == 6)
  67. chatButtonC.drawSprite(347, 143);
  68. if(cButtonHPos == cButtonCPos) {
  69. if(cButtonHPos == 0)
  70. chatButtonHC.drawSprite(5, 143);
  71. else if(cButtonHPos == 1)
  72. chatButtonHC.drawSprite(62, 143);
  73. else if(cButtonHPos == 2)
  74. chatButtonHC.drawSprite(119, 143);
  75. else if(cButtonHPos == 3)
  76. chatButtonHC.drawSprite(176, 143);
  77. else if(cButtonHPos == 4)
  78. chatButtonHC.drawSprite(233, 143);
  79. else if(cButtonHPos == 5)
  80. chatButtonHC.drawSprite(290, 143);
  81. else if(cButtonHPos == 6)
  82. chatButtonHC.drawSprite(347, 143);
  83. } else {
  84. if(cButtonHPos == 0)
  85. chatButtonH.drawSprite(5, 143);
  86. else if(cButtonHPos == 1)
  87. chatButtonH.drawSprite(62, 143);
  88. else if(cButtonHPos == 2)
  89. chatButtonH.drawSprite(119, 143);
  90. else if(cButtonHPos == 3)
  91. chatButtonH.drawSprite(176, 143);
  92. else if(cButtonHPos == 4)
  93. chatButtonH.drawSprite(233, 143);
  94. else if(cButtonHPos == 5)
  95. chatButtonH.drawSprite(290, 143);
  96. else if(cButtonHPos == 6)
  97. chatButtonH.drawSprite(347, 143);
  98. }
  99. /* Button text */
  100. smallText.method389(true, 427, 0xffffff, "Report Abuse", 158);
  101. smallText.method389(true, 26, 0xffffff, "All", 158);
  102. smallText.method389(true, 77, 0xffffff, "Game", 158);
  103. smallText.method389(true, 131, 0xffffff, "Public", 153);
  104. smallText.method389(true, 185, 0xffffff, "Private", 153);
  105. smallText.method389(true, 249, 0xffffff, "Clan", 153);
  106. smallText.method389(true, 304, 0xffffff, "Trade", 153);
  107. smallText.method389(true, 363, 0xffffff, "Duel", 153);
  108. /* Chat modes */
  109. smallText.method382(textColor[publicChatMode], 146, text[publicChatMode], 164, true);
  110. smallText.method382(textColor[privateChatMode], 203, text[privateChatMode], 164, true);
  111. smallText.method382(textColor[clanChatMode], 260, text[clanChatMode], 164, true);
  112. smallText.method382(textColor[tradeMode], 317, text[tradeMode], 164, true);
  113. smallText.method382(textColor[duelMode], 374, text[duelMode], 164, true);
  114. }
  115.  
  116. private void drawChatArea() /* This draws/displays the chat area */
  117. {
  118. aRSImageProducer_1166.initDrawingArea();
  119. Texture.anIntArray1472 = anIntArray1180;
  120. chatArea.drawSprite(0, 0);
  121. drawChannelButtons();
  122. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  123. if(messagePromptRaised) {
  124. chatTextDrawingArea.drawText(0, aString1121, 60, 259);
  125. chatTextDrawingArea.drawText(128, promptInput + "*", 80, 259);
  126. } else
  127. if(inputDialogState == 1) {
  128. chatTextDrawingArea.drawText(0, "Enter amount:", 60, 259);
  129. chatTextDrawingArea.drawText(128, amountOrNameInput + "*", 80, 259);
  130. } else
  131. if(inputDialogState == 2) {
  132. chatTextDrawingArea.drawText(0, "Enter name:", 60, 259);
  133. chatTextDrawingArea.drawText(128, amountOrNameInput + "*", 80, 259);
  134. } else
  135. if(aString844 != null) {
  136. chatTextDrawingArea.drawText(0, aString844, 60, 259);
  137. chatTextDrawingArea.drawText(128, "Click to continue", 80, 259);
  138. } else
  139. if(backDialogID != -1)
  140. drawInterface(0, 20, RSInterface.interfaceCache[backDialogID], 20);
  141. else
  142. if(dialogID != -1) {
  143. drawInterface(0, 20, RSInterface.interfaceCache[dialogID], 20);
  144. } else {
  145. int j77 = -3;
  146. int j = 0;
  147. DrawingArea.setDrawingArea(121, 8, 497, 7);
  148. for(int k = 0; k < 500; k++)
  149. if(chatMessages[k] != null) {
  150. int l = chatTypes[k];
  151. int i1 = (70 - j77 * 14) + anInt1089 + 5;
  152. String s1 = chatNames[k];
  153. byte byte0 = 0;
  154. if(s1 != null && s1.startsWith("@cr1@")) {
  155. s1 = s1.substring(5);
  156. byte0 = 1;
  157. }
  158. if(s1 != null && s1.startsWith("@cr2@")) {
  159. s1 = s1.substring(5);
  160. byte0 = 2;
  161. }
  162. if(s1 != null && s1.startsWith("@cr3@")) {
  163. s1 = s1.substring(5);
  164. byte0 = 3;
  165. }
  166. if(l == 0) {
  167. if (chatTypeView == 5 || chatTypeView == 0) {
  168. if(i1 > 0 && i1 < 210)
  169. textDrawingArea.method389(false, 9, 0, chatMessages[k], i1 - 1);//chat color enabled
  170. j++;
  171. j77++;
  172. }
  173. }
  174. if((l == 1 || l == 2) && (l == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
  175. if (chatTypeView == 1 || chatTypeView == 0) {
  176. if(i1 > 0 && i1 < 210) {
  177. int j1 = 8;
  178. if(byte0 == 1) {
  179. modIcons[0].method361(j1, i1 - 12);
  180. j1 += 12;
  181. }
  182. if(byte0 == 2) {
  183. modIcons[1].method361(j1, i1 - 12);
  184. j1 += 12;
  185. }
  186. if(byte0 == 3) {
  187. modIcons[2].method361(j1, i1 - 12);
  188. j1 += 12;
  189. }
  190. /* draws playername in chatbox[history] */
  191. textDrawingArea.method385(0, s1 + ":", i1 - 1, j1 + 1);
  192. j1 += textDrawingArea.getTextWidth(s1) + 8;
  193. /* draws chat in chatbox[history] */
  194. textDrawingArea.method389(false, j1 + 1, 255, chatMessages[k], i1 - 1);//chat color enabled;
  195. }
  196. j++;
  197. j77++;
  198. }
  199. }
  200. if((l == 3 || l == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (l == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1)))
  201. {
  202. if (chatTypeView == 2 || chatTypeView == 0) {
  203. if(i1 > 0 && i1 < 210) {
  204. int k1 = 8;
  205. textDrawingArea.method385(0, "From", i1, k1);
  206. k1 += textDrawingArea.getTextWidth("From ");
  207. if(byte0 == 1) {
  208. modIcons[0].method361(k1, i1 - 12);
  209. k1 += 12;
  210. }
  211. if(byte0 == 2) {
  212. modIcons[1].method361(k1, i1 - 12);
  213. k1 += 12;
  214. }
  215. if(byte0 == 3) {
  216. modIcons[2].method361(k1, i1 - 12);
  217. k1 += 12;
  218. k1 += 12;
  219. }
  220. textDrawingArea.method385(0, s1 + ":", i1 - 1, k1 + 1);
  221. k1 += textDrawingArea.getTextWidth(s1) + 8;
  222. textDrawingArea.method385(0x800000, chatMessages[k], i1 - 1, k1 + 1);
  223. }
  224. j++;
  225. j77++;
  226. }
  227. }
  228. if(l == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  229. if (chatTypeView == 3 || chatTypeView == 0) {
  230. if(i1 > 0 && i1 < 210)
  231. textDrawingArea.method385(0x800080, s1 + " " + chatMessages[k], i1, 8);
  232. j++;
  233. j77++;
  234. }
  235. }
  236. if(l == 5 && splitPrivateChat == 0 && privateChatMode < 2) {
  237. if (chatTypeView == 2 || chatTypeView == 0) {
  238. if(i1 > 0 && i1 < 210)
  239. textDrawingArea.method385(0x800000, chatMessages[k], i1, 8);
  240. j++;
  241. j77++;
  242. }
  243. }
  244. if(l == 6 && (splitPrivateChat == 0 || chatTypeView == 2) && privateChatMode < 2)
  245. {
  246. if (chatTypeView == 2 || chatTypeView == 0) {
  247. if(i1 > 0 && i1 < 210) {
  248. textDrawingArea.method385(0, "To " + s1 + ":", i1, 8);
  249. textDrawingArea.method385(0x800000, chatMessages[k], i1, 12 + textDrawingArea.getTextWidth("To :" + s1));
  250. }
  251. j++;
  252. j77++;
  253. }
  254. }
  255. if(l == 8 && (duelMode == 0 || duelMode == 1 && isFriendOrSelf(s1)))
  256. {
  257. if (chatTypeView == 4 || chatTypeView == 0) {
  258. if(i1 > 0 && i1 < 210)
  259. textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], i1, 8);
  260. j++;
  261. j77++;
  262. }
  263. if(l == 11 && (clanChatMode == 0))
  264. {
  265. if (chatTypeView == 11) {
  266. if(i1 > 0 && i1 < 210)
  267. textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], i1, 8);
  268. j++;
  269. j77++;
  270. }
  271. if(l == 12)//link
  272. {
  273. if(i1 > 0 && i1 < 110)
  274. textDrawingArea.method385(0x7e3200, chatMessages[k] + " @blu@" + s1, i1, 8);
  275. j++;
  276. }
  277. }
  278. }
  279. }
  280. DrawingArea.defaultDrawingAreaSize();
  281. anInt1211 = j * 14 + 7 + 5;
  282. if(anInt1211 < 111)
  283. anInt1211 = 111;
  284. drawScrollbar(113, anInt1211 - anInt1089 - 113, 7, 496, anInt1211);
  285. String s;
  286. if(myPlayer != null && myPlayer.name != null)
  287. s = myPlayer.name;
  288. else
  289. s = TextClass.fixName(myUsername);
  290. textDrawingArea.method385(0, s + ":", 132, 9);
  291. textDrawingArea.drawChatInput(255, 10 + textDrawingArea.getTextWidth(s + ": "), inputString + "*", 132, false);
  292. DrawingArea.method339(120, 0x807660, 504, 7);
  293. }
  294. if(menuOpen && menuScreenArea == 2) {
  295. drawMenu();
  296. }
  297. aRSImageProducer_1166.drawGraphics(338, super.graphics, 0);
  298. aRSImageProducer_1165.initDrawingArea();
  299. Texture.anIntArray1472 = anIntArray1182;
  300. }
  301.  
  302. public void init() {
  303. nodeID = 10;
  304. portOff = 0;
  305. setHighMem();
  306. isMembers = true;
  307. initClientFrame(503, 765);
  308. }
  309.  
  310. public void startRunnable(Runnable runnable, int i)
  311. {
  312. if(i > 10)
  313. i = 10;
  314. if(signlink.mainapp != null)
  315. {
  316. signlink.startthread(runnable, i);
  317. } else
  318. {
  319. super.startRunnable(runnable, i);
  320. }
  321. }
  322.  
  323. public Socket openSocket(int port)
  324. throws IOException
  325. {
  326. return new Socket(InetAddress.getByName(server), port);
  327. }
  328.  
  329. private void processMenuClick()
  330. {
  331. if(activeInterfaceType != 0)
  332. return;
  333. int j = super.clickMode3;
  334. if(spellSelected == 1 && super.saveClickX >= 516 && super.saveClickY >= 160 && super.saveClickX <= 765 && super.saveClickY <= 205)
  335. j = 0;
  336. if(menuOpen) {
  337. if(j != 1) {
  338. int k = super.mouseX;
  339. int j1 = super.mouseY;
  340. if(menuScreenArea == 0) {
  341. k -= 4;
  342. j1 -= 4;
  343. }
  344. if(menuScreenArea == 1) {
  345. k -= 519;
  346. j1 -= 168;
  347. }
  348. if(menuScreenArea == 2) {
  349. k -= 17;
  350. j1 -= 338;
  351. }
  352. if(menuScreenArea == 3) {
  353. k -= 519;
  354. j1 -= 0;
  355. }
  356. if(k < menuOffsetX - 10 || k > menuOffsetX + menuWidth + 10 || j1 < menuOffsetY - 10 || j1 > menuOffsetY + anInt952 + 10)
  357. {
  358. menuOpen = false;
  359. if(menuScreenArea == 1)
  360. needDrawTabArea = true;
  361. if(menuScreenArea == 2)
  362. inputTaken = true;
  363. }
  364. }
  365. if(j == 1) {
  366. int l = menuOffsetX;
  367. int k1 = menuOffsetY;
  368. int i2 = menuWidth;
  369. int k2 = super.saveClickX;
  370. int l2 = super.saveClickY;
  371. if(menuScreenArea == 0) {
  372. k2 -= 4;
  373. l2 -= 4;
  374. }
  375. if(menuScreenArea == 1) {
  376. k2 -= 519;
  377. l2 -= 168;
  378. }
  379. if(menuScreenArea == 2) {
  380. k2 -= 17;
  381. l2 -= 338;
  382. }
  383. if(menuScreenArea == 3) {
  384. k2 -= 519;
  385. l2 -= 0;
  386. }
  387. int i3 = -1;
  388. for(int j3 = 0; j3 < menuActionRow; j3++)
  389. {
  390. int k3 = k1 + 31 + (menuActionRow - 1 - j3) * 15;
  391. if(k2 > l && k2 < l + i2 && l2 > k3 - 13 && l2 < k3 + 3)
  392. i3 = j3;
  393. }
  394.  
  395. if(i3 != -1)
  396. doAction(i3);
  397. menuOpen = false;
  398. if(menuScreenArea == 1)
  399. needDrawTabArea = true;
  400. if(menuScreenArea == 2)
  401. {
  402. inputTaken = true;
  403. }
  404. }
  405. } else
  406. {
  407. if(j == 1 && menuActionRow > 0)
  408. {
  409. int i1 = menuActionID[menuActionRow - 1];
  410. 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)
  411. {
  412. int l1 = menuActionCmd2[menuActionRow - 1];
  413. int j2 = menuActionCmd3[menuActionRow - 1];
  414. RSInterface class9 = RSInterface.interfaceCache[j2];
  415. if(class9.aBoolean259 || class9.aBoolean235)
  416. {
  417. aBoolean1242 = false;
  418. anInt989 = 0;
  419. anInt1084 = j2;
  420. anInt1085 = l1;
  421. activeInterfaceType = 2;
  422. anInt1087 = super.saveClickX;
  423. anInt1088 = super.saveClickY;
  424. if(RSInterface.interfaceCache[j2].parentID == openInterfaceID)
  425. activeInterfaceType = 1;
  426. if(RSInterface.interfaceCache[j2].parentID == backDialogID)
  427. activeInterfaceType = 3;
  428. return;
  429. }
  430. }
  431. }
  432. if(j == 1 && (anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  433. j = 2;
  434. if(j == 1 && menuActionRow > 0)
  435. doAction(menuActionRow - 1);
  436. if(j == 2 && menuActionRow > 0)
  437. determineMenuSize();
  438. }
  439. }
  440.  
  441. public static int totalRead = 0;
  442.  
  443. public static String getFileNameWithoutExtension(String fileName) {
  444. File tmpFile = new File(fileName);
  445. tmpFile.getName();
  446. int whereDot = tmpFile.getName().lastIndexOf('.');
  447. if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2 ) {
  448. return tmpFile.getName().substring(0, whereDot);
  449. }
  450. return "";
  451. }
  452.  
  453. public void preloadModels() {
  454. File file = new File("./Raw/");
  455. File[] fileArray = file.listFiles();
  456. for(int y = 0; y < fileArray.length; y++) {
  457. String s = fileArray[y].getName();
  458. byte[] buffer = ReadFile("./Raw/"+s);
  459. Model.method460(buffer,Integer.parseInt(getFileNameWithoutExtension(s)));
  460. }
  461. }
  462.  
  463. public static final byte[] ReadFile(String s) {
  464. try {
  465. byte abyte0[];
  466. File file = new File(s);
  467. int i = (int)file.length();
  468. abyte0 = new byte[i];
  469. DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new FileInputStream(s)));
  470. datainputstream.readFully(abyte0, 0, i);
  471. datainputstream.close();
  472. totalRead++;
  473. return abyte0;
  474. } catch(Exception e) {
  475. System.out.println((new StringBuilder()).append("Read Error: ").append(s).toString());
  476. return null;
  477. }
  478. }
  479.  
  480. public void models() {
  481. for(int ModelIndex = 0; ModelIndex < 50000; ModelIndex++) {
  482. byte[] abyte0 = getModel(ModelIndex);
  483. if(abyte0 != null && abyte0.length > 0) {
  484. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  485. pushMessage("Model added successfully!", 0, "");
  486. }
  487. }
  488. }
  489.  
  490. private void saveMidi(boolean flag, byte abyte0[])
  491. {
  492. signlink.midifade = flag ? 1 : 0;
  493. signlink.midisave(abyte0, abyte0.length);
  494. }
  495.  
  496. private void method22()
  497. {
  498. try
  499. {
  500. anInt985 = -1;
  501. aClass19_1056.removeAll();
  502. aClass19_1013.removeAll();
  503. Texture.method366();
  504. unlinkMRUNodes();
  505. worldController.initToNull();
  506. System.gc();
  507. for(int i = 0; i < 4; i++)
  508. aClass11Array1230[i].method210();
  509.  
  510. for(int l = 0; l < 4; l++)
  511. {
  512. for(int k1 = 0; k1 < 104; k1++)
  513. {
  514. for(int j2 = 0; j2 < 104; j2++)
  515. byteGroundArray[l][k1][j2] = 0;
  516.  
  517. }
  518.  
  519. }
  520.  
  521. ObjectManager objectManager = new ObjectManager(byteGroundArray, intGroundArray);
  522. int k2 = aByteArrayArray1183.length;
  523. stream.createFrame(0);
  524. if(!aBoolean1159)
  525. {
  526. for(int i3 = 0; i3 < k2; i3++)
  527. {
  528. int i4 = (anIntArray1234[i3] >> 8) * 64 - baseX;
  529. int k5 = (anIntArray1234[i3] & 0xff) * 64 - baseY;
  530. byte abyte0[] = aByteArrayArray1183[i3];
  531. if(abyte0 != null)
  532. objectManager.method180(abyte0, k5, i4, (anInt1069 - 6) * 8, (anInt1070 - 6) * 8, aClass11Array1230);
  533. }
  534.  
  535. for(int j4 = 0; j4 < k2; j4++)
  536. {
  537. int l5 = (anIntArray1234[j4] >> 8) * 64 - baseX;
  538. int k7 = (anIntArray1234[j4] & 0xff) * 64 - baseY;
  539. byte abyte2[] = aByteArrayArray1183[j4];
  540. if(abyte2 == null && anInt1070 < 800)
  541. objectManager.method174(k7, 64, 64, l5);
  542. }
  543.  
  544. anInt1097++;
  545. if(anInt1097 > 160)
  546. {
  547. anInt1097 = 0;
  548. stream.createFrame(238);
  549. stream.writeWordBigEndian(96);
  550. }
  551. stream.createFrame(0);
  552. for(int i6 = 0; i6 < k2; i6++)
  553. {
  554. byte abyte1[] = aByteArrayArray1247[i6];
  555. if(abyte1 != null)
  556. {
  557. int l8 = (anIntArray1234[i6] >> 8) * 64 - baseX;
  558. int k9 = (anIntArray1234[i6] & 0xff) * 64 - baseY;
  559. objectManager.method190(l8, aClass11Array1230, k9, worldController, abyte1);
  560. }
  561. }
  562.  
  563. }
  564. if(aBoolean1159)
  565. {
  566. for(int j3 = 0; j3 < 4; j3++)
  567. {
  568. for(int k4 = 0; k4 < 13; k4++)
  569. {
  570. for(int j6 = 0; j6 < 13; j6++)
  571. {
  572. int l7 = anIntArrayArrayArray1129[j3][k4][j6];
  573. if(l7 != -1)
  574. {
  575. int i9 = l7 >> 24 & 3;
  576. int l9 = l7 >> 1 & 3;
  577. int j10 = l7 >> 14 & 0x3ff;
  578. int l10 = l7 >> 3 & 0x7ff;
  579. int j11 = (j10 / 8 << 8) + l10 / 8;
  580. for(int l11 = 0; l11 < anIntArray1234.length; l11++)
  581. {
  582. if(anIntArray1234[l11] != j11 || aByteArrayArray1183[l11] == null)
  583. continue;
  584. objectManager.method179(i9, l9, aClass11Array1230, k4 * 8, (j10 & 7) * 8, aByteArrayArray1183[l11], (l10 & 7) * 8, j3, j6 * 8);
  585. break;
  586. }
  587.  
  588. }
  589. }
  590.  
  591. }
  592.  
  593. }
  594.  
  595. for(int l4 = 0; l4 < 13; l4++)
  596. {
  597. for(int k6 = 0; k6 < 13; k6++)
  598. {
  599. int i8 = anIntArrayArrayArray1129[0][l4][k6];
  600. if(i8 == -1)
  601. objectManager.method174(k6 * 8, 8, 8, l4 * 8);
  602. }
  603.  
  604. }
  605.  
  606. stream.createFrame(0);
  607. for(int l6 = 0; l6 < 4; l6++)
  608. {
  609. for(int j8 = 0; j8 < 13; j8++)
  610. {
  611. for(int j9 = 0; j9 < 13; j9++)
  612. {
  613. int i10 = anIntArrayArrayArray1129[l6][j8][j9];
  614. if(i10 != -1)
  615. {
  616. int k10 = i10 >> 24 & 3;
  617. int i11 = i10 >> 1 & 3;
  618. int k11 = i10 >> 14 & 0x3ff;
  619. int i12 = i10 >> 3 & 0x7ff;
  620. int j12 = (k11 / 8 << 8) + i12 / 8;
  621. for(int k12 = 0; k12 < anIntArray1234.length; k12++)
  622. {
  623. if(anIntArray1234[k12] != j12 || aByteArrayArray1247[k12] == null)
  624. continue;
  625. objectManager.method183(aClass11Array1230, worldController, k10, j8 * 8, (i12 & 7) * 8, l6, aByteArrayArray1247[k12], (k11 & 7) * 8, i11, j9 * 8);
  626. break;
  627. }
  628.  
  629. }
  630. }
  631.  
  632. }
  633.  
  634. }
  635.  
  636. }
  637. stream.createFrame(0);
  638. objectManager.method171(aClass11Array1230, worldController);
  639. aRSImageProducer_1165.initDrawingArea();
  640. stream.createFrame(0);
  641. int k3 = ObjectManager.anInt145;
  642. if(k3 > plane)
  643. k3 = plane;
  644. if(k3 < plane - 1)
  645. k3 = plane - 1;
  646. if(lowMem)
  647. worldController.method275(ObjectManager.anInt145);
  648. else
  649. worldController.method275(0);
  650. for(int i5 = 0; i5 < 104; i5++)
  651. {
  652. for(int i7 = 0; i7 < 104; i7++)
  653. spawnGroundItem(i5, i7);
  654.  
  655. }
  656.  
  657. anInt1051++;
  658. if(anInt1051 > 98)
  659. {
  660. anInt1051 = 0;
  661. stream.createFrame(150);
  662. }
  663. method63();
  664. }
  665. catch(Exception exception) { }
  666. ObjectDef.mruNodes1.unlinkAll();
  667. if(super.gameFrame != null)
  668. {
  669. stream.createFrame(210);
  670. stream.writeDWord(0x3f008edd);
  671. }
  672. if(lowMem && signlink.cache_dat != null)
  673. {
  674. int j = onDemandFetcher.getVersionCount(0);
  675. for(int i1 = 0; i1 < j; i1++)
  676. {
  677. int l1 = onDemandFetcher.getModelIndex(i1);
  678. if((l1 & 0x79) == 0)
  679. Model.method461(i1);
  680. }
  681.  
  682. }
  683. System.gc();
  684. Texture.method367();
  685. onDemandFetcher.method566();
  686. int k = (anInt1069 - 6) / 8 - 1;
  687. int j1 = (anInt1069 + 6) / 8 + 1;
  688. int i2 = (anInt1070 - 6) / 8 - 1;
  689. int l2 = (anInt1070 + 6) / 8 + 1;
  690. if(aBoolean1141)
  691. {
  692. k = 49;
  693. j1 = 50;
  694. i2 = 49;
  695. l2 = 50;
  696. }
  697. for(int l3 = k; l3 <= j1; l3++)
  698. {
  699. for(int j5 = i2; j5 <= l2; j5++)
  700. if(l3 == k || l3 == j1 || j5 == i2 || j5 == l2)
  701. {
  702. int j7 = onDemandFetcher.method562(0, j5, l3);
  703. if(j7 != -1)
  704. onDemandFetcher.method560(j7, 3);
  705. int k8 = onDemandFetcher.method562(1, j5, l3);
  706. if(k8 != -1)
  707. onDemandFetcher.method560(k8, 3);
  708. }
  709.  
  710. }
  711.  
  712. }
  713.  
  714. private void unlinkMRUNodes()
  715. {
  716. ObjectDef.mruNodes1.unlinkAll();
  717. ObjectDef.mruNodes2.unlinkAll();
  718. EntityDef.mruNodes.unlinkAll();
  719. ItemDef.mruNodes2.unlinkAll();
  720. ItemDef.mruNodes1.unlinkAll();
  721. Player.mruNodes.unlinkAll();
  722. SpotAnim.aMRUNodes_415.unlinkAll();
  723. }
  724.  
  725. private void method24(int i)
  726. {
  727. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  728. int j = ai.length;
  729. for(int k = 0; k < j; k++)
  730. ai[k] = 0;
  731.  
  732. for(int l = 1; l < 103; l++)
  733. {
  734. int i1 = 24628 + (103 - l) * 512 * 4;
  735. for(int k1 = 1; k1 < 103; k1++)
  736. {
  737. if((byteGroundArray[i][k1][l] & 0x18) == 0)
  738. worldController.method309(ai, i1, i, k1, l);
  739. if(i < 3 && (byteGroundArray[i + 1][k1][l] & 8) != 0)
  740. worldController.method309(ai, i1, i + 1, k1, l);
  741. i1 += 4;
  742. }
  743.  
  744. }
  745.  
  746. int j1 = ((238 + (int)(Math.random() * 20D)) - 10 << 16) + ((238 + (int)(Math.random() * 20D)) - 10 << 8) + ((238 + (int)(Math.random() * 20D)) - 10);
  747. int l1 = (238 + (int)(Math.random() * 20D)) - 10 << 16;
  748. aClass30_Sub2_Sub1_Sub1_1263.method343();
  749. for(int i2 = 1; i2 < 103; i2++)
  750. {
  751. for(int j2 = 1; j2 < 103; j2++)
  752. {
  753. if((byteGroundArray[i][j2][i2] & 0x18) == 0)
  754. method50(i2, j1, j2, l1, i);
  755. if(i < 3 && (byteGroundArray[i + 1][j2][i2] & 8) != 0)
  756. method50(i2, j1, j2, l1, i + 1);
  757. }
  758.  
  759. }
  760.  
  761. aRSImageProducer_1165.initDrawingArea();
  762. anInt1071 = 0;
  763. for(int k2 = 0; k2 < 104; k2++)
  764. {
  765. for(int l2 = 0; l2 < 104; l2++)
  766. {
  767. int i3 = worldController.method303(plane, k2, l2);
  768. if(i3 != 0)
  769. {
  770. i3 = i3 >> 14 & 0x7fff;
  771. int j3 = ObjectDef.forID(i3).anInt746;
  772. if(j3 >= 0)
  773. {
  774. int k3 = k2;
  775. int l3 = l2;
  776. if(j3 != 22 && j3 != 29 && j3 != 34 && j3 != 36 && j3 != 46 && j3 != 47 && j3 != 48)
  777. {
  778. byte byte0 = 104;
  779. byte byte1 = 104;
  780. int ai1[][] = aClass11Array1230[plane].anIntArrayArray294;
  781. for(int i4 = 0; i4 < 10; i4++)
  782. {
  783. int j4 = (int)(Math.random() * 4D);
  784. if(j4 == 0 && k3 > 0 && k3 > k2 - 3 && (ai1[k3 - 1][l3] & 0x1280108) == 0)
  785. k3--;
  786. if(j4 == 1 && k3 < byte0 - 1 && k3 < k2 + 3 && (ai1[k3 + 1][l3] & 0x1280180) == 0)
  787. k3++;
  788. if(j4 == 2 && l3 > 0 && l3 > l2 - 3 && (ai1[k3][l3 - 1] & 0x1280102) == 0)
  789. l3--;
  790. if(j4 == 3 && l3 < byte1 - 1 && l3 < l2 + 3 && (ai1[k3][l3 + 1] & 0x1280120) == 0)
  791. l3++;
  792. }
  793.  
  794. }
  795. aClass30_Sub2_Sub1_Sub1Array1140[anInt1071] = mapFunctions[j3];
  796. anIntArray1072[anInt1071] = k3;
  797. anIntArray1073[anInt1071] = l3;
  798. anInt1071++;
  799. }
  800. }
  801. }
  802.  
  803. }
  804.  
  805. }
  806.  
  807. private void spawnGroundItem(int i, int j)
  808. {
  809. NodeList class19 = groundArray[plane][i][j];
  810. if(class19 == null)
  811. {
  812. worldController.method295(plane, i, j);
  813. return;
  814. }
  815. int k = 0xfa0a1f01;
  816. Object obj = null;
  817. for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  818. {
  819. ItemDef itemDef = ItemDef.forID(item.ID);
  820. int l = itemDef.value;
  821. if(itemDef.stackable)
  822. l *= item.anInt1559 + 1;
  823. // notifyItemSpawn(item, i + baseX, j + baseY);
  824.  
  825. if(l > k)
  826. {
  827. k = l;
  828. obj = item;
  829. }
  830. }
  831.  
  832. class19.insertTail(((Node) (obj)));
  833. Object obj1 = null;
  834. Object obj2 = null;
  835. for(Item class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetFirst(); class30_sub2_sub4_sub2_1 != null; class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetNext())
  836. {
  837. if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && obj1 == null)
  838. obj1 = class30_sub2_sub4_sub2_1;
  839. if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && class30_sub2_sub4_sub2_1.ID != ((Item) (obj1)).ID && obj2 == null)
  840. obj2 = class30_sub2_sub4_sub2_1;
  841. }
  842.  
  843. int i1 = i + (j << 7) + 0x60000000;
  844. worldController.method281(i, i1, ((Animable) (obj1)), method42(plane, j * 128 + 64, i * 128 + 64), ((Animable) (obj2)), ((Animable) (obj)), plane, j);
  845. }
  846.  
  847. private void method26(boolean flag)
  848. {
  849. for(int j = 0; j < npcCount; j++)
  850. {
  851. NPC npc = npcArray[npcIndices[j]];
  852. int k = 0x20000000 + (npcIndices[j] << 14);
  853. if(npc == null || !npc.isVisible() || npc.desc.aBoolean93 != flag)
  854. continue;
  855. int l = npc.x >> 7;
  856. int i1 = npc.y >> 7;
  857. if(l < 0 || l >= 104 || i1 < 0 || i1 >= 104)
  858. continue;
  859. if(npc.anInt1540 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  860. {
  861. if(anIntArrayArray929[l][i1] == anInt1265)
  862. continue;
  863. anIntArrayArray929[l][i1] = anInt1265;
  864. }
  865. if(!npc.desc.aBoolean84)
  866. k += 0x80000000;
  867. worldController.method285(plane, npc.anInt1552, method42(plane, npc.y, npc.x), k, npc.y, (npc.anInt1540 - 1) * 64 + 60, npc.x, npc, npc.aBoolean1541);
  868. }
  869. }
  870.  
  871. private boolean replayWave()
  872. {
  873. return signlink.wavereplay();
  874. }
  875.  
  876. private void loadError()
  877. {
  878. String s = "ondemand";//was a constant parameter
  879. System.out.println(s);
  880. try
  881. {
  882. getAppletContext().showDocument(new URL(getCodeBase(), "loaderror_" + s + ".html"));
  883. }
  884. catch(Exception exception)
  885. {
  886. exception.printStackTrace();
  887. }
  888. do
  889. try
  890. {
  891. Thread.sleep(1000L);
  892. }
  893. catch(Exception _ex) { }
  894. while(true);
  895. }
  896.  
  897. private void buildInterfaceMenu(int i, RSInterface class9, int k, int l, int i1, int j1)
  898. {
  899. if(class9.type != 0 || class9.children == null || class9.isMouseoverTriggered)
  900. return;
  901. if(k < i || i1 < l || k > i + class9.width || i1 > l + class9.height)
  902. return;
  903. int k1 = class9.children.length;
  904. for(int l1 = 0; l1 < k1; l1++)
  905. {
  906. int i2 = class9.childX[l1] + i;
  907. int j2 = (class9.childY[l1] + l) - j1;
  908. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[l1]];
  909. i2 += class9_1.anInt263;
  910. j2 += class9_1.anInt265;
  911. if((class9_1.mOverInterToTrigger >= 0 || class9_1.anInt216 != 0) && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  912. if(class9_1.mOverInterToTrigger >= 0)
  913. anInt886 = class9_1.mOverInterToTrigger;
  914. else
  915. anInt886 = class9_1.id;
  916. if(class9_1.type == 0)
  917. {
  918. buildInterfaceMenu(i2, class9_1, k, j2, i1, class9_1.scrollPosition);
  919. if(class9_1.scrollMax > class9_1.height)
  920. method65(i2 + class9_1.width, class9_1.height, k, i1, class9_1, j2, true, class9_1.scrollMax);
  921. } else
  922. {
  923. if(class9_1.atActionType == 1 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  924. {
  925. boolean flag = false;
  926. if(class9_1.contentType != 0)
  927. flag = buildFriendsListMenu(class9_1);
  928. if(!flag)
  929. {
  930. //System.out.println("1"+class9_1.tooltip + ", " + class9_1.interfaceID);
  931. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  932. menuActionID[menuActionRow] = 315;
  933. menuActionCmd3[menuActionRow] = class9_1.id;
  934. menuActionRow++;
  935. }
  936. }
  937. if(class9_1.atActionType == 2 && spellSelected == 0 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  938. {
  939. String s = class9_1.selectedActionName;
  940. if(s.indexOf(" ") != -1)
  941. s = s.substring(0, s.indexOf(" "));
  942. menuActionName[menuActionRow] = s + " @gre@" + class9_1.spellName;
  943. menuActionID[menuActionRow] = 626;
  944. menuActionCmd3[menuActionRow] = class9_1.id;
  945. menuActionRow++;
  946. }
  947. if(class9_1.atActionType == 3 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  948. {
  949. menuActionName[menuActionRow] = "Close";
  950. menuActionID[menuActionRow] = 200;
  951. menuActionCmd3[menuActionRow] = class9_1.id;
  952. menuActionRow++;
  953. }
  954. if(class9_1.atActionType == 4 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  955. {
  956. //System.out.println("2"+class9_1.tooltip + ", " + class9_1.interfaceID);
  957. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  958. menuActionID[menuActionRow] = 169;
  959. menuActionCmd3[menuActionRow] = class9_1.id;
  960. menuActionRow++;
  961. }
  962. if(class9_1.atActionType == 5 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  963. {
  964. //System.out.println("3"+class9_1.tooltip + ", " + class9_1.interfaceID);
  965. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  966. menuActionID[menuActionRow] = 646;
  967. menuActionCmd3[menuActionRow] = class9_1.id;
  968. menuActionRow++;
  969. }
  970. if(class9_1.atActionType == 6 && !aBoolean1149 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  971. {
  972. //System.out.println("4"+class9_1.tooltip + ", " + class9_1.interfaceID);
  973. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  974. menuActionID[menuActionRow] = 679;
  975. menuActionCmd3[menuActionRow] = class9_1.id;
  976. menuActionRow++;
  977. }
  978. if(class9_1.type == 2)
  979. {
  980. int k2 = 0;
  981. for(int l2 = 0; l2 < class9_1.height; l2++)
  982. {
  983. for(int i3 = 0; i3 < class9_1.width; i3++)
  984. {
  985. int j3 = i2 + i3 * (32 + class9_1.invSpritePadX);
  986. int k3 = j2 + l2 * (32 + class9_1.invSpritePadY);
  987. if(k2 < 20)
  988. {
  989. j3 += class9_1.spritesX[k2];
  990. k3 += class9_1.spritesY[k2];
  991. }
  992. if(k >= j3 && i1 >= k3 && k < j3 + 32 && i1 < k3 + 32)
  993. {
  994. mouseInvInterfaceIndex = k2;
  995. lastActiveInvInterface = class9_1.id;
  996. if(class9_1.inv[k2] > 0)
  997. {
  998. ItemDef itemDef = ItemDef.forID(class9_1.inv[k2] - 1);
  999. if(itemSelected == 1 && class9_1.isInventoryInterface)
  1000. {
  1001. if(class9_1.id != anInt1284 || k2 != anInt1283)
  1002. {
  1003. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  1004. menuActionID[menuActionRow] = 870;
  1005. menuActionCmd1[menuActionRow] = itemDef.id;
  1006. menuActionCmd2[menuActionRow] = k2;
  1007. menuActionCmd3[menuActionRow] = class9_1.id;
  1008. menuActionRow++;
  1009. }
  1010. } else
  1011. if(spellSelected == 1 && class9_1.isInventoryInterface)
  1012. {
  1013. if((spellUsableOn & 0x10) == 16)
  1014. {
  1015. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  1016. menuActionID[menuActionRow] = 543;
  1017. menuActionCmd1[menuActionRow] = itemDef.id;
  1018. menuActionCmd2[menuActionRow] = k2;
  1019. menuActionCmd3[menuActionRow] = class9_1.id;
  1020. menuActionRow++;
  1021. }
  1022. } else
  1023. {
  1024. if(class9_1.isInventoryInterface)
  1025. {
  1026. for(int l3 = 4; l3 >= 3; l3--)
  1027. if(itemDef.actions != null && itemDef.actions[l3] != null)
  1028. {
  1029. menuActionName[menuActionRow] = itemDef.actions[l3] + " @lre@" + itemDef.name;
  1030. if(l3 == 3)
  1031. menuActionID[menuActionRow] = 493;
  1032. if(l3 == 4)
  1033. menuActionID[menuActionRow] = 847;
  1034. menuActionCmd1[menuActionRow] = itemDef.id;
  1035. menuActionCmd2[menuActionRow] = k2;
  1036. menuActionCmd3[menuActionRow] = class9_1.id;
  1037. menuActionRow++;
  1038. } else
  1039. if(l3 == 4)
  1040. {
  1041. menuActionName[menuActionRow] = "Drop @lre@" + itemDef.name;
  1042. menuActionID[menuActionRow] = 847;
  1043. menuActionCmd1[menuActionRow] = itemDef.id;
  1044. menuActionCmd2[menuActionRow] = k2;
  1045. menuActionCmd3[menuActionRow] = class9_1.id;
  1046. menuActionRow++;
  1047. }
  1048.  
  1049. }
  1050. if(class9_1.usableItemInterface)
  1051. {
  1052. menuActionName[menuActionRow] = "Use @lre@" + itemDef.name;
  1053. menuActionID[menuActionRow] = 447;
  1054. menuActionCmd1[menuActionRow] = itemDef.id;
  1055. menuActionCmd2[menuActionRow] = k2;
  1056. menuActionCmd3[menuActionRow] = class9_1.id;
  1057. menuActionRow++;
  1058. }
  1059. if(class9_1.isInventoryInterface && itemDef.actions != null)
  1060. {
  1061. for(int i4 = 2; i4 >= 0; i4--)
  1062. if(itemDef.actions[i4] != null)
  1063. {
  1064. menuActionName[menuActionRow] = itemDef.actions[i4] + " @lre@" + itemDef.name;
  1065. if(i4 == 0)
  1066. menuActionID[menuActionRow] = 74;
  1067. if(i4 == 1)
  1068. menuActionID[menuActionRow] = 454;
  1069. if(i4 == 2)
  1070. menuActionID[menuActionRow] = 539;
  1071. menuActionCmd1[menuActionRow] = itemDef.id;
  1072. menuActionCmd2[menuActionRow] = k2;
  1073. menuActionCmd3[menuActionRow] = class9_1.id;
  1074. menuActionRow++;
  1075. }
  1076.  
  1077. }
  1078. if(class9_1.actions != null)
  1079. {
  1080. for(int j4 = 4; j4 >= 0; j4--)
  1081. if(class9_1.actions[j4] != null)
  1082. {
  1083. menuActionName[menuActionRow] = class9_1.actions[j4] + " @lre@" + itemDef.name;
  1084. if(j4 == 0)
  1085. menuActionID[menuActionRow] = 632;
  1086. if(j4 == 1)
  1087. menuActionID[menuActionRow] = 78;
  1088. if(j4 == 2)
  1089. menuActionID[menuActionRow] = 867;
  1090. if(j4 == 3)
  1091. menuActionID[menuActionRow] = 431;
  1092. if(j4 == 4)
  1093. menuActionID[menuActionRow] = 53;
  1094. menuActionCmd1[menuActionRow] = itemDef.id;
  1095. menuActionCmd2[menuActionRow] = k2;
  1096. menuActionCmd3[menuActionRow] = class9_1.id;
  1097. menuActionRow++;
  1098. }
  1099.  
  1100. }
  1101. //menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + (class9_1.inv[k2] - 1) + "@gre@)";
  1102. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  1103. menuActionID[menuActionRow] = 1125;
  1104. menuActionCmd1[menuActionRow] = itemDef.id;
  1105. menuActionCmd2[menuActionRow] = k2;
  1106. menuActionCmd3[menuActionRow] = class9_1.id;
  1107. menuActionRow++;
  1108. }
  1109. }
  1110. }
  1111. k2++;
  1112. }
  1113.  
  1114. }
  1115.  
  1116. }
  1117. }
  1118. }
  1119.  
  1120. }
  1121.  
  1122. public void drawScrollbar(int j, int k, int l, int i1, int j1) {
  1123. scrollBar1.method361(i1, l);
  1124. scrollBar2.method361(i1, (l + j) - 16);
  1125. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 16);
  1126. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x3d3426, 15);
  1127. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x342d21, 13);
  1128. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x2e281d, 11);
  1129. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x29241b, 10);
  1130. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x252019, 9);
  1131. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 1);
  1132. int k1 = ((j - 32) * j) / j1;
  1133. if(k1 < 8)
  1134. k1 = 8;
  1135. int l1 = ((j - 32 - k1) * k) / (j1 - j);
  1136. DrawingArea.drawPixels(k1, l + 16 + l1, i1, barFillColor, 16);
  1137. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1);
  1138. DrawingArea.method341(l + 16 + l1, 0x8d8269, k1, i1 + 1);
  1139. DrawingArea.method341(l + 16 + l1, 0x6a614d, k1, i1 + 2);
  1140. DrawingArea.method341(l + 16 + l1, 0x706651, k1, i1 + 3);
  1141. DrawingArea.method341(l + 16 + l1, 0x706651, k1, i1 + 4);
  1142. DrawingArea.method341(l + 16 + l1, 0x6a614d, k1, i1 + 5);
  1143. DrawingArea.method341(l + 16 + l1, 0x6a614d, k1, i1 + 6);
  1144. DrawingArea.method341(l + 16 + l1, 0x685e4b, k1, i1 + 7);
  1145. DrawingArea.method341(l + 16 + l1, 0x685e4b, k1, i1 + 8);
  1146. DrawingArea.method341(l + 16 + l1, 0x665d4a, k1, i1 + 9);
  1147. DrawingArea.method341(l + 16 + l1, 0x665d4a, k1, i1 + 10);
  1148. DrawingArea.method341(l + 16 + l1, 0x58503f, k1, i1 + 11);
  1149. DrawingArea.method341(l + 16 + l1, 0x58503f, k1, i1 + 12);
  1150. DrawingArea.method341(l + 16 + l1, 0x544c3c, k1, i1 + 13);
  1151. DrawingArea.method341(l + 16 + l1, 0x4b4535, k1, i1 + 14);
  1152. DrawingArea.method339(l + 16 + l1, 0x000001, 15, i1);
  1153. DrawingArea.method339(l + 17 + l1, 0x000001, 15, i1);
  1154. DrawingArea.method339(l + 17 + l1, 0x6a614d, 14, i1);
  1155. DrawingArea.method339(l + 17 + l1, 0x706651, 13, i1);
  1156. DrawingArea.method339(l + 17 + l1, 0x6d5f48, 11, i1);
  1157. DrawingArea.method339(l + 17 + l1, 0x6a614d, 10, i1);
  1158. DrawingArea.method339(l + 17 + l1, 0x76684b, 7, i1);
  1159. DrawingArea.method339(l + 17 + l1, 0x7d715b, 5, i1);
  1160. DrawingArea.method339(l + 17 + l1, 0x7e6e50, 4, i1);
  1161. DrawingArea.method339(l + 17 + l1, 0x8d8269, 3, i1);
  1162. DrawingArea.method339(l + 17 + l1, 0x000001, 2, i1);
  1163. DrawingArea.method339(l + 18 + l1, 0x000001, 16, i1);
  1164. DrawingArea.method339(l + 18 + l1, 0x625946, 15, i1);
  1165. DrawingArea.method339(l + 18 + l1, 0x665d4a, 14, i1);
  1166. DrawingArea.method339(l + 18 + l1, 0x625640, 11, i1);
  1167. DrawingArea.method339(l + 18 + l1, 0x6a614d, 10, i1);
  1168. DrawingArea.method339(l + 18 + l1, 0x706651, 7, i1);
  1169. DrawingArea.method339(l + 18 + l1, 0x726954, 5, i1);
  1170. DrawingArea.method339(l + 18 + l1, 0x716247, 4, i1);
  1171. DrawingArea.method339(l + 18 + l1, 0x7d715b, 3, i1);
  1172. DrawingArea.method339(l + 18 + l1, 0x8d8269, 2, i1);
  1173. DrawingArea.method339(l + 18 + l1, 0x000001, 1, i1);
  1174. DrawingArea.method339(l + 19 + l1, 0x000001, 16, i1);
  1175. DrawingArea.method339(l + 19 + l1, 0x544c3c, 15, i1);
  1176. DrawingArea.method339(l + 19 + l1, 0x625946, 14, i1);
  1177. DrawingArea.method339(l + 19 + l1, 0x665d4a, 11, i1);
  1178. DrawingArea.method339(l + 19 + l1, 0x685e4b, 9, i1);
  1179. DrawingArea.method339(l + 19 + l1, 0x6a614d, 7, i1);
  1180. DrawingArea.method339(l + 19 + l1, 0x706651, 5, i1);
  1181. DrawingArea.method339(l + 19 + l1, 0x726954, 4, i1);
  1182. DrawingArea.method339(l + 19 + l1, 0x6a614d, 3, i1);
  1183. DrawingArea.method339(l + 19 + l1, 0x8d8269, 2, i1);
  1184. DrawingArea.method339(l + 19 + l1, 0x000001, 1, i1);
  1185. DrawingArea.method339(l + 20 + l1, 0x000001, 16, i1);
  1186. DrawingArea.method339(l + 20 + l1, 0x4b4535, 15, i1);
  1187. DrawingArea.method339(l + 20 + l1, 0x4f4839, 14, i1);
  1188. DrawingArea.method339(l + 20 + l1, 0x58503f, 13, i1);
  1189. DrawingArea.method339(l + 20 + l1, 0x665d4a, 10, i1);
  1190. DrawingArea.method339(l + 20 + l1, 0x685e4b, 8, i1);
  1191. DrawingArea.method339(l + 20 + l1, 0x6a614d, 6, i1);
  1192. DrawingArea.method339(l + 20 + l1, 0x706651, 4, i1);
  1193. DrawingArea.method339(l + 20 + l1, 0x6a614d, 3, i1);
  1194. DrawingArea.method339(l + 20 + l1, 0x8d8269, 2, i1);
  1195. DrawingArea.method339(l + 20 + l1, 0x000001, 1, i1);
  1196. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1 + 15);
  1197. DrawingArea.method339(l + 15 + l1 + k1, 0x000001, 16, i1);
  1198. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 15, i1);
  1199. DrawingArea.method339(l + 14 + l1 + k1, 0x413a2e, 14, i1);
  1200. DrawingArea.method339(l + 14 + l1 + k1, 0x453d31, 10, i1);
  1201. DrawingArea.method339(l + 14 + l1 + k1, 0x4f4839, 9, i1);
  1202. DrawingArea.method339(l + 14 + l1 + k1, 0x4a402f, 7, i1);
  1203. DrawingArea.method339(l + 14 + l1 + k1, 0x4b4535, 4, i1);
  1204. DrawingArea.method339(l + 14 + l1 + k1, 0x625946, 3, i1);
  1205. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 2, i1);
  1206. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 16, i1);
  1207. DrawingArea.method339(l + 13 + l1 + k1, 0x453d31, 15, i1);
  1208. DrawingArea.method339(l + 13 + l1 + k1, 0x4b4535, 11, i1);
  1209. DrawingArea.method339(l + 13 + l1 + k1, 0x544c3c, 9, i1);
  1210. DrawingArea.method339(l + 13 + l1 + k1, 0x4f4839, 7, i1);
  1211. DrawingArea.method339(l + 13 + l1 + k1, 0x625946, 6, i1);
  1212. DrawingArea.method339(l + 13 + l1 + k1, 0x58503f, 4, i1);
  1213. DrawingArea.method339(l + 13 + l1 + k1, 0x625640, 3, i1);
  1214. DrawingArea.method339(l + 13 + l1 + k1, 0x706651, 2, i1);
  1215. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 1, i1);
  1216. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 16, i1);
  1217. DrawingArea.method339(l + 12 + l1 + k1, 0x453d31, 15, i1);
  1218. DrawingArea.method339(l + 12 + l1 + k1, 0x4b4535, 14, i1);
  1219. DrawingArea.method339(l + 12 + l1 + k1, 0x4f4839, 12, i1);
  1220. DrawingArea.method339(l + 12 + l1 + k1, 0x625946, 11, i1);
  1221. DrawingArea.method339(l + 12 + l1 + k1, 0x58503f, 10, i1);
  1222. DrawingArea.method339(l + 12 + l1 + k1, 0x665d4a, 7, i1);
  1223. DrawingArea.method339(l + 12 + l1 + k1, 0x685e4b, 4, i1);
  1224. DrawingArea.method339(l + 12 + l1 + k1, 0x726954, 3, i1);
  1225. DrawingArea.method339(l + 12 + l1 + k1, 0x7d715b, 2, i1);
  1226. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 1, i1);
  1227. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 16, i1);
  1228. DrawingArea.method339(l + 11 + l1 + k1, 0x4b4535, 15, i1);
  1229. DrawingArea.method339(l + 11 + l1 + k1, 0x544c3c, 14, i1);
  1230. DrawingArea.method339(l + 11 + l1 + k1, 0x625946, 13, i1);
  1231. DrawingArea.method339(l + 11 + l1 + k1, 0x58503f, 11, i1);
  1232. DrawingArea.method339(l + 11 + l1 + k1, 0x665d4a, 9, i1);
  1233. DrawingArea.method339(l + 11 + l1 + k1, 0x685e4b, 7, i1);
  1234. DrawingArea.method339(l + 11 + l1 + k1, 0x6a614d, 5, i1);
  1235. DrawingArea.method339(l + 11 + l1 + k1, 0x706651, 4, i1);
  1236. DrawingArea.method339(l + 11 + l1 + k1, 0x6a614d, 3, i1);
  1237. DrawingArea.method339(l + 11 + l1 + k1, 0x7d715b, 2, i1);
  1238. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 1, i1);
  1239. }
  1240.  
  1241. private void updateNPCs(Stream stream, int i)
  1242. {
  1243. anInt839 = 0;
  1244. anInt893 = 0;
  1245. method139(stream);
  1246. method46(i, stream);
  1247. method86(stream);
  1248. for(int k = 0; k < anInt839; k++)
  1249. {
  1250. int l = anIntArray840[k];
  1251. if(npcArray[l].anInt1537 != loopCycle)
  1252. {
  1253. npcArray[l].desc = null;
  1254. npcArray[l] = null;
  1255. }
  1256. }
  1257.  
  1258. if(stream.currentOffset != i)
  1259. {
  1260. signlink.reporterror(myUsername + " size mismatch in getnpcpos - pos:" + stream.currentOffset + " psize:" + i);
  1261. throw new RuntimeException("eek");
  1262. }
  1263. for(int i1 = 0; i1 < npcCount; i1++)
  1264. if(npcArray[npcIndices[i1]] == null)
  1265. {
  1266. signlink.reporterror(myUsername + " null entry in npc list - pos:" + i1 + " size:" + npcCount);
  1267. throw new RuntimeException("eek");
  1268. }
  1269.  
  1270. }
  1271.  
  1272. private int cButtonHPos;
  1273. private int cButtonHCPos;
  1274. private int cButtonCPos;
  1275.  
  1276. private void processChatModeClick() {
  1277. if(super.mouseX >= 6 && super.mouseX <= 62 && super.mouseY >= 482 && super.mouseY <= 505) {
  1278. cButtonHPos = 0;
  1279. aBoolean1233 = true;
  1280. inputTaken = true;
  1281. }
  1282. else if(super.mouseX >= 63 && super.mouseX <= 118 && super.mouseY >= 482 && super.mouseY <= 505) {
  1283. cButtonHPos = 1;
  1284. aBoolean1233 = true;
  1285. inputTaken = true;
  1286. }
  1287. else if(super.mouseX >= 119 && super.mouseX <= 175 && super.mouseY >= 482 && super.mouseY <= 505) {
  1288. cButtonHPos = 2;
  1289. aBoolean1233 = true;
  1290. inputTaken = true;
  1291. }
  1292. else if(super.mouseX >= 177 && super.mouseX <= 232 && super.mouseY >= 482 && super.mouseY <= 505) {
  1293. cButtonHPos = 3;
  1294. aBoolean1233 = true;
  1295. inputTaken = true;
  1296. }
  1297. else if(super.mouseX >= 233 && super.mouseX <= 289 && super.mouseY >= 482 && super.mouseY <= 505) {
  1298. cButtonHPos = 4;
  1299. aBoolean1233 = true;
  1300. inputTaken = true;
  1301. }
  1302. else if(super.mouseX >= 290 && super.mouseX <= 346 && super.mouseY >= 482 && super.mouseY <= 505) {
  1303. cButtonHPos = 5;
  1304. aBoolean1233 = true;
  1305. inputTaken = true;
  1306. }
  1307. else if(super.mouseX >= 347 && super.mouseX <= 403 && super.mouseY >= 482 && super.mouseY <= 505) {
  1308. cButtonHPos = 6;
  1309. aBoolean1233 = true;
  1310. inputTaken = true;
  1311. }
  1312. else if(super.mouseX >= 404 && super.mouseX <= 515 && super.mouseY >= 482 && super.mouseY <= 505) {
  1313. cButtonHPos = 7;
  1314. aBoolean1233 = true;
  1315. inputTaken = true;
  1316. } else {
  1317. cButtonHPos = -1;
  1318. aBoolean1233 = true;
  1319. inputTaken = true;
  1320. }
  1321.  
  1322. if(super.clickMode3 == 1) {
  1323. if(super.saveClickX >= 6 && super.saveClickX <= 62 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1324. cButtonCPos = 0;
  1325. chatTypeView = 0;
  1326. aBoolean1233 = true;
  1327. inputTaken = true;
  1328. }
  1329. if(super.saveClickX >= 63 && super.saveClickX <= 118 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1330. cButtonCPos = 1;
  1331. chatTypeView = 5;
  1332. aBoolean1233 = true;
  1333. inputTaken = true;
  1334. }
  1335. if(super.saveClickX >= 119 && super.saveClickX <= 175 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1336. cButtonCPos = 2;
  1337. chatTypeView = 1;
  1338. aBoolean1233 = true;
  1339. inputTaken = true;
  1340. }
  1341. if(super.saveClickX >= 177 && super.saveClickX <= 232 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1342. cButtonCPos = 3;
  1343. chatTypeView = 2;
  1344. aBoolean1233 = true;
  1345. inputTaken = true;
  1346. }
  1347. if(super.saveClickX >= 233 && super.saveClickX <= 289 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1348. cButtonCPos = 4;
  1349. chatTypeView = 11;
  1350. aBoolean1233 = true;
  1351. inputTaken = true;
  1352. }
  1353. if(super.saveClickX >= 290 && super.saveClickX <= 346 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1354. cButtonCPos = 5;
  1355. chatTypeView = 3;
  1356. aBoolean1233 = true;
  1357. inputTaken = true;
  1358. }
  1359. if(super.saveClickX >= 347 && super.saveClickX <= 403 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1360. cButtonCPos = 6;
  1361. chatTypeView = 4;
  1362. aBoolean1233 = true;
  1363. inputTaken = true;
  1364. }
  1365. if(super.saveClickX >= 404 && super.saveClickX <= 515 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1366. if(openInterfaceID == -1) {
  1367. clearTopInterfaces();
  1368. reportAbuseInput = "";
  1369. canMute = false;
  1370. for(int i = 0; i < RSInterface.interfaceCache.length; i++) {
  1371. if(RSInterface.interfaceCache[i] == null || RSInterface.interfaceCache[i].contentType != 600)
  1372. continue;
  1373. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  1374. break;
  1375. }
  1376.  
  1377. } else {
  1378. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  1379. }
  1380. }
  1381. }
  1382. }
  1383.  
  1384. private void method33(int i)
  1385. {
  1386. int j = Varp.cache[i].anInt709;
  1387. if(j == 0)
  1388. return;
  1389. int k = variousSettings[i];
  1390. if(j == 1)
  1391. {
  1392. if(k == 1)
  1393. Texture.method372(0.90000000000000002D);
  1394. if(k == 2)
  1395. Texture.method372(0.80000000000000004D);
  1396. if(k == 3)
  1397. Texture.method372(0.69999999999999996D);
  1398. if(k == 4)
  1399. Texture.method372(0.59999999999999998D);
  1400. ItemDef.mruNodes1.unlinkAll();
  1401. welcomeScreenRaised = true;
  1402. }
  1403. if(j == 3)
  1404. {
  1405. boolean flag1 = musicEnabled;
  1406. if(k == 0)
  1407. {
  1408. adjustVolume(musicEnabled, 0);
  1409. musicEnabled = true;
  1410. }
  1411. if(k == 1)
  1412. {
  1413. adjustVolume(musicEnabled, -400);
  1414. musicEnabled = true;
  1415. }
  1416. if(k == 2)
  1417. {
  1418. adjustVolume(musicEnabled, -800);
  1419. musicEnabled = true;
  1420. }
  1421. if(k == 3)
  1422. {
  1423. adjustVolume(musicEnabled, -1200);
  1424. musicEnabled = true;
  1425. }
  1426. if(k == 4)
  1427. musicEnabled = false;
  1428. if(musicEnabled != flag1 && !lowMem)
  1429. {
  1430. if(musicEnabled)
  1431. {
  1432. nextSong = currentSong;
  1433. songChanging = true;
  1434. onDemandFetcher.method558(2, nextSong);
  1435. } else
  1436. {
  1437. stopMidi();
  1438. }
  1439. prevSong = 0;
  1440. }
  1441. }
  1442. if(j == 4)
  1443. {
  1444. if(k == 0)
  1445. {
  1446. aBoolean848 = true;
  1447. setWaveVolume(0);
  1448. }
  1449. if(k == 1)
  1450. {
  1451. aBoolean848 = true;
  1452. setWaveVolume(-400);
  1453. }
  1454. if(k == 2)
  1455. {
  1456. aBoolean848 = true;
  1457. setWaveVolume(-800);
  1458. }
  1459. if(k == 3)
  1460. {
  1461. aBoolean848 = true;
  1462. setWaveVolume(-1200);
  1463. }
  1464. if(k == 4)
  1465. aBoolean848 = false;
  1466. }
  1467. if(j == 5)
  1468. anInt1253 = k;
  1469. if(j == 6)
  1470. anInt1249 = k;
  1471. if(j == 8)
  1472. {
  1473. splitPrivateChat = k;
  1474. inputTaken = true;
  1475. }
  1476. if(j == 9)
  1477. anInt913 = k;
  1478. }
  1479.  
  1480. private void updateEntities()
  1481. {
  1482. try{
  1483. int anInt974 = 0;
  1484. for(int j = -1; j < playerCount + npcCount; j++)
  1485. {
  1486. Object obj;
  1487. if(j == -1)
  1488. obj = myPlayer;
  1489. else
  1490. if(j < playerCount)
  1491. obj = playerArray[playerIndices[j]];
  1492. else
  1493. obj = npcArray[npcIndices[j - playerCount]];
  1494. if(obj == null || !((Entity) (obj)).isVisible())
  1495. continue;
  1496. if(obj instanceof NPC)
  1497. {
  1498. EntityDef entityDef = ((NPC)obj).desc;
  1499. if(entityDef.childrenIDs != null)
  1500. entityDef = entityDef.method161();
  1501. if(entityDef == null)
  1502. continue;
  1503. }
  1504. if(j < playerCount) {
  1505. int l = 30;
  1506. Player player = (Player)obj;
  1507. if(player.headIcon != 0) {
  1508. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1509. if(spriteDrawX > -1) {
  1510. for(int i2 = 0; i2 < 8; i2++)
  1511. if((player.headIcon & 1 << i2) != 0) {
  1512. headIcons[i2].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1513. l -= 25;
  1514. }
  1515. }
  1516. }
  1517. if(j >= 0 && anInt855 == 10 && anInt933 == playerIndices[j]) {
  1518. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1519. if(spriteDrawX > -1)
  1520. headIconsHint[player.hintIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1521. }
  1522. } else {
  1523. EntityDef entityDef_1 = ((NPC)obj).desc;
  1524. if(entityDef_1.anInt75 >= 0 && entityDef_1.anInt75 < headIcons.length) {
  1525. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1526. if(spriteDrawX > -1)
  1527. headIcons[entityDef_1.anInt75].drawSprite(spriteDrawX - 12, spriteDrawY - 30);
  1528. }
  1529. if(anInt855 == 1 && anInt1222 == npcIndices[j - playerCount] && loopCycle % 20 < 10) {
  1530. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1531. if(spriteDrawX > -1)
  1532. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  1533. }
  1534. }
  1535. if(((Entity) (obj)).textSpoken != null && (j >= playerCount || publicChatMode == 0 || publicChatMode == 3 || publicChatMode == 1 && isFriendOrSelf(((Player)obj).name)))
  1536. {
  1537. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height);
  1538. if(spriteDrawX > -1 && anInt974 < anInt975)
  1539. {
  1540. anIntArray979[anInt974] = chatTextDrawingArea.method384(((Entity) (obj)).textSpoken) / 2;
  1541. anIntArray978[anInt974] = chatTextDrawingArea.anInt1497;
  1542. anIntArray976[anInt974] = spriteDrawX;
  1543. anIntArray977[anInt974] = spriteDrawY;
  1544. anIntArray980[anInt974] = ((Entity) (obj)).anInt1513;
  1545. anIntArray981[anInt974] = ((Entity) (obj)).anInt1531;
  1546. anIntArray982[anInt974] = ((Entity) (obj)).textCycle;
  1547. aStringArray983[anInt974++] = ((Entity) (obj)).textSpoken;
  1548. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 >= 1 && ((Entity) (obj)).anInt1531 <= 3)
  1549. {
  1550. anIntArray978[anInt974] += 10;
  1551. anIntArray977[anInt974] += 5;
  1552. }
  1553. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 4)
  1554. anIntArray979[anInt974] = 60;
  1555. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 5)
  1556. anIntArray978[anInt974] += 5;
  1557. }
  1558. }
  1559. if(((Entity) (obj)).loopCycleStatus > loopCycle)
  1560. { try{
  1561. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1562. if(spriteDrawX > -1)
  1563. {
  1564. int i1 = (((Entity) (obj)).currentHealth * 30) / ((Entity) (obj)).maxHealth;
  1565. if(i1 > 30)
  1566. i1 = 30;
  1567. DrawingArea.drawPixels(5, spriteDrawY - 3, spriteDrawX - 15, 65280, i1);
  1568. DrawingArea.drawPixels(5, spriteDrawY - 3, (spriteDrawX - 15) + i1, 0xff0000, 30 - i1);
  1569. }
  1570. }catch(Exception e){ }
  1571. }
  1572. for(int j1 = 0; j1 < 4; j1++)
  1573. if(((Entity) (obj)).hitsLoopCycle[j1] > loopCycle)
  1574. {
  1575. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height / 2);
  1576. if(spriteDrawX > -1)
  1577. {
  1578. if(j1 == 1)
  1579. spriteDrawY -= 20;
  1580. if(j1 == 2)
  1581. {
  1582. spriteDrawX -= 15;
  1583. spriteDrawY -= 10;
  1584. }
  1585. if(j1 == 3)
  1586. {
  1587. spriteDrawX += 15;
  1588. spriteDrawY -= 10;
  1589. }
  1590. hitMarks[((Entity) (obj)).hitMarkTypes[j1]].drawSprite(spriteDrawX - 12, spriteDrawY - 12);
  1591. smallText.drawText(0, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 4, spriteDrawX);
  1592. smallText.drawText(0xffffff, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 3, spriteDrawX - 1);
  1593. }
  1594. }
  1595.  
  1596. }
  1597. for(int k = 0; k < anInt974; k++)
  1598. {
  1599. int k1 = anIntArray976[k];
  1600. int l1 = anIntArray977[k];
  1601. int j2 = anIntArray979[k];
  1602. int k2 = anIntArray978[k];
  1603. boolean flag = true;
  1604. while(flag)
  1605. {
  1606. flag = false;
  1607. for(int l2 = 0; l2 < k; l2++)
  1608. 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)
  1609. {
  1610. l1 = anIntArray977[l2] - anIntArray978[l2];
  1611. flag = true;
  1612. }
  1613.  
  1614. }
  1615. spriteDrawX = anIntArray976[k];
  1616. spriteDrawY = anIntArray977[k] = l1;
  1617. String s = aStringArray983[k];
  1618. if(anInt1249 == 0)
  1619. {
  1620. int i3 = 0xffff00;
  1621. if(anIntArray980[k] < 6)
  1622. i3 = anIntArray965[anIntArray980[k]];
  1623. if(anIntArray980[k] == 6)
  1624. i3 = anInt1265 % 20 >= 10 ? 0xffff00 : 0xff0000;
  1625. if(anIntArray980[k] == 7)
  1626. i3 = anInt1265 % 20 >= 10 ? 65535 : 255;
  1627. if(anIntArray980[k] == 8)
  1628. i3 = anInt1265 % 20 >= 10 ? 0x80ff80 : 45056;
  1629. if(anIntArray980[k] == 9)
  1630. {
  1631. int j3 = 150 - anIntArray982[k];
  1632. if(j3 < 50)
  1633. i3 = 0xff0000 + 1280 * j3;
  1634. else
  1635. if(j3 < 100)
  1636. i3 = 0xffff00 - 0x50000 * (j3 - 50);
  1637. else
  1638. if(j3 < 150)
  1639. i3 = 65280 + 5 * (j3 - 100);
  1640. }
  1641. if(anIntArray980[k] == 10)
  1642. {
  1643. int k3 = 150 - anIntArray982[k];
  1644. if(k3 < 50)
  1645. i3 = 0xff0000 + 5 * k3;
  1646. else
  1647. if(k3 < 100)
  1648. i3 = 0xff00ff - 0x50000 * (k3 - 50);
  1649. else
  1650. if(k3 < 150)
  1651. i3 = (255 + 0x50000 * (k3 - 100)) - 5 * (k3 - 100);
  1652. }
  1653. if(anIntArray980[k] == 11)
  1654. {
  1655. int l3 = 150 - anIntArray982[k];
  1656. if(l3 < 50)
  1657. i3 = 0xffffff - 0x50005 * l3;
  1658. else
  1659. if(l3 < 100)
  1660. i3 = 65280 + 0x50005 * (l3 - 50);
  1661. else
  1662. if(l3 < 150)
  1663. i3 = 0xffffff - 0x50000 * (l3 - 100);
  1664. }
  1665. if(anIntArray981[k] == 0)
  1666. {
  1667. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  1668. chatTextDrawingArea.drawText(i3, s, spriteDrawY, spriteDrawX);
  1669. }
  1670. if(anIntArray981[k] == 1)
  1671. {
  1672. chatTextDrawingArea.method386(0, s, spriteDrawX, anInt1265, spriteDrawY + 1);
  1673. chatTextDrawingArea.method386(i3, s, spriteDrawX, anInt1265, spriteDrawY);
  1674. }
  1675. if(anIntArray981[k] == 2)
  1676. {
  1677. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY + 1, 0);
  1678. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY, i3);
  1679. }
  1680. if(anIntArray981[k] == 3)
  1681. {
  1682. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY + 1, spriteDrawX, 0);
  1683. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY, spriteDrawX, i3);
  1684. }
  1685. if(anIntArray981[k] == 4)
  1686. {
  1687. int i4 = chatTextDrawingArea.method384(s);
  1688. int k4 = ((150 - anIntArray982[k]) * (i4 + 100)) / 150;
  1689. DrawingArea.setDrawingArea(334, spriteDrawX - 50, spriteDrawX + 50, 0);
  1690. chatTextDrawingArea.method385(0, s, spriteDrawY + 1, (spriteDrawX + 50) - k4);
  1691. chatTextDrawingArea.method385(i3, s, spriteDrawY, (spriteDrawX + 50) - k4);
  1692. DrawingArea.defaultDrawingAreaSize();
  1693. }
  1694. if(anIntArray981[k] == 5)
  1695. {
  1696. int j4 = 150 - anIntArray982[k];
  1697. int l4 = 0;
  1698. if(j4 < 25)
  1699. l4 = j4 - 25;
  1700. else
  1701. if(j4 > 125)
  1702. l4 = j4 - 125;
  1703. DrawingArea.setDrawingArea(spriteDrawY + 5, 0, 512, spriteDrawY - chatTextDrawingArea.anInt1497 - 1);
  1704. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1 + l4, spriteDrawX);
  1705. chatTextDrawingArea.drawText(i3, s, spriteDrawY + l4, spriteDrawX);
  1706. DrawingArea.defaultDrawingAreaSize();
  1707. }
  1708. } else
  1709. {
  1710. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  1711. chatTextDrawingArea.drawText(0xffff00, s, spriteDrawY, spriteDrawX);
  1712. }
  1713. }
  1714. }catch(Exception e){ }
  1715.  
  1716. }
  1717.  
  1718. private void delFriend(long l)
  1719. {
  1720. try
  1721. {
  1722. if(l == 0L)
  1723. return;
  1724. for(int i = 0; i < friendsCount; i++)
  1725. {
  1726. if(friendsListAsLongs[i] != l)
  1727. continue;
  1728. friendsCount--;
  1729. needDrawTabArea = true;
  1730. for(int j = i; j < friendsCount; j++)
  1731. {
  1732. friendsList[j] = friendsList[j + 1];
  1733. friendsNodeIDs[j] = friendsNodeIDs[j + 1];
  1734. friendsListAsLongs[j] = friendsListAsLongs[j + 1];
  1735. }
  1736.  
  1737. stream.createFrame(215);
  1738. stream.writeQWord(l);
  1739. break;
  1740. }
  1741. }
  1742. catch(RuntimeException runtimeexception)
  1743. {
  1744. signlink.reporterror("18622, " + false + ", " + l + ", " + runtimeexception.toString());
  1745. throw new RuntimeException();
  1746. }
  1747. }
  1748.  
  1749. public void drawSideIcons(){
  1750. /* Top sideIcons */
  1751. if(tabInterfaceIDs[0] != -1 && anInt1054 == 0)
  1752. if(loopCycle % 20 >= 10);
  1753. sideIcons[0].drawSprite(10, 4);
  1754. if(tabInterfaceIDs[1] != -1 && anInt1054 == 1)
  1755. if(loopCycle % 20 >= 10);
  1756. sideIcons[1].drawSprite(43, 4);
  1757. if(tabInterfaceIDs[2] != -1 && anInt1054 == 2)
  1758. if(loopCycle % 20 >= 10);
  1759. sideIcons[2].drawSprite(76, 3);
  1760. if(tabInterfaceIDs[3] != -1 && anInt1054 == 3)
  1761. if(loopCycle % 20 >= 10);
  1762. sideIcons[3].drawSprite(111, 5);
  1763. if(tabInterfaceIDs[4] != -1 && anInt1054 == 4)
  1764. if(loopCycle % 20 >= 10);
  1765. sideIcons[4].drawSprite(140, 1);
  1766. if(tabInterfaceIDs[5] != -1 && anInt1054 == 5)
  1767. if(loopCycle % 20 >= 10);
  1768. sideIcons[5].drawSprite(174, 1);
  1769. if(tabInterfaceIDs[6] != -1 && anInt1054 == 6)
  1770. if(loopCycle % 20 >= 10);
  1771. sideIcons[6].drawSprite(209, 5);
  1772. /* Bottom sideIcons */
  1773. if(tabInterfaceIDs[7] != -1 && anInt1054 == 7)
  1774. if(loopCycle % 20 >= 10);
  1775. sideIcons[7].drawSprite(43, 302);
  1776. if(tabInterfaceIDs[8] != -1 && anInt1054 == 8)
  1777. if(loopCycle % 20 >= 10);
  1778. sideIcons[8].drawSprite(76, 302);
  1779. if(tabInterfaceIDs[9] != -1 && anInt1054 == 9)
  1780. if(loopCycle % 20 >= 10);
  1781. sideIcons[13].drawSprite(112, 304);
  1782. if(tabInterfaceIDs[10] != -1 && anInt1054 == 10)
  1783. if(loopCycle % 20 >= 10);
  1784. sideIcons[10].drawSprite(143, 303);
  1785. if(tabInterfaceIDs[11] != -1 && anInt1054 == 11)
  1786. if(loopCycle % 20 >= 10);
  1787. sideIcons[11].drawSprite(173, 300);
  1788. if(tabInterfaceIDs[12] != -1 && anInt1054 == 12)
  1789. if(loopCycle % 20 >= 10);
  1790. sideIcons[12].drawSprite(206, 300);
  1791. }
  1792.  
  1793. public void drawRedStones() {
  1794. if(tabInterfaceIDs[tabID] != -1)
  1795. {
  1796. if(tabID == 0)
  1797. redStones[0].drawSprite(3, 0);
  1798. if(tabID == 1)
  1799. redStones[4].drawSprite(41, 0);
  1800. if(tabID == 2)
  1801. redStones[4].drawSprite(74, 0);
  1802. if(tabID == 3)
  1803. redStones[4].drawSprite(107, 0);
  1804. if(tabID == 4)
  1805. redStones[4].drawSprite(140, 0);
  1806. if(tabID == 5)
  1807. redStones[4].drawSprite(173, 0);
  1808. if(tabID == 6)
  1809. redStones[1].drawSprite(206, 0);
  1810. if(tabID == 7)
  1811. redStones[4].drawSprite(107, 298);
  1812. if(tabID == 8)
  1813. redStones[4].drawSprite(41, 298);
  1814. if(tabID == 9)
  1815. redStones[4].drawSprite(74, 298);
  1816. if(tabID == 11)
  1817. redStones[4].drawSprite(140, 298);
  1818. if(tabID == 12)
  1819. redStones[4].drawSprite(173, 298);
  1820. if(tabID == 13)
  1821. redStones[3].drawSprite(206, 298);
  1822. }
  1823. }
  1824.  
  1825. private void drawTabArea()
  1826. {
  1827. aRSImageProducer_1163.initDrawingArea();
  1828. Texture.anIntArray1472 = anIntArray1181;
  1829. /* Draws new tab area sprite */
  1830. tabArea.drawSprite(0, 0);
  1831. if(invOverlayInterfaceID == -1)
  1832. {
  1833. drawRedStones();
  1834. drawSideIcons();
  1835. }
  1836. if(invOverlayInterfaceID != -1)
  1837. drawInterface(0, 28, RSInterface.interfaceCache[invOverlayInterfaceID], 37);
  1838. else
  1839. if(tabInterfaceIDs[tabID] != -1)
  1840. drawInterface(0, 28, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 37);
  1841. if(menuOpen && menuScreenArea == 1)
  1842. drawMenu();
  1843. aRSImageProducer_1163.drawGraphics(168, super.graphics, 519);
  1844. aRSImageProducer_1165.initDrawingArea();
  1845. Texture.anIntArray1472 = anIntArray1182;
  1846. }
  1847.  
  1848. private void method37(int j)
  1849. {
  1850. if(!lowMem)
  1851. {
  1852. if(Texture.anIntArray1480[17] >= j)
  1853. {
  1854. Background background = Texture.aBackgroundArray1474s[17];
  1855. int k = background.anInt1452 * background.anInt1453 - 1;
  1856. int j1 = background.anInt1452 * anInt945 * 2;
  1857. byte abyte0[] = background.aByteArray1450;
  1858. byte abyte3[] = aByteArray912;
  1859. for(int i2 = 0; i2 <= k; i2++)
  1860. abyte3[i2] = abyte0[i2 - j1 & k];
  1861.  
  1862. background.aByteArray1450 = abyte3;
  1863. aByteArray912 = abyte0;
  1864. Texture.method370(17);
  1865. anInt854++;
  1866. if(anInt854 > 1235)
  1867. {
  1868. anInt854 = 0;
  1869. stream.createFrame(226);
  1870. stream.writeWordBigEndian(0);
  1871. int l2 = stream.currentOffset;
  1872. stream.writeWord(58722);
  1873. stream.writeWordBigEndian(240);
  1874. stream.writeWord((int)(Math.random() * 65536D));
  1875. stream.writeWordBigEndian((int)(Math.random() * 256D));
  1876. if((int)(Math.random() * 2D) == 0)
  1877. stream.writeWord(51825);
  1878. stream.writeWordBigEndian((int)(Math.random() * 256D));
  1879. stream.writeWord((int)(Math.random() * 65536D));
  1880. stream.writeWord(7130);
  1881. stream.writeWord((int)(Math.random() * 65536D));
  1882. stream.writeWord(61657);
  1883. stream.writeBytes(stream.currentOffset - l2);
  1884. }
  1885. }
  1886. if(Texture.anIntArray1480[24] >= j)
  1887. {
  1888. Background background_1 = Texture.aBackgroundArray1474s[24];
  1889. int l = background_1.anInt1452 * background_1.anInt1453 - 1;
  1890. int k1 = background_1.anInt1452 * anInt945 * 2;
  1891. byte abyte1[] = background_1.aByteArray1450;
  1892. byte abyte4[] = aByteArray912;
  1893. for(int j2 = 0; j2 <= l; j2++)
  1894. abyte4[j2] = abyte1[j2 - k1 & l];
  1895.  
  1896. background_1.aByteArray1450 = abyte4;
  1897. aByteArray912 = abyte1;
  1898. Texture.method370(24);
  1899. }
  1900. if(Texture.anIntArray1480[34] >= j)
  1901. {
  1902. Background background_2 = Texture.aBackgroundArray1474s[34];
  1903. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  1904. int l1 = background_2.anInt1452 * anInt945 * 2;
  1905. byte abyte2[] = background_2.aByteArray1450;
  1906. byte abyte5[] = aByteArray912;
  1907. for(int k2 = 0; k2 <= i1; k2++)
  1908. abyte5[k2] = abyte2[k2 - l1 & i1];
  1909.  
  1910. background_2.aByteArray1450 = abyte5;
  1911. aByteArray912 = abyte2;
  1912. Texture.method370(34);
  1913. }
  1914. }
  1915. }
  1916.  
  1917. private void method38()
  1918. {
  1919. for(int i = -1; i < playerCount; i++)
  1920. {
  1921. int j;
  1922. if(i == -1)
  1923. j = myPlayerIndex;
  1924. else
  1925. j = playerIndices[i];
  1926. Player player = playerArray[j];
  1927. if(player != null && player.textCycle > 0)
  1928. {
  1929. player.textCycle--;
  1930. if(player.textCycle == 0)
  1931. player.textSpoken = null;
  1932. }
  1933. }
  1934.  
  1935. for(int k = 0; k < npcCount; k++)
  1936. {
  1937. int l = npcIndices[k];
  1938. NPC npc = npcArray[l];
  1939. if(npc != null && npc.textCycle > 0)
  1940. {
  1941. npc.textCycle--;
  1942. if(npc.textCycle == 0)
  1943. npc.textSpoken = null;
  1944. }
  1945. }
  1946.  
  1947. }
  1948.  
  1949. private void calcCameraPos()
  1950. {
  1951. int i = anInt1098 * 128 + 64;
  1952. int j = anInt1099 * 128 + 64;
  1953. int k = method42(plane, j, i) - anInt1100;
  1954. if(xCameraPos < i)
  1955. {
  1956. xCameraPos += anInt1101 + ((i - xCameraPos) * anInt1102) / 1000;
  1957. if(xCameraPos > i)
  1958. xCameraPos = i;
  1959. }
  1960. if(xCameraPos > i)
  1961. {
  1962. xCameraPos -= anInt1101 + ((xCameraPos - i) * anInt1102) / 1000;
  1963. if(xCameraPos < i)
  1964. xCameraPos = i;
  1965. }
  1966. if(zCameraPos < k)
  1967. {
  1968. zCameraPos += anInt1101 + ((k - zCameraPos) * anInt1102) / 1000;
  1969. if(zCameraPos > k)
  1970. zCameraPos = k;
  1971. }
  1972. if(zCameraPos > k)
  1973. {
  1974. zCameraPos -= anInt1101 + ((zCameraPos - k) * anInt1102) / 1000;
  1975. if(zCameraPos < k)
  1976. zCameraPos = k;
  1977. }
  1978. if(yCameraPos < j)
  1979. {
  1980. yCameraPos += anInt1101 + ((j - yCameraPos) * anInt1102) / 1000;
  1981. if(yCameraPos > j)
  1982. yCameraPos = j;
  1983. }
  1984. if(yCameraPos > j)
  1985. {
  1986. yCameraPos -= anInt1101 + ((yCameraPos - j) * anInt1102) / 1000;
  1987. if(yCameraPos < j)
  1988. yCameraPos = j;
  1989. }
  1990. i = anInt995 * 128 + 64;
  1991. j = anInt996 * 128 + 64;
  1992. k = method42(plane, j, i) - anInt997;
  1993. int l = i - xCameraPos;
  1994. int i1 = k - zCameraPos;
  1995. int j1 = j - yCameraPos;
  1996. int k1 = (int)Math.sqrt(l * l + j1 * j1);
  1997. int l1 = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  1998. int i2 = (int)(Math.atan2(l, j1) * -325.94900000000001D) & 0x7ff;
  1999. if(l1 < 128)
  2000. l1 = 128;
  2001. if(l1 > 383)
  2002. l1 = 383;
  2003. if(yCameraCurve < l1)
  2004. {
  2005. yCameraCurve += anInt998 + ((l1 - yCameraCurve) * anInt999) / 1000;
  2006. if(yCameraCurve > l1)
  2007. yCameraCurve = l1;
  2008. }
  2009. if(yCameraCurve > l1)
  2010. {
  2011. yCameraCurve -= anInt998 + ((yCameraCurve - l1) * anInt999) / 1000;
  2012. if(yCameraCurve < l1)
  2013. yCameraCurve = l1;
  2014. }
  2015. int j2 = i2 - xCameraCurve;
  2016. if(j2 > 1024)
  2017. j2 -= 2048;
  2018. if(j2 < -1024)
  2019. j2 += 2048;
  2020. if(j2 > 0)
  2021. {
  2022. xCameraCurve += anInt998 + (j2 * anInt999) / 1000;
  2023. xCameraCurve &= 0x7ff;
  2024. }
  2025. if(j2 < 0)
  2026. {
  2027. xCameraCurve -= anInt998 + (-j2 * anInt999) / 1000;
  2028. xCameraCurve &= 0x7ff;
  2029. }
  2030. int k2 = i2 - xCameraCurve;
  2031. if(k2 > 1024)
  2032. k2 -= 2048;
  2033. if(k2 < -1024)
  2034. k2 += 2048;
  2035. if(k2 < 0 && j2 > 0 || k2 > 0 && j2 < 0)
  2036. xCameraCurve = i2;
  2037. }
  2038.  
  2039. private void drawMenu()
  2040. {
  2041. int i = menuOffsetX;
  2042. int j = menuOffsetY;
  2043. int k = menuWidth;
  2044. int l = anInt952;
  2045. int i1 = 0x5d5447;
  2046. DrawingArea.drawPixels(l, j, i, i1, k);
  2047. DrawingArea.drawPixels(16, j + 1, i + 1, 0, k - 2);
  2048. DrawingArea.fillPixels(i + 1, k - 2, l - 19, 0, j + 18);
  2049. chatTextDrawingArea.method385(i1, "Choose Option", j + 14, i + 3);
  2050. int j1 = super.mouseX;
  2051. int k1 = super.mouseY;
  2052. if(menuScreenArea == 0) {
  2053. j1 -= 4;
  2054. k1 -= 4;
  2055. }
  2056. if(menuScreenArea == 1) {
  2057. j1 -= 519;
  2058. k1 -= 168;
  2059. }
  2060. if(menuScreenArea == 2) {
  2061. j1 -= 17;
  2062. k1 -= 338;
  2063. }
  2064. if(menuScreenArea == 3) {
  2065. j1 -= 519;
  2066. k1 -= 0;
  2067. }
  2068. for(int l1 = 0; l1 < menuActionRow; l1++)
  2069. {
  2070. int i2 = j + 31 + (menuActionRow - 1 - l1) * 15;
  2071. int j2 = 0xffffff;
  2072. if(j1 > i && j1 < i + k && k1 > i2 - 13 && k1 < i2 + 3)
  2073. j2 = 0xffff00;
  2074. chatTextDrawingArea.method389(true, i + 3, j2, menuActionName[l1], i2);
  2075. }
  2076.  
  2077. }
  2078.  
  2079. private void addFriend(long l)
  2080. {
  2081. try
  2082. {
  2083. if(l == 0L)
  2084. return;
  2085. if(friendsCount >= 100 && anInt1046 != 1)
  2086. {
  2087. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  2088. return;
  2089. }
  2090. if(friendsCount >= 200)
  2091. {
  2092. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  2093. return;
  2094. }
  2095. String s = TextClass.fixName(TextClass.nameForLong(l));
  2096. for(int i = 0; i < friendsCount; i++)
  2097. if(friendsListAsLongs[i] == l)
  2098. {
  2099. pushMessage(s + " is already on your friend list", 0, "");
  2100. return;
  2101. }
  2102. for(int j = 0; j < ignoreCount; j++)
  2103. if(ignoreListAsLongs[j] == l)
  2104. {
  2105. pushMessage("Please remove " + s + " from your ignore list first", 0, "");
  2106. return;
  2107. }
  2108.  
  2109. if(s.equals(myPlayer.name))
  2110. {
  2111. return;
  2112. } else
  2113. {
  2114. friendsList[friendsCount] = s;
  2115. friendsListAsLongs[friendsCount] = l;
  2116. friendsNodeIDs[friendsCount] = 0;
  2117. friendsCount++;
  2118. needDrawTabArea = true;
  2119. stream.createFrame(188);
  2120. stream.writeQWord(l);
  2121. return;
  2122. }
  2123. }
  2124. catch(RuntimeException runtimeexception)
  2125. {
  2126. signlink.reporterror("15283, " + (byte)68 + ", " + l + ", " + runtimeexception.toString());
  2127. }
  2128. throw new RuntimeException();
  2129. }
  2130.  
  2131. private int method42(int i, int j, int k)
  2132. {
  2133. int l = k >> 7;
  2134. int i1 = j >> 7;
  2135. if(l < 0 || i1 < 0 || l > 103 || i1 > 103)
  2136. return 0;
  2137. int j1 = i;
  2138. if(j1 < 3 && (byteGroundArray[1][l][i1] & 2) == 2)
  2139. j1++;
  2140. int k1 = k & 0x7f;
  2141. int l1 = j & 0x7f;
  2142. int i2 = intGroundArray[j1][l][i1] * (128 - k1) + intGroundArray[j1][l + 1][i1] * k1 >> 7;
  2143. int j2 = intGroundArray[j1][l][i1 + 1] * (128 - k1) + intGroundArray[j1][l + 1][i1 + 1] * k1 >> 7;
  2144. return i2 * (128 - l1) + j2 * l1 >> 7;
  2145. }
  2146.  
  2147. private static String intToKOrMil(int j)
  2148. {
  2149. if(j < 0x186a0)
  2150. return String.valueOf(j);
  2151. if(j < 0x989680)
  2152. return j / 1000 + "K";
  2153. else
  2154. return j / 0xf4240 + "M";
  2155. }
  2156.  
  2157. private void resetLogout()
  2158. {
  2159. try
  2160. {
  2161. if(socketStream != null)
  2162. socketStream.close();
  2163. }
  2164. catch(Exception _ex) { }
  2165. socketStream = null;
  2166. loggedIn = false;
  2167. loginScreenState = 0;
  2168. // myUsername = "";
  2169. // myPassword = "";
  2170. unlinkMRUNodes();
  2171. worldController.initToNull();
  2172. for(int i = 0; i < 4; i++)
  2173. aClass11Array1230[i].method210();
  2174.  
  2175. System.gc();
  2176. stopMidi();
  2177. currentSong = -1;
  2178. nextSong = -1;
  2179. prevSong = 0;
  2180. }
  2181.  
  2182. private void method45()
  2183. {
  2184. aBoolean1031 = true;
  2185. for(int j = 0; j < 7; j++)
  2186. {
  2187. anIntArray1065[j] = -1;
  2188. for(int k = 0; k < IDK.length; k++)
  2189. {
  2190. if(IDK.cache[k].aBoolean662 || IDK.cache[k].anInt657 != j + (aBoolean1047 ? 0 : 7))
  2191. continue;
  2192. anIntArray1065[j] = k;
  2193. break;
  2194. }
  2195.  
  2196. }
  2197.  
  2198. }
  2199.  
  2200. private void method46(int i, Stream stream)
  2201. {
  2202. while(stream.bitPosition + 21 < i * 8)
  2203. {
  2204. int k = stream.readBits(14);
  2205. if(k == 16383)
  2206. break;
  2207. if(npcArray[k] == null)
  2208. npcArray[k] = new NPC();
  2209. NPC npc = npcArray[k];
  2210. npcIndices[npcCount++] = k;
  2211. npc.anInt1537 = loopCycle;
  2212. int l = stream.readBits(5);
  2213. if(l > 15)
  2214. l -= 32;
  2215. int i1 = stream.readBits(5);
  2216. if(i1 > 15)
  2217. i1 -= 32;
  2218. int j1 = stream.readBits(1);
  2219. npc.desc = EntityDef.forID(stream.readBits(12));
  2220. int k1 = stream.readBits(1);
  2221. if(k1 == 1)
  2222. anIntArray894[anInt893++] = k;
  2223. npc.anInt1540 = npc.desc.aByte68;
  2224. npc.anInt1504 = npc.desc.anInt79;
  2225. npc.anInt1554 = npc.desc.anInt67;
  2226. npc.anInt1555 = npc.desc.anInt58;
  2227. npc.anInt1556 = npc.desc.anInt83;
  2228. npc.anInt1557 = npc.desc.anInt55;
  2229. npc.anInt1511 = npc.desc.anInt77;
  2230. npc.setPos(myPlayer.smallX[0] + i1, myPlayer.smallY[0] + l, j1 == 1);
  2231. }
  2232. stream.finishBitAccess();
  2233. }
  2234.  
  2235. public void processGameLoop()
  2236. {
  2237. if(rsAlreadyLoaded || loadingError || genericLoadingError)
  2238. return;
  2239. loopCycle++;
  2240. if(!loggedIn)
  2241. processLoginScreenInput();
  2242. else
  2243. mainGameProcessor();
  2244. processOnDemandQueue();
  2245. }
  2246.  
  2247. private void method47(boolean flag)
  2248. {
  2249. if(myPlayer.x >> 7 == destX && myPlayer.y >> 7 == destY)
  2250. destX = 0;
  2251. int j = playerCount;
  2252. if(flag)
  2253. j = 1;
  2254. for(int l = 0; l < j; l++)
  2255. {
  2256. Player player;
  2257. int i1;
  2258. if(flag)
  2259. {
  2260. player = myPlayer;
  2261. i1 = myPlayerIndex << 14;
  2262. } else
  2263. {
  2264. player = playerArray[playerIndices[l]];
  2265. i1 = playerIndices[l] << 14;
  2266. }
  2267. if(player == null || !player.isVisible())
  2268. continue;
  2269. player.aBoolean1699 = (lowMem && playerCount > 50 || playerCount > 200) && !flag && player.anInt1517 == player.anInt1511;
  2270. int j1 = player.x >> 7;
  2271. int k1 = player.y >> 7;
  2272. if(j1 < 0 || j1 >= 104 || k1 < 0 || k1 >= 104)
  2273. continue;
  2274. if(player.aModel_1714 != null && loopCycle >= player.anInt1707 && loopCycle < player.anInt1708)
  2275. {
  2276. player.aBoolean1699 = false;
  2277. player.anInt1709 = method42(plane, player.y, player.x);
  2278. worldController.method286(plane, player.y, player, player.anInt1552, player.anInt1722, player.x, player.anInt1709, player.anInt1719, player.anInt1721, i1, player.anInt1720);
  2279. continue;
  2280. }
  2281. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64)
  2282. {
  2283. if(anIntArrayArray929[j1][k1] == anInt1265)
  2284. continue;
  2285. anIntArrayArray929[j1][k1] = anInt1265;
  2286. }
  2287. player.anInt1709 = method42(plane, player.y, player.x);
  2288. worldController.method285(plane, player.anInt1552, player.anInt1709, i1, player.y, 60, player.x, player, player.aBoolean1541);
  2289. }
  2290.  
  2291. }
  2292.  
  2293. private boolean promptUserForInput(RSInterface class9)
  2294. {
  2295. int j = class9.contentType;
  2296. if(anInt900 == 2)
  2297. {
  2298. if(j == 201)
  2299. {
  2300. inputTaken = true;
  2301. inputDialogState = 0;
  2302. messagePromptRaised = true;
  2303. promptInput = "";
  2304. friendsListAction = 1;
  2305. aString1121 = "Enter name of friend to add to list";
  2306. }
  2307. if(j == 202)
  2308. {
  2309. inputTaken = true;
  2310. inputDialogState = 0;
  2311. messagePromptRaised = true;
  2312. promptInput = "";
  2313. friendsListAction = 2;
  2314. aString1121 = "Enter name of friend to delete from list";
  2315. }
  2316. }
  2317. if(j == 205)
  2318. {
  2319. anInt1011 = 250;
  2320. return true;
  2321. }
  2322. if(j == 501)
  2323. {
  2324. inputTaken = true;
  2325. inputDialogState = 0;
  2326. messagePromptRaised = true;
  2327. promptInput = "";
  2328. friendsListAction = 4;
  2329. aString1121 = "Enter name of player to add to list";
  2330. }
  2331. if(j == 502)
  2332. {
  2333. inputTaken = true;
  2334. inputDialogState = 0;
  2335. messagePromptRaised = true;
  2336. promptInput = "";
  2337. friendsListAction = 5;
  2338. aString1121 = "Enter name of player to delete from list";
  2339. }
  2340. if(j >= 300 && j <= 313)
  2341. {
  2342. int k = (j - 300) / 2;
  2343. int j1 = j & 1;
  2344. int i2 = anIntArray1065[k];
  2345. if(i2 != -1)
  2346. {
  2347. do
  2348. {
  2349. if(j1 == 0 && --i2 < 0)
  2350. i2 = IDK.length - 1;
  2351. if(j1 == 1 && ++i2 >= IDK.length)
  2352. i2 = 0;
  2353. } while(IDK.cache[i2].aBoolean662 || IDK.cache[i2].anInt657 != k + (aBoolean1047 ? 0 : 7));
  2354. anIntArray1065[k] = i2;
  2355. aBoolean1031 = true;
  2356. }
  2357. }
  2358. if(j >= 314 && j <= 323)
  2359. {
  2360. int l = (j - 314) / 2;
  2361. int k1 = j & 1;
  2362. int j2 = anIntArray990[l];
  2363. if(k1 == 0 && --j2 < 0)
  2364. j2 = anIntArrayArray1003[l].length - 1;
  2365. if(k1 == 1 && ++j2 >= anIntArrayArray1003[l].length)
  2366. j2 = 0;
  2367. anIntArray990[l] = j2;
  2368. aBoolean1031 = true;
  2369. }
  2370. if(j == 324 && !aBoolean1047)
  2371. {
  2372. aBoolean1047 = true;
  2373. method45();
  2374. }
  2375. if(j == 325 && aBoolean1047)
  2376. {
  2377. aBoolean1047 = false;
  2378. method45();
  2379. }
  2380. if(j == 326)
  2381. {
  2382. stream.createFrame(101);
  2383. stream.writeWordBigEndian(aBoolean1047 ? 0 : 1);
  2384. for(int i1 = 0; i1 < 7; i1++)
  2385. stream.writeWordBigEndian(anIntArray1065[i1]);
  2386.  
  2387. for(int l1 = 0; l1 < 5; l1++)
  2388. stream.writeWordBigEndian(anIntArray990[l1]);
  2389.  
  2390. return true;
  2391. }
  2392. if(j == 613)
  2393. canMute = !canMute;
  2394. if(j >= 601 && j <= 612)
  2395. {
  2396. clearTopInterfaces();
  2397. if(reportAbuseInput.length() > 0)
  2398. {
  2399. stream.createFrame(218);
  2400. stream.writeQWord(TextClass.longForName(reportAbuseInput));
  2401. stream.writeWordBigEndian(j - 601);
  2402. stream.writeWordBigEndian(canMute ? 1 : 0);
  2403. }
  2404. }
  2405. return false;
  2406. }
  2407.  
  2408. private void method49(Stream stream)
  2409. {
  2410. for(int j = 0; j < anInt893; j++)
  2411. {
  2412. int k = anIntArray894[j];
  2413. Player player = playerArray[k];
  2414. int l = stream.readUnsignedByte();
  2415. if((l & 0x40) != 0)
  2416. l += stream.readUnsignedByte() << 8;
  2417. method107(l, k, stream, player);
  2418. }
  2419.  
  2420. }
  2421.  
  2422. private void method50(int i, int k, int l, int i1, int j1)
  2423. {
  2424. int k1 = worldController.method300(j1, l, i);
  2425. if(k1 != 0)
  2426. {
  2427. int l1 = worldController.method304(j1, l, i, k1);
  2428. int k2 = l1 >> 6 & 3;
  2429. int i3 = l1 & 0x1f;
  2430. int k3 = k;
  2431. if(k1 > 0)
  2432. k3 = i1;
  2433. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  2434. int k4 = 24624 + l * 4 + (103 - i) * 512 * 4;
  2435. int i5 = k1 >> 14 & 0x7fff;
  2436. ObjectDef class46_2 = ObjectDef.forID(i5);
  2437. if(class46_2.anInt758 != -1)
  2438. {
  2439. Background background_2 = mapScenes[class46_2.anInt758];
  2440. if(background_2 != null)
  2441. {
  2442. int i6 = (class46_2.anInt744 * 4 - background_2.anInt1452) / 2;
  2443. int j6 = (class46_2.anInt761 * 4 - background_2.anInt1453) / 2;
  2444. background_2.method361(48 + l * 4 + i6, 48 + (104 - i - class46_2.anInt761) * 4 + j6);
  2445. }
  2446. } else
  2447. {
  2448. if(i3 == 0 || i3 == 2)
  2449. if(k2 == 0)
  2450. {
  2451. ai[k4] = k3;
  2452. ai[k4 + 512] = k3;
  2453. ai[k4 + 1024] = k3;
  2454. ai[k4 + 1536] = k3;
  2455. } else
  2456. if(k2 == 1)
  2457. {
  2458. ai[k4] = k3;
  2459. ai[k4 + 1] = k3;
  2460. ai[k4 + 2] = k3;
  2461. ai[k4 + 3] = k3;
  2462. } else
  2463. if(k2 == 2)
  2464. {
  2465. ai[k4 + 3] = k3;
  2466. ai[k4 + 3 + 512] = k3;
  2467. ai[k4 + 3 + 1024] = k3;
  2468. ai[k4 + 3 + 1536] = k3;
  2469. } else
  2470. if(k2 == 3)
  2471. {
  2472. ai[k4 + 1536] = k3;
  2473. ai[k4 + 1536 + 1] = k3;
  2474. ai[k4 + 1536 + 2] = k3;
  2475. ai[k4 + 1536 + 3] = k3;
  2476. }
  2477. if(i3 == 3)
  2478. if(k2 == 0)
  2479. ai[k4] = k3;
  2480. else
  2481. if(k2 == 1)
  2482. ai[k4 + 3] = k3;
  2483. else
  2484. if(k2 == 2)
  2485. ai[k4 + 3 + 1536] = k3;
  2486. else
  2487. if(k2 == 3)
  2488. ai[k4 + 1536] = k3;
  2489. if(i3 == 2)
  2490. if(k2 == 3)
  2491. {
  2492. ai[k4] = k3;
  2493. ai[k4 + 512] = k3;
  2494. ai[k4 + 1024] = k3;
  2495. ai[k4 + 1536] = k3;
  2496. } else
  2497. if(k2 == 0)
  2498. {
  2499. ai[k4] = k3;
  2500. ai[k4 + 1] = k3;
  2501. ai[k4 + 2] = k3;
  2502. ai[k4 + 3] = k3;
  2503. } else
  2504. if(k2 == 1)
  2505. {
  2506. ai[k4 + 3] = k3;
  2507. ai[k4 + 3 + 512] = k3;
  2508. ai[k4 + 3 + 1024] = k3;
  2509. ai[k4 + 3 + 1536] = k3;
  2510. } else
  2511. if(k2 == 2)
  2512. {
  2513. ai[k4 + 1536] = k3;
  2514. ai[k4 + 1536 + 1] = k3;
  2515. ai[k4 + 1536 + 2] = k3;
  2516. ai[k4 + 1536 + 3] = k3;
  2517. }
  2518. }
  2519. }
  2520. k1 = worldController.method302(j1, l, i);
  2521. if(k1 != 0)
  2522. {
  2523. int i2 = worldController.method304(j1, l, i, k1);
  2524. int l2 = i2 >> 6 & 3;
  2525. int j3 = i2 & 0x1f;
  2526. int l3 = k1 >> 14 & 0x7fff;
  2527. ObjectDef class46_1 = ObjectDef.forID(l3);
  2528. if(class46_1.anInt758 != -1)
  2529. {
  2530. Background background_1 = mapScenes[class46_1.anInt758];
  2531. if(background_1 != null)
  2532. {
  2533. int j5 = (class46_1.anInt744 * 4 - background_1.anInt1452) / 2;
  2534. int k5 = (class46_1.anInt761 * 4 - background_1.anInt1453) / 2;
  2535. background_1.method361(48 + l * 4 + j5, 48 + (104 - i - class46_1.anInt761) * 4 + k5);
  2536. }
  2537. } else
  2538. if(j3 == 9)
  2539. {
  2540. int l4 = 0xeeeeee;
  2541. if(k1 > 0)
  2542. l4 = 0xee0000;
  2543. int ai1[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  2544. int l5 = 24624 + l * 4 + (103 - i) * 512 * 4;
  2545. if(l2 == 0 || l2 == 2)
  2546. {
  2547. ai1[l5 + 1536] = l4;
  2548. ai1[l5 + 1024 + 1] = l4;
  2549. ai1[l5 + 512 + 2] = l4;
  2550. ai1[l5 + 3] = l4;
  2551. } else
  2552. {
  2553. ai1[l5] = l4;
  2554. ai1[l5 + 512 + 1] = l4;
  2555. ai1[l5 + 1024 + 2] = l4;
  2556. ai1[l5 + 1536 + 3] = l4;
  2557. }
  2558. }
  2559. }
  2560. k1 = worldController.method303(j1, l, i);
  2561. if(k1 != 0)
  2562. {
  2563. int j2 = k1 >> 14 & 0x7fff;
  2564. ObjectDef class46 = ObjectDef.forID(j2);
  2565. if(class46.anInt758 != -1)
  2566. {
  2567. Background background = mapScenes[class46.anInt758];
  2568. if(background != null)
  2569. {
  2570. int i4 = (class46.anInt744 * 4 - background.anInt1452) / 2;
  2571. int j4 = (class46.anInt761 * 4 - background.anInt1453) / 2;
  2572. background.method361(48 + l * 4 + i4, 48 + (104 - i - class46.anInt761) * 4 + j4);
  2573. }
  2574. }
  2575. }
  2576. }
  2577.  
  2578. private void loadTitleScreen()
  2579. {
  2580. aBackground_966 = new Background(titleStreamLoader, "titlebox", 0);
  2581. aBackground_967 = new Background(titleStreamLoader, "titlebutton", 0);
  2582. aBackgroundArray1152s = new Background[12];
  2583. int j = 0;
  2584. try
  2585. {
  2586. j = Integer.parseInt(getParameter("fl_icon"));
  2587. }
  2588. catch(Exception _ex) { }
  2589. if(j == 0)
  2590. {
  2591. for(int k = 0; k < 12; k++)
  2592. aBackgroundArray1152s[k] = new Background(titleStreamLoader, "runes", k);
  2593.  
  2594. } else
  2595. {
  2596. for(int l = 0; l < 12; l++)
  2597. aBackgroundArray1152s[l] = new Background(titleStreamLoader, "runes", 12 + (l & 3));
  2598.  
  2599. }
  2600. aClass30_Sub2_Sub1_Sub1_1201 = new Sprite(128, 265);
  2601. aClass30_Sub2_Sub1_Sub1_1202 = new Sprite(128, 265);
  2602. System.arraycopy(aRSImageProducer_1110.anIntArray315, 0, aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, 33920);
  2603.  
  2604. System.arraycopy(aRSImageProducer_1111.anIntArray315, 0, aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, 33920);
  2605.  
  2606. anIntArray851 = new int[256];
  2607. for(int k1 = 0; k1 < 64; k1++)
  2608. anIntArray851[k1] = k1 * 0x40000;
  2609.  
  2610. for(int l1 = 0; l1 < 64; l1++)
  2611. anIntArray851[l1 + 64] = 0xff0000 + 1024 * l1;
  2612.  
  2613. for(int i2 = 0; i2 < 64; i2++)
  2614. anIntArray851[i2 + 128] = 0xffff00 + 4 * i2;
  2615.  
  2616. for(int j2 = 0; j2 < 64; j2++)
  2617. anIntArray851[j2 + 192] = 0xffffff;
  2618.  
  2619. anIntArray852 = new int[256];
  2620. for(int k2 = 0; k2 < 64; k2++)
  2621. anIntArray852[k2] = k2 * 1024;
  2622.  
  2623. for(int l2 = 0; l2 < 64; l2++)
  2624. anIntArray852[l2 + 64] = 65280 + 4 * l2;
  2625.  
  2626. for(int i3 = 0; i3 < 64; i3++)
  2627. anIntArray852[i3 + 128] = 65535 + 0x40000 * i3;
  2628.  
  2629. for(int j3 = 0; j3 < 64; j3++)
  2630. anIntArray852[j3 + 192] = 0xffffff;
  2631.  
  2632. anIntArray853 = new int[256];
  2633. for(int k3 = 0; k3 < 64; k3++)
  2634. anIntArray853[k3] = k3 * 4;
  2635.  
  2636. for(int l3 = 0; l3 < 64; l3++)
  2637. anIntArray853[l3 + 64] = 255 + 0x40000 * l3;
  2638.  
  2639. for(int i4 = 0; i4 < 64; i4++)
  2640. anIntArray853[i4 + 128] = 0xff00ff + 1024 * i4;
  2641.  
  2642. for(int j4 = 0; j4 < 64; j4++)
  2643. anIntArray853[j4 + 192] = 0xffffff;
  2644.  
  2645. anIntArray850 = new int[256];
  2646. anIntArray1190 = new int[32768];
  2647. anIntArray1191 = new int[32768];
  2648. randomizeBackground(null);
  2649. anIntArray828 = new int[32768];
  2650. anIntArray829 = new int[32768];
  2651. drawLoadingText(10, "Connecting to fileserver");
  2652. if(!aBoolean831)
  2653. {
  2654. drawFlames = true;
  2655. aBoolean831 = true;
  2656. startRunnable(this, 2);
  2657. }
  2658. }
  2659.  
  2660. private static void setHighMem()
  2661. {
  2662. WorldController.lowMem = false;
  2663. Texture.lowMem = false;
  2664. lowMem = false;
  2665. ObjectManager.lowMem = false;
  2666. ObjectDef.lowMem = false;
  2667. }
  2668.  
  2669. public static void main(String args[]) {
  2670. try {
  2671. System.out.println("MiscellaPS - release v1" + 317);
  2672. if(args.length != 5) {
  2673. System.out.println("Usage: node-id, port-offset, [lowmem/highmem], [free/members], storeid");
  2674. return;
  2675. }
  2676. nodeID = Integer.parseInt(args[0]);
  2677. portOff = Integer.parseInt(args[1]);
  2678. if(args[2].equals("lowmem"))
  2679. setLowMem();
  2680. else if(args[2].equals("highmem")) {
  2681. setHighMem();
  2682. } else {
  2683. System.out.println("Usage: node-id, port-offset, [lowmem/highmem], [free/members], storeid");
  2684. return;
  2685. }
  2686. if(args[3].equals("free"))
  2687. isMembers = false;
  2688. else if(args[3].equals("members")) {
  2689. isMembers = true;
  2690. } else {
  2691. System.out.println("Usage: node-id, port-offset, [lowmem/highmem], [free/members], storeid");
  2692. return;
  2693. }
  2694. signlink.storeid = Integer.parseInt(args[4]);
  2695. signlink.startpriv(InetAddress.getLocalHost());
  2696. new Jframe(args);
  2697. //client client1 = new client();
  2698. //client1.createClientFrame(503, 765);
  2699. } catch(Exception exception) {
  2700. }
  2701. }
  2702.  
  2703. private void loadingStages()
  2704. {
  2705. if(lowMem && loadingStage == 2 && ObjectManager.anInt131 != plane)
  2706. {
  2707. aRSImageProducer_1165.initDrawingArea();
  2708. aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151, 257);
  2709. aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.", 150, 256);
  2710. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  2711. loadingStage = 1;
  2712. aLong824 = System.currentTimeMillis();
  2713. }
  2714. if(loadingStage == 1)
  2715. {
  2716. int j = method54();
  2717. if(j != 0 && System.currentTimeMillis() - aLong824 > 0x57e40L)
  2718. {
  2719. signlink.reporterror(myUsername + " glcfb " + aLong1215 + "," + j + "," + lowMem + "," + decompressors[0] + "," + onDemandFetcher.getNodeCount() + "," + plane + "," + anInt1069 + "," + anInt1070);
  2720. aLong824 = System.currentTimeMillis();
  2721. }
  2722. }
  2723. if(loadingStage == 2 && plane != anInt985)
  2724. {
  2725. anInt985 = plane;
  2726. method24(plane);
  2727. }
  2728. }
  2729.  
  2730. private int method54()
  2731. {
  2732. for(int i = 0; i < aByteArrayArray1183.length; i++)
  2733. {
  2734. if(aByteArrayArray1183[i] == null && anIntArray1235[i] != -1)
  2735. return -1;
  2736. if(aByteArrayArray1247[i] == null && anIntArray1236[i] != -1)
  2737. return -2;
  2738. }
  2739.  
  2740. boolean flag = true;
  2741. for(int j = 0; j < aByteArrayArray1183.length; j++)
  2742. {
  2743. byte abyte0[] = aByteArrayArray1247[j];
  2744. if(abyte0 != null)
  2745. {
  2746. int k = (anIntArray1234[j] >> 8) * 64 - baseX;
  2747. int l = (anIntArray1234[j] & 0xff) * 64 - baseY;
  2748. if(aBoolean1159)
  2749. {
  2750. k = 10;
  2751. l = 10;
  2752. }
  2753. flag &= ObjectManager.method189(k, abyte0, l);
  2754. }
  2755. }
  2756.  
  2757. if(!flag)
  2758. return -3;
  2759. if(aBoolean1080)
  2760. {
  2761. return -4;
  2762. } else
  2763. {
  2764. loadingStage = 2;
  2765. ObjectManager.anInt131 = plane;
  2766. method22();
  2767. stream.createFrame(121);
  2768. return 0;
  2769. }
  2770. }
  2771.  
  2772. private void method55()
  2773. {
  2774. 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())
  2775. if(class30_sub2_sub4_sub4.anInt1597 != plane || loopCycle > class30_sub2_sub4_sub4.anInt1572)
  2776. class30_sub2_sub4_sub4.unlink();
  2777. else
  2778. if(loopCycle >= class30_sub2_sub4_sub4.anInt1571)
  2779. {
  2780. if(class30_sub2_sub4_sub4.anInt1590 > 0)
  2781. {
  2782. NPC npc = npcArray[class30_sub2_sub4_sub4.anInt1590 - 1];
  2783. if(npc != null && npc.x >= 0 && npc.x < 13312 && npc.y >= 0 && npc.y < 13312)
  2784. 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);
  2785. }
  2786. if(class30_sub2_sub4_sub4.anInt1590 < 0)
  2787. {
  2788. int j = -class30_sub2_sub4_sub4.anInt1590 - 1;
  2789. Player player;
  2790. if(j == unknownInt10)
  2791. player = myPlayer;
  2792. else
  2793. player = playerArray[j];
  2794. if(player != null && player.x >= 0 && player.x < 13312 && player.y >= 0 && player.y < 13312)
  2795. 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);
  2796. }
  2797. class30_sub2_sub4_sub4.method456(anInt945);
  2798. 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);
  2799. }
  2800.  
  2801. }
  2802.  
  2803. public AppletContext getAppletContext()
  2804. {
  2805. if(signlink.mainapp != null)
  2806. return signlink.mainapp.getAppletContext();
  2807. else
  2808. return super.getAppletContext();
  2809. }
  2810.  
  2811. private void drawLogo()
  2812. {
  2813. byte abyte0[] = titleStreamLoader.getDataForName("title.dat");
  2814. Sprite sprite = new Sprite(abyte0, this);
  2815. aRSImageProducer_1110.initDrawingArea();
  2816. sprite.method346(0, 0);
  2817. aRSImageProducer_1111.initDrawingArea();
  2818. sprite.method346(-637, 0);
  2819. aRSImageProducer_1107.initDrawingArea();
  2820. sprite.method346(-128, 0);
  2821. aRSImageProducer_1108.initDrawingArea();
  2822. sprite.method346(-202, -371);
  2823. aRSImageProducer_1109.initDrawingArea();
  2824. sprite.method346(-202, -171);
  2825. aRSImageProducer_1112.initDrawingArea();
  2826. sprite.method346(0, -265);
  2827. aRSImageProducer_1113.initDrawingArea();
  2828. sprite.method346(-562, -265);
  2829. aRSImageProducer_1114.initDrawingArea();
  2830. sprite.method346(-128, -171);
  2831. aRSImageProducer_1115.initDrawingArea();
  2832. sprite.method346(-562, -171);
  2833. int ai[] = new int[sprite.myWidth];
  2834. for(int j = 0; j < sprite.myHeight; j++)
  2835. {
  2836. for(int k = 0; k < sprite.myWidth; k++)
  2837. ai[k] = sprite.myPixels[(sprite.myWidth - k - 1) + sprite.myWidth * j];
  2838.  
  2839. System.arraycopy(ai, 0, sprite.myPixels, sprite.myWidth * j, sprite.myWidth);
  2840.  
  2841. }
  2842.  
  2843. aRSImageProducer_1110.initDrawingArea();
  2844. sprite.method346(382, 0);
  2845. aRSImageProducer_1111.initDrawingArea();
  2846. sprite.method346(-255, 0);
  2847. aRSImageProducer_1107.initDrawingArea();
  2848. sprite.method346(254, 0);
  2849. aRSImageProducer_1108.initDrawingArea();
  2850. sprite.method346(180, -371);
  2851. aRSImageProducer_1109.initDrawingArea();
  2852. sprite.method346(180, -171);
  2853. aRSImageProducer_1112.initDrawingArea();
  2854. sprite.method346(382, -265);
  2855. aRSImageProducer_1113.initDrawingArea();
  2856. sprite.method346(-180, -265);
  2857. aRSImageProducer_1114.initDrawingArea();
  2858. sprite.method346(254, -171);
  2859. aRSImageProducer_1115.initDrawingArea();
  2860. sprite.method346(-180, -171);
  2861. sprite = new Sprite(titleStreamLoader, "logo", 0);
  2862. aRSImageProducer_1107.initDrawingArea();
  2863. sprite.drawSprite(382 - sprite.myWidth / 2 - 128, 18);
  2864. sprite = null;
  2865. Object obj = null;
  2866. Object obj1 = null;
  2867. System.gc();
  2868.  
  2869. }
  2870.  
  2871. private void processOnDemandQueue()
  2872. {
  2873. do
  2874. {
  2875. OnDemandData onDemandData;
  2876. do
  2877. {
  2878. onDemandData = onDemandFetcher.getNextNode();
  2879. if(onDemandData == null)
  2880. return;
  2881. if(onDemandData.dataType == 0)
  2882. {
  2883. Model.method460(onDemandData.buffer, onDemandData.ID);
  2884. if((onDemandFetcher.getModelIndex(onDemandData.ID) & 0x62) != 0)
  2885. {
  2886. needDrawTabArea = true;
  2887. if(backDialogID != -1)
  2888. inputTaken = true;
  2889. }
  2890. }
  2891. if(onDemandData.dataType == 1 && onDemandData.buffer != null)
  2892. Class36.method529(onDemandData.buffer);
  2893. if(onDemandData.dataType == 2 && onDemandData.ID == nextSong && onDemandData.buffer != null)
  2894. saveMidi(songChanging, onDemandData.buffer);
  2895. if(onDemandData.dataType == 3 && loadingStage == 1)
  2896. {
  2897. for(int i = 0; i < aByteArrayArray1183.length; i++)
  2898. {
  2899. if(anIntArray1235[i] == onDemandData.ID)
  2900. {
  2901. aByteArrayArray1183[i] = onDemandData.buffer;
  2902. if(onDemandData.buffer == null)
  2903. anIntArray1235[i] = -1;
  2904. break;
  2905. }
  2906. if(anIntArray1236[i] != onDemandData.ID)
  2907. continue;
  2908. aByteArrayArray1247[i] = onDemandData.buffer;
  2909. if(onDemandData.buffer == null)
  2910. anIntArray1236[i] = -1;
  2911. break;
  2912. }
  2913.  
  2914. }
  2915. } while(onDemandData.dataType != 93 || !onDemandFetcher.method564(onDemandData.ID));
  2916. ObjectManager.method173(new Stream(onDemandData.buffer), onDemandFetcher);
  2917. } while(true);
  2918. }
  2919.  
  2920. private void calcFlamesPosition()
  2921. {
  2922. char c = '\u0100';
  2923. for(int j = 10; j < 117; j++)
  2924. {
  2925. int k = (int)(Math.random() * 100D);
  2926. if(k < 50)
  2927. anIntArray828[j + (c - 2 << 7)] = 255;
  2928. }
  2929. for(int l = 0; l < 100; l++)
  2930. {
  2931. int i1 = (int)(Math.random() * 124D) + 2;
  2932. int k1 = (int)(Math.random() * 128D) + 128;
  2933. int k2 = i1 + (k1 << 7);
  2934. anIntArray828[k2] = 192;
  2935. }
  2936.  
  2937. for(int j1 = 1; j1 < c - 1; j1++)
  2938. {
  2939. for(int l1 = 1; l1 < 127; l1++)
  2940. {
  2941. int l2 = l1 + (j1 << 7);
  2942. anIntArray829[l2] = (anIntArray828[l2 - 1] + anIntArray828[l2 + 1] + anIntArray828[l2 - 128] + anIntArray828[l2 + 128]) / 4;
  2943. }
  2944.  
  2945. }
  2946.  
  2947. anInt1275 += 128;
  2948. if(anInt1275 > anIntArray1190.length)
  2949. {
  2950. anInt1275 -= anIntArray1190.length;
  2951. int i2 = (int)(Math.random() * 12D);
  2952. randomizeBackground(aBackgroundArray1152s[i2]);
  2953. }
  2954. for(int j2 = 1; j2 < c - 1; j2++)
  2955. {
  2956. for(int i3 = 1; i3 < 127; i3++)
  2957. {
  2958. int k3 = i3 + (j2 << 7);
  2959. int i4 = anIntArray829[k3 + 128] - anIntArray1190[k3 + anInt1275 & anIntArray1190.length - 1] / 5;
  2960. if(i4 < 0)
  2961. i4 = 0;
  2962. anIntArray828[k3] = i4;
  2963. }
  2964.  
  2965. }
  2966.  
  2967. System.arraycopy(anIntArray969, 1, anIntArray969, 0, c - 1);
  2968.  
  2969. anIntArray969[c - 1] = (int)(Math.sin((double)loopCycle / 14D) * 16D + Math.sin((double)loopCycle / 15D) * 14D + Math.sin((double)loopCycle / 16D) * 12D);
  2970. if(anInt1040 > 0)
  2971. anInt1040 -= 4;
  2972. if(anInt1041 > 0)
  2973. anInt1041 -= 4;
  2974. if(anInt1040 == 0 && anInt1041 == 0)
  2975. {
  2976. int l3 = (int)(Math.random() * 2000D);
  2977. if(l3 == 0)
  2978. anInt1040 = 1024;
  2979. if(l3 == 1)
  2980. anInt1041 = 1024;
  2981. }
  2982. }
  2983.  
  2984. private boolean saveWave(byte abyte0[], int i)
  2985. {
  2986. return abyte0 == null || signlink.wavesave(abyte0, i);
  2987. }
  2988.  
  2989. private void method60(int i)
  2990. {
  2991. RSInterface class9 = RSInterface.interfaceCache[i];
  2992. for(int j = 0; j < class9.children.length; j++)
  2993. {
  2994. if(class9.children[j] == -1)
  2995. break;
  2996. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j]];
  2997. if(class9_1.type == 1)
  2998. method60(class9_1.id);
  2999. class9_1.anInt246 = 0;
  3000. class9_1.anInt208 = 0;
  3001. }
  3002. }
  3003.  
  3004. private void drawHeadIcon()
  3005. {
  3006. if(anInt855 != 2)
  3007. return;
  3008. calcEntityScreenPos((anInt934 - baseX << 7) + anInt937, anInt936 * 2, (anInt935 - baseY << 7) + anInt938);
  3009. if(spriteDrawX > -1 && loopCycle % 20 < 10)
  3010. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  3011. }
  3012.  
  3013. private void mainGameProcessor()
  3014. {
  3015. if(anInt1104 > 1)
  3016. anInt1104--;
  3017. if(anInt1011 > 0)
  3018. anInt1011--;
  3019. for(int j = 0; j < 5; j++)
  3020. if(!parsePacket())
  3021. break;
  3022.  
  3023. if(!loggedIn)
  3024. return;
  3025. synchronized(mouseDetection.syncObject)
  3026. {
  3027. if(flagged)
  3028. {
  3029. if(super.clickMode3 != 0 || mouseDetection.coordsIndex >= 40)
  3030. {
  3031. stream.createFrame(45);
  3032. stream.writeWordBigEndian(0);
  3033. int j2 = stream.currentOffset;
  3034. int j3 = 0;
  3035. for(int j4 = 0; j4 < mouseDetection.coordsIndex; j4++)
  3036. {
  3037. if(j2 - stream.currentOffset >= 240)
  3038. break;
  3039. j3++;
  3040. int l4 = mouseDetection.coordsY[j4];
  3041. if(l4 < 0)
  3042. l4 = 0;
  3043. else
  3044. if(l4 > 502)
  3045. l4 = 502;
  3046. int k5 = mouseDetection.coordsX[j4];
  3047. if(k5 < 0)
  3048. k5 = 0;
  3049. else
  3050. if(k5 > 764)
  3051. k5 = 764;
  3052. int i6 = l4 * 765 + k5;
  3053. if(mouseDetection.coordsY[j4] == -1 && mouseDetection.coordsX[j4] == -1)
  3054. {
  3055. k5 = -1;
  3056. l4 = -1;
  3057. i6 = 0x7ffff;
  3058. }
  3059. if(k5 == anInt1237 && l4 == anInt1238)
  3060. {
  3061. if(anInt1022 < 2047)
  3062. anInt1022++;
  3063. } else
  3064. {
  3065. int j6 = k5 - anInt1237;
  3066. anInt1237 = k5;
  3067. int k6 = l4 - anInt1238;
  3068. anInt1238 = l4;
  3069. if(anInt1022 < 8 && j6 >= -32 && j6 <= 31 && k6 >= -32 && k6 <= 31)
  3070. {
  3071. j6 += 32;
  3072. k6 += 32;
  3073. stream.writeWord((anInt1022 << 12) + (j6 << 6) + k6);
  3074. anInt1022 = 0;
  3075. } else
  3076. if(anInt1022 < 8)
  3077. {
  3078. stream.writeDWordBigEndian(0x800000 + (anInt1022 << 19) + i6);
  3079. anInt1022 = 0;
  3080. } else
  3081. {
  3082. stream.writeDWord(0xc0000000 + (anInt1022 << 19) + i6);
  3083. anInt1022 = 0;
  3084. }
  3085. }
  3086. }
  3087.  
  3088. stream.writeBytes(stream.currentOffset - j2);
  3089. if(j3 >= mouseDetection.coordsIndex)
  3090. {
  3091. mouseDetection.coordsIndex = 0;
  3092. } else
  3093. {
  3094. mouseDetection.coordsIndex -= j3;
  3095. for(int i5 = 0; i5 < mouseDetection.coordsIndex; i5++)
  3096. {
  3097. mouseDetection.coordsX[i5] = mouseDetection.coordsX[i5 + j3];
  3098. mouseDetection.coordsY[i5] = mouseDetection.coordsY[i5 + j3];
  3099. }
  3100.  
  3101. }
  3102. }
  3103. } else
  3104. {
  3105. mouseDetection.coordsIndex = 0;
  3106. }
  3107. }
  3108. if(super.clickMode3 != 0)
  3109. {
  3110. long l = (super.aLong29 - aLong1220) / 50L;
  3111. if(l > 4095L)
  3112. l = 4095L;
  3113. aLong1220 = super.aLong29;
  3114. int k2 = super.saveClickY;
  3115. if(k2 < 0)
  3116. k2 = 0;
  3117. else
  3118. if(k2 > 502)
  3119. k2 = 502;
  3120. int k3 = super.saveClickX;
  3121. if(k3 < 0)
  3122. k3 = 0;
  3123. else
  3124. if(k3 > 764)
  3125. k3 = 764;
  3126. int k4 = k2 * 765 + k3;
  3127. int j5 = 0;
  3128. if(super.clickMode3 == 2)
  3129. j5 = 1;
  3130. int l5 = (int)l;
  3131. stream.createFrame(241);
  3132. stream.writeDWord((l5 << 20) + (j5 << 19) + k4);
  3133. }
  3134. if(anInt1016 > 0)
  3135. anInt1016--;
  3136. if(super.keyArray[1] == 1 || super.keyArray[2] == 1 || super.keyArray[3] == 1 || super.keyArray[4] == 1)
  3137. aBoolean1017 = true;
  3138. if(aBoolean1017 && anInt1016 <= 0)
  3139. {
  3140. anInt1016 = 20;
  3141. aBoolean1017 = false;
  3142. stream.createFrame(86);
  3143. stream.writeWord(anInt1184);
  3144. stream.method432(minimapInt1);
  3145. }
  3146. if(super.awtFocus && !aBoolean954)
  3147. {
  3148. aBoolean954 = true;
  3149. stream.createFrame(3);
  3150. stream.writeWordBigEndian(1);
  3151. }
  3152. if(!super.awtFocus && aBoolean954)
  3153. {
  3154. aBoolean954 = false;
  3155. stream.createFrame(3);
  3156. stream.writeWordBigEndian(0);
  3157. }
  3158. loadingStages();
  3159. method115();
  3160. method90();
  3161. anInt1009++;
  3162. if(anInt1009 > 750)
  3163. dropClient();
  3164. method114();
  3165. method95();
  3166. method38();
  3167. anInt945++;
  3168. if(crossType != 0)
  3169. {
  3170. crossIndex += 20;
  3171. if(crossIndex >= 400)
  3172. crossType = 0;
  3173. }
  3174. if(atInventoryInterfaceType != 0)
  3175. {
  3176. atInventoryLoopCycle++;
  3177. if(atInventoryLoopCycle >= 15)
  3178. {
  3179. if(atInventoryInterfaceType == 2)
  3180. needDrawTabArea = true;
  3181. if(atInventoryInterfaceType == 3)
  3182. inputTaken = true;
  3183. atInventoryInterfaceType = 0;
  3184. }
  3185. }
  3186. if(activeInterfaceType != 0)
  3187. {
  3188. anInt989++;
  3189. if(super.mouseX > anInt1087 + 5 || super.mouseX < anInt1087 - 5 || super.mouseY > anInt1088 + 5 || super.mouseY < anInt1088 - 5)
  3190. aBoolean1242 = true;
  3191. if(super.clickMode2 == 0)
  3192. {
  3193. if(activeInterfaceType == 2)
  3194. needDrawTabArea = true;
  3195. if(activeInterfaceType == 3)
  3196. inputTaken = true;
  3197. activeInterfaceType = 0;
  3198. if(aBoolean1242 && anInt989 >= 15)
  3199. {
  3200. lastActiveInvInterface = -1;
  3201. processRightClick();
  3202. if(lastActiveInvInterface == anInt1084 && mouseInvInterfaceIndex != anInt1085)
  3203. {
  3204. RSInterface class9 = RSInterface.interfaceCache[anInt1084];
  3205. int j1 = 0;
  3206. if(anInt913 == 1 && class9.contentType == 206)
  3207. j1 = 1;
  3208. if(class9.inv[mouseInvInterfaceIndex] <= 0)
  3209. j1 = 0;
  3210. if(class9.aBoolean235)
  3211. {
  3212. int l2 = anInt1085;
  3213. int l3 = mouseInvInterfaceIndex;
  3214. class9.inv[l3] = class9.inv[l2];
  3215. class9.invStackSizes[l3] = class9.invStackSizes[l2];
  3216. class9.inv[l2] = -1;
  3217. class9.invStackSizes[l2] = 0;
  3218. } else
  3219. if(j1 == 1)
  3220. {
  3221. int i3 = anInt1085;
  3222. for(int i4 = mouseInvInterfaceIndex; i3 != i4;)
  3223. if(i3 > i4)
  3224. {
  3225. class9.swapInventoryItems(i3, i3 - 1);
  3226. i3--;
  3227. } else
  3228. if(i3 < i4)
  3229. {
  3230. class9.swapInventoryItems(i3, i3 + 1);
  3231. i3++;
  3232. }
  3233.  
  3234. } else
  3235. {
  3236. class9.swapInventoryItems(anInt1085, mouseInvInterfaceIndex);
  3237. }
  3238. stream.createFrame(214);
  3239. stream.method433(anInt1084);
  3240. stream.method424(j1);
  3241. stream.method433(anInt1085);
  3242. stream.method431(mouseInvInterfaceIndex);
  3243. }
  3244. } else
  3245. if((anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  3246. determineMenuSize();
  3247. else
  3248. if(menuActionRow > 0)
  3249. doAction(menuActionRow - 1);
  3250. atInventoryLoopCycle = 10;
  3251. super.clickMode3 = 0;
  3252. }
  3253. }
  3254. if(WorldController.anInt470 != -1)
  3255. {
  3256. int k = WorldController.anInt470;
  3257. int k1 = WorldController.anInt471;
  3258. boolean flag = doWalkTo(0, 0, 0, 0, myPlayer.smallY[0], 0, 0, k1, myPlayer.smallX[0], true, k);
  3259. WorldController.anInt470 = -1;
  3260. if(flag)
  3261. {
  3262. crossX = super.saveClickX;
  3263. crossY = super.saveClickY;
  3264. crossType = 1;
  3265. crossIndex = 0;
  3266. }
  3267. }
  3268. if(super.clickMode3 == 1 && aString844 != null)
  3269. {
  3270. aString844 = null;
  3271. inputTaken = true;
  3272. super.clickMode3 = 0;
  3273. }
  3274. processMenuClick();
  3275. processMainScreenClick();
  3276. processTabClick();
  3277. processMapAreaClick();
  3278. processChatModeClick();
  3279. if(super.clickMode2 == 1 || super.clickMode3 == 1)
  3280. anInt1213++;
  3281. if(loadingStage == 2)
  3282. method108();
  3283. if(loadingStage == 2 && aBoolean1160)
  3284. calcCameraPos();
  3285. for(int i1 = 0; i1 < 5; i1++)
  3286. anIntArray1030[i1]++;
  3287.  
  3288. method73();
  3289. super.idleTime++;
  3290. if(super.idleTime > 4500)
  3291. {
  3292. anInt1011 = 250;
  3293. super.idleTime -= 500;
  3294. stream.createFrame(202);
  3295. }
  3296. anInt988++;
  3297. if(anInt988 > 500)
  3298. {
  3299. anInt988 = 0;
  3300. int l1 = (int)(Math.random() * 8D);
  3301. if((l1 & 1) == 1)
  3302. anInt1278 += anInt1279;
  3303. if((l1 & 2) == 2)
  3304. anInt1131 += anInt1132;
  3305. if((l1 & 4) == 4)
  3306. anInt896 += anInt897;
  3307. }
  3308. if(anInt1278 < -50)
  3309. anInt1279 = 2;
  3310. if(anInt1278 > 50)
  3311. anInt1279 = -2;
  3312. if(anInt1131 < -55)
  3313. anInt1132 = 2;
  3314. if(anInt1131 > 55)
  3315. anInt1132 = -2;
  3316. if(anInt896 < -40)
  3317. anInt897 = 1;
  3318. if(anInt896 > 40)
  3319. anInt897 = -1;
  3320. anInt1254++;
  3321. if(anInt1254 > 500)
  3322. {
  3323. anInt1254 = 0;
  3324. int i2 = (int)(Math.random() * 8D);
  3325. if((i2 & 1) == 1)
  3326. minimapInt2 += anInt1210;
  3327. if((i2 & 2) == 2)
  3328. minimapInt3 += anInt1171;
  3329. }
  3330. if(minimapInt2 < -60)
  3331. anInt1210 = 2;
  3332. if(minimapInt2 > 60)
  3333. anInt1210 = -2;
  3334. if(minimapInt3 < -20)
  3335. anInt1171 = 1;
  3336. if(minimapInt3 > 10)
  3337. anInt1171 = -1;
  3338. anInt1010++;
  3339. if(anInt1010 > 50)
  3340. stream.createFrame(0);
  3341. try
  3342. {
  3343. if(socketStream != null && stream.currentOffset > 0)
  3344. {
  3345. socketStream.queueBytes(stream.currentOffset, stream.buffer);
  3346. stream.currentOffset = 0;
  3347. anInt1010 = 0;
  3348. }
  3349. }
  3350. catch(IOException _ex)
  3351. {
  3352. dropClient();
  3353. }
  3354. catch(Exception exception)
  3355. {
  3356. resetLogout();
  3357. }
  3358. }
  3359.  
  3360. private void method63()
  3361. {
  3362. Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst();
  3363. for(; class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  3364. if(class30_sub1.anInt1294 == -1)
  3365. {
  3366. class30_sub1.anInt1302 = 0;
  3367. method89(class30_sub1);
  3368. } else
  3369. {
  3370. class30_sub1.unlink();
  3371. }
  3372.  
  3373. }
  3374.  
  3375. private void resetImageProducers()
  3376. {
  3377. if(aRSImageProducer_1107 != null)
  3378. return;
  3379. super.fullGameScreen = null;
  3380. aRSImageProducer_1166 = null;
  3381. aRSImageProducer_1164 = null;
  3382. aRSImageProducer_1163 = null;
  3383. aRSImageProducer_1165 = null;
  3384. aRSImageProducer_1123 = null;
  3385. aRSImageProducer_1124 = null;
  3386. aRSImageProducer_1125 = null;
  3387. aRSImageProducer_1110 = new RSImageProducer(128, 265, getGameComponent());
  3388. DrawingArea.setAllPixelsToZero();
  3389. aRSImageProducer_1111 = new RSImageProducer(128, 265, getGameComponent());
  3390. DrawingArea.setAllPixelsToZero();
  3391. aRSImageProducer_1107 = new RSImageProducer(509, 171, getGameComponent());
  3392. DrawingArea.setAllPixelsToZero();
  3393. aRSImageProducer_1108 = new RSImageProducer(360, 132, getGameComponent());
  3394. DrawingArea.setAllPixelsToZero();
  3395. aRSImageProducer_1109 = new RSImageProducer(360, 200, getGameComponent());
  3396. DrawingArea.setAllPixelsToZero();
  3397. aRSImageProducer_1112 = new RSImageProducer(202, 238, getGameComponent());
  3398. DrawingArea.setAllPixelsToZero();
  3399. aRSImageProducer_1113 = new RSImageProducer(203, 238, getGameComponent());
  3400. DrawingArea.setAllPixelsToZero();
  3401. aRSImageProducer_1114 = new RSImageProducer(74, 94, getGameComponent());
  3402. DrawingArea.setAllPixelsToZero();
  3403. aRSImageProducer_1115 = new RSImageProducer(75, 94, getGameComponent());
  3404. DrawingArea.setAllPixelsToZero();
  3405. if(titleStreamLoader != null)
  3406. {
  3407. drawLogo();
  3408. loadTitleScreen();
  3409. }
  3410. welcomeScreenRaised = true;
  3411. }
  3412.  
  3413. void drawLoadingText(int i, String s)
  3414. {
  3415. anInt1079 = i;
  3416. aString1049 = s;
  3417. resetImageProducers();
  3418. if(titleStreamLoader == null)
  3419. {
  3420. super.drawLoadingText(i, s);
  3421. return;
  3422. }
  3423. aRSImageProducer_1109.initDrawingArea();
  3424. char c = '\u0168';
  3425. char c1 = '\310';
  3426. byte byte1 = 20;
  3427. chatTextDrawingArea.drawText(0xffffff, "RuneScape is loading - please wait...", c1 / 2 - 26 - byte1, c / 2);
  3428. int j = c1 / 2 - 18 - byte1;
  3429. DrawingArea.fillPixels(c / 2 - 152, 304, 34, 0x8c1111, j);
  3430. DrawingArea.fillPixels(c / 2 - 151, 302, 32, 0, j + 1);
  3431. DrawingArea.drawPixels(30, j + 2, c / 2 - 150, 0x8c1111, i * 3);
  3432. DrawingArea.drawPixels(30, j + 2, (c / 2 - 150) + i * 3, 0, 300 - i * 3);
  3433. chatTextDrawingArea.drawText(0xffffff, s, (c1 / 2 + 5) - byte1, c / 2);
  3434. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  3435. if(welcomeScreenRaised)
  3436. {
  3437. welcomeScreenRaised = false;
  3438. if(!aBoolean831)
  3439. {
  3440. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  3441. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  3442. }
  3443. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  3444. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  3445. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  3446. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  3447. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  3448. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  3449. }
  3450. }
  3451.  
  3452. private void method65(int i, int j, int k, int l, RSInterface class9, int i1, boolean flag,
  3453. int j1)
  3454. {
  3455. int anInt992;
  3456. if(aBoolean972)
  3457. anInt992 = 32;
  3458. else
  3459. anInt992 = 0;
  3460. aBoolean972 = false;
  3461. if(k >= i && k < i + 16 && l >= i1 && l < i1 + 16)
  3462. {
  3463. class9.scrollPosition -= anInt1213 * 4;
  3464. if(flag)
  3465. {
  3466. needDrawTabArea = true;
  3467. }
  3468. } else
  3469. if(k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j)
  3470. {
  3471. class9.scrollPosition += anInt1213 * 4;
  3472. if(flag)
  3473. {
  3474. needDrawTabArea = true;
  3475. }
  3476. } else
  3477. if(k >= i - anInt992 && k < i + 16 + anInt992 && l >= i1 + 16 && l < (i1 + j) - 16 && anInt1213 > 0)
  3478. {
  3479. int l1 = ((j - 32) * j) / j1;
  3480. if(l1 < 8)
  3481. l1 = 8;
  3482. int i2 = l - i1 - 16 - l1 / 2;
  3483. int j2 = j - 32 - l1;
  3484. class9.scrollPosition = ((j1 - j) * i2) / j2;
  3485. if(flag)
  3486. needDrawTabArea = true;
  3487. aBoolean972 = true;
  3488. }
  3489. }
  3490.  
  3491. private boolean method66(int i, int j, int k)
  3492. {
  3493. int i1 = i >> 14 & 0x7fff;
  3494. int j1 = worldController.method304(plane, k, j, i);
  3495. if(j1 == -1)
  3496. return false;
  3497. int k1 = j1 & 0x1f;
  3498. int l1 = j1 >> 6 & 3;
  3499. if(k1 == 10 || k1 == 11 || k1 == 22)
  3500. {
  3501. ObjectDef class46 = ObjectDef.forID(i1);
  3502. int i2;
  3503. int j2;
  3504. if(l1 == 0 || l1 == 2)
  3505. {
  3506. i2 = class46.anInt744;
  3507. j2 = class46.anInt761;
  3508. } else
  3509. {
  3510. i2 = class46.anInt761;
  3511. j2 = class46.anInt744;
  3512. }
  3513. int k2 = class46.anInt768;
  3514. if(l1 != 0)
  3515. k2 = (k2 << l1 & 0xf) + (k2 >> 4 - l1);
  3516. doWalkTo(2, 0, j2, 0, myPlayer.smallY[0], i2, k2, j, myPlayer.smallX[0], false, k);
  3517. } else
  3518. {
  3519. doWalkTo(2, l1, 0, k1 + 1, myPlayer.smallY[0], 0, 0, j, myPlayer.smallX[0], false, k);
  3520. }
  3521. crossX = super.saveClickX;
  3522. crossY = super.saveClickY;
  3523. crossType = 2;
  3524. crossIndex = 0;
  3525. return true;
  3526. }
  3527.  
  3528. private StreamLoader streamLoaderForName(int i, String s, String s1, int j, int k)
  3529. {
  3530. byte abyte0[] = null;
  3531. int l = 5;
  3532. try
  3533. {
  3534. if(decompressors[0] != null)
  3535. abyte0 = decompressors[0].decompress(i);
  3536. }
  3537. catch(Exception _ex) { }
  3538. if(abyte0 != null)
  3539. {
  3540. // aCRC32_930.reset();
  3541. // aCRC32_930.update(abyte0);
  3542. // int i1 = (int)aCRC32_930.getValue();
  3543. // if(i1 != j)
  3544. }
  3545. if(abyte0 != null)
  3546. {
  3547. StreamLoader streamLoader = new StreamLoader(abyte0);
  3548. return streamLoader;
  3549. }
  3550. int j1 = 0;
  3551. while(abyte0 == null)
  3552. {
  3553. String s2 = "Unknown error";
  3554. drawLoadingText(k, "Requesting " + s);
  3555. Object obj = null;
  3556. try
  3557. {
  3558. int k1 = 0;
  3559. DataInputStream datainputstream = openJagGrabInputStream(s1 + j);
  3560. byte abyte1[] = new byte[6];
  3561. datainputstream.readFully(abyte1, 0, 6);
  3562. Stream stream = new Stream(abyte1);
  3563. stream.currentOffset = 3;
  3564. int i2 = stream.read3Bytes() + 6;
  3565. int j2 = 6;
  3566. abyte0 = new byte[i2];
  3567. System.arraycopy(abyte1, 0, abyte0, 0, 6);
  3568.  
  3569. while(j2 < i2)
  3570. {
  3571. int l2 = i2 - j2;
  3572. if(l2 > 1000)
  3573. l2 = 1000;
  3574. int j3 = datainputstream.read(abyte0, j2, l2);
  3575. if(j3 < 0)
  3576. {
  3577. s2 = "Length error: " + j2 + "/" + i2;
  3578. throw new IOException("EOF");
  3579. }
  3580. j2 += j3;
  3581. int k3 = (j2 * 100) / i2;
  3582. if(k3 != k1)
  3583. drawLoadingText(k, "Loading " + s + " - " + k3 + "%");
  3584. k1 = k3;
  3585. }
  3586. datainputstream.close();
  3587. try
  3588. {
  3589. if(decompressors[0] != null)
  3590. decompressors[0].method234(abyte0.length, abyte0, i);
  3591. }
  3592. catch(Exception _ex)
  3593. {
  3594. decompressors[0] = null;
  3595. }
  3596. /* if(abyte0 != null)
  3597. {
  3598. aCRC32_930.reset();
  3599. aCRC32_930.update(abyte0);
  3600. int i3 = (int)aCRC32_930.getValue();
  3601. if(i3 != j)
  3602. {
  3603. abyte0 = null;
  3604. j1++;
  3605. s2 = "Checksum error: " + i3;
  3606. }
  3607. }
  3608. */
  3609. }
  3610. catch(IOException ioexception)
  3611. {
  3612. if(s2.equals("Unknown error"))
  3613. s2 = "Connection error";
  3614. abyte0 = null;
  3615. }
  3616. catch(NullPointerException _ex)
  3617. {
  3618. s2 = "Null error";
  3619. abyte0 = null;
  3620. if(!signlink.reporterror)
  3621. return null;
  3622. }
  3623. catch(ArrayIndexOutOfBoundsException _ex)
  3624. {
  3625. s2 = "Bounds error";
  3626. abyte0 = null;
  3627. if(!signlink.reporterror)
  3628. return null;
  3629. }
  3630. catch(Exception _ex)
  3631. {
  3632. s2 = "Unexpected error";
  3633. abyte0 = null;
  3634. if(!signlink.reporterror)
  3635. return null;
  3636. }
  3637. if(abyte0 == null)
  3638. {
  3639. for(int l1 = l; l1 > 0; l1--)
  3640. {
  3641. if(j1 >= 3)
  3642. {
  3643. drawLoadingText(k, "Game updated - please reload page");
  3644. l1 = 10;
  3645. } else
  3646. {
  3647. drawLoadingText(k, s2 + " - Retrying in " + l1);
  3648. }
  3649. try
  3650. {
  3651. Thread.sleep(1000L);
  3652. }
  3653. catch(Exception _ex) { }
  3654. }
  3655.  
  3656. l *= 2;
  3657. if(l > 60)
  3658. l = 60;
  3659. aBoolean872 = !aBoolean872;
  3660. }
  3661.  
  3662. }
  3663.  
  3664. StreamLoader streamLoader_1 = new StreamLoader(abyte0);
  3665. return streamLoader_1;
  3666. }
  3667.  
  3668. private void dropClient()
  3669. {
  3670. if(anInt1011 > 0)
  3671. {
  3672. resetLogout();
  3673. return;
  3674. }
  3675. aRSImageProducer_1165.initDrawingArea();
  3676. aTextDrawingArea_1271.drawText(0, "Connection lost", 144, 257);
  3677. aTextDrawingArea_1271.drawText(0xffffff, "Connection lost", 143, 256);
  3678. aTextDrawingArea_1271.drawText(0, "Please wait - attempting to reestablish", 159, 257);
  3679. aTextDrawingArea_1271.drawText(0xffffff, "Please wait - attempting to reestablish", 158, 256);
  3680. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  3681. anInt1021 = 0;
  3682. destX = 0;
  3683. RSSocket rsSocket = socketStream;
  3684. loggedIn = false;
  3685. loginFailures = 0;
  3686. login(myUsername, myPassword, true);
  3687. if(!loggedIn)
  3688. resetLogout();
  3689. try
  3690. {
  3691. rsSocket.close();
  3692. }
  3693. catch(Exception _ex)
  3694. {
  3695. }
  3696. }
  3697.  
  3698. private void doAction(int i)
  3699. {
  3700. if(i < 0)
  3701. return;
  3702. if(inputDialogState != 0)
  3703. {
  3704. inputDialogState = 0;
  3705. inputTaken = true;
  3706. }
  3707. int j = menuActionCmd2[i];
  3708. int k = menuActionCmd3[i];
  3709. int l = menuActionID[i];
  3710. int i1 = menuActionCmd1[i];
  3711. if(l >= 2000)
  3712. l -= 2000;
  3713. if(l == 582)
  3714. {
  3715. NPC npc = npcArray[i1];
  3716. if(npc != null)
  3717. {
  3718. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0], myPlayer.smallX[0], false, npc.smallX[0]);
  3719. crossX = super.saveClickX;
  3720. crossY = super.saveClickY;
  3721. crossType = 2;
  3722. crossIndex = 0;
  3723. stream.createFrame(57);
  3724. stream.method432(anInt1285);
  3725. stream.method432(i1);
  3726. stream.method431(anInt1283);
  3727. stream.method432(anInt1284);
  3728. }
  3729. }
  3730. if(l == 234)
  3731. {
  3732. boolean flag1 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  3733. if(!flag1)
  3734. flag1 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  3735. crossX = super.saveClickX;
  3736. crossY = super.saveClickY;
  3737. crossType = 2;
  3738. crossIndex = 0;
  3739. stream.createFrame(236);
  3740. stream.method431(k + baseY);
  3741. stream.writeWord(i1);
  3742. stream.method431(j + baseX);
  3743. }
  3744. if(l == 62 && method66(i1, k, j))
  3745. {
  3746. stream.createFrame(192);
  3747. stream.writeWord(anInt1284);
  3748. stream.method431(i1 >> 14 & 0x7fff);
  3749. stream.method433(k + baseY);
  3750. stream.method431(anInt1283);
  3751. stream.method433(j + baseX);
  3752. stream.writeWord(anInt1285);
  3753. }
  3754. if(l == 511)
  3755. {
  3756. boolean flag2 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  3757. if(!flag2)
  3758. flag2 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  3759. crossX = super.saveClickX;
  3760. crossY = super.saveClickY;
  3761. crossType = 2;
  3762. crossIndex = 0;
  3763. stream.createFrame(25);
  3764. stream.method431(anInt1284);
  3765. stream.method432(anInt1285);
  3766. stream.writeWord(i1);
  3767. stream.method432(k + baseY);
  3768. stream.method433(anInt1283);
  3769. stream.writeWord(j + baseX);
  3770. }
  3771. if(l == 74)
  3772. {
  3773. stream.createFrame(122);
  3774. stream.method433(k);
  3775. stream.method432(j);
  3776. stream.method431(i1);
  3777. atInventoryLoopCycle = 0;
  3778. atInventoryInterface = k;
  3779. atInventoryIndex = j;
  3780. atInventoryInterfaceType = 2;
  3781. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3782. atInventoryInterfaceType = 1;
  3783. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3784. atInventoryInterfaceType = 3;
  3785. }
  3786. if(l == 315)
  3787. {
  3788. RSInterface class9 = RSInterface.interfaceCache[k];
  3789. boolean flag8 = true;
  3790. if(class9.contentType > 0)
  3791. flag8 = promptUserForInput(class9);
  3792. if(flag8)
  3793. {
  3794. stream.createFrame(185);
  3795. stream.writeWord(k);
  3796. }
  3797. }
  3798. if(l == 561)
  3799. {
  3800. Player player = playerArray[i1];
  3801. if(player != null)
  3802. {
  3803. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, player.smallY[0], myPlayer.smallX[0], false, player.smallX[0]);
  3804. crossX = super.saveClickX;
  3805. crossY = super.saveClickY;
  3806. crossType = 2;
  3807. crossIndex = 0;
  3808. anInt1188 += i1;
  3809. if(anInt1188 >= 90)
  3810. {
  3811. stream.createFrame(136);
  3812. anInt1188 = 0;
  3813. }
  3814. stream.createFrame(128);
  3815. stream.writeWord(i1);
  3816. }
  3817. }
  3818. if(l == 20)
  3819. {
  3820. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[i1];
  3821. if(class30_sub2_sub4_sub1_sub1_1 != null)
  3822. {
  3823. 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]);
  3824. crossX = super.saveClickX;
  3825. crossY = super.saveClickY;
  3826. crossType = 2;
  3827. crossIndex = 0;
  3828. stream.createFrame(155);
  3829. stream.method431(i1);
  3830. }
  3831. }
  3832. if(l == 779)
  3833. {
  3834. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[i1];
  3835. if(class30_sub2_sub4_sub1_sub2_1 != null)
  3836. {
  3837. 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]);
  3838. crossX = super.saveClickX;
  3839. crossY = super.saveClickY;
  3840. crossType = 2;
  3841. crossIndex = 0;
  3842. stream.createFrame(153);
  3843. stream.method431(i1);
  3844. }
  3845. }
  3846. if(l == 516)
  3847. if(!menuOpen)
  3848. worldController.method312(super.saveClickY - 4, super.saveClickX - 4);
  3849. else
  3850. worldController.method312(k - 4, j - 4);
  3851. if(l == 1062)
  3852. {
  3853. anInt924 += baseX;
  3854. if(anInt924 >= 113)
  3855. {
  3856. stream.createFrame(183);
  3857. stream.writeDWordBigEndian(0xe63271);
  3858. anInt924 = 0;
  3859. }
  3860. method66(i1, k, j);
  3861. stream.createFrame(228);
  3862. stream.method432(i1 >> 14 & 0x7fff);
  3863. stream.method432(k + baseY);
  3864. stream.writeWord(j + baseX);
  3865. }
  3866. if(l == 679 && !aBoolean1149)
  3867. {
  3868. stream.createFrame(40);
  3869. stream.writeWord(k);
  3870. aBoolean1149 = true;
  3871. }
  3872. if(l == 431)
  3873. {
  3874. stream.createFrame(129);
  3875. stream.method432(j);
  3876. stream.writeWord(k);
  3877. stream.method432(i1);
  3878. atInventoryLoopCycle = 0;
  3879. atInventoryInterface = k;
  3880. atInventoryIndex = j;
  3881. atInventoryInterfaceType = 2;
  3882. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3883. atInventoryInterfaceType = 1;
  3884. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3885. atInventoryInterfaceType = 3;
  3886. }
  3887. if(l == 337 || l == 42 || l == 792 || l == 322)
  3888. {
  3889. String s = menuActionName[i];
  3890. int k1 = s.indexOf("@whi@");
  3891. if(k1 != -1)
  3892. {
  3893. long l3 = TextClass.longForName(s.substring(k1 + 5).trim());
  3894. if(l == 337)
  3895. addFriend(l3);
  3896. if(l == 42)
  3897. addIgnore(l3);
  3898. if(l == 792)
  3899. delFriend(l3);
  3900. if(l == 322)
  3901. delIgnore(l3);
  3902. }
  3903. }
  3904. if(l == 53)
  3905. {
  3906. stream.createFrame(135);
  3907. stream.method431(j);
  3908. stream.method432(k);
  3909. stream.method431(i1);
  3910. atInventoryLoopCycle = 0;
  3911. atInventoryInterface = k;
  3912. atInventoryIndex = j;
  3913. atInventoryInterfaceType = 2;
  3914. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3915. atInventoryInterfaceType = 1;
  3916. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3917. atInventoryInterfaceType = 3;
  3918. }
  3919. if(l == 539)
  3920. {
  3921. stream.createFrame(16);
  3922. stream.method432(i1);
  3923. stream.method433(j);
  3924. stream.method433(k);
  3925. atInventoryLoopCycle = 0;
  3926. atInventoryInterface = k;
  3927. atInventoryIndex = j;
  3928. atInventoryInterfaceType = 2;
  3929. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3930. atInventoryInterfaceType = 1;
  3931. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3932. atInventoryInterfaceType = 3;
  3933. }
  3934. if(l == 484 || l == 6)
  3935. {
  3936. String s1 = menuActionName[i];
  3937. int l1 = s1.indexOf("@whi@");
  3938. if(l1 != -1)
  3939. {
  3940. s1 = s1.substring(l1 + 5).trim();
  3941. String s7 = TextClass.fixName(TextClass.nameForLong(TextClass.longForName(s1)));
  3942. boolean flag9 = false;
  3943. for(int j3 = 0; j3 < playerCount; j3++)
  3944. {
  3945. Player class30_sub2_sub4_sub1_sub2_7 = playerArray[playerIndices[j3]];
  3946. 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))
  3947. continue;
  3948. 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]);
  3949. if(l == 484)
  3950. {
  3951. stream.createFrame(139);
  3952. stream.method431(playerIndices[j3]);
  3953. }
  3954. if(l == 6)
  3955. {
  3956. anInt1188 += i1;
  3957. if(anInt1188 >= 90)
  3958. {
  3959. stream.createFrame(136);
  3960. anInt1188 = 0;
  3961. }
  3962. stream.createFrame(128);
  3963. stream.writeWord(playerIndices[j3]);
  3964. }
  3965. flag9 = true;
  3966. break;
  3967. }
  3968.  
  3969. if(!flag9)
  3970. pushMessage("Unable to find " + s7, 0, "");
  3971. }
  3972. }
  3973. if(l == 870)
  3974. {
  3975. stream.createFrame(53);
  3976. stream.writeWord(j);
  3977. stream.method432(anInt1283);
  3978. stream.method433(i1);
  3979. stream.writeWord(anInt1284);
  3980. stream.method431(anInt1285);
  3981. stream.writeWord(k);
  3982. atInventoryLoopCycle = 0;
  3983. atInventoryInterface = k;
  3984. atInventoryIndex = j;
  3985. atInventoryInterfaceType = 2;
  3986. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3987. atInventoryInterfaceType = 1;
  3988. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3989. atInventoryInterfaceType = 3;
  3990. }
  3991. if(l == 847)
  3992. {
  3993. stream.createFrame(87);
  3994. stream.method432(i1);
  3995. stream.writeWord(k);
  3996. stream.method432(j);
  3997. atInventoryLoopCycle = 0;
  3998. atInventoryInterface = k;
  3999. atInventoryIndex = j;
  4000. atInventoryInterfaceType = 2;
  4001. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4002. atInventoryInterfaceType = 1;
  4003. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4004. atInventoryInterfaceType = 3;
  4005. }
  4006. if(l == 626)
  4007. {
  4008. RSInterface class9_1 = RSInterface.interfaceCache[k];
  4009. spellSelected = 1;
  4010. anInt1137 = k;
  4011. spellUsableOn = class9_1.spellUsableOn;
  4012. itemSelected = 0;
  4013. needDrawTabArea = true;
  4014. String s4 = class9_1.selectedActionName;
  4015. if(s4.indexOf(" ") != -1)
  4016. s4 = s4.substring(0, s4.indexOf(" "));
  4017. String s8 = class9_1.selectedActionName;
  4018. if(s8.indexOf(" ") != -1)
  4019. s8 = s8.substring(s8.indexOf(" ") + 1);
  4020. spellTooltip = s4 + " " + class9_1.spellName + " " + s8;
  4021. if(spellUsableOn == 16)
  4022. {
  4023. needDrawTabArea = true;
  4024. tabID = 3;
  4025. tabAreaAltered = true;
  4026. }
  4027. return;
  4028. }
  4029. if(l == 78)
  4030. {
  4031. stream.createFrame(117);
  4032. stream.method433(k);
  4033. stream.method433(i1);
  4034. stream.method431(j);
  4035. atInventoryLoopCycle = 0;
  4036. atInventoryInterface = k;
  4037. atInventoryIndex = j;
  4038. atInventoryInterfaceType = 2;
  4039. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4040. atInventoryInterfaceType = 1;
  4041. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4042. atInventoryInterfaceType = 3;
  4043. }
  4044. if(l == 27)
  4045. {
  4046. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[i1];
  4047. if(class30_sub2_sub4_sub1_sub2_2 != null)
  4048. {
  4049. 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]);
  4050. crossX = super.saveClickX;
  4051. crossY = super.saveClickY;
  4052. crossType = 2;
  4053. crossIndex = 0;
  4054. anInt986 += i1;
  4055. if(anInt986 >= 54)
  4056. {
  4057. stream.createFrame(189);
  4058. stream.writeWordBigEndian(234);
  4059. anInt986 = 0;
  4060. }
  4061. stream.createFrame(73);
  4062. stream.method431(i1);
  4063. }
  4064. }
  4065. if(l == 213)
  4066. {
  4067. boolean flag3 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4068. if(!flag3)
  4069. flag3 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4070. crossX = super.saveClickX;
  4071. crossY = super.saveClickY;
  4072. crossType = 2;
  4073. crossIndex = 0;
  4074. stream.createFrame(79);
  4075. stream.method431(k + baseY);
  4076. stream.writeWord(i1);
  4077. stream.method432(j + baseX);
  4078. }
  4079. if(l == 632)
  4080. {
  4081. stream.createFrame(145);
  4082. stream.method432(k);
  4083. stream.method432(j);
  4084. stream.method432(i1);
  4085. atInventoryLoopCycle = 0;
  4086. atInventoryInterface = k;
  4087. atInventoryIndex = j;
  4088. atInventoryInterfaceType = 2;
  4089. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4090. atInventoryInterfaceType = 1;
  4091. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4092. atInventoryInterfaceType = 3;
  4093. }
  4094. if(l == 1004) {
  4095. if(tabInterfaceIDs[10] != -1) {
  4096. needDrawTabArea = true;
  4097. tabID = 10;
  4098. tabAreaAltered = true;
  4099. }
  4100. }
  4101. if(l == 1003) {
  4102. clanChatMode = 2;
  4103. aBoolean1233 = true;
  4104. inputTaken = true;
  4105. }
  4106. if(l == 1002) {
  4107. clanChatMode = 1;
  4108. aBoolean1233 = true;
  4109. inputTaken = true;
  4110. }
  4111. if(l == 1001) {
  4112. clanChatMode = 0;
  4113. aBoolean1233 = true;
  4114. inputTaken = true;
  4115. }
  4116. if(l == 1000) {
  4117. cButtonCPos = 4;
  4118. chatTypeView = 11;
  4119. aBoolean1233 = true;
  4120. inputTaken = true;
  4121. }
  4122. if(l == 999) {
  4123. cButtonCPos = 0;
  4124. chatTypeView = 0;
  4125. aBoolean1233 = true;
  4126. inputTaken = true;
  4127. }
  4128. if(l == 998) {
  4129. cButtonCPos = 1;
  4130. chatTypeView = 5;
  4131. aBoolean1233 = true;
  4132. inputTaken = true;
  4133. }
  4134. if(l == 997) {
  4135. publicChatMode = 3;
  4136. aBoolean1233 = true;
  4137. inputTaken = true;
  4138. }
  4139. if(l == 996) {
  4140. publicChatMode = 2;
  4141. aBoolean1233 = true;
  4142. inputTaken = true;
  4143. }
  4144. if(l == 995) {
  4145. publicChatMode = 1;
  4146. aBoolean1233 = true;
  4147. inputTaken = true;
  4148. }
  4149. if(l == 994) {
  4150. publicChatMode = 0;
  4151. aBoolean1233 = true;
  4152. inputTaken = true;
  4153. }
  4154. if(l == 993) {
  4155. cButtonCPos = 2;
  4156. chatTypeView = 1;
  4157. aBoolean1233 = true;
  4158. inputTaken = true;
  4159. }
  4160. if(l == 992) {
  4161. privateChatMode = 2;
  4162. aBoolean1233 = true;
  4163. inputTaken = true;
  4164. }
  4165. if(l == 991) {
  4166. privateChatMode = 1;
  4167. aBoolean1233 = true;
  4168. inputTaken = true;
  4169. }
  4170. if(l == 990) {
  4171. privateChatMode = 0;
  4172. aBoolean1233 = true;
  4173. inputTaken = true;
  4174. }
  4175. if(l == 989) {
  4176. cButtonCPos = 3;
  4177. chatTypeView = 2;
  4178. aBoolean1233 = true;
  4179. inputTaken = true;
  4180. }
  4181. if(l == 987) {
  4182. tradeMode = 2;
  4183. aBoolean1233 = true;
  4184. inputTaken = true;
  4185. }
  4186. if(l == 986) {
  4187. tradeMode = 1;
  4188. aBoolean1233 = true;
  4189. inputTaken = true;
  4190. }
  4191. if(l == 985) {
  4192. tradeMode = 0;
  4193. aBoolean1233 = true;
  4194. inputTaken = true;
  4195. }
  4196. if(l == 984) {
  4197. cButtonCPos = 5;
  4198. chatTypeView = 3;
  4199. aBoolean1233 = true;
  4200. inputTaken = true;
  4201. }
  4202. if(l == 983) {
  4203. duelMode = 2;
  4204. aBoolean1233 = true;
  4205. inputTaken = true;
  4206. }
  4207. if(l == 982) {
  4208. duelMode = 1;
  4209. aBoolean1233 = true;
  4210. inputTaken = true;
  4211. }
  4212. if(l == 981) {
  4213. duelMode = 0;
  4214. aBoolean1233 = true;
  4215. inputTaken = true;
  4216. }
  4217. if(l == 980) {
  4218. cButtonCPos = 6;
  4219. chatTypeView = 4;
  4220. aBoolean1233 = true;
  4221. inputTaken = true;
  4222. }
  4223. if(l == 493)
  4224. {
  4225. stream.createFrame(75);
  4226. stream.method433(k);
  4227. stream.method431(j);
  4228. stream.method432(i1);
  4229. atInventoryLoopCycle = 0;
  4230. atInventoryInterface = k;
  4231. atInventoryIndex = j;
  4232. atInventoryInterfaceType = 2;
  4233. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4234. atInventoryInterfaceType = 1;
  4235. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4236. atInventoryInterfaceType = 3;
  4237. }
  4238. if(l == 652)
  4239. {
  4240. boolean flag4 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4241. if(!flag4)
  4242. flag4 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4243. crossX = super.saveClickX;
  4244. crossY = super.saveClickY;
  4245. crossType = 2;
  4246. crossIndex = 0;
  4247. stream.createFrame(156);
  4248. stream.method432(j + baseX);
  4249. stream.method431(k + baseY);
  4250. stream.method433(i1);
  4251. }
  4252. if(l == 94)
  4253. {
  4254. boolean flag5 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4255. if(!flag5)
  4256. flag5 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4257. crossX = super.saveClickX;
  4258. crossY = super.saveClickY;
  4259. crossType = 2;
  4260. crossIndex = 0;
  4261. stream.createFrame(181);
  4262. stream.method431(k + baseY);
  4263. stream.writeWord(i1);
  4264. stream.method431(j + baseX);
  4265. stream.method432(anInt1137);
  4266. }
  4267. if(l == 646)
  4268. {
  4269. stream.createFrame(185);
  4270. stream.writeWord(k);
  4271. RSInterface class9_2 = RSInterface.interfaceCache[k];
  4272. if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5)
  4273. {
  4274. int i2 = class9_2.valueIndexArray[0][1];
  4275. if(variousSettings[i2] != class9_2.anIntArray212[0])
  4276. {
  4277. variousSettings[i2] = class9_2.anIntArray212[0];
  4278. method33(i2);
  4279. needDrawTabArea = true;
  4280. }
  4281. }
  4282. }
  4283. if(l == 225)
  4284. {
  4285. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[i1];
  4286. if(class30_sub2_sub4_sub1_sub1_2 != null)
  4287. {
  4288. 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]);
  4289. crossX = super.saveClickX;
  4290. crossY = super.saveClickY;
  4291. crossType = 2;
  4292. crossIndex = 0;
  4293. anInt1226 += i1;
  4294. if(anInt1226 >= 85)
  4295. {
  4296. stream.createFrame(230);
  4297. stream.writeWordBigEndian(239);
  4298. anInt1226 = 0;
  4299. }
  4300. stream.createFrame(17);
  4301. stream.method433(i1);
  4302. }
  4303. }
  4304. if(l == 965)
  4305. {
  4306. NPC class30_sub2_sub4_sub1_sub1_3 = npcArray[i1];
  4307. if(class30_sub2_sub4_sub1_sub1_3 != null)
  4308. {
  4309. 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]);
  4310. crossX = super.saveClickX;
  4311. crossY = super.saveClickY;
  4312. crossType = 2;
  4313. crossIndex = 0;
  4314. anInt1134++;
  4315. if(anInt1134 >= 96)
  4316. {
  4317. stream.createFrame(152);
  4318. stream.writeWordBigEndian(88);
  4319. anInt1134 = 0;
  4320. }
  4321. stream.createFrame(21);
  4322. stream.writeWord(i1);
  4323. }
  4324. }
  4325. if(l == 413)
  4326. {
  4327. NPC class30_sub2_sub4_sub1_sub1_4 = npcArray[i1];
  4328. if(class30_sub2_sub4_sub1_sub1_4 != null)
  4329. {
  4330. 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]);
  4331. crossX = super.saveClickX;
  4332. crossY = super.saveClickY;
  4333. crossType = 2;
  4334. crossIndex = 0;
  4335. stream.createFrame(131);
  4336. stream.method433(i1);
  4337. stream.method432(anInt1137);
  4338. }
  4339. }
  4340. if(l == 200)
  4341. clearTopInterfaces();
  4342. if(l == 1025)
  4343. {
  4344. NPC class30_sub2_sub4_sub1_sub1_5 = npcArray[i1];
  4345. if(class30_sub2_sub4_sub1_sub1_5 != null)
  4346. {
  4347. EntityDef entityDef = class30_sub2_sub4_sub1_sub1_5.desc;
  4348. if(entityDef.childrenIDs != null)
  4349. entityDef = entityDef.method161();
  4350. if(entityDef != null)
  4351. {
  4352. String s9;
  4353. if(entityDef.description != null)
  4354. s9 = new String(entityDef.description);
  4355. else
  4356. s9 = "It's a " + entityDef.name + ".";
  4357. pushMessage(s9, 0, "");
  4358. }
  4359. }
  4360. }
  4361. if(l == 900)
  4362. {
  4363. method66(i1, k, j);
  4364. stream.createFrame(252);
  4365. stream.method433(i1 >> 14 & 0x7fff);
  4366. stream.method431(k + baseY);
  4367. stream.method432(j + baseX);
  4368. }
  4369. if(l == 412)
  4370. {
  4371. NPC class30_sub2_sub4_sub1_sub1_6 = npcArray[i1];
  4372. if(class30_sub2_sub4_sub1_sub1_6 != null)
  4373. {
  4374. 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]);
  4375. crossX = super.saveClickX;
  4376. crossY = super.saveClickY;
  4377. crossType = 2;
  4378. crossIndex = 0;
  4379. stream.createFrame(72);
  4380. stream.method432(i1);
  4381. }
  4382. }
  4383. if(l == 365)
  4384. {
  4385. Player class30_sub2_sub4_sub1_sub2_3 = playerArray[i1];
  4386. if(class30_sub2_sub4_sub1_sub2_3 != null)
  4387. {
  4388. 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]);
  4389. crossX = super.saveClickX;
  4390. crossY = super.saveClickY;
  4391. crossType = 2;
  4392. crossIndex = 0;
  4393. stream.createFrame(249);
  4394. stream.method432(i1);
  4395. stream.method431(anInt1137);
  4396. }
  4397. }
  4398. if(l == 729)
  4399. {
  4400. Player class30_sub2_sub4_sub1_sub2_4 = playerArray[i1];
  4401. if(class30_sub2_sub4_sub1_sub2_4 != null)
  4402. {
  4403. 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]);
  4404. crossX = super.saveClickX;
  4405. crossY = super.saveClickY;
  4406. crossType = 2;
  4407. crossIndex = 0;
  4408. stream.createFrame(39);
  4409. stream.method431(i1);
  4410. }
  4411. }
  4412. if(l == 577)
  4413. {
  4414. Player class30_sub2_sub4_sub1_sub2_5 = playerArray[i1];
  4415. if(class30_sub2_sub4_sub1_sub2_5 != null)
  4416. {
  4417. 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]);
  4418. crossX = super.saveClickX;
  4419. crossY = super.saveClickY;
  4420. crossType = 2;
  4421. crossIndex = 0;
  4422. stream.createFrame(139);
  4423. stream.method431(i1);
  4424. }
  4425. }
  4426. if(l == 956 && method66(i1, k, j))
  4427. {
  4428. stream.createFrame(35);
  4429. stream.method431(j + baseX);
  4430. stream.method432(anInt1137);
  4431. stream.method432(k + baseY);
  4432. stream.method431(i1 >> 14 & 0x7fff);
  4433. }
  4434. if(l == 567)
  4435. {
  4436. boolean flag6 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4437. if(!flag6)
  4438. flag6 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4439. crossX = super.saveClickX;
  4440. crossY = super.saveClickY;
  4441. crossType = 2;
  4442. crossIndex = 0;
  4443. stream.createFrame(23);
  4444. stream.method431(k + baseY);
  4445. stream.method431(i1);
  4446. stream.method431(j + baseX);
  4447. }
  4448. if(l == 867)
  4449. {
  4450. if((i1 & 3) == 0)
  4451. anInt1175++;
  4452. if(anInt1175 >= 59)
  4453. {
  4454. stream.createFrame(200);
  4455. stream.writeWord(25501);
  4456. anInt1175 = 0;
  4457. }
  4458. stream.createFrame(43);
  4459. stream.method431(k);
  4460. stream.method432(i1);
  4461. stream.method432(j);
  4462. atInventoryLoopCycle = 0;
  4463. atInventoryInterface = k;
  4464. atInventoryIndex = j;
  4465. atInventoryInterfaceType = 2;
  4466. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4467. atInventoryInterfaceType = 1;
  4468. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4469. atInventoryInterfaceType = 3;
  4470. }
  4471. if(l == 543)
  4472. {
  4473. stream.createFrame(237);
  4474. stream.writeWord(j);
  4475. stream.method432(i1);
  4476. stream.writeWord(k);
  4477. stream.method432(anInt1137);
  4478. atInventoryLoopCycle = 0;
  4479. atInventoryInterface = k;
  4480. atInventoryIndex = j;
  4481. atInventoryInterfaceType = 2;
  4482. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4483. atInventoryInterfaceType = 1;
  4484. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4485. atInventoryInterfaceType = 3;
  4486. }
  4487. if(l == 606)
  4488. {
  4489. String s2 = menuActionName[i];
  4490. int j2 = s2.indexOf("@whi@");
  4491. if(j2 != -1)
  4492. if(openInterfaceID == -1)
  4493. {
  4494. clearTopInterfaces();
  4495. reportAbuseInput = s2.substring(j2 + 5).trim();
  4496. canMute = false;
  4497. for(int i3 = 0; i3 < RSInterface.interfaceCache.length; i3++)
  4498. {
  4499. if(RSInterface.interfaceCache[i3] == null || RSInterface.interfaceCache[i3].contentType != 600)
  4500. continue;
  4501. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i3].parentID;
  4502. break;
  4503. }
  4504.  
  4505. } else
  4506. {
  4507. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  4508. }
  4509. }
  4510. if(l == 491)
  4511. {
  4512. Player class30_sub2_sub4_sub1_sub2_6 = playerArray[i1];
  4513. if(class30_sub2_sub4_sub1_sub2_6 != null)
  4514. {
  4515. 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]);
  4516. crossX = super.saveClickX;
  4517. crossY = super.saveClickY;
  4518. crossType = 2;
  4519. crossIndex = 0;
  4520. stream.createFrame(14);
  4521. stream.method432(anInt1284);
  4522. stream.writeWord(i1);
  4523. stream.writeWord(anInt1285);
  4524. stream.method431(anInt1283);
  4525. }
  4526. }
  4527. if(l == 639)
  4528. {
  4529. String s3 = menuActionName[i];
  4530. int k2 = s3.indexOf("@whi@");
  4531. if(k2 != -1)
  4532. {
  4533. long l4 = TextClass.longForName(s3.substring(k2 + 5).trim());
  4534. int k3 = -1;
  4535. for(int i4 = 0; i4 < friendsCount; i4++)
  4536. {
  4537. if(friendsListAsLongs[i4] != l4)
  4538. continue;
  4539. k3 = i4;
  4540. break;
  4541. }
  4542.  
  4543. if(k3 != -1 && friendsNodeIDs[k3] > 0)
  4544. {
  4545. inputTaken = true;
  4546. inputDialogState = 0;
  4547. messagePromptRaised = true;
  4548. promptInput = "";
  4549. friendsListAction = 3;
  4550. aLong953 = friendsListAsLongs[k3];
  4551. aString1121 = "Enter message to send to " + friendsList[k3];
  4552. }
  4553. }
  4554. }
  4555. if(l == 454)
  4556. {
  4557. stream.createFrame(41);
  4558. stream.writeWord(i1);
  4559. stream.method432(j);
  4560. stream.method432(k);
  4561. atInventoryLoopCycle = 0;
  4562. atInventoryInterface = k;
  4563. atInventoryIndex = j;
  4564. atInventoryInterfaceType = 2;
  4565. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4566. atInventoryInterfaceType = 1;
  4567. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4568. atInventoryInterfaceType = 3;
  4569. }
  4570. if(l == 478)
  4571. {
  4572. NPC class30_sub2_sub4_sub1_sub1_7 = npcArray[i1];
  4573. if(class30_sub2_sub4_sub1_sub1_7 != null)
  4574. {
  4575. 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]);
  4576. crossX = super.saveClickX;
  4577. crossY = super.saveClickY;
  4578. crossType = 2;
  4579. crossIndex = 0;
  4580. if((i1 & 3) == 0)
  4581. anInt1155++;
  4582. if(anInt1155 >= 53)
  4583. {
  4584. stream.createFrame(85);
  4585. stream.writeWordBigEndian(66);
  4586. anInt1155 = 0;
  4587. }
  4588. stream.createFrame(18);
  4589. stream.method431(i1);
  4590. }
  4591. }
  4592. if(l == 113)
  4593. {
  4594. method66(i1, k, j);
  4595. stream.createFrame(70);
  4596. stream.method431(j + baseX);
  4597. stream.writeWord(k + baseY);
  4598. stream.method433(i1 >> 14 & 0x7fff);
  4599. }
  4600. if(l == 872)
  4601. {
  4602. method66(i1, k, j);
  4603. stream.createFrame(234);
  4604. stream.method433(j + baseX);
  4605. stream.method432(i1 >> 14 & 0x7fff);
  4606. stream.method433(k + baseY);
  4607. }
  4608. if(l == 502)
  4609. {
  4610. method66(i1, k, j);
  4611. stream.createFrame(132);
  4612. stream.method433(j + baseX);
  4613. stream.writeWord(i1 >> 14 & 0x7fff);
  4614. stream.method432(k + baseY);
  4615. }
  4616. if(l == 1125)
  4617. {
  4618. ItemDef itemDef = ItemDef.forID(i1);
  4619. RSInterface class9_4 = RSInterface.interfaceCache[k];
  4620. String s5;
  4621. if(class9_4 != null && class9_4.invStackSizes[j] >= 0x186a0)
  4622. s5 = class9_4.invStackSizes[j] + " x " + itemDef.name;
  4623. else
  4624. if(itemDef.description != null)
  4625. s5 = new String(itemDef.description);
  4626. else
  4627. s5 = "It's a " + itemDef.name + ".";
  4628. pushMessage(s5, 0, "");
  4629. }
  4630. if(l == 169)
  4631. {
  4632. stream.createFrame(185);
  4633. stream.writeWord(k);
  4634. RSInterface class9_3 = RSInterface.interfaceCache[k];
  4635. if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5)
  4636. {
  4637. int l2 = class9_3.valueIndexArray[0][1];
  4638. variousSettings[l2] = 1 - variousSettings[l2];
  4639. method33(l2);
  4640. needDrawTabArea = true;
  4641. }
  4642. }
  4643. if(l == 447)
  4644. {
  4645. itemSelected = 1;
  4646. anInt1283 = j;
  4647. anInt1284 = k;
  4648. anInt1285 = i1;
  4649. selectedItemName = ItemDef.forID(i1).name;
  4650. spellSelected = 0;
  4651. needDrawTabArea = true;
  4652. return;
  4653. }
  4654. if(l == 1226)
  4655. {
  4656. int j1 = i1 >> 14 & 0x7fff;
  4657. ObjectDef class46 = ObjectDef.forID(j1);
  4658. String s10;
  4659. if(class46.description != null)
  4660. s10 = new String(class46.description);
  4661. else
  4662. s10 = "It's a " + class46.name + ".";
  4663. pushMessage(s10, 0, "");
  4664. }
  4665. if(l == 244)
  4666. {
  4667. boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4668. if(!flag7)
  4669. flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4670. crossX = super.saveClickX;
  4671. crossY = super.saveClickY;
  4672. crossType = 2;
  4673. crossIndex = 0;
  4674. stream.createFrame(253);
  4675. stream.method431(j + baseX);
  4676. stream.method433(k + baseY);
  4677. stream.method432(i1);
  4678. }
  4679. if(l == 1448)
  4680. {
  4681. ItemDef itemDef_1 = ItemDef.forID(i1);
  4682. String s6;
  4683. if(itemDef_1.description != null)
  4684. s6 = new String(itemDef_1.description);
  4685. else
  4686. s6 = "It's a " + itemDef_1.name + ".";
  4687. pushMessage(s6, 0, "");
  4688. }
  4689. itemSelected = 0;
  4690. spellSelected = 0;
  4691. needDrawTabArea = true;
  4692.  
  4693. }
  4694.  
  4695. private void method70()
  4696. {
  4697. anInt1251 = 0;
  4698. int j = (myPlayer.x >> 7) + baseX;
  4699. int k = (myPlayer.y >> 7) + baseY;
  4700. if(j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
  4701. anInt1251 = 1;
  4702. if(j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
  4703. anInt1251 = 1;
  4704. if(anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
  4705. anInt1251 = 0;
  4706. }
  4707.  
  4708. public void run()
  4709. {
  4710. if(drawFlames)
  4711. {
  4712. drawFlames();
  4713. } else
  4714. {
  4715. super.run();
  4716. }
  4717. }
  4718.  
  4719. private void build3dScreenMenu()
  4720. {
  4721. if(itemSelected == 0 && spellSelected == 0)
  4722. {
  4723. menuActionName[menuActionRow] = "Walk here";
  4724. menuActionID[menuActionRow] = 516;
  4725. menuActionCmd2[menuActionRow] = super.mouseX;
  4726. menuActionCmd3[menuActionRow] = super.mouseY;
  4727. menuActionRow++;
  4728. }
  4729. int j = -1;
  4730. for(int k = 0; k < Model.anInt1687; k++)
  4731. {
  4732. int l = Model.anIntArray1688[k];
  4733. int i1 = l & 0x7f;
  4734. int j1 = l >> 7 & 0x7f;
  4735. int k1 = l >> 29 & 3;
  4736. int l1 = l >> 14 & 0x7fff;
  4737. if(l == j)
  4738. continue;
  4739. j = l;
  4740. if(k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0)
  4741. {
  4742. ObjectDef class46 = ObjectDef.forID(l1);
  4743. if(class46.childrenIDs != null)
  4744. class46 = class46.method580();
  4745. if(class46 == null)
  4746. continue;
  4747. if(itemSelected == 1)
  4748. {
  4749. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @cya@" + class46.name;
  4750. menuActionID[menuActionRow] = 62;
  4751. menuActionCmd1[menuActionRow] = l;
  4752. menuActionCmd2[menuActionRow] = i1;
  4753. menuActionCmd3[menuActionRow] = j1;
  4754. menuActionRow++;
  4755. } else
  4756. if(spellSelected == 1)
  4757. {
  4758. if((spellUsableOn & 4) == 4)
  4759. {
  4760. menuActionName[menuActionRow] = spellTooltip + " @cya@" + class46.name;
  4761. menuActionID[menuActionRow] = 956;
  4762. menuActionCmd1[menuActionRow] = l;
  4763. menuActionCmd2[menuActionRow] = i1;
  4764. menuActionCmd3[menuActionRow] = j1;
  4765. menuActionRow++;
  4766. }
  4767. } else
  4768. {
  4769. if(class46.actions != null)
  4770. {
  4771. for(int i2 = 4; i2 >= 0; i2--)
  4772. if(class46.actions[i2] != null)
  4773. {
  4774. menuActionName[menuActionRow] = class46.actions[i2] + " @cya@" + class46.name;
  4775. if(i2 == 0)
  4776. menuActionID[menuActionRow] = 502;
  4777. if(i2 == 1)
  4778. menuActionID[menuActionRow] = 900;
  4779. if(i2 == 2)
  4780. menuActionID[menuActionRow] = 113;
  4781. if(i2 == 3)
  4782. menuActionID[menuActionRow] = 872;
  4783. if(i2 == 4)
  4784. menuActionID[menuActionRow] = 1062;
  4785. menuActionCmd1[menuActionRow] = l;
  4786. menuActionCmd2[menuActionRow] = i1;
  4787. menuActionCmd3[menuActionRow] = j1;
  4788. menuActionRow++;
  4789. }
  4790.  
  4791. }
  4792. //menuActionName[menuActionRow] = "Examine @cya@" + class46.name + " @gre@(@whi@" + l1 + "@gre@) (@whi@" + (i1 + baseX) + "," + (j1 + baseY) + "@gre@)";
  4793. menuActionName[menuActionRow] = "Examine @cya@" + class46.name;
  4794. menuActionID[menuActionRow] = 1226;
  4795. menuActionCmd1[menuActionRow] = class46.type << 14;
  4796. menuActionCmd2[menuActionRow] = i1;
  4797. menuActionCmd3[menuActionRow] = j1;
  4798. menuActionRow++;
  4799. }
  4800. }
  4801. if(k1 == 1)
  4802. {
  4803. NPC npc = npcArray[l1];
  4804. if(npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  4805. {
  4806. for(int j2 = 0; j2 < npcCount; j2++)
  4807. {
  4808. NPC npc2 = npcArray[npcIndices[j2]];
  4809. if(npc2 != null && npc2 != npc && npc2.desc.aByte68 == 1 && npc2.x == npc.x && npc2.y == npc.y)
  4810. buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
  4811. }
  4812.  
  4813. for(int l2 = 0; l2 < playerCount; l2++)
  4814. {
  4815. Player player = playerArray[playerIndices[l2]];
  4816. if(player != null && player.x == npc.x && player.y == npc.y)
  4817. buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
  4818. }
  4819.  
  4820. }
  4821. buildAtNPCMenu(npc.desc, l1, j1, i1);
  4822. }
  4823. if(k1 == 0)
  4824. {
  4825. Player player = playerArray[l1];
  4826. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64)
  4827. {
  4828. for(int k2 = 0; k2 < npcCount; k2++)
  4829. {
  4830. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
  4831. 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)
  4832. buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc, npcIndices[k2], j1, i1);
  4833. }
  4834.  
  4835. for(int i3 = 0; i3 < playerCount; i3++)
  4836. {
  4837. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
  4838. 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)
  4839. buildAtPlayerMenu(i1, playerIndices[i3], class30_sub2_sub4_sub1_sub2_2, j1);
  4840. }
  4841.  
  4842. }
  4843. buildAtPlayerMenu(i1, l1, player, j1);
  4844. }
  4845. if(k1 == 3)
  4846. {
  4847. NodeList class19 = groundArray[plane][i1][j1];
  4848. if(class19 != null)
  4849. {
  4850. for(Item item = (Item)class19.getFirst(); item != null; item = (Item)class19.getNext())
  4851. {
  4852. ItemDef itemDef = ItemDef.forID(item.ID);
  4853. if(itemSelected == 1)
  4854. {
  4855. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  4856. menuActionID[menuActionRow] = 511;
  4857. menuActionCmd1[menuActionRow] = item.ID;
  4858. menuActionCmd2[menuActionRow] = i1;
  4859. menuActionCmd3[menuActionRow] = j1;
  4860. menuActionRow++;
  4861. } else
  4862. if(spellSelected == 1)
  4863. {
  4864. if((spellUsableOn & 1) == 1)
  4865. {
  4866. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  4867. menuActionID[menuActionRow] = 94;
  4868. menuActionCmd1[menuActionRow] = item.ID;
  4869. menuActionCmd2[menuActionRow] = i1;
  4870. menuActionCmd3[menuActionRow] = j1;
  4871. menuActionRow++;
  4872. }
  4873. } else
  4874. {
  4875. for(int j3 = 4; j3 >= 0; j3--)
  4876. if(itemDef.groundActions != null && itemDef.groundActions[j3] != null)
  4877. {
  4878. menuActionName[menuActionRow] = itemDef.groundActions[j3] + " @lre@" + itemDef.name;
  4879. if(j3 == 0)
  4880. menuActionID[menuActionRow] = 652;
  4881. if(j3 == 1)
  4882. menuActionID[menuActionRow] = 567;
  4883. if(j3 == 2)
  4884. menuActionID[menuActionRow] = 234;
  4885. if(j3 == 3)
  4886. menuActionID[menuActionRow] = 244;
  4887. if(j3 == 4)
  4888. menuActionID[menuActionRow] = 213;
  4889. menuActionCmd1[menuActionRow] = item.ID;
  4890. menuActionCmd2[menuActionRow] = i1;
  4891. menuActionCmd3[menuActionRow] = j1;
  4892. menuActionRow++;
  4893. } else
  4894. if(j3 == 2)
  4895. {
  4896. menuActionName[menuActionRow] = "Take @lre@" + itemDef.name;
  4897. menuActionID[menuActionRow] = 234;
  4898. menuActionCmd1[menuActionRow] = item.ID;
  4899. menuActionCmd2[menuActionRow] = i1;
  4900. menuActionCmd3[menuActionRow] = j1;
  4901. menuActionRow++;
  4902. }
  4903.  
  4904. //menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + item.ID + "@gre@)";
  4905. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  4906. menuActionID[menuActionRow] = 1448;
  4907. menuActionCmd1[menuActionRow] = item.ID;
  4908. menuActionCmd2[menuActionRow] = i1;
  4909. menuActionCmd3[menuActionRow] = j1;
  4910. menuActionRow++;
  4911. }
  4912. }
  4913.  
  4914. }
  4915. }
  4916. }
  4917. }
  4918.  
  4919. public void cleanUpForQuit()
  4920. {
  4921. signlink.reporterror = false;
  4922. try
  4923. {
  4924. if(socketStream != null)
  4925. socketStream.close();
  4926. }
  4927. catch(Exception _ex) { }
  4928. socketStream = null;
  4929. stopMidi();
  4930. if(mouseDetection != null)
  4931. mouseDetection.running = false;
  4932. mouseDetection = null;
  4933. onDemandFetcher.disable();
  4934. onDemandFetcher = null;
  4935. aStream_834 = null;
  4936. stream = null;
  4937. aStream_847 = null;
  4938. inStream = null;
  4939. anIntArray1234 = null;
  4940. aByteArrayArray1183 = null;
  4941. aByteArrayArray1247 = null;
  4942. anIntArray1235 = null;
  4943. anIntArray1236 = null;
  4944. intGroundArray = null;
  4945. byteGroundArray = null;
  4946. worldController = null;
  4947. aClass11Array1230 = null;
  4948. anIntArrayArray901 = null;
  4949. anIntArrayArray825 = null;
  4950. bigX = null;
  4951. bigY = null;
  4952. aByteArray912 = null;
  4953. aRSImageProducer_1163 = null;
  4954. aRSImageProducer_1164 = null;
  4955. aRSImageProducer_1165 = null;
  4956. aRSImageProducer_1166 = null;
  4957. aRSImageProducer_1123 = null;
  4958. aRSImageProducer_1124 = null;
  4959. aRSImageProducer_1125 = null;
  4960. /* Null pointers for custom sprites */
  4961. chatArea = null;
  4962. chatButtons = null;
  4963. chatButtonH = null;
  4964. chatButtonHC = null;
  4965. chatButtonC = null;
  4966. reportH = null;
  4967. tabArea = null;
  4968. mapArea = null;
  4969. logIconH = null;
  4970. logIconC = null;
  4971. worldMapIcon = null;
  4972. emptyOrb = null;
  4973. hitPointsFill = null;
  4974. hitPointsIcon = null;
  4975. prayerFill = null;
  4976. prayerIcon = null;
  4977. frame = null;
  4978. /**/
  4979. mapBack = null;
  4980. sideIcons = null;
  4981. redStones = null;
  4982. compass = null;
  4983. hitMarks = null;
  4984. headIcons = null;
  4985. headIconsHint = null;
  4986. crosses = null;
  4987. mapDotItem = null;
  4988. mapDotNPC = null;
  4989. mapDotPlayer = null;
  4990. mapDotFriend = null;
  4991. mapDotTeam = null;
  4992. mapScenes = null;
  4993. mapFunctions = null;
  4994. anIntArrayArray929 = null;
  4995. playerArray = null;
  4996. playerIndices = null;
  4997. anIntArray894 = null;
  4998. aStreamArray895s = null;
  4999. anIntArray840 = null;
  5000. npcArray = null;
  5001. npcIndices = null;
  5002. groundArray = null;
  5003. aClass19_1179 = null;
  5004. aClass19_1013 = null;
  5005. aClass19_1056 = null;
  5006. menuActionCmd2 = null;
  5007. menuActionCmd3 = null;
  5008. menuActionID = null;
  5009. menuActionCmd1 = null;
  5010. menuActionName = null;
  5011. variousSettings = null;
  5012. anIntArray1072 = null;
  5013. anIntArray1073 = null;
  5014. aClass30_Sub2_Sub1_Sub1Array1140 = null;
  5015. aClass30_Sub2_Sub1_Sub1_1263 = null;
  5016. friendsList = null;
  5017. friendsListAsLongs = null;
  5018. friendsNodeIDs = null;
  5019. aRSImageProducer_1110 = null;
  5020. aRSImageProducer_1111 = null;
  5021. aRSImageProducer_1107 = null;
  5022. aRSImageProducer_1108 = null;
  5023. aRSImageProducer_1109 = null;
  5024. aRSImageProducer_1112 = null;
  5025. aRSImageProducer_1113 = null;
  5026. aRSImageProducer_1114 = null;
  5027. aRSImageProducer_1115 = null;
  5028. nullLoader();
  5029. ObjectDef.nullLoader();
  5030. EntityDef.nullLoader();
  5031. ItemDef.nullLoader();
  5032. Flo.cache = null;
  5033. IDK.cache = null;
  5034. RSInterface.interfaceCache = null;
  5035. DummyClass.cache = null;
  5036. Animation.anims = null;
  5037. SpotAnim.cache = null;
  5038. SpotAnim.aMRUNodes_415 = null;
  5039. Varp.cache = null;
  5040. super.fullGameScreen = null;
  5041. Player.mruNodes = null;
  5042. Texture.nullLoader();
  5043. WorldController.nullLoader();
  5044. Model.nullLoader();
  5045. Class36.nullLoader();
  5046. System.gc();
  5047. }
  5048.  
  5049. private void printDebug()
  5050. {
  5051. System.out.println("============");
  5052. System.out.println("flame-cycle:" + anInt1208);
  5053. if(onDemandFetcher != null)
  5054. System.out.println("Od-cycle:" + onDemandFetcher.onDemandCycle);
  5055. System.out.println("loop-cycle:" + loopCycle);
  5056. System.out.println("draw-cycle:" + anInt1061);
  5057. System.out.println("ptype:" + pktType);
  5058. System.out.println("psize:" + pktSize);
  5059. if(socketStream != null)
  5060. socketStream.printDebug();
  5061. super.shouldDebug = true;
  5062. }
  5063.  
  5064. Component getGameComponent()
  5065. {
  5066. if(signlink.mainapp != null)
  5067. return signlink.mainapp;
  5068. if(super.gameFrame != null)
  5069. return super.gameFrame;
  5070. else
  5071. return this;
  5072. }
  5073.  
  5074. public byte[] getModel(int Index) {
  5075. try {
  5076. File Model = new File("./Models/"+Index+".gz");
  5077. byte[] aByte = new byte[(int)Model.length()];
  5078. FileInputStream fis = new FileInputStream(Model);
  5079. fis.read(aByte);
  5080. pushMessage("aByte = ["+aByte+"]!", 0, "");
  5081. fis.close();
  5082. return aByte;
  5083. }
  5084. catch(Exception e)
  5085. {return null;}
  5086. }
  5087.  
  5088. private void method73() {
  5089. do {
  5090. int j = readChar(-796);
  5091. if(j == -1)
  5092. break;
  5093. if(openInterfaceID != -1 && openInterfaceID == reportAbuseInterfaceID) {
  5094. if(j == 8 && reportAbuseInput.length() > 0)
  5095. reportAbuseInput = reportAbuseInput.substring(0, reportAbuseInput.length() - 1);
  5096. if((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48 && j <= 57 || j == 32) && reportAbuseInput.length() < 12)
  5097. reportAbuseInput += (char)j;
  5098. } else if(messagePromptRaised) {
  5099. if(j >= 32 && j <= 122 && promptInput.length() < 80) {
  5100. promptInput += (char)j;
  5101. inputTaken = true;
  5102. }
  5103. if(j == 8 && promptInput.length() > 0) {
  5104. promptInput = promptInput.substring(0, promptInput.length() - 1);
  5105. inputTaken = true;
  5106. }
  5107. if(j == 13 || j == 10) {
  5108. messagePromptRaised = false;
  5109. inputTaken = true;
  5110. if(friendsListAction == 1)
  5111. {
  5112. long l = TextClass.longForName(promptInput);
  5113. addFriend(l);
  5114. }
  5115. if(friendsListAction == 2 && friendsCount > 0)
  5116. {
  5117. long l1 = TextClass.longForName(promptInput);
  5118. delFriend(l1);
  5119. }
  5120. if(friendsListAction == 3 && promptInput.length() > 0)
  5121. {
  5122. stream.createFrame(126);
  5123. stream.writeWordBigEndian(0);
  5124. int k = stream.currentOffset;
  5125. stream.writeQWord(aLong953);
  5126. TextInput.method526(promptInput, stream);
  5127. stream.writeBytes(stream.currentOffset - k);
  5128. promptInput = TextInput.processText(promptInput);
  5129. promptInput = Censor.doCensor(promptInput);
  5130. pushMessage(promptInput, 6, TextClass.fixName(TextClass.nameForLong(aLong953)));
  5131. if(privateChatMode == 2)
  5132. {
  5133. privateChatMode = 1;
  5134. aBoolean1233 = true;
  5135. stream.createFrame(95);
  5136. stream.writeWordBigEndian(publicChatMode);
  5137. stream.writeWordBigEndian(privateChatMode);
  5138. stream.writeWordBigEndian(tradeMode);
  5139. }
  5140. }
  5141. if(friendsListAction == 4 && ignoreCount < 100)
  5142. {
  5143. long l2 = TextClass.longForName(promptInput);
  5144. addIgnore(l2);
  5145. }
  5146. if(friendsListAction == 5 && ignoreCount > 0)
  5147. {
  5148. long l3 = TextClass.longForName(promptInput);
  5149. delIgnore(l3);
  5150. }
  5151. }
  5152. } else
  5153. if(inputDialogState == 1)
  5154. {
  5155. if(j >= 48 && j <= 57 && amountOrNameInput.length() < 10)
  5156. {
  5157. amountOrNameInput += (char)j;
  5158. inputTaken = true;
  5159. }
  5160. if(j == 8 && amountOrNameInput.length() > 0)
  5161. {
  5162. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5163. inputTaken = true;
  5164. }
  5165. if(j == 13 || j == 10)
  5166. {
  5167. if(amountOrNameInput.length() > 0)
  5168. {
  5169. int i1 = 0;
  5170. try
  5171. {
  5172. i1 = Integer.parseInt(amountOrNameInput);
  5173. }
  5174. catch(Exception _ex) { }
  5175. stream.createFrame(208);
  5176. stream.writeDWord(i1);
  5177. }
  5178. inputDialogState = 0;
  5179. inputTaken = true;
  5180. }
  5181. } else
  5182. if(inputDialogState == 2)
  5183. {
  5184. if(j >= 32 && j <= 122 && amountOrNameInput.length() < 12)
  5185. {
  5186. amountOrNameInput += (char)j;
  5187. inputTaken = true;
  5188. }
  5189. if(j == 8 && amountOrNameInput.length() > 0)
  5190. {
  5191. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5192. inputTaken = true;
  5193. }
  5194. if(j == 13 || j == 10)
  5195. {
  5196. if(amountOrNameInput.length() > 0)
  5197. {
  5198. stream.createFrame(60);
  5199. stream.writeQWord(TextClass.longForName(amountOrNameInput));
  5200. }
  5201. inputDialogState = 0;
  5202. inputTaken = true;
  5203. }
  5204. } else
  5205. if(backDialogID == -1)
  5206. {
  5207. if(j >= 32 && j <= 122 && inputString.length() < 80)
  5208. {
  5209. inputString += (char)j;
  5210. inputTaken = true;
  5211. }
  5212. if(j == 8 && inputString.length() > 0)
  5213. {
  5214. inputString = inputString.substring(0, inputString.length() - 1);
  5215. inputTaken = true;
  5216. }
  5217. if((j == 13 || j == 10) && inputString.length() > 0)
  5218. {
  5219. if(myPrivilege == 2)
  5220. {
  5221. if(inputString.equals("::clientdrop"))
  5222. dropClient();
  5223. if(inputString.equals("::lag"))
  5224. printDebug();
  5225. if(inputString.equals("::prefetchmusic"))
  5226. {
  5227. for(int j1 = 0; j1 < onDemandFetcher.getVersionCount(2); j1++)
  5228. onDemandFetcher.method563((byte)1, 2, j1);
  5229.  
  5230. }
  5231. if(inputString.equals("::fpson"))
  5232. fpsOn = true;
  5233. if(inputString.equals("::fpsoff"))
  5234. fpsOn = false;
  5235. if(inputString.equals("::dataon"))
  5236. clientData = true;
  5237. if(inputString.equals("::dataoff"))
  5238. clientData = false;
  5239. if(inputString.equals("::noclip"))
  5240. {
  5241. for(int k1 = 0; k1 < 4; k1++)
  5242. {
  5243. for(int i2 = 1; i2 < 103; i2++)
  5244. {
  5245. for(int k2 = 1; k2 < 103; k2++)
  5246. aClass11Array1230[k1].anIntArrayArray294[i2][k2] = 0;
  5247.  
  5248. }
  5249.  
  5250. }
  5251.  
  5252. }
  5253. }
  5254. if(inputString.startsWith("::"))
  5255. {
  5256. stream.createFrame(103);
  5257. stream.writeWordBigEndian(inputString.length() - 1);
  5258. stream.writeString(inputString.substring(2));
  5259. } else
  5260. {
  5261. String s = inputString.toLowerCase();
  5262. int j2 = 0;
  5263. if(s.startsWith("yellow:"))
  5264. {
  5265. j2 = 0;
  5266. inputString = inputString.substring(7);
  5267. } else
  5268. if(s.startsWith("red:"))
  5269. {
  5270. j2 = 1;
  5271. inputString = inputString.substring(4);
  5272. } else
  5273. if(s.startsWith("green:"))
  5274. {
  5275. j2 = 2;
  5276. inputString = inputString.substring(6);
  5277. } else
  5278. if(s.startsWith("cyan:"))
  5279. {
  5280. j2 = 3;
  5281. inputString = inputString.substring(5);
  5282. } else
  5283. if(s.startsWith("purple:"))
  5284. {
  5285. j2 = 4;
  5286. inputString = inputString.substring(7);
  5287. } else
  5288. if(s.startsWith("white:"))
  5289. {
  5290. j2 = 5;
  5291. inputString = inputString.substring(6);
  5292. } else
  5293. if(s.startsWith("flash1:"))
  5294. {
  5295. j2 = 6;
  5296. inputString = inputString.substring(7);
  5297. } else
  5298. if(s.startsWith("flash2:"))
  5299. {
  5300. j2 = 7;
  5301. inputString = inputString.substring(7);
  5302. } else
  5303. if(s.startsWith("flash3:"))
  5304. {
  5305. j2 = 8;
  5306. inputString = inputString.substring(7);
  5307. } else
  5308. if(s.startsWith("glow1:"))
  5309. {
  5310. j2 = 9;
  5311. inputString = inputString.substring(6);
  5312. } else
  5313. if(s.startsWith("glow2:"))
  5314. {
  5315. j2 = 10;
  5316. inputString = inputString.substring(6);
  5317. } else
  5318. if(s.startsWith("glow3:"))
  5319. {
  5320. j2 = 11;
  5321. inputString = inputString.substring(6);
  5322. }
  5323. s = inputString.toLowerCase();
  5324. int i3 = 0;
  5325. if(s.startsWith("wave:"))
  5326. {
  5327. i3 = 1;
  5328. inputString = inputString.substring(5);
  5329. } else
  5330. if(s.startsWith("wave2:"))
  5331. {
  5332. i3 = 2;
  5333. inputString = inputString.substring(6);
  5334. } else
  5335. if(s.startsWith("shake:"))
  5336. {
  5337. i3 = 3;
  5338. inputString = inputString.substring(6);
  5339. } else
  5340. if(s.startsWith("scroll:"))
  5341. {
  5342. i3 = 4;
  5343. inputString = inputString.substring(7);
  5344. } else
  5345. if(s.startsWith("slide:"))
  5346. {
  5347. i3 = 5;
  5348. inputString = inputString.substring(6);
  5349. }
  5350. stream.createFrame(4);
  5351. stream.writeWordBigEndian(0);
  5352. int j3 = stream.currentOffset;
  5353. stream.method425(i3);
  5354. stream.method425(j2);
  5355. aStream_834.currentOffset = 0;
  5356. TextInput.method526(inputString, aStream_834);
  5357. stream.method441(0, aStream_834.buffer, aStream_834.currentOffset);
  5358. stream.writeBytes(stream.currentOffset - j3);
  5359. inputString = TextInput.processText(inputString);
  5360. inputString = Censor.doCensor(inputString);
  5361. myPlayer.textSpoken = inputString;
  5362. myPlayer.anInt1513 = j2;
  5363. myPlayer.anInt1531 = i3;
  5364. myPlayer.textCycle = 150;
  5365. if(myPrivilege == 2)
  5366. pushMessage(myPlayer.textSpoken, 2, "@cr2@" + myPlayer.name);
  5367. else
  5368. if(myPrivilege == 1)
  5369. pushMessage(myPlayer.textSpoken, 2, "@cr1@" + myPlayer.name);
  5370. else
  5371. pushMessage(myPlayer.textSpoken, 2, myPlayer.name);
  5372. if(publicChatMode == 2)
  5373. {
  5374. publicChatMode = 3;
  5375. aBoolean1233 = true;
  5376. stream.createFrame(95);
  5377. stream.writeWordBigEndian(publicChatMode);
  5378. stream.writeWordBigEndian(privateChatMode);
  5379. stream.writeWordBigEndian(tradeMode);
  5380. }
  5381. }
  5382. inputString = "";
  5383. inputTaken = true;
  5384. }
  5385. }
  5386. } while(true);
  5387. }
  5388.  
  5389. private void buildPublicChat(int j)
  5390. {
  5391. int l = 0;
  5392. for(int i1 = 0; i1 < 500; i1++)
  5393. {
  5394. if(chatMessages[i1] == null)
  5395. continue;
  5396. if(chatTypeView != 1)
  5397. continue;
  5398. int j1 = chatTypes[i1];
  5399. String s = chatNames[i1];
  5400. String ct = chatMessages[i1];
  5401. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5402. if(k1 < -23)
  5403. break;
  5404. if(s != null && s.startsWith("@cr1@"))
  5405. s = s.substring(5);
  5406. if(s != null && s.startsWith("@cr2@"))
  5407. s = s.substring(5);
  5408. if(s != null && s.startsWith("@cr3@"))
  5409. s = s.substring(5);
  5410. if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  5411. if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  5412. if(myPrivilege >= 1) {
  5413. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5414. menuActionID[menuActionRow] = 606;
  5415. menuActionRow++;
  5416. }
  5417. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5418. menuActionID[menuActionRow] = 42;
  5419. menuActionRow++;
  5420. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5421. menuActionID[menuActionRow] = 337;
  5422. menuActionRow++;
  5423. }
  5424. l++;
  5425. }
  5426. }
  5427. }
  5428.  
  5429. private void buildFriendChat(int j)
  5430. {
  5431. int l = 0;
  5432. for(int i1 = 0; i1 < 500; i1++) {
  5433. if(chatMessages[i1] == null)
  5434. continue;
  5435. if(chatTypeView != 2)
  5436. continue;
  5437. int j1 = chatTypes[i1];
  5438. String s = chatNames[i1];
  5439. String ct = chatMessages[i1];
  5440. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5441. if(k1 < -23)
  5442. break;
  5443. if(s != null && s.startsWith("@cr1@"))
  5444. s = s.substring(5);
  5445. if(s != null && s.startsWith("@cr2@"))
  5446. s = s.substring(5);
  5447. if(s != null && s.startsWith("@cr3@"))
  5448. s = s.substring(5);
  5449. if((j1 == 5 || j1 == 6) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 6 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5450. l++;
  5451. if((j1 == 3 || j1 == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5452. {
  5453. if(j > k1 - 14 && j <= k1) {
  5454. if(myPrivilege >= 1) {
  5455. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5456. menuActionID[menuActionRow] = 606;
  5457. menuActionRow++;
  5458. }
  5459. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5460. menuActionID[menuActionRow] = 42;
  5461. menuActionRow++;
  5462. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5463. menuActionID[menuActionRow] = 337;
  5464. menuActionRow++;
  5465. }
  5466. l++;
  5467. }
  5468. }
  5469. }
  5470.  
  5471. private void buildDuelorTrade(int j)
  5472. {
  5473. int l = 0;
  5474. for(int i1 = 0; i1 < 500; i1++)
  5475. {
  5476. if(chatMessages[i1] == null)
  5477. continue;
  5478. if(chatTypeView != 3 && chatTypeView != 4)
  5479. continue;
  5480. int j1 = chatTypes[i1];
  5481. String s = chatNames[i1];
  5482. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5483. if(k1 < -23)
  5484. break;
  5485. if(s != null && s.startsWith("@cr1@"))
  5486. s = s.substring(5);
  5487. if(s != null && s.startsWith("@cr2@"))
  5488. s = s.substring(5);
  5489. if(s != null && s.startsWith("@cr3@"))
  5490. s = s.substring(5);
  5491. if(chatTypeView == 3 && j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5492. if(j > k1 - 14 && j <= k1) {
  5493. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  5494. menuActionID[menuActionRow] = 484;
  5495. menuActionRow++;
  5496. }
  5497. l++;
  5498. }
  5499. if(chatTypeView == 4 && j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5500. if(j > k1 - 14 && j <= k1) {
  5501. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  5502. menuActionID[menuActionRow] = 6;
  5503. menuActionRow++;
  5504. }
  5505. l++;
  5506. }
  5507. if(j1 == 12) {
  5508. if(j > k1 - 14 && j <= k1) {
  5509. menuActionName[menuActionRow] = "Go-to @blu@" + s;
  5510. menuActionID[menuActionRow] = 915;
  5511. menuActionRow++;
  5512. }
  5513. l++;
  5514. }
  5515. }
  5516. }
  5517.  
  5518. private void buildChatAreaMenu(int j)
  5519. {
  5520. int l = 0;
  5521. int test = 0;
  5522. for(int i1 = 0; i1 < 500; i1++)
  5523. {
  5524. if(chatMessages[i1] == null)
  5525. continue;
  5526. int j1 = chatTypes[i1];
  5527. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5528. if(k1 < -23)
  5529. break;
  5530. String s = chatNames[i1];
  5531. String ct = chatMessages[i1];
  5532. boolean flag = false;
  5533. if(chatTypeView == 1) {
  5534. buildPublicChat(j);
  5535. break;
  5536. }
  5537. if(chatTypeView == 2) {
  5538. buildFriendChat(j);
  5539. break;
  5540. }
  5541. if(chatTypeView == 3 || chatTypeView == 4) {
  5542. buildDuelorTrade(j);
  5543. break;
  5544. }
  5545. if(chatTypeView == 5) {
  5546. break;
  5547. }
  5548. if(s != null && s.startsWith("@cr1@")) {
  5549. s = s.substring(5);
  5550. boolean flag1 = true;
  5551. byte byte0 = 1;
  5552. }
  5553. if(s != null && s.startsWith("@cr2@")) {
  5554. s = s.substring(5);
  5555. byte byte0 = 2;
  5556. }
  5557. if(s != null && s.startsWith("@cr3@")) {
  5558. s = s.substring(5);
  5559. byte byte0 = 3;
  5560. }
  5561. if(j1 == 0)
  5562. l++;
  5563. if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s)))
  5564. {
  5565. if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name))
  5566. {
  5567. if(myPrivilege >= 1)
  5568. {
  5569. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5570. menuActionID[menuActionRow] = 606;
  5571. menuActionRow++;
  5572. }
  5573. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5574. menuActionID[menuActionRow] = 42;
  5575. menuActionRow++;
  5576. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5577. menuActionID[menuActionRow] = 337;
  5578. menuActionRow++;
  5579. }
  5580. l++;
  5581. }
  5582. if((j1 == 3 || j1 == 7) && splitPrivateChat == 0 && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5583. {
  5584. if(j > k1 - 14 && j <= k1)
  5585. {
  5586. if(myPrivilege >= 1)
  5587. {
  5588. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5589. menuActionID[menuActionRow] = 606;
  5590. menuActionRow++;
  5591. }
  5592. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5593. menuActionID[menuActionRow] = 42;
  5594. menuActionRow++;
  5595. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5596. menuActionID[menuActionRow] = 337;
  5597. menuActionRow++;
  5598. }
  5599. l++;
  5600. }
  5601. if(j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s)))
  5602. {
  5603. if(j > k1 - 14 && j <= k1)
  5604. {
  5605. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  5606. menuActionID[menuActionRow] = 484;
  5607. menuActionRow++;
  5608. }
  5609. l++;
  5610. }
  5611. if((j1 == 5 || j1 == 6) && splitPrivateChat == 0 && privateChatMode < 2)
  5612. l++;
  5613. if(j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s)))
  5614. {
  5615. if(j > k1 - 14 && j <= k1)
  5616. {
  5617. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  5618. menuActionID[menuActionRow] = 6;
  5619. menuActionRow++;
  5620. }
  5621. l++;
  5622. }
  5623. }
  5624. }
  5625.  
  5626. private void drawFriendsListOrWelcomeScreen(RSInterface class9)
  5627. {
  5628. int j = class9.contentType;
  5629. if(j >= 1 && j <= 100 || j >= 701 && j <= 800)
  5630. {
  5631. if(j == 1 && anInt900 == 0)
  5632. {
  5633. class9.message = "Loading friend list";
  5634. class9.atActionType = 0;
  5635. return;
  5636. }
  5637. if(j == 1 && anInt900 == 1)
  5638. {
  5639. class9.message = "Connecting to friendserver";
  5640. class9.atActionType = 0;
  5641. return;
  5642. }
  5643. if(j == 2 && anInt900 != 2)
  5644. {
  5645. class9.message = "Please wait...";
  5646. class9.atActionType = 0;
  5647. return;
  5648. }
  5649. int k = friendsCount;
  5650. if(anInt900 != 2)
  5651. k = 0;
  5652. if(j > 700)
  5653. j -= 601;
  5654. else
  5655. j--;
  5656. if(j >= k)
  5657. {
  5658. class9.message = "";
  5659. class9.atActionType = 0;
  5660. return;
  5661. } else
  5662. {
  5663. class9.message = friendsList[j];
  5664. class9.atActionType = 1;
  5665. return;
  5666. }
  5667. }
  5668. if(j >= 101 && j <= 200 || j >= 801 && j <= 900)
  5669. {
  5670. int l = friendsCount;
  5671. if(anInt900 != 2)
  5672. l = 0;
  5673. if(j > 800)
  5674. j -= 701;
  5675. else
  5676. j -= 101;
  5677. if(j >= l)
  5678. {
  5679. class9.message = "";
  5680. class9.atActionType = 0;
  5681. return;
  5682. }
  5683. if(friendsNodeIDs[j] == 0)
  5684. class9.message = "@red@Offline";
  5685. else if(friendsNodeIDs[j] == nodeID)
  5686. class9.message = "@gre@Online"/* + (friendsNodeIDs[j] - 9)*/;
  5687. else
  5688. class9.message = "@red@Offline"/* + (friendsNodeIDs[j] - 9)*/;
  5689. class9.atActionType = 1;
  5690. return;
  5691. }
  5692. if(j == 203)
  5693. {
  5694. int i1 = friendsCount;
  5695. if(anInt900 != 2)
  5696. i1 = 0;
  5697. class9.scrollMax = i1 * 15 + 20;
  5698. if(class9.scrollMax <= class9.height)
  5699. class9.scrollMax = class9.height + 1;
  5700. return;
  5701. }
  5702. if(j >= 401 && j <= 500)
  5703. {
  5704. if((j -= 401) == 0 && anInt900 == 0)
  5705. {
  5706. class9.message = "Loading ignore list";
  5707. class9.atActionType = 0;
  5708. return;
  5709. }
  5710. if(j == 1 && anInt900 == 0)
  5711. {
  5712. class9.message = "Please wait...";
  5713. class9.atActionType = 0;
  5714. return;
  5715. }
  5716. int j1 = ignoreCount;
  5717. if(anInt900 == 0)
  5718. j1 = 0;
  5719. if(j >= j1)
  5720. {
  5721. class9.message = "";
  5722. class9.atActionType = 0;
  5723. return;
  5724. } else
  5725. {
  5726. class9.message = TextClass.fixName(TextClass.nameForLong(ignoreListAsLongs[j]));
  5727. class9.atActionType = 1;
  5728. return;
  5729. }
  5730. }
  5731. if(j == 503)
  5732. {
  5733. class9.scrollMax = ignoreCount * 15 + 20;
  5734. if(class9.scrollMax <= class9.height)
  5735. class9.scrollMax = class9.height + 1;
  5736. return;
  5737. }
  5738. if(j == 327)
  5739. {
  5740. class9.modelRotation1 = 150;
  5741. class9.modelRotation2 = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  5742. if(aBoolean1031)
  5743. {
  5744. for(int k1 = 0; k1 < 7; k1++)
  5745. {
  5746. int l1 = anIntArray1065[k1];
  5747. if(l1 >= 0 && !IDK.cache[l1].method537())
  5748. return;
  5749. }
  5750.  
  5751. aBoolean1031 = false;
  5752. Model aclass30_sub2_sub4_sub6s[] = new Model[7];
  5753. int i2 = 0;
  5754. for(int j2 = 0; j2 < 7; j2++)
  5755. {
  5756. int k2 = anIntArray1065[j2];
  5757. if(k2 >= 0)
  5758. aclass30_sub2_sub4_sub6s[i2++] = IDK.cache[k2].method538();
  5759. }
  5760.  
  5761. Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
  5762. for(int l2 = 0; l2 < 5; l2++)
  5763. if(anIntArray990[l2] != 0)
  5764. {
  5765. model.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  5766. if(l2 == 1)
  5767. model.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  5768. }
  5769.  
  5770. model.method469();
  5771. model.method470(Animation.anims[myPlayer.anInt1511].anIntArray353[0]);
  5772. model.method479(64, 850, -30, -50, -30, true);
  5773. class9.anInt233 = 5;
  5774. class9.mediaID = 0;
  5775. RSInterface.method208(aBoolean994, model);
  5776. }
  5777. return;
  5778. }
  5779. if(j == 324)
  5780. {
  5781. if(aClass30_Sub2_Sub1_Sub1_931 == null)
  5782. {
  5783. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  5784. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  5785. }
  5786. if(aBoolean1047)
  5787. {
  5788. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  5789. return;
  5790. } else
  5791. {
  5792. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  5793. return;
  5794. }
  5795. }
  5796. if(j == 325)
  5797. {
  5798. if(aClass30_Sub2_Sub1_Sub1_931 == null)
  5799. {
  5800. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  5801. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  5802. }
  5803. if(aBoolean1047)
  5804. {
  5805. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  5806. return;
  5807. } else
  5808. {
  5809. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  5810. return;
  5811. }
  5812. }
  5813. if(j == 600)
  5814. {
  5815. class9.message = reportAbuseInput;
  5816. if(loopCycle % 20 < 10)
  5817. {
  5818. class9.message += "|";
  5819. return;
  5820. } else
  5821. {
  5822. class9.message += " ";
  5823. return;
  5824. }
  5825. }
  5826. if(j == 613)
  5827. if(myPrivilege >= 1)
  5828. {
  5829. if(canMute)
  5830. {
  5831. class9.textColor = 0xff0000;
  5832. class9.message = "Moderator option: Mute player for 48 hours: <ON>";
  5833. } else
  5834. {
  5835. class9.textColor = 0xffffff;
  5836. class9.message = "Moderator option: Mute player for 48 hours: <OFF>";
  5837. }
  5838. } else
  5839. {
  5840. class9.message = "";
  5841. }
  5842. if(j == 650 || j == 655)
  5843. if(anInt1193 != 0)
  5844. {
  5845. String s;
  5846. if(daysSinceLastLogin == 0)
  5847. s = "earlier today";
  5848. else
  5849. if(daysSinceLastLogin == 1)
  5850. s = "yesterday";
  5851. else
  5852. s = daysSinceLastLogin + " days ago";
  5853. class9.message = "You last logged in " + s + " from: " + signlink.dns;
  5854. } else
  5855. {
  5856. class9.message = "";
  5857. }
  5858. if(j == 651)
  5859. {
  5860. if(unreadMessages == 0)
  5861. {
  5862. class9.message = "0 unread messages";
  5863. class9.textColor = 0xffff00;
  5864. }
  5865. if(unreadMessages == 1)
  5866. {
  5867. class9.message = "1 unread message";
  5868. class9.textColor = 65280;
  5869. }
  5870. if(unreadMessages > 1)
  5871. {
  5872. class9.message = unreadMessages + " unread messages";
  5873. class9.textColor = 65280;
  5874. }
  5875. }
  5876. if(j == 652)
  5877. if(daysSinceRecovChange == 201)
  5878. {
  5879. if(membersInt == 1)
  5880. class9.message = "@yel@This is a non-members world: @whi@Since you are a member we";
  5881. else
  5882. class9.message = "";
  5883. } else
  5884. if(daysSinceRecovChange == 200)
  5885. {
  5886. class9.message = "You have not yet set any password recovery questions.";
  5887. } else
  5888. {
  5889. String s1;
  5890. if(daysSinceRecovChange == 0)
  5891. s1 = "Earlier today";
  5892. else
  5893. if(daysSinceRecovChange == 1)
  5894. s1 = "Yesterday";
  5895. else
  5896. s1 = daysSinceRecovChange + " days ago";
  5897. class9.message = s1 + " you changed your recovery questions";
  5898. }
  5899. if(j == 653)
  5900. if(daysSinceRecovChange == 201)
  5901. {
  5902. if(membersInt == 1)
  5903. class9.message = "@whi@recommend you use a members world instead. You may use";
  5904. else
  5905. class9.message = "";
  5906. } else
  5907. if(daysSinceRecovChange == 200)
  5908. class9.message = "We strongly recommend you do so now to secure your account.";
  5909. else
  5910. class9.message = "If you do not remember making this change then cancel it immediately";
  5911. if(j == 654)
  5912. {
  5913. if(daysSinceRecovChange == 201)
  5914. if(membersInt == 1)
  5915. {
  5916. class9.message = "@whi@this world but member benefits are unavailable whilst here.";
  5917. return;
  5918. } else
  5919. {
  5920. class9.message = "";
  5921. return;
  5922. }
  5923. if(daysSinceRecovChange == 200)
  5924. {
  5925. class9.message = "Do this from the 'account management' area on our front webpage";
  5926. return;
  5927. }
  5928. class9.message = "Do this from the 'account management' area on our front webpage";
  5929. }
  5930. }
  5931.  
  5932. private void drawSplitPrivateChat()
  5933. {
  5934. if(splitPrivateChat == 0)
  5935. return;
  5936. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  5937. int i = 0;
  5938. if(anInt1104 != 0)
  5939. i = 1;
  5940. for(int j = 0; j < 100; j++)
  5941. if(chatMessages[j] != null)
  5942. {
  5943. int k = chatTypes[j];
  5944. String s = chatNames[j];
  5945. byte byte1 = 0;
  5946. if(s != null && s.startsWith("@cr1@"))
  5947. {
  5948. s = s.substring(5);
  5949. byte1 = 1;
  5950. }
  5951. if(s != null && s.startsWith("@cr2@"))
  5952. {
  5953. s = s.substring(5);
  5954. byte1 = 2;
  5955. }
  5956. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5957. {
  5958. int l = 329 - i * 13;
  5959. int k1 = 4;
  5960. textDrawingArea.method385(0, "From", l, k1);
  5961. textDrawingArea.method385(65535, "From", l - 1, k1);
  5962. k1 += textDrawingArea.getTextWidth("From ");
  5963. if(byte1 == 1)
  5964. {
  5965. modIcons[0].method361(k1, l - 12);
  5966. k1 += 12;
  5967. }
  5968. if(byte1 == 2)
  5969. {
  5970. modIcons[1].method361(k1, l - 12);
  5971. k1 += 12;
  5972. }
  5973. textDrawingArea.method385(0, s + ": " + chatMessages[j], l, k1);
  5974. textDrawingArea.method385(65535, s + ": " + chatMessages[j], l - 1, k1);
  5975. if(++i >= 5)
  5976. return;
  5977. }
  5978. if(k == 5 && privateChatMode < 2)
  5979. {
  5980. int i1 = 329 - i * 13;
  5981. textDrawingArea.method385(0, chatMessages[j], i1, 4);
  5982. textDrawingArea.method385(65535, chatMessages[j], i1 - 1, 4);
  5983. if(++i >= 5)
  5984. return;
  5985. }
  5986. if(k == 6 && privateChatMode < 2)
  5987. {
  5988. int j1 = 329 - i * 13;
  5989. textDrawingArea.method385(0, "To " + s + ": " + chatMessages[j], j1, 4);
  5990. textDrawingArea.method385(65535, "To " + s + ": " + chatMessages[j], j1 - 1, 4);
  5991. if(++i >= 5)
  5992. return;
  5993. }
  5994. }
  5995.  
  5996. }
  5997.  
  5998. public void pushMessage(String s, int i, String s1) {
  5999. if(i == 0 && dialogID != -1) {
  6000. aString844 = s;
  6001. super.clickMode3 = 0;
  6002. }
  6003. if(backDialogID == -1)
  6004. inputTaken = true;
  6005. for(int j = 499; j > 0; j--) {
  6006. chatTypes[j] = chatTypes[j - 1];
  6007. chatNames[j] = chatNames[j - 1];
  6008. chatMessages[j] = chatMessages[j - 1];
  6009. }
  6010. chatTypes[0] = i;
  6011. chatNames[0] = s1;
  6012. chatMessages[0] = s;
  6013. }
  6014.  
  6015. public int logIconHPos = 0;
  6016.  
  6017. public void processMapAreaClick() {
  6018. if(super.mouseX >= 742 && super.mouseX <= 764 && super.mouseY >= 1 && super.mouseY <= 23) {
  6019. logIconHPos = 1;
  6020. } else {
  6021. logIconHPos = 0;
  6022. }
  6023. }
  6024.  
  6025. private void processTabClick() {
  6026. if(super.clickMode3 == 1) {
  6027. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[0] != -1)
  6028. {
  6029. needDrawTabArea = true;
  6030. tabID = 0;
  6031. tabAreaAltered = true;
  6032. }
  6033. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[1] != -1)
  6034. {
  6035. needDrawTabArea = true;
  6036. tabID = 1;
  6037. tabAreaAltered = true;
  6038. }
  6039. if(super.saveClickX >= 595 && super.saveClickX <= 626 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[2] != -1)
  6040. {
  6041. needDrawTabArea = true;
  6042. tabID = 2;
  6043. tabAreaAltered = true;
  6044. }
  6045. if(super.saveClickX >= 627 && super.saveClickX <= 660 && super.saveClickY >= 168 && super.saveClickY < 203 && tabInterfaceIDs[3] != -1)
  6046. {
  6047. needDrawTabArea = true;
  6048. tabID = 3;
  6049. tabAreaAltered = true;
  6050. }
  6051. if(super.saveClickX >= 661 && super.saveClickX <= 693 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[4] != -1)
  6052. {
  6053. needDrawTabArea = true;
  6054. tabID = 4;
  6055. tabAreaAltered = true;
  6056. }
  6057. if(super.saveClickX >= 694 && super.saveClickX <= 725 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[5] != -1)
  6058. {
  6059. needDrawTabArea = true;
  6060. tabID = 5;
  6061. tabAreaAltered = true;
  6062. }
  6063. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[6] != -1)
  6064. {
  6065. needDrawTabArea = true;
  6066. tabID = 6;
  6067. tabAreaAltered = true;
  6068. }
  6069. if(super.saveClickX >= 627 && super.saveClickX <= 664 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[7] != -1)
  6070. {
  6071. needDrawTabArea = true;
  6072. tabID = 7;
  6073. tabAreaAltered = true;
  6074. }
  6075. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[8] != -1)
  6076. {
  6077. needDrawTabArea = true;
  6078. tabID = 8;
  6079. tabAreaAltered = true;
  6080. }
  6081. if(super.saveClickX >= 595 && super.saveClickX <= 627 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[9] != -1)
  6082. {
  6083. needDrawTabArea = true;
  6084. tabID = 9;
  6085. tabAreaAltered = true;
  6086. }
  6087. if(super.saveClickX >= 742 && super.saveClickX <= 764 && super.saveClickY >= 1 && super.saveClickY < 24 && tabInterfaceIDs[10] != -1)
  6088. {
  6089. needDrawTabArea = true;
  6090. tabID = 10;
  6091. tabAreaAltered = true;
  6092. }
  6093. if(super.saveClickX >= 661 && super.saveClickX <= 694 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[11] != -1)
  6094. {
  6095. needDrawTabArea = true;
  6096. tabID = 11;
  6097. tabAreaAltered = true;
  6098. }
  6099. if(super.saveClickX >= 695 && super.saveClickX <= 725 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[12] != -1)
  6100. {
  6101. needDrawTabArea = true;
  6102. tabID = 12;
  6103. tabAreaAltered = true;
  6104. }
  6105. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[13] != -1)
  6106. {
  6107. needDrawTabArea = true;
  6108. tabID = 13;
  6109. tabAreaAltered = true;
  6110. }
  6111. if(super.saveClickX >= 520 && super.saveClickX <= 561 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[14] != -1)
  6112. {
  6113. needDrawTabArea = true;
  6114. tabID = 14;
  6115. tabAreaAltered = true;
  6116. }
  6117. }
  6118. }
  6119.  
  6120. private void resetImageProducers2()
  6121. {
  6122. if(aRSImageProducer_1166 != null)
  6123. return;
  6124. nullLoader();
  6125. super.fullGameScreen = null;
  6126. aRSImageProducer_1107 = null;
  6127. aRSImageProducer_1108 = null;
  6128. aRSImageProducer_1109 = null;
  6129. aRSImageProducer_1110 = null;
  6130. aRSImageProducer_1111 = null;
  6131. aRSImageProducer_1112 = null;
  6132. aRSImageProducer_1113 = null;
  6133. aRSImageProducer_1114 = null;
  6134. aRSImageProducer_1115 = null;
  6135. /* Original chat area image producer */
  6136. //aRSImageProducer_1166 = new RSImageProducer(479, 96, getGameComponent());
  6137. /* New chat area image producer */
  6138. aRSImageProducer_1166 = new RSImageProducer(519, 165, getGameComponent());
  6139. aRSImageProducer_1164 = new RSImageProducer(246, 168, getGameComponent());
  6140. DrawingArea.setAllPixelsToZero();
  6141. mapArea.drawSprite(0, 0);
  6142. aRSImageProducer_1163 = new RSImageProducer(246, 335, getGameComponent());
  6143. aRSImageProducer_1165 = new RSImageProducer(512, 334, getGameComponent());
  6144. DrawingArea.setAllPixelsToZero();
  6145. aRSImageProducer_1123 = new RSImageProducer(496, 50, getGameComponent());
  6146. aRSImageProducer_1124 = new RSImageProducer(269, 37, getGameComponent());
  6147. aRSImageProducer_1125 = new RSImageProducer(249, 45, getGameComponent());
  6148. welcomeScreenRaised = true;
  6149. }
  6150.  
  6151. private String getDocumentBaseHost()
  6152. {
  6153. if(signlink.mainapp != null)
  6154. return signlink.mainapp.getDocumentBase().getHost().toLowerCase();
  6155. if(super.gameFrame != null)
  6156. return "";
  6157. else
  6158. return "";
  6159. }
  6160.  
  6161. private void method81(Sprite sprite, int j, int k)
  6162. {
  6163. int l = k * k + j * j;
  6164. if(l > 4225 && l < 0x15f90)
  6165. {
  6166. int i1 = minimapInt1 + minimapInt2 & 0x7ff;
  6167. int j1 = Model.modelIntArray1[i1];
  6168. int k1 = Model.modelIntArray2[i1];
  6169. j1 = (j1 * 256) / (minimapInt3 + 256);
  6170. k1 = (k1 * 256) / (minimapInt3 + 256);
  6171. int l1 = j * j1 + k * k1 >> 16;
  6172. int i2 = j * k1 - k * j1 >> 16;
  6173. double d = Math.atan2(l1, i2);
  6174. int j2 = (int)(Math.sin(d) * 63D);
  6175. int k2 = (int)(Math.cos(d) * 57D);
  6176. mapEdge.method353(83 - k2 - 20, d, (94 + j2 + 4) - 10);
  6177. } else
  6178. {
  6179. markMinimap(sprite, k, j);
  6180. }
  6181. }
  6182.  
  6183. private void rightClickMapArea() {
  6184. if(super.mouseX >= 742 && super.mouseX <= 764 && super.mouseY >= 1 && super.mouseY <= 23 && tabInterfaceIDs[10] != -1) {
  6185. menuActionName[1] = "Logout";
  6186. menuActionID[1] = 1004;
  6187. menuActionRow = 2;
  6188. }
  6189. }
  6190.  
  6191. private void rightClickChatButtons() {
  6192. if(super.mouseX >= 6 && super.mouseX <= 62 && super.mouseY >= 482 && super.mouseY <= 503) {
  6193. menuActionName[1] = "View All";
  6194. menuActionID[1] = 999;
  6195. menuActionRow = 2;
  6196. }
  6197. else if(super.mouseX >= 63 && super.mouseX <= 118 && super.mouseY >= 482 && super.mouseY <= 503) {
  6198. menuActionName[1] = "View Game";
  6199. menuActionID[1] = 998;
  6200. menuActionRow = 2;
  6201. }
  6202. else if(super.mouseX >= 119 && super.mouseX <= 175 && super.mouseY >= 482 && super.mouseY <= 503) {
  6203. menuActionName[1] = "Hide public";
  6204. menuActionID[1] = 997;
  6205. menuActionName[2] = "Off public";
  6206. menuActionID[2] = 996;
  6207. menuActionName[3] = "Friends public";
  6208. menuActionID[3] = 995;
  6209. menuActionName[4] = "On public";
  6210. menuActionID[4] = 994;
  6211. menuActionName[5] = "View public";
  6212. menuActionID[5] = 993;
  6213. menuActionRow = 6;
  6214. }
  6215. else if(super.mouseX >= 177 && super.mouseX <= 232 && super.mouseY >= 482 && super.mouseY <= 503) {
  6216. menuActionName[1] = "Off private";
  6217. menuActionID[1] = 992;
  6218. menuActionName[2] = "Friends private";
  6219. menuActionID[2] = 991;
  6220. menuActionName[3] = "On private";
  6221. menuActionID[3] = 990;
  6222. menuActionName[4] = "View private";
  6223. menuActionID[4] = 989;
  6224. menuActionRow = 5;
  6225. }
  6226. else if(super.mouseX >= 233 && super.mouseX <= 289 && super.mouseY >= 482 && super.mouseY <= 503) {
  6227. menuActionName[1] = "Off clan chat";
  6228. menuActionID[1] = 1003;
  6229. menuActionName[2] = "Friends clan chat";
  6230. menuActionID[2] = 1002;
  6231. menuActionName[3] = "On clan chat";
  6232. menuActionID[3] = 1001;
  6233. menuActionName[4] = "View clan chat";
  6234. menuActionID[4] = 1000;
  6235. menuActionRow = 5;
  6236. }
  6237. else if(super.mouseX >= 290 && super.mouseX <= 346 && super.mouseY >= 482 && super.mouseY <= 503) {
  6238. menuActionName[1] = "Off trade";
  6239. menuActionID[1] = 987;
  6240. menuActionName[2] = "Friends trade";
  6241. menuActionID[2] = 986;
  6242. menuActionName[3] = "On trade";
  6243. menuActionID[3] = 985;
  6244. menuActionName[4] = "View trade";
  6245. menuActionID[4] = 984;
  6246. menuActionRow = 5;
  6247. }
  6248. else if(super.mouseX >= 347 && super.mouseX <= 403 && super.mouseY >= 482 && super.mouseY <= 503) {
  6249. menuActionName[1] = "Off duel";
  6250. menuActionID[1] = 983;
  6251. menuActionName[2] = "Friends duel";
  6252. menuActionID[2] = 982;
  6253. menuActionName[3] = "On duel";
  6254. menuActionID[3] = 981;
  6255. menuActionName[4] = "View duel";
  6256. menuActionID[4] = 980;
  6257. menuActionRow = 5;
  6258. }
  6259. }
  6260.  
  6261. private void processRightClick()
  6262. {
  6263. if(activeInterfaceType != 0)
  6264. return;
  6265. menuActionName[0] = "Cancel";
  6266. menuActionID[0] = 1107;
  6267. menuActionRow = 1;
  6268. buildSplitPrivateChatMenu();
  6269. anInt886 = 0;
  6270. if(super.mouseX > 4 && super.mouseY > 4 && super.mouseX < 516 && super.mouseY < 338)
  6271. if(openInterfaceID != -1)
  6272. buildInterfaceMenu(4, RSInterface.interfaceCache[openInterfaceID], super.mouseX, 4, super.mouseY, 0);
  6273. else
  6274. build3dScreenMenu();
  6275. if(anInt886 != anInt1026)
  6276. anInt1026 = anInt886;
  6277. anInt886 = 0;
  6278. if(super.mouseX > 548 && super.mouseY > 207 && super.mouseX < 740 && super.mouseY < 468)
  6279. if(invOverlayInterfaceID != -1)
  6280. buildInterfaceMenu(548, RSInterface.interfaceCache[invOverlayInterfaceID], super.mouseX, 207, super.mouseY, 0);
  6281. else
  6282. if(tabInterfaceIDs[tabID] != -1)
  6283. buildInterfaceMenu(548, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], super.mouseX, 207, super.mouseY, 0);
  6284. if(anInt886 != anInt1048)
  6285. {
  6286. needDrawTabArea = true;
  6287. anInt1048 = anInt886;
  6288. }
  6289. anInt886 = 0;
  6290. /* Chat area clicking */
  6291. if(super.mouseX > 0 && super.mouseY > 338 && super.mouseX < 490 && super.mouseY < 463)
  6292. if(backDialogID != -1)
  6293. buildInterfaceMenu(20, RSInterface.interfaceCache[backDialogID], super.mouseX, 358, super.mouseY, 0);
  6294. else
  6295. if(super.mouseY < 463 && super.mouseX < 490)
  6296. buildChatAreaMenu(super.mouseY - 338);
  6297. if(backDialogID != -1 && anInt886 != anInt1039)
  6298. {
  6299. inputTaken = true;
  6300. anInt1039 = anInt886;
  6301. }
  6302. /* Enable custom right click areas */
  6303. if(super.mouseX > 4 && super.mouseY > 480 && super.mouseX < 516 && super.mouseY < 503)
  6304. rightClickChatButtons();
  6305. if(super.mouseX > 519 && super.mouseY > 0 && super.mouseX < 765 && super.mouseY < 168)
  6306. rightClickMapArea();
  6307. /**/
  6308. boolean flag = false;
  6309. while(!flag)
  6310. {
  6311. flag = true;
  6312. for(int j = 0; j < menuActionRow - 1; j++)
  6313. if(menuActionID[j] < 1000 && menuActionID[j + 1] > 1000)
  6314. {
  6315. String s = menuActionName[j];
  6316. menuActionName[j] = menuActionName[j + 1];
  6317. menuActionName[j + 1] = s;
  6318. int k = menuActionID[j];
  6319. menuActionID[j] = menuActionID[j + 1];
  6320. menuActionID[j + 1] = k;
  6321. k = menuActionCmd2[j];
  6322. menuActionCmd2[j] = menuActionCmd2[j + 1];
  6323. menuActionCmd2[j + 1] = k;
  6324. k = menuActionCmd3[j];
  6325. menuActionCmd3[j] = menuActionCmd3[j + 1];
  6326. menuActionCmd3[j + 1] = k;
  6327. k = menuActionCmd1[j];
  6328. menuActionCmd1[j] = menuActionCmd1[j + 1];
  6329. menuActionCmd1[j + 1] = k;
  6330. flag = false;
  6331. }
  6332.  
  6333. }
  6334. }
  6335.  
  6336. private int method83(int i, int j, int k)
  6337. {
  6338. int l = 256 - k;
  6339. return ((i & 0xff00ff) * l + (j & 0xff00ff) * k & 0xff00ff00) + ((i & 0xff00) * l + (j & 0xff00) * k & 0xff0000) >> 8;
  6340. }
  6341.  
  6342. private void login(String s, String s1, boolean flag)
  6343. {
  6344. signlink.errorname = s;
  6345. try
  6346. {
  6347. if(!flag)
  6348. {
  6349. loginMessage1 = "";
  6350. loginMessage2 = "Connecting to server...";
  6351. drawLoginScreen(true);
  6352. }
  6353. socketStream = new RSSocket(this, openSocket(43594 + portOff));
  6354. long l = TextClass.longForName(s);
  6355. int i = (int)(l >> 16 & 31L);
  6356. stream.currentOffset = 0;
  6357. stream.writeWordBigEndian(14);
  6358. stream.writeWordBigEndian(i);
  6359. socketStream.queueBytes(2, stream.buffer);
  6360. for(int j = 0; j < 8; j++)
  6361. socketStream.read();
  6362.  
  6363. int k = socketStream.read();
  6364. int i1 = k;
  6365. if(k == 0)
  6366. {
  6367. socketStream.flushInputStream(inStream.buffer, 8);
  6368. inStream.currentOffset = 0;
  6369. aLong1215 = inStream.readQWord();
  6370. int ai[] = new int[4];
  6371. ai[0] = (int)(Math.random() * 99999999D);
  6372. ai[1] = (int)(Math.random() * 99999999D);
  6373. ai[2] = (int)(aLong1215 >> 32);
  6374. ai[3] = (int)aLong1215;
  6375. stream.currentOffset = 0;
  6376. stream.writeWordBigEndian(10);
  6377. stream.writeDWord(ai[0]);
  6378. stream.writeDWord(ai[1]);
  6379. stream.writeDWord(ai[2]);
  6380. stream.writeDWord(ai[3]);
  6381. stream.writeDWord(signlink.uid);
  6382. stream.writeString(s);
  6383. stream.writeString(s1);
  6384. stream.doKeys();
  6385. aStream_847.currentOffset = 0;
  6386. if(flag)
  6387. aStream_847.writeWordBigEndian(18);
  6388. else
  6389. aStream_847.writeWordBigEndian(16);
  6390. aStream_847.writeWordBigEndian(stream.currentOffset + 36 + 1 + 1 + 2);
  6391. aStream_847.writeWordBigEndian(255);
  6392. aStream_847.writeWord(317);
  6393. aStream_847.writeWordBigEndian(lowMem ? 1 : 0);
  6394. for(int l1 = 0; l1 < 9; l1++)
  6395. aStream_847.writeDWord(expectedCRCs[l1]);
  6396.  
  6397. aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
  6398. stream.encryption = new ISAACRandomGen(ai);
  6399. for(int j2 = 0; j2 < 4; j2++)
  6400. ai[j2] += 50;
  6401.  
  6402. encryption = new ISAACRandomGen(ai);
  6403. socketStream.queueBytes(aStream_847.currentOffset, aStream_847.buffer);
  6404. k = socketStream.read();
  6405. }
  6406. if(k == 1)
  6407. {
  6408. try
  6409. {
  6410. Thread.sleep(2000L);
  6411. }
  6412. catch(Exception _ex) { }
  6413. login(s, s1, flag);
  6414. return;
  6415. }
  6416. if(k == 2)
  6417. {
  6418. myPrivilege = socketStream.read();
  6419. flagged = socketStream.read() == 1;
  6420. aLong1220 = 0L;
  6421. anInt1022 = 0;
  6422. mouseDetection.coordsIndex = 0;
  6423. super.awtFocus = true;
  6424. aBoolean954 = true;
  6425. loggedIn = true;
  6426. stream.currentOffset = 0;
  6427. inStream.currentOffset = 0;
  6428. pktType = -1;
  6429. anInt841 = -1;
  6430. anInt842 = -1;
  6431. anInt843 = -1;
  6432. pktSize = 0;
  6433. anInt1009 = 0;
  6434. anInt1104 = 0;
  6435. anInt1011 = 0;
  6436. anInt855 = 0;
  6437. menuActionRow = 0;
  6438. menuOpen = false;
  6439. super.idleTime = 0;
  6440. for(int j1 = 0; j1 < 100; j1++)
  6441. chatMessages[j1] = null;
  6442.  
  6443. itemSelected = 0;
  6444. spellSelected = 0;
  6445. loadingStage = 0;
  6446. anInt1062 = 0;
  6447. anInt1278 = (int)(Math.random() * 100D) - 50;
  6448. anInt1131 = (int)(Math.random() * 110D) - 55;
  6449. anInt896 = (int)(Math.random() * 80D) - 40;
  6450. minimapInt2 = (int)(Math.random() * 120D) - 60;
  6451. minimapInt3 = (int)(Math.random() * 30D) - 20;
  6452. minimapInt1 = (int)(Math.random() * 20D) - 10 & 0x7ff;
  6453. anInt1021 = 0;
  6454. anInt985 = -1;
  6455. destX = 0;
  6456. destY = 0;
  6457. playerCount = 0;
  6458. npcCount = 0;
  6459. for(int i2 = 0; i2 < maxPlayers; i2++)
  6460. {
  6461. playerArray[i2] = null;
  6462. aStreamArray895s[i2] = null;
  6463. }
  6464.  
  6465. for(int k2 = 0; k2 < 16384; k2++)
  6466. npcArray[k2] = null;
  6467.  
  6468. myPlayer = playerArray[myPlayerIndex] = new Player();
  6469. aClass19_1013.removeAll();
  6470. aClass19_1056.removeAll();
  6471. for(int l2 = 0; l2 < 4; l2++)
  6472. {
  6473. for(int i3 = 0; i3 < 104; i3++)
  6474. {
  6475. for(int k3 = 0; k3 < 104; k3++)
  6476. groundArray[l2][i3][k3] = null;
  6477.  
  6478. }
  6479.  
  6480. }
  6481.  
  6482. aClass19_1179 = new NodeList();
  6483. anInt900 = 0;
  6484. friendsCount = 0;
  6485. dialogID = -1;
  6486. backDialogID = -1;
  6487. openInterfaceID = -1;
  6488. invOverlayInterfaceID = -1;
  6489. anInt1018 = -1;
  6490. aBoolean1149 = false;
  6491. tabID = 3;
  6492. inputDialogState = 0;
  6493. menuOpen = false;
  6494. messagePromptRaised = false;
  6495. aString844 = null;
  6496. anInt1055 = 0;
  6497. anInt1054 = -1;
  6498. aBoolean1047 = true;
  6499. method45();
  6500. for(int j3 = 0; j3 < 5; j3++)
  6501. anIntArray990[j3] = 0;
  6502.  
  6503. for(int l3 = 0; l3 < 5; l3++)
  6504. {
  6505. atPlayerActions[l3] = null;
  6506. atPlayerArray[l3] = false;
  6507. }
  6508.  
  6509. anInt1175 = 0;
  6510. anInt1134 = 0;
  6511. anInt986 = 0;
  6512. anInt1288 = 0;
  6513. anInt924 = 0;
  6514. anInt1188 = 0;
  6515. anInt1155 = 0;
  6516. anInt1226 = 0;
  6517. int anInt941 = 0;
  6518. int anInt1260 = 0;
  6519. resetImageProducers2();
  6520. return;
  6521. }
  6522. if(k == 3)
  6523. {
  6524. loginMessage1 = "";
  6525. loginMessage2 = "Invalid username or password.";
  6526. return;
  6527. }
  6528. if(k == 4)
  6529. {
  6530. loginMessage1 = "Your account has been disabled.";
  6531. loginMessage2 = "Please check your message-center for details.";
  6532. return;
  6533. }
  6534. if(k == 5)
  6535. {
  6536. loginMessage1 = "Your account is already logged in.";
  6537. loginMessage2 = "Try again in 60 secs...";
  6538. return;
  6539. }
  6540. if(k == 6)
  6541. {
  6542. loginMessage1 = "MiscellaPS has been updated!";
  6543. loginMessage2 = "Please reload this page.";
  6544. return;
  6545. }
  6546. if(k == 7)
  6547. {
  6548. loginMessage1 = "This world is full.";
  6549. loginMessage2 = "Please use a different world.";
  6550. return;
  6551. }
  6552. if(k == 8)
  6553. {
  6554. loginMessage1 = "Unable to connect.";
  6555. loginMessage2 = "Login server offline.";
  6556. return;
  6557. }
  6558. if(k == 9)
  6559. {
  6560. loginMessage1 = "Login limit exceeded.";
  6561. loginMessage2 = "Too many connections from your address.";
  6562. return;
  6563. }
  6564. if(k == 10)
  6565. {
  6566. loginMessage1 = "Unable to connect.";
  6567. loginMessage2 = "Bad session id.";
  6568. return;
  6569. }
  6570. if(k == 11)
  6571. {
  6572. loginMessage2 = "Login server rejected session.";
  6573. loginMessage2 = "Please try again.";
  6574. return;
  6575. }
  6576. if(k == 12)
  6577. {
  6578. loginMessage1 = "You need a members account to login to this world.";
  6579. loginMessage2 = "Please subscribe, or use a different world.";
  6580. return;
  6581. }
  6582. if(k == 13)
  6583. {
  6584. loginMessage1 = "Could not complete login.";
  6585. loginMessage2 = "Please try using a different world.";
  6586. return;
  6587. }
  6588. if(k == 14)
  6589. {
  6590. loginMessage1 = "The server is being updated.";
  6591. loginMessage2 = "Please wait 1 minute and try again.";
  6592. return;
  6593. }
  6594. if(k == 15)
  6595. {
  6596. loggedIn = true;
  6597. stream.currentOffset = 0;
  6598. inStream.currentOffset = 0;
  6599. pktType = -1;
  6600. anInt841 = -1;
  6601. anInt842 = -1;
  6602. anInt843 = -1;
  6603. pktSize = 0;
  6604. anInt1009 = 0;
  6605. anInt1104 = 0;
  6606. menuActionRow = 0;
  6607. menuOpen = false;
  6608. aLong824 = System.currentTimeMillis();
  6609. return;
  6610. }
  6611. if(k == 16)
  6612. {
  6613. loginMessage1 = "Login attempts exceeded.";
  6614. loginMessage2 = "Please wait 1 minute and try again.";
  6615. return;
  6616. }
  6617. if(k == 17)
  6618. {
  6619. loginMessage1 = "You are standing in a members-only area.";
  6620. loginMessage2 = "To play on this world move to a free area first";
  6621. return;
  6622. }
  6623. if(k == 20)
  6624. {
  6625. loginMessage1 = "Invalid loginserver requested";
  6626. loginMessage2 = "Please try using a different world.";
  6627. return;
  6628. }
  6629. if(k == 21)
  6630. {
  6631. for(int k1 = socketStream.read(); k1 >= 0; k1--)
  6632. {
  6633. loginMessage1 = "You have only just left another world";
  6634. loginMessage2 = "Your profile will be transferred in: " + k1 + " seconds";
  6635. drawLoginScreen(true);
  6636. try
  6637. {
  6638. Thread.sleep(1000L);
  6639. }
  6640. catch(Exception _ex) { }
  6641. }
  6642.  
  6643. login(s, s1, flag);
  6644. return;
  6645. }
  6646. if(k == -1)
  6647. {
  6648. if(i1 == 0)
  6649. {
  6650. if(loginFailures < 2)
  6651. {
  6652. try
  6653. {
  6654. Thread.sleep(2000L);
  6655. }
  6656. catch(Exception _ex) { }
  6657. loginFailures++;
  6658. login(s, s1, flag);
  6659. return;
  6660. } else
  6661. {
  6662. loginMessage1 = "No response from loginserver";
  6663. loginMessage2 = "Please wait 1 minute and try again.";
  6664. return;
  6665. }
  6666. } else
  6667. {
  6668. loginMessage1 = "No response from server";
  6669. loginMessage2 = "Please try using a different world.";
  6670. return;
  6671. }
  6672. } else
  6673. {
  6674. System.out.println("response:" + k);
  6675. loginMessage1 = "Unexpected server response";
  6676. loginMessage2 = "Please try using a different world.";
  6677. return;
  6678. }
  6679. }
  6680. catch(IOException _ex)
  6681. {
  6682. loginMessage1 = "";
  6683. }
  6684. loginMessage2 = "Error connecting to server.";
  6685. }
  6686.  
  6687. private boolean doWalkTo(int i, int j, int k, int i1, int j1, int k1,
  6688. int l1, int i2, int j2, boolean flag, int k2)
  6689. {
  6690. byte byte0 = 104;
  6691. byte byte1 = 104;
  6692. for(int l2 = 0; l2 < byte0; l2++)
  6693. {
  6694. for(int i3 = 0; i3 < byte1; i3++)
  6695. {
  6696. anIntArrayArray901[l2][i3] = 0;
  6697. anIntArrayArray825[l2][i3] = 0x5f5e0ff;
  6698. }
  6699.  
  6700. }
  6701.  
  6702. int j3 = j2;
  6703. int k3 = j1;
  6704. anIntArrayArray901[j2][j1] = 99;
  6705. anIntArrayArray825[j2][j1] = 0;
  6706. int l3 = 0;
  6707. int i4 = 0;
  6708. bigX[l3] = j2;
  6709. bigY[l3++] = j1;
  6710. boolean flag1 = false;
  6711. int j4 = bigX.length;
  6712. int ai[][] = aClass11Array1230[plane].anIntArrayArray294;
  6713. while(i4 != l3)
  6714. {
  6715. j3 = bigX[i4];
  6716. k3 = bigY[i4];
  6717. i4 = (i4 + 1) % j4;
  6718. if(j3 == k2 && k3 == i2)
  6719. {
  6720. flag1 = true;
  6721. break;
  6722. }
  6723. if(i1 != 0)
  6724. {
  6725. if((i1 < 5 || i1 == 10) && aClass11Array1230[plane].method219(k2, j3, k3, j, i1 - 1, i2))
  6726. {
  6727. flag1 = true;
  6728. break;
  6729. }
  6730. if(i1 < 10 && aClass11Array1230[plane].method220(k2, i2, k3, i1 - 1, j, j3))
  6731. {
  6732. flag1 = true;
  6733. break;
  6734. }
  6735. }
  6736. if(k1 != 0 && k != 0 && aClass11Array1230[plane].method221(i2, k2, j3, k, l1, k1, k3))
  6737. {
  6738. flag1 = true;
  6739. break;
  6740. }
  6741. int l4 = anIntArrayArray825[j3][k3] + 1;
  6742. if(j3 > 0 && anIntArrayArray901[j3 - 1][k3] == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0)
  6743. {
  6744. bigX[l3] = j3 - 1;
  6745. bigY[l3] = k3;
  6746. l3 = (l3 + 1) % j4;
  6747. anIntArrayArray901[j3 - 1][k3] = 2;
  6748. anIntArrayArray825[j3 - 1][k3] = l4;
  6749. }
  6750. if(j3 < byte0 - 1 && anIntArrayArray901[j3 + 1][k3] == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0)
  6751. {
  6752. bigX[l3] = j3 + 1;
  6753. bigY[l3] = k3;
  6754. l3 = (l3 + 1) % j4;
  6755. anIntArrayArray901[j3 + 1][k3] = 8;
  6756. anIntArrayArray825[j3 + 1][k3] = l4;
  6757. }
  6758. if(k3 > 0 && anIntArrayArray901[j3][k3 - 1] == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0)
  6759. {
  6760. bigX[l3] = j3;
  6761. bigY[l3] = k3 - 1;
  6762. l3 = (l3 + 1) % j4;
  6763. anIntArrayArray901[j3][k3 - 1] = 1;
  6764. anIntArrayArray825[j3][k3 - 1] = l4;
  6765. }
  6766. if(k3 < byte1 - 1 && anIntArrayArray901[j3][k3 + 1] == 0 && (ai[j3][k3 + 1] & 0x1280120) == 0)
  6767. {
  6768. bigX[l3] = j3;
  6769. bigY[l3] = k3 + 1;
  6770. l3 = (l3 + 1) % j4;
  6771. anIntArrayArray901[j3][k3 + 1] = 4;
  6772. anIntArrayArray825[j3][k3 + 1] = l4;
  6773. }
  6774. 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)
  6775. {
  6776. bigX[l3] = j3 - 1;
  6777. bigY[l3] = k3 - 1;
  6778. l3 = (l3 + 1) % j4;
  6779. anIntArrayArray901[j3 - 1][k3 - 1] = 3;
  6780. anIntArrayArray825[j3 - 1][k3 - 1] = l4;
  6781. }
  6782. 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)
  6783. {
  6784. bigX[l3] = j3 + 1;
  6785. bigY[l3] = k3 - 1;
  6786. l3 = (l3 + 1) % j4;
  6787. anIntArrayArray901[j3 + 1][k3 - 1] = 9;
  6788. anIntArrayArray825[j3 + 1][k3 - 1] = l4;
  6789. }
  6790. 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)
  6791. {
  6792. bigX[l3] = j3 - 1;
  6793. bigY[l3] = k3 + 1;
  6794. l3 = (l3 + 1) % j4;
  6795. anIntArrayArray901[j3 - 1][k3 + 1] = 6;
  6796. anIntArrayArray825[j3 - 1][k3 + 1] = l4;
  6797. }
  6798. 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)
  6799. {
  6800. bigX[l3] = j3 + 1;
  6801. bigY[l3] = k3 + 1;
  6802. l3 = (l3 + 1) % j4;
  6803. anIntArrayArray901[j3 + 1][k3 + 1] = 12;
  6804. anIntArrayArray825[j3 + 1][k3 + 1] = l4;
  6805. }
  6806. }
  6807. anInt1264 = 0;
  6808. if(!flag1)
  6809. {
  6810. if(flag)
  6811. {
  6812. int i5 = 100;
  6813. for(int k5 = 1; k5 < 2; k5++)
  6814. {
  6815. for(int i6 = k2 - k5; i6 <= k2 + k5; i6++)
  6816. {
  6817. for(int l6 = i2 - k5; l6 <= i2 + k5; l6++)
  6818. if(i6 >= 0 && l6 >= 0 && i6 < 104 && l6 < 104 && anIntArrayArray825[i6][l6] < i5)
  6819. {
  6820. i5 = anIntArrayArray825[i6][l6];
  6821. j3 = i6;
  6822. k3 = l6;
  6823. anInt1264 = 1;
  6824. flag1 = true;
  6825. }
  6826.  
  6827. }
  6828.  
  6829. if(flag1)
  6830. break;
  6831. }
  6832.  
  6833. }
  6834. if(!flag1)
  6835. return false;
  6836. }
  6837. i4 = 0;
  6838. bigX[i4] = j3;
  6839. bigY[i4++] = k3;
  6840. int l5;
  6841. for(int j5 = l5 = anIntArrayArray901[j3][k3]; j3 != j2 || k3 != j1; j5 = anIntArrayArray901[j3][k3])
  6842. {
  6843. if(j5 != l5)
  6844. {
  6845. l5 = j5;
  6846. bigX[i4] = j3;
  6847. bigY[i4++] = k3;
  6848. }
  6849. if((j5 & 2) != 0)
  6850. j3++;
  6851. else
  6852. if((j5 & 8) != 0)
  6853. j3--;
  6854. if((j5 & 1) != 0)
  6855. k3++;
  6856. else
  6857. if((j5 & 4) != 0)
  6858. k3--;
  6859. }
  6860. // if(cancelWalk) { return i4 > 0; }
  6861.  
  6862.  
  6863. if(i4 > 0)
  6864. {
  6865. int k4 = i4;
  6866. if(k4 > 25)
  6867. k4 = 25;
  6868. i4--;
  6869. int k6 = bigX[i4];
  6870. int i7 = bigY[i4];
  6871. anInt1288 += k4;
  6872. if(anInt1288 >= 92)
  6873. {
  6874. stream.createFrame(36);
  6875. stream.writeDWord(0);
  6876. anInt1288 = 0;
  6877. }
  6878. if(i == 0)
  6879. {
  6880. stream.createFrame(164);
  6881. stream.writeWordBigEndian(k4 + k4 + 3);
  6882. }
  6883. if(i == 1)
  6884. {
  6885. stream.createFrame(248);
  6886. stream.writeWordBigEndian(k4 + k4 + 3 + 14);
  6887. }
  6888. if(i == 2)
  6889. {
  6890. stream.createFrame(98);
  6891. stream.writeWordBigEndian(k4 + k4 + 3);
  6892. }
  6893. stream.method433(k6 + baseX);
  6894. destX = bigX[0];
  6895. destY = bigY[0];
  6896. for(int j7 = 1; j7 < k4; j7++)
  6897. {
  6898. i4--;
  6899. stream.writeWordBigEndian(bigX[i4] - k6);
  6900. stream.writeWordBigEndian(bigY[i4] - i7);
  6901. }
  6902.  
  6903. stream.method431(i7 + baseY);
  6904. stream.method424(super.keyArray[5] != 1 ? 0 : 1);
  6905. return true;
  6906. }
  6907. return i != 1;
  6908. }
  6909.  
  6910. private void method86(Stream stream)
  6911. {
  6912. for(int j = 0; j < anInt893; j++)
  6913. {
  6914. int k = anIntArray894[j];
  6915. NPC npc = npcArray[k];
  6916. int l = stream.readUnsignedByte();
  6917. if((l & 0x10) != 0)
  6918. {
  6919. int i1 = stream.method434();
  6920. if(i1 == 65535)
  6921. i1 = -1;
  6922. int i2 = stream.readUnsignedByte();
  6923. if(i1 == npc.anim && i1 != -1)
  6924. {
  6925. int l2 = Animation.anims[i1].anInt365;
  6926. if(l2 == 1)
  6927. {
  6928. npc.anInt1527 = 0;
  6929. npc.anInt1528 = 0;
  6930. npc.anInt1529 = i2;
  6931. npc.anInt1530 = 0;
  6932. }
  6933. if(l2 == 2)
  6934. npc.anInt1530 = 0;
  6935. } else
  6936. if(i1 == -1 || npc.anim == -1 || Animation.anims[i1].anInt359 >= Animation.anims[npc.anim].anInt359)
  6937. {
  6938. npc.anim = i1;
  6939. npc.anInt1527 = 0;
  6940. npc.anInt1528 = 0;
  6941. npc.anInt1529 = i2;
  6942. npc.anInt1530 = 0;
  6943. npc.anInt1542 = npc.smallXYIndex;
  6944. }
  6945. }
  6946. if((l & 8) != 0)
  6947. {
  6948. int j1 = stream.method426();
  6949. int j2 = stream.method427();
  6950. npc.updateHitData(j2, j1, loopCycle);
  6951. npc.loopCycleStatus = loopCycle + 300;
  6952. npc.currentHealth = stream.method426();
  6953. npc.maxHealth = stream.readUnsignedByte();
  6954. }
  6955. if((l & 0x80) != 0)
  6956. {
  6957. npc.anInt1520 = stream.readUnsignedWord();
  6958. int k1 = stream.readDWord();
  6959. npc.anInt1524 = k1 >> 16;
  6960. npc.anInt1523 = loopCycle + (k1 & 0xffff);
  6961. npc.anInt1521 = 0;
  6962. npc.anInt1522 = 0;
  6963. if(npc.anInt1523 > loopCycle)
  6964. npc.anInt1521 = -1;
  6965. if(npc.anInt1520 == 65535)
  6966. npc.anInt1520 = -1;
  6967. }
  6968. if((l & 0x20) != 0)
  6969. {
  6970. npc.interactingEntity = stream.readUnsignedWord();
  6971. if(npc.interactingEntity == 65535)
  6972. npc.interactingEntity = -1;
  6973. }
  6974. if((l & 1) != 0)
  6975. {
  6976. npc.textSpoken = stream.readString();
  6977. npc.textCycle = 100;
  6978. // entityMessage(npc);
  6979.  
  6980. }
  6981. if((l & 0x40) != 0)
  6982. {
  6983. int l1 = stream.method427();
  6984. int k2 = stream.method428();
  6985. npc.updateHitData(k2, l1, loopCycle);
  6986. npc.loopCycleStatus = loopCycle + 300;
  6987. npc.currentHealth = stream.method428();
  6988. npc.maxHealth = stream.method427();
  6989. }
  6990. if((l & 2) != 0)
  6991. {
  6992. npc.desc = EntityDef.forID(stream.method436());
  6993. npc.anInt1540 = npc.desc.aByte68;
  6994. npc.anInt1504 = npc.desc.anInt79;
  6995. npc.anInt1554 = npc.desc.anInt67;
  6996. npc.anInt1555 = npc.desc.anInt58;
  6997. npc.anInt1556 = npc.desc.anInt83;
  6998. npc.anInt1557 = npc.desc.anInt55;
  6999. npc.anInt1511 = npc.desc.anInt77;
  7000. }
  7001. if((l & 4) != 0)
  7002. {
  7003. npc.anInt1538 = stream.method434();
  7004. npc.anInt1539 = stream.method434();
  7005. }
  7006. }
  7007. }
  7008.  
  7009. private void buildAtNPCMenu(EntityDef entityDef, int i, int j, int k)
  7010. {
  7011. if(menuActionRow >= 400)
  7012. return;
  7013. if(entityDef.childrenIDs != null)
  7014. entityDef = entityDef.method161();
  7015. if(entityDef == null)
  7016. return;
  7017. if(!entityDef.aBoolean84)
  7018. return;
  7019. String s = entityDef.name;
  7020. if(entityDef.combatLevel != 0)
  7021. s = s + combatDiffColor(myPlayer.combatLevel, entityDef.combatLevel) + " (level-" + entityDef.combatLevel + ")";
  7022. if(itemSelected == 1)
  7023. {
  7024. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @yel@" + s;
  7025. menuActionID[menuActionRow] = 582;
  7026. menuActionCmd1[menuActionRow] = i;
  7027. menuActionCmd2[menuActionRow] = k;
  7028. menuActionCmd3[menuActionRow] = j;
  7029. menuActionRow++;
  7030. return;
  7031. }
  7032. if(spellSelected == 1)
  7033. {
  7034. if((spellUsableOn & 2) == 2)
  7035. {
  7036. menuActionName[menuActionRow] = spellTooltip + " @yel@" + s;
  7037. menuActionID[menuActionRow] = 413;
  7038. menuActionCmd1[menuActionRow] = i;
  7039. menuActionCmd2[menuActionRow] = k;
  7040. menuActionCmd3[menuActionRow] = j;
  7041. menuActionRow++;
  7042. }
  7043. } else
  7044. {
  7045. if(entityDef.actions != null)
  7046. {
  7047. for(int l = 4; l >= 0; l--)
  7048. if(entityDef.actions[l] != null && !entityDef.actions[l].equalsIgnoreCase("attack"))
  7049. {
  7050. menuActionName[menuActionRow] = entityDef.actions[l] + " @yel@" + s;
  7051. if(l == 0)
  7052. menuActionID[menuActionRow] = 20;
  7053. if(l == 1)
  7054. menuActionID[menuActionRow] = 412;
  7055. if(l == 2)
  7056. menuActionID[menuActionRow] = 225;
  7057. if(l == 3)
  7058. menuActionID[menuActionRow] = 965;
  7059. if(l == 4)
  7060. menuActionID[menuActionRow] = 478;
  7061. menuActionCmd1[menuActionRow] = i;
  7062. menuActionCmd2[menuActionRow] = k;
  7063. menuActionCmd3[menuActionRow] = j;
  7064. menuActionRow++;
  7065. }
  7066.  
  7067. }
  7068. if(entityDef.actions != null)
  7069. {
  7070. for(int i1 = 4; i1 >= 0; i1--)
  7071. if(entityDef.actions[i1] != null && entityDef.actions[i1].equalsIgnoreCase("attack"))
  7072. {
  7073. char c = '\0';
  7074. if(entityDef.combatLevel > myPlayer.combatLevel)
  7075. c = '\u07D0';
  7076. menuActionName[menuActionRow] = entityDef.actions[i1] + " @yel@" + s;
  7077. if(i1 == 0)
  7078. menuActionID[menuActionRow] = 20 + c;
  7079. if(i1 == 1)
  7080. menuActionID[menuActionRow] = 412 + c;
  7081. if(i1 == 2)
  7082. menuActionID[menuActionRow] = 225 + c;
  7083. if(i1 == 3)
  7084. menuActionID[menuActionRow] = 965 + c;
  7085. if(i1 == 4)
  7086. menuActionID[menuActionRow] = 478 + c;
  7087. menuActionCmd1[menuActionRow] = i;
  7088. menuActionCmd2[menuActionRow] = k;
  7089. menuActionCmd3[menuActionRow] = j;
  7090. menuActionRow++;
  7091. }
  7092.  
  7093. }
  7094. //menuActionName[menuActionRow] = "Examine @yel@" + s + " @gre@(@whi@" + entityDef.type + "@gre@)";
  7095. menuActionName[menuActionRow] = "Examine @yel@" + s;
  7096. menuActionID[menuActionRow] = 1025;
  7097. menuActionCmd1[menuActionRow] = i;
  7098. menuActionCmd2[menuActionRow] = k;
  7099. menuActionCmd3[menuActionRow] = j;
  7100. menuActionRow++;
  7101. }
  7102. }
  7103.  
  7104. private void buildAtPlayerMenu(int i, int j, Player player, int k)
  7105. {
  7106. if(player == myPlayer)
  7107. return;
  7108. if(menuActionRow >= 400)
  7109. return;
  7110. String s;
  7111. if(player.skill == 0)
  7112. s = player.name + combatDiffColor(myPlayer.combatLevel, player.combatLevel) + " (level-" + player.combatLevel + ")";
  7113. else
  7114. s = player.name + " (skill-" + player.skill + ")";
  7115. if(itemSelected == 1)
  7116. {
  7117. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @whi@" + s;
  7118. menuActionID[menuActionRow] = 491;
  7119. menuActionCmd1[menuActionRow] = j;
  7120. menuActionCmd2[menuActionRow] = i;
  7121. menuActionCmd3[menuActionRow] = k;
  7122. menuActionRow++;
  7123. } else
  7124. if(spellSelected == 1)
  7125. {
  7126. if((spellUsableOn & 8) == 8)
  7127. {
  7128. menuActionName[menuActionRow] = spellTooltip + " @whi@" + s;
  7129. menuActionID[menuActionRow] = 365;
  7130. menuActionCmd1[menuActionRow] = j;
  7131. menuActionCmd2[menuActionRow] = i;
  7132. menuActionCmd3[menuActionRow] = k;
  7133. menuActionRow++;
  7134. }
  7135. } else
  7136. {
  7137. for(int l = 4; l >= 0; l--)
  7138. if(atPlayerActions[l] != null)
  7139. {
  7140. menuActionName[menuActionRow] = atPlayerActions[l] + " @whi@" + s;
  7141. char c = '\0';
  7142. if(atPlayerActions[l].equalsIgnoreCase("attack"))
  7143. {
  7144. if(player.combatLevel > myPlayer.combatLevel)
  7145. c = '\u07D0';
  7146. if(myPlayer.team != 0 && player.team != 0)
  7147. if(myPlayer.team == player.team)
  7148. c = '\u07D0';
  7149. else
  7150. c = '\0';
  7151. } else
  7152. if(atPlayerArray[l])
  7153. c = '\u07D0';
  7154. if(l == 0)
  7155. menuActionID[menuActionRow] = 561 + c;
  7156. if(l == 1)
  7157. menuActionID[menuActionRow] = 779 + c;
  7158. if(l == 2)
  7159. menuActionID[menuActionRow] = 27 + c;
  7160. if(l == 3)
  7161. menuActionID[menuActionRow] = 577 + c;
  7162. if(l == 4)
  7163. menuActionID[menuActionRow] = 729 + c;
  7164. menuActionCmd1[menuActionRow] = j;
  7165. menuActionCmd2[menuActionRow] = i;
  7166. menuActionCmd3[menuActionRow] = k;
  7167. menuActionRow++;
  7168. }
  7169.  
  7170. }
  7171. for(int i1 = 0; i1 < menuActionRow; i1++)
  7172. if(menuActionID[i1] == 516)
  7173. {
  7174. menuActionName[i1] = "Walk here @whi@" + s;
  7175. return;
  7176. }
  7177.  
  7178. }
  7179.  
  7180. private void method89(Class30_Sub1 class30_sub1)
  7181. {
  7182. int i = 0;
  7183. int j = -1;
  7184. int k = 0;
  7185. int l = 0;
  7186. if(class30_sub1.anInt1296 == 0)
  7187. i = worldController.method300(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7188. if(class30_sub1.anInt1296 == 1)
  7189. i = worldController.method301(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7190. if(class30_sub1.anInt1296 == 2)
  7191. i = worldController.method302(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7192. if(class30_sub1.anInt1296 == 3)
  7193. i = worldController.method303(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7194. if(i != 0)
  7195. {
  7196. int i1 = worldController.method304(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298, i);
  7197. j = i >> 14 & 0x7fff;
  7198. k = i1 & 0x1f;
  7199. l = i1 >> 6;
  7200. }
  7201. class30_sub1.anInt1299 = j;
  7202. class30_sub1.anInt1301 = k;
  7203. class30_sub1.anInt1300 = l;
  7204. }
  7205.  
  7206. private void method90()
  7207. {
  7208. for(int i = 0; i < anInt1062; i++)
  7209. if(anIntArray1250[i] <= 0)
  7210. {
  7211. boolean flag1 = false;
  7212. try
  7213. {
  7214. if(anIntArray1207[i] == anInt874 && anIntArray1241[i] == anInt1289)
  7215. {
  7216. if(!replayWave())
  7217. flag1 = true;
  7218. } else
  7219. {
  7220. Stream stream = Sounds.method241(anIntArray1241[i], anIntArray1207[i]);
  7221. if(System.currentTimeMillis() + (long)(stream.currentOffset / 22) > aLong1172 + (long)(anInt1257 / 22))
  7222. {
  7223. anInt1257 = stream.currentOffset;
  7224. aLong1172 = System.currentTimeMillis();
  7225. if(saveWave(stream.buffer, stream.currentOffset))
  7226. {
  7227. anInt874 = anIntArray1207[i];
  7228. anInt1289 = anIntArray1241[i];
  7229. } else
  7230. {
  7231. flag1 = true;
  7232. }
  7233. }
  7234. }
  7235. }
  7236. catch(Exception exception) { }
  7237. if(!flag1 || anIntArray1250[i] == -5)
  7238. {
  7239. anInt1062--;
  7240. for(int j = i; j < anInt1062; j++)
  7241. {
  7242. anIntArray1207[j] = anIntArray1207[j + 1];
  7243. anIntArray1241[j] = anIntArray1241[j + 1];
  7244. anIntArray1250[j] = anIntArray1250[j + 1];
  7245. }
  7246.  
  7247. i--;
  7248. } else
  7249. {
  7250. anIntArray1250[i] = -5;
  7251. }
  7252. } else
  7253. {
  7254. anIntArray1250[i]--;
  7255. }
  7256.  
  7257. if(prevSong > 0)
  7258. {
  7259. prevSong -= 20;
  7260. if(prevSong < 0)
  7261. prevSong = 0;
  7262. if(prevSong == 0 && musicEnabled && !lowMem)
  7263. {
  7264. nextSong = currentSong;
  7265. songChanging = true;
  7266. onDemandFetcher.method558(2, nextSong);
  7267. }
  7268. }
  7269. }
  7270.  
  7271. void startUp()
  7272. {
  7273. drawLoadingText(20, "Starting up");
  7274. if(signlink.sunjava)
  7275. super.minDelay = 5;
  7276. if(aBoolean993)
  7277. {
  7278. // rsAlreadyLoaded = true;
  7279. // return;
  7280. }
  7281. aBoolean993 = true;
  7282. boolean flag = true;
  7283. String s = getDocumentBaseHost();
  7284. if(signlink.cache_dat != null)
  7285. {
  7286. for(int i = 0; i < 5; i++)
  7287. decompressors[i] = new Decompressor(signlink.cache_dat, signlink.cache_idx[i], i + 1);
  7288. } try {
  7289. titleStreamLoader = streamLoaderForName(1, "title screen", "title", expectedCRCs[1], 25);
  7290. smallText = new TextDrawingArea(false, "p11_full", titleStreamLoader);
  7291. aTextDrawingArea_1271 = new TextDrawingArea(false, "p12_full", titleStreamLoader);
  7292. chatTextDrawingArea = new TextDrawingArea(false, "b12_full", titleStreamLoader);
  7293. TextDrawingArea aTextDrawingArea_1273 = new TextDrawingArea(true, "q8_full", titleStreamLoader);
  7294. drawLogo();
  7295. loadTitleScreen();
  7296. StreamLoader streamLoader = streamLoaderForName(2, "config", "config", expectedCRCs[2], 30);
  7297. StreamLoader streamLoader_1 = streamLoaderForName(3, "interface", "interface", expectedCRCs[3], 35);
  7298. StreamLoader streamLoader_2 = streamLoaderForName(4, "2d graphics", "media", expectedCRCs[4], 40);
  7299. StreamLoader streamLoader_3 = streamLoaderForName(6, "textures", "textures", expectedCRCs[6], 45);
  7300. StreamLoader streamLoader_4 = streamLoaderForName(7, "chat system", "wordenc", expectedCRCs[7], 50);
  7301. StreamLoader streamLoader_5 = streamLoaderForName(8, "sound effects", "sounds", expectedCRCs[8], 55);
  7302. byteGroundArray = new byte[4][104][104];
  7303. intGroundArray = new int[4][105][105];
  7304. worldController = new WorldController(intGroundArray);
  7305. for(int j = 0; j < 4; j++)
  7306. aClass11Array1230[j] = new Class11();
  7307.  
  7308. aClass30_Sub2_Sub1_Sub1_1263 = new Sprite(512, 512);
  7309. StreamLoader streamLoader_6 = streamLoaderForName(5, "update list", "versionlist", expectedCRCs[5], 60);
  7310. drawLoadingText(60, "Connecting to update server");
  7311. onDemandFetcher = new OnDemandFetcher();
  7312. onDemandFetcher.start(streamLoader_6, this);
  7313. Class36.method528(onDemandFetcher.getAnimCount());
  7314. Model.method459(onDemandFetcher.getVersionCount(0), onDemandFetcher);
  7315. preloadModels();
  7316. if(!lowMem)
  7317. {
  7318. nextSong = 0;
  7319. try
  7320. {
  7321. nextSong = Integer.parseInt(getParameter("music"));
  7322. }
  7323. catch(Exception _ex) { }
  7324. songChanging = true;
  7325. onDemandFetcher.method558(2, nextSong);
  7326. while(onDemandFetcher.getNodeCount() > 0)
  7327. {
  7328. processOnDemandQueue();
  7329. try
  7330. {
  7331. Thread.sleep(100L);
  7332. }
  7333. catch(Exception _ex) { }
  7334. if(onDemandFetcher.anInt1349 > 3)
  7335. {
  7336. loadError();
  7337. return;
  7338. }
  7339. }
  7340. }
  7341. drawLoadingText(65, "Requesting animations");
  7342. int k = onDemandFetcher.getVersionCount(1);
  7343. for(int i1 = 0; i1 < k; i1++)
  7344. onDemandFetcher.method558(1, i1);
  7345.  
  7346. while(onDemandFetcher.getNodeCount() > 0)
  7347. {
  7348. int j1 = k - onDemandFetcher.getNodeCount();
  7349. if(j1 > 0)
  7350. drawLoadingText(65, "Loading animations - " + (j1 * 100) / k + "%");
  7351. processOnDemandQueue();
  7352. try
  7353. {
  7354. Thread.sleep(100L);
  7355. }
  7356. catch(Exception _ex) { }
  7357. if(onDemandFetcher.anInt1349 > 3)
  7358. {
  7359. loadError();
  7360. return;
  7361. }
  7362. }
  7363. drawLoadingText(70, "Requesting models");
  7364. k = onDemandFetcher.getVersionCount(0);
  7365. for(int k1 = 0; k1 < k; k1++)
  7366. {
  7367. int l1 = onDemandFetcher.getModelIndex(k1);
  7368. if((l1 & 1) != 0)
  7369. onDemandFetcher.method558(0, k1);
  7370. }
  7371.  
  7372. k = onDemandFetcher.getNodeCount();
  7373. while(onDemandFetcher.getNodeCount() > 0)
  7374. {
  7375. int i2 = k - onDemandFetcher.getNodeCount();
  7376. if(i2 > 0)
  7377. drawLoadingText(70, "Loading models - " + (i2 * 100) / k + "%");
  7378. processOnDemandQueue();
  7379. try
  7380. {
  7381. Thread.sleep(100L);
  7382. }
  7383. catch(Exception _ex) { }
  7384. }
  7385. if(decompressors[0] != null)
  7386. {
  7387. drawLoadingText(75, "Requesting maps");
  7388. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 47));
  7389. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 47));
  7390. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 48));
  7391. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 48));
  7392. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 49));
  7393. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 49));
  7394. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 47, 47));
  7395. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 47, 47));
  7396. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 47, 48));
  7397. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 47, 48));
  7398. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 148, 48));
  7399. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 148, 48));
  7400. k = onDemandFetcher.getNodeCount();
  7401. while(onDemandFetcher.getNodeCount() > 0)
  7402. {
  7403. int j2 = k - onDemandFetcher.getNodeCount();
  7404. if(j2 > 0)
  7405. drawLoadingText(75, "Loading maps - " + (j2 * 100) / k + "%");
  7406. processOnDemandQueue();
  7407. try
  7408. {
  7409. Thread.sleep(100L);
  7410. }
  7411. catch(Exception _ex) { }
  7412. }
  7413. }
  7414. k = onDemandFetcher.getVersionCount(0);
  7415. for(int k2 = 0; k2 < k; k2++)
  7416. {
  7417. int l2 = onDemandFetcher.getModelIndex(k2);
  7418. byte byte0 = 0;
  7419. if((l2 & 8) != 0)
  7420. byte0 = 10;
  7421. else
  7422. if((l2 & 0x20) != 0)
  7423. byte0 = 9;
  7424. else
  7425. if((l2 & 0x10) != 0)
  7426. byte0 = 8;
  7427. else
  7428. if((l2 & 0x40) != 0)
  7429. byte0 = 7;
  7430. else
  7431. if((l2 & 0x80) != 0)
  7432. byte0 = 6;
  7433. else
  7434. if((l2 & 2) != 0)
  7435. byte0 = 5;
  7436. else
  7437. if((l2 & 4) != 0)
  7438. byte0 = 4;
  7439. if((l2 & 1) != 0)
  7440. byte0 = 3;
  7441. if(byte0 != 0)
  7442. onDemandFetcher.method563(byte0, 0, k2);
  7443. }
  7444.  
  7445. onDemandFetcher.method554(isMembers);
  7446. if(!lowMem)
  7447. {
  7448. int l = onDemandFetcher.getVersionCount(2);
  7449. for(int i3 = 1; i3 < l; i3++)
  7450. if(onDemandFetcher.method569(i3))
  7451. onDemandFetcher.method563((byte)1, 2, i3);
  7452.  
  7453. }
  7454. drawLoadingText(80, "Unpacking media");
  7455. /* Custom sprite unpacking */
  7456. chatArea = new Sprite("chatarea");
  7457. chatButtons = new Sprite("chatbuttons");
  7458. chatButtonH = new Sprite("chathover");
  7459. chatButtonC = new Sprite("chatclicked");
  7460. chatButtonHC = new Sprite("chatclickedh");
  7461. reportH = new Sprite("reporthover");
  7462. tabArea = new Sprite("tabarea");
  7463. mapArea = new Sprite("maparea");
  7464. logIconH = new Sprite("logiconh");
  7465. logIconC = new Sprite("logiconc");
  7466. worldMapIcon = new Sprite("mapicon");
  7467. emptyOrb = new Sprite("emptyorb");
  7468. hitPointsFill = new Sprite("hitpointsfill");
  7469. hitPointsIcon = new Sprite("hitpointsicon");
  7470. prayerFill = new Sprite("prayerfill");
  7471. prayerIcon = new Sprite("prayericon");
  7472. /**/
  7473. mapBack = new Background(streamLoader_2, "mapback", 0);
  7474. for(int j3 = 0; j3 < 14; j3++)
  7475. sideIcons[j3] = new Sprite(streamLoader_2, "sideicons", j3);
  7476. for(int r1 = 0; r1 < 5; r1++)
  7477. redStones[r1] = new Sprite(streamLoader_2, "redstones", r1);
  7478.  
  7479. compass = new Sprite(streamLoader_2, "compass", 0);
  7480. mapEdge = new Sprite(streamLoader_2, "mapedge", 0);
  7481. mapEdge.method345();
  7482. try
  7483. {
  7484. for(int k3 = 0; k3 < 100; k3++)
  7485. mapScenes[k3] = new Background(streamLoader_2, "mapscene", k3);
  7486. }
  7487. catch(Exception _ex) { }
  7488. try
  7489. {
  7490. for(int l3 = 0; l3 < 100; l3++)
  7491. mapFunctions[l3] = new Sprite(streamLoader_2, "mapfunction", l3);
  7492. }
  7493. catch(Exception _ex) { }
  7494. try
  7495. {
  7496. for(int i4 = 0; i4 < 20; i4++)
  7497. hitMarks[i4] = new Sprite(streamLoader_2, "hitmarks", i4);
  7498. }
  7499. catch(Exception _ex) { }
  7500. try
  7501. {
  7502. for(int h1 = 0; h1 < 6; h1++)
  7503. headIconsHint[h1] = new Sprite(streamLoader_2, "headicons_hint", h1);
  7504. }
  7505. catch(Exception _ex) { }
  7506. try
  7507. {
  7508. for(int j4 = 0; j4 < 20; j4++)
  7509. headIcons[j4] = new Sprite(streamLoader_2, "headicons", j4);
  7510. }
  7511. catch(Exception _ex) { }
  7512. mapFlag = new Sprite(streamLoader_2, "mapmarker", 0);
  7513. mapMarker = new Sprite(streamLoader_2, "mapmarker", 1);
  7514. for(int k4 = 0; k4 < 8; k4++)
  7515. crosses[k4] = new Sprite(streamLoader_2, "cross", k4);
  7516.  
  7517. mapDotItem = new Sprite(streamLoader_2, "mapdots", 0);
  7518. mapDotNPC = new Sprite(streamLoader_2, "mapdots", 1);
  7519. mapDotPlayer = new Sprite(streamLoader_2, "mapdots", 2);
  7520. mapDotFriend = new Sprite(streamLoader_2, "mapdots", 3);
  7521. mapDotTeam = new Sprite(streamLoader_2, "mapdots", 4);
  7522. scrollBar1 = new Background(streamLoader_2, "scrollbar", 0);
  7523. scrollBar2 = new Background(streamLoader_2, "scrollbar", 1);
  7524.  
  7525. for(int l4 = 0; l4 < 2; l4++)
  7526. modIcons[l4] = new Background(streamLoader_2, "mod_icons", l4);
  7527.  
  7528. Sprite sprite = new Sprite("frame");
  7529. frame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  7530. sprite.method346(0, 0);
  7531.  
  7532. int i5 = (int)(Math.random() * 21D) - 10;
  7533. int j5 = (int)(Math.random() * 21D) - 10;
  7534. int k5 = (int)(Math.random() * 21D) - 10;
  7535. int l5 = (int)(Math.random() * 41D) - 20;
  7536. for(int i6 = 0; i6 < 100; i6++)
  7537. {
  7538. if(mapFunctions[i6] != null)
  7539. mapFunctions[i6].method344(i5 + l5, j5 + l5, k5 + l5);
  7540. if(mapScenes[i6] != null)
  7541. mapScenes[i6].method360(i5 + l5, j5 + l5, k5 + l5);
  7542. }
  7543.  
  7544. drawLoadingText(83, "Unpacking textures");
  7545. Texture.method368(streamLoader_3);
  7546. Texture.method372(0.80000000000000004D);
  7547. Texture.method367();
  7548. drawLoadingText(86, "Unpacking config");
  7549. Animation.unpackConfig(streamLoader);
  7550. ObjectDef.unpackConfig(streamLoader);
  7551. Flo.unpackConfig(streamLoader);
  7552. ItemDef.unpackConfig(streamLoader);
  7553. EntityDef.unpackConfig(streamLoader);
  7554. IDK.unpackConfig(streamLoader);
  7555. SpotAnim.unpackConfig(streamLoader);
  7556. Varp.unpackConfig(streamLoader);
  7557. VarBit.unpackConfig(streamLoader);
  7558. ItemDef.isMembers = isMembers;
  7559. if(!lowMem)
  7560. {
  7561. drawLoadingText(90, "Unpacking sounds");
  7562. byte abyte0[] = streamLoader_5.getDataForName("sounds.dat");
  7563. Stream stream = new Stream(abyte0);
  7564. Sounds.unpack(stream);
  7565. }
  7566. drawLoadingText(95, "Unpacking interfaces");
  7567. TextDrawingArea aclass30_sub2_sub1_sub4s[] = {
  7568. smallText, aTextDrawingArea_1271, chatTextDrawingArea, aTextDrawingArea_1273
  7569. };
  7570. RSInterface.unpack(streamLoader_1, aclass30_sub2_sub1_sub4s, streamLoader_2);
  7571. drawLoadingText(100, "Preparing game engine");
  7572. for(int j6 = 0; j6 < 33; j6++)
  7573. {
  7574. int k6 = 999;
  7575. int i7 = 0;
  7576. for(int k7 = 0; k7 < 34; k7++)
  7577. {
  7578. if(mapBack.aByteArray1450[k7 + j6 * mapBack.anInt1452] == 0)
  7579. {
  7580. if(k6 == 999)
  7581. k6 = k7;
  7582. continue;
  7583. }
  7584. if(k6 == 999)
  7585. continue;
  7586. i7 = k7;
  7587. break;
  7588. }
  7589.  
  7590. anIntArray968[j6] = k6;
  7591. anIntArray1057[j6] = i7 - k6;
  7592. }
  7593.  
  7594. for(int l6 = 5; l6 < 156; l6++)
  7595. {
  7596. int j7 = 999;
  7597. int l7 = 0;
  7598. for(int j8 = 25; j8 < 172; j8++)
  7599. {
  7600. if(mapBack.aByteArray1450[j8 + l6 * mapBack.anInt1452] == 0 && (j8 > 34 || l6 > 34))
  7601. {
  7602. if(j7 == 999)
  7603. j7 = j8;
  7604. continue;
  7605. }
  7606. if(j7 == 999)
  7607. continue;
  7608. l7 = j8;
  7609. break;
  7610. }
  7611.  
  7612. anIntArray1052[l6 - 5] = j7 - 25;
  7613. anIntArray1229[l6 - 5] = l7 - j7;
  7614. }
  7615.  
  7616. Texture.method365(519, 165);
  7617. anIntArray1180 = Texture.anIntArray1472;
  7618. Texture.method365(246, 335);
  7619. anIntArray1181 = Texture.anIntArray1472;
  7620. Texture.method365(512, 334);
  7621. anIntArray1182 = Texture.anIntArray1472;
  7622. int ai[] = new int[9];
  7623. for(int i8 = 0; i8 < 9; i8++)
  7624. {
  7625. int k8 = 128 + i8 * 32 + 15;
  7626. int l8 = 600 + k8 * 3;
  7627. int i9 = Texture.anIntArray1470[k8];
  7628. ai[i8] = l8 * i9 >> 16;
  7629. }
  7630.  
  7631. WorldController.method310(500, 800, 512, 334, ai);
  7632. Censor.loadConfig(streamLoader_4);
  7633. mouseDetection = new MouseDetection(this);
  7634. startRunnable(mouseDetection, 10);
  7635. Animable_Sub5.clientInstance = this;
  7636. ObjectDef.clientInstance = this;
  7637. EntityDef.clientInstance = this;
  7638. return;
  7639. }
  7640. catch(Exception exception)
  7641. {
  7642. signlink.reporterror("loaderror " + aString1049 + " " + anInt1079);
  7643. }
  7644. loadingError = true;
  7645. }
  7646.  
  7647. private void method91(Stream stream, int i)
  7648. {
  7649. while(stream.bitPosition + 10 < i * 8)
  7650. {
  7651. int j = stream.readBits(11);
  7652. if(j == 2047)
  7653. break;
  7654. if(playerArray[j] == null)
  7655. {
  7656. playerArray[j] = new Player();
  7657. if(aStreamArray895s[j] != null)
  7658. playerArray[j].updatePlayer(aStreamArray895s[j]);
  7659. }
  7660. playerIndices[playerCount++] = j;
  7661. Player player = playerArray[j];
  7662. player.anInt1537 = loopCycle;
  7663. int k = stream.readBits(1);
  7664. if(k == 1)
  7665. anIntArray894[anInt893++] = j;
  7666. int l = stream.readBits(1);
  7667. int i1 = stream.readBits(5);
  7668. if(i1 > 15)
  7669. i1 -= 32;
  7670. int j1 = stream.readBits(5);
  7671. if(j1 > 15)
  7672. j1 -= 32;
  7673. player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1, l == 1);
  7674. }
  7675. stream.finishBitAccess();
  7676. }
  7677.  
  7678. private void processMainScreenClick()
  7679. {
  7680. if(anInt1021 != 0)
  7681. return;
  7682. if(super.clickMode3 == 1)
  7683. {
  7684. int i = super.saveClickX - 10 - 550;
  7685. int j = super.saveClickY - 5 - 4;
  7686. if(i >= 0 && j >= 0 && i < 146 && j < 151)
  7687. {
  7688. i -= 73;
  7689. j -= 75;
  7690. int k = minimapInt1 + minimapInt2 & 0x7ff;
  7691. int i1 = Texture.anIntArray1470[k];
  7692. int j1 = Texture.anIntArray1471[k];
  7693. i1 = i1 * (minimapInt3 + 256) >> 8;
  7694. j1 = j1 * (minimapInt3 + 256) >> 8;
  7695. int k1 = j * i1 + i * j1 >> 11;
  7696. int l1 = j * j1 - i * i1 >> 11;
  7697. int i2 = myPlayer.x + k1 >> 7;
  7698. int j2 = myPlayer.y - l1 >> 7;
  7699. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0, j2, myPlayer.smallX[0], true, i2);
  7700. if(flag1)
  7701. {
  7702. stream.writeWordBigEndian(i);
  7703. stream.writeWordBigEndian(j);
  7704. stream.writeWord(minimapInt1);
  7705. stream.writeWordBigEndian(57);
  7706. stream.writeWordBigEndian(minimapInt2);
  7707. stream.writeWordBigEndian(minimapInt3);
  7708. stream.writeWordBigEndian(89);
  7709. stream.writeWord(myPlayer.x);
  7710. stream.writeWord(myPlayer.y);
  7711. stream.writeWordBigEndian(anInt1264);
  7712. stream.writeWordBigEndian(63);
  7713. }
  7714. }
  7715. anInt1117++;
  7716. if(anInt1117 > 1151)
  7717. {
  7718. anInt1117 = 0;
  7719. stream.createFrame(246);
  7720. stream.writeWordBigEndian(0);
  7721. int l = stream.currentOffset;
  7722. if((int)(Math.random() * 2D) == 0)
  7723. stream.writeWordBigEndian(101);
  7724. stream.writeWordBigEndian(197);
  7725. stream.writeWord((int)(Math.random() * 65536D));
  7726. stream.writeWordBigEndian((int)(Math.random() * 256D));
  7727. stream.writeWordBigEndian(67);
  7728. stream.writeWord(14214);
  7729. if((int)(Math.random() * 2D) == 0)
  7730. stream.writeWord(29487);
  7731. stream.writeWord((int)(Math.random() * 65536D));
  7732. if((int)(Math.random() * 2D) == 0)
  7733. stream.writeWordBigEndian(220);
  7734. stream.writeWordBigEndian(180);
  7735. stream.writeBytes(stream.currentOffset - l);
  7736. }
  7737. }
  7738. }
  7739.  
  7740. private String interfaceIntToString(int j)
  7741. {
  7742. if(j < 0x3b9ac9ff)
  7743. return String.valueOf(j);
  7744. else
  7745. return "*";
  7746. }
  7747.  
  7748. private void showErrorScreen()
  7749. {
  7750. Graphics g = getGameComponent().getGraphics();
  7751. g.setColor(Color.black);
  7752. g.fillRect(0, 0, 765, 503);
  7753. method4(1);
  7754. if(loadingError)
  7755. {
  7756. aBoolean831 = false;
  7757. g.setFont(new Font("Helvetica", 1, 16));
  7758. g.setColor(Color.yellow);
  7759. int k = 35;
  7760. g.drawString("Sorry, an error has occured whilst loading RuneScape", 30, k);
  7761. k += 50;
  7762. g.setColor(Color.white);
  7763. g.drawString("To fix this try the following (in order):", 30, k);
  7764. k += 50;
  7765. g.setColor(Color.white);
  7766. g.setFont(new Font("Helvetica", 1, 12));
  7767. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, k);
  7768. k += 30;
  7769. g.drawString("2: Try clearing your web-browsers cache from tools->internet options", 30, k);
  7770. k += 30;
  7771. g.drawString("3: Try using a different game-world", 30, k);
  7772. k += 30;
  7773. g.drawString("4: Try rebooting your computer", 30, k);
  7774. k += 30;
  7775. g.drawString("5: Try selecting a different version of Java from the play-game menu", 30, k);
  7776. }
  7777. if(genericLoadingError)
  7778. {
  7779. aBoolean831 = false;
  7780. g.setFont(new Font("Helvetica", 1, 20));
  7781. g.setColor(Color.white);
  7782. g.drawString("Error - unable to load game!", 50, 50);
  7783. g.drawString("To play RuneScape make sure you play from", 50, 100);
  7784. g.drawString("http://www.runescape.com", 50, 150);
  7785. }
  7786. if(rsAlreadyLoaded)
  7787. {
  7788. aBoolean831 = false;
  7789. g.setColor(Color.yellow);
  7790. int l = 35;
  7791. g.drawString("Error a copy of RuneScape already appears to be loaded", 30, l);
  7792. l += 50;
  7793. g.setColor(Color.white);
  7794. g.drawString("To fix this try the following (in order):", 30, l);
  7795. l += 50;
  7796. g.setColor(Color.white);
  7797. g.setFont(new Font("Helvetica", 1, 12));
  7798. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, l);
  7799. l += 30;
  7800. g.drawString("2: Try rebooting your computer, and reloading", 30, l);
  7801. l += 30;
  7802. }
  7803. }
  7804.  
  7805. public URL getCodeBase()
  7806. {
  7807. try
  7808. {
  7809. return new URL(server +":" + (80 + portOff));
  7810. }
  7811. catch(Exception _ex) { }
  7812. return null;
  7813. }
  7814.  
  7815. private void method95()
  7816. {
  7817. for(int j = 0; j < npcCount; j++)
  7818. {
  7819. int k = npcIndices[j];
  7820. NPC npc = npcArray[k];
  7821. if(npc != null)
  7822. method96(npc);
  7823. }
  7824. }
  7825.  
  7826. private void method96(Entity entity)
  7827. {
  7828. if(entity.x < 128 || entity.y < 128 || entity.x >= 13184 || entity.y >= 13184)
  7829. {
  7830. entity.anim = -1;
  7831. entity.anInt1520 = -1;
  7832. entity.anInt1547 = 0;
  7833. entity.anInt1548 = 0;
  7834. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  7835. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  7836. entity.method446();
  7837. }
  7838. if(entity == myPlayer && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776))
  7839. {
  7840. entity.anim = -1;
  7841. entity.anInt1520 = -1;
  7842. entity.anInt1547 = 0;
  7843. entity.anInt1548 = 0;
  7844. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  7845. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  7846. entity.method446();
  7847. }
  7848. if(entity.anInt1547 > loopCycle)
  7849. method97(entity);
  7850. else
  7851. if(entity.anInt1548 >= loopCycle)
  7852. method98(entity);
  7853. else
  7854. method99(entity);
  7855. method100(entity);
  7856. method101(entity);
  7857. }
  7858.  
  7859. private void method97(Entity entity)
  7860. {
  7861. int i = entity.anInt1547 - loopCycle;
  7862. int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  7863. int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  7864. entity.x += (j - entity.x) / i;
  7865. entity.y += (k - entity.y) / i;
  7866. entity.anInt1503 = 0;
  7867. if(entity.anInt1549 == 0)
  7868. entity.turnDirection = 1024;
  7869. if(entity.anInt1549 == 1)
  7870. entity.turnDirection = 1536;
  7871. if(entity.anInt1549 == 2)
  7872. entity.turnDirection = 0;
  7873. if(entity.anInt1549 == 3)
  7874. entity.turnDirection = 512;
  7875. }
  7876.  
  7877. private void method98(Entity entity)
  7878. {
  7879. if(entity.anInt1548 == loopCycle || entity.anim == -1 || entity.anInt1529 != 0 || entity.anInt1528 + 1 > Animation.anims[entity.anim].method258(entity.anInt1527))
  7880. {
  7881. int i = entity.anInt1548 - entity.anInt1547;
  7882. int j = loopCycle - entity.anInt1547;
  7883. int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  7884. int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  7885. int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
  7886. int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
  7887. entity.x = (k * (i - j) + i1 * j) / i;
  7888. entity.y = (l * (i - j) + j1 * j) / i;
  7889. }
  7890. entity.anInt1503 = 0;
  7891. if(entity.anInt1549 == 0)
  7892. entity.turnDirection = 1024;
  7893. if(entity.anInt1549 == 1)
  7894. entity.turnDirection = 1536;
  7895. if(entity.anInt1549 == 2)
  7896. entity.turnDirection = 0;
  7897. if(entity.anInt1549 == 3)
  7898. entity.turnDirection = 512;
  7899. entity.anInt1552 = entity.turnDirection;
  7900. }
  7901.  
  7902. private void method99(Entity entity)
  7903. {
  7904. entity.anInt1517 = entity.anInt1511;
  7905. if(entity.smallXYIndex == 0)
  7906. {
  7907. entity.anInt1503 = 0;
  7908. return;
  7909. }
  7910. if(entity.anim != -1 && entity.anInt1529 == 0)
  7911. {
  7912. Animation animation = Animation.anims[entity.anim];
  7913. if(entity.anInt1542 > 0 && animation.anInt363 == 0)
  7914. {
  7915. entity.anInt1503++;
  7916. return;
  7917. }
  7918. if(entity.anInt1542 <= 0 && animation.anInt364 == 0)
  7919. {
  7920. entity.anInt1503++;
  7921. return;
  7922. }
  7923. }
  7924. int i = entity.x;
  7925. int j = entity.y;
  7926. int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  7927. int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  7928. if(k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256)
  7929. {
  7930. entity.x = k;
  7931. entity.y = l;
  7932. return;
  7933. }
  7934. if(i < k)
  7935. {
  7936. if(j < l)
  7937. entity.turnDirection = 1280;
  7938. else
  7939. if(j > l)
  7940. entity.turnDirection = 1792;
  7941. else
  7942. entity.turnDirection = 1536;
  7943. } else
  7944. if(i > k)
  7945. {
  7946. if(j < l)
  7947. entity.turnDirection = 768;
  7948. else
  7949. if(j > l)
  7950. entity.turnDirection = 256;
  7951. else
  7952. entity.turnDirection = 512;
  7953. } else
  7954. if(j < l)
  7955. entity.turnDirection = 1024;
  7956. else
  7957. entity.turnDirection = 0;
  7958. int i1 = entity.turnDirection - entity.anInt1552 & 0x7ff;
  7959. if(i1 > 1024)
  7960. i1 -= 2048;
  7961. int j1 = entity.anInt1555;
  7962. if(i1 >= -256 && i1 <= 256)
  7963. j1 = entity.anInt1554;
  7964. else
  7965. if(i1 >= 256 && i1 < 768)
  7966. j1 = entity.anInt1557;
  7967. else
  7968. if(i1 >= -768 && i1 <= -256)
  7969. j1 = entity.anInt1556;
  7970. if(j1 == -1)
  7971. j1 = entity.anInt1554;
  7972. entity.anInt1517 = j1;
  7973. int k1 = 4;
  7974. if(entity.anInt1552 != entity.turnDirection && entity.interactingEntity == -1 && entity.anInt1504 != 0)
  7975. k1 = 2;
  7976. if(entity.smallXYIndex > 2)
  7977. k1 = 6;
  7978. if(entity.smallXYIndex > 3)
  7979. k1 = 8;
  7980. if(entity.anInt1503 > 0 && entity.smallXYIndex > 1)
  7981. {
  7982. k1 = 8;
  7983. entity.anInt1503--;
  7984. }
  7985. if(entity.aBooleanArray1553[entity.smallXYIndex - 1])
  7986. k1 <<= 1;
  7987. if(k1 >= 8 && entity.anInt1517 == entity.anInt1554 && entity.anInt1505 != -1)
  7988. entity.anInt1517 = entity.anInt1505;
  7989. if(i < k)
  7990. {
  7991. entity.x += k1;
  7992. if(entity.x > k)
  7993. entity.x = k;
  7994. } else
  7995. if(i > k)
  7996. {
  7997. entity.x -= k1;
  7998. if(entity.x < k)
  7999. entity.x = k;
  8000. }
  8001. if(j < l)
  8002. {
  8003. entity.y += k1;
  8004. if(entity.y > l)
  8005. entity.y = l;
  8006. } else
  8007. if(j > l)
  8008. {
  8009. entity.y -= k1;
  8010. if(entity.y < l)
  8011. entity.y = l;
  8012. }
  8013. if(entity.x == k && entity.y == l)
  8014. {
  8015. entity.smallXYIndex--;
  8016. if(entity.anInt1542 > 0)
  8017. entity.anInt1542--;
  8018. }
  8019. }
  8020.  
  8021. private void method100(Entity entity)
  8022. {
  8023. if(entity.anInt1504 == 0)
  8024. return;
  8025. if(entity.interactingEntity != -1 && entity.interactingEntity < 32768)
  8026. {
  8027. NPC npc = npcArray[entity.interactingEntity];
  8028. if(npc != null)
  8029. {
  8030. int i1 = entity.x - npc.x;
  8031. int k1 = entity.y - npc.y;
  8032. if(i1 != 0 || k1 != 0)
  8033. entity.turnDirection = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  8034. }
  8035. }
  8036. if(entity.interactingEntity >= 32768)
  8037. {
  8038. int j = entity.interactingEntity - 32768;
  8039. if(j == unknownInt10)
  8040. j = myPlayerIndex;
  8041. Player player = playerArray[j];
  8042. if(player != null)
  8043. {
  8044. int l1 = entity.x - player.x;
  8045. int i2 = entity.y - player.y;
  8046. if(l1 != 0 || i2 != 0)
  8047. entity.turnDirection = (int)(Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  8048. }
  8049. }
  8050. if((entity.anInt1538 != 0 || entity.anInt1539 != 0) && (entity.smallXYIndex == 0 || entity.anInt1503 > 0))
  8051. {
  8052. int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
  8053. int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
  8054. if(k != 0 || j1 != 0)
  8055. entity.turnDirection = (int)(Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  8056. entity.anInt1538 = 0;
  8057. entity.anInt1539 = 0;
  8058. }
  8059. int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
  8060. if(l != 0)
  8061. {
  8062. if(l < entity.anInt1504 || l > 2048 - entity.anInt1504)
  8063. entity.anInt1552 = entity.turnDirection;
  8064. else
  8065. if(l > 1024)
  8066. entity.anInt1552 -= entity.anInt1504;
  8067. else
  8068. entity.anInt1552 += entity.anInt1504;
  8069. entity.anInt1552 &= 0x7ff;
  8070. if(entity.anInt1517 == entity.anInt1511 && entity.anInt1552 != entity.turnDirection)
  8071. {
  8072. if(entity.anInt1512 != -1)
  8073. {
  8074. entity.anInt1517 = entity.anInt1512;
  8075. return;
  8076. }
  8077. entity.anInt1517 = entity.anInt1554;
  8078. }
  8079. }
  8080. }
  8081.  
  8082. private void method101(Entity entity)
  8083. {
  8084. entity.aBoolean1541 = false;
  8085. if(entity.anInt1517 != -1)
  8086. {
  8087. Animation animation = Animation.anims[entity.anInt1517];
  8088. entity.anInt1519++;
  8089. if(entity.anInt1518 < animation.anInt352 && entity.anInt1519 > animation.method258(entity.anInt1518))
  8090. {
  8091. entity.anInt1519 = 0;
  8092. entity.anInt1518++;
  8093. }
  8094. if(entity.anInt1518 >= animation.anInt352)
  8095. {
  8096. entity.anInt1519 = 0;
  8097. entity.anInt1518 = 0;
  8098. }
  8099. }
  8100. if(entity.anInt1520 != -1 && loopCycle >= entity.anInt1523)
  8101. {
  8102. if(entity.anInt1521 < 0)
  8103. entity.anInt1521 = 0;
  8104. Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  8105. for(entity.anInt1522++; entity.anInt1521 < animation_1.anInt352 && entity.anInt1522 > animation_1.method258(entity.anInt1521); entity.anInt1521++)
  8106. entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  8107.  
  8108. if(entity.anInt1521 >= animation_1.anInt352 && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352))
  8109. entity.anInt1520 = -1;
  8110. }
  8111. if(entity.anim != -1 && entity.anInt1529 <= 1)
  8112. {
  8113. Animation animation_2 = Animation.anims[entity.anim];
  8114. if(animation_2.anInt363 == 1 && entity.anInt1542 > 0 && entity.anInt1547 <= loopCycle && entity.anInt1548 < loopCycle)
  8115. {
  8116. entity.anInt1529 = 1;
  8117. return;
  8118. }
  8119. }
  8120. if(entity.anim != -1 && entity.anInt1529 == 0)
  8121. {
  8122. Animation animation_3 = Animation.anims[entity.anim];
  8123. for(entity.anInt1528++; entity.anInt1527 < animation_3.anInt352 && entity.anInt1528 > animation_3.method258(entity.anInt1527); entity.anInt1527++)
  8124. entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  8125.  
  8126. if(entity.anInt1527 >= animation_3.anInt352)
  8127. {
  8128. entity.anInt1527 -= animation_3.anInt356;
  8129. entity.anInt1530++;
  8130. if(entity.anInt1530 >= animation_3.anInt362)
  8131. entity.anim = -1;
  8132. if(entity.anInt1527 < 0 || entity.anInt1527 >= animation_3.anInt352)
  8133. entity.anim = -1;
  8134. }
  8135. entity.aBoolean1541 = animation_3.aBoolean358;
  8136. }
  8137. if(entity.anInt1529 > 0)
  8138. entity.anInt1529--;
  8139. }
  8140.  
  8141. private void drawGameScreen()
  8142. {
  8143. if(welcomeScreenRaised)
  8144. {
  8145. welcomeScreenRaised = false;
  8146. frame.drawGraphics(0, super.graphics, 0);
  8147. needDrawTabArea = true;
  8148. inputTaken = true;
  8149. tabAreaAltered = true;
  8150. aBoolean1233 = true;
  8151. if(loadingStage != 2)
  8152. {
  8153. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  8154. aRSImageProducer_1164.drawGraphics(0, super.graphics, 519);
  8155. }
  8156. }
  8157. if(loadingStage == 2)
  8158. method146();
  8159. if(menuOpen && menuScreenArea == 1)
  8160. needDrawTabArea = true;
  8161. if(invOverlayInterfaceID != -1)
  8162. {
  8163. boolean flag1 = method119(anInt945, invOverlayInterfaceID);
  8164. if(flag1)
  8165. needDrawTabArea = true;
  8166. }
  8167. if(atInventoryInterfaceType == 2)
  8168. needDrawTabArea = true;
  8169. if(activeInterfaceType == 2)
  8170. needDrawTabArea = true;
  8171. if(needDrawTabArea)
  8172. {
  8173. drawTabArea();
  8174. needDrawTabArea = false;
  8175. }
  8176. if(backDialogID == -1)
  8177. {
  8178. aClass9_1059.scrollPosition = anInt1211 - anInt1089 - 110;
  8179. if(super.mouseX > 478 && super.mouseX < 580 && super.mouseY > 342)
  8180. method65(494, 110, super.mouseX - 0, super.mouseY - 348, aClass9_1059, 0, false, anInt1211);
  8181. int i = anInt1211 - 110 - aClass9_1059.scrollPosition;
  8182. if(i < 0)
  8183. i = 0;
  8184. if(i > anInt1211 - 110)
  8185. i = anInt1211 - 110;
  8186. if(anInt1089 != i)
  8187. {
  8188. anInt1089 = i;
  8189. inputTaken = true;
  8190. }
  8191. }
  8192. if(backDialogID != -1)
  8193. {
  8194. boolean flag2 = method119(anInt945, backDialogID);
  8195. if(flag2)
  8196. inputTaken = true;
  8197. }
  8198. if(atInventoryInterfaceType == 3)
  8199. inputTaken = true;
  8200. if(activeInterfaceType == 3)
  8201. inputTaken = true;
  8202. if(aString844 != null)
  8203. inputTaken = true;
  8204. if(menuOpen && menuScreenArea == 2)
  8205. inputTaken = true;
  8206. if(inputTaken)
  8207. {
  8208. drawChatArea();
  8209. inputTaken = false;
  8210. }
  8211. if(loadingStage == 2)
  8212. {
  8213. drawMinimap();
  8214. aRSImageProducer_1164.drawGraphics(0, super.graphics, 519);
  8215. }
  8216. if(anInt1054 != -1)
  8217. tabAreaAltered = true;
  8218. if(tabAreaAltered)
  8219. {
  8220. if(anInt1054 != -1 && anInt1054 == tabID)
  8221. {
  8222. anInt1054 = -1;
  8223. stream.createFrame(120);
  8224. stream.writeWordBigEndian(tabID);
  8225. }
  8226. tabAreaAltered = false;
  8227. aRSImageProducer_1125.initDrawingArea();
  8228. aRSImageProducer_1165.initDrawingArea();
  8229. }
  8230. anInt945 = 0;
  8231. }
  8232.  
  8233. private boolean buildFriendsListMenu(RSInterface class9)
  8234. {
  8235. int i = class9.contentType;
  8236. if(i >= 1 && i <= 200 || i >= 701 && i <= 900)
  8237. {
  8238. if(i >= 801)
  8239. i -= 701;
  8240. else
  8241. if(i >= 701)
  8242. i -= 601;
  8243. else
  8244. if(i >= 101)
  8245. i -= 101;
  8246. else
  8247. i--;
  8248. menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
  8249. menuActionID[menuActionRow] = 792;
  8250. menuActionRow++;
  8251. menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
  8252. menuActionID[menuActionRow] = 639;
  8253. menuActionRow++;
  8254. return true;
  8255. }
  8256. if(i >= 401 && i <= 500)
  8257. {
  8258. menuActionName[menuActionRow] = "Remove @whi@" + class9.message;
  8259. menuActionID[menuActionRow] = 322;
  8260. menuActionRow++;
  8261. return true;
  8262. } else
  8263. {
  8264. return false;
  8265. }
  8266. }
  8267.  
  8268. private void method104()
  8269. {
  8270. Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetFirst();
  8271. for(; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetNext())
  8272. if(class30_sub2_sub4_sub3.anInt1560 != plane || class30_sub2_sub4_sub3.aBoolean1567)
  8273. class30_sub2_sub4_sub3.unlink();
  8274. else
  8275. if(loopCycle >= class30_sub2_sub4_sub3.anInt1564)
  8276. {
  8277. class30_sub2_sub4_sub3.method454(anInt945);
  8278. if(class30_sub2_sub4_sub3.aBoolean1567)
  8279. class30_sub2_sub4_sub3.unlink();
  8280. else
  8281. 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);
  8282. }
  8283.  
  8284. }
  8285.  
  8286. private void drawInterface(int j, int k, RSInterface class9, int l)
  8287. {
  8288. if(class9.type != 0 || class9.children == null)
  8289. return;
  8290. if(class9.isMouseoverTriggered && anInt1026 != class9.id && anInt1048 != class9.id && anInt1039 != class9.id)
  8291. return;
  8292. int i1 = DrawingArea.topX;
  8293. int j1 = DrawingArea.topY;
  8294. int k1 = DrawingArea.bottomX;
  8295. int l1 = DrawingArea.bottomY;
  8296. DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  8297. int i2 = class9.children.length;
  8298. for(int j2 = 0; j2 < i2; j2++)
  8299. {
  8300. int k2 = class9.childX[j2] + k;
  8301. int l2 = (class9.childY[j2] + l) - j;
  8302. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j2]];
  8303. k2 += class9_1.anInt263;
  8304. l2 += class9_1.anInt265;
  8305. if(class9_1.contentType > 0)
  8306. drawFriendsListOrWelcomeScreen(class9_1);
  8307. if(class9_1.type == 0)
  8308. {
  8309. if(class9_1.scrollPosition > class9_1.scrollMax - class9_1.height)
  8310. class9_1.scrollPosition = class9_1.scrollMax - class9_1.height;
  8311. if(class9_1.scrollPosition < 0)
  8312. class9_1.scrollPosition = 0;
  8313. drawInterface(class9_1.scrollPosition, k2, class9_1, l2);
  8314. if(class9_1.scrollMax > class9_1.height)
  8315. drawScrollbar(class9_1.height, class9_1.scrollPosition, l2, k2 + class9_1.width, class9_1.scrollMax);
  8316. } else
  8317. if(class9_1.type != 1)
  8318. if(class9_1.type == 2)
  8319. {
  8320. int i3 = 0;
  8321. for(int l3 = 0; l3 < class9_1.height; l3++)
  8322. {
  8323. for(int l4 = 0; l4 < class9_1.width; l4++)
  8324. {
  8325. int k5 = k2 + l4 * (32 + class9_1.invSpritePadX);
  8326. int j6 = l2 + l3 * (32 + class9_1.invSpritePadY);
  8327. if(i3 < 20)
  8328. {
  8329. k5 += class9_1.spritesX[i3];
  8330. j6 += class9_1.spritesY[i3];
  8331. }
  8332. if(class9_1.inv[i3] > 0)
  8333. {
  8334. int k6 = 0;
  8335. int j7 = 0;
  8336. int j9 = class9_1.inv[i3] - 1;
  8337. if(k5 > DrawingArea.topX - 32 && k5 < DrawingArea.bottomX && j6 > DrawingArea.topY - 32 && j6 < DrawingArea.bottomY || activeInterfaceType != 0 && anInt1085 == i3)
  8338. {
  8339. int l9 = 0;
  8340. if(itemSelected == 1 && anInt1283 == i3 && anInt1284 == class9_1.id)
  8341. l9 = 0xffffff;
  8342. Sprite class30_sub2_sub1_sub1_2 = ItemDef.getSprite(j9, class9_1.invStackSizes[i3], l9);
  8343. if(class30_sub2_sub1_sub1_2 != null)
  8344. {
  8345. if(activeInterfaceType != 0 && anInt1085 == i3 && anInt1084 == class9_1.id)
  8346. {
  8347. k6 = super.mouseX - anInt1087;
  8348. j7 = super.mouseY - anInt1088;
  8349. if(k6 < 5 && k6 > -5)
  8350. k6 = 0;
  8351. if(j7 < 5 && j7 > -5)
  8352. j7 = 0;
  8353. if(anInt989 < 15)
  8354. {
  8355. k6 = 0;
  8356. j7 = 0;
  8357. }
  8358. class30_sub2_sub1_sub1_2.drawSprite1(k5 + k6, j6 + j7);
  8359. if(j6 + j7 < DrawingArea.topY && class9.scrollPosition > 0)
  8360. {
  8361. int i10 = (anInt945 * (DrawingArea.topY - j6 - j7)) / 3;
  8362. if(i10 > anInt945 * 10)
  8363. i10 = anInt945 * 10;
  8364. if(i10 > class9.scrollPosition)
  8365. i10 = class9.scrollPosition;
  8366. class9.scrollPosition -= i10;
  8367. anInt1088 += i10;
  8368. }
  8369. if(j6 + j7 + 32 > DrawingArea.bottomY && class9.scrollPosition < class9.scrollMax - class9.height)
  8370. {
  8371. int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  8372. if(j10 > anInt945 * 10)
  8373. j10 = anInt945 * 10;
  8374. if(j10 > class9.scrollMax - class9.height - class9.scrollPosition)
  8375. j10 = class9.scrollMax - class9.height - class9.scrollPosition;
  8376. class9.scrollPosition += j10;
  8377. anInt1088 -= j10;
  8378. }
  8379. } else
  8380. if(atInventoryInterfaceType != 0 && atInventoryIndex == i3 && atInventoryInterface == class9_1.id)
  8381. class30_sub2_sub1_sub1_2.drawSprite1(k5, j6);
  8382. else
  8383. class30_sub2_sub1_sub1_2.drawSprite(k5, j6);
  8384. if(class30_sub2_sub1_sub1_2.anInt1444 == 33 || class9_1.invStackSizes[i3] != 1)
  8385. {
  8386. int k10 = class9_1.invStackSizes[i3];
  8387. smallText.method385(0, intToKOrMil(k10), j6 + 10 + j7, k5 + 1 + k6);
  8388. smallText.method385(0xffff00, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  8389. }
  8390. }
  8391. }
  8392. } else
  8393. if(class9_1.sprites != null && i3 < 20)
  8394. {
  8395. Sprite class30_sub2_sub1_sub1_1 = class9_1.sprites[i3];
  8396. if(class30_sub2_sub1_sub1_1 != null)
  8397. class30_sub2_sub1_sub1_1.drawSprite(k5, j6);
  8398. }
  8399. i3++;
  8400. }
  8401.  
  8402. }
  8403.  
  8404. } else
  8405. if(class9_1.type == 3)
  8406. {
  8407. boolean flag = false;
  8408. if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  8409. flag = true;
  8410. int j3;
  8411. if(interfaceIsSelected(class9_1))
  8412. {
  8413. j3 = class9_1.anInt219;
  8414. if(flag && class9_1.anInt239 != 0)
  8415. j3 = class9_1.anInt239;
  8416. } else
  8417. {
  8418. j3 = class9_1.textColor;
  8419. if(flag && class9_1.anInt216 != 0)
  8420. j3 = class9_1.anInt216;
  8421. }
  8422. if(class9_1.aByte254 == 0)
  8423. {
  8424. if(class9_1.aBoolean227)
  8425. DrawingArea.drawPixels(class9_1.height, l2, k2, j3, class9_1.width);
  8426. else
  8427. DrawingArea.fillPixels(k2, class9_1.width, class9_1.height, j3, l2);
  8428. } else
  8429. if(class9_1.aBoolean227)
  8430. DrawingArea.method335(j3, l2, class9_1.width, class9_1.height, 256 - (class9_1.aByte254 & 0xff), k2);
  8431. else
  8432. DrawingArea.method338(l2, class9_1.height, 256 - (class9_1.aByte254 & 0xff), j3, class9_1.width, k2);
  8433. } else
  8434. if(class9_1.type == 4)
  8435. {
  8436. TextDrawingArea textDrawingArea = class9_1.textDrawingAreas;
  8437. String s = class9_1.message;
  8438. boolean flag1 = false;
  8439. if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  8440. flag1 = true;
  8441. int i4;
  8442. if(interfaceIsSelected(class9_1))
  8443. {
  8444. i4 = class9_1.anInt219;
  8445. if(flag1 && class9_1.anInt239 != 0)
  8446. i4 = class9_1.anInt239;
  8447. if(class9_1.aString228.length() > 0)
  8448. s = class9_1.aString228;
  8449. } else
  8450. {
  8451. i4 = class9_1.textColor;
  8452. if(flag1 && class9_1.anInt216 != 0)
  8453. i4 = class9_1.anInt216;
  8454. }
  8455. if(class9_1.atActionType == 6 && aBoolean1149)
  8456. {
  8457. s = "Please wait...";
  8458. i4 = class9_1.textColor;
  8459. }
  8460. if(DrawingArea.width == 519)
  8461. {
  8462. if(i4 == 0xffff00)
  8463. i4 = 255;
  8464. if(i4 == 49152)
  8465. i4 = 0xffffff;
  8466. }
  8467. for(int l6 = l2 + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497)
  8468. {
  8469. if(s.indexOf("%") != -1)
  8470. {
  8471. do
  8472. {
  8473. int k7 = s.indexOf("%1");
  8474. if(k7 == -1)
  8475. break;
  8476. s = s.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  8477. } while(true);
  8478. do
  8479. {
  8480. int l7 = s.indexOf("%2");
  8481. if(l7 == -1)
  8482. break;
  8483. s = s.substring(0, l7) + interfaceIntToString(extractInterfaceValues(class9_1, 1)) + s.substring(l7 + 2);
  8484. } while(true);
  8485. do
  8486. {
  8487. int i8 = s.indexOf("%3");
  8488. if(i8 == -1)
  8489. break;
  8490. s = s.substring(0, i8) + interfaceIntToString(extractInterfaceValues(class9_1, 2)) + s.substring(i8 + 2);
  8491. } while(true);
  8492. do
  8493. {
  8494. int j8 = s.indexOf("%4");
  8495. if(j8 == -1)
  8496. break;
  8497. s = s.substring(0, j8) + interfaceIntToString(extractInterfaceValues(class9_1, 3)) + s.substring(j8 + 2);
  8498. } while(true);
  8499. do
  8500. {
  8501. int k8 = s.indexOf("%5");
  8502. if(k8 == -1)
  8503. break;
  8504. s = s.substring(0, k8) + interfaceIntToString(extractInterfaceValues(class9_1, 4)) + s.substring(k8 + 2);
  8505. } while(true);
  8506. }
  8507. int l8 = s.indexOf("\\n");
  8508. String s1;
  8509. if(l8 != -1)
  8510. {
  8511. s1 = s.substring(0, l8);
  8512. s = s.substring(l8 + 2);
  8513. } else
  8514. {
  8515. s1 = s;
  8516. s = "";
  8517. }
  8518. if(class9_1.centerText)
  8519. textDrawingArea.method382(i4, k2 + class9_1.width / 2, s1, l6, class9_1.textShadow);
  8520. else
  8521. textDrawingArea.method389(class9_1.textShadow, k2, i4, s1, l6);
  8522. }
  8523. } else if(class9_1.type == 5) {
  8524. Sprite sprite;
  8525. if(interfaceIsSelected(class9_1))
  8526. sprite = class9_1.sprite2;
  8527. else
  8528. sprite = class9_1.sprite1;
  8529. if(sprite != null)
  8530. if(class9_1.drawsTransparent == true)
  8531. sprite.drawSprite2(k2, l2);
  8532. else
  8533. sprite.drawSprite(k2, l2);
  8534. } else if(class9_1.type == 6) {
  8535. int k3 = Texture.textureInt1;
  8536. int j4 = Texture.textureInt2;
  8537. Texture.textureInt1 = k2 + class9_1.width / 2;
  8538. Texture.textureInt2 = l2 + class9_1.height / 2;
  8539. int i5 = Texture.anIntArray1470[class9_1.modelRotation1] * class9_1.anInt269 >> 16;
  8540. int l5 = Texture.anIntArray1471[class9_1.modelRotation1] * class9_1.anInt269 >> 16;
  8541. boolean flag2 = interfaceIsSelected(class9_1);
  8542. int i7;
  8543. if(flag2)
  8544. i7 = class9_1.anInt258;
  8545. else
  8546. i7 = class9_1.anInt257;
  8547. Model model;
  8548. if(i7 == -1)
  8549. {
  8550. model = class9_1.method209(-1, -1, flag2);
  8551. } else
  8552. {
  8553. Animation animation = Animation.anims[i7];
  8554. model = class9_1.method209(animation.anIntArray354[class9_1.anInt246], animation.anIntArray353[class9_1.anInt246], flag2);
  8555. }
  8556. if(model != null)
  8557. model.method482(class9_1.modelRotation2, 0, class9_1.modelRotation1, 0, i5, l5);
  8558. Texture.textureInt1 = k3;
  8559. Texture.textureInt2 = j4;
  8560. } else
  8561. if(class9_1.type == 7)
  8562. {
  8563. TextDrawingArea textDrawingArea_1 = class9_1.textDrawingAreas;
  8564. int k4 = 0;
  8565. for(int j5 = 0; j5 < class9_1.height; j5++)
  8566. {
  8567. for(int i6 = 0; i6 < class9_1.width; i6++)
  8568. {
  8569. if(class9_1.inv[k4] > 0)
  8570. {
  8571. ItemDef itemDef = ItemDef.forID(class9_1.inv[k4] - 1);
  8572. String s2 = itemDef.name;
  8573. if(itemDef.stackable || class9_1.invStackSizes[k4] != 1)
  8574. s2 = s2 + " x" + intToKOrMilLongName(class9_1.invStackSizes[k4]);
  8575. int i9 = k2 + i6 * (115 + class9_1.invSpritePadX);
  8576. int k9 = l2 + j5 * (12 + class9_1.invSpritePadY);
  8577. if(class9_1.centerText)
  8578. textDrawingArea_1.method382(class9_1.textColor, i9 + class9_1.width / 2, s2, k9, class9_1.textShadow);
  8579. else
  8580. textDrawingArea_1.method389(class9_1.textShadow, i9, class9_1.textColor, s2, k9);
  8581. }
  8582. k4++;
  8583. }
  8584.  
  8585. }
  8586.  
  8587. }
  8588. }
  8589.  
  8590. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  8591. }
  8592.  
  8593. private void randomizeBackground(Background background)
  8594. {
  8595. int j = 256;
  8596. for(int k = 0; k < anIntArray1190.length; k++)
  8597. anIntArray1190[k] = 0;
  8598.  
  8599. for(int l = 0; l < 5000; l++)
  8600. {
  8601. int i1 = (int)(Math.random() * 128D * (double)j);
  8602. anIntArray1190[i1] = (int)(Math.random() * 256D);
  8603. }
  8604.  
  8605. for(int j1 = 0; j1 < 20; j1++)
  8606. {
  8607. for(int k1 = 1; k1 < j - 1; k1++)
  8608. {
  8609. for(int i2 = 1; i2 < 127; i2++)
  8610. {
  8611. int k2 = i2 + (k1 << 7);
  8612. anIntArray1191[k2] = (anIntArray1190[k2 - 1] + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128] + anIntArray1190[k2 + 128]) / 4;
  8613. }
  8614.  
  8615. }
  8616.  
  8617. int ai[] = anIntArray1190;
  8618. anIntArray1190 = anIntArray1191;
  8619. anIntArray1191 = ai;
  8620. }
  8621.  
  8622. if(background != null)
  8623. {
  8624. int l1 = 0;
  8625. for(int j2 = 0; j2 < background.anInt1453; j2++)
  8626. {
  8627. for(int l2 = 0; l2 < background.anInt1452; l2++)
  8628. if(background.aByteArray1450[l1++] != 0)
  8629. {
  8630. int i3 = l2 + 16 + background.anInt1454;
  8631. int j3 = j2 + 16 + background.anInt1455;
  8632. int k3 = i3 + (j3 << 7);
  8633. anIntArray1190[k3] = 0;
  8634. }
  8635.  
  8636. }
  8637.  
  8638. }
  8639. }
  8640.  
  8641. private void method107(int i, int j, Stream stream, Player player)
  8642. {
  8643. if((i & 0x400) != 0)
  8644. {
  8645. player.anInt1543 = stream.method428();
  8646. player.anInt1545 = stream.method428();
  8647. player.anInt1544 = stream.method428();
  8648. player.anInt1546 = stream.method428();
  8649. player.anInt1547 = stream.method436() + loopCycle;
  8650. player.anInt1548 = stream.method435() + loopCycle;
  8651. player.anInt1549 = stream.method428();
  8652. player.method446();
  8653. }
  8654. if((i & 0x100) != 0)
  8655. {
  8656. player.anInt1520 = stream.method434();
  8657. int k = stream.readDWord();
  8658. player.anInt1524 = k >> 16;
  8659. player.anInt1523 = loopCycle + (k & 0xffff);
  8660. player.anInt1521 = 0;
  8661. player.anInt1522 = 0;
  8662. if(player.anInt1523 > loopCycle)
  8663. player.anInt1521 = -1;
  8664. if(player.anInt1520 == 65535)
  8665. player.anInt1520 = -1;
  8666. }
  8667. if((i & 8) != 0)
  8668. {
  8669. int l = stream.method434();
  8670. if(l == 65535)
  8671. l = -1;
  8672. int i2 = stream.method427();
  8673. if(l == player.anim && l != -1)
  8674. {
  8675. int i3 = Animation.anims[l].anInt365;
  8676. if(i3 == 1)
  8677. {
  8678. player.anInt1527 = 0;
  8679. player.anInt1528 = 0;
  8680. player.anInt1529 = i2;
  8681. player.anInt1530 = 0;
  8682. }
  8683. if(i3 == 2)
  8684. player.anInt1530 = 0;
  8685. } else
  8686. if(l == -1 || player.anim == -1 || Animation.anims[l].anInt359 >= Animation.anims[player.anim].anInt359)
  8687. {
  8688. player.anim = l;
  8689. player.anInt1527 = 0;
  8690. player.anInt1528 = 0;
  8691. player.anInt1529 = i2;
  8692. player.anInt1530 = 0;
  8693. player.anInt1542 = player.smallXYIndex;
  8694. }
  8695. }
  8696. if((i & 4) != 0)
  8697. {
  8698. player.textSpoken = stream.readString();
  8699. if(player.textSpoken.charAt(0) == '~')
  8700. {
  8701. player.textSpoken = player.textSpoken.substring(1);
  8702. pushMessage(player.textSpoken, 2, player.name);
  8703. } else
  8704. if(player == myPlayer)
  8705. pushMessage(player.textSpoken, 2, player.name);
  8706. player.anInt1513 = 0;
  8707. player.anInt1531 = 0;
  8708. player.textCycle = 150;
  8709. }
  8710. if((i & 0x80) != 0)
  8711. {
  8712. int i1 = stream.method434();
  8713. int j2 = stream.readUnsignedByte();
  8714. int j3 = stream.method427();
  8715. int k3 = stream.currentOffset;
  8716. if(player.name != null && player.visible)
  8717. {
  8718. long l3 = TextClass.longForName(player.name);
  8719. boolean flag = false;
  8720. if(j2 <= 1)
  8721. {
  8722. for(int i4 = 0; i4 < ignoreCount; i4++)
  8723. {
  8724. if(ignoreListAsLongs[i4] != l3)
  8725. continue;
  8726. flag = true;
  8727. break;
  8728. }
  8729.  
  8730. }
  8731. if(!flag && anInt1251 == 0)
  8732. try
  8733. {
  8734. aStream_834.currentOffset = 0;
  8735. stream.method442(j3, 0, aStream_834.buffer);
  8736. aStream_834.currentOffset = 0;
  8737. String s = TextInput.method525(j3, aStream_834);
  8738. s = Censor.doCensor(s);
  8739. player.textSpoken = s;
  8740. player.anInt1513 = i1 >> 8;
  8741. player.privelage = j2;
  8742.  
  8743. //entityMessage(player);
  8744.  
  8745. player.anInt1531 = i1 & 0xff;
  8746. player.textCycle = 150;
  8747. if(j2 == 2 || j2 == 3)
  8748. pushMessage(s, 1, "@cr2@" + player.name);
  8749. else
  8750. if(j2 == 1)
  8751. pushMessage(s, 1, "@cr1@" + player.name);
  8752. else
  8753. pushMessage(s, 2, player.name);
  8754. }
  8755. catch(Exception exception)
  8756. {
  8757. signlink.reporterror("cde2");
  8758. }
  8759. }
  8760. stream.currentOffset = k3 + j3;
  8761. }
  8762. if((i & 1) != 0)
  8763. {
  8764. player.interactingEntity = stream.method434();
  8765. if(player.interactingEntity == 65535)
  8766. player.interactingEntity = -1;
  8767. }
  8768. if((i & 0x10) != 0)
  8769. {
  8770. int j1 = stream.method427();
  8771. byte abyte0[] = new byte[j1];
  8772. Stream stream_1 = new Stream(abyte0);
  8773. stream.readBytes(j1, 0, abyte0);
  8774. aStreamArray895s[j] = stream_1;
  8775. player.updatePlayer(stream_1);
  8776. }
  8777. if((i & 2) != 0)
  8778. {
  8779. player.anInt1538 = stream.method436();
  8780. player.anInt1539 = stream.method434();
  8781. }
  8782. if((i & 0x20) != 0)
  8783. {
  8784. int k1 = stream.readUnsignedByte();
  8785. int k2 = stream.method426();
  8786. player.updateHitData(k2, k1, loopCycle);
  8787. player.loopCycleStatus = loopCycle + 300;
  8788. player.currentHealth = stream.method427();
  8789. player.maxHealth = stream.readUnsignedByte();
  8790. }
  8791. if((i & 0x200) != 0)
  8792. {
  8793. int l1 = stream.readUnsignedByte();
  8794. int l2 = stream.method428();
  8795. player.updateHitData(l2, l1, loopCycle);
  8796. player.loopCycleStatus = loopCycle + 300;
  8797. player.currentHealth = stream.readUnsignedByte();
  8798. player.maxHealth = stream.method427();
  8799. }
  8800. }
  8801.  
  8802. private void method108()
  8803. {
  8804. try
  8805. {
  8806. int j = myPlayer.x + anInt1278;
  8807. int k = myPlayer.y + anInt1131;
  8808. if(anInt1014 - j < -500 || anInt1014 - j > 500 || anInt1015 - k < -500 || anInt1015 - k > 500)
  8809. {
  8810. anInt1014 = j;
  8811. anInt1015 = k;
  8812. }
  8813. if(anInt1014 != j)
  8814. anInt1014 += (j - anInt1014) / 16;
  8815. if(anInt1015 != k)
  8816. anInt1015 += (k - anInt1015) / 16;
  8817. if(super.keyArray[1] == 1)
  8818. anInt1186 += (-24 - anInt1186) / 2;
  8819. else
  8820. if(super.keyArray[2] == 1)
  8821. anInt1186 += (24 - anInt1186) / 2;
  8822. else
  8823. anInt1186 /= 2;
  8824. if(super.keyArray[3] == 1)
  8825. anInt1187 += (12 - anInt1187) / 2;
  8826. else
  8827. if(super.keyArray[4] == 1)
  8828. anInt1187 += (-12 - anInt1187) / 2;
  8829. else
  8830. anInt1187 /= 2;
  8831. minimapInt1 = minimapInt1 + anInt1186 / 2 & 0x7ff;
  8832. anInt1184 += anInt1187 / 2;
  8833. if(anInt1184 < 128)
  8834. anInt1184 = 128;
  8835. if(anInt1184 > 383)
  8836. anInt1184 = 383;
  8837. int l = anInt1014 >> 7;
  8838. int i1 = anInt1015 >> 7;
  8839. int j1 = method42(plane, anInt1015, anInt1014);
  8840. int k1 = 0;
  8841. if(l > 3 && i1 > 3 && l < 100 && i1 < 100)
  8842. {
  8843. for(int l1 = l - 4; l1 <= l + 4; l1++)
  8844. {
  8845. for(int k2 = i1 - 4; k2 <= i1 + 4; k2++)
  8846. {
  8847. int l2 = plane;
  8848. if(l2 < 3 && (byteGroundArray[1][l1][k2] & 2) == 2)
  8849. l2++;
  8850. int i3 = j1 - intGroundArray[l2][l1][k2];
  8851. if(i3 > k1)
  8852. k1 = i3;
  8853. }
  8854.  
  8855. }
  8856.  
  8857. }
  8858. anInt1005++;
  8859. if(anInt1005 > 1512)
  8860. {
  8861. anInt1005 = 0;
  8862. stream.createFrame(77);
  8863. stream.writeWordBigEndian(0);
  8864. int i2 = stream.currentOffset;
  8865. stream.writeWordBigEndian((int)(Math.random() * 256D));
  8866. stream.writeWordBigEndian(101);
  8867. stream.writeWordBigEndian(233);
  8868. stream.writeWord(45092);
  8869. if((int)(Math.random() * 2D) == 0)
  8870. stream.writeWord(35784);
  8871. stream.writeWordBigEndian((int)(Math.random() * 256D));
  8872. stream.writeWordBigEndian(64);
  8873. stream.writeWordBigEndian(38);
  8874. stream.writeWord((int)(Math.random() * 65536D));
  8875. stream.writeWord((int)(Math.random() * 65536D));
  8876. stream.writeBytes(stream.currentOffset - i2);
  8877. }
  8878. int j2 = k1 * 192;
  8879. if(j2 > 0x17f00)
  8880. j2 = 0x17f00;
  8881. if(j2 < 32768)
  8882. j2 = 32768;
  8883. if(j2 > anInt984)
  8884. {
  8885. anInt984 += (j2 - anInt984) / 24;
  8886. return;
  8887. }
  8888. if(j2 < anInt984)
  8889. {
  8890. anInt984 += (j2 - anInt984) / 80;
  8891. }
  8892. }
  8893. catch(Exception _ex)
  8894. {
  8895. signlink.reporterror("glfc_ex " + myPlayer.x + "," + myPlayer.y + "," + anInt1014 + "," + anInt1015 + "," + anInt1069 + "," + anInt1070 + "," + baseX + "," + baseY);
  8896. throw new RuntimeException("eek");
  8897. }
  8898. }
  8899.  
  8900. public void processDrawing()
  8901. {
  8902. if(rsAlreadyLoaded || loadingError || genericLoadingError)
  8903. {
  8904. showErrorScreen();
  8905. return;
  8906. }
  8907. anInt1061++;
  8908. if(!loggedIn)
  8909. drawLoginScreen(false);
  8910. else
  8911. drawGameScreen();
  8912. anInt1213 = 0;
  8913. }
  8914.  
  8915. private boolean isFriendOrSelf(String s)
  8916. {
  8917. if(s == null)
  8918. return false;
  8919. for(int i = 0; i < friendsCount; i++)
  8920. if(s.equalsIgnoreCase(friendsList[i]))
  8921. return true;
  8922. return s.equalsIgnoreCase(myPlayer.name);
  8923. }
  8924.  
  8925. private static String combatDiffColor(int i, int j)
  8926. {
  8927. int k = i - j;
  8928. if(k < -9)
  8929. return "@red@";
  8930. if(k < -6)
  8931. return "@or3@";
  8932. if(k < -3)
  8933. return "@or2@";
  8934. if(k < 0)
  8935. return "@or1@";
  8936. if(k > 9)
  8937. return "@gre@";
  8938. if(k > 6)
  8939. return "@gr3@";
  8940. if(k > 3)
  8941. return "@gr2@";
  8942. if(k > 0)
  8943. return "@gr1@";
  8944. else
  8945. return "@yel@";
  8946. }
  8947.  
  8948. private void setWaveVolume(int i)
  8949. {
  8950. signlink.wavevol = i;
  8951. }
  8952.  
  8953. private void draw3dScreen()
  8954. {
  8955. drawSplitPrivateChat();
  8956. if(crossType == 1)
  8957. {
  8958. crosses[crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  8959. anInt1142++;
  8960. if(anInt1142 > 67)
  8961. {
  8962. anInt1142 = 0;
  8963. stream.createFrame(78);
  8964. }
  8965. }
  8966. if(crossType == 2)
  8967. crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  8968. if(anInt1018 != -1)
  8969. {
  8970. method119(anInt945, anInt1018);
  8971. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 0);
  8972. }
  8973. if(openInterfaceID != -1)
  8974. {
  8975. method119(anInt945, openInterfaceID);
  8976. drawInterface(0, 0, RSInterface.interfaceCache[openInterfaceID], 0);
  8977. }
  8978. method70();
  8979. if(!menuOpen)
  8980. {
  8981. processRightClick();
  8982. drawTooltip();
  8983. } else
  8984. if(menuScreenArea == 0)
  8985. drawMenu();
  8986. if(anInt1055 == 1)
  8987. headIcons[1].drawSprite(472, 296);
  8988. if(fpsOn)
  8989. {
  8990. char c = '\u01FB';
  8991. int k = 20;
  8992. int i1 = 0xffff00;
  8993. if(super.fps < 15)
  8994. i1 = 0xff0000;
  8995. aTextDrawingArea_1271.method380("Fps:" + super.fps, c, i1, k);
  8996. k += 15;
  8997. Runtime runtime = Runtime.getRuntime();
  8998. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  8999. i1 = 0xffff00;
  9000. if(j1 > 0x2000000 && lowMem)
  9001. i1 = 0xff0000;
  9002. aTextDrawingArea_1271.method380("Mem:" + j1 + "k", c, 0xffff00, k);
  9003. k += 15;
  9004. }
  9005. int i1 = 0xffff00;
  9006. int x = baseX + (myPlayer.x - 6 >> 7);
  9007. int y = baseY + (myPlayer.y - 6 >> 7);
  9008. if (clientData)
  9009. {
  9010. char c = '\u01FB';
  9011. int k = 20;
  9012. if(super.fps < 15)
  9013. i1 = 0xff0000;
  9014. aTextDrawingArea_1271.method385(0xffff00, "Fps: " + super.fps, 285, 5);
  9015. Runtime runtime = Runtime.getRuntime();
  9016. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  9017. i1 = 0xffff00;
  9018. if(j1 > 0x2000000 && lowMem)
  9019. i1 = 0xff0000;
  9020. k += 15;
  9021. aTextDrawingArea_1271.method385(0xffff00, "Mem: " + j1 + "k", 299, 5);
  9022. aTextDrawingArea_1271.method385(0xffff00, "Mouse X: " + super.mouseX + " , Mouse Y: " + super.mouseY, 314, 5);
  9023. aTextDrawingArea_1271.method385(0xffff00, "Coords: " + x + ", " + y, 329, 5);
  9024. }
  9025. if(anInt1104 != 0)
  9026. {
  9027. int j = anInt1104 / 50;
  9028. int l = j / 60;
  9029. j %= 60;
  9030. if(j < 10)
  9031. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":0" + j, 329, 4);
  9032. else
  9033. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":" + j, 329, 4);
  9034. anInt849++;
  9035. if(anInt849 > 75)
  9036. {
  9037. anInt849 = 0;
  9038. stream.createFrame(148);
  9039. }
  9040. }
  9041. }
  9042.  
  9043. private void addIgnore(long l)
  9044. {
  9045. try
  9046. {
  9047. if(l == 0L)
  9048. return;
  9049. if(ignoreCount >= 100)
  9050. {
  9051. pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
  9052. return;
  9053. }
  9054. String s = TextClass.fixName(TextClass.nameForLong(l));
  9055. for(int j = 0; j < ignoreCount; j++)
  9056. if(ignoreListAsLongs[j] == l)
  9057. {
  9058. pushMessage(s + " is already on your ignore list", 0, "");
  9059. return;
  9060. }
  9061. for(int k = 0; k < friendsCount; k++)
  9062. if(friendsListAsLongs[k] == l)
  9063. {
  9064. pushMessage("Please remove " + s + " from your friend list first", 0, "");
  9065. return;
  9066. }
  9067.  
  9068. ignoreListAsLongs[ignoreCount++] = l;
  9069. needDrawTabArea = true;
  9070. stream.createFrame(133);
  9071. stream.writeQWord(l);
  9072. return;
  9073. }
  9074. catch(RuntimeException runtimeexception)
  9075. {
  9076. signlink.reporterror("45688, " + l + ", " + 4 + ", " + runtimeexception.toString());
  9077. }
  9078. throw new RuntimeException();
  9079. }
  9080.  
  9081. private void method114()
  9082. {
  9083. for(int i = -1; i < playerCount; i++)
  9084. {
  9085. int j;
  9086. if(i == -1)
  9087. j = myPlayerIndex;
  9088. else
  9089. j = playerIndices[i];
  9090. Player player = playerArray[j];
  9091. if(player != null)
  9092. method96(player);
  9093. }
  9094.  
  9095. }
  9096.  
  9097. private void method115()
  9098. {
  9099. if(loadingStage == 2)
  9100. {
  9101. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  9102. {
  9103. if(class30_sub1.anInt1294 > 0)
  9104. class30_sub1.anInt1294--;
  9105. if(class30_sub1.anInt1294 == 0)
  9106. {
  9107. if(class30_sub1.anInt1299 < 0 || ObjectManager.method178(class30_sub1.anInt1299, class30_sub1.anInt1301))
  9108. {
  9109. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1300, class30_sub1.anInt1301, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1299);
  9110. class30_sub1.unlink();
  9111. }
  9112. } else
  9113. {
  9114. if(class30_sub1.anInt1302 > 0)
  9115. class30_sub1.anInt1302--;
  9116. 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)))
  9117. {
  9118. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1292, class30_sub1.anInt1293, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1291);
  9119. class30_sub1.anInt1302 = -1;
  9120. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1299 == -1)
  9121. class30_sub1.unlink();
  9122. else
  9123. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1292 == class30_sub1.anInt1300 && class30_sub1.anInt1293 == class30_sub1.anInt1301)
  9124. class30_sub1.unlink();
  9125. }
  9126. }
  9127. }
  9128.  
  9129. }
  9130. }
  9131.  
  9132. private void determineMenuSize()
  9133. {
  9134. int i = chatTextDrawingArea.getTextWidth("Choose Option");
  9135. for(int j = 0; j < menuActionRow; j++)
  9136. {
  9137. int k = chatTextDrawingArea.getTextWidth(menuActionName[j]);
  9138. if(k > i)
  9139. i = k;
  9140. }
  9141.  
  9142. i += 8;
  9143. int l = 15 * menuActionRow + 21;
  9144. if(super.saveClickX > 4 && super.saveClickY > 4 && super.saveClickX < 516 && super.saveClickY < 338)
  9145. {
  9146. int i1 = super.saveClickX - 4 - i / 2;
  9147. if(i1 + i > 512)
  9148. i1 = 512 - i;
  9149. if(i1 < 0)
  9150. i1 = 0;
  9151. int l1 = super.saveClickY - 4;
  9152. if(l1 + l > 334)
  9153. l1 = 334 - l;
  9154. if(l1 < 0)
  9155. l1 = 0;
  9156. menuOpen = true;
  9157. menuScreenArea = 0;
  9158. menuOffsetX = i1;
  9159. menuOffsetY = l1;
  9160. menuWidth = i;
  9161. anInt952 = 15 * menuActionRow + 22;
  9162. }
  9163. if(super.saveClickX > 519 && super.saveClickY > 168 && super.saveClickX < 765 && super.saveClickY < 503)
  9164. {
  9165. int j1 = super.saveClickX - 519 - i / 2;
  9166. if(j1 < 0)
  9167. j1 = 0;
  9168. else
  9169. if(j1 + i > 245)
  9170. j1 = 245 - i;
  9171. int i2 = super.saveClickY - 168;
  9172. if(i2 < 0)
  9173. i2 = 0;
  9174. else
  9175. if(i2 + l > 333)
  9176. i2 = 333 - l;
  9177. menuOpen = true;
  9178. menuScreenArea = 1;
  9179. menuOffsetX = j1;
  9180. menuOffsetY = i2;
  9181. menuWidth = i;
  9182. anInt952 = 15 * menuActionRow + 22;
  9183. }
  9184. if(super.saveClickX > 0 && super.saveClickY > 338 && super.saveClickX < 516 && super.saveClickY < 503)
  9185. {
  9186. int k1 = super.saveClickX - 0 - i / 2;
  9187. if(k1 < 0)
  9188. k1 = 0;
  9189. else
  9190. if(k1 + i > 516)
  9191. k1 = 516 - i;
  9192. int j2 = super.saveClickY - 338;
  9193. if(j2 < 0)
  9194. j2 = 0;
  9195. else
  9196. if(j2 + l > 165)
  9197. j2 = 165 - l;
  9198. menuOpen = true;
  9199. menuScreenArea = 2;
  9200. menuOffsetX = k1;
  9201. menuOffsetY = j2;
  9202. menuWidth = i;
  9203. anInt952 = 15 * menuActionRow + 22;
  9204. }
  9205. }
  9206.  
  9207. private void method117(Stream stream)
  9208. {
  9209. stream.initBitAccess();
  9210. int j = stream.readBits(1);
  9211. if(j == 0)
  9212. return;
  9213. int k = stream.readBits(2);
  9214. if(k == 0)
  9215. {
  9216. anIntArray894[anInt893++] = myPlayerIndex;
  9217. return;
  9218. }
  9219. if(k == 1)
  9220. {
  9221. int l = stream.readBits(3);
  9222. myPlayer.moveInDir(false, l);
  9223. int k1 = stream.readBits(1);
  9224. if(k1 == 1)
  9225. anIntArray894[anInt893++] = myPlayerIndex;
  9226. return;
  9227. }
  9228. if(k == 2)
  9229. {
  9230. int i1 = stream.readBits(3);
  9231. myPlayer.moveInDir(true, i1);
  9232. int l1 = stream.readBits(3);
  9233. myPlayer.moveInDir(true, l1);
  9234. int j2 = stream.readBits(1);
  9235. if(j2 == 1)
  9236. anIntArray894[anInt893++] = myPlayerIndex;
  9237. return;
  9238. }
  9239. if(k == 3)
  9240. {
  9241. plane = stream.readBits(2);
  9242. int j1 = stream.readBits(1);
  9243. int i2 = stream.readBits(1);
  9244. if(i2 == 1)
  9245. anIntArray894[anInt893++] = myPlayerIndex;
  9246. int k2 = stream.readBits(7);
  9247. int l2 = stream.readBits(7);
  9248. myPlayer.setPos(l2, k2, j1 == 1);
  9249. }
  9250. }
  9251.  
  9252. private void nullLoader()
  9253. {
  9254. aBoolean831 = false;
  9255. while(drawingFlames)
  9256. {
  9257. aBoolean831 = false;
  9258. try
  9259. {
  9260. Thread.sleep(50L);
  9261. }
  9262. catch(Exception _ex) { }
  9263. }
  9264. aBackground_966 = null;
  9265. aBackground_967 = null;
  9266. aBackgroundArray1152s = null;
  9267. anIntArray850 = null;
  9268. anIntArray851 = null;
  9269. anIntArray852 = null;
  9270. anIntArray853 = null;
  9271. anIntArray1190 = null;
  9272. anIntArray1191 = null;
  9273. anIntArray828 = null;
  9274. anIntArray829 = null;
  9275. aClass30_Sub2_Sub1_Sub1_1201 = null;
  9276. aClass30_Sub2_Sub1_Sub1_1202 = null;
  9277. }
  9278.  
  9279. private boolean method119(int i, int j)
  9280. {
  9281. boolean flag1 = false;
  9282. RSInterface class9 = RSInterface.interfaceCache[j];
  9283. for(int k = 0; k < class9.children.length; k++)
  9284. {
  9285. if(class9.children[k] == -1)
  9286. break;
  9287. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
  9288. if(class9_1.type == 1)
  9289. flag1 |= method119(i, class9_1.id);
  9290. if(class9_1.type == 6 && (class9_1.anInt257 != -1 || class9_1.anInt258 != -1))
  9291. {
  9292. boolean flag2 = interfaceIsSelected(class9_1);
  9293. int l;
  9294. if(flag2)
  9295. l = class9_1.anInt258;
  9296. else
  9297. l = class9_1.anInt257;
  9298. if(l != -1)
  9299. {
  9300. Animation animation = Animation.anims[l];
  9301. for(class9_1.anInt208 += i; class9_1.anInt208 > animation.method258(class9_1.anInt246);)
  9302. {
  9303. class9_1.anInt208 -= animation.method258(class9_1.anInt246) + 1;
  9304. class9_1.anInt246++;
  9305. if(class9_1.anInt246 >= animation.anInt352)
  9306. {
  9307. class9_1.anInt246 -= animation.anInt356;
  9308. if(class9_1.anInt246 < 0 || class9_1.anInt246 >= animation.anInt352)
  9309. class9_1.anInt246 = 0;
  9310. }
  9311. flag1 = true;
  9312. }
  9313.  
  9314. }
  9315. }
  9316. }
  9317.  
  9318. return flag1;
  9319. }
  9320.  
  9321. private int method120()
  9322. {
  9323. int j = 3;
  9324. if(yCameraCurve < 310)
  9325. {
  9326. int k = xCameraPos >> 7;
  9327. int l = yCameraPos >> 7;
  9328. int i1 = myPlayer.x >> 7;
  9329. int j1 = myPlayer.y >> 7;
  9330. if((byteGroundArray[plane][k][l] & 4) != 0)
  9331. j = plane;
  9332. int k1;
  9333. if(i1 > k)
  9334. k1 = i1 - k;
  9335. else
  9336. k1 = k - i1;
  9337. int l1;
  9338. if(j1 > l)
  9339. l1 = j1 - l;
  9340. else
  9341. l1 = l - j1;
  9342. if(k1 > l1)
  9343. {
  9344. int i2 = (l1 * 0x10000) / k1;
  9345. int k2 = 32768;
  9346. while(k != i1)
  9347. {
  9348. if(k < i1)
  9349. k++;
  9350. else
  9351. if(k > i1)
  9352. k--;
  9353. if((byteGroundArray[plane][k][l] & 4) != 0)
  9354. j = plane;
  9355. k2 += i2;
  9356. if(k2 >= 0x10000)
  9357. {
  9358. k2 -= 0x10000;
  9359. if(l < j1)
  9360. l++;
  9361. else
  9362. if(l > j1)
  9363. l--;
  9364. if((byteGroundArray[plane][k][l] & 4) != 0)
  9365. j = plane;
  9366. }
  9367. }
  9368. } else
  9369. {
  9370. int j2 = (k1 * 0x10000) / l1;
  9371. int l2 = 32768;
  9372. while(l != j1)
  9373. {
  9374. if(l < j1)
  9375. l++;
  9376. else
  9377. if(l > j1)
  9378. l--;
  9379. if((byteGroundArray[plane][k][l] & 4) != 0)
  9380. j = plane;
  9381. l2 += j2;
  9382. if(l2 >= 0x10000)
  9383. {
  9384. l2 -= 0x10000;
  9385. if(k < i1)
  9386. k++;
  9387. else
  9388. if(k > i1)
  9389. k--;
  9390. if((byteGroundArray[plane][k][l] & 4) != 0)
  9391. j = plane;
  9392. }
  9393. }
  9394. }
  9395. }
  9396. if((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
  9397. j = plane;
  9398. return j;
  9399. }
  9400.  
  9401. private int method121()
  9402. {
  9403. int j = method42(plane, yCameraPos, xCameraPos);
  9404. if(j - zCameraPos < 800 && (byteGroundArray[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
  9405. return plane;
  9406. else
  9407. return 3;
  9408. }
  9409.  
  9410. private void delIgnore(long l)
  9411. {
  9412. try
  9413. {
  9414. if(l == 0L)
  9415. return;
  9416. for(int j = 0; j < ignoreCount; j++)
  9417. if(ignoreListAsLongs[j] == l)
  9418. {
  9419. ignoreCount--;
  9420. needDrawTabArea = true;
  9421. System.arraycopy(ignoreListAsLongs, j + 1, ignoreListAsLongs, j, ignoreCount - j);
  9422.  
  9423. stream.createFrame(74);
  9424. stream.writeQWord(l);
  9425. return;
  9426. }
  9427.  
  9428. return;
  9429. }
  9430. catch(RuntimeException runtimeexception)
  9431. {
  9432. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  9433. }
  9434. throw new RuntimeException();
  9435. }
  9436.  
  9437. public String getParameter(String s)
  9438. {
  9439. if(signlink.mainapp != null)
  9440. return signlink.mainapp.getParameter(s);
  9441. else
  9442. return super.getParameter(s);
  9443. }
  9444.  
  9445. private void adjustVolume(boolean flag, int i)
  9446. {
  9447. signlink.midivol = i;
  9448. if(flag)
  9449. signlink.midi = "voladjust";
  9450. }
  9451.  
  9452. private int extractInterfaceValues(RSInterface class9, int j)
  9453. {
  9454. if(class9.valueIndexArray == null || j >= class9.valueIndexArray.length)
  9455. return -2;
  9456. try
  9457. {
  9458. int ai[] = class9.valueIndexArray[j];
  9459. int k = 0;
  9460. int l = 0;
  9461. int i1 = 0;
  9462. do
  9463. {
  9464. int j1 = ai[l++];
  9465. int k1 = 0;
  9466. byte byte0 = 0;
  9467. if(j1 == 0)
  9468. return k;
  9469. if(j1 == 1)
  9470. k1 = currentStats[ai[l++]];
  9471. if(j1 == 2)
  9472. k1 = maxStats[ai[l++]];
  9473. if(j1 == 3)
  9474. k1 = currentExp[ai[l++]];
  9475. if(j1 == 4)
  9476. {
  9477. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  9478. int k2 = ai[l++];
  9479. if(k2 >= 0 && k2 < ItemDef.totalItems && (!ItemDef.forID(k2).membersObject || isMembers))
  9480. {
  9481. for(int j3 = 0; j3 < class9_1.inv.length; j3++)
  9482. if(class9_1.inv[j3] == k2 + 1)
  9483. k1 += class9_1.invStackSizes[j3];
  9484.  
  9485. }
  9486. }
  9487. if(j1 == 5)
  9488. k1 = variousSettings[ai[l++]];
  9489. if(j1 == 6)
  9490. k1 = anIntArray1019[maxStats[ai[l++]] - 1];
  9491. if(j1 == 7)
  9492. k1 = (variousSettings[ai[l++]] * 100) / 46875;
  9493. if(j1 == 8)
  9494. k1 = myPlayer.combatLevel;
  9495. if(j1 == 9)
  9496. {
  9497. for(int l1 = 0; l1 < Skills.skillsCount; l1++)
  9498. if(Skills.skillEnabled[l1])
  9499. k1 += maxStats[l1];
  9500.  
  9501. }
  9502. if(j1 == 10)
  9503. {
  9504. RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
  9505. int l2 = ai[l++] + 1;
  9506. if(l2 >= 0 && l2 < ItemDef.totalItems && (!ItemDef.forID(l2).membersObject || isMembers))
  9507. {
  9508. for(int k3 = 0; k3 < class9_2.inv.length; k3++)
  9509. {
  9510. if(class9_2.inv[k3] != l2)
  9511. continue;
  9512. k1 = 0x3b9ac9ff;
  9513. break;
  9514. }
  9515.  
  9516. }
  9517. }
  9518. if(j1 == 11)
  9519. k1 = energy;
  9520. if(j1 == 12)
  9521. k1 = weight;
  9522. if(j1 == 13)
  9523. {
  9524. int i2 = variousSettings[ai[l++]];
  9525. int i3 = ai[l++];
  9526. k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  9527. }
  9528. if(j1 == 14)
  9529. {
  9530. int j2 = ai[l++];
  9531. VarBit varBit = VarBit.cache[j2];
  9532. int l3 = varBit.anInt648;
  9533. int i4 = varBit.anInt649;
  9534. int j4 = varBit.anInt650;
  9535. int k4 = anIntArray1232[j4 - i4];
  9536. k1 = variousSettings[l3] >> i4 & k4;
  9537. }
  9538. if(j1 == 15)
  9539. byte0 = 1;
  9540. if(j1 == 16)
  9541. byte0 = 2;
  9542. if(j1 == 17)
  9543. byte0 = 3;
  9544. if(j1 == 18)
  9545. k1 = (myPlayer.x >> 7) + baseX;
  9546. if(j1 == 19)
  9547. k1 = (myPlayer.y >> 7) + baseY;
  9548. if(j1 == 20)
  9549. k1 = ai[l++];
  9550. if(byte0 == 0)
  9551. {
  9552. if(i1 == 0)
  9553. k += k1;
  9554. if(i1 == 1)
  9555. k -= k1;
  9556. if(i1 == 2 && k1 != 0)
  9557. k /= k1;
  9558. if(i1 == 3)
  9559. k *= k1;
  9560. i1 = 0;
  9561. } else
  9562. {
  9563. i1 = byte0;
  9564. }
  9565. } while(true);
  9566. }
  9567. catch(Exception _ex)
  9568. {
  9569. return -1;
  9570. }
  9571. }
  9572.  
  9573. private void drawTooltip()
  9574. {
  9575. if(menuActionRow < 2 && itemSelected == 0 && spellSelected == 0)
  9576. return;
  9577. String s;
  9578. if(itemSelected == 1 && menuActionRow < 2)
  9579. s = "Use " + selectedItemName + " with...";
  9580. else
  9581. if(spellSelected == 1 && menuActionRow < 2)
  9582. s = spellTooltip + "...";
  9583. else
  9584. s = menuActionName[menuActionRow - 1];
  9585. if(menuActionRow > 2)
  9586. s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
  9587. chatTextDrawingArea.method390(4, 0xffffff, s, loopCycle / 1000, 15);
  9588. }
  9589.  
  9590. public void drawHPOrb() {
  9591. int health;
  9592. String cHP = RSInterface.interfaceCache[4016].message;
  9593. int currentHP = Integer.parseInt(cHP);
  9594. String mHP = RSInterface.interfaceCache[4017].message;
  9595. int maxHP2 = Integer.parseInt(mHP);
  9596. health = (int)(((double)currentHP / (double)maxHP2) * 100D);
  9597. /* Draws empty orb */
  9598. emptyOrb.drawSprite(170, 13);
  9599. /* Draws current HP text */
  9600. if(health <= 100 && health >= 75) {
  9601. smallText.method382(65280, 213, cHP, 39, true);
  9602. }
  9603. else if(health <= 74 && health >= 50) {
  9604. smallText.method382(0xffff00, 213, cHP, 39, true);
  9605. }
  9606. else if(health <= 49 && health >= 25) {
  9607. smallText.method382(0xfca607, 213, cHP, 39, true);
  9608. }
  9609. else if(health <= 24 && health >= 0) {
  9610. smallText.method382(0xf50d0d, 213, cHP, 39, true);
  9611. }
  9612. /* Draws inside orb sprites */
  9613. hitPointsFill.drawSprite(173, 16);
  9614. hitPointsIcon.drawSprite(179, 24);
  9615. }
  9616.  
  9617. public void drawPrayerOrb() {
  9618. int prayer;
  9619.  
  9620. String cP = RSInterface.interfaceCache[4012].message;
  9621. int currentPrayer = Integer.parseInt(cP);
  9622. String mP = RSInterface.interfaceCache[4013].message;
  9623. int maxPrayer = Integer.parseInt(mP);
  9624. prayer = (int)(((double)currentPrayer / (double)maxPrayer) * 100D);
  9625. /* Draws empty orb */
  9626. emptyOrb.drawSprite(184, 49);
  9627. /* Draws current HP text */
  9628. if(prayer <= 100 && prayer >= 75) {
  9629. smallText.method382(65280, 227, cP, 75, true);
  9630. }
  9631. else if(prayer <= 74 && prayer >= 50) {
  9632. smallText.method382(0xffff00, 227, cP, 75, true);
  9633. }
  9634. else if(prayer <= 49 && prayer >= 25) {
  9635. smallText.method382(0xfca607, 227, cP, 75, true);
  9636. }
  9637. else if(prayer <= 24 && prayer >= 0) {
  9638. smallText.method382(0xf50d0d, 227, cP, 75, true);
  9639. }
  9640. /* Draws inside orb sprites */
  9641. prayerFill.drawSprite(187, 52);
  9642. prayerIcon.drawSprite(191, 56);
  9643. }
  9644.  
  9645. private void drawMinimap() {
  9646. aRSImageProducer_1164.initDrawingArea();
  9647. if(anInt1021 == 2) {
  9648. byte abyte0[] = mapBack.aByteArray1450;
  9649. int ai[] = DrawingArea.pixels;
  9650. int k2 = abyte0.length;
  9651. for(int i5 = 0; i5 < k2; i5++)
  9652. if(abyte0[i5] == 0)
  9653. ai[i5] = 0;
  9654. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, 8, 8, 33, 25);
  9655. aRSImageProducer_1165.initDrawingArea();
  9656. return;
  9657. }
  9658. int i = minimapInt1 + minimapInt2 & 0x7ff;
  9659. int j = 48 + myPlayer.x / 32;
  9660. int l2 = 464 - myPlayer.y / 32;
  9661. for (int x = 0; x < anIntArray1229.length; x++){
  9662. anIntArray1229[x] = 170;
  9663. anIntArray1052[x] = -23;
  9664. }
  9665. aClass30_Sub2_Sub1_Sub1_1263.method352(151, i, anIntArray1229, 256 + minimapInt3, anIntArray1052, l2, 10, 45, 146, j);
  9666. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, 8, 8, 33, 25);
  9667. for(int j5 = 0; j5 < anInt1071; j5++) {
  9668. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  9669. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  9670. markMinimap(aClass30_Sub2_Sub1_Sub1Array1140[j5], k, i3);
  9671. }
  9672.  
  9673. for(int k5 = 0; k5 < 104; k5++) {
  9674. for(int l5 = 0; l5 < 104; l5++) {
  9675. NodeList class19 = groundArray[plane][k5][l5];
  9676. if(class19 != null) {
  9677. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  9678. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  9679. markMinimap(mapDotItem, l, j3);
  9680. }
  9681. }
  9682. }
  9683.  
  9684. for(int i6 = 0; i6 < npcCount; i6++) {
  9685. NPC npc = npcArray[npcIndices[i6]];
  9686. if(npc != null && npc.isVisible()) {
  9687. EntityDef entityDef = npc.desc;
  9688. if(entityDef.childrenIDs != null)
  9689. entityDef = entityDef.method161();
  9690. if(entityDef != null && entityDef.aBoolean87 && entityDef.aBoolean84) {
  9691. int i1 = npc.x / 32 - myPlayer.x / 32;
  9692. int k3 = npc.y / 32 - myPlayer.y / 32;
  9693. markMinimap(mapDotNPC, i1, k3);
  9694. }
  9695. }
  9696. }
  9697.  
  9698. for(int j6 = 0; j6 < playerCount; j6++) {
  9699. Player player = playerArray[playerIndices[j6]];
  9700. if(player != null && player.isVisible()) {
  9701. int j1 = player.x / 32 - myPlayer.x / 32;
  9702. int l3 = player.y / 32 - myPlayer.y / 32;
  9703. boolean flag1 = false;
  9704. long l6 = TextClass.longForName(player.name);
  9705. for(int k6 = 0; k6 < friendsCount; k6++) {
  9706. if(l6 != friendsListAsLongs[k6] || friendsNodeIDs[k6] == 0)
  9707. continue;
  9708. flag1 = true;
  9709. break;
  9710. }
  9711. boolean flag2 = false;
  9712. if(myPlayer.team != 0 && player.team != 0 && myPlayer.team == player.team)
  9713. flag2 = true;
  9714. if(flag1)
  9715. markMinimap(mapDotFriend, j1, l3);
  9716. else
  9717. markMinimap(mapDotPlayer, j1, l3);
  9718. }
  9719. }
  9720.  
  9721. if(anInt855 != 0 && loopCycle % 20 < 10) {
  9722. if(anInt855 == 1 && anInt1222 >= 0 && anInt1222 < npcArray.length) {
  9723. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  9724. if(class30_sub2_sub4_sub1_sub1_1 != null)
  9725. {
  9726. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32 - myPlayer.x / 32;
  9727. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32 - myPlayer.y / 32;
  9728. method81(mapMarker, i4, k1);
  9729. }
  9730. }
  9731. if(anInt855 == 2) {
  9732. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  9733. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  9734. method81(mapMarker, j4, l1);
  9735. }
  9736. if(anInt855 == 10 && anInt933 >= 0 && anInt933 < playerArray.length)
  9737. {
  9738. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  9739. if(class30_sub2_sub4_sub1_sub2_1 != null) {
  9740. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32 - myPlayer.x / 32;
  9741. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32 - myPlayer.y / 32;
  9742. method81(mapMarker, k4, i2);
  9743. }
  9744. }
  9745. }
  9746. if(destX != 0) {
  9747. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  9748. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  9749. markMinimap(mapFlag, j2, l4);
  9750. }
  9751. DrawingArea.drawPixels(3, 78+5, 97+20, 0xffffff, 3);
  9752. mapArea.drawSprite(0, 0);
  9753. drawHPOrb();
  9754. drawPrayerOrb();
  9755. drawLogoutButton();
  9756. drawWorldMapButton();
  9757. aRSImageProducer_1165.initDrawingArea();
  9758. }
  9759.  
  9760. public void drawLogoutButton() {
  9761. if(tabInterfaceIDs[9] != -1 && anInt1054 == 9)
  9762. if(loopCycle % 20 >= 10);
  9763. sideIcons[9].drawSprite(223, 1);
  9764. if(logIconHPos == 1) {
  9765. logIconH.drawSprite(223, 1);
  9766. if(tabID == 10)
  9767. logIconC.drawSprite(223, 1);
  9768. }
  9769. }
  9770.  
  9771. public void drawWorldMapButton() {
  9772. worldMapIcon.drawSprite(8, 124);
  9773. }
  9774.  
  9775. private void npcScreenPos(Entity entity, int i) {
  9776. calcEntityScreenPos(entity.x, i, entity.y);
  9777. }
  9778.  
  9779. private void calcEntityScreenPos(int i, int j, int l) {
  9780. if(i < 128 || l < 128 || i > 13056 || l > 13056) {
  9781. spriteDrawX = -1;
  9782. spriteDrawY = -1;
  9783. return;
  9784. }
  9785. int i1 = method42(plane, l, i) - j;
  9786. i -= xCameraPos;
  9787. i1 -= zCameraPos;
  9788. l -= yCameraPos;
  9789. int j1 = Model.modelIntArray1[yCameraCurve];
  9790. int k1 = Model.modelIntArray2[yCameraCurve];
  9791. int l1 = Model.modelIntArray1[xCameraCurve];
  9792. int i2 = Model.modelIntArray2[xCameraCurve];
  9793. int j2 = l * l1 + i * i2 >> 16;
  9794. l = l * i2 - i * l1 >> 16;
  9795. i = j2;
  9796. j2 = i1 * k1 - l * j1 >> 16;
  9797. l = i1 * j1 + l * k1 >> 16;
  9798. i1 = j2;
  9799. if(l >= 50) {
  9800. spriteDrawX = Texture.textureInt1 + (i << 9) / l;
  9801. spriteDrawY = Texture.textureInt2 + (i1 << 9) / l;
  9802. } else {
  9803. spriteDrawX = -1;
  9804. spriteDrawY = -1;
  9805. }
  9806. }
  9807.  
  9808. private void buildSplitPrivateChatMenu()
  9809. {
  9810. if(splitPrivateChat == 0)
  9811. return;
  9812. int i = 0;
  9813. if(anInt1104 != 0)
  9814. i = 1;
  9815. for(int j = 0; j < 100; j++)
  9816. if(chatMessages[j] != null)
  9817. {
  9818. int k = chatTypes[j];
  9819. String s = chatNames[j];
  9820. boolean flag1 = false;
  9821. if(s != null && s.startsWith("@cr1@"))
  9822. {
  9823. s = s.substring(5);
  9824. boolean flag2 = true;
  9825. }
  9826. if(s != null && s.startsWith("@cr2@"))
  9827. {
  9828. s = s.substring(5);
  9829. byte byte0 = 2;
  9830. }
  9831. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  9832. {
  9833. int l = 329 - i * 13;
  9834. if(super.mouseX > 4 && super.mouseY - 4 > l - 10 && super.mouseY - 4 <= l + 3)
  9835. {
  9836. int i1 = aTextDrawingArea_1271.getTextWidth("From: " + s + chatMessages[j]) + 25;
  9837. if(i1 > 450)
  9838. i1 = 450;
  9839. if(super.mouseX < 4 + i1)
  9840. {
  9841. if(myPrivilege >= 1)
  9842. {
  9843. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  9844. menuActionID[menuActionRow] = 2606;
  9845. menuActionRow++;
  9846. }
  9847. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  9848. menuActionID[menuActionRow] = 2042;
  9849. menuActionRow++;
  9850. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  9851. menuActionID[menuActionRow] = 2337;
  9852. menuActionRow++;
  9853. }
  9854. }
  9855. if(++i >= 5)
  9856. return;
  9857. }
  9858. if((k == 5 || k == 6) && privateChatMode < 2 && ++i >= 5)
  9859. return;
  9860. }
  9861.  
  9862. }
  9863.  
  9864. private void method130(int j, int k, int l, int i1, int j1, int k1,
  9865. int l1, int i2, int j2)
  9866. {
  9867. Class30_Sub1 class30_sub1 = null;
  9868. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  9869. {
  9870. if(class30_sub1_1.anInt1295 != l1 || class30_sub1_1.anInt1297 != i2 || class30_sub1_1.anInt1298 != j1 || class30_sub1_1.anInt1296 != i1)
  9871. continue;
  9872. class30_sub1 = class30_sub1_1;
  9873. break;
  9874. }
  9875.  
  9876. if(class30_sub1 == null)
  9877. {
  9878. class30_sub1 = new Class30_Sub1();
  9879. class30_sub1.anInt1295 = l1;
  9880. class30_sub1.anInt1296 = i1;
  9881. class30_sub1.anInt1297 = i2;
  9882. class30_sub1.anInt1298 = j1;
  9883. method89(class30_sub1);
  9884. aClass19_1179.insertHead(class30_sub1);
  9885. }
  9886. class30_sub1.anInt1291 = k;
  9887. class30_sub1.anInt1293 = k1;
  9888. class30_sub1.anInt1292 = l;
  9889. class30_sub1.anInt1302 = j2;
  9890. class30_sub1.anInt1294 = j;
  9891. }
  9892.  
  9893. private boolean interfaceIsSelected(RSInterface class9)
  9894. {
  9895. if(class9.anIntArray245 == null)
  9896. return false;
  9897. for(int i = 0; i < class9.anIntArray245.length; i++)
  9898. {
  9899. int j = extractInterfaceValues(class9, i);
  9900. int k = class9.anIntArray212[i];
  9901. if(class9.anIntArray245[i] == 2)
  9902. {
  9903. if(j >= k)
  9904. return false;
  9905. } else
  9906. if(class9.anIntArray245[i] == 3)
  9907. {
  9908. if(j <= k)
  9909. return false;
  9910. } else
  9911. if(class9.anIntArray245[i] == 4)
  9912. {
  9913. if(j == k)
  9914. return false;
  9915. } else
  9916. if(j != k)
  9917. return false;
  9918. }
  9919.  
  9920. return true;
  9921. }
  9922.  
  9923. private DataInputStream openJagGrabInputStream(String s)
  9924. throws IOException
  9925. {
  9926. // if(!aBoolean872)
  9927. // if(signlink.mainapp != null)
  9928. // return signlink.openurl(s);
  9929. // else
  9930. // return new DataInputStream((new URL(getCodeBase(), s)).openStream());
  9931. if(aSocket832 != null)
  9932. {
  9933. try
  9934. {
  9935. aSocket832.close();
  9936. }
  9937. catch(Exception _ex) { }
  9938. aSocket832 = null;
  9939. }
  9940. aSocket832 = openSocket(43595);
  9941. aSocket832.setSoTimeout(10000);
  9942. java.io.InputStream inputstream = aSocket832.getInputStream();
  9943. OutputStream outputstream = aSocket832.getOutputStream();
  9944. outputstream.write(("JAGGRAB /" + s + "\n\n").getBytes());
  9945. return new DataInputStream(inputstream);
  9946. }
  9947.  
  9948. private void doFlamesDrawing()
  9949. {
  9950. char c = '\u0100';
  9951. if(anInt1040 > 0)
  9952. {
  9953. for(int i = 0; i < 256; i++)
  9954. if(anInt1040 > 768)
  9955. anIntArray850[i] = method83(anIntArray851[i], anIntArray852[i], 1024 - anInt1040);
  9956. else
  9957. if(anInt1040 > 256)
  9958. anIntArray850[i] = anIntArray852[i];
  9959. else
  9960. anIntArray850[i] = method83(anIntArray852[i], anIntArray851[i], 256 - anInt1040);
  9961.  
  9962. } else
  9963. if(anInt1041 > 0)
  9964. {
  9965. for(int j = 0; j < 256; j++)
  9966. if(anInt1041 > 768)
  9967. anIntArray850[j] = method83(anIntArray851[j], anIntArray853[j], 1024 - anInt1041);
  9968. else
  9969. if(anInt1041 > 256)
  9970. anIntArray850[j] = anIntArray853[j];
  9971. else
  9972. anIntArray850[j] = method83(anIntArray853[j], anIntArray851[j], 256 - anInt1041);
  9973.  
  9974. } else
  9975. {
  9976. System.arraycopy(anIntArray851, 0, anIntArray850, 0, 256);
  9977.  
  9978. }
  9979. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, aRSImageProducer_1110.anIntArray315, 0, 33920);
  9980.  
  9981. int i1 = 0;
  9982. int j1 = 1152;
  9983. for(int k1 = 1; k1 < c - 1; k1++)
  9984. {
  9985. int l1 = (anIntArray969[k1] * (c - k1)) / c;
  9986. int j2 = 22 + l1;
  9987. if(j2 < 0)
  9988. j2 = 0;
  9989. i1 += j2;
  9990. for(int l2 = j2; l2 < 128; l2++)
  9991. {
  9992. int j3 = anIntArray828[i1++];
  9993. if(j3 != 0)
  9994. {
  9995. int l3 = j3;
  9996. int j4 = 256 - j3;
  9997. j3 = anIntArray850[j3];
  9998. int l4 = aRSImageProducer_1110.anIntArray315[j1];
  9999. aRSImageProducer_1110.anIntArray315[j1++] = ((j3 & 0xff00ff) * l3 + (l4 & 0xff00ff) * j4 & 0xff00ff00) + ((j3 & 0xff00) * l3 + (l4 & 0xff00) * j4 & 0xff0000) >> 8;
  10000. } else
  10001. {
  10002. j1++;
  10003. }
  10004. }
  10005.  
  10006. j1 += j2;
  10007. }
  10008.  
  10009. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  10010. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, aRSImageProducer_1111.anIntArray315, 0, 33920);
  10011.  
  10012. i1 = 0;
  10013. j1 = 1176;
  10014. for(int k2 = 1; k2 < c - 1; k2++)
  10015. {
  10016. int i3 = (anIntArray969[k2] * (c - k2)) / c;
  10017. int k3 = 103 - i3;
  10018. j1 += i3;
  10019. for(int i4 = 0; i4 < k3; i4++)
  10020. {
  10021. int k4 = anIntArray828[i1++];
  10022. if(k4 != 0)
  10023. {
  10024. int i5 = k4;
  10025. int j5 = 256 - k4;
  10026. k4 = anIntArray850[k4];
  10027. int k5 = aRSImageProducer_1111.anIntArray315[j1];
  10028. aRSImageProducer_1111.anIntArray315[j1++] = ((k4 & 0xff00ff) * i5 + (k5 & 0xff00ff) * j5 & 0xff00ff00) + ((k4 & 0xff00) * i5 + (k5 & 0xff00) * j5 & 0xff0000) >> 8;
  10029. } else
  10030. {
  10031. j1++;
  10032. }
  10033. }
  10034.  
  10035. i1 += 128 - k3;
  10036. j1 += 128 - k3 - i3;
  10037. }
  10038.  
  10039. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  10040. }
  10041.  
  10042. private void method134(Stream stream)
  10043. {
  10044. int j = stream.readBits(8);
  10045. if(j < playerCount)
  10046. {
  10047. for(int k = j; k < playerCount; k++)
  10048. anIntArray840[anInt839++] = playerIndices[k];
  10049.  
  10050. }
  10051. if(j > playerCount)
  10052. {
  10053. signlink.reporterror(myUsername + " Too many players");
  10054. throw new RuntimeException("eek");
  10055. }
  10056. playerCount = 0;
  10057. for(int l = 0; l < j; l++)
  10058. {
  10059. int i1 = playerIndices[l];
  10060. Player player = playerArray[i1];
  10061. int j1 = stream.readBits(1);
  10062. if(j1 == 0)
  10063. {
  10064. playerIndices[playerCount++] = i1;
  10065. player.anInt1537 = loopCycle;
  10066. } else
  10067. {
  10068. int k1 = stream.readBits(2);
  10069. if(k1 == 0)
  10070. {
  10071. playerIndices[playerCount++] = i1;
  10072. player.anInt1537 = loopCycle;
  10073. anIntArray894[anInt893++] = i1;
  10074. } else
  10075. if(k1 == 1)
  10076. {
  10077. playerIndices[playerCount++] = i1;
  10078. player.anInt1537 = loopCycle;
  10079. int l1 = stream.readBits(3);
  10080. player.moveInDir(false, l1);
  10081. int j2 = stream.readBits(1);
  10082. if(j2 == 1)
  10083. anIntArray894[anInt893++] = i1;
  10084. } else
  10085. if(k1 == 2)
  10086. {
  10087. playerIndices[playerCount++] = i1;
  10088. player.anInt1537 = loopCycle;
  10089. int i2 = stream.readBits(3);
  10090. player.moveInDir(true, i2);
  10091. int k2 = stream.readBits(3);
  10092. player.moveInDir(true, k2);
  10093. int l2 = stream.readBits(1);
  10094. if(l2 == 1)
  10095. anIntArray894[anInt893++] = i1;
  10096. } else
  10097. if(k1 == 3)
  10098. anIntArray840[anInt839++] = i1;
  10099. }
  10100. }
  10101. }
  10102.  
  10103. private void drawLoginScreen(boolean flag)
  10104. {
  10105. resetImageProducers();
  10106. aRSImageProducer_1109.initDrawingArea();
  10107. aBackground_966.method361(0, 0);
  10108. char c = '\u0168';
  10109. char c1 = '\310';
  10110. if(loginScreenState == 0)
  10111. {
  10112. int i = c1 / 2 + 80;
  10113. smallText.method382(0x75a9a9, c / 2, onDemandFetcher.statusString, i, true);
  10114. i = c1 / 2 - 20;
  10115. chatTextDrawingArea.method382(0xffff00, c / 2, "Welcome to RuneScape", i, true);
  10116. i += 30;
  10117. int l = c / 2 - 80;
  10118. int k1 = c1 / 2 + 20;
  10119. aBackground_967.method361(l - 73, k1 - 20);
  10120. chatTextDrawingArea.method382(0xffffff, l, "New User", k1 + 5, true);
  10121. l = c / 2 + 80;
  10122. aBackground_967.method361(l - 73, k1 - 20);
  10123. chatTextDrawingArea.method382(0xffffff, l, "Existing User", k1 + 5, true);
  10124. }
  10125. if(loginScreenState == 2)
  10126. {
  10127. int j = c1 / 2 - 40;
  10128. if(loginMessage1.length() > 0)
  10129. {
  10130. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage1, j - 15, true);
  10131. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2, j, true);
  10132. j += 30;
  10133. } else
  10134. {
  10135. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2, j - 7, true);
  10136. j += 30;
  10137. }
  10138. chatTextDrawingArea.method389(true, c / 2 - 90, 0xffffff, "Username: " + myUsername + ((loginScreenCursorPos == 0) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  10139. j += 15;
  10140. chatTextDrawingArea.method389(true, c / 2 - 88, 0xffffff, "Password: " + TextClass.passwordAsterisks(myPassword) + ((loginScreenCursorPos == 1) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  10141. j += 15;
  10142. if(!flag)
  10143. {
  10144. int i1 = c / 2 - 80;
  10145. int l1 = c1 / 2 + 50;
  10146. aBackground_967.method361(i1 - 73, l1 - 20);
  10147. chatTextDrawingArea.method382(0xffffff, i1, "Login", l1 + 5, true);
  10148. i1 = c / 2 + 80;
  10149. aBackground_967.method361(i1 - 73, l1 - 20);
  10150. chatTextDrawingArea.method382(0xffffff, i1, "Cancel", l1 + 5, true);
  10151. }
  10152. }
  10153. if(loginScreenState == 3)
  10154. {
  10155. chatTextDrawingArea.method382(0xffff00, c / 2, "Create a free account", c1 / 2 - 60, true);
  10156. int k = c1 / 2 - 35;
  10157. chatTextDrawingArea.method382(0xffffff, c / 2, "To create a new account you need to", k, true);
  10158. k += 15;
  10159. chatTextDrawingArea.method382(0xffffff, c / 2, "go back to the main RuneScape webpage", k, true);
  10160. k += 15;
  10161. chatTextDrawingArea.method382(0xffffff, c / 2, "and choose the red 'create account'", k, true);
  10162. k += 15;
  10163. chatTextDrawingArea.method382(0xffffff, c / 2, "button at the top right of that page.", k, true);
  10164. k += 15;
  10165. int j1 = c / 2;
  10166. int i2 = c1 / 2 + 50;
  10167. aBackground_967.method361(j1 - 73, i2 - 20);
  10168. chatTextDrawingArea.method382(0xffffff, j1, "Cancel", i2 + 5, true);
  10169. }
  10170. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  10171. if(welcomeScreenRaised)
  10172. {
  10173. welcomeScreenRaised = false;
  10174. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  10175. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  10176. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  10177. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  10178. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  10179. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  10180. }
  10181. }
  10182.  
  10183. private void drawFlames()
  10184. {
  10185. drawingFlames = true;
  10186. try
  10187. {
  10188. long l = System.currentTimeMillis();
  10189. int i = 0;
  10190. int j = 20;
  10191. while(aBoolean831)
  10192. {
  10193. anInt1208++;
  10194. calcFlamesPosition();
  10195. calcFlamesPosition();
  10196. doFlamesDrawing();
  10197. if(++i > 10)
  10198. {
  10199. long l1 = System.currentTimeMillis();
  10200. int k = (int)(l1 - l) / 10 - j;
  10201. j = 40 - k;
  10202. if(j < 5)
  10203. j = 5;
  10204. i = 0;
  10205. l = l1;
  10206. }
  10207. try
  10208. {
  10209. Thread.sleep(j);
  10210. }
  10211. catch(Exception _ex) { }
  10212. }
  10213. }
  10214. catch(Exception _ex) { }
  10215. drawingFlames = false;
  10216. }
  10217.  
  10218. public void raiseWelcomeScreen()
  10219. {
  10220. welcomeScreenRaised = true;
  10221. }
  10222.  
  10223. private void method137(Stream stream, int j)
  10224. {
  10225. if(j == 84)
  10226. {
  10227. int k = stream.readUnsignedByte();
  10228. int j3 = anInt1268 + (k >> 4 & 7);
  10229. int i6 = anInt1269 + (k & 7);
  10230. int l8 = stream.readUnsignedWord();
  10231. int k11 = stream.readUnsignedWord();
  10232. int l13 = stream.readUnsignedWord();
  10233. if(j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104)
  10234. {
  10235. NodeList class19_1 = groundArray[plane][j3][i6];
  10236. if(class19_1 != null)
  10237. {
  10238. 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())
  10239. {
  10240. if(class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff) || class30_sub2_sub4_sub2_3.anInt1559 != k11)
  10241. continue;
  10242. class30_sub2_sub4_sub2_3.anInt1559 = l13;
  10243. break;
  10244. }
  10245.  
  10246. spawnGroundItem(j3, i6);
  10247. }
  10248. }
  10249. return;
  10250. }
  10251. if(j == 105)
  10252. {
  10253. int l = stream.readUnsignedByte();
  10254. int k3 = anInt1268 + (l >> 4 & 7);
  10255. int j6 = anInt1269 + (l & 7);
  10256. int i9 = stream.readUnsignedWord();
  10257. int l11 = stream.readUnsignedByte();
  10258. int i14 = l11 >> 4 & 0xf;
  10259. int i16 = l11 & 7;
  10260. 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)
  10261. {
  10262. anIntArray1207[anInt1062] = i9;
  10263. anIntArray1241[anInt1062] = i16;
  10264. anIntArray1250[anInt1062] = Sounds.anIntArray326[i9];
  10265. anInt1062++;
  10266. }
  10267. }
  10268. if(j == 215)
  10269. {
  10270. int i1 = stream.method435();
  10271. int l3 = stream.method428();
  10272. int k6 = anInt1268 + (l3 >> 4 & 7);
  10273. int j9 = anInt1269 + (l3 & 7);
  10274. int i12 = stream.method435();
  10275. int j14 = stream.readUnsignedWord();
  10276. if(k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104 && i12 != unknownInt10)
  10277. {
  10278. Item class30_sub2_sub4_sub2_2 = new Item();
  10279. class30_sub2_sub4_sub2_2.ID = i1;
  10280. class30_sub2_sub4_sub2_2.anInt1559 = j14;
  10281. if(groundArray[plane][k6][j9] == null)
  10282. groundArray[plane][k6][j9] = new NodeList();
  10283. groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
  10284. spawnGroundItem(k6, j9);
  10285. }
  10286. return;
  10287. }
  10288. if(j == 156)
  10289. {
  10290. int j1 = stream.method426();
  10291. int i4 = anInt1268 + (j1 >> 4 & 7);
  10292. int l6 = anInt1269 + (j1 & 7);
  10293. int k9 = stream.readUnsignedWord();
  10294. if(i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104)
  10295. {
  10296. NodeList class19 = groundArray[plane][i4][l6];
  10297. if(class19 != null)
  10298. {
  10299. for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  10300. {
  10301. if(item.ID != (k9 & 0x7fff))
  10302. continue;
  10303. item.unlink();
  10304. break;
  10305. }
  10306.  
  10307. if(class19.reverseGetFirst() == null)
  10308. groundArray[plane][i4][l6] = null;
  10309. spawnGroundItem(i4, l6);
  10310. }
  10311. }
  10312. return;
  10313. }
  10314. if(j == 160)
  10315. {
  10316. int k1 = stream.method428();
  10317. int j4 = anInt1268 + (k1 >> 4 & 7);
  10318. int i7 = anInt1269 + (k1 & 7);
  10319. int l9 = stream.method428();
  10320. int j12 = l9 >> 2;
  10321. int k14 = l9 & 3;
  10322. int j16 = anIntArray1177[j12];
  10323. int j17 = stream.method435();
  10324. if(j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103)
  10325. {
  10326. int j18 = intGroundArray[plane][j4][i7];
  10327. int i19 = intGroundArray[plane][j4 + 1][i7];
  10328. int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
  10329. int k20 = intGroundArray[plane][j4][i7 + 1];
  10330. if(j16 == 0)
  10331. {
  10332. Object1 class10 = worldController.method296(plane, j4, i7);
  10333. if(class10 != null)
  10334. {
  10335. int k21 = class10.uid >> 14 & 0x7fff;
  10336. if(j12 == 2)
  10337. {
  10338. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, 4 + k14, 2, i19, l19, j18, k20, j17, false);
  10339. class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(k21, k14 + 1 & 3, 2, i19, l19, j18, k20, j17, false);
  10340. } else
  10341. {
  10342. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, k14, j12, i19, l19, j18, k20, j17, false);
  10343. }
  10344. }
  10345. }
  10346. if(j16 == 1)
  10347. {
  10348. Object2 class26 = worldController.method297(j4, i7, plane);
  10349. if(class26 != null)
  10350. class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(class26.uid >> 14 & 0x7fff, 0, 4, i19, l19, j18, k20, j17, false);
  10351. }
  10352. if(j16 == 2)
  10353. {
  10354. Object5 class28 = worldController.method298(j4, i7, plane);
  10355. if(j12 == 11)
  10356. j12 = 10;
  10357. if(class28 != null)
  10358. class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(class28.uid >> 14 & 0x7fff, k14, j12, i19, l19, j18, k20, j17, false);
  10359. }
  10360. if(j16 == 3)
  10361. {
  10362. Object3 class49 = worldController.method299(i7, j4, plane);
  10363. if(class49 != null)
  10364. class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(class49.uid >> 14 & 0x7fff, k14, 22, i19, l19, j18, k20, j17, false);
  10365. }
  10366. }
  10367. return;
  10368. }
  10369. if(j == 147)
  10370. {
  10371. int l1 = stream.method428();
  10372. int k4 = anInt1268 + (l1 >> 4 & 7);
  10373. int j7 = anInt1269 + (l1 & 7);
  10374. int i10 = stream.readUnsignedWord();
  10375. byte byte0 = stream.method430();
  10376. int l14 = stream.method434();
  10377. byte byte1 = stream.method429();
  10378. int k17 = stream.readUnsignedWord();
  10379. int k18 = stream.method428();
  10380. int j19 = k18 >> 2;
  10381. int i20 = k18 & 3;
  10382. int l20 = anIntArray1177[j19];
  10383. byte byte2 = stream.readSignedByte();
  10384. int l21 = stream.readUnsignedWord();
  10385. byte byte3 = stream.method429();
  10386. Player player;
  10387. if(i10 == unknownInt10)
  10388. player = myPlayer;
  10389. else
  10390. player = playerArray[i10];
  10391. if(player != null)
  10392. {
  10393. ObjectDef class46 = ObjectDef.forID(l21);
  10394. int i22 = intGroundArray[plane][k4][j7];
  10395. int j22 = intGroundArray[plane][k4 + 1][j7];
  10396. int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
  10397. int l22 = intGroundArray[plane][k4][j7 + 1];
  10398. Model model = class46.method578(j19, i20, i22, j22, k22, l22, -1);
  10399. if(model != null)
  10400. {
  10401. method130(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
  10402. player.anInt1707 = l14 + loopCycle;
  10403. player.anInt1708 = k17 + loopCycle;
  10404. player.aModel_1714 = model;
  10405. int i23 = class46.anInt744;
  10406. int j23 = class46.anInt761;
  10407. if(i20 == 1 || i20 == 3)
  10408. {
  10409. i23 = class46.anInt761;
  10410. j23 = class46.anInt744;
  10411. }
  10412. player.anInt1711 = k4 * 128 + i23 * 64;
  10413. player.anInt1713 = j7 * 128 + j23 * 64;
  10414. player.anInt1712 = method42(plane, player.anInt1713, player.anInt1711);
  10415. if(byte2 > byte0)
  10416. {
  10417. byte byte4 = byte2;
  10418. byte2 = byte0;
  10419. byte0 = byte4;
  10420. }
  10421. if(byte3 > byte1)
  10422. {
  10423. byte byte5 = byte3;
  10424. byte3 = byte1;
  10425. byte1 = byte5;
  10426. }
  10427. player.anInt1719 = k4 + byte2;
  10428. player.anInt1721 = k4 + byte0;
  10429. player.anInt1720 = j7 + byte3;
  10430. player.anInt1722 = j7 + byte1;
  10431. }
  10432. }
  10433. }
  10434. if(j == 151)
  10435. {
  10436. int i2 = stream.method426();
  10437. int l4 = anInt1268 + (i2 >> 4 & 7);
  10438. int k7 = anInt1269 + (i2 & 7);
  10439. int j10 = stream.method434();
  10440. int k12 = stream.method428();
  10441. int i15 = k12 >> 2;
  10442. int k16 = k12 & 3;
  10443. int l17 = anIntArray1177[i15];
  10444. if(l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104)
  10445. method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
  10446. return;
  10447. }
  10448. if(j == 4)
  10449. {
  10450. int j2 = stream.readUnsignedByte();
  10451. int i5 = anInt1268 + (j2 >> 4 & 7);
  10452. int l7 = anInt1269 + (j2 & 7);
  10453. int k10 = stream.readUnsignedWord();
  10454. int l12 = stream.readUnsignedByte();
  10455. int j15 = stream.readUnsignedWord();
  10456. if(i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104)
  10457. {
  10458. i5 = i5 * 128 + 64;
  10459. l7 = l7 * 128 + 64;
  10460. Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane, loopCycle, j15, k10, method42(plane, l7, i5) - l12, l7, i5);
  10461. aClass19_1056.insertHead(class30_sub2_sub4_sub3);
  10462. }
  10463. return;
  10464. }
  10465. if(j == 44)
  10466. {
  10467. int k2 = stream.method436();
  10468. int j5 = stream.readUnsignedWord();
  10469. int i8 = stream.readUnsignedByte();
  10470. int l10 = anInt1268 + (i8 >> 4 & 7);
  10471. int i13 = anInt1269 + (i8 & 7);
  10472. if(l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104)
  10473. {
  10474. Item class30_sub2_sub4_sub2_1 = new Item();
  10475. class30_sub2_sub4_sub2_1.ID = k2;
  10476. class30_sub2_sub4_sub2_1.anInt1559 = j5;
  10477. if(groundArray[plane][l10][i13] == null)
  10478. groundArray[plane][l10][i13] = new NodeList();
  10479. groundArray[plane][l10][i13].insertHead(class30_sub2_sub4_sub2_1);
  10480. spawnGroundItem(l10, i13);
  10481. }
  10482. return;
  10483. }
  10484. if(j == 101)
  10485. {
  10486. int l2 = stream.method427();
  10487. int k5 = l2 >> 2;
  10488. int j8 = l2 & 3;
  10489. int i11 = anIntArray1177[k5];
  10490. int j13 = stream.readUnsignedByte();
  10491. int k15 = anInt1268 + (j13 >> 4 & 7);
  10492. int l16 = anInt1269 + (j13 & 7);
  10493. if(k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
  10494. method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
  10495. return;
  10496. }
  10497. if(j == 117)
  10498. {
  10499. int i3 = stream.readUnsignedByte();
  10500. int l5 = anInt1268 + (i3 >> 4 & 7);
  10501. int k8 = anInt1269 + (i3 & 7);
  10502. int j11 = l5 + stream.readSignedByte();
  10503. int k13 = k8 + stream.readSignedByte();
  10504. int l15 = stream.readSignedWord();
  10505. int i17 = stream.readUnsignedWord();
  10506. int i18 = stream.readUnsignedByte() * 4;
  10507. int l18 = stream.readUnsignedByte() * 4;
  10508. int k19 = stream.readUnsignedWord();
  10509. int j20 = stream.readUnsignedWord();
  10510. int i21 = stream.readUnsignedByte();
  10511. int j21 = stream.readUnsignedByte();
  10512. if(l5 >= 0 && k8 >= 0 && l5 < 104 && k8 < 104 && j11 >= 0 && k13 >= 0 && j11 < 104 && k13 < 104 && i17 != 65535)
  10513. {
  10514. l5 = l5 * 128 + 64;
  10515. k8 = k8 * 128 + 64;
  10516. j11 = j11 * 128 + 64;
  10517. k13 = k13 * 128 + 64;
  10518. 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);
  10519. class30_sub2_sub4_sub4.method455(k19 + loopCycle, k13, method42(plane, k13, j11) - l18, j11);
  10520. aClass19_1013.insertHead(class30_sub2_sub4_sub4);
  10521. }
  10522. }
  10523. }
  10524.  
  10525. private static void setLowMem()
  10526. {
  10527. WorldController.lowMem = true;
  10528. Texture.lowMem = true;
  10529. lowMem = true;
  10530. ObjectManager.lowMem = true;
  10531. ObjectDef.lowMem = true;
  10532. }
  10533.  
  10534. private void method139(Stream stream)
  10535. {
  10536. stream.initBitAccess();
  10537. int k = stream.readBits(8);
  10538. if(k < npcCount)
  10539. {
  10540. for(int l = k; l < npcCount; l++)
  10541. anIntArray840[anInt839++] = npcIndices[l];
  10542.  
  10543. }
  10544. if(k > npcCount)
  10545. {
  10546. signlink.reporterror(myUsername + " Too many npcs");
  10547. throw new RuntimeException("eek");
  10548. }
  10549. npcCount = 0;
  10550. for(int i1 = 0; i1 < k; i1++)
  10551. {
  10552. int j1 = npcIndices[i1];
  10553. NPC npc = npcArray[j1];
  10554. int k1 = stream.readBits(1);
  10555. if(k1 == 0)
  10556. {
  10557. npcIndices[npcCount++] = j1;
  10558. npc.anInt1537 = loopCycle;
  10559. } else
  10560. {
  10561. int l1 = stream.readBits(2);
  10562. if(l1 == 0)
  10563. {
  10564. npcIndices[npcCount++] = j1;
  10565. npc.anInt1537 = loopCycle;
  10566. anIntArray894[anInt893++] = j1;
  10567. } else
  10568. if(l1 == 1)
  10569. {
  10570. npcIndices[npcCount++] = j1;
  10571. npc.anInt1537 = loopCycle;
  10572. int i2 = stream.readBits(3);
  10573. npc.moveInDir(false, i2);
  10574. int k2 = stream.readBits(1);
  10575. if(k2 == 1)
  10576. anIntArray894[anInt893++] = j1;
  10577. } else
  10578. if(l1 == 2)
  10579. {
  10580. npcIndices[npcCount++] = j1;
  10581. npc.anInt1537 = loopCycle;
  10582. int j2 = stream.readBits(3);
  10583. npc.moveInDir(true, j2);
  10584. int l2 = stream.readBits(3);
  10585. npc.moveInDir(true, l2);
  10586. int i3 = stream.readBits(1);
  10587. if(i3 == 1)
  10588. anIntArray894[anInt893++] = j1;
  10589. } else
  10590. if(l1 == 3)
  10591. anIntArray840[anInt839++] = j1;
  10592. }
  10593. }
  10594.  
  10595. }
  10596.  
  10597. private void processLoginScreenInput()
  10598. {
  10599. if(loginScreenState == 0)
  10600. {
  10601. int i = super.myWidth / 2 - 80;
  10602. int l = super.myHeight / 2 + 20;
  10603. l += 20;
  10604. if(super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20)
  10605. {
  10606. loginScreenState = 3;
  10607. loginScreenCursorPos = 0;
  10608. }
  10609. i = super.myWidth / 2 + 80;
  10610. if(super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20)
  10611. {
  10612. loginMessage1 = "";
  10613. loginMessage2 = "Enter your username & password.";
  10614. loginScreenState = 2;
  10615. loginScreenCursorPos = 0;
  10616. }
  10617. } else
  10618. {
  10619. if(loginScreenState == 2)
  10620. {
  10621. int j = super.myHeight / 2 - 40;
  10622. j += 30;
  10623. j += 25;
  10624. if(super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  10625. loginScreenCursorPos = 0;
  10626. j += 15;
  10627. if(super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  10628. loginScreenCursorPos = 1;
  10629. j += 15;
  10630. int i1 = super.myWidth / 2 - 80;
  10631. int k1 = super.myHeight / 2 + 50;
  10632. k1 += 20;
  10633. if(super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20)
  10634. {
  10635. loginFailures = 0;
  10636. login(myUsername, myPassword, false);
  10637. if(loggedIn)
  10638. return;
  10639. }
  10640. i1 = super.myWidth / 2 + 80;
  10641. if(super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20)
  10642. {
  10643. loginScreenState = 0;
  10644. // myUsername = "";
  10645. // myPassword = "";
  10646. }
  10647. do
  10648. {
  10649. int l1 = readChar(-796);
  10650. if(l1 == -1)
  10651. break;
  10652. boolean flag1 = false;
  10653. for(int i2 = 0; i2 < validUserPassChars.length(); i2++)
  10654. {
  10655. if(l1 != validUserPassChars.charAt(i2))
  10656. continue;
  10657. flag1 = true;
  10658. break;
  10659. }
  10660.  
  10661. if(loginScreenCursorPos == 0)
  10662. {
  10663. if(l1 == 8 && myUsername.length() > 0)
  10664. myUsername = myUsername.substring(0, myUsername.length() - 1);
  10665. if(l1 == 9 || l1 == 10 || l1 == 13)
  10666. loginScreenCursorPos = 1;
  10667. if(flag1)
  10668. myUsername += (char)l1;
  10669. if(myUsername.length() > 12)
  10670. myUsername = myUsername.substring(0, 12);
  10671. } else
  10672. if(loginScreenCursorPos == 1)
  10673. {
  10674. if(l1 == 8 && myPassword.length() > 0)
  10675. myPassword = myPassword.substring(0, myPassword.length() - 1);
  10676. if(l1 == 9 || l1 == 10 || l1 == 13)
  10677. loginScreenCursorPos = 0;
  10678. if(flag1)
  10679. myPassword += (char)l1;
  10680. if(myPassword.length() > 20)
  10681. myPassword = myPassword.substring(0, 20);
  10682. }
  10683. } while(true);
  10684. return;
  10685. }
  10686. if(loginScreenState == 3)
  10687. {
  10688. int k = super.myWidth / 2;
  10689. int j1 = super.myHeight / 2 + 50;
  10690. j1 += 20;
  10691. if(super.clickMode3 == 1 && super.saveClickX >= k - 75 && super.saveClickX <= k + 75 && super.saveClickY >= j1 - 20 && super.saveClickY <= j1 + 20)
  10692. loginScreenState = 0;
  10693. }
  10694. }
  10695. }
  10696.  
  10697. private void markMinimap(Sprite sprite, int i, int j)
  10698. {
  10699. int k = minimapInt1 + minimapInt2 & 0x7ff;
  10700. int l = i * i + j * j;
  10701. if(l > 6400)
  10702. return;
  10703. int i1 = Model.modelIntArray1[k];
  10704. int j1 = Model.modelIntArray2[k];
  10705. i1 = (i1 * 256) / (minimapInt3 + 256);
  10706. j1 = (j1 * 256) / (minimapInt3 + 256);
  10707. int k1 = j * i1 + i * j1 >> 16;
  10708. int l1 = j * j1 - i * i1 >> 16;
  10709. if(l > 2500) {
  10710. sprite.drawSprite(((94 + k1) - sprite.anInt1444 / 2) + 4 + 20, 83 - l1 - sprite.anInt1445 / 2 - 4 + 5);
  10711. } else {
  10712. sprite.drawSprite(((94 + k1) - sprite.anInt1444 / 2) + 4 + 20, 83 - l1 - sprite.anInt1445 / 2 - 4 + 5);
  10713. }
  10714. }
  10715.  
  10716. private void method142(int i, int j, int k, int l, int i1, int j1, int k1
  10717. )
  10718. {
  10719. if(i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102)
  10720. {
  10721. if(lowMem && j != plane)
  10722. return;
  10723. int i2 = 0;
  10724. if(j1 == 0)
  10725. i2 = worldController.method300(j, i1, i);
  10726. if(j1 == 1)
  10727. i2 = worldController.method301(j, i1, i);
  10728. if(j1 == 2)
  10729. i2 = worldController.method302(j, i1, i);
  10730. if(j1 == 3)
  10731. i2 = worldController.method303(j, i1, i);
  10732. if(i2 != 0)
  10733. {
  10734. int i3 = worldController.method304(j, i1, i, i2);
  10735. int j2 = i2 >> 14 & 0x7fff;
  10736. int k2 = i3 & 0x1f;
  10737. int l2 = i3 >> 6;
  10738. if(j1 == 0)
  10739. {
  10740. worldController.method291(i1, j, i, (byte)-119);
  10741. ObjectDef class46 = ObjectDef.forID(j2);
  10742. if(class46.aBoolean767)
  10743. aClass11Array1230[j].method215(l2, k2, class46.aBoolean757, i1, i);
  10744. }
  10745. if(j1 == 1)
  10746. worldController.method292(i, j, i1);
  10747. if(j1 == 2)
  10748. {
  10749. worldController.method293(j, i1, i);
  10750. ObjectDef class46_1 = ObjectDef.forID(j2);
  10751. if(i1 + class46_1.anInt744 > 103 || i + class46_1.anInt744 > 103 || i1 + class46_1.anInt761 > 103 || i + class46_1.anInt761 > 103)
  10752. return;
  10753. if(class46_1.aBoolean767)
  10754. aClass11Array1230[j].method216(l2, class46_1.anInt744, i1, i, class46_1.anInt761, class46_1.aBoolean757);
  10755. }
  10756. if(j1 == 3)
  10757. {
  10758. worldController.method294(j, i, i1);
  10759. ObjectDef class46_2 = ObjectDef.forID(j2);
  10760. if(class46_2.aBoolean767 && class46_2.hasActions)
  10761. aClass11Array1230[j].method218(i, i1);
  10762. }
  10763. }
  10764. if(k1 >= 0)
  10765. {
  10766. int j3 = j;
  10767. if(j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
  10768. j3++;
  10769. ObjectManager.method188(worldController, k, i, l, j3, aClass11Array1230[j], intGroundArray, i1, k1, j);
  10770. }
  10771. }
  10772. }
  10773.  
  10774. private void updatePlayers(int i, Stream stream)
  10775. {
  10776. anInt839 = 0;
  10777. anInt893 = 0;
  10778. method117(stream);
  10779. method134(stream);
  10780. method91(stream, i);
  10781. method49(stream);
  10782. for(int k = 0; k < anInt839; k++)
  10783. {
  10784. int l = anIntArray840[k];
  10785. if(playerArray[l].anInt1537 != loopCycle)
  10786. playerArray[l] = null;
  10787. }
  10788.  
  10789. if(stream.currentOffset != i)
  10790. {
  10791. signlink.reporterror("Error packet size mismatch in getplayer pos:" + stream.currentOffset + " psize:" + i);
  10792. throw new RuntimeException("eek");
  10793. }
  10794. for(int i1 = 0; i1 < playerCount; i1++)
  10795. if(playerArray[playerIndices[i1]] == null)
  10796. {
  10797. signlink.reporterror(myUsername + " null entry in pl list - pos:" + i1 + " size:" + playerCount);
  10798. throw new RuntimeException("eek");
  10799. }
  10800.  
  10801. }
  10802.  
  10803. private void setCameraPos(int j, int k, int l, int i1, int j1, int k1)
  10804. {
  10805. int l1 = 2048 - k & 0x7ff;
  10806. int i2 = 2048 - j1 & 0x7ff;
  10807. int j2 = 0;
  10808. int k2 = 0;
  10809. int l2 = j;
  10810. if(l1 != 0)
  10811. {
  10812. int i3 = Model.modelIntArray1[l1];
  10813. int k3 = Model.modelIntArray2[l1];
  10814. int i4 = k2 * k3 - l2 * i3 >> 16;
  10815. l2 = k2 * i3 + l2 * k3 >> 16;
  10816. k2 = i4;
  10817. }
  10818. if(i2 != 0)
  10819. {
  10820. /* xxx if(cameratoggle){
  10821. if(zoom == 0)
  10822. zoom = k2;
  10823. if(lftrit == 0)
  10824. lftrit = j2;
  10825. if(fwdbwd == 0)
  10826. fwdbwd = l2;
  10827. k2 = zoom;
  10828. j2 = lftrit;
  10829. l2 = fwdbwd;
  10830. }
  10831. */
  10832. int j3 = Model.modelIntArray1[i2];
  10833. int l3 = Model.modelIntArray2[i2];
  10834. int j4 = l2 * j3 + j2 * l3 >> 16;
  10835. l2 = l2 * l3 - j2 * j3 >> 16;
  10836. j2 = j4;
  10837. }
  10838. xCameraPos = l - j2;
  10839. zCameraPos = i1 - k2;
  10840. yCameraPos = k1 - l2;
  10841. yCameraCurve = k;
  10842. xCameraCurve = j1;
  10843. }
  10844.  
  10845. private boolean parsePacket()
  10846. {
  10847. if(socketStream == null)
  10848. return false;
  10849. try
  10850. {
  10851. int i = socketStream.available();
  10852. if(i == 0)
  10853. return false;
  10854. if(pktType == -1)
  10855. {
  10856. socketStream.flushInputStream(inStream.buffer, 1);
  10857. pktType = inStream.buffer[0] & 0xff;
  10858. if(encryption != null)
  10859. pktType = pktType - encryption.getNextKey() & 0xff;
  10860. pktSize = SizeConstants.packetSizes[pktType];
  10861. i--;
  10862. }
  10863. if(pktSize == -1)
  10864. if(i > 0)
  10865. {
  10866. socketStream.flushInputStream(inStream.buffer, 1);
  10867. pktSize = inStream.buffer[0] & 0xff;
  10868. i--;
  10869. } else
  10870. {
  10871. return false;
  10872. }
  10873. if(pktSize == -2)
  10874. if(i > 1)
  10875. {
  10876. socketStream.flushInputStream(inStream.buffer, 2);
  10877. inStream.currentOffset = 0;
  10878. pktSize = inStream.readUnsignedWord();
  10879. i -= 2;
  10880. } else
  10881. {
  10882. return false;
  10883. }
  10884. if(i < pktSize)
  10885. return false;
  10886. inStream.currentOffset = 0;
  10887. socketStream.flushInputStream(inStream.buffer, pktSize);
  10888. anInt1009 = 0;
  10889. anInt843 = anInt842;
  10890. anInt842 = anInt841;
  10891. anInt841 = pktType;
  10892. if(pktType == 81)
  10893. {
  10894. updatePlayers(pktSize, inStream);
  10895. aBoolean1080 = false;
  10896. pktType = -1;
  10897. return true;
  10898. }
  10899. if(pktType == 176)
  10900. {
  10901. daysSinceRecovChange = inStream.method427();
  10902. unreadMessages = inStream.method435();
  10903. membersInt = inStream.readUnsignedByte();
  10904. anInt1193 = inStream.method440();
  10905. daysSinceLastLogin = inStream.readUnsignedWord();
  10906. if(anInt1193 != 0 && openInterfaceID == -1)
  10907. {
  10908. signlink.dnslookup(TextClass.method586(anInt1193));
  10909. clearTopInterfaces();
  10910. char c = '\u028A';
  10911. if(daysSinceRecovChange != 201 || membersInt == 1)
  10912. c = '\u028F';
  10913. reportAbuseInput = "";
  10914. canMute = false;
  10915. for(int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++)
  10916. {
  10917. if(RSInterface.interfaceCache[k9] == null || RSInterface.interfaceCache[k9].contentType != c)
  10918. continue;
  10919. openInterfaceID = RSInterface.interfaceCache[k9].parentID;
  10920. break;
  10921. }
  10922.  
  10923. }
  10924. pktType = -1;
  10925. return true;
  10926. }
  10927. if(pktType == 64)
  10928. {
  10929. anInt1268 = inStream.method427();
  10930. anInt1269 = inStream.method428();
  10931. for(int j = anInt1268; j < anInt1268 + 8; j++)
  10932. {
  10933. for(int l9 = anInt1269; l9 < anInt1269 + 8; l9++)
  10934. if(groundArray[plane][j][l9] != null)
  10935. {
  10936. groundArray[plane][j][l9] = null;
  10937. spawnGroundItem(j, l9);
  10938. }
  10939.  
  10940. }
  10941.  
  10942. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  10943. if(class30_sub1.anInt1297 >= anInt1268 && class30_sub1.anInt1297 < anInt1268 + 8 && class30_sub1.anInt1298 >= anInt1269 && class30_sub1.anInt1298 < anInt1269 + 8 && class30_sub1.anInt1295 == plane)
  10944. class30_sub1.anInt1294 = 0;
  10945.  
  10946. pktType = -1;
  10947. return true;
  10948. }
  10949. if(pktType == 185)
  10950. {
  10951. int k = inStream.method436();
  10952. RSInterface.interfaceCache[k].anInt233 = 3;
  10953. if(myPlayer.desc == null)
  10954. 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];
  10955. else
  10956. RSInterface.interfaceCache[k].mediaID = (int)(0x12345678L + myPlayer.desc.type);
  10957. pktType = -1;
  10958. return true;
  10959. }
  10960. if(pktType == 107)
  10961. {
  10962. aBoolean1160 = false;
  10963. for(int l = 0; l < 5; l++)
  10964. aBooleanArray876[l] = false;
  10965.  
  10966. pktType = -1;
  10967. return true;
  10968. }
  10969. if(pktType == 72)
  10970. {
  10971. int i1 = inStream.method434();
  10972. RSInterface class9 = RSInterface.interfaceCache[i1];
  10973. for(int k15 = 0; k15 < class9.inv.length; k15++)
  10974. {
  10975. class9.inv[k15] = -1;
  10976. class9.inv[k15] = 0;
  10977. }
  10978.  
  10979. pktType = -1;
  10980. return true;
  10981. }
  10982. if(pktType == 214)
  10983. {
  10984. ignoreCount = pktSize / 8;
  10985. for(int j1 = 0; j1 < ignoreCount; j1++)
  10986. ignoreListAsLongs[j1] = inStream.readQWord();
  10987.  
  10988. pktType = -1;
  10989. return true;
  10990. }
  10991. if(pktType == 166)
  10992. {
  10993. aBoolean1160 = true;
  10994. anInt1098 = inStream.readUnsignedByte();
  10995. anInt1099 = inStream.readUnsignedByte();
  10996. anInt1100 = inStream.readUnsignedWord();
  10997. anInt1101 = inStream.readUnsignedByte();
  10998. anInt1102 = inStream.readUnsignedByte();
  10999. if(anInt1102 >= 100)
  11000. {
  11001. xCameraPos = anInt1098 * 128 + 64;
  11002. yCameraPos = anInt1099 * 128 + 64;
  11003. zCameraPos = method42(plane, yCameraPos, xCameraPos) - anInt1100;
  11004. }
  11005. pktType = -1;
  11006. return true;
  11007. }
  11008. if(pktType == 134)
  11009. {
  11010. needDrawTabArea = true;
  11011. int k1 = inStream.readUnsignedByte();
  11012. int i10 = inStream.method439();
  11013. int l15 = inStream.readUnsignedByte();
  11014. currentExp[k1] = i10;
  11015. currentStats[k1] = l15;
  11016. maxStats[k1] = 1;
  11017. for(int k20 = 0; k20 < 98; k20++)
  11018. if(i10 >= anIntArray1019[k20])
  11019. maxStats[k1] = k20 + 2;
  11020.  
  11021. pktType = -1;
  11022. return true;
  11023. }
  11024. if(pktType == 71)
  11025. {
  11026. int l1 = inStream.readUnsignedWord();
  11027. int j10 = inStream.method426();
  11028. if(l1 == 65535)
  11029. l1 = -1;
  11030. tabInterfaceIDs[j10] = l1;
  11031. needDrawTabArea = true;
  11032. tabAreaAltered = true;
  11033. pktType = -1;
  11034. return true;
  11035. }
  11036. if(pktType == 74)
  11037. {
  11038. int i2 = inStream.method434();
  11039. if(i2 == 65535)
  11040. i2 = -1;
  11041. if(i2 != currentSong && musicEnabled && !lowMem && prevSong == 0)
  11042. {
  11043. nextSong = i2;
  11044. songChanging = true;
  11045. onDemandFetcher.method558(2, nextSong);
  11046. }
  11047. currentSong = i2;
  11048. pktType = -1;
  11049. return true;
  11050. }
  11051. if(pktType == 121)
  11052. {
  11053. int j2 = inStream.method436();
  11054. int k10 = inStream.method435();
  11055. if(musicEnabled && !lowMem)
  11056. {
  11057. nextSong = j2;
  11058. songChanging = false;
  11059. onDemandFetcher.method558(2, nextSong);
  11060. prevSong = k10;
  11061. }
  11062. pktType = -1;
  11063. return true;
  11064. }
  11065. if(pktType == 109)
  11066. {
  11067. resetLogout();
  11068. pktType = -1;
  11069. return false;
  11070. }
  11071. if(pktType == 70)
  11072. {
  11073. int k2 = inStream.readSignedWord();
  11074. int l10 = inStream.method437();
  11075. int i16 = inStream.method434();
  11076. RSInterface class9_5 = RSInterface.interfaceCache[i16];
  11077. class9_5.anInt263 = k2;
  11078. class9_5.anInt265 = l10;
  11079. pktType = -1;
  11080. return true;
  11081. }
  11082. if(pktType == 73 || pktType == 241)
  11083. {
  11084.  
  11085. //mapReset();
  11086. int l2 = anInt1069;
  11087. int i11 = anInt1070;
  11088. if(pktType == 73)
  11089. {
  11090. l2 = inStream.method435();
  11091. i11 = inStream.readUnsignedWord();
  11092. aBoolean1159 = false;
  11093. }
  11094. if(pktType == 241)
  11095. {
  11096. i11 = inStream.method435();
  11097. inStream.initBitAccess();
  11098. for(int j16 = 0; j16 < 4; j16++)
  11099. {
  11100. for(int l20 = 0; l20 < 13; l20++)
  11101. {
  11102. for(int j23 = 0; j23 < 13; j23++)
  11103. {
  11104. int i26 = inStream.readBits(1);
  11105. if(i26 == 1)
  11106. anIntArrayArrayArray1129[j16][l20][j23] = inStream.readBits(26);
  11107. else
  11108. anIntArrayArrayArray1129[j16][l20][j23] = -1;
  11109. }
  11110.  
  11111. }
  11112.  
  11113. }
  11114.  
  11115. inStream.finishBitAccess();
  11116. l2 = inStream.readUnsignedWord();
  11117. aBoolean1159 = true;
  11118. }
  11119. if(anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2)
  11120. {
  11121. pktType = -1;
  11122. return true;
  11123. }
  11124. anInt1069 = l2;
  11125. anInt1070 = i11;
  11126. baseX = (anInt1069 - 6) * 8;
  11127. baseY = (anInt1070 - 6) * 8;
  11128. aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49) && anInt1070 / 8 == 48;
  11129. if(anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
  11130. aBoolean1141 = true;
  11131. loadingStage = 1;
  11132. aLong824 = System.currentTimeMillis();
  11133. aRSImageProducer_1165.initDrawingArea();
  11134. aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151, 257);
  11135. aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.", 150, 256);
  11136. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  11137. if(pktType == 73)
  11138. {
  11139. int k16 = 0;
  11140. for(int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++)
  11141. {
  11142. for(int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
  11143. k16++;
  11144.  
  11145. }
  11146.  
  11147. aByteArrayArray1183 = new byte[k16][];
  11148. aByteArrayArray1247 = new byte[k16][];
  11149. anIntArray1234 = new int[k16];
  11150. anIntArray1235 = new int[k16];
  11151. anIntArray1236 = new int[k16];
  11152. k16 = 0;
  11153. for(int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++)
  11154. {
  11155. for(int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++)
  11156. {
  11157. anIntArray1234[k16] = (l23 << 8) + j26;
  11158. if(aBoolean1141 && (j26 == 49 || j26 == 149 || j26 == 147 || l23 == 50 || l23 == 49 && j26 == 47))
  11159. {
  11160. anIntArray1235[k16] = -1;
  11161. anIntArray1236[k16] = -1;
  11162. k16++;
  11163. } else
  11164. {
  11165. int k28 = anIntArray1235[k16] = onDemandFetcher.method562(0, j26, l23);
  11166. if(k28 != -1)
  11167. onDemandFetcher.method558(3, k28);
  11168. int j30 = anIntArray1236[k16] = onDemandFetcher.method562(1, j26, l23);
  11169. if(j30 != -1)
  11170. onDemandFetcher.method558(3, j30);
  11171. k16++;
  11172. }
  11173. }
  11174.  
  11175. }
  11176.  
  11177. }
  11178. if(pktType == 241)
  11179. {
  11180. int l16 = 0;
  11181. int ai[] = new int[676];
  11182. for(int i24 = 0; i24 < 4; i24++)
  11183. {
  11184. for(int k26 = 0; k26 < 13; k26++)
  11185. {
  11186. for(int l28 = 0; l28 < 13; l28++)
  11187. {
  11188. int k30 = anIntArrayArrayArray1129[i24][k26][l28];
  11189. if(k30 != -1)
  11190. {
  11191. int k31 = k30 >> 14 & 0x3ff;
  11192. int i32 = k30 >> 3 & 0x7ff;
  11193. int k32 = (k31 / 8 << 8) + i32 / 8;
  11194. for(int j33 = 0; j33 < l16; j33++)
  11195. {
  11196. if(ai[j33] != k32)
  11197. continue;
  11198. k32 = -1;
  11199. break;
  11200. }
  11201.  
  11202. if(k32 != -1)
  11203. ai[l16++] = k32;
  11204. }
  11205. }
  11206.  
  11207. }
  11208.  
  11209. }
  11210.  
  11211. aByteArrayArray1183 = new byte[l16][];
  11212. aByteArrayArray1247 = new byte[l16][];
  11213. anIntArray1234 = new int[l16];
  11214. anIntArray1235 = new int[l16];
  11215. anIntArray1236 = new int[l16];
  11216. for(int l26 = 0; l26 < l16; l26++)
  11217. {
  11218. int i29 = anIntArray1234[l26] = ai[l26];
  11219. int l30 = i29 >> 8 & 0xff;
  11220. int l31 = i29 & 0xff;
  11221. int j32 = anIntArray1235[l26] = onDemandFetcher.method562(0, l31, l30);
  11222. if(j32 != -1)
  11223. onDemandFetcher.method558(3, j32);
  11224. int i33 = anIntArray1236[l26] = onDemandFetcher.method562(1, l31, l30);
  11225. if(i33 != -1)
  11226. onDemandFetcher.method558(3, i33);
  11227. }
  11228.  
  11229. }
  11230. int i17 = baseX - anInt1036;
  11231. int j21 = baseY - anInt1037;
  11232. anInt1036 = baseX;
  11233. anInt1037 = baseY;
  11234. for(int j24 = 0; j24 < 16384; j24++)
  11235. {
  11236. NPC npc = npcArray[j24];
  11237. if(npc != null)
  11238. {
  11239. for(int j29 = 0; j29 < 10; j29++)
  11240. {
  11241. npc.smallX[j29] -= i17;
  11242. npc.smallY[j29] -= j21;
  11243. }
  11244.  
  11245. npc.x -= i17 * 128;
  11246. npc.y -= j21 * 128;
  11247. }
  11248. }
  11249.  
  11250. for(int i27 = 0; i27 < maxPlayers; i27++)
  11251. {
  11252. Player player = playerArray[i27];
  11253. if(player != null)
  11254. {
  11255. for(int i31 = 0; i31 < 10; i31++)
  11256. {
  11257. player.smallX[i31] -= i17;
  11258. player.smallY[i31] -= j21;
  11259. }
  11260.  
  11261. player.x -= i17 * 128;
  11262. player.y -= j21 * 128;
  11263. }
  11264. }
  11265.  
  11266. aBoolean1080 = true;
  11267. byte byte1 = 0;
  11268. byte byte2 = 104;
  11269. byte byte3 = 1;
  11270. if(i17 < 0)
  11271. {
  11272. byte1 = 103;
  11273. byte2 = -1;
  11274. byte3 = -1;
  11275. }
  11276. byte byte4 = 0;
  11277. byte byte5 = 104;
  11278. byte byte6 = 1;
  11279. if(j21 < 0)
  11280. {
  11281. byte4 = 103;
  11282. byte5 = -1;
  11283. byte6 = -1;
  11284. }
  11285. for(int k33 = byte1; k33 != byte2; k33 += byte3)
  11286. {
  11287. for(int l33 = byte4; l33 != byte5; l33 += byte6)
  11288. {
  11289. int i34 = k33 + i17;
  11290. int j34 = l33 + j21;
  11291. for(int k34 = 0; k34 < 4; k34++)
  11292. if(i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
  11293. groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
  11294. else
  11295. groundArray[k34][k33][l33] = null;
  11296.  
  11297. }
  11298.  
  11299. }
  11300.  
  11301. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  11302. {
  11303. class30_sub1_1.anInt1297 -= i17;
  11304. class30_sub1_1.anInt1298 -= j21;
  11305. if(class30_sub1_1.anInt1297 < 0 || class30_sub1_1.anInt1298 < 0 || class30_sub1_1.anInt1297 >= 104 || class30_sub1_1.anInt1298 >= 104)
  11306. class30_sub1_1.unlink();
  11307. }
  11308.  
  11309. if(destX != 0)
  11310. {
  11311. destX -= i17;
  11312. destY -= j21;
  11313. }
  11314. aBoolean1160 = false;
  11315. pktType = -1;
  11316. return true;
  11317. }
  11318. if(pktType == 208)
  11319. {
  11320. int i3 = inStream.method437();
  11321. if(i3 >= 0)
  11322. method60(i3);
  11323. anInt1018 = i3;
  11324. pktType = -1;
  11325. return true;
  11326. }
  11327. if(pktType == 99)
  11328. {
  11329. anInt1021 = inStream.readUnsignedByte();
  11330. pktType = -1;
  11331. return true;
  11332. }
  11333. if(pktType == 75)
  11334. {
  11335. int j3 = inStream.method436();
  11336. int j11 = inStream.method436();
  11337. RSInterface.interfaceCache[j11].anInt233 = 2;
  11338. RSInterface.interfaceCache[j11].mediaID = j3;
  11339. pktType = -1;
  11340. return true;
  11341. }
  11342. if(pktType == 114)
  11343. {
  11344. anInt1104 = inStream.method434() * 30;
  11345. pktType = -1;
  11346. return true;
  11347. }
  11348. if(pktType == 60)
  11349. {
  11350. anInt1269 = inStream.readUnsignedByte();
  11351. anInt1268 = inStream.method427();
  11352. while(inStream.currentOffset < pktSize)
  11353. {
  11354. int k3 = inStream.readUnsignedByte();
  11355. method137(inStream, k3);
  11356. }
  11357. pktType = -1;
  11358. return true;
  11359. }
  11360. if(pktType == 35)
  11361. {
  11362. int l3 = inStream.readUnsignedByte();
  11363. int k11 = inStream.readUnsignedByte();
  11364. int j17 = inStream.readUnsignedByte();
  11365. int k21 = inStream.readUnsignedByte();
  11366. aBooleanArray876[l3] = true;
  11367. anIntArray873[l3] = k11;
  11368. anIntArray1203[l3] = j17;
  11369. anIntArray928[l3] = k21;
  11370. anIntArray1030[l3] = 0;
  11371. pktType = -1;
  11372. return true;
  11373. }
  11374. if(pktType == 174)
  11375. {
  11376. int i4 = inStream.readUnsignedWord();
  11377. int l11 = inStream.readUnsignedByte();
  11378. int k17 = inStream.readUnsignedWord();
  11379. if(aBoolean848 && !lowMem && anInt1062 < 50)
  11380. {
  11381. anIntArray1207[anInt1062] = i4;
  11382. anIntArray1241[anInt1062] = l11;
  11383. anIntArray1250[anInt1062] = k17 + Sounds.anIntArray326[i4];
  11384. anInt1062++;
  11385. }
  11386. pktType = -1;
  11387. return true;
  11388. }
  11389. if(pktType == 104)
  11390. {
  11391. int j4 = inStream.method427();
  11392. int i12 = inStream.method426();
  11393. String s6 = inStream.readString();
  11394. if(j4 >= 1 && j4 <= 5)
  11395. {
  11396. if(s6.equalsIgnoreCase("null"))
  11397. s6 = null;
  11398. atPlayerActions[j4 - 1] = s6;
  11399. atPlayerArray[j4 - 1] = i12 == 0;
  11400. }
  11401. pktType = -1;
  11402. return true;
  11403. }
  11404. if(pktType == 78)
  11405. {
  11406. destX = 0;
  11407. pktType = -1;
  11408. return true;
  11409. }
  11410. if(pktType == 253)
  11411. {
  11412. String s = inStream.readString();
  11413. if(s.endsWith(":tradereq:"))
  11414. {
  11415. String s3 = s.substring(0, s.indexOf(":"));
  11416. long l17 = TextClass.longForName(s3);
  11417. boolean flag2 = false;
  11418. for(int j27 = 0; j27 < ignoreCount; j27++)
  11419. {
  11420. if(ignoreListAsLongs[j27] != l17)
  11421. continue;
  11422. flag2 = true;
  11423. break;
  11424. }
  11425.  
  11426. if(!flag2 && anInt1251 == 0)
  11427. pushMessage("wishes to trade with you.", 4, s3);
  11428. } else
  11429. if(s.endsWith(":duelreq:"))
  11430. {
  11431. String s4 = s.substring(0, s.indexOf(":"));
  11432. long l18 = TextClass.longForName(s4);
  11433. boolean flag3 = false;
  11434. for(int k27 = 0; k27 < ignoreCount; k27++)
  11435. {
  11436. if(ignoreListAsLongs[k27] != l18)
  11437. continue;
  11438. flag3 = true;
  11439. break;
  11440. }
  11441.  
  11442. if(!flag3 && anInt1251 == 0)
  11443. pushMessage("wishes to duel with you.", 8, s4);
  11444. } else
  11445. if(s.endsWith(":chalreq:"))
  11446. {
  11447. String s5 = s.substring(0, s.indexOf(":"));
  11448. long l19 = TextClass.longForName(s5);
  11449. boolean flag4 = false;
  11450. for(int l27 = 0; l27 < ignoreCount; l27++)
  11451. {
  11452. if(ignoreListAsLongs[l27] != l19)
  11453. continue;
  11454. flag4 = true;
  11455. break;
  11456. }
  11457.  
  11458. if(!flag4 && anInt1251 == 0)
  11459. {
  11460. String s8 = s.substring(s.indexOf(":") + 1, s.length() - 9);
  11461. pushMessage(s8, 8, s5);
  11462. }
  11463. } else
  11464. {
  11465. pushMessage(s, 0, "");
  11466. }
  11467. pktType = -1;
  11468. //serverMessage(s);
  11469.  
  11470. return true;
  11471. }
  11472. if(pktType == 1)
  11473. {
  11474. for(int k4 = 0; k4 < playerArray.length; k4++)
  11475. if(playerArray[k4] != null)
  11476. playerArray[k4].anim = -1;
  11477.  
  11478. for(int j12 = 0; j12 < npcArray.length; j12++)
  11479. if(npcArray[j12] != null)
  11480. npcArray[j12].anim = -1;
  11481.  
  11482. pktType = -1;
  11483. return true;
  11484. }
  11485. if(pktType == 50)
  11486. {
  11487. long l4 = inStream.readQWord();
  11488. int i18 = inStream.readUnsignedByte();
  11489. String s7 = TextClass.fixName(TextClass.nameForLong(l4));
  11490. for(int k24 = 0; k24 < friendsCount; k24++)
  11491. {
  11492. if(l4 != friendsListAsLongs[k24])
  11493. continue;
  11494. if(friendsNodeIDs[k24] != i18)
  11495. {
  11496. friendsNodeIDs[k24] = i18;
  11497. needDrawTabArea = true;
  11498. if(i18 >= 2) {
  11499. pushMessage(s7 + " has logged in.", 5, "");
  11500. }
  11501. if(i18 <= 1) {
  11502. pushMessage(s7 + " has logged out.", 5, "");
  11503. }
  11504. }
  11505. s7 = null;
  11506. break;
  11507. }
  11508.  
  11509. if(s7 != null && friendsCount < 200)
  11510. {
  11511. friendsListAsLongs[friendsCount] = l4;
  11512. friendsList[friendsCount] = s7;
  11513. friendsNodeIDs[friendsCount] = i18;
  11514. friendsCount++;
  11515. needDrawTabArea = true;
  11516. }
  11517. for(boolean flag6 = false; !flag6;)
  11518. {
  11519. flag6 = true;
  11520. for(int k29 = 0; k29 < friendsCount - 1; k29++)
  11521. if(friendsNodeIDs[k29] != nodeID && friendsNodeIDs[k29 + 1] == nodeID || friendsNodeIDs[k29] == 0 && friendsNodeIDs[k29 + 1] != 0)
  11522. {
  11523. int j31 = friendsNodeIDs[k29];
  11524. friendsNodeIDs[k29] = friendsNodeIDs[k29 + 1];
  11525. friendsNodeIDs[k29 + 1] = j31;
  11526. String s10 = friendsList[k29];
  11527. friendsList[k29] = friendsList[k29 + 1];
  11528. friendsList[k29 + 1] = s10;
  11529. long l32 = friendsListAsLongs[k29];
  11530. friendsListAsLongs[k29] = friendsListAsLongs[k29 + 1];
  11531. friendsListAsLongs[k29 + 1] = l32;
  11532. needDrawTabArea = true;
  11533. flag6 = false;
  11534. }
  11535.  
  11536. }
  11537.  
  11538. pktType = -1;
  11539. return true;
  11540. }
  11541. if(pktType == 110)
  11542. {
  11543. if(tabID == 12)
  11544. needDrawTabArea = true;
  11545. energy = inStream.readUnsignedByte();
  11546. pktType = -1;
  11547. return true;
  11548. }
  11549. if(pktType == 254)
  11550. {
  11551. anInt855 = inStream.readUnsignedByte();
  11552. if(anInt855 == 1)
  11553. anInt1222 = inStream.readUnsignedWord();
  11554. if(anInt855 >= 2 && anInt855 <= 6)
  11555. {
  11556. if(anInt855 == 2)
  11557. {
  11558. anInt937 = 64;
  11559. anInt938 = 64;
  11560. }
  11561. if(anInt855 == 3)
  11562. {
  11563. anInt937 = 0;
  11564. anInt938 = 64;
  11565. }
  11566. if(anInt855 == 4)
  11567. {
  11568. anInt937 = 128;
  11569. anInt938 = 64;
  11570. }
  11571. if(anInt855 == 5)
  11572. {
  11573. anInt937 = 64;
  11574. anInt938 = 0;
  11575. }
  11576. if(anInt855 == 6)
  11577. {
  11578. anInt937 = 64;
  11579. anInt938 = 128;
  11580. }
  11581. anInt855 = 2;
  11582. anInt934 = inStream.readUnsignedWord();
  11583. anInt935 = inStream.readUnsignedWord();
  11584. anInt936 = inStream.readUnsignedByte();
  11585. }
  11586. if(anInt855 == 10)
  11587. anInt933 = inStream.readUnsignedWord();
  11588. pktType = -1;
  11589. return true;
  11590. }
  11591. if(pktType == 248)
  11592. {
  11593. int i5 = inStream.method435();
  11594. int k12 = inStream.readUnsignedWord();
  11595. if(backDialogID != -1)
  11596. {
  11597. backDialogID = -1;
  11598. inputTaken = true;
  11599. }
  11600. if(inputDialogState != 0)
  11601. {
  11602. inputDialogState = 0;
  11603. inputTaken = true;
  11604. }
  11605. openInterfaceID = i5;
  11606. invOverlayInterfaceID = k12;
  11607. needDrawTabArea = true;
  11608. tabAreaAltered = true;
  11609. aBoolean1149 = false;
  11610. pktType = -1;
  11611. return true;
  11612. }
  11613. if(pktType == 79)
  11614. {
  11615. int j5 = inStream.method434();
  11616. int l12 = inStream.method435();
  11617. RSInterface class9_3 = RSInterface.interfaceCache[j5];
  11618. if(class9_3 != null && class9_3.type == 0)
  11619. {
  11620. if(l12 < 0)
  11621. l12 = 0;
  11622. if(l12 > class9_3.scrollMax - class9_3.height)
  11623. l12 = class9_3.scrollMax - class9_3.height;
  11624. class9_3.scrollPosition = l12;
  11625. }
  11626. pktType = -1;
  11627. return true;
  11628. }
  11629. if(pktType == 68)
  11630. {
  11631. for(int k5 = 0; k5 < variousSettings.length; k5++)
  11632. if(variousSettings[k5] != anIntArray1045[k5])
  11633. {
  11634. variousSettings[k5] = anIntArray1045[k5];
  11635. method33(k5);
  11636. needDrawTabArea = true;
  11637. }
  11638.  
  11639. pktType = -1;
  11640. return true;
  11641. }
  11642. if(pktType == 196)
  11643. {
  11644. long l5 = inStream.readQWord();
  11645. int j18 = inStream.readDWord();
  11646. int l21 = inStream.readUnsignedByte();
  11647. boolean flag5 = false;
  11648. for(int i28 = 0; i28 < 100; i28++)
  11649. {
  11650. if(anIntArray1240[i28] != j18)
  11651. continue;
  11652. flag5 = true;
  11653. break;
  11654. }
  11655.  
  11656. if(l21 <= 1)
  11657. {
  11658. for(int l29 = 0; l29 < ignoreCount; l29++)
  11659. {
  11660. if(ignoreListAsLongs[l29] != l5)
  11661. continue;
  11662. flag5 = true;
  11663. break;
  11664. }
  11665.  
  11666. }
  11667. if(!flag5 && anInt1251 == 0)
  11668. try
  11669. {
  11670. anIntArray1240[anInt1169] = j18;
  11671. anInt1169 = (anInt1169 + 1) % 100;
  11672. String s9 = TextInput.method525(pktSize - 13, inStream);
  11673. if(l21 != 3)
  11674. s9 = Censor.doCensor(s9);
  11675. if(l21 == 2 || l21 == 3)
  11676. pushMessage(s9, 7, "@cr2@" + TextClass.fixName(TextClass.nameForLong(l5)));
  11677. else
  11678. if(l21 == 1)
  11679. pushMessage(s9, 7, "@cr1@" + TextClass.fixName(TextClass.nameForLong(l5)));
  11680. else
  11681. pushMessage(s9, 3, TextClass.fixName(TextClass.nameForLong(l5)));
  11682. }
  11683. catch(Exception exception1)
  11684. {
  11685. signlink.reporterror("cde1");
  11686. }
  11687. pktType = -1;
  11688. return true;
  11689. }
  11690. if(pktType == 85)
  11691. {
  11692. anInt1269 = inStream.method427();
  11693. anInt1268 = inStream.method427();
  11694. pktType = -1;
  11695. return true;
  11696. }
  11697. if(pktType == 24)
  11698. {
  11699. anInt1054 = inStream.method428();
  11700. if(anInt1054 == tabID)
  11701. {
  11702. if(anInt1054 == 3)
  11703. tabID = 1;
  11704. else
  11705. tabID = 3;
  11706. needDrawTabArea = true;
  11707. }
  11708. pktType = -1;
  11709. return true;
  11710. }
  11711. if(pktType == 246)
  11712. {
  11713. int i6 = inStream.method434();
  11714. int i13 = inStream.readUnsignedWord();
  11715. int k18 = inStream.readUnsignedWord();
  11716. if(k18 == 65535)
  11717. {
  11718. RSInterface.interfaceCache[i6].anInt233 = 0;
  11719. pktType = -1;
  11720. return true;
  11721. } else
  11722. {
  11723. ItemDef itemDef = ItemDef.forID(k18);
  11724. RSInterface.interfaceCache[i6].anInt233 = 4;
  11725. RSInterface.interfaceCache[i6].mediaID = k18;
  11726. RSInterface.interfaceCache[i6].modelRotation1 = itemDef.modelRotation1;
  11727. RSInterface.interfaceCache[i6].modelRotation2 = itemDef.modelRotation2;
  11728. RSInterface.interfaceCache[i6].anInt269 = (itemDef.modelZoom * 100) / i13;
  11729. pktType = -1;
  11730. return true;
  11731. }
  11732. }
  11733. if(pktType == 171)
  11734. {
  11735. boolean flag1 = inStream.readUnsignedByte() == 1;
  11736. int j13 = inStream.readUnsignedWord();
  11737. RSInterface.interfaceCache[j13].isMouseoverTriggered = flag1;
  11738. pktType = -1;
  11739. return true;
  11740. }
  11741. if(pktType == 142)
  11742. {
  11743. int j6 = inStream.method434();
  11744. method60(j6);
  11745. if(backDialogID != -1)
  11746. {
  11747. backDialogID = -1;
  11748. inputTaken = true;
  11749. }
  11750. if(inputDialogState != 0)
  11751. {
  11752. inputDialogState = 0;
  11753. inputTaken = true;
  11754. }
  11755. invOverlayInterfaceID = j6;
  11756. needDrawTabArea = true;
  11757. tabAreaAltered = true;
  11758. openInterfaceID = -1;
  11759. aBoolean1149 = false;
  11760. pktType = -1;
  11761. return true;
  11762. }
  11763. if(pktType == 126)
  11764. {
  11765. String s1 = inStream.readString();
  11766. int k13 = inStream.method435();
  11767. RSInterface.interfaceCache[k13].message = s1;
  11768. if(RSInterface.interfaceCache[k13].parentID == tabInterfaceIDs[tabID])
  11769. needDrawTabArea = true;
  11770. pktType = -1;
  11771. return true;
  11772. }
  11773. if(pktType == 206)
  11774. {
  11775. publicChatMode = inStream.readUnsignedByte();
  11776. privateChatMode = inStream.readUnsignedByte();
  11777. tradeMode = inStream.readUnsignedByte();
  11778. aBoolean1233 = true;
  11779. inputTaken = true;
  11780. pktType = -1;
  11781. return true;
  11782. }
  11783. if(pktType == 240)
  11784. {
  11785. if(tabID == 12)
  11786. needDrawTabArea = true;
  11787. weight = inStream.readSignedWord();
  11788. pktType = -1;
  11789. return true;
  11790. }
  11791. if(pktType == 8)
  11792. {
  11793. int k6 = inStream.method436();
  11794. int l13 = inStream.readUnsignedWord();
  11795. RSInterface.interfaceCache[k6].anInt233 = 1;
  11796. RSInterface.interfaceCache[k6].mediaID = l13;
  11797. pktType = -1;
  11798. return true;
  11799. }
  11800. if(pktType == 122)
  11801. {
  11802. int l6 = inStream.method436();
  11803. int i14 = inStream.method436();
  11804. int i19 = i14 >> 10 & 0x1f;
  11805. int i22 = i14 >> 5 & 0x1f;
  11806. int l24 = i14 & 0x1f;
  11807. RSInterface.interfaceCache[l6].textColor = (i19 << 19) + (i22 << 11) + (l24 << 3);
  11808. pktType = -1;
  11809. return true;
  11810. }
  11811. if(pktType == 53)
  11812. {
  11813. needDrawTabArea = true;
  11814. int i7 = inStream.readUnsignedWord();
  11815. RSInterface class9_1 = RSInterface.interfaceCache[i7];
  11816. int j19 = inStream.readUnsignedWord();
  11817. for(int j22 = 0; j22 < j19; j22++)
  11818. {
  11819. int i25 = inStream.readUnsignedByte();
  11820. if(i25 == 255)
  11821. i25 = inStream.method440();
  11822. class9_1.inv[j22] = inStream.method436();
  11823. class9_1.invStackSizes[j22] = i25;
  11824. }
  11825.  
  11826. for(int j25 = j19; j25 < class9_1.inv.length; j25++)
  11827. {
  11828. class9_1.inv[j25] = 0;
  11829. class9_1.invStackSizes[j25] = 0;
  11830. }
  11831.  
  11832. pktType = -1;
  11833. return true;
  11834. }
  11835. if(pktType == 230)
  11836. {
  11837. int j7 = inStream.method435();
  11838. int j14 = inStream.readUnsignedWord();
  11839. int k19 = inStream.readUnsignedWord();
  11840. int k22 = inStream.method436();
  11841. RSInterface.interfaceCache[j14].modelRotation1 = k19;
  11842. RSInterface.interfaceCache[j14].modelRotation2 = k22;
  11843. RSInterface.interfaceCache[j14].anInt269 = j7;
  11844. pktType = -1;
  11845. return true;
  11846. }
  11847. if(pktType == 221)
  11848. {
  11849. anInt900 = inStream.readUnsignedByte();
  11850. needDrawTabArea = true;
  11851. pktType = -1;
  11852. return true;
  11853. }
  11854. if(pktType == 177)
  11855. {
  11856. aBoolean1160 = true;
  11857. anInt995 = inStream.readUnsignedByte();
  11858. anInt996 = inStream.readUnsignedByte();
  11859. anInt997 = inStream.readUnsignedWord();
  11860. anInt998 = inStream.readUnsignedByte();
  11861. anInt999 = inStream.readUnsignedByte();
  11862. if(anInt999 >= 100)
  11863. {
  11864. int k7 = anInt995 * 128 + 64;
  11865. int k14 = anInt996 * 128 + 64;
  11866. int i20 = method42(plane, k14, k7) - anInt997;
  11867. int l22 = k7 - xCameraPos;
  11868. int k25 = i20 - zCameraPos;
  11869. int j28 = k14 - yCameraPos;
  11870. int i30 = (int)Math.sqrt(l22 * l22 + j28 * j28);
  11871. yCameraCurve = (int)(Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  11872. xCameraCurve = (int)(Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  11873. if(yCameraCurve < 128)
  11874. yCameraCurve = 128;
  11875. if(yCameraCurve > 383)
  11876. yCameraCurve = 383;
  11877. }
  11878. pktType = -1;
  11879. return true;
  11880. }
  11881. if(pktType == 249)
  11882. {
  11883. anInt1046 = inStream.method426();
  11884. unknownInt10 = inStream.method436();
  11885. pktType = -1;
  11886. return true;
  11887. }
  11888. if(pktType == 65)
  11889. {
  11890. updateNPCs(inStream, pktSize);
  11891. pktType = -1;
  11892. return true;
  11893. }
  11894. if(pktType == 27)
  11895. {
  11896. messagePromptRaised = false;
  11897. inputDialogState = 1;
  11898. amountOrNameInput = "";
  11899. inputTaken = true;
  11900. pktType = -1;
  11901. return true;
  11902. }
  11903. if(pktType == 187)
  11904. {
  11905. messagePromptRaised = false;
  11906. inputDialogState = 2;
  11907. amountOrNameInput = "";
  11908. inputTaken = true;
  11909. pktType = -1;
  11910. return true;
  11911. }
  11912. if(pktType == 97)
  11913. {
  11914. int l7 = inStream.readUnsignedWord();
  11915. method60(l7);
  11916. if(invOverlayInterfaceID != -1)
  11917. {
  11918. invOverlayInterfaceID = -1;
  11919. needDrawTabArea = true;
  11920. tabAreaAltered = true;
  11921. }
  11922. if(backDialogID != -1)
  11923. {
  11924. backDialogID = -1;
  11925. inputTaken = true;
  11926. }
  11927. if(inputDialogState != 0)
  11928. {
  11929. inputDialogState = 0;
  11930. inputTaken = true;
  11931. }
  11932. openInterfaceID = l7;
  11933. aBoolean1149 = false;
  11934. pktType = -1;
  11935. return true;
  11936. }
  11937. if(pktType == 218)
  11938. {
  11939. int i8 = inStream.method438();
  11940. dialogID = i8;
  11941. inputTaken = true;
  11942. pktType = -1;
  11943. return true;
  11944. }
  11945. if(pktType == 87)
  11946. {
  11947. int j8 = inStream.method434();
  11948. int l14 = inStream.method439();
  11949. anIntArray1045[j8] = l14;
  11950. if(variousSettings[j8] != l14)
  11951. {
  11952. variousSettings[j8] = l14;
  11953. method33(j8);
  11954. needDrawTabArea = true;
  11955. if(dialogID != -1)
  11956. inputTaken = true;
  11957. }
  11958. pktType = -1;
  11959. return true;
  11960. }
  11961. if(pktType == 36)
  11962. {
  11963. int k8 = inStream.method434();
  11964. byte byte0 = inStream.readSignedByte();
  11965. anIntArray1045[k8] = byte0;
  11966. if(variousSettings[k8] != byte0)
  11967. {
  11968. variousSettings[k8] = byte0;
  11969. method33(k8);
  11970. needDrawTabArea = true;
  11971. if(dialogID != -1)
  11972. inputTaken = true;
  11973. }
  11974. pktType = -1;
  11975. return true;
  11976. }
  11977. if(pktType == 61)
  11978. {
  11979. anInt1055 = inStream.readUnsignedByte();
  11980. pktType = -1;
  11981. return true;
  11982. }
  11983. if(pktType == 200)
  11984. {
  11985. int l8 = inStream.readUnsignedWord();
  11986. int i15 = inStream.readSignedWord();
  11987. RSInterface class9_4 = RSInterface.interfaceCache[l8];
  11988. class9_4.anInt257 = i15;
  11989. if(i15 == -1)
  11990. {
  11991. class9_4.anInt246 = 0;
  11992. class9_4.anInt208 = 0;
  11993. }
  11994. pktType = -1;
  11995. return true;
  11996. }
  11997. if(pktType == 219)
  11998. {
  11999. if(invOverlayInterfaceID != -1)
  12000. {
  12001. invOverlayInterfaceID = -1;
  12002. needDrawTabArea = true;
  12003. tabAreaAltered = true;
  12004. }
  12005. if(backDialogID != -1)
  12006. {
  12007. backDialogID = -1;
  12008. inputTaken = true;
  12009. }
  12010. if(inputDialogState != 0)
  12011. {
  12012. inputDialogState = 0;
  12013. inputTaken = true;
  12014. }
  12015. openInterfaceID = -1;
  12016. aBoolean1149 = false;
  12017. pktType = -1;
  12018. return true;
  12019. }
  12020. if(pktType == 34)
  12021. {
  12022. needDrawTabArea = true;
  12023. int i9 = inStream.readUnsignedWord();
  12024. RSInterface class9_2 = RSInterface.interfaceCache[i9];
  12025. while(inStream.currentOffset < pktSize)
  12026. {
  12027. int j20 = inStream.method422();
  12028. int i23 = inStream.readUnsignedWord();
  12029. int l25 = inStream.readUnsignedByte();
  12030. if(l25 == 255)
  12031. l25 = inStream.readDWord();
  12032. if(j20 >= 0 && j20 < class9_2.inv.length)
  12033. {
  12034. class9_2.inv[j20] = i23;
  12035. class9_2.invStackSizes[j20] = l25;
  12036. }
  12037. }
  12038. pktType = -1;
  12039. return true;
  12040. }
  12041. if(pktType == 105 || pktType == 84 || pktType == 147 || pktType == 215 || pktType == 4 || pktType == 117 || pktType == 156 || pktType == 44 || pktType == 160 || pktType == 101 || pktType == 151)
  12042. {
  12043. method137(inStream, pktType);
  12044. pktType = -1;
  12045. return true;
  12046. }
  12047. if(pktType == 106)
  12048. {
  12049. tabID = inStream.method427();
  12050. needDrawTabArea = true;
  12051. tabAreaAltered = true;
  12052. pktType = -1;
  12053. return true;
  12054. }
  12055. if(pktType == 164)
  12056. {
  12057. int j9 = inStream.method434();
  12058. method60(j9);
  12059. if(invOverlayInterfaceID != -1)
  12060. {
  12061. invOverlayInterfaceID = -1;
  12062. needDrawTabArea = true;
  12063. tabAreaAltered = true;
  12064. }
  12065. backDialogID = j9;
  12066. inputTaken = true;
  12067. openInterfaceID = -1;
  12068. aBoolean1149 = false;
  12069. pktType = -1;
  12070. return true;
  12071. }
  12072. signlink.reporterror("T1 - " + pktType + "," + pktSize + " - " + anInt842 + "," + anInt843);
  12073. resetLogout();
  12074. }
  12075. catch(IOException _ex)
  12076. {
  12077. dropClient();
  12078. }
  12079. catch(Exception exception)
  12080. {
  12081. String s2 = "T2 - " + pktType + "," + anInt842 + "," + anInt843 + " - " + pktSize + "," + (baseX + myPlayer.smallX[0]) + "," + (baseY + myPlayer.smallY[0]) + " - ";
  12082. for(int j15 = 0; j15 < pktSize && j15 < 50; j15++)
  12083. s2 = s2 + inStream.buffer[j15] + ",";
  12084.  
  12085. signlink.reporterror(s2);
  12086. resetLogout();
  12087. }
  12088. return true;
  12089. }
  12090.  
  12091. private void method146()
  12092. {
  12093. anInt1265++;
  12094. method47(true);
  12095. method26(true);
  12096. method47(false);
  12097. method26(false);
  12098. method55();
  12099. method104();
  12100. if(!aBoolean1160)
  12101. {
  12102. int i = anInt1184;
  12103. if(anInt984 / 256 > i)
  12104. i = anInt984 / 256;
  12105. if(aBooleanArray876[4] && anIntArray1203[4] + 128 > i)
  12106. i = anIntArray1203[4] + 128;
  12107. int k = minimapInt1 + anInt896 & 0x7ff;
  12108. setCameraPos(600 + i * 3, i, anInt1014, method42(plane, myPlayer.y, myPlayer.x) - 50, k, anInt1015);
  12109. }
  12110. int j;
  12111. if(!aBoolean1160)
  12112. j = method120();
  12113. else
  12114. j = method121();
  12115. int l = xCameraPos;
  12116. int i1 = zCameraPos;
  12117. int j1 = yCameraPos;
  12118. int k1 = yCameraCurve;
  12119. int l1 = xCameraCurve;
  12120. for(int i2 = 0; i2 < 5; i2++)
  12121. if(aBooleanArray876[i2])
  12122. {
  12123. 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]);
  12124. if(i2 == 0)
  12125. xCameraPos += j2;
  12126. if(i2 == 1)
  12127. zCameraPos += j2;
  12128. if(i2 == 2)
  12129. yCameraPos += j2;
  12130. if(i2 == 3)
  12131. xCameraCurve = xCameraCurve + j2 & 0x7ff;
  12132. if(i2 == 4)
  12133. {
  12134. yCameraCurve += j2;
  12135. if(yCameraCurve < 128)
  12136. yCameraCurve = 128;
  12137. if(yCameraCurve > 383)
  12138. yCameraCurve = 383;
  12139. }
  12140. }
  12141.  
  12142. int k2 = Texture.anInt1481;
  12143. Model.aBoolean1684 = true;
  12144. Model.anInt1687 = 0;
  12145. Model.anInt1685 = super.mouseX - 4;
  12146. Model.anInt1686 = super.mouseY - 4;
  12147. DrawingArea.setAllPixelsToZero();
  12148. //xxx disables graphics if(graphicsEnabled){
  12149. worldController.method313(xCameraPos, yCameraPos, xCameraCurve, zCameraPos, j, yCameraCurve);
  12150. worldController.clearObj5Cache();
  12151. updateEntities();
  12152. drawHeadIcon();
  12153. method37(k2);
  12154. draw3dScreen();
  12155. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  12156. xCameraPos = l;
  12157. zCameraPos = i1;
  12158. yCameraPos = j1;
  12159. yCameraCurve = k1;
  12160. xCameraCurve = l1;
  12161. // }
  12162. }
  12163.  
  12164. private void clearTopInterfaces()
  12165. {
  12166. stream.createFrame(130);
  12167. if(invOverlayInterfaceID != -1)
  12168. {
  12169. invOverlayInterfaceID = -1;
  12170. needDrawTabArea = true;
  12171. aBoolean1149 = false;
  12172. tabAreaAltered = true;
  12173. }
  12174. if(backDialogID != -1)
  12175. {
  12176. backDialogID = -1;
  12177. inputTaken = true;
  12178. aBoolean1149 = false;
  12179. }
  12180. openInterfaceID = -1;
  12181. }
  12182.  
  12183. public client()
  12184. {
  12185. chatTypeView = 0;
  12186. duelMode = 0;
  12187. clanChatMode = 0;
  12188. cButtonHPos = -1;
  12189. cButtonHCPos = -1;
  12190. cButtonCPos = 0;
  12191. server = "127.0.0.1";
  12192. anIntArrayArray825 = new int[104][104];
  12193. friendsNodeIDs = new int[200];
  12194. groundArray = new NodeList[4][104][104];
  12195. aBoolean831 = false;
  12196. aStream_834 = new Stream(new byte[5000]);
  12197. npcArray = new NPC[16384];
  12198. npcIndices = new int[16384];
  12199. anIntArray840 = new int[1000];
  12200. aStream_847 = Stream.create();
  12201. aBoolean848 = true;
  12202. openInterfaceID = -1;
  12203. currentExp = new int[Skills.skillsCount];
  12204. aBoolean872 = false;
  12205. anIntArray873 = new int[5];
  12206. anInt874 = -1;
  12207. aBooleanArray876 = new boolean[5];
  12208. drawFlames = false;
  12209. reportAbuseInput = "";
  12210. unknownInt10 = -1;
  12211. menuOpen = false;
  12212. inputString = "";
  12213. maxPlayers = 2048;
  12214. myPlayerIndex = 2047;
  12215. playerArray = new Player[maxPlayers];
  12216. playerIndices = new int[maxPlayers];
  12217. anIntArray894 = new int[maxPlayers];
  12218. aStreamArray895s = new Stream[maxPlayers];
  12219. anInt897 = 1;
  12220. anIntArrayArray901 = new int[104][104];
  12221. anInt902 = 0x766654;
  12222. aByteArray912 = new byte[16384];
  12223. currentStats = new int[Skills.skillsCount];
  12224. ignoreListAsLongs = new long[100];
  12225. loadingError = false;
  12226. anInt927 = 0x332d25;
  12227. anIntArray928 = new int[5];
  12228. anIntArrayArray929 = new int[104][104];
  12229. chatTypes = new int[500];
  12230. chatNames = new String[500];
  12231. chatMessages = new String[500];
  12232. sideIcons = new Sprite[14];
  12233. redStones = new Sprite[5];
  12234. aBoolean954 = true;
  12235. friendsListAsLongs = new long[200];
  12236. currentSong = -1;
  12237. drawingFlames = false;
  12238. spriteDrawX = -1;
  12239. spriteDrawY = -1;
  12240. anIntArray968 = new int[33];
  12241. anIntArray969 = new int[256];
  12242. decompressors = new Decompressor[5];
  12243. variousSettings = new int[2000];
  12244. aBoolean972 = false;
  12245. anInt975 = 50;
  12246. anIntArray976 = new int[anInt975];
  12247. anIntArray977 = new int[anInt975];
  12248. anIntArray978 = new int[anInt975];
  12249. anIntArray979 = new int[anInt975];
  12250. anIntArray980 = new int[anInt975];
  12251. anIntArray981 = new int[anInt975];
  12252. anIntArray982 = new int[anInt975];
  12253. aStringArray983 = new String[anInt975];
  12254. anInt985 = -1;
  12255. hitMarks = new Sprite[20];
  12256. anIntArray990 = new int[5];
  12257. aBoolean994 = false;
  12258. anInt1002 = 0x23201b;
  12259. amountOrNameInput = "";
  12260. aClass19_1013 = new NodeList();
  12261. aBoolean1017 = false;
  12262. anInt1018 = -1;
  12263. anIntArray1030 = new int[5];
  12264. aBoolean1031 = false;
  12265. mapFunctions = new Sprite[100];
  12266. dialogID = -1;
  12267. maxStats = new int[Skills.skillsCount];
  12268. anIntArray1045 = new int[2000];
  12269. aBoolean1047 = true;
  12270. anIntArray1052 = new int[151];
  12271. anInt1054 = -1;
  12272. aClass19_1056 = new NodeList();
  12273. anIntArray1057 = new int[33];
  12274. aClass9_1059 = new RSInterface();
  12275. mapScenes = new Background[100];
  12276. barFillColor = 0x4d4233;
  12277. anIntArray1065 = new int[7];
  12278. anIntArray1072 = new int[1000];
  12279. anIntArray1073 = new int[1000];
  12280. aBoolean1080 = false;
  12281. friendsList = new String[200];
  12282. inStream = Stream.create();
  12283. expectedCRCs = new int[9];
  12284. menuActionCmd2 = new int[500];
  12285. menuActionCmd3 = new int[500];
  12286. menuActionID = new int[500];
  12287. menuActionCmd1 = new int[500];
  12288. headIcons = new Sprite[20];
  12289. headIconsHint = new Sprite[20];
  12290. tabAreaAltered = false;
  12291. aString1121 = "";
  12292. atPlayerActions = new String[5];
  12293. atPlayerArray = new boolean[5];
  12294. anIntArrayArrayArray1129 = new int[4][13][13];
  12295. anInt1132 = 2;
  12296. aClass30_Sub2_Sub1_Sub1Array1140 = new Sprite[1000];
  12297. aBoolean1141 = false;
  12298. aBoolean1149 = false;
  12299. crosses = new Sprite[8];
  12300. musicEnabled = true;
  12301. needDrawTabArea = false;
  12302. loggedIn = false;
  12303. canMute = false;
  12304. aBoolean1159 = false;
  12305. aBoolean1160 = false;
  12306. anInt1171 = 1;
  12307. myUsername = "";
  12308. myPassword = "";
  12309. genericLoadingError = false;
  12310. reportAbuseInterfaceID = -1;
  12311. aClass19_1179 = new NodeList();
  12312. anInt1184 = 128;
  12313. invOverlayInterfaceID = -1;
  12314. stream = Stream.create();
  12315. menuActionName = new String[500];
  12316. anIntArray1203 = new int[5];
  12317. anIntArray1207 = new int[50];
  12318. anInt1210 = 2;
  12319. anInt1211 = 78;
  12320. promptInput = "";
  12321. modIcons = new Background[2];
  12322. tabID = 3;
  12323. inputTaken = false;
  12324. songChanging = true;
  12325. anIntArray1229 = new int[151];
  12326. aClass11Array1230 = new Class11[4];
  12327. aBoolean1233 = false;
  12328. anIntArray1240 = new int[100];
  12329. anIntArray1241 = new int[50];
  12330. aBoolean1242 = false;
  12331. anIntArray1250 = new int[50];
  12332. rsAlreadyLoaded = false;
  12333. welcomeScreenRaised = false;
  12334. messagePromptRaised = false;
  12335. loginMessage1 = "";
  12336. loginMessage2 = "";
  12337. backDialogID = -1;
  12338. anInt1279 = 2;
  12339. bigX = new int[4000];
  12340. bigY = new int[4000];
  12341. anInt1289 = -1;
  12342. }
  12343.  
  12344. public int chatTypeView;
  12345. public int clanChatMode;
  12346. public int duelMode;
  12347. /* Declare custom sprites */
  12348. private Sprite chatArea;
  12349. private Sprite chatButtons;
  12350. private Sprite chatButtonH;
  12351. private Sprite chatButtonHC;
  12352. private Sprite chatButtonC;
  12353. private Sprite reportH;
  12354. private Sprite tabArea;
  12355. private Sprite mapArea;
  12356. private Sprite logIconH;
  12357. private Sprite logIconC;
  12358. private Sprite worldMapIcon;
  12359. private Sprite emptyOrb;
  12360. private Sprite hitPointsFill;
  12361. private Sprite hitPointsIcon;
  12362. private Sprite prayerFill;
  12363. private Sprite prayerIcon;
  12364. /**/
  12365. private RSImageProducer frame;
  12366. private int ignoreCount;
  12367. private long aLong824;
  12368. private int[][] anIntArrayArray825;
  12369. private int[] friendsNodeIDs;
  12370. private NodeList[][][] groundArray;
  12371. private int[] anIntArray828;
  12372. private int[] anIntArray829;
  12373. private volatile boolean aBoolean831;
  12374. private Socket aSocket832;
  12375. private int loginScreenState;
  12376. private Stream aStream_834;
  12377. private NPC[] npcArray;
  12378. private int npcCount;
  12379. private int[] npcIndices;
  12380. private int anInt839;
  12381. private int[] anIntArray840;
  12382. private int anInt841;
  12383. private int anInt842;
  12384. private int anInt843;
  12385. private String aString844;
  12386. private int privateChatMode;
  12387. private Stream aStream_847;
  12388. private boolean aBoolean848;
  12389. private static int anInt849;
  12390. private int[] anIntArray850;
  12391. private int[] anIntArray851;
  12392. private int[] anIntArray852;
  12393. private int[] anIntArray853;
  12394. private static int anInt854;
  12395. private int anInt855;
  12396. private int openInterfaceID;
  12397. private int xCameraPos;
  12398. private int zCameraPos;
  12399. private int yCameraPos;
  12400. private int yCameraCurve;
  12401. private int xCameraCurve;
  12402. private int myPrivilege;
  12403. private final int[] currentExp;
  12404. private Sprite[] redStones;
  12405. private Sprite mapFlag;
  12406. private Sprite mapMarker;
  12407. private boolean aBoolean872;
  12408. private final int[] anIntArray873;
  12409. private int anInt874;
  12410. private final boolean[] aBooleanArray876;
  12411. private int weight;
  12412. private MouseDetection mouseDetection;
  12413. private volatile boolean drawFlames;
  12414. private String reportAbuseInput;
  12415. private int unknownInt10;
  12416. private boolean menuOpen;
  12417. private int anInt886;
  12418. private String inputString;
  12419. private final int maxPlayers;
  12420. private final int myPlayerIndex;
  12421. private Player[] playerArray;
  12422. private int playerCount;
  12423. private int[] playerIndices;
  12424. private int anInt893;
  12425. private int[] anIntArray894;
  12426. private Stream[] aStreamArray895s;
  12427. private int anInt896;
  12428. private int anInt897;
  12429. private int friendsCount;
  12430. private int anInt900;
  12431. private int[][] anIntArrayArray901;
  12432. private final int anInt902;
  12433. private byte[] aByteArray912;
  12434. private int anInt913;
  12435. private int crossX;
  12436. private int crossY;
  12437. private int crossIndex;
  12438. private int crossType;
  12439. private int plane;
  12440. private final int[] currentStats;
  12441. private static int anInt924;
  12442. private final long[] ignoreListAsLongs;
  12443. private boolean loadingError;
  12444. private final int anInt927;
  12445. private final int[] anIntArray928;
  12446. private int[][] anIntArrayArray929;
  12447. private Sprite aClass30_Sub2_Sub1_Sub1_931;
  12448. private Sprite aClass30_Sub2_Sub1_Sub1_932;
  12449. private int anInt933;
  12450. private int anInt934;
  12451. private int anInt935;
  12452. private int anInt936;
  12453. private int anInt937;
  12454. private int anInt938;
  12455. private static int anInt940;
  12456. private final int[] chatTypes;
  12457. private final String[] chatNames;
  12458. private final String[] chatMessages;
  12459. private int anInt945;
  12460. private WorldController worldController;
  12461. private Sprite[] sideIcons;
  12462. private int menuScreenArea;
  12463. private int menuOffsetX;
  12464. private int menuOffsetY;
  12465. private int menuWidth;
  12466. private int anInt952;
  12467. private long aLong953;
  12468. private boolean aBoolean954;
  12469. private long[] friendsListAsLongs;
  12470. private int currentSong;
  12471. private static int nodeID = 10;
  12472. static int portOff;
  12473. static boolean clientData;
  12474. private static boolean isMembers = true;
  12475. private static boolean lowMem;
  12476. private volatile boolean drawingFlames;
  12477. private int spriteDrawX;
  12478. private int spriteDrawY;
  12479. private final int[] anIntArray965 = {
  12480. 0xffff00, 0xff0000, 65280, 65535, 0xff00ff, 0xffffff
  12481. };
  12482. private Background aBackground_966;
  12483. private Background aBackground_967;
  12484. private final int[] anIntArray968;
  12485. private final int[] anIntArray969;
  12486. final Decompressor[] decompressors;
  12487. public int variousSettings[];
  12488. private boolean aBoolean972;
  12489. private final int anInt975;
  12490. private final int[] anIntArray976;
  12491. private final int[] anIntArray977;
  12492. private final int[] anIntArray978;
  12493. private final int[] anIntArray979;
  12494. private final int[] anIntArray980;
  12495. private final int[] anIntArray981;
  12496. private final int[] anIntArray982;
  12497. private final String[] aStringArray983;
  12498. private int anInt984;
  12499. private int anInt985;
  12500. private static int anInt986;
  12501. private Sprite[] hitMarks;
  12502. private int anInt988;
  12503. private int anInt989;
  12504. private final int[] anIntArray990;
  12505. private static boolean aBoolean993;
  12506. private final boolean aBoolean994;
  12507. private int anInt995;
  12508. private int anInt996;
  12509. private int anInt997;
  12510. private int anInt998;
  12511. private int anInt999;
  12512. private ISAACRandomGen encryption;
  12513. private Sprite mapEdge;
  12514. private final int anInt1002;
  12515. static final int[][] anIntArrayArray1003 = {
  12516. {
  12517. 6798, 107, 10283, 16, 4797, 7744, 5799, 4634, 33697, 22433,
  12518. 2983, 54193
  12519. }, {
  12520. 8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153,
  12521. 56621, 4783, 1341, 16578, 35003, 25239
  12522. }, {
  12523. 25238, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094,
  12524. 10153, 56621, 4783, 1341, 16578, 35003
  12525. }, {
  12526. 4626, 11146, 6439, 12, 4758, 10270
  12527. }, {
  12528. 4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574
  12529. }
  12530. };
  12531. private String amountOrNameInput;
  12532. private static int anInt1005;
  12533. private int daysSinceLastLogin;
  12534. private int pktSize;
  12535. private int pktType;
  12536. private int anInt1009;
  12537. private int anInt1010;
  12538. private int anInt1011;
  12539. private NodeList aClass19_1013;
  12540. private int anInt1014;
  12541. private int anInt1015;
  12542. private int anInt1016;
  12543. private boolean aBoolean1017;
  12544. private int anInt1018;
  12545. private static final int[] anIntArray1019;
  12546. private int anInt1021;
  12547. private int anInt1022;
  12548. private int loadingStage;
  12549. private Background scrollBar1;
  12550. private Background scrollBar2;
  12551. private int anInt1026;
  12552. private Background backBase1;
  12553. private Background backBase2;
  12554. private Background backHmid1;
  12555. private final int[] anIntArray1030;
  12556. private boolean aBoolean1031;
  12557. private Sprite[] mapFunctions;
  12558. private int baseX;
  12559. private int baseY;
  12560. private int anInt1036;
  12561. private int anInt1037;
  12562. private int loginFailures;
  12563. private int anInt1039;
  12564. private int anInt1040;
  12565. private int anInt1041;
  12566. private int dialogID;
  12567. private final int[] maxStats;
  12568. private final int[] anIntArray1045;
  12569. private int anInt1046;
  12570. private boolean aBoolean1047;
  12571. private int anInt1048;
  12572. private String aString1049;
  12573. private static int anInt1051;
  12574. private final int[] anIntArray1052;
  12575. private StreamLoader titleStreamLoader;
  12576. private int anInt1054;
  12577. private int anInt1055;
  12578. private NodeList aClass19_1056;
  12579. private final int[] anIntArray1057;
  12580. public final RSInterface aClass9_1059;
  12581. private Background[] mapScenes;
  12582. private static int anInt1061;
  12583. private int anInt1062;
  12584. private final int barFillColor;
  12585. private int friendsListAction;
  12586. private final int[] anIntArray1065;
  12587. private int mouseInvInterfaceIndex;
  12588. private int lastActiveInvInterface;
  12589. private OnDemandFetcher onDemandFetcher;
  12590. private int anInt1069;
  12591. private int anInt1070;
  12592. private int anInt1071;
  12593. private int[] anIntArray1072;
  12594. private int[] anIntArray1073;
  12595. private Sprite mapDotItem;
  12596. private Sprite mapDotNPC;
  12597. private Sprite mapDotPlayer;
  12598. private Sprite mapDotFriend;
  12599. private Sprite mapDotTeam;
  12600. private int anInt1079;
  12601. private boolean aBoolean1080;
  12602. private String[] friendsList;
  12603. private Stream inStream;
  12604. private int anInt1084;
  12605. private int anInt1085;
  12606. private int activeInterfaceType;
  12607. private int anInt1087;
  12608. private int anInt1088;
  12609. public static int anInt1089;
  12610. private final int[] expectedCRCs;
  12611. private int[] menuActionCmd2;
  12612. private int[] menuActionCmd3;
  12613. private int[] menuActionID;
  12614. private int[] menuActionCmd1;
  12615. private Sprite[] headIcons;
  12616. private Sprite[] headIconsHint;
  12617. private static int anInt1097;
  12618. private int anInt1098;
  12619. private int anInt1099;
  12620. private int anInt1100;
  12621. private int anInt1101;
  12622. private int anInt1102;
  12623. private boolean tabAreaAltered;
  12624. private int anInt1104;
  12625. private RSImageProducer aRSImageProducer_1107;
  12626. private RSImageProducer aRSImageProducer_1108;
  12627. private RSImageProducer aRSImageProducer_1109;
  12628. private RSImageProducer aRSImageProducer_1110;
  12629. private RSImageProducer aRSImageProducer_1111;
  12630. private RSImageProducer aRSImageProducer_1112;
  12631. private RSImageProducer aRSImageProducer_1113;
  12632. private RSImageProducer aRSImageProducer_1114;
  12633. private RSImageProducer aRSImageProducer_1115;
  12634. private static int anInt1117;
  12635. private int membersInt;
  12636. private String aString1121;
  12637. private Sprite compass;
  12638. private RSImageProducer aRSImageProducer_1123;
  12639. private RSImageProducer aRSImageProducer_1124;
  12640. private RSImageProducer aRSImageProducer_1125;
  12641. public static Player myPlayer;
  12642. private final String[] atPlayerActions;
  12643. private final boolean[] atPlayerArray;
  12644. private final int[][][] anIntArrayArrayArray1129;
  12645. private final int[] tabInterfaceIDs = {
  12646. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  12647. -1, -1, -1, -1, -1
  12648. };
  12649. private int anInt1131;
  12650. private int anInt1132;
  12651. private int menuActionRow;
  12652. private static int anInt1134;
  12653. private int spellSelected;
  12654. private int anInt1137;
  12655. private int spellUsableOn;
  12656. private String spellTooltip;
  12657. private Sprite[] aClass30_Sub2_Sub1_Sub1Array1140;
  12658. private boolean aBoolean1141;
  12659. private static int anInt1142;
  12660. private int energy;
  12661. private boolean aBoolean1149;
  12662. private Sprite[] crosses;
  12663. private boolean musicEnabled;
  12664. private Background[] aBackgroundArray1152s;
  12665. private boolean needDrawTabArea;
  12666. private int unreadMessages;
  12667. private static int anInt1155;
  12668. private static boolean fpsOn;
  12669. public boolean loggedIn;
  12670. private boolean canMute;
  12671. private boolean aBoolean1159;
  12672. private boolean aBoolean1160;
  12673. static int loopCycle;
  12674. private static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  12675. private RSImageProducer aRSImageProducer_1163;
  12676. private RSImageProducer aRSImageProducer_1164;
  12677. private RSImageProducer aRSImageProducer_1165;
  12678. private RSImageProducer aRSImageProducer_1166;
  12679. private int daysSinceRecovChange;
  12680. private RSSocket socketStream;
  12681. private int anInt1169;
  12682. private int minimapInt3;
  12683. private int anInt1171;
  12684. private long aLong1172;
  12685. private String myUsername;
  12686. private String myPassword;
  12687. private static int anInt1175;
  12688. private boolean genericLoadingError;
  12689. private final int[] anIntArray1177 = {
  12690. 0, 0, 0, 0, 1, 1, 1, 1, 1, 2,
  12691. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  12692. 2, 2, 3
  12693. };
  12694. private int reportAbuseInterfaceID;
  12695. private NodeList aClass19_1179;
  12696. private int[] anIntArray1180;
  12697. private int[] anIntArray1181;
  12698. private int[] anIntArray1182;
  12699. private byte[][] aByteArrayArray1183;
  12700. private int anInt1184;
  12701. private int minimapInt1;
  12702. private int anInt1186;
  12703. private int anInt1187;
  12704. private static int anInt1188;
  12705. private int invOverlayInterfaceID;
  12706. private int[] anIntArray1190;
  12707. private int[] anIntArray1191;
  12708. private Stream stream;
  12709. private int anInt1193;
  12710. private int splitPrivateChat;
  12711. private Background mapBack;
  12712. private String[] menuActionName;
  12713. private Sprite aClass30_Sub2_Sub1_Sub1_1201;
  12714. private Sprite aClass30_Sub2_Sub1_Sub1_1202;
  12715. private final int[] anIntArray1203;
  12716. static final int[] anIntArray1204 = {
  12717. 9104, 10275, 7595, 3610, 7975, 8526, 918, 38802, 24466, 10145,
  12718. 58654, 5027, 1457, 16565, 34991, 25486
  12719. };
  12720. private static boolean flagged;
  12721. private final int[] anIntArray1207;
  12722. private int anInt1208;
  12723. private int minimapInt2;
  12724. private int anInt1210;
  12725. private int anInt1211;
  12726. private String promptInput;
  12727. private int anInt1213;
  12728. private int[][][] intGroundArray;
  12729. private long aLong1215;
  12730. private int loginScreenCursorPos;
  12731. private final Background[] modIcons;
  12732. private long aLong1220;
  12733. private int tabID;
  12734. private int anInt1222;
  12735. public static boolean inputTaken;
  12736. private int inputDialogState;
  12737. private static int anInt1226;
  12738. private int nextSong;
  12739. private boolean songChanging;
  12740. private final int[] anIntArray1229;
  12741. private Class11[] aClass11Array1230;
  12742. public static int anIntArray1232[];
  12743. private boolean aBoolean1233;
  12744. private int[] anIntArray1234;
  12745. private int[] anIntArray1235;
  12746. private int[] anIntArray1236;
  12747. private int anInt1237;
  12748. private int anInt1238;
  12749. public final int anInt1239 = 100;
  12750. private final int[] anIntArray1240;
  12751. private final int[] anIntArray1241;
  12752. private boolean aBoolean1242;
  12753. private int atInventoryLoopCycle;
  12754. private int atInventoryInterface;
  12755. private int atInventoryIndex;
  12756. private int atInventoryInterfaceType;
  12757. private byte[][] aByteArrayArray1247;
  12758. private int tradeMode;
  12759. private int anInt1249;
  12760. private final int[] anIntArray1250;
  12761. private int anInt1251;
  12762. private final boolean rsAlreadyLoaded;
  12763. private int anInt1253;
  12764. private int anInt1254;
  12765. private boolean welcomeScreenRaised;
  12766. private boolean messagePromptRaised;
  12767. private int anInt1257;
  12768. private byte[][][] byteGroundArray;
  12769. private int prevSong;
  12770. private int destX;
  12771. private int destY;
  12772. private Sprite aClass30_Sub2_Sub1_Sub1_1263;
  12773. private int anInt1264;
  12774. private int anInt1265;
  12775. private String loginMessage1;
  12776. private String loginMessage2;
  12777. private int anInt1268;
  12778. private int anInt1269;
  12779. private TextDrawingArea smallText;
  12780. private TextDrawingArea aTextDrawingArea_1271;
  12781. private TextDrawingArea chatTextDrawingArea;
  12782. private int anInt1275;
  12783. private int backDialogID;
  12784. private int anInt1278;
  12785. private int anInt1279;
  12786. private int[] bigX;
  12787. private int[] bigY;
  12788. private int itemSelected;
  12789. private int anInt1283;
  12790. private int anInt1284;
  12791. private int anInt1285;
  12792. private String selectedItemName;
  12793. private int publicChatMode;
  12794. private static int anInt1288;
  12795. private int anInt1289;
  12796. public static int anInt1290;
  12797. public static String server = "";
  12798.  
  12799. static
  12800. {
  12801. anIntArray1019 = new int[99];
  12802. int i = 0;
  12803. for(int j = 0; j < 99; j++)
  12804. {
  12805. int l = j + 1;
  12806. int i1 = (int)((double)l + 300D * Math.pow(2D, (double)l / 7D));
  12807. i += i1;
  12808. anIntArray1019[j] = i / 4;
  12809. }
  12810.  
  12811. anIntArray1232 = new int[32];
  12812. i = 2;
  12813. for(int k = 0; k < 32; k++)
  12814. {
  12815. anIntArray1232[k] = i - 1;
  12816. i += i;
  12817. }
  12818.  
  12819. }
  12820. }
Advertisement
Add Comment
Please, Sign In to add comment