Guest User

Untitled

a guest
Jul 17th, 2015
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 384.30 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. import java.lang.reflect.Method;
  12. import sign.signlink;
  13. import javax.swing.*;
  14.  
  15. public class client extends RSApplet {
  16.  
  17.  
  18. public int MapX, MapY;
  19. public static int spellID = 0;
  20. public static boolean newDamage = false;
  21. private static String intToKOrMilLongName(int i) {
  22. String s = String.valueOf(i);
  23. for(int k = s.length() - 3; k > 0; k -= 3)
  24. s = s.substring(0, k) + "," + s.substring(k);
  25.  
  26. //if(j != 0)
  27. // aBoolean1224 = !aBoolean1224;
  28. if(s.length() > 8)
  29. s = "@gre@" + s.substring(0, s.length() - 8) + " million @whi@(" + s + ")";
  30. else
  31. if(s.length() > 4)
  32. s = "@cya@" + s.substring(0, s.length() - 4) + "K @whi@(" + s + ")";
  33. return " " + s;
  34. }
  35. public final String methodR(/*int i,*/ int j)
  36. {
  37. //if(i <= 0)
  38. // pktType = inStream.readUnsignedByte();
  39. if(j >= 0 && j < 10000)
  40. return String.valueOf(j);
  41. if(j >= 10000 && j < 10000000)
  42. return j / 1000 + "K";
  43. if(j >= 10000000 && j < 999999999)
  44. return j / 1000000 + "M";
  45. if(j >= 999999999)
  46. return "*";
  47. else
  48. return "?";
  49. }
  50. public void loadExtraSprites() {
  51. for(int k = 1; k <= 15; k++)
  52. ORBS[k] = new Sprite((new StringBuilder()).append("Frame/ORBS ").append(k).append("").toString());
  53. }
  54. public void drawWorldMapButton() {
  55. worldMapIcon.drawSprite(8, 124);
  56. }
  57. public static void writeSettings() throws IOException {
  58. try {
  59. DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(signlink.findcachedir() + "settings.dat")));
  60. out.writeUTF(myUsername);
  61. out.writeUTF(myPassword);
  62. out.close();
  63. } catch(Exception e) { }
  64. }
  65.  
  66. public static void readSettings() throws IOException {
  67. try {
  68. DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream(signlink.findcachedir() + "settings.dat")));
  69. myUsername = in.readUTF();
  70. myPassword = in.readUTF();
  71. in.close();
  72. } catch(Exception e) { }
  73. }
  74. private void rightClickMapArea() {
  75. if(super.mouseX >= 742 && super.mouseX <= 764 && super.mouseY >= 1 && super.mouseY <= 23 && tabInterfaceIDs[10] != -1) {
  76. menuActionName[1] = "Logout";
  77. menuActionID[1] = 1004;
  78. menuActionRow = 2;
  79. } else if (super.mouseX > 713 && super.mouseX < 765 && super.mouseY > 83 && super.mouseY < 118) {
  80. menuActionName[1] = "Run";
  81. menuActionID[1] = 1051;
  82. menuActionRow = 2;
  83. }
  84. }
  85. public static final byte[] ReadFile(String s) {
  86. try {
  87. byte abyte0[];
  88. File file = new File(s);
  89. int i = (int)file.length();
  90. abyte0 = new byte[i];
  91. DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new FileInputStream(s)));
  92. datainputstream.readFully(abyte0, 0, i);
  93. datainputstream.close();
  94. return abyte0;
  95. } catch(Exception e) {
  96. System.out.println((new StringBuilder()).append("Read Error: ").append(s).toString());
  97. return null;
  98. }
  99. }
  100.  
  101. public void models() {
  102. for(int ModelIndex = 0; ModelIndex < 29191; ModelIndex++) {
  103. byte[] abyte0 = getModel(ModelIndex);
  104. if(abyte0 != null && abyte0.length > 0) {
  105. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  106. pushMessage("Model added successfully!", 0, "");
  107. }
  108. }
  109. }
  110. public int getOrbTextColor(int statusInt){
  111. if(statusInt >= 75){
  112. return 0x00FF00;
  113. } else if(statusInt >= 50 && statusInt <= 74){
  114. return 0xFFFF00;
  115. } else if(statusInt >= 25 && statusInt <= 49){
  116. return 0xFF981F;
  117. } else {
  118. return 0xFF0000;
  119. }
  120. }
  121.  
  122. public int getOrbFill(int statusInt){
  123. if(statusInt <= 100 && statusInt >= 97) {
  124. return 0;
  125. } else if(statusInt <= 96 && statusInt >= 93) {
  126. return 1;
  127. } else if(statusInt <= 92 && statusInt >= 89) {
  128. return 2;
  129. } else if(statusInt <= 88 && statusInt >= 85) {
  130. return 3;
  131. } else if(statusInt <= 84 && statusInt >= 81) {
  132. return 4;
  133. } else if(statusInt <= 80 && statusInt >= 77) {
  134. return 5;
  135. } else if(statusInt <= 76 && statusInt >= 73) {
  136. return 6;
  137. } else if(statusInt <= 72 && statusInt >= 69) {
  138. return 7;
  139. } else if(statusInt <= 68 && statusInt >= 65) {
  140. return 8;
  141. } else if(statusInt <= 64 && statusInt >= 61) {
  142. return 9;
  143. } else if(statusInt <= 60 && statusInt >= 57) {
  144. return 10;
  145. } else if(statusInt <= 56 && statusInt >= 53) {
  146. return 11;
  147. } else if(statusInt <= 52 && statusInt >= 49) {
  148. return 12;
  149. } else if(statusInt <= 48 && statusInt >= 45) {
  150. return 13;
  151. } else if(statusInt <= 44 && statusInt >= 41) {
  152. return 14;
  153. } else if(statusInt <= 40 && statusInt >= 37) {
  154. return 15;
  155. } else if(statusInt <= 36 && statusInt >= 33) {
  156. return 16;
  157. } else if(statusInt <= 32 && statusInt >= 29) {
  158. return 17;
  159. } else if(statusInt <= 28 && statusInt >= 25) {
  160. return 18;
  161. } else if(statusInt <= 24 && statusInt >= 21) {
  162. return 19;
  163. } else if(statusInt <= 20 && statusInt >= 17) {
  164. return 20;
  165. } else if(statusInt <= 16 && statusInt >= 13) {
  166. return 21;
  167. } else if(statusInt <= 12 && statusInt >= 9) {
  168. return 22;
  169. } else if(statusInt <= 8 && statusInt >= 7) {
  170. return 23;
  171. } else if(statusInt <= 6 && statusInt >= 5) {
  172. return 24;
  173. } else if(statusInt <= 4 && statusInt >= 3) {
  174. return 25;
  175. } else if(statusInt <= 2 && statusInt >= 1) {
  176. return 26;
  177. } else if(statusInt <= 0) {
  178. return 27;
  179. }
  180. return 0;
  181. }
  182. public byte[] getModel(int Index) {
  183. try {
  184. File Model = new File("./model/"+Index+".gz");
  185. byte[] aByte = new byte[(int)Model.length()];
  186. FileInputStream fis = new FileInputStream(Model);
  187. fis.read(aByte);
  188. pushMessage("aByte = ["+aByte+"]!", 0, "");
  189. fis.close();
  190. return aByte;
  191. }
  192. catch(Exception e)
  193. {return null;}
  194. }
  195.  
  196. private void stopMidi() {
  197. signlink.midifade = 0;
  198. signlink.midi = "stop";
  199. }
  200.  
  201. private boolean menuHasAddFriend(int j) {
  202. if(j < 0)
  203. return false;
  204. int k = menuActionID[j];
  205. if(k >= 2000)
  206. k -= 2000;
  207. return k == 337;
  208. }
  209.  
  210. public void drawChannelButtons() {
  211. String text[] = { "On", "Friends", "Off", "Hide" };
  212. int textColor[] = { 65280, 0xffff00, 0xff0000, 65535 };
  213. switch(cButtonCPos) {
  214. case 0:
  215. chatButtons[1].drawSprite(5, 142);
  216. break;
  217. case 1:
  218. chatButtons[1].drawSprite(71, 142);
  219. break;
  220. case 2:
  221. chatButtons[1].drawSprite(137, 142);
  222. break;
  223. case 3:
  224. chatButtons[1].drawSprite(203, 142);
  225. break;
  226. case 4:
  227. chatButtons[1].drawSprite(269, 142);
  228. break;
  229. case 5:
  230. chatButtons[1].drawSprite(335, 142);
  231. break;
  232. }
  233. if(cButtonHPos == cButtonCPos) {
  234. switch(cButtonHPos) {
  235. case 0:
  236. chatButtons[2].drawSprite(5, 142);
  237. break;
  238. case 1:
  239. chatButtons[2].drawSprite(71, 142);
  240. break;
  241. case 2:
  242. chatButtons[2].drawSprite(137, 142);
  243. break;
  244. case 3:
  245. chatButtons[2].drawSprite(203, 142);
  246. break;
  247. case 4:
  248. chatButtons[2].drawSprite(269, 142);
  249. break;
  250. case 5:
  251. chatButtons[2].drawSprite(335, 142);
  252. break;
  253. case 6:
  254. chatButtons[3].drawSprite(404, 142);
  255. break;
  256. }
  257. } else {
  258. switch(cButtonHPos) {
  259. case 0:
  260. chatButtons[0].drawSprite(5, 142);
  261. break;
  262. case 1:
  263. chatButtons[0].drawSprite(71, 142);
  264. break;
  265. case 2:
  266. chatButtons[0].drawSprite(137, 142);
  267. break;
  268. case 3:
  269. chatButtons[0].drawSprite(203, 142);
  270. break;
  271. case 4:
  272. chatButtons[0].drawSprite(269, 142);
  273. break;
  274. case 5:
  275. chatButtons[0].drawSprite(335, 142);
  276. break;
  277. case 6:
  278. chatButtons[3].drawSprite(404, 142);
  279. break;
  280. }
  281. }
  282. smallText.method389(true, 425, 0xffffff, "Report Abuse", 157);
  283. smallText.method389(true, 26, 0xffffff, "All", 157);
  284. smallText.method389(true, 86, 0xffffff, "Game", 157);
  285. smallText.method389(true, 150, 0xffffff, "Public", 152);
  286. smallText.method389(true, 212, 0xffffff, "Private", 152);
  287. smallText.method389(true, 286, 0xffffff, "Clan", 152);
  288. smallText.method389(true, 349, 0xffffff, "Trade", 152);
  289. smallText.method382(textColor[publicChatMode], 164, text[publicChatMode], 163, true);
  290. smallText.method382(textColor[privateChatMode], 230, text[privateChatMode], 163, true);
  291. smallText.method382(textColor[clanChatMode], 296, text[clanChatMode], 163, true);
  292. smallText.method382(textColor[tradeMode], 362, text[tradeMode], 163, true);
  293. }
  294.  
  295. private void drawChatArea() {
  296. aRSImageProducer_1166.initDrawingArea();
  297. Texture.anIntArray1472 = anIntArray1180;
  298. chatArea.drawSprite(0, 0);
  299. drawChannelButtons();
  300. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  301. if(messagePromptRaised) {
  302. chatTextDrawingArea.drawText(0, aString1121, 60, 259);
  303. chatTextDrawingArea.drawText(128, promptInput + "*", 80, 259);
  304. } else if(inputDialogState == 1) {
  305. chatTextDrawingArea.drawText(0, "Enter amount:", 60, 259);
  306. chatTextDrawingArea.drawText(128, amountOrNameInput + "*", 80, 259);
  307. } else if(inputDialogState == 2) {
  308. chatTextDrawingArea.drawText(0, "Enter name:", 60, 259);
  309. chatTextDrawingArea.drawText(128, amountOrNameInput + "*", 80, 259);
  310. } else if(aString844 != null) {
  311. chatTextDrawingArea.drawText(0, aString844, 60, 259);
  312. chatTextDrawingArea.drawText(128, "Click to continue", 80, 259);
  313. } else if(backDialogID != -1) {
  314. drawInterface(0, 20, RSInterface.interfaceCache[backDialogID], 20);
  315. } else if(dialogID != -1) {
  316. drawInterface(0, 20, RSInterface.interfaceCache[dialogID], 20);
  317. } else {
  318. int j77 = -3;
  319. int j = 0;
  320. DrawingArea.setDrawingArea(122, 8, 497, 7);
  321. for(int k = 0; k < 500; k++)
  322. if(chatMessages[k] != null) {
  323. int chatType = chatTypes[k];
  324. int yPos = (70 - j77 * 14) + anInt1089 + 5;
  325. String s1 = chatNames[k];
  326. byte byte0 = 0;
  327. if (s1 != null && s1.startsWith("@cr0@")) {
  328. s1 = s1.substring(5);
  329. byte0 = 0;
  330. }
  331. if(s1 != null && s1.startsWith("@cr1@")) {
  332. s1 = s1.substring(5);
  333. byte0 = 1;
  334. if (s1 != null && s1.startsWith("@cr3@")) {
  335. s1 = s1.substring(5);
  336. byte0 = 3;
  337. }
  338. if (s1 != null && s1.startsWith("@cr4@")) {
  339. s1 = s1.substring(5);
  340. byte0 = 4;
  341. }
  342. } else if(s1 != null && s1.startsWith("@cr2@")) {
  343. s1 = s1.substring(5);
  344. byte0 = 2;
  345. } else if(s1 != null && s1.startsWith("@cr3@")) {
  346. s1 = s1.substring(5);
  347. byte0 = 3;
  348. }
  349. if(chatType == 0) {
  350. if (chatTypeView == 5 || chatTypeView == 0) {
  351. if(yPos > 0 && yPos < 210)
  352. textDrawingArea.method389(false, 11, 0, chatMessages[k], yPos);//chat color enabled
  353. j++;
  354. j77++;
  355. }
  356. }
  357. if((chatType == 1 || chatType == 2) && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
  358. if (chatTypeView == 1 || chatTypeView == 0) {
  359. if(yPos > 0 && yPos < 210) {
  360. int xPos = 11;
  361. if(byte0 == 1) {
  362. modIcons[0].drawBackground(xPos + 1, yPos - 12);
  363. xPos += 14;
  364. } else if(byte0 == 2) {
  365. modIcons[1].drawBackground(xPos + 1, yPos - 12);
  366. xPos += 14;
  367. } else if(byte0 == 3) {
  368. modIcons[2].drawBackground(xPos + 1, yPos - 12);
  369. xPos += 14;
  370. } else if(byte0 == 4) {
  371. modIcons[3].drawBackground(xPos + 1, yPos - 12);
  372. xPos += 14;
  373. }
  374. textDrawingArea.method385(0, s1 + ":", yPos, xPos);
  375. xPos += textDrawingArea.getTextWidth(s1) + 8;
  376. textDrawingArea.method389(false, xPos, 255, chatMessages[k], yPos);
  377. }
  378. j++;
  379. j77++;
  380. }
  381. }
  382. if((chatType == 3 || chatType == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1))) {
  383. if (chatTypeView == 2 || chatTypeView == 0) {
  384. if(yPos > 0 && yPos < 210) {
  385. int k1 = 11;
  386. textDrawingArea.method385(0, "From", yPos, k1);
  387. k1 += textDrawingArea.getTextWidth("From ");
  388. if(byte0 == 1) {
  389. modIcons[0].drawBackground(k1, yPos - 12);
  390. k1 += 12;
  391. } else if(byte0 == 2) {
  392. modIcons[1].drawBackground(k1, yPos - 12);
  393. k1 += 12;
  394. } else if(byte0 == 3) {
  395. modIcons[2].drawBackground(k1, yPos - 12);
  396. k1 += 12;
  397. } else if(byte0 == 4) {
  398. modIcons[3].drawBackground(k1, yPos - 12);
  399. k1 += 12;
  400. }
  401. textDrawingArea.method385(0, s1 + ":", yPos, k1);
  402. k1 += textDrawingArea.getTextWidth(s1) + 8;
  403. textDrawingArea.method385(0x800000, chatMessages[k], yPos, k1);
  404. }
  405. j++;
  406. j77++;
  407. }
  408. }
  409. if(chatType == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  410. if (chatTypeView == 3 || chatTypeView == 0) {
  411. if(yPos > 0 && yPos < 210)
  412. textDrawingArea.method385(0x800080, s1 + " " + chatMessages[k], yPos, 11);
  413. j++;
  414. j77++;
  415. }
  416. }
  417. if(chatType == 5 && splitPrivateChat == 0 && privateChatMode < 2) {
  418. if (chatTypeView == 2 || chatTypeView == 0) {
  419. if(yPos > 0 && yPos < 210)
  420. textDrawingArea.method385(0x800000, chatMessages[k], yPos, 11);
  421. j++;
  422. j77++;
  423. }
  424. }
  425. if(chatType == 6 && (splitPrivateChat == 0 || chatTypeView == 2) && privateChatMode < 2) {
  426. if (chatTypeView == 2 || chatTypeView == 0) {
  427. if(yPos > 0 && yPos < 210) {
  428. textDrawingArea.method385(0, "To " + s1 + ":", yPos, 11);
  429. textDrawingArea.method385(0x800000, chatMessages[k], yPos, 15 + textDrawingArea.getTextWidth("To :" + s1));
  430. }
  431. j++;
  432. j77++;
  433. }
  434. }
  435. if(chatType == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  436. if (chatTypeView == 3 || chatTypeView == 0) {
  437. if(yPos > 0 && yPos < 210)
  438. textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], yPos, 11);
  439. j++;
  440. j77++;
  441. }
  442. if(chatType == 11 && (clanChatMode == 0)) {
  443. if (chatTypeView == 11) {
  444. if(yPos > 0 && yPos < 210)
  445. textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], yPos, 11);
  446. j++;
  447. j77++;
  448. }
  449. if(chatType == 12) {
  450. if(yPos > 0 && yPos < 110)
  451. textDrawingArea.method385(0x7e3200, chatMessages[k] + " @blu@" + s1, yPos, 11);
  452. j++;
  453. }
  454. }
  455. }
  456. if(chatType == 16) {
  457. int j2 = 40;
  458. int clanNameWidth = textDrawingArea.getTextWidth(clanname);
  459. if(chatTypeView == 11 || chatTypeView == 0) {
  460. if(yPos > 3 && yPos < 130)
  461. switch(chatRights[k]) {
  462. case 1:
  463. j2 += clanNameWidth;
  464. modIcons[0].drawBackground(j2 - 18, yPos - 12);
  465. j2 += 14;
  466. break;
  467.  
  468. case 2:
  469. j2 += clanNameWidth;
  470. modIcons[1].drawBackground(j2 - 18, yPos - 12);
  471. j2 += 14;
  472. break;
  473.  
  474. case 3:
  475. j2 += clanNameWidth;
  476. modIcons[1].drawBackground(j2 - 18, yPos - 12);
  477. j2 += 14;
  478. break;
  479. case 4:
  480. j2 += clanNameWidth;
  481. modIcons[2].drawBackground(j2 - 18, yPos - 12);
  482. j2 += 14;
  483. break;
  484.  
  485. default:
  486. j2 += clanNameWidth;
  487. break;
  488. }
  489. textDrawingArea.method385(0, "[", yPos, 8);
  490. textDrawingArea.method385(255, ""+clanname+"", yPos, 14);
  491. textDrawingArea.method385(0, "]", yPos, clanNameWidth + 14);
  492.  
  493. textDrawingArea.method385(0, chatNames[k]+":", yPos, j2 - 17); //j2
  494. j2 += textDrawingArea.getTextWidth(chatNames[k]) + 7;
  495. textDrawingArea.method385(0x800000, chatMessages[k], yPos, j2 - 16);//j2
  496. j++;
  497. j77++;
  498. }
  499. }
  500. }
  501. DrawingArea.defaultDrawingAreaSize();
  502. anInt1211 = j * 14 + 7 + 5;
  503. if(anInt1211 < 111)
  504. anInt1211 = 111;
  505. drawScrollbar(114, anInt1211 - anInt1089 - 113, 7, 496, anInt1211);
  506. String s;
  507. if(myPlayer != null && myPlayer.name != null)
  508. s = myPlayer.name;
  509. else
  510. s = TextClass.fixName(myUsername);
  511. textDrawingArea.method385(0, s + ":", 133, 11);
  512. textDrawingArea.drawChatInput(255, 12 + textDrawingArea.getTextWidth(s + ": "), inputString + "*", 133, false);
  513. DrawingArea.method339(121, 0x807660, 506, 7);
  514. }
  515. if(menuOpen && menuScreenArea == 2) {
  516. drawMenu();
  517. }
  518. aRSImageProducer_1166.drawGraphics(338, super.graphics, 0);
  519. aRSImageProducer_1165.initDrawingArea();
  520. Texture.anIntArray1472 = anIntArray1182;
  521. }
  522.  
  523. public void init() {
  524. try {
  525. nodeID = 10;
  526. portOff = 0;
  527. setLowMem();
  528. isMembers = true;
  529. signlink.storeid = 32;
  530. signlink.startpriv(InetAddress.getLocalHost());
  531. initClientFrame(505,767);
  532. readSettings();
  533. }
  534. catch (Exception exception) {
  535. return;
  536. }
  537. }
  538.  
  539. public void startRunnable(Runnable runnable, int i) {
  540. if(i > 10)
  541. i = 10;
  542. if(signlink.mainapp != null) {
  543. signlink.startthread(runnable, i);
  544. } else {
  545. super.startRunnable(runnable, i);
  546. }
  547. }
  548.  
  549. public Socket openSocket(int port) throws IOException {
  550. return new Socket(InetAddress.getByName(server), port);
  551. }
  552.  
  553. private void processMenuClick() {
  554. if(activeInterfaceType != 0)
  555. return;
  556. int j = super.clickMode3;
  557. if(spellSelected == 1 && super.saveClickX >= 516 && super.saveClickY >= 160 && super.saveClickX <= 765 && super.saveClickY <= 205)
  558. j = 0;
  559. if(menuOpen) {
  560. if(j != 1) {
  561. int k = super.mouseX;
  562. int j1 = super.mouseY;
  563. if(menuScreenArea == 0) {
  564. k -= 4;
  565. j1 -= 4;
  566. }
  567. if(menuScreenArea == 1) {
  568. k -= 519;
  569. j1 -= 168;
  570. }
  571. if(menuScreenArea == 2) {
  572. k -= 17;
  573. j1 -= 338;
  574. }
  575. if(menuScreenArea == 3) {
  576. k -= 519;
  577. j1 -= 0;
  578. }
  579. if(k < menuOffsetX - 10 || k > menuOffsetX + menuWidth + 10 || j1 < menuOffsetY - 10 || j1 > menuOffsetY + menuHeight + 10) {
  580. menuOpen = false;
  581. if(menuScreenArea == 1)
  582. needDrawTabArea = true;
  583. if(menuScreenArea == 2)
  584. inputTaken = true;
  585. }
  586. }
  587. if(j == 1) {
  588. int l = menuOffsetX;
  589. int k1 = menuOffsetY;
  590. int i2 = menuWidth;
  591. int k2 = super.saveClickX;
  592. int l2 = super.saveClickY;
  593. if(menuScreenArea == 0) {
  594. k2 -= 4;
  595. l2 -= 4;
  596. }
  597. if(menuScreenArea == 1) {
  598. k2 -= 519;
  599. l2 -= 168;
  600. }
  601. if(menuScreenArea == 2) {
  602. k2 -= 17;
  603. l2 -= 338;
  604. }
  605. if(menuScreenArea == 3) {
  606. k2 -= 519;
  607. l2 -= 0;
  608. }
  609. int i3 = -1;
  610. for(int j3 = 0; j3 < menuActionRow; j3++) {
  611. int k3 = k1 + 31 + (menuActionRow - 1 - j3) * 15;
  612. if(k2 > l && k2 < l + i2 && l2 > k3 - 13 && l2 < k3 + 3)
  613. i3 = j3;
  614. }
  615. System.out.println(i3);
  616. if(i3 != -1)
  617. doAction(i3);
  618. menuOpen = false;
  619. if(menuScreenArea == 1)
  620. needDrawTabArea = true;
  621. if(menuScreenArea == 2) {
  622. inputTaken = true;
  623. }
  624. }
  625. } else {
  626. if(j == 1 && menuActionRow > 0) {
  627. int i1 = menuActionID[menuActionRow - 1];
  628. 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) {
  629. int l1 = menuActionCmd2[menuActionRow - 1];
  630. int j2 = menuActionCmd3[menuActionRow - 1];
  631. RSInterface class9 = RSInterface.interfaceCache[j2];
  632. if(class9.aBoolean259 || class9.aBoolean235) {
  633. aBoolean1242 = false;
  634. anInt989 = 0;
  635. anInt1084 = j2;
  636. anInt1085 = l1;
  637. activeInterfaceType = 2;
  638. anInt1087 = super.saveClickX;
  639. anInt1088 = super.saveClickY;
  640. if(RSInterface.interfaceCache[j2].parentID == openInterfaceID)
  641. activeInterfaceType = 1;
  642. if(RSInterface.interfaceCache[j2].parentID == backDialogID)
  643. activeInterfaceType = 3;
  644. return;
  645. }
  646. }
  647. }
  648. if(j == 1 && (anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  649. j = 2;
  650. if(j == 1 && menuActionRow > 0)
  651. doAction(menuActionRow - 1);
  652. if(j == 2 && menuActionRow > 0)
  653. determineMenuSize();
  654. }
  655. }
  656.  
  657.  
  658. public static int totalRead = 0;
  659.  
  660. public static String getFileNameWithoutExtension(String fileName) {
  661. File tmpFile = new File(fileName);
  662. tmpFile.getName();
  663. int whereDot = tmpFile.getName().lastIndexOf('.');
  664. if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2 ) {
  665. return tmpFile.getName().substring(0, whereDot);
  666. }
  667. return "";
  668. }
  669.  
  670. public void preloadModels() {
  671. String b = System.getProperty("user.home");
  672. File file = new File("/WBCache/Raw/");
  673. File[] fileArray = file.listFiles();
  674. for(int y = 0; y < fileArray.length; y++) {
  675. String s = fileArray[y].getName();
  676. byte[] buffer = ReadFile("/WBCache/Raw/"+s);
  677. Model.method460(buffer,Integer.parseInt(getFileNameWithoutExtension(s)));
  678. }
  679. }
  680.  
  681.  
  682.  
  683. private void saveMidi(boolean flag, byte abyte0[])
  684. {
  685. signlink.midifade = flag ? 1 : 0;
  686. signlink.midisave(abyte0, abyte0.length);
  687. }
  688.  
  689. private void method22()
  690. {
  691. try
  692. {
  693. anInt985 = -1;
  694. aClass19_1056.removeAll();
  695. aClass19_1013.removeAll();
  696. Texture.method366();
  697. unlinkMRUNodes();
  698. worldController.initToNull();
  699. System.gc();
  700. for(int i = 0; i < 4; i++)
  701. aClass11Array1230[i].method210();
  702.  
  703. for(int l = 0; l < 4; l++)
  704. {
  705. for(int k1 = 0; k1 < 104; k1++)
  706. {
  707. for(int j2 = 0; j2 < 104; j2++)
  708. byteGroundArray[l][k1][j2] = 0;
  709.  
  710. }
  711.  
  712. }
  713.  
  714. ObjectManager objectManager = new ObjectManager(byteGroundArray, intGroundArray);
  715. int k2 = aByteArrayArray1183.length;
  716. stream.createFrame(0);
  717. if(!aBoolean1159)
  718. {
  719. for(int i3 = 0; i3 < k2; i3++)
  720. {
  721. int i4 = (anIntArray1234[i3] >> 8) * 64 - baseX;
  722. int k5 = (anIntArray1234[i3] & 0xff) * 64 - baseY;
  723. byte abyte0[] = aByteArrayArray1183[i3];
  724. if (FileOperations.FileExists(signlink.findcachedir()+"maps/"+anIntArray1235[i3]+".dat"))
  725. abyte0 = FileOperations.ReadFile(signlink.findcachedir()+"maps/"+anIntArray1235[i3]+".dat");
  726. if(abyte0 != null)
  727. objectManager.method180(abyte0, k5, i4, (anInt1069 - 6) * 8, (anInt1070 - 6) * 8, aClass11Array1230);
  728. }
  729.  
  730. for(int j4 = 0; j4 < k2; j4++)
  731. {
  732. int l5 = (anIntArray1234[j4] >> 8) * 64 - baseX;
  733. int k7 = (anIntArray1234[j4] & 0xff) * 64 - baseY;
  734. byte abyte2[] = aByteArrayArray1183[j4];
  735. if(abyte2 == null && anInt1070 < 800)
  736. objectManager.method174(k7, 64, 64, l5);
  737. }
  738.  
  739. anInt1097++;
  740. if(anInt1097 > 160)
  741. {
  742. anInt1097 = 0;
  743. stream.createFrame(238);
  744. stream.writeWordBigEndian(96);
  745. }
  746. stream.createFrame(0);
  747. for(int i6 = 0; i6 < k2; i6++)
  748. {
  749. byte abyte1[] = aByteArrayArray1247[i6];
  750. if(abyte1 != null)
  751. {
  752. int l8 = (anIntArray1234[i6] >> 8) * 64 - baseX;
  753. int k9 = (anIntArray1234[i6] & 0xff) * 64 - baseY;
  754. objectManager.method190(l8, aClass11Array1230, k9, worldController, abyte1);
  755. }
  756. }
  757.  
  758. }
  759. if(aBoolean1159)
  760. {
  761. for(int j3 = 0; j3 < 4; j3++)
  762. {
  763. for(int k4 = 0; k4 < 13; k4++)
  764. {
  765. for(int j6 = 0; j6 < 13; j6++)
  766. {
  767. int l7 = anIntArrayArrayArray1129[j3][k4][j6];
  768. if(l7 != -1)
  769. {
  770. int i9 = l7 >> 24 & 3;
  771. int l9 = l7 >> 1 & 3;
  772. int j10 = l7 >> 14 & 0x3ff;
  773. int l10 = l7 >> 3 & 0x7ff;
  774. int j11 = (j10 / 8 << 8) + l10 / 8;
  775. for(int l11 = 0; l11 < anIntArray1234.length; l11++)
  776. {
  777. if(anIntArray1234[l11] != j11 || aByteArrayArray1183[l11] == null)
  778. continue;
  779. objectManager.method179(i9, l9, aClass11Array1230, k4 * 8, (j10 & 7) * 8, aByteArrayArray1183[l11], (l10 & 7) * 8, j3, j6 * 8);
  780. break;
  781. }
  782.  
  783. }
  784. }
  785.  
  786. }
  787.  
  788. }
  789.  
  790. for(int l4 = 0; l4 < 13; l4++)
  791. {
  792. for(int k6 = 0; k6 < 13; k6++)
  793. {
  794. int i8 = anIntArrayArrayArray1129[0][l4][k6];
  795. if(i8 == -1)
  796. objectManager.method174(k6 * 8, 8, 8, l4 * 8);
  797. }
  798.  
  799. }
  800.  
  801. stream.createFrame(0);
  802. for(int l6 = 0; l6 < 4; l6++)
  803. {
  804. for(int j8 = 0; j8 < 13; j8++)
  805. {
  806. for(int j9 = 0; j9 < 13; j9++)
  807. {
  808. int i10 = anIntArrayArrayArray1129[l6][j8][j9];
  809. if(i10 != -1)
  810. {
  811. int k10 = i10 >> 24 & 3;
  812. int i11 = i10 >> 1 & 3;
  813. int k11 = i10 >> 14 & 0x3ff;
  814. int i12 = i10 >> 3 & 0x7ff;
  815. int j12 = (k11 / 8 << 8) + i12 / 8;
  816. for(int k12 = 0; k12 < anIntArray1234.length; k12++)
  817. {
  818. if(anIntArray1234[k12] != j12 || aByteArrayArray1247[k12] == null)
  819. continue;
  820. //objectManager.method183(aClass11Array1230, worldController, k10, j8 * 8, (i12 & 7) * 8, l6, aByteArrayArray1247[k12], (k11 & 7) * 8, i11, j9 * 8);
  821. byte abyte0[] = aByteArrayArray1247[k12];
  822. if (FileOperations.FileExists(signlink.findcachedir()+"maps/"+anIntArray1235[k12]+".dat"))
  823. abyte0 = FileOperations.ReadFile(signlink.findcachedir()+"maps/"+anIntArray1235[k12]+".dat");
  824. objectManager.method183(aClass11Array1230, worldController, k10, j8 * 8, (i12 & 7) * 8, l6, aByteArrayArray1247[k12], (k11 & 7) * 8, i11, j9 * 8);
  825. break;
  826. }
  827.  
  828. }
  829. }
  830.  
  831. }
  832.  
  833. }
  834.  
  835. }
  836. stream.createFrame(0);
  837. objectManager.method171(aClass11Array1230, worldController);
  838. aRSImageProducer_1165.initDrawingArea();
  839. stream.createFrame(0);
  840. int k3 = ObjectManager.anInt145;
  841. if(k3 > plane)
  842. k3 = plane;
  843. if(k3 < plane - 1)
  844. k3 = plane - 1;
  845. if(lowMem)
  846. worldController.method275(ObjectManager.anInt145);
  847. else
  848. worldController.method275(0);
  849. for(int i5 = 0; i5 < 104; i5++)
  850. {
  851. for(int i7 = 0; i7 < 104; i7++)
  852. spawnGroundItem(i5, i7);
  853.  
  854. }
  855.  
  856. anInt1051++;
  857. if(anInt1051 > 98)
  858. {
  859. anInt1051 = 0;
  860. stream.createFrame(150);
  861. }
  862. method63();
  863. }
  864. catch(Exception exception) { }
  865. ObjectDef.mruNodes1.unlinkAll();
  866. if(super.gameFrame != null)
  867. {
  868. stream.createFrame(210);
  869. stream.writeDWord(0x3f008edd);
  870. }
  871. if(lowMem && signlink.cache_dat != null)
  872. {
  873. int j = onDemandFetcher.getVersionCount(0);
  874. for(int i1 = 0; i1 < j; i1++)
  875. {
  876. int l1 = onDemandFetcher.getModelIndex(i1);
  877. if((l1 & 0x79) == 0)
  878. Model.method461(i1);
  879. }
  880.  
  881. }
  882. System.gc();
  883. Texture.method367();
  884. onDemandFetcher.method566();
  885. int k = (anInt1069 - 6) / 8 - 1;
  886. int j1 = (anInt1069 + 6) / 8 + 1;
  887. int i2 = (anInt1070 - 6) / 8 - 1;
  888. int l2 = (anInt1070 + 6) / 8 + 1;
  889. if(aBoolean1141)
  890. {
  891. k = 49;
  892. j1 = 50;
  893. i2 = 49;
  894. l2 = 50;
  895. }
  896. for(int l3 = k; l3 <= j1; l3++)
  897. {
  898. for(int j5 = i2; j5 <= l2; j5++)
  899. if(l3 == k || l3 == j1 || j5 == i2 || j5 == l2)
  900. {
  901. int j7 = onDemandFetcher.method562(0, j5, l3);
  902. if(j7 != -1)
  903. onDemandFetcher.method560(j7, 3);
  904. int k8 = onDemandFetcher.method562(1, j5, l3);
  905. if(k8 != -1)
  906. onDemandFetcher.method560(k8, 3);
  907. }
  908.  
  909. }
  910.  
  911. }
  912.  
  913. private void unlinkMRUNodes()
  914. {
  915. ObjectDef.mruNodes1.unlinkAll();
  916. ObjectDef.mruNodes2.unlinkAll();
  917. EntityDef.mruNodes.unlinkAll();
  918. ItemDef.mruNodes2.unlinkAll();
  919. ItemDef.mruNodes1.unlinkAll();
  920. Player.mruNodes.unlinkAll();
  921. SpotAnim.aMRUNodes_415.unlinkAll();
  922. }
  923.  
  924. private void method24(int i)
  925. {
  926. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  927. int j = ai.length;
  928. for(int k = 0; k < j; k++)
  929. ai[k] = 0;
  930.  
  931. for(int l = 1; l < 103; l++)
  932. {
  933. int i1 = 24628 + (103 - l) * 512 * 4;
  934. for(int k1 = 1; k1 < 103; k1++)
  935. {
  936. if((byteGroundArray[i][k1][l] & 0x18) == 0)
  937. worldController.method309(ai, i1, i, k1, l);
  938. if(i < 3 && (byteGroundArray[i + 1][k1][l] & 8) != 0)
  939. worldController.method309(ai, i1, i + 1, k1, l);
  940. i1 += 4;
  941. }
  942.  
  943. }
  944.  
  945. int j1 = ((238 + (int)(Math.random() * 20D)) - 10 << 16) + ((238 + (int)(Math.random() * 20D)) - 10 << 8) + ((238 + (int)(Math.random() * 20D)) - 10);
  946. int l1 = (238 + (int)(Math.random() * 20D)) - 10 << 16;
  947. aClass30_Sub2_Sub1_Sub1_1263.method343();
  948. for(int i2 = 1; i2 < 103; i2++)
  949. {
  950. for(int j2 = 1; j2 < 103; j2++)
  951. {
  952. if((byteGroundArray[i][j2][i2] & 0x18) == 0)
  953. method50(i2, j1, j2, l1, i);
  954. if(i < 3 && (byteGroundArray[i + 1][j2][i2] & 8) != 0)
  955. method50(i2, j1, j2, l1, i + 1);
  956. }
  957.  
  958. }
  959.  
  960. aRSImageProducer_1165.initDrawingArea();
  961. anInt1071 = 0;
  962. for(int k2 = 0; k2 < 104; k2++)
  963. {
  964. for(int l2 = 0; l2 < 104; l2++)
  965. {
  966. int i3 = worldController.method303(plane, k2, l2);
  967. if(i3 != 0)
  968. {
  969. i3 = i3 >> 14 & 0x7fff;
  970. int j3 = ObjectDef.forID(i3).anInt746;
  971. if(j3 >= 0)
  972. {
  973. int k3 = k2;
  974. int l3 = l2;
  975. if(j3 != 22 && j3 != 29 && j3 != 34 && j3 != 36 && j3 != 46 && j3 != 47 && j3 != 48)
  976. {
  977. byte byte0 = 104;
  978. byte byte1 = 104;
  979. int ai1[][] = aClass11Array1230[plane].anIntArrayArray294;
  980. for(int i4 = 0; i4 < 10; i4++)
  981. {
  982. int j4 = (int)(Math.random() * 4D);
  983. if(j4 == 0 && k3 > 0 && k3 > k2 - 3 && (ai1[k3 - 1][l3] & 0x1280108) == 0)
  984. k3--;
  985. if(j4 == 1 && k3 < byte0 - 1 && k3 < k2 + 3 && (ai1[k3 + 1][l3] & 0x1280180) == 0)
  986. k3++;
  987. if(j4 == 2 && l3 > 0 && l3 > l2 - 3 && (ai1[k3][l3 - 1] & 0x1280102) == 0)
  988. l3--;
  989. if(j4 == 3 && l3 < byte1 - 1 && l3 < l2 + 3 && (ai1[k3][l3 + 1] & 0x1280120) == 0)
  990. l3++;
  991. }
  992.  
  993. }
  994. aClass30_Sub2_Sub1_Sub1Array1140[anInt1071] = mapFunctions[j3];
  995. anIntArray1072[anInt1071] = k3;
  996. anIntArray1073[anInt1071] = l3;
  997. anInt1071++;
  998. }
  999. }
  1000. }
  1001.  
  1002. }
  1003.  
  1004. }
  1005.  
  1006. private void spawnGroundItem(int i, int j)
  1007. {
  1008. NodeList class19 = groundArray[plane][i][j];
  1009. if(class19 == null)
  1010. {
  1011. worldController.method295(plane, i, j);
  1012. return;
  1013. }
  1014. int k = 0xfa0a1f01;
  1015. Object obj = null;
  1016. for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  1017. {
  1018. ItemDef itemDef = ItemDef.forID(item.ID);
  1019. int l = itemDef.value;
  1020. if(itemDef.stackable)
  1021. l *= item.anInt1559 + 1;
  1022. // notifyItemSpawn(item, i + baseX, j + baseY);
  1023.  
  1024. if(l > k)
  1025. {
  1026. k = l;
  1027. obj = item;
  1028. }
  1029. }
  1030.  
  1031. class19.insertTail(((Node) (obj)));
  1032. Object obj1 = null;
  1033. Object obj2 = null;
  1034. for(Item class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetFirst(); class30_sub2_sub4_sub2_1 != null; class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetNext())
  1035. {
  1036. if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && obj1 == null)
  1037. obj1 = class30_sub2_sub4_sub2_1;
  1038. if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && class30_sub2_sub4_sub2_1.ID != ((Item) (obj1)).ID && obj2 == null)
  1039. obj2 = class30_sub2_sub4_sub2_1;
  1040. }
  1041.  
  1042. int i1 = i + (j << 7) + 0x60000000;
  1043. worldController.method281(i, i1, ((Animable) (obj1)), method42(plane, j * 128 + 64, i * 128 + 64), ((Animable) (obj2)), ((Animable) (obj)), plane, j);
  1044. }
  1045.  
  1046. private void method26(boolean flag)
  1047. {
  1048. for(int j = 0; j < npcCount; j++)
  1049. {
  1050. NPC npc = npcArray[npcIndices[j]];
  1051. int k = 0x20000000 + (npcIndices[j] << 14);
  1052. if(npc == null || !npc.isVisible() || npc.desc.aBoolean93 != flag)
  1053. continue;
  1054. int l = npc.x >> 7;
  1055. int i1 = npc.y >> 7;
  1056. if(l < 0 || l >= 104 || i1 < 0 || i1 >= 104)
  1057. continue;
  1058. if(npc.anInt1540 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  1059. {
  1060. if(anIntArrayArray929[l][i1] == anInt1265)
  1061. continue;
  1062. anIntArrayArray929[l][i1] = anInt1265;
  1063. }
  1064. if(!npc.desc.aBoolean84)
  1065. k += 0x80000000;
  1066. worldController.method285(plane, npc.anInt1552, method42(plane, npc.y, npc.x), k, npc.y, (npc.anInt1540 - 1) * 64 + 60, npc.x, npc, npc.aBoolean1541);
  1067. }
  1068. }
  1069.  
  1070. private boolean replayWave()
  1071. {
  1072. return signlink.wavereplay();
  1073. }
  1074.  
  1075. private void loadError()
  1076. {
  1077. String s = "ondemand";//was a constant parameter
  1078. System.out.println(s);
  1079. try
  1080. {
  1081. getAppletContext().showDocument(new URL(getCodeBase(), "loaderror_" + s + ".html"));
  1082. }
  1083. catch(Exception exception)
  1084. {
  1085. exception.printStackTrace();
  1086. }
  1087. do
  1088. try
  1089. {
  1090. Thread.sleep(1000L);
  1091. }
  1092. catch(Exception _ex) { }
  1093. while(true);
  1094. }
  1095.  
  1096. public void drawHoverBox(int xPos, int yPos, String text) {
  1097. String[] results = text.split("\n");
  1098. int height = (results.length * 16) + 6;
  1099. int width;
  1100. width = smallText.getTextWidth(results[0]) + 6;
  1101. for(int i = 1; i < results.length; i++)
  1102. if(width <= smallText.getTextWidth(results[i]) + 6)
  1103. width = smallText.getTextWidth(results[i]) + 6;
  1104. DrawingArea.drawPixels(height, yPos, xPos, 0xFFFFA0, width);
  1105. DrawingArea.fillPixels(xPos, width, height, 0, yPos);
  1106. yPos += 14;
  1107. for(int i = 0; i < results.length; i++) {
  1108. smallText.method389(false, xPos + 3, 0, results[i], yPos);
  1109. yPos += 16;
  1110. }
  1111. }
  1112.  
  1113. private void buildInterfaceMenu(int i, RSInterface class9, int k, int l, int i1, int j1)
  1114. {
  1115. if(class9.type != 0 || class9.children == null || class9.isMouseoverTriggered)
  1116. return;
  1117. if(k < i || i1 < l || k > i + class9.width || i1 > l + class9.height)
  1118. return;
  1119. int k1 = class9.children.length;
  1120. for(int l1 = 0; l1 < k1; l1++)
  1121. {
  1122. int i2 = class9.childX[l1] + i;
  1123. int j2 = (class9.childY[l1] + l) - j1;
  1124. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[l1]];
  1125. i2 += class9_1.anInt263;
  1126. j2 += class9_1.anInt265;
  1127. if((class9_1.mOverInterToTrigger >= 0 || class9_1.anInt216 != 0) && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1128. if(class9_1.mOverInterToTrigger >= 0)
  1129. anInt886 = class9_1.mOverInterToTrigger;
  1130. else
  1131. anInt886 = class9_1.id;
  1132. if (class9_1.type == 8 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1133. anInt1315 = class9_1.id;
  1134. }
  1135. if(class9_1.type == 0)
  1136. {
  1137. buildInterfaceMenu(i2, class9_1, k, j2, i1, class9_1.scrollPosition);
  1138. if(class9_1.scrollMax > class9_1.height)
  1139. method65(i2 + class9_1.width, class9_1.height, k, i1, class9_1, j2, true, class9_1.scrollMax);
  1140. } else
  1141. {
  1142. if(class9_1.atActionType == 1 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1143. {
  1144. boolean flag = false;
  1145. if(class9_1.contentType != 0)
  1146. flag = buildFriendsListMenu(class9_1);
  1147. if(!flag)
  1148. {
  1149. //System.out.println("1"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1150. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1151. menuActionID[menuActionRow] = 315;
  1152. menuActionCmd3[menuActionRow] = class9_1.id;
  1153. menuActionRow++;
  1154. }
  1155. }
  1156. if(class9_1.atActionType == 2 && spellSelected == 0 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1157. {
  1158. String s = class9_1.selectedActionName;
  1159. if(s.indexOf(" ") != -1)
  1160. s = s.substring(0, s.indexOf(" "));
  1161. menuActionName[menuActionRow] = s + " @gre@" + class9_1.spellName;
  1162. menuActionID[menuActionRow] = 626;
  1163. menuActionCmd3[menuActionRow] = class9_1.id;
  1164. menuActionRow++;
  1165. }
  1166. if(class9_1.atActionType == 3 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1167. {
  1168. menuActionName[menuActionRow] = "Close";
  1169. menuActionID[menuActionRow] = 200;
  1170. menuActionCmd3[menuActionRow] = class9_1.id;
  1171. menuActionRow++;
  1172. }
  1173. if(class9_1.atActionType == 4 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1174. {
  1175. //System.out.println("2"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1176. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1177. menuActionID[menuActionRow] = 169;
  1178. menuActionCmd3[menuActionRow] = class9_1.id;
  1179. menuActionRow++;
  1180. if (class9_1.hoverText != null) {
  1181. //drawHoverBox(k, l, class9_1.hoverText);
  1182. //System.out.println("DRAWING INTERFACE: " + class9_1.hoverText);
  1183. }
  1184. }
  1185. if(class9_1.atActionType == 5 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1186. {
  1187. //System.out.println("3"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1188. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1189. menuActionID[menuActionRow] = 646;
  1190. menuActionCmd3[menuActionRow] = class9_1.id;
  1191. menuActionRow++;
  1192. }
  1193. if(class9_1.atActionType == 6 && !aBoolean1149 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1194. {
  1195. //System.out.println("4"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1196. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1197. menuActionID[menuActionRow] = 679;
  1198. menuActionCmd3[menuActionRow] = class9_1.id;
  1199. menuActionRow++;
  1200. }
  1201. if(class9_1.type == 2)
  1202. {
  1203. int k2 = 0;
  1204. for(int l2 = 0; l2 < class9_1.height; l2++)
  1205. {
  1206. for(int i3 = 0; i3 < class9_1.width; i3++)
  1207. {
  1208. int j3 = i2 + i3 * (32 + class9_1.invSpritePadX);
  1209. int k3 = j2 + l2 * (32 + class9_1.invSpritePadY);
  1210. if(k2 < 20)
  1211. {
  1212. j3 += class9_1.spritesX[k2];
  1213. k3 += class9_1.spritesY[k2];
  1214. }
  1215. if(k >= j3 && i1 >= k3 && k < j3 + 32 && i1 < k3 + 32)
  1216. {
  1217. mouseInvInterfaceIndex = k2;
  1218. lastActiveInvInterface = class9_1.id;
  1219. if(class9_1.inv[k2] > 0)
  1220. {
  1221. ItemDef itemDef = ItemDef.forID(class9_1.inv[k2] - 1);
  1222. if(itemSelected == 1 && class9_1.isInventoryInterface)
  1223. {
  1224. if(class9_1.id != anInt1284 || k2 != anInt1283)
  1225. {
  1226. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  1227. menuActionID[menuActionRow] = 870;
  1228. menuActionCmd1[menuActionRow] = itemDef.id;
  1229. menuActionCmd2[menuActionRow] = k2;
  1230. menuActionCmd3[menuActionRow] = class9_1.id;
  1231. menuActionRow++;
  1232. }
  1233. } else
  1234. if(spellSelected == 1 && class9_1.isInventoryInterface)
  1235. {
  1236. if((spellUsableOn & 0x10) == 16)
  1237. {
  1238. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  1239. menuActionID[menuActionRow] = 543;
  1240. menuActionCmd1[menuActionRow] = itemDef.id;
  1241. menuActionCmd2[menuActionRow] = k2;
  1242. menuActionCmd3[menuActionRow] = class9_1.id;
  1243. menuActionRow++;
  1244. }
  1245. } else
  1246. {
  1247. if(class9_1.isInventoryInterface)
  1248. {
  1249. for(int l3 = 4; l3 >= 3; l3--)
  1250. if(itemDef.actions != null && itemDef.actions[l3] != null)
  1251. {
  1252. menuActionName[menuActionRow] = itemDef.actions[l3] + " @lre@" + itemDef.name;
  1253. if(l3 == 3)
  1254. menuActionID[menuActionRow] = 493;
  1255. if(l3 == 4)
  1256. menuActionID[menuActionRow] = 847;
  1257. menuActionCmd1[menuActionRow] = itemDef.id;
  1258. menuActionCmd2[menuActionRow] = k2;
  1259. menuActionCmd3[menuActionRow] = class9_1.id;
  1260. menuActionRow++;
  1261. } else
  1262. if(l3 == 4)
  1263. {
  1264. menuActionName[menuActionRow] = "Drop @lre@" + itemDef.name;
  1265. menuActionID[menuActionRow] = 847;
  1266. menuActionCmd1[menuActionRow] = itemDef.id;
  1267. menuActionCmd2[menuActionRow] = k2;
  1268. menuActionCmd3[menuActionRow] = class9_1.id;
  1269. menuActionRow++;
  1270. }
  1271.  
  1272. }
  1273. if(class9_1.usableItemInterface)
  1274. {
  1275. menuActionName[menuActionRow] = "Use @lre@" + itemDef.name;
  1276. menuActionID[menuActionRow] = 447;
  1277. menuActionCmd1[menuActionRow] = itemDef.id;
  1278. //k2 = inventory spot
  1279. //System.out.println(k2);
  1280. menuActionCmd2[menuActionRow] = k2;
  1281. menuActionCmd3[menuActionRow] = class9_1.id;
  1282. menuActionRow++;
  1283. }
  1284. if(class9_1.isInventoryInterface && itemDef.actions != null)
  1285. {
  1286. for(int i4 = 2; i4 >= 0; i4--)
  1287. if(itemDef.actions[i4] != null)
  1288. {
  1289. menuActionName[menuActionRow] = itemDef.actions[i4] + " @lre@" + itemDef.name;
  1290. if(i4 == 0)
  1291. menuActionID[menuActionRow] = 74;
  1292. if(i4 == 1)
  1293. menuActionID[menuActionRow] = 454;
  1294. if(i4 == 2)
  1295. menuActionID[menuActionRow] = 539;
  1296. menuActionCmd1[menuActionRow] = itemDef.id;
  1297. menuActionCmd2[menuActionRow] = k2;
  1298. menuActionCmd3[menuActionRow] = class9_1.id;
  1299. menuActionRow++;
  1300. }
  1301.  
  1302. }
  1303. if(class9_1.actions != null)
  1304. {
  1305. for(int j4 = 4; j4 >= 0; j4--)
  1306. if(class9_1.actions[j4] != null)
  1307. {
  1308. menuActionName[menuActionRow] = class9_1.actions[j4] + " @lre@" + itemDef.name;
  1309. if(j4 == 0)
  1310. menuActionID[menuActionRow] = 632;
  1311. if(j4 == 1)
  1312. menuActionID[menuActionRow] = 78;
  1313. if(j4 == 2)
  1314. menuActionID[menuActionRow] = 867;
  1315. if(j4 == 3)
  1316. menuActionID[menuActionRow] = 431;
  1317. if(j4 == 4)
  1318. menuActionID[menuActionRow] = 53;
  1319. menuActionCmd1[menuActionRow] = itemDef.id;
  1320. menuActionCmd2[menuActionRow] = k2;
  1321. menuActionCmd3[menuActionRow] = class9_1.id;
  1322. menuActionRow++;
  1323. }
  1324.  
  1325. }
  1326. //menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + (class9_1.inv[k2] - 1) + "@gre@)";
  1327. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  1328. menuActionID[menuActionRow] = 1125;
  1329. menuActionCmd1[menuActionRow] = itemDef.id;
  1330. menuActionCmd2[menuActionRow] = k2;
  1331. menuActionCmd3[menuActionRow] = class9_1.id;
  1332. menuActionRow++;
  1333. }
  1334. }
  1335. }
  1336. k2++;
  1337. }
  1338.  
  1339. }
  1340.  
  1341. }
  1342. }
  1343. }
  1344.  
  1345. }
  1346.  
  1347. public void drawScrollbar(int j, int k, int l, int i1, int j1) {
  1348. scrollBar1.drawSprite(i1, l);
  1349. scrollBar2.drawSprite(i1, (l + j) - 16);
  1350. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 16);
  1351. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x3d3426, 15);
  1352. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x342d21, 13);
  1353. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x2e281d, 11);
  1354. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x29241b, 10);
  1355. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x252019, 9);
  1356. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 1);
  1357. int k1 = ((j - 32) * j) / j1;
  1358. if(k1 < 8)
  1359. k1 = 8;
  1360. int l1 = ((j - 32 - k1) * k) / (j1 - j);
  1361. DrawingArea.drawPixels(k1, l + 16 + l1, i1, barFillColor, 16);
  1362. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1);
  1363. DrawingArea.method341(l + 16 + l1, 0x817051, k1, i1 + 1);
  1364. DrawingArea.method341(l + 16 + l1, 0x73654a, k1, i1 + 2);
  1365. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 3);
  1366. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 4);
  1367. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 5);
  1368. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 6);
  1369. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 7);
  1370. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 8);
  1371. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 9);
  1372. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 10);
  1373. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 11);
  1374. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 12);
  1375. DrawingArea.method341(l + 16 + l1, 0x514635, k1, i1 + 13);
  1376. DrawingArea.method341(l + 16 + l1, 0x4b4131, k1, i1 + 14);
  1377. DrawingArea.method339(l + 16 + l1, 0x000001, 15, i1);
  1378. DrawingArea.method339(l + 17 + l1, 0x000001, 15, i1);
  1379. DrawingArea.method339(l + 17 + l1, 0x655841, 14, i1);
  1380. DrawingArea.method339(l + 17 + l1, 0x6a5c43, 13, i1);
  1381. DrawingArea.method339(l + 17 + l1, 0x6d5f48, 11, i1);
  1382. DrawingArea.method339(l + 17 + l1, 0x73654a, 10, i1);
  1383. DrawingArea.method339(l + 17 + l1, 0x76684b, 7, i1);
  1384. DrawingArea.method339(l + 17 + l1, 0x7b6a4d, 5, i1);
  1385. DrawingArea.method339(l + 17 + l1, 0x7e6e50, 4, i1);
  1386. DrawingArea.method339(l + 17 + l1, 0x817051, 3, i1);
  1387. DrawingArea.method339(l + 17 + l1, 0x000001, 2, i1);
  1388. DrawingArea.method339(l + 18 + l1, 0x000001, 16, i1);
  1389. DrawingArea.method339(l + 18 + l1, 0x564b38, 15, i1);
  1390. DrawingArea.method339(l + 18 + l1, 0x5d513c, 14, i1);
  1391. DrawingArea.method339(l + 18 + l1, 0x625640, 11, i1);
  1392. DrawingArea.method339(l + 18 + l1, 0x655841, 10, i1);
  1393. DrawingArea.method339(l + 18 + l1, 0x6a5c43, 7, i1);
  1394. DrawingArea.method339(l + 18 + l1, 0x6e6046, 5, i1);
  1395. DrawingArea.method339(l + 18 + l1, 0x716247, 4, i1);
  1396. DrawingArea.method339(l + 18 + l1, 0x7b6a4d, 3, i1);
  1397. DrawingArea.method339(l + 18 + l1, 0x817051, 2, i1);
  1398. DrawingArea.method339(l + 18 + l1, 0x000001, 1, i1);
  1399. DrawingArea.method339(l + 19 + l1, 0x000001, 16, i1);
  1400. DrawingArea.method339(l + 19 + l1, 0x514635, 15, i1);
  1401. DrawingArea.method339(l + 19 + l1, 0x564b38, 14, i1);
  1402. DrawingArea.method339(l + 19 + l1, 0x5d513c, 11, i1);
  1403. DrawingArea.method339(l + 19 + l1, 0x61553e, 9, i1);
  1404. DrawingArea.method339(l + 19 + l1, 0x655841, 7, i1);
  1405. DrawingArea.method339(l + 19 + l1, 0x6a5c43, 5, i1);
  1406. DrawingArea.method339(l + 19 + l1, 0x6e6046, 4, i1);
  1407. DrawingArea.method339(l + 19 + l1, 0x73654a, 3, i1);
  1408. DrawingArea.method339(l + 19 + l1, 0x817051, 2, i1);
  1409. DrawingArea.method339(l + 19 + l1, 0x000001, 1, i1);
  1410. DrawingArea.method339(l + 20 + l1, 0x000001, 16, i1);
  1411. DrawingArea.method339(l + 20 + l1, 0x4b4131, 15, i1);
  1412. DrawingArea.method339(l + 20 + l1, 0x544936, 14, i1);
  1413. DrawingArea.method339(l + 20 + l1, 0x594e3a, 13, i1);
  1414. DrawingArea.method339(l + 20 + l1, 0x5d513c, 10, i1);
  1415. DrawingArea.method339(l + 20 + l1, 0x61553e, 8, i1);
  1416. DrawingArea.method339(l + 20 + l1, 0x655841, 6, i1);
  1417. DrawingArea.method339(l + 20 + l1, 0x6a5c43, 4, i1);
  1418. DrawingArea.method339(l + 20 + l1, 0x73654a, 3, i1);
  1419. DrawingArea.method339(l + 20 + l1, 0x817051, 2, i1);
  1420. DrawingArea.method339(l + 20 + l1, 0x000001, 1, i1);
  1421. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1 + 15);
  1422. DrawingArea.method339(l + 15 + l1 + k1, 0x000001, 16, i1);
  1423. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 15, i1);
  1424. DrawingArea.method339(l + 14 + l1 + k1, 0x3f372a, 14, i1);
  1425. DrawingArea.method339(l + 14 + l1 + k1, 0x443c2d, 10, i1);
  1426. DrawingArea.method339(l + 14 + l1 + k1, 0x483e2f, 9, i1);
  1427. DrawingArea.method339(l + 14 + l1 + k1, 0x4a402f, 7, i1);
  1428. DrawingArea.method339(l + 14 + l1 + k1, 0x4b4131, 4, i1);
  1429. DrawingArea.method339(l + 14 + l1 + k1, 0x564b38, 3, i1);
  1430. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 2, i1);
  1431. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 16, i1);
  1432. DrawingArea.method339(l + 13 + l1 + k1, 0x443c2d, 15, i1);
  1433. DrawingArea.method339(l + 13 + l1 + k1, 0x4b4131, 11, i1);
  1434. DrawingArea.method339(l + 13 + l1 + k1, 0x514635, 9, i1);
  1435. DrawingArea.method339(l + 13 + l1 + k1, 0x544936, 7, i1);
  1436. DrawingArea.method339(l + 13 + l1 + k1, 0x564b38, 6, i1);
  1437. DrawingArea.method339(l + 13 + l1 + k1, 0x594e3a, 4, i1);
  1438. DrawingArea.method339(l + 13 + l1 + k1, 0x625640, 3, i1);
  1439. DrawingArea.method339(l + 13 + l1 + k1, 0x6a5c43, 2, i1);
  1440. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 1, i1);
  1441. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 16, i1);
  1442. DrawingArea.method339(l + 12 + l1 + k1, 0x443c2d, 15, i1);
  1443. DrawingArea.method339(l + 12 + l1 + k1, 0x4b4131, 14, i1);
  1444. DrawingArea.method339(l + 12 + l1 + k1, 0x544936, 12, i1);
  1445. DrawingArea.method339(l + 12 + l1 + k1, 0x564b38, 11, i1);
  1446. DrawingArea.method339(l + 12 + l1 + k1, 0x594e3a, 10, i1);
  1447. DrawingArea.method339(l + 12 + l1 + k1, 0x5d513c, 7, i1);
  1448. DrawingArea.method339(l + 12 + l1 + k1, 0x61553e, 4, i1);
  1449. DrawingArea.method339(l + 12 + l1 + k1, 0x6e6046, 3, i1);
  1450. DrawingArea.method339(l + 12 + l1 + k1, 0x7b6a4d, 2, i1);
  1451. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 1, i1);
  1452. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 16, i1);
  1453. DrawingArea.method339(l + 11 + l1 + k1, 0x4b4131, 15, i1);
  1454. DrawingArea.method339(l + 11 + l1 + k1, 0x514635, 14, i1);
  1455. DrawingArea.method339(l + 11 + l1 + k1, 0x564b38, 13, i1);
  1456. DrawingArea.method339(l + 11 + l1 + k1, 0x594e3a, 11, i1);
  1457. DrawingArea.method339(l + 11 + l1 + k1, 0x5d513c, 9, i1);
  1458. DrawingArea.method339(l + 11 + l1 + k1, 0x61553e, 7, i1);
  1459. DrawingArea.method339(l + 11 + l1 + k1, 0x655841, 5, i1);
  1460. DrawingArea.method339(l + 11 + l1 + k1, 0x6a5c43, 4, i1);
  1461. DrawingArea.method339(l + 11 + l1 + k1, 0x73654a, 3, i1);
  1462. DrawingArea.method339(l + 11 + l1 + k1, 0x7b6a4d, 2, i1);
  1463. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 1, i1);
  1464. }
  1465.  
  1466. private void updateNPCs(Stream stream, int i)
  1467. {
  1468. anInt839 = 0;
  1469. anInt893 = 0;
  1470. method139(stream);
  1471. method46(i, stream);
  1472. method86(stream);
  1473. for(int k = 0; k < anInt839; k++)
  1474. {
  1475. int l = anIntArray840[k];
  1476. if(npcArray[l].anInt1537 != loopCycle)
  1477. {
  1478. npcArray[l].desc = null;
  1479. npcArray[l] = null;
  1480. }
  1481. }
  1482.  
  1483. if(stream.currentOffset != i)
  1484. {
  1485. signlink.reporterror(myUsername + " size mismatch in getnpcpos - pos:" + stream.currentOffset + " psize:" + i);
  1486. throw new RuntimeException("eek");
  1487. }
  1488. for(int i1 = 0; i1 < npcCount; i1++)
  1489. if(npcArray[npcIndices[i1]] == null)
  1490. {
  1491. signlink.reporterror(myUsername + " null entry in npc list - pos:" + i1 + " size:" + npcCount);
  1492. throw new RuntimeException("eek");
  1493. }
  1494.  
  1495. }
  1496.  
  1497. private int cButtonHPos;
  1498. private int cButtonHCPos;
  1499. private int cButtonCPos;
  1500.  
  1501. private void processChatModeClick() {
  1502. if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  1503. cButtonHPos = 0;
  1504. aBoolean1233 = true;
  1505. inputTaken = true;
  1506. } else if(super.mouseX >= 71 && super.mouseX <= 127 && super.mouseY >= 482 && super.mouseY <= 503) {
  1507. cButtonHPos = 1;
  1508. aBoolean1233 = true;
  1509. inputTaken = true;
  1510. } else if(super.mouseX >= 137 && super.mouseX <= 193 && super.mouseY >= 482 && super.mouseY <= 503) {
  1511. cButtonHPos = 2;
  1512. aBoolean1233 = true;
  1513. inputTaken = true;
  1514. } else if(super.mouseX >= 203 && super.mouseX <= 259 && super.mouseY >= 482 && super.mouseY <= 503) {
  1515. cButtonHPos = 3;
  1516. aBoolean1233 = true;
  1517. inputTaken = true;
  1518. } else if(super.mouseX >= 269 && super.mouseX <= 325 && super.mouseY >= 482 && super.mouseY <= 503) {
  1519. cButtonHPos = 4;
  1520. aBoolean1233 = true;
  1521. inputTaken = true;
  1522. } else if(super.mouseX >= 335 && super.mouseX <= 391 && super.mouseY >= 482 && super.mouseY <= 503) {
  1523. cButtonHPos = 5;
  1524. aBoolean1233 = true;
  1525. inputTaken = true;
  1526. } else if(super.mouseX >= 404 && super.mouseX <= 515 && super.mouseY >= 482 && super.mouseY <= 503) {
  1527. cButtonHPos = 6;
  1528. aBoolean1233 = true;
  1529. inputTaken = true;
  1530. } else {
  1531. cButtonHPos = -1;
  1532. aBoolean1233 = true;
  1533. inputTaken = true;
  1534. }
  1535. if(super.clickMode3 == 1) {
  1536. if(super.saveClickX >= 5 && super.saveClickX <= 61 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1537. cButtonCPos = 0;
  1538. chatTypeView = 0;
  1539. aBoolean1233 = true;
  1540. inputTaken = true;
  1541. } else if(super.saveClickX >= 71 && super.saveClickX <= 127 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1542. cButtonCPos = 1;
  1543. chatTypeView = 5;
  1544. aBoolean1233 = true;
  1545. inputTaken = true;
  1546. } else if(super.saveClickX >= 137 && super.saveClickX <= 193 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1547. cButtonCPos = 2;
  1548. chatTypeView = 1;
  1549. aBoolean1233 = true;
  1550. inputTaken = true;
  1551. } else if(super.saveClickX >= 203 && super.saveClickX <= 259 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1552. cButtonCPos = 3;
  1553. chatTypeView = 2;
  1554. aBoolean1233 = true;
  1555. inputTaken = true;
  1556. } else if(super.saveClickX >= 269 && super.saveClickX <= 325 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1557. cButtonCPos = 4;
  1558. chatTypeView = 11;
  1559. aBoolean1233 = true;
  1560. inputTaken = true;
  1561. } else if(super.saveClickX >= 335 && super.saveClickX <= 391 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1562. cButtonCPos = 5;
  1563. chatTypeView = 3;
  1564. aBoolean1233 = true;
  1565. inputTaken = true;
  1566. } else if(super.saveClickX >= 404 && super.saveClickX <= 515 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1567. if(openInterfaceID == -1) {
  1568. clearTopInterfaces();
  1569. reportAbuseInput = "";
  1570. canMute = false;
  1571. for(int i = 0; i < RSInterface.interfaceCache.length; i++) {
  1572. if(RSInterface.interfaceCache[i] == null || RSInterface.interfaceCache[i].contentType != 600)
  1573. continue;
  1574. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  1575. break;
  1576. }
  1577. } else {
  1578. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  1579. }
  1580. }
  1581. }
  1582. }
  1583.  
  1584. private void method33(int i)
  1585. {
  1586. int j = Varp.cache[i].anInt709;
  1587. if(j == 0)
  1588. return;
  1589. int k = variousSettings[i];
  1590. if(j == 1)
  1591. {
  1592. if(k == 1)
  1593. Texture.method372(0.90000000000000002D);
  1594. if(k == 2)
  1595. Texture.method372(0.80000000000000004D);
  1596. if(k == 3)
  1597. Texture.method372(0.69999999999999996D);
  1598. if(k == 4)
  1599. Texture.method372(0.59999999999999998D);
  1600. ItemDef.mruNodes1.unlinkAll();
  1601. welcomeScreenRaised = true;
  1602. }
  1603. if(j == 3)
  1604. {
  1605. boolean flag1 = musicEnabled;
  1606. if(k == 0)
  1607. {
  1608. adjustVolume(musicEnabled, 0);
  1609. musicEnabled = true;
  1610. }
  1611. if(k == 1)
  1612. {
  1613. adjustVolume(musicEnabled, -400);
  1614. musicEnabled = true;
  1615. }
  1616. if(k == 2)
  1617. {
  1618. adjustVolume(musicEnabled, -800);
  1619. musicEnabled = true;
  1620. }
  1621. if(k == 3)
  1622. {
  1623. adjustVolume(musicEnabled, -1200);
  1624. musicEnabled = true;
  1625. }
  1626. if(k == 4)
  1627. musicEnabled = false;
  1628. if(musicEnabled != flag1 && !lowMem)
  1629. {
  1630. if(musicEnabled)
  1631. {
  1632. nextSong = currentSong;
  1633. songChanging = true;
  1634. onDemandFetcher.method558(2, nextSong);
  1635. } else
  1636. {
  1637. stopMidi();
  1638. }
  1639. prevSong = 0;
  1640. }
  1641. }
  1642. if(j == 4)
  1643. {
  1644. if(k == 0)
  1645. {
  1646. aBoolean848 = true;
  1647. setWaveVolume(0);
  1648. }
  1649. if(k == 1)
  1650. {
  1651. aBoolean848 = true;
  1652. setWaveVolume(-400);
  1653. }
  1654. if(k == 2)
  1655. {
  1656. aBoolean848 = true;
  1657. setWaveVolume(-800);
  1658. }
  1659. if(k == 3)
  1660. {
  1661. aBoolean848 = true;
  1662. setWaveVolume(-1200);
  1663. }
  1664. if(k == 4)
  1665. aBoolean848 = false;
  1666. }
  1667. if(j == 5)
  1668. anInt1253 = k;
  1669. if(j == 6)
  1670. anInt1249 = k;
  1671. if(j == 8)
  1672. {
  1673. splitPrivateChat = k;
  1674. inputTaken = true;
  1675. }
  1676. if(j == 9)
  1677. anInt913 = k;
  1678. }
  1679.  
  1680. private void updateEntities() {
  1681. try{
  1682. int anInt974 = 0;
  1683. for(int j = -1; j < playerCount + npcCount; j++) {
  1684. Object obj;
  1685. if(j == -1)
  1686. obj = myPlayer;
  1687. else
  1688. if(j < playerCount)
  1689. obj = playerArray[playerIndices[j]];
  1690. else
  1691. obj = npcArray[npcIndices[j - playerCount]];
  1692. if(obj == null || !((Entity) (obj)).isVisible())
  1693. continue;
  1694. if(obj instanceof NPC) {
  1695. EntityDef entityDef = ((NPC)obj).desc;
  1696. if(entityDef.childrenIDs != null)
  1697. entityDef = entityDef.method161();
  1698. if(entityDef == null)
  1699. continue;
  1700. }
  1701. if(j < playerCount) {
  1702. int l = 30;
  1703. Player player = (Player)obj;
  1704. if(player.headIcon >= 0) {
  1705. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1706. if(spriteDrawX > -1) {
  1707. if (player.skullIcon < 2) {
  1708. skullIcons[player.skullIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1709. l += 25;
  1710. }
  1711. if (player.headIcon < 7) {
  1712. headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1713. l += 18;
  1714. }
  1715. }
  1716. }
  1717. if(j >= 0 && anInt855 == 10 && anInt933 == playerIndices[j]) {
  1718. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1719. if(spriteDrawX > -1)
  1720. headIconsHint[player.hintIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1721. }
  1722. } else {
  1723. EntityDef entityDef_1 = ((NPC)obj).desc;
  1724. if(entityDef_1.anInt75 >= 0 && entityDef_1.anInt75 < headIcons.length) {
  1725. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1726. if(spriteDrawX > -1)
  1727. headIcons[entityDef_1.anInt75].drawSprite(spriteDrawX - 12, spriteDrawY - 30);
  1728. }
  1729. if(anInt855 == 1 && anInt1222 == npcIndices[j - playerCount] && loopCycle % 20 < 10) {
  1730. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1731. if(spriteDrawX > -1)
  1732. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  1733. }
  1734. }
  1735. if(((Entity) (obj)).textSpoken != null && (j >= playerCount || publicChatMode == 0 || publicChatMode == 3 || publicChatMode == 1 && isFriendOrSelf(((Player)obj).name)))
  1736. {
  1737. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height);
  1738. if(spriteDrawX > -1 && anInt974 < anInt975)
  1739. {
  1740. anIntArray979[anInt974] = chatTextDrawingArea.method384(((Entity) (obj)).textSpoken) / 2;
  1741. anIntArray978[anInt974] = chatTextDrawingArea.anInt1497;
  1742. anIntArray976[anInt974] = spriteDrawX;
  1743. anIntArray977[anInt974] = spriteDrawY;
  1744. anIntArray980[anInt974] = ((Entity) (obj)).anInt1513;
  1745. anIntArray981[anInt974] = ((Entity) (obj)).anInt1531;
  1746. anIntArray982[anInt974] = ((Entity) (obj)).textCycle;
  1747. aStringArray983[anInt974++] = ((Entity) (obj)).textSpoken;
  1748. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 >= 1 && ((Entity) (obj)).anInt1531 <= 3)
  1749. {
  1750. anIntArray978[anInt974] += 10;
  1751. anIntArray977[anInt974] += 5;
  1752. }
  1753. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 4)
  1754. anIntArray979[anInt974] = 60;
  1755. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 5)
  1756. anIntArray978[anInt974] += 5;
  1757. }
  1758. }
  1759. /*if(((Entity) (obj)).loopCycleStatus > loopCycle)
  1760. {
  1761. try{
  1762. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1763. if(spriteDrawX > -1)
  1764. {
  1765. int i1 = (((Entity) (obj)).currentHealth * 30) / ((Entity) (obj)).maxHealth;
  1766. if(i1 > 30)
  1767. i1 = 30;
  1768. DrawingArea.drawPixels(5, spriteDrawY - 3, spriteDrawX - 15, 65280, i1);
  1769. DrawingArea.drawPixels(5, spriteDrawY - 3, (spriteDrawX - 15) + i1, 0xff0000, 30 - i1);
  1770. }
  1771. }catch(Exception e){ }
  1772. }*/
  1773. if (((Entity) (obj)).loopCycleStatus > loopCycle) {
  1774. try {
  1775. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1776. if (spriteDrawX > -1) {
  1777. int i1 = (((Entity) (obj)).currentHealth * 30) / ((Entity) (obj)).maxHealth;
  1778.  
  1779. if (i1 > 30) {
  1780. i1 = 30;
  1781. }
  1782. int HpPercent = (((Entity) (obj)).currentHealth * 56) / ((Entity) (obj)).maxHealth;
  1783.  
  1784. if (HpPercent > 56) {
  1785. HpPercent = 56;
  1786. }
  1787. if(!HPBarToggle){
  1788. DrawingArea.drawPixels(5, spriteDrawY - 3, spriteDrawX - 15, 65280, i1);
  1789. DrawingArea.drawPixels(5, spriteDrawY - 3, (spriteDrawX - 15) + i1, 0xff0000, 30 - i1);
  1790. } else {
  1791. HPBarEmpty.drawSprite(spriteDrawX - 28, spriteDrawY - 3);
  1792. HPBarFull = new Sprite(sign.signlink.findcachedir() + "Sprites/HITPOINTS_0.PNG", HpPercent, 7);
  1793. HPBarFull.drawSprite(spriteDrawX - 28, spriteDrawY - 3);
  1794. }
  1795. }
  1796. } catch (Exception e) {}
  1797. }
  1798. for(int j1 = 0; j1 < 4; j1++)
  1799. if(((Entity) (obj)).hitsLoopCycle[j1] > loopCycle)
  1800. {
  1801. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height / 2);
  1802. if(spriteDrawX > -1)
  1803. {
  1804. if(j1 == 1)
  1805. spriteDrawY -= 20;
  1806. if(j1 == 2)
  1807. {
  1808. spriteDrawX -= 15;
  1809. spriteDrawY -= 10;
  1810. }
  1811. if(j1 == 3)
  1812. {
  1813. spriteDrawX += 15;
  1814. spriteDrawY -= 10;
  1815. }
  1816. hitMarks[((Entity) (obj)).hitMarkTypes[j1]].drawSprite(spriteDrawX - 12, spriteDrawY - 12);
  1817. smallText.drawText(0, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 4, spriteDrawX);
  1818. smallText.drawText(0xffffff, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 3, spriteDrawX - 1);
  1819. }
  1820. }
  1821. }
  1822. for(int k = 0; k < anInt974; k++) {
  1823. int k1 = anIntArray976[k];
  1824. int l1 = anIntArray977[k];
  1825. int j2 = anIntArray979[k];
  1826. int k2 = anIntArray978[k];
  1827. boolean flag = true;
  1828. while(flag)
  1829. {
  1830. flag = false;
  1831. for(int l2 = 0; l2 < k; l2++)
  1832. 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)
  1833. {
  1834. l1 = anIntArray977[l2] - anIntArray978[l2];
  1835. flag = true;
  1836. }
  1837.  
  1838. }
  1839. spriteDrawX = anIntArray976[k];
  1840. spriteDrawY = anIntArray977[k] = l1;
  1841. String s = aStringArray983[k];
  1842. if(anInt1249 == 0)
  1843. {
  1844. int i3 = 0xffff00;
  1845. if(anIntArray980[k] < 6)
  1846. i3 = anIntArray965[anIntArray980[k]];
  1847. if(anIntArray980[k] == 6)
  1848. i3 = anInt1265 % 20 >= 10 ? 0xffff00 : 0xff0000;
  1849. if(anIntArray980[k] == 7)
  1850. i3 = anInt1265 % 20 >= 10 ? 65535 : 255;
  1851. if(anIntArray980[k] == 8)
  1852. i3 = anInt1265 % 20 >= 10 ? 0x80ff80 : 45056;
  1853. if(anIntArray980[k] == 9) {
  1854. int j3 = 150 - anIntArray982[k];
  1855. if(j3 < 50)
  1856. i3 = 0xff0000 + 1280 * j3;
  1857. else
  1858. if(j3 < 100)
  1859. i3 = 0xffff00 - 0x50000 * (j3 - 50);
  1860. else
  1861. if(j3 < 150)
  1862. i3 = 65280 + 5 * (j3 - 100);
  1863. }
  1864. if(anIntArray980[k] == 10) {
  1865. int k3 = 150 - anIntArray982[k];
  1866. if(k3 < 50)
  1867. i3 = 0xff0000 + 5 * k3;
  1868. else
  1869. if(k3 < 100)
  1870. i3 = 0xff00ff - 0x50000 * (k3 - 50);
  1871. else
  1872. if(k3 < 150)
  1873. i3 = (255 + 0x50000 * (k3 - 100)) - 5 * (k3 - 100);
  1874. }
  1875. if(anIntArray980[k] == 11) {
  1876. int l3 = 150 - anIntArray982[k];
  1877. if(l3 < 50)
  1878. i3 = 0xffffff - 0x50005 * l3;
  1879. else
  1880. if(l3 < 100)
  1881. i3 = 65280 + 0x50005 * (l3 - 50);
  1882. else
  1883. if(l3 < 150)
  1884. i3 = 0xffffff - 0x50000 * (l3 - 100);
  1885. }
  1886. if(anIntArray981[k] == 0) {
  1887. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  1888. chatTextDrawingArea.drawText(i3, s, spriteDrawY, spriteDrawX);
  1889. }
  1890. if(anIntArray981[k] == 1) {
  1891. chatTextDrawingArea.method386(0, s, spriteDrawX, anInt1265, spriteDrawY + 1);
  1892. chatTextDrawingArea.method386(i3, s, spriteDrawX, anInt1265, spriteDrawY);
  1893. }
  1894. if(anIntArray981[k] == 2) {
  1895. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY + 1, 0);
  1896. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY, i3);
  1897. }
  1898. if(anIntArray981[k] == 3) {
  1899. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY + 1, spriteDrawX, 0);
  1900. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY, spriteDrawX, i3);
  1901. }
  1902. if(anIntArray981[k] == 4) {
  1903. int i4 = chatTextDrawingArea.method384(s);
  1904. int k4 = ((150 - anIntArray982[k]) * (i4 + 100)) / 150;
  1905. DrawingArea.setDrawingArea(334, spriteDrawX - 50, spriteDrawX + 50, 0);
  1906. chatTextDrawingArea.method385(0, s, spriteDrawY + 1, (spriteDrawX + 50) - k4);
  1907. chatTextDrawingArea.method385(i3, s, spriteDrawY, (spriteDrawX + 50) - k4);
  1908. DrawingArea.defaultDrawingAreaSize();
  1909. }
  1910. if(anIntArray981[k] == 5) {
  1911. int j4 = 150 - anIntArray982[k];
  1912. int l4 = 0;
  1913. if(j4 < 25)
  1914. l4 = j4 - 25;
  1915. else
  1916. if(j4 > 125)
  1917. l4 = j4 - 125;
  1918. DrawingArea.setDrawingArea(spriteDrawY + 5, 0, 512, spriteDrawY - chatTextDrawingArea.anInt1497 - 1);
  1919. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1 + l4, spriteDrawX);
  1920. chatTextDrawingArea.drawText(i3, s, spriteDrawY + l4, spriteDrawX);
  1921. DrawingArea.defaultDrawingAreaSize();
  1922. }
  1923. } else {
  1924. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  1925. chatTextDrawingArea.drawText(0xffff00, s, spriteDrawY, spriteDrawX);
  1926. }
  1927. }
  1928. } catch(Exception e){ }
  1929. }
  1930.  
  1931. private void delFriend(long l)
  1932. {
  1933. try
  1934. {
  1935. if(l == 0L)
  1936. return;
  1937. for(int i = 0; i < friendsCount; i++)
  1938. {
  1939. if(friendsListAsLongs[i] != l)
  1940. continue;
  1941. friendsCount--;
  1942. needDrawTabArea = true;
  1943. for(int j = i; j < friendsCount; j++)
  1944. {
  1945. friendsList[j] = friendsList[j + 1];
  1946. friendsNodeIDs[j] = friendsNodeIDs[j + 1];
  1947. friendsListAsLongs[j] = friendsListAsLongs[j + 1];
  1948. }
  1949.  
  1950. stream.createFrame(215);
  1951. stream.writeQWord(l);
  1952. break;
  1953. }
  1954. }
  1955. catch(RuntimeException runtimeexception)
  1956. {
  1957. signlink.reporterror("18622, " + false + ", " + l + ", " + runtimeexception.toString());
  1958. throw new RuntimeException();
  1959. }
  1960. }
  1961.  
  1962. public void drawSideIcons(){
  1963. /* Top sideIcons */
  1964. if(tabInterfaceIDs[0] != -1)//attack
  1965. sideIcons[0].drawSprite(10, 4);
  1966. if(tabInterfaceIDs[1] != -1)//stat
  1967. sideIcons[1].drawSprite(43, 4);
  1968. if(tabInterfaceIDs[2] != -1)//quest
  1969. sideIcons[2].drawSprite(76, 3);
  1970. if(tabInterfaceIDs[3] != -1)//inventory
  1971. sideIcons[3].drawSprite(111, 5);
  1972. if(tabInterfaceIDs[4] != -1)//equipment
  1973. sideIcons[4].drawSprite(140, 1);
  1974. if(tabInterfaceIDs[5] != -1)//prayer
  1975. sideIcons[5].drawSprite(174, 1);
  1976. if(tabInterfaceIDs[6] != -1)//magic
  1977. sideIcons[6].drawSprite(208, 4);
  1978. /* Bottom sideIcons */
  1979. if(tabInterfaceIDs[7] != -1)//clan
  1980. sideIcons[7].drawSprite(11, 303);
  1981. if(tabInterfaceIDs[8] != -1)//friends
  1982. sideIcons[8].drawSprite(46, 306);
  1983. if(tabInterfaceIDs[9] != -1)//ignore
  1984. sideIcons[9].drawSprite(79, 306);
  1985. if(tabInterfaceIDs[10] != -1)//options
  1986. sideIcons[10].drawSprite(113, 302);
  1987. if(tabInterfaceIDs[11] != -1)//options
  1988. sideIcons[11].drawSprite(145, 304);
  1989. if(tabInterfaceIDs[12] != -1)//emotes
  1990. sideIcons[12].drawSprite(181, 302);
  1991. if(tabInterfaceIDs[13] != -1)//music
  1992. sideIcons[13].drawSprite(213, 303);
  1993. }
  1994.  
  1995. public void drawRedStones() {
  1996. if(tabInterfaceIDs[tabID] != -1) {
  1997. switch(tabID) {
  1998. case 0:
  1999. redStones[0].drawSprite(3, 0);
  2000. break;
  2001. case 1:
  2002. redStones[4].drawSprite(41, 0);
  2003. break;
  2004. case 2:
  2005. redStones[4].drawSprite(74, 0);
  2006. break;
  2007. case 3:
  2008. redStones[4].drawSprite(107, 0);
  2009. break;
  2010. case 4:
  2011. redStones[4].drawSprite(140, 0);
  2012. break;
  2013. case 5:
  2014. redStones[4].drawSprite(173, 0);
  2015. break;
  2016. case 6:
  2017. redStones[1].drawSprite(206, 0);
  2018. break;
  2019. case 7:
  2020. redStones[2].drawSprite(3, 298);
  2021. break;
  2022. case 8:
  2023. redStones[4].drawSprite(41, 298);
  2024. break;
  2025. case 9:
  2026. redStones[4].drawSprite(74, 298);
  2027. break;
  2028. case 10:
  2029. redStones[4].drawSprite(107, 298);
  2030. break;
  2031. case 11:
  2032. redStones[4].drawSprite(140, 298);
  2033. break;
  2034. case 12:
  2035. redStones[4].drawSprite(173, 298);
  2036. break;
  2037. case 13:
  2038. redStones[3].drawSprite(206, 298);
  2039. break;
  2040. }
  2041. }
  2042. }
  2043.  
  2044. private void drawTabArea() {
  2045. aRSImageProducer_1163.initDrawingArea();
  2046. Texture.anIntArray1472 = anIntArray1181;
  2047. tabArea.drawSprite(0, 0);
  2048. if(invOverlayInterfaceID == -1) {
  2049. drawRedStones();
  2050. drawSideIcons();
  2051. }
  2052. if(invOverlayInterfaceID != -1)
  2053. drawInterface(0, 28, RSInterface.interfaceCache[invOverlayInterfaceID], 37);
  2054. else if(tabInterfaceIDs[tabID] != -1)
  2055. drawInterface(0, 28, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 37);
  2056. if(menuOpen && menuScreenArea == 1)
  2057. drawMenu();
  2058. aRSImageProducer_1163.drawGraphics(168, super.graphics, 519);
  2059. aRSImageProducer_1165.initDrawingArea();
  2060. Texture.anIntArray1472 = anIntArray1182;
  2061. }
  2062.  
  2063. private void method37(int j) {
  2064. if(!lowMem) {
  2065. if(Texture.anIntArray1480[17] >= j) {
  2066. Background background = Texture.aBackgroundArray1474s[17];
  2067. int k = background.anInt1452 * background.anInt1453 - 1;
  2068. //fire cape apparently?
  2069. int j1 = background.anInt1452 * anInt945 * 2;
  2070. byte abyte0[] = background.aByteArray1450;
  2071. byte abyte3[] = aByteArray912;
  2072. for(int i2 = 0; i2 <= k; i2++)
  2073. abyte3[i2] = abyte0[i2 - j1 & k];
  2074.  
  2075. background.aByteArray1450 = abyte3;
  2076. aByteArray912 = abyte0;
  2077. Texture.method370(17);
  2078. anInt854++;
  2079. if(anInt854 > 1235) {
  2080. anInt854 = 0;
  2081. stream.createFrame(226);
  2082. stream.writeWordBigEndian(0);
  2083. int l2 = stream.currentOffset;
  2084. stream.writeWord(58722);
  2085. stream.writeWordBigEndian(240);
  2086. stream.writeWord((int)(Math.random() * 65536D));
  2087. stream.writeWordBigEndian((int)(Math.random() * 256D));
  2088. if((int)(Math.random() * 2D) == 0)
  2089. stream.writeWord(51825);
  2090. stream.writeWordBigEndian((int)(Math.random() * 256D));
  2091. stream.writeWord((int)(Math.random() * 65536D));
  2092. stream.writeWord(7130);
  2093. stream.writeWord((int)(Math.random() * 65536D));
  2094. stream.writeWord(61657);
  2095. stream.writeBytes(stream.currentOffset - l2);
  2096. }
  2097. }
  2098. if(Texture.anIntArray1480[24] >= j) {
  2099. Background background_1 = Texture.aBackgroundArray1474s[24];
  2100. int l = background_1.anInt1452 * background_1.anInt1453 - 1;
  2101. int k1 = background_1.anInt1452 * anInt945 * 2;
  2102. byte abyte1[] = background_1.aByteArray1450;
  2103. byte abyte4[] = aByteArray912;
  2104. for(int j2 = 0; j2 <= l; j2++)
  2105. abyte4[j2] = abyte1[j2 - k1 & l];
  2106.  
  2107. background_1.aByteArray1450 = abyte4;
  2108. aByteArray912 = abyte1;
  2109. Texture.method370(24);
  2110. }
  2111. if(Texture.anIntArray1480[34] >= j) {
  2112. Background background_2 = Texture.aBackgroundArray1474s[34];
  2113. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  2114. int l1 = background_2.anInt1452 * anInt945 * 2;
  2115. byte abyte2[] = background_2.aByteArray1450;
  2116. byte abyte5[] = aByteArray912;
  2117. for(int k2 = 0; k2 <= i1; k2++)
  2118. abyte5[k2] = abyte2[k2 - l1 & i1];
  2119.  
  2120. background_2.aByteArray1450 = abyte5;
  2121. aByteArray912 = abyte2;
  2122. Texture.method370(34);
  2123. }
  2124. if(Texture.anIntArray1480[40] >= j)
  2125. {
  2126. Background background_2 = Texture.aBackgroundArray1474s[40];
  2127. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  2128. int l1 = background_2.anInt1452 * anInt945 * 2;
  2129. byte abyte2[] = background_2.aByteArray1450;
  2130. byte abyte5[] = aByteArray912;
  2131. for(int k2 = 0; k2 <= i1; k2++)
  2132. abyte5[k2] = abyte2[k2 - l1 & i1];
  2133.  
  2134. background_2.aByteArray1450 = abyte5;
  2135. aByteArray912 = abyte2;
  2136. Texture.method370(40);
  2137. }
  2138. }
  2139. }
  2140.  
  2141. private void method38() {
  2142. for(int i = -1; i < playerCount; i++) {
  2143. int j;
  2144. if(i == -1)
  2145. j = myPlayerIndex;
  2146. else
  2147. j = playerIndices[i];
  2148. Player player = playerArray[j];
  2149. if(player != null && player.textCycle > 0) {
  2150. player.textCycle--;
  2151. if(player.textCycle == 0)
  2152. player.textSpoken = null;
  2153. }
  2154. }
  2155. for(int k = 0; k < npcCount; k++) {
  2156. int l = npcIndices[k];
  2157. NPC npc = npcArray[l];
  2158. if(npc != null && npc.textCycle > 0) {
  2159. npc.textCycle--;
  2160. if(npc.textCycle == 0)
  2161. npc.textSpoken = null;
  2162. }
  2163. }
  2164. }
  2165.  
  2166. private void calcCameraPos() {
  2167. int i = anInt1098 * 128 + 64;
  2168. int j = anInt1099 * 128 + 64;
  2169. int k = method42(plane, j, i) - anInt1100;
  2170. if(xCameraPos < i) {
  2171. xCameraPos += anInt1101 + ((i - xCameraPos) * anInt1102) / 1000;
  2172. if(xCameraPos > i)
  2173. xCameraPos = i;
  2174. }
  2175. if(xCameraPos > i) {
  2176. xCameraPos -= anInt1101 + ((xCameraPos - i) * anInt1102) / 1000;
  2177. if(xCameraPos < i)
  2178. xCameraPos = i;
  2179. }
  2180. if(zCameraPos < k) {
  2181. zCameraPos += anInt1101 + ((k - zCameraPos) * anInt1102) / 1000;
  2182. if(zCameraPos > k)
  2183. zCameraPos = k;
  2184. }
  2185. if(zCameraPos > k) {
  2186. zCameraPos -= anInt1101 + ((zCameraPos - k) * anInt1102) / 1000;
  2187. if(zCameraPos < k)
  2188. zCameraPos = k;
  2189. }
  2190. if(yCameraPos < j) {
  2191. yCameraPos += anInt1101 + ((j - yCameraPos) * anInt1102) / 1000;
  2192. if(yCameraPos > j)
  2193. yCameraPos = j;
  2194. }
  2195. if(yCameraPos > j) {
  2196. yCameraPos -= anInt1101 + ((yCameraPos - j) * anInt1102) / 1000;
  2197. if(yCameraPos < j)
  2198. yCameraPos = j;
  2199. }
  2200. i = anInt995 * 128 + 64;
  2201. j = anInt996 * 128 + 64;
  2202. k = method42(plane, j, i) - anInt997;
  2203. int l = i - xCameraPos;
  2204. int i1 = k - zCameraPos;
  2205. int j1 = j - yCameraPos;
  2206. int k1 = (int)Math.sqrt(l * l + j1 * j1);
  2207. int l1 = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  2208. int i2 = (int)(Math.atan2(l, j1) * -325.94900000000001D) & 0x7ff;
  2209. if(l1 < 128)
  2210. l1 = 128;
  2211. if(l1 > 383)
  2212. l1 = 383;
  2213. if(yCameraCurve < l1) {
  2214. yCameraCurve += anInt998 + ((l1 - yCameraCurve) * anInt999) / 1000;
  2215. if(yCameraCurve > l1)
  2216. yCameraCurve = l1;
  2217. }
  2218. if(yCameraCurve > l1) {
  2219. yCameraCurve -= anInt998 + ((yCameraCurve - l1) * anInt999) / 1000;
  2220. if(yCameraCurve < l1)
  2221. yCameraCurve = l1;
  2222. }
  2223. int j2 = i2 - xCameraCurve;
  2224. if(j2 > 1024)
  2225. j2 -= 2048;
  2226. if(j2 < -1024)
  2227. j2 += 2048;
  2228. if(j2 > 0) {
  2229. xCameraCurve += anInt998 + (j2 * anInt999) / 1000;
  2230. xCameraCurve &= 0x7ff;
  2231. }
  2232. if(j2 < 0) {
  2233. xCameraCurve -= anInt998 + (-j2 * anInt999) / 1000;
  2234. xCameraCurve &= 0x7ff;
  2235. }
  2236. int k2 = i2 - xCameraCurve;
  2237. if(k2 > 1024)
  2238. k2 -= 2048;
  2239. if(k2 < -1024)
  2240. k2 += 2048;
  2241. if(k2 < 0 && j2 > 0 || k2 > 0 && j2 < 0)
  2242. xCameraCurve = i2;
  2243. }
  2244.  
  2245. private void drawMenu() {
  2246. int i = menuOffsetX;
  2247. int j = menuOffsetY;
  2248. int k = menuWidth;
  2249. int l = menuHeight + 1;
  2250. int i1 = 0x5d5447;
  2251. //DrawingArea.drawPixels(height, yPos, xPos, color, width);
  2252. //DrawingArea.fillPixels(xPos, width, height, color, yPos);
  2253. DrawingArea.drawPixels(l, j, i, i1, k);
  2254. DrawingArea.drawPixels(16, j + 1, i + 1, 0, k - 2);
  2255. DrawingArea.fillPixels(i + 1, k - 2, l - 19, 0, j + 18);
  2256. chatTextDrawingArea.method385(i1, "Choose Option", j + 14, i + 3);
  2257. //Newer. chatTextDrawingArea.method385(0xc6b895, "Choose Option", j + 14, i + 3);
  2258. //below is new.
  2259. /*
  2260. DrawingArea.fillPixels(+ 3, - 6, 1, 0x2a291b, + 2);
  2261. DrawingArea.fillPixels(+ 2, - 4, 1, 0x2a261b, + 3);
  2262. DrawingArea.fillPixels(+ 2, - 4, 1, 0x252116, + 4);
  2263. DrawingArea.fillPixels(+ 2, - 4, 1, 0x211e15, + 5);
  2264. DrawingArea.fillPixels(+ 2, - 4, 1, 0x1e1b12, + 6);
  2265. DrawingArea.fillPixels(+ 2, - 4, 1, 0x1a170e, + 7);
  2266. DrawingArea.fillPixels(+ 2, - 4, 2, 0x15120b, + 8);
  2267. DrawingArea.fillPixels(+ 2, - 4, 1, 0x100d08, + 10);
  2268. DrawingArea.fillPixels(+ 2, - 4, 1, 0x090a04, + 11);
  2269. DrawingArea.fillPixels(+ 2, - 4, 1, 0x080703, + 12);
  2270. DrawingArea.fillPixels(+ 2, - 4, 1, 0x090a04, + 13);
  2271. DrawingArea.fillPixels(+ 2, - 4, 1, 0x070802, + 14);
  2272. DrawingArea.fillPixels(+ 2, - 4, 1, 0x090a04, + 15);
  2273. DrawingArea.fillPixels(+ 2, - 4, 1, 0x070802, + 16);
  2274. DrawingArea.fillPixels(+ 2, - 4, 1, 0x090a04, + 17);
  2275. DrawingArea.fillPixels(+ 2, - 4, 1, 0x2a291b, + 18);
  2276. DrawingArea.fillPixels(+ 3, - 6, 1, 0x564943, + 19);
  2277. */
  2278. //end of new.
  2279. int j1 = super.mouseX;
  2280. int k1 = super.mouseY;
  2281. if(menuScreenArea == 0) {
  2282. j1 -= 4;
  2283. k1 -= 4;
  2284. }
  2285. if(menuScreenArea == 1) {
  2286. j1 -= 519;
  2287. k1 -= 168;
  2288. }
  2289. if(menuScreenArea == 2) {
  2290. j1 -= 17;
  2291. k1 -= 338;
  2292. }
  2293. if(menuScreenArea == 3) {
  2294. j1 -= 519;
  2295. k1 -= 0;
  2296. }
  2297. for(int l1 = 0; l1 < menuActionRow; l1++) {
  2298. int i2 = j + 31 + (menuActionRow - 1 - l1) * 15;
  2299. int j2 = 0xffffff;
  2300. if(j1 > i && j1 < i + k && k1 > i2 - 13 && k1 < i2 + 3)
  2301. j2 = 0xffff00;
  2302. chatTextDrawingArea.method389(true, i + 3, j2, menuActionName[l1], i2);
  2303. }
  2304. }
  2305.  
  2306. private void addFriend(long l) {
  2307. try {
  2308. if(l == 0L)
  2309. return;
  2310. if(friendsCount >= 100 && anInt1046 != 1) {
  2311. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  2312. return;
  2313. }
  2314. if(friendsCount >= 200) {
  2315. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  2316. return;
  2317. }
  2318. String s = TextClass.fixName(TextClass.nameForLong(l));
  2319. for(int i = 0; i < friendsCount; i++)
  2320. if(friendsListAsLongs[i] == l) {
  2321. pushMessage(s + " is already on your friend list", 0, "");
  2322. return;
  2323. }
  2324. for(int j = 0; j < ignoreCount; j++)
  2325. if(ignoreListAsLongs[j] == l) {
  2326. pushMessage("Please remove " + s + " from your ignore list first", 0, "");
  2327. return;
  2328. }
  2329.  
  2330. if(s.equals(myPlayer.name)) {
  2331. return;
  2332. } else {
  2333. friendsList[friendsCount] = s;
  2334. friendsListAsLongs[friendsCount] = l;
  2335. friendsNodeIDs[friendsCount] = 0;
  2336. friendsCount++;
  2337. needDrawTabArea = true;
  2338. stream.createFrame(188);
  2339. stream.writeQWord(l);
  2340. return;
  2341. }
  2342. } catch(RuntimeException runtimeexception) {
  2343. signlink.reporterror("15283, " + (byte)68 + ", " + l + ", " + runtimeexception.toString());
  2344. }
  2345. throw new RuntimeException();
  2346. }
  2347.  
  2348. private int method42(int i, int j, int k) {
  2349. int l = k >> 7;
  2350. int i1 = j >> 7;
  2351. if(l < 0 || i1 < 0 || l > 103 || i1 > 103)
  2352. return 0;
  2353. int j1 = i;
  2354. if(j1 < 3 && (byteGroundArray[1][l][i1] & 2) == 2)
  2355. j1++;
  2356. int k1 = k & 0x7f;
  2357. int l1 = j & 0x7f;
  2358. int i2 = intGroundArray[j1][l][i1] * (128 - k1) + intGroundArray[j1][l + 1][i1] * k1 >> 7;
  2359. int j2 = intGroundArray[j1][l][i1 + 1] * (128 - k1) + intGroundArray[j1][l + 1][i1 + 1] * k1 >> 7;
  2360. return i2 * (128 - l1) + j2 * l1 >> 7;
  2361. }
  2362.  
  2363. private static String intToKOrMil(int j) {
  2364. if(j < 0x186a0)
  2365. return String.valueOf(j);
  2366. if(j < 0x989680)
  2367. return j / 1000 + "K";
  2368. else
  2369. return j / 0xf4240 + "M";
  2370. }
  2371.  
  2372. private void resetLogout() {
  2373. try {
  2374. if(socketStream != null)
  2375. socketStream.close();
  2376. }
  2377. catch(Exception _ex) { }
  2378. socketStream = null;
  2379. loggedIn = false;
  2380. loginScreenState = 0;
  2381. // myUsername = "";
  2382. // myPassword = "";
  2383. unlinkMRUNodes();
  2384. worldController.initToNull();
  2385. for(int i = 0; i < 4; i++)
  2386. aClass11Array1230[i].method210();
  2387. System.gc();
  2388. stopMidi();
  2389. currentSong = -1;
  2390. nextSong = -1;
  2391. prevSong = 0;
  2392. }
  2393.  
  2394. private void method45() {
  2395. aBoolean1031 = true;
  2396. for(int j = 0; j < 7; j++) {
  2397. anIntArray1065[j] = -1;
  2398. for(int k = 0; k < IDK.length; k++) {
  2399. if(IDK.cache[k].aBoolean662 || IDK.cache[k].anInt657 != j + (aBoolean1047 ? 0 : 7))
  2400. continue;
  2401. anIntArray1065[j] = k;
  2402. break;
  2403. }
  2404. }
  2405. }
  2406.  
  2407. private void method46(int i, Stream stream) {
  2408. while(stream.bitPosition + 21 < i * 8) {
  2409. int k = stream.readBits(14);
  2410. if(k == 16383)
  2411. break;
  2412. if(npcArray[k] == null)
  2413. npcArray[k] = new NPC();
  2414. NPC npc = npcArray[k];
  2415. npcIndices[npcCount++] = k;
  2416. npc.anInt1537 = loopCycle;
  2417. int l = stream.readBits(5);
  2418. if(l > 15)
  2419. l -= 32;
  2420. int i1 = stream.readBits(5);
  2421. if(i1 > 15)
  2422. i1 -= 32;
  2423. int j1 = stream.readBits(1);
  2424. npc.desc = EntityDef.forID(stream.readBits(14));
  2425. int k1 = stream.readBits(1);
  2426. if(k1 == 1)
  2427. anIntArray894[anInt893++] = k;
  2428. npc.anInt1540 = npc.desc.aByte68;
  2429. npc.anInt1504 = npc.desc.anInt79;
  2430. npc.anInt1554 = npc.desc.walkAnim;
  2431. npc.anInt1555 = npc.desc.anInt58;
  2432. npc.anInt1556 = npc.desc.anInt83;
  2433. npc.anInt1557 = npc.desc.anInt55;
  2434. npc.anInt1511 = npc.desc.standAnim;
  2435. npc.setPos(myPlayer.smallX[0] + i1, myPlayer.smallY[0] + l, j1 == 1);
  2436. }
  2437. stream.finishBitAccess();
  2438. }
  2439.  
  2440. public void processGameLoop() {
  2441. if(rsAlreadyLoaded || loadingError || genericLoadingError)
  2442. return;
  2443. loopCycle++;
  2444. if(!loggedIn)
  2445. processLoginScreenInput();
  2446. else
  2447. mainGameProcessor();
  2448. processOnDemandQueue();
  2449. }
  2450.  
  2451. private void method47(boolean flag) {
  2452. if(myPlayer.x >> 7 == destX && myPlayer.y >> 7 == destY)
  2453. destX = 0;
  2454. int j = playerCount;
  2455. if(flag)
  2456. j = 1;
  2457. for(int l = 0; l < j; l++) {
  2458. Player player;
  2459. int i1;
  2460. if(flag) {
  2461. player = myPlayer;
  2462. i1 = myPlayerIndex << 14;
  2463. } else {
  2464. player = playerArray[playerIndices[l]];
  2465. i1 = playerIndices[l] << 14;
  2466. }
  2467. if(player == null || !player.isVisible())
  2468. continue;
  2469. player.aBoolean1699 = (lowMem && playerCount > 50 || playerCount > 200) && !flag && player.anInt1517 == player.anInt1511;
  2470. int j1 = player.x >> 7;
  2471. int k1 = player.y >> 7;
  2472. if(j1 < 0 || j1 >= 104 || k1 < 0 || k1 >= 104)
  2473. continue;
  2474. if(player.aModel_1714 != null && loopCycle >= player.anInt1707 && loopCycle < player.anInt1708) {
  2475. player.aBoolean1699 = false;
  2476. player.anInt1709 = method42(plane, player.y, player.x);
  2477. worldController.method286(plane, player.y, player, player.anInt1552, player.anInt1722, player.x, player.anInt1709, player.anInt1719, player.anInt1721, i1, player.anInt1720);
  2478. continue;
  2479. }
  2480. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  2481. if(anIntArrayArray929[j1][k1] == anInt1265)
  2482. continue;
  2483. anIntArrayArray929[j1][k1] = anInt1265;
  2484. }
  2485. player.anInt1709 = method42(plane, player.y, player.x);
  2486. worldController.method285(plane, player.anInt1552, player.anInt1709, i1, player.y, 60, player.x, player, player.aBoolean1541);
  2487. }
  2488. }
  2489.  
  2490. private boolean promptUserForInput(RSInterface class9) {
  2491. int j = class9.contentType;
  2492. if(anInt900 == 2) {
  2493. if(j == 201) {
  2494. inputTaken = true;
  2495. inputDialogState = 0;
  2496. messagePromptRaised = true;
  2497. promptInput = "";
  2498. friendsListAction = 1;
  2499. aString1121 = "Enter name of friend to add to list";
  2500. }
  2501. if(j == 202) {
  2502. inputTaken = true;
  2503. inputDialogState = 0;
  2504. messagePromptRaised = true;
  2505. promptInput = "";
  2506. friendsListAction = 2;
  2507. aString1121 = "Enter name of friend to delete from list";
  2508. }
  2509. }
  2510. if(j == 205) {
  2511. anInt1011 = 250;
  2512. return true;
  2513. }
  2514. if(j == 501) {
  2515. inputTaken = true;
  2516. inputDialogState = 0;
  2517. messagePromptRaised = true;
  2518. promptInput = "";
  2519. friendsListAction = 4;
  2520. aString1121 = "Enter name of player to add to list";
  2521. }
  2522. if(j == 502) {
  2523. inputTaken = true;
  2524. inputDialogState = 0;
  2525. messagePromptRaised = true;
  2526. promptInput = "";
  2527. friendsListAction = 5;
  2528. aString1121 = "Enter name of player to delete from list";
  2529. }
  2530. if(j == 550) {
  2531. inputTaken = true;
  2532. inputDialogState = 0;
  2533. messagePromptRaised = true;
  2534. promptInput = "";
  2535. friendsListAction = 6;
  2536. aString1121 = "Enter the name of the chat you wish to join";
  2537. }
  2538. if(j >= 300 && j <= 313) {
  2539. int k = (j - 300) / 2;
  2540. int j1 = j & 1;
  2541. int i2 = anIntArray1065[k];
  2542. if(i2 != -1) {
  2543. do {
  2544. if(j1 == 0 && --i2 < 0)
  2545. i2 = IDK.length - 1;
  2546. if(j1 == 1 && ++i2 >= IDK.length)
  2547. i2 = 0;
  2548. } while(IDK.cache[i2].aBoolean662 || IDK.cache[i2].anInt657 != k + (aBoolean1047 ? 0 : 7));
  2549. anIntArray1065[k] = i2;
  2550. aBoolean1031 = true;
  2551. }
  2552. }
  2553. if(j >= 314 && j <= 323) {
  2554. int l = (j - 314) / 2;
  2555. int k1 = j & 1;
  2556. int j2 = anIntArray990[l];
  2557. if(k1 == 0 && --j2 < 0)
  2558. j2 = anIntArrayArray1003[l].length - 1;
  2559. if(k1 == 1 && ++j2 >= anIntArrayArray1003[l].length)
  2560. j2 = 0;
  2561. anIntArray990[l] = j2;
  2562. aBoolean1031 = true;
  2563. }
  2564. if(j == 324 && !aBoolean1047) {
  2565. aBoolean1047 = true;
  2566. method45();
  2567. }
  2568. if(j == 325 && aBoolean1047) {
  2569. aBoolean1047 = false;
  2570. method45();
  2571. }
  2572. if(j == 326) {
  2573. stream.createFrame(101);
  2574. stream.writeWordBigEndian(aBoolean1047 ? 0 : 1);
  2575. for(int i1 = 0; i1 < 7; i1++)
  2576. stream.writeWordBigEndian(anIntArray1065[i1]);
  2577.  
  2578. for(int l1 = 0; l1 < 5; l1++)
  2579. stream.writeWordBigEndian(anIntArray990[l1]);
  2580.  
  2581. return true;
  2582. }
  2583. if(j == 613)
  2584. canMute = !canMute;
  2585. if(j >= 601 && j <= 612) {
  2586. clearTopInterfaces();
  2587. if(reportAbuseInput.length() > 0) {
  2588. stream.createFrame(218);
  2589. stream.writeQWord(TextClass.longForName(reportAbuseInput));
  2590. stream.writeWordBigEndian(j - 601);
  2591. stream.writeWordBigEndian(canMute ? 1 : 0);
  2592. }
  2593. }
  2594. return false;
  2595. }
  2596.  
  2597. private void method49(Stream stream) {
  2598. for(int j = 0; j < anInt893; j++) {
  2599. int k = anIntArray894[j];
  2600. Player player = playerArray[k];
  2601. int l = stream.readUnsignedByte();
  2602. if((l & 0x40) != 0)
  2603. l += stream.readUnsignedByte() << 8;
  2604. method107(l, k, stream, player);
  2605. }
  2606. }
  2607.  
  2608. private void method50(int i, int k, int l, int i1, int j1) {
  2609. int k1 = worldController.method300(j1, l, i);
  2610. if(k1 != 0) {
  2611. int l1 = worldController.method304(j1, l, i, k1);
  2612. int k2 = l1 >> 6 & 3;
  2613. int i3 = l1 & 0x1f;
  2614. int k3 = k;
  2615. if(k1 > 0)
  2616. k3 = i1;
  2617. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  2618. int k4 = 24624 + l * 4 + (103 - i) * 512 * 4;
  2619. int i5 = k1 >> 14 & 0x7fff;
  2620. ObjectDef class46_2 = ObjectDef.forID(i5);
  2621. if(class46_2.anInt758 != -1) {
  2622. Background background_2 = mapScenes[class46_2.anInt758];
  2623. if(background_2 != null) {
  2624. int i6 = (class46_2.anInt744 * 4 - background_2.anInt1452) / 2;
  2625. int j6 = (class46_2.anInt761 * 4 - background_2.anInt1453) / 2;
  2626. background_2.drawBackground(48 + l * 4 + i6, 48 + (104 - i - class46_2.anInt761) * 4 + j6);
  2627. }
  2628. } else {
  2629. if(i3 == 0 || i3 == 2)
  2630. if(k2 == 0) {
  2631. ai[k4] = k3;
  2632. ai[k4 + 512] = k3;
  2633. ai[k4 + 1024] = k3;
  2634. ai[k4 + 1536] = k3;
  2635. } else if(k2 == 1) {
  2636. ai[k4] = k3;
  2637. ai[k4 + 1] = k3;
  2638. ai[k4 + 2] = k3;
  2639. ai[k4 + 3] = k3;
  2640. } else if(k2 == 2) {
  2641. ai[k4 + 3] = k3;
  2642. ai[k4 + 3 + 512] = k3;
  2643. ai[k4 + 3 + 1024] = k3;
  2644. ai[k4 + 3 + 1536] = k3;
  2645. } else if(k2 == 3) {
  2646. ai[k4 + 1536] = k3;
  2647. ai[k4 + 1536 + 1] = k3;
  2648. ai[k4 + 1536 + 2] = k3;
  2649. ai[k4 + 1536 + 3] = k3;
  2650. }
  2651. if(i3 == 3)
  2652. if(k2 == 0)
  2653. ai[k4] = k3;
  2654. else if(k2 == 1)
  2655. ai[k4 + 3] = k3;
  2656. else if(k2 == 2)
  2657. ai[k4 + 3 + 1536] = k3;
  2658. else if(k2 == 3)
  2659. ai[k4 + 1536] = k3;
  2660. if(i3 == 2)
  2661. if(k2 == 3) {
  2662. ai[k4] = k3;
  2663. ai[k4 + 512] = k3;
  2664. ai[k4 + 1024] = k3;
  2665. ai[k4 + 1536] = k3;
  2666. } else if(k2 == 0) {
  2667. ai[k4] = k3;
  2668. ai[k4 + 1] = k3;
  2669. ai[k4 + 2] = k3;
  2670. ai[k4 + 3] = k3;
  2671. } else if(k2 == 1) {
  2672. ai[k4 + 3] = k3;
  2673. ai[k4 + 3 + 512] = k3;
  2674. ai[k4 + 3 + 1024] = k3;
  2675. ai[k4 + 3 + 1536] = k3;
  2676. } else if(k2 == 2) {
  2677. ai[k4 + 1536] = k3;
  2678. ai[k4 + 1536 + 1] = k3;
  2679. ai[k4 + 1536 + 2] = k3;
  2680. ai[k4 + 1536 + 3] = k3;
  2681. }
  2682. }
  2683. }
  2684. k1 = worldController.method302(j1, l, i);
  2685. if(k1 != 0) {
  2686. int i2 = worldController.method304(j1, l, i, k1);
  2687. int l2 = i2 >> 6 & 3;
  2688. int j3 = i2 & 0x1f;
  2689. int l3 = k1 >> 14 & 0x7fff;
  2690. ObjectDef class46_1 = ObjectDef.forID(l3);
  2691. if(class46_1.anInt758 != -1) {
  2692. Background background_1 = mapScenes[class46_1.anInt758];
  2693. if(background_1 != null) {
  2694. int j5 = (class46_1.anInt744 * 4 - background_1.anInt1452) / 2;
  2695. int k5 = (class46_1.anInt761 * 4 - background_1.anInt1453) / 2;
  2696. background_1.drawBackground(48 + l * 4 + j5, 48 + (104 - i - class46_1.anInt761) * 4 + k5);
  2697. }
  2698. } else if(j3 == 9) {
  2699. int l4 = 0xeeeeee;
  2700. if(k1 > 0)
  2701. l4 = 0xee0000;
  2702. int ai1[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  2703. int l5 = 24624 + l * 4 + (103 - i) * 512 * 4;
  2704. if(l2 == 0 || l2 == 2) {
  2705. ai1[l5 + 1536] = l4;
  2706. ai1[l5 + 1024 + 1] = l4;
  2707. ai1[l5 + 512 + 2] = l4;
  2708. ai1[l5 + 3] = l4;
  2709. } else {
  2710. ai1[l5] = l4;
  2711. ai1[l5 + 512 + 1] = l4;
  2712. ai1[l5 + 1024 + 2] = l4;
  2713. ai1[l5 + 1536 + 3] = l4;
  2714. }
  2715. }
  2716. }
  2717. k1 = worldController.method303(j1, l, i);
  2718. if(k1 != 0) {
  2719. int j2 = k1 >> 14 & 0x7fff;
  2720. ObjectDef class46 = ObjectDef.forID(j2);
  2721. if(class46.anInt758 != -1) {
  2722. Background background = mapScenes[class46.anInt758];
  2723. if(background != null) {
  2724. int i4 = (class46.anInt744 * 4 - background.anInt1452) / 2;
  2725. int j4 = (class46.anInt761 * 4 - background.anInt1453) / 2;
  2726. background.drawBackground(48 + l * 4 + i4, 48 + (104 - i - class46.anInt761) * 4 + j4);
  2727. }
  2728. }
  2729. }
  2730. }
  2731.  
  2732. private void loadTitleScreen() {
  2733. aBackground_966 = new Background(titleStreamLoader, "titlebox", 0);
  2734. aBackground_967 = new Background(titleStreamLoader, "titlebutton", 0);
  2735. aBackgroundArray1152s = new Background[12];
  2736. int j = 0;
  2737. try {
  2738. j = Integer.parseInt(getParameter("fl_icon"));
  2739. } catch(Exception _ex) {
  2740. }
  2741. if(j == 0) {
  2742. for(int k = 0; k < 12; k++)
  2743. aBackgroundArray1152s[k] = new Background(titleStreamLoader, "runes", k);
  2744.  
  2745. } else {
  2746. for(int l = 0; l < 12; l++)
  2747. aBackgroundArray1152s[l] = new Background(titleStreamLoader, "runes", 12 + (l & 3));
  2748.  
  2749. }
  2750. aClass30_Sub2_Sub1_Sub1_1201 = new Sprite(128, 265);
  2751. aClass30_Sub2_Sub1_Sub1_1202 = new Sprite(128, 265);
  2752. System.arraycopy(aRSImageProducer_1110.anIntArray315, 0, aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, 33920);
  2753.  
  2754. System.arraycopy(aRSImageProducer_1111.anIntArray315, 0, aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, 33920);
  2755.  
  2756. anIntArray851 = new int[256];
  2757. for(int k1 = 0; k1 < 64; k1++)
  2758. anIntArray851[k1] = k1 * 0x40000;
  2759.  
  2760. for(int l1 = 0; l1 < 64; l1++)
  2761. anIntArray851[l1 + 64] = 0xff0000 + 1024 * l1;
  2762.  
  2763. for(int i2 = 0; i2 < 64; i2++)
  2764. anIntArray851[i2 + 128] = 0xffff00 + 4 * i2;
  2765.  
  2766. for(int j2 = 0; j2 < 64; j2++)
  2767. anIntArray851[j2 + 192] = 0xffffff;
  2768.  
  2769. anIntArray852 = new int[256];
  2770. for(int k2 = 0; k2 < 64; k2++)
  2771. anIntArray852[k2] = k2 * 1024;
  2772.  
  2773. for(int l2 = 0; l2 < 64; l2++)
  2774. anIntArray852[l2 + 64] = 65280 + 4 * l2;
  2775.  
  2776. for(int i3 = 0; i3 < 64; i3++)
  2777. anIntArray852[i3 + 128] = 65535 + 0x40000 * i3;
  2778.  
  2779. for(int j3 = 0; j3 < 64; j3++)
  2780. anIntArray852[j3 + 192] = 0xffffff;
  2781.  
  2782. anIntArray853 = new int[256];
  2783. for(int k3 = 0; k3 < 64; k3++)
  2784. anIntArray853[k3] = k3 * 4;
  2785.  
  2786. for(int l3 = 0; l3 < 64; l3++)
  2787. anIntArray853[l3 + 64] = 255 + 0x40000 * l3;
  2788.  
  2789. for(int i4 = 0; i4 < 64; i4++)
  2790. anIntArray853[i4 + 128] = 0xff00ff + 1024 * i4;
  2791.  
  2792. for(int j4 = 0; j4 < 64; j4++)
  2793. anIntArray853[j4 + 192] = 0xffffff;
  2794.  
  2795. anIntArray850 = new int[256];
  2796. anIntArray1190 = new int[32768];
  2797. anIntArray1191 = new int[32768];
  2798. randomizeBackground(null);
  2799. anIntArray828 = new int[32768];
  2800. anIntArray829 = new int[32768];
  2801. drawLoadingText(10, "Connecting to fileserver");
  2802. if(!aBoolean831) {
  2803. drawFlames = true;
  2804. aBoolean831 = true;
  2805. startRunnable(this, 2);
  2806. }
  2807. }
  2808.  
  2809. private static void setHighMem() {
  2810. WorldController.lowMem = false;
  2811. Texture.lowMem = false;
  2812. lowMem = false;
  2813. ObjectManager.lowMem = false;
  2814. ObjectDef.lowMem = false;
  2815. }
  2816. public static void main(String args[]) {
  2817. try {
  2818. nodeID = 10;
  2819. portOff = 0;
  2820. setHighMem();
  2821. isMembers = true;
  2822. signlink.storeid = 32;
  2823. signlink.startpriv(InetAddress.getLocalHost());
  2824. client client1 = new client();
  2825. client1.createClientFrame(503, 765);
  2826. } catch (Exception exception) {
  2827. }
  2828. }
  2829. private void loadingStages() {
  2830. if(lowMem && loadingStage == 2 && ObjectManager.anInt131 != plane) {
  2831. aRSImageProducer_1165.initDrawingArea();
  2832. aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151, 257);
  2833. aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.", 150, 256);
  2834. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  2835. loadingStage = 1;
  2836. aLong824 = System.currentTimeMillis();
  2837. }
  2838. if(loadingStage == 1) {
  2839. int j = method54();
  2840. if(j != 0 && System.currentTimeMillis() - aLong824 > 0x57e40L) {
  2841. signlink.reporterror(myUsername + " glcfb " + aLong1215 + "," + j + "," + lowMem + "," + decompressors[0] + "," + onDemandFetcher.getNodeCount() + "," + plane + "," + anInt1069 + "," + anInt1070);
  2842. aLong824 = System.currentTimeMillis();
  2843. }
  2844. }
  2845. if(loadingStage == 2 && plane != anInt985) {
  2846. anInt985 = plane;
  2847. method24(plane);
  2848. }
  2849. }
  2850.  
  2851. private int method54() {
  2852. for(int i = 0; i < aByteArrayArray1183.length; i++) {
  2853. if(aByteArrayArray1183[i] == null && anIntArray1235[i] != -1)
  2854. return -1;
  2855. if(aByteArrayArray1247[i] == null && anIntArray1236[i] != -1)
  2856. return -2;
  2857. }
  2858. boolean flag = true;
  2859. for(int j = 0; j < aByteArrayArray1183.length; j++) {
  2860. byte abyte0[] = aByteArrayArray1247[j];
  2861. if(abyte0 != null) {
  2862. int k = (anIntArray1234[j] >> 8) * 64 - baseX;
  2863. int l = (anIntArray1234[j] & 0xff) * 64 - baseY;
  2864. if(aBoolean1159) {
  2865. k = 10;
  2866. l = 10;
  2867. }
  2868. flag &= ObjectManager.method189(k, abyte0, l);
  2869. }
  2870. }
  2871. if(!flag)
  2872. return -3;
  2873. if(aBoolean1080) {
  2874. return -4;
  2875. } else {
  2876. loadingStage = 2;
  2877. ObjectManager.anInt131 = plane;
  2878. method22();
  2879. stream.createFrame(121);
  2880. return 0;
  2881. }
  2882. }
  2883.  
  2884. private void method55()
  2885. {
  2886. 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())
  2887. if(class30_sub2_sub4_sub4.anInt1597 != plane || loopCycle > class30_sub2_sub4_sub4.anInt1572)
  2888. class30_sub2_sub4_sub4.unlink();
  2889. else
  2890. if(loopCycle >= class30_sub2_sub4_sub4.anInt1571)
  2891. {
  2892. if(class30_sub2_sub4_sub4.anInt1590 > 0)
  2893. {
  2894. NPC npc = npcArray[class30_sub2_sub4_sub4.anInt1590 - 1];
  2895. if(npc != null && npc.x >= 0 && npc.x < 13312 && npc.y >= 0 && npc.y < 13312)
  2896. 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);
  2897. }
  2898. if(class30_sub2_sub4_sub4.anInt1590 < 0)
  2899. {
  2900. int j = -class30_sub2_sub4_sub4.anInt1590 - 1;
  2901. Player player;
  2902. if(j == unknownInt10)
  2903. player = myPlayer;
  2904. else
  2905. player = playerArray[j];
  2906. if(player != null && player.x >= 0 && player.x < 13312 && player.y >= 0 && player.y < 13312)
  2907. 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);
  2908. }
  2909. class30_sub2_sub4_sub4.method456(anInt945);
  2910. 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);
  2911. }
  2912.  
  2913. }
  2914.  
  2915. public AppletContext getAppletContext()
  2916. {
  2917. if(signlink.mainapp != null)
  2918. return signlink.mainapp.getAppletContext();
  2919. else
  2920. return super.getAppletContext();
  2921. }
  2922.  
  2923. private void drawLogo() {
  2924. byte abyte0[] = titleStreamLoader.getDataForName("title.dat");
  2925. Sprite sprite = new Sprite(abyte0, this);
  2926. aRSImageProducer_1110.initDrawingArea();
  2927. sprite.method346(0, 0);
  2928. aRSImageProducer_1111.initDrawingArea();
  2929. sprite.method346(-637, 0);
  2930. aRSImageProducer_1107.initDrawingArea();
  2931. sprite.method346(-128, 0);
  2932. aRSImageProducer_1108.initDrawingArea();
  2933. sprite.method346(-202, -371);
  2934. aRSImageProducer_1109.initDrawingArea();
  2935. sprite.method346(-202, -171);
  2936. aRSImageProducer_1112.initDrawingArea();
  2937. sprite.method346(0, -265);
  2938. aRSImageProducer_1113.initDrawingArea();
  2939. sprite.method346(-562, -265);
  2940. aRSImageProducer_1114.initDrawingArea();
  2941. sprite.method346(-128, -171);
  2942. aRSImageProducer_1115.initDrawingArea();
  2943. sprite.method346(-562, -171);
  2944. int ai[] = new int[sprite.myWidth];
  2945. for(int j = 0; j < sprite.myHeight; j++) {
  2946. for(int k = 0; k < sprite.myWidth; k++)
  2947. ai[k] = sprite.myPixels[(sprite.myWidth - k - 1) + sprite.myWidth * j];
  2948.  
  2949. System.arraycopy(ai, 0, sprite.myPixels, sprite.myWidth * j, sprite.myWidth);
  2950. }
  2951. /*aRSImageProducer_1110.initDrawingArea();
  2952. sprite.method346(382, 0);
  2953. aRSImageProducer_1111.initDrawingArea();
  2954. sprite.method346(-255, 0);
  2955. aRSImageProducer_1107.initDrawingArea();
  2956. sprite.method346(254, 0);
  2957. aRSImageProducer_1108.initDrawingArea();
  2958. sprite.method346(180, -371);
  2959. aRSImageProducer_1109.initDrawingArea();
  2960. sprite.method346(180, -171);
  2961. aRSImageProducer_1112.initDrawingArea();
  2962. sprite.method346(382, -265);
  2963. aRSImageProducer_1113.initDrawingArea();
  2964. sprite.method346(-180, -265);
  2965. aRSImageProducer_1114.initDrawingArea();
  2966. sprite.method346(254, -171);
  2967. aRSImageProducer_1115.initDrawingArea();*/
  2968. // sprite.method346(-180, -171);
  2969. // sprite = new Sprite(titleStreamLoader, "logo", 0);
  2970. // aRSImageProducer_1107.initDrawingArea();
  2971. // sprite.drawSprite(382 - sprite.myWidth / 2 - 128, 18);
  2972. sprite = null;
  2973. Object obj = null;
  2974. Object obj1 = null;
  2975. System.gc();
  2976. }
  2977.  
  2978. private void processOnDemandQueue()
  2979. {
  2980. do
  2981. {
  2982. OnDemandData onDemandData;
  2983. do
  2984. {
  2985. onDemandData = onDemandFetcher.getNextNode();
  2986. if(onDemandData == null)
  2987. return;
  2988. if(onDemandData.dataType == 0)
  2989. {
  2990. Model.method460(onDemandData.buffer, onDemandData.ID);
  2991. if((onDemandFetcher.getModelIndex(onDemandData.ID) & 0x62) != 0)
  2992. {
  2993. needDrawTabArea = true;
  2994. if(backDialogID != -1)
  2995. inputTaken = true;
  2996. }
  2997. }
  2998. if(onDemandData.dataType == 1 && onDemandData.buffer != null)
  2999. Class36.method529(onDemandData.buffer);
  3000. if(onDemandData.dataType == 2 && onDemandData.ID == nextSong && onDemandData.buffer != null)
  3001. saveMidi(songChanging, onDemandData.buffer);
  3002. if(onDemandData.dataType == 3 && loadingStage == 1)
  3003. {
  3004. for(int i = 0; i < aByteArrayArray1183.length; i++)
  3005. {
  3006. if(anIntArray1235[i] == onDemandData.ID)
  3007. {
  3008. aByteArrayArray1183[i] = onDemandData.buffer;
  3009. if(onDemandData.buffer == null)
  3010. anIntArray1235[i] = -1;
  3011. break;
  3012. }
  3013. if(anIntArray1236[i] != onDemandData.ID)
  3014. continue;
  3015. aByteArrayArray1247[i] = onDemandData.buffer;
  3016. if(onDemandData.buffer == null)
  3017. anIntArray1236[i] = -1;
  3018. break;
  3019. }
  3020.  
  3021. }
  3022. } while(onDemandData.dataType != 93 || !onDemandFetcher.method564(onDemandData.ID));
  3023. ObjectManager.method173(new Stream(onDemandData.buffer), onDemandFetcher);
  3024. } while(true);
  3025. }
  3026.  
  3027. private void calcFlamesPosition()
  3028. {
  3029. char c = '\u0100';
  3030. for(int j = 10; j < 117; j++)
  3031. {
  3032. int k = (int)(Math.random() * 100D);
  3033. if(k < 50)
  3034. anIntArray828[j + (c - 2 << 7)] = 255;
  3035. }
  3036. for(int l = 0; l < 100; l++)
  3037. {
  3038. int i1 = (int)(Math.random() * 124D) + 2;
  3039. int k1 = (int)(Math.random() * 128D) + 128;
  3040. int k2 = i1 + (k1 << 7);
  3041. anIntArray828[k2] = 192;
  3042. }
  3043.  
  3044. for(int j1 = 1; j1 < c - 1; j1++)
  3045. {
  3046. for(int l1 = 1; l1 < 127; l1++)
  3047. {
  3048. int l2 = l1 + (j1 << 7);
  3049. anIntArray829[l2] = (anIntArray828[l2 - 1] + anIntArray828[l2 + 1] + anIntArray828[l2 - 128] + anIntArray828[l2 + 128]) / 4;
  3050. }
  3051.  
  3052. }
  3053.  
  3054. anInt1275 += 128;
  3055. if(anInt1275 > anIntArray1190.length)
  3056. {
  3057. anInt1275 -= anIntArray1190.length;
  3058. int i2 = (int)(Math.random() * 12D);
  3059. randomizeBackground(aBackgroundArray1152s[i2]);
  3060. }
  3061. for(int j2 = 1; j2 < c - 1; j2++)
  3062. {
  3063. for(int i3 = 1; i3 < 127; i3++)
  3064. {
  3065. int k3 = i3 + (j2 << 7);
  3066. int i4 = anIntArray829[k3 + 128] - anIntArray1190[k3 + anInt1275 & anIntArray1190.length - 1] / 5;
  3067. if(i4 < 0)
  3068. i4 = 0;
  3069. anIntArray828[k3] = i4;
  3070. }
  3071.  
  3072. }
  3073.  
  3074. System.arraycopy(anIntArray969, 1, anIntArray969, 0, c - 1);
  3075.  
  3076. anIntArray969[c - 1] = (int)(Math.sin((double)loopCycle / 14D) * 16D + Math.sin((double)loopCycle / 15D) * 14D + Math.sin((double)loopCycle / 16D) * 12D);
  3077. if(anInt1040 > 0)
  3078. anInt1040 -= 4;
  3079. if(anInt1041 > 0)
  3080. anInt1041 -= 4;
  3081. if(anInt1040 == 0 && anInt1041 == 0)
  3082. {
  3083. int l3 = (int)(Math.random() * 2000D);
  3084. if(l3 == 0)
  3085. anInt1040 = 1024;
  3086. if(l3 == 1)
  3087. anInt1041 = 1024;
  3088. }
  3089. }
  3090.  
  3091. private boolean saveWave(byte abyte0[], int i)
  3092. {
  3093. return abyte0 == null || signlink.wavesave(abyte0, i);
  3094. }
  3095.  
  3096. private void method60(int i)
  3097. {
  3098. RSInterface class9 = RSInterface.interfaceCache[i];
  3099. for(int j = 0; j < class9.children.length; j++)
  3100. {
  3101. if(class9.children[j] == -1)
  3102. break;
  3103. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j]];
  3104. if(class9_1.type == 1)
  3105. method60(class9_1.id);
  3106. class9_1.anInt246 = 0;
  3107. class9_1.anInt208 = 0;
  3108. }
  3109. }
  3110.  
  3111. private void drawHeadIcon()
  3112. {
  3113. if(anInt855 != 2)
  3114. return;
  3115. calcEntityScreenPos((anInt934 - baseX << 7) + anInt937, anInt936 * 2, (anInt935 - baseY << 7) + anInt938);
  3116. if(spriteDrawX > -1 && loopCycle % 20 < 10)
  3117. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  3118. }
  3119.  
  3120. private void mainGameProcessor()
  3121. {
  3122. if(anInt1104 > 1)
  3123. anInt1104--;
  3124. if(anInt1011 > 0)
  3125. anInt1011--;
  3126. for(int j = 0; j < 5; j++)
  3127. if(!parsePacket())
  3128. break;
  3129.  
  3130. if(!loggedIn)
  3131. return;
  3132. synchronized(mouseDetection.syncObject)
  3133. {
  3134. if(flagged)
  3135. {
  3136. if(super.clickMode3 != 0 || mouseDetection.coordsIndex >= 40)
  3137. {
  3138. stream.createFrame(45);
  3139. stream.writeWordBigEndian(0);
  3140. int j2 = stream.currentOffset;
  3141. int j3 = 0;
  3142. for(int j4 = 0; j4 < mouseDetection.coordsIndex; j4++)
  3143. {
  3144. if(j2 - stream.currentOffset >= 240)
  3145. break;
  3146. j3++;
  3147. int l4 = mouseDetection.coordsY[j4];
  3148. if(l4 < 0)
  3149. l4 = 0;
  3150. else
  3151. if(l4 > 502)
  3152. l4 = 502;
  3153. int k5 = mouseDetection.coordsX[j4];
  3154. if(k5 < 0)
  3155. k5 = 0;
  3156. else
  3157. if(k5 > 764)
  3158. k5 = 764;
  3159. int i6 = l4 * 765 + k5;
  3160. if(mouseDetection.coordsY[j4] == -1 && mouseDetection.coordsX[j4] == -1)
  3161. {
  3162. k5 = -1;
  3163. l4 = -1;
  3164. i6 = 0x7ffff;
  3165. }
  3166. if(k5 == anInt1237 && l4 == anInt1238)
  3167. {
  3168. if(anInt1022 < 2047)
  3169. anInt1022++;
  3170. } else
  3171. {
  3172. int j6 = k5 - anInt1237;
  3173. anInt1237 = k5;
  3174. int k6 = l4 - anInt1238;
  3175. anInt1238 = l4;
  3176. if(anInt1022 < 8 && j6 >= -32 && j6 <= 31 && k6 >= -32 && k6 <= 31)
  3177. {
  3178. j6 += 32;
  3179. k6 += 32;
  3180. stream.writeWord((anInt1022 << 12) + (j6 << 6) + k6);
  3181. anInt1022 = 0;
  3182. } else
  3183. if(anInt1022 < 8)
  3184. {
  3185. stream.writeDWordBigEndian(0x800000 + (anInt1022 << 19) + i6);
  3186. anInt1022 = 0;
  3187. } else
  3188. {
  3189. stream.writeDWord(0xc0000000 + (anInt1022 << 19) + i6);
  3190. anInt1022 = 0;
  3191. }
  3192. }
  3193. }
  3194.  
  3195. stream.writeBytes(stream.currentOffset - j2);
  3196. if(j3 >= mouseDetection.coordsIndex)
  3197. {
  3198. mouseDetection.coordsIndex = 0;
  3199. } else
  3200. {
  3201. mouseDetection.coordsIndex -= j3;
  3202. for(int i5 = 0; i5 < mouseDetection.coordsIndex; i5++)
  3203. {
  3204. mouseDetection.coordsX[i5] = mouseDetection.coordsX[i5 + j3];
  3205. mouseDetection.coordsY[i5] = mouseDetection.coordsY[i5 + j3];
  3206. }
  3207.  
  3208. }
  3209. }
  3210. } else
  3211. {
  3212. mouseDetection.coordsIndex = 0;
  3213. }
  3214. }
  3215. if(super.clickMode3 != 0)
  3216. {
  3217. long l = (super.aLong29 - aLong1220) / 50L;
  3218. if(l > 4095L)
  3219. l = 4095L;
  3220. aLong1220 = super.aLong29;
  3221. int k2 = super.saveClickY;
  3222. if(k2 < 0)
  3223. k2 = 0;
  3224. else
  3225. if(k2 > 502)
  3226. k2 = 502;
  3227. int k3 = super.saveClickX;
  3228. if(k3 < 0)
  3229. k3 = 0;
  3230. else
  3231. if(k3 > 764)
  3232. k3 = 764;
  3233. int k4 = k2 * 765 + k3;
  3234. int j5 = 0;
  3235. if(super.clickMode3 == 2)
  3236. j5 = 1;
  3237. int l5 = (int)l;
  3238. stream.createFrame(241);
  3239. stream.writeDWord((l5 << 20) + (j5 << 19) + k4);
  3240. }
  3241. if(anInt1016 > 0)
  3242. anInt1016--;
  3243. if(super.keyArray[1] == 1 || super.keyArray[2] == 1 || super.keyArray[3] == 1 || super.keyArray[4] == 1)
  3244. aBoolean1017 = true;
  3245. if(aBoolean1017 && anInt1016 <= 0)
  3246. {
  3247. anInt1016 = 20;
  3248. aBoolean1017 = false;
  3249. stream.createFrame(86);
  3250. stream.writeWord(anInt1184);
  3251. stream.method432(minimapInt1);
  3252. }
  3253. if(super.awtFocus && !aBoolean954)
  3254. {
  3255. aBoolean954 = true;
  3256. stream.createFrame(3);
  3257. stream.writeWordBigEndian(1);
  3258. }
  3259. if(!super.awtFocus && aBoolean954)
  3260. {
  3261. aBoolean954 = false;
  3262. stream.createFrame(3);
  3263. stream.writeWordBigEndian(0);
  3264. }
  3265. loadingStages();
  3266. method115();
  3267. method90();
  3268. anInt1009++;
  3269. if(anInt1009 > 750)
  3270. dropClient();
  3271. method114();
  3272. method95();
  3273. method38();
  3274. anInt945++;
  3275. if(crossType != 0)
  3276. {
  3277. crossIndex += 20;
  3278. if(crossIndex >= 400)
  3279. crossType = 0;
  3280. }
  3281. if(atInventoryInterfaceType != 0)
  3282. {
  3283. atInventoryLoopCycle++;
  3284. if(atInventoryLoopCycle >= 15)
  3285. {
  3286. if(atInventoryInterfaceType == 2)
  3287. needDrawTabArea = true;
  3288. if(atInventoryInterfaceType == 3)
  3289. inputTaken = true;
  3290. atInventoryInterfaceType = 0;
  3291. }
  3292. }
  3293. if(activeInterfaceType != 0)
  3294. {
  3295. anInt989++;
  3296. if(super.mouseX > anInt1087 + 5 || super.mouseX < anInt1087 - 5 || super.mouseY > anInt1088 + 5 || super.mouseY < anInt1088 - 5)
  3297. aBoolean1242 = true;
  3298. if(super.clickMode2 == 0)
  3299. {
  3300. if(activeInterfaceType == 2)
  3301. needDrawTabArea = true;
  3302. if(activeInterfaceType == 3)
  3303. inputTaken = true;
  3304. activeInterfaceType = 0;
  3305. if(aBoolean1242 && anInt989 >= 5)
  3306. {
  3307. lastActiveInvInterface = -1;
  3308. processRightClick();
  3309. if(lastActiveInvInterface == anInt1084 && mouseInvInterfaceIndex != anInt1085)
  3310. {
  3311. RSInterface class9 = RSInterface.interfaceCache[anInt1084];
  3312. int j1 = 0;
  3313. if(anInt913 == 1 && class9.contentType == 206)
  3314. j1 = 1;
  3315. if(class9.inv[mouseInvInterfaceIndex] <= 0)
  3316. j1 = 0;
  3317. if(class9.aBoolean235)
  3318. {
  3319. int l2 = anInt1085;
  3320. int l3 = mouseInvInterfaceIndex;
  3321. class9.inv[l3] = class9.inv[l2];
  3322. class9.invStackSizes[l3] = class9.invStackSizes[l2];
  3323. class9.inv[l2] = -1;
  3324. class9.invStackSizes[l2] = 0;
  3325. } else
  3326. if(j1 == 1)
  3327. {
  3328. int i3 = anInt1085;
  3329. for(int i4 = mouseInvInterfaceIndex; i3 != i4;)
  3330. if(i3 > i4)
  3331. {
  3332. class9.swapInventoryItems(i3, i3 - 1);
  3333. i3--;
  3334. } else
  3335. if(i3 < i4)
  3336. {
  3337. class9.swapInventoryItems(i3, i3 + 1);
  3338. i3++;
  3339. }
  3340.  
  3341. } else
  3342. {
  3343. class9.swapInventoryItems(anInt1085, mouseInvInterfaceIndex);
  3344. }
  3345. stream.createFrame(214);
  3346. stream.method433(anInt1084);
  3347. stream.method424(j1);
  3348. stream.method433(anInt1085);
  3349. stream.method431(mouseInvInterfaceIndex);
  3350. }
  3351. } else
  3352. if((anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  3353. determineMenuSize();
  3354. else
  3355. if(menuActionRow > 0)
  3356. doAction(menuActionRow - 1);
  3357. atInventoryLoopCycle = 10;
  3358. super.clickMode3 = 0;
  3359. }
  3360. }
  3361. if(WorldController.anInt470 != -1)
  3362. {
  3363. int k = WorldController.anInt470;
  3364. int k1 = WorldController.anInt471;
  3365. boolean flag = doWalkTo(0, 0, 0, 0, myPlayer.smallY[0], 0, 0, k1, myPlayer.smallX[0], true, k);
  3366. WorldController.anInt470 = -1;
  3367. if(flag)
  3368. {
  3369. crossX = super.saveClickX;
  3370. crossY = super.saveClickY;
  3371. crossType = 1;
  3372. crossIndex = 0;
  3373. }
  3374. }
  3375. if(super.clickMode3 == 1 && aString844 != null)
  3376. {
  3377. aString844 = null;
  3378. inputTaken = true;
  3379. super.clickMode3 = 0;
  3380. }
  3381. processMenuClick();
  3382. processMainScreenClick();
  3383. processTabClick();
  3384. processChatModeClick();
  3385. if(super.clickMode2 == 1 || super.clickMode3 == 1)
  3386. anInt1213++;
  3387. if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  3388. if (anInt1501 < 100) {
  3389. anInt1501++;
  3390. if (anInt1501 == 100) {
  3391. if (anInt1500 != 0) {
  3392. inputTaken = true;
  3393. }
  3394. if (anInt1044 != 0) {
  3395. needDrawTabArea = true;
  3396. }
  3397. }
  3398. }
  3399. } else if (anInt1501 > 0) {
  3400. anInt1501--;
  3401. }
  3402. if(loadingStage == 2)
  3403. method108();
  3404. if(loadingStage == 2 && aBoolean1160)
  3405. calcCameraPos();
  3406. for(int i1 = 0; i1 < 5; i1++)
  3407. anIntArray1030[i1]++;
  3408.  
  3409. method73();
  3410. super.idleTime++;
  3411. if(super.idleTime > 4500)
  3412. {
  3413. anInt1011 = 250;
  3414. super.idleTime -= 500;
  3415. stream.createFrame(202);
  3416. }
  3417. anInt988++;
  3418. if(anInt988 > 500)
  3419. {
  3420. anInt988 = 0;
  3421. int l1 = (int)(Math.random() * 8D);
  3422. if((l1 & 1) == 1)
  3423. anInt1278 += anInt1279;
  3424. if((l1 & 2) == 2)
  3425. anInt1131 += anInt1132;
  3426. if((l1 & 4) == 4)
  3427. anInt896 += anInt897;
  3428. }
  3429. if(anInt1278 < -50)
  3430. anInt1279 = 2;
  3431. if(anInt1278 > 50)
  3432. anInt1279 = -2;
  3433. if(anInt1131 < -55)
  3434. anInt1132 = 2;
  3435. if(anInt1131 > 55)
  3436. anInt1132 = -2;
  3437. if(anInt896 < -40)
  3438. anInt897 = 1;
  3439. if(anInt896 > 40)
  3440. anInt897 = -1;
  3441. anInt1254++;
  3442. if(anInt1254 > 500)
  3443. {
  3444. anInt1254 = 0;
  3445. int i2 = (int)(Math.random() * 8D);
  3446. if((i2 & 1) == 1)
  3447. minimapInt2 += anInt1210;
  3448. if((i2 & 2) == 2)
  3449. minimapInt3 += anInt1171;
  3450. }
  3451. if(minimapInt2 < -60)
  3452. anInt1210 = 2;
  3453. if(minimapInt2 > 60)
  3454. anInt1210 = -2;
  3455. if(minimapInt3 < -20)
  3456. anInt1171 = 1;
  3457. if(minimapInt3 > 10)
  3458. anInt1171 = -1;
  3459. anInt1010++;
  3460. if(anInt1010 > 50)
  3461. stream.createFrame(0);
  3462. try
  3463. {
  3464. if(socketStream != null && stream.currentOffset > 0)
  3465. {
  3466. socketStream.queueBytes(stream.currentOffset, stream.buffer);
  3467. stream.currentOffset = 0;
  3468. anInt1010 = 0;
  3469. }
  3470. }
  3471. catch(IOException _ex)
  3472. {
  3473. dropClient();
  3474. }
  3475. catch(Exception exception)
  3476. {
  3477. resetLogout();
  3478. }
  3479. }
  3480.  
  3481. private void method63()
  3482. {
  3483. Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst();
  3484. for(; class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  3485. if(class30_sub1.anInt1294 == -1)
  3486. {
  3487. class30_sub1.anInt1302 = 0;
  3488. method89(class30_sub1);
  3489. } else
  3490. {
  3491. class30_sub1.unlink();
  3492. }
  3493.  
  3494. }
  3495.  
  3496. private void resetImageProducers()
  3497. {
  3498. if(aRSImageProducer_1107 != null)
  3499. return;
  3500. super.fullGameScreen = null;
  3501. aRSImageProducer_1166 = null;
  3502. aRSImageProducer_1164 = null;
  3503. aRSImageProducer_1163 = null;
  3504. aRSImageProducer_1165 = null;
  3505. aRSImageProducer_1123 = null;
  3506. aRSImageProducer_1124 = null;
  3507. aRSImageProducer_1125 = null;
  3508. aRSImageProducer_1110 = new RSImageProducer(128, 265, getGameComponent());
  3509. DrawingArea.setAllPixelsToZero();
  3510. aRSImageProducer_1111 = new RSImageProducer(128, 265, getGameComponent());
  3511. DrawingArea.setAllPixelsToZero();
  3512. aRSImageProducer_1107 = new RSImageProducer(509, 171, getGameComponent());
  3513. DrawingArea.setAllPixelsToZero();
  3514. aRSImageProducer_1108 = new RSImageProducer(360, 132, getGameComponent());
  3515. DrawingArea.setAllPixelsToZero();
  3516. aRSImageProducer_1109 = new RSImageProducer(360, 200, getGameComponent());
  3517. DrawingArea.setAllPixelsToZero();
  3518. aRSImageProducer_1112 = new RSImageProducer(202, 238, getGameComponent());
  3519. DrawingArea.setAllPixelsToZero();
  3520. aRSImageProducer_1113 = new RSImageProducer(203, 238, getGameComponent());
  3521. DrawingArea.setAllPixelsToZero();
  3522. aRSImageProducer_1114 = new RSImageProducer(74, 94, getGameComponent());
  3523. DrawingArea.setAllPixelsToZero();
  3524. aRSImageProducer_1115 = new RSImageProducer(75, 94, getGameComponent());
  3525. DrawingArea.setAllPixelsToZero();
  3526. if(titleStreamLoader != null)
  3527. {
  3528. drawLogo();
  3529. loadTitleScreen();
  3530. }
  3531. welcomeScreenRaised = true;
  3532. }
  3533.  
  3534. void drawLoadingText(int i, String s)
  3535. {
  3536. anInt1079 = i;
  3537. aString1049 = s;
  3538. resetImageProducers();
  3539. if(titleStreamLoader == null)
  3540. {
  3541. super.drawLoadingText(i, s);
  3542. return;
  3543. }
  3544. aRSImageProducer_1109.initDrawingArea();
  3545. char c = '\u0168';
  3546. char c1 = '\310';
  3547. byte byte1 = 20;
  3548. chatTextDrawingArea.drawText(0xffffff, "Wake & Bake is loading - please wait...", c1 / 2 - 26 - byte1, c / 2);
  3549. int j = c1 / 2 - 18 - byte1;
  3550. DrawingArea.fillPixels(c / 2 - 152, 304, 34, 0x8c1111, j);
  3551. DrawingArea.fillPixels(c / 2 - 151, 302, 32, 0, j + 1);
  3552. DrawingArea.drawPixels(30, j + 2, c / 2 - 150, 0x8c1111, i * 3);
  3553. DrawingArea.drawPixels(30, j + 2, (c / 2 - 150) + i * 3, 0, 300 - i * 3);
  3554. chatTextDrawingArea.drawText(0xffffff, s, (c1 / 2 + 5) - byte1, c / 2);
  3555. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  3556. if(welcomeScreenRaised)
  3557. {
  3558. welcomeScreenRaised = false;
  3559. if(!aBoolean831)
  3560. {
  3561. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  3562. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  3563. }
  3564. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  3565. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  3566. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  3567. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  3568. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  3569. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  3570. }
  3571. }
  3572.  
  3573. private void method65(int i, int j, int k, int l, RSInterface class9, int i1, boolean flag,
  3574. int j1)
  3575. {
  3576. int anInt992;
  3577. if(aBoolean972)
  3578. anInt992 = 32;
  3579. else
  3580. anInt992 = 0;
  3581. aBoolean972 = false;
  3582. if(k >= i && k < i + 16 && l >= i1 && l < i1 + 16)
  3583. {
  3584. class9.scrollPosition -= anInt1213 * 4;
  3585. if(flag)
  3586. {
  3587. needDrawTabArea = true;
  3588. }
  3589. } else
  3590. if(k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j)
  3591. {
  3592. class9.scrollPosition += anInt1213 * 4;
  3593. if(flag)
  3594. {
  3595. needDrawTabArea = true;
  3596. }
  3597. } else
  3598. if(k >= i - anInt992 && k < i + 16 + anInt992 && l >= i1 + 16 && l < (i1 + j) - 16 && anInt1213 > 0)
  3599. {
  3600. int l1 = ((j - 32) * j) / j1;
  3601. if(l1 < 8)
  3602. l1 = 8;
  3603. int i2 = l - i1 - 16 - l1 / 2;
  3604. int j2 = j - 32 - l1;
  3605. class9.scrollPosition = ((j1 - j) * i2) / j2;
  3606. if(flag)
  3607. needDrawTabArea = true;
  3608. aBoolean972 = true;
  3609. }
  3610. }
  3611.  
  3612. private boolean method66(int i, int j, int k)
  3613. {
  3614. int i1 = i >> 14 & 0x7fff;
  3615. int j1 = worldController.method304(plane, k, j, i);
  3616. if(j1 == -1)
  3617. return false;
  3618. int k1 = j1 & 0x1f;
  3619. int l1 = j1 >> 6 & 3;
  3620. if(k1 == 10 || k1 == 11 || k1 == 22)
  3621. {
  3622. ObjectDef class46 = ObjectDef.forID(i1);
  3623. int i2;
  3624. int j2;
  3625. if(l1 == 0 || l1 == 2)
  3626. {
  3627. i2 = class46.anInt744;
  3628. j2 = class46.anInt761;
  3629. } else
  3630. {
  3631. i2 = class46.anInt761;
  3632. j2 = class46.anInt744;
  3633. }
  3634. int k2 = class46.anInt768;
  3635. if(l1 != 0)
  3636. k2 = (k2 << l1 & 0xf) + (k2 >> 4 - l1);
  3637. doWalkTo(2, 0, j2, 0, myPlayer.smallY[0], i2, k2, j, myPlayer.smallX[0], false, k);
  3638. } else
  3639. {
  3640. doWalkTo(2, l1, 0, k1 + 1, myPlayer.smallY[0], 0, 0, j, myPlayer.smallX[0], false, k);
  3641. }
  3642. crossX = super.saveClickX;
  3643. crossY = super.saveClickY;
  3644. crossType = 2;
  3645. crossIndex = 0;
  3646. return true;
  3647. }
  3648.  
  3649. private StreamLoader streamLoaderForName(int i, String s, String s1, int j, int k)
  3650. {
  3651. byte abyte0[] = null;
  3652. int l = 5;
  3653. try
  3654. {
  3655. if(decompressors[0] != null)
  3656. abyte0 = decompressors[0].decompress(i);
  3657. }
  3658. catch(Exception _ex) { }
  3659. if(abyte0 != null)
  3660. {
  3661. // aCRC32_930.reset();
  3662. // aCRC32_930.update(abyte0);
  3663. // int i1 = (int)aCRC32_930.getValue();
  3664. // if(i1 != j)
  3665. }
  3666. if(abyte0 != null)
  3667. {
  3668. StreamLoader streamLoader = new StreamLoader(abyte0);
  3669. return streamLoader;
  3670. }
  3671. int j1 = 0;
  3672. while(abyte0 == null)
  3673. {
  3674. String s2 = "Unknown error";
  3675. drawLoadingText(k, "Requesting " + s);
  3676. Object obj = null;
  3677. try
  3678. {
  3679. int k1 = 0;
  3680. DataInputStream datainputstream = openJagGrabInputStream(s1 + j);
  3681. byte abyte1[] = new byte[6];
  3682. datainputstream.readFully(abyte1, 0, 6);
  3683. Stream stream = new Stream(abyte1);
  3684. stream.currentOffset = 3;
  3685. int i2 = stream.read3Bytes() + 6;
  3686. int j2 = 6;
  3687. abyte0 = new byte[i2];
  3688. System.arraycopy(abyte1, 0, abyte0, 0, 6);
  3689.  
  3690. while(j2 < i2)
  3691. {
  3692. int l2 = i2 - j2;
  3693. if(l2 > 1000)
  3694. l2 = 1000;
  3695. int j3 = datainputstream.read(abyte0, j2, l2);
  3696. if(j3 < 0)
  3697. {
  3698. s2 = "Length error: " + j2 + "/" + i2;
  3699. throw new IOException("EOF");
  3700. }
  3701. j2 += j3;
  3702. int k3 = (j2 * 100) / i2;
  3703. if(k3 != k1)
  3704. drawLoadingText(k, "Loading " + s + " - " + k3 + "%");
  3705. k1 = k3;
  3706. }
  3707. datainputstream.close();
  3708. try
  3709. {
  3710. if(decompressors[0] != null)
  3711. decompressors[0].method234(abyte0.length, abyte0, i);
  3712. }
  3713. catch(Exception _ex)
  3714. {
  3715. decompressors[0] = null;
  3716. }
  3717. /* if(abyte0 != null)
  3718. {
  3719. aCRC32_930.reset();
  3720. aCRC32_930.update(abyte0);
  3721. int i3 = (int)aCRC32_930.getValue();
  3722. if(i3 != j)
  3723. {
  3724. abyte0 = null;
  3725. j1++;
  3726. s2 = "Checksum error: " + i3;
  3727. }
  3728. }
  3729. */
  3730. }
  3731. catch(IOException ioexception)
  3732. {
  3733. if(s2.equals("Unknown error"))
  3734. s2 = "Connection error";
  3735. abyte0 = null;
  3736. }
  3737. catch(NullPointerException _ex)
  3738. {
  3739. s2 = "Null error";
  3740. abyte0 = null;
  3741. if(!signlink.reporterror)
  3742. return null;
  3743. }
  3744. catch(ArrayIndexOutOfBoundsException _ex)
  3745. {
  3746. s2 = "Bounds error";
  3747. abyte0 = null;
  3748. if(!signlink.reporterror)
  3749. return null;
  3750. }
  3751. catch(Exception _ex)
  3752. {
  3753. s2 = "Unexpected error";
  3754. abyte0 = null;
  3755. if(!signlink.reporterror)
  3756. return null;
  3757. }
  3758. if(abyte0 == null)
  3759. {
  3760. for(int l1 = l; l1 > 0; l1--)
  3761. {
  3762. if(j1 >= 3)
  3763. {
  3764. drawLoadingText(k, "Game updated - please reload page");
  3765. l1 = 10;
  3766. } else
  3767. {
  3768. drawLoadingText(k, s2 + " - Retrying in " + l1);
  3769. }
  3770. try
  3771. {
  3772. Thread.sleep(1000L);
  3773. }
  3774. catch(Exception _ex) { }
  3775. }
  3776.  
  3777. l *= 2;
  3778. if(l > 60)
  3779. l = 60;
  3780. aBoolean872 = !aBoolean872;
  3781. }
  3782.  
  3783. }
  3784.  
  3785. StreamLoader streamLoader_1 = new StreamLoader(abyte0);
  3786. return streamLoader_1;
  3787. }
  3788.  
  3789. private void dropClient()
  3790. {
  3791. if(anInt1011 > 0)
  3792. {
  3793. resetLogout();
  3794. return;
  3795. }
  3796. aRSImageProducer_1165.initDrawingArea();
  3797. aTextDrawingArea_1271.drawText(0, "Connection lost", 144, 257);
  3798. aTextDrawingArea_1271.drawText(0xffffff, "Connection lost", 143, 256);
  3799. aTextDrawingArea_1271.drawText(0, "Please wait - attempting to reestablish", 159, 257);
  3800. aTextDrawingArea_1271.drawText(0xffffff, "Please wait - attempting to reestablish", 158, 256);
  3801. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  3802. anInt1021 = 0;
  3803. destX = 0;
  3804. RSSocket rsSocket = socketStream;
  3805. loggedIn = false;
  3806. loginFailures = 0;
  3807. login(myUsername, myPassword, true);
  3808. if(!loggedIn)
  3809. resetLogout();
  3810. try
  3811. {
  3812. rsSocket.close();
  3813. }
  3814. catch(Exception _ex)
  3815. {
  3816. }
  3817. }
  3818.  
  3819. private void doAction(int i)
  3820. {
  3821. if(i < 0)
  3822. return;
  3823. if(inputDialogState != 0)
  3824. {
  3825. inputDialogState = 0;
  3826. inputTaken = true;
  3827. }
  3828. int j = menuActionCmd2[i];
  3829. int k = menuActionCmd3[i];
  3830. int l = menuActionID[i];
  3831. int i1 = menuActionCmd1[i];
  3832. if(l >= 2000)
  3833. l -= 2000;
  3834. if(l == 582)
  3835. {
  3836. NPC npc = npcArray[i1];
  3837. if(npc != null)
  3838. {
  3839. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0], myPlayer.smallX[0], false, npc.smallX[0]);
  3840. crossX = super.saveClickX;
  3841. crossY = super.saveClickY;
  3842. crossType = 2;
  3843. crossIndex = 0;
  3844. stream.createFrame(57);
  3845. stream.method432(anInt1285);
  3846. stream.method432(i1);
  3847. stream.method431(anInt1283);
  3848. stream.method432(anInt1284);
  3849. }
  3850. }
  3851. if(l == 234)
  3852. {
  3853. boolean flag1 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  3854. if(!flag1)
  3855. flag1 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  3856. crossX = super.saveClickX;
  3857. crossY = super.saveClickY;
  3858. crossType = 2;
  3859. crossIndex = 0;
  3860. stream.createFrame(236);
  3861. stream.method431(k + baseY);
  3862. stream.writeWord(i1);
  3863. stream.method431(j + baseX);
  3864. }
  3865. if(l == 62 && method66(i1, k, j))
  3866. {
  3867. stream.createFrame(192);
  3868. stream.writeWord(anInt1284);
  3869. stream.method431(i1 >> 14 & 0x7fff);
  3870. stream.method433(k + baseY);
  3871. stream.method431(anInt1283);
  3872. stream.method433(j + baseX);
  3873. stream.writeWord(anInt1285);
  3874. }
  3875. if(l == 511)
  3876. {
  3877. boolean flag2 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  3878. if(!flag2)
  3879. flag2 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  3880. crossX = super.saveClickX;
  3881. crossY = super.saveClickY;
  3882. crossType = 2;
  3883. crossIndex = 0;
  3884. stream.createFrame(25);
  3885. stream.method431(anInt1284);
  3886. stream.method432(anInt1285);
  3887. stream.writeWord(i1);
  3888. stream.method432(k + baseY);
  3889. stream.method433(anInt1283);
  3890. stream.writeWord(j + baseX);
  3891. }
  3892. if(l == 74)
  3893. {
  3894. stream.createFrame(122);
  3895. stream.method433(k);
  3896. stream.method432(j);
  3897. stream.method431(i1);
  3898. atInventoryLoopCycle = 0;
  3899. atInventoryInterface = k;
  3900. atInventoryIndex = j;
  3901. atInventoryInterfaceType = 2;
  3902. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3903. atInventoryInterfaceType = 1;
  3904. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3905. atInventoryInterfaceType = 3;
  3906. }
  3907. if (l == 315) {
  3908. RSInterface class9 = RSInterface.interfaceCache[k];
  3909. boolean flag8 = true;
  3910. if (class9.contentType > 0)
  3911. flag8 = promptUserForInput(class9);
  3912. if (flag8) {
  3913.  
  3914. switch(k){
  3915. case 19144:
  3916. sendFrame248(15106,3213);
  3917. method60(15106);
  3918. inputTaken = true;
  3919. break;
  3920. default:
  3921. stream.createFrame(185);
  3922. stream.writeWord(k);
  3923. break;
  3924.  
  3925. }
  3926. }
  3927. }
  3928. if(l == 561)
  3929. {
  3930. Player player = playerArray[i1];
  3931. if(player != null)
  3932. {
  3933. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, player.smallY[0], myPlayer.smallX[0], false, player.smallX[0]);
  3934. crossX = super.saveClickX;
  3935. crossY = super.saveClickY;
  3936. crossType = 2;
  3937. crossIndex = 0;
  3938. anInt1188 += i1;
  3939. if(anInt1188 >= 90)
  3940. {
  3941. stream.createFrame(136);
  3942. anInt1188 = 0;
  3943. }
  3944. stream.createFrame(128);
  3945. stream.writeWord(i1);
  3946. }
  3947. }
  3948. if(l == 20)
  3949. {
  3950. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[i1];
  3951. if(class30_sub2_sub4_sub1_sub1_1 != null)
  3952. {
  3953. 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]);
  3954. crossX = super.saveClickX;
  3955. crossY = super.saveClickY;
  3956. crossType = 2;
  3957. crossIndex = 0;
  3958. stream.createFrame(155);
  3959. stream.method431(i1);
  3960. }
  3961. }
  3962. if(l == 779)
  3963. {
  3964. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[i1];
  3965. if(class30_sub2_sub4_sub1_sub2_1 != null)
  3966. {
  3967. 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]);
  3968. crossX = super.saveClickX;
  3969. crossY = super.saveClickY;
  3970. crossType = 2;
  3971. crossIndex = 0;
  3972. stream.createFrame(153);
  3973. stream.method431(i1);
  3974. }
  3975. }
  3976. if(l == 516)
  3977. if(!menuOpen)
  3978. worldController.method312(super.saveClickY - 4, super.saveClickX - 4);
  3979. else
  3980. worldController.method312(k - 4, j - 4);
  3981. if(l == 1062)
  3982. {
  3983. anInt924 += baseX;
  3984. if(anInt924 >= 113)
  3985. {
  3986. stream.createFrame(183);
  3987. stream.writeDWordBigEndian(0xe63271);
  3988. anInt924 = 0;
  3989. }
  3990. method66(i1, k, j);
  3991. stream.createFrame(228);
  3992. stream.method432(i1 >> 14 & 0x7fff);
  3993. stream.method432(k + baseY);
  3994. stream.writeWord(j + baseX);
  3995. }
  3996. if(l == 679 && !aBoolean1149)
  3997. {
  3998. stream.createFrame(40);
  3999. stream.writeWord(k);
  4000. aBoolean1149 = true;
  4001. }
  4002. if(l == 431)
  4003. {
  4004. stream.createFrame(129);
  4005. stream.method432(j);
  4006. stream.writeWord(k);
  4007. stream.method432(i1);
  4008. atInventoryLoopCycle = 0;
  4009. atInventoryInterface = k;
  4010. atInventoryIndex = j;
  4011. atInventoryInterfaceType = 2;
  4012. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4013. atInventoryInterfaceType = 1;
  4014. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4015. atInventoryInterfaceType = 3;
  4016. }
  4017. if(l == 337 || l == 42 || l == 792 || l == 322)
  4018. {
  4019. String s = menuActionName[i];
  4020. int k1 = s.indexOf("@whi@");
  4021. if(k1 != -1)
  4022. {
  4023. long l3 = TextClass.longForName(s.substring(k1 + 5).trim());
  4024. if(l == 337)
  4025. addFriend(l3);
  4026. if(l == 42)
  4027. addIgnore(l3);
  4028. if(l == 792)
  4029. delFriend(l3);
  4030. if(l == 322)
  4031. delIgnore(l3);
  4032. }
  4033. }
  4034. if(l == 53)
  4035. {
  4036. stream.createFrame(135);
  4037. stream.method431(j);
  4038. stream.method432(k);
  4039. stream.method431(i1);
  4040. atInventoryLoopCycle = 0;
  4041. atInventoryInterface = k;
  4042. atInventoryIndex = j;
  4043. atInventoryInterfaceType = 2;
  4044. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4045. atInventoryInterfaceType = 1;
  4046. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4047. atInventoryInterfaceType = 3;
  4048. }
  4049. if(l == 539)
  4050. {
  4051. stream.createFrame(16);
  4052. stream.method432(i1);
  4053. stream.method433(j);
  4054. stream.method433(k);
  4055. atInventoryLoopCycle = 0;
  4056. atInventoryInterface = k;
  4057. atInventoryIndex = j;
  4058. atInventoryInterfaceType = 2;
  4059. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4060. atInventoryInterfaceType = 1;
  4061. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4062. atInventoryInterfaceType = 3;
  4063. }
  4064. if(l == 484 || l == 6)
  4065. {
  4066. String s1 = menuActionName[i];
  4067. int l1 = s1.indexOf("@whi@");
  4068. if(l1 != -1)
  4069. {
  4070. s1 = s1.substring(l1 + 5).trim();
  4071. String s7 = TextClass.fixName(TextClass.nameForLong(TextClass.longForName(s1)));
  4072. boolean flag9 = false;
  4073. for(int j3 = 0; j3 < playerCount; j3++)
  4074. {
  4075. Player class30_sub2_sub4_sub1_sub2_7 = playerArray[playerIndices[j3]];
  4076. 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))
  4077. continue;
  4078. 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]);
  4079. if(l == 484)
  4080. {
  4081. stream.createFrame(139);
  4082. stream.method431(playerIndices[j3]);
  4083. }
  4084. if(l == 6)
  4085. {
  4086. anInt1188 += i1;
  4087. if(anInt1188 >= 90)
  4088. {
  4089. stream.createFrame(136);
  4090. anInt1188 = 0;
  4091. }
  4092. stream.createFrame(128);
  4093. stream.writeWord(playerIndices[j3]);
  4094. }
  4095. flag9 = true;
  4096. break;
  4097. }
  4098.  
  4099. if(!flag9)
  4100. pushMessage("Unable to find " + s7, 0, "");
  4101. }
  4102. }
  4103. if(l == 870)
  4104. {
  4105. stream.createFrame(53);
  4106. stream.writeWord(j);
  4107. stream.method432(anInt1283);
  4108. stream.method433(i1);
  4109. stream.writeWord(anInt1284);
  4110. stream.method431(anInt1285);
  4111. stream.writeWord(k);
  4112. atInventoryLoopCycle = 0;
  4113. atInventoryInterface = k;
  4114. atInventoryIndex = j;
  4115. atInventoryInterfaceType = 2;
  4116. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4117. atInventoryInterfaceType = 1;
  4118. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4119. atInventoryInterfaceType = 3;
  4120. }
  4121. if(l == 847)
  4122. {
  4123. stream.createFrame(87);
  4124. stream.method432(i1);
  4125. stream.writeWord(k);
  4126. stream.method432(j);
  4127. atInventoryLoopCycle = 0;
  4128. atInventoryInterface = k;
  4129. atInventoryIndex = j;
  4130. atInventoryInterfaceType = 2;
  4131. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4132. atInventoryInterfaceType = 1;
  4133. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4134. atInventoryInterfaceType = 3;
  4135. }
  4136. if(l == 626)
  4137. {
  4138. RSInterface class9_1 = RSInterface.interfaceCache[k];
  4139. spellSelected = 1;
  4140. spellID = class9_1.id;
  4141. anInt1137 = k;
  4142. spellUsableOn = class9_1.spellUsableOn;
  4143. itemSelected = 0;
  4144. needDrawTabArea = true;
  4145. String s4 = class9_1.selectedActionName;
  4146. if(s4.indexOf(" ") != -1)
  4147. s4 = s4.substring(0, s4.indexOf(" "));
  4148. String s8 = class9_1.selectedActionName;
  4149. if(s8.indexOf(" ") != -1)
  4150. s8 = s8.substring(s8.indexOf(" ") + 1);
  4151. spellTooltip = s4 + " " + class9_1.spellName + " " + s8;
  4152. //class9_1.sprite1.drawSprite(class9_1.anInt263, class9_1.anInt265, 0xffffff);
  4153. //class9_1.sprite1.drawSprite(200,200);
  4154. //System.out.println("Sprite: " + class9_1.sprite1.toString());
  4155. if(spellUsableOn == 16)
  4156. {
  4157. needDrawTabArea = true;
  4158. tabID = 3;
  4159. tabAreaAltered = true;
  4160. }
  4161. return;
  4162. }
  4163. if(l == 78)
  4164. {
  4165. stream.createFrame(117);
  4166. stream.method433(k);
  4167. stream.method433(i1);
  4168. stream.method431(j);
  4169. atInventoryLoopCycle = 0;
  4170. atInventoryInterface = k;
  4171. atInventoryIndex = j;
  4172. atInventoryInterfaceType = 2;
  4173. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4174. atInventoryInterfaceType = 1;
  4175. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4176. atInventoryInterfaceType = 3;
  4177. }
  4178. if(l == 27)
  4179. {
  4180. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[i1];
  4181. if(class30_sub2_sub4_sub1_sub2_2 != null)
  4182. {
  4183. 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]);
  4184. crossX = super.saveClickX;
  4185. crossY = super.saveClickY;
  4186. crossType = 2;
  4187. crossIndex = 0;
  4188. anInt986 += i1;
  4189. if(anInt986 >= 54)
  4190. {
  4191. stream.createFrame(189);
  4192. stream.writeWordBigEndian(234);
  4193. anInt986 = 0;
  4194. }
  4195. stream.createFrame(73);
  4196. stream.method431(i1);
  4197. }
  4198. }
  4199. if(l == 213)
  4200. {
  4201. boolean flag3 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4202. if(!flag3)
  4203. flag3 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4204. crossX = super.saveClickX;
  4205. crossY = super.saveClickY;
  4206. crossType = 2;
  4207. crossIndex = 0;
  4208. stream.createFrame(79);
  4209. stream.method431(k + baseY);
  4210. stream.writeWord(i1);
  4211. stream.method432(j + baseX);
  4212. }
  4213. if(l == 632)
  4214. {
  4215. stream.createFrame(145);
  4216. stream.method432(k);
  4217. stream.method432(j);
  4218. stream.method432(i1);
  4219. atInventoryLoopCycle = 0;
  4220. atInventoryInterface = k;
  4221. atInventoryIndex = j;
  4222. atInventoryInterfaceType = 2;
  4223. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4224. atInventoryInterfaceType = 1;
  4225. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4226. atInventoryInterfaceType = 3;
  4227. }
  4228. if(l == 1004) {
  4229. if(tabInterfaceIDs[10] != -1) {
  4230. needDrawTabArea = true;
  4231. tabID = 10;
  4232. tabAreaAltered = true;
  4233. }
  4234. }
  4235. if(l == 1003) {
  4236. clanChatMode = 2;
  4237. aBoolean1233 = true;
  4238. inputTaken = true;
  4239. }
  4240. if(l == 1002) {
  4241. clanChatMode = 1;
  4242. aBoolean1233 = true;
  4243. inputTaken = true;
  4244. }
  4245. if(l == 1001) {
  4246. clanChatMode = 0;
  4247. aBoolean1233 = true;
  4248. inputTaken = true;
  4249. }
  4250. if(l == 1000) {
  4251. cButtonCPos = 4;
  4252. chatTypeView = 11;
  4253. aBoolean1233 = true;
  4254. inputTaken = true;
  4255. }
  4256. if(l == 999) {
  4257. cButtonCPos = 0;
  4258. chatTypeView = 0;
  4259. aBoolean1233 = true;
  4260. inputTaken = true;
  4261. }
  4262. if(l == 998) {
  4263. cButtonCPos = 1;
  4264. chatTypeView = 5;
  4265. aBoolean1233 = true;
  4266. inputTaken = true;
  4267. }
  4268. if(l == 997) {
  4269. publicChatMode = 3;
  4270. aBoolean1233 = true;
  4271. inputTaken = true;
  4272. }
  4273. if(l == 996) {
  4274. publicChatMode = 2;
  4275. aBoolean1233 = true;
  4276. inputTaken = true;
  4277. }
  4278. if(l == 995) {
  4279. publicChatMode = 1;
  4280. aBoolean1233 = true;
  4281. inputTaken = true;
  4282. }
  4283. if(l == 994) {
  4284. publicChatMode = 0;
  4285. aBoolean1233 = true;
  4286. inputTaken = true;
  4287. }
  4288. if(l == 993) {
  4289. cButtonCPos = 2;
  4290. chatTypeView = 1;
  4291. aBoolean1233 = true;
  4292. inputTaken = true;
  4293. }
  4294. if(l == 992) {
  4295. privateChatMode = 2;
  4296. aBoolean1233 = true;
  4297. inputTaken = true;
  4298. }
  4299. if(l == 991) {
  4300. privateChatMode = 1;
  4301. aBoolean1233 = true;
  4302. inputTaken = true;
  4303. }
  4304. if(l == 990) {
  4305. privateChatMode = 0;
  4306. aBoolean1233 = true;
  4307. inputTaken = true;
  4308. }
  4309. if(l == 989) {
  4310. cButtonCPos = 3;
  4311. chatTypeView = 2;
  4312. aBoolean1233 = true;
  4313. inputTaken = true;
  4314. }
  4315. if(l == 987) {
  4316. tradeMode = 2;
  4317. aBoolean1233 = true;
  4318. inputTaken = true;
  4319. }
  4320. if(l == 986) {
  4321. tradeMode = 1;
  4322. aBoolean1233 = true;
  4323. inputTaken = true;
  4324. }
  4325. if(l == 985) {
  4326. tradeMode = 0;
  4327. aBoolean1233 = true;
  4328. inputTaken = true;
  4329. }
  4330. if(l == 984) {
  4331. cButtonCPos = 5;
  4332. chatTypeView = 3;
  4333. aBoolean1233 = true;
  4334. inputTaken = true;
  4335. }
  4336. if(l == 983) {
  4337. duelMode = 2;
  4338. aBoolean1233 = true;
  4339. inputTaken = true;
  4340. }
  4341. if(l == 982) {
  4342. duelMode = 1;
  4343. aBoolean1233 = true;
  4344. inputTaken = true;
  4345. }
  4346. if(l == 981) {
  4347. duelMode = 0;
  4348. aBoolean1233 = true;
  4349. inputTaken = true;
  4350. }
  4351. if(l == 980) {
  4352. cButtonCPos = 6;
  4353. chatTypeView = 4;
  4354. aBoolean1233 = true;
  4355. inputTaken = true;
  4356. }
  4357. if(l == 493)
  4358. {
  4359. stream.createFrame(75);
  4360. stream.method433(k);
  4361. stream.method431(j);
  4362. stream.method432(i1);
  4363. atInventoryLoopCycle = 0;
  4364. atInventoryInterface = k;
  4365. atInventoryIndex = j;
  4366. atInventoryInterfaceType = 2;
  4367. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4368. atInventoryInterfaceType = 1;
  4369. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4370. atInventoryInterfaceType = 3;
  4371. }
  4372. if(l == 652)
  4373. {
  4374. boolean flag4 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4375. if(!flag4)
  4376. flag4 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4377. crossX = super.saveClickX;
  4378. crossY = super.saveClickY;
  4379. crossType = 2;
  4380. crossIndex = 0;
  4381. stream.createFrame(156);
  4382. stream.method432(j + baseX);
  4383. stream.method431(k + baseY);
  4384. stream.method433(i1);
  4385. }
  4386. if(l == 94)
  4387. {
  4388. boolean flag5 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4389. if(!flag5)
  4390. flag5 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4391. crossX = super.saveClickX;
  4392. crossY = super.saveClickY;
  4393. crossType = 2;
  4394. crossIndex = 0;
  4395. stream.createFrame(181);
  4396. stream.method431(k + baseY);
  4397. stream.writeWord(i1);
  4398. stream.method431(j + baseX);
  4399. stream.method432(anInt1137);
  4400. }
  4401. if(l == 646)
  4402. {
  4403. stream.createFrame(185);
  4404. stream.writeWord(k);
  4405. RSInterface class9_2 = RSInterface.interfaceCache[k];
  4406. if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5)
  4407. {
  4408. int i2 = class9_2.valueIndexArray[0][1];
  4409. if(variousSettings[i2] != class9_2.anIntArray212[0])
  4410. {
  4411. variousSettings[i2] = class9_2.anIntArray212[0];
  4412. method33(i2);
  4413. needDrawTabArea = true;
  4414. }
  4415. }
  4416. }
  4417. if(l == 225)
  4418. {
  4419. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[i1];
  4420. if(class30_sub2_sub4_sub1_sub1_2 != null)
  4421. {
  4422. 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]);
  4423. crossX = super.saveClickX;
  4424. crossY = super.saveClickY;
  4425. crossType = 2;
  4426. crossIndex = 0;
  4427. anInt1226 += i1;
  4428. if(anInt1226 >= 85)
  4429. {
  4430. stream.createFrame(230);
  4431. stream.writeWordBigEndian(239);
  4432. anInt1226 = 0;
  4433. }
  4434. stream.createFrame(17);
  4435. stream.method433(i1);
  4436. }
  4437. }
  4438. if(l == 965)
  4439. {
  4440. NPC class30_sub2_sub4_sub1_sub1_3 = npcArray[i1];
  4441. if(class30_sub2_sub4_sub1_sub1_3 != null)
  4442. {
  4443. 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]);
  4444. crossX = super.saveClickX;
  4445. crossY = super.saveClickY;
  4446. crossType = 2;
  4447. crossIndex = 0;
  4448. anInt1134++;
  4449. if(anInt1134 >= 96)
  4450. {
  4451. stream.createFrame(152);
  4452. stream.writeWordBigEndian(88);
  4453. anInt1134 = 0;
  4454. }
  4455. stream.createFrame(21);
  4456. stream.writeWord(i1);
  4457. }
  4458. }
  4459. if(l == 413)
  4460. {
  4461. NPC class30_sub2_sub4_sub1_sub1_4 = npcArray[i1];
  4462. if(class30_sub2_sub4_sub1_sub1_4 != null)
  4463. {
  4464. 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]);
  4465. crossX = super.saveClickX;
  4466. crossY = super.saveClickY;
  4467. crossType = 2;
  4468. crossIndex = 0;
  4469. stream.createFrame(131);
  4470. stream.method433(i1);
  4471. stream.method432(anInt1137);
  4472. }
  4473. }
  4474. if(l == 200)
  4475. clearTopInterfaces();
  4476. if(l == 1025)
  4477. {
  4478. NPC class30_sub2_sub4_sub1_sub1_5 = npcArray[i1];
  4479. if(class30_sub2_sub4_sub1_sub1_5 != null)
  4480. {
  4481. EntityDef entityDef = class30_sub2_sub4_sub1_sub1_5.desc;
  4482. if(entityDef.childrenIDs != null)
  4483. entityDef = entityDef.method161();
  4484. if(entityDef != null)
  4485. {
  4486. String s9;
  4487. if(entityDef.description != null)
  4488. s9 = new String(entityDef.description);
  4489. else
  4490. s9 = "It's a " + entityDef.name + ".";
  4491. pushMessage(s9, 0, "");
  4492. }
  4493. }
  4494. }
  4495. if(l == 900)
  4496. {
  4497. method66(i1, k, j);
  4498. stream.createFrame(252);
  4499. stream.method433(i1 >> 14 & 0x7fff);
  4500. stream.method431(k + baseY);
  4501. stream.method432(j + baseX);
  4502. }
  4503. if(l == 412)
  4504. {
  4505. NPC class30_sub2_sub4_sub1_sub1_6 = npcArray[i1];
  4506. if(class30_sub2_sub4_sub1_sub1_6 != null)
  4507. {
  4508. 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]);
  4509. crossX = super.saveClickX;
  4510. crossY = super.saveClickY;
  4511. crossType = 2;
  4512. crossIndex = 0;
  4513. stream.createFrame(72);
  4514. stream.method432(i1);
  4515. }
  4516. }
  4517. if(l == 365)
  4518. {
  4519. Player class30_sub2_sub4_sub1_sub2_3 = playerArray[i1];
  4520. if(class30_sub2_sub4_sub1_sub2_3 != null)
  4521. {
  4522. 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]);
  4523. crossX = super.saveClickX;
  4524. crossY = super.saveClickY;
  4525. crossType = 2;
  4526. crossIndex = 0;
  4527. stream.createFrame(249);
  4528. stream.method432(i1);
  4529. stream.method431(anInt1137);
  4530. }
  4531. }
  4532. if(l == 729)
  4533. {
  4534. Player class30_sub2_sub4_sub1_sub2_4 = playerArray[i1];
  4535. if(class30_sub2_sub4_sub1_sub2_4 != null)
  4536. {
  4537. 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]);
  4538. crossX = super.saveClickX;
  4539. crossY = super.saveClickY;
  4540. crossType = 2;
  4541. crossIndex = 0;
  4542. stream.createFrame(39);
  4543. stream.method431(i1);
  4544. }
  4545. }
  4546. if(l == 577)
  4547. {
  4548. Player class30_sub2_sub4_sub1_sub2_5 = playerArray[i1];
  4549. if(class30_sub2_sub4_sub1_sub2_5 != null)
  4550. {
  4551. 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]);
  4552. crossX = super.saveClickX;
  4553. crossY = super.saveClickY;
  4554. crossType = 2;
  4555. crossIndex = 0;
  4556. stream.createFrame(139);
  4557. stream.method431(i1);
  4558. }
  4559. }
  4560. if(l == 956 && method66(i1, k, j))
  4561. {
  4562. stream.createFrame(35);
  4563. stream.method431(j + baseX);
  4564. stream.method432(anInt1137);
  4565. stream.method432(k + baseY);
  4566. stream.method431(i1 >> 14 & 0x7fff);
  4567. }
  4568. if(l == 567)
  4569. {
  4570. boolean flag6 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4571. if(!flag6)
  4572. flag6 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4573. crossX = super.saveClickX;
  4574. crossY = super.saveClickY;
  4575. crossType = 2;
  4576. crossIndex = 0;
  4577. stream.createFrame(23);
  4578. stream.method431(k + baseY);
  4579. stream.method431(i1);
  4580. stream.method431(j + baseX);
  4581. }
  4582. if(l == 867)
  4583. {
  4584. if((i1 & 3) == 0)
  4585. anInt1175++;
  4586. if(anInt1175 >= 59)
  4587. {
  4588. stream.createFrame(200);
  4589. stream.writeWord(25501);
  4590. anInt1175 = 0;
  4591. }
  4592. stream.createFrame(43);
  4593. stream.method431(k);
  4594. stream.method432(i1);
  4595. stream.method432(j);
  4596. atInventoryLoopCycle = 0;
  4597. atInventoryInterface = k;
  4598. atInventoryIndex = j;
  4599. atInventoryInterfaceType = 2;
  4600. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4601. atInventoryInterfaceType = 1;
  4602. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4603. atInventoryInterfaceType = 3;
  4604. }
  4605. if(l == 543)
  4606. {
  4607. stream.createFrame(237);
  4608. stream.writeWord(j);
  4609. stream.method432(i1);
  4610. stream.writeWord(k);
  4611. stream.method432(anInt1137);
  4612. atInventoryLoopCycle = 0;
  4613. atInventoryInterface = k;
  4614. atInventoryIndex = j;
  4615. atInventoryInterfaceType = 2;
  4616. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4617. atInventoryInterfaceType = 1;
  4618. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4619. atInventoryInterfaceType = 3;
  4620. }
  4621. if(l == 606)
  4622. {
  4623. String s2 = menuActionName[i];
  4624. int j2 = s2.indexOf("@whi@");
  4625. if(j2 != -1)
  4626. if(openInterfaceID == -1)
  4627. {
  4628. clearTopInterfaces();
  4629. reportAbuseInput = s2.substring(j2 + 5).trim();
  4630. canMute = false;
  4631. for(int i3 = 0; i3 < RSInterface.interfaceCache.length; i3++)
  4632. {
  4633. if(RSInterface.interfaceCache[i3] == null || RSInterface.interfaceCache[i3].contentType != 600)
  4634. continue;
  4635. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i3].parentID;
  4636. break;
  4637. }
  4638.  
  4639. } else
  4640. {
  4641. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  4642. }
  4643. }
  4644. if(l == 491)
  4645. {
  4646. Player class30_sub2_sub4_sub1_sub2_6 = playerArray[i1];
  4647. if(class30_sub2_sub4_sub1_sub2_6 != null)
  4648. {
  4649. 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]);
  4650. crossX = super.saveClickX;
  4651. crossY = super.saveClickY;
  4652. crossType = 2;
  4653. crossIndex = 0;
  4654. stream.createFrame(14);
  4655. stream.method432(anInt1284);
  4656. stream.writeWord(i1);
  4657. stream.writeWord(anInt1285);
  4658. stream.method431(anInt1283);
  4659. }
  4660. }
  4661. if(l == 639)
  4662. {
  4663. String s3 = menuActionName[i];
  4664. int k2 = s3.indexOf("@whi@");
  4665. if(k2 != -1)
  4666. {
  4667. long l4 = TextClass.longForName(s3.substring(k2 + 5).trim());
  4668. int k3 = -1;
  4669. for(int i4 = 0; i4 < friendsCount; i4++)
  4670. {
  4671. if(friendsListAsLongs[i4] != l4)
  4672. continue;
  4673. k3 = i4;
  4674. break;
  4675. }
  4676.  
  4677. if(k3 != -1 && friendsNodeIDs[k3] > 0)
  4678. {
  4679. inputTaken = true;
  4680. inputDialogState = 0;
  4681. messagePromptRaised = true;
  4682. promptInput = "";
  4683. friendsListAction = 3;
  4684. aLong953 = friendsListAsLongs[k3];
  4685. aString1121 = "Enter message to send to " + friendsList[k3];
  4686. }
  4687. }
  4688. }
  4689. if(l == 454)
  4690. {
  4691. stream.createFrame(41);
  4692. stream.writeWord(i1);
  4693. stream.method432(j);
  4694. stream.method432(k);
  4695. atInventoryLoopCycle = 0;
  4696. atInventoryInterface = k;
  4697. atInventoryIndex = j;
  4698. atInventoryInterfaceType = 2;
  4699. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4700. atInventoryInterfaceType = 1;
  4701. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4702. atInventoryInterfaceType = 3;
  4703. }
  4704. if(l == 478)
  4705. {
  4706. NPC class30_sub2_sub4_sub1_sub1_7 = npcArray[i1];
  4707. if(class30_sub2_sub4_sub1_sub1_7 != null)
  4708. {
  4709. 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]);
  4710. crossX = super.saveClickX;
  4711. crossY = super.saveClickY;
  4712. crossType = 2;
  4713. crossIndex = 0;
  4714. if((i1 & 3) == 0)
  4715. anInt1155++;
  4716. if(anInt1155 >= 53)
  4717. {
  4718. stream.createFrame(85);
  4719. stream.writeWordBigEndian(66);
  4720. anInt1155 = 0;
  4721. }
  4722. stream.createFrame(18);
  4723. stream.method431(i1);
  4724. }
  4725. }
  4726. if(l == 113)
  4727. {
  4728. method66(i1, k, j);
  4729. stream.createFrame(70);
  4730. stream.method431(j + baseX);
  4731. stream.writeWord(k + baseY);
  4732. stream.method433(i1 >> 14 & 0x7fff);
  4733. }
  4734. if(l == 872)
  4735. {
  4736. method66(i1, k, j);
  4737. stream.createFrame(234);
  4738. stream.method433(j + baseX);
  4739. stream.method432(i1 >> 14 & 0x7fff);
  4740. stream.method433(k + baseY);
  4741. }
  4742. if(l == 502)
  4743. {
  4744. method66(i1, k, j);
  4745. stream.createFrame(132);
  4746. stream.method433(j + baseX);
  4747. stream.writeWord(i1 >> 14 & 0x7fff);
  4748. stream.method432(k + baseY);
  4749. }
  4750. if(l == 1125)
  4751. {
  4752. ItemDef itemDef = ItemDef.forID(i1);
  4753. RSInterface class9_4 = RSInterface.interfaceCache[k];
  4754. String s5;
  4755. if(class9_4 != null && class9_4.invStackSizes[j] >= 0x186a0)
  4756. s5 = class9_4.invStackSizes[j] + " x " + itemDef.name;
  4757. else
  4758. if(itemDef.description != null)
  4759. s5 = new String(itemDef.description);
  4760. else
  4761. s5 = "It's a " + itemDef.name + ".";
  4762. pushMessage(s5, 0, "");
  4763. }
  4764. if(l == 169)
  4765. {
  4766. stream.createFrame(185);
  4767. stream.writeWord(k);
  4768. RSInterface class9_3 = RSInterface.interfaceCache[k];
  4769. if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5)
  4770. {
  4771. int l2 = class9_3.valueIndexArray[0][1];
  4772. variousSettings[l2] = 1 - variousSettings[l2];
  4773. method33(l2);
  4774. needDrawTabArea = true;
  4775. }
  4776. }
  4777. if(l == 447)
  4778. {
  4779. itemSelected = 1;
  4780. anInt1283 = j;
  4781. anInt1284 = k;
  4782. anInt1285 = i1;
  4783. selectedItemName = ItemDef.forID(i1).name;
  4784. spellSelected = 0;
  4785. needDrawTabArea = true;
  4786. return;
  4787. }
  4788. if(l == 1226)
  4789. {
  4790. int j1 = i1 >> 14 & 0x7fff;
  4791. ObjectDef class46 = ObjectDef.forID(j1);
  4792. String s10;
  4793. if(class46.description != null)
  4794. s10 = new String(class46.description);
  4795. else
  4796. s10 = "It's a " + class46.name + ".";
  4797. pushMessage(s10, 0, "");
  4798. }
  4799. if(l == 244)
  4800. {
  4801. boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4802. if(!flag7)
  4803. flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4804. crossX = super.saveClickX;
  4805. crossY = super.saveClickY;
  4806. crossType = 2;
  4807. crossIndex = 0;
  4808. stream.createFrame(253);
  4809. stream.method431(j + baseX);
  4810. stream.method433(k + baseY);
  4811. stream.method432(i1);
  4812. }
  4813. if(l == 1448)
  4814. {
  4815. ItemDef itemDef_1 = ItemDef.forID(i1);
  4816. String s6;
  4817. if(itemDef_1.description != null)
  4818. s6 = new String(itemDef_1.description);
  4819. else
  4820. s6 = "It's a " + itemDef_1.name + ".";
  4821. pushMessage(s6, 0, "");
  4822. }
  4823. itemSelected = 0;
  4824. spellSelected = 0;
  4825. needDrawTabArea = true;
  4826.  
  4827. }
  4828.  
  4829. private void method70()
  4830. {
  4831. anInt1251 = 0;
  4832. int j = (myPlayer.x >> 7) + baseX;
  4833. int k = (myPlayer.y >> 7) + baseY;
  4834. if(j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
  4835. anInt1251 = 1;
  4836. if(j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
  4837. anInt1251 = 1;
  4838. if(anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
  4839. anInt1251 = 0;
  4840. }
  4841.  
  4842. public void run() {
  4843. if(drawFlames) {
  4844. drawFlames();
  4845. } else {
  4846. super.run();
  4847. }
  4848. }
  4849.  
  4850. private void build3dScreenMenu()
  4851. {
  4852. if(itemSelected == 0 && spellSelected == 0)
  4853. {
  4854. menuActionName[menuActionRow] = "Walk here";
  4855. menuActionID[menuActionRow] = 516;
  4856. menuActionCmd2[menuActionRow] = super.mouseX;
  4857. menuActionCmd3[menuActionRow] = super.mouseY;
  4858. menuActionRow++;
  4859. }
  4860. int j = -1;
  4861. for(int k = 0; k < Model.anInt1687; k++)
  4862. {
  4863. int l = Model.anIntArray1688[k];
  4864. int i1 = l & 0x7f;
  4865. int j1 = l >> 7 & 0x7f;
  4866. int k1 = l >> 29 & 3;
  4867. int l1 = l >> 14 & 0x7fff;
  4868. if(l == j)
  4869. continue;
  4870. j = l;
  4871. if(k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0)
  4872. {
  4873. ObjectDef class46 = ObjectDef.forID(l1);
  4874. if(class46.childrenIDs != null)
  4875. class46 = class46.method580();
  4876. if(class46 == null)
  4877. continue;
  4878. if(itemSelected == 1)
  4879. {
  4880. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @cya@" + class46.name;
  4881. menuActionID[menuActionRow] = 62;
  4882. menuActionCmd1[menuActionRow] = l;
  4883. menuActionCmd2[menuActionRow] = i1;
  4884. menuActionCmd3[menuActionRow] = j1;
  4885. menuActionRow++;
  4886. } else
  4887. if(spellSelected == 1)
  4888. {
  4889. if((spellUsableOn & 4) == 4)
  4890. {
  4891. menuActionName[menuActionRow] = spellTooltip + " @cya@" + class46.name;
  4892. menuActionID[menuActionRow] = 956;
  4893. menuActionCmd1[menuActionRow] = l;
  4894. menuActionCmd2[menuActionRow] = i1;
  4895. menuActionCmd3[menuActionRow] = j1;
  4896. menuActionRow++;
  4897. }
  4898. } else
  4899. {
  4900. if(class46.actions != null)
  4901. {
  4902. for(int i2 = 4; i2 >= 0; i2--)
  4903. if(class46.actions[i2] != null)
  4904. {
  4905. menuActionName[menuActionRow] = class46.actions[i2] + " @cya@" + class46.name;
  4906. if(i2 == 0)
  4907. menuActionID[menuActionRow] = 502;
  4908. if(i2 == 1)
  4909. menuActionID[menuActionRow] = 900;
  4910. if(i2 == 2)
  4911. menuActionID[menuActionRow] = 113;
  4912. if(i2 == 3)
  4913. menuActionID[menuActionRow] = 872;
  4914. if(i2 == 4)
  4915. menuActionID[menuActionRow] = 1062;
  4916. menuActionCmd1[menuActionRow] = l;
  4917. menuActionCmd2[menuActionRow] = i1;
  4918. menuActionCmd3[menuActionRow] = j1;
  4919. menuActionRow++;
  4920. }
  4921.  
  4922. }
  4923. //menuActionName[menuActionRow] = "Examine @cya@" + class46.name + " @gre@(@whi@" + l1 + "@gre@) (@whi@" + (i1 + baseX) + "," + (j1 + baseY) + "@gre@)";
  4924. menuActionName[menuActionRow] = "Examine @cya@" + class46.name;
  4925. menuActionID[menuActionRow] = 1226;
  4926. menuActionCmd1[menuActionRow] = class46.type << 14;
  4927. menuActionCmd2[menuActionRow] = i1;
  4928. menuActionCmd3[menuActionRow] = j1;
  4929. menuActionRow++;
  4930. }
  4931. }
  4932. if(k1 == 1)
  4933. {
  4934. NPC npc = npcArray[l1];
  4935. if(npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  4936. {
  4937. for(int j2 = 0; j2 < npcCount; j2++)
  4938. {
  4939. NPC npc2 = npcArray[npcIndices[j2]];
  4940. if(npc2 != null && npc2 != npc && npc2.desc.aByte68 == 1 && npc2.x == npc.x && npc2.y == npc.y)
  4941. buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
  4942. }
  4943.  
  4944. for(int l2 = 0; l2 < playerCount; l2++)
  4945. {
  4946. Player player = playerArray[playerIndices[l2]];
  4947. if(player != null && player.x == npc.x && player.y == npc.y)
  4948. buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
  4949. }
  4950.  
  4951. }
  4952. buildAtNPCMenu(npc.desc, l1, j1, i1);
  4953. }
  4954. if(k1 == 0)
  4955. {
  4956. Player player = playerArray[l1];
  4957. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64)
  4958. {
  4959. for(int k2 = 0; k2 < npcCount; k2++)
  4960. {
  4961. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
  4962. 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)
  4963. buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc, npcIndices[k2], j1, i1);
  4964. }
  4965.  
  4966. for(int i3 = 0; i3 < playerCount; i3++)
  4967. {
  4968. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
  4969. 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)
  4970. buildAtPlayerMenu(i1, playerIndices[i3], class30_sub2_sub4_sub1_sub2_2, j1);
  4971. }
  4972.  
  4973. }
  4974. buildAtPlayerMenu(i1, l1, player, j1);
  4975. }
  4976. if(k1 == 3)
  4977. {
  4978. NodeList class19 = groundArray[plane][i1][j1];
  4979. if(class19 != null)
  4980. {
  4981. for(Item item = (Item)class19.getFirst(); item != null; item = (Item)class19.getNext())
  4982. {
  4983. ItemDef itemDef = ItemDef.forID(item.ID);
  4984. if(itemSelected == 1)
  4985. {
  4986. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  4987. menuActionID[menuActionRow] = 511;
  4988. menuActionCmd1[menuActionRow] = item.ID;
  4989. menuActionCmd2[menuActionRow] = i1;
  4990. menuActionCmd3[menuActionRow] = j1;
  4991. menuActionRow++;
  4992. } else
  4993. if(spellSelected == 1)
  4994. {
  4995. if((spellUsableOn & 1) == 1)
  4996. {
  4997. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  4998. menuActionID[menuActionRow] = 94;
  4999. menuActionCmd1[menuActionRow] = item.ID;
  5000. menuActionCmd2[menuActionRow] = i1;
  5001. menuActionCmd3[menuActionRow] = j1;
  5002. menuActionRow++;
  5003. }
  5004. } else
  5005. {
  5006. for(int j3 = 4; j3 >= 0; j3--)
  5007. if(itemDef.groundActions != null && itemDef.groundActions[j3] != null)
  5008. {
  5009. menuActionName[menuActionRow] = itemDef.groundActions[j3] + " @lre@" + itemDef.name;
  5010. if(j3 == 0)
  5011. menuActionID[menuActionRow] = 652;
  5012. if(j3 == 1)
  5013. menuActionID[menuActionRow] = 567;
  5014. if(j3 == 2)
  5015. menuActionID[menuActionRow] = 234;
  5016. if(j3 == 3)
  5017. menuActionID[menuActionRow] = 244;
  5018. if(j3 == 4)
  5019. menuActionID[menuActionRow] = 213;
  5020. menuActionCmd1[menuActionRow] = item.ID;
  5021. menuActionCmd2[menuActionRow] = i1;
  5022. menuActionCmd3[menuActionRow] = j1;
  5023. menuActionRow++;
  5024. } else
  5025. if(j3 == 2)
  5026. {
  5027. menuActionName[menuActionRow] = "Take @lre@" + itemDef.name;
  5028. menuActionID[menuActionRow] = 234;
  5029. menuActionCmd1[menuActionRow] = item.ID;
  5030. menuActionCmd2[menuActionRow] = i1;
  5031. menuActionCmd3[menuActionRow] = j1;
  5032. menuActionRow++;
  5033. }
  5034.  
  5035. //menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + item.ID + "@gre@)";
  5036. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  5037. menuActionID[menuActionRow] = 1448;
  5038. menuActionCmd1[menuActionRow] = item.ID;
  5039. menuActionCmd2[menuActionRow] = i1;
  5040. menuActionCmd3[menuActionRow] = j1;
  5041. menuActionRow++;
  5042. }
  5043. }
  5044.  
  5045. }
  5046. }
  5047. }
  5048. }
  5049.  
  5050. public void cleanUpForQuit()
  5051. {
  5052. signlink.reporterror = false;
  5053. try
  5054. {
  5055. if(socketStream != null)
  5056. socketStream.close();
  5057. }
  5058. catch(Exception _ex) { }
  5059. socketStream = null;
  5060. stopMidi();
  5061. if(mouseDetection != null)
  5062. mouseDetection.running = false;
  5063. mouseDetection = null;
  5064. onDemandFetcher.disable();
  5065. onDemandFetcher = null;
  5066. aStream_834 = null;
  5067. mapArea = null;
  5068. stream = null;
  5069. aStream_847 = null;
  5070. inStream = null;
  5071. anIntArray1234 = null;
  5072. aByteArrayArray1183 = null;
  5073. aByteArrayArray1247 = null;
  5074. anIntArray1235 = null;
  5075. anIntArray1236 = null;
  5076. intGroundArray = null;
  5077. byteGroundArray = null;
  5078. worldController = null;
  5079. aClass11Array1230 = null;
  5080. anIntArrayArray901 = null;
  5081. anIntArrayArray825 = null;
  5082. bigX = null;
  5083. bigY = null;
  5084. aByteArray912 = null;
  5085. aRSImageProducer_1163 = null;
  5086. mapEdgeIP = null;
  5087. leftFrame = null;
  5088. topFrame = null;
  5089. rightFrame = null;
  5090. aRSImageProducer_1164 = null;
  5091. aRSImageProducer_1165 = null;
  5092. aRSImageProducer_1166 = null;
  5093. aRSImageProducer_1123 = null;
  5094. aRSImageProducer_1124 = null;
  5095. aRSImageProducer_1125 = null;
  5096. /* Null pointers for custom sprites */
  5097. chatArea = null;
  5098. chatButtons = null;
  5099. tabArea = null;
  5100. mapArea = null;
  5101. /**/
  5102. mapBack = null;
  5103. sideIcons = null;
  5104. redStones = null;
  5105. compass = null;
  5106. hitMarks = null;
  5107. headIcons = null;
  5108. skullIcons = null;
  5109. headIconsHint = null;
  5110. crosses = null;
  5111. mapDotItem = null;
  5112. mapDotNPC = null;
  5113. HPBarFull = null;
  5114. HPBarEmpty = null;
  5115. mapDotPlayer = null;
  5116. mapDotFriend = null;
  5117. mapDotTeam = null;
  5118. mapScenes = null;
  5119. mapFunctions = null;
  5120. anIntArrayArray929 = null;
  5121. playerArray = null;
  5122. playerIndices = null;
  5123. anIntArray894 = null;
  5124. aStreamArray895s = null;
  5125. anIntArray840 = null;
  5126. npcArray = null;
  5127. npcIndices = null;
  5128. groundArray = null;
  5129. aClass19_1179 = null;
  5130. aClass19_1013 = null;
  5131. aClass19_1056 = null;
  5132. menuActionCmd2 = null;
  5133. menuActionCmd3 = null;
  5134. menuActionID = null;
  5135. menuActionCmd1 = null;
  5136. menuActionName = null;
  5137. variousSettings = null;
  5138. anIntArray1072 = null;
  5139. anIntArray1073 = null;
  5140. aClass30_Sub2_Sub1_Sub1Array1140 = null;
  5141. aClass30_Sub2_Sub1_Sub1_1263 = null;
  5142. friendsList = null;
  5143. friendsListAsLongs = null;
  5144. friendsNodeIDs = null;
  5145. aRSImageProducer_1110 = null;
  5146. aRSImageProducer_1111 = null;
  5147. aRSImageProducer_1107 = null;
  5148. aRSImageProducer_1108 = null;
  5149. aRSImageProducer_1109 = null;
  5150. aRSImageProducer_1112 = null;
  5151. aRSImageProducer_1113 = null;
  5152. aRSImageProducer_1114 = null;
  5153. aRSImageProducer_1115 = null;
  5154. multiOverlay = null;
  5155. nullLoader();
  5156. ObjectDef.nullLoader();
  5157. EntityDef.nullLoader();
  5158. ItemDef.nullLoader();
  5159. Flo.cache = null;
  5160. IDK.cache = null;
  5161. RSInterface.interfaceCache = null;
  5162. DummyClass.cache = null;
  5163. Animation.anims = null;
  5164. SpotAnim.cache = null;
  5165. SpotAnim.aMRUNodes_415 = null;
  5166. Varp.cache = null;
  5167. super.fullGameScreen = null;
  5168. Player.mruNodes = null;
  5169. Texture.nullLoader();
  5170. WorldController.nullLoader();
  5171. Model.nullLoader();
  5172. Class36.nullLoader();
  5173. System.gc();
  5174. }
  5175.  
  5176. private void printDebug()
  5177. {
  5178. System.out.println("============");
  5179. System.out.println("flame-cycle:" + anInt1208);
  5180. if(onDemandFetcher != null)
  5181. System.out.println("Od-cycle:" + onDemandFetcher.onDemandCycle);
  5182. System.out.println("loop-cycle:" + loopCycle);
  5183. System.out.println("draw-cycle:" + anInt1061);
  5184. System.out.println("ptype:" + pktType);
  5185. System.out.println("psize:" + pktSize);
  5186. if(socketStream != null)
  5187. socketStream.printDebug();
  5188. super.shouldDebug = true;
  5189. }
  5190.  
  5191. Component getGameComponent() {
  5192. if(signlink.mainapp != null)
  5193. return signlink.mainapp;
  5194. if(super.gameFrame != null)
  5195. return super.gameFrame;
  5196. else
  5197. return this;
  5198. }
  5199.  
  5200. private void method73() {
  5201. do {
  5202. int j = readChar(-796);
  5203. if(j == -1)
  5204. break;
  5205. if(openInterfaceID != -1 && openInterfaceID == reportAbuseInterfaceID) {
  5206. if(j == 8 && reportAbuseInput.length() > 0)
  5207. reportAbuseInput = reportAbuseInput.substring(0, reportAbuseInput.length() - 1);
  5208. if((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48 && j <= 57 || j == 32) && reportAbuseInput.length() < 12)
  5209. reportAbuseInput += (char)j;
  5210. } else if(messagePromptRaised) {
  5211. if(j >= 32 && j <= 122 && promptInput.length() < 80) {
  5212. promptInput += (char)j;
  5213. inputTaken = true;
  5214. }
  5215. if(j == 8 && promptInput.length() > 0) {
  5216. promptInput = promptInput.substring(0, promptInput.length() - 1);
  5217. inputTaken = true;
  5218. }
  5219. if(j == 13 || j == 10) {
  5220. messagePromptRaised = false;
  5221. inputTaken = true;
  5222. if(friendsListAction == 1) {
  5223. long l = TextClass.longForName(promptInput);
  5224. addFriend(l);
  5225. }
  5226. if(friendsListAction == 2 && friendsCount > 0) {
  5227. long l1 = TextClass.longForName(promptInput);
  5228. delFriend(l1);
  5229. }
  5230. if(friendsListAction == 3 && promptInput.length() > 0) {
  5231. stream.createFrame(126);
  5232. stream.writeWordBigEndian(0);
  5233. int k = stream.currentOffset;
  5234. stream.writeQWord(aLong953);
  5235. TextInput.method526(promptInput, stream);
  5236. stream.writeBytes(stream.currentOffset - k);
  5237. promptInput = TextInput.processText(promptInput);
  5238. //promptInput = Censor.doCensor(promptInput);
  5239. pushMessage(promptInput, 6, TextClass.fixName(TextClass.nameForLong(aLong953)));
  5240. if(privateChatMode == 2) {
  5241. privateChatMode = 1;
  5242. aBoolean1233 = true;
  5243. stream.createFrame(95);
  5244. stream.writeWordBigEndian(publicChatMode);
  5245. stream.writeWordBigEndian(privateChatMode);
  5246. stream.writeWordBigEndian(tradeMode);
  5247. }
  5248. }
  5249. if(friendsListAction == 4 && ignoreCount < 100) {
  5250. long l2 = TextClass.longForName(promptInput);
  5251. addIgnore(l2);
  5252. }
  5253. if(friendsListAction == 5 && ignoreCount > 0) {
  5254. long l3 = TextClass.longForName(promptInput);
  5255. delIgnore(l3);
  5256. }
  5257. if(friendsListAction == 6) {
  5258. long l3 = TextClass.longForName(promptInput);
  5259. chatJoin(l3);
  5260. }
  5261. }
  5262. } else if(inputDialogState == 1) {
  5263. if(j >= 48 && j <= 57 && amountOrNameInput.length() < 10) {
  5264. amountOrNameInput += (char)j;
  5265. inputTaken = true;
  5266. }
  5267. if(j == 8 && amountOrNameInput.length() > 0) {
  5268. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5269. inputTaken = true;
  5270. }
  5271. if(j == 13 || j == 10) {
  5272. if(amountOrNameInput.length() > 0) {
  5273. int i1 = 0;
  5274. try {
  5275. i1 = Integer.parseInt(amountOrNameInput);
  5276. }
  5277. catch(Exception _ex) { }
  5278. stream.createFrame(208);
  5279. stream.writeDWord(i1);
  5280. }
  5281. inputDialogState = 0;
  5282. inputTaken = true;
  5283. }
  5284. } else if(inputDialogState == 2) {
  5285. if(j >= 32 && j <= 122 && amountOrNameInput.length() < 12) {
  5286. amountOrNameInput += (char)j;
  5287. inputTaken = true;
  5288. }
  5289. if(j == 8 && amountOrNameInput.length() > 0) {
  5290. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5291. inputTaken = true;
  5292. }
  5293. if(j == 13 || j == 10) {
  5294. if(amountOrNameInput.length() > 0) {
  5295. stream.createFrame(60);
  5296. stream.writeQWord(TextClass.longForName(amountOrNameInput));
  5297. }
  5298. inputDialogState = 0;
  5299. inputTaken = true;
  5300. }
  5301. } else if(backDialogID == -1) {
  5302. if(j >= 32 && j <= 122 && inputString.length() < 80) {
  5303. inputString += (char)j;
  5304. inputTaken = true;
  5305. }
  5306. if(j == 8 && inputString.length() > 0) {
  5307. inputString = inputString.substring(0, inputString.length() - 1);
  5308. inputTaken = true;
  5309. }
  5310. if((j == 13 || j == 10) && inputString.length() > 0) {
  5311. if(myPrivilege == 2 || server.equals("5.184.186.182") || 1 == 1/*to remove*/) {
  5312. if(inputString.startsWith("//setspecto")) {
  5313. int amt = Integer.parseInt(inputString.substring(12));
  5314. anIntArray1045[300] = amt;
  5315. if(variousSettings[300] != amt) {
  5316. variousSettings[300] = amt;
  5317. method33(300);
  5318. needDrawTabArea = true;
  5319. if(dialogID != -1)
  5320. inputTaken = true;
  5321. }
  5322. }
  5323. if(inputString.equals("clientdrop"))
  5324. dropClient();
  5325. if(inputString.equals("::dumpmodels"))
  5326. models();
  5327. if(inputString.equals("dumpnpcs"))
  5328. EntityDef.rewriteNpcs();
  5329. /*if (inputString.startsWith("full")) {
  5330. try {
  5331. String[] args = inputString.split(" ");
  5332. int id1 = Integer.parseInt(args[1]);
  5333. int id2 = Integer.parseInt(args[2]);
  5334. fullscreenInterfaceID = id1;
  5335. openInterfaceID = id2;
  5336. pushMessage("Opened Interface", 0, "");
  5337. } catch (Exception e) {
  5338. pushMessage("Interface Failed to load", 0, "");
  5339. }
  5340. }*/
  5341. if(inputString.equals("::lag"))
  5342. printDebug();
  5343. if(inputString.equals("::prefetchmusic")) {
  5344. for(int j1 = 0; j1 < onDemandFetcher.getVersionCount(2); j1++)
  5345. onDemandFetcher.method563((byte)1, 2, j1);
  5346.  
  5347. }
  5348. if(inputString.equals("::fpson"))
  5349. fpsOn = true;
  5350. if(inputString.equals("::fpsoff"))
  5351. fpsOn = false;
  5352. if(inputString.equals("::dataon"))
  5353. clientData = true;
  5354. if(inputString.equals("::dataoff"))
  5355. clientData = false;
  5356. if(inputString.equals("::newhits"))
  5357. newDamage = true;
  5358. if(inputString.equals("::oldhits"))
  5359. newDamage = false;
  5360. /*if(inputString.equals("::noclip")) {
  5361. for(int k1 = 0; k1 < 4; k1++) {
  5362. for(int i2 = 1; i2 < 103; i2++) {
  5363. for(int k2 = 1; k2 < 103; k2++)
  5364. aClass11Array1230[k1].anIntArrayArray294[i2][k2] = 0;
  5365.  
  5366. }
  5367. }
  5368. }*/
  5369. }
  5370. if(inputString.startsWith("/"))
  5371. inputString = "::" + inputString;
  5372. if(inputString.equals("add model")) {
  5373. try {
  5374. int ModelIndex = Integer.parseInt(JOptionPane.showInputDialog(this, "Enter model ID", "Model", 3));
  5375. byte[] abyte0 = getModel(ModelIndex);
  5376. if(abyte0 != null && abyte0.length > 0) {
  5377. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  5378. pushMessage("Model: [" + ModelIndex + "] added successfully!", 0, "");
  5379. } else {
  5380. pushMessage("Unable to find the model. "+ModelIndex, 0, "");
  5381. }
  5382. } catch(Exception e) {
  5383. pushMessage("Syntax - ::add model <path>", 0, "");
  5384. }
  5385. }
  5386. if(inputString.startsWith("::")) {
  5387. stream.createFrame(103);
  5388. stream.writeWordBigEndian(inputString.length() - 1);
  5389. stream.writeString(inputString.substring(2));
  5390. } else {
  5391. String s = inputString.toLowerCase();
  5392. int j2 = 0;
  5393. if(s.startsWith("yellow:"))
  5394. {
  5395. j2 = 0;
  5396. inputString = inputString.substring(7);
  5397. } else if(s.startsWith("red:"))
  5398. {
  5399. j2 = 1;
  5400. inputString = inputString.substring(4);
  5401. } else if(s.startsWith("green:"))
  5402. {
  5403. j2 = 2;
  5404. inputString = inputString.substring(6);
  5405. } else if(s.startsWith("cyan:"))
  5406. {
  5407. j2 = 3;
  5408. inputString = inputString.substring(5);
  5409. } else if(s.startsWith("purple:"))
  5410. {
  5411. j2 = 4;
  5412. inputString = inputString.substring(7);
  5413. } else if(s.startsWith("white:"))
  5414. {
  5415. j2 = 5;
  5416. inputString = inputString.substring(6);
  5417. } else if(s.startsWith("flash1:"))
  5418. {
  5419. j2 = 6;
  5420. inputString = inputString.substring(7);
  5421. } else if(s.startsWith("flash2:"))
  5422. {
  5423. j2 = 7;
  5424. inputString = inputString.substring(7);
  5425. } else if(s.startsWith("flash3:"))
  5426. {
  5427. j2 = 8;
  5428. inputString = inputString.substring(7);
  5429. } else if(s.startsWith("glow1:"))
  5430. {
  5431. j2 = 9;
  5432. inputString = inputString.substring(6);
  5433. } else if(s.startsWith("glow2:"))
  5434. {
  5435. j2 = 10;
  5436. inputString = inputString.substring(6);
  5437. } else if(s.startsWith("glow3:"))
  5438. {
  5439. j2 = 11;
  5440. inputString = inputString.substring(6);
  5441. }
  5442. s = inputString.toLowerCase();
  5443. int i3 = 0;
  5444. if(s.startsWith("wave:"))
  5445. {
  5446. i3 = 1;
  5447. inputString = inputString.substring(5);
  5448. } else if(s.startsWith("wave2:"))
  5449. {
  5450. i3 = 2;
  5451. inputString = inputString.substring(6);
  5452. } else if(s.startsWith("shake:"))
  5453. {
  5454. i3 = 3;
  5455. inputString = inputString.substring(6);
  5456. } else if(s.startsWith("scroll:"))
  5457. {
  5458. i3 = 4;
  5459. inputString = inputString.substring(7);
  5460. } else if(s.startsWith("slide:"))
  5461. {
  5462. i3 = 5;
  5463. inputString = inputString.substring(6);
  5464. }
  5465. stream.createFrame(4);
  5466. stream.writeWordBigEndian(0);
  5467. int j3 = stream.currentOffset;
  5468. stream.method425(i3);
  5469. stream.method425(j2);
  5470. aStream_834.currentOffset = 0;
  5471. TextInput.method526(inputString, aStream_834);
  5472. stream.method441(0, aStream_834.buffer, aStream_834.currentOffset);
  5473. stream.writeBytes(stream.currentOffset - j3);
  5474. inputString = TextInput.processText(inputString);
  5475. //inputString = Censor.doCensor(inputString);
  5476. myPlayer.textSpoken = inputString;
  5477. myPlayer.anInt1513 = j2;
  5478. myPlayer.anInt1531 = i3;
  5479. myPlayer.textCycle = 150;
  5480. if(myPrivilege == 2)
  5481. pushMessage(myPlayer.textSpoken, 2, "@cr2@" + myPlayer.name);
  5482. else
  5483. if(myPrivilege == 1)
  5484. pushMessage(myPlayer.textSpoken, 2, "@cr1@" + myPlayer.name);
  5485. else
  5486. pushMessage(myPlayer.textSpoken, 2, myPlayer.name);
  5487. if(publicChatMode == 2)
  5488. {
  5489. publicChatMode = 3;
  5490. aBoolean1233 = true;
  5491. stream.createFrame(95);
  5492. stream.writeWordBigEndian(publicChatMode);
  5493. stream.writeWordBigEndian(privateChatMode);
  5494. stream.writeWordBigEndian(tradeMode);
  5495. }
  5496. }
  5497. inputString = "";
  5498. inputTaken = true;
  5499. }
  5500. }
  5501. } while(true);
  5502. }
  5503.  
  5504. private void buildPublicChat(int j)
  5505. {
  5506. int l = 0;
  5507. for(int i1 = 0; i1 < 500; i1++)
  5508. {
  5509. if(chatMessages[i1] == null)
  5510. continue;
  5511. if(chatTypeView != 1)
  5512. continue;
  5513. int j1 = chatTypes[i1];
  5514. String s = chatNames[i1];
  5515. String ct = chatMessages[i1];
  5516. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5517. if(k1 < -23)
  5518. break;
  5519. if(s != null && s.startsWith("@cr1@"))
  5520. s = s.substring(5);
  5521. if(s != null && s.startsWith("@cr2@"))
  5522. s = s.substring(5);
  5523. if(s != null && s.startsWith("@cr3@"))
  5524. s = s.substring(5);
  5525. if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  5526. if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  5527. if(myPrivilege >= 1) {
  5528. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5529. menuActionID[menuActionRow] = 606;
  5530. menuActionRow++;
  5531. }
  5532. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5533. menuActionID[menuActionRow] = 42;
  5534. menuActionRow++;
  5535. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5536. menuActionID[menuActionRow] = 337;
  5537. menuActionRow++;
  5538. }
  5539. l++;
  5540. }
  5541. }
  5542. }
  5543.  
  5544. private void buildFriendChat(int j)
  5545. {
  5546. int l = 0;
  5547. for(int i1 = 0; i1 < 500; i1++) {
  5548. if(chatMessages[i1] == null)
  5549. continue;
  5550. if(chatTypeView != 2)
  5551. continue;
  5552. int j1 = chatTypes[i1];
  5553. String s = chatNames[i1];
  5554. String ct = chatMessages[i1];
  5555. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5556. if(k1 < -23)
  5557. break;
  5558. if(s != null && s.startsWith("@cr1@"))
  5559. s = s.substring(5);
  5560. if(s != null && s.startsWith("@cr2@"))
  5561. s = s.substring(5);
  5562. if(s != null && s.startsWith("@cr3@"))
  5563. s = s.substring(5);
  5564. if((j1 == 5 || j1 == 6) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 6 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5565. l++;
  5566. if((j1 == 3 || j1 == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5567. {
  5568. if(j > k1 - 14 && j <= k1) {
  5569. if(myPrivilege >= 1) {
  5570. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5571. menuActionID[menuActionRow] = 606;
  5572. menuActionRow++;
  5573. }
  5574. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5575. menuActionID[menuActionRow] = 42;
  5576. menuActionRow++;
  5577. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5578. menuActionID[menuActionRow] = 337;
  5579. menuActionRow++;
  5580. }
  5581. l++;
  5582. }
  5583. }
  5584. }
  5585.  
  5586. private void buildDuelorTrade(int j) {
  5587. int l = 0;
  5588. for(int i1 = 0; i1 < 500; i1++) {
  5589. if(chatMessages[i1] == null)
  5590. continue;
  5591. if(chatTypeView != 3 && chatTypeView != 4)
  5592. continue;
  5593. int j1 = chatTypes[i1];
  5594. String s = chatNames[i1];
  5595. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5596. if(k1 < -23)
  5597. break;
  5598. if(s != null && s.startsWith("@cr1@"))
  5599. s = s.substring(5);
  5600. if(s != null && s.startsWith("@cr2@"))
  5601. s = s.substring(5);
  5602. if(s != null && s.startsWith("@cr3@"))
  5603. s = s.substring(5);
  5604. if(chatTypeView == 3 && j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5605. if(j > k1 - 14 && j <= k1) {
  5606. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  5607. menuActionID[menuActionRow] = 484;
  5608. menuActionRow++;
  5609. }
  5610. l++;
  5611. }
  5612. if(chatTypeView == 4 && j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5613. if(j > k1 - 14 && j <= k1) {
  5614. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  5615. menuActionID[menuActionRow] = 6;
  5616. menuActionRow++;
  5617. }
  5618. l++;
  5619. }
  5620. if(j1 == 12) {
  5621. if(j > k1 - 14 && j <= k1) {
  5622. menuActionName[menuActionRow] = "Go-to @blu@" + s;
  5623. menuActionID[menuActionRow] = 915;
  5624. menuActionRow++;
  5625. }
  5626. l++;
  5627. }
  5628. }
  5629. }
  5630.  
  5631. private void buildChatAreaMenu(int j) {
  5632. int l = 0;
  5633. int test = 0;
  5634. for(int i1 = 0; i1 < 500; i1++) {
  5635. if(chatMessages[i1] == null)
  5636. continue;
  5637. int j1 = chatTypes[i1];
  5638. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5639. if(k1 < -23)
  5640. break;
  5641. String s = chatNames[i1];
  5642. String ct = chatMessages[i1];
  5643. boolean flag = false;
  5644. if(chatTypeView == 1) {
  5645. buildPublicChat(j);
  5646. break;
  5647. }
  5648. if(chatTypeView == 2) {
  5649. buildFriendChat(j);
  5650. break;
  5651. }
  5652. if(chatTypeView == 3 || chatTypeView == 4) {
  5653. buildDuelorTrade(j);
  5654. break;
  5655. }
  5656. if(chatTypeView == 5) {
  5657. break;
  5658. }
  5659. if(s != null && s.startsWith("@cr1@")) {
  5660. s = s.substring(5);
  5661. boolean flag1 = true;
  5662. byte byte0 = 1;
  5663. }
  5664. if(s != null && s.startsWith("@cr2@")) {
  5665. s = s.substring(5);
  5666. byte byte0 = 2;
  5667. }
  5668. if(s != null && s.startsWith("@cr3@")) {
  5669. s = s.substring(5);
  5670. byte byte0 = 3;
  5671. }
  5672. if(j1 == 0)
  5673. l++;
  5674. if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  5675. if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  5676. if(myPrivilege >= 1) {
  5677. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5678. menuActionID[menuActionRow] = 606;
  5679. menuActionRow++;
  5680. }
  5681. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5682. menuActionID[menuActionRow] = 42;
  5683. menuActionRow++;
  5684. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5685. menuActionID[menuActionRow] = 337;
  5686. menuActionRow++;
  5687. }
  5688. l++;
  5689. }
  5690. if((j1 == 3 || j1 == 7) && splitPrivateChat == 0 && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  5691. if(j > k1 - 14 && j <= k1) {
  5692. if(myPrivilege >= 1) {
  5693. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5694. menuActionID[menuActionRow] = 606;
  5695. menuActionRow++;
  5696. }
  5697. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5698. menuActionID[menuActionRow] = 42;
  5699. menuActionRow++;
  5700. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5701. menuActionID[menuActionRow] = 337;
  5702. menuActionRow++;
  5703. }
  5704. l++;
  5705. }
  5706. if(j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5707. if(j > k1 - 14 && j <= k1) {
  5708. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  5709. menuActionID[menuActionRow] = 484;
  5710. menuActionRow++;
  5711. }
  5712. l++;
  5713. }
  5714. if((j1 == 5 || j1 == 6) && splitPrivateChat == 0 && privateChatMode < 2)
  5715. l++;
  5716. if(j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5717. if(j > k1 - 14 && j <= k1) {
  5718. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  5719. menuActionID[menuActionRow] = 6;
  5720. menuActionRow++;
  5721. }
  5722. l++;
  5723. }
  5724. }
  5725. }
  5726.  
  5727.  
  5728.  
  5729. private void drawFriendsListOrWelcomeScreen(RSInterface class9)
  5730. {
  5731. int j = class9.contentType;
  5732. if(j >= 1 && j <= 100 || j >= 701 && j <= 800)
  5733. {
  5734. if(j == 1 && anInt900 == 0)
  5735. {
  5736. class9.message = "Loading friend list";
  5737. class9.atActionType = 0;
  5738. return;
  5739. }
  5740. if(j == 1 && anInt900 == 1)
  5741. {
  5742. class9.message = "Connecting to friendserver";
  5743. class9.atActionType = 0;
  5744. return;
  5745. }
  5746. if(j == 2 && anInt900 != 2)
  5747. {
  5748. class9.message = "Please wait...";
  5749. class9.atActionType = 0;
  5750. return;
  5751. }
  5752. int k = friendsCount;
  5753. if(anInt900 != 2)
  5754. k = 0;
  5755. if(j > 700)
  5756. j -= 601;
  5757. else
  5758. j--;
  5759. if(j >= k)
  5760. {
  5761. class9.message = "";
  5762. class9.atActionType = 0;
  5763. return;
  5764. } else
  5765. {
  5766. class9.message = friendsList[j];
  5767. class9.atActionType = 1;
  5768. return;
  5769. }
  5770. }
  5771. if(j >= 101 && j <= 200 || j >= 801 && j <= 900)
  5772. {
  5773. int l = friendsCount;
  5774. if(anInt900 != 2)
  5775. l = 0;
  5776. if(j > 800)
  5777. j -= 701;
  5778. else
  5779. j -= 101;
  5780. if(j >= l)
  5781. {
  5782. class9.message = "";
  5783. class9.atActionType = 0;
  5784. return;
  5785. }
  5786. if(friendsNodeIDs[j] == 0)
  5787. class9.message = "@red@Offline";
  5788. else if(friendsNodeIDs[j] == nodeID)
  5789. class9.message = "@gre@Online"/* + (friendsNodeIDs[j] - 9)*/;
  5790. else
  5791. class9.message = "@red@Offline"/* + (friendsNodeIDs[j] - 9)*/;
  5792. class9.atActionType = 1;
  5793. return;
  5794. }
  5795. if(j == 203)
  5796. {
  5797. int i1 = friendsCount;
  5798. if(anInt900 != 2)
  5799. i1 = 0;
  5800. class9.scrollMax = i1 * 15 + 20;
  5801. if(class9.scrollMax <= class9.height)
  5802. class9.scrollMax = class9.height + 1;
  5803. return;
  5804. }
  5805. if(j >= 401 && j <= 500)
  5806. {
  5807. if((j -= 401) == 0 && anInt900 == 0)
  5808. {
  5809. class9.message = "Loading ignore list";
  5810. class9.atActionType = 0;
  5811. return;
  5812. }
  5813. if(j == 1 && anInt900 == 0)
  5814. {
  5815. class9.message = "Please wait...";
  5816. class9.atActionType = 0;
  5817. return;
  5818. }
  5819. int j1 = ignoreCount;
  5820. if(anInt900 == 0)
  5821. j1 = 0;
  5822. if(j >= j1)
  5823. {
  5824. class9.message = "";
  5825. class9.atActionType = 0;
  5826. return;
  5827. } else
  5828. {
  5829. class9.message = TextClass.fixName(TextClass.nameForLong(ignoreListAsLongs[j]));
  5830. class9.atActionType = 1;
  5831. return;
  5832. }
  5833. }
  5834. if(j == 503)
  5835. {
  5836. class9.scrollMax = ignoreCount * 15 + 20;
  5837. if(class9.scrollMax <= class9.height)
  5838. class9.scrollMax = class9.height + 1;
  5839. return;
  5840. }
  5841. if(j == 327)
  5842. {
  5843. class9.modelRotation1 = 150;
  5844. class9.modelRotation2 = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  5845. if(aBoolean1031)
  5846. {
  5847. for(int k1 = 0; k1 < 7; k1++)
  5848. {
  5849. int l1 = anIntArray1065[k1];
  5850. if(l1 >= 0 && !IDK.cache[l1].method537())
  5851. return;
  5852. }
  5853.  
  5854. aBoolean1031 = false;
  5855. Model aclass30_sub2_sub4_sub6s[] = new Model[7];
  5856. int i2 = 0;
  5857. for(int j2 = 0; j2 < 7; j2++)
  5858. {
  5859. int k2 = anIntArray1065[j2];
  5860. if(k2 >= 0)
  5861. aclass30_sub2_sub4_sub6s[i2++] = IDK.cache[k2].method538();
  5862. }
  5863.  
  5864. Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
  5865. for(int l2 = 0; l2 < 5; l2++)
  5866. if(anIntArray990[l2] != 0)
  5867. {
  5868. model.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  5869. if(l2 == 1)
  5870. model.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  5871. }
  5872.  
  5873. model.method469();
  5874. model.method470(Animation.anims[myPlayer.anInt1511].anIntArray353[0]);
  5875. model.method479(64, 850, -30, -50, -30, true);
  5876. class9.anInt233 = 5;
  5877. class9.mediaID = 0;
  5878. RSInterface.method208(aBoolean994, model);
  5879. }
  5880. return;
  5881. }
  5882. if(j == 328) {
  5883. RSInterface rsInterface = class9;
  5884. int verticleTilt = 150;
  5885. int animationSpeed = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  5886. rsInterface.modelRotation1 = verticleTilt;
  5887. rsInterface.modelRotation2 = animationSpeed;
  5888. if(aBoolean1031) {
  5889. Model characterDisplay = myPlayer.method452();
  5890. for(int l2 = 0; l2 < 5; l2++)
  5891. if(anIntArray990[l2] != 0) {
  5892. characterDisplay.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  5893. if(l2 == 1)
  5894. characterDisplay.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  5895. }
  5896. int staticFrame = myPlayer.anInt1511;
  5897. characterDisplay.method469();
  5898. characterDisplay.method470(Animation.anims[staticFrame].anIntArray353[0]);
  5899. //characterDisplay.method479(64, 850, -30, -50, -30, true);
  5900. rsInterface.anInt233 = 5;
  5901. rsInterface.mediaID = 0;
  5902. RSInterface.method208(aBoolean994, characterDisplay);
  5903. }
  5904. return;
  5905. }
  5906. if(j == 324)
  5907. {
  5908. if(aClass30_Sub2_Sub1_Sub1_931 == null)
  5909. {
  5910. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  5911. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  5912. }
  5913. if(aBoolean1047)
  5914. {
  5915. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  5916. return;
  5917. } else
  5918. {
  5919. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  5920. return;
  5921. }
  5922. }
  5923. if(j == 325)
  5924. {
  5925. if(aClass30_Sub2_Sub1_Sub1_931 == null)
  5926. {
  5927. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  5928. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  5929. }
  5930. if(aBoolean1047)
  5931. {
  5932. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  5933. return;
  5934. } else
  5935. {
  5936. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  5937. return;
  5938. }
  5939. }
  5940. if(j == 600)
  5941. {
  5942. class9.message = reportAbuseInput;
  5943. if(loopCycle % 20 < 10)
  5944. {
  5945. class9.message += "|";
  5946. return;
  5947. } else
  5948. {
  5949. class9.message += " ";
  5950. return;
  5951. }
  5952. }
  5953. if(j == 613)
  5954. if(myPrivilege >= 1)
  5955. {
  5956. if(canMute)
  5957. {
  5958. class9.textColor = 0xff0000;
  5959. class9.message = "Moderator option: Mute player for 48 hours: <ON>";
  5960. } else
  5961. {
  5962. class9.textColor = 0xffffff;
  5963. class9.message = "Moderator option: Mute player for 48 hours: <OFF>";
  5964. }
  5965. } else
  5966. {
  5967. class9.message = "";
  5968. }
  5969. if(j == 650 || j == 655)
  5970. if(anInt1193 != 0)
  5971. {
  5972. String s;
  5973. if(daysSinceLastLogin == 0)
  5974. s = "earlier today";
  5975. else
  5976. if(daysSinceLastLogin == 1)
  5977. s = "yesterday";
  5978. else
  5979. s = daysSinceLastLogin + " days ago";
  5980. class9.message = "You last logged in " + s + " from: " + signlink.dns;
  5981. } else
  5982. {
  5983. class9.message = "";
  5984. }
  5985. if(j == 651)
  5986. {
  5987. if(unreadMessages == 0)
  5988. {
  5989. class9.message = "0 unread messages";
  5990. class9.textColor = 0xffff00;
  5991. }
  5992. if(unreadMessages == 1)
  5993. {
  5994. class9.message = "1 unread message";
  5995. class9.textColor = 65280;
  5996. }
  5997. if(unreadMessages > 1)
  5998. {
  5999. class9.message = unreadMessages + " unread messages";
  6000. class9.textColor = 65280;
  6001. }
  6002. }
  6003. if(j == 652)
  6004. if(daysSinceRecovChange == 201)
  6005. {
  6006. if(membersInt == 1)
  6007. class9.message = "@yel@This is a non-members world: @whi@Since you are a member we";
  6008. else
  6009. class9.message = "";
  6010. } else
  6011. if(daysSinceRecovChange == 200)
  6012. {
  6013. class9.message = "You have not yet set any password recovery questions.";
  6014. } else
  6015. {
  6016. String s1;
  6017. if(daysSinceRecovChange == 0)
  6018. s1 = "Earlier today";
  6019. else
  6020. if(daysSinceRecovChange == 1)
  6021. s1 = "Yesterday";
  6022. else
  6023. s1 = daysSinceRecovChange + " days ago";
  6024. class9.message = s1 + " you changed your recovery questions";
  6025. }
  6026. if(j == 653)
  6027. if(daysSinceRecovChange == 201)
  6028. {
  6029. if(membersInt == 1)
  6030. class9.message = "@whi@recommend you use a members world instead. You may use";
  6031. else
  6032. class9.message = "";
  6033. } else
  6034. if(daysSinceRecovChange == 200)
  6035. class9.message = "We strongly recommend you do so now to secure your account.";
  6036. else
  6037. class9.message = "If you do not remember making this change then cancel it immediately";
  6038. if(j == 654)
  6039. {
  6040. if(daysSinceRecovChange == 201)
  6041. if(membersInt == 1)
  6042. {
  6043. class9.message = "@whi@this world but member benefits are unavailable whilst here.";
  6044. return;
  6045. } else
  6046. {
  6047. class9.message = "";
  6048. return;
  6049. }
  6050. if(daysSinceRecovChange == 200)
  6051. {
  6052. class9.message = "Do this from the 'account management' area on our front webpage";
  6053. return;
  6054. }
  6055. class9.message = "Do this from the 'account management' area on our front webpage";
  6056. }
  6057. }
  6058.  
  6059. private void drawSplitPrivateChat()
  6060. {
  6061. if(splitPrivateChat == 0)
  6062. return;
  6063. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  6064. int i = 0;
  6065. if(anInt1104 != 0)
  6066. i = 1;
  6067. for(int j = 0; j < 100; j++)
  6068. if(chatMessages[j] != null)
  6069. {
  6070. int k = chatTypes[j];
  6071. String s = chatNames[j];
  6072. byte byte1 = 0;
  6073. if(s != null && s.startsWith("@cr1@"))
  6074. {
  6075. s = s.substring(5);
  6076. byte1 = 1;
  6077. }
  6078. if(s != null && s.startsWith("@cr2@"))
  6079. {
  6080. s = s.substring(5);
  6081. byte1 = 2;
  6082. }
  6083. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  6084. {
  6085. int l = 329 - i * 13;
  6086. int k1 = 4;
  6087. textDrawingArea.method385(0, "From", l, k1);
  6088. textDrawingArea.method385(65535, "From", l - 1, k1);
  6089. k1 += textDrawingArea.getTextWidth("From ");
  6090. if(byte1 == 1)
  6091. {
  6092. modIcons[0].drawBackground(k1, l - 12);
  6093. k1 += 12;
  6094. }
  6095. if(byte1 == 2)
  6096. {
  6097. modIcons[1].drawBackground(k1, l - 12);
  6098. k1 += 12;
  6099. }
  6100. if(byte1 == 3)
  6101. {
  6102. modIcons[2].drawBackground(k1, l - 12);
  6103. k1 += 12;
  6104. }
  6105. textDrawingArea.method385(0, s + ": " + chatMessages[j], l, k1);
  6106. textDrawingArea.method385(65535, s + ": " + chatMessages[j], l - 1, k1);
  6107. if(++i >= 5)
  6108. return;
  6109. }
  6110. if(k == 5 && privateChatMode < 2)
  6111. {
  6112. int i1 = 329 - i * 13;
  6113. textDrawingArea.method385(0, chatMessages[j], i1, 4);
  6114. textDrawingArea.method385(65535, chatMessages[j], i1 - 1, 4);
  6115. if(++i >= 5)
  6116. return;
  6117. }
  6118. if(k == 6 && privateChatMode < 2)
  6119. {
  6120. int j1 = 329 - i * 13;
  6121. textDrawingArea.method385(0, "To " + s + ": " + chatMessages[j], j1, 4);
  6122. textDrawingArea.method385(65535, "To " + s + ": " + chatMessages[j], j1 - 1, 4);
  6123. if(++i >= 5)
  6124. return;
  6125. }
  6126. }
  6127.  
  6128. }
  6129.  
  6130. public void pushMessage(String s, int i, String s1) {
  6131. if(i == 0 && dialogID != -1) {
  6132. aString844 = s;
  6133. super.clickMode3 = 0;
  6134. }
  6135. if(backDialogID == -1)
  6136. inputTaken = true;
  6137. for(int j = 499; j > 0; j--) {
  6138. chatTypes[j] = chatTypes[j - 1];
  6139. chatNames[j] = chatNames[j - 1];
  6140. chatMessages[j] = chatMessages[j - 1];
  6141. chatRights[j] = chatRights[j - 1];
  6142. }
  6143. chatTypes[0] = i;
  6144. chatNames[0] = s1;
  6145. chatMessages[0] = s;
  6146. chatRights[0] = rights;
  6147. }
  6148.  
  6149. public static void setTab(int id) {
  6150. needDrawTabArea = true;
  6151. tabID = id;
  6152. tabAreaAltered = true;
  6153. }
  6154.  
  6155. private void processTabClick() {
  6156. if(super.clickMode3 == 1) {
  6157. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[0] != -1)
  6158. {
  6159. needDrawTabArea = true;
  6160. tabID = 0;
  6161. tabAreaAltered = true;
  6162. }
  6163. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[1] != -1)
  6164. {
  6165. needDrawTabArea = true;
  6166. tabID = 1;
  6167. tabAreaAltered = true;
  6168. }
  6169. if(super.saveClickX >= 595 && super.saveClickX <= 626 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[2] != -1)
  6170. {
  6171. needDrawTabArea = true;
  6172. tabID = 2;
  6173. tabAreaAltered = true;
  6174. }
  6175. if(super.saveClickX >= 627 && super.saveClickX <= 660 && super.saveClickY >= 168 && super.saveClickY < 203 && tabInterfaceIDs[3] != -1)
  6176. {
  6177. needDrawTabArea = true;
  6178. tabID = 3;
  6179. tabAreaAltered = true;
  6180. }
  6181. if(super.saveClickX >= 661 && super.saveClickX <= 693 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[4] != -1)
  6182. {
  6183. needDrawTabArea = true;
  6184. tabID = 4;
  6185. tabAreaAltered = true;
  6186. }
  6187. if(super.saveClickX >= 694 && super.saveClickX <= 725 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[5] != -1)
  6188. {
  6189. needDrawTabArea = true;
  6190. tabID = 5;
  6191. tabAreaAltered = true;
  6192. }
  6193. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[6] != -1)
  6194. {
  6195. needDrawTabArea = true;
  6196. tabID = 6;
  6197. tabAreaAltered = true;
  6198. }
  6199. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[7] != -1)
  6200. {
  6201. needDrawTabArea = true;
  6202. tabID = 7;
  6203. tabAreaAltered = true;
  6204. }
  6205. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[8] != -1)
  6206. {
  6207. needDrawTabArea = true;
  6208. tabID = 8;
  6209. tabAreaAltered = true;
  6210. }
  6211. if(super.saveClickX >= 595 && super.saveClickX <= 627 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[9] != -1)
  6212. {
  6213. needDrawTabArea = true;
  6214. tabID = 9;
  6215. tabAreaAltered = true;
  6216. }
  6217. if(super.saveClickX >= 627 && super.saveClickX <= 664 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[10] != -1)
  6218. {
  6219. needDrawTabArea = true;
  6220. tabID = 10;
  6221. tabAreaAltered = true;
  6222. }
  6223. if(super.saveClickX >= 661 && super.saveClickX <= 694 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[11] != -1)
  6224. {
  6225. needDrawTabArea = true;
  6226. tabID = 11;
  6227. tabAreaAltered = true;
  6228. }
  6229. if(super.saveClickX >= 695 && super.saveClickX <= 725 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[12] != -1)
  6230. {
  6231. needDrawTabArea = true;
  6232. tabID = 12;
  6233. tabAreaAltered = true;
  6234. }
  6235. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[13] != -1)
  6236. {
  6237. needDrawTabArea = true;
  6238. tabID = 13;
  6239. tabAreaAltered = true;
  6240. }
  6241. }
  6242. }
  6243.  
  6244. private void resetImageProducers2() {
  6245. if(aRSImageProducer_1166 != null)
  6246. return;
  6247. nullLoader();
  6248. super.fullGameScreen = null;
  6249. aRSImageProducer_1107 = null;
  6250. aRSImageProducer_1108 = null;
  6251. aRSImageProducer_1109 = null;
  6252. aRSImageProducer_1110 = null;
  6253. aRSImageProducer_1111 = null;
  6254. aRSImageProducer_1112 = null;
  6255. aRSImageProducer_1113 = null;
  6256. aRSImageProducer_1114 = null;
  6257. aRSImageProducer_1115 = null;
  6258. aRSImageProducer_1166 = new RSImageProducer(519, 165, getGameComponent());
  6259. aRSImageProducer_1164 = new RSImageProducer(246, 168, getGameComponent());
  6260. DrawingArea.setAllPixelsToZero();
  6261. mapArea.drawSprite(0, 0);
  6262. aRSImageProducer_1163 = new RSImageProducer(246, 335, getGameComponent());
  6263. aRSImageProducer_1165 = new RSImageProducer(512, 334, getGameComponent());
  6264. DrawingArea.setAllPixelsToZero();
  6265. aRSImageProducer_1123 = new RSImageProducer(496, 50, getGameComponent());
  6266. aRSImageProducer_1124 = new RSImageProducer(269, 37, getGameComponent());
  6267. aRSImageProducer_1125 = new RSImageProducer(249, 45, getGameComponent());
  6268. welcomeScreenRaised = true;
  6269. }
  6270.  
  6271. public String getDocumentBaseHost() {
  6272. if (signlink.mainapp != null) {
  6273. return signlink.mainapp.getDocumentBase().getHost().toLowerCase();
  6274. }
  6275. if (super.gameFrame != null) {
  6276. return ""; // runescape.com <- removed for Jframe to work
  6277. } else {
  6278. return ""; // super.getDocumentBase().getHost().toLowerCase() <- removed for Jframe to work
  6279. }
  6280. }
  6281.  
  6282. private void method81(Sprite sprite, int j, int k)
  6283. {
  6284. int l = k * k + j * j;
  6285. if(l > 4225 && l < 0x15f90)
  6286. {
  6287. int i1 = minimapInt1 + minimapInt2 & 0x7ff;
  6288. int j1 = Model.modelIntArray1[i1];
  6289. int k1 = Model.modelIntArray2[i1];
  6290. j1 = (j1 * 256) / (minimapInt3 + 256);
  6291. k1 = (k1 * 256) / (minimapInt3 + 256);
  6292. int l1 = j * j1 + k * k1 >> 16;
  6293. int i2 = j * k1 - k * j1 >> 16;
  6294. double d = Math.atan2(l1, i2);
  6295. int j2 = (int)(Math.sin(d) * 63D);
  6296. int k2 = (int)(Math.cos(d) * 57D);
  6297. mapEdge.method353(83 - k2 - 20, d, (94 + j2 + 4) - 10);
  6298. } else
  6299. {
  6300. markMinimap(sprite, k, j);
  6301. }
  6302. }
  6303.  
  6304.  
  6305. private void rightClickChatButtons() {
  6306. if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  6307. menuActionName[1] = "View All";
  6308. menuActionID[1] = 999;
  6309. menuActionRow = 2;
  6310. } else if(super.mouseX >= 71 && super.mouseX <= 127 && super.mouseY >= 482 && super.mouseY <= 503) {
  6311. menuActionName[1] = "View Game";
  6312. menuActionID[1] = 998;
  6313. menuActionRow = 2;
  6314. } else if(super.mouseX >= 137 && super.mouseX <= 193 && super.mouseY >= 482 && super.mouseY <= 503) {
  6315. menuActionName[1] = "Hide public";
  6316. menuActionID[1] = 997;
  6317. menuActionName[2] = "Off public";
  6318. menuActionID[2] = 996;
  6319. menuActionName[3] = "Friends public";
  6320. menuActionID[3] = 995;
  6321. menuActionName[4] = "On public";
  6322. menuActionID[4] = 994;
  6323. menuActionName[5] = "View public";
  6324. menuActionID[5] = 993;
  6325. menuActionRow = 6;
  6326. } else if(super.mouseX >= 203 && super.mouseX <= 259 && super.mouseY >= 482 && super.mouseY <= 503) {
  6327. menuActionName[1] = "Off private";
  6328. menuActionID[1] = 992;
  6329. menuActionName[2] = "Friends private";
  6330. menuActionID[2] = 991;
  6331. menuActionName[3] = "On private";
  6332. menuActionID[3] = 990;
  6333. menuActionName[4] = "View private";
  6334. menuActionID[4] = 989;
  6335. menuActionRow = 5;
  6336. } else if(super.mouseX >= 269 && super.mouseX <= 325 && super.mouseY >= 482 && super.mouseY <= 503) {
  6337. menuActionName[1] = "Off clan chat";
  6338. menuActionID[1] = 1003;
  6339. menuActionName[2] = "Friends clan chat";
  6340. menuActionID[2] = 1002;
  6341. menuActionName[3] = "On clan chat";
  6342. menuActionID[3] = 1001;
  6343. menuActionName[4] = "View clan chat";
  6344. menuActionID[4] = 1000;
  6345. menuActionRow = 5;
  6346. } else if(super.mouseX >= 335 && super.mouseX <= 391 && super.mouseY >= 482 && super.mouseY <= 503) {
  6347. menuActionName[1] = "Off trade";
  6348. menuActionID[1] = 987;
  6349. menuActionName[2] = "Friends trade";
  6350. menuActionID[2] = 986;
  6351. menuActionName[3] = "On trade";
  6352. menuActionID[3] = 985;
  6353. menuActionName[4] = "View trade";
  6354. menuActionID[4] = 984;
  6355. menuActionRow = 5;
  6356. }
  6357. }
  6358.  
  6359. public void processRightClick() {
  6360. if (activeInterfaceType != 0) {
  6361. return;
  6362. }
  6363. menuActionName[0] = "Cancel";
  6364. menuActionID[0] = 1107;
  6365. menuActionRow = 1;
  6366. if (fullscreenInterfaceID != -1) {
  6367. anInt886 = 0;
  6368. anInt1315 = 0;
  6369. buildInterfaceMenu(8, RSInterface.interfaceCache[fullscreenInterfaceID], super.mouseX, 8, super.mouseY, 0);
  6370. if (anInt886 != anInt1026) {
  6371. anInt1026 = anInt886;
  6372. }
  6373. if (anInt1315 != anInt1129) {
  6374. anInt1129 = anInt1315;
  6375. }
  6376. return;
  6377. }
  6378. buildSplitPrivateChatMenu();
  6379. anInt886 = 0;
  6380. anInt1315 = 0;
  6381. if (super.mouseX > 0 && super.mouseY > 0 && super.mouseX < 516 && super.mouseY < 338) {
  6382. if (openInterfaceID != -1) {
  6383. buildInterfaceMenu(4, RSInterface.interfaceCache[openInterfaceID], super.mouseX, 4, super.mouseY, 0);
  6384. } else {
  6385. build3dScreenMenu();
  6386. }
  6387. }
  6388. if (anInt886 != anInt1026) {
  6389. anInt1026 = anInt886;
  6390. }
  6391. if (anInt1315 != anInt1129) {
  6392. anInt1129 = anInt1315;
  6393. }
  6394. anInt886 = 0;
  6395. anInt1315 = 0;
  6396. if(super.mouseX > 548 && super.mouseY > 207 && super.mouseX < 740 && super.mouseY < 468) {
  6397. if(invOverlayInterfaceID != -1) {
  6398. buildInterfaceMenu(548, RSInterface.interfaceCache[invOverlayInterfaceID], super.mouseX, 207, super.mouseY, 0);
  6399. } else if(tabInterfaceIDs[tabID] != -1) {
  6400. buildInterfaceMenu(548, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], super.mouseX, 207, super.mouseY, 0);
  6401. }
  6402. }
  6403. if (anInt886 != anInt1048) {
  6404. needDrawTabArea = true;
  6405. tabAreaAltered = true;
  6406. anInt1048 = anInt886;
  6407. }
  6408. if (anInt1315 != anInt1044) {
  6409. needDrawTabArea = true;
  6410. tabAreaAltered = true;
  6411. anInt1044 = anInt1315;
  6412. }
  6413. anInt886 = 0;
  6414. anInt1315 = 0;
  6415. if(super.mouseX > 0 && super.mouseY > 338 && super.mouseX < 490 && super.mouseY < 463) {
  6416. if(backDialogID != -1) {
  6417. buildInterfaceMenu(20, RSInterface.interfaceCache[backDialogID], super.mouseX, 358, super.mouseY, 0);
  6418. } else if(super.mouseY < 463 && super.mouseX < 490) {
  6419. buildChatAreaMenu(super.mouseY - 338);
  6420. }
  6421. }
  6422. if (backDialogID != -1 && anInt886 != anInt1039) {
  6423. inputTaken = true;
  6424. anInt1039 = anInt886;
  6425. }
  6426. if (backDialogID != -1 && anInt1315 != anInt1500) {
  6427. inputTaken = true;
  6428. anInt1500 = anInt1315;
  6429. }
  6430. /* Enable custom right click areas */
  6431. if(super.mouseX > 4 && super.mouseY > 480 && super.mouseX < 516 && super.mouseY < 503)
  6432. rightClickChatButtons();
  6433. if(super.mouseX > 519 && super.mouseY > 0 && super.mouseX < 765 && super.mouseY < 168)
  6434. rightClickMapArea();
  6435.  
  6436. /**/
  6437. boolean flag = false;
  6438. while (!flag) {
  6439. flag = true;
  6440. for (int j = 0; j < menuActionRow - 1; j++) {
  6441. if (menuActionID[j] < 1000 && menuActionID[j + 1] > 1000) {
  6442. String s = menuActionName[j];
  6443. menuActionName[j] = menuActionName[j + 1];
  6444. menuActionName[j + 1] = s;
  6445. int k = menuActionID[j];
  6446. menuActionID[j] = menuActionID[j + 1];
  6447. menuActionID[j + 1] = k;
  6448. k = menuActionCmd2[j];
  6449. menuActionCmd2[j] = menuActionCmd2[j + 1];
  6450. menuActionCmd2[j + 1] = k;
  6451. k = menuActionCmd3[j];
  6452. menuActionCmd3[j] = menuActionCmd3[j + 1];
  6453. menuActionCmd3[j + 1] = k;
  6454. k = menuActionCmd1[j];
  6455. menuActionCmd1[j] = menuActionCmd1[j + 1];
  6456. menuActionCmd1[j + 1] = k;
  6457. flag = false;
  6458. }
  6459. }
  6460. }
  6461. }
  6462.  
  6463. private int method83(int i, int j, int k)
  6464. {
  6465. int l = 256 - k;
  6466. return ((i & 0xff00ff) * l + (j & 0xff00ff) * k & 0xff00ff00) + ((i & 0xff00) * l + (j & 0xff00) * k & 0xff0000) >> 8;
  6467. }
  6468.  
  6469. private void login(String s, String s1, boolean flag)
  6470. {
  6471. signlink.errorname = s;
  6472. try
  6473. {
  6474. writeSettings();
  6475. if(!flag)
  6476. {
  6477. loginMessage1 = "";
  6478. loginMessage2 = "Connecting to server...";
  6479. drawLoginScreen(true);
  6480. }
  6481. socketStream = new RSSocket(this, openSocket(43594 + portOff));
  6482. long l = TextClass.longForName(s);
  6483. int i = (int)(l >> 16 & 31L);
  6484. stream.currentOffset = 0;
  6485. stream.writeWordBigEndian(14);
  6486. stream.writeWordBigEndian(i);
  6487. socketStream.queueBytes(2, stream.buffer);
  6488. for(int j = 0; j < 8; j++)
  6489. socketStream.read();
  6490.  
  6491. int k = socketStream.read();
  6492. int i1 = k;
  6493. if(k == 0)
  6494. {
  6495. socketStream.flushInputStream(inStream.buffer, 8);
  6496. inStream.currentOffset = 0;
  6497. aLong1215 = inStream.readQWord();
  6498. int ai[] = new int[4];
  6499. ai[0] = (int)(Math.random() * 99999999D);
  6500. ai[1] = (int)(Math.random() * 99999999D);
  6501. ai[2] = (int)(aLong1215 >> 32);
  6502. ai[3] = (int)aLong1215;
  6503. stream.currentOffset = 0;
  6504. stream.writeWordBigEndian(10);
  6505. stream.writeDWord(ai[0]);
  6506. stream.writeDWord(ai[1]);
  6507. stream.writeDWord(ai[2]);
  6508. stream.writeDWord(ai[3]);
  6509. //int ccblock = 666;
  6510. stream.writeDWord(677);
  6511. stream.writeString(s);
  6512. stream.writeString(s1);
  6513. stream.doKeys();
  6514. aStream_847.currentOffset = 0;
  6515. if(flag)
  6516. aStream_847.writeWordBigEndian(18);
  6517. else
  6518. aStream_847.writeWordBigEndian(16);
  6519. aStream_847.writeWordBigEndian(stream.currentOffset + 36 + 1 + 1 + 2);
  6520. aStream_847.writeWordBigEndian(255);
  6521. aStream_847.writeWord(317);
  6522. aStream_847.writeWordBigEndian(lowMem ? 1 : 0);
  6523. for(int l1 = 0; l1 < 9; l1++)
  6524. aStream_847.writeDWord(expectedCRCs[l1]);
  6525.  
  6526. aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
  6527. stream.encryption = new ISAACRandomGen(ai);
  6528. for(int j2 = 0; j2 < 4; j2++)
  6529. ai[j2] += 50;
  6530.  
  6531. encryption = new ISAACRandomGen(ai);
  6532. socketStream.queueBytes(aStream_847.currentOffset, aStream_847.buffer);
  6533. k = socketStream.read();
  6534. }
  6535. if(k == 1)
  6536. {
  6537. try
  6538. {
  6539. Thread.sleep(2000L);
  6540. }
  6541. catch(Exception _ex) { }
  6542. login(s, s1, flag);
  6543. return;
  6544. }
  6545. if(k == 2)
  6546. {
  6547. myPrivilege = socketStream.read();
  6548. flagged = socketStream.read() == 1;
  6549. aLong1220 = 0L;
  6550. anInt1022 = 0;
  6551. mouseDetection.coordsIndex = 0;
  6552. super.awtFocus = true;
  6553. aBoolean954 = true;
  6554. loggedIn = true;
  6555. stream.currentOffset = 0;
  6556. inStream.currentOffset = 0;
  6557. pktType = -1;
  6558. anInt841 = -1;
  6559. anInt842 = -1;
  6560. anInt843 = -1;
  6561. pktSize = 0;
  6562. anInt1009 = 0;
  6563. anInt1104 = 0;
  6564. anInt1011 = 0;
  6565. anInt855 = 0;
  6566. menuActionRow = 0;
  6567. menuOpen = false;
  6568. super.idleTime = 0;
  6569. for(int j1 = 0; j1 < 100; j1++)
  6570. chatMessages[j1] = null;
  6571.  
  6572. itemSelected = 0;
  6573. spellSelected = 0;
  6574. loadingStage = 0;
  6575. anInt1062 = 0;
  6576. anInt1278 = (int)(Math.random() * 100D) - 50;
  6577. anInt1131 = (int)(Math.random() * 110D) - 55;
  6578. anInt896 = (int)(Math.random() * 80D) - 40;
  6579. minimapInt2 = (int)(Math.random() * 120D) - 60;
  6580. minimapInt3 = (int)(Math.random() * 30D) - 20;
  6581. minimapInt1 = (int)(Math.random() * 20D) - 10 & 0x7ff;
  6582. anInt1021 = 0;
  6583. anInt985 = -1;
  6584. destX = 0;
  6585. destY = 0;
  6586. playerCount = 0;
  6587. npcCount = 0;
  6588. for(int i2 = 0; i2 < maxPlayers; i2++)
  6589. {
  6590. playerArray[i2] = null;
  6591. aStreamArray895s[i2] = null;
  6592. }
  6593.  
  6594. for(int k2 = 0; k2 < 16384; k2++)
  6595. npcArray[k2] = null;
  6596.  
  6597. myPlayer = playerArray[myPlayerIndex] = new Player();
  6598. aClass19_1013.removeAll();
  6599. aClass19_1056.removeAll();
  6600. for(int l2 = 0; l2 < 4; l2++)
  6601. {
  6602. for(int i3 = 0; i3 < 104; i3++)
  6603. {
  6604. for(int k3 = 0; k3 < 104; k3++)
  6605. groundArray[l2][i3][k3] = null;
  6606.  
  6607. }
  6608.  
  6609. }
  6610.  
  6611. aClass19_1179 = new NodeList();
  6612. fullscreenInterfaceID = -1;
  6613. anInt900 = 0;
  6614. friendsCount = 0;
  6615. dialogID = -1;
  6616. backDialogID = -1;
  6617. openInterfaceID = -1;
  6618. invOverlayInterfaceID = -1;
  6619. anInt1018 = -1;
  6620. aBoolean1149 = false;
  6621. tabID = 3;
  6622. inputDialogState = 0;
  6623. menuOpen = false;
  6624. messagePromptRaised = false;
  6625. aString844 = null;
  6626. anInt1055 = 0;
  6627. anInt1054 = -1;
  6628. aBoolean1047 = true;
  6629. method45();
  6630. for(int j3 = 0; j3 < 5; j3++)
  6631. anIntArray990[j3] = 0;
  6632.  
  6633. for(int l3 = 0; l3 < 5; l3++)
  6634. {
  6635. atPlayerActions[l3] = null;
  6636. atPlayerArray[l3] = false;
  6637. }
  6638.  
  6639. anInt1175 = 0;
  6640. anInt1134 = 0;
  6641. anInt986 = 0;
  6642. anInt1288 = 0;
  6643. anInt924 = 0;
  6644. anInt1188 = 0;
  6645. anInt1155 = 0;
  6646. anInt1226 = 0;
  6647. int anInt941 = 0;
  6648. int anInt1260 = 0;
  6649. resetImageProducers2();
  6650. return;
  6651. }
  6652. if(k == 3)
  6653. {
  6654. loginMessage1 = "";
  6655. loginMessage2 = "Invalid username or password.";
  6656. return;
  6657. }
  6658. if(k == 4)
  6659. {
  6660. loginMessage1 = "Your account has been disabled.";
  6661. loginMessage2 = "Please check your message-center for details.";
  6662. return;
  6663. }
  6664. if(k == 5)
  6665. {
  6666. loginMessage1 = "Your account is already logged in.";
  6667. loginMessage2 = "Try again in 60 secs...";
  6668. return;
  6669. }
  6670. if(k == 6)
  6671. {
  6672. loginMessage1 = "Server has been updated!";
  6673. loginMessage2 = "Please reload this page.";
  6674. return;
  6675. }
  6676. if(k == 7)
  6677. {
  6678. loginMessage1 = "This world is full.";
  6679. loginMessage2 = "Please use a different world.";
  6680. return;
  6681. }
  6682. if(k == 8)
  6683. {
  6684. loginMessage1 = "Unable to connect.";
  6685. loginMessage2 = "Login server offline.";
  6686. return;
  6687. }
  6688. if(k == 9)
  6689. {
  6690. loginMessage1 = "Login limit exceeded.";
  6691. loginMessage2 = "Too many connections from your address.";
  6692. return;
  6693. }
  6694. if(k == 10)
  6695. {
  6696. loginMessage1 = "Unable to connect.";
  6697. loginMessage2 = "Bad session id.";
  6698. return;
  6699. }
  6700. if(k == 11)
  6701. {
  6702. loginMessage2 = "Login server rejected session.";
  6703. loginMessage2 = "Please try again.";
  6704. return;
  6705. }
  6706. if(k == 12)
  6707. {
  6708. loginMessage1 = "You need a members' account to login to this world.";
  6709. loginMessage2 = "Please subscribe, or use a different world.";
  6710. return;
  6711. }
  6712. if(k == 13)
  6713. {
  6714. loginMessage1 = "Could not complete login.";
  6715. loginMessage2 = "Please try using a different world.";
  6716. return;
  6717. }
  6718. if(k == 14)
  6719. {
  6720. loginMessage1 = "The server is being updated.";
  6721. loginMessage2 = "Please wait 1 minute and then try again.";
  6722. return;
  6723. }
  6724. if(k == 15)
  6725. {
  6726. loggedIn = true;
  6727. stream.currentOffset = 0;
  6728. inStream.currentOffset = 0;
  6729. pktType = -1;
  6730. anInt841 = -1;
  6731. anInt842 = -1;
  6732. anInt843 = -1;
  6733. pktSize = 0;
  6734. anInt1009 = 0;
  6735. anInt1104 = 0;
  6736. menuActionRow = 0;
  6737. menuOpen = false;
  6738. aLong824 = System.currentTimeMillis();
  6739. return;
  6740. }
  6741. if(k == 16)
  6742. {
  6743. loginMessage1 = "Login attempts exceeded.";
  6744. loginMessage2 = "Please wait 1 minute and try again.";
  6745. return;
  6746. }
  6747. if(k == 17)
  6748. {
  6749. loginMessage1 = "You are standing in a members-only area.";
  6750. loginMessage2 = "To play on this world move to a free area first";
  6751. return;
  6752. }
  6753. if(k == 20)
  6754. {
  6755. loginMessage1 = "Invalid loginserver requested";
  6756. loginMessage2 = "Please try using a different world.";
  6757. return;
  6758. }
  6759. if(k == 21)
  6760. {
  6761. for(int k1 = socketStream.read(); k1 >= 0; k1--)
  6762. {
  6763. loginMessage1 = "You have only just left another world.";
  6764. loginMessage2 = "Your profile will be transferred in: " + k1 + " seconds";
  6765. drawLoginScreen(true);
  6766. try
  6767. {
  6768. Thread.sleep(1000L);
  6769. }
  6770. catch(Exception _ex) { }
  6771. }
  6772.  
  6773. login(s, s1, flag);
  6774. return;
  6775. }
  6776. if(k == -1)
  6777. {
  6778. if(i1 == 0)
  6779. {
  6780. if(loginFailures < 2)
  6781. {
  6782. try
  6783. {
  6784. Thread.sleep(2000L);
  6785. }
  6786. catch(Exception _ex) { }
  6787. loginFailures++;
  6788. login(s, s1, flag);
  6789. return;
  6790. } else
  6791. {
  6792. loginMessage1 = "@red@Client has been updated!!";
  6793. loginMessage2 = "@red@Please download the new one from forums!";
  6794. return;
  6795. }
  6796. } else
  6797. {
  6798. loginMessage1 = "No response from server";
  6799. loginMessage2 = "Please try using a different world.";
  6800. return;
  6801. }
  6802. } else
  6803. {
  6804. System.out.println("response:" + k);
  6805. loginMessage1 = "Unexpected server response";
  6806. loginMessage2 = "Please try using a different world.";
  6807. return;
  6808. }
  6809. }
  6810. catch(IOException _ex)
  6811. {
  6812. loginMessage1 = "";
  6813. }
  6814. loginMessage2 = "Error connecting to server.";
  6815. }
  6816.  
  6817. private boolean doWalkTo(int i, int j, int k, int i1, int j1, int k1, int l1, int i2, int j2, boolean flag, int k2) {
  6818. byte byte0 = 104;
  6819. byte byte1 = 104;
  6820. for(int l2 = 0; l2 < byte0; l2++) {
  6821. for(int i3 = 0; i3 < byte1; i3++) {
  6822. anIntArrayArray901[l2][i3] = 0;
  6823. anIntArrayArray825[l2][i3] = 0x5f5e0ff;
  6824. }
  6825. }
  6826. int j3 = j2;
  6827. int k3 = j1;
  6828. anIntArrayArray901[j2][j1] = 99;
  6829. anIntArrayArray825[j2][j1] = 0;
  6830. int l3 = 0;
  6831. int i4 = 0;
  6832. bigX[l3] = j2;
  6833. bigY[l3++] = j1;
  6834. boolean flag1 = false;
  6835. int j4 = bigX.length;
  6836. int ai[][] = aClass11Array1230[plane].anIntArrayArray294;
  6837. while(i4 != l3)
  6838. {
  6839. j3 = bigX[i4];
  6840. k3 = bigY[i4];
  6841. i4 = (i4 + 1) % j4;
  6842. if(j3 == k2 && k3 == i2)
  6843. {
  6844. flag1 = true;
  6845. break;
  6846. }
  6847. if(i1 != 0)
  6848. {
  6849. if((i1 < 5 || i1 == 10) && aClass11Array1230[plane].method219(k2, j3, k3, j, i1 - 1, i2))
  6850. {
  6851. flag1 = true;
  6852. break;
  6853. }
  6854. if(i1 < 10 && aClass11Array1230[plane].method220(k2, i2, k3, i1 - 1, j, j3))
  6855. {
  6856. flag1 = true;
  6857. break;
  6858. }
  6859. }
  6860. if(k1 != 0 && k != 0 && aClass11Array1230[plane].method221(i2, k2, j3, k, l1, k1, k3))
  6861. {
  6862. flag1 = true;
  6863. break;
  6864. }
  6865. int l4 = anIntArrayArray825[j3][k3] + 1;
  6866. if(j3 > 0 && anIntArrayArray901[j3 - 1][k3] == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0)
  6867. {
  6868. bigX[l3] = j3 - 1;
  6869. bigY[l3] = k3;
  6870. l3 = (l3 + 1) % j4;
  6871. anIntArrayArray901[j3 - 1][k3] = 2;
  6872. anIntArrayArray825[j3 - 1][k3] = l4;
  6873. }
  6874. if(j3 < byte0 - 1 && anIntArrayArray901[j3 + 1][k3] == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0)
  6875. {
  6876. bigX[l3] = j3 + 1;
  6877. bigY[l3] = k3;
  6878. l3 = (l3 + 1) % j4;
  6879. anIntArrayArray901[j3 + 1][k3] = 8;
  6880. anIntArrayArray825[j3 + 1][k3] = l4;
  6881. }
  6882. if(k3 > 0 && anIntArrayArray901[j3][k3 - 1] == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0)
  6883. {
  6884. bigX[l3] = j3;
  6885. bigY[l3] = k3 - 1;
  6886. l3 = (l3 + 1) % j4;
  6887. anIntArrayArray901[j3][k3 - 1] = 1;
  6888. anIntArrayArray825[j3][k3 - 1] = l4;
  6889. }
  6890. if(k3 < byte1 - 1 && anIntArrayArray901[j3][k3 + 1] == 0 && (ai[j3][k3 + 1] & 0x1280120) == 0)
  6891. {
  6892. bigX[l3] = j3;
  6893. bigY[l3] = k3 + 1;
  6894. l3 = (l3 + 1) % j4;
  6895. anIntArrayArray901[j3][k3 + 1] = 4;
  6896. anIntArrayArray825[j3][k3 + 1] = l4;
  6897. }
  6898. 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)
  6899. {
  6900. bigX[l3] = j3 - 1;
  6901. bigY[l3] = k3 - 1;
  6902. l3 = (l3 + 1) % j4;
  6903. anIntArrayArray901[j3 - 1][k3 - 1] = 3;
  6904. anIntArrayArray825[j3 - 1][k3 - 1] = l4;
  6905. }
  6906. 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)
  6907. {
  6908. bigX[l3] = j3 + 1;
  6909. bigY[l3] = k3 - 1;
  6910. l3 = (l3 + 1) % j4;
  6911. anIntArrayArray901[j3 + 1][k3 - 1] = 9;
  6912. anIntArrayArray825[j3 + 1][k3 - 1] = l4;
  6913. }
  6914. 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)
  6915. {
  6916. bigX[l3] = j3 - 1;
  6917. bigY[l3] = k3 + 1;
  6918. l3 = (l3 + 1) % j4;
  6919. anIntArrayArray901[j3 - 1][k3 + 1] = 6;
  6920. anIntArrayArray825[j3 - 1][k3 + 1] = l4;
  6921. }
  6922. 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)
  6923. {
  6924. bigX[l3] = j3 + 1;
  6925. bigY[l3] = k3 + 1;
  6926. l3 = (l3 + 1) % j4;
  6927. anIntArrayArray901[j3 + 1][k3 + 1] = 12;
  6928. anIntArrayArray825[j3 + 1][k3 + 1] = l4;
  6929. }
  6930. }
  6931. anInt1264 = 0;
  6932. if(!flag1)
  6933. {
  6934. if(flag)
  6935. {
  6936. int i5 = 100;
  6937. for(int k5 = 1; k5 < 2; k5++)
  6938. {
  6939. for(int i6 = k2 - k5; i6 <= k2 + k5; i6++)
  6940. {
  6941. for(int l6 = i2 - k5; l6 <= i2 + k5; l6++)
  6942. if(i6 >= 0 && l6 >= 0 && i6 < 104 && l6 < 104 && anIntArrayArray825[i6][l6] < i5)
  6943. {
  6944. i5 = anIntArrayArray825[i6][l6];
  6945. j3 = i6;
  6946. k3 = l6;
  6947. anInt1264 = 1;
  6948. flag1 = true;
  6949. }
  6950.  
  6951. }
  6952.  
  6953. if(flag1)
  6954. break;
  6955. }
  6956.  
  6957. }
  6958. if(!flag1)
  6959. return false;
  6960. }
  6961. i4 = 0;
  6962. bigX[i4] = j3;
  6963. bigY[i4++] = k3;
  6964. int l5;
  6965. for(int j5 = l5 = anIntArrayArray901[j3][k3]; j3 != j2 || k3 != j1; j5 = anIntArrayArray901[j3][k3])
  6966. {
  6967. if(j5 != l5)
  6968. {
  6969. l5 = j5;
  6970. bigX[i4] = j3;
  6971. bigY[i4++] = k3;
  6972. }
  6973. if((j5 & 2) != 0)
  6974. j3++;
  6975. else
  6976. if((j5 & 8) != 0)
  6977. j3--;
  6978. if((j5 & 1) != 0)
  6979. k3++;
  6980. else
  6981. if((j5 & 4) != 0)
  6982. k3--;
  6983. }
  6984. // if(cancelWalk) { return i4 > 0; }
  6985.  
  6986.  
  6987. if(i4 > 0)
  6988. {
  6989. int k4 = i4;
  6990. if(k4 > 25)
  6991. k4 = 25;
  6992. i4--;
  6993. int k6 = bigX[i4];
  6994. int i7 = bigY[i4];
  6995. anInt1288 += k4;
  6996. if(anInt1288 >= 92)
  6997. {
  6998. stream.createFrame(36);
  6999. stream.writeDWord(0);
  7000. anInt1288 = 0;
  7001. }
  7002. if(i == 0)
  7003. {
  7004. stream.createFrame(164);
  7005. stream.writeWordBigEndian(k4 + k4 + 3);
  7006. }
  7007. if(i == 1)
  7008. {
  7009. stream.createFrame(248);
  7010. stream.writeWordBigEndian(k4 + k4 + 3 + 14);
  7011. }
  7012. if(i == 2)
  7013. {
  7014. stream.createFrame(98);
  7015. stream.writeWordBigEndian(k4 + k4 + 3);
  7016. }
  7017. stream.method433(k6 + baseX);
  7018. destX = bigX[0];
  7019. destY = bigY[0];
  7020. for(int j7 = 1; j7 < k4; j7++)
  7021. {
  7022. i4--;
  7023. stream.writeWordBigEndian(bigX[i4] - k6);
  7024. stream.writeWordBigEndian(bigY[i4] - i7);
  7025. }
  7026.  
  7027. stream.method431(i7 + baseY);
  7028. stream.method424(super.keyArray[5] != 1 ? 0 : 1);
  7029. return true;
  7030. }
  7031. return i != 1;
  7032. }
  7033.  
  7034. private void method86(Stream stream)
  7035. {
  7036. for(int j = 0; j < anInt893; j++)
  7037. {
  7038. int k = anIntArray894[j];
  7039. NPC npc = npcArray[k];
  7040. int l = stream.readUnsignedByte();
  7041. if((l & 0x10) != 0)
  7042. {
  7043. int i1 = stream.method434();
  7044. if(i1 == 65535)
  7045. i1 = -1;
  7046. int i2 = stream.readUnsignedByte();
  7047. if(i1 == npc.anim && i1 != -1)
  7048. {
  7049. int l2 = Animation.anims[i1].anInt365;
  7050. if(l2 == 1)
  7051. {
  7052. npc.anInt1527 = 0;
  7053. npc.anInt1528 = 0;
  7054. npc.anInt1529 = i2;
  7055. npc.anInt1530 = 0;
  7056. }
  7057. if(l2 == 2)
  7058. npc.anInt1530 = 0;
  7059. } else
  7060. if(i1 == -1 || npc.anim == -1 || Animation.anims[i1].anInt359 >= Animation.anims[npc.anim].anInt359)
  7061. {
  7062. npc.anim = i1;
  7063. npc.anInt1527 = 0;
  7064. npc.anInt1528 = 0;
  7065. npc.anInt1529 = i2;
  7066. npc.anInt1530 = 0;
  7067. npc.anInt1542 = npc.smallXYIndex;
  7068. }
  7069. }
  7070. if((l & 8) != 0)
  7071. {
  7072. int j1 = stream.method426();
  7073. int j2 = stream.method427();
  7074. npc.updateHitData(j2, j1, loopCycle);
  7075. npc.loopCycleStatus = loopCycle + 300;
  7076. npc.currentHealth = stream.method426();
  7077. npc.maxHealth = stream.readUnsignedByte();
  7078. }
  7079. if((l & 0x80) != 0)
  7080. {
  7081. npc.anInt1520 = stream.readUnsignedWord();
  7082. int k1 = stream.readDWord();
  7083. npc.anInt1524 = k1 >> 16;
  7084. npc.anInt1523 = loopCycle + (k1 & 0xffff);
  7085. npc.anInt1521 = 0;
  7086. npc.anInt1522 = 0;
  7087. if(npc.anInt1523 > loopCycle)
  7088. npc.anInt1521 = -1;
  7089. if(npc.anInt1520 == 65535)
  7090. npc.anInt1520 = -1;
  7091. }
  7092. if((l & 0x20) != 0)
  7093. {
  7094. npc.interactingEntity = stream.readUnsignedWord();
  7095. if(npc.interactingEntity == 65535)
  7096. npc.interactingEntity = -1;
  7097. }
  7098. if((l & 1) != 0)
  7099. {
  7100. npc.textSpoken = stream.readString();
  7101. npc.textCycle = 100;
  7102. // entityMessage(npc);
  7103.  
  7104. }
  7105. if((l & 0x40) != 0)
  7106. {
  7107. int l1 = stream.method427();
  7108. int k2 = stream.method428();
  7109. npc.updateHitData(k2, l1, loopCycle);
  7110. npc.loopCycleStatus = loopCycle + 300;
  7111. npc.currentHealth = stream.method428();
  7112. npc.maxHealth = stream.method427();
  7113. }
  7114. if((l & 2) != 0)
  7115. {
  7116. npc.desc = EntityDef.forID(stream.method436());
  7117. npc.anInt1540 = npc.desc.aByte68;
  7118. npc.anInt1504 = npc.desc.anInt79;
  7119. npc.anInt1554 = npc.desc.walkAnim;
  7120. npc.anInt1555 = npc.desc.anInt58;
  7121. npc.anInt1556 = npc.desc.anInt83;
  7122. npc.anInt1557 = npc.desc.anInt55;
  7123. npc.anInt1511 = npc.desc.standAnim;
  7124. }
  7125. if((l & 4) != 0)
  7126. {
  7127. npc.anInt1538 = stream.method434();
  7128. npc.anInt1539 = stream.method434();
  7129. }
  7130. }
  7131. }
  7132.  
  7133. private void buildAtNPCMenu(EntityDef entityDef, int i, int j, int k)
  7134. {
  7135. if(menuActionRow >= 400)
  7136. return;
  7137. if(entityDef.childrenIDs != null)
  7138. entityDef = entityDef.method161();
  7139. if(entityDef == null)
  7140. return;
  7141. if(!entityDef.aBoolean84)
  7142. return;
  7143. String s = entityDef.name;
  7144. if(entityDef.combatLevel != 0)
  7145. s = s + combatDiffColor(myPlayer.combatLevel, entityDef.combatLevel) + " (level-" + entityDef.combatLevel + ")";
  7146. if(itemSelected == 1)
  7147. {
  7148. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @yel@" + s;
  7149. menuActionID[menuActionRow] = 582;
  7150. menuActionCmd1[menuActionRow] = i;
  7151. menuActionCmd2[menuActionRow] = k;
  7152. menuActionCmd3[menuActionRow] = j;
  7153. menuActionRow++;
  7154. return;
  7155. }
  7156. if(spellSelected == 1)
  7157. {
  7158. if((spellUsableOn & 2) == 2)
  7159. {
  7160. menuActionName[menuActionRow] = spellTooltip + " @yel@" + s;
  7161. menuActionID[menuActionRow] = 413;
  7162. menuActionCmd1[menuActionRow] = i;
  7163. menuActionCmd2[menuActionRow] = k;
  7164. menuActionCmd3[menuActionRow] = j;
  7165. menuActionRow++;
  7166. }
  7167. } else
  7168. {
  7169. if(entityDef.actions != null)
  7170. {
  7171. for(int l = 4; l >= 0; l--)
  7172. if(entityDef.actions[l] != null && !entityDef.actions[l].equalsIgnoreCase("attack"))
  7173. {
  7174. menuActionName[menuActionRow] = entityDef.actions[l] + " @yel@" + s;
  7175. if(l == 0)
  7176. menuActionID[menuActionRow] = 20;
  7177. if(l == 1)
  7178. menuActionID[menuActionRow] = 412;
  7179. if(l == 2)
  7180. menuActionID[menuActionRow] = 225;
  7181. if(l == 3)
  7182. menuActionID[menuActionRow] = 965;
  7183. if(l == 4)
  7184. menuActionID[menuActionRow] = 478;
  7185. menuActionCmd1[menuActionRow] = i;
  7186. menuActionCmd2[menuActionRow] = k;
  7187. menuActionCmd3[menuActionRow] = j;
  7188. menuActionRow++;
  7189. }
  7190.  
  7191. }
  7192. if(entityDef.actions != null)
  7193. {
  7194. for(int i1 = 4; i1 >= 0; i1--)
  7195. if(entityDef.actions[i1] != null && entityDef.actions[i1].equalsIgnoreCase("attack"))
  7196. {
  7197. char c = '\0';
  7198. if(entityDef.combatLevel > myPlayer.combatLevel)
  7199. c = '\u07D0';
  7200. menuActionName[menuActionRow] = entityDef.actions[i1] + " @yel@" + s;
  7201. if(i1 == 0)
  7202. menuActionID[menuActionRow] = 20 + c;
  7203. if(i1 == 1)
  7204. menuActionID[menuActionRow] = 412 + c;
  7205. if(i1 == 2)
  7206. menuActionID[menuActionRow] = 225 + c;
  7207. if(i1 == 3)
  7208. menuActionID[menuActionRow] = 965 + c;
  7209. if(i1 == 4)
  7210. menuActionID[menuActionRow] = 478 + c;
  7211. menuActionCmd1[menuActionRow] = i;
  7212. menuActionCmd2[menuActionRow] = k;
  7213. menuActionCmd3[menuActionRow] = j;
  7214. menuActionRow++;
  7215. }
  7216.  
  7217. }
  7218. //menuActionName[menuActionRow] = "Examine @yel@" + s + " @gre@(@whi@" + entityDef.type + "@gre@)";
  7219. menuActionName[menuActionRow] = "Examine @yel@" + s;
  7220. menuActionID[menuActionRow] = 1025;
  7221. menuActionCmd1[menuActionRow] = i;
  7222. menuActionCmd2[menuActionRow] = k;
  7223. menuActionCmd3[menuActionRow] = j;
  7224. menuActionRow++;
  7225. }
  7226. }
  7227.  
  7228. private void buildAtPlayerMenu(int i, int j, Player player, int k)
  7229. {
  7230. if(player == myPlayer)
  7231. return;
  7232. if(menuActionRow >= 400)
  7233. return;
  7234. String s;
  7235. if(player.skill == 0)
  7236. s = player.name + combatDiffColor(myPlayer.combatLevel, player.combatLevel) + " (level-" + player.combatLevel + ")";
  7237. else
  7238. s = player.name + " (skill-" + player.skill + ")";
  7239. if(itemSelected == 1)
  7240. {
  7241. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @whi@" + s;
  7242. menuActionID[menuActionRow] = 491;
  7243. menuActionCmd1[menuActionRow] = j;
  7244. menuActionCmd2[menuActionRow] = i;
  7245. menuActionCmd3[menuActionRow] = k;
  7246. menuActionRow++;
  7247. } else
  7248. if(spellSelected == 1)
  7249. {
  7250. if((spellUsableOn & 8) == 8)
  7251. {
  7252. menuActionName[menuActionRow] = spellTooltip + " @whi@" + s;
  7253. menuActionID[menuActionRow] = 365;
  7254. menuActionCmd1[menuActionRow] = j;
  7255. menuActionCmd2[menuActionRow] = i;
  7256. menuActionCmd3[menuActionRow] = k;
  7257. menuActionRow++;
  7258. }
  7259. } else
  7260. {
  7261. for(int l = 4; l >= 0; l--)
  7262. if(atPlayerActions[l] != null)
  7263. {
  7264. menuActionName[menuActionRow] = atPlayerActions[l] + " @whi@" + s;
  7265. char c = '\0';
  7266. if(atPlayerActions[l].equalsIgnoreCase("attack"))
  7267. {
  7268. if(player.combatLevel > myPlayer.combatLevel)
  7269. c = '\u07D0';
  7270. if(myPlayer.team != 0 && player.team != 0)
  7271. if(myPlayer.team == player.team)
  7272. c = '\u07D0';
  7273. else
  7274. c = '\0';
  7275. } else
  7276. if(atPlayerArray[l])
  7277. c = '\u07D0';
  7278. if(l == 0)
  7279. menuActionID[menuActionRow] = 561 + c;
  7280. if(l == 1)
  7281. menuActionID[menuActionRow] = 779 + c;
  7282. if(l == 2)
  7283. menuActionID[menuActionRow] = 27 + c;
  7284. if(l == 3)
  7285. menuActionID[menuActionRow] = 577 + c;
  7286. if(l == 4)
  7287. menuActionID[menuActionRow] = 729 + c;
  7288. menuActionCmd1[menuActionRow] = j;
  7289. menuActionCmd2[menuActionRow] = i;
  7290. menuActionCmd3[menuActionRow] = k;
  7291. menuActionRow++;
  7292. }
  7293.  
  7294. }
  7295. for(int i1 = 0; i1 < menuActionRow; i1++)
  7296. if(menuActionID[i1] == 516)
  7297. {
  7298. menuActionName[i1] = "Walk here @whi@" + s;
  7299. return;
  7300. }
  7301.  
  7302. }
  7303.  
  7304. private void method89(Class30_Sub1 class30_sub1)
  7305. {
  7306. int i = 0;
  7307. int j = -1;
  7308. int k = 0;
  7309. int l = 0;
  7310. if(class30_sub1.anInt1296 == 0)
  7311. i = worldController.method300(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7312. if(class30_sub1.anInt1296 == 1)
  7313. i = worldController.method301(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7314. if(class30_sub1.anInt1296 == 2)
  7315. i = worldController.method302(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7316. if(class30_sub1.anInt1296 == 3)
  7317. i = worldController.method303(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7318. if(i != 0)
  7319. {
  7320. int i1 = worldController.method304(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298, i);
  7321. j = i >> 14 & 0x7fff;
  7322. k = i1 & 0x1f;
  7323. l = i1 >> 6;
  7324. }
  7325. class30_sub1.anInt1299 = j;
  7326. class30_sub1.anInt1301 = k;
  7327. class30_sub1.anInt1300 = l;
  7328. }
  7329.  
  7330. private void method90()
  7331. {
  7332. for(int i = 0; i < anInt1062; i++)
  7333. if(anIntArray1250[i] <= 0)
  7334. {
  7335. boolean flag1 = false;
  7336. try
  7337. {
  7338. if(anIntArray1207[i] == anInt874 && anIntArray1241[i] == anInt1289)
  7339. {
  7340. if(!replayWave())
  7341. flag1 = true;
  7342. } else
  7343. {
  7344. Stream stream = Sounds.method241(anIntArray1241[i], anIntArray1207[i]);
  7345. if(System.currentTimeMillis() + (long)(stream.currentOffset / 22) > aLong1172 + (long)(anInt1257 / 22))
  7346. {
  7347. anInt1257 = stream.currentOffset;
  7348. aLong1172 = System.currentTimeMillis();
  7349. if(saveWave(stream.buffer, stream.currentOffset))
  7350. {
  7351. anInt874 = anIntArray1207[i];
  7352. anInt1289 = anIntArray1241[i];
  7353. } else
  7354. {
  7355. flag1 = true;
  7356. }
  7357. }
  7358. }
  7359. }
  7360. catch(Exception exception) { }
  7361. if(!flag1 || anIntArray1250[i] == -5)
  7362. {
  7363. anInt1062--;
  7364. for(int j = i; j < anInt1062; j++)
  7365. {
  7366. anIntArray1207[j] = anIntArray1207[j + 1];
  7367. anIntArray1241[j] = anIntArray1241[j + 1];
  7368. anIntArray1250[j] = anIntArray1250[j + 1];
  7369. }
  7370.  
  7371. i--;
  7372. } else
  7373. {
  7374. anIntArray1250[i] = -5;
  7375. }
  7376. } else
  7377. {
  7378. anIntArray1250[i]--;
  7379. }
  7380.  
  7381. if(prevSong > 0)
  7382. {
  7383. prevSong -= 20;
  7384. if(prevSong < 0)
  7385. prevSong = 0;
  7386. if(prevSong == 0 && musicEnabled && !lowMem)
  7387. {
  7388. nextSong = currentSong;
  7389. songChanging = true;
  7390. onDemandFetcher.method558(2, nextSong);
  7391. }
  7392. }
  7393. }
  7394.  
  7395. void startUp()
  7396. {
  7397. drawLoadingText(20, "Starting up");
  7398. new CacheDownloader(this).downloadCache();
  7399. if(signlink.sunjava)
  7400. super.minDelay = 5;
  7401. if(aBoolean993)
  7402. {
  7403. // rsAlreadyLoaded = true;
  7404. // return;
  7405. }
  7406. aBoolean993 = true;
  7407. boolean flag = true;
  7408. String s = getDocumentBaseHost();
  7409. if(signlink.cache_dat != null)
  7410. {
  7411. for(int i = 0; i < 5; i++)
  7412. decompressors[i] = new Decompressor(signlink.cache_dat, signlink.cache_idx[i], i + 1);
  7413. } try {
  7414. titleStreamLoader = streamLoaderForName(1, "title screen", "title", expectedCRCs[1], 25);
  7415. smallText = new TextDrawingArea(false, "p11_full", titleStreamLoader);
  7416. aTextDrawingArea_1271 = new TextDrawingArea(false, "p12_full", titleStreamLoader);
  7417. chatTextDrawingArea = new TextDrawingArea(false, "b12_full", titleStreamLoader);
  7418. TextDrawingArea aTextDrawingArea_1273 = new TextDrawingArea(true, "q8_full", titleStreamLoader);
  7419. drawLogo();
  7420. loadTitleScreen();
  7421. StreamLoader streamLoader = streamLoaderForName(2, "config", "config", expectedCRCs[2], 30);
  7422. StreamLoader streamLoader_1 = streamLoaderForName(3, "interface", "interface", expectedCRCs[3], 35);
  7423. StreamLoader streamLoader_2 = streamLoaderForName(4, "2d graphics", "media", expectedCRCs[4], 40);
  7424. StreamLoader streamLoader_3 = streamLoaderForName(6, "textures", "textures", expectedCRCs[6], 45);
  7425. StreamLoader streamLoader_4 = streamLoaderForName(7, "chat system", "wordenc", expectedCRCs[7], 50);
  7426. StreamLoader streamLoader_5 = streamLoaderForName(8, "sound effects", "sounds", expectedCRCs[8], 55);
  7427. byteGroundArray = new byte[4][104][104];
  7428. intGroundArray = new int[4][105][105];
  7429. worldController = new WorldController(intGroundArray);
  7430. for(int j = 0; j < 4; j++)
  7431. aClass11Array1230[j] = new Class11();
  7432.  
  7433. aClass30_Sub2_Sub1_Sub1_1263 = new Sprite(512, 512);
  7434. StreamLoader streamLoader_6 = streamLoaderForName(5, "update list", "versionlist", expectedCRCs[5], 60);
  7435. drawLoadingText(60, "Connecting to update server");
  7436. onDemandFetcher = new OnDemandFetcher();
  7437. onDemandFetcher.start(streamLoader_6, this);
  7438. Class36.method528(onDemandFetcher.getAnimCount());
  7439. Model.method459(onDemandFetcher.getVersionCount(0), onDemandFetcher);
  7440. ModelDecompressor.loadModels();
  7441. ModelDecompressor.loadModels2();
  7442. preloadModels();
  7443. if(!lowMem)
  7444. {
  7445. nextSong = 0;
  7446. try
  7447. {
  7448. nextSong = Integer.parseInt(getParameter("music"));
  7449. }
  7450. catch(Exception _ex) { }
  7451. songChanging = true;
  7452. onDemandFetcher.method558(2, nextSong);
  7453. while(onDemandFetcher.getNodeCount() > 0)
  7454. {
  7455. processOnDemandQueue();
  7456. try
  7457. {
  7458. Thread.sleep(100L);
  7459. }
  7460. catch(Exception _ex) { }
  7461. if(onDemandFetcher.anInt1349 > 3)
  7462. {
  7463. loadError();
  7464. return;
  7465. }
  7466. }
  7467. }
  7468. drawLoadingText(65, "Requesting animations");
  7469. int k = onDemandFetcher.getVersionCount(1);
  7470. for(int i1 = 0; i1 < k; i1++)
  7471. onDemandFetcher.method558(1, i1);
  7472.  
  7473. while(onDemandFetcher.getNodeCount() > 0)
  7474. {
  7475. int j1 = k - onDemandFetcher.getNodeCount();
  7476. if(j1 > 0)
  7477. drawLoadingText(65, "Loading animations - " + (j1 * 100) / k + "%");
  7478. processOnDemandQueue();
  7479. try
  7480. {
  7481. Thread.sleep(100L);
  7482. }
  7483. catch(Exception _ex) { }
  7484. if(onDemandFetcher.anInt1349 > 3)
  7485. {
  7486. loadError();
  7487. return;
  7488. }
  7489. }
  7490. drawLoadingText(70, "Requesting models");
  7491. k = onDemandFetcher.getVersionCount(0);
  7492. for(int k1 = 0; k1 < k; k1++)
  7493. {
  7494. int l1 = onDemandFetcher.getModelIndex(k1);
  7495. if((l1 & 1) != 0)
  7496. onDemandFetcher.method558(0, k1);
  7497. }
  7498.  
  7499. k = onDemandFetcher.getNodeCount();
  7500. while(onDemandFetcher.getNodeCount() > 0)
  7501. {
  7502. int i2 = k - onDemandFetcher.getNodeCount();
  7503. if(i2 > 0)
  7504. drawLoadingText(70, "Loading models - " + (i2 * 100) / k + "%");
  7505. processOnDemandQueue();
  7506. try
  7507. {
  7508. Thread.sleep(100L);
  7509. }
  7510. catch(Exception _ex) { }
  7511. }
  7512. if(decompressors[0] != null)
  7513. {
  7514. drawLoadingText(75, "Requesting maps");
  7515. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 47));
  7516. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 47));
  7517. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 48));
  7518. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 48));
  7519. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 49));
  7520. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 49));
  7521. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 47, 47));
  7522. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 47, 47));
  7523. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 47, 48));
  7524. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 47, 48));
  7525. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 148, 48));
  7526. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 148, 48));
  7527. k = onDemandFetcher.getNodeCount();
  7528. while(onDemandFetcher.getNodeCount() > 0)
  7529. {
  7530. int j2 = k - onDemandFetcher.getNodeCount();
  7531. if(j2 > 0)
  7532. drawLoadingText(75, "Loading maps - " + (j2 * 100) / k + "%");
  7533. processOnDemandQueue();
  7534. try
  7535. {
  7536. Thread.sleep(100L);
  7537. }
  7538. catch(Exception _ex) { }
  7539. }
  7540. }
  7541. k = onDemandFetcher.getVersionCount(0);
  7542. for(int k2 = 0; k2 < k; k2++)
  7543. {
  7544. int l2 = onDemandFetcher.getModelIndex(k2);
  7545. byte byte0 = 0;
  7546. if((l2 & 8) != 0)
  7547. byte0 = 10;
  7548. else
  7549. if((l2 & 0x20) != 0)
  7550. byte0 = 9;
  7551. else
  7552. if((l2 & 0x10) != 0)
  7553. byte0 = 8;
  7554. else
  7555. if((l2 & 0x40) != 0)
  7556. byte0 = 7;
  7557. else
  7558. if((l2 & 0x80) != 0)
  7559. byte0 = 6;
  7560. else
  7561. if((l2 & 2) != 0)
  7562. byte0 = 5;
  7563. else
  7564. if((l2 & 4) != 0)
  7565. byte0 = 4;
  7566. if((l2 & 1) != 0)
  7567. byte0 = 3;
  7568. if(byte0 != 0)
  7569. onDemandFetcher.method563(byte0, 0, k2);
  7570. }
  7571.  
  7572. onDemandFetcher.method554(isMembers);
  7573. if(!lowMem)
  7574. {
  7575. int l = onDemandFetcher.getVersionCount(2);
  7576. for(int i3 = 1; i3 < l; i3++)
  7577. if(onDemandFetcher.method569(i3))
  7578. onDemandFetcher.method563((byte)1, 2, i3);
  7579.  
  7580. }
  7581. drawLoadingText(80, "Unpacking media");
  7582. /* Custom sprite unpacking */
  7583. emptyOrb = new Sprite("emptyorb");
  7584. hoverOrb = new Sprite("hoverorb");
  7585. hoverorbrun2 = new Sprite("hoverorbrun2");
  7586. hoverorbrun = new Sprite("hoverorbrun");
  7587. runClick = new Sprite("runclick");
  7588. runorb = new Sprite("runorb");
  7589. HPBarFull = new Sprite(sign.signlink.findcachedir() + "Sprites/HITPOINTS_0.PNG", 1);
  7590. HPBarEmpty = new Sprite(sign.signlink.findcachedir() + "Sprites/HITPOINTS_1.PNG", 1);
  7591. hitPointsFill = new Sprite("hitpointsfill");
  7592. prayerFill = new Sprite("prayerfill");
  7593. worldMapIcon = new Sprite("mapicon");
  7594. logIconH = new Sprite("logiconh");
  7595. logIconC = new Sprite("logiconc");
  7596. for(int i = 1; i <= 15; i++) {
  7597. ORBS[i] = new Sprite("Gameframe/Orbs/ORBS "+i+"");
  7598. }
  7599. chatArea = new Sprite("chatarea");
  7600. tabArea = new Sprite("tabarea");
  7601. mapArea = new Sprite("maparea");
  7602. multiOverlay = new Sprite(streamLoader_2, "overlay_multiway", 0);
  7603. /**/
  7604. mapBack = new Background(streamLoader_2, "mapback", 0);
  7605. for(int c1 = 0; c1 <= 3; c1++)
  7606. chatButtons[c1] = new Sprite(streamLoader_2, "chatbuttons", c1);
  7607. for(int j3 = 0; j3 <= 14; j3++)
  7608. sideIcons[j3] = new Sprite(streamLoader_2, "sideicons", j3);
  7609. for(int r1 = 0; r1 < 5; r1++)
  7610. redStones[r1] = new Sprite("redstones " + r1);
  7611. compass = new Sprite(streamLoader_2, "compass", 0);
  7612. mapEdge = new Sprite(streamLoader_2, "mapedge", 0);
  7613. mapEdge.method345();
  7614. try
  7615. {
  7616. for(int k3 = 0; k3 < 100; k3++)
  7617. mapScenes[k3] = new Background(streamLoader_2, "mapscene", k3);
  7618. }
  7619. catch(Exception _ex) { }
  7620. try
  7621. {
  7622. for(int l3 = 0; l3 < 100; l3++)
  7623. mapFunctions[l3] = new Sprite(streamLoader_2, "mapfunction", l3);
  7624. }
  7625. catch(Exception _ex) { }
  7626. try
  7627. {
  7628. for(int i4 = 0; i4 < 20; i4++)
  7629. hitMarks[i4] = new Sprite(streamLoader_2, "hitmarks", i4);
  7630. }
  7631. catch(Exception _ex) { }
  7632. try
  7633. {
  7634. for(int h1 = 0; h1 < 6; h1++)
  7635. headIconsHint[h1] = new Sprite(streamLoader_2, "headicons_hint", h1);
  7636. } catch(Exception _ex) { }
  7637. try {
  7638. for(int j4 = 0; j4 < 8; j4++)
  7639. headIcons[j4] = new Sprite(streamLoader_2, "headicons_prayer", j4);
  7640. for(int j45 = 0; j45 < 3; j45++)
  7641. skullIcons[j45] = new Sprite(streamLoader_2, "headicons_pk", j45 );
  7642. }
  7643. catch(Exception _ex) { }
  7644. mapFlag = new Sprite(streamLoader_2, "mapmarker", 0);
  7645. mapMarker = new Sprite(streamLoader_2, "mapmarker", 1);
  7646. for(int k4 = 0; k4 < 8; k4++)
  7647. crosses[k4] = new Sprite(streamLoader_2, "cross", k4);
  7648.  
  7649. mapDotItem = new Sprite(streamLoader_2, "mapdots", 0);
  7650. mapDotNPC = new Sprite(streamLoader_2, "mapdots", 1);
  7651. mapDotPlayer = new Sprite(streamLoader_2, "mapdots", 2);
  7652. mapDotFriend = new Sprite(streamLoader_2, "mapdots", 3);
  7653. mapDotTeam = new Sprite(streamLoader_2, "mapdots", 4);
  7654. mapDotClan = new Sprite(streamLoader_2, "mapdots", 5);
  7655. scrollBar1 = new Sprite(streamLoader_2, "scrollbar", 0);
  7656. scrollBar2 = new Sprite(streamLoader_2, "scrollbar", 1);
  7657.  
  7658. for(int l4 = 0; l4 < 2; l4++)
  7659. modIcons[l4] = new Background(streamLoader_2, "mod_icons", l4);
  7660.  
  7661. Sprite sprite = new Sprite(streamLoader_2, "screenframe", 0);
  7662. leftFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  7663. sprite.method346(0, 0);
  7664. sprite = new Sprite(streamLoader_2, "screenframe", 1);
  7665. topFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  7666. sprite.method346(0, 0);
  7667. sprite = new Sprite(streamLoader_2, "screenframe", 2);
  7668. rightFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  7669. sprite.method346(0, 0);
  7670. sprite = new Sprite(streamLoader_2, "mapedge", 0);
  7671. mapEdgeIP = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  7672. sprite.method346(0, 0);
  7673.  
  7674. int i5 = (int)(Math.random() * 21D) - 10;
  7675. int j5 = (int)(Math.random() * 21D) - 10;
  7676. int k5 = (int)(Math.random() * 21D) - 10;
  7677. int l5 = (int)(Math.random() * 41D) - 20;
  7678. for(int i6 = 0; i6 < 100; i6++)
  7679. {
  7680. if(mapFunctions[i6] != null)
  7681. mapFunctions[i6].method344(i5 + l5, j5 + l5, k5 + l5);
  7682. if(mapScenes[i6] != null)
  7683. mapScenes[i6].method360(i5 + l5, j5 + l5, k5 + l5);
  7684. }
  7685.  
  7686. drawLoadingText(83, "Unpacking textures");
  7687. Texture.method368(streamLoader_3);
  7688. Texture.method372(0.80000000000000004D);
  7689. Texture.method367();
  7690. drawLoadingText(86, "Unpacking config");
  7691. Animation.unpackConfig(streamLoader);
  7692. ObjectDef.unpackConfig(streamLoader);
  7693. Flo.unpackConfig(streamLoader);
  7694. ItemDef.unpackConfig(streamLoader);
  7695. EntityDef.unpackConfig(streamLoader);
  7696. IDK.unpackConfig(streamLoader);
  7697. SpotAnim.unpackConfig(streamLoader);
  7698. Varp.unpackConfig(streamLoader);
  7699. VarBit.unpackConfig(streamLoader);
  7700. ItemDef.isMembers = isMembers;
  7701. if(!lowMem)
  7702. {
  7703. drawLoadingText(90, "Unpacking sounds");
  7704. byte abyte0[] = streamLoader_5.getDataForName("sounds.dat");
  7705. Stream stream = new Stream(abyte0);
  7706. Sounds.unpack(stream);
  7707. }
  7708. drawLoadingText(95, "Unpacking interfaces");
  7709. TextDrawingArea aclass30_sub2_sub1_sub4s[] = {
  7710. smallText, aTextDrawingArea_1271, chatTextDrawingArea, aTextDrawingArea_1273
  7711. };
  7712. RSInterface.unpack(streamLoader_1, aclass30_sub2_sub1_sub4s, streamLoader_2);
  7713. drawLoadingText(100, "Preparing game engine");
  7714. for(int j6 = 0; j6 < 33; j6++)
  7715. {
  7716. int k6 = 999;
  7717. int i7 = 0;
  7718. for(int k7 = 0; k7 < 34; k7++)
  7719. {
  7720. if(mapBack.aByteArray1450[k7 + j6 * mapBack.anInt1452] == 0)
  7721. {
  7722. if(k6 == 999)
  7723. k6 = k7;
  7724. continue;
  7725. }
  7726. if(k6 == 999)
  7727. continue;
  7728. i7 = k7;
  7729. break;
  7730. }
  7731.  
  7732. anIntArray968[j6] = k6;
  7733. anIntArray1057[j6] = i7 - k6;
  7734. }
  7735.  
  7736. for(int l6 = 5; l6 < 156; l6++)
  7737. {
  7738. int j7 = 999;
  7739. int l7 = 0;
  7740. for(int j8 = 25; j8 < 172; j8++)
  7741. {
  7742. if(mapBack.aByteArray1450[j8 + l6 * mapBack.anInt1452] == 0 && (j8 > 34 || l6 > 34))
  7743. {
  7744. if(j7 == 999)
  7745. j7 = j8;
  7746. continue;
  7747. }
  7748. if(j7 == 999)
  7749. continue;
  7750. l7 = j8;
  7751. break;
  7752. }
  7753.  
  7754. anIntArray1052[l6 - 5] = j7 - 25;
  7755. anIntArray1229[l6 - 5] = l7 - j7;
  7756. }
  7757.  
  7758. Texture.method365(765, 503);
  7759. fullScreenTextureArray = Texture.anIntArray1472;
  7760. Texture.method365(519, 165);
  7761. anIntArray1180 = Texture.anIntArray1472;
  7762. Texture.method365(246, 335);
  7763. anIntArray1181 = Texture.anIntArray1472;
  7764. Texture.method365(512, 334);
  7765. anIntArray1182 = Texture.anIntArray1472;
  7766. int ai[] = new int[9];
  7767. for(int i8 = 0; i8 < 9; i8++)
  7768. {
  7769. int k8 = 128 + i8 * 32 + 15;
  7770. int l8 = 600 + k8 * 3;
  7771. int i9 = Texture.anIntArray1470[k8];
  7772. ai[i8] = l8 * i9 >> 16;
  7773. }
  7774.  
  7775. WorldController.method310(500, 800, 512, 334, ai);
  7776. Censor.loadConfig(streamLoader_4);
  7777. mouseDetection = new MouseDetection(this);
  7778. startRunnable(mouseDetection, 10);
  7779. Animable_Sub5.clientInstance = this;
  7780. ObjectDef.clientInstance = this;
  7781. EntityDef.clientInstance = this;
  7782. return;
  7783. }
  7784. catch(Exception exception)
  7785. {
  7786. signlink.reporterror("loaderror " + aString1049 + " " + anInt1079);
  7787. }
  7788. loadingError = true;
  7789. }
  7790. public void drawRunOrb(){
  7791. String OD = "./Sprites/Gameframe/Orbs/";
  7792. ORBS[0] = new Sprite(OD + "ORBS 0.png", 27, getOrbFill(100));
  7793. if(energy != 100){
  7794. ORBS[0].drawSprite(193, 95);
  7795. }
  7796. runClicked = anIntArray1045[173] == 1;
  7797. Resting = anIntArray1045[174] == 1;
  7798. ORBS[runHover ? 7 : 1].drawSprite(190, 92);
  7799. ORBS[runClicked ? 11 : 10].drawSprite(193, 95);
  7800. if(!Resting)
  7801. ORBS[runClicked ? 9 : 8].drawSprite(200, 100);
  7802. else
  7803. ORBS[Resting ? 12 : 8].drawSprite(200, 100);
  7804. String currentEnergy = RSInterface.interfaceCache[149].message;
  7805. currentEnergy = currentEnergy.replaceAll("%","");
  7806. smallText.method382(getOrbTextColor(100), 232, currentEnergy, 118, true);
  7807. }
  7808.  
  7809. public void drawPrayer()
  7810. {
  7811. String s = (new StringBuilder()).append("./Sprites/Gameframe/Orbs/").toString();
  7812. String s1 = RSInterface.interfaceCache[4012].message;
  7813. String s2 = RSInterface.interfaceCache[4013].message;
  7814. int i = Integer.parseInt(s1);
  7815. int j = Integer.parseInt(s2);
  7816. int k = (int)(((double)i / (double)j) * 100D);
  7817. ORBS[0] = new Sprite((new StringBuilder()).append(s).append("ORBS 0.png").toString(), 27, getOrbFill(k));
  7818. ORBS[1].drawSprite(190, 53);
  7819. ORBS[4].drawSprite(193, 56);
  7820. ORBS[0].drawSprite(194, 56);
  7821. ORBS[6].drawSprite(197, 60);
  7822. smallText.method382(getOrbTextColor(k), 234, (new StringBuilder()).append("").append(i).toString(), 79, true);
  7823. }
  7824.  
  7825. public void drawHP() {
  7826. int health;
  7827. String OrbDirectory = "./Sprites/Gameframe/Orbs/";
  7828. String cHP = RSInterface.interfaceCache[4016].message;
  7829. cHP = cHP.replaceAll("%","");
  7830. int currentHP = Integer.parseInt(cHP);
  7831. String mHP = RSInterface.interfaceCache[4017].message;
  7832. mHP = mHP.replaceAll("%","");
  7833. int maxHP2 = Integer.parseInt(mHP);
  7834. health = (int)(((double)currentHP / (double)maxHP2) * 100D);
  7835. ORBS[0] = new Sprite(OrbDirectory+"ORBS 0.PNG", 27, getOrbFill(health));
  7836. ORBS[1].drawSprite(174, 14);
  7837.  
  7838. ORBS[2].drawSprite(177, 17);
  7839. ORBS[0].drawSprite(177, 17);
  7840. if(health <= 20){
  7841. if(loopCycle % 20 < 10){
  7842. ORBS[3].drawSprite(183, 25);
  7843. }
  7844. } else {
  7845. ORBS[3].drawSprite(183, 25);
  7846. }
  7847. int Y = 40;
  7848. smallText.method382(getOrbTextColor(health), 218, currentHP + "", Y, true);
  7849. }
  7850. private void method91(Stream stream, int i)
  7851. {
  7852. while(stream.bitPosition + 10 < i * 8)
  7853. {
  7854. int j = stream.readBits(11);
  7855. if(j == 2047)
  7856. break;
  7857. if(playerArray[j] == null)
  7858. {
  7859. playerArray[j] = new Player();
  7860. if(aStreamArray895s[j] != null)
  7861. playerArray[j].updatePlayer(aStreamArray895s[j]);
  7862. }
  7863. playerIndices[playerCount++] = j;
  7864. Player player = playerArray[j];
  7865. player.anInt1537 = loopCycle;
  7866. int k = stream.readBits(1);
  7867. if(k == 1)
  7868. anIntArray894[anInt893++] = j;
  7869. int l = stream.readBits(1);
  7870. int i1 = stream.readBits(5);
  7871. if(i1 > 15)
  7872. i1 -= 32;
  7873. int j1 = stream.readBits(5);
  7874. if(j1 > 15)
  7875. j1 -= 32;
  7876. player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1, l == 1);
  7877. }
  7878. stream.finishBitAccess();
  7879. }
  7880.  
  7881. private void processMainScreenClick() {
  7882. if(anInt1021 != 0)
  7883. return;
  7884. if(super.clickMode3 == 1) {
  7885. int i = super.saveClickX - 25 - 545;
  7886. int j = super.saveClickY - 5 - 4;
  7887. if(i >= 0 && j >= 0 && i < 146 && j < 151) {
  7888. i -= 73;
  7889. j -= 75;
  7890. int k = minimapInt1 + minimapInt2 & 0x7ff;
  7891. int i1 = Texture.anIntArray1470[k];
  7892. int j1 = Texture.anIntArray1471[k];
  7893. i1 = i1 * (minimapInt3 + 256) >> 8;
  7894. j1 = j1 * (minimapInt3 + 256) >> 8;
  7895. int k1 = j * i1 + i * j1 >> 11;
  7896. int l1 = j * j1 - i * i1 >> 11;
  7897. int i2 = myPlayer.x + k1 >> 7;
  7898. int j2 = myPlayer.y - l1 >> 7;
  7899. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0, j2, myPlayer.smallX[0], true, i2);
  7900. if(flag1) {
  7901. stream.writeWordBigEndian(i);
  7902. stream.writeWordBigEndian(j);
  7903. stream.writeWord(minimapInt1);
  7904. stream.writeWordBigEndian(57);
  7905. stream.writeWordBigEndian(minimapInt2);
  7906. stream.writeWordBigEndian(minimapInt3);
  7907. stream.writeWordBigEndian(89);
  7908. stream.writeWord(myPlayer.x);
  7909. stream.writeWord(myPlayer.y);
  7910. stream.writeWordBigEndian(anInt1264);
  7911. stream.writeWordBigEndian(63);
  7912. }
  7913. }
  7914. anInt1117++;
  7915. if(anInt1117 > 1151) {
  7916. anInt1117 = 0;
  7917. stream.createFrame(246);
  7918. stream.writeWordBigEndian(0);
  7919. int l = stream.currentOffset;
  7920. if((int)(Math.random() * 2D) == 0)
  7921. stream.writeWordBigEndian(101);
  7922. stream.writeWordBigEndian(197);
  7923. stream.writeWord((int)(Math.random() * 65536D));
  7924. stream.writeWordBigEndian((int)(Math.random() * 256D));
  7925. stream.writeWordBigEndian(67);
  7926. stream.writeWord(14214);
  7927. if((int)(Math.random() * 2D) == 0)
  7928. stream.writeWord(29487);
  7929. stream.writeWord((int)(Math.random() * 65536D));
  7930. if((int)(Math.random() * 2D) == 0)
  7931. stream.writeWordBigEndian(220);
  7932. stream.writeWordBigEndian(180);
  7933. stream.writeBytes(stream.currentOffset - l);
  7934. }
  7935. }
  7936. }
  7937.  
  7938. private String interfaceIntToString(int j) {
  7939. if(j < 0x3b9ac9ff)
  7940. return String.valueOf(j);
  7941. else
  7942. return "*";
  7943. }
  7944.  
  7945. private void showErrorScreen()
  7946. {
  7947. Graphics g = getGameComponent().getGraphics();
  7948. g.setColor(Color.black);
  7949. g.fillRect(0, 0, 765, 503);
  7950. method4(1);
  7951. if(loadingError)
  7952. {
  7953. aBoolean831 = false;
  7954. g.setFont(new Font("Helvetica", 1, 16));
  7955. g.setColor(Color.yellow);
  7956. int k = 35;
  7957. g.drawString("Sorry, an error has occured whilst loading RuneScape", 30, k);
  7958. k += 50;
  7959. g.setColor(Color.white);
  7960. g.drawString("To fix this try the following (in order):", 30, k);
  7961. k += 50;
  7962. g.setColor(Color.white);
  7963. g.setFont(new Font("Helvetica", 1, 12));
  7964. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, k);
  7965. k += 30;
  7966. g.drawString("2: Try clearing your web-browsers cache from tools->internet options", 30, k);
  7967. k += 30;
  7968. g.drawString("3: Try using a different game-world", 30, k);
  7969. k += 30;
  7970. g.drawString("4: Try rebooting your computer", 30, k);
  7971. k += 30;
  7972. g.drawString("5: Try selecting a different version of Java from the play-game menu", 30, k);
  7973. }
  7974. if(genericLoadingError)
  7975. {
  7976. aBoolean831 = false;
  7977. g.setFont(new Font("Helvetica", 1, 20));
  7978. g.setColor(Color.white);
  7979. g.drawString("Error - unable to load game!", 50, 50);
  7980. g.drawString("To play RuneScape make sure you play from", 50, 100);
  7981. g.drawString("http://www.runescape.com", 50, 150);
  7982. }
  7983. if(rsAlreadyLoaded)
  7984. {
  7985. aBoolean831 = false;
  7986. g.setColor(Color.yellow);
  7987. int l = 35;
  7988. g.drawString("Error a copy of RuneScape already appears to be loaded", 30, l);
  7989. l += 50;
  7990. g.setColor(Color.white);
  7991. g.drawString("To fix this try the following (in order):", 30, l);
  7992. l += 50;
  7993. g.setColor(Color.white);
  7994. g.setFont(new Font("Helvetica", 1, 12));
  7995. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, l);
  7996. l += 30;
  7997. g.drawString("2: Try rebooting your computer, and reloading", 30, l);
  7998. l += 30;
  7999. }
  8000. }
  8001.  
  8002. public URL getCodeBase() {
  8003. try {
  8004. return new URL(server +":" + (80 + portOff));
  8005. } catch(Exception _ex) {
  8006. }
  8007. return null;
  8008. }
  8009.  
  8010. private void method95() {
  8011. for(int j = 0; j < npcCount; j++) {
  8012. int k = npcIndices[j];
  8013. NPC npc = npcArray[k];
  8014. if(npc != null)
  8015. method96(npc);
  8016. }
  8017. }
  8018.  
  8019. private void method96(Entity entity)
  8020. {
  8021. if(entity.x < 128 || entity.y < 128 || entity.x >= 13184 || entity.y >= 13184)
  8022. {
  8023. entity.anim = -1;
  8024. entity.anInt1520 = -1;
  8025. entity.anInt1547 = 0;
  8026. entity.anInt1548 = 0;
  8027. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  8028. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  8029. entity.method446();
  8030. }
  8031. if(entity == myPlayer && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776))
  8032. {
  8033. entity.anim = -1;
  8034. entity.anInt1520 = -1;
  8035. entity.anInt1547 = 0;
  8036. entity.anInt1548 = 0;
  8037. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  8038. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  8039. entity.method446();
  8040. }
  8041. if(entity.anInt1547 > loopCycle)
  8042. method97(entity);
  8043. else
  8044. if(entity.anInt1548 >= loopCycle)
  8045. method98(entity);
  8046. else
  8047. method99(entity);
  8048. method100(entity);
  8049. method101(entity);
  8050. }
  8051.  
  8052. private void method97(Entity entity)
  8053. {
  8054. int i = entity.anInt1547 - loopCycle;
  8055. int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  8056. int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  8057. entity.x += (j - entity.x) / i;
  8058. entity.y += (k - entity.y) / i;
  8059. entity.anInt1503 = 0;
  8060. if(entity.anInt1549 == 0)
  8061. entity.turnDirection = 1024;
  8062. if(entity.anInt1549 == 1)
  8063. entity.turnDirection = 1536;
  8064. if(entity.anInt1549 == 2)
  8065. entity.turnDirection = 0;
  8066. if(entity.anInt1549 == 3)
  8067. entity.turnDirection = 512;
  8068. }
  8069.  
  8070. private void method98(Entity entity)
  8071. {
  8072. if(entity.anInt1548 == loopCycle || entity.anim == -1 || entity.anInt1529 != 0 || entity.anInt1528 + 1 > Animation.anims[entity.anim].method258(entity.anInt1527))
  8073. {
  8074. int i = entity.anInt1548 - entity.anInt1547;
  8075. int j = loopCycle - entity.anInt1547;
  8076. int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  8077. int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  8078. int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
  8079. int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
  8080. entity.x = (k * (i - j) + i1 * j) / i;
  8081. entity.y = (l * (i - j) + j1 * j) / i;
  8082. }
  8083. entity.anInt1503 = 0;
  8084. if(entity.anInt1549 == 0)
  8085. entity.turnDirection = 1024;
  8086. if(entity.anInt1549 == 1)
  8087. entity.turnDirection = 1536;
  8088. if(entity.anInt1549 == 2)
  8089. entity.turnDirection = 0;
  8090. if(entity.anInt1549 == 3)
  8091. entity.turnDirection = 512;
  8092. entity.anInt1552 = entity.turnDirection;
  8093. }
  8094.  
  8095. private void method99(Entity entity)
  8096. {
  8097. entity.anInt1517 = entity.anInt1511;
  8098. if(entity.smallXYIndex == 0)
  8099. {
  8100. entity.anInt1503 = 0;
  8101. return;
  8102. }
  8103. if(entity.anim != -1 && entity.anInt1529 == 0)
  8104. {
  8105. Animation animation = Animation.anims[entity.anim];
  8106. if(entity.anInt1542 > 0 && animation.anInt363 == 0)
  8107. {
  8108. entity.anInt1503++;
  8109. return;
  8110. }
  8111. if(entity.anInt1542 <= 0 && animation.anInt364 == 0)
  8112. {
  8113. entity.anInt1503++;
  8114. return;
  8115. }
  8116. }
  8117. int i = entity.x;
  8118. int j = entity.y;
  8119. int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  8120. int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  8121. if(k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256)
  8122. {
  8123. entity.x = k;
  8124. entity.y = l;
  8125. return;
  8126. }
  8127. if(i < k)
  8128. {
  8129. if(j < l)
  8130. entity.turnDirection = 1280;
  8131. else
  8132. if(j > l)
  8133. entity.turnDirection = 1792;
  8134. else
  8135. entity.turnDirection = 1536;
  8136. } else
  8137. if(i > k)
  8138. {
  8139. if(j < l)
  8140. entity.turnDirection = 768;
  8141. else
  8142. if(j > l)
  8143. entity.turnDirection = 256;
  8144. else
  8145. entity.turnDirection = 512;
  8146. } else
  8147. if(j < l)
  8148. entity.turnDirection = 1024;
  8149. else
  8150. entity.turnDirection = 0;
  8151. int i1 = entity.turnDirection - entity.anInt1552 & 0x7ff;
  8152. if(i1 > 1024)
  8153. i1 -= 2048;
  8154. int j1 = entity.anInt1555;
  8155. if(i1 >= -256 && i1 <= 256)
  8156. j1 = entity.anInt1554;
  8157. else
  8158. if(i1 >= 256 && i1 < 768)
  8159. j1 = entity.anInt1557;
  8160. else
  8161. if(i1 >= -768 && i1 <= -256)
  8162. j1 = entity.anInt1556;
  8163. if(j1 == -1)
  8164. j1 = entity.anInt1554;
  8165. entity.anInt1517 = j1;
  8166. int k1 = 4;
  8167. if(entity.anInt1552 != entity.turnDirection && entity.interactingEntity == -1 && entity.anInt1504 != 0)
  8168. k1 = 2;
  8169. if(entity.smallXYIndex > 2)
  8170. k1 = 6;
  8171. if(entity.smallXYIndex > 3)
  8172. k1 = 8;
  8173. if(entity.anInt1503 > 0 && entity.smallXYIndex > 1)
  8174. {
  8175. k1 = 8;
  8176. entity.anInt1503--;
  8177. }
  8178. if(entity.aBooleanArray1553[entity.smallXYIndex - 1])
  8179. k1 <<= 1;
  8180. if(k1 >= 8 && entity.anInt1517 == entity.anInt1554 && entity.anInt1505 != -1)
  8181. entity.anInt1517 = entity.anInt1505;
  8182. if(i < k)
  8183. {
  8184. entity.x += k1;
  8185. if(entity.x > k)
  8186. entity.x = k;
  8187. } else
  8188. if(i > k)
  8189. {
  8190. entity.x -= k1;
  8191. if(entity.x < k)
  8192. entity.x = k;
  8193. }
  8194. if(j < l)
  8195. {
  8196. entity.y += k1;
  8197. if(entity.y > l)
  8198. entity.y = l;
  8199. } else
  8200. if(j > l)
  8201. {
  8202. entity.y -= k1;
  8203. if(entity.y < l)
  8204. entity.y = l;
  8205. }
  8206. if(entity.x == k && entity.y == l)
  8207. {
  8208. entity.smallXYIndex--;
  8209. if(entity.anInt1542 > 0)
  8210. entity.anInt1542--;
  8211. }
  8212. }
  8213.  
  8214. private void method100(Entity entity)
  8215. {
  8216. if(entity.anInt1504 == 0)
  8217. return;
  8218. if(entity.interactingEntity != -1 && entity.interactingEntity < 32768)
  8219. {
  8220. NPC npc = npcArray[entity.interactingEntity];
  8221. if(npc != null)
  8222. {
  8223. int i1 = entity.x - npc.x;
  8224. int k1 = entity.y - npc.y;
  8225. if(i1 != 0 || k1 != 0)
  8226. entity.turnDirection = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  8227. }
  8228. }
  8229. if(entity.interactingEntity >= 32768)
  8230. {
  8231. int j = entity.interactingEntity - 32768;
  8232. if(j == unknownInt10)
  8233. j = myPlayerIndex;
  8234. Player player = playerArray[j];
  8235. if(player != null)
  8236. {
  8237. int l1 = entity.x - player.x;
  8238. int i2 = entity.y - player.y;
  8239. if(l1 != 0 || i2 != 0)
  8240. entity.turnDirection = (int)(Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  8241. }
  8242. }
  8243. if((entity.anInt1538 != 0 || entity.anInt1539 != 0) && (entity.smallXYIndex == 0 || entity.anInt1503 > 0))
  8244. {
  8245. int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
  8246. int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
  8247. if(k != 0 || j1 != 0)
  8248. entity.turnDirection = (int)(Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  8249. entity.anInt1538 = 0;
  8250. entity.anInt1539 = 0;
  8251. }
  8252. int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
  8253. if(l != 0)
  8254. {
  8255. if(l < entity.anInt1504 || l > 2048 - entity.anInt1504)
  8256. entity.anInt1552 = entity.turnDirection;
  8257. else
  8258. if(l > 1024)
  8259. entity.anInt1552 -= entity.anInt1504;
  8260. else
  8261. entity.anInt1552 += entity.anInt1504;
  8262. entity.anInt1552 &= 0x7ff;
  8263. if(entity.anInt1517 == entity.anInt1511 && entity.anInt1552 != entity.turnDirection)
  8264. {
  8265. if(entity.anInt1512 != -1)
  8266. {
  8267. entity.anInt1517 = entity.anInt1512;
  8268. return;
  8269. }
  8270. entity.anInt1517 = entity.anInt1554;
  8271. }
  8272. }
  8273. }
  8274.  
  8275. private void method101(Entity entity)
  8276. {
  8277. entity.aBoolean1541 = false;
  8278. if(entity.anInt1517 != -1)
  8279. {
  8280. Animation animation = Animation.anims[entity.anInt1517];
  8281. entity.anInt1519++;
  8282. if(entity.anInt1518 < animation.anInt352 && entity.anInt1519 > animation.method258(entity.anInt1518))
  8283. {
  8284. entity.anInt1519 = 0;
  8285. entity.anInt1518++;
  8286. }
  8287. if(entity.anInt1518 >= animation.anInt352)
  8288. {
  8289. entity.anInt1519 = 0;
  8290. entity.anInt1518 = 0;
  8291. }
  8292. }
  8293. if(entity.anInt1520 != -1 && loopCycle >= entity.anInt1523)
  8294. {
  8295. if(entity.anInt1521 < 0)
  8296. entity.anInt1521 = 0;
  8297. Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  8298. for(entity.anInt1522++; entity.anInt1521 < animation_1.anInt352 && entity.anInt1522 > animation_1.method258(entity.anInt1521); entity.anInt1521++)
  8299. entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  8300.  
  8301. if(entity.anInt1521 >= animation_1.anInt352 && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352))
  8302. entity.anInt1520 = -1;
  8303. }
  8304. if(entity.anim != -1 && entity.anInt1529 <= 1)
  8305. {
  8306. Animation animation_2 = Animation.anims[entity.anim];
  8307. if(animation_2.anInt363 == 1 && entity.anInt1542 > 0 && entity.anInt1547 <= loopCycle && entity.anInt1548 < loopCycle)
  8308. {
  8309. entity.anInt1529 = 1;
  8310. return;
  8311. }
  8312. }
  8313. if(entity.anim != -1 && entity.anInt1529 == 0)
  8314. {
  8315. Animation animation_3 = Animation.anims[entity.anim];
  8316. for(entity.anInt1528++; entity.anInt1527 < animation_3.anInt352 && entity.anInt1528 > animation_3.method258(entity.anInt1527); entity.anInt1527++)
  8317. entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  8318.  
  8319. if(entity.anInt1527 >= animation_3.anInt352)
  8320. {
  8321. entity.anInt1527 -= animation_3.anInt356;
  8322. entity.anInt1530++;
  8323. if(entity.anInt1530 >= animation_3.anInt362)
  8324. entity.anim = -1;
  8325. if(entity.anInt1527 < 0 || entity.anInt1527 >= animation_3.anInt352)
  8326. entity.anim = -1;
  8327. }
  8328. entity.aBoolean1541 = animation_3.aBoolean358;
  8329. }
  8330. if(entity.anInt1529 > 0)
  8331. entity.anInt1529--;
  8332. }
  8333.  
  8334. private void drawGameScreen()
  8335. {
  8336. if (fullscreenInterfaceID != -1 && (loadingStage == 2 || super.fullGameScreen != null)) {
  8337. if (loadingStage == 2) {
  8338. method119(anInt945, fullscreenInterfaceID);
  8339. if (openInterfaceID != -1) {
  8340. method119(anInt945, openInterfaceID);
  8341. }
  8342. anInt945 = 0;
  8343. resetAllImageProducers();
  8344. super.fullGameScreen.initDrawingArea();
  8345. Texture.anIntArray1472 = fullScreenTextureArray;
  8346. DrawingArea.setAllPixelsToZero();
  8347. welcomeScreenRaised = true;
  8348. if (openInterfaceID != -1) {
  8349. RSInterface rsInterface_1 = RSInterface.interfaceCache[openInterfaceID];
  8350. if (rsInterface_1.width == 512 && rsInterface_1.height == 334 && rsInterface_1.type == 0) {
  8351. rsInterface_1.width = 765;
  8352. rsInterface_1.height = 503;
  8353. }
  8354. drawInterface(0, 0, rsInterface_1, 8);
  8355. }
  8356. RSInterface rsInterface = RSInterface.interfaceCache[fullscreenInterfaceID];
  8357. if (rsInterface.width == 512 && rsInterface.height == 334 && rsInterface.type == 0) {
  8358. rsInterface.width = 765;
  8359. rsInterface.height = 503;
  8360. }
  8361. drawInterface(0, 0, rsInterface, 8);
  8362.  
  8363. if (!menuOpen) {
  8364. processRightClick();
  8365. drawTooltip();
  8366. } else {
  8367. drawMenu();
  8368. }
  8369. }
  8370. drawCount++;
  8371. super.fullGameScreen.drawGraphics(0, super.graphics, 0);
  8372. return;
  8373. } else {
  8374. if (drawCount != 0) {
  8375. resetImageProducers2();
  8376. }
  8377. }
  8378. if(welcomeScreenRaised) {
  8379. welcomeScreenRaised = false;
  8380. topFrame.drawGraphics(0, super.graphics, 0);
  8381. leftFrame.drawGraphics(4, super.graphics, 0);
  8382. rightFrame.drawGraphics(4, super.graphics, 516);
  8383. mapEdgeIP.drawGraphics(4, super.graphics, 519);
  8384. needDrawTabArea = true;
  8385. inputTaken = true;
  8386. tabAreaAltered = true;
  8387. aBoolean1233 = true;
  8388. if(loadingStage != 2) {
  8389. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  8390. aRSImageProducer_1164.drawGraphics(0, super.graphics, 519);
  8391. }
  8392. }
  8393. if(menuOpen && menuScreenArea == 1)
  8394. needDrawTabArea = true;
  8395. if(invOverlayInterfaceID != -1)
  8396. {
  8397. boolean flag1 = method119(anInt945, invOverlayInterfaceID);
  8398. if(flag1)
  8399. needDrawTabArea = true;
  8400. }
  8401. if(atInventoryInterfaceType == 2)
  8402. needDrawTabArea = true;
  8403. if(activeInterfaceType == 2)
  8404. needDrawTabArea = true;
  8405. /*if(needDrawTabArea)
  8406. {*/
  8407. drawTabArea();
  8408. /*needDrawTabArea = false;
  8409. }*/
  8410. if(backDialogID == -1)
  8411. {
  8412. aClass9_1059.scrollPosition = anInt1211 - anInt1089 - 110;
  8413. if(super.mouseX > 478 && super.mouseX < 580 && super.mouseY > 342)
  8414. method65(494, 110, super.mouseX - 0, super.mouseY - 348, aClass9_1059, 0, false, anInt1211);
  8415. int i = anInt1211 - 110 - aClass9_1059.scrollPosition;
  8416. if(i < 0)
  8417. i = 0;
  8418. if(i > anInt1211 - 110)
  8419. i = anInt1211 - 110;
  8420. if(anInt1089 != i)
  8421. {
  8422. anInt1089 = i;
  8423. inputTaken = true;
  8424. }
  8425. }
  8426. if(backDialogID != -1) {
  8427. boolean flag2 = method119(anInt945, backDialogID);
  8428. if(flag2)
  8429. inputTaken = true;
  8430. }
  8431. if(atInventoryInterfaceType == 3)
  8432. inputTaken = true;
  8433. if(activeInterfaceType == 3)
  8434. inputTaken = true;
  8435. if(aString844 != null)
  8436. inputTaken = true;
  8437. if(menuOpen && menuScreenArea == 2)
  8438. inputTaken = true;
  8439. if(inputTaken) {
  8440. drawChatArea();
  8441. inputTaken = false;
  8442. }
  8443. if(loadingStage == 2)
  8444. method146();
  8445. if(loadingStage == 2) {
  8446. drawMinimap();
  8447. aRSImageProducer_1164.drawGraphics(0, super.graphics, 519);
  8448. }
  8449. if(anInt1054 != -1)
  8450. tabAreaAltered = true;
  8451. if(tabAreaAltered)
  8452. {
  8453. if(anInt1054 != -1 && anInt1054 == tabID)
  8454. {
  8455. anInt1054 = -1;
  8456. stream.createFrame(120);
  8457. stream.writeWordBigEndian(tabID);
  8458. }
  8459. tabAreaAltered = false;
  8460. aRSImageProducer_1125.initDrawingArea();
  8461. aRSImageProducer_1165.initDrawingArea();
  8462. }
  8463. anInt945 = 0;
  8464. }
  8465.  
  8466. private boolean buildFriendsListMenu(RSInterface class9)
  8467. {
  8468. int i = class9.contentType;
  8469. if(i >= 1 && i <= 200 || i >= 701 && i <= 900)
  8470. {
  8471. if(i >= 801)
  8472. i -= 701;
  8473. else
  8474. if(i >= 701)
  8475. i -= 601;
  8476. else
  8477. if(i >= 101)
  8478. i -= 101;
  8479. else
  8480. i--;
  8481. menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
  8482. menuActionID[menuActionRow] = 792;
  8483. menuActionRow++;
  8484. menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
  8485. menuActionID[menuActionRow] = 639;
  8486. menuActionRow++;
  8487. return true;
  8488. }
  8489. if(i >= 401 && i <= 500)
  8490. {
  8491. menuActionName[menuActionRow] = "Remove @whi@" + class9.message;
  8492. menuActionID[menuActionRow] = 322;
  8493. menuActionRow++;
  8494. return true;
  8495. } else
  8496. {
  8497. return false;
  8498. }
  8499. }
  8500.  
  8501. private void method104()
  8502. {
  8503. Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetFirst();
  8504. for(; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetNext())
  8505. if(class30_sub2_sub4_sub3.anInt1560 != plane || class30_sub2_sub4_sub3.aBoolean1567)
  8506. class30_sub2_sub4_sub3.unlink();
  8507. else
  8508. if(loopCycle >= class30_sub2_sub4_sub3.anInt1564)
  8509. {
  8510. class30_sub2_sub4_sub3.method454(anInt945);
  8511. if(class30_sub2_sub4_sub3.aBoolean1567)
  8512. class30_sub2_sub4_sub3.unlink();
  8513. else
  8514. 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);
  8515. }
  8516.  
  8517. }
  8518.  
  8519. public void drawBlackBox(int xPos, int yPos) {
  8520. DrawingArea.drawPixels(71, yPos - 1, xPos - 2, 0x726451, 1);
  8521. DrawingArea.drawPixels(69, yPos, xPos + 174, 0x726451, 1);
  8522. DrawingArea.drawPixels(1, yPos - 2, xPos - 2, 0x726451, 178);
  8523. DrawingArea.drawPixels(1, yPos + 68, xPos, 0x726451, 174);
  8524. DrawingArea.drawPixels(71, yPos - 1, xPos - 1, 0x2E2B23, 1);
  8525. DrawingArea.drawPixels(71, yPos - 1, xPos + 175, 0x2E2B23, 1);
  8526. DrawingArea.drawPixels(1, yPos - 1, xPos, 0x2E2B23, 175);
  8527. DrawingArea.drawPixels(1, yPos + 69, xPos, 0x2E2B23, 175);
  8528. DrawingArea.method335(0, yPos, 174, 68, 220, xPos);
  8529.  
  8530. }
  8531.  
  8532. private void drawInterface(int j, int k, RSInterface class9, int l) {
  8533. if(class9.type != 0 || class9.children == null)
  8534. return;
  8535. if(class9.isMouseoverTriggered && anInt1026 != class9.id && anInt1048 != class9.id && anInt1039 != class9.id)
  8536. return;
  8537. int i1 = DrawingArea.topX;
  8538. int j1 = DrawingArea.topY;
  8539. int k1 = DrawingArea.bottomX;
  8540. int l1 = DrawingArea.bottomY;
  8541. DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  8542. int i2 = class9.children.length;
  8543. for(int j2 = 0; j2 < i2; j2++) {
  8544. int k2 = class9.childX[j2] + k;
  8545. int l2 = (class9.childY[j2] + l) - j;
  8546. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j2]];
  8547. k2 += class9_1.anInt263;
  8548. l2 += class9_1.anInt265;
  8549. if(class9_1.contentType > 0)
  8550. drawFriendsListOrWelcomeScreen(class9_1);
  8551. //here
  8552. int[] IDs = {
  8553. 1196, 1199, 1206, 1215, 1224, 1231, 1240, 1249, 1258, 1267, 1274, 1283, 1573,
  8554. 1290, 1299, 1308, 1315, 1324, 1333, 1340, 1349, 1358, 1367, 1374, 1381, 1388,
  8555. 1397, 1404, 1583, 12038, 1414, 1421, 1430, 1437, 1446, 1453, 1460, 1469, 15878,
  8556. 1602, 1613, 1624, 7456, 1478, 1485, 1494, 1503, 1512, 1521, 1530, 1544, 1553,
  8557. 1563, 1593, 1635, 12426, 12436, 12446, 12456, 6004, 18471,
  8558. /* Ancients */
  8559. 12940, 12988, 13036, 12902, 12862, 13046, 12964, 13012, 13054, 12920, 12882, 13062,
  8560. 12952, 13000, 13070, 12912, 12872, 13080, 12976, 13024, 13088, 12930, 12892, 13096
  8561. };
  8562. for(int m5 = 0; m5 < IDs.length; m5++) {
  8563. if(class9_1.id == IDs[m5] + 1) {
  8564. if(m5 > 61)
  8565. drawBlackBox(k2 + 1, l2);
  8566. else
  8567. drawBlackBox(k2, l2 + 1);
  8568. }
  8569. }
  8570. int[] runeChildren = {
  8571. 1202, 1203, 1209, 1210, 1211, 1218, 1219, 1220, 1227, 1228, 1234, 1235, 1236, 1243, 1244, 1245,
  8572. 1252, 1253, 1254, 1261, 1262, 1263, 1270, 1271, 1277, 1278, 1279, 1286, 1287, 1293, 1294, 1295,
  8573. 1302, 1303, 1304, 1311, 1312, 1318, 1319, 1320, 1327, 1328, 1329, 1336, 1337, 1343, 1344, 1345,
  8574. 1352, 1353, 1354, 1361, 1362, 1363, 1370, 1371, 1377, 1378, 1384, 1385, 1391, 1392, 1393, 1400,
  8575. 1401, 1407, 1408, 1410, 1417, 1418, 1424, 1425, 1426, 1433, 1434, 1440, 1441, 1442, 1449, 1450,
  8576. 1456, 1457, 1463, 1464, 1465, 1472, 1473, 1474, 1481, 1482, 1488, 1489, 1490, 1497, 1498, 1499,
  8577. 1506, 1507, 1508, 1515, 1516, 1517, 1524, 1525, 1526, 1533, 1534, 1535, 1547, 1548, 1549, 1556,
  8578. 1557, 1558, 1566, 1567, 1568, 1576, 1577, 1578, 1586, 1587, 1588, 1596, 1597, 1598, 1605, 1606,
  8579. 1607, 1616, 1617, 1618, 1627, 1628, 1629, 1638, 1639, 1640, 6007, 6008, 6011, 8673, 8674, 12041,
  8580. 12042, 12429, 12430, 12431, 12439, 12440, 12441, 12449, 12450, 12451, 12459, 12460, 15881, 15882,
  8581. 15885, 18474, 18475, 18478
  8582. };
  8583. for(int r = 0; r < runeChildren.length; r++)
  8584. if(class9_1.id == runeChildren[r])
  8585. class9_1.modelZoom = 775;
  8586. if(class9_1.type == 0) {
  8587. if(class9_1.scrollPosition > class9_1.scrollMax - class9_1.height)
  8588. class9_1.scrollPosition = class9_1.scrollMax - class9_1.height;
  8589. if(class9_1.scrollPosition < 0)
  8590. class9_1.scrollPosition = 0;
  8591. drawInterface(class9_1.scrollPosition, k2, class9_1, l2);
  8592. if(class9_1.scrollMax > class9_1.height)
  8593. drawScrollbar(class9_1.height, class9_1.scrollPosition, l2, k2 + class9_1.width, class9_1.scrollMax);
  8594. } else if(class9_1.type != 1)
  8595. if(class9_1.type == 2) {
  8596. int i3 = 0;
  8597. for(int l3 = 0; l3 < class9_1.height; l3++) {
  8598. for(int l4 = 0; l4 < class9_1.width; l4++) {
  8599. int k5 = k2 + l4 * (32 + class9_1.invSpritePadX);
  8600. int j6 = l2 + l3 * (32 + class9_1.invSpritePadY);
  8601. if(i3 < 20) {
  8602. k5 += class9_1.spritesX[i3];
  8603. j6 += class9_1.spritesY[i3];
  8604. }
  8605. if(class9_1.inv[i3] > 0) {
  8606. int k6 = 0;
  8607. int j7 = 0;
  8608. int j9 = class9_1.inv[i3] - 1;
  8609. if(k5 > DrawingArea.topX - 32 && k5 < DrawingArea.bottomX && j6 > DrawingArea.topY - 32 && j6 < DrawingArea.bottomY || activeInterfaceType != 0 && anInt1085 == i3) {
  8610. int l9 = 0;
  8611. if(itemSelected == 1 && anInt1283 == i3 && anInt1284 == class9_1.id)
  8612. l9 = 0xffffff;
  8613. Sprite class30_sub2_sub1_sub1_2 = ItemDef.getSprite(j9, class9_1.invStackSizes[i3], l9);
  8614. if(class30_sub2_sub1_sub1_2 != null) {
  8615. if(activeInterfaceType != 0 && anInt1085 == i3 && anInt1084 == class9_1.id) {
  8616. k6 = super.mouseX - anInt1087;
  8617. j7 = super.mouseY - anInt1088;
  8618. if(k6 < 5 && k6 > -5)
  8619. k6 = 0;
  8620. if(j7 < 5 && j7 > -5)
  8621. j7 = 0;
  8622. if(anInt989 < 5) {
  8623. k6 = 0;
  8624. j7 = 0;
  8625. }
  8626. class30_sub2_sub1_sub1_2.drawSprite1(k5 + k6, j6 + j7);
  8627. if(j6 + j7 < DrawingArea.topY && class9.scrollPosition > 0) {
  8628. int i10 = (anInt945 * (DrawingArea.topY - j6 - j7)) / 3;
  8629. if(i10 > anInt945 * 10)
  8630. i10 = anInt945 * 10;
  8631. if(i10 > class9.scrollPosition)
  8632. i10 = class9.scrollPosition;
  8633. class9.scrollPosition -= i10;
  8634. anInt1088 += i10;
  8635. }
  8636. if(j6 + j7 + 32 > DrawingArea.bottomY && class9.scrollPosition < class9.scrollMax - class9.height) {
  8637. int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  8638. if(j10 > anInt945 * 10)
  8639. j10 = anInt945 * 10;
  8640. if(j10 > class9.scrollMax - class9.height - class9.scrollPosition)
  8641. j10 = class9.scrollMax - class9.height - class9.scrollPosition;
  8642. class9.scrollPosition += j10;
  8643. anInt1088 -= j10;
  8644. }
  8645. } else if(atInventoryInterfaceType != 0 && atInventoryIndex == i3 && atInventoryInterface == class9_1.id)
  8646. class30_sub2_sub1_sub1_2.drawSprite1(k5, j6);
  8647. else
  8648. class30_sub2_sub1_sub1_2.drawSprite(k5, j6);
  8649. if(class30_sub2_sub1_sub1_2.anInt1444 == 33 || class9_1.invStackSizes[i3] != 1)
  8650. {
  8651. int k10 = class9_1.invStackSizes[i3];
  8652. if(k10 >= 1)
  8653. smallText.method385(0xFFFF00, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  8654. if(k10 >= 100000)
  8655. smallText.method385(0xFFFFFF, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  8656. if(k10 >= 10000000)
  8657. smallText.method385(0x00ff80, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  8658.  
  8659. /*smallText.method385(0, intToKOrMil(k10), j6 + 10 + j7, k5 + 1 + k6);
  8660. smallText.method385(0xffff00, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);*/
  8661. }
  8662. }
  8663. }
  8664. } else if(class9_1.sprites != null && i3 < 20) {
  8665. Sprite class30_sub2_sub1_sub1_1 = class9_1.sprites[i3];
  8666. if(class30_sub2_sub1_sub1_1 != null)
  8667. class30_sub2_sub1_sub1_1.drawSprite(k5, j6);
  8668. }
  8669. i3++;
  8670. }
  8671. }
  8672. } else if(class9_1.type == 3) {
  8673. boolean flag = false;
  8674. if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  8675. flag = true;
  8676. int j3;
  8677. if(interfaceIsSelected(class9_1)) {
  8678. j3 = class9_1.anInt219;
  8679. if(flag && class9_1.anInt239 != 0)
  8680. j3 = class9_1.anInt239;
  8681. } else {
  8682. j3 = class9_1.textColor;
  8683. if(flag && class9_1.anInt216 != 0)
  8684. j3 = class9_1.anInt216;
  8685. }
  8686. if(class9_1.aByte254 == 0) {
  8687. if(class9_1.aBoolean227)
  8688. DrawingArea.drawPixels(class9_1.height, l2, k2, j3, class9_1.width);
  8689. else
  8690. DrawingArea.fillPixels(k2, class9_1.width, class9_1.height, j3, l2);
  8691. } else if(class9_1.aBoolean227)
  8692. DrawingArea.method335(j3, l2, class9_1.width, class9_1.height, 256 - (class9_1.aByte254 & 0xff), k2);
  8693. else
  8694. DrawingArea.method338(l2, class9_1.height, 256 - (class9_1.aByte254 & 0xff), j3, class9_1.width, k2);
  8695. } else if(class9_1.type == 4) {
  8696. TextDrawingArea textDrawingArea = class9_1.textDrawingAreas;
  8697. String s = class9_1.message;
  8698. boolean flag1 = false;
  8699. if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  8700. flag1 = true;
  8701. int i4;
  8702. if(interfaceIsSelected(class9_1)) {
  8703. i4 = class9_1.anInt219;
  8704. if(flag1 && class9_1.anInt239 != 0)
  8705. i4 = class9_1.anInt239;
  8706. if(class9_1.aString228.length() > 0)
  8707. s = class9_1.aString228;
  8708. } else {
  8709. i4 = class9_1.textColor;
  8710. if(flag1 && class9_1.anInt216 != 0)
  8711. i4 = class9_1.anInt216;
  8712. }
  8713. if(class9_1.atActionType == 6 && aBoolean1149) {
  8714. s = "Please wait...";
  8715. i4 = class9_1.textColor;
  8716. }
  8717. if(DrawingArea.width == 519) {
  8718. if(i4 == 0xffff00)
  8719. i4 = 255;
  8720. if(i4 == 49152)
  8721. i4 = 0xffffff;
  8722. }
  8723. if((class9_1.parentID == 1151) || (class9_1.parentID == 12855)) {
  8724. switch (i4) {
  8725. case 16773120: i4 = 0xFE981F; break;
  8726. case 7040819: i4 = 0xAF6A1A; break;
  8727. }
  8728. }
  8729. for(int l6 = l2 + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497)
  8730. {
  8731. if(s.indexOf("%") != -1)
  8732. {
  8733. do
  8734. {
  8735. int k7 = s.indexOf("%1");
  8736. if(k7 == -1)
  8737. break;
  8738. if(class9_1.id < 4000 || class9_1.id > 5000 && class9_1.id !=13921 && class9_1.id !=13922 && class9_1.id !=12171 && class9_1.id !=12172)
  8739. s = s.substring(0, k7) + methodR(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  8740. else
  8741. s = s.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  8742. } while(true);
  8743. do
  8744. {
  8745. int l7 = s.indexOf("%2");
  8746. if(l7 == -1)
  8747. break;
  8748. s = s.substring(0, l7) + interfaceIntToString(extractInterfaceValues(class9_1, 1)) + s.substring(l7 + 2);
  8749. } while(true);
  8750. do
  8751. {
  8752. int i8 = s.indexOf("%3");
  8753. if(i8 == -1)
  8754. break;
  8755. s = s.substring(0, i8) + interfaceIntToString(extractInterfaceValues(class9_1, 2)) + s.substring(i8 + 2);
  8756. } while(true);
  8757. do
  8758. {
  8759. int j8 = s.indexOf("%4");
  8760. if(j8 == -1)
  8761. break;
  8762. s = s.substring(0, j8) + interfaceIntToString(extractInterfaceValues(class9_1, 3)) + s.substring(j8 + 2);
  8763. } while(true);
  8764. do
  8765. {
  8766. int k8 = s.indexOf("%5");
  8767. if(k8 == -1)
  8768. break;
  8769. s = s.substring(0, k8) + interfaceIntToString(extractInterfaceValues(class9_1, 4)) + s.substring(k8 + 2);
  8770. } while(true);
  8771. }
  8772. int l8 = s.indexOf("\\n");
  8773. String s1;
  8774. if(l8 != -1)
  8775. {
  8776. s1 = s.substring(0, l8);
  8777. s = s.substring(l8 + 2);
  8778. } else
  8779. {
  8780. s1 = s;
  8781. s = "";
  8782. }
  8783. if(class9_1.centerText)
  8784. textDrawingArea.method382(i4, k2 + class9_1.width / 2, s1, l6, class9_1.textShadow);
  8785. else
  8786. textDrawingArea.method389(class9_1.textShadow, k2, i4, s1, l6);
  8787. }
  8788. } else if(class9_1.type == 5) {
  8789. Sprite sprite;
  8790. if(interfaceIsSelected(class9_1))
  8791. sprite = class9_1.sprite2;
  8792. else
  8793. sprite = class9_1.sprite1;
  8794. if(spellSelected == 1 && class9_1.id == spellID && spellID != 0 && sprite != null) {
  8795. sprite.drawSprite(k2, l2, 0xffffff);
  8796. } else {
  8797. if (sprite != null)
  8798. sprite.drawSprite(k2, l2);
  8799. }
  8800. if(sprite != null)
  8801. sprite.drawSprite(k2, l2);
  8802. } else if(class9_1.type == 6) {
  8803. int k3 = Texture.textureInt1;
  8804. int j4 = Texture.textureInt2;
  8805. Texture.textureInt1 = k2 + class9_1.width / 2;
  8806. Texture.textureInt2 = l2 + class9_1.height / 2;
  8807. int i5 = Texture.anIntArray1470[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  8808. int l5 = Texture.anIntArray1471[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  8809. boolean flag2 = interfaceIsSelected(class9_1);
  8810. int i7;
  8811. if(flag2)
  8812. i7 = class9_1.anInt258;
  8813. else
  8814. i7 = class9_1.anInt257;
  8815. Model model;
  8816. if(i7 == -1) {
  8817. model = class9_1.method209(-1, -1, flag2);
  8818. } else {
  8819. Animation animation = Animation.anims[i7];
  8820. model = class9_1.method209(animation.anIntArray354[class9_1.anInt246], animation.anIntArray353[class9_1.anInt246], flag2);
  8821. }
  8822. if(model != null)
  8823. model.method482(class9_1.modelRotation2, 0, class9_1.modelRotation1, 0, i5, l5);
  8824. Texture.textureInt1 = k3;
  8825. Texture.textureInt2 = j4;
  8826. } else if(class9_1.type == 7) {
  8827. TextDrawingArea textDrawingArea_1 = class9_1.textDrawingAreas;
  8828. int k4 = 0;
  8829. for(int j5 = 0; j5 < class9_1.height; j5++) {
  8830. for(int i6 = 0; i6 < class9_1.width; i6++) {
  8831. if(class9_1.inv[k4] > 0) {
  8832. ItemDef itemDef = ItemDef.forID(class9_1.inv[k4] - 1);
  8833. String s2 = itemDef.name;
  8834. if(itemDef.stackable || class9_1.invStackSizes[k4] != 1)
  8835. s2 = s2 + " x" + intToKOrMilLongName(class9_1.invStackSizes[k4]);
  8836. int i9 = k2 + i6 * (115 + class9_1.invSpritePadX);
  8837. int k9 = l2 + j5 * (12 + class9_1.invSpritePadY);
  8838. if(class9_1.centerText)
  8839. textDrawingArea_1.method382(class9_1.textColor, i9 + class9_1.width / 2, s2, k9, class9_1.textShadow);
  8840. else
  8841. textDrawingArea_1.method389(class9_1.textShadow, i9, class9_1.textColor, s2, k9);
  8842. }
  8843. k4++;
  8844. }
  8845. }
  8846. } else if (class9_1.type == 8) {
  8847. drawHoverBox(k2, l2, class9_1.popupString);
  8848. }
  8849. }
  8850. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  8851. }
  8852.  
  8853. private void randomizeBackground(Background background) {
  8854. int j = 256;
  8855. for(int k = 0; k < anIntArray1190.length; k++)
  8856. anIntArray1190[k] = 0;
  8857.  
  8858. for(int l = 0; l < 5000; l++) {
  8859. int i1 = (int)(Math.random() * 128D * (double)j);
  8860. anIntArray1190[i1] = (int)(Math.random() * 256D);
  8861. }
  8862. for(int j1 = 0; j1 < 20; j1++) {
  8863. for(int k1 = 1; k1 < j - 1; k1++) {
  8864. for(int i2 = 1; i2 < 127; i2++) {
  8865. int k2 = i2 + (k1 << 7);
  8866. anIntArray1191[k2] = (anIntArray1190[k2 - 1] + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128] + anIntArray1190[k2 + 128]) / 4;
  8867. }
  8868.  
  8869. }
  8870. int ai[] = anIntArray1190;
  8871. anIntArray1190 = anIntArray1191;
  8872. anIntArray1191 = ai;
  8873. }
  8874. if(background != null) {
  8875. int l1 = 0;
  8876. for(int j2 = 0; j2 < background.anInt1453; j2++) {
  8877. for(int l2 = 0; l2 < background.anInt1452; l2++)
  8878. if(background.aByteArray1450[l1++] != 0) {
  8879. int i3 = l2 + 16 + background.anInt1454;
  8880. int j3 = j2 + 16 + background.anInt1455;
  8881. int k3 = i3 + (j3 << 7);
  8882. anIntArray1190[k3] = 0;
  8883. }
  8884. }
  8885. }
  8886. }
  8887.  
  8888. private void method107(int i, int j, Stream stream, Player player)
  8889. {
  8890. if((i & 0x400) != 0)
  8891. {
  8892. player.anInt1543 = stream.method428();
  8893. player.anInt1545 = stream.method428();
  8894. player.anInt1544 = stream.method428();
  8895. player.anInt1546 = stream.method428();
  8896. player.anInt1547 = stream.method436() + loopCycle;
  8897. player.anInt1548 = stream.method435() + loopCycle;
  8898. player.anInt1549 = stream.method428();
  8899. player.method446();
  8900. }
  8901. if((i & 0x100) != 0)
  8902. {
  8903. player.anInt1520 = stream.method434();
  8904. int k = stream.readDWord();
  8905. player.anInt1524 = k >> 16;
  8906. player.anInt1523 = loopCycle + (k & 0xffff);
  8907. player.anInt1521 = 0;
  8908. player.anInt1522 = 0;
  8909. if(player.anInt1523 > loopCycle)
  8910. player.anInt1521 = -1;
  8911. if(player.anInt1520 == 65535)
  8912. player.anInt1520 = -1;
  8913. }
  8914. if((i & 8) != 0)
  8915. {
  8916. int l = stream.method434();
  8917. if(l == 65535)
  8918. l = -1;
  8919. int i2 = stream.method427();
  8920. if(l == player.anim && l != -1)
  8921. {
  8922. int i3 = Animation.anims[l].anInt365;
  8923. if(i3 == 1)
  8924. {
  8925. player.anInt1527 = 0;
  8926. player.anInt1528 = 0;
  8927. player.anInt1529 = i2;
  8928. player.anInt1530 = 0;
  8929. }
  8930. if(i3 == 2)
  8931. player.anInt1530 = 0;
  8932. } else
  8933. if(l == -1 || player.anim == -1 || Animation.anims[l].anInt359 >= Animation.anims[player.anim].anInt359)
  8934. {
  8935. player.anim = l;
  8936. player.anInt1527 = 0;
  8937. player.anInt1528 = 0;
  8938. player.anInt1529 = i2;
  8939. player.anInt1530 = 0;
  8940. player.anInt1542 = player.smallXYIndex;
  8941. }
  8942. }
  8943. if((i & 4) != 0)
  8944. {
  8945. player.textSpoken = stream.readString();
  8946. if(player.textSpoken.charAt(0) == '~')
  8947. {
  8948. player.textSpoken = player.textSpoken.substring(1);
  8949. pushMessage(player.textSpoken, 2, player.name);
  8950. } else
  8951. if(player == myPlayer)
  8952. pushMessage(player.textSpoken, 2, player.name);
  8953. player.anInt1513 = 0;
  8954. player.anInt1531 = 0;
  8955. player.textCycle = 150;
  8956. }
  8957. if((i & 0x80) != 0)
  8958. {
  8959. //right fucking here
  8960. int i1 = stream.method434();
  8961. int j2 = stream.readUnsignedByte();
  8962. int j3 = stream.method427();
  8963. int k3 = stream.currentOffset;
  8964. if(player.name != null && player.visible)
  8965. {
  8966. long l3 = TextClass.longForName(player.name);
  8967. boolean flag = false;
  8968. if(j2 <= 1)
  8969. {
  8970. for(int i4 = 0; i4 < ignoreCount; i4++)
  8971. {
  8972. if(ignoreListAsLongs[i4] != l3)
  8973. continue;
  8974. flag = true;
  8975. break;
  8976. }
  8977.  
  8978. }
  8979. if(!flag && anInt1251 == 0)
  8980. try
  8981. {
  8982. aStream_834.currentOffset = 0;
  8983. stream.method442(j3, 0, aStream_834.buffer);
  8984. aStream_834.currentOffset = 0;
  8985. String s = TextInput.method525(j3, aStream_834);
  8986. //s = Censor.doCensor(s);
  8987. player.textSpoken = s;
  8988. player.anInt1513 = i1 >> 8;
  8989. player.privelage = j2;
  8990. player.anInt1531 = i1 & 0xff;
  8991. player.textCycle = 150;
  8992. if(j2 == 2 || j2 == 3)
  8993. pushMessage(s, 1, "@cr2@" + player.name);
  8994. else if(j2 == 1)
  8995. pushMessage(s, 1, "@cr1@" + player.name);
  8996. else
  8997. pushMessage(s, 2, player.name);
  8998. }
  8999. catch(Exception exception)
  9000. {
  9001. signlink.reporterror("cde2");
  9002. }
  9003. }
  9004. stream.currentOffset = k3 + j3;
  9005. }
  9006. if((i & 1) != 0)
  9007. {
  9008. player.interactingEntity = stream.method434();
  9009. if(player.interactingEntity == 65535)
  9010. player.interactingEntity = -1;
  9011. }
  9012. if((i & 0x10) != 0)
  9013. {
  9014. int j1 = stream.method427();
  9015. byte abyte0[] = new byte[j1];
  9016. Stream stream_1 = new Stream(abyte0);
  9017. stream.readBytes(j1, 0, abyte0);
  9018. aStreamArray895s[j] = stream_1;
  9019. player.updatePlayer(stream_1);
  9020. }
  9021. if((i & 2) != 0)
  9022. {
  9023. player.anInt1538 = stream.method436();
  9024. player.anInt1539 = stream.method434();
  9025. }
  9026. if((i & 0x20) != 0)
  9027. {
  9028. int k1 = stream.readUnsignedByte();
  9029. int k2 = stream.method426();
  9030. player.updateHitData(k2, k1, loopCycle);
  9031. player.loopCycleStatus = loopCycle + 300;
  9032. player.currentHealth = stream.method427();
  9033. player.maxHealth = stream.readUnsignedByte();
  9034. }
  9035. if((i & 0x200) != 0)
  9036. {
  9037. int l1 = stream.readUnsignedByte();
  9038. int l2 = stream.method428();
  9039. player.updateHitData(l2, l1, loopCycle);
  9040. player.loopCycleStatus = loopCycle + 300;
  9041. player.currentHealth = stream.readUnsignedByte();
  9042. player.maxHealth = stream.method427();
  9043. }
  9044. }
  9045.  
  9046. private void method108()
  9047. {
  9048. try
  9049. {
  9050. int j = myPlayer.x + anInt1278;
  9051. int k = myPlayer.y + anInt1131;
  9052. if(anInt1014 - j < -500 || anInt1014 - j > 500 || anInt1015 - k < -500 || anInt1015 - k > 500)
  9053. {
  9054. anInt1014 = j;
  9055. anInt1015 = k;
  9056. }
  9057. if(anInt1014 != j)
  9058. anInt1014 += (j - anInt1014) / 16;
  9059. if(anInt1015 != k)
  9060. anInt1015 += (k - anInt1015) / 16;
  9061. if(super.keyArray[1] == 1)
  9062. anInt1186 += (-24 - anInt1186) / 2;
  9063. else
  9064. if(super.keyArray[2] == 1)
  9065. anInt1186 += (24 - anInt1186) / 2;
  9066. else
  9067. anInt1186 /= 2;
  9068. if(super.keyArray[3] == 1)
  9069. anInt1187 += (12 - anInt1187) / 2;
  9070. else
  9071. if(super.keyArray[4] == 1)
  9072. anInt1187 += (-12 - anInt1187) / 2;
  9073. else
  9074. anInt1187 /= 2;
  9075. minimapInt1 = minimapInt1 + anInt1186 / 2 & 0x7ff;
  9076. anInt1184 += anInt1187 / 2;
  9077. if(anInt1184 < 128)
  9078. anInt1184 = 128;
  9079. if(anInt1184 > 383)
  9080. anInt1184 = 383;
  9081. int l = anInt1014 >> 7;
  9082. int i1 = anInt1015 >> 7;
  9083. int j1 = method42(plane, anInt1015, anInt1014);
  9084. int k1 = 0;
  9085. if(l > 3 && i1 > 3 && l < 100 && i1 < 100)
  9086. {
  9087. for(int l1 = l - 4; l1 <= l + 4; l1++)
  9088. {
  9089. for(int k2 = i1 - 4; k2 <= i1 + 4; k2++)
  9090. {
  9091. int l2 = plane;
  9092. if(l2 < 3 && (byteGroundArray[1][l1][k2] & 2) == 2)
  9093. l2++;
  9094. int i3 = j1 - intGroundArray[l2][l1][k2];
  9095. if(i3 > k1)
  9096. k1 = i3;
  9097. }
  9098.  
  9099. }
  9100.  
  9101. }
  9102. anInt1005++;
  9103. if(anInt1005 > 1512)
  9104. {
  9105. anInt1005 = 0;
  9106. stream.createFrame(77);
  9107. stream.writeWordBigEndian(0);
  9108. int i2 = stream.currentOffset;
  9109. stream.writeWordBigEndian((int)(Math.random() * 256D));
  9110. stream.writeWordBigEndian(101);
  9111. stream.writeWordBigEndian(233);
  9112. stream.writeWord(45092);
  9113. if((int)(Math.random() * 2D) == 0)
  9114. stream.writeWord(35784);
  9115. stream.writeWordBigEndian((int)(Math.random() * 256D));
  9116. stream.writeWordBigEndian(64);
  9117. stream.writeWordBigEndian(38);
  9118. stream.writeWord((int)(Math.random() * 65536D));
  9119. stream.writeWord((int)(Math.random() * 65536D));
  9120. stream.writeBytes(stream.currentOffset - i2);
  9121. }
  9122. int j2 = k1 * 192;
  9123. if(j2 > 0x17f00)
  9124. j2 = 0x17f00;
  9125. if(j2 < 32768)
  9126. j2 = 32768;
  9127. if(j2 > anInt984)
  9128. {
  9129. anInt984 += (j2 - anInt984) / 24;
  9130. return;
  9131. }
  9132. if(j2 < anInt984)
  9133. {
  9134. anInt984 += (j2 - anInt984) / 80;
  9135. }
  9136. }
  9137. catch(Exception _ex)
  9138. {
  9139. signlink.reporterror("glfc_ex " + myPlayer.x + "," + myPlayer.y + "," + anInt1014 + "," + anInt1015 + "," + anInt1069 + "," + anInt1070 + "," + baseX + "," + baseY);
  9140. throw new RuntimeException("eek");
  9141. }
  9142. }
  9143.  
  9144. public void processDrawing()
  9145. {
  9146. if(rsAlreadyLoaded || loadingError || genericLoadingError)
  9147. {
  9148. showErrorScreen();
  9149. return;
  9150. }
  9151. anInt1061++;
  9152. if(!loggedIn)
  9153. drawLoginScreen(false);
  9154. else
  9155. drawGameScreen();
  9156. anInt1213 = 0;
  9157. }
  9158.  
  9159. private boolean isFriendOrSelf(String s)
  9160. {
  9161. if(s == null)
  9162. return false;
  9163. for(int i = 0; i < friendsCount; i++)
  9164. if(s.equalsIgnoreCase(friendsList[i]))
  9165. return true;
  9166. return s.equalsIgnoreCase(myPlayer.name);
  9167. }
  9168.  
  9169. private static String combatDiffColor(int i, int j)
  9170. {
  9171. int k = i - j;
  9172. if(k < -9)
  9173. return "@red@";
  9174. if(k < -6)
  9175. return "@or3@";
  9176. if(k < -3)
  9177. return "@or2@";
  9178. if(k < 0)
  9179. return "@or1@";
  9180. if(k > 9)
  9181. return "@gre@";
  9182. if(k > 6)
  9183. return "@gr3@";
  9184. if(k > 3)
  9185. return "@gr2@";
  9186. if(k > 0)
  9187. return "@gr1@";
  9188. else
  9189. return "@yel@";
  9190. }
  9191.  
  9192. private void setWaveVolume(int i)
  9193. {
  9194. signlink.wavevol = i;
  9195. }
  9196.  
  9197. private void draw3dScreen()
  9198. {
  9199. drawSplitPrivateChat();
  9200. if(crossType == 1)
  9201. {
  9202. crosses[crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  9203. anInt1142++;
  9204. if(anInt1142 > 67)
  9205. {
  9206. anInt1142 = 0;
  9207. stream.createFrame(78);
  9208. }
  9209. }
  9210. if(crossType == 2)
  9211. crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  9212. if(anInt1018 != -1)
  9213. {
  9214. method119(anInt945, anInt1018);
  9215. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 0);
  9216. }
  9217. if(openInterfaceID != -1)
  9218. {
  9219. method119(anInt945, openInterfaceID);
  9220. drawInterface(0, 0, RSInterface.interfaceCache[openInterfaceID], 0);
  9221. }
  9222. method70();
  9223. if(!menuOpen)
  9224. {
  9225. processRightClick();
  9226. drawTooltip();
  9227. } else
  9228. if(menuScreenArea == 0)
  9229. drawMenu();
  9230. if(anInt1055 == 1)
  9231. multiOverlay.drawSprite(472, 296);
  9232. if(fpsOn)
  9233. {
  9234. char c = '\u01FB';
  9235. int k = 20;
  9236. int i1 = 0xffff00;
  9237. if(super.fps < 15)
  9238. i1 = 0xff0000;
  9239. aTextDrawingArea_1271.method380("Fps:" + super.fps, c, i1, k);
  9240. k += 15;
  9241. Runtime runtime = Runtime.getRuntime();
  9242. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  9243. i1 = 0xffff00;
  9244. if(j1 > 0x2000000 && lowMem)
  9245. i1 = 0xff0000;
  9246. aTextDrawingArea_1271.method380("Mem:" + j1 + "k", c, 0xffff00, k);
  9247. k += 15;
  9248. }
  9249. int i1 = 0xffff00;
  9250. int x = baseX + (myPlayer.x - 6 >> 7);
  9251. int y = baseY + (myPlayer.y - 6 >> 7);
  9252. if (clientData)
  9253. {
  9254. char c = '\u01FB';
  9255. int k = 20;
  9256. if(super.fps < 15)
  9257. i1 = 0xff0000;
  9258. aTextDrawingArea_1271.method385(0xffff00, "Fps: " + super.fps, 285, 5);
  9259. Runtime runtime = Runtime.getRuntime();
  9260. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  9261. i1 = 0xffff00;
  9262. if(j1 > 0x2000000 && lowMem)
  9263. i1 = 0xff0000;
  9264. k += 15;
  9265. aTextDrawingArea_1271.method385(0xffff00, "Mem: " + j1 + "k", 299, 5);
  9266. aTextDrawingArea_1271.method385(0xffff00, "Mouse X: " + super.mouseX + " , Mouse Y: " + super.mouseY, 314, 5);
  9267. aTextDrawingArea_1271.method385(0xffff00, "Coords: " + x + ", " + y, 329, 5);
  9268. }
  9269. if(anInt1104 != 0)
  9270. {
  9271. int j = anInt1104 / 50;
  9272. int l = j / 60;
  9273. j %= 60;
  9274. if(j < 10)
  9275. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":0" + j, 329, 4);
  9276. else
  9277. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":" + j, 329, 4);
  9278. anInt849++;
  9279. if(anInt849 > 75)
  9280. {
  9281. anInt849 = 0;
  9282. stream.createFrame(148);
  9283. }
  9284. }
  9285. }
  9286.  
  9287. private void addIgnore(long l)
  9288. {
  9289. try
  9290. {
  9291. if(l == 0L)
  9292. return;
  9293. if(ignoreCount >= 100)
  9294. {
  9295. pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
  9296. return;
  9297. }
  9298. String s = TextClass.fixName(TextClass.nameForLong(l));
  9299. for(int j = 0; j < ignoreCount; j++)
  9300. if(ignoreListAsLongs[j] == l)
  9301. {
  9302. pushMessage(s + " is already on your ignore list", 0, "");
  9303. return;
  9304. }
  9305. for(int k = 0; k < friendsCount; k++)
  9306. if(friendsListAsLongs[k] == l)
  9307. {
  9308. pushMessage("Please remove " + s + " from your friend list first", 0, "");
  9309. return;
  9310. }
  9311.  
  9312. ignoreListAsLongs[ignoreCount++] = l;
  9313. needDrawTabArea = true;
  9314. stream.createFrame(133);
  9315. stream.writeQWord(l);
  9316. return;
  9317. }
  9318. catch(RuntimeException runtimeexception)
  9319. {
  9320. signlink.reporterror("45688, " + l + ", " + 4 + ", " + runtimeexception.toString());
  9321. }
  9322. throw new RuntimeException();
  9323. }
  9324.  
  9325. private void method114()
  9326. {
  9327. for(int i = -1; i < playerCount; i++)
  9328. {
  9329. int j;
  9330. if(i == -1)
  9331. j = myPlayerIndex;
  9332. else
  9333. j = playerIndices[i];
  9334. Player player = playerArray[j];
  9335. if(player != null)
  9336. method96(player);
  9337. }
  9338.  
  9339. }
  9340.  
  9341. private void method115()
  9342. {
  9343. if(loadingStage == 2)
  9344. {
  9345. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  9346. {
  9347. if(class30_sub1.anInt1294 > 0)
  9348. class30_sub1.anInt1294--;
  9349. if(class30_sub1.anInt1294 == 0)
  9350. {
  9351. if(class30_sub1.anInt1299 < 0 || ObjectManager.method178(class30_sub1.anInt1299, class30_sub1.anInt1301))
  9352. {
  9353. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1300, class30_sub1.anInt1301, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1299);
  9354. class30_sub1.unlink();
  9355. }
  9356. } else
  9357. {
  9358. if(class30_sub1.anInt1302 > 0)
  9359. class30_sub1.anInt1302--;
  9360. 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)))
  9361. {
  9362. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1292, class30_sub1.anInt1293, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1291);
  9363. class30_sub1.anInt1302 = -1;
  9364. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1299 == -1)
  9365. class30_sub1.unlink();
  9366. else
  9367. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1292 == class30_sub1.anInt1300 && class30_sub1.anInt1293 == class30_sub1.anInt1301)
  9368. class30_sub1.unlink();
  9369. }
  9370. }
  9371. }
  9372.  
  9373. }
  9374. }
  9375.  
  9376.  
  9377. //stops the click from going over sprite
  9378. private void determineMenuSize()
  9379. {
  9380. int i = chatTextDrawingArea.getTextWidth("Choose Option");
  9381. for(int j = 0; j < menuActionRow; j++)
  9382. {
  9383. int k = chatTextDrawingArea.getTextWidth(menuActionName[j]);
  9384. if(k > i)
  9385. i = k;
  9386. }
  9387.  
  9388. i += 8;
  9389. int l = 15 * menuActionRow + 21;
  9390. if(super.saveClickX > 4 && super.saveClickY > 4 && super.saveClickX < 516 && super.saveClickY < 338)
  9391. {
  9392. int i1 = super.saveClickX - 4 - i / 2;
  9393. if(i1 + i > 512)
  9394. i1 = 512 - i;
  9395. if(i1 < 0)
  9396. i1 = 0;
  9397. int l1 = super.saveClickY - 4;
  9398. if(l1 + l > 334)
  9399. l1 = 334 - l;
  9400. if(l1 < 0)
  9401. l1 = 0;
  9402. menuOpen = true;
  9403. menuScreenArea = 0;
  9404. menuOffsetX = i1;
  9405. menuOffsetY = l1;
  9406. menuWidth = i;
  9407. menuHeight = 15 * menuActionRow + 22;
  9408. }
  9409. if(super.saveClickX > 519 && super.saveClickY > 168 && super.saveClickX < 765 && super.saveClickY < 503)
  9410. {
  9411. int j1 = super.saveClickX - 519 - i / 2;
  9412. if(j1 < 0)
  9413. j1 = 0;
  9414. else
  9415. if(j1 + i > 245)
  9416. j1 = 245 - i;
  9417. int i2 = super.saveClickY - 168;
  9418. if(i2 < 0)
  9419. i2 = 0;
  9420. else
  9421. if(i2 + l > 333)
  9422. i2 = 333 - l;
  9423. menuOpen = true;
  9424. menuScreenArea = 1;
  9425. menuOffsetX = j1;
  9426. menuOffsetY = i2;
  9427. menuWidth = i;
  9428. menuHeight = 15 * menuActionRow + 22;
  9429. }
  9430. if(super.saveClickX > 0 && super.saveClickY > 338 && super.saveClickX < 516 && super.saveClickY < 503)
  9431. {
  9432. int k1 = super.saveClickX - 0 - i / 2;
  9433. if(k1 < 0)
  9434. k1 = 0;
  9435. else
  9436. if(k1 + i > 516)
  9437. k1 = 516 - i;
  9438. int j2 = super.saveClickY - 338;
  9439. if(j2 < 0)
  9440. j2 = 0;
  9441. else
  9442. if(j2 + l > 165)
  9443. j2 = 165 - l;
  9444. menuOpen = true;
  9445. menuScreenArea = 2;
  9446. menuOffsetX = k1;
  9447. menuOffsetY = j2;
  9448. menuWidth = i;
  9449. menuHeight = 15 * menuActionRow + 22;
  9450. }
  9451. }
  9452.  
  9453. private void method117(Stream stream)
  9454. {
  9455. stream.initBitAccess();
  9456. int j = stream.readBits(1);
  9457. if(j == 0)
  9458. return;
  9459. int k = stream.readBits(2);
  9460. if(k == 0)
  9461. {
  9462. anIntArray894[anInt893++] = myPlayerIndex;
  9463. return;
  9464. }
  9465. if(k == 1)
  9466. {
  9467. int l = stream.readBits(3);
  9468. myPlayer.moveInDir(false, l);
  9469. int k1 = stream.readBits(1);
  9470. if(k1 == 1)
  9471. anIntArray894[anInt893++] = myPlayerIndex;
  9472. return;
  9473. }
  9474. if(k == 2)
  9475. {
  9476. int i1 = stream.readBits(3);
  9477. myPlayer.moveInDir(true, i1);
  9478. int l1 = stream.readBits(3);
  9479. myPlayer.moveInDir(true, l1);
  9480. int j2 = stream.readBits(1);
  9481. if(j2 == 1)
  9482. anIntArray894[anInt893++] = myPlayerIndex;
  9483. return;
  9484. }
  9485. if(k == 3)
  9486. {
  9487. plane = stream.readBits(2);
  9488. int j1 = stream.readBits(1);
  9489. int i2 = stream.readBits(1);
  9490. if(i2 == 1)
  9491. anIntArray894[anInt893++] = myPlayerIndex;
  9492. int k2 = stream.readBits(7);
  9493. int l2 = stream.readBits(7);
  9494. myPlayer.setPos(l2, k2, j1 == 1);
  9495. }
  9496. }
  9497.  
  9498. private void nullLoader()
  9499. {
  9500. aBoolean831 = false;
  9501. while(drawingFlames)
  9502. {
  9503. aBoolean831 = false;
  9504. try
  9505. {
  9506. Thread.sleep(50L);
  9507. }
  9508. catch(Exception _ex) { }
  9509. }
  9510. aBackground_966 = null;
  9511. aBackground_967 = null;
  9512. aBackgroundArray1152s = null;
  9513. anIntArray850 = null;
  9514. anIntArray851 = null;
  9515. anIntArray852 = null;
  9516. anIntArray853 = null;
  9517. anIntArray1190 = null;
  9518. anIntArray1191 = null;
  9519. anIntArray828 = null;
  9520. anIntArray829 = null;
  9521. aClass30_Sub2_Sub1_Sub1_1201 = null;
  9522. aClass30_Sub2_Sub1_Sub1_1202 = null;
  9523. }
  9524.  
  9525. private boolean method119(int i, int j)
  9526. {
  9527. boolean flag1 = false;
  9528. RSInterface class9 = RSInterface.interfaceCache[j];
  9529. for(int k = 0; k < class9.children.length; k++)
  9530. {
  9531. if(class9.children[k] == -1)
  9532. break;
  9533. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
  9534. if(class9_1.type == 1)
  9535. flag1 |= method119(i, class9_1.id);
  9536. if(class9_1.type == 6 && (class9_1.anInt257 != -1 || class9_1.anInt258 != -1))
  9537. {
  9538. boolean flag2 = interfaceIsSelected(class9_1);
  9539. int l;
  9540. if(flag2)
  9541. l = class9_1.anInt258;
  9542. else
  9543. l = class9_1.anInt257;
  9544. if(l != -1)
  9545. {
  9546. Animation animation = Animation.anims[l];
  9547. for(class9_1.anInt208 += i; class9_1.anInt208 > animation.method258(class9_1.anInt246);)
  9548. {
  9549. class9_1.anInt208 -= animation.method258(class9_1.anInt246) + 1;
  9550. class9_1.anInt246++;
  9551. if(class9_1.anInt246 >= animation.anInt352)
  9552. {
  9553. class9_1.anInt246 -= animation.anInt356;
  9554. if(class9_1.anInt246 < 0 || class9_1.anInt246 >= animation.anInt352)
  9555. class9_1.anInt246 = 0;
  9556. }
  9557. flag1 = true;
  9558. }
  9559.  
  9560. }
  9561. }
  9562. }
  9563.  
  9564. return flag1;
  9565. }
  9566.  
  9567. private int method120()
  9568. {
  9569. int j = 3;
  9570. if(yCameraCurve < 310)
  9571. {
  9572. int k = xCameraPos >> 7;
  9573. int l = yCameraPos >> 7;
  9574. int i1 = myPlayer.x >> 7;
  9575. int j1 = myPlayer.y >> 7;
  9576. if((byteGroundArray[plane][k][l] & 4) != 0)
  9577. j = plane;
  9578. int k1;
  9579. if(i1 > k)
  9580. k1 = i1 - k;
  9581. else
  9582. k1 = k - i1;
  9583. int l1;
  9584. if(j1 > l)
  9585. l1 = j1 - l;
  9586. else
  9587. l1 = l - j1;
  9588. if(k1 > l1)
  9589. {
  9590. int i2 = (l1 * 0x10000) / k1;
  9591. int k2 = 32768;
  9592. while(k != i1)
  9593. {
  9594. if(k < i1)
  9595. k++;
  9596. else
  9597. if(k > i1)
  9598. k--;
  9599. if((byteGroundArray[plane][k][l] & 4) != 0)
  9600. j = plane;
  9601. k2 += i2;
  9602. if(k2 >= 0x10000)
  9603. {
  9604. k2 -= 0x10000;
  9605. if(l < j1)
  9606. l++;
  9607. else
  9608. if(l > j1)
  9609. l--;
  9610. if((byteGroundArray[plane][k][l] & 4) != 0)
  9611. j = plane;
  9612. }
  9613. }
  9614. } else
  9615. {
  9616. int j2 = (k1 * 0x10000) / l1;
  9617. int l2 = 32768;
  9618. while(l != j1)
  9619. {
  9620. if(l < j1)
  9621. l++;
  9622. else
  9623. if(l > j1)
  9624. l--;
  9625. if((byteGroundArray[plane][k][l] & 4) != 0)
  9626. j = plane;
  9627. l2 += j2;
  9628. if(l2 >= 0x10000)
  9629. {
  9630. l2 -= 0x10000;
  9631. if(k < i1)
  9632. k++;
  9633. else
  9634. if(k > i1)
  9635. k--;
  9636. if((byteGroundArray[plane][k][l] & 4) != 0)
  9637. j = plane;
  9638. }
  9639. }
  9640. }
  9641. }
  9642. if((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
  9643. j = plane;
  9644. return j;
  9645. }
  9646.  
  9647. private int method121()
  9648. {
  9649. int j = method42(plane, yCameraPos, xCameraPos);
  9650. if(j - zCameraPos < 800 && (byteGroundArray[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
  9651. return plane;
  9652. else
  9653. return 3;
  9654. }
  9655.  
  9656. private void delIgnore(long l)
  9657. {
  9658. try
  9659. {
  9660. if(l == 0L)
  9661. return;
  9662. for(int j = 0; j < ignoreCount; j++)
  9663. if(ignoreListAsLongs[j] == l)
  9664. {
  9665. ignoreCount--;
  9666. needDrawTabArea = true;
  9667. System.arraycopy(ignoreListAsLongs, j + 1, ignoreListAsLongs, j, ignoreCount - j);
  9668.  
  9669. stream.createFrame(74);
  9670. stream.writeQWord(l);
  9671. return;
  9672. }
  9673.  
  9674. return;
  9675. }
  9676. catch(RuntimeException runtimeexception)
  9677. {
  9678. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  9679. }
  9680. throw new RuntimeException();
  9681. }
  9682.  
  9683.  
  9684. private void chatJoin(long l) {
  9685. try {
  9686. if(l == 0L)
  9687. return;
  9688. stream.createFrame(60);
  9689. stream.writeQWord(l);
  9690. return;
  9691. }
  9692. catch(RuntimeException runtimeexception)
  9693. {
  9694. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  9695. }
  9696. throw new RuntimeException();
  9697.  
  9698. }
  9699.  
  9700. public String getParameter(String s)
  9701. {
  9702. if(signlink.mainapp != null)
  9703. return signlink.mainapp.getParameter(s);
  9704. else
  9705. return super.getParameter(s);
  9706. }
  9707.  
  9708. private void adjustVolume(boolean flag, int i)
  9709. {
  9710. signlink.midivol = i;
  9711. if(flag)
  9712. signlink.midi = "voladjust";
  9713. }
  9714.  
  9715. private int extractInterfaceValues(RSInterface class9, int j)
  9716. {
  9717. if(class9.valueIndexArray == null || j >= class9.valueIndexArray.length)
  9718. return -2;
  9719. try
  9720. {
  9721. int ai[] = class9.valueIndexArray[j];
  9722. int k = 0;
  9723. int l = 0;
  9724. int i1 = 0;
  9725. do
  9726. {
  9727. int j1 = ai[l++];
  9728. int k1 = 0;
  9729. byte byte0 = 0;
  9730. if(j1 == 0)
  9731. return k;
  9732. if(j1 == 1)
  9733. k1 = currentStats[ai[l++]];
  9734. if(j1 == 2)
  9735. k1 = maxStats[ai[l++]];
  9736. if(j1 == 3)
  9737. k1 = currentExp[ai[l++]];
  9738. if(j1 == 4)
  9739. {
  9740. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  9741. int k2 = ai[l++];
  9742. if(k2 >= 0 && k2 < ItemDef.totalItems && (!ItemDef.forID(k2).membersObject || isMembers))
  9743. {
  9744. for(int j3 = 0; j3 < class9_1.inv.length; j3++)
  9745. if(class9_1.inv[j3] == k2 + 1)
  9746. k1 += class9_1.invStackSizes[j3];
  9747.  
  9748. }
  9749. }
  9750. if(j1 == 5)
  9751. k1 = variousSettings[ai[l++]];
  9752. if(j1 == 6)
  9753. k1 = anIntArray1019[maxStats[ai[l++]] - 1];
  9754. if(j1 == 7)
  9755. k1 = (variousSettings[ai[l++]] * 100) / 46875;
  9756. if(j1 == 8)
  9757. k1 = myPlayer.combatLevel;
  9758. if(j1 == 9)
  9759. {
  9760. for(int l1 = 0; l1 < Skills.skillsCount; l1++)
  9761. if(Skills.skillEnabled[l1])
  9762. k1 += maxStats[l1];
  9763.  
  9764. }
  9765. if(j1 == 10)
  9766. {
  9767. RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
  9768. int l2 = ai[l++] + 1;
  9769. if(l2 >= 0 && l2 < ItemDef.totalItems && (!ItemDef.forID(l2).membersObject || isMembers))
  9770. {
  9771. for(int k3 = 0; k3 < class9_2.inv.length; k3++)
  9772. {
  9773. if(class9_2.inv[k3] != l2)
  9774. continue;
  9775. k1 = 0x3b9ac9ff;
  9776. break;
  9777. }
  9778.  
  9779. }
  9780. }
  9781. if(j1 == 11)
  9782. k1 = energy;
  9783. if(j1 == 12)
  9784. k1 = weight;
  9785. if(j1 == 13)
  9786. {
  9787. int i2 = variousSettings[ai[l++]];
  9788. int i3 = ai[l++];
  9789. k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  9790. }
  9791. if(j1 == 14)
  9792. {
  9793. int j2 = ai[l++];
  9794. VarBit varBit = VarBit.cache[j2];
  9795. int l3 = varBit.anInt648;
  9796. int i4 = varBit.anInt649;
  9797. int j4 = varBit.anInt650;
  9798. int k4 = anIntArray1232[j4 - i4];
  9799. k1 = variousSettings[l3] >> i4 & k4;
  9800. }
  9801. if(j1 == 15)
  9802. byte0 = 1;
  9803. if(j1 == 16)
  9804. byte0 = 2;
  9805. if(j1 == 17)
  9806. byte0 = 3;
  9807. if(j1 == 18)
  9808. k1 = (myPlayer.x >> 7) + baseX;
  9809. if(j1 == 19)
  9810. k1 = (myPlayer.y >> 7) + baseY;
  9811. if(j1 == 20)
  9812. k1 = ai[l++];
  9813. if(byte0 == 0)
  9814. {
  9815. if(i1 == 0)
  9816. k += k1;
  9817. if(i1 == 1)
  9818. k -= k1;
  9819. if(i1 == 2 && k1 != 0)
  9820. k /= k1;
  9821. if(i1 == 3)
  9822. k *= k1;
  9823. i1 = 0;
  9824. } else
  9825. {
  9826. i1 = byte0;
  9827. }
  9828. } while(true);
  9829. }
  9830. catch(Exception _ex)
  9831. {
  9832. return -1;
  9833. }
  9834. }
  9835.  
  9836. private void drawTooltip() {
  9837. if(menuActionRow < 2 && itemSelected == 0 && spellSelected == 0)
  9838. return;
  9839. String s;
  9840. if(itemSelected == 1 && menuActionRow < 2)
  9841. s = "Use " + selectedItemName + " with...";
  9842. else if(spellSelected == 1 && menuActionRow < 2)
  9843. s = spellTooltip + "...";
  9844. else
  9845. s = menuActionName[menuActionRow - 1];
  9846. if(menuActionRow > 2)
  9847. s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
  9848. chatTextDrawingArea.method390(4, 0xffffff, s, loopCycle / 1000, 15);
  9849. }
  9850.  
  9851. private void drawMinimap() {
  9852. aRSImageProducer_1164.initDrawingArea();
  9853. if(anInt1021 == 2) {
  9854. byte abyte0[] = mapBack.aByteArray1450;
  9855. int ai[] = DrawingArea.pixels;
  9856. int k2 = abyte0.length;
  9857. for(int i5 = 0; i5 < k2; i5++)
  9858. if(abyte0[i5] == 0)
  9859. ai[i5] = 0;
  9860. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, 8, 8, 33, 25);
  9861. aRSImageProducer_1165.initDrawingArea();
  9862. return;
  9863. }
  9864. int i = minimapInt1 + minimapInt2 & 0x7ff;
  9865. int j = 48 + myPlayer.x / 32;
  9866. int l2 = 464 - myPlayer.y / 32;
  9867. for (int x = 0; x < anIntArray1229.length; x++){
  9868. anIntArray1229[x] = 170;
  9869. anIntArray1052[x] = -23;
  9870. }
  9871. aClass30_Sub2_Sub1_Sub1_1263.method352(151, i, anIntArray1229, 256 + minimapInt3, anIntArray1052, l2, 10, 45, 146, j);
  9872. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, 8, 8, 33, 25);
  9873. for(int j5 = 0; j5 < anInt1071; j5++) {
  9874. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  9875. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  9876. markMinimap(aClass30_Sub2_Sub1_Sub1Array1140[j5], k, i3);
  9877. }
  9878.  
  9879. for(int k5 = 0; k5 < 104; k5++) {
  9880. for(int l5 = 0; l5 < 104; l5++) {
  9881. NodeList class19 = groundArray[plane][k5][l5];
  9882. if(class19 != null) {
  9883. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  9884. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  9885. markMinimap(mapDotItem, l, j3);
  9886. }
  9887. }
  9888. }
  9889.  
  9890. for(int i6 = 0; i6 < npcCount; i6++) {
  9891. NPC npc = npcArray[npcIndices[i6]];
  9892. if(npc != null && npc.isVisible()) {
  9893. EntityDef entityDef = npc.desc;
  9894. if(entityDef.childrenIDs != null)
  9895. entityDef = entityDef.method161();
  9896. if(entityDef != null && entityDef.aBoolean87 && entityDef.aBoolean84) {
  9897. int i1 = npc.x / 32 - myPlayer.x / 32;
  9898. int k3 = npc.y / 32 - myPlayer.y / 32;
  9899. markMinimap(mapDotNPC, i1, k3);
  9900. }
  9901. }
  9902. }
  9903.  
  9904. for(int j6 = 0; j6 < playerCount; j6++) {
  9905. Player player = playerArray[playerIndices[j6]];
  9906. if(player != null && player.isVisible()) {
  9907. int j1 = player.x / 32 - myPlayer.x / 32;
  9908. int l3 = player.y / 32 - myPlayer.y / 32;
  9909. boolean flag1 = false;
  9910. long l6 = TextClass.longForName(player.name);
  9911. for(int k6 = 0; k6 < friendsCount; k6++) {
  9912. if(l6 != friendsListAsLongs[k6] || friendsNodeIDs[k6] == 0)
  9913. continue;
  9914. flag1 = true;
  9915. break;
  9916. }
  9917. boolean flag2 = false;
  9918. if(myPlayer.team != 0 && player.team != 0 && myPlayer.team == player.team)
  9919. flag2 = true;
  9920. if(flag1)
  9921. markMinimap(mapDotFriend, j1, l3);
  9922. else
  9923. markMinimap(mapDotPlayer, j1, l3);
  9924. }
  9925. }
  9926.  
  9927. if(anInt855 != 0 && loopCycle % 20 < 10) {
  9928. if(anInt855 == 1 && anInt1222 >= 0 && anInt1222 < npcArray.length) {
  9929. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  9930. if(class30_sub2_sub4_sub1_sub1_1 != null)
  9931. {
  9932. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32 - myPlayer.x / 32;
  9933. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32 - myPlayer.y / 32;
  9934. method81(mapMarker, i4, k1);
  9935. }
  9936. }
  9937. if(anInt855 == 2) {
  9938. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  9939. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  9940. method81(mapMarker, j4, l1);
  9941. }
  9942. if(anInt855 == 10 && anInt933 >= 0 && anInt933 < playerArray.length)
  9943. {
  9944. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  9945. if(class30_sub2_sub4_sub1_sub2_1 != null) {
  9946. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32 - myPlayer.x / 32;
  9947. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32 - myPlayer.y / 32;
  9948. method81(mapMarker, k4, i2);
  9949. }
  9950. }
  9951. }
  9952. if(destX != 0) {
  9953. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  9954. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  9955. markMinimap(mapFlag, j2, l4);
  9956. }
  9957. DrawingArea.drawPixels(3, 78+5, 97+20, 0xffffff, 3);
  9958. mapArea.drawSprite(0, 0);
  9959. drawWorldMapButton();
  9960. drawHP();
  9961. drawPrayer();
  9962. drawRunOrb();
  9963. aRSImageProducer_1165.initDrawingArea();
  9964. }
  9965.  
  9966. private void npcScreenPos(Entity entity, int i) {
  9967. calcEntityScreenPos(entity.x, i, entity.y);
  9968. }
  9969.  
  9970. private void calcEntityScreenPos(int i, int j, int l) {
  9971. if(i < 128 || l < 128 || i > 13056 || l > 13056) {
  9972. spriteDrawX = -1;
  9973. spriteDrawY = -1;
  9974. return;
  9975. }
  9976. int i1 = method42(plane, l, i) - j;
  9977. i -= xCameraPos;
  9978. i1 -= zCameraPos;
  9979. l -= yCameraPos;
  9980. int j1 = Model.modelIntArray1[yCameraCurve];
  9981. int k1 = Model.modelIntArray2[yCameraCurve];
  9982. int l1 = Model.modelIntArray1[xCameraCurve];
  9983. int i2 = Model.modelIntArray2[xCameraCurve];
  9984. int j2 = l * l1 + i * i2 >> 16;
  9985. l = l * i2 - i * l1 >> 16;
  9986. i = j2;
  9987. j2 = i1 * k1 - l * j1 >> 16;
  9988. l = i1 * j1 + l * k1 >> 16;
  9989. i1 = j2;
  9990. if(l >= 50) {
  9991. spriteDrawX = Texture.textureInt1 + (i << 9) / l;
  9992. spriteDrawY = Texture.textureInt2 + (i1 << 9) / l;
  9993. } else {
  9994. spriteDrawX = -1;
  9995. spriteDrawY = -1;
  9996. }
  9997. }
  9998.  
  9999. private void buildSplitPrivateChatMenu()
  10000. {
  10001. if(splitPrivateChat == 0)
  10002. return;
  10003. int i = 0;
  10004. if(anInt1104 != 0)
  10005. i = 1;
  10006. for(int j = 0; j < 100; j++)
  10007. if(chatMessages[j] != null)
  10008. {
  10009. int k = chatTypes[j];
  10010. String s = chatNames[j];
  10011. boolean flag1 = false;
  10012. if(s != null && s.startsWith("@cr1@"))
  10013. {
  10014. s = s.substring(5);
  10015. boolean flag2 = true;
  10016. }
  10017. if(s != null && s.startsWith("@cr2@"))
  10018. {
  10019. s = s.substring(5);
  10020. byte byte0 = 2;
  10021. }
  10022. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  10023. {
  10024. int l = 329 - i * 13;
  10025. if(super.mouseX > 4 && super.mouseY - 4 > l - 10 && super.mouseY - 4 <= l + 3)
  10026. {
  10027. int i1 = aTextDrawingArea_1271.getTextWidth("From: " + s + chatMessages[j]) + 25;
  10028. if(i1 > 450)
  10029. i1 = 450;
  10030. if(super.mouseX < 4 + i1)
  10031. {
  10032. if(myPrivilege >= 1)
  10033. {
  10034. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  10035. menuActionID[menuActionRow] = 2606;
  10036. menuActionRow++;
  10037. }
  10038. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  10039. menuActionID[menuActionRow] = 2042;
  10040. menuActionRow++;
  10041. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  10042. menuActionID[menuActionRow] = 2337;
  10043. menuActionRow++;
  10044. }
  10045. }
  10046. if(++i >= 5)
  10047. return;
  10048. }
  10049. if((k == 5 || k == 6) && privateChatMode < 2 && ++i >= 5)
  10050. return;
  10051. }
  10052.  
  10053. }
  10054.  
  10055. private void method130(int j, int k, int l, int i1, int j1, int k1,
  10056. int l1, int i2, int j2)
  10057. {
  10058. Class30_Sub1 class30_sub1 = null;
  10059. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  10060. {
  10061. if(class30_sub1_1.anInt1295 != l1 || class30_sub1_1.anInt1297 != i2 || class30_sub1_1.anInt1298 != j1 || class30_sub1_1.anInt1296 != i1)
  10062. continue;
  10063. class30_sub1 = class30_sub1_1;
  10064. break;
  10065. }
  10066.  
  10067. if(class30_sub1 == null)
  10068. {
  10069. class30_sub1 = new Class30_Sub1();
  10070. class30_sub1.anInt1295 = l1;
  10071. class30_sub1.anInt1296 = i1;
  10072. class30_sub1.anInt1297 = i2;
  10073. class30_sub1.anInt1298 = j1;
  10074. method89(class30_sub1);
  10075. aClass19_1179.insertHead(class30_sub1);
  10076. }
  10077. class30_sub1.anInt1291 = k;
  10078. class30_sub1.anInt1293 = k1;
  10079. class30_sub1.anInt1292 = l;
  10080. class30_sub1.anInt1302 = j2;
  10081. class30_sub1.anInt1294 = j;
  10082. }
  10083.  
  10084. private boolean interfaceIsSelected(RSInterface class9)
  10085. {
  10086. if(class9.anIntArray245 == null)
  10087. return false;
  10088. for(int i = 0; i < class9.anIntArray245.length; i++)
  10089. {
  10090. int j = extractInterfaceValues(class9, i);
  10091. int k = class9.anIntArray212[i];
  10092. if(class9.anIntArray245[i] == 2)
  10093. {
  10094. if(j >= k)
  10095. return false;
  10096. } else
  10097. if(class9.anIntArray245[i] == 3)
  10098. {
  10099. if(j <= k)
  10100. return false;
  10101. } else
  10102. if(class9.anIntArray245[i] == 4)
  10103. {
  10104. if(j == k)
  10105. return false;
  10106. } else
  10107. if(j != k)
  10108. return false;
  10109. }
  10110.  
  10111. return true;
  10112. }
  10113.  
  10114. private DataInputStream openJagGrabInputStream(String s)
  10115. throws IOException
  10116. {
  10117. // if(!aBoolean872)
  10118. // if(signlink.mainapp != null)
  10119. // return signlink.openurl(s);
  10120. // else
  10121. // return new DataInputStream((new URL(getCodeBase(), s)).openStream());
  10122. if(aSocket832 != null)
  10123. {
  10124. try
  10125. {
  10126. aSocket832.close();
  10127. }
  10128. catch(Exception _ex) { }
  10129. aSocket832 = null;
  10130. }
  10131. aSocket832 = openSocket(43594);
  10132. aSocket832.setSoTimeout(10000);
  10133. java.io.InputStream inputstream = aSocket832.getInputStream();
  10134. OutputStream outputstream = aSocket832.getOutputStream();
  10135. outputstream.write(("JAGGRAB /" + s + "\n\n").getBytes());
  10136. return new DataInputStream(inputstream);
  10137. }
  10138.  
  10139. private void doFlamesDrawing()
  10140. {
  10141. char c = '\u0100';
  10142. if(anInt1040 > 0)
  10143. {
  10144. for(int i = 0; i < 256; i++)
  10145. if(anInt1040 > 768)
  10146. anIntArray850[i] = method83(anIntArray851[i], anIntArray852[i], 1024 - anInt1040);
  10147. else
  10148. if(anInt1040 > 256)
  10149. anIntArray850[i] = anIntArray852[i];
  10150. else
  10151. anIntArray850[i] = method83(anIntArray852[i], anIntArray851[i], 256 - anInt1040);
  10152.  
  10153. } else
  10154. if(anInt1041 > 0)
  10155. {
  10156. for(int j = 0; j < 256; j++)
  10157. if(anInt1041 > 768)
  10158. anIntArray850[j] = method83(anIntArray851[j], anIntArray853[j], 1024 - anInt1041);
  10159. else
  10160. if(anInt1041 > 256)
  10161. anIntArray850[j] = anIntArray853[j];
  10162. else
  10163. anIntArray850[j] = method83(anIntArray853[j], anIntArray851[j], 256 - anInt1041);
  10164.  
  10165. } else
  10166. {
  10167. System.arraycopy(anIntArray851, 0, anIntArray850, 0, 256);
  10168.  
  10169. }
  10170. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, aRSImageProducer_1110.anIntArray315, 0, 33920);
  10171.  
  10172. int i1 = 0;
  10173. int j1 = 1152;
  10174. for(int k1 = 1; k1 < c - 1; k1++)
  10175. {
  10176. int l1 = (anIntArray969[k1] * (c - k1)) / c;
  10177. int j2 = 22 + l1;
  10178. if(j2 < 0)
  10179. j2 = 0;
  10180. i1 += j2;
  10181. for(int l2 = j2; l2 < 128; l2++)
  10182. {
  10183. int j3 = anIntArray828[i1++];
  10184. if(j3 != 0)
  10185. {
  10186. int l3 = j3;
  10187. int j4 = 256 - j3;
  10188. j3 = anIntArray850[j3];
  10189. int l4 = aRSImageProducer_1110.anIntArray315[j1];
  10190. aRSImageProducer_1110.anIntArray315[j1++] = ((j3 & 0xff00ff) * l3 + (l4 & 0xff00ff) * j4 & 0xff00ff00) + ((j3 & 0xff00) * l3 + (l4 & 0xff00) * j4 & 0xff0000) >> 8;
  10191. } else
  10192. {
  10193. j1++;
  10194. }
  10195. }
  10196.  
  10197. j1 += j2;
  10198. }
  10199.  
  10200. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  10201. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, aRSImageProducer_1111.anIntArray315, 0, 33920);
  10202.  
  10203. i1 = 0;
  10204. j1 = 1176;
  10205. for(int k2 = 1; k2 < c - 1; k2++)
  10206. {
  10207. int i3 = (anIntArray969[k2] * (c - k2)) / c;
  10208. int k3 = 103 - i3;
  10209. j1 += i3;
  10210. for(int i4 = 0; i4 < k3; i4++)
  10211. {
  10212. int k4 = anIntArray828[i1++];
  10213. if(k4 != 0)
  10214. {
  10215. int i5 = k4;
  10216. int j5 = 256 - k4;
  10217. k4 = anIntArray850[k4];
  10218. int k5 = aRSImageProducer_1111.anIntArray315[j1];
  10219. aRSImageProducer_1111.anIntArray315[j1++] = ((k4 & 0xff00ff) * i5 + (k5 & 0xff00ff) * j5 & 0xff00ff00) + ((k4 & 0xff00) * i5 + (k5 & 0xff00) * j5 & 0xff0000) >> 8;
  10220. } else
  10221. {
  10222. j1++;
  10223. }
  10224. }
  10225.  
  10226. i1 += 128 - k3;
  10227. j1 += 128 - k3 - i3;
  10228. }
  10229.  
  10230. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  10231. }
  10232.  
  10233. private void method134(Stream stream)
  10234. {
  10235. int j = stream.readBits(8);
  10236. if(j < playerCount)
  10237. {
  10238. for(int k = j; k < playerCount; k++)
  10239. anIntArray840[anInt839++] = playerIndices[k];
  10240.  
  10241. }
  10242. if(j > playerCount)
  10243. {
  10244. signlink.reporterror(myUsername + " Too many players");
  10245. throw new RuntimeException("eek");
  10246. }
  10247. playerCount = 0;
  10248. for(int l = 0; l < j; l++)
  10249. {
  10250. int i1 = playerIndices[l];
  10251. Player player = playerArray[i1];
  10252. int j1 = stream.readBits(1);
  10253. if(j1 == 0)
  10254. {
  10255. playerIndices[playerCount++] = i1;
  10256. player.anInt1537 = loopCycle;
  10257. } else
  10258. {
  10259. int k1 = stream.readBits(2);
  10260. if(k1 == 0)
  10261. {
  10262. playerIndices[playerCount++] = i1;
  10263. player.anInt1537 = loopCycle;
  10264. anIntArray894[anInt893++] = i1;
  10265. } else
  10266. if(k1 == 1)
  10267. {
  10268. playerIndices[playerCount++] = i1;
  10269. player.anInt1537 = loopCycle;
  10270. int l1 = stream.readBits(3);
  10271. player.moveInDir(false, l1);
  10272. int j2 = stream.readBits(1);
  10273. if(j2 == 1)
  10274. anIntArray894[anInt893++] = i1;
  10275. } else
  10276. if(k1 == 2)
  10277. {
  10278. playerIndices[playerCount++] = i1;
  10279. player.anInt1537 = loopCycle;
  10280. int i2 = stream.readBits(3);
  10281. player.moveInDir(true, i2);
  10282. int k2 = stream.readBits(3);
  10283. player.moveInDir(true, k2);
  10284. int l2 = stream.readBits(1);
  10285. if(l2 == 1)
  10286. anIntArray894[anInt893++] = i1;
  10287. } else
  10288. if(k1 == 3)
  10289. anIntArray840[anInt839++] = i1;
  10290. }
  10291. }
  10292. }
  10293.  
  10294. private void drawLoginScreen(boolean flag)
  10295. {
  10296. resetImageProducers();
  10297. aRSImageProducer_1109.initDrawingArea();
  10298. aBackground_966.drawBackground(0, 0);
  10299. char c = '\u0168';
  10300. char c1 = '\310';
  10301. if(loginScreenState == 0)
  10302. {
  10303. int i = c1 / 2 + 80;
  10304. smallText.method382(0x75a9a9, c / 2, onDemandFetcher.statusString, i, true);
  10305. i = c1 / 2 - 20;
  10306. chatTextDrawingArea.method382(0xffff00, c / 2, "Wake & Bake", i, true);
  10307. i += 30;
  10308. int l = c / 2 - 80;
  10309. int k1 = c1 / 2 + 20;
  10310. aBackground_967.drawBackground(l - 73, k1 - 20);
  10311. chatTextDrawingArea.method382(0xffffff, l, "Information", k1 + 5, true);
  10312. l = c / 2 + 80;
  10313. aBackground_967.drawBackground(l - 73, k1 - 20);
  10314. chatTextDrawingArea.method382(0xffffff, l, "Existing User", k1 + 5, true);
  10315. }
  10316. if(loginScreenState == 2)
  10317. {
  10318. int j = c1 / 2 - 40;
  10319. if(loginMessage1.length() > 0)
  10320. {
  10321. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage1, j - 15, true);
  10322. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2, j, true);
  10323. j += 30;
  10324. } else
  10325. {
  10326. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2, j - 7, true);
  10327. j += 30;
  10328. }
  10329. chatTextDrawingArea.method389(true, c / 2 - 90, 0xffffff, "Username: " + myUsername + ((loginScreenCursorPos == 0) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  10330. j += 15;
  10331. chatTextDrawingArea.method389(true, c / 2 - 88, 0xffffff, "Password: " + TextClass.passwordAsterisks(myPassword) + ((loginScreenCursorPos == 1) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  10332. j += 15;
  10333. if(!flag)
  10334. {
  10335. int i1 = c / 2 - 80;
  10336. int l1 = c1 / 2 + 50;
  10337. aBackground_967.drawBackground(i1 - 73, l1 - 20);
  10338. chatTextDrawingArea.method382(0xffffff, i1, "Login", l1 + 5, true);
  10339. i1 = c / 2 + 80;
  10340. aBackground_967.drawBackground(i1 - 73, l1 - 20);
  10341. chatTextDrawingArea.method382(0xffffff, i1, "Cancel", l1 + 5, true);
  10342. }
  10343. }
  10344. if(loginScreenState == 3)
  10345. {
  10346. chatTextDrawingArea.method382(0xffff00, c / 2, "Information", c1 / 2 - 60, true);
  10347. int k = c1 / 2 - 35;
  10348. chatTextDrawingArea.method382(0xffffff, c / 2, "Server Information", k, true);
  10349. k += 15;
  10350. chatTextDrawingArea.method382(0xffffff, c / 2, "Welcome To Wake & Bake", k, true);
  10351. k += 15;
  10352. chatTextDrawingArea.method382(0xffffff, c / 2, "Our server is 24/7 online", k, true);
  10353. k += 15;
  10354. chatTextDrawingArea.method382(0xffffff, c / 2, "", k, true); // Forums URL goes right inside there :P
  10355. k += 15;
  10356. int j1 = c / 2;
  10357. int i2 = c1 / 2 + 50;
  10358. aBackground_967.drawBackground(j1 - 73, i2 - 20);
  10359. chatTextDrawingArea.method382(0xffffff, j1, "Cancel", i2 + 5, true);
  10360. }
  10361. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  10362. if(welcomeScreenRaised)
  10363. {
  10364. welcomeScreenRaised = false;
  10365. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  10366. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  10367. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  10368. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  10369. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  10370. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  10371. }
  10372. }
  10373.  
  10374. private void drawFlames()
  10375. {
  10376. drawingFlames = true;
  10377. try
  10378. {
  10379. long l = System.currentTimeMillis();
  10380. int i = 0;
  10381. int j = 20;
  10382. while(aBoolean831)
  10383. {
  10384. anInt1208++;
  10385. //calcFlamesPosition();
  10386. //calcFlamesPosition();
  10387. doFlamesDrawing();
  10388. if(++i > 10)
  10389. {
  10390. long l1 = System.currentTimeMillis();
  10391. int k = (int)(l1 - l) / 10 - j;
  10392. j = 40 - k;
  10393. if(j < 5)
  10394. j = 5;
  10395. i = 0;
  10396. l = l1;
  10397. }
  10398. try
  10399. {
  10400. Thread.sleep(j);
  10401. }
  10402. catch(Exception _ex) { }
  10403. }
  10404. }
  10405. catch(Exception _ex) { }
  10406. drawingFlames = false;
  10407. }
  10408.  
  10409. public void raiseWelcomeScreen()
  10410. {
  10411. welcomeScreenRaised = true;
  10412. }
  10413.  
  10414. private void method137(Stream stream, int j)
  10415. {
  10416. if(j == 84)
  10417. {
  10418. int k = stream.readUnsignedByte();
  10419. int j3 = anInt1268 + (k >> 4 & 7);
  10420. int i6 = anInt1269 + (k & 7);
  10421. int l8 = stream.readUnsignedWord();
  10422. int k11 = stream.readUnsignedWord();
  10423. int l13 = stream.readUnsignedWord();
  10424. if(j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104)
  10425. {
  10426. NodeList class19_1 = groundArray[plane][j3][i6];
  10427. if(class19_1 != null)
  10428. {
  10429. 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())
  10430. {
  10431. if(class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff) || class30_sub2_sub4_sub2_3.anInt1559 != k11)
  10432. continue;
  10433. class30_sub2_sub4_sub2_3.anInt1559 = l13;
  10434. break;
  10435. }
  10436.  
  10437. spawnGroundItem(j3, i6);
  10438. }
  10439. }
  10440. return;
  10441. }
  10442. if(j == 105)
  10443. {
  10444. int l = stream.readUnsignedByte();
  10445. int k3 = anInt1268 + (l >> 4 & 7);
  10446. int j6 = anInt1269 + (l & 7);
  10447. int i9 = stream.readUnsignedWord();
  10448. int l11 = stream.readUnsignedByte();
  10449. int i14 = l11 >> 4 & 0xf;
  10450. int i16 = l11 & 7;
  10451. 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)
  10452. {
  10453. anIntArray1207[anInt1062] = i9;
  10454. anIntArray1241[anInt1062] = i16;
  10455. anIntArray1250[anInt1062] = Sounds.anIntArray326[i9];
  10456. anInt1062++;
  10457. }
  10458. }
  10459. if(j == 215)
  10460. {
  10461. int i1 = stream.method435();
  10462. int l3 = stream.method428();
  10463. int k6 = anInt1268 + (l3 >> 4 & 7);
  10464. int j9 = anInt1269 + (l3 & 7);
  10465. int i12 = stream.method435();
  10466. int j14 = stream.readUnsignedWord();
  10467. if(k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104 && i12 != unknownInt10)
  10468. {
  10469. Item class30_sub2_sub4_sub2_2 = new Item();
  10470. class30_sub2_sub4_sub2_2.ID = i1;
  10471. class30_sub2_sub4_sub2_2.anInt1559 = j14;
  10472. if(groundArray[plane][k6][j9] == null)
  10473. groundArray[plane][k6][j9] = new NodeList();
  10474. groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
  10475. spawnGroundItem(k6, j9);
  10476. }
  10477. return;
  10478. }
  10479. if(j == 156)
  10480. {
  10481. int j1 = stream.method426();
  10482. int i4 = anInt1268 + (j1 >> 4 & 7);
  10483. int l6 = anInt1269 + (j1 & 7);
  10484. int k9 = stream.readUnsignedWord();
  10485. if(i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104)
  10486. {
  10487. NodeList class19 = groundArray[plane][i4][l6];
  10488. if(class19 != null)
  10489. {
  10490. for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  10491. {
  10492. if(item.ID != (k9 & 0x7fff))
  10493. continue;
  10494. item.unlink();
  10495. break;
  10496. }
  10497.  
  10498. if(class19.reverseGetFirst() == null)
  10499. groundArray[plane][i4][l6] = null;
  10500. spawnGroundItem(i4, l6);
  10501. }
  10502. }
  10503. return;
  10504. }
  10505. if(j == 160)
  10506. {
  10507. int k1 = stream.method428();
  10508. int j4 = anInt1268 + (k1 >> 4 & 7);
  10509. int i7 = anInt1269 + (k1 & 7);
  10510. int l9 = stream.method428();
  10511. int j12 = l9 >> 2;
  10512. int k14 = l9 & 3;
  10513. int j16 = anIntArray1177[j12];
  10514. int j17 = stream.method435();
  10515. if(j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103)
  10516. {
  10517. int j18 = intGroundArray[plane][j4][i7];
  10518. int i19 = intGroundArray[plane][j4 + 1][i7];
  10519. int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
  10520. int k20 = intGroundArray[plane][j4][i7 + 1];
  10521. if(j16 == 0)
  10522. {
  10523. Object1 class10 = worldController.method296(plane, j4, i7);
  10524. if(class10 != null)
  10525. {
  10526. int k21 = class10.uid >> 14 & 0x7fff;
  10527. if(j12 == 2)
  10528. {
  10529. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, 4 + k14, 2, i19, l19, j18, k20, j17, false);
  10530. class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(k21, k14 + 1 & 3, 2, i19, l19, j18, k20, j17, false);
  10531. } else
  10532. {
  10533. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, k14, j12, i19, l19, j18, k20, j17, false);
  10534. }
  10535. }
  10536. }
  10537. if(j16 == 1)
  10538. {
  10539. Object2 class26 = worldController.method297(j4, i7, plane);
  10540. if(class26 != null)
  10541. class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(class26.uid >> 14 & 0x7fff, 0, 4, i19, l19, j18, k20, j17, false);
  10542. }
  10543. if(j16 == 2)
  10544. {
  10545. Object5 class28 = worldController.method298(j4, i7, plane);
  10546. if(j12 == 11)
  10547. j12 = 10;
  10548. if(class28 != null)
  10549. class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(class28.uid >> 14 & 0x7fff, k14, j12, i19, l19, j18, k20, j17, false);
  10550. }
  10551. if(j16 == 3)
  10552. {
  10553. Object3 class49 = worldController.method299(i7, j4, plane);
  10554. if(class49 != null)
  10555. class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(class49.uid >> 14 & 0x7fff, k14, 22, i19, l19, j18, k20, j17, false);
  10556. }
  10557. }
  10558. return;
  10559. }
  10560. if(j == 147)
  10561. {
  10562. int l1 = stream.method428();
  10563. int k4 = anInt1268 + (l1 >> 4 & 7);
  10564. int j7 = anInt1269 + (l1 & 7);
  10565. int i10 = stream.readUnsignedWord();
  10566. byte byte0 = stream.method430();
  10567. int l14 = stream.method434();
  10568. byte byte1 = stream.method429();
  10569. int k17 = stream.readUnsignedWord();
  10570. int k18 = stream.method428();
  10571. int j19 = k18 >> 2;
  10572. int i20 = k18 & 3;
  10573. int l20 = anIntArray1177[j19];
  10574. byte byte2 = stream.readSignedByte();
  10575. int l21 = stream.readUnsignedWord();
  10576. byte byte3 = stream.method429();
  10577. Player player;
  10578. if(i10 == unknownInt10)
  10579. player = myPlayer;
  10580. else
  10581. player = playerArray[i10];
  10582. if(player != null)
  10583. {
  10584. ObjectDef class46 = ObjectDef.forID(l21);
  10585. int i22 = intGroundArray[plane][k4][j7];
  10586. int j22 = intGroundArray[plane][k4 + 1][j7];
  10587. int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
  10588. int l22 = intGroundArray[plane][k4][j7 + 1];
  10589. Model model = class46.method578(j19, i20, i22, j22, k22, l22, -1);
  10590. if(model != null)
  10591. {
  10592. method130(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
  10593. player.anInt1707 = l14 + loopCycle;
  10594. player.anInt1708 = k17 + loopCycle;
  10595. player.aModel_1714 = model;
  10596. int i23 = class46.anInt744;
  10597. int j23 = class46.anInt761;
  10598. if(i20 == 1 || i20 == 3)
  10599. {
  10600. i23 = class46.anInt761;
  10601. j23 = class46.anInt744;
  10602. }
  10603. player.anInt1711 = k4 * 128 + i23 * 64;
  10604. player.anInt1713 = j7 * 128 + j23 * 64;
  10605. player.anInt1712 = method42(plane, player.anInt1713, player.anInt1711);
  10606. if(byte2 > byte0)
  10607. {
  10608. byte byte4 = byte2;
  10609. byte2 = byte0;
  10610. byte0 = byte4;
  10611. }
  10612. if(byte3 > byte1)
  10613. {
  10614. byte byte5 = byte3;
  10615. byte3 = byte1;
  10616. byte1 = byte5;
  10617. }
  10618. player.anInt1719 = k4 + byte2;
  10619. player.anInt1721 = k4 + byte0;
  10620. player.anInt1720 = j7 + byte3;
  10621. player.anInt1722 = j7 + byte1;
  10622. }
  10623. }
  10624. }
  10625. if(j == 151)
  10626. {
  10627. int i2 = stream.method426();
  10628. int l4 = anInt1268 + (i2 >> 4 & 7);
  10629. int k7 = anInt1269 + (i2 & 7);
  10630. int j10 = stream.method434();
  10631. int k12 = stream.method428();
  10632. int i15 = k12 >> 2;
  10633. int k16 = k12 & 3;
  10634. int l17 = anIntArray1177[i15];
  10635. if(l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104)
  10636. method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
  10637. return;
  10638. }
  10639. if(j == 4)
  10640. {
  10641. int j2 = stream.readUnsignedByte();
  10642. int i5 = anInt1268 + (j2 >> 4 & 7);
  10643. int l7 = anInt1269 + (j2 & 7);
  10644. int k10 = stream.readUnsignedWord();
  10645. int l12 = stream.readUnsignedByte();
  10646. int j15 = stream.readUnsignedWord();
  10647. if(i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104)
  10648. {
  10649. i5 = i5 * 128 + 64;
  10650. l7 = l7 * 128 + 64;
  10651. Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane, loopCycle, j15, k10, method42(plane, l7, i5) - l12, l7, i5);
  10652. aClass19_1056.insertHead(class30_sub2_sub4_sub3);
  10653. }
  10654. return;
  10655. }
  10656. if(j == 44)
  10657. {
  10658. int k2 = stream.method436();
  10659. int j5 = stream.readUnsignedWord();
  10660. int i8 = stream.readUnsignedByte();
  10661. int l10 = anInt1268 + (i8 >> 4 & 7);
  10662. int i13 = anInt1269 + (i8 & 7);
  10663. if(l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104)
  10664. {
  10665. Item class30_sub2_sub4_sub2_1 = new Item();
  10666. class30_sub2_sub4_sub2_1.ID = k2;
  10667. class30_sub2_sub4_sub2_1.anInt1559 = j5;
  10668. if(groundArray[plane][l10][i13] == null)
  10669. groundArray[plane][l10][i13] = new NodeList();
  10670. groundArray[plane][l10][i13].insertHead(class30_sub2_sub4_sub2_1);
  10671. spawnGroundItem(l10, i13);
  10672. }
  10673. return;
  10674. }
  10675. if(j == 101)
  10676. {
  10677. int l2 = stream.method427();
  10678. int k5 = l2 >> 2;
  10679. int j8 = l2 & 3;
  10680. int i11 = anIntArray1177[k5];
  10681. int j13 = stream.readUnsignedByte();
  10682. int k15 = anInt1268 + (j13 >> 4 & 7);
  10683. int l16 = anInt1269 + (j13 & 7);
  10684. if(k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
  10685. method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
  10686. return;
  10687. }
  10688. if(j == 117)
  10689. {
  10690. int i3 = stream.readUnsignedByte();
  10691. int l5 = anInt1268 + (i3 >> 4 & 7);
  10692. int k8 = anInt1269 + (i3 & 7);
  10693. int j11 = l5 + stream.readSignedByte();
  10694. int k13 = k8 + stream.readSignedByte();
  10695. int l15 = stream.readSignedWord();
  10696. int i17 = stream.readUnsignedWord();
  10697. int i18 = stream.readUnsignedByte() * 4;
  10698. int l18 = stream.readUnsignedByte() * 4;
  10699. int k19 = stream.readUnsignedWord();
  10700. int j20 = stream.readUnsignedWord();
  10701. int i21 = stream.readUnsignedByte();
  10702. int j21 = stream.readUnsignedByte();
  10703. if(l5 >= 0 && k8 >= 0 && l5 < 104 && k8 < 104 && j11 >= 0 && k13 >= 0 && j11 < 104 && k13 < 104 && i17 != 65535)
  10704. {
  10705. l5 = l5 * 128 + 64;
  10706. k8 = k8 * 128 + 64;
  10707. j11 = j11 * 128 + 64;
  10708. k13 = k13 * 128 + 64;
  10709. 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);
  10710. class30_sub2_sub4_sub4.method455(k19 + loopCycle, k13, method42(plane, k13, j11) - l18, j11);
  10711. aClass19_1013.insertHead(class30_sub2_sub4_sub4);
  10712. }
  10713. }
  10714. }
  10715.  
  10716. private static void setLowMem()
  10717. {
  10718. WorldController.lowMem = true;
  10719. Texture.lowMem = true;
  10720. lowMem = true;
  10721. ObjectManager.lowMem = true;
  10722. ObjectDef.lowMem = true;
  10723. }
  10724.  
  10725. private void method139(Stream stream)
  10726. {
  10727. stream.initBitAccess();
  10728. int k = stream.readBits(8);
  10729. if(k < npcCount)
  10730. {
  10731. for(int l = k; l < npcCount; l++)
  10732. anIntArray840[anInt839++] = npcIndices[l];
  10733.  
  10734. }
  10735. if(k > npcCount)
  10736. {
  10737. signlink.reporterror(myUsername + " Too many npcs");
  10738. throw new RuntimeException("eek");
  10739. }
  10740. npcCount = 0;
  10741. for(int i1 = 0; i1 < k; i1++)
  10742. {
  10743. int j1 = npcIndices[i1];
  10744. NPC npc = npcArray[j1];
  10745. int k1 = stream.readBits(1);
  10746. if(k1 == 0)
  10747. {
  10748. npcIndices[npcCount++] = j1;
  10749. npc.anInt1537 = loopCycle;
  10750. } else
  10751. {
  10752. int l1 = stream.readBits(2);
  10753. if(l1 == 0)
  10754. {
  10755. npcIndices[npcCount++] = j1;
  10756. npc.anInt1537 = loopCycle;
  10757. anIntArray894[anInt893++] = j1;
  10758. } else
  10759. if(l1 == 1)
  10760. {
  10761. npcIndices[npcCount++] = j1;
  10762. npc.anInt1537 = loopCycle;
  10763. int i2 = stream.readBits(3);
  10764. npc.moveInDir(false, i2);
  10765. int k2 = stream.readBits(1);
  10766. if(k2 == 1)
  10767. anIntArray894[anInt893++] = j1;
  10768. } else
  10769. if(l1 == 2)
  10770. {
  10771. npcIndices[npcCount++] = j1;
  10772. npc.anInt1537 = loopCycle;
  10773. int j2 = stream.readBits(3);
  10774. npc.moveInDir(true, j2);
  10775. int l2 = stream.readBits(3);
  10776. npc.moveInDir(true, l2);
  10777. int i3 = stream.readBits(1);
  10778. if(i3 == 1)
  10779. anIntArray894[anInt893++] = j1;
  10780. } else
  10781. if(l1 == 3)
  10782. anIntArray840[anInt839++] = j1;
  10783. }
  10784. }
  10785.  
  10786. }
  10787.  
  10788. private void processLoginScreenInput()
  10789. {
  10790. if(loginScreenState == 0)
  10791. {
  10792. int i = super.myWidth / 2 - 80;
  10793. int l = super.myHeight / 2 + 20;
  10794. l += 20;
  10795. if(super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20)
  10796. {
  10797. loginScreenState = 3;
  10798. loginScreenCursorPos = 0;
  10799. }
  10800. i = super.myWidth / 2 + 80;
  10801. if(super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20)
  10802. {
  10803. loginMessage1 = "";
  10804. loginMessage2 = "Enter your username & password.";
  10805. loginScreenState = 2;
  10806. loginScreenCursorPos = 0;
  10807. }
  10808. } else
  10809. {
  10810. if(loginScreenState == 2)
  10811. {
  10812. int j = super.myHeight / 2 - 40;
  10813. j += 30;
  10814. j += 25;
  10815. if(super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  10816. loginScreenCursorPos = 0;
  10817. j += 15;
  10818. if(super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  10819. loginScreenCursorPos = 1;
  10820. j += 15;
  10821. int i1 = super.myWidth / 2 - 80;
  10822. int k1 = super.myHeight / 2 + 50;
  10823. k1 += 20;
  10824. if(super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20)
  10825. {
  10826. loginFailures = 0;
  10827. login(myUsername, myPassword, false);
  10828. if(loggedIn)
  10829. return;
  10830. }
  10831. i1 = super.myWidth / 2 + 80;
  10832. if(super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20)
  10833. {
  10834. loginScreenState = 0;
  10835. // myUsername = "";
  10836. // myPassword = "";
  10837. }
  10838. do
  10839. {
  10840. int l1 = readChar(-796);
  10841. if(l1 == -1)
  10842. break;
  10843. boolean flag1 = false;
  10844. for(int i2 = 0; i2 < validUserPassChars.length(); i2++)
  10845. {
  10846. if(l1 != validUserPassChars.charAt(i2))
  10847. continue;
  10848. flag1 = true;
  10849. break;
  10850. }
  10851.  
  10852. if(loginScreenCursorPos == 0)
  10853. {
  10854. if(l1 == 8 && myUsername.length() > 0)
  10855. myUsername = myUsername.substring(0, myUsername.length() - 1);
  10856. if(l1 == 9 || l1 == 10 || l1 == 13)
  10857. loginScreenCursorPos = 1;
  10858. if(flag1)
  10859. myUsername += (char)l1;
  10860. if(myUsername.length() > 12)
  10861. myUsername = myUsername.substring(0, 12);
  10862. } else
  10863. if(loginScreenCursorPos == 1)
  10864. {
  10865. if(l1 == 8 && myPassword.length() > 0)
  10866. myPassword = myPassword.substring(0, myPassword.length() - 1);
  10867. if(l1 == 9 || l1 == 10 || l1 == 13)
  10868. loginScreenCursorPos = 0;
  10869. if(flag1)
  10870. myPassword += (char)l1;
  10871. if(myPassword.length() > 20)
  10872. myPassword = myPassword.substring(0, 20);
  10873. }
  10874. } while(true);
  10875. return;
  10876. }
  10877. if(loginScreenState == 3)
  10878. {
  10879. int k = super.myWidth / 2;
  10880. int j1 = super.myHeight / 2 + 50;
  10881. j1 += 20;
  10882. if(super.clickMode3 == 1 && super.saveClickX >= k - 75 && super.saveClickX <= k + 75 && super.saveClickY >= j1 - 20 && super.saveClickY <= j1 + 20)
  10883. loginScreenState = 0;
  10884. }
  10885. }
  10886. }
  10887.  
  10888. private void markMinimap(Sprite sprite, int i, int j)
  10889. {
  10890. int k = minimapInt1 + minimapInt2 & 0x7ff;
  10891. int l = i * i + j * j;
  10892. if(l > 6400)
  10893. return;
  10894. int i1 = Model.modelIntArray1[k];
  10895. int j1 = Model.modelIntArray2[k];
  10896. i1 = (i1 * 256) / (minimapInt3 + 256);
  10897. j1 = (j1 * 256) / (minimapInt3 + 256);
  10898. int k1 = j * i1 + i * j1 >> 16;
  10899. int l1 = j * j1 - i * i1 >> 16;
  10900. if(l > 2500) {
  10901. sprite.drawSprite(((94 + k1) - sprite.anInt1444 / 2) + 4 + 20, 83 - l1 - sprite.anInt1445 / 2 - 4 + 5);
  10902. } else {
  10903. sprite.drawSprite(((94 + k1) - sprite.anInt1444 / 2) + 4 + 20, 83 - l1 - sprite.anInt1445 / 2 - 4 + 5);
  10904. }
  10905. }
  10906.  
  10907. private void method142(int i, int j, int k, int l, int i1, int j1, int k1
  10908. )
  10909. {
  10910. if(i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102)
  10911. {
  10912. if(lowMem && j != plane)
  10913. return;
  10914. int i2 = 0;
  10915. if(j1 == 0)
  10916. i2 = worldController.method300(j, i1, i);
  10917. if(j1 == 1)
  10918. i2 = worldController.method301(j, i1, i);
  10919. if(j1 == 2)
  10920. i2 = worldController.method302(j, i1, i);
  10921. if(j1 == 3)
  10922. i2 = worldController.method303(j, i1, i);
  10923. if(i2 != 0)
  10924. {
  10925. int i3 = worldController.method304(j, i1, i, i2);
  10926. int j2 = i2 >> 14 & 0x7fff;
  10927. int k2 = i3 & 0x1f;
  10928. int l2 = i3 >> 6;
  10929. if(j1 == 0)
  10930. {
  10931. worldController.method291(i1, j, i, (byte)-119);
  10932. ObjectDef class46 = ObjectDef.forID(j2);
  10933. if(class46.aBoolean767)
  10934. aClass11Array1230[j].method215(l2, k2, class46.aBoolean757, i1, i);
  10935. }
  10936. if(j1 == 1)
  10937. worldController.method292(i, j, i1);
  10938. if(j1 == 2)
  10939. {
  10940. worldController.method293(j, i1, i);
  10941. ObjectDef class46_1 = ObjectDef.forID(j2);
  10942. if(i1 + class46_1.anInt744 > 103 || i + class46_1.anInt744 > 103 || i1 + class46_1.anInt761 > 103 || i + class46_1.anInt761 > 103)
  10943. return;
  10944. if(class46_1.aBoolean767)
  10945. aClass11Array1230[j].method216(l2, class46_1.anInt744, i1, i, class46_1.anInt761, class46_1.aBoolean757);
  10946. }
  10947. if(j1 == 3)
  10948. {
  10949. worldController.method294(j, i, i1);
  10950. ObjectDef class46_2 = ObjectDef.forID(j2);
  10951. if(class46_2.aBoolean767 && class46_2.hasActions)
  10952. aClass11Array1230[j].method218(i, i1);
  10953. }
  10954. }
  10955. if(k1 >= 0)
  10956. {
  10957. int j3 = j;
  10958. if(j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
  10959. j3++;
  10960. ObjectManager.method188(worldController, k, i, l, j3, aClass11Array1230[j], intGroundArray, i1, k1, j);
  10961. }
  10962. }
  10963. }
  10964.  
  10965. private void updatePlayers(int i, Stream stream)
  10966. {
  10967. anInt839 = 0;
  10968. anInt893 = 0;
  10969. method117(stream);
  10970. method134(stream);
  10971. method91(stream, i);
  10972. method49(stream);
  10973. for(int k = 0; k < anInt839; k++)
  10974. {
  10975. int l = anIntArray840[k];
  10976. if(playerArray[l].anInt1537 != loopCycle)
  10977. playerArray[l] = null;
  10978. }
  10979.  
  10980. if(stream.currentOffset != i)
  10981. {
  10982. signlink.reporterror("Error packet size mismatch in getplayer pos:" + stream.currentOffset + " psize:" + i);
  10983. throw new RuntimeException("eek");
  10984. }
  10985. for(int i1 = 0; i1 < playerCount; i1++)
  10986. if(playerArray[playerIndices[i1]] == null)
  10987. {
  10988. signlink.reporterror(myUsername + " null entry in pl list - pos:" + i1 + " size:" + playerCount);
  10989. throw new RuntimeException("eek");
  10990. }
  10991.  
  10992. }
  10993.  
  10994. private void setCameraPos(int j, int k, int l, int i1, int j1, int k1)
  10995. {
  10996. int l1 = 2048 - k & 0x7ff;
  10997. int i2 = 2048 - j1 & 0x7ff;
  10998. int j2 = 0;
  10999. int k2 = 0;
  11000. int l2 = j;
  11001. if(l1 != 0)
  11002. {
  11003. int i3 = Model.modelIntArray1[l1];
  11004. int k3 = Model.modelIntArray2[l1];
  11005. int i4 = k2 * k3 - l2 * i3 >> 16;
  11006. l2 = k2 * i3 + l2 * k3 >> 16;
  11007. k2 = i4;
  11008. }
  11009. if(i2 != 0)
  11010. {
  11011. /* xxx if(cameratoggle){
  11012. if(zoom == 0)
  11013. zoom = k2;
  11014. if(lftrit == 0)
  11015. lftrit = j2;
  11016. if(fwdbwd == 0)
  11017. fwdbwd = l2;
  11018. k2 = zoom;
  11019. j2 = lftrit;
  11020. l2 = fwdbwd;
  11021. }
  11022. */
  11023. int j3 = Model.modelIntArray1[i2];
  11024. int l3 = Model.modelIntArray2[i2];
  11025. int j4 = l2 * j3 + j2 * l3 >> 16;
  11026. l2 = l2 * l3 - j2 * j3 >> 16;
  11027. j2 = j4;
  11028. }
  11029. xCameraPos = l - j2;
  11030. zCameraPos = i1 - k2;
  11031. yCameraPos = k1 - l2;
  11032. yCameraCurve = k;
  11033. xCameraCurve = j1;
  11034. }
  11035.  
  11036. public void updateStrings(String str, int i) {
  11037. switch(i) {
  11038. case 1675: sendFrame126(str, 17508); break;//Stab
  11039. case 1676: sendFrame126(str, 17509); break;//Slash
  11040. case 1677: sendFrame126(str, 17510); break;//Cursh
  11041. case 1678: sendFrame126(str, 17511); break;//Magic
  11042. case 1679: sendFrame126(str, 17512); break;//Range
  11043. case 1680: sendFrame126(str, 17513); break;//Stab
  11044. case 1681: sendFrame126(str, 17514); break;//Slash
  11045. case 1682: sendFrame126(str, 17515); break;//Crush
  11046. case 1683: sendFrame126(str, 17516); break;//Magic
  11047. case 1684: sendFrame126(str, 17517); break;//Range
  11048. case 1686: sendFrame126(str, 17518); break;//Strength
  11049. case 1687: sendFrame126(str, 17519); break;//Prayer
  11050. }
  11051. }
  11052.  
  11053. public void sendFrame126(String str,int i) {
  11054. RSInterface.interfaceCache[i].message = str;
  11055. if(RSInterface.interfaceCache[i].parentID == tabInterfaceIDs[tabID])
  11056. needDrawTabArea = true;
  11057. }
  11058.  
  11059. public void sendPacket185(int button,int toggle,int type) {
  11060. switch(type) {
  11061. case 135:
  11062. RSInterface class9 = RSInterface.interfaceCache[button];
  11063. boolean flag8 = true;
  11064. if(class9.contentType > 0)
  11065. flag8 = promptUserForInput(class9);
  11066. if(flag8) {
  11067. stream.createFrame(185);
  11068. stream.writeWord(button);
  11069. }
  11070. break;
  11071. case 646:
  11072. stream.createFrame(185);
  11073. stream.writeWord(button);
  11074. RSInterface class9_2 = RSInterface.interfaceCache[button];
  11075. if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5) {
  11076. if(variousSettings[toggle] != class9_2.anIntArray212[0]) {
  11077. variousSettings[toggle] = class9_2.anIntArray212[0];
  11078. method33(toggle);
  11079. needDrawTabArea = true;
  11080. }
  11081. }
  11082. break;
  11083. case 169:
  11084. stream.createFrame(185);
  11085. stream.writeWord(button);
  11086. RSInterface class9_3 = RSInterface.interfaceCache[button];
  11087. if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5) {
  11088. variousSettings[toggle] = 1 - variousSettings[toggle];
  11089. method33(toggle);
  11090. needDrawTabArea = true;
  11091. }
  11092. switch(button) {
  11093. case 19136:
  11094. System.out.println("toggle = "+toggle);
  11095. if(toggle == 0)
  11096. sendFrame36(173,toggle);
  11097. if(toggle == 1)
  11098. sendPacket185(153,173,646);
  11099. break;
  11100. }
  11101. break;
  11102. }
  11103. }
  11104.  
  11105. public void sendFrame36(int id,int state) {
  11106. anIntArray1045[id] = state;
  11107. if(variousSettings[id] != state) {
  11108. variousSettings[id] = state;
  11109. method33(id);
  11110. needDrawTabArea = true;
  11111. if(dialogID != -1)
  11112. inputTaken = true;
  11113. }
  11114. }
  11115.  
  11116. public void sendFrame219() {
  11117. if(invOverlayInterfaceID != -1) {
  11118. invOverlayInterfaceID = -1;
  11119. needDrawTabArea = true;
  11120. tabAreaAltered = true;
  11121. }
  11122. if(backDialogID != -1) {
  11123. backDialogID = -1;
  11124. inputTaken = true;
  11125. }
  11126. if(inputDialogState != 0) {
  11127. inputDialogState = 0;
  11128. inputTaken = true;
  11129. }
  11130. openInterfaceID = -1;
  11131. aBoolean1149 = false;
  11132. }
  11133.  
  11134. public void sendFrame248(int interfaceID,int sideInterfaceID) {
  11135. if(backDialogID != -1) {
  11136. backDialogID = -1;
  11137. inputTaken = true;
  11138. }
  11139. if(inputDialogState != 0) {
  11140. inputDialogState = 0;
  11141. inputTaken = true;
  11142. }
  11143. openInterfaceID = interfaceID;
  11144. invOverlayInterfaceID = sideInterfaceID;
  11145. needDrawTabArea = true;
  11146. tabAreaAltered = true;
  11147. aBoolean1149 = false;
  11148. }
  11149.  
  11150. private boolean parsePacket() {
  11151. if(socketStream == null)
  11152. return false;
  11153. try {
  11154. int i = socketStream.available();
  11155. if(i == 0)
  11156. return false;
  11157. if(pktType == -1) {
  11158. socketStream.flushInputStream(inStream.buffer, 1);
  11159. pktType = inStream.buffer[0] & 0xff;
  11160. if(encryption != null)
  11161. pktType = pktType - encryption.getNextKey() & 0xff;
  11162. pktSize = SizeConstants.packetSizes[pktType];
  11163. i--;
  11164. }
  11165. if(pktSize == -1)
  11166. if(i > 0) {
  11167. socketStream.flushInputStream(inStream.buffer, 1);
  11168. pktSize = inStream.buffer[0] & 0xff;
  11169. i--;
  11170. } else {
  11171. return false;
  11172. }
  11173. if(pktSize == -2)
  11174. if(i > 1) {
  11175. socketStream.flushInputStream(inStream.buffer, 2);
  11176. inStream.currentOffset = 0;
  11177. pktSize = inStream.readUnsignedWord();
  11178. i -= 2;
  11179. } else {
  11180. return false;
  11181. }
  11182. if(i < pktSize)
  11183. return false;
  11184. inStream.currentOffset = 0;
  11185. socketStream.flushInputStream(inStream.buffer, pktSize);
  11186. anInt1009 = 0;
  11187. anInt843 = anInt842;
  11188. anInt842 = anInt841;
  11189. anInt841 = pktType;
  11190. switch(pktType) {
  11191. case 81:
  11192. updatePlayers(pktSize, inStream);
  11193. aBoolean1080 = false;
  11194. pktType = -1;
  11195. return true;
  11196.  
  11197. case 176:
  11198. daysSinceRecovChange = inStream.method427();
  11199. unreadMessages = inStream.method435();
  11200. membersInt = inStream.readUnsignedByte();
  11201. anInt1193 = inStream.method440();
  11202. daysSinceLastLogin = inStream.readUnsignedWord();
  11203. if(anInt1193 != 0 && openInterfaceID == -1) {
  11204. signlink.dnslookup(TextClass.method586(anInt1193));
  11205. clearTopInterfaces();
  11206. char c = '\u028A';
  11207. if(daysSinceRecovChange != 201 || membersInt == 1)
  11208. c = '\u028F';
  11209. reportAbuseInput = "";
  11210. canMute = false;
  11211. for(int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
  11212. if(RSInterface.interfaceCache[k9] == null || RSInterface.interfaceCache[k9].contentType != c)
  11213. continue;
  11214. openInterfaceID = RSInterface.interfaceCache[k9].parentID;
  11215.  
  11216. }
  11217. }
  11218. pktType = -1;
  11219. return true;
  11220.  
  11221. case 64:
  11222. anInt1268 = inStream.method427();
  11223. anInt1269 = inStream.method428();
  11224. for(int j = anInt1268; j < anInt1268 + 8; j++) {
  11225. for(int l9 = anInt1269; l9 < anInt1269 + 8; l9++)
  11226. if(groundArray[plane][j][l9] != null) {
  11227. groundArray[plane][j][l9] = null;
  11228. spawnGroundItem(j, l9);
  11229. }
  11230. }
  11231. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  11232. if(class30_sub1.anInt1297 >= anInt1268 && class30_sub1.anInt1297 < anInt1268 + 8 && class30_sub1.anInt1298 >= anInt1269 && class30_sub1.anInt1298 < anInt1269 + 8 && class30_sub1.anInt1295 == plane)
  11233. class30_sub1.anInt1294 = 0;
  11234. pktType = -1;
  11235. return true;
  11236.  
  11237. case 185:
  11238. int k = inStream.method436();
  11239. RSInterface.interfaceCache[k].anInt233 = 3;
  11240. if(myPlayer.desc == null)
  11241. 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];
  11242. else
  11243. RSInterface.interfaceCache[k].mediaID = (int)(0x12345678L + myPlayer.desc.type);
  11244. pktType = -1;
  11245. return true;
  11246.  
  11247. /* Clan chat packet */
  11248. case 217:
  11249. try {
  11250. name = inStream.readString();
  11251. message = inStream.readString();
  11252. clanname = inStream.readString();
  11253. rights = inStream.readUnsignedWord();
  11254. //message = TextInput.processText(message);
  11255. //message = Censor.doCensor(message);
  11256. System.out.println(clanname);
  11257. pushMessage(message, 16, name);
  11258. } catch(Exception e) {
  11259. e.printStackTrace();
  11260. }
  11261. pktType = -1;
  11262. return true;
  11263.  
  11264. case 107:
  11265. aBoolean1160 = false;
  11266. for(int l = 0; l < 5; l++)
  11267. aBooleanArray876[l] = false;
  11268. pktType = -1;
  11269. return true;
  11270.  
  11271. case 72:
  11272. int i1 = inStream.method434();
  11273. RSInterface class9 = RSInterface.interfaceCache[i1];
  11274. for(int k15 = 0; k15 < class9.inv.length; k15++) {
  11275. class9.inv[k15] = -1;
  11276. class9.inv[k15] = 0;
  11277. }
  11278. pktType = -1;
  11279. return true;
  11280.  
  11281. case 214:
  11282. ignoreCount = pktSize / 8;
  11283. for(int j1 = 0; j1 < ignoreCount; j1++)
  11284. ignoreListAsLongs[j1] = inStream.readQWord();
  11285. pktType = -1;
  11286. return true;
  11287.  
  11288. case 166:
  11289. aBoolean1160 = true;
  11290. anInt1098 = inStream.readUnsignedByte();
  11291. anInt1099 = inStream.readUnsignedByte();
  11292. anInt1100 = inStream.readUnsignedWord();
  11293. anInt1101 = inStream.readUnsignedByte();
  11294. anInt1102 = inStream.readUnsignedByte();
  11295. if(anInt1102 >= 100) {
  11296. xCameraPos = anInt1098 * 128 + 64;
  11297. yCameraPos = anInt1099 * 128 + 64;
  11298. zCameraPos = method42(plane, yCameraPos, xCameraPos) - anInt1100;
  11299. }
  11300. pktType = -1;
  11301. return true;
  11302.  
  11303. case 134:
  11304. needDrawTabArea = true;
  11305. int k1 = inStream.readUnsignedByte();
  11306. int i10 = inStream.method439();
  11307. int l15 = inStream.readUnsignedByte();
  11308. currentExp[k1] = i10;
  11309. currentStats[k1] = l15;
  11310. maxStats[k1] = 1;
  11311. for(int k20 = 0; k20 < 98; k20++)
  11312. if(i10 >= anIntArray1019[k20])
  11313. maxStats[k1] = k20 + 2;
  11314. pktType = -1;
  11315. return true;
  11316.  
  11317. case 71:
  11318. int l1 = inStream.readUnsignedWord();
  11319. int j10 = inStream.method426();
  11320. if(l1 == 65535)
  11321. l1 = -1;
  11322. tabInterfaceIDs[j10] = l1;
  11323. needDrawTabArea = true;
  11324. tabAreaAltered = true;
  11325. pktType = -1;
  11326. return true;
  11327.  
  11328. case 74:
  11329. int i2 = inStream.method434();
  11330. if(i2 == 65535)
  11331. i2 = -1;
  11332. if(i2 != currentSong && musicEnabled && !lowMem && prevSong == 0) {
  11333. nextSong = i2;
  11334. songChanging = true;
  11335. onDemandFetcher.method558(2, nextSong);
  11336. }
  11337. currentSong = i2;
  11338. pktType = -1;
  11339. return true;
  11340.  
  11341. case 121:
  11342. int j2 = inStream.method436();
  11343. int k10 = inStream.method435();
  11344. if(musicEnabled && !lowMem) {
  11345. nextSong = j2;
  11346. songChanging = false;
  11347. onDemandFetcher.method558(2, nextSong);
  11348. prevSong = k10;
  11349. }
  11350. pktType = -1;
  11351. return true;
  11352.  
  11353. case 109:
  11354. resetLogout();
  11355. pktType = -1;
  11356. return false;
  11357.  
  11358. case 70:
  11359. int k2 = inStream.readSignedWord();
  11360. int l10 = inStream.method437();
  11361. int i16 = inStream.method434();
  11362. RSInterface class9_5 = RSInterface.interfaceCache[i16];
  11363. class9_5.anInt263 = k2;
  11364. class9_5.anInt265 = l10;
  11365. pktType = -1;
  11366. return true;
  11367.  
  11368. case 73:
  11369. case 241:
  11370. int l2 = anInt1069;
  11371. int i11 = anInt1070;
  11372. if(pktType == 73) {
  11373. l2 = inStream.method435();
  11374. i11 = inStream.readUnsignedWord();
  11375. aBoolean1159 = false;
  11376. }
  11377. if(pktType == 241) {
  11378. i11 = inStream.method435();
  11379. inStream.initBitAccess();
  11380. for(int j16 = 0; j16 < 4; j16++) {
  11381. for(int l20 = 0; l20 < 13; l20++) {
  11382. for(int j23 = 0; j23 < 13; j23++) {
  11383. int i26 = inStream.readBits(1);
  11384. if(i26 == 1)
  11385. anIntArrayArrayArray1129[j16][l20][j23] = inStream.readBits(26);
  11386. else
  11387. anIntArrayArrayArray1129[j16][l20][j23] = -1;
  11388. }
  11389. }
  11390. }
  11391. inStream.finishBitAccess();
  11392. l2 = inStream.readUnsignedWord();
  11393. aBoolean1159 = true;
  11394. }
  11395. if(anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2) {
  11396. pktType = -1;
  11397. return true;
  11398. }
  11399. anInt1069 = l2;
  11400. anInt1070 = i11;
  11401. baseX = (anInt1069 - 6) * 8;
  11402. baseY = (anInt1070 - 6) * 8;
  11403. aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49) && anInt1070 / 8 == 48;
  11404. if(anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
  11405. aBoolean1141 = true;
  11406. loadingStage = 1;
  11407. aLong824 = System.currentTimeMillis();
  11408. aRSImageProducer_1165.initDrawingArea();
  11409. aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151, 257);
  11410. aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.", 150, 256);
  11411. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  11412. if(pktType == 73) {
  11413. int k16 = 0;
  11414. for(int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++) {
  11415. for(int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
  11416. k16++;
  11417. }
  11418. aByteArrayArray1183 = new byte[k16][];
  11419. aByteArrayArray1247 = new byte[k16][];
  11420. anIntArray1234 = new int[k16];
  11421. anIntArray1235 = new int[k16];
  11422. anIntArray1236 = new int[k16];
  11423. k16 = 0;
  11424. for(int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++) {
  11425. for(int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++) {
  11426. anIntArray1234[k16] = (l23 << 8) + j26;
  11427. if(aBoolean1141 && (j26 == 49 || j26 == 149 || j26 == 147 || l23 == 50 || l23 == 49 && j26 == 47)) {
  11428. anIntArray1235[k16] = -1;
  11429. anIntArray1236[k16] = -1;
  11430. k16++;
  11431. } else {
  11432. int k28 = anIntArray1235[k16] = onDemandFetcher.method562(0, j26, l23);
  11433. if(k28 != -1)
  11434. onDemandFetcher.method558(3, k28);
  11435. int j30 = anIntArray1236[k16] = onDemandFetcher.method562(1, j26, l23);
  11436. if(j30 != -1)
  11437. onDemandFetcher.method558(3, j30);
  11438. k16++;
  11439. }
  11440. }
  11441. }
  11442. }
  11443. if(pktType == 241) {
  11444. int l16 = 0;
  11445. int ai[] = new int[676];
  11446. for(int i24 = 0; i24 < 4; i24++) {
  11447. for(int k26 = 0; k26 < 13; k26++) {
  11448. for(int l28 = 0; l28 < 13; l28++) {
  11449. int k30 = anIntArrayArrayArray1129[i24][k26][l28];
  11450. if(k30 != -1) {
  11451. int k31 = k30 >> 14 & 0x3ff;
  11452. int i32 = k30 >> 3 & 0x7ff;
  11453. int k32 = (k31 / 8 << 8) + i32 / 8;
  11454. for(int j33 = 0; j33 < l16; j33++) {
  11455. if(ai[j33] != k32)
  11456. continue;
  11457. k32 = -1;
  11458.  
  11459. }
  11460. if(k32 != -1)
  11461. ai[l16++] = k32;
  11462. }
  11463. }
  11464. }
  11465. }
  11466. aByteArrayArray1183 = new byte[l16][];
  11467. aByteArrayArray1247 = new byte[l16][];
  11468. anIntArray1234 = new int[l16];
  11469. anIntArray1235 = new int[l16];
  11470. anIntArray1236 = new int[l16];
  11471. for(int l26 = 0; l26 < l16; l26++) {
  11472. int i29 = anIntArray1234[l26] = ai[l26];
  11473. int l30 = i29 >> 8 & 0xff;
  11474. int l31 = i29 & 0xff;
  11475. int j32 = anIntArray1235[l26] = onDemandFetcher.method562(0, l31, l30);
  11476. if(j32 != -1)
  11477. onDemandFetcher.method558(3, j32);
  11478. int i33 = anIntArray1236[l26] = onDemandFetcher.method562(1, l31, l30);
  11479. if(i33 != -1)
  11480. onDemandFetcher.method558(3, i33);
  11481. }
  11482. }
  11483. int i17 = baseX - anInt1036;
  11484. int j21 = baseY - anInt1037;
  11485. anInt1036 = baseX;
  11486. anInt1037 = baseY;
  11487. for(int j24 = 0; j24 < 16384; j24++) {
  11488. NPC npc = npcArray[j24];
  11489. if(npc != null) {
  11490. for(int j29 = 0; j29 < 10; j29++) {
  11491. npc.smallX[j29] -= i17;
  11492. npc.smallY[j29] -= j21;
  11493. }
  11494. npc.x -= i17 * 128;
  11495. npc.y -= j21 * 128;
  11496. }
  11497. }
  11498. for(int i27 = 0; i27 < maxPlayers; i27++) {
  11499. Player player = playerArray[i27];
  11500. if(player != null) {
  11501. for(int i31 = 0; i31 < 10; i31++) {
  11502. player.smallX[i31] -= i17;
  11503. player.smallY[i31] -= j21;
  11504. }
  11505. player.x -= i17 * 128;
  11506. player.y -= j21 * 128;
  11507. }
  11508. }
  11509. aBoolean1080 = true;
  11510. byte byte1 = 0;
  11511. byte byte2 = 104;
  11512. byte byte3 = 1;
  11513. if(i17 < 0) {
  11514. byte1 = 103;
  11515. byte2 = -1;
  11516. byte3 = -1;
  11517. }
  11518. byte byte4 = 0;
  11519. byte byte5 = 104;
  11520. byte byte6 = 1;
  11521. if(j21 < 0) {
  11522. byte4 = 103;
  11523. byte5 = -1;
  11524. byte6 = -1;
  11525. }
  11526. for(int k33 = byte1; k33 != byte2; k33 += byte3) {
  11527. for(int l33 = byte4; l33 != byte5; l33 += byte6) {
  11528. int i34 = k33 + i17;
  11529. int j34 = l33 + j21;
  11530. for(int k34 = 0; k34 < 4; k34++)
  11531. if(i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
  11532. groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
  11533. else
  11534. groundArray[k34][k33][l33] = null;
  11535. }
  11536. }
  11537. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext()) {
  11538. class30_sub1_1.anInt1297 -= i17;
  11539. class30_sub1_1.anInt1298 -= j21;
  11540. if(class30_sub1_1.anInt1297 < 0 || class30_sub1_1.anInt1298 < 0 || class30_sub1_1.anInt1297 >= 104 || class30_sub1_1.anInt1298 >= 104)
  11541. class30_sub1_1.unlink();
  11542. }
  11543. if(destX != 0) {
  11544. destX -= i17;
  11545. destY -= j21;
  11546. }
  11547. aBoolean1160 = false;
  11548. pktType = -1;
  11549. return true;
  11550.  
  11551. case 208:
  11552. int i3 = inStream.method437();
  11553. if(i3 >= 0)
  11554. method60(i3);
  11555. anInt1018 = i3;
  11556. pktType = -1;
  11557. return true;
  11558.  
  11559. case 99:
  11560. anInt1021 = inStream.readUnsignedByte();
  11561. pktType = -1;
  11562. return true;
  11563.  
  11564. case 75:
  11565. int j3 = inStream.method436();
  11566. int j11 = inStream.method436();
  11567. RSInterface.interfaceCache[j11].anInt233 = 2;
  11568. RSInterface.interfaceCache[j11].mediaID = j3;
  11569. pktType = -1;
  11570. return true;
  11571.  
  11572. case 114:
  11573. anInt1104 = inStream.method434() * 30;
  11574. pktType = -1;
  11575. return true;
  11576.  
  11577. case 60:
  11578. anInt1269 = inStream.readUnsignedByte();
  11579. anInt1268 = inStream.method427();
  11580. while(inStream.currentOffset < pktSize) {
  11581. int k3 = inStream.readUnsignedByte();
  11582. method137(inStream, k3);
  11583. }
  11584. pktType = -1;
  11585. return true;
  11586.  
  11587. case 35:
  11588. int l3 = inStream.readUnsignedByte();
  11589. int k11 = inStream.readUnsignedByte();
  11590. int j17 = inStream.readUnsignedByte();
  11591. int k21 = inStream.readUnsignedByte();
  11592. aBooleanArray876[l3] = true;
  11593. anIntArray873[l3] = k11;
  11594. anIntArray1203[l3] = j17;
  11595. anIntArray928[l3] = k21;
  11596. anIntArray1030[l3] = 0;
  11597. pktType = -1;
  11598. return true;
  11599.  
  11600. //case 174:
  11601. case 104:
  11602. int j4 = inStream.method427();
  11603. int i12 = inStream.method426();
  11604. String s6 = inStream.readString();
  11605. if(j4 >= 1 && j4 <= 5) {
  11606. if(s6.equalsIgnoreCase("null"))
  11607. s6 = null;
  11608. atPlayerActions[j4 - 1] = s6;
  11609. atPlayerArray[j4 - 1] = i12 == 0;
  11610. }
  11611. pktType = -1;
  11612. return true;
  11613.  
  11614. case 78:
  11615. destX = 0;
  11616. pktType = -1;
  11617. return true;
  11618.  
  11619. case 253:
  11620. String s = inStream.readString();
  11621. if(s.endsWith(":tradereq:")) {
  11622. String s3 = s.substring(0, s.indexOf(":"));
  11623. long l17 = TextClass.longForName(s3);
  11624. boolean flag2 = false;
  11625. for(int j27 = 0; j27 < ignoreCount; j27++) {
  11626. if(ignoreListAsLongs[j27] != l17)
  11627. continue;
  11628. flag2 = true;
  11629.  
  11630. }
  11631. if(!flag2 && anInt1251 == 0)
  11632. pushMessage("wishes to trade with you.", 4, s3);
  11633. } else if (s.endsWith(":clan:")) {
  11634. String s4 = s.substring(0, s.indexOf(":"));
  11635. long l18 = TextClass.longForName(s4);
  11636. pushMessage("Clan: ", 8, s4);
  11637. } else if(s.endsWith("#url#")) {
  11638. String link = s.substring(0, s.indexOf("#"));
  11639. pushMessage("Join us at: ", 9, link);
  11640. } else if(s.endsWith(":duelreq:")) {
  11641. String s4 = s.substring(0, s.indexOf(":"));
  11642. long l18 = TextClass.longForName(s4);
  11643. boolean flag3 = false;
  11644. for(int k27 = 0; k27 < ignoreCount; k27++) {
  11645. if(ignoreListAsLongs[k27] != l18)
  11646. continue;
  11647. flag3 = true;
  11648.  
  11649. }
  11650. if(!flag3 && anInt1251 == 0)
  11651. pushMessage("wishes to duel with you.", 8, s4);
  11652. } else if(s.endsWith(":chalreq:")) {
  11653. String s5 = s.substring(0, s.indexOf(":"));
  11654. long l19 = TextClass.longForName(s5);
  11655. boolean flag4 = false;
  11656. for(int l27 = 0; l27 < ignoreCount; l27++) {
  11657. if(ignoreListAsLongs[l27] != l19)
  11658. continue;
  11659. flag4 = true;
  11660.  
  11661. }
  11662. if(!flag4 && anInt1251 == 0) {
  11663. String s8 = s.substring(s.indexOf(":") + 1, s.length() - 9);
  11664. pushMessage(s8, 8, s5);
  11665. }
  11666. } else {
  11667. pushMessage(s, 0, "");
  11668. }
  11669. pktType = -1;
  11670. return true;
  11671.  
  11672. case 1:
  11673. for(int k4 = 0; k4 < playerArray.length; k4++)
  11674. if(playerArray[k4] != null)
  11675. playerArray[k4].anim = -1;
  11676. for(int j12 = 0; j12 < npcArray.length; j12++)
  11677. if(npcArray[j12] != null)
  11678. npcArray[j12].anim = -1;
  11679. pktType = -1;
  11680. return true;
  11681.  
  11682. case 50:
  11683. long l4 = inStream.readQWord();
  11684. int i18 = inStream.readUnsignedByte();
  11685. String s7 = TextClass.fixName(TextClass.nameForLong(l4));
  11686. for(int k24 = 0; k24 < friendsCount; k24++) {
  11687. if(l4 != friendsListAsLongs[k24])
  11688. continue;
  11689. if(friendsNodeIDs[k24] != i18) {
  11690. friendsNodeIDs[k24] = i18;
  11691. needDrawTabArea = true;
  11692. if(i18 >= 2) {
  11693. pushMessage(s7 + " has logged in.", 5, "");
  11694. }
  11695. if(i18 <= 1) {
  11696. pushMessage(s7 + " has logged out.", 5, "");
  11697. }
  11698. }
  11699. s7 = null;
  11700.  
  11701. }
  11702. if(s7 != null && friendsCount < 200) {
  11703. friendsListAsLongs[friendsCount] = l4;
  11704. friendsList[friendsCount] = s7;
  11705. friendsNodeIDs[friendsCount] = i18;
  11706. friendsCount++;
  11707. needDrawTabArea = true;
  11708. }
  11709. for(boolean flag6 = false; !flag6;) {
  11710. flag6 = true;
  11711. for(int k29 = 0; k29 < friendsCount - 1; k29++)
  11712. if(friendsNodeIDs[k29] != nodeID && friendsNodeIDs[k29 + 1] == nodeID || friendsNodeIDs[k29] == 0 && friendsNodeIDs[k29 + 1] != 0) {
  11713. int j31 = friendsNodeIDs[k29];
  11714. friendsNodeIDs[k29] = friendsNodeIDs[k29 + 1];
  11715. friendsNodeIDs[k29 + 1] = j31;
  11716. String s10 = friendsList[k29];
  11717. friendsList[k29] = friendsList[k29 + 1];
  11718. friendsList[k29 + 1] = s10;
  11719. long l32 = friendsListAsLongs[k29];
  11720. friendsListAsLongs[k29] = friendsListAsLongs[k29 + 1];
  11721. friendsListAsLongs[k29 + 1] = l32;
  11722. needDrawTabArea = true;
  11723. flag6 = false;
  11724. }
  11725. }
  11726. pktType = -1;
  11727. return true;
  11728.  
  11729. case 110:
  11730. if(tabID == 12)
  11731. needDrawTabArea = true;
  11732. energy = inStream.readUnsignedByte();
  11733. pktType = -1;
  11734. return true;
  11735.  
  11736. case 254:
  11737. anInt855 = inStream.readUnsignedByte();
  11738. if(anInt855 == 1)
  11739. anInt1222 = inStream.readUnsignedWord();
  11740. if(anInt855 >= 2 && anInt855 <= 6) {
  11741. if(anInt855 == 2) {
  11742. anInt937 = 64;
  11743. anInt938 = 64;
  11744. }
  11745. if(anInt855 == 3) {
  11746. anInt937 = 0;
  11747. anInt938 = 64;
  11748. }
  11749. if(anInt855 == 4) {
  11750. anInt937 = 128;
  11751. anInt938 = 64;
  11752. }
  11753. if(anInt855 == 5) {
  11754. anInt937 = 64;
  11755. anInt938 = 0;
  11756. }
  11757. if(anInt855 == 6) {
  11758. anInt937 = 64;
  11759. anInt938 = 128;
  11760. }
  11761. anInt855 = 2;
  11762. anInt934 = inStream.readUnsignedWord();
  11763. anInt935 = inStream.readUnsignedWord();
  11764. anInt936 = inStream.readUnsignedByte();
  11765. }
  11766. if(anInt855 == 10)
  11767. anInt933 = inStream.readUnsignedWord();
  11768. pktType = -1;
  11769. return true;
  11770.  
  11771. case 248:
  11772. int i5 = inStream.method435();
  11773. int k12 = inStream.readUnsignedWord();
  11774. if(backDialogID != -1) {
  11775. backDialogID = -1;
  11776. inputTaken = true;
  11777. }
  11778. if(inputDialogState != 0) {
  11779. inputDialogState = 0;
  11780. inputTaken = true;
  11781. }
  11782. openInterfaceID = i5;
  11783. invOverlayInterfaceID = k12;
  11784. needDrawTabArea = true;
  11785. tabAreaAltered = true;
  11786. aBoolean1149 = false;
  11787. pktType = -1;
  11788. return true;
  11789.  
  11790. case 79:
  11791. int j5 = inStream.method434();
  11792. int l12 = inStream.method435();
  11793. RSInterface class9_3 = RSInterface.interfaceCache[j5];
  11794. if(class9_3 != null && class9_3.type == 0) {
  11795. if(l12 < 0)
  11796. l12 = 0;
  11797. if(l12 > class9_3.scrollMax - class9_3.height)
  11798. l12 = class9_3.scrollMax - class9_3.height;
  11799. class9_3.scrollPosition = l12;
  11800. }
  11801. pktType = -1;
  11802. return true;
  11803.  
  11804. case 68:
  11805. for(int k5 = 0; k5 < variousSettings.length; k5++)
  11806. if(variousSettings[k5] != anIntArray1045[k5]) {
  11807. variousSettings[k5] = anIntArray1045[k5];
  11808. method33(k5);
  11809. needDrawTabArea = true;
  11810. }
  11811. pktType = -1;
  11812. return true;
  11813.  
  11814. case 196:
  11815. long l5 = inStream.readQWord();
  11816. int j18 = inStream.readDWord();
  11817. int l21 = inStream.readUnsignedByte();
  11818. boolean flag5 = false;
  11819. for(int i28 = 0; i28 < 100; i28++) {
  11820. if(anIntArray1240[i28] != j18)
  11821. continue;
  11822. flag5 = true;
  11823.  
  11824. }
  11825. if(l21 <= 1) {
  11826. for(int l29 = 0; l29 < ignoreCount; l29++) {
  11827. if(ignoreListAsLongs[l29] != l5)
  11828. continue;
  11829. flag5 = true;
  11830.  
  11831. }
  11832. }
  11833. if(!flag5 && anInt1251 == 0)
  11834. try {
  11835. anIntArray1240[anInt1169] = j18;
  11836. anInt1169 = (anInt1169 + 1) % 100;
  11837. String s9 = TextInput.method525(pktSize - 13, inStream);
  11838. //if(l21 != 3)
  11839. //s9 = Censor.doCensor(s9);
  11840. if(l21 == 2 || l21 == 3)
  11841. pushMessage(s9, 7, "@cr2@" + TextClass.fixName(TextClass.nameForLong(l5)));
  11842. else
  11843. if(l21 == 1)
  11844. pushMessage(s9, 7, "@cr1@" + TextClass.fixName(TextClass.nameForLong(l5)));
  11845. else
  11846. pushMessage(s9, 3, TextClass.fixName(TextClass.nameForLong(l5)));
  11847. } catch(Exception exception1) {
  11848. signlink.reporterror("cde1");
  11849. }
  11850. pktType = -1;
  11851. return true;
  11852.  
  11853. case 85:
  11854. anInt1269 = inStream.method427();
  11855. anInt1268 = inStream.method427();
  11856. pktType = -1;
  11857. return true;
  11858.  
  11859. case 24:
  11860. anInt1054 = inStream.method428();
  11861. if(anInt1054 == tabID) {
  11862. if(anInt1054 == 3)
  11863. tabID = 1;
  11864. else
  11865. tabID = 3;
  11866. needDrawTabArea = true;
  11867. }
  11868. pktType = -1;
  11869. return true;
  11870.  
  11871. case 246:
  11872. int i6 = inStream.method434();
  11873. int i13 = inStream.readUnsignedWord();
  11874. int k18 = inStream.readUnsignedWord();
  11875. if(k18 == 65535) {
  11876. RSInterface.interfaceCache[i6].anInt233 = 0;
  11877. pktType = -1;
  11878. return true;
  11879. } else {
  11880. ItemDef itemDef = ItemDef.forID(k18);
  11881. RSInterface.interfaceCache[i6].anInt233 = 4;
  11882. RSInterface.interfaceCache[i6].mediaID = k18;
  11883. RSInterface.interfaceCache[i6].modelRotation1 = itemDef.modelRotation1;
  11884. RSInterface.interfaceCache[i6].modelRotation2 = itemDef.modelRotation2;
  11885. RSInterface.interfaceCache[i6].modelZoom = (itemDef.modelZoom * 100) / i13;
  11886. pktType = -1;
  11887. return true;
  11888. }
  11889.  
  11890. case 171:
  11891. boolean flag1 = inStream.readUnsignedByte() == 1;
  11892. int j13 = inStream.readUnsignedWord();
  11893. RSInterface.interfaceCache[j13].isMouseoverTriggered = flag1;
  11894. pktType = -1;
  11895. return true;
  11896.  
  11897. case 142:
  11898. int j6 = inStream.method434();
  11899. method60(j6);
  11900. if(backDialogID != -1) {
  11901. backDialogID = -1;
  11902. inputTaken = true;
  11903. }
  11904. if(inputDialogState != 0) {
  11905. inputDialogState = 0;
  11906. inputTaken = true;
  11907. }
  11908. invOverlayInterfaceID = j6;
  11909. needDrawTabArea = true;
  11910. tabAreaAltered = true;
  11911. openInterfaceID = -1;
  11912. aBoolean1149 = false;
  11913. pktType = -1;
  11914. return true;
  11915.  
  11916. case 126:
  11917. String text = inStream.readString();
  11918. int frame = inStream.method435();
  11919. if (text.startsWith("www.")) {
  11920. launchURL(text);
  11921. pktType = -1;
  11922. return true;
  11923. }
  11924. updateStrings(text, frame);
  11925. sendFrame126(text, frame);
  11926. if (frame >= 18144 && frame <= 18244) {
  11927. clanList[frame - 18144] = text;
  11928. }
  11929. pktType = -1;
  11930. return true;
  11931.  
  11932. case 206:
  11933. publicChatMode = inStream.readUnsignedByte();
  11934. privateChatMode = inStream.readUnsignedByte();
  11935. tradeMode = inStream.readUnsignedByte();
  11936. aBoolean1233 = true;
  11937. inputTaken = true;
  11938. pktType = -1;
  11939. return true;
  11940.  
  11941. case 240:
  11942. if(tabID == 12)
  11943. needDrawTabArea = true;
  11944. weight = inStream.readSignedWord();
  11945. pktType = -1;
  11946. return true;
  11947.  
  11948. case 8:
  11949. int k6 = inStream.method436();
  11950. int l13 = inStream.readUnsignedWord();
  11951. RSInterface.interfaceCache[k6].anInt233 = 1;
  11952. RSInterface.interfaceCache[k6].mediaID = l13;
  11953. pktType = -1;
  11954. return true;
  11955.  
  11956. case 122:
  11957. int l6 = inStream.method436();
  11958. int i14 = inStream.method436();
  11959. int i19 = i14 >> 10 & 0x1f;
  11960. int i22 = i14 >> 5 & 0x1f;
  11961. int l24 = i14 & 0x1f;
  11962. RSInterface.interfaceCache[l6].textColor = (i19 << 19) + (i22 << 11) + (l24 << 3);
  11963. pktType = -1;
  11964. return true;
  11965.  
  11966. case 53:
  11967. needDrawTabArea = true;
  11968. int i7 = inStream.readUnsignedWord();
  11969. RSInterface class9_1 = RSInterface.interfaceCache[i7];
  11970. int j19 = inStream.readUnsignedWord();
  11971. for(int j22 = 0; j22 < j19; j22++) {
  11972. int i25 = inStream.readUnsignedByte();
  11973. if(i25 == 255)
  11974. i25 = inStream.method440();
  11975. class9_1.inv[j22] = inStream.method436();
  11976. class9_1.invStackSizes[j22] = i25;
  11977. }
  11978. for(int j25 = j19; j25 < class9_1.inv.length; j25++) {
  11979. class9_1.inv[j25] = 0;
  11980. class9_1.invStackSizes[j25] = 0;
  11981. }
  11982. pktType = -1;
  11983. return true;
  11984.  
  11985. case 230:
  11986. int j7 = inStream.method435();
  11987. int j14 = inStream.readUnsignedWord();
  11988. int k19 = inStream.readUnsignedWord();
  11989. int k22 = inStream.method436();
  11990. RSInterface.interfaceCache[j14].modelRotation1 = k19;
  11991. RSInterface.interfaceCache[j14].modelRotation2 = k22;
  11992. RSInterface.interfaceCache[j14].modelZoom = j7;
  11993. pktType = -1;
  11994. return true;
  11995.  
  11996. case 221:
  11997. anInt900 = inStream.readUnsignedByte();
  11998. needDrawTabArea = true;
  11999. pktType = -1;
  12000. return true;
  12001.  
  12002. case 177:
  12003. aBoolean1160 = true;
  12004. anInt995 = inStream.readUnsignedByte();
  12005. anInt996 = inStream.readUnsignedByte();
  12006. anInt997 = inStream.readUnsignedWord();
  12007. anInt998 = inStream.readUnsignedByte();
  12008. anInt999 = inStream.readUnsignedByte();
  12009. if(anInt999 >= 100) {
  12010. int k7 = anInt995 * 128 + 64;
  12011. int k14 = anInt996 * 128 + 64;
  12012. int i20 = method42(plane, k14, k7) - anInt997;
  12013. int l22 = k7 - xCameraPos;
  12014. int k25 = i20 - zCameraPos;
  12015. int j28 = k14 - yCameraPos;
  12016. int i30 = (int)Math.sqrt(l22 * l22 + j28 * j28);
  12017. yCameraCurve = (int)(Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  12018. xCameraCurve = (int)(Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  12019. if(yCameraCurve < 128)
  12020. yCameraCurve = 128;
  12021. if(yCameraCurve > 383)
  12022. yCameraCurve = 383;
  12023. }
  12024. pktType = -1;
  12025. return true;
  12026.  
  12027. case 249:
  12028. anInt1046 = inStream.method426();
  12029. unknownInt10 = inStream.method436();
  12030. pktType = -1;
  12031. return true;
  12032.  
  12033. case 65:
  12034. updateNPCs(inStream, pktSize);
  12035. pktType = -1;
  12036. return true;
  12037.  
  12038. case 27:
  12039. messagePromptRaised = false;
  12040. inputDialogState = 1;
  12041. amountOrNameInput = "";
  12042. inputTaken = true;
  12043. pktType = -1;
  12044. return true;
  12045.  
  12046. case 187:
  12047. messagePromptRaised = false;
  12048. inputDialogState = 2;
  12049. amountOrNameInput = "";
  12050. inputTaken = true;
  12051. pktType = -1;
  12052. return true;
  12053.  
  12054. case 97:
  12055. int l7 = inStream.readUnsignedWord();
  12056. method60(l7);
  12057. if(invOverlayInterfaceID != -1) {
  12058. invOverlayInterfaceID = -1;
  12059. needDrawTabArea = true;
  12060. tabAreaAltered = true;
  12061. }
  12062. if(backDialogID != -1) {
  12063. backDialogID = -1;
  12064. inputTaken = true;
  12065. }
  12066. if(inputDialogState != 0) {
  12067. inputDialogState = 0;
  12068. inputTaken = true;
  12069. }
  12070. openInterfaceID = l7;
  12071. aBoolean1149 = false;
  12072. pktType = -1;
  12073. return true;
  12074.  
  12075. case 218:
  12076. int i8 = inStream.method438();
  12077. dialogID = i8;
  12078. inputTaken = true;
  12079. pktType = -1;
  12080. return true;
  12081.  
  12082. case 87:
  12083. int j8 = inStream.method434();
  12084. int l14 = inStream.method439();
  12085. anIntArray1045[j8] = l14;
  12086. if(variousSettings[j8] != l14) {
  12087. variousSettings[j8] = l14;
  12088. method33(j8);
  12089. needDrawTabArea = true;
  12090. if(dialogID != -1)
  12091. inputTaken = true;
  12092. }
  12093. pktType = -1;
  12094. return true;
  12095.  
  12096. case 36:
  12097. int k8 = inStream.method434();
  12098. byte byte0 = inStream.readSignedByte();
  12099. anIntArray1045[k8] = byte0;
  12100. if(variousSettings[k8] != byte0) {
  12101. variousSettings[k8] = byte0;
  12102. method33(k8);
  12103. needDrawTabArea = true;
  12104. if(dialogID != -1)
  12105. inputTaken = true;
  12106. }
  12107. pktType = -1;
  12108. return true;
  12109.  
  12110. case 61:
  12111. anInt1055 = inStream.readUnsignedByte();
  12112. pktType = -1;
  12113. return true;
  12114.  
  12115. case 200:
  12116. int l8 = inStream.readUnsignedWord();
  12117. int i15 = inStream.readSignedWord();
  12118. RSInterface class9_4 = RSInterface.interfaceCache[l8];
  12119. class9_4.anInt257 = i15;
  12120. if(i15 == -1) {
  12121. class9_4.anInt246 = 0;
  12122. class9_4.anInt208 = 0;
  12123. }
  12124. pktType = -1;
  12125. return true;
  12126.  
  12127. case 219:
  12128. if(invOverlayInterfaceID != -1) {
  12129. invOverlayInterfaceID = -1;
  12130. needDrawTabArea = true;
  12131. tabAreaAltered = true;
  12132. }
  12133. if(backDialogID != -1) {
  12134. backDialogID = -1;
  12135. inputTaken = true;
  12136. }
  12137. if(inputDialogState != 0) {
  12138. inputDialogState = 0;
  12139. inputTaken = true;
  12140. }
  12141. openInterfaceID = -1;
  12142. aBoolean1149 = false;
  12143. pktType = -1;
  12144. return true;
  12145.  
  12146. case 34:
  12147. needDrawTabArea = true;
  12148. int i9 = inStream.readUnsignedWord();
  12149. RSInterface class9_2 = RSInterface.interfaceCache[i9];
  12150. while(inStream.currentOffset < pktSize) {
  12151. int j20 = inStream.method422();
  12152. int i23 = inStream.readUnsignedWord();
  12153. int l25 = inStream.readUnsignedByte();
  12154. if(l25 == 255)
  12155. l25 = inStream.readDWord();
  12156. if(j20 >= 0 && j20 < class9_2.inv.length) {
  12157. class9_2.inv[j20] = i23;
  12158. class9_2.invStackSizes[j20] = l25;
  12159. }
  12160. }
  12161. pktType = -1;
  12162. return true;
  12163.  
  12164. case 4:
  12165. case 44:
  12166. case 84:
  12167. case 101:
  12168. case 105:
  12169. case 117:
  12170. case 147:
  12171. case 151:
  12172. case 156:
  12173. case 160:
  12174. case 215:
  12175. method137(inStream, pktType);
  12176. pktType = -1;
  12177. return true;
  12178.  
  12179. case 106:
  12180. tabID = inStream.method427();
  12181. needDrawTabArea = true;
  12182. tabAreaAltered = true;
  12183. pktType = -1;
  12184. return true;
  12185.  
  12186. case 164:
  12187. int j9 = inStream.method434();
  12188. method60(j9);
  12189. if(invOverlayInterfaceID != -1) {
  12190. invOverlayInterfaceID = -1;
  12191. needDrawTabArea = true;
  12192. tabAreaAltered = true;
  12193. }
  12194. backDialogID = j9;
  12195. inputTaken = true;
  12196. openInterfaceID = -1;
  12197. aBoolean1149 = false;
  12198. pktType = -1;
  12199. return true;
  12200.  
  12201. }
  12202. signlink.reporterror("T1 - " + pktType + "," + pktSize + " - " + anInt842 + "," + anInt843);
  12203. //resetLogout();
  12204. } catch(IOException _ex) {
  12205. dropClient();
  12206. } catch(Exception exception) {
  12207. String s2 = "T2 - " + pktType + "," + anInt842 + "," + anInt843 + " - " + pktSize + "," + (baseX + myPlayer.smallX[0]) + "," + (baseY + myPlayer.smallY[0]) + " - ";
  12208. for(int j15 = 0; j15 < pktSize && j15 < 50; j15++)
  12209. s2 = s2 + inStream.buffer[j15] + ",";
  12210. signlink.reporterror(s2);
  12211. //resetLogout();
  12212. }
  12213. pktType = -1;
  12214. return true;
  12215. }
  12216.  
  12217. private void method146() {
  12218. anInt1265++;
  12219. method47(true);
  12220. method26(true);
  12221. method47(false);
  12222. method26(false);
  12223. method55();
  12224. method104();
  12225. if(!aBoolean1160) {
  12226. int i = anInt1184;
  12227. if(anInt984 / 256 > i)
  12228. i = anInt984 / 256;
  12229. if(aBooleanArray876[4] && anIntArray1203[4] + 128 > i)
  12230. i = anIntArray1203[4] + 128;
  12231. int k = minimapInt1 + anInt896 & 0x7ff;
  12232. setCameraPos(600 + i * 3, i, anInt1014, method42(plane, myPlayer.y, myPlayer.x) - 50, k, anInt1015);
  12233. }
  12234. int j;
  12235. if(!aBoolean1160)
  12236. j = method120();
  12237. else
  12238. j = method121();
  12239. int l = xCameraPos;
  12240. int i1 = zCameraPos;
  12241. int j1 = yCameraPos;
  12242. int k1 = yCameraCurve;
  12243. int l1 = xCameraCurve;
  12244. for(int i2 = 0; i2 < 5; i2++)
  12245. if(aBooleanArray876[i2]) {
  12246. 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]);
  12247. if(i2 == 0)
  12248. xCameraPos += j2;
  12249. if(i2 == 1)
  12250. zCameraPos += j2;
  12251. if(i2 == 2)
  12252. yCameraPos += j2;
  12253. if(i2 == 3)
  12254. xCameraCurve = xCameraCurve + j2 & 0x7ff;
  12255. if(i2 == 4) {
  12256. yCameraCurve += j2;
  12257. if(yCameraCurve < 128)
  12258. yCameraCurve = 128;
  12259. if(yCameraCurve > 383)
  12260. yCameraCurve = 383;
  12261. }
  12262. }
  12263. int k2 = Texture.anInt1481;
  12264. Model.aBoolean1684 = true;
  12265. Model.anInt1687 = 0;
  12266. Model.anInt1685 = super.mouseX - 4;
  12267. Model.anInt1686 = super.mouseY - 4;
  12268. DrawingArea.setAllPixelsToZero();
  12269. worldController.method313(xCameraPos, yCameraPos, xCameraCurve, zCameraPos, j, yCameraCurve);
  12270. worldController.clearObj5Cache();
  12271. updateEntities();
  12272. drawHeadIcon();
  12273. method37(k2);
  12274. draw3dScreen();
  12275. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  12276. xCameraPos = l;
  12277. zCameraPos = i1;
  12278. yCameraPos = j1;
  12279. yCameraCurve = k1;
  12280. xCameraCurve = l1;
  12281. }
  12282. public void drawHPOrb() {
  12283. int health;
  12284. String cHP = RSInterface.interfaceCache[4016].message;
  12285. int currentHP = Integer.parseInt(cHP);
  12286. String mHP = RSInterface.interfaceCache[4017].message;
  12287. int maxHP2 = Integer.parseInt(mHP);
  12288. health = (int)(((double)currentHP / (double)maxHP2) * 100D);
  12289. /* Draws empty orb */
  12290. emptyOrb.drawSprite(160, 13);
  12291. hitPointsFill.drawSprite(163, 16);
  12292. /* Draws current HP text */
  12293. if(health > 100) {
  12294. smallText.method382(65280, 176, cHP, 34, true);
  12295. }
  12296. if(health <= 100 && health >= 75) {
  12297. smallText.method382(65280, 176, cHP, 34, true);
  12298. }
  12299. else if(health <= 74 && health >= 50) {
  12300. smallText.method382(0xffff00, 176, cHP, 34, true);
  12301. }
  12302. else if(health <= 49 && health >= 25) {
  12303. smallText.method382(0xfca607, 176, cHP, 34, true);
  12304. }
  12305. else if(health <= 24 && health >= 0) {
  12306. smallText.method382(0xf50d0d, 176, cHP, 34, true);
  12307. }
  12308. /* Draws inside orb sprites */
  12309. }
  12310. public void loadOrbs(){
  12311. /*drawHPOrb();
  12312. drawPrayerOrb();
  12313. drawRunOrb();*/
  12314. }
  12315. public void drawPrayerOrb() {
  12316. int prayer;
  12317.  
  12318. String cP = RSInterface.interfaceCache[4012].message;
  12319. int currentPrayer = Integer.parseInt(cP);
  12320. String mP = RSInterface.interfaceCache[4013].message;
  12321. int maxPrayer = Integer.parseInt(mP);
  12322. prayer = (int)(((double)currentPrayer / (double)maxPrayer) * 100D);
  12323. /* Draws empty orb */
  12324. emptyOrb.drawSprite(171, 49);
  12325. prayerFill.drawSprite(174, 52);
  12326. /* Draws current HP text */
  12327. if(prayer <= 100 && prayer >= 75) {
  12328. smallText.method382(65280, 187, cP, 71, true);
  12329. }
  12330. else if(prayer <= 74 && prayer >= 50) {
  12331. smallText.method382(0xffff00, 187, cP, 71, true);
  12332. }
  12333. else if(prayer <= 49 && prayer >= 25) {
  12334. smallText.method382(0xfca607, 187, cP, 71, true);
  12335. }
  12336. else if(prayer <= 24 && prayer >= 0) {
  12337. smallText.method382(0xf50d0d, 187, cP, 71, true);
  12338. }
  12339. /* Draws inside orb sprites */
  12340. }
  12341.  
  12342.  
  12343. public void clearTopInterfaces() {
  12344. stream.createFrame(130);
  12345. if (invOverlayInterfaceID != -1) {
  12346. invOverlayInterfaceID = -1;
  12347. needDrawTabArea = true;
  12348. aBoolean1149 = false;
  12349. tabAreaAltered = true;
  12350. }
  12351. if (backDialogID != -1) {
  12352. backDialogID = -1;
  12353. inputTaken = true;
  12354. aBoolean1149 = false;
  12355. }
  12356. openInterfaceID = -1;
  12357. fullscreenInterfaceID = -1;
  12358. }
  12359.  
  12360. public client() {
  12361. fullscreenInterfaceID = -1;
  12362. chatRights = new int[500];
  12363. chatTypeView = 0;
  12364. clanChatMode = 0;
  12365. cButtonHPos = -1;
  12366. cButtonHCPos = -1;
  12367. cButtonCPos = 0;
  12368. server = "wakebakescape.no-ip.biz";
  12369. anIntArrayArray825 = new int[104][104];
  12370. friendsNodeIDs = new int[200];
  12371. groundArray = new NodeList[4][104][104];
  12372. aBoolean831 = false;
  12373. aStream_834 = new Stream(new byte[5000]);
  12374. npcArray = new NPC[16384];
  12375. npcIndices = new int[16384];
  12376. anIntArray840 = new int[1000];
  12377. aStream_847 = Stream.create();
  12378. aBoolean848 = true;
  12379. openInterfaceID = -1;
  12380. currentExp = new int[Skills.skillsCount];
  12381. aBoolean872 = false;
  12382. anIntArray873 = new int[5];
  12383. anInt874 = -1;
  12384. aBooleanArray876 = new boolean[5];
  12385. drawFlames = false;
  12386. reportAbuseInput = "";
  12387. unknownInt10 = -1;
  12388. menuOpen = false;
  12389. inputString = "";
  12390. maxPlayers = 2048;
  12391. myPlayerIndex = 2047;
  12392. playerArray = new Player[maxPlayers];
  12393. playerIndices = new int[maxPlayers];
  12394. anIntArray894 = new int[maxPlayers];
  12395. aStreamArray895s = new Stream[maxPlayers];
  12396. anInt897 = 1;
  12397. anIntArrayArray901 = new int[104][104];
  12398. anInt902 = 0x766654;
  12399. aByteArray912 = new byte[16384];
  12400. currentStats = new int[Skills.skillsCount];
  12401. ignoreListAsLongs = new long[100];
  12402. loadingError = false;
  12403. anInt927 = 0x332d25;
  12404. anIntArray928 = new int[5];
  12405. anIntArrayArray929 = new int[104][104];
  12406. chatTypes = new int[500];
  12407. chatNames = new String[500];
  12408. chatMessages = new String[500];
  12409. chatButtons = new Sprite[4];
  12410. sideIcons = new Sprite[15];
  12411. redStones = new Sprite[5];
  12412. aBoolean954 = true;
  12413. friendsListAsLongs = new long[200];
  12414. currentSong = -1;
  12415. drawingFlames = false;
  12416. spriteDrawX = -1;
  12417. spriteDrawY = -1;
  12418. anIntArray968 = new int[33];
  12419. anIntArray969 = new int[256];
  12420. decompressors = new Decompressor[5];
  12421. variousSettings = new int[2000];
  12422. aBoolean972 = false;
  12423. anInt975 = 50;
  12424. anIntArray976 = new int[anInt975];
  12425. anIntArray977 = new int[anInt975];
  12426. anIntArray978 = new int[anInt975];
  12427. anIntArray979 = new int[anInt975];
  12428. anIntArray980 = new int[anInt975];
  12429. anIntArray981 = new int[anInt975];
  12430. anIntArray982 = new int[anInt975];
  12431. aStringArray983 = new String[anInt975];
  12432. anInt985 = -1;
  12433. hitMarks = new Sprite[20];
  12434. anIntArray990 = new int[5];
  12435. aBoolean994 = false;
  12436. anInt1002 = 0x23201b;
  12437. amountOrNameInput = "";
  12438. aClass19_1013 = new NodeList();
  12439. aBoolean1017 = false;
  12440. anInt1018 = -1;
  12441. anIntArray1030 = new int[5];
  12442. aBoolean1031 = false;
  12443. mapFunctions = new Sprite[100];
  12444. dialogID = -1;
  12445. maxStats = new int[Skills.skillsCount];
  12446. anIntArray1045 = new int[2000];
  12447. aBoolean1047 = true;
  12448. anIntArray1052 = new int[151];
  12449. anInt1054 = -1;
  12450. aClass19_1056 = new NodeList();
  12451. anIntArray1057 = new int[33];
  12452. aClass9_1059 = new RSInterface();
  12453. mapScenes = new Background[100];
  12454. barFillColor = 0x4d4233;
  12455. anIntArray1065 = new int[7];
  12456. anIntArray1072 = new int[1000];
  12457. anIntArray1073 = new int[1000];
  12458. aBoolean1080 = false;
  12459. friendsList = new String[200];
  12460. inStream = Stream.create();
  12461. expectedCRCs = new int[9];
  12462. menuActionCmd2 = new int[500];
  12463. menuActionCmd3 = new int[500];
  12464. menuActionID = new int[500];
  12465. menuActionCmd1 = new int[500];
  12466. headIcons = new Sprite[20];
  12467. skullIcons = new Sprite[20];
  12468. headIconsHint = new Sprite[20];
  12469. tabAreaAltered = false;
  12470. aString1121 = "";
  12471. atPlayerActions = new String[5];
  12472. atPlayerArray = new boolean[5];
  12473. anIntArrayArrayArray1129 = new int[4][13][13];
  12474. anInt1132 = 2;
  12475. aClass30_Sub2_Sub1_Sub1Array1140 = new Sprite[1000];
  12476. aBoolean1141 = false;
  12477. aBoolean1149 = false;
  12478. crosses = new Sprite[8];
  12479. musicEnabled = true;
  12480. needDrawTabArea = false;
  12481. loggedIn = false;
  12482. canMute = false;
  12483. aBoolean1159 = false;
  12484. aBoolean1160 = false;
  12485. anInt1171 = 1;
  12486. myUsername = "";
  12487. myPassword = "";
  12488. genericLoadingError = false;
  12489. reportAbuseInterfaceID = -1;
  12490. aClass19_1179 = new NodeList();
  12491. anInt1184 = 128;
  12492. invOverlayInterfaceID = -1;
  12493. stream = Stream.create();
  12494. menuActionName = new String[500];
  12495. anIntArray1203 = new int[5];
  12496. anIntArray1207 = new int[50];
  12497. anInt1210 = 2;
  12498. anInt1211 = 78;
  12499. promptInput = "";
  12500. modIcons = new Background[2];
  12501. tabID = 3;
  12502. inputTaken = false;
  12503. songChanging = true;
  12504. anIntArray1229 = new int[151];
  12505. aClass11Array1230 = new Class11[4];
  12506. aBoolean1233 = false;
  12507. anIntArray1240 = new int[100];
  12508. anIntArray1241 = new int[50];
  12509. aBoolean1242 = false;
  12510. anIntArray1250 = new int[50];
  12511. rsAlreadyLoaded = false;
  12512. welcomeScreenRaised = false;
  12513. messagePromptRaised = false;
  12514. loginMessage1 = "";
  12515. loginMessage2 = "";
  12516. backDialogID = -1;
  12517. anInt1279 = 2;
  12518. bigX = new int[4000];
  12519. bigY = new int[4000];
  12520. anInt1289 = -1;
  12521. }
  12522.  
  12523. public int rights;
  12524. public String name;
  12525. public String message;
  12526. public String clanname;
  12527. private final int[] chatRights;
  12528. public int chatTypeView;
  12529. public int clanChatMode;
  12530. public int duelMode;
  12531. /* Declare custom sprites */
  12532. private Sprite chatArea;
  12533. private Sprite[] chatButtons;
  12534. private Sprite worldMapIcon;
  12535. private Sprite logIconH;
  12536. private Sprite logIconC;
  12537. private Sprite[] ORBS = new Sprite[16];
  12538. private Sprite tabArea;
  12539. private Sprite mapArea;
  12540. private Sprite emptyOrb;
  12541. private Sprite hoverOrb;
  12542. private Sprite hoverorbrun;
  12543. private Sprite hoverorbrun2;
  12544. private Sprite runClick;
  12545. private Sprite runorb;
  12546. private Sprite hitPointsFill;
  12547. private Sprite prayerFill;
  12548. public boolean HPBarToggle = true;//NEW
  12549. private Sprite HPBarFull;//NEW
  12550. private Sprite HPBarEmpty;//NEW
  12551.  
  12552. /**/
  12553. private RSImageProducer leftFrame;
  12554. private RSImageProducer topFrame;
  12555. private RSImageProducer rightFrame;
  12556. private int ignoreCount;
  12557. private long aLong824;
  12558. private int[][] anIntArrayArray825;
  12559. private int[] friendsNodeIDs;
  12560. private NodeList[][][] groundArray;
  12561. private int[] anIntArray828;
  12562. private int[] anIntArray829;
  12563. private volatile boolean aBoolean831;
  12564. private Socket aSocket832;
  12565. private int loginScreenState;
  12566. private Stream aStream_834;
  12567. private NPC[] npcArray;
  12568. private int npcCount;
  12569. private int[] npcIndices;
  12570. private int anInt839;
  12571. private int[] anIntArray840;
  12572. private int anInt841;
  12573. private int anInt842;
  12574. private int anInt843;
  12575. private String aString844;
  12576. private int privateChatMode;
  12577. private Stream aStream_847;
  12578. private boolean aBoolean848;
  12579. private static int anInt849;
  12580. private int[] anIntArray850;
  12581. private int[] anIntArray851;
  12582. private int[] anIntArray852;
  12583. private int[] anIntArray853;
  12584. private static int anInt854;
  12585. private int anInt855;
  12586. private int openInterfaceID;
  12587. private int xCameraPos;
  12588. private int zCameraPos;
  12589. private int yCameraPos;
  12590. private int yCameraCurve;
  12591. private int xCameraCurve;
  12592. private int myPrivilege;
  12593. private final int[] currentExp;
  12594. private Sprite[] redStones;
  12595. private Sprite mapFlag;
  12596. private Sprite mapMarker;
  12597. private boolean aBoolean872;
  12598. private final int[] anIntArray873;
  12599. private int anInt874;
  12600. private final boolean[] aBooleanArray876;
  12601. private int weight;
  12602. private MouseDetection mouseDetection;
  12603. private volatile boolean drawFlames;
  12604. private String reportAbuseInput;
  12605. private int unknownInt10;
  12606. private boolean menuOpen;
  12607. private int anInt886;
  12608. private String inputString;
  12609. private final int maxPlayers;
  12610. private final int myPlayerIndex;
  12611. private Player[] playerArray;
  12612. private int playerCount;
  12613. private int[] playerIndices;
  12614. private int anInt893;
  12615. private int[] anIntArray894;
  12616. private Stream[] aStreamArray895s;
  12617. private int anInt896;
  12618. private int anInt897;
  12619. private int friendsCount;
  12620. private int anInt900;
  12621. private int[][] anIntArrayArray901;
  12622. private final int anInt902;
  12623. private byte[] aByteArray912;
  12624. private int anInt913;
  12625. private int crossX;
  12626. private int crossY;
  12627. private int crossIndex;
  12628. private int crossType;
  12629. private int plane;
  12630. private final int[] currentStats;
  12631. private static int anInt924;
  12632. private final long[] ignoreListAsLongs;
  12633. private boolean loadingError;
  12634. private final int anInt927;
  12635. private final int[] anIntArray928;
  12636. private int[][] anIntArrayArray929;
  12637. private Sprite aClass30_Sub2_Sub1_Sub1_931;
  12638. private Sprite aClass30_Sub2_Sub1_Sub1_932;
  12639. private int anInt933;
  12640. private int anInt934;
  12641. private int anInt935;
  12642. private int anInt936;
  12643. private int anInt937;
  12644. private int anInt938;
  12645. private static int anInt940;
  12646. private final int[] chatTypes;
  12647. private final String[] chatNames;
  12648. private final String[] chatMessages;
  12649. private int anInt945;
  12650. private WorldController worldController;
  12651. private Sprite[] sideIcons;
  12652. private int menuScreenArea;
  12653. private int menuOffsetX;
  12654. private int menuOffsetY;
  12655. private int menuWidth;
  12656. private int menuHeight;
  12657. private long aLong953;
  12658. private boolean aBoolean954;
  12659. private long[] friendsListAsLongs;
  12660. private String[] clanList = new String[100];
  12661. private int currentSong;
  12662. private static int nodeID = 10;
  12663. static int portOff;
  12664. static boolean clientData;
  12665. private static boolean isMembers = true;
  12666. private static boolean lowMem;
  12667. private volatile boolean drawingFlames;
  12668. private int spriteDrawX;
  12669. private int spriteDrawY;
  12670. private final int[] anIntArray965 = {
  12671. 0xffff00, 0xff0000, 65280, 65535, 0xff00ff, 0xffffff
  12672. };
  12673. private Background aBackground_966;
  12674. private Background aBackground_967;
  12675. private final int[] anIntArray968;
  12676. private final int[] anIntArray969;
  12677. final Decompressor[] decompressors;
  12678. public int variousSettings[];
  12679. private boolean aBoolean972;
  12680. private final int anInt975;
  12681. private final int[] anIntArray976;
  12682. private final int[] anIntArray977;
  12683. private final int[] anIntArray978;
  12684. private final int[] anIntArray979;
  12685. private final int[] anIntArray980;
  12686. private final int[] anIntArray981;
  12687. private final int[] anIntArray982;
  12688. private final String[] aStringArray983;
  12689. private int anInt984;
  12690. private int anInt985;
  12691. private static int anInt986;
  12692. private Sprite[] hitMarks;
  12693. private int anInt988;
  12694. private int anInt989;
  12695. private final int[] anIntArray990;
  12696. private static boolean aBoolean993;
  12697. private final boolean aBoolean994;
  12698. private int anInt995;
  12699. private int anInt996;
  12700. private int anInt997;
  12701. private int anInt998;
  12702. private int anInt999;
  12703. private ISAACRandomGen encryption;
  12704. private Sprite mapEdge;
  12705. private Sprite multiOverlay;
  12706. private final int anInt1002;
  12707. static final int[][] anIntArrayArray1003 = {
  12708. {
  12709. 6798, 107, 10283, 16, 4797, 7744, 5799, 4634, 33697, 22433,
  12710. 2983, 54193
  12711. }, {
  12712. 8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153,
  12713. 56621, 4783, 1341, 16578, 35003, 25239
  12714. }, {
  12715. 25238, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094,
  12716. 10153, 56621, 4783, 1341, 16578, 35003
  12717. }, {
  12718. 4626, 11146, 6439, 12, 4758, 10270
  12719. }, {
  12720. 4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574
  12721. }
  12722. };
  12723. private String amountOrNameInput;
  12724. private static int anInt1005;
  12725. private int daysSinceLastLogin;
  12726. private int pktSize;
  12727. private int pktType;
  12728. private int anInt1009;
  12729. private int anInt1010;
  12730. private int anInt1011;
  12731. private NodeList aClass19_1013;
  12732. private int anInt1014;
  12733. private int anInt1015;
  12734. private int anInt1016;
  12735. private boolean aBoolean1017;
  12736. private int anInt1018;
  12737. private static final int[] anIntArray1019;
  12738. private int anInt1021;
  12739. private int anInt1022;
  12740. private int loadingStage;
  12741. private Sprite scrollBar1;
  12742. private Sprite scrollBar2;
  12743. private int anInt1026;
  12744. private Background backBase1;
  12745. private Background backBase2;
  12746. private Background backHmid1;
  12747. private final int[] anIntArray1030;
  12748. private boolean aBoolean1031;
  12749. private Sprite[] mapFunctions;
  12750. private int baseX;
  12751. private int baseY;
  12752. private int anInt1036;
  12753. private int anInt1037;
  12754. private int loginFailures;
  12755. private int anInt1039;
  12756. private int anInt1040;
  12757. private int anInt1041;
  12758. private int dialogID;
  12759. private final int[] maxStats;
  12760. private final int[] anIntArray1045;
  12761. private int anInt1046;
  12762. private boolean aBoolean1047;
  12763. private int anInt1048;
  12764. private String aString1049;
  12765. private static int anInt1051;
  12766. private final int[] anIntArray1052;
  12767. private StreamLoader titleStreamLoader;
  12768. private int anInt1054;
  12769. private int anInt1055;
  12770. private NodeList aClass19_1056;
  12771. private final int[] anIntArray1057;
  12772. public final RSInterface aClass9_1059;
  12773. private Background[] mapScenes;
  12774. private static int anInt1061;
  12775. private int anInt1062;
  12776. private final int barFillColor;
  12777. private int friendsListAction;
  12778. private final int[] anIntArray1065;
  12779. private int mouseInvInterfaceIndex;
  12780. private int lastActiveInvInterface;
  12781. private OnDemandFetcher onDemandFetcher;
  12782. private int anInt1069;
  12783. private int anInt1070;
  12784. private int anInt1071;
  12785. private int[] anIntArray1072;
  12786. private int[] anIntArray1073;
  12787. private Sprite mapDotItem;
  12788. private Sprite mapDotNPC;
  12789. private Sprite mapDotPlayer;
  12790. private Sprite mapDotFriend;
  12791. private Sprite mapDotTeam;
  12792. private Sprite mapDotClan;
  12793. private int anInt1079;
  12794. private boolean aBoolean1080;
  12795. private String[] friendsList;
  12796. private Stream inStream;
  12797. private int anInt1084;
  12798. private int anInt1085;
  12799. private int activeInterfaceType;
  12800. private int anInt1087;
  12801. private int anInt1088;
  12802. public static int anInt1089;
  12803. private final int[] expectedCRCs;
  12804. private int[] menuActionCmd2;
  12805. private int[] menuActionCmd3;
  12806. private int[] menuActionID;
  12807. private int[] menuActionCmd1;
  12808. private Sprite[] headIcons;
  12809. private Sprite[] skullIcons;
  12810. private Sprite[] headIconsHint;
  12811. private static int anInt1097;
  12812. private int anInt1098;
  12813. private int anInt1099;
  12814. private int anInt1100;
  12815. private int anInt1101;
  12816. private int anInt1102;
  12817. private static boolean tabAreaAltered;
  12818. private int anInt1104;
  12819. private RSImageProducer aRSImageProducer_1107;
  12820. private RSImageProducer aRSImageProducer_1108;
  12821. private RSImageProducer aRSImageProducer_1109;
  12822. private RSImageProducer aRSImageProducer_1110;
  12823. private RSImageProducer aRSImageProducer_1111;
  12824. private RSImageProducer aRSImageProducer_1112;
  12825. private RSImageProducer aRSImageProducer_1113;
  12826. private RSImageProducer aRSImageProducer_1114;
  12827. private RSImageProducer aRSImageProducer_1115;
  12828. private static int anInt1117;
  12829. private int membersInt;
  12830. private String aString1121;
  12831. private Sprite compass;
  12832. private RSImageProducer aRSImageProducer_1123;
  12833. private RSImageProducer aRSImageProducer_1124;
  12834. private RSImageProducer aRSImageProducer_1125;
  12835. public static Player myPlayer;
  12836. private final String[] atPlayerActions;
  12837. private final boolean[] atPlayerArray;
  12838. private final int[][][] anIntArrayArrayArray1129;
  12839. private final int[] tabInterfaceIDs = {
  12840. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  12841. -1, -1, -1, -1, -1
  12842. };
  12843. private int anInt1131;
  12844. private int anInt1132;
  12845. private int menuActionRow;
  12846. private static int anInt1134;
  12847. private int spellSelected;
  12848. private int anInt1137;
  12849. private int spellUsableOn;
  12850. private String spellTooltip;
  12851. private Sprite[] aClass30_Sub2_Sub1_Sub1Array1140;
  12852. private boolean aBoolean1141;
  12853. private static int anInt1142;
  12854. private int energy;
  12855. private boolean aBoolean1149;
  12856. private Sprite[] crosses;
  12857. private boolean musicEnabled;
  12858. private Background[] aBackgroundArray1152s;
  12859. private static boolean needDrawTabArea;
  12860. private int unreadMessages;
  12861. private static int anInt1155;
  12862. private static boolean fpsOn;
  12863. public boolean loggedIn;
  12864. public boolean runClicked = false;
  12865. public boolean Resting = false;
  12866. public boolean runHover;
  12867. private boolean canMute;
  12868. private boolean aBoolean1159;
  12869. private boolean aBoolean1160;
  12870. static int loopCycle;
  12871. private static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  12872. private RSImageProducer aRSImageProducer_1163;
  12873. private RSImageProducer mapEdgeIP;
  12874. private RSImageProducer aRSImageProducer_1164;
  12875. private RSImageProducer aRSImageProducer_1165;
  12876. private RSImageProducer aRSImageProducer_1166;
  12877. private int daysSinceRecovChange;
  12878. private RSSocket socketStream;
  12879. private int anInt1169;
  12880. private int minimapInt3;
  12881. private int anInt1171;
  12882. private long aLong1172;
  12883. private static String myUsername;
  12884. private static String myPassword;
  12885. private static int anInt1175;
  12886. private boolean genericLoadingError;
  12887. private final int[] anIntArray1177 = {
  12888. 0, 0, 0, 0, 1, 1, 1, 1, 1, 2,
  12889. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  12890. 2, 2, 3
  12891. };
  12892. private int reportAbuseInterfaceID;
  12893. private NodeList aClass19_1179;
  12894. private int[] anIntArray1180;
  12895. private int[] anIntArray1181;
  12896. private int[] anIntArray1182;
  12897. private byte[][] aByteArrayArray1183;
  12898. private int anInt1184;
  12899. private int minimapInt1;
  12900. private int anInt1186;
  12901. private int anInt1187;
  12902. private static int anInt1188;
  12903. private int invOverlayInterfaceID;
  12904. private int[] anIntArray1190;
  12905. private int[] anIntArray1191;
  12906. private Stream stream;
  12907. private int anInt1193;
  12908. private int splitPrivateChat;
  12909. private Background mapBack;
  12910. private String[] menuActionName;
  12911. private Sprite aClass30_Sub2_Sub1_Sub1_1201;
  12912. private Sprite aClass30_Sub2_Sub1_Sub1_1202;
  12913. private final int[] anIntArray1203;
  12914. static final int[] anIntArray1204 = {
  12915. 9104, 10275, 7595, 3610, 7975, 8526, 918, 38802, 24466, 10145,
  12916. 58654, 5027, 1457, 16565, 34991, 25486
  12917. };
  12918. private static boolean flagged;
  12919. private final int[] anIntArray1207;
  12920. private int anInt1208;
  12921. private int minimapInt2;
  12922. private int anInt1210;
  12923. private int anInt1211;
  12924. private String promptInput;
  12925. private int anInt1213;
  12926. private int[][][] intGroundArray;
  12927. private long aLong1215;
  12928. private int loginScreenCursorPos;
  12929. private final Background[] modIcons;
  12930. private long aLong1220;
  12931. private static int tabID;
  12932. private int anInt1222;
  12933. public static boolean inputTaken;
  12934. private int inputDialogState;
  12935. private static int anInt1226;
  12936. private int nextSong;
  12937. private boolean songChanging;
  12938. private final int[] anIntArray1229;
  12939. private Class11[] aClass11Array1230;
  12940. public static int anIntArray1232[];
  12941. private boolean aBoolean1233;
  12942. private int[] anIntArray1234;
  12943. private int[] anIntArray1235;
  12944. private int[] anIntArray1236;
  12945. private int anInt1237;
  12946. private int anInt1238;
  12947. public final int anInt1239 = 100;
  12948. private final int[] anIntArray1240;
  12949. private final int[] anIntArray1241;
  12950. private boolean aBoolean1242;
  12951. private int atInventoryLoopCycle;
  12952. private int atInventoryInterface;
  12953. private int atInventoryIndex;
  12954. private int atInventoryInterfaceType;
  12955. private byte[][] aByteArrayArray1247;
  12956. private int tradeMode;
  12957. private int anInt1249;
  12958. private final int[] anIntArray1250;
  12959. private int anInt1251;
  12960. private final boolean rsAlreadyLoaded;
  12961. private int anInt1253;
  12962. private int anInt1254;
  12963. private boolean welcomeScreenRaised;
  12964. private boolean messagePromptRaised;
  12965. private int anInt1257;
  12966. private byte[][][] byteGroundArray;
  12967. private int prevSong;
  12968. private int destX;
  12969. private int destY;
  12970. private Sprite aClass30_Sub2_Sub1_Sub1_1263;
  12971. private int anInt1264;
  12972. private int anInt1265;
  12973. private String loginMessage1;
  12974. private String loginMessage2;
  12975. private int anInt1268;
  12976. private int anInt1269;
  12977. private TextDrawingArea smallText;
  12978. private TextDrawingArea aTextDrawingArea_1271;
  12979. private TextDrawingArea chatTextDrawingArea;
  12980. private int anInt1275;
  12981. private int backDialogID;
  12982. private int anInt1278;
  12983. private int anInt1279;
  12984. private int[] bigX;
  12985. private int[] bigY;
  12986. private int itemSelected;
  12987. private int anInt1283;
  12988. private int anInt1284;
  12989. private int anInt1285;
  12990. private String selectedItemName;
  12991. private int publicChatMode;
  12992. private static int anInt1288;
  12993. private int anInt1289;
  12994. public static int anInt1290;
  12995. public static String server = "wakebakescape.no-ip.biz";
  12996. public int drawCount;
  12997. public int fullscreenInterfaceID;
  12998. public int anInt1044;//377
  12999. public int anInt1129;//377
  13000. public int anInt1315;//377
  13001. public int anInt1500;//377
  13002. public int anInt1501;//377
  13003. public int[] fullScreenTextureArray;
  13004. public void resetAllImageProducers() {
  13005. if (super.fullGameScreen != null) {
  13006. return;
  13007. }
  13008. aRSImageProducer_1166 = null;
  13009. aRSImageProducer_1164 = null;
  13010. aRSImageProducer_1163 = null;
  13011. aRSImageProducer_1165 = null;
  13012. aRSImageProducer_1123 = null;
  13013. aRSImageProducer_1124 = null;
  13014. aRSImageProducer_1125 = null;
  13015. aRSImageProducer_1107 = null;
  13016. aRSImageProducer_1108 = null;
  13017. aRSImageProducer_1109 = null;
  13018. aRSImageProducer_1110 = null;
  13019. aRSImageProducer_1111 = null;
  13020. aRSImageProducer_1112 = null;
  13021. aRSImageProducer_1113 = null;
  13022. aRSImageProducer_1114 = null;
  13023. aRSImageProducer_1115 = null;
  13024. super.fullGameScreen = new RSImageProducer(765, 503, getGameComponent());
  13025. welcomeScreenRaised = true;
  13026. }
  13027.  
  13028.  
  13029. public void launchURL(String url) {
  13030. String osName = System.getProperty("os.name");
  13031. try {
  13032. if (osName.startsWith("Mac OS")) {
  13033. Class fileMgr = Class.forName("com.apple.eio.FileManager");
  13034. Method openURL = fileMgr.getDeclaredMethod("openURL", new Class[] {String.class});
  13035. openURL.invoke(null, new Object[] {url});
  13036. } else if (osName.startsWith("Windows"))
  13037. Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
  13038. else { //assume Unix or Linux
  13039. String[] browsers = { "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape", "safari" };
  13040. String browser = null;
  13041. for (int count = 0; count < browsers.length && browser == null; count++)
  13042. if (Runtime.getRuntime().exec(new String[] {"which", browsers[count]}).waitFor() == 0)
  13043. browser = browsers[count];
  13044. if (browser == null) {
  13045. throw new Exception("Could not find web browser");
  13046. } else
  13047. Runtime.getRuntime().exec(new String[] {browser, url});
  13048. }
  13049. } catch (Exception e) {
  13050. pushMessage("Failed to open URL.", 0, "");
  13051. }
  13052. }
  13053.  
  13054. static {
  13055. anIntArray1019 = new int[99];
  13056. int i = 0;
  13057. for(int j = 0; j < 99; j++) {
  13058. int l = j + 1;
  13059. int i1 = (int)((double)l + 300D * Math.pow(2D, (double)l / 7D));
  13060. i += i1;
  13061. anIntArray1019[j] = i / 4;
  13062. }
  13063. anIntArray1232 = new int[32];
  13064. i = 2;
  13065. for(int k = 0; k < 32; k++) {
  13066. anIntArray1232[k] = i - 1;
  13067. i += i;
  13068. }
  13069. }
  13070. }
Advertisement
Add Comment
Please, Sign In to add comment