Advertisement
Guest User

Untitled

a guest
Dec 4th, 2016
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 406.56 KB | None | 0 0
  1. // Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
  2. // Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
  3. // Jad home page: http://www.kpdus.com/jad.html
  4. // Decompiler options: packimports(3)
  5.  
  6. import java.applet.AppletContext;
  7. import java.awt.*;
  8. import java.io.*;
  9. import java.math.BigInteger;
  10. import java.net.*;
  11. import java.util.zip.CRC32;
  12. import java.lang.reflect.Method;
  13. import sign.signlink;
  14. import javax.swing.*;
  15. import javax.sound.midi.*;
  16. import java.io.InputStream;
  17. import java.io.IOException;
  18. import java.io.FileInputStream;
  19. import java.io.FileNotFoundException;
  20.  
  21. import java.io.BufferedInputStream;
  22. import java.io.BufferedOutputStream;
  23. import java.io.BufferedReader;
  24. import java.io.BufferedWriter;
  25. import java.io.ByteArrayInputStream;
  26. import java.io.DataInputStream;
  27. import java.io.DataOutputStream;
  28. import java.io.EOFException;
  29. import java.io.File;
  30. import java.io.FileOutputStream;
  31. import java.io.FileReader;
  32. import java.io.FileWriter;
  33. import java.io.InputStreamReader;
  34. import java.io.OutputStream;
  35.  
  36. public class client extends RSApplet {
  37.  
  38. public int positions[] = new int[2000];
  39. public int landScapes[] = new int[2000];
  40. public int objects[] = new int[2000];
  41. private String consoleInput;
  42. public static boolean consoleOpen;
  43. private final String[] consoleMessages;
  44. private boolean hunterTitleButtons = false;
  45. private boolean clientDevelopment = false;
  46. public static boolean is459 = false;
  47. public static boolean debugServerIP = false;
  48. public static boolean showClicking = false;
  49. public static boolean newRendering = false;
  50.  
  51. public int followPlayer;
  52. public int followNPC;
  53. public int followDistance;
  54.  
  55. public static int totalSettings = 16;
  56.  
  57. public void readSettings() {
  58. File file = new File(signlink.findcachedir() + "settings.dat");
  59. if (!file.exists()) {
  60. return;
  61. }
  62. try {
  63. DataInputStream in = new DataInputStream(new FileInputStream(signlink.findcachedir() + "settings.dat"));
  64. int totalSettings = in.readShort();
  65. readSettingsValues(in);
  66. in.close();
  67. } catch (IOException e) {
  68. e.printStackTrace();
  69. }
  70. }
  71.  
  72. public static String getExamine(int id) {
  73.  
  74. String examine = "";
  75. try {
  76. String name = ItemDef.forID(id).name;
  77. URL url = new URL("http://runescape.wikia.com/wiki/" + name.replaceAll(" ", "_"));
  78. URLConnection con = url.openConnection();
  79. BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
  80. String line;
  81. int next = 0;
  82. while ((line = in.readLine()) != null) {
  83. if (line.contains("<th nowrap=\"nowrap\"><a href=\"/wiki/Examine\" title=\"Examine\">Examine</a>")) {
  84. next++;
  85. }
  86. if (line.contains("</th><td> ") && next == 1) {
  87. examine = line.replace("</th><td> ", "");
  88. return examine;
  89. }
  90. }
  91. in.close();
  92. return examine;
  93. } catch (IOException e) {
  94. e.printStackTrace();
  95. }
  96. return examine;
  97. }
  98.  
  99. public void readSettingsValues(DataInputStream in) {
  100. try {
  101. do {
  102. int opCode = in.readByte();
  103. if (opCode == 1) {
  104. signlink.musicOn = true;
  105. }
  106. if (opCode == 2) {
  107. signlink.musicOn = false;
  108. }
  109. if (opCode == 15) {
  110. //midiVolume = in.readShort();
  111. }
  112. } while (true);
  113. } catch (IOException e) {
  114. }
  115. }
  116.  
  117. public String indexLocation(int cacheIndex, int index) {
  118. return signlink.findcachedir() + "index" + cacheIndex + "/" + (index != -1 ? index + ".gz" : "");
  119. }
  120.  
  121. public void repackCacheIndex(int cacheIndex) {
  122. System.out.println("Started repacking index " + cacheIndex + ".");
  123. int indexLength = new File(indexLocation(cacheIndex, -1)).listFiles().length;
  124. File[] file = new File(indexLocation(cacheIndex, -1)).listFiles();
  125. try {
  126. for (int index = 0; index < indexLength; index++) {
  127. int fileIndex = Integer.parseInt(getFileNameWithoutExtension(file[index].toString()));
  128. byte[] data = fileToByteArray(cacheIndex, fileIndex);
  129. if(data != null && data.length > 0) {
  130. decompressors[cacheIndex].method234(data.length, data, fileIndex);
  131. System.out.println("Repacked " + fileIndex + ".");
  132. } else {
  133. System.out.println("Unable to locate index " + fileIndex + ".");
  134. }
  135. }
  136. } catch(Exception e) {
  137. System.out.println("Error packing cache index " + cacheIndex + ".");
  138. }
  139. System.out.println("Finished repacking " + cacheIndex + ".");
  140. }
  141.  
  142. public byte[] fileToByteArray(int cacheIndex, int index) {
  143. try {
  144. if (indexLocation(cacheIndex, index).length() <= 0 || indexLocation(cacheIndex, index) == null) {
  145. return null;
  146. }
  147. File file = new File(indexLocation(cacheIndex, index));
  148. byte[] fileData = new byte[(int)file.length()];
  149. FileInputStream fis = new FileInputStream(file);
  150. fis.read(fileData);
  151. fis.close();
  152. return fileData;
  153. } catch(Exception e) {
  154. return null;
  155. }
  156. }
  157.  
  158. public void writeSettings() {
  159. try {
  160. DataOutputStream out = new DataOutputStream(new FileOutputStream(signlink.findcachedir() + "settings.dat"));
  161. out.writeShort(totalSettings);
  162. if (signlink.musicOn) {
  163. out.writeByte(1);
  164. }
  165. if (!signlink.musicOn) {
  166. out.writeByte(2);
  167. }
  168. /*if (midiVolume != -1) {
  169. out.writeByte(15);
  170. out.writeShort(midiVolume);
  171. }*/
  172. out.close();
  173. } catch (IOException e) {
  174. e.printStackTrace();
  175. }
  176. }
  177.  
  178.  
  179. public void setNewMaps() {
  180. try {
  181. BufferedReader in = new BufferedReader(new FileReader(signlink.findcachedir()+"Maps/mapConfig.txt"));
  182. String s;
  183. int D = 0;
  184. while ((s = in.readLine()) != null) {
  185. positions[D] = Integer.parseInt(s.substring(s.indexOf("=")+1,s.indexOf("(")));
  186. landScapes[D] = Integer.parseInt(s.substring(s.indexOf("(")+1,s.indexOf(")")));
  187. objects[D] = Integer.parseInt(s.substring(s.indexOf("[")+1,s.indexOf("]")));
  188. D++;
  189. }
  190. } catch (IOException e) {
  191. e.printStackTrace();
  192. }
  193. }
  194.  
  195. public void setSidebarInterface(int sidebarID, int interfaceID) {
  196. tabInterfaceIDs[sidebarID] = interfaceID;
  197. tabID = sidebarID;
  198. needDrawTabArea = true;
  199. tabAreaAltered = true;
  200. }
  201.  
  202. int messager = 1;
  203.  
  204. public void drawConsoleMessage(int Message)
  205. {
  206. if (Message == 1)
  207. {
  208. printConsoleMessage("This is the developer console. To close, press the ` key on your keyboard.", 1);
  209. return;
  210. }
  211.  
  212. }
  213.  
  214. private void drawConsole()
  215. {
  216. TextDrawingArea textDrawingArea = regularText;
  217. if(consoleOpen)
  218. {
  219. drawConsoleMessage(messager);
  220. messager++;
  221. DrawingArea.transparentBox(334, 0, 0, 5320850, 512, 0, 97);
  222. DrawingArea.drawPixels(1, 315, 0, 16777215, 512);
  223. //newBoldFont.drawBasicString("-->", 11, 328, 16777215, 0);
  224. textDrawingArea.method385(16777215,"-->", 328, 11);
  225. if(loopCycle % 20 < 10)
  226. {
  227. //newBoldFont.drawBasicString(consoleInput+"|", 38, 328, 16777215, 0);
  228. textDrawingArea.method385(16777215,consoleInput+"|", 328, 38);
  229. return;
  230. } else
  231. {
  232. //newBoldFont.drawBasicString(consoleInput, 38, 328, 16777215, 0);
  233. textDrawingArea.method385(16777215,consoleInput, 328, 38);
  234. return;
  235. }
  236. }
  237. }
  238.  
  239. private void drawConsoleArea() {
  240. TextDrawingArea textDrawingArea = regularText;
  241. if(consoleOpen) {
  242. for(int i = 0, j = 308; i < 17;i++, j -= 18) {
  243. if(consoleMessages[i] != null)
  244. //newRegularFont.drawBasicString(consoleMessages[i], 9, j, 16777215, 0);
  245. textDrawingArea.method385(16777215,consoleMessages[i], j, 9);
  246. }
  247. }
  248. }
  249.  
  250. public void printConsoleMessage(String s, int i) {
  251. if(backDialogID == -1)
  252. inputTaken = true;
  253. for(int j = 16; j > 0; j--) {
  254. consoleMessages[j] = consoleMessages[j - 1];
  255. }
  256. if(i == 0)
  257. consoleMessages[0] = "--> "+s;
  258. else
  259. consoleMessages[0] = s;
  260. }
  261. private void sendCommandPacket(String cmd) {
  262. if(cmd.equalsIgnoreCase("cls")){
  263. for(int j = 0; j < 17; j++)
  264. consoleMessages[j] = null;
  265. }
  266. /**Add Commands Here**/
  267. stream.createFrame(103);
  268. stream.writeWordBigEndian(cmd.length()+1);
  269. stream.writeString(cmd);
  270. }
  271.  
  272.  
  273. public static String capitalize(String s) {
  274.  
  275. for (int i = 0; i < s.length(); i++) {
  276. if (i == 0) {
  277. s = String.format( "%s%s",
  278. Character.toUpperCase(s.charAt(0)),
  279. s.substring(1) );
  280. }
  281. if (!Character.isLetterOrDigit(s.charAt(i))) {
  282. if (i + 1 < s.length()) {
  283. s = String.format( "%s%s%s",
  284. s.subSequence(0, i+1),
  285. Character.toUpperCase(s.charAt(i + 1)),
  286. s.substring(i+2) );
  287. }
  288. }
  289. }
  290. return s;
  291. }
  292.  
  293. public int MapX, MapY;
  294. private static String intToKOrMilLongName(int i) {
  295. String s = String.valueOf(i);
  296. for (int k = s.length() - 3; k > 0; k -= 3)
  297. s = s.substring(0, k) + "," + s.substring(k);
  298. if (s.length() > 8)
  299. s = "@gre@" + s.substring(0, s.length() - 8) + " million @whi@("
  300. + s + ")";
  301. else if (s.length() > 4)
  302. s = "@cya@" + s.substring(0, s.length() - 4) + "K @whi@(" + s + ")";
  303. return " " + s;
  304. }
  305.  
  306. public final String methodR(int j) {
  307. if (j >= 0 && j < 10000)
  308. return String.valueOf(j);
  309. if (j >= 10000 && j < 10000000)
  310. return j / 1000 + "K";
  311. if (j >= 10000000 && j < 999999999)
  312. return j / 1000000 + "M";
  313. if (j >= 999999999)
  314. return "*";
  315. else
  316. return "?";
  317. }
  318.  
  319. public void playSong(int id) {
  320. if (currentSong != id) {
  321. nextSong = id;
  322. songChanging = true;
  323. onDemandFetcher.method558(2, nextSong);
  324. currentSong = id;
  325. }
  326. }
  327.  
  328. public void stopMidi() {
  329. if (signlink.music != null) {
  330. signlink.music.stop();
  331. }
  332. signlink.fadeMidi = 0;
  333. signlink.midi = "stop";
  334. }
  335.  
  336. private boolean menuHasAddFriend(int j) {
  337. if(j < 0)
  338. return false;
  339. int k = menuActionID[j];
  340. if(k >= 2000)
  341. k -= 2000;
  342. return k == 337;
  343. }
  344.  
  345. public void drawChannelButtons() {
  346. String text[] = { "On", "Friends", "Off", "Hide" };
  347. int textColor[] = { 65280, 0xffff00, 0xff0000, 65535 };
  348. int buttonXPos[] = { 5, 62, 119, 176, 233, 290, 347, 404 };
  349. int cPosId[] = { 2, 2, 2, 2, 2, 2, 2, 3 };
  350. int hPosId[] = { 0, 0, 0, 0, 0, 0, 0, 3 };
  351. chatButtons[1].drawSprite(buttonXPos[cButtonCPos], 143);
  352. if(cButtonHPos == cButtonCPos) {
  353. if(cButtonHPos >= 0 && cButtonHPos <= 7)
  354. chatButtons[cPosId[cButtonHPos]].drawSprite(buttonXPos[cButtonHPos], 143);
  355. } else {
  356. if(cButtonHPos >= 0 && cButtonHPos <= 7)
  357. chatButtons[hPosId[cButtonHPos]].drawSprite(buttonXPos[cButtonHPos], 143);
  358. }
  359. smallText.method389(true, 427, 0xffffff, "Report Abuse", 159);
  360. smallText.method389(true, 26, 0xffffff, "All", 159);
  361. smallText.method389(true, 77, 0xffffff, "Game", 159);
  362. smallText.method389(true, 131, 0xffffff, "Public", 154);
  363. smallText.method389(true, 185, 0xffffff, "Private", 154);
  364. smallText.method389(true, 248, 0xffffff, "Clan", 154);
  365. smallText.method389(true, 304, 0xffffff, "Trade", 154);
  366. smallText.method389(true, 363, 0xffffff, "Duel", 154);
  367. smallText.method382(textColor[publicChatMode], 146, text[publicChatMode], 165, true);
  368. smallText.method382(textColor[privateChatMode], 203, text[privateChatMode], 165, true);
  369. smallText.method382(textColor[clanChatMode], 260, text[clanChatMode], 165, true);
  370. smallText.method382(textColor[tradeMode], 317, text[tradeMode], 165, true);
  371. smallText.method382(textColor[duelMode], 374, text[duelMode], 165, true);
  372. }
  373.  
  374. public void drawChatArea() {
  375. aRSImageProducer_1166.initDrawingArea();
  376. Texture.anIntArray1472 = anIntArray1180;
  377. chatArea.drawSprite(0, 0);
  378. drawChannelButtons();
  379. TextDrawingArea textDrawingArea = regularText;
  380. if(messagePromptRaised) {
  381. boldText.drawText(0, aString1121, 60, 259);
  382. boldText.drawText(128, promptInput + "*", 80, 259);
  383. } else if(inputDialogState == 1) {
  384. boldText.drawText(0, "Enter amount:", 60, 259);
  385. boldText.drawText(128, amountOrNameInput + "*", 80, 259);
  386. } else if(inputDialogState == 2) {
  387. boldText.drawText(0, "Enter name:", 60, 259);
  388. boldText.drawText(128, amountOrNameInput + "*", 80, 259);
  389. } else if(aString844 != null) {
  390. boldText.drawText(0, aString844, 60, 259);
  391. boldText.drawText(128, "Click to continue", 80, 259);
  392. } else if(backDialogID != -1) {
  393. drawInterface(0, 20, RSInterface.interfaceCache[backDialogID], 20);
  394. } else if(dialogID != -1) {
  395. drawInterface(0, 20, RSInterface.interfaceCache[dialogID], 20);
  396. } else {
  397. int j77 = -3;
  398. int j = 0;
  399. DrawingArea.setDrawingArea(122, 8, 497, 7);
  400. for(int k = 0; k < 500; k++)
  401. if(chatMessages[k] != null) {
  402. int chatType = chatTypes[k];
  403. int yPos = (70 - j77 * 14) + anInt1089 + 5;
  404. String s1 = chatNames[k];
  405. byte byte0 = 0;
  406. if(s1 != null && s1.startsWith("@cr1@")) {
  407. s1 = s1.substring(5);
  408. byte0 = 1;
  409. } else if(s1 != null && s1.startsWith("@cr2@")) {
  410. s1 = s1.substring(5);
  411. byte0 = 2;
  412. } else if(s1 != null && s1.startsWith("@cr3@")) {
  413. s1 = s1.substring(5);
  414. byte0 = 3;
  415. }
  416. if(chatType == 0) {
  417. if (chatTypeView == 5 || chatTypeView == 0) {
  418. if(yPos > 0 && yPos < 210)
  419. textDrawingArea.method389(false, 11, 0, chatMessages[k], yPos);//chat color enabled
  420. j++;
  421. j77++;
  422. }
  423. }
  424. if((chatType == 1 || chatType == 2) && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
  425. if (chatTypeView == 1 || chatTypeView == 0) {
  426. if(yPos > 0 && yPos < 210) {
  427. int xPos = 11;
  428. if(byte0 == 1) {
  429. modIcons[0].drawBackground(xPos + 1, yPos - 12);
  430. xPos += 14;
  431. } else if(byte0 == 2) {
  432. modIcons[1].drawBackground(xPos + 1, yPos - 12);
  433. xPos += 14;
  434. } else if(byte0 == 3) {
  435. modIcons[2].drawBackground(xPos + 1, yPos - 12);
  436. xPos += 14;
  437. }
  438. textDrawingArea.method385(0, s1 + ":", yPos, xPos);
  439. xPos += textDrawingArea.getTextWidth(s1) + 8;
  440. textDrawingArea.method389(false, xPos, 255, chatMessages[k], yPos);
  441. }
  442. j++;
  443. j77++;
  444. }
  445. }
  446. if((chatType == 3 || chatType == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1))) {
  447. if (chatTypeView == 2 || chatTypeView == 0) {
  448. if(yPos > 0 && yPos < 210) {
  449. int k1 = 11;
  450. textDrawingArea.method385(0, "From", yPos, k1);
  451. k1 += textDrawingArea.getTextWidth("From ");
  452. if(byte0 == 1) {
  453. modIcons[0].drawBackground(k1, yPos - 12);
  454. k1 += 12;
  455. } else if(byte0 == 2) {
  456. modIcons[1].drawBackground(k1, yPos - 12);
  457. k1 += 12;
  458. } else if(byte0 == 3) {
  459. modIcons[2].drawBackground(k1, yPos - 12);
  460. k1 += 12;
  461. }
  462. textDrawingArea.method385(0, s1 + ":", yPos, k1);
  463. k1 += textDrawingArea.getTextWidth(s1) + 8;
  464. textDrawingArea.method385(0x800000, chatMessages[k], yPos, k1);
  465. }
  466. j++;
  467. j77++;
  468. }
  469. }
  470. if(chatType == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  471. if (chatTypeView == 3 || chatTypeView == 0) {
  472. if(yPos > 0 && yPos < 210)
  473. textDrawingArea.method385(0x800080, s1 + " " + chatMessages[k], yPos, 11);
  474. j++;
  475. j77++;
  476. }
  477. }
  478. if(chatType == 5 && splitPrivateChat == 0 && privateChatMode < 2) {
  479. if (chatTypeView == 2 || chatTypeView == 0) {
  480. if(yPos > 0 && yPos < 210)
  481. textDrawingArea.method385(0x800000, chatMessages[k], yPos, 11);
  482. j++;
  483. j77++;
  484. }
  485. }
  486. if(chatType == 6 && (splitPrivateChat == 0 || chatTypeView == 2) && privateChatMode < 2) {
  487. if (chatTypeView == 2 || chatTypeView == 0) {
  488. if(yPos > 0 && yPos < 210) {
  489. textDrawingArea.method385(0, "To " + s1 + ":", yPos, 11);
  490. textDrawingArea.method385(0x800000, chatMessages[k], yPos, 15 + textDrawingArea.getTextWidth("To :" + s1));
  491. }
  492. j++;
  493. j77++;
  494. }
  495. }
  496. if(chatType == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  497. if (chatTypeView == 3 || chatTypeView == 0) {
  498. if(yPos > 0 && yPos < 210)
  499. textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], yPos, 11);
  500. j++;
  501. j77++;
  502. }
  503. if(chatType == 11 && (clanChatMode == 0)) {
  504. if (chatTypeView == 11) {
  505. if(yPos > 0 && yPos < 210)
  506. textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], yPos, 11);
  507. j++;
  508. j77++;
  509. }
  510. if(chatType == 12) {
  511. if(yPos > 0 && yPos < 110)
  512. textDrawingArea.method385(0x7e3200, chatMessages[k] + " @blu@" + s1, yPos, 11);
  513. j++;
  514. }
  515. }
  516. }
  517. if(chatType == 16) {
  518. int j2 = 40;
  519. int clanNameWidth = textDrawingArea.getTextWidth(clanname);
  520. if(chatTypeView == 11 || chatTypeView == 0) {
  521. if(yPos > 3 && yPos < 130)
  522. switch(chatRights[k]) {
  523. case 1:
  524. j2 += clanNameWidth;
  525. modIcons[0].drawBackground(j2 - 18, yPos - 12);
  526. j2 += 14;
  527. break;
  528.  
  529. case 2:
  530. j2 += clanNameWidth;
  531. modIcons[1].drawBackground(j2 - 18, yPos - 12);
  532. j2 += 14;
  533. break;
  534.  
  535. case 3:
  536. j2 += clanNameWidth;
  537. modIcons[1].drawBackground(j2 - 18, yPos - 12);
  538. j2 += 14;
  539. break;
  540.  
  541. case 4:
  542. j2 += clanNameWidth;
  543. modIcons[2].drawBackground(j2 - 18, yPos - 12);
  544. j2 += 14;
  545. break;
  546.  
  547. default:
  548. j2 += clanNameWidth;
  549. break;
  550. }
  551. textDrawingArea.method385(0, "[", yPos, 8);
  552. textDrawingArea.method385(255, ""+clanname+"", yPos, 14);
  553. textDrawingArea.method385(0, "]", yPos, clanNameWidth + 14);
  554.  
  555. textDrawingArea.method385(0, capitalize(chatNames[k]) + ":", yPos, j2 - 17); //j2
  556. j2 += textDrawingArea.getTextWidth(chatNames[k]) + 7;
  557. textDrawingArea.method385(0x800000, chatMessages[k], yPos, j2 - 16);//j2
  558. j++;
  559. j77++;
  560. }
  561. }
  562. }
  563. DrawingArea.defaultDrawingAreaSize();
  564. anInt1211 = j * 14 + 7 + 5;
  565. if(anInt1211 < 111)
  566. anInt1211 = 111;
  567. drawScrollbar(114, anInt1211 - anInt1089 - 113, 7, 496, anInt1211);
  568. String s;
  569. if(myPlayer != null && myPlayer.name != null)
  570. s = myPlayer.name;
  571. else
  572. s = TextClass.fixName(capitalize(myUsername));
  573. textDrawingArea.method385(0, s + ":", 133, 11);
  574. textDrawingArea.drawChatInput(255, 12 + textDrawingArea.getTextWidth(s + ": "), inputString + "*", 133, false);
  575. DrawingArea.method339(121, 0x807660, 506, 7);
  576. }
  577. if(menuOpen && menuScreenArea == 2) {
  578. drawMenu();
  579. }
  580. aRSImageProducer_1166.drawGraphics(338, super.graphics, 0);
  581. aRSImageProducer_1165.initDrawingArea();
  582. Texture.anIntArray1472 = anIntArray1182;
  583. }
  584.  
  585. public void init() {
  586. try {
  587. nodeID = 10;
  588. portOff = 0;
  589. setHighMem();
  590. isMembers = true;
  591. signlink.storeid = 32;
  592. signlink.startpriv(InetAddress.getLocalHost());
  593. initClientFrame(503, 765);
  594. instance = this;
  595. } catch (Exception exception) {
  596. return;
  597. }
  598. }
  599.  
  600. public void startRunnable(Runnable runnable, int i) {
  601. if(i > 10)
  602. i = 10;
  603. if(signlink.mainapp != null) {
  604. signlink.startthread(runnable, i);
  605. } else {
  606. super.startRunnable(runnable, i);
  607. }
  608. }
  609.  
  610. public Socket openSocket(int port) throws IOException {
  611. return new Socket(InetAddress.getByName(server), port);
  612. }
  613.  
  614. public void processMenuClick() {
  615. if(activeInterfaceType != 0)
  616. return;
  617. int j = super.clickMode3;
  618. if(spellSelected == 1 && super.saveClickX >= 516 && super.saveClickY >= 160 && super.saveClickX <= 765 && super.saveClickY <= 205)
  619. j = 0;
  620. if(menuOpen) {
  621. if(j != 1) {
  622. int k = super.mouseX;
  623. int j1 = super.mouseY;
  624. if(menuScreenArea == 0) {
  625. k -= 4;
  626. j1 -= 4;
  627. }
  628. if(menuScreenArea == 1) {
  629. k -= 519;
  630. j1 -= 168;
  631. }
  632. if(menuScreenArea == 2) {
  633. k -= 17;
  634. j1 -= 338;
  635. }
  636. if(menuScreenArea == 3) {
  637. k -= 519;
  638. j1 -= 0;
  639. }
  640. if(k < menuOffsetX - 10 || k > menuOffsetX + menuWidth + 10 || j1 < menuOffsetY - 10 || j1 > menuOffsetY + menuHeight + 10) {
  641. menuOpen = false;
  642. if(menuScreenArea == 1)
  643. needDrawTabArea = true;
  644. if(menuScreenArea == 2)
  645. inputTaken = true;
  646. }
  647. }
  648. if(j == 1) {
  649. int l = menuOffsetX;
  650. int k1 = menuOffsetY;
  651. int i2 = menuWidth;
  652. int k2 = super.saveClickX;
  653. int l2 = super.saveClickY;
  654. if(menuScreenArea == 0) {
  655. k2 -= 4;
  656. l2 -= 4;
  657. }
  658. if(menuScreenArea == 1) {
  659. k2 -= 519;
  660. l2 -= 168;
  661. }
  662. if(menuScreenArea == 2) {
  663. k2 -= 17;
  664. l2 -= 338;
  665. }
  666. if(menuScreenArea == 3) {
  667. k2 -= 519;
  668. l2 -= 0;
  669. }
  670. int i3 = -1;
  671. for(int j3 = 0; j3 < menuActionRow; j3++) {
  672. int k3 = k1 + 31 + (menuActionRow - 1 - j3) * 15;
  673. if(k2 > l && k2 < l + i2 && l2 > k3 - 13 && l2 < k3 + 3)
  674. i3 = j3;
  675. }
  676. if(i3 != -1)
  677. doAction(i3);
  678. menuOpen = false;
  679. if(menuScreenArea == 1)
  680. needDrawTabArea = true;
  681. if(menuScreenArea == 2) {
  682. inputTaken = true;
  683. }
  684. }
  685. } else {
  686. if(j == 1 && menuActionRow > 0) {
  687. int i1 = menuActionID[menuActionRow - 1];
  688. 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) {
  689. int l1 = menuActionCmd2[menuActionRow - 1];
  690. int j2 = menuActionCmd3[menuActionRow - 1];
  691. RSInterface class9 = RSInterface.interfaceCache[j2];
  692. if(class9.aBoolean259 || class9.aBoolean235) {
  693. aBoolean1242 = false;
  694. anInt989 = 0;
  695. anInt1084 = j2;
  696. anInt1085 = l1;
  697. activeInterfaceType = 2;
  698. anInt1087 = super.saveClickX;
  699. anInt1088 = super.saveClickY;
  700. if(RSInterface.interfaceCache[j2].parentID == openInterfaceID)
  701. activeInterfaceType = 1;
  702. if(RSInterface.interfaceCache[j2].parentID == backDialogID)
  703. activeInterfaceType = 3;
  704. return;
  705. }
  706. }
  707. }
  708. if(j == 1 && (anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  709. j = 2;
  710. if(j == 1 && menuActionRow > 0)
  711. doAction(menuActionRow - 1);
  712. if(j == 2 && menuActionRow > 0)
  713. determineMenuSize();
  714. }
  715. }
  716.  
  717. public byte[] getModel(int index) {
  718. try {
  719. File model = new File(signlink.findcachedir() + "/Models/" + index + ".gz");
  720. byte[] aByte = new byte[(int)model.length()];
  721. FileInputStream Fis = new FileInputStream(model);
  722. Fis.read(aByte);
  723. pushMessage("aByte = [" + aByte + "]!", 0, "");
  724. Fis.close();
  725. return aByte;
  726. } catch(Exception e) {
  727. return null;
  728. }
  729. }
  730.  
  731. public static int totalRead = 0;
  732.  
  733. public static String getFileNameWithoutExtension(String fileName) {
  734. File tmpFile = new File(fileName);
  735. tmpFile.getName();
  736. int whereDot = tmpFile.getName().lastIndexOf('.');
  737. if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2) {
  738. return tmpFile.getName().substring(0, whereDot);
  739. }
  740. return "";
  741. }
  742.  
  743. public void preloadModels() {
  744. File file = new File(signlink.findcachedir() + "/Raw/");
  745. File[] fileArray = file.listFiles();
  746. for(int y = 0; y < fileArray.length; y++) {
  747. String s = fileArray[y].getName();
  748. byte[] buffer = ReadFile(signlink.findcachedir() + "/Raw/" +s);
  749. Model.method460(buffer,Integer.parseInt(getFileNameWithoutExtension(s)));
  750. }
  751. }
  752.  
  753. public static final byte[] ReadFile(String s) {
  754. try {
  755. byte abyte0[];
  756. File file = new File(s);
  757. int i = (int)file.length();
  758. abyte0 = new byte[i];
  759. DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new FileInputStream(s)));
  760. datainputstream.readFully(abyte0, 0, i);
  761. datainputstream.close();
  762. totalRead++;
  763. return abyte0;
  764. } catch(Exception e) {
  765. System.out.println((new StringBuilder()).append("Read Error: ").append(s).toString());
  766. return null;
  767. }
  768. }
  769.  
  770. public void models() {
  771. for(int ModelIndex = 0; ModelIndex < 14927; ModelIndex++) {
  772. byte[] abyte0 = getModel(ModelIndex);
  773. if(abyte0 != null && abyte0.length > 0) {
  774. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  775. //pushMessage("Model added successfully!", 0, "");
  776. }
  777. }
  778. }
  779.  
  780. public void saveMidi(boolean flag, byte abyte0[])
  781. {
  782. signlink.midifade = flag ? 1 : 0;
  783. signlink.midisave(abyte0, abyte0.length);
  784. }
  785.  
  786. public static void writeFile(byte[] data, String fileName) throws IOException{
  787. OutputStream out = new FileOutputStream(fileName);
  788. out.write(data);
  789. out.close();
  790. }
  791.  
  792. public void method22() {
  793. try {
  794. anInt985 = -1;
  795. aClass19_1056.removeAll();
  796. aClass19_1013.removeAll();
  797. Texture.method366();
  798. unlinkMRUNodes();
  799. worldController.initToNull();
  800. System.gc();
  801. for (int i = 0; i < 4; i++)
  802. aClass11Array1230[i].method210();
  803.  
  804. for (int l = 0; l < 4; l++) {
  805. for (int k1 = 0; k1 < 104; k1++) {
  806. for (int j2 = 0; j2 < 104; j2++)
  807. byteGroundArray[l][k1][j2] = 0;
  808.  
  809. }
  810.  
  811. }
  812.  
  813. ObjectManager objectManager = new ObjectManager(byteGroundArray, intGroundArray);
  814. int k2 = aByteArrayArray1183.length;
  815. int k18 = 62;
  816. for(int A = 0; A < k2; A++)
  817. for(int B = 0; B < 2000; B++)
  818. if(anIntArray1234[A] == positions[B]){
  819. anIntArray1235[A] = landScapes[B];
  820. anIntArray1236[A] = objects[B];
  821. }
  822. stream.createFrame(0);
  823. if(!aBoolean1159) {
  824. for(int i3 = 0; i3 < k2; i3++) {
  825. int i4 = (anIntArray1234[i3] >> 8) * 64 - baseX;
  826. int k5 = (anIntArray1234[i3] & 0xff) * 64 - baseY;
  827. byte abyte0[] = aByteArrayArray1183[i3];
  828. if (FileOperations.FileExists(signlink.findcachedir()+"Maps/Maps/"+anIntArray1235[i3]+".dat"))
  829. abyte0 = FileOperations.ReadFile(signlink.findcachedir()+"Maps/Maps/"+anIntArray1235[i3]+".dat");
  830. if(abyte0 != null)
  831. objectManager.method180(abyte0, k5, i4, (anInt1069 - 6) * 8, (anInt1070 - 6) * 8, aClass11Array1230);
  832. }
  833. for(int j4 = 0; j4 < k2; j4++) {
  834. int l5 = (anIntArray1234[j4] >> 8) * k18 - baseX;
  835. int k7 = (anIntArray1234[j4] & 0xff) * k18 - baseY;
  836. byte abyte2[] = aByteArrayArray1183[j4];
  837. if(abyte2 == null && anInt1070 < 800)
  838. objectManager.method174(k7, 64, 64, l5);
  839. }
  840. anInt1097++;
  841. if(anInt1097 > 160) {
  842. anInt1097 = 0;
  843. stream.createFrame(238);
  844. stream.writeWordBigEndian(96);
  845. }
  846. stream.createFrame(0);
  847. for(int i6 = 0; i6 < k2; i6++) {
  848. byte abyte1[] = aByteArrayArray1247[i6];
  849. if (FileOperations.FileExists(signlink.findcachedir()+"Maps/Maps/"+anIntArray1236[i6]+".dat"))
  850. abyte1 = FileOperations.ReadFile(signlink.findcachedir()+"Maps/Maps/"+anIntArray1236[i6]+".dat");
  851. if(abyte1 != null) {
  852. int l8 = (anIntArray1234[i6] >> 8) * 64 - baseX;
  853. int k9 = (anIntArray1234[i6] & 0xff) * 64 - baseY;
  854. objectManager.method190(l8, aClass11Array1230, k9, worldController, abyte1);
  855. }
  856. }
  857. }
  858. if (aBoolean1159) {
  859. for (int j3 = 0; j3 < 4; j3++) {
  860. for (int k4 = 0; k4 < 13; k4++) {
  861. for (int j6 = 0; j6 < 13; j6++) {
  862. int l7 = anIntArrayArrayArray1129[j3][k4][j6];
  863. if (l7 != -1) {
  864. int i9 = l7 >> 24 & 3;
  865. int l9 = l7 >> 1 & 3;
  866. int j10 = l7 >> 14 & 0x3ff;
  867. int l10 = l7 >> 3 & 0x7ff;
  868. int j11 = (j10 / 8 << 8) + l10 / 8;
  869. for (int l11 = 0; l11 < anIntArray1234.length; l11++) {
  870. if (anIntArray1234[l11] != j11
  871. || aByteArrayArray1183[l11] == null)
  872. continue;
  873. objectManager.method179(i9, l9,
  874. aClass11Array1230, k4 * 8,
  875. (j10 & 7) * 8,
  876. aByteArrayArray1183[l11],
  877. (l10 & 7) * 8, j3, j6 * 8);
  878. break;
  879. }
  880.  
  881. }
  882. }
  883.  
  884. }
  885.  
  886. }
  887.  
  888. for (int l4 = 0; l4 < 13; l4++) {
  889. for (int k6 = 0; k6 < 13; k6++) {
  890. int i8 = anIntArrayArrayArray1129[0][l4][k6];
  891. if (i8 == -1)
  892. objectManager.method174(k6 * 8, 8, 8, l4 * 8);
  893. }
  894.  
  895. }
  896.  
  897. stream.createFrame(0);
  898. for (int l6 = 0; l6 < 4; l6++) {
  899. for (int j8 = 0; j8 < 13; j8++) {
  900. for (int j9 = 0; j9 < 13; j9++) {
  901. int i10 = anIntArrayArrayArray1129[l6][j8][j9];
  902. if (i10 != -1) {
  903. int k10 = i10 >> 24 & 3;
  904. int i11 = i10 >> 1 & 3;
  905. int k11 = i10 >> 14 & 0x3ff;
  906. int i12 = i10 >> 3 & 0x7ff;
  907. int j12 = (k11 / 8 << 8) + i12 / 8;
  908. for (int k12 = 0; k12 < anIntArray1234.length; k12++) {
  909. if (anIntArray1234[k12] != j12
  910. || aByteArrayArray1247[k12] == null)
  911. continue;
  912. objectManager.method183(aClass11Array1230,
  913. worldController, k10, j8 * 8,
  914. (i12 & 7) * 8, l6,
  915. aByteArrayArray1247[k12],
  916. (k11 & 7) * 8, i11, j9 * 8);
  917. break;
  918. }
  919.  
  920. }
  921. }
  922.  
  923. }
  924.  
  925. }
  926.  
  927. }
  928. stream.createFrame(0);
  929. objectManager.method171(aClass11Array1230, worldController);
  930. aRSImageProducer_1165.initDrawingArea();
  931. stream.createFrame(0);
  932. int k3 = ObjectManager.anInt145;
  933. if (k3 > plane)
  934. k3 = plane;
  935. if (k3 < plane - 1)
  936. k3 = plane - 1;
  937. if (lowMem)
  938. worldController.method275(ObjectManager.anInt145);
  939. else
  940. worldController.method275(0);
  941. for (int i5 = 0; i5 < 104; i5++) {
  942. for (int i7 = 0; i7 < 104; i7++)
  943. spawnGroundItem(i5, i7);
  944.  
  945. }
  946.  
  947. anInt1051++;
  948. if (anInt1051 > 98) {
  949. anInt1051 = 0;
  950. stream.createFrame(150);
  951. }
  952. method63();
  953. } catch (Exception exception) {
  954. }
  955. ObjectDef.mruNodes1.unlinkAll();
  956. if (super.gameFrame != null) {
  957. stream.createFrame(210);
  958. stream.writeDWord(0x3f008edd);
  959. }
  960. if (lowMem && signlink.cache_dat != null) {
  961. int j = onDemandFetcher.getVersionCount(0);
  962. for (int i1 = 0; i1 < j; i1++) {
  963. int l1 = onDemandFetcher.getModelIndex(i1);
  964. if ((l1 & 0x79) == 0)
  965. Model.method461(i1);
  966. }
  967.  
  968. }
  969. System.gc();
  970. Texture.method367();
  971. onDemandFetcher.method566();
  972. int k = (anInt1069 - 6) / 8 - 1;
  973. int j1 = (anInt1069 + 6) / 8 + 1;
  974. int i2 = (anInt1070 - 6) / 8 - 1;
  975. int l2 = (anInt1070 + 6) / 8 + 1;
  976. if (aBoolean1141) {
  977. k = 49;
  978. j1 = 50;
  979. i2 = 49;
  980. l2 = 50;
  981. }
  982. for (int l3 = k; l3 <= j1; l3++) {
  983. for (int j5 = i2; j5 <= l2; j5++)
  984. if (l3 == k || l3 == j1 || j5 == i2 || j5 == l2) {
  985. int j7 = onDemandFetcher.method562(0, j5, l3);
  986. if (j7 != -1)
  987. onDemandFetcher.method560(j7, 3);
  988. int k8 = onDemandFetcher.method562(1, j5, l3);
  989. if (k8 != -1)
  990. onDemandFetcher.method560(k8, 3);
  991. }
  992.  
  993. }
  994.  
  995. }
  996.  
  997. public void unlinkMRUNodes()
  998. {
  999. ObjectDef.mruNodes1.unlinkAll();
  1000. ObjectDef.mruNodes2.unlinkAll();
  1001. EntityDef.mruNodes.unlinkAll();
  1002. ItemDef.mruNodes2.unlinkAll();
  1003. ItemDef.mruNodes1.unlinkAll();
  1004. Player.mruNodes.unlinkAll();
  1005. SpotAnim.aMRUNodes_415.unlinkAll();
  1006. }
  1007.  
  1008. public void method24(int i)
  1009. {
  1010. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  1011. int j = ai.length;
  1012. for(int k = 0; k < j; k++)
  1013. ai[k] = 0;
  1014.  
  1015. for(int l = 1; l < 103; l++)
  1016. {
  1017. int i1 = 24628 + (103 - l) * 512 * 4;
  1018. for(int k1 = 1; k1 < 103; k1++)
  1019. {
  1020. if((byteGroundArray[i][k1][l] & 0x18) == 0)
  1021. worldController.method309(ai, i1, i, k1, l);
  1022. if(i < 3 && (byteGroundArray[i + 1][k1][l] & 8) != 0)
  1023. worldController.method309(ai, i1, i + 1, k1, l);
  1024. i1 += 4;
  1025. }
  1026.  
  1027. }
  1028.  
  1029. int j1 = ((238 + (int)(Math.random() * 20D)) - 10 << 16) + ((238 + (int)(Math.random() * 20D)) - 10 << 8) + ((238 + (int)(Math.random() * 20D)) - 10);
  1030. int l1 = (238 + (int)(Math.random() * 20D)) - 10 << 16;
  1031. aClass30_Sub2_Sub1_Sub1_1263.method343();
  1032. for(int i2 = 1; i2 < 103; i2++)
  1033. {
  1034. for(int j2 = 1; j2 < 103; j2++)
  1035. {
  1036. if((byteGroundArray[i][j2][i2] & 0x18) == 0)
  1037. method50(i2, j1, j2, l1, i);
  1038. if(i < 3 && (byteGroundArray[i + 1][j2][i2] & 8) != 0)
  1039. method50(i2, j1, j2, l1, i + 1);
  1040. }
  1041.  
  1042. }
  1043.  
  1044. aRSImageProducer_1165.initDrawingArea();
  1045. anInt1071 = 0;
  1046. for(int k2 = 0; k2 < 104; k2++)
  1047. {
  1048. for(int l2 = 0; l2 < 104; l2++)
  1049. {
  1050. int i3 = worldController.method303(plane, k2, l2);
  1051. if(i3 != 0)
  1052. {
  1053. i3 = i3 >> 14 & 0x7fff;
  1054. int j3 = ObjectDef.forID(i3).anInt746;
  1055. if(j3 >= 0)
  1056. {
  1057. int k3 = k2;
  1058. int l3 = l2;
  1059. if(j3 != 22 && j3 != 29 && j3 != 34 && j3 != 36 && j3 != 46 && j3 != 47 && j3 != 48)
  1060. {
  1061. byte byte0 = 104;
  1062. byte byte1 = 104;
  1063. int ai1[][] = aClass11Array1230[plane].anIntArrayArray294;
  1064. for(int i4 = 0; i4 < 10; i4++)
  1065. {
  1066. int j4 = (int)(Math.random() * 4D);
  1067. if(j4 == 0 && k3 > 0 && k3 > k2 - 3 && (ai1[k3 - 1][l3] & 0x1280108) == 0)
  1068. k3--;
  1069. if(j4 == 1 && k3 < byte0 - 1 && k3 < k2 + 3 && (ai1[k3 + 1][l3] & 0x1280180) == 0)
  1070. k3++;
  1071. if(j4 == 2 && l3 > 0 && l3 > l2 - 3 && (ai1[k3][l3 - 1] & 0x1280102) == 0)
  1072. l3--;
  1073. if(j4 == 3 && l3 < byte1 - 1 && l3 < l2 + 3 && (ai1[k3][l3 + 1] & 0x1280120) == 0)
  1074. l3++;
  1075. }
  1076.  
  1077. }
  1078. aClass30_Sub2_Sub1_Sub1Array1140[anInt1071] = mapFunctions[j3];
  1079. anIntArray1072[anInt1071] = k3;
  1080. anIntArray1073[anInt1071] = l3;
  1081. anInt1071++;
  1082. }
  1083. }
  1084. }
  1085.  
  1086. }
  1087.  
  1088. }
  1089.  
  1090. public void spawnGroundItem(int i, int j)
  1091. {
  1092. NodeList class19 = groundArray[plane][i][j];
  1093. if(class19 == null)
  1094. {
  1095. worldController.method295(plane, i, j);
  1096. return;
  1097. }
  1098. int k = 0xfa0a1f01;
  1099. Object obj = null;
  1100. for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  1101. {
  1102. ItemDef itemDef = ItemDef.forID(item.ID);
  1103. int l = itemDef.value;
  1104. if(itemDef.stackable)
  1105. l *= item.anInt1559 + 1;
  1106. // notifyItemSpawn(item, i + baseX, j + baseY);
  1107.  
  1108. if(l > k)
  1109. {
  1110. k = l;
  1111. obj = item;
  1112. }
  1113. }
  1114.  
  1115. class19.insertTail(((Node) (obj)));
  1116. Object obj1 = null;
  1117. Object obj2 = null;
  1118. for(Item class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetFirst(); class30_sub2_sub4_sub2_1 != null; class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetNext())
  1119. {
  1120. if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && obj1 == null)
  1121. obj1 = class30_sub2_sub4_sub2_1;
  1122. if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && class30_sub2_sub4_sub2_1.ID != ((Item) (obj1)).ID && obj2 == null)
  1123. obj2 = class30_sub2_sub4_sub2_1;
  1124. }
  1125.  
  1126. int i1 = i + (j << 7) + 0x60000000;
  1127. worldController.method281(i, i1, ((Animable) (obj1)), method42(plane, j * 128 + 64, i * 128 + 64), ((Animable) (obj2)), ((Animable) (obj)), plane, j);
  1128. }
  1129.  
  1130. public void method26(boolean flag)
  1131. {
  1132. for(int j = 0; j < npcCount; j++)
  1133. {
  1134. NPC npc = npcArray[npcIndices[j]];
  1135. int k = 0x20000000 + (npcIndices[j] << 14);
  1136. if(npc == null || !npc.isVisible() || npc.desc.aBoolean93 != flag)
  1137. continue;
  1138. int l = npc.x >> 7;
  1139. int i1 = npc.y >> 7;
  1140. if(l < 0 || l >= 104 || i1 < 0 || i1 >= 104)
  1141. continue;
  1142. if(npc.anInt1540 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  1143. {
  1144. if(anIntArrayArray929[l][i1] == anInt1265)
  1145. continue;
  1146. anIntArrayArray929[l][i1] = anInt1265;
  1147. }
  1148. if(!npc.desc.aBoolean84)
  1149. k += 0x80000000;
  1150. worldController.method285(plane, npc.anInt1552, method42(plane, npc.y, npc.x), k, npc.y, (npc.anInt1540 - 1) * 64 + 60, npc.x, npc, npc.aBoolean1541);
  1151. }
  1152. }
  1153.  
  1154. private boolean replayWave()
  1155. {
  1156. return signlink.wavereplay();
  1157. }
  1158.  
  1159. public void loadError()
  1160. {
  1161. String s = "ondemand";//was a constant parameter
  1162. System.out.println(s);
  1163. try
  1164. {
  1165. getAppletContext().showDocument(new URL(getCodeBase(), "loaderror_" + s + ".html"));
  1166. }
  1167. catch(Exception exception)
  1168. {
  1169. exception.printStackTrace();
  1170. }
  1171. do
  1172. try
  1173. {
  1174. Thread.sleep(1000L);
  1175. }
  1176. catch(Exception _ex) { }
  1177. while(true);
  1178. }
  1179.  
  1180. public void buildInterfaceMenu(int i, RSInterface class9, int k, int l, int i1, int j1)
  1181. {
  1182. if(class9.type != 0 || class9.children == null || class9.isMouseoverTriggered)
  1183. return;
  1184. if(k < i || i1 < l || k > i + class9.width || i1 > l + class9.height)
  1185. return;
  1186. int k1 = class9.children.length;
  1187. for(int l1 = 0; l1 < k1; l1++)
  1188. {
  1189. int i2 = class9.childX[l1] + i;
  1190. int j2 = (class9.childY[l1] + l) - j1;
  1191. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[l1]];
  1192. i2 += class9_1.anInt263;
  1193. j2 += class9_1.anInt265;
  1194. if((class9_1.mOverInterToTrigger >= 0 || class9_1.anInt216 != 0) && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1195. if(class9_1.mOverInterToTrigger >= 0)
  1196. anInt886 = class9_1.mOverInterToTrigger;
  1197. else
  1198. anInt886 = class9_1.id;
  1199. if((class9_1.type == 8 || class9_1.type == 9) && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1200. {
  1201. anInt1315 = class9_1.id;
  1202. }
  1203. if(class9_1.type == 0)
  1204. {
  1205. buildInterfaceMenu(i2, class9_1, k, j2, i1, class9_1.scrollPosition);
  1206. if(class9_1.scrollMax > class9_1.height)
  1207. method65(i2 + class9_1.width, class9_1.height, k, i1, class9_1, j2, true, class9_1.scrollMax);
  1208. } else
  1209. {
  1210. if(class9_1.atActionType == 1 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1211. {
  1212. boolean flag = false;
  1213. if(class9_1.contentType != 0)
  1214. flag = buildFriendsListMenu(class9_1);
  1215. if(!flag)
  1216. {
  1217. //System.out.println("1"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1218. if (showClicking)
  1219. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id; //Clicking Buttons
  1220. else menuActionName[menuActionRow] = class9_1.tooltip;
  1221. menuActionID[menuActionRow] = 315;
  1222. menuActionCmd3[menuActionRow] = class9_1.id;
  1223. menuActionRow++;
  1224. }
  1225. }
  1226. if(class9_1.atActionType == 2 && spellSelected == 0 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1227. {
  1228. String s = class9_1.selectedActionName;
  1229. if(s.indexOf(" ") != -1)
  1230. s = s.substring(0, s.indexOf(" "));
  1231. menuActionName[menuActionRow] = s + " @gre@" + class9_1.spellName;
  1232. menuActionID[menuActionRow] = 626;
  1233. menuActionCmd3[menuActionRow] = class9_1.id;
  1234. menuActionRow++;
  1235. }
  1236. if(class9_1.atActionType == 3 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1237. {
  1238. menuActionName[menuActionRow] = "Close";
  1239. menuActionID[menuActionRow] = 200;
  1240. menuActionCmd3[menuActionRow] = class9_1.id;
  1241. menuActionRow++;
  1242. }
  1243. if(class9_1.atActionType == 4 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1244. {
  1245. //System.out.println("2"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1246. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1247. menuActionID[menuActionRow] = 169;
  1248. menuActionCmd3[menuActionRow] = class9_1.id;
  1249. menuActionRow++;
  1250. }
  1251. if(class9_1.atActionType == 5 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1252. {
  1253. //System.out.println("3"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1254. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1255. menuActionID[menuActionRow] = 646;
  1256. menuActionCmd3[menuActionRow] = class9_1.id;
  1257. menuActionRow++;
  1258. }
  1259. if(class9_1.atActionType == 6 && !aBoolean1149 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1260. {
  1261. //System.out.println("4"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1262. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1263. menuActionID[menuActionRow] = 679;
  1264. menuActionCmd3[menuActionRow] = class9_1.id;
  1265. menuActionRow++;
  1266. }
  1267. if(class9_1.type == 2)
  1268. {
  1269. int k2 = 0;
  1270. for(int l2 = 0; l2 < class9_1.height; l2++)
  1271. {
  1272. for(int i3 = 0; i3 < class9_1.width; i3++)
  1273. {
  1274. int j3 = i2 + i3 * (32 + class9_1.invSpritePadX);
  1275. int k3 = j2 + l2 * (32 + class9_1.invSpritePadY);
  1276. if(k2 < 20)
  1277. {
  1278. j3 += class9_1.spritesX[k2];
  1279. k3 += class9_1.spritesY[k2];
  1280. }
  1281. if(k >= j3 && i1 >= k3 && k < j3 + 32 && i1 < k3 + 32)
  1282. {
  1283. mouseInvInterfaceIndex = k2;
  1284. lastActiveInvInterface = class9_1.id;
  1285. if(class9_1.inv[k2] > 0)
  1286. {
  1287. ItemDef itemDef = ItemDef.forID(class9_1.inv[k2] - 1);
  1288. if(itemSelected == 1 && class9_1.isInventoryInterface)
  1289. {
  1290. if(class9_1.id != anInt1284 || k2 != anInt1283)
  1291. {
  1292. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  1293. menuActionID[menuActionRow] = 870;
  1294. menuActionCmd1[menuActionRow] = itemDef.id;
  1295. menuActionCmd2[menuActionRow] = k2;
  1296. menuActionCmd3[menuActionRow] = class9_1.id;
  1297. menuActionRow++;
  1298. }
  1299. } else
  1300. if(spellSelected == 1 && class9_1.isInventoryInterface)
  1301. {
  1302. if((spellUsableOn & 0x10) == 16)
  1303. {
  1304. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  1305. menuActionID[menuActionRow] = 543;
  1306. menuActionCmd1[menuActionRow] = itemDef.id;
  1307. menuActionCmd2[menuActionRow] = k2;
  1308. menuActionCmd3[menuActionRow] = class9_1.id;
  1309. menuActionRow++;
  1310. }
  1311. } else
  1312. {
  1313. if(class9_1.isInventoryInterface)
  1314. {
  1315. for(int l3 = 4; l3 >= 3; l3--)
  1316. if(itemDef.actions != null && itemDef.actions[l3] != null)
  1317. {
  1318. menuActionName[menuActionRow] = itemDef.actions[l3] + " @lre@" + itemDef.name;
  1319. if(l3 == 3)
  1320. menuActionID[menuActionRow] = 493;
  1321. if(l3 == 4)
  1322. menuActionID[menuActionRow] = 847;
  1323. menuActionCmd1[menuActionRow] = itemDef.id;
  1324. menuActionCmd2[menuActionRow] = k2;
  1325. menuActionCmd3[menuActionRow] = class9_1.id;
  1326. menuActionRow++;
  1327. } else
  1328. if(l3 == 4)
  1329. {
  1330. menuActionName[menuActionRow] = "Drop @lre@" + itemDef.name;
  1331. menuActionID[menuActionRow] = 847;
  1332. menuActionCmd1[menuActionRow] = itemDef.id;
  1333. menuActionCmd2[menuActionRow] = k2;
  1334. menuActionCmd3[menuActionRow] = class9_1.id;
  1335. menuActionRow++;
  1336. }
  1337.  
  1338. }
  1339. if(class9_1.usableItemInterface)
  1340. {
  1341. menuActionName[menuActionRow] = "Use @lre@" + itemDef.name;
  1342. menuActionID[menuActionRow] = 447;
  1343. menuActionCmd1[menuActionRow] = itemDef.id;
  1344. menuActionCmd2[menuActionRow] = k2;
  1345. menuActionCmd3[menuActionRow] = class9_1.id;
  1346. menuActionRow++;
  1347. }
  1348. if(class9_1.isInventoryInterface && itemDef.actions != null)
  1349. {
  1350. for(int i4 = 2; i4 >= 0; i4--)
  1351. if(itemDef.actions[i4] != null)
  1352. {
  1353. menuActionName[menuActionRow] = itemDef.actions[i4] + " @lre@" + itemDef.name;
  1354. if(i4 == 0)
  1355. menuActionID[menuActionRow] = 74;
  1356. if(i4 == 1)
  1357. menuActionID[menuActionRow] = 454;
  1358. if(i4 == 2)
  1359. menuActionID[menuActionRow] = 539;
  1360. menuActionCmd1[menuActionRow] = itemDef.id;
  1361. menuActionCmd2[menuActionRow] = k2;
  1362. menuActionCmd3[menuActionRow] = class9_1.id;
  1363. menuActionRow++;
  1364. }
  1365.  
  1366. }
  1367. if(class9_1.actions != null)
  1368. {
  1369. for(int j4 = 4; j4 >= 0; j4--)
  1370. if(class9_1.actions[j4] != null)
  1371. {
  1372. menuActionName[menuActionRow] = class9_1.actions[j4] + " @lre@" + itemDef.name;
  1373. if(j4 == 0)
  1374. menuActionID[menuActionRow] = 632;
  1375. if(j4 == 1)
  1376. menuActionID[menuActionRow] = 78;
  1377. if(j4 == 2)
  1378. menuActionID[menuActionRow] = 867;
  1379. if(j4 == 3)
  1380. menuActionID[menuActionRow] = 431;
  1381. if(j4 == 4)
  1382. menuActionID[menuActionRow] = 53;
  1383. menuActionCmd1[menuActionRow] = itemDef.id;
  1384. menuActionCmd2[menuActionRow] = k2;
  1385. menuActionCmd3[menuActionRow] = class9_1.id;
  1386. menuActionRow++;
  1387. }
  1388.  
  1389. }
  1390. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + (class9_1.inv[k2] - 1) + "@gre@)";
  1391. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  1392. menuActionID[menuActionRow] = 1125;
  1393. menuActionCmd1[menuActionRow] = itemDef.id;
  1394. menuActionCmd2[menuActionRow] = k2;
  1395. menuActionCmd3[menuActionRow] = class9_1.id;
  1396. menuActionRow++;
  1397. }
  1398. }
  1399. }
  1400. k2++;
  1401. }
  1402.  
  1403. }
  1404.  
  1405. }
  1406. }
  1407. }
  1408.  
  1409. }
  1410.  
  1411. public void drawScrollbar(int j, int k, int l, int i1, int j1) {
  1412. scrollBar1.drawSprite(i1, l);
  1413. scrollBar2.drawSprite(i1, (l + j) - 16);
  1414. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 16);
  1415. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x3d3426, 15);
  1416. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x342d21, 13);
  1417. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x2e281d, 11);
  1418. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x29241b, 10);
  1419. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x252019, 9);
  1420. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 1);
  1421. int k1 = ((j - 32) * j) / j1;
  1422. if(k1 < 8)
  1423. k1 = 8;
  1424. int l1 = ((j - 32 - k1) * k) / (j1 - j);
  1425. DrawingArea.drawPixels(k1, l + 16 + l1, i1, barFillColor, 16);
  1426. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1);
  1427. DrawingArea.method341(l + 16 + l1, 0x817051, k1, i1 + 1);
  1428. DrawingArea.method341(l + 16 + l1, 0x73654a, k1, i1 + 2);
  1429. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 3);
  1430. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 4);
  1431. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 5);
  1432. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 6);
  1433. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 7);
  1434. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 8);
  1435. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 9);
  1436. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 10);
  1437. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 11);
  1438. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 12);
  1439. DrawingArea.method341(l + 16 + l1, 0x514635, k1, i1 + 13);
  1440. DrawingArea.method341(l + 16 + l1, 0x4b4131, k1, i1 + 14);
  1441. DrawingArea.method339(l + 16 + l1, 0x000001, 15, i1);
  1442. DrawingArea.method339(l + 17 + l1, 0x000001, 15, i1);
  1443. DrawingArea.method339(l + 17 + l1, 0x655841, 14, i1);
  1444. DrawingArea.method339(l + 17 + l1, 0x6a5c43, 13, i1);
  1445. DrawingArea.method339(l + 17 + l1, 0x6d5f48, 11, i1);
  1446. DrawingArea.method339(l + 17 + l1, 0x73654a, 10, i1);
  1447. DrawingArea.method339(l + 17 + l1, 0x76684b, 7, i1);
  1448. DrawingArea.method339(l + 17 + l1, 0x7b6a4d, 5, i1);
  1449. DrawingArea.method339(l + 17 + l1, 0x7e6e50, 4, i1);
  1450. DrawingArea.method339(l + 17 + l1, 0x817051, 3, i1);
  1451. DrawingArea.method339(l + 17 + l1, 0x000001, 2, i1);
  1452. DrawingArea.method339(l + 18 + l1, 0x000001, 16, i1);
  1453. DrawingArea.method339(l + 18 + l1, 0x564b38, 15, i1);
  1454. DrawingArea.method339(l + 18 + l1, 0x5d513c, 14, i1);
  1455. DrawingArea.method339(l + 18 + l1, 0x625640, 11, i1);
  1456. DrawingArea.method339(l + 18 + l1, 0x655841, 10, i1);
  1457. DrawingArea.method339(l + 18 + l1, 0x6a5c43, 7, i1);
  1458. DrawingArea.method339(l + 18 + l1, 0x6e6046, 5, i1);
  1459. DrawingArea.method339(l + 18 + l1, 0x716247, 4, i1);
  1460. DrawingArea.method339(l + 18 + l1, 0x7b6a4d, 3, i1);
  1461. DrawingArea.method339(l + 18 + l1, 0x817051, 2, i1);
  1462. DrawingArea.method339(l + 18 + l1, 0x000001, 1, i1);
  1463. DrawingArea.method339(l + 19 + l1, 0x000001, 16, i1);
  1464. DrawingArea.method339(l + 19 + l1, 0x514635, 15, i1);
  1465. DrawingArea.method339(l + 19 + l1, 0x564b38, 14, i1);
  1466. DrawingArea.method339(l + 19 + l1, 0x5d513c, 11, i1);
  1467. DrawingArea.method339(l + 19 + l1, 0x61553e, 9, i1);
  1468. DrawingArea.method339(l + 19 + l1, 0x655841, 7, i1);
  1469. DrawingArea.method339(l + 19 + l1, 0x6a5c43, 5, i1);
  1470. DrawingArea.method339(l + 19 + l1, 0x6e6046, 4, i1);
  1471. DrawingArea.method339(l + 19 + l1, 0x73654a, 3, i1);
  1472. DrawingArea.method339(l + 19 + l1, 0x817051, 2, i1);
  1473. DrawingArea.method339(l + 19 + l1, 0x000001, 1, i1);
  1474. DrawingArea.method339(l + 20 + l1, 0x000001, 16, i1);
  1475. DrawingArea.method339(l + 20 + l1, 0x4b4131, 15, i1);
  1476. DrawingArea.method339(l + 20 + l1, 0x544936, 14, i1);
  1477. DrawingArea.method339(l + 20 + l1, 0x594e3a, 13, i1);
  1478. DrawingArea.method339(l + 20 + l1, 0x5d513c, 10, i1);
  1479. DrawingArea.method339(l + 20 + l1, 0x61553e, 8, i1);
  1480. DrawingArea.method339(l + 20 + l1, 0x655841, 6, i1);
  1481. DrawingArea.method339(l + 20 + l1, 0x6a5c43, 4, i1);
  1482. DrawingArea.method339(l + 20 + l1, 0x73654a, 3, i1);
  1483. DrawingArea.method339(l + 20 + l1, 0x817051, 2, i1);
  1484. DrawingArea.method339(l + 20 + l1, 0x000001, 1, i1);
  1485. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1 + 15);
  1486. DrawingArea.method339(l + 15 + l1 + k1, 0x000001, 16, i1);
  1487. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 15, i1);
  1488. DrawingArea.method339(l + 14 + l1 + k1, 0x3f372a, 14, i1);
  1489. DrawingArea.method339(l + 14 + l1 + k1, 0x443c2d, 10, i1);
  1490. DrawingArea.method339(l + 14 + l1 + k1, 0x483e2f, 9, i1);
  1491. DrawingArea.method339(l + 14 + l1 + k1, 0x4a402f, 7, i1);
  1492. DrawingArea.method339(l + 14 + l1 + k1, 0x4b4131, 4, i1);
  1493. DrawingArea.method339(l + 14 + l1 + k1, 0x564b38, 3, i1);
  1494. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 2, i1);
  1495. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 16, i1);
  1496. DrawingArea.method339(l + 13 + l1 + k1, 0x443c2d, 15, i1);
  1497. DrawingArea.method339(l + 13 + l1 + k1, 0x4b4131, 11, i1);
  1498. DrawingArea.method339(l + 13 + l1 + k1, 0x514635, 9, i1);
  1499. DrawingArea.method339(l + 13 + l1 + k1, 0x544936, 7, i1);
  1500. DrawingArea.method339(l + 13 + l1 + k1, 0x564b38, 6, i1);
  1501. DrawingArea.method339(l + 13 + l1 + k1, 0x594e3a, 4, i1);
  1502. DrawingArea.method339(l + 13 + l1 + k1, 0x625640, 3, i1);
  1503. DrawingArea.method339(l + 13 + l1 + k1, 0x6a5c43, 2, i1);
  1504. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 1, i1);
  1505. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 16, i1);
  1506. DrawingArea.method339(l + 12 + l1 + k1, 0x443c2d, 15, i1);
  1507. DrawingArea.method339(l + 12 + l1 + k1, 0x4b4131, 14, i1);
  1508. DrawingArea.method339(l + 12 + l1 + k1, 0x544936, 12, i1);
  1509. DrawingArea.method339(l + 12 + l1 + k1, 0x564b38, 11, i1);
  1510. DrawingArea.method339(l + 12 + l1 + k1, 0x594e3a, 10, i1);
  1511. DrawingArea.method339(l + 12 + l1 + k1, 0x5d513c, 7, i1);
  1512. DrawingArea.method339(l + 12 + l1 + k1, 0x61553e, 4, i1);
  1513. DrawingArea.method339(l + 12 + l1 + k1, 0x6e6046, 3, i1);
  1514. DrawingArea.method339(l + 12 + l1 + k1, 0x7b6a4d, 2, i1);
  1515. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 1, i1);
  1516. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 16, i1);
  1517. DrawingArea.method339(l + 11 + l1 + k1, 0x4b4131, 15, i1);
  1518. DrawingArea.method339(l + 11 + l1 + k1, 0x514635, 14, i1);
  1519. DrawingArea.method339(l + 11 + l1 + k1, 0x564b38, 13, i1);
  1520. DrawingArea.method339(l + 11 + l1 + k1, 0x594e3a, 11, i1);
  1521. DrawingArea.method339(l + 11 + l1 + k1, 0x5d513c, 9, i1);
  1522. DrawingArea.method339(l + 11 + l1 + k1, 0x61553e, 7, i1);
  1523. DrawingArea.method339(l + 11 + l1 + k1, 0x655841, 5, i1);
  1524. DrawingArea.method339(l + 11 + l1 + k1, 0x6a5c43, 4, i1);
  1525. DrawingArea.method339(l + 11 + l1 + k1, 0x73654a, 3, i1);
  1526. DrawingArea.method339(l + 11 + l1 + k1, 0x7b6a4d, 2, i1);
  1527. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 1, i1);
  1528.  
  1529. }
  1530.  
  1531. public void updateNPCs(Stream stream, int i)
  1532. {
  1533. anInt839 = 0;
  1534. anInt893 = 0;
  1535. method139(stream);
  1536. method46(i, stream);
  1537. method86(stream);
  1538. for(int k = 0; k < anInt839; k++)
  1539. {
  1540. int l = anIntArray840[k];
  1541. if(npcArray[l].anInt1537 != loopCycle)
  1542. {
  1543. npcArray[l].desc = null;
  1544. npcArray[l] = null;
  1545. }
  1546. }
  1547.  
  1548. if(stream.currentOffset != i)
  1549. {
  1550. signlink.reporterror(myUsername + " size mismatch in getnpcpos - pos:" + stream.currentOffset + " psize:" + i);
  1551. throw new RuntimeException("eek");
  1552. }
  1553. for(int i1 = 0; i1 < npcCount; i1++)
  1554. if(npcArray[npcIndices[i1]] == null)
  1555. {
  1556. signlink.reporterror(myUsername + " null entry in npc list - pos:" + i1 + " size:" + npcCount);
  1557. throw new RuntimeException("eek");
  1558. }
  1559.  
  1560. }
  1561.  
  1562. private int cButtonHPos;
  1563. private int cButtonHCPos;
  1564. private int cButtonCPos;
  1565.  
  1566. public void processChatModeClick() {
  1567. if(super.mouseX >= 6 && super.mouseX <= 62 && super.mouseY >= 482 && super.mouseY <= 505) {
  1568. cButtonHPos = 0;
  1569. aBoolean1233 = true;
  1570. inputTaken = true;
  1571. }
  1572. else if(super.mouseX >= 63 && super.mouseX <= 118 && super.mouseY >= 482 && super.mouseY <= 505) {
  1573. cButtonHPos = 1;
  1574. aBoolean1233 = true;
  1575. inputTaken = true;
  1576. }
  1577. else if(super.mouseX >= 119 && super.mouseX <= 175 && super.mouseY >= 482 && super.mouseY <= 505) {
  1578. cButtonHPos = 2;
  1579. aBoolean1233 = true;
  1580. inputTaken = true;
  1581. }
  1582. else if(super.mouseX >= 177 && super.mouseX <= 232 && super.mouseY >= 482 && super.mouseY <= 505) {
  1583. cButtonHPos = 3;
  1584. aBoolean1233 = true;
  1585. inputTaken = true;
  1586. }
  1587. else if(super.mouseX >= 233 && super.mouseX <= 289 && super.mouseY >= 482 && super.mouseY <= 505) {
  1588. cButtonHPos = 4;
  1589. aBoolean1233 = true;
  1590. inputTaken = true;
  1591. }
  1592. else if(super.mouseX >= 290 && super.mouseX <= 346 && super.mouseY >= 482 && super.mouseY <= 505) {
  1593. cButtonHPos = 5;
  1594. aBoolean1233 = true;
  1595. inputTaken = true;
  1596. }
  1597. else if(super.mouseX >= 347 && super.mouseX <= 403 && super.mouseY >= 482 && super.mouseY <= 505) {
  1598. cButtonHPos = 6;
  1599. aBoolean1233 = true;
  1600. inputTaken = true;
  1601. }
  1602. else if(super.mouseX >= 404 && super.mouseX <= 515 && super.mouseY >= 482 && super.mouseY <= 505) {
  1603. cButtonHPos = 7;
  1604. aBoolean1233 = true;
  1605. inputTaken = true;
  1606. } else {
  1607. cButtonHPos = -1;
  1608. aBoolean1233 = true;
  1609. inputTaken = true;
  1610. }
  1611.  
  1612. if(super.clickMode3 == 1) {
  1613. if(super.saveClickX >= 6 && super.saveClickX <= 62 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1614. cButtonCPos = 0;
  1615. chatTypeView = 0;
  1616. aBoolean1233 = true;
  1617. inputTaken = true;
  1618. }
  1619. if(super.saveClickX >= 63 && super.saveClickX <= 118 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1620. cButtonCPos = 1;
  1621. chatTypeView = 5;
  1622. aBoolean1233 = true;
  1623. inputTaken = true;
  1624. }
  1625. if(super.saveClickX >= 119 && super.saveClickX <= 175 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1626. cButtonCPos = 2;
  1627. chatTypeView = 1;
  1628. aBoolean1233 = true;
  1629. inputTaken = true;
  1630. }
  1631. if(super.saveClickX >= 177 && super.saveClickX <= 232 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1632. cButtonCPos = 3;
  1633. chatTypeView = 2;
  1634. aBoolean1233 = true;
  1635. inputTaken = true;
  1636. }
  1637. if(super.saveClickX >= 233 && super.saveClickX <= 289 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1638. cButtonCPos = 4;
  1639. chatTypeView = 11;
  1640. aBoolean1233 = true;
  1641. inputTaken = true;
  1642. }
  1643. if(super.saveClickX >= 290 && super.saveClickX <= 346 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1644. cButtonCPos = 5;
  1645. chatTypeView = 3;
  1646. aBoolean1233 = true;
  1647. inputTaken = true;
  1648. }
  1649. if(super.saveClickX >= 347 && super.saveClickX <= 403 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1650. cButtonCPos = 6;
  1651. chatTypeView = 4;
  1652. aBoolean1233 = true;
  1653. inputTaken = true;
  1654. }
  1655. if(super.saveClickX >= 404 && super.saveClickX <= 515 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1656. if(openInterfaceID == -1) {
  1657. clearTopInterfaces();
  1658. reportAbuseInput = "";
  1659. canMute = false;
  1660. for(int i = 0; i < RSInterface.interfaceCache.length; i++) {
  1661. if(RSInterface.interfaceCache[i] == null || RSInterface.interfaceCache[i].contentType != 600)
  1662. continue;
  1663. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  1664. break;
  1665. }
  1666.  
  1667. } else {
  1668. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  1669. }
  1670. }
  1671. }
  1672. }
  1673.  
  1674. public void method33(int i)
  1675. {
  1676. int j = Varp.cache[i].anInt709;
  1677. if(j == 0)
  1678. return;
  1679. int k = variousSettings[i];
  1680. if(j == 1)
  1681. {
  1682. if(k == 1)
  1683. Texture.method372(0.90000000000000002D);
  1684. if(k == 2)
  1685. Texture.method372(0.80000000000000004D);
  1686. if(k == 3)
  1687. Texture.method372(0.69999999999999996D);
  1688. if(k == 4)
  1689. Texture.method372(0.59999999999999998D);
  1690. ItemDef.mruNodes1.unlinkAll();
  1691. welcomeScreenRaised = true;
  1692. }
  1693. if(j == 3)
  1694. {
  1695. boolean flag1 = musicEnabled;
  1696. if (k == 0) {
  1697. if (signlink.music != null)
  1698. adjustVolume(musicEnabled, 500);
  1699. musicEnabled = true;
  1700. }
  1701. if (k == 1) {
  1702. if (signlink.music != null)
  1703. adjustVolume(musicEnabled, 300);
  1704. musicEnabled = true;
  1705. }
  1706. if (k == 2) {
  1707. if (signlink.music != null)
  1708. adjustVolume(musicEnabled, 100);
  1709. musicEnabled = true;
  1710. }
  1711. if (k == 3) {
  1712. if (signlink.music != null)
  1713. adjustVolume(musicEnabled, 0);
  1714. musicEnabled = true;
  1715. }
  1716. if(k == 4)
  1717. musicEnabled = false;
  1718. if (musicEnabled != flag1 && !lowMem) {
  1719. if (musicEnabled) {
  1720. nextSong = currentSong;
  1721. songChanging = true;
  1722. onDemandFetcher.method558(2, nextSong);
  1723. } else {
  1724. stopMidi();
  1725. }
  1726. prevSong = 0;
  1727. }
  1728. }
  1729. if (j == 4) {
  1730. SoundPlayer.setVolume(k);
  1731. if (k == 0) {
  1732. aBoolean848 = true;
  1733. setWaveVolume(0);
  1734. }
  1735. if (k == 1) {
  1736. aBoolean848 = true;
  1737. setWaveVolume(-400);
  1738. }
  1739. if (k == 2) {
  1740. aBoolean848 = true;
  1741. setWaveVolume(-800);
  1742. }
  1743. if (k == 3) {
  1744. aBoolean848 = true;
  1745. setWaveVolume(-1200);
  1746. }
  1747. if (k == 4) {
  1748. aBoolean848 = false;
  1749. }
  1750. }
  1751. if(j == 5)
  1752. anInt1253 = k;
  1753. if(j == 6)
  1754. anInt1249 = k;
  1755. if(j == 8)
  1756. {
  1757. splitPrivateChat = k;
  1758. inputTaken = true;
  1759. }
  1760. if(j == 9)
  1761. anInt913 = k;
  1762. }
  1763.  
  1764. public void updateEntities() {
  1765. try{
  1766. int anInt974 = 0;
  1767. for(int j = -1; j < playerCount + npcCount; j++) {
  1768. Object obj;
  1769. if(j == -1)
  1770. obj = myPlayer;
  1771. else
  1772. if(j < playerCount)
  1773. obj = playerArray[playerIndices[j]];
  1774. else
  1775. obj = npcArray[npcIndices[j - playerCount]];
  1776. if(obj == null || !((Entity) (obj)).isVisible())
  1777. continue;
  1778. if(obj instanceof NPC) {
  1779. EntityDef entityDef = ((NPC)obj).desc;
  1780. if(entityDef.childrenIDs != null)
  1781. entityDef = entityDef.method161();
  1782. if(entityDef == null)
  1783. continue;
  1784. }
  1785. if(j < playerCount) {
  1786. int l = 30;
  1787. Player player = (Player)obj;
  1788. if(player.headIcon >= 0) {
  1789. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1790. if(spriteDrawX > -1) {
  1791. if (player.skullIcon < 2) {
  1792. skullIcons[player.skullIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1793. l += 25;
  1794. }
  1795. if (player.headIcon < 7) {
  1796. headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1797. l += 18;
  1798. }
  1799. }
  1800. }
  1801. if(j >= 0 && anInt855 == 10 && anInt933 == playerIndices[j]) {
  1802. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1803. if(spriteDrawX > -1)
  1804. headIconsHint[player.hintIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1805. }
  1806. } else {
  1807. EntityDef entityDef_1 = ((NPC)obj).desc;
  1808. if(entityDef_1.anInt75 >= 0 && entityDef_1.anInt75 < headIcons.length) {
  1809. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1810. if(spriteDrawX > -1)
  1811. headIcons[entityDef_1.anInt75].drawSprite(spriteDrawX - 12, spriteDrawY - 30);
  1812. }
  1813. if(anInt855 == 1 && anInt1222 == npcIndices[j - playerCount] && loopCycle % 20 < 10) {
  1814. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1815. if(spriteDrawX > -1)
  1816. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  1817. }
  1818. }
  1819. if(((Entity) (obj)).textSpoken != null && (j >= playerCount || publicChatMode == 0 || publicChatMode == 3 || publicChatMode == 1 && isFriendOrSelf(((Player)obj).name)))
  1820. {
  1821. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height);
  1822. if(spriteDrawX > -1 && anInt974 < anInt975)
  1823. {
  1824. anIntArray979[anInt974] = boldText.method384(((Entity) (obj)).textSpoken) / 2;
  1825. anIntArray978[anInt974] = boldText.anInt1497;
  1826. anIntArray976[anInt974] = spriteDrawX;
  1827. anIntArray977[anInt974] = spriteDrawY;
  1828. anIntArray980[anInt974] = ((Entity) (obj)).anInt1513;
  1829. anIntArray981[anInt974] = ((Entity) (obj)).anInt1531;
  1830. anIntArray982[anInt974] = ((Entity) (obj)).textCycle;
  1831. aStringArray983[anInt974++] = ((Entity) (obj)).textSpoken;
  1832. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 >= 1 && ((Entity) (obj)).anInt1531 <= 3)
  1833. {
  1834. anIntArray978[anInt974] += 10;
  1835. anIntArray977[anInt974] += 5;
  1836. }
  1837. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 4)
  1838. anIntArray979[anInt974] = 60;
  1839. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 5)
  1840. anIntArray978[anInt974] += 5;
  1841. }
  1842. }
  1843. if(((Entity) (obj)).loopCycleStatus > loopCycle)
  1844. {
  1845. try{
  1846. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1847. if(spriteDrawX > -1)
  1848. {
  1849. int i1 = (((Entity) (obj)).currentHealth * 30) / ((Entity) (obj)).maxHealth;
  1850. if(i1 > 30)
  1851. i1 = 30;
  1852. DrawingArea.drawPixels(5, spriteDrawY - 3, spriteDrawX - 15, 65280, i1);
  1853. DrawingArea.drawPixels(5, spriteDrawY - 3, (spriteDrawX - 15) + i1, 0xff0000, 30 - i1);
  1854. }
  1855. }catch(Exception e){ }
  1856. }
  1857. for(int j1 = 0; j1 < 4; j1++)
  1858. if(((Entity) (obj)).hitsLoopCycle[j1] > loopCycle)
  1859. {
  1860. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height / 2);
  1861. if(spriteDrawX > -1)
  1862. {
  1863. if(j1 == 1)
  1864. spriteDrawY -= 20;
  1865. if(j1 == 2)
  1866. {
  1867. spriteDrawX -= 15;
  1868. spriteDrawY -= 10;
  1869. }
  1870. if(j1 == 3)
  1871. {
  1872. spriteDrawX += 15;
  1873. spriteDrawY -= 10;
  1874. }
  1875. hitMarks[((Entity) (obj)).hitMarkTypes[j1]].drawSprite(spriteDrawX - 12, spriteDrawY - 12);
  1876. smallText.drawText(0, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 4, spriteDrawX);
  1877. smallText.drawText(0xffffff, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 3, spriteDrawX - 1);
  1878. }
  1879. }
  1880. }
  1881. for(int k = 0; k < anInt974; k++) {
  1882. int k1 = anIntArray976[k];
  1883. int l1 = anIntArray977[k];
  1884. int j2 = anIntArray979[k];
  1885. int k2 = anIntArray978[k];
  1886. boolean flag = true;
  1887. while(flag)
  1888. {
  1889. flag = false;
  1890. for(int l2 = 0; l2 < k; l2++)
  1891. 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)
  1892. {
  1893. l1 = anIntArray977[l2] - anIntArray978[l2];
  1894. flag = true;
  1895. }
  1896.  
  1897. }
  1898. spriteDrawX = anIntArray976[k];
  1899. spriteDrawY = anIntArray977[k] = l1;
  1900. String s = aStringArray983[k];
  1901. if(anInt1249 == 0)
  1902. {
  1903. int i3 = 0xffff00;
  1904. if(anIntArray980[k] < 6)
  1905. i3 = anIntArray965[anIntArray980[k]];
  1906. if(anIntArray980[k] == 6)
  1907. i3 = anInt1265 % 20 >= 10 ? 0xffff00 : 0xff0000;
  1908. if(anIntArray980[k] == 7)
  1909. i3 = anInt1265 % 20 >= 10 ? 65535 : 255;
  1910. if(anIntArray980[k] == 8)
  1911. i3 = anInt1265 % 20 >= 10 ? 0x80ff80 : 45056;
  1912. if(anIntArray980[k] == 9) {
  1913. int j3 = 150 - anIntArray982[k];
  1914. if(j3 < 50)
  1915. i3 = 0xff0000 + 1280 * j3;
  1916. else
  1917. if(j3 < 100)
  1918. i3 = 0xffff00 - 0x50000 * (j3 - 50);
  1919. else
  1920. if(j3 < 150)
  1921. i3 = 65280 + 5 * (j3 - 100);
  1922. }
  1923. if(anIntArray980[k] == 10) {
  1924. int k3 = 150 - anIntArray982[k];
  1925. if(k3 < 50)
  1926. i3 = 0xff0000 + 5 * k3;
  1927. else
  1928. if(k3 < 100)
  1929. i3 = 0xff00ff - 0x50000 * (k3 - 50);
  1930. else
  1931. if(k3 < 150)
  1932. i3 = (255 + 0x50000 * (k3 - 100)) - 5 * (k3 - 100);
  1933. }
  1934. if(anIntArray980[k] == 11) {
  1935. int l3 = 150 - anIntArray982[k];
  1936. if(l3 < 50)
  1937. i3 = 0xffffff - 0x50005 * l3;
  1938. else
  1939. if(l3 < 100)
  1940. i3 = 65280 + 0x50005 * (l3 - 50);
  1941. else
  1942. if(l3 < 150)
  1943. i3 = 0xffffff - 0x50000 * (l3 - 100);
  1944. }
  1945. if(anIntArray981[k] == 0) {
  1946. boldText.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  1947. boldText.drawText(i3, s, spriteDrawY, spriteDrawX);
  1948. }
  1949. if(anIntArray981[k] == 1) {
  1950. boldText.method386(0, s, spriteDrawX, anInt1265, spriteDrawY + 1);
  1951. boldText.method386(i3, s, spriteDrawX, anInt1265, spriteDrawY);
  1952. }
  1953. if(anIntArray981[k] == 2) {
  1954. boldText.method387(spriteDrawX, s, anInt1265, spriteDrawY + 1, 0);
  1955. boldText.method387(spriteDrawX, s, anInt1265, spriteDrawY, i3);
  1956. }
  1957. if(anIntArray981[k] == 3) {
  1958. boldText.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY + 1, spriteDrawX, 0);
  1959. boldText.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY, spriteDrawX, i3);
  1960. }
  1961. if(anIntArray981[k] == 4) {
  1962. int i4 = boldText.method384(s);
  1963. int k4 = ((150 - anIntArray982[k]) * (i4 + 100)) / 150;
  1964. DrawingArea.setDrawingArea(334, spriteDrawX - 50, spriteDrawX + 50, 0);
  1965. boldText.method385(0, s, spriteDrawY + 1, (spriteDrawX + 50) - k4);
  1966. boldText.method385(i3, s, spriteDrawY, (spriteDrawX + 50) - k4);
  1967. DrawingArea.defaultDrawingAreaSize();
  1968. }
  1969. if(anIntArray981[k] == 5) {
  1970. int j4 = 150 - anIntArray982[k];
  1971. int l4 = 0;
  1972. if(j4 < 25)
  1973. l4 = j4 - 25;
  1974. else
  1975. if(j4 > 125)
  1976. l4 = j4 - 125;
  1977. DrawingArea.setDrawingArea(spriteDrawY + 5, 0, 512, spriteDrawY - boldText.anInt1497 - 1);
  1978. boldText.drawText(0, s, spriteDrawY + 1 + l4, spriteDrawX);
  1979. boldText.drawText(i3, s, spriteDrawY + l4, spriteDrawX);
  1980. DrawingArea.defaultDrawingAreaSize();
  1981. }
  1982. } else {
  1983. boldText.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  1984. boldText.drawText(0xffff00, s, spriteDrawY, spriteDrawX);
  1985. }
  1986. }
  1987. } catch(Exception e){ }
  1988. }
  1989.  
  1990. public void delFriend(long l)
  1991. {
  1992. try
  1993. {
  1994. if(l == 0L)
  1995. return;
  1996. for(int i = 0; i < friendsCount; i++)
  1997. {
  1998. if(friendsListAsLongs[i] != l)
  1999. continue;
  2000. friendsCount--;
  2001. needDrawTabArea = true;
  2002. for(int j = i; j < friendsCount; j++)
  2003. {
  2004. friendsList[j] = friendsList[j + 1];
  2005. friendsNodeIDs[j] = friendsNodeIDs[j + 1];
  2006. friendsListAsLongs[j] = friendsListAsLongs[j + 1];
  2007. }
  2008.  
  2009. stream.createFrame(215);
  2010. stream.writeQWord(l);
  2011. break;
  2012. }
  2013. }
  2014. catch(RuntimeException runtimeexception)
  2015. {
  2016. signlink.reporterror("18622, " + false + ", " + l + ", " + runtimeexception.toString());
  2017. throw new RuntimeException();
  2018. }
  2019. }
  2020.  
  2021. public void drawSideIcons(){
  2022. if(tabInterfaceIDs[0] != -1)//attack
  2023. sideIcons[0].drawSprite(10, 4);
  2024. if(tabInterfaceIDs[1] != -1)//stat
  2025. sideIcons[1].drawSprite(43, 4);
  2026. if(tabInterfaceIDs[2] != -1)//quest
  2027. sideIcons[2].drawSprite(76, 3);
  2028. if(tabInterfaceIDs[3] != -1)//inventory
  2029. sideIcons[3].drawSprite(111, 5);
  2030. if(tabInterfaceIDs[4] != -1)//equipment
  2031. sideIcons[4].drawSprite(140, 2);
  2032. if(tabInterfaceIDs[5] != -1)//prayer
  2033. sideIcons[5].drawSprite(174, 1);
  2034. if(tabInterfaceIDs[6] != -1)//magic
  2035. sideIcons[6].drawSprite(208, 4);
  2036. if(tabInterfaceIDs[7] != -1)//summoning
  2037. sideIcons[14].drawSprite(11, 303);
  2038. if(tabInterfaceIDs[7] != -1)//clan
  2039. sideIcons[7].drawSprite(113, 302);
  2040. if(tabInterfaceIDs[8] != -1)//friends
  2041. sideIcons[8].drawSprite(46, 306);
  2042. if(tabInterfaceIDs[9] != -1)//ignore
  2043. sideIcons[9].drawSprite(79, 306);
  2044. if(tabInterfaceIDs[11] != -1)//options
  2045. sideIcons[11].drawSprite(145, 304);
  2046. if(tabInterfaceIDs[12] != -1)//emotes
  2047. sideIcons[12].drawSprite(181, 302);
  2048. if(tabInterfaceIDs[13] != -1)//music
  2049. sideIcons[13].drawSprite(213, 303);
  2050. }
  2051.  
  2052. public void drawRedStones() {
  2053. if(tabInterfaceIDs[tabID] != -1) {
  2054. switch(tabID) {
  2055. case 0:
  2056. redStones[0].drawSprite(3, 0);
  2057. break;
  2058. case 1:
  2059. redStones[4].drawSprite(41, 0);
  2060. break;
  2061. case 2:
  2062. redStones[4].drawSprite(74, 0);
  2063. break;
  2064. case 3:
  2065. redStones[4].drawSprite(107, 0);
  2066. break;
  2067. case 4:
  2068. redStones[4].drawSprite(140, 0);
  2069. break;
  2070. case 5:
  2071. redStones[4].drawSprite(173, 0);
  2072. break;
  2073. case 6:
  2074. redStones[1].drawSprite(206, 0);
  2075. break;
  2076. case 7:
  2077. redStones[2].drawSprite(3, 298);
  2078. break;
  2079. case 8:
  2080. redStones[4].drawSprite(41, 298);
  2081. break;
  2082. case 9:
  2083. redStones[4].drawSprite(74, 298);
  2084. break;
  2085. case 10:
  2086. redStones[4].drawSprite(107, 298);
  2087. break;
  2088. case 11:
  2089. redStones[4].drawSprite(140, 298);
  2090. break;
  2091. case 12:
  2092. redStones[4].drawSprite(173, 298);
  2093. break;
  2094. case 13:
  2095. redStones[3].drawSprite(206, 298);
  2096. break;
  2097. }
  2098. }
  2099. }
  2100.  
  2101. private void drawTabArea() {
  2102. aRSImageProducer_1163.initDrawingArea();
  2103. Texture.anIntArray1472 = anIntArray1181;
  2104. tabArea.drawSprite(0, 0);
  2105. if(invOverlayInterfaceID == -1) {
  2106. drawRedStones();
  2107. drawSideIcons();
  2108. }
  2109. if(invOverlayInterfaceID != -1)
  2110. drawInterface(0, 28, RSInterface.interfaceCache[invOverlayInterfaceID], 37);
  2111. else if(tabInterfaceIDs[tabID] != -1)
  2112. drawInterface(0, 28, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 37);
  2113. if(menuOpen && menuScreenArea == 1)
  2114. drawMenu();
  2115. aRSImageProducer_1163.drawGraphics(168, super.graphics, 519);
  2116. aRSImageProducer_1165.initDrawingArea();
  2117. Texture.anIntArray1472 = anIntArray1182;
  2118. }
  2119.  
  2120. public void method37(int j) {
  2121. if(!lowMem) {
  2122. if(Texture.anIntArray1480[17] >= j) {
  2123. Background background = Texture.aBackgroundArray1474s[17];
  2124. int k = background.anInt1452 * background.anInt1453 - 1;
  2125. int j1 = background.anInt1452 * anInt945 * 2;
  2126. byte abyte0[] = background.aByteArray1450;
  2127. byte abyte3[] = aByteArray912;
  2128. for(int i2 = 0; i2 <= k; i2++)
  2129. abyte3[i2] = abyte0[i2 - j1 & k];
  2130.  
  2131. background.aByteArray1450 = abyte3;
  2132. aByteArray912 = abyte0;
  2133. Texture.method370(17);
  2134. anInt854++;
  2135. if(anInt854 > 1235) {
  2136. anInt854 = 0;
  2137. stream.createFrame(226);
  2138. stream.writeWordBigEndian(0);
  2139. int l2 = stream.currentOffset;
  2140. stream.writeWord(58722);
  2141. stream.writeWordBigEndian(240);
  2142. stream.writeWord((int)(Math.random() * 65536D));
  2143. stream.writeWordBigEndian((int)(Math.random() * 256D));
  2144. if((int)(Math.random() * 2D) == 0)
  2145. stream.writeWord(51825);
  2146. stream.writeWordBigEndian((int)(Math.random() * 256D));
  2147. stream.writeWord((int)(Math.random() * 65536D));
  2148. stream.writeWord(7130);
  2149. stream.writeWord((int)(Math.random() * 65536D));
  2150. stream.writeWord(61657);
  2151. stream.writeBytes(stream.currentOffset - l2);
  2152. }
  2153. }
  2154. if(Texture.anIntArray1480[24] >= j) {
  2155. Background background_1 = Texture.aBackgroundArray1474s[24];
  2156. int l = background_1.anInt1452 * background_1.anInt1453 - 1;
  2157. int k1 = background_1.anInt1452 * anInt945 * 2;
  2158. byte abyte1[] = background_1.aByteArray1450;
  2159. byte abyte4[] = aByteArray912;
  2160. for(int j2 = 0; j2 <= l; j2++)
  2161. abyte4[j2] = abyte1[j2 - k1 & l];
  2162.  
  2163. background_1.aByteArray1450 = abyte4;
  2164. aByteArray912 = abyte1;
  2165. Texture.method370(24);
  2166. }
  2167. if(Texture.anIntArray1480[34] >= j) {
  2168. Background background_2 = Texture.aBackgroundArray1474s[34];
  2169. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  2170. int l1 = background_2.anInt1452 * anInt945 * 2;
  2171. byte abyte2[] = background_2.aByteArray1450;
  2172. byte abyte5[] = aByteArray912;
  2173. for(int k2 = 0; k2 <= i1; k2++)
  2174. abyte5[k2] = abyte2[k2 - l1 & i1];
  2175.  
  2176. background_2.aByteArray1450 = abyte5;
  2177. aByteArray912 = abyte2;
  2178. Texture.method370(34);
  2179. }
  2180. if(Texture.anIntArray1480[40] >= j);
  2181. {
  2182. Background background_2 = Texture.aBackgroundArray1474s[40];
  2183. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  2184. int l1 = background_2.anInt1452 * anInt945 * 2;
  2185. byte abyte2[] = background_2.aByteArray1450;
  2186. byte abyte5[] = aByteArray912;
  2187. for (int k2 = 0; k2 <= i1; k2++)
  2188. abyte5[k2] = abyte2[k2 - l1 & i1];
  2189.  
  2190. background_2.aByteArray1450 = abyte5;
  2191. aByteArray912 = abyte2;
  2192. Texture.method370(40);
  2193. }
  2194. }
  2195. }
  2196.  
  2197. public void method38() {
  2198. for(int i = -1; i < playerCount; i++) {
  2199. int j;
  2200. if(i == -1)
  2201. j = myPlayerIndex;
  2202. else
  2203. j = playerIndices[i];
  2204. Player player = playerArray[j];
  2205. if(player != null && player.textCycle > 0) {
  2206. player.textCycle--;
  2207. if(player.textCycle == 0)
  2208. player.textSpoken = null;
  2209. }
  2210. }
  2211. for(int k = 0; k < npcCount; k++) {
  2212. int l = npcIndices[k];
  2213. NPC npc = npcArray[l];
  2214. if(npc != null && npc.textCycle > 0) {
  2215. npc.textCycle--;
  2216. if(npc.textCycle == 0)
  2217. npc.textSpoken = null;
  2218. }
  2219. }
  2220. }
  2221.  
  2222. public void calcCameraPos() {
  2223. int i = anInt1098 * 128 + 64;
  2224. int j = anInt1099 * 128 + 64;
  2225. int k = method42(plane, j, i) - anInt1100;
  2226. if(xCameraPos < i) {
  2227. xCameraPos += anInt1101 + ((i - xCameraPos) * anInt1102) / 1000;
  2228. if(xCameraPos > i)
  2229. xCameraPos = i;
  2230. }
  2231. if(xCameraPos > i) {
  2232. xCameraPos -= anInt1101 + ((xCameraPos - i) * anInt1102) / 1000;
  2233. if(xCameraPos < i)
  2234. xCameraPos = i;
  2235. }
  2236. if(zCameraPos < k) {
  2237. zCameraPos += anInt1101 + ((k - zCameraPos) * anInt1102) / 1000;
  2238. if(zCameraPos > k)
  2239. zCameraPos = k;
  2240. }
  2241. if(zCameraPos > k) {
  2242. zCameraPos -= anInt1101 + ((zCameraPos - k) * anInt1102) / 1000;
  2243. if(zCameraPos < k)
  2244. zCameraPos = k;
  2245. }
  2246. if(yCameraPos < j) {
  2247. yCameraPos += anInt1101 + ((j - yCameraPos) * anInt1102) / 1000;
  2248. if(yCameraPos > j)
  2249. yCameraPos = j;
  2250. }
  2251. if(yCameraPos > j) {
  2252. yCameraPos -= anInt1101 + ((yCameraPos - j) * anInt1102) / 1000;
  2253. if(yCameraPos < j)
  2254. yCameraPos = j;
  2255. }
  2256. i = anInt995 * 128 + 64;
  2257. j = anInt996 * 128 + 64;
  2258. k = method42(plane, j, i) - anInt997;
  2259. int l = i - xCameraPos;
  2260. int i1 = k - zCameraPos;
  2261. int j1 = j - yCameraPos;
  2262. int k1 = (int)Math.sqrt(l * l + j1 * j1);
  2263. int l1 = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  2264. int i2 = (int)(Math.atan2(l, j1) * -325.94900000000001D) & 0x7ff;
  2265. if(l1 < 128)
  2266. l1 = 128;
  2267. if(l1 > 383)
  2268. l1 = 383;
  2269. if(yCameraCurve < l1) {
  2270. yCameraCurve += anInt998 + ((l1 - yCameraCurve) * anInt999) / 1000;
  2271. if(yCameraCurve > l1)
  2272. yCameraCurve = l1;
  2273. }
  2274. if(yCameraCurve > l1) {
  2275. yCameraCurve -= anInt998 + ((yCameraCurve - l1) * anInt999) / 1000;
  2276. if(yCameraCurve < l1)
  2277. yCameraCurve = l1;
  2278. }
  2279. int j2 = i2 - xCameraCurve;
  2280. if(j2 > 1024)
  2281. j2 -= 2048;
  2282. if(j2 < -1024)
  2283. j2 += 2048;
  2284. if(j2 > 0) {
  2285. xCameraCurve += anInt998 + (j2 * anInt999) / 1000;
  2286. xCameraCurve &= 0x7ff;
  2287. }
  2288. if(j2 < 0) {
  2289. xCameraCurve -= anInt998 + (-j2 * anInt999) / 1000;
  2290. xCameraCurve &= 0x7ff;
  2291. }
  2292. int k2 = i2 - xCameraCurve;
  2293. if(k2 > 1024)
  2294. k2 -= 2048;
  2295. if(k2 < -1024)
  2296. k2 += 2048;
  2297. if(k2 < 0 && j2 > 0 || k2 > 0 && j2 < 0)
  2298. xCameraCurve = i2;
  2299. }
  2300.  
  2301. public void drawMenu() {
  2302. int i = menuOffsetX;
  2303. int j = menuOffsetY;
  2304. int k = menuWidth;
  2305. int l = menuHeight + 1;
  2306. int i1 = 0x5d5447;
  2307. //DrawingArea.drawPixels(height, yPos, xPos, color, width);
  2308. //DrawingArea.fillPixels(xPos, width, height, color, yPos);
  2309. DrawingArea.drawPixels(l, j, i, i1, k);
  2310. DrawingArea.drawPixels(16, j + 1, i + 1, 0, k - 2);
  2311. DrawingArea.fillPixels(i + 1, k - 2, l - 19, 0, j + 18);
  2312. boldText.method385(i1, "Choose Option", j + 14, i + 3);
  2313. int j1 = super.mouseX;
  2314. int k1 = super.mouseY;
  2315. if(menuScreenArea == 0) {
  2316. j1 -= 4;
  2317. k1 -= 4;
  2318. }
  2319. if(menuScreenArea == 1) {
  2320. j1 -= 519;
  2321. k1 -= 168;
  2322. }
  2323. if(menuScreenArea == 2) {
  2324. j1 -= 17;
  2325. k1 -= 338;
  2326. }
  2327. if(menuScreenArea == 3) {
  2328. j1 -= 519;
  2329. k1 -= 0;
  2330. }
  2331. for(int l1 = 0; l1 < menuActionRow; l1++) {
  2332. int i2 = j + 31 + (menuActionRow - 1 - l1) * 15;
  2333. int j2 = 0xffffff;
  2334. if(j1 > i && j1 < i + k && k1 > i2 - 13 && k1 < i2 + 3)
  2335. j2 = 0xffff00;
  2336. boldText.method389(true, i + 3, j2, menuActionName[l1], i2);
  2337. }
  2338. }
  2339.  
  2340. public void addFriend(long l) {
  2341. try {
  2342. if(l == 0L)
  2343. return;
  2344. if(friendsCount >= 100 && anInt1046 != 1) {
  2345. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  2346. return;
  2347. }
  2348. if(friendsCount >= 200) {
  2349. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  2350. return;
  2351. }
  2352. String s = TextClass.fixName(TextClass.nameForLong(l));
  2353. for(int i = 0; i < friendsCount; i++)
  2354. if(friendsListAsLongs[i] == l) {
  2355. pushMessage(s + " is already on your friend list", 0, "");
  2356. return;
  2357. }
  2358. for(int j = 0; j < ignoreCount; j++)
  2359. if(ignoreListAsLongs[j] == l) {
  2360. pushMessage("Please remove " + s + " from your ignore list first", 0, "");
  2361. return;
  2362. }
  2363.  
  2364. if(s.equals(myPlayer.name)) {
  2365. return;
  2366. } else {
  2367. friendsList[friendsCount] = s;
  2368. friendsListAsLongs[friendsCount] = l;
  2369. friendsNodeIDs[friendsCount] = 0;
  2370. friendsCount++;
  2371. needDrawTabArea = true;
  2372. stream.createFrame(188);
  2373. stream.writeQWord(l);
  2374. return;
  2375. }
  2376. } catch(RuntimeException runtimeexception) {
  2377. signlink.reporterror("15283, " + (byte)68 + ", " + l + ", " + runtimeexception.toString());
  2378. }
  2379. throw new RuntimeException();
  2380. }
  2381.  
  2382. private int method42(int i, int j, int k) {
  2383. int l = k >> 7;
  2384. int i1 = j >> 7;
  2385. if(l < 0 || i1 < 0 || l > 103 || i1 > 103)
  2386. return 0;
  2387. int j1 = i;
  2388. if(j1 < 3 && (byteGroundArray[1][l][i1] & 2) == 2)
  2389. j1++;
  2390. int k1 = k & 0x7f;
  2391. int l1 = j & 0x7f;
  2392. int i2 = intGroundArray[j1][l][i1] * (128 - k1) + intGroundArray[j1][l + 1][i1] * k1 >> 7;
  2393. int j2 = intGroundArray[j1][l][i1 + 1] * (128 - k1) + intGroundArray[j1][l + 1][i1 + 1] * k1 >> 7;
  2394. return i2 * (128 - l1) + j2 * l1 >> 7;
  2395. }
  2396.  
  2397. private static String intToKOrMil(int j) {
  2398. if(j == 0)
  2399. return "@inf@";
  2400. if(j < 0x186a0)
  2401. return String.valueOf(j);
  2402. if(j < 0x989680)
  2403. return j / 1000 + "K";
  2404. else
  2405. return j / 0xf4240 + "M";
  2406. }
  2407.  
  2408. public void resetLogout() {
  2409. try {
  2410. if(socketStream != null)
  2411. socketStream.close();
  2412. }
  2413. catch(Exception _ex) { }
  2414. socketStream = null;
  2415. loggedIn = false;
  2416. loginScreenState = 0;
  2417. // myUsername = "";
  2418. // myPassword = "";
  2419. writeSettings();
  2420. unlinkMRUNodes();
  2421. worldController.initToNull();
  2422. for(int i = 0; i < 4; i++)
  2423. aClass11Array1230[i].method210();
  2424. System.gc();
  2425. stopMidi();
  2426. currentSong = -1;
  2427. nextSong = -1;
  2428. prevSong = 0;
  2429. if (signlink.musicOn) {
  2430. playMusicButton();
  2431. }
  2432. }
  2433.  
  2434. public void method45() {
  2435. aBoolean1031 = true;
  2436. for(int j = 0; j < 7; j++) {
  2437. anIntArray1065[j] = -1;
  2438. for(int k = 0; k < IDK.length; k++) {
  2439. if(IDK.cache[k].aBoolean662 || IDK.cache[k].anInt657 != j + (aBoolean1047 ? 0 : 7))
  2440. continue;
  2441. anIntArray1065[j] = k;
  2442. break;
  2443. }
  2444. }
  2445. }
  2446.  
  2447. public void tradePlayer(int index) {
  2448. if (loggedIn) {
  2449. stream.createFrame(39);
  2450. //stream.writeWord(index);
  2451. stream.method431(index);
  2452. }
  2453. }
  2454.  
  2455. public void method46(int i, Stream stream) {
  2456. while(stream.bitPosition + 21 < i * 8) {
  2457. int k = stream.readBits(14);
  2458. if(k == 16383)
  2459. break;
  2460. if(npcArray[k] == null)
  2461. npcArray[k] = new NPC();
  2462. NPC npc = npcArray[k];
  2463. npcIndices[npcCount++] = k;
  2464. npc.anInt1537 = loopCycle;
  2465. int l = stream.readBits(5);
  2466. if(l > 15)
  2467. l -= 32;
  2468. int i1 = stream.readBits(5);
  2469. if(i1 > 15)
  2470. i1 -= 32;
  2471. int j1 = stream.readBits(1);
  2472. npc.desc = EntityDef.forID(stream.readBits(14));
  2473. int k1 = stream.readBits(1);
  2474. if(k1 == 1)
  2475. anIntArray894[anInt893++] = k;
  2476. npc.anInt1540 = npc.desc.aByte68;
  2477. npc.anInt1504 = npc.desc.anInt79;
  2478. npc.anInt1554 = npc.desc.walkAnim;
  2479. npc.anInt1555 = npc.desc.anInt58;
  2480. npc.anInt1556 = npc.desc.anInt83;
  2481. npc.anInt1557 = npc.desc.anInt55;
  2482. npc.anInt1511 = npc.desc.standAnim;
  2483. npc.setPos(myPlayer.smallX[0] + i1, myPlayer.smallY[0] + l, j1 == 1);
  2484. }
  2485. stream.finishBitAccess();
  2486. }
  2487.  
  2488. public void processGameLoop() {
  2489. if(rsAlreadyLoaded || loadingError || genericLoadingError)
  2490. return;
  2491. loopCycle++;
  2492. if(!loggedIn)
  2493. processLoginScreenInput();
  2494. else
  2495. mainGameProcessor();
  2496. processOnDemandQueue();
  2497. }
  2498.  
  2499. public void method47(boolean flag) {
  2500. if(myPlayer.x >> 7 == destX && myPlayer.y >> 7 == destY)
  2501. destX = 0;
  2502. int j = playerCount;
  2503. if(flag)
  2504. j = 1;
  2505. for(int l = 0; l < j; l++) {
  2506. Player player;
  2507. int i1;
  2508. if(flag) {
  2509. player = myPlayer;
  2510. i1 = myPlayerIndex << 14;
  2511. } else {
  2512. player = playerArray[playerIndices[l]];
  2513. i1 = playerIndices[l] << 14;
  2514. }
  2515. if(player == null || !player.isVisible())
  2516. continue;
  2517. player.aBoolean1699 = (lowMem && playerCount > 50 || playerCount > 200) && !flag && player.anInt1517 == player.anInt1511;
  2518. int j1 = player.x >> 7;
  2519. int k1 = player.y >> 7;
  2520. if(j1 < 0 || j1 >= 104 || k1 < 0 || k1 >= 104)
  2521. continue;
  2522. if(player.aModel_1714 != null && loopCycle >= player.anInt1707 && loopCycle < player.anInt1708) {
  2523. player.aBoolean1699 = false;
  2524. player.anInt1709 = method42(plane, player.y, player.x);
  2525. worldController.method286(plane, player.y, player, player.anInt1552, player.anInt1722, player.x, player.anInt1709, player.anInt1719, player.anInt1721, i1, player.anInt1720);
  2526. continue;
  2527. }
  2528. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  2529. if(anIntArrayArray929[j1][k1] == anInt1265)
  2530. continue;
  2531. anIntArrayArray929[j1][k1] = anInt1265;
  2532. }
  2533. player.anInt1709 = method42(plane, player.y, player.x);
  2534. worldController.method285(plane, player.anInt1552, player.anInt1709, i1, player.y, 60, player.x, player, player.aBoolean1541);
  2535. }
  2536. }
  2537.  
  2538. private boolean promptUserForInput(RSInterface class9) {
  2539. int j = class9.contentType;
  2540. if(anInt900 == 2) {
  2541. if(j == 201) {
  2542. inputTaken = true;
  2543. inputDialogState = 0;
  2544. messagePromptRaised = true;
  2545. promptInput = "";
  2546. friendsListAction = 1;
  2547. aString1121 = "Enter name of friend to add to list";
  2548. }
  2549. if(j == 202) {
  2550. inputTaken = true;
  2551. inputDialogState = 0;
  2552. messagePromptRaised = true;
  2553. promptInput = "";
  2554. friendsListAction = 2;
  2555. aString1121 = "Enter name of friend to delete from list";
  2556. }
  2557. }
  2558. if(j == 205) {
  2559. anInt1011 = 250;
  2560. return true;
  2561. }
  2562. if(j == 501) {
  2563. inputTaken = true;
  2564. inputDialogState = 0;
  2565. messagePromptRaised = true;
  2566. promptInput = "";
  2567. friendsListAction = 4;
  2568. aString1121 = "Enter name of player to add to list";
  2569. }
  2570. if(j == 502) {
  2571. inputTaken = true;
  2572. inputDialogState = 0;
  2573. messagePromptRaised = true;
  2574. promptInput = "";
  2575. friendsListAction = 5;
  2576. aString1121 = "Enter name of player to delete from list";
  2577. }
  2578. if(j == 550) {
  2579. inputTaken = true;
  2580. inputDialogState = 0;
  2581. messagePromptRaised = true;
  2582. promptInput = "";
  2583. friendsListAction = 6;
  2584. aString1121 = "Enter the name of the chat you wish to join";
  2585. }
  2586. if(j >= 300 && j <= 313) {
  2587. int k = (j - 300) / 2;
  2588. int j1 = j & 1;
  2589. int i2 = anIntArray1065[k];
  2590. if(i2 != -1) {
  2591. do {
  2592. if(j1 == 0 && --i2 < 0)
  2593. i2 = IDK.length - 1;
  2594. if(j1 == 1 && ++i2 >= IDK.length)
  2595. i2 = 0;
  2596. } while(IDK.cache[i2].aBoolean662 || IDK.cache[i2].anInt657 != k + (aBoolean1047 ? 0 : 7));
  2597. anIntArray1065[k] = i2;
  2598. aBoolean1031 = true;
  2599. }
  2600. }
  2601. if(j >= 314 && j <= 323) {
  2602. int l = (j - 314) / 2;
  2603. int k1 = j & 1;
  2604. int j2 = anIntArray990[l];
  2605. if(k1 == 0 && --j2 < 0)
  2606. j2 = anIntArrayArray1003[l].length - 1;
  2607. if(k1 == 1 && ++j2 >= anIntArrayArray1003[l].length)
  2608. j2 = 0;
  2609. anIntArray990[l] = j2;
  2610. aBoolean1031 = true;
  2611. }
  2612. if(j == 324 && !aBoolean1047) {
  2613. aBoolean1047 = true;
  2614. method45();
  2615. }
  2616. if(j == 325 && aBoolean1047) {
  2617. aBoolean1047 = false;
  2618. method45();
  2619. }
  2620. if(j == 326) {
  2621. stream.createFrame(101);
  2622. stream.writeWordBigEndian(aBoolean1047 ? 0 : 1);
  2623. for(int i1 = 0; i1 < 7; i1++)
  2624. stream.writeWordBigEndian(anIntArray1065[i1]);
  2625.  
  2626. for(int l1 = 0; l1 < 5; l1++)
  2627. stream.writeWordBigEndian(anIntArray990[l1]);
  2628.  
  2629. return true;
  2630. }
  2631. if(j == 620)
  2632. canMute = !canMute;
  2633. if(j >= 601 && j <= 613) {
  2634. clearTopInterfaces();
  2635. if(reportAbuseInput.length() > 0) {
  2636. stream.createFrame(218);
  2637. stream.writeQWord(TextClass.longForName(reportAbuseInput));
  2638. stream.writeWordBigEndian(j - 601);
  2639. stream.writeWordBigEndian(canMute ? 1 : 0);
  2640. }
  2641. }
  2642. return false;
  2643. }
  2644.  
  2645. public void method49(Stream stream) {
  2646. for(int j = 0; j < anInt893; j++) {
  2647. int k = anIntArray894[j];
  2648. Player player = playerArray[k];
  2649. int l = stream.readUnsignedByte();
  2650. if((l & 0x40) != 0)
  2651. l += stream.readUnsignedByte() << 8;
  2652. method107(l, k, stream, player);
  2653. }
  2654. }
  2655.  
  2656. public void method50(int i, int k, int l, int i1, int j1) {
  2657. int k1 = worldController.method300(j1, l, i);
  2658. if(k1 != 0) {
  2659. int l1 = worldController.method304(j1, l, i, k1);
  2660. int k2 = l1 >> 6 & 3;
  2661. int i3 = l1 & 0x1f;
  2662. int k3 = k;
  2663. if(k1 > 0)
  2664. k3 = i1;
  2665. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  2666. int k4 = 24624 + l * 4 + (103 - i) * 512 * 4;
  2667. int i5 = k1 >> 14 & 0x7fff;
  2668. ObjectDef class46_2 = ObjectDef.forID(i5);
  2669. if(class46_2.anInt758 != -1) {
  2670. Background background_2 = mapScenes[class46_2.anInt758];
  2671. if(background_2 != null) {
  2672. int i6 = (class46_2.anInt744 * 4 - background_2.anInt1452) / 2;
  2673. int j6 = (class46_2.anInt761 * 4 - background_2.anInt1453) / 2;
  2674. background_2.drawBackground(48 + l * 4 + i6, 48 + (104 - i - class46_2.anInt761) * 4 + j6);
  2675. }
  2676. } else {
  2677. if(i3 == 0 || i3 == 2)
  2678. if(k2 == 0) {
  2679. ai[k4] = k3;
  2680. ai[k4 + 512] = k3;
  2681. ai[k4 + 1024] = k3;
  2682. ai[k4 + 1536] = k3;
  2683. } else if(k2 == 1) {
  2684. ai[k4] = k3;
  2685. ai[k4 + 1] = k3;
  2686. ai[k4 + 2] = k3;
  2687. ai[k4 + 3] = k3;
  2688. } else if(k2 == 2) {
  2689. ai[k4 + 3] = k3;
  2690. ai[k4 + 3 + 512] = k3;
  2691. ai[k4 + 3 + 1024] = k3;
  2692. ai[k4 + 3 + 1536] = k3;
  2693. } else if(k2 == 3) {
  2694. ai[k4 + 1536] = k3;
  2695. ai[k4 + 1536 + 1] = k3;
  2696. ai[k4 + 1536 + 2] = k3;
  2697. ai[k4 + 1536 + 3] = k3;
  2698. }
  2699. if(i3 == 3)
  2700. if(k2 == 0)
  2701. ai[k4] = k3;
  2702. else if(k2 == 1)
  2703. ai[k4 + 3] = k3;
  2704. else if(k2 == 2)
  2705. ai[k4 + 3 + 1536] = k3;
  2706. else if(k2 == 3)
  2707. ai[k4 + 1536] = k3;
  2708. if(i3 == 2)
  2709. if(k2 == 3) {
  2710. ai[k4] = k3;
  2711. ai[k4 + 512] = k3;
  2712. ai[k4 + 1024] = k3;
  2713. ai[k4 + 1536] = k3;
  2714. } else if(k2 == 0) {
  2715. ai[k4] = k3;
  2716. ai[k4 + 1] = k3;
  2717. ai[k4 + 2] = k3;
  2718. ai[k4 + 3] = k3;
  2719. } else if(k2 == 1) {
  2720. ai[k4 + 3] = k3;
  2721. ai[k4 + 3 + 512] = k3;
  2722. ai[k4 + 3 + 1024] = k3;
  2723. ai[k4 + 3 + 1536] = k3;
  2724. } else if(k2 == 2) {
  2725. ai[k4 + 1536] = k3;
  2726. ai[k4 + 1536 + 1] = k3;
  2727. ai[k4 + 1536 + 2] = k3;
  2728. ai[k4 + 1536 + 3] = k3;
  2729. }
  2730. }
  2731. }
  2732. k1 = worldController.method302(j1, l, i);
  2733. if(k1 != 0) {
  2734. int i2 = worldController.method304(j1, l, i, k1);
  2735. int l2 = i2 >> 6 & 3;
  2736. int j3 = i2 & 0x1f;
  2737. int l3 = k1 >> 14 & 0x7fff;
  2738. ObjectDef class46_1 = ObjectDef.forID(l3);
  2739. if(class46_1.anInt758 != -1) {
  2740. Background background_1 = mapScenes[class46_1.anInt758];
  2741. if(background_1 != null) {
  2742. int j5 = (class46_1.anInt744 * 4 - background_1.anInt1452) / 2;
  2743. int k5 = (class46_1.anInt761 * 4 - background_1.anInt1453) / 2;
  2744. background_1.drawBackground(48 + l * 4 + j5, 48 + (104 - i - class46_1.anInt761) * 4 + k5);
  2745. }
  2746. } else if(j3 == 9) {
  2747. int l4 = 0xeeeeee;
  2748. if(k1 > 0)
  2749. l4 = 0xee0000;
  2750. int ai1[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  2751. int l5 = 24624 + l * 4 + (103 - i) * 512 * 4;
  2752. if(l2 == 0 || l2 == 2) {
  2753. ai1[l5 + 1536] = l4;
  2754. ai1[l5 + 1024 + 1] = l4;
  2755. ai1[l5 + 512 + 2] = l4;
  2756. ai1[l5 + 3] = l4;
  2757. } else {
  2758. ai1[l5] = l4;
  2759. ai1[l5 + 512 + 1] = l4;
  2760. ai1[l5 + 1024 + 2] = l4;
  2761. ai1[l5 + 1536 + 3] = l4;
  2762. }
  2763. }
  2764. }
  2765. k1 = worldController.method303(j1, l, i);
  2766. if(k1 != 0) {
  2767. int j2 = k1 >> 14 & 0x7fff;
  2768. ObjectDef class46 = ObjectDef.forID(j2);
  2769. if(class46.anInt758 != -1) {
  2770. Background background = mapScenes[class46.anInt758];
  2771. if(background != null) {
  2772. int i4 = (class46.anInt744 * 4 - background.anInt1452) / 2;
  2773. int j4 = (class46.anInt761 * 4 - background.anInt1453) / 2;
  2774. background.drawBackground(48 + l * 4 + i4, 48 + (104 - i - class46.anInt761) * 4 + j4);
  2775. }
  2776. }
  2777. }
  2778. }
  2779.  
  2780. public void loadTitleScreen() {
  2781.  
  2782. if (!hunterTitleButtons) {
  2783. aBackground_966 = new Background(titleStreamLoader, "titlebox", 0);
  2784. aBackground_967 = new Background(titleStreamLoader, "titlebutton", 0);
  2785. } else {
  2786. titleBox = new Sprite("Login/titlebox");
  2787. titleButton = new Sprite("Login/titlebutton");
  2788. }
  2789. aBackgroundArray1152s = new Background[12];
  2790. int j = 0;
  2791. try {
  2792. j = Integer.parseInt(getParameter("fl_icon"));
  2793. } catch(Exception _ex) {
  2794. }
  2795. if(j == 0) {
  2796. for(int k = 0; k < 12; k++)
  2797. aBackgroundArray1152s[k] = new Background(titleStreamLoader, "runes", k);
  2798.  
  2799. } else {
  2800. for(int l = 0; l < 12; l++)
  2801. aBackgroundArray1152s[l] = new Background(titleStreamLoader, "runes", 12 + (l & 3));
  2802.  
  2803. }
  2804. aClass30_Sub2_Sub1_Sub1_1201 = new Sprite(128, 265);
  2805. aClass30_Sub2_Sub1_Sub1_1202 = new Sprite(128, 265);
  2806. System.arraycopy(aRSImageProducer_1110.anIntArray315, 0, aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, 33920);
  2807.  
  2808. System.arraycopy(aRSImageProducer_1111.anIntArray315, 0, aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, 33920);
  2809.  
  2810. anIntArray851 = new int[256];
  2811. for(int k1 = 0; k1 < 64; k1++)
  2812. anIntArray851[k1] = k1 * 0x40000;
  2813.  
  2814. for(int l1 = 0; l1 < 64; l1++)
  2815. anIntArray851[l1 + 64] = 0xff0000 + 1024 * l1;
  2816.  
  2817. for(int i2 = 0; i2 < 64; i2++)
  2818. anIntArray851[i2 + 128] = 0xffff00 + 4 * i2;
  2819.  
  2820. for(int j2 = 0; j2 < 64; j2++)
  2821. anIntArray851[j2 + 192] = 0xffffff;
  2822.  
  2823. anIntArray852 = new int[256];
  2824. for(int k2 = 0; k2 < 64; k2++)
  2825. anIntArray852[k2] = k2 * 1024;
  2826.  
  2827. for(int l2 = 0; l2 < 64; l2++)
  2828. anIntArray852[l2 + 64] = 65280 + 4 * l2;
  2829.  
  2830. for(int i3 = 0; i3 < 64; i3++)
  2831. anIntArray852[i3 + 128] = 65535 + 0x40000 * i3;
  2832.  
  2833. for(int j3 = 0; j3 < 64; j3++)
  2834. anIntArray852[j3 + 192] = 0xffffff;
  2835.  
  2836. anIntArray853 = new int[256];
  2837. for(int k3 = 0; k3 < 64; k3++)
  2838. anIntArray853[k3] = k3 * 4;
  2839.  
  2840. for(int l3 = 0; l3 < 64; l3++)
  2841. anIntArray853[l3 + 64] = 255 + 0x40000 * l3;
  2842.  
  2843. for(int i4 = 0; i4 < 64; i4++)
  2844. anIntArray853[i4 + 128] = 0xff00ff + 1024 * i4;
  2845.  
  2846. for(int j4 = 0; j4 < 64; j4++)
  2847. anIntArray853[j4 + 192] = 0xffffff;
  2848.  
  2849. anIntArray850 = new int[256];
  2850. anIntArray1190 = new int[32768];
  2851. anIntArray1191 = new int[32768];
  2852. randomizeBackground(null);
  2853. anIntArray828 = new int[32768];
  2854. anIntArray829 = new int[32768];
  2855. drawLoadingText(10, "Connecting to fileserver");
  2856. if(!aBoolean831) {
  2857. drawFlames = true;
  2858. aBoolean831 = true;
  2859. startRunnable(this, 2);
  2860. }
  2861. }
  2862.  
  2863. private static void setHighMem() {
  2864. WorldController.lowMem = false;
  2865. Texture.lowMem = false;
  2866. lowMem = false;
  2867. ObjectManager.lowMem = false;
  2868. ObjectDef.lowMem = false;
  2869. }
  2870.  
  2871. public static void main(String args[]) {
  2872. try {
  2873. nodeID = 10;
  2874. portOff = 0;
  2875. setHighMem();
  2876. isMembers = true;
  2877. signlink.storeid = 32;
  2878. signlink.startpriv(InetAddress.getLocalHost());
  2879. instance = new Jframe(args);
  2880. } catch (Exception exception) {
  2881. }
  2882. }
  2883.  
  2884. public static client instance;
  2885.  
  2886. public void loadingStages() {
  2887. if(lowMem && loadingStage == 2 && ObjectManager.anInt131 != plane) {
  2888. aRSImageProducer_1165.initDrawingArea();
  2889. regularText.drawText(0, "Loading - please wait.", 151, 257);
  2890. regularText.drawText(0xffffff, "Loading - please wait.", 150, 256);
  2891. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  2892. loadingStage = 1;
  2893. aLong824 = System.currentTimeMillis();
  2894. }
  2895. if(loadingStage == 1) {
  2896. int j = method54();
  2897. if(j != 0 && System.currentTimeMillis() - aLong824 > 0x57e40L) {
  2898. signlink.reporterror(myUsername + " glcfb " + aLong1215 + "," + j + "," + lowMem + "," + decompressors[0] + "," + onDemandFetcher.getNodeCount() + "," + plane + "," + anInt1069 + "," + anInt1070);
  2899. aLong824 = System.currentTimeMillis();
  2900. }
  2901. }
  2902. if(loadingStage == 2 && plane != anInt985) {
  2903. anInt985 = plane;
  2904. method24(plane);
  2905. }
  2906. }
  2907.  
  2908. private int method54() {
  2909. for(int i = 0; i < aByteArrayArray1183.length; i++) {
  2910. if(aByteArrayArray1183[i] == null && anIntArray1235[i] != -1)
  2911. return -1;
  2912. if(aByteArrayArray1247[i] == null && anIntArray1236[i] != -1)
  2913. return -2;
  2914. }
  2915. boolean flag = true;
  2916. for(int j = 0; j < aByteArrayArray1183.length; j++) {
  2917. byte abyte0[] = aByteArrayArray1247[j];
  2918. if(abyte0 != null) {
  2919. int k = (anIntArray1234[j] >> 8) * 64 - baseX;
  2920. int l = (anIntArray1234[j] & 0xff) * 64 - baseY;
  2921. if(aBoolean1159) {
  2922. k = 10;
  2923. l = 10;
  2924. }
  2925. flag &= ObjectManager.method189(k, abyte0, l);
  2926. }
  2927. }
  2928. if(!flag)
  2929. return -3;
  2930. if(aBoolean1080) {
  2931. return -4;
  2932. } else {
  2933. loadingStage = 2;
  2934. ObjectManager.anInt131 = plane;
  2935. method22();
  2936. stream.createFrame(121);
  2937. return 0;
  2938. }
  2939. }
  2940.  
  2941. public void method55()
  2942. {
  2943. 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())
  2944. if(class30_sub2_sub4_sub4.anInt1597 != plane || loopCycle > class30_sub2_sub4_sub4.anInt1572)
  2945. class30_sub2_sub4_sub4.unlink();
  2946. else
  2947. if(loopCycle >= class30_sub2_sub4_sub4.anInt1571)
  2948. {
  2949. if(class30_sub2_sub4_sub4.anInt1590 > 0)
  2950. {
  2951. NPC npc = npcArray[class30_sub2_sub4_sub4.anInt1590 - 1];
  2952. if(npc != null && npc.x >= 0 && npc.x < 13312 && npc.y >= 0 && npc.y < 13312)
  2953. 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);
  2954. }
  2955. if(class30_sub2_sub4_sub4.anInt1590 < 0)
  2956. {
  2957. int j = -class30_sub2_sub4_sub4.anInt1590 - 1;
  2958. Player player;
  2959. if(j == unknownInt10)
  2960. player = myPlayer;
  2961. else
  2962. player = playerArray[j];
  2963. if(player != null && player.x >= 0 && player.x < 13312 && player.y >= 0 && player.y < 13312)
  2964. 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);
  2965. }
  2966. class30_sub2_sub4_sub4.method456(anInt945);
  2967. 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);
  2968. }
  2969.  
  2970. }
  2971.  
  2972. public AppletContext getAppletContext()
  2973. {
  2974. if(signlink.mainapp != null)
  2975. return signlink.mainapp.getAppletContext();
  2976. else
  2977. return super.getAppletContext();
  2978. }
  2979.  
  2980. public void drawLogo() {
  2981. byte abyte0[] = titleStreamLoader.getDataForName("title.dat");
  2982. Sprite sprite = new Sprite(abyte0, this);
  2983. aRSImageProducer_1110.initDrawingArea();
  2984. sprite.method346(0, 0);
  2985. aRSImageProducer_1111.initDrawingArea();
  2986. sprite.method346(-637, 0);
  2987. aRSImageProducer_1107.initDrawingArea();
  2988. sprite.method346(-128, 0);
  2989. aRSImageProducer_1108.initDrawingArea();
  2990. sprite.method346(-202, -371);
  2991. aRSImageProducer_1109.initDrawingArea();
  2992. sprite.method346(-202, -171);
  2993. aRSImageProducer_1112.initDrawingArea();
  2994. sprite.method346(0, -265);
  2995. aRSImageProducer_1113.initDrawingArea();
  2996. sprite.method346(-562, -265);
  2997. aRSImageProducer_1114.initDrawingArea();
  2998. sprite.method346(-128, -171);
  2999. aRSImageProducer_1115.initDrawingArea();
  3000. sprite.method346(-562, -171);
  3001. int ai[] = new int[sprite.myWidth];
  3002. for(int j = 0; j < sprite.myHeight; j++) {
  3003. for(int k = 0; k < sprite.myWidth; k++)
  3004. ai[k] = sprite.myPixels[(sprite.myWidth - k - 1) + sprite.myWidth * j];
  3005.  
  3006. System.arraycopy(ai, 0, sprite.myPixels, sprite.myWidth * j, sprite.myWidth);
  3007. }
  3008. /*aRSImageProducer_1110.initDrawingArea();
  3009. sprite.method346(382, 0);
  3010. aRSImageProducer_1111.initDrawingArea();
  3011. sprite.method346(-255, 0);
  3012. aRSImageProducer_1107.initDrawingArea();
  3013. sprite.method346(254, 0);
  3014. aRSImageProducer_1108.initDrawingArea();
  3015. sprite.method346(180, -371);
  3016. aRSImageProducer_1109.initDrawingArea();
  3017. sprite.method346(180, -171);
  3018. aRSImageProducer_1112.initDrawingArea();
  3019. sprite.method346(382, -265);
  3020. aRSImageProducer_1113.initDrawingArea();
  3021. sprite.method346(-180, -265);
  3022. aRSImageProducer_1114.initDrawingArea();
  3023. sprite.method346(254, -171);
  3024. aRSImageProducer_1115.initDrawingArea();*/
  3025. //sprite.method346(-180, -171);
  3026. //sprite = new Sprite(titleStreamLoader, "logo", 0);
  3027. //aRSImageProducer_1107.initDrawingArea(); //Delete the // from here to not have a retarded logo glitch.
  3028. //sprite.drawSprite(382 - sprite.myWidth / 2 - 128, 18);
  3029. sprite = null;
  3030. Object obj = null;
  3031. Object obj1 = null;
  3032. System.gc();
  3033. }
  3034.  
  3035. public void processOnDemandQueue() {
  3036. do {
  3037. OnDemandData onDemandData;
  3038. do {
  3039. onDemandData = onDemandFetcher.getNextNode();
  3040. if (onDemandData == null)
  3041. return;
  3042. if (onDemandData.dataType == 0) {
  3043. Model.method460(onDemandData.buffer, onDemandData.ID);
  3044. needDrawTabArea = true;
  3045. if (backDialogID != -1)
  3046. inputTaken = true;
  3047. }
  3048. if (onDemandData.dataType == 1 && onDemandData.buffer != null)
  3049. Class36.method529(onDemandData.buffer, onDemandData.ID);
  3050. if (onDemandData.dataType == 2 && onDemandData.ID == nextSong
  3051. && onDemandData.buffer != null)
  3052. saveMidi(songChanging, onDemandData.buffer);
  3053. if (onDemandData.dataType == 3 && loadingStage == 1) {
  3054. try {
  3055. writeFile(onDemandData.buffer, "./maps/" + onDemandData.ID + ".dat");
  3056. } catch (Exception e) {}
  3057. for (int i = 0; i < aByteArrayArray1183.length; i++) {
  3058. if (anIntArray1235[i] == onDemandData.ID) {
  3059. aByteArrayArray1183[i] = onDemandData.buffer;
  3060. if (onDemandData.buffer == null) {
  3061. anIntArray1235[i] = -1;
  3062. System.out.println("Landscape nulled.");
  3063. }
  3064. break;
  3065. }
  3066. if (anIntArray1236[i] != onDemandData.ID)
  3067. continue;
  3068. aByteArrayArray1247[i] = onDemandData.buffer;
  3069. if (onDemandData.buffer == null) {
  3070. anIntArray1236[i] = -1;
  3071. System.out.println("Objects nulled.");
  3072. }
  3073. break;
  3074. }
  3075.  
  3076. }
  3077. } while (onDemandData.dataType != 93
  3078. || !onDemandFetcher.method564(onDemandData.ID));
  3079. ObjectManager.method173(new Stream(onDemandData.buffer),
  3080. onDemandFetcher);
  3081. } while (true);
  3082. }
  3083.  
  3084. public void calcFlamesPosition()
  3085. {
  3086. char c = '\u0100';
  3087. for(int j = 10; j < 117; j++)
  3088. {
  3089. int k = (int)(Math.random() * 100D);
  3090. if(k < 50)
  3091. anIntArray828[j + (c - 2 << 7)] = 255;
  3092. }
  3093. for(int l = 0; l < 100; l++)
  3094. {
  3095. int i1 = (int)(Math.random() * 124D) + 2;
  3096. int k1 = (int)(Math.random() * 128D) + 128;
  3097. int k2 = i1 + (k1 << 7);
  3098. anIntArray828[k2] = 192;
  3099. }
  3100.  
  3101. for(int j1 = 1; j1 < c - 1; j1++)
  3102. {
  3103. for(int l1 = 1; l1 < 127; l1++)
  3104. {
  3105. int l2 = l1 + (j1 << 7);
  3106. anIntArray829[l2] = (anIntArray828[l2 - 1] + anIntArray828[l2 + 1] + anIntArray828[l2 - 128] + anIntArray828[l2 + 128]) / 4;
  3107. }
  3108.  
  3109. }
  3110.  
  3111. anInt1275 += 128;
  3112. if(anInt1275 > anIntArray1190.length)
  3113. {
  3114. anInt1275 -= anIntArray1190.length;
  3115. int i2 = (int)(Math.random() * 12D);
  3116. randomizeBackground(aBackgroundArray1152s[i2]);
  3117. }
  3118. for(int j2 = 1; j2 < c - 1; j2++)
  3119. {
  3120. for(int i3 = 1; i3 < 127; i3++)
  3121. {
  3122. int k3 = i3 + (j2 << 7);
  3123. int i4 = anIntArray829[k3 + 128] - anIntArray1190[k3 + anInt1275 & anIntArray1190.length - 1] / 5;
  3124. if(i4 < 0)
  3125. i4 = 0;
  3126. anIntArray828[k3] = i4;
  3127. }
  3128.  
  3129. }
  3130.  
  3131. System.arraycopy(anIntArray969, 1, anIntArray969, 0, c - 1);
  3132.  
  3133. anIntArray969[c - 1] = (int)(Math.sin((double)loopCycle / 14D) * 16D + Math.sin((double)loopCycle / 15D) * 14D + Math.sin((double)loopCycle / 16D) * 12D);
  3134. if(anInt1040 > 0)
  3135. anInt1040 -= 4;
  3136. if(anInt1041 > 0)
  3137. anInt1041 -= 4;
  3138. if(anInt1040 == 0 && anInt1041 == 0)
  3139. {
  3140. int l3 = (int)(Math.random() * 2000D);
  3141. if(l3 == 0)
  3142. anInt1040 = 1024;
  3143. if(l3 == 1)
  3144. anInt1041 = 1024;
  3145. }
  3146. }
  3147.  
  3148. private boolean saveWave(byte abyte0[], int i)
  3149. {
  3150. return abyte0 == null || signlink.wavesave(abyte0, i);
  3151. }
  3152.  
  3153. public void method60(int i)
  3154. {
  3155. RSInterface class9 = RSInterface.interfaceCache[i];
  3156. if (class9 == null)
  3157. return;
  3158. for(int j = 0; j < class9.children.length; j++)
  3159. {
  3160. if(class9.children[j] == -1)
  3161. break;
  3162. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j]];
  3163. if(class9_1.type == 1)
  3164. method60(class9_1.id);
  3165. class9_1.anInt246 = 0;
  3166. class9_1.anInt208 = 0;
  3167. }
  3168. }
  3169.  
  3170. private void drawHeadIcon()
  3171. {
  3172. if(anInt855 != 2)
  3173. return;
  3174. calcEntityScreenPos((anInt934 - baseX << 7) + anInt937, anInt936 * 2, (anInt935 - baseY << 7) + anInt938);
  3175. if(spriteDrawX > -1 && loopCycle % 20 < 10)
  3176. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  3177. }
  3178.  
  3179. public int canWalkDelay = 0;
  3180. public int getDis(int coordX1, int coordY1, int coordX2, int coordY2)
  3181. {
  3182. int deltaX = coordX2 - coordX1;
  3183. int deltaY = coordY2 - coordY1;
  3184. return ((int)Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2)));
  3185. }
  3186. public int random(int range)
  3187. {
  3188. return (int)(Math.random() * range);
  3189. }
  3190. public boolean withinDistance(int x1, int y1, int x2, int y2, int dis)
  3191. {
  3192. for (int i = 0; i <= dis; i++)
  3193. {
  3194. try{
  3195. if ((x1 + i) == x2 && ((y1 + i) == y2 || (y1 - i) == y2 || y1 == y2))
  3196. return true;
  3197. else
  3198. if ((x1 - i) == x2 && ((x1 + i) == y2 || (y1 - i) == y2 || y1 == y2))
  3199. return true;
  3200. else
  3201. if (x1 == x2 && ((x1 + i) == y2 || (y1 - i) == y2 || y1 == y2))
  3202. return true;
  3203. } catch(Exception ex){
  3204. System.out.println("Exception in following, method : WithingDistance");
  3205. }
  3206. }
  3207. return false;
  3208. }
  3209.  
  3210. public void mainGameProcessor()
  3211. {
  3212. if(anInt1104 > 1)
  3213. anInt1104--;
  3214. if(anInt1011 > 0)
  3215. anInt1011--;
  3216. for(int j = 0; j < 5; j++)
  3217. if(!parsePacket())
  3218. break;
  3219.  
  3220. if(!loggedIn)
  3221. return;
  3222. synchronized(mouseDetection.syncObject)
  3223. {
  3224. if(flagged)
  3225. {
  3226. if(super.clickMode3 != 0 || mouseDetection.coordsIndex >= 40)
  3227. {
  3228. stream.createFrame(45);
  3229. stream.writeWordBigEndian(0);
  3230. int j2 = stream.currentOffset;
  3231. int j3 = 0;
  3232. for(int j4 = 0; j4 < mouseDetection.coordsIndex; j4++)
  3233. {
  3234. if(j2 - stream.currentOffset >= 240)
  3235. break;
  3236. j3++;
  3237. int l4 = mouseDetection.coordsY[j4];
  3238. if(l4 < 0)
  3239. l4 = 0;
  3240. else
  3241. if(l4 > 502)
  3242. l4 = 502;
  3243. int k5 = mouseDetection.coordsX[j4];
  3244. if(k5 < 0)
  3245. k5 = 0;
  3246. else
  3247. if(k5 > 764)
  3248. k5 = 764;
  3249. int i6 = l4 * 765 + k5;
  3250. if(mouseDetection.coordsY[j4] == -1 && mouseDetection.coordsX[j4] == -1)
  3251. {
  3252. k5 = -1;
  3253. l4 = -1;
  3254. i6 = 0x7ffff;
  3255. }
  3256. if(k5 == anInt1237 && l4 == anInt1238)
  3257. {
  3258. if(anInt1022 < 2047)
  3259. anInt1022++;
  3260. } else
  3261. {
  3262. int j6 = k5 - anInt1237;
  3263. anInt1237 = k5;
  3264. int k6 = l4 - anInt1238;
  3265. anInt1238 = l4;
  3266. if(anInt1022 < 8 && j6 >= -32 && j6 <= 31 && k6 >= -32 && k6 <= 31)
  3267. {
  3268. j6 += 32;
  3269. k6 += 32;
  3270. stream.writeWord((anInt1022 << 12) + (j6 << 6) + k6);
  3271. anInt1022 = 0;
  3272. } else
  3273. if(anInt1022 < 8)
  3274. {
  3275. stream.writeDWordBigEndian(0x800000 + (anInt1022 << 19) + i6);
  3276. anInt1022 = 0;
  3277. } else
  3278. {
  3279. stream.writeDWord(0xc0000000 + (anInt1022 << 19) + i6);
  3280. anInt1022 = 0;
  3281. }
  3282. }
  3283. }
  3284.  
  3285. stream.writeBytes(stream.currentOffset - j2);
  3286. if(j3 >= mouseDetection.coordsIndex)
  3287. {
  3288. mouseDetection.coordsIndex = 0;
  3289. } else
  3290. {
  3291. mouseDetection.coordsIndex -= j3;
  3292. for(int i5 = 0; i5 < mouseDetection.coordsIndex; i5++)
  3293. {
  3294. mouseDetection.coordsX[i5] = mouseDetection.coordsX[i5 + j3];
  3295. mouseDetection.coordsY[i5] = mouseDetection.coordsY[i5 + j3];
  3296. }
  3297.  
  3298. }
  3299. }
  3300. } else
  3301. {
  3302. mouseDetection.coordsIndex = 0;
  3303. }
  3304. }
  3305. if(super.clickMode3 != 0)
  3306. {
  3307. long l = (super.aLong29 - aLong1220) / 50L;
  3308. if(l > 4095L)
  3309. l = 4095L;
  3310. aLong1220 = super.aLong29;
  3311. int k2 = super.saveClickY;
  3312. if(k2 < 0)
  3313. k2 = 0;
  3314. else
  3315. if(k2 > 502)
  3316. k2 = 502;
  3317. int k3 = super.saveClickX;
  3318. if(k3 < 0)
  3319. k3 = 0;
  3320. else
  3321. if(k3 > 764)
  3322. k3 = 764;
  3323. int k4 = k2 * 765 + k3;
  3324. int j5 = 0;
  3325. if(super.clickMode3 == 2)
  3326. j5 = 1;
  3327. int l5 = (int)l;
  3328. stream.createFrame(241);
  3329. stream.writeDWord((l5 << 20) + (j5 << 19) + k4);
  3330. }
  3331. if(anInt1016 > 0)
  3332. anInt1016--;
  3333. if(super.keyArray[1] == 1 || super.keyArray[2] == 1 || super.keyArray[3] == 1 || super.keyArray[4] == 1)
  3334. aBoolean1017 = true;
  3335. if(aBoolean1017 && anInt1016 <= 0)
  3336. {
  3337. anInt1016 = 20;
  3338. aBoolean1017 = false;
  3339. stream.createFrame(86);
  3340. stream.writeWord(anInt1184);
  3341. stream.method432(minimapInt1);
  3342. }
  3343. if(super.awtFocus && !aBoolean954)
  3344. {
  3345. aBoolean954 = true;
  3346. stream.createFrame(3);
  3347. stream.writeWordBigEndian(1);
  3348. }
  3349. if(!super.awtFocus && aBoolean954)
  3350. {
  3351. aBoolean954 = false;
  3352. stream.createFrame(3);
  3353. stream.writeWordBigEndian(0);
  3354. }
  3355. loadingStages();
  3356. method115();
  3357. method90();
  3358. anInt1009++;
  3359. if(anInt1009 > 750)
  3360. dropClient();
  3361. method114();
  3362. method95();
  3363. method38();
  3364. anInt945++;
  3365. if(crossType != 0)
  3366. {
  3367. crossIndex += 20;
  3368. if(crossIndex >= 400)
  3369. crossType = 0;
  3370. }
  3371. if(atInventoryInterfaceType != 0)
  3372. {
  3373. atInventoryLoopCycle++;
  3374. if(atInventoryLoopCycle >= 15)
  3375. {
  3376. if(atInventoryInterfaceType == 2)
  3377. needDrawTabArea = true;
  3378. if(atInventoryInterfaceType == 3)
  3379. inputTaken = true;
  3380. atInventoryInterfaceType = 0;
  3381. }
  3382. }
  3383. if(activeInterfaceType != 0)
  3384. {
  3385. anInt989++;
  3386. if(super.mouseX > anInt1087 + 5 || super.mouseX < anInt1087 - 5 || super.mouseY > anInt1088 + 5 || super.mouseY < anInt1088 - 5)
  3387. aBoolean1242 = true;
  3388. if(super.clickMode2 == 0)
  3389. {
  3390. if(activeInterfaceType == 2)
  3391. needDrawTabArea = true;
  3392. if(activeInterfaceType == 3)
  3393. inputTaken = true;
  3394. activeInterfaceType = 0;
  3395. if(aBoolean1242 && anInt989 >= 5)
  3396. {
  3397. lastActiveInvInterface = -1;
  3398. processRightClick();
  3399. if(lastActiveInvInterface == anInt1084 && mouseInvInterfaceIndex != anInt1085)
  3400. {
  3401. RSInterface class9 = RSInterface.interfaceCache[anInt1084];
  3402. int j1 = 0;
  3403. if(anInt913 == 1 && class9.contentType == 206)
  3404. j1 = 1;
  3405. if(class9.inv[mouseInvInterfaceIndex] <= 0)
  3406. j1 = 0;
  3407. if(class9.aBoolean235)
  3408. {
  3409. int l2 = anInt1085;
  3410. int l3 = mouseInvInterfaceIndex;
  3411. class9.inv[l3] = class9.inv[l2];
  3412. class9.invStackSizes[l3] = class9.invStackSizes[l2];
  3413. class9.inv[l2] = -1;
  3414. class9.invStackSizes[l2] = 0;
  3415. } else
  3416. if(j1 == 1)
  3417. {
  3418. int i3 = anInt1085;
  3419. for(int i4 = mouseInvInterfaceIndex; i3 != i4;)
  3420. if(i3 > i4)
  3421. {
  3422. class9.swapInventoryItems(i3, i3 - 1);
  3423. i3--;
  3424. } else
  3425. if(i3 < i4)
  3426. {
  3427. class9.swapInventoryItems(i3, i3 + 1);
  3428. i3++;
  3429. }
  3430.  
  3431. } else
  3432. {
  3433. class9.swapInventoryItems(anInt1085, mouseInvInterfaceIndex);
  3434. }
  3435. stream.createFrame(214);
  3436. stream.method433(anInt1084);
  3437. stream.method424(j1);
  3438. stream.method433(anInt1085);
  3439. stream.method431(mouseInvInterfaceIndex);
  3440. }
  3441. } else
  3442. if((anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  3443. determineMenuSize();
  3444. else
  3445. if(menuActionRow > 0)
  3446. doAction(menuActionRow - 1);
  3447. atInventoryLoopCycle = 10;
  3448. super.clickMode3 = 0;
  3449. }
  3450. }
  3451. if(WorldController.anInt470 != -1)
  3452. {
  3453. int k = WorldController.anInt470;
  3454. int k1 = WorldController.anInt471;
  3455. boolean flag = doWalkTo(0, 0, 0, 0, myPlayer.smallY[0], 0, 0, k1, myPlayer.smallX[0], true, k);
  3456. WorldController.anInt470 = -1;
  3457. if(flag)
  3458. {
  3459. crossX = super.saveClickX;
  3460. crossY = super.saveClickY;
  3461. crossType = 1;
  3462. crossIndex = 0;
  3463. }
  3464. }
  3465. if(super.clickMode3 == 1 && aString844 != null)
  3466. {
  3467. aString844 = null;
  3468. inputTaken = true;
  3469. super.clickMode3 = 0;
  3470. }
  3471. processMenuClick();
  3472. processMainScreenClick();
  3473. processTabClick();
  3474. processChatModeClick();
  3475. if(super.clickMode2 == 1 || super.clickMode3 == 1)
  3476. anInt1213++;
  3477. if(anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0)
  3478. {
  3479. if(anInt1501 < 100)
  3480. {
  3481. anInt1501++;
  3482. if(anInt1501 == 100)
  3483. {
  3484. if(anInt1500 != 0)
  3485. {
  3486. inputTaken = true;
  3487. }
  3488. if(anInt1044 != 0)
  3489. {
  3490. needDrawTabArea = true;
  3491. }
  3492. }
  3493. }
  3494. } else if(anInt1501 > 0) {
  3495. anInt1501--;
  3496. }
  3497. if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  3498. if (anInt1501 < 100) {
  3499. anInt1501++;
  3500. if (anInt1501 == 100) {
  3501. if (anInt1500 != 0) {
  3502. inputTaken = true;
  3503. }
  3504. if (anInt1044 != 0) {
  3505. needDrawTabArea = true;
  3506. }
  3507. }
  3508. }
  3509. } else if (anInt1501 > 0) {
  3510. anInt1501--;
  3511. }
  3512. if(loadingStage == 2)
  3513. method108();
  3514. if(loadingStage == 2 && aBoolean1160)
  3515. calcCameraPos();
  3516. for(int i1 = 0; i1 < 5; i1++)
  3517. anIntArray1030[i1]++;
  3518.  
  3519. method73();
  3520. super.idleTime++;
  3521. if(super.idleTime > 4500)
  3522. {
  3523. anInt1011 = 250;
  3524. super.idleTime -= 500;
  3525. stream.createFrame(202);
  3526. }
  3527. anInt988++;
  3528. if(anInt988 > 500)
  3529. {
  3530. anInt988 = 0;
  3531. int l1 = (int)(Math.random() * 8D);
  3532. if((l1 & 1) == 1)
  3533. anInt1278 += anInt1279;
  3534. if((l1 & 2) == 2)
  3535. anInt1131 += anInt1132;
  3536. if((l1 & 4) == 4)
  3537. anInt896 += anInt897;
  3538. }
  3539. if(anInt1278 < -50)
  3540. anInt1279 = 2;
  3541. if(anInt1278 > 50)
  3542. anInt1279 = -2;
  3543. if(anInt1131 < -55)
  3544. anInt1132 = 2;
  3545. if(anInt1131 > 55)
  3546. anInt1132 = -2;
  3547. if(anInt896 < -40)
  3548. anInt897 = 1;
  3549. if(anInt896 > 40)
  3550. anInt897 = -1;
  3551. anInt1254++;
  3552. if(anInt1254 > 500)
  3553. {
  3554. anInt1254 = 0;
  3555. int i2 = (int)(Math.random() * 8D);
  3556. if((i2 & 1) == 1)
  3557. minimapInt2 += anInt1210;
  3558. if((i2 & 2) == 2)
  3559. minimapInt3 += anInt1171;
  3560. }
  3561. if(minimapInt2 < -60)
  3562. anInt1210 = 2;
  3563. if(minimapInt2 > 60)
  3564. anInt1210 = -2;
  3565. if(minimapInt3 < -20)
  3566. anInt1171 = 1;
  3567. if(minimapInt3 > 10)
  3568. anInt1171 = -1;
  3569. anInt1010++;
  3570. if(anInt1010 > 50)
  3571. stream.createFrame(0);
  3572. try
  3573. {
  3574. if(socketStream != null && stream.currentOffset > 0)
  3575. {
  3576. socketStream.queueBytes(stream.currentOffset, stream.buffer);
  3577. stream.currentOffset = 0;
  3578. anInt1010 = 0;
  3579. }
  3580. }
  3581. catch(IOException _ex)
  3582. {
  3583. dropClient();
  3584. }
  3585. catch(Exception exception)
  3586. {
  3587. resetLogout();
  3588. }
  3589. }
  3590.  
  3591. public void method63()
  3592. {
  3593. Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst();
  3594. for(; class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  3595. if(class30_sub1.anInt1294 == -1)
  3596. {
  3597. class30_sub1.anInt1302 = 0;
  3598. method89(class30_sub1);
  3599. } else
  3600. {
  3601. class30_sub1.unlink();
  3602. }
  3603.  
  3604. }
  3605.  
  3606. public void resetImageProducers()
  3607. {
  3608. if(aRSImageProducer_1107 != null)
  3609. return;
  3610. super.fullGameScreen = null;
  3611. aRSImageProducer_1166 = null;
  3612. aRSImageProducer_1164 = null;
  3613. aRSImageProducer_1163 = null;
  3614. aRSImageProducer_1165 = null;
  3615. aRSImageProducer_1123 = null;
  3616. aRSImageProducer_1124 = null;
  3617. aRSImageProducer_1125 = null;
  3618. aRSImageProducer_1110 = new RSImageProducer(128, 265, getGameComponent());
  3619. DrawingArea.setAllPixelsToZero();
  3620. aRSImageProducer_1111 = new RSImageProducer(128, 265, getGameComponent());
  3621. DrawingArea.setAllPixelsToZero();
  3622. aRSImageProducer_1107 = new RSImageProducer(509, 171, getGameComponent());
  3623. DrawingArea.setAllPixelsToZero();
  3624. aRSImageProducer_1108 = new RSImageProducer(360, 132, getGameComponent());
  3625. DrawingArea.setAllPixelsToZero();
  3626. aRSImageProducer_1109 = new RSImageProducer(360, 200, getGameComponent());
  3627. DrawingArea.setAllPixelsToZero();
  3628. aRSImageProducer_1112 = new RSImageProducer(202, 238, getGameComponent());
  3629. DrawingArea.setAllPixelsToZero();
  3630. aRSImageProducer_1113 = new RSImageProducer(203, 238, getGameComponent());
  3631. DrawingArea.setAllPixelsToZero();
  3632. aRSImageProducer_1114 = new RSImageProducer(74, 94, getGameComponent());
  3633. DrawingArea.setAllPixelsToZero();
  3634. aRSImageProducer_1115 = new RSImageProducer(75, 94, getGameComponent());
  3635. DrawingArea.setAllPixelsToZero();
  3636. if(titleStreamLoader != null)
  3637. {
  3638. drawLogo();
  3639. loadTitleScreen();
  3640. }
  3641. welcomeScreenRaised = true;
  3642. }
  3643.  
  3644. /*void drawLoadingText(int i, String s)
  3645. {
  3646. anInt1079 = i;
  3647. aString1049 = s;
  3648. resetImageProducers();
  3649. if(titleStreamLoader == null)
  3650. {
  3651. super.drawLoadingText(i, s);
  3652. return;
  3653. }
  3654. aRSImageProducer_1109.initDrawingArea();
  3655. char c = '\u0168';
  3656. char c1 = '\310';
  3657. byte byte1 = 20;
  3658. boldText.drawText(0xffffff, "Falador is loading - please wait...", c1 / 2 - 26 - byte1, c / 2);
  3659. int j = c1 / 2 - 18 - byte1;
  3660. DrawingArea.fillPixels(c / 2 - 152, 304, 34, 0x8c1111, j);
  3661. DrawingArea.fillPixels(c / 2 - 151, 302, 32, 0, j + 1);
  3662. DrawingArea.drawPixels(30, j + 2, c / 2 - 150, 0x8c1111, i * 3);
  3663. DrawingArea.drawPixels(30, j + 2, (c / 2 - 150) + i * 3, 0, 300 - i * 3);
  3664. boldText.drawText(0xffffff, s, (c1 / 2 + 5) - byte1, c / 2);
  3665. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  3666. if(welcomeScreenRaised)
  3667. {
  3668. welcomeScreenRaised = false;
  3669. if(!aBoolean831)
  3670. {
  3671. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  3672. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  3673. }
  3674. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  3675. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  3676. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  3677. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  3678. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  3679. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  3680. }
  3681. }*/
  3682. void drawLoadingText(int i, String s)
  3683. {
  3684. anInt1079 = i;
  3685. aString1049 = s;
  3686. resetImageProducers();
  3687. if(titleStreamLoader == null)
  3688. {
  3689. super.drawLoadingText(i, s);
  3690. return;
  3691. }
  3692. aRSImageProducer_1109.initDrawingArea();
  3693. char c = '\u0168';
  3694. char c1 = '\310';
  3695. byte byte1 = 20;
  3696. boldText.drawText(0xffffff, "Hidden Mirage is loading - please wait...", c1 / 2 - 26 - byte1, c / 2);
  3697. int j = c1 / 2 - 18 - byte1;
  3698. DrawingArea.fillPixels(c / 2 - 152, 304, 34, 0x8c1111, j);
  3699. DrawingArea.fillPixels(c / 2 - 151, 302, 32, 0, j + 1);
  3700. DrawingArea.drawPixels(30, j + 2, c / 2 - 150, 0x8c1111, i * 3);
  3701. DrawingArea.drawPixels(30, j + 2, (c / 2 - 150) + i * 3, 0, 300 - i * 3);
  3702. boldText.drawText(0xffffff, s, (c1 / 2 + 5) - byte1, c / 2);
  3703. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  3704. if(welcomeScreenRaised)
  3705. {
  3706. welcomeScreenRaised = false;
  3707. if(!aBoolean831)
  3708. {
  3709. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  3710. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  3711. }
  3712. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  3713. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  3714. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  3715. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  3716. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  3717. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  3718. }
  3719. }
  3720.  
  3721. public void method65(int i, int j, int k, int l, RSInterface class9, int i1, boolean flag,
  3722. int j1)
  3723. {
  3724. int anInt992;
  3725. if(aBoolean972)
  3726. anInt992 = 32;
  3727. else
  3728. anInt992 = 0;
  3729. aBoolean972 = false;
  3730. if(k >= i && k < i + 16 && l >= i1 && l < i1 + 16)
  3731. {
  3732. class9.scrollPosition -= anInt1213 * 4;
  3733. if(flag)
  3734. {
  3735. needDrawTabArea = true;
  3736. }
  3737. } else
  3738. if(k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j)
  3739. {
  3740. class9.scrollPosition += anInt1213 * 4;
  3741. if(flag)
  3742. {
  3743. needDrawTabArea = true;
  3744. }
  3745. } else
  3746. if(k >= i - anInt992 && k < i + 16 + anInt992 && l >= i1 + 16 && l < (i1 + j) - 16 && anInt1213 > 0)
  3747. {
  3748. int l1 = ((j - 32) * j) / j1;
  3749. if(l1 < 8)
  3750. l1 = 8;
  3751. int i2 = l - i1 - 16 - l1 / 2;
  3752. int j2 = j - 32 - l1;
  3753. class9.scrollPosition = ((j1 - j) * i2) / j2;
  3754. if(flag)
  3755. needDrawTabArea = true;
  3756. aBoolean972 = true;
  3757. }
  3758. }
  3759.  
  3760. private boolean method66(int i, int j, int k)
  3761. {
  3762. int i1 = i >> 14 & 0x7fff;
  3763. int j1 = worldController.method304(plane, k, j, i);
  3764. if(j1 == -1)
  3765. return false;
  3766. int k1 = j1 & 0x1f;
  3767. int l1 = j1 >> 6 & 3;
  3768. if(k1 == 10 || k1 == 11 || k1 == 22)
  3769. {
  3770. ObjectDef class46 = ObjectDef.forID(i1);
  3771. int i2;
  3772. int j2;
  3773. if(l1 == 0 || l1 == 2)
  3774. {
  3775. i2 = class46.anInt744;
  3776. j2 = class46.anInt761;
  3777. } else
  3778. {
  3779. i2 = class46.anInt761;
  3780. j2 = class46.anInt744;
  3781. }
  3782. int k2 = class46.anInt768;
  3783. if(l1 != 0)
  3784. k2 = (k2 << l1 & 0xf) + (k2 >> 4 - l1);
  3785. doWalkTo(2, 0, j2, 0, myPlayer.smallY[0], i2, k2, j, myPlayer.smallX[0], false, k);
  3786. } else
  3787. {
  3788. doWalkTo(2, l1, 0, k1 + 1, myPlayer.smallY[0], 0, 0, j, myPlayer.smallX[0], false, k);
  3789. }
  3790. crossX = super.saveClickX;
  3791. crossY = super.saveClickY;
  3792. crossType = 2;
  3793. crossIndex = 0;
  3794. return true;
  3795. }
  3796.  
  3797. private StreamLoader streamLoaderForName(int i, String s, String s1, int j,
  3798. int k) {
  3799. byte abyte0[] = null;
  3800. int l = 5;
  3801. try {
  3802. if (decompressors[0] != null)
  3803. abyte0 = decompressors[0].decompress(i);
  3804. } catch (Exception _ex) {
  3805. }
  3806. if (abyte0 != null) {
  3807. // aCRC32_930.reset();
  3808. // aCRC32_930.update(abyte0);
  3809. // int i1 = (int)aCRC32_930.getValue();
  3810. // if(i1 != j)
  3811. }
  3812. if (abyte0 != null) {
  3813. StreamLoader streamLoader = new StreamLoader(abyte0, s);
  3814. return streamLoader;
  3815. }
  3816. int j1 = 0;
  3817. while (abyte0 == null) {
  3818. String s2 = "Unknown error";
  3819. drawLoadingText(k, "Requesting " + s);
  3820. Object obj = null;
  3821. try {
  3822. int k1 = 0;
  3823. DataInputStream datainputstream = openJagGrabInputStream(s1 + j);
  3824. byte abyte1[] = new byte[6];
  3825. datainputstream.readFully(abyte1, 0, 6);
  3826. Stream stream = new Stream(abyte1);
  3827. stream.currentOffset = 3;
  3828. int i2 = stream.read3Bytes() + 6;
  3829. int j2 = 6;
  3830. abyte0 = new byte[i2];
  3831. System.arraycopy(abyte1, 0, abyte0, 0, 6);
  3832.  
  3833. while (j2 < i2) {
  3834. int l2 = i2 - j2;
  3835. if (l2 > 1000)
  3836. l2 = 1000;
  3837. int j3 = datainputstream.read(abyte0, j2, l2);
  3838. if (j3 < 0) {
  3839. s2 = "Length error: " + j2 + "/" + i2;
  3840. throw new IOException("EOF");
  3841. }
  3842. j2 += j3;
  3843. int k3 = (j2 * 100) / i2;
  3844. if (k3 != k1)
  3845. drawLoadingText(k, "Loading " + s + " - " + k3 + "%");
  3846. k1 = k3;
  3847. }
  3848. datainputstream.close();
  3849. try {
  3850. if (decompressors[0] != null)
  3851. decompressors[0].method234(abyte0.length, abyte0, i);
  3852. } catch (Exception _ex) {
  3853. decompressors[0] = null;
  3854. }
  3855. /*
  3856. * if(abyte0 != null) { aCRC32_930.reset();
  3857. * aCRC32_930.update(abyte0); int i3 =
  3858. * (int)aCRC32_930.getValue(); if(i3 != j) { abyte0 = null;
  3859. * j1++; s2 = "Checksum error: " + i3; } }
  3860. */
  3861. } catch (IOException ioexception) {
  3862. if (s2.equals("Unknown error"))
  3863. s2 = "Connection error";
  3864. abyte0 = null;
  3865. } catch (NullPointerException _ex) {
  3866. s2 = "Null error";
  3867. abyte0 = null;
  3868. if (!signlink.reporterror)
  3869. return null;
  3870. } catch (ArrayIndexOutOfBoundsException _ex) {
  3871. s2 = "Bounds error";
  3872. abyte0 = null;
  3873. if (!signlink.reporterror)
  3874. return null;
  3875. } catch (Exception _ex) {
  3876. s2 = "Unexpected error";
  3877. abyte0 = null;
  3878. if (!signlink.reporterror)
  3879. return null;
  3880. }
  3881. if (abyte0 == null) {
  3882. for (int l1 = l; l1 > 0; l1--) {
  3883. if (j1 >= 3) {
  3884. drawLoadingText(k, "Game updated - please reload page");
  3885. l1 = 10;
  3886. } else {
  3887. drawLoadingText(k, s2 + " - Retrying in " + l1);
  3888. }
  3889. try {
  3890. Thread.sleep(1000L);
  3891. } catch (Exception _ex) {
  3892. }
  3893. }
  3894.  
  3895. l *= 2;
  3896. if (l > 60)
  3897. l = 60;
  3898. aBoolean872 = !aBoolean872;
  3899. }
  3900.  
  3901. }
  3902.  
  3903. StreamLoader streamLoader_1 = new StreamLoader(abyte0, s);
  3904. return streamLoader_1;
  3905. }
  3906.  
  3907. public void dropClient()
  3908. {
  3909. if(anInt1011 > 0)
  3910. {
  3911. resetLogout();
  3912. return;
  3913. }
  3914. if (aRSImageProducer_1165 != null)
  3915. aRSImageProducer_1165.initDrawingArea();
  3916. DrawingArea.fillPixels(2, 229, 39, 0xffffff, 2);
  3917. DrawingArea.drawPixels(37, 3, 3, 0, 227);
  3918. regularText.drawText(0, "Connection Lost", 19, 120);
  3919. regularText.drawText(0xffffff, "Connection Lost", 18, 119);
  3920. regularText.drawText(0, "Please Wait - Reconnecting", 34, 117);
  3921. regularText.drawText(0xffffff, "Please Wait - Reconnecting", 34, 116);
  3922. if (aRSImageProducer_1165 != null)
  3923. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  3924. anInt1021 = 0;
  3925. destX = 0;
  3926. RSSocket rsSocket = socketStream;
  3927. loggedIn = false;
  3928. loginFailures = 0;
  3929. login(capitalize(myUsername), myPassword, true);
  3930. if(!loggedIn)
  3931. resetLogout();
  3932. try
  3933. {
  3934. rsSocket.close();
  3935. }
  3936. catch(Exception _ex)
  3937. {
  3938. }
  3939. }
  3940.  
  3941. public void doAction(int i)
  3942. {
  3943. if(i < 0)
  3944. return;
  3945. if(inputDialogState != 0)
  3946. {
  3947. inputDialogState = 0;
  3948. inputTaken = true;
  3949. }
  3950. int j = menuActionCmd2[i];
  3951. int k = menuActionCmd3[i];
  3952. int l = menuActionID[i];
  3953. int i1 = menuActionCmd1[i];
  3954. if(l >= 2000)
  3955. l -= 2000;
  3956. if(l == 582)
  3957. {
  3958. NPC npc = npcArray[i1];
  3959. if(npc != null)
  3960. {
  3961. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0], myPlayer.smallX[0], false, npc.smallX[0]);
  3962. crossX = super.saveClickX;
  3963. crossY = super.saveClickY;
  3964. crossType = 2;
  3965. crossIndex = 0;
  3966. stream.createFrame(57);
  3967. stream.method432(anInt1285);
  3968. stream.method432(i1);
  3969. stream.method431(anInt1283);
  3970. stream.method432(anInt1284);
  3971. }
  3972. }
  3973. if(l == 234)
  3974. {
  3975. boolean flag1 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  3976. if(!flag1)
  3977. flag1 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  3978. crossX = super.saveClickX;
  3979. crossY = super.saveClickY;
  3980. crossType = 2;
  3981. crossIndex = 0;
  3982. stream.createFrame(236);
  3983. stream.method431(k + baseY);
  3984. stream.writeWord(i1);
  3985. stream.method431(j + baseX);
  3986. }
  3987. if(l == 1505){
  3988. setSidebarInterface(7, 17011);
  3989. needDrawTabArea = true;
  3990. tabAreaAltered = true;
  3991. }
  3992. if(l == 62 && method66(i1, k, j))
  3993. {
  3994. stream.createFrame(192);
  3995. stream.writeWord(anInt1284);
  3996. stream.method431(i1 >> 14 & 0x7fff);
  3997. stream.method433(k + baseY);
  3998. stream.method431(anInt1283);
  3999. stream.method433(j + baseX);
  4000. stream.writeWord(anInt1285);
  4001. }
  4002. if(l == 511)
  4003. {
  4004. boolean flag2 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4005. if(!flag2)
  4006. flag2 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4007. crossX = super.saveClickX;
  4008. crossY = super.saveClickY;
  4009. crossType = 2;
  4010. crossIndex = 0;
  4011. stream.createFrame(25);
  4012. stream.method431(anInt1284);
  4013. stream.method432(anInt1285);
  4014. stream.writeWord(i1);
  4015. stream.method432(k + baseY);
  4016. stream.method433(anInt1283);
  4017. stream.writeWord(j + baseX);
  4018. }
  4019. if(l == 74)
  4020. {
  4021. stream.createFrame(122);
  4022. stream.method433(k);
  4023. stream.method432(j);
  4024. stream.method431(i1);
  4025. atInventoryLoopCycle = 0;
  4026. atInventoryInterface = k;
  4027. atInventoryIndex = j;
  4028. atInventoryInterfaceType = 2;
  4029. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4030. atInventoryInterfaceType = 1;
  4031. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4032. atInventoryInterfaceType = 3;
  4033. }
  4034. switch(l){
  4035. case 1050:
  4036. runState = 1;
  4037. if(!runClicked) {
  4038. runClicked = true;
  4039. musicOrb = false;
  4040. restOrb = false;
  4041. stream.createFrame(185);
  4042. stream.writeWord(153);
  4043. } else {
  4044. runClicked = false;
  4045. stream.createFrame(185);
  4046. stream.writeWord(152);
  4047. }
  4048. break;
  4049. case 1500:
  4050. if(!prayClicked){
  4051. prayClicked = true;
  4052. } else {
  4053. prayClicked = false;
  4054. }
  4055. break;
  4056. }
  4057. if(l == 315) {
  4058. RSInterface class9 = RSInterface.interfaceCache[k];
  4059. boolean flag8 = true;
  4060. if(class9.contentType > 0)
  4061. flag8 = promptUserForInput(class9);
  4062. if(flag8) {
  4063. switch(k) {
  4064. /* Client-sided button clicking */
  4065. case 1668:
  4066. sendFrame248(17500, 3213);
  4067. break;
  4068. case 21341:
  4069. sendFrame248(21172, 3213);
  4070. break;
  4071. case 21299:
  4072. sendFrame248(-1, -1);
  4073. break;
  4074. default:
  4075. stream.createFrame(185);
  4076. stream.writeWord(k);
  4077. break;
  4078. }
  4079. }
  4080. }
  4081. if(l == 561)
  4082. {
  4083. Player player = playerArray[i1];
  4084. if(player != null)
  4085. {
  4086. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, player.smallY[0], myPlayer.smallX[0], false, player.smallX[0]);
  4087. crossX = super.saveClickX;
  4088. crossY = super.saveClickY;
  4089. crossType = 2;
  4090. crossIndex = 0;
  4091. anInt1188 += i1;
  4092. if(anInt1188 >= 90)
  4093. {
  4094. stream.createFrame(136);
  4095. anInt1188 = 0;
  4096. }
  4097. stream.createFrame(128);
  4098. stream.writeWord(i1);
  4099. }
  4100. }
  4101. if(l == 20)
  4102. {
  4103. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[i1];
  4104. if(class30_sub2_sub4_sub1_sub1_1 != null)
  4105. {
  4106. 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]);
  4107. crossX = super.saveClickX;
  4108. crossY = super.saveClickY;
  4109. crossType = 2;
  4110. crossIndex = 0;
  4111. stream.createFrame(155);
  4112. stream.method431(i1);
  4113. }
  4114. }
  4115. if(l == 779)
  4116. {
  4117. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[i1];
  4118. if(class30_sub2_sub4_sub1_sub2_1 != null)
  4119. {
  4120. 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]);
  4121. crossX = super.saveClickX;
  4122. crossY = super.saveClickY;
  4123. crossType = 2;
  4124. crossIndex = 0;
  4125. stream.createFrame(153);
  4126. stream.method431(i1);
  4127. }
  4128. }
  4129. if(l == 516)
  4130. if(!menuOpen)
  4131. worldController.method312(super.saveClickY - 4, super.saveClickX - 4);
  4132. else
  4133. worldController.method312(k - 4, j - 4);
  4134. if(l == 1062)
  4135. {
  4136. anInt924 += baseX;
  4137. if(anInt924 >= 113)
  4138. {
  4139. stream.createFrame(183);
  4140. stream.writeDWordBigEndian(0xe63271);
  4141. anInt924 = 0;
  4142. }
  4143. method66(i1, k, j);
  4144. stream.createFrame(228);
  4145. stream.method432(i1 >> 14 & 0x7fff);
  4146. stream.method432(k + baseY);
  4147. stream.writeWord(j + baseX);
  4148. }
  4149. if(l == 679 && !aBoolean1149)
  4150. {
  4151. stream.createFrame(40);
  4152. stream.writeWord(k);
  4153. aBoolean1149 = true;
  4154. }
  4155. if(l == 431)
  4156. {
  4157. stream.createFrame(129);
  4158. stream.method432(j);
  4159. stream.writeWord(k);
  4160. stream.method432(i1);
  4161. atInventoryLoopCycle = 0;
  4162. atInventoryInterface = k;
  4163. atInventoryIndex = j;
  4164. atInventoryInterfaceType = 2;
  4165. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4166. atInventoryInterfaceType = 1;
  4167. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4168. atInventoryInterfaceType = 3;
  4169. }
  4170. if(l == 337 || l == 42 || l == 792 || l == 322)
  4171. {
  4172. String s = menuActionName[i];
  4173. int k1 = s.indexOf("@whi@");
  4174. if(k1 != -1)
  4175. {
  4176. long l3 = TextClass.longForName(s.substring(k1 + 5).trim());
  4177. if(l == 337)
  4178. addFriend(l3);
  4179. if(l == 42)
  4180. addIgnore(l3);
  4181. if(l == 792)
  4182. delFriend(l3);
  4183. if(l == 322)
  4184. delIgnore(l3);
  4185. }
  4186. }
  4187. if(l == 53)
  4188. {
  4189. stream.createFrame(135);
  4190. stream.method431(j);
  4191. stream.method432(k);
  4192. stream.method431(i1);
  4193. atInventoryLoopCycle = 0;
  4194. atInventoryInterface = k;
  4195. atInventoryIndex = j;
  4196. atInventoryInterfaceType = 2;
  4197. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4198. atInventoryInterfaceType = 1;
  4199. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4200. atInventoryInterfaceType = 3;
  4201. }
  4202. if(l == 539)
  4203. {
  4204. stream.createFrame(16);
  4205. stream.method432(i1);
  4206. stream.method433(j);
  4207. stream.method433(k);
  4208. atInventoryLoopCycle = 0;
  4209. atInventoryInterface = k;
  4210. atInventoryIndex = j;
  4211. atInventoryInterfaceType = 2;
  4212. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4213. atInventoryInterfaceType = 1;
  4214. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4215. atInventoryInterfaceType = 3;
  4216. }
  4217. if(l == 484 || l == 6)
  4218. {
  4219. String s1 = menuActionName[i];
  4220. int l1 = s1.indexOf("@whi@");
  4221. if(l1 != -1)
  4222. {
  4223. s1 = s1.substring(l1 + 5).trim();
  4224. String s7 = TextClass.fixName(TextClass.nameForLong(TextClass.longForName(s1)));
  4225. boolean flag9 = false;
  4226. for(int j3 = 0; j3 < playerCount; j3++)
  4227. {
  4228. Player class30_sub2_sub4_sub1_sub2_7 = playerArray[playerIndices[j3]];
  4229. 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))
  4230. continue;
  4231. 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]);
  4232. if(l == 484)
  4233. {
  4234. stream.createFrame(139);
  4235. stream.method431(playerIndices[j3]);
  4236. }
  4237. if(l == 6)
  4238. {
  4239. anInt1188 += i1;
  4240. if(anInt1188 >= 90)
  4241. {
  4242. stream.createFrame(136);
  4243. anInt1188 = 0;
  4244. }
  4245. stream.createFrame(128);
  4246. stream.writeWord(playerIndices[j3]);
  4247. }
  4248. flag9 = true;
  4249. break;
  4250. }
  4251.  
  4252. if(!flag9)
  4253. pushMessage("Unable to find " + s7, 0, "");
  4254. }
  4255. }
  4256. if(l == 870)
  4257. {
  4258. stream.createFrame(53);
  4259. stream.writeWord(j);
  4260. stream.method432(anInt1283);
  4261. stream.method433(i1);
  4262. stream.writeWord(anInt1284);
  4263. stream.method431(anInt1285);
  4264. stream.writeWord(k);
  4265. atInventoryLoopCycle = 0;
  4266. atInventoryInterface = k;
  4267. atInventoryIndex = j;
  4268. atInventoryInterfaceType = 2;
  4269. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4270. atInventoryInterfaceType = 1;
  4271. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4272. atInventoryInterfaceType = 3;
  4273. }
  4274. if(l == 847)
  4275. {
  4276. stream.createFrame(87);
  4277. stream.method432(i1);
  4278. stream.writeWord(k);
  4279. stream.method432(j);
  4280. atInventoryLoopCycle = 0;
  4281. atInventoryInterface = k;
  4282. atInventoryIndex = j;
  4283. atInventoryInterfaceType = 2;
  4284. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4285. atInventoryInterfaceType = 1;
  4286. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4287. atInventoryInterfaceType = 3;
  4288. }
  4289. if(l == 626)
  4290. {
  4291. RSInterface class9_1 = RSInterface.interfaceCache[k];
  4292. spellSelected = 1;
  4293. anInt1137 = k;
  4294. spellUsableOn = class9_1.spellUsableOn;
  4295. itemSelected = 0;
  4296. needDrawTabArea = true;
  4297. String s4 = class9_1.selectedActionName;
  4298. if(s4.indexOf(" ") != -1)
  4299. s4 = s4.substring(0, s4.indexOf(" "));
  4300. String s8 = class9_1.selectedActionName;
  4301. if(s8.indexOf(" ") != -1)
  4302. s8 = s8.substring(s8.indexOf(" ") + 1);
  4303. spellTooltip = s4 + " " + class9_1.spellName + " " + s8;
  4304. if(spellUsableOn == 16)
  4305. {
  4306. needDrawTabArea = true;
  4307. tabID = 3;
  4308. tabAreaAltered = true;
  4309. }
  4310. return;
  4311. }
  4312. if(l == 78)
  4313. {
  4314. stream.createFrame(117);
  4315. stream.method433(k);
  4316. stream.method433(i1);
  4317. stream.method431(j);
  4318. atInventoryLoopCycle = 0;
  4319. atInventoryInterface = k;
  4320. atInventoryIndex = j;
  4321. atInventoryInterfaceType = 2;
  4322. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4323. atInventoryInterfaceType = 1;
  4324. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4325. atInventoryInterfaceType = 3;
  4326. }
  4327. if(l == 27)
  4328. {
  4329. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[i1];
  4330. if(class30_sub2_sub4_sub1_sub2_2 != null)
  4331. {
  4332. 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]);
  4333. crossX = super.saveClickX;
  4334. crossY = super.saveClickY;
  4335. crossType = 2;
  4336. crossIndex = 0;
  4337. anInt986 += i1;
  4338. if(anInt986 >= 54)
  4339. {
  4340. stream.createFrame(189);
  4341. stream.writeWordBigEndian(234);
  4342. anInt986 = 0;
  4343. }
  4344. stream.createFrame(73);
  4345. stream.method431(i1);
  4346. }
  4347. }
  4348. if(l == 213)
  4349. {
  4350. boolean flag3 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4351. if(!flag3)
  4352. flag3 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4353. crossX = super.saveClickX;
  4354. crossY = super.saveClickY;
  4355. crossType = 2;
  4356. crossIndex = 0;
  4357. stream.createFrame(79);
  4358. stream.method431(k + baseY);
  4359. stream.writeWord(i1);
  4360. stream.method432(j + baseX);
  4361. }
  4362. if(l == 632)
  4363. {
  4364. stream.createFrame(145);
  4365. stream.method432(k);
  4366. stream.method432(j);
  4367. stream.method432(i1);
  4368. atInventoryLoopCycle = 0;
  4369. atInventoryInterface = k;
  4370. atInventoryIndex = j;
  4371. atInventoryInterfaceType = 2;
  4372. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4373. atInventoryInterfaceType = 1;
  4374. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4375. atInventoryInterfaceType = 3;
  4376. }
  4377. if (l == 1051) {
  4378. if(!runClicked){
  4379. runClicked = true;
  4380. stream.createFrame(185);
  4381. stream.writeWord(153);
  4382. } else {
  4383. runClicked = false;
  4384. stream.createFrame(185);
  4385. stream.writeWord(152);
  4386. }
  4387. }
  4388. if(l == 1004) {
  4389. needDrawTabArea = true;
  4390. tabID = 12;
  4391. tabAreaAltered = true;
  4392. }
  4393. if(l == 1005) {
  4394. //World map action
  4395. pushMessage("The world map feature is currently disabled.", 0, "");
  4396. }
  4397. if(l == 1003) {
  4398. clanChatMode = 2;
  4399. aBoolean1233 = true;
  4400. inputTaken = true;
  4401. }
  4402. if(l == 1002) {
  4403. clanChatMode = 1;
  4404. aBoolean1233 = true;
  4405. inputTaken = true;
  4406. }
  4407. if(l == 1001) {
  4408. clanChatMode = 0;
  4409. aBoolean1233 = true;
  4410. inputTaken = true;
  4411. }
  4412. if(l == 1000) {
  4413. cButtonCPos = 4;
  4414. chatTypeView = 11;
  4415. aBoolean1233 = true;
  4416. inputTaken = true;
  4417. }
  4418. if(l == 999) {
  4419. cButtonCPos = 0;
  4420. chatTypeView = 0;
  4421. aBoolean1233 = true;
  4422. inputTaken = true;
  4423. }
  4424. if(l == 998) {
  4425. cButtonCPos = 1;
  4426. chatTypeView = 5;
  4427. aBoolean1233 = true;
  4428. inputTaken = true;
  4429. }
  4430. if(l == 997) {
  4431. publicChatMode = 3;
  4432. aBoolean1233 = true;
  4433. inputTaken = true;
  4434. }
  4435. if(l == 996) {
  4436. publicChatMode = 2;
  4437. aBoolean1233 = true;
  4438. inputTaken = true;
  4439. }
  4440. if(l == 995) {
  4441. publicChatMode = 1;
  4442. aBoolean1233 = true;
  4443. inputTaken = true;
  4444. }
  4445. if(l == 994) {
  4446. publicChatMode = 0;
  4447. aBoolean1233 = true;
  4448. inputTaken = true;
  4449. }
  4450. if(l == 993) {
  4451. cButtonCPos = 2;
  4452. chatTypeView = 1;
  4453. aBoolean1233 = true;
  4454. inputTaken = true;
  4455. }
  4456. if(l == 992) {
  4457. privateChatMode = 2;
  4458. aBoolean1233 = true;
  4459. inputTaken = true;
  4460. }
  4461. if(l == 991) {
  4462. privateChatMode = 1;
  4463. aBoolean1233 = true;
  4464. inputTaken = true;
  4465. }
  4466. if(l == 990) {
  4467. privateChatMode = 0;
  4468. aBoolean1233 = true;
  4469. inputTaken = true;
  4470. }
  4471. if(l == 989) {
  4472. cButtonCPos = 3;
  4473. chatTypeView = 2;
  4474. aBoolean1233 = true;
  4475. inputTaken = true;
  4476. }
  4477. if(l == 987) {
  4478. tradeMode = 2;
  4479. aBoolean1233 = true;
  4480. inputTaken = true;
  4481. }
  4482. if(l == 986) {
  4483. tradeMode = 1;
  4484. aBoolean1233 = true;
  4485. inputTaken = true;
  4486. }
  4487. if(l == 985) {
  4488. tradeMode = 0;
  4489. aBoolean1233 = true;
  4490. inputTaken = true;
  4491. }
  4492. if(l == 984) {
  4493. cButtonCPos = 5;
  4494. chatTypeView = 3;
  4495. aBoolean1233 = true;
  4496. inputTaken = true;
  4497. }
  4498. if(l == 983) {
  4499. duelMode = 2;
  4500. aBoolean1233 = true;
  4501. inputTaken = true;
  4502. }
  4503. if(l == 982) {
  4504. duelMode = 1;
  4505. aBoolean1233 = true;
  4506. inputTaken = true;
  4507. }
  4508. if(l == 981) {
  4509. duelMode = 0;
  4510. aBoolean1233 = true;
  4511. inputTaken = true;
  4512. }
  4513. if(l == 980) {
  4514. cButtonCPos = 6;
  4515. chatTypeView = 4;
  4516. aBoolean1233 = true;
  4517. inputTaken = true;
  4518. }
  4519. //}
  4520. if(l == 493)
  4521. {
  4522. stream.createFrame(75);
  4523. stream.method433(k);
  4524. stream.method431(j);
  4525. stream.method432(i1);
  4526. atInventoryLoopCycle = 0;
  4527. atInventoryInterface = k;
  4528. atInventoryIndex = j;
  4529. atInventoryInterfaceType = 2;
  4530. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4531. atInventoryInterfaceType = 1;
  4532. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4533. atInventoryInterfaceType = 3;
  4534. }
  4535. if(l == 652)
  4536. {
  4537. boolean flag4 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4538. if(!flag4)
  4539. flag4 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4540. crossX = super.saveClickX;
  4541. crossY = super.saveClickY;
  4542. crossType = 2;
  4543. crossIndex = 0;
  4544. stream.createFrame(156);
  4545. stream.method432(j + baseX);
  4546. stream.method431(k + baseY);
  4547. stream.method433(i1);
  4548. }
  4549. if(l == 94)
  4550. {
  4551. boolean flag5 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4552. if(!flag5)
  4553. flag5 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4554. crossX = super.saveClickX;
  4555. crossY = super.saveClickY;
  4556. crossType = 2;
  4557. crossIndex = 0;
  4558. stream.createFrame(181);
  4559. stream.method431(k + baseY);
  4560. stream.writeWord(i1);
  4561. stream.method431(j + baseX);
  4562. stream.method432(anInt1137);
  4563. }
  4564. if(l == 646)
  4565. {
  4566. stream.createFrame(185);
  4567. stream.writeWord(k);
  4568. RSInterface class9_2 = RSInterface.interfaceCache[k];
  4569. if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5)
  4570. {
  4571. int i2 = class9_2.valueIndexArray[0][1];
  4572. if(variousSettings[i2] != class9_2.anIntArray212[0])
  4573. {
  4574. variousSettings[i2] = class9_2.anIntArray212[0];
  4575. method33(i2);
  4576. needDrawTabArea = true;
  4577. }
  4578. }
  4579. }
  4580. if(l == 225)
  4581. {
  4582. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[i1];
  4583. if(class30_sub2_sub4_sub1_sub1_2 != null)
  4584. {
  4585. 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]);
  4586. crossX = super.saveClickX;
  4587. crossY = super.saveClickY;
  4588. crossType = 2;
  4589. crossIndex = 0;
  4590. anInt1226 += i1;
  4591. if(anInt1226 >= 85)
  4592. {
  4593. stream.createFrame(230);
  4594. stream.writeWordBigEndian(239);
  4595. anInt1226 = 0;
  4596. }
  4597. stream.createFrame(17);
  4598. stream.method433(i1);
  4599. }
  4600. }
  4601. if(l == 965)
  4602. {
  4603. NPC class30_sub2_sub4_sub1_sub1_3 = npcArray[i1];
  4604. if(class30_sub2_sub4_sub1_sub1_3 != null)
  4605. {
  4606. 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]);
  4607. crossX = super.saveClickX;
  4608. crossY = super.saveClickY;
  4609. crossType = 2;
  4610. crossIndex = 0;
  4611. anInt1134++;
  4612. if(anInt1134 >= 96)
  4613. {
  4614. stream.createFrame(152);
  4615. stream.writeWordBigEndian(88);
  4616. anInt1134 = 0;
  4617. }
  4618. stream.createFrame(21);
  4619. stream.writeWord(i1);
  4620. }
  4621. }
  4622. if(l == 413)
  4623. {
  4624. NPC class30_sub2_sub4_sub1_sub1_4 = npcArray[i1];
  4625. if(class30_sub2_sub4_sub1_sub1_4 != null)
  4626. {
  4627. 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]);
  4628. crossX = super.saveClickX;
  4629. crossY = super.saveClickY;
  4630. crossType = 2;
  4631. crossIndex = 0;
  4632. stream.createFrame(131);
  4633. stream.method433(i1);
  4634. stream.method432(anInt1137);
  4635. }
  4636. }
  4637. if(l == 200)
  4638. clearTopInterfaces();
  4639. if(l == 1025)
  4640. {
  4641. NPC class30_sub2_sub4_sub1_sub1_5 = npcArray[i1];
  4642. if(class30_sub2_sub4_sub1_sub1_5 != null)
  4643. {
  4644. EntityDef entityDef = class30_sub2_sub4_sub1_sub1_5.desc;
  4645. if(entityDef.childrenIDs != null)
  4646. entityDef = entityDef.method161();
  4647. if(entityDef != null)
  4648. {
  4649. String s9;
  4650. if(entityDef.description != null)
  4651. s9 = new String(entityDef.description);
  4652. else
  4653. s9 = "It's a " + entityDef.name + ".";
  4654. pushMessage(s9, 0, "");
  4655. }
  4656. }
  4657. }
  4658. if(l == 900)
  4659. {
  4660. method66(i1, k, j);
  4661. stream.createFrame(252);
  4662. stream.method433(i1 >> 14 & 0x7fff);
  4663. stream.method431(k + baseY);
  4664. stream.method432(j + baseX);
  4665. }
  4666. if(l == 412)
  4667. {
  4668. NPC class30_sub2_sub4_sub1_sub1_6 = npcArray[i1];
  4669. if(class30_sub2_sub4_sub1_sub1_6 != null)
  4670. {
  4671. 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]);
  4672. crossX = super.saveClickX;
  4673. crossY = super.saveClickY;
  4674. crossType = 2;
  4675. crossIndex = 0;
  4676. stream.createFrame(72);
  4677. stream.method432(i1);
  4678. }
  4679. }
  4680. if(l == 365)
  4681. {
  4682. Player class30_sub2_sub4_sub1_sub2_3 = playerArray[i1];
  4683. if(class30_sub2_sub4_sub1_sub2_3 != null)
  4684. {
  4685. 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]);
  4686. crossX = super.saveClickX;
  4687. crossY = super.saveClickY;
  4688. crossType = 2;
  4689. crossIndex = 0;
  4690. stream.createFrame(249);
  4691. stream.method432(i1);
  4692. stream.method431(anInt1137);
  4693. }
  4694. }
  4695. if (l == 729)
  4696. {
  4697. Player class30_sub2_sub4_sub1_sub2_4 = playerArray[i1];
  4698. if(class30_sub2_sub4_sub1_sub2_4 != null)
  4699. {
  4700. 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]);
  4701. crossX = super.saveClickX;
  4702. crossY = super.saveClickY;
  4703. crossType = 2;
  4704. crossIndex = 0;
  4705. stream.createFrame(39);
  4706. stream.method431(i1);
  4707. //System.out.println("Packet(39): Challenge Player: " + class30_sub2_sub4_sub1_sub2_4.name + "(" + i1 + ")");
  4708. }
  4709. }
  4710. if(l == 577)
  4711. {
  4712. Player class30_sub2_sub4_sub1_sub2_5 = playerArray[i1];
  4713. if(class30_sub2_sub4_sub1_sub2_5 != null)
  4714. {
  4715. 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]);
  4716. crossX = super.saveClickX;
  4717. crossY = super.saveClickY;
  4718. crossType = 2;
  4719. crossIndex = 0;
  4720. stream.createFrame(139);
  4721. stream.method431(i1);
  4722. }
  4723. }
  4724. if(l == 956 && method66(i1, k, j))
  4725. {
  4726. stream.createFrame(35);
  4727. stream.method431(j + baseX);
  4728. stream.method432(anInt1137);
  4729. stream.method432(k + baseY);
  4730. stream.method431(i1 >> 14 & 0x7fff);
  4731. }
  4732. if(l == 567)
  4733. {
  4734. boolean flag6 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4735. if(!flag6)
  4736. flag6 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4737. crossX = super.saveClickX;
  4738. crossY = super.saveClickY;
  4739. crossType = 2;
  4740. crossIndex = 0;
  4741. stream.createFrame(23);
  4742. stream.method431(k + baseY);
  4743. stream.method431(i1);
  4744. stream.method431(j + baseX);
  4745. }
  4746. if(l == 867)
  4747. {
  4748. if((i1 & 3) == 0)
  4749. anInt1175++;
  4750. if(anInt1175 >= 59)
  4751. {
  4752. stream.createFrame(200);
  4753. stream.writeWord(25501);
  4754. anInt1175 = 0;
  4755. }
  4756. stream.createFrame(43);
  4757. stream.method431(k);
  4758. stream.method432(i1);
  4759. stream.method432(j);
  4760. atInventoryLoopCycle = 0;
  4761. atInventoryInterface = k;
  4762. atInventoryIndex = j;
  4763. atInventoryInterfaceType = 2;
  4764. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4765. atInventoryInterfaceType = 1;
  4766. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4767. atInventoryInterfaceType = 3;
  4768. }
  4769. if(l == 543)
  4770. {
  4771. stream.createFrame(237);
  4772. stream.writeWord(j);
  4773. stream.method432(i1);
  4774. stream.writeWord(k);
  4775. stream.method432(anInt1137);
  4776. atInventoryLoopCycle = 0;
  4777. atInventoryInterface = k;
  4778. atInventoryIndex = j;
  4779. atInventoryInterfaceType = 2;
  4780. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4781. atInventoryInterfaceType = 1;
  4782. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4783. atInventoryInterfaceType = 3;
  4784. }
  4785. if(l == 606)
  4786. {
  4787. String s2 = menuActionName[i];
  4788. int j2 = s2.indexOf("@whi@");
  4789. if(j2 != -1)
  4790. if(openInterfaceID == -1)
  4791. {
  4792. clearTopInterfaces();
  4793. reportAbuseInput = s2.substring(j2 + 5).trim();
  4794. canMute = false;
  4795. for(int i3 = 0; i3 < RSInterface.interfaceCache.length; i3++)
  4796. {
  4797. if(RSInterface.interfaceCache[i3] == null || RSInterface.interfaceCache[i3].contentType != 600)
  4798. continue;
  4799. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i3].parentID;
  4800. break;
  4801. }
  4802.  
  4803. } else
  4804. {
  4805. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  4806. }
  4807. }
  4808. if(l == 491)
  4809. {
  4810. Player class30_sub2_sub4_sub1_sub2_6 = playerArray[i1];
  4811. if(class30_sub2_sub4_sub1_sub2_6 != null)
  4812. {
  4813. 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]);
  4814. crossX = super.saveClickX;
  4815. crossY = super.saveClickY;
  4816. crossType = 2;
  4817. crossIndex = 0;
  4818. stream.createFrame(14);
  4819. //stream.method432(anInt1284);
  4820. stream.writeWord(i1);
  4821. //stream.writeWord(anInt1285);
  4822. stream.method431(anInt1283);
  4823. }
  4824. }
  4825. if(l == 639)
  4826. {
  4827. String s3 = menuActionName[i];
  4828. int k2 = s3.indexOf("@whi@");
  4829. if(k2 != -1)
  4830. {
  4831. long l4 = TextClass.longForName(s3.substring(k2 + 5).trim());
  4832. int k3 = -1;
  4833. for(int i4 = 0; i4 < friendsCount; i4++)
  4834. {
  4835. if(friendsListAsLongs[i4] != l4)
  4836. continue;
  4837. k3 = i4;
  4838. break;
  4839. }
  4840.  
  4841. if(k3 != -1 && friendsNodeIDs[k3] > 0)
  4842. {
  4843. inputTaken = true;
  4844. inputDialogState = 0;
  4845. messagePromptRaised = true;
  4846. promptInput = "";
  4847. friendsListAction = 3;
  4848. aLong953 = friendsListAsLongs[k3];
  4849. aString1121 = "Enter message to send to " + friendsList[k3];
  4850. }
  4851. }
  4852. }
  4853. if(l == 454)
  4854. {
  4855. stream.createFrame(41);
  4856. stream.writeWord(i1);
  4857. stream.method432(j);
  4858. stream.method432(k);
  4859. atInventoryLoopCycle = 0;
  4860. atInventoryInterface = k;
  4861. atInventoryIndex = j;
  4862. atInventoryInterfaceType = 2;
  4863. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4864. atInventoryInterfaceType = 1;
  4865. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4866. atInventoryInterfaceType = 3;
  4867. }
  4868. if(l == 478)
  4869. {
  4870. NPC class30_sub2_sub4_sub1_sub1_7 = npcArray[i1];
  4871. if(class30_sub2_sub4_sub1_sub1_7 != null)
  4872. {
  4873. 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]);
  4874. crossX = super.saveClickX;
  4875. crossY = super.saveClickY;
  4876. crossType = 2;
  4877. crossIndex = 0;
  4878. if((i1 & 3) == 0)
  4879. anInt1155++;
  4880. if(anInt1155 >= 53)
  4881. {
  4882. stream.createFrame(85);
  4883. stream.writeWordBigEndian(66);
  4884. anInt1155 = 0;
  4885. }
  4886. stream.createFrame(18);
  4887. stream.method431(i1);
  4888. }
  4889. }
  4890. if(l == 113)
  4891. {
  4892. method66(i1, k, j);
  4893. stream.createFrame(70);
  4894. stream.method431(j + baseX);
  4895. stream.writeWord(k + baseY);
  4896. stream.method433(i1 >> 14 & 0x7fff);
  4897. }
  4898. if(l == 872)
  4899. {
  4900. method66(i1, k, j);
  4901. stream.createFrame(234);
  4902. stream.method433(j + baseX);
  4903. stream.method432(i1 >> 14 & 0x7fff);
  4904. stream.method433(k + baseY);
  4905. }
  4906. if(l == 502)
  4907. {
  4908. method66(i1, k, j);
  4909. stream.createFrame(132);
  4910. stream.method433(j + baseX);
  4911. stream.writeWord(i1 >> 14 & 0x7fff);
  4912. stream.method432(k + baseY);
  4913. }
  4914. if(l == 1125)
  4915. {
  4916. ItemDef itemDef = ItemDef.forID(i1);
  4917. RSInterface class9_4 = RSInterface.interfaceCache[k];
  4918. String s5;
  4919. if(class9_4 != null && class9_4.invStackSizes[j] >= 0x186a0)
  4920. s5 = class9_4.invStackSizes[j] + " x " + itemDef.name;
  4921. else
  4922. if(itemDef.description != null)
  4923. s5 = new String(itemDef.description);
  4924. else
  4925. s5 = "You examine the " + itemDef.name;
  4926. pushMessage(s5, 0, "");
  4927. }
  4928. if(l == 169)
  4929. {
  4930. stream.createFrame(185);
  4931. stream.writeWord(k);
  4932. RSInterface class9_3 = RSInterface.interfaceCache[k];
  4933. if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5)
  4934. {
  4935. int l2 = class9_3.valueIndexArray[0][1];
  4936. variousSettings[l2] = 1 - variousSettings[l2];
  4937. method33(l2);
  4938. needDrawTabArea = true;
  4939. }
  4940. }
  4941. if(l == 447)
  4942. {
  4943. itemSelected = 1;
  4944. anInt1283 = j;
  4945. anInt1284 = k;
  4946. anInt1285 = i1;
  4947. selectedItemName = ItemDef.forID(i1).name;
  4948. spellSelected = 0;
  4949. needDrawTabArea = true;
  4950. return;
  4951. }
  4952. if(l == 1226)
  4953. {
  4954. int j1 = i1 >> 14 & 0x7fff;
  4955. ObjectDef class46 = ObjectDef.forID(j1);
  4956. String s10;
  4957. if(class46.description != null)
  4958. s10 = new String(class46.description);
  4959. else
  4960. s10 = "It's a " + class46.name + ".";
  4961. pushMessage(s10, 0, "");
  4962. }
  4963. if(l == 244)
  4964. {
  4965. boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4966. if(!flag7)
  4967. flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4968. crossX = super.saveClickX;
  4969. crossY = super.saveClickY;
  4970. crossType = 2;
  4971. crossIndex = 0;
  4972. stream.createFrame(253);
  4973. stream.method431(j + baseX);
  4974. stream.method433(k + baseY);
  4975. stream.method432(i1);
  4976. }
  4977. if(l == 1448)
  4978. {
  4979. ItemDef itemDef_1 = ItemDef.forID(i1);
  4980. String s6;
  4981. if(itemDef_1.description != null)
  4982. s6 = new String(itemDef_1.description);
  4983. else
  4984. s6 = "It's a " + itemDef_1.name + ".";
  4985. pushMessage(s6, 0, "");
  4986. }
  4987. itemSelected = 0;
  4988. spellSelected = 0;
  4989. needDrawTabArea = true;
  4990.  
  4991. }
  4992.  
  4993. public void method70()
  4994. {
  4995. anInt1251 = 0;
  4996. int j = (myPlayer.x >> 7) + baseX;
  4997. int k = (myPlayer.y >> 7) + baseY;
  4998. if(j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
  4999. anInt1251 = 1;
  5000. if(j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
  5001. anInt1251 = 1;
  5002. if(anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
  5003. anInt1251 = 0;
  5004. }
  5005.  
  5006. public void run() {
  5007. if(drawFlames) {
  5008. drawFlames();
  5009. } else {
  5010. super.run();
  5011. }
  5012. }
  5013.  
  5014. public void build3dScreenMenu()
  5015. {
  5016. if(itemSelected == 0 && spellSelected == 0)
  5017. {
  5018. menuActionName[menuActionRow] = "Walk here";
  5019. menuActionID[menuActionRow] = 516;
  5020. menuActionCmd2[menuActionRow] = super.mouseX;
  5021. menuActionCmd3[menuActionRow] = super.mouseY;
  5022. menuActionRow++;
  5023. }
  5024. int j = -1;
  5025. for(int k = 0; k < Model.anInt1687; k++)
  5026. {
  5027. int l = Model.anIntArray1688[k];
  5028. int i1 = l & 0x7f;
  5029. int j1 = l >> 7 & 0x7f;
  5030. int k1 = l >> 29 & 3;
  5031. int l1 = l >> 14 & 0x7fff;
  5032. if(l == j)
  5033. continue;
  5034. j = l;
  5035. if(k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0)
  5036. {
  5037. ObjectDef class46 = ObjectDef.forID(l1);
  5038. if(class46.childrenIDs != null)
  5039. class46 = class46.method580();
  5040. if(class46 == null)
  5041. continue;
  5042. if(itemSelected == 1)
  5043. {
  5044. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @cya@" + class46.name;
  5045. menuActionID[menuActionRow] = 62;
  5046. menuActionCmd1[menuActionRow] = l;
  5047. menuActionCmd2[menuActionRow] = i1;
  5048. menuActionCmd3[menuActionRow] = j1;
  5049. menuActionRow++;
  5050. } else
  5051. if(spellSelected == 1)
  5052. {
  5053. if((spellUsableOn & 4) == 4)
  5054. {
  5055. menuActionName[menuActionRow] = spellTooltip + " @cya@" + class46.name;
  5056. menuActionID[menuActionRow] = 956;
  5057. menuActionCmd1[menuActionRow] = l;
  5058. menuActionCmd2[menuActionRow] = i1;
  5059. menuActionCmd3[menuActionRow] = j1;
  5060. menuActionRow++;
  5061. }
  5062. } else
  5063. {
  5064. if(class46.actions != null)
  5065. {
  5066. for(int i2 = 4; i2 >= 0; i2--)
  5067. if(class46.actions[i2] != null)
  5068. {
  5069. menuActionName[menuActionRow] = class46.actions[i2] + " @cya@" + class46.name;
  5070. if(i2 == 0)
  5071. menuActionID[menuActionRow] = 502;
  5072. if(i2 == 1)
  5073. menuActionID[menuActionRow] = 900;
  5074. if(i2 == 2)
  5075. menuActionID[menuActionRow] = 113;
  5076. if(i2 == 3)
  5077. menuActionID[menuActionRow] = 872;
  5078. if(i2 == 4)
  5079. menuActionID[menuActionRow] = 1062;
  5080. menuActionCmd1[menuActionRow] = l;
  5081. menuActionCmd2[menuActionRow] = i1;
  5082. menuActionCmd3[menuActionRow] = j1;
  5083. menuActionRow++;
  5084. }
  5085.  
  5086. }
  5087. // menuActionName[menuActionRow] = "Examine @cya@" + class46.name + " @gre@(@whi@" + l1 + "@gre@) (@whi@" + (i1 + baseX) + "," + (j1 + baseY) + "@gre@)";
  5088. menuActionName[menuActionRow] = "Examine @cya@" + class46.name;
  5089.  
  5090. menuActionID[menuActionRow] = 1226;
  5091. menuActionCmd1[menuActionRow] = class46.type << 14;
  5092. menuActionCmd2[menuActionRow] = i1;
  5093. menuActionCmd3[menuActionRow] = j1;
  5094. menuActionRow++;
  5095. }
  5096. }
  5097. if(k1 == 1)
  5098. {
  5099. NPC npc = npcArray[l1];
  5100. if(npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  5101. {
  5102. for(int j2 = 0; j2 < npcCount; j2++)
  5103. {
  5104. NPC npc2 = npcArray[npcIndices[j2]];
  5105. if(npc2 != null && npc2 != npc && npc2.desc.aByte68 == 1 && npc2.x == npc.x && npc2.y == npc.y)
  5106. buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
  5107. }
  5108.  
  5109. for(int l2 = 0; l2 < playerCount; l2++)
  5110. {
  5111. Player player = playerArray[playerIndices[l2]];
  5112. if(player != null && player.x == npc.x && player.y == npc.y)
  5113. buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
  5114. }
  5115.  
  5116. }
  5117. buildAtNPCMenu(npc.desc, l1, j1, i1);
  5118. }
  5119. if(k1 == 0)
  5120. {
  5121. Player player = playerArray[l1];
  5122. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64)
  5123. {
  5124. for(int k2 = 0; k2 < npcCount; k2++)
  5125. {
  5126. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
  5127. 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)
  5128. buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc, npcIndices[k2], j1, i1);
  5129. }
  5130.  
  5131. for(int i3 = 0; i3 < playerCount; i3++)
  5132. {
  5133. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
  5134. 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)
  5135. buildAtPlayerMenu(i1, playerIndices[i3], class30_sub2_sub4_sub1_sub2_2, j1);
  5136. }
  5137.  
  5138. }
  5139. buildAtPlayerMenu(i1, l1, player, j1);
  5140. }
  5141. if(k1 == 3)
  5142. {
  5143. NodeList class19 = groundArray[plane][i1][j1];
  5144. if(class19 != null)
  5145. {
  5146. for(Item item = (Item)class19.getFirst(); item != null; item = (Item)class19.getNext())
  5147. {
  5148. ItemDef itemDef = ItemDef.forID(item.ID);
  5149. if(itemSelected == 1)
  5150. {
  5151. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  5152. menuActionID[menuActionRow] = 511;
  5153. menuActionCmd1[menuActionRow] = item.ID;
  5154. menuActionCmd2[menuActionRow] = i1;
  5155. menuActionCmd3[menuActionRow] = j1;
  5156. menuActionRow++;
  5157. } else
  5158. if(spellSelected == 1)
  5159. {
  5160. if((spellUsableOn & 1) == 1)
  5161. {
  5162. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  5163. menuActionID[menuActionRow] = 94;
  5164. menuActionCmd1[menuActionRow] = item.ID;
  5165. menuActionCmd2[menuActionRow] = i1;
  5166. menuActionCmd3[menuActionRow] = j1;
  5167. menuActionRow++;
  5168. }
  5169. } else
  5170. {
  5171. for(int j3 = 4; j3 >= 0; j3--)
  5172. if(itemDef.groundActions != null && itemDef.groundActions[j3] != null)
  5173. {
  5174. menuActionName[menuActionRow] = itemDef.groundActions[j3] + " @lre@" + itemDef.name;
  5175. if(j3 == 0)
  5176. menuActionID[menuActionRow] = 652;
  5177. if(j3 == 1)
  5178. menuActionID[menuActionRow] = 567;
  5179. if(j3 == 2)
  5180. menuActionID[menuActionRow] = 234;
  5181. if(j3 == 3)
  5182. menuActionID[menuActionRow] = 244;
  5183. if(j3 == 4)
  5184. menuActionID[menuActionRow] = 213;
  5185. menuActionCmd1[menuActionRow] = item.ID;
  5186. menuActionCmd2[menuActionRow] = i1;
  5187. menuActionCmd3[menuActionRow] = j1;
  5188. menuActionRow++;
  5189. } else
  5190. if(j3 == 2)
  5191. {
  5192. menuActionName[menuActionRow] = "Take @lre@" + itemDef.name;
  5193. menuActionID[menuActionRow] = 234;
  5194. menuActionCmd1[menuActionRow] = item.ID;
  5195. menuActionCmd2[menuActionRow] = i1;
  5196. menuActionCmd3[menuActionRow] = j1;
  5197. menuActionRow++;
  5198. }
  5199.  
  5200. //menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + item.ID + "@gre@)";
  5201. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  5202. menuActionID[menuActionRow] = 1448;
  5203. menuActionCmd1[menuActionRow] = item.ID;
  5204. menuActionCmd2[menuActionRow] = i1;
  5205. menuActionCmd3[menuActionRow] = j1;
  5206. menuActionRow++;
  5207. }
  5208. }
  5209.  
  5210. }
  5211. }
  5212. }
  5213. }
  5214.  
  5215. public void cleanUpForQuit()
  5216. {
  5217. mapArea = null;
  5218. signlink.reporterror = false;
  5219. try
  5220. {
  5221. if(socketStream != null)
  5222. socketStream.close();
  5223. }
  5224. catch(Exception _ex) { }
  5225. socketStream = null;
  5226. stopMidi();
  5227. if(mouseDetection != null)
  5228. mouseDetection.running = false;
  5229. mouseDetection = null;
  5230. onDemandFetcher.disable();
  5231. onDemandFetcher = null;
  5232. aStream_834 = null;
  5233. stream = null;
  5234. aStream_847 = null;
  5235. inStream = null;
  5236. anIntArray1234 = null;
  5237. aByteArrayArray1183 = null;
  5238. aByteArrayArray1247 = null;
  5239. anIntArray1235 = null;
  5240. anIntArray1236 = null;
  5241. intGroundArray = null;
  5242. byteGroundArray = null;
  5243. worldController = null;
  5244. aClass11Array1230 = null;
  5245. anIntArrayArray901 = null;
  5246. anIntArrayArray825 = null;
  5247. bigX = null;
  5248. bigY = null;
  5249. aByteArray912 = null;
  5250. aRSImageProducer_1163 = null;
  5251. mapEdgeIP = null;
  5252. leftFrame = null;
  5253. topFrame = null;
  5254. rightFrame = null;
  5255. aRSImageProducer_1164 = null;
  5256. aRSImageProducer_1165 = null;
  5257. aRSImageProducer_1166 = null;
  5258. aRSImageProducer_1123 = null;
  5259. aRSImageProducer_1124 = null;
  5260. aRSImageProducer_1125 = null;
  5261. /* Null pointers for custom sprites */
  5262. chatArea = null;
  5263. chatButtons = null;
  5264. tabArea = null;
  5265. mapArea = null;
  5266. emptyOrb = null;
  5267. titleBox = null;
  5268. titleButton = null;
  5269. musicLoginButton = null;
  5270. hitPointsFill = null;
  5271. hitPointsIcon = null;
  5272. prayerFill = null;
  5273. prayerIcon = null;
  5274. worldMapIcon = null;
  5275. worldMapIconH = null;
  5276. /**/
  5277. mapBack = null;
  5278. backBase1 = null;
  5279. sideIcons = null;
  5280. redStones = null;
  5281. compass = null;
  5282. hitMarks = null;
  5283. headIcons = null;
  5284. skullIcons = null;
  5285. headIconsHint = null;
  5286. crosses = null;
  5287. mapDotItem = null;
  5288. mapDotNPC = null;
  5289. mapDotPlayer = null;
  5290. mapDotFriend = null;
  5291. mapDotTeam = null;
  5292. mapScenes = null;
  5293. mapFunctions = null;
  5294. anIntArrayArray929 = null;
  5295. playerArray = null;
  5296. playerIndices = null;
  5297. anIntArray894 = null;
  5298. aStreamArray895s = null;
  5299. anIntArray840 = null;
  5300. npcArray = null;
  5301. npcIndices = null;
  5302. groundArray = null;
  5303. aClass19_1179 = null;
  5304. aClass19_1013 = null;
  5305. aClass19_1056 = null;
  5306. menuActionCmd2 = null;
  5307. menuActionCmd3 = null;
  5308. menuActionID = null;
  5309. menuActionCmd1 = null;
  5310. menuActionName = null;
  5311. variousSettings = null;
  5312. anIntArray1072 = null;
  5313. anIntArray1073 = null;
  5314. aClass30_Sub2_Sub1_Sub1Array1140 = null;
  5315. aClass30_Sub2_Sub1_Sub1_1263 = null;
  5316. friendsList = null;
  5317. friendsListAsLongs = null;
  5318. friendsNodeIDs = null;
  5319. aRSImageProducer_1110 = null;
  5320. aRSImageProducer_1111 = null;
  5321. aRSImageProducer_1107 = null;
  5322. aRSImageProducer_1108 = null;
  5323. aRSImageProducer_1109 = null;
  5324. aRSImageProducer_1112 = null;
  5325. aRSImageProducer_1113 = null;
  5326. aRSImageProducer_1114 = null;
  5327. aRSImageProducer_1115 = null;
  5328. multiOverlay = null;
  5329. nullLoader();
  5330. ObjectDef.nullLoader();
  5331. EntityDef.nullLoader();
  5332. ItemDef.nullLoader();
  5333. Flo.cache = null;
  5334. IDK.cache = null;
  5335. RSInterface.interfaceCache = null;
  5336. DummyClass.cache = null;
  5337. Animation.anims = null;
  5338. SpotAnim.cache = null;
  5339. SpotAnim.aMRUNodes_415 = null;
  5340. Varp.cache = null;
  5341. super.fullGameScreen = null;
  5342. Player.mruNodes = null;
  5343. Texture.nullLoader();
  5344. WorldController.nullLoader();
  5345. Model.nullLoader();
  5346. Class36.nullLoader();
  5347. System.gc();
  5348. }
  5349.  
  5350. public void printDebug()
  5351. {
  5352. System.out.println("============");
  5353. System.out.println("flame-cycle:" + anInt1208);
  5354. if(onDemandFetcher != null)
  5355. System.out.println("Od-cycle:" + onDemandFetcher.onDemandCycle);
  5356. System.out.println("loop-cycle:" + loopCycle);
  5357. System.out.println("draw-cycle:" + anInt1061);
  5358. System.out.println("ptype:" + pktType);
  5359. System.out.println("psize:" + pktSize);
  5360. if(socketStream != null)
  5361. socketStream.printDebug();
  5362. super.shouldDebug = true;
  5363. }
  5364.  
  5365. Component getGameComponent() {
  5366. if(signlink.mainapp != null)
  5367. return signlink.mainapp;
  5368. if(super.gameFrame != null)
  5369. return super.gameFrame;
  5370. else
  5371. return this;
  5372. }
  5373.  
  5374. public void method73() {
  5375. do {
  5376. int j = readChar(-796);
  5377. if(j == -1)
  5378. break;
  5379. if(j == 96)
  5380. break;
  5381. if(consoleOpen){
  5382. if(j == 8 && consoleInput.length() > 0)
  5383. consoleInput = consoleInput.substring(0, consoleInput.length() - 1);
  5384. if(j >= 32 && j <= 122 && consoleInput.length() < 80)
  5385. consoleInput += (char)j;
  5386.  
  5387. if((j == 13 || j == 10) && consoleInput.length() > 0) {
  5388. printConsoleMessage(consoleInput, 0);
  5389. sendCommandPacket(consoleInput);
  5390. consoleInput = "";
  5391. inputTaken = true;
  5392. }
  5393. }
  5394. else
  5395. if(openInterfaceID != -1 && openInterfaceID == reportAbuseInterfaceID) {
  5396. if(j == 8 && reportAbuseInput.length() > 0)
  5397. reportAbuseInput = reportAbuseInput.substring(0, reportAbuseInput.length() - 1);
  5398. if((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48 && j <= 57 || j == 32) && reportAbuseInput.length() < 12)
  5399. reportAbuseInput += (char)j;
  5400. } else if(messagePromptRaised) {
  5401. if(j >= 32 && j <= 122 && promptInput.length() < 80) {
  5402. promptInput += (char)j;
  5403. inputTaken = true;
  5404. }
  5405. if(j == 8 && promptInput.length() > 0) {
  5406. promptInput = promptInput.substring(0, promptInput.length() - 1);
  5407. inputTaken = true;
  5408. }
  5409. if(j == 13 || j == 10) {
  5410. messagePromptRaised = false;
  5411. inputTaken = true;
  5412. if(friendsListAction == 1) {
  5413. long l = TextClass.longForName(promptInput);
  5414. addFriend(l);
  5415. }
  5416. if(friendsListAction == 2 && friendsCount > 0) {
  5417. long l1 = TextClass.longForName(promptInput);
  5418. delFriend(l1);
  5419. }
  5420. if(friendsListAction == 3 && promptInput.length() > 0) {
  5421. stream.createFrame(126);
  5422. stream.writeWordBigEndian(0);
  5423. int k = stream.currentOffset;
  5424. stream.writeQWord(aLong953);
  5425. TextInput.method526(promptInput, stream);
  5426. stream.writeBytes(stream.currentOffset - k);
  5427. promptInput = TextInput.processText(promptInput);
  5428. promptInput = Censor.doCensor(promptInput);
  5429. pushMessage(promptInput, 6, TextClass.fixName(TextClass.nameForLong(aLong953)));
  5430. if(privateChatMode == 2) {
  5431. privateChatMode = 1;
  5432. aBoolean1233 = true;
  5433. stream.createFrame(95);
  5434. stream.writeWordBigEndian(publicChatMode);
  5435. stream.writeWordBigEndian(privateChatMode);
  5436. stream.writeWordBigEndian(tradeMode);
  5437. }
  5438. }
  5439. if(friendsListAction == 4 && ignoreCount < 100) {
  5440. long l2 = TextClass.longForName(promptInput);
  5441. addIgnore(l2);
  5442. }
  5443. if(friendsListAction == 5 && ignoreCount > 0) {
  5444. long l3 = TextClass.longForName(promptInput);
  5445. delIgnore(l3);
  5446. }
  5447. if(friendsListAction == 6) {
  5448. long l3 = TextClass.longForName(promptInput);
  5449. chatJoin(l3);
  5450. }
  5451. }
  5452. } else if(inputDialogState == 1) {
  5453. if(j >= 48 && j <= 57 && amountOrNameInput.length() < 10) {
  5454. amountOrNameInput += (char)j;
  5455. inputTaken = true;
  5456. }
  5457. if(j == 8 && amountOrNameInput.length() > 0) {
  5458. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5459. inputTaken = true;
  5460. }
  5461. if(j == 13 || j == 10) {
  5462. if(amountOrNameInput.length() > 0) {
  5463. int i1 = 0;
  5464. try {
  5465. i1 = Integer.parseInt(amountOrNameInput);
  5466. }
  5467. catch(Exception _ex) { }
  5468. stream.createFrame(208);
  5469. stream.writeDWord(i1);
  5470. }
  5471. inputDialogState = 0;
  5472. inputTaken = true;
  5473. }
  5474. } else if(inputDialogState == 2) {
  5475. if(j >= 32 && j <= 122 && amountOrNameInput.length() < 12) {
  5476. amountOrNameInput += (char)j;
  5477. inputTaken = true;
  5478. }
  5479. if(j == 8 && amountOrNameInput.length() > 0) {
  5480. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5481. inputTaken = true;
  5482. }
  5483. if(j == 13 || j == 10) {
  5484. if(amountOrNameInput.length() > 0) {
  5485. stream.createFrame(60);
  5486. stream.writeQWord(TextClass.longForName(amountOrNameInput));
  5487. }
  5488. inputDialogState = 0;
  5489. inputTaken = true;
  5490. }
  5491. } else if(backDialogID == -1) {
  5492. if(j >= 32 && j <= 122 && inputString.length() < 80) {
  5493. inputString += (char)j;
  5494. inputTaken = true;
  5495. }
  5496. if(j == 8 && inputString.length() > 0) {
  5497. inputString = inputString.substring(0, inputString.length() - 1);
  5498. inputTaken = true;
  5499. }
  5500. if((j == 13 || j == 10) && inputString.length() > 0) {
  5501. if(myPrivilege == 2) {
  5502. if(inputString.startsWith("//setspecto")) {
  5503. int amt = Integer.parseInt(inputString.substring(12));
  5504. anIntArray1045[300] = amt;
  5505. if(variousSettings[300] != amt) {
  5506. variousSettings[300] = amt;
  5507. method33(300);
  5508. needDrawTabArea = true;
  5509. if(dialogID != -1)
  5510. inputTaken = true;
  5511. }
  5512. }
  5513. if(inputString.equals("clientdrop"))
  5514. dropClient();
  5515. if (inputString.startsWith("full")) {
  5516. try {
  5517. String[] args = inputString.split(" ");
  5518. int id1 = Integer.parseInt(args[1]);
  5519. int id2 = Integer.parseInt(args[2]);
  5520. fullscreenInterfaceID = id1;
  5521. openInterfaceID = id2;
  5522. pushMessage("Opened Interface", 0, "");
  5523. } catch (Exception e) {
  5524. pushMessage("Interface Failed to load", 0, "");
  5525. }
  5526. }
  5527. if(inputString.equals("::lag"))
  5528. printDebug();
  5529. if(inputString.equals("::prefetchmusic")) {
  5530. for(int j1 = 0; j1 < onDemandFetcher.getVersionCount(2); j1++)
  5531. onDemandFetcher.method563((byte)1, 2, j1);
  5532.  
  5533. }
  5534. if(inputString.equals("::fpson"))
  5535. fpsOn = true;
  5536. if(inputString.equals("::fpsoff"))
  5537. fpsOn = false;
  5538. if(inputString.equals("::dataon"))
  5539. clientData = true;
  5540. if(inputString.equals("::dataoff"))
  5541. clientData = false;
  5542. if (inputString.equals("::rendering")) {
  5543. newRendering = !newRendering;
  5544. resetLogout();
  5545. }
  5546. if(inputString.equals("::noclip")) {
  5547. for(int k1 = 0; k1 < 4; k1++) {
  5548. for(int i2 = 1; i2 < 103; i2++) {
  5549. for(int k2 = 1; k2 < 103; k2++)
  5550. aClass11Array1230[k1].anIntArrayArray294[i2][k2] = 0;
  5551.  
  5552. }
  5553. }
  5554. }
  5555. }
  5556. if(inputString.equals("add model")) {
  5557. try {
  5558. int ModelIndex = Integer.parseInt(JOptionPane.showInputDialog(this, "Enter model ID", "Model", 3));
  5559. byte[] abyte0 = getModel(ModelIndex);
  5560. if(abyte0 != null && abyte0.length > 0) {
  5561. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  5562. pushMessage("Model: [" + ModelIndex + "] added successfully!", 0, "");
  5563. } else {
  5564. pushMessage("Unable to find the model. "+ModelIndex, 0, "");
  5565. }
  5566. } catch(Exception e) {
  5567. pushMessage("Syntax - ::add model <path>", 0, "");
  5568. }
  5569. }
  5570. if(inputString.startsWith("/"))
  5571. inputString = "::" + inputString;
  5572. if(inputString.startsWith("::")) {
  5573. stream.createFrame(103);
  5574. stream.writeWordBigEndian(inputString.length() - 1);
  5575. stream.writeString(inputString.substring(2));
  5576. } else {
  5577. String s = inputString.toLowerCase();
  5578. int j2 = 0;
  5579. if(s.startsWith("yellow:"))
  5580. {
  5581. j2 = 0;
  5582. inputString = inputString.substring(7);
  5583. } else if(s.startsWith("red:"))
  5584. {
  5585. j2 = 1;
  5586. inputString = inputString.substring(4);
  5587. } else if(s.startsWith("green:"))
  5588. {
  5589. j2 = 2;
  5590. inputString = inputString.substring(6);
  5591. } else if(s.startsWith("cyan:"))
  5592. {
  5593. j2 = 3;
  5594. inputString = inputString.substring(5);
  5595. } else if(s.startsWith("purple:"))
  5596. {
  5597. j2 = 4;
  5598. inputString = inputString.substring(7);
  5599. } else if(s.startsWith("white:"))
  5600. {
  5601. j2 = 5;
  5602. inputString = inputString.substring(6);
  5603. } else if(s.startsWith("flash1:"))
  5604. {
  5605. j2 = 6;
  5606. inputString = inputString.substring(7);
  5607. } else if(s.startsWith("flash2:"))
  5608. {
  5609. j2 = 7;
  5610. inputString = inputString.substring(7);
  5611. } else if(s.startsWith("flash3:"))
  5612. {
  5613. j2 = 8;
  5614. inputString = inputString.substring(7);
  5615. } else if(s.startsWith("glow1:"))
  5616. {
  5617. j2 = 9;
  5618. inputString = inputString.substring(6);
  5619. } else if(s.startsWith("glow2:"))
  5620. {
  5621. j2 = 10;
  5622. inputString = inputString.substring(6);
  5623. } else if(s.startsWith("glow3:"))
  5624. {
  5625. j2 = 11;
  5626. inputString = inputString.substring(6);
  5627. }
  5628. s = inputString.toLowerCase();
  5629. int i3 = 0;
  5630. if(s.startsWith("wave:"))
  5631. {
  5632. i3 = 1;
  5633. inputString = inputString.substring(5);
  5634. } else if(s.startsWith("wave2:"))
  5635. {
  5636. i3 = 2;
  5637. inputString = inputString.substring(6);
  5638. } else if(s.startsWith("shake:"))
  5639. {
  5640. i3 = 3;
  5641. inputString = inputString.substring(6);
  5642. } else if(s.startsWith("scroll:"))
  5643. {
  5644. i3 = 4;
  5645. inputString = inputString.substring(7);
  5646. } else if(s.startsWith("slide:"))
  5647. {
  5648. i3 = 5;
  5649. inputString = inputString.substring(6);
  5650. }
  5651. stream.createFrame(4);
  5652. stream.writeWordBigEndian(0);
  5653. int j3 = stream.currentOffset;
  5654. stream.method425(i3);
  5655. stream.method425(j2);
  5656. aStream_834.currentOffset = 0;
  5657. TextInput.method526(inputString, aStream_834);
  5658. stream.method441(0, aStream_834.buffer, aStream_834.currentOffset);
  5659. stream.writeBytes(stream.currentOffset - j3);
  5660. inputString = TextInput.processText(inputString);
  5661. inputString = Censor.doCensor(inputString);
  5662. myPlayer.textSpoken = inputString;
  5663. myPlayer.anInt1513 = j2;
  5664. myPlayer.anInt1531 = i3;
  5665. myPlayer.textCycle = 150;
  5666. if(myPrivilege == 2)
  5667. pushMessage(myPlayer.textSpoken, 2, "@cr2@" + myPlayer.name);
  5668. else
  5669. if(myPrivilege == 1)
  5670. pushMessage(myPlayer.textSpoken, 2, "@cr1@" + myPlayer.name);
  5671. else
  5672. if(myPrivilege == 4)
  5673. pushMessage(myPlayer.textSpoken, 2, "@cr3@" + myPlayer.name);
  5674. else
  5675. pushMessage(myPlayer.textSpoken, 2, myPlayer.name);
  5676. if(publicChatMode == 2)
  5677. {
  5678. publicChatMode = 3;
  5679. aBoolean1233 = true;
  5680. stream.createFrame(95);
  5681. stream.writeWordBigEndian(publicChatMode);
  5682. stream.writeWordBigEndian(privateChatMode);
  5683. stream.writeWordBigEndian(tradeMode);
  5684. }
  5685. }
  5686. inputString = "";
  5687. inputTaken = true;
  5688. }
  5689. }
  5690. } while(true);
  5691. }
  5692.  
  5693. public void buildPublicChat(int j)
  5694. {
  5695. int l = 0;
  5696. for(int i1 = 0; i1 < 500; i1++)
  5697. {
  5698. if(chatMessages[i1] == null)
  5699. continue;
  5700. if(chatTypeView != 1)
  5701. continue;
  5702. int j1 = chatTypes[i1];
  5703. String s = chatNames[i1];
  5704. String ct = chatMessages[i1];
  5705. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5706. if(k1 < -23)
  5707. break;
  5708. if(s != null && s.startsWith("@cr1@"))
  5709. s = s.substring(5);
  5710. if(s != null && s.startsWith("@cr2@"))
  5711. s = s.substring(5);
  5712. if(s != null && s.startsWith("@cr3@"))
  5713. s = s.substring(5);
  5714. if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  5715. if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  5716. if(myPrivilege >= 1) {
  5717. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5718. menuActionID[menuActionRow] = 606;
  5719. menuActionRow++;
  5720. }
  5721. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5722. menuActionID[menuActionRow] = 42;
  5723. menuActionRow++;
  5724. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5725. menuActionID[menuActionRow] = 337;
  5726. menuActionRow++;
  5727. }
  5728. l++;
  5729. }
  5730. }
  5731. }
  5732.  
  5733. public void buildFriendChat(int j)
  5734. {
  5735. int l = 0;
  5736. for(int i1 = 0; i1 < 500; i1++) {
  5737. if(chatMessages[i1] == null)
  5738. continue;
  5739. if(chatTypeView != 2)
  5740. continue;
  5741. int j1 = chatTypes[i1];
  5742. String s = chatNames[i1];
  5743. String ct = chatMessages[i1];
  5744. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5745. if(k1 < -23)
  5746. break;
  5747. if(s != null && s.startsWith("@cr1@"))
  5748. s = s.substring(5);
  5749. if(s != null && s.startsWith("@cr2@"))
  5750. s = s.substring(5);
  5751. if(s != null && s.startsWith("@cr3@"))
  5752. s = s.substring(5);
  5753. if((j1 == 5 || j1 == 6) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 6 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5754. l++;
  5755. if((j1 == 3 || j1 == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5756. {
  5757. if(j > k1 - 14 && j <= k1) {
  5758. if(myPrivilege >= 1) {
  5759. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5760. menuActionID[menuActionRow] = 606;
  5761. menuActionRow++;
  5762. }
  5763. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5764. menuActionID[menuActionRow] = 42;
  5765. menuActionRow++;
  5766. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5767. menuActionID[menuActionRow] = 337;
  5768. menuActionRow++;
  5769. }
  5770. l++;
  5771. }
  5772. }
  5773. }
  5774.  
  5775. public void buildDuelorTrade(int j) {
  5776. int l = 0;
  5777. for(int i1 = 0; i1 < 500; i1++) {
  5778. if(chatMessages[i1] == null)
  5779. continue;
  5780. if(chatTypeView != 3 && chatTypeView != 4)
  5781. continue;
  5782. int j1 = chatTypes[i1];
  5783. String s = chatNames[i1];
  5784. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5785. if(k1 < -23)
  5786. break;
  5787. if(s != null && s.startsWith("@cr1@"))
  5788. s = s.substring(5);
  5789. if(s != null && s.startsWith("@cr2@"))
  5790. s = s.substring(5);
  5791. if(s != null && s.startsWith("@cr3@"))
  5792. s = s.substring(5);
  5793. if(chatTypeView == 3 && j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5794. if(j > k1 - 14 && j <= k1) {
  5795. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  5796. menuActionID[menuActionRow] = 484;
  5797. menuActionRow++;
  5798. }
  5799. l++;
  5800. }
  5801. if(chatTypeView == 4 && j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5802. if(j > k1 - 14 && j <= k1) {
  5803. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  5804. menuActionID[menuActionRow] = 6;
  5805. menuActionRow++;
  5806. }
  5807. l++;
  5808. }
  5809. if(j1 == 12) {
  5810. if(j > k1 - 14 && j <= k1) {
  5811. menuActionName[menuActionRow] = "Go-to @blu@" + s;
  5812. menuActionID[menuActionRow] = 915;
  5813. menuActionRow++;
  5814. }
  5815. l++;
  5816. }
  5817. }
  5818. }
  5819.  
  5820. public void buildChatAreaMenu(int j) {
  5821. int l = 0;
  5822. int test = 0;
  5823. for(int i1 = 0; i1 < 500; i1++) {
  5824. if(chatMessages[i1] == null)
  5825. continue;
  5826. int j1 = chatTypes[i1];
  5827. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5828. if(k1 < -23)
  5829. break;
  5830. String s = chatNames[i1];
  5831. String ct = chatMessages[i1];
  5832. boolean flag = false;
  5833. if(chatTypeView == 1) {
  5834. buildPublicChat(j);
  5835. break;
  5836. }
  5837. if(chatTypeView == 2) {
  5838. buildFriendChat(j);
  5839. break;
  5840. }
  5841. if(chatTypeView == 3 || chatTypeView == 4) {
  5842. buildDuelorTrade(j);
  5843. break;
  5844. }
  5845. if(chatTypeView == 5) {
  5846. break;
  5847. }
  5848. if(s != null && s.startsWith("@cr1@")) {
  5849. s = s.substring(5);
  5850. boolean flag1 = true;
  5851. byte byte0 = 1;
  5852. }
  5853. if(s != null && s.startsWith("@cr2@")) {
  5854. s = s.substring(5);
  5855. byte byte0 = 2;
  5856. }
  5857. if(s != null && s.startsWith("@cr3@")) {
  5858. s = s.substring(5);
  5859. byte byte0 = 3;
  5860. }
  5861. if(j1 == 0)
  5862. l++;
  5863. if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  5864. if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  5865. if(myPrivilege >= 1) {
  5866. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5867. menuActionID[menuActionRow] = 606;
  5868. menuActionRow++;
  5869. }
  5870. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5871. menuActionID[menuActionRow] = 42;
  5872. menuActionRow++;
  5873. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5874. menuActionID[menuActionRow] = 337;
  5875. menuActionRow++;
  5876. }
  5877. l++;
  5878. }
  5879. if((j1 == 3 || j1 == 7) && splitPrivateChat == 0 && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  5880. if(j > k1 - 14 && j <= k1) {
  5881. if(myPrivilege >= 1) {
  5882. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5883. menuActionID[menuActionRow] = 606;
  5884. menuActionRow++;
  5885. }
  5886. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5887. menuActionID[menuActionRow] = 42;
  5888. menuActionRow++;
  5889. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5890. menuActionID[menuActionRow] = 337;
  5891. menuActionRow++;
  5892. }
  5893. l++;
  5894. }
  5895. if(j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5896. if(j > k1 - 14 && j <= k1) {
  5897. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  5898. menuActionID[menuActionRow] = 484;
  5899. menuActionRow++;
  5900. }
  5901. l++;
  5902. }
  5903. if((j1 == 5 || j1 == 6) && splitPrivateChat == 0 && privateChatMode < 2)
  5904. l++;
  5905. if(j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5906. if(j > k1 - 14 && j <= k1) {
  5907. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  5908. menuActionID[menuActionRow] = 6;
  5909. menuActionRow++;
  5910. }
  5911. l++;
  5912. }
  5913. }
  5914. }
  5915.  
  5916. public void drawFriendsListOrWelcomeScreen(RSInterface class9)
  5917. {
  5918. int j = class9.contentType;
  5919. if(j >= 1 && j <= 100 || j >= 701 && j <= 800)
  5920. {
  5921. if(j == 1 && anInt900 == 0)
  5922. {
  5923. class9.message = "Loading friend list";
  5924. class9.atActionType = 0;
  5925. return;
  5926. }
  5927. if(j == 1 && anInt900 == 1)
  5928. {
  5929. class9.message = "Connecting to friendserver";
  5930. class9.atActionType = 0;
  5931. return;
  5932. }
  5933. if(j == 2 && anInt900 != 2)
  5934. {
  5935. class9.message = "Please wait...";
  5936. class9.atActionType = 0;
  5937. return;
  5938. }
  5939. int k = friendsCount;
  5940. if(anInt900 != 2)
  5941. k = 0;
  5942. if(j > 700)
  5943. j -= 601;
  5944. else
  5945. j--;
  5946. if(j >= k)
  5947. {
  5948. class9.message = "";
  5949. class9.atActionType = 0;
  5950. return;
  5951. } else
  5952. {
  5953. class9.message = friendsList[j];
  5954. class9.atActionType = 1;
  5955. return;
  5956. }
  5957. }
  5958. if(j >= 101 && j <= 200 || j >= 801 && j <= 900)
  5959. {
  5960. int l = friendsCount;
  5961. if(anInt900 != 2)
  5962. l = 0;
  5963. if(j > 800)
  5964. j -= 701;
  5965. else
  5966. j -= 101;
  5967. if(j >= l)
  5968. {
  5969. class9.message = "";
  5970. class9.atActionType = 0;
  5971. return;
  5972. }
  5973. if(friendsNodeIDs[j] == 0)
  5974. class9.message = "@red@Offline";
  5975. else if(friendsNodeIDs[j] == nodeID)
  5976. class9.message = "@gre@Online"/* + (friendsNodeIDs[j] - 9)*/;
  5977. else
  5978. class9.message = "@red@Offline"/* + (friendsNodeIDs[j] - 9)*/;
  5979. class9.atActionType = 1;
  5980. return;
  5981. }
  5982. if(j == 203)
  5983. {
  5984. int i1 = friendsCount;
  5985. if(anInt900 != 2)
  5986. i1 = 0;
  5987. class9.scrollMax = i1 * 15 + 20;
  5988. if(class9.scrollMax <= class9.height)
  5989. class9.scrollMax = class9.height + 1;
  5990. return;
  5991. }
  5992. if(j >= 401 && j <= 500)
  5993. {
  5994. if((j -= 401) == 0 && anInt900 == 0)
  5995. {
  5996. class9.message = "Loading ignore list";
  5997. class9.atActionType = 0;
  5998. return;
  5999. }
  6000. if(j == 1 && anInt900 == 0)
  6001. {
  6002. class9.message = "Please wait...";
  6003. class9.atActionType = 0;
  6004. return;
  6005. }
  6006. int j1 = ignoreCount;
  6007. if(anInt900 == 0)
  6008. j1 = 0;
  6009. if(j >= j1)
  6010. {
  6011. class9.message = "";
  6012. class9.atActionType = 0;
  6013. return;
  6014. } else
  6015. {
  6016. class9.message = TextClass.fixName(TextClass.nameForLong(ignoreListAsLongs[j]));
  6017. class9.atActionType = 1;
  6018. return;
  6019. }
  6020. }
  6021. if(j == 503)
  6022. {
  6023. class9.scrollMax = ignoreCount * 15 + 20;
  6024. if(class9.scrollMax <= class9.height)
  6025. class9.scrollMax = class9.height + 1;
  6026. return;
  6027. }
  6028. if(j == 327)
  6029. {
  6030. class9.modelRotation1 = 150;
  6031. class9.modelRotation2 = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  6032. if(aBoolean1031)
  6033. {
  6034. for(int k1 = 0; k1 < 7; k1++)
  6035. {
  6036. int l1 = anIntArray1065[k1];
  6037. if(l1 >= 0 && !IDK.cache[l1].method537())
  6038. return;
  6039. }
  6040.  
  6041. aBoolean1031 = false;
  6042. Model aclass30_sub2_sub4_sub6s[] = new Model[7];
  6043. int i2 = 0;
  6044. for(int j2 = 0; j2 < 7; j2++)
  6045. {
  6046. int k2 = anIntArray1065[j2];
  6047. if(k2 >= 0)
  6048. aclass30_sub2_sub4_sub6s[i2++] = IDK.cache[k2].method538();
  6049. }
  6050.  
  6051. Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
  6052. for(int l2 = 0; l2 < 5; l2++)
  6053. if(anIntArray990[l2] != 0)
  6054. {
  6055. model.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  6056. if(l2 == 1)
  6057. model.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  6058. }
  6059.  
  6060. model.method469();
  6061. model.method470(Animation.anims[myPlayer.anInt1511].anIntArray353[0]);
  6062. model.method479(64, 850, -30, -50, -30, true);
  6063. class9.anInt233 = 5;
  6064. class9.mediaID = 0;
  6065. RSInterface.method208(aBoolean994, model);
  6066. }
  6067. return;
  6068. }
  6069. if(j == 328) {
  6070. RSInterface rsInterface = class9;
  6071. int verticleTilt = 150;
  6072. int animationSpeed = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  6073. rsInterface.modelRotation1 = verticleTilt;
  6074. rsInterface.modelRotation2 = animationSpeed;
  6075. if(aBoolean1031) {
  6076. Model characterDisplay = myPlayer.method452();
  6077. for(int l2 = 0; l2 < 5; l2++)
  6078. if(anIntArray990[l2] != 0) {
  6079. characterDisplay.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  6080. if(l2 == 1)
  6081. characterDisplay.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  6082. }
  6083. int staticFrame = myPlayer.anInt1511;
  6084. characterDisplay.method469();
  6085. characterDisplay.method470(Animation.anims[staticFrame].anIntArray353[0]);
  6086. //characterDisplay.method479(64, 850, -30, -50, -30, true);
  6087. rsInterface.anInt233 = 5;
  6088. rsInterface.mediaID = 0;
  6089. RSInterface.method208(aBoolean994, characterDisplay);
  6090. }
  6091. return;
  6092. }
  6093. if(j == 324)
  6094. {
  6095. if(aClass30_Sub2_Sub1_Sub1_931 == null)
  6096. {
  6097. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  6098. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  6099. }
  6100. if(aBoolean1047)
  6101. {
  6102. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  6103. return;
  6104. } else
  6105. {
  6106. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  6107. return;
  6108. }
  6109. }
  6110. if(j == 325)
  6111. {
  6112. if(aClass30_Sub2_Sub1_Sub1_931 == null)
  6113. {
  6114. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  6115. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  6116. }
  6117. if(aBoolean1047)
  6118. {
  6119. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  6120. return;
  6121. } else
  6122. {
  6123. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  6124. return;
  6125. }
  6126. }
  6127. if(j == 600)
  6128. {
  6129. class9.message = reportAbuseInput;
  6130. if(loopCycle % 20 < 10)
  6131. {
  6132. class9.message += "|";
  6133. return;
  6134. } else
  6135. {
  6136. class9.message += " ";
  6137. return;
  6138. }
  6139. }
  6140. if(j == 620)
  6141. if(myPrivilege >= 1)
  6142. {
  6143. if(canMute)
  6144. {
  6145. class9.textColor = 0xff0000;
  6146. class9.message = "Moderator option: Mute player for 48 hours: <ON>";
  6147. } else
  6148. {
  6149. class9.textColor = 0xffffff;
  6150. class9.message = "Moderator option: Mute player for 48 hours: <OFF>";
  6151. }
  6152. } else
  6153. {
  6154. class9.message = "";
  6155. }
  6156. if(j == 650 || j == 655)
  6157. if(anInt1193 != 0)
  6158. {
  6159. String s;
  6160. if(daysSinceLastLogin == 0)
  6161. s = "earlier today";
  6162. else
  6163. if(daysSinceLastLogin == 1)
  6164. s = "yesterday";
  6165. else
  6166. s = daysSinceLastLogin + " days ago";
  6167. class9.message = "You last logged in " + s + " from: " + signlink.dns;
  6168. } else
  6169. {
  6170. class9.message = "";
  6171. }
  6172. if(j == 651)
  6173. {
  6174. if(unreadMessages == 0)
  6175. {
  6176. class9.message = "0 unread messages";
  6177. class9.textColor = 0xffff00;
  6178. }
  6179. if(unreadMessages == 1)
  6180. {
  6181. class9.message = "1 unread message";
  6182. class9.textColor = 65280;
  6183. }
  6184. if(unreadMessages > 1)
  6185. {
  6186. class9.message = unreadMessages + " unread messages";
  6187. class9.textColor = 65280;
  6188. }
  6189. }
  6190. if(j == 652)
  6191. if(daysSinceRecovChange == 201)
  6192. {
  6193. if(membersInt == 1)
  6194. class9.message = "@yel@This is a non-members world: @whi@Since you are a member we";
  6195. else
  6196. class9.message = "";
  6197. } else
  6198. if(daysSinceRecovChange == 200)
  6199. {
  6200. class9.message = "You have not yet set any password recovery questions.";
  6201. } else
  6202. {
  6203. String s1;
  6204. if(daysSinceRecovChange == 0)
  6205. s1 = "Earlier today";
  6206. else
  6207. if(daysSinceRecovChange == 1)
  6208. s1 = "Yesterday";
  6209. else
  6210. s1 = daysSinceRecovChange + " days ago";
  6211. class9.message = s1 + " you changed your recovery questions";
  6212. }
  6213. if(j == 653)
  6214. if(daysSinceRecovChange == 201)
  6215. {
  6216. if(membersInt == 1)
  6217. class9.message = "@whi@recommend you use a members world instead. You may use";
  6218. else
  6219. class9.message = "";
  6220. } else
  6221. if(daysSinceRecovChange == 200)
  6222. class9.message = "We strongly recommend you do so now to secure your account.";
  6223. else
  6224. class9.message = "If you do not remember making this change then cancel it immediately";
  6225. if(j == 654)
  6226. {
  6227. if(daysSinceRecovChange == 201)
  6228. if(membersInt == 1)
  6229. {
  6230. class9.message = "@whi@this world but member benefits are unavailable whilst here.";
  6231. return;
  6232. } else
  6233. {
  6234. class9.message = "";
  6235. return;
  6236. }
  6237. if(daysSinceRecovChange == 200)
  6238. {
  6239. class9.message = "Do this from the 'account management' area on our front webpage";
  6240. return;
  6241. }
  6242. class9.message = "Do this from the 'account management' area on our front webpage";
  6243. }
  6244. }
  6245.  
  6246. public void drawSplitPrivateChat()
  6247. {
  6248. if(splitPrivateChat == 0)
  6249. return;
  6250. TextDrawingArea textDrawingArea = regularText;
  6251. int i = 0;
  6252. if(anInt1104 != 0)
  6253. i = 1;
  6254. for(int j = 0; j < 100; j++)
  6255. if(chatMessages[j] != null)
  6256. {
  6257. int k = chatTypes[j];
  6258. String s = chatNames[j];
  6259. byte byte1 = 0;
  6260. if(s != null && s.startsWith("@cr1@"))
  6261. {
  6262. s = s.substring(5);
  6263. byte1 = 1;
  6264. }
  6265. if(s != null && s.startsWith("@cr2@"))
  6266. {
  6267. s = s.substring(5);
  6268. byte1 = 2;
  6269. }
  6270. if(s != null && s.startsWith("@cr3@"))
  6271. {
  6272. s = s.substring(5);
  6273. byte1 = 3;
  6274. }
  6275. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  6276. {
  6277. int l = 329 - i * 13;
  6278. int k1 = 4;
  6279. textDrawingArea.method385(0, "From", l, k1);
  6280. textDrawingArea.method385(65535, "From", l - 1, k1);
  6281. k1 += textDrawingArea.getTextWidth("From ");
  6282. if(byte1 == 1)
  6283. {
  6284. modIcons[0].drawBackground(k1, l - 12);
  6285. k1 += 12;
  6286. }
  6287. if(byte1 == 2)
  6288. {
  6289. modIcons[1].drawBackground(k1, l - 12);
  6290. k1 += 12;
  6291. }
  6292. if(byte1 == 3)
  6293. {
  6294. modIcons[2].drawBackground(k1, l - 12);
  6295. k1 += 12;
  6296. }
  6297. textDrawingArea.method385(0, s + ": " + chatMessages[j], l, k1);
  6298. textDrawingArea.method385(65535, s + ": " + chatMessages[j], l - 1, k1);
  6299. if(++i >= 5)
  6300. return;
  6301. }
  6302. if(k == 5 && privateChatMode < 2)
  6303. {
  6304. int i1 = 329 - i * 13;
  6305. textDrawingArea.method385(0, chatMessages[j], i1, 4);
  6306. textDrawingArea.method385(65535, chatMessages[j], i1 - 1, 4);
  6307. if(++i >= 5)
  6308. return;
  6309. }
  6310. if(k == 6 && privateChatMode < 2)
  6311. {
  6312. int j1 = 329 - i * 13;
  6313. textDrawingArea.method385(0, "To " + s + ": " + chatMessages[j], j1, 4);
  6314. textDrawingArea.method385(65535, "To " + s + ": " + chatMessages[j], j1 - 1, 4);
  6315. if(++i >= 5)
  6316. return;
  6317. }
  6318. }
  6319.  
  6320. }
  6321.  
  6322. public void pushMessage(String s, int i, String s1) {
  6323. if(i == 0 && dialogID != -1) {
  6324. aString844 = s;
  6325. super.clickMode3 = 0;
  6326. }
  6327. if(backDialogID == -1)
  6328. inputTaken = true;
  6329. for(int j = 499; j > 0; j--) {
  6330. chatTypes[j] = chatTypes[j - 1];
  6331. chatNames[j] = chatNames[j - 1];
  6332. chatMessages[j] = chatMessages[j - 1];
  6333. chatRights[j] = chatRights[j - 1];
  6334. }
  6335. chatTypes[0] = i;
  6336. chatNames[0] = s1;
  6337. chatMessages[0] = s;
  6338. chatRights[0] = rights;
  6339. }
  6340.  
  6341. public static void setTab(int id) {
  6342. needDrawTabArea = true;
  6343. tabID = id;
  6344. tabAreaAltered = true;
  6345. }
  6346.  
  6347. public void processTabClick() {
  6348. if (super.mouseX >= 695 && super.mouseX <= 751 && super.mouseY >= 134 && super.mouseY < 165) {
  6349. summHover = true;
  6350. } else {
  6351. summHover = false;
  6352. }
  6353. if(super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 95 && super.mouseY < 128){
  6354. runHover = true;
  6355. } else {
  6356. runHover = false;
  6357. }
  6358. if(super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 52 && super.mouseY < 87){
  6359. prayHover = true;
  6360. } else {
  6361. prayHover = false;
  6362. }
  6363. if(super.mouseX >= 765-24 && super.mouseX <= 765 && super.mouseY >= 3 && super.mouseY <= 25){
  6364. logHover = true;
  6365. } else {
  6366. logHover = false;
  6367. }
  6368. if(super.clickMode3 == 1) {
  6369. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[0] != -1)
  6370. {
  6371. needDrawTabArea = true;
  6372. tabID = 0;
  6373. tabAreaAltered = true;
  6374. }
  6375. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[1] != -1)
  6376. {
  6377. needDrawTabArea = true;
  6378. tabID = 1;
  6379. tabAreaAltered = true;
  6380. }
  6381. if(super.saveClickX >= 595 && super.saveClickX <= 626 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[2] != -1)
  6382. {
  6383. needDrawTabArea = true;
  6384. tabID = 2;
  6385. tabAreaAltered = true;
  6386. }
  6387. if(super.saveClickX >= 627 && super.saveClickX <= 660 && super.saveClickY >= 168 && super.saveClickY < 203 && tabInterfaceIDs[3] != -1)
  6388. {
  6389. needDrawTabArea = true;
  6390. tabID = 3;
  6391. tabAreaAltered = true;
  6392. }
  6393. if(super.saveClickX >= 661 && super.saveClickX <= 693 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[4] != -1)
  6394. {
  6395. needDrawTabArea = true;
  6396. tabID = 4;
  6397. tabAreaAltered = true;
  6398. }
  6399. if(super.saveClickX >= 694 && super.saveClickX <= 725 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[5] != -1)
  6400. {
  6401. needDrawTabArea = true;
  6402. tabID = 5;
  6403. tabAreaAltered = true;
  6404. }
  6405. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[6] != -1)
  6406. {
  6407. needDrawTabArea = true;
  6408. tabID = 6;
  6409. tabAreaAltered = true;
  6410. }
  6411. /*if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[7] != -1)
  6412. {
  6413. needDrawTabArea = true;
  6414. tabID = 7;
  6415. tabAreaAltered = true;
  6416. }*/
  6417. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[8] != -1)
  6418. {
  6419. needDrawTabArea = true;
  6420. tabID = 8;
  6421. tabAreaAltered = true;
  6422. }
  6423. if(super.saveClickX >= 595 && super.saveClickX <= 627 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[9] != -1)
  6424. {
  6425. needDrawTabArea = true;
  6426. tabID = 9;
  6427. tabAreaAltered = true;
  6428. }
  6429. if(super.saveClickX >= 627 && super.saveClickX <= 664 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[10] != -1)
  6430. {
  6431. setSidebarInterface(10, 18128);
  6432. needDrawTabArea = true;
  6433. tabAreaAltered = true;
  6434. }
  6435. if(super.saveClickX >= 661 && super.saveClickX <= 694 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[11] != -1)
  6436. {
  6437. needDrawTabArea = true;
  6438. tabID = 11;
  6439. tabAreaAltered = true;
  6440. }
  6441. if(super.saveClickX >= 695 && super.saveClickX <= 725 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[12] != -1)
  6442. {
  6443. needDrawTabArea = true;
  6444. tabID = 12;
  6445. tabAreaAltered = true;
  6446. }
  6447. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[13] != -1)
  6448. {
  6449. needDrawTabArea = true;
  6450. tabID = 13;
  6451. tabAreaAltered = true;
  6452. }
  6453. if(super.saveClickX >= 742 && super.saveClickX <= 764 && super.saveClickY >= 1 && super.saveClickY < 24 && tabInterfaceIDs[10] != -1) {
  6454. setSidebarInterface(14, 2449);
  6455. needDrawTabArea = true;
  6456. tabAreaAltered = true;
  6457. }
  6458. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[7] != -1) {
  6459. setSidebarInterface(7, 17011);
  6460. needDrawTabArea = true;
  6461. tabAreaAltered = true;//Summoning
  6462. }
  6463. }
  6464. }
  6465.  
  6466. public void resetImageProducers2() {
  6467. if(aRSImageProducer_1166 != null)
  6468. return;
  6469. nullLoader();
  6470. super.fullGameScreen = null;
  6471. aRSImageProducer_1107 = null;
  6472. aRSImageProducer_1108 = null;
  6473. aRSImageProducer_1109 = null;
  6474. aRSImageProducer_1110 = null;
  6475. aRSImageProducer_1111 = null;
  6476. aRSImageProducer_1112 = null;
  6477. aRSImageProducer_1113 = null;
  6478. aRSImageProducer_1114 = null;
  6479. aRSImageProducer_1115 = null;
  6480. aRSImageProducer_1166 = new RSImageProducer(519, 165, getGameComponent());
  6481. DrawingArea.setAllPixelsToZero();
  6482. aRSImageProducer_1164 = new RSImageProducer(246, 168, getGameComponent());
  6483. mapArea.drawSprite(0, 0);
  6484. aRSImageProducer_1163 = new RSImageProducer(246, 335, getGameComponent());
  6485. aRSImageProducer_1165 = new RSImageProducer(512, 334, getGameComponent());
  6486. DrawingArea.setAllPixelsToZero();
  6487. aRSImageProducer_1123 = new RSImageProducer(496, 50, getGameComponent());
  6488. aRSImageProducer_1124 = new RSImageProducer(269, 37, getGameComponent());
  6489. aRSImageProducer_1125 = new RSImageProducer(249, 45, getGameComponent());
  6490. welcomeScreenRaised = true;
  6491. }
  6492.  
  6493. public String getDocumentBaseHost() {
  6494. if (signlink.mainapp != null) {
  6495. return signlink.mainapp.getDocumentBase().getHost().toLowerCase();
  6496. }
  6497. if (super.gameFrame != null) {
  6498. return ""; // runescape.com <- removed for Jframe to work
  6499. } else {
  6500. return ""; // super.getDocumentBase().getHost().toLowerCase() <- removed for Jframe to work
  6501. }
  6502. }
  6503.  
  6504. private void method81(Sprite sprite, int j, int k) {
  6505. int l = k * k + j * j;
  6506. if(l > 4225 && l < 0x15f90) {
  6507. int i1 = minimapInt1 + minimapInt2 & 0x7ff;
  6508. int j1 = Model.modelIntArray1[i1];
  6509. int k1 = Model.modelIntArray2[i1];
  6510. j1 = (j1 * 256) / (minimapInt3 + 256);
  6511. k1 = (k1 * 256) / (minimapInt3 + 256);
  6512. int l1 = j * j1 + k * k1 >> 16;
  6513. int i2 = j * k1 - k * j1 >> 16;
  6514. double d = Math.atan2(l1, i2);
  6515. int j2 = (int)(Math.sin(d) * 63D);
  6516. int k2 = (int)(Math.cos(d) * 57D);
  6517. mapEdge.method353(83 - k2 - 20, d, (94 + j2 + 4) - 10);
  6518. } else
  6519. {
  6520. markMinimap(sprite, k, j);
  6521. }
  6522. }
  6523.  
  6524. public void rightClickChatButtons() {
  6525. if(super.mouseX >= 6 && super.mouseX <= 62 && super.mouseY >= 482 && super.mouseY <= 503) {
  6526. menuActionName[1] = "View All";
  6527. menuActionID[1] = 999;
  6528. menuActionRow = 2;
  6529. }
  6530. else if(super.mouseX >= 63 && super.mouseX <= 118 && super.mouseY >= 482 && super.mouseY <= 503) {
  6531. menuActionName[1] = "View Game";
  6532. menuActionID[1] = 998;
  6533. menuActionRow = 2;
  6534. }
  6535. else if(super.mouseX >= 119 && super.mouseX <= 175 && super.mouseY >= 482 && super.mouseY <= 503) {
  6536. menuActionName[1] = "Hide public";
  6537. menuActionID[1] = 997;
  6538. menuActionName[2] = "Off public";
  6539. menuActionID[2] = 996;
  6540. menuActionName[3] = "Friends public";
  6541. menuActionID[3] = 995;
  6542. menuActionName[4] = "On public";
  6543. menuActionID[4] = 994;
  6544. menuActionName[5] = "View public";
  6545. menuActionID[5] = 993;
  6546. menuActionRow = 6;
  6547. }
  6548. else if(super.mouseX >= 177 && super.mouseX <= 232 && super.mouseY >= 482 && super.mouseY <= 503) {
  6549. menuActionName[1] = "Off private";
  6550. menuActionID[1] = 992;
  6551. menuActionName[2] = "Friends private";
  6552. menuActionID[2] = 991;
  6553. menuActionName[3] = "On private";
  6554. menuActionID[3] = 990;
  6555. menuActionName[4] = "View private";
  6556. menuActionID[4] = 989;
  6557. menuActionRow = 5;
  6558. }
  6559. else if(super.mouseX >= 233 && super.mouseX <= 289 && super.mouseY >= 482 && super.mouseY <= 503) {
  6560. menuActionName[1] = "Off clan chat";
  6561. menuActionID[1] = 1003;
  6562. menuActionName[2] = "Friends clan chat";
  6563. menuActionID[2] = 1002;
  6564. menuActionName[3] = "On clan chat";
  6565. menuActionID[3] = 1001;
  6566. menuActionName[4] = "View clan chat";
  6567. menuActionID[4] = 1000;
  6568. menuActionRow = 5;
  6569. }
  6570. else if(super.mouseX >= 290 && super.mouseX <= 346 && super.mouseY >= 482 && super.mouseY <= 503) {
  6571. menuActionName[1] = "Off trade";
  6572. menuActionID[1] = 987;
  6573. menuActionName[2] = "Friends trade";
  6574. menuActionID[2] = 986;
  6575. menuActionName[3] = "On trade";
  6576. menuActionID[3] = 985;
  6577. menuActionName[4] = "View trade";
  6578. menuActionID[4] = 984;
  6579. menuActionRow = 5;
  6580. }
  6581. else if(super.mouseX >= 347 && super.mouseX <= 403 && super.mouseY >= 482 && super.mouseY <= 503) {
  6582. menuActionName[1] = "Off duel";
  6583. menuActionID[1] = 983;
  6584. menuActionName[2] = "Friends duel";
  6585. menuActionID[2] = 982;
  6586. menuActionName[3] = "On duel";
  6587. menuActionID[3] = 981;
  6588. menuActionName[4] = "View duel";
  6589. menuActionID[4] = 980;
  6590. menuActionRow = 5;
  6591. }
  6592. }
  6593.  
  6594. public void processRightClick() {
  6595. if (activeInterfaceType != 0) {
  6596. return;
  6597. }
  6598. menuActionName[0] = "Cancel";
  6599. menuActionID[0] = 1107;
  6600. menuActionRow = 1;
  6601. if (fullscreenInterfaceID != -1) {
  6602. anInt886 = 0;
  6603. anInt1315 = 0;
  6604. buildInterfaceMenu(8, RSInterface.interfaceCache[fullscreenInterfaceID], super.mouseX, 8, super.mouseY, 0);
  6605. if (anInt886 != anInt1026) {
  6606. anInt1026 = anInt886;
  6607. }
  6608. if (anInt1315 != anInt1129) {
  6609. anInt1129 = anInt1315;
  6610. }
  6611. return;
  6612. }
  6613. buildSplitPrivateChatMenu();
  6614. anInt886 = 0;
  6615. anInt1315 = 0;
  6616. if (super.mouseX > 0 && super.mouseY > 0 && super.mouseX < 516 && super.mouseY < 338) {
  6617. if (openInterfaceID != -1) {
  6618. buildInterfaceMenu(4, RSInterface.interfaceCache[openInterfaceID], super.mouseX, 4, super.mouseY, 0);
  6619. } else {
  6620. build3dScreenMenu();
  6621. }
  6622. }
  6623. if (anInt886 != anInt1026) {
  6624. anInt1026 = anInt886;
  6625. }
  6626. if (anInt1315 != anInt1129) {
  6627. anInt1129 = anInt1315;
  6628. }
  6629. anInt886 = 0;
  6630. anInt1315 = 0;
  6631. if(super.mouseX > 548 && super.mouseY > 207 && super.mouseX < 740 && super.mouseY < 468) {
  6632. if(invOverlayInterfaceID != -1) {
  6633. buildInterfaceMenu(548, RSInterface.interfaceCache[invOverlayInterfaceID], super.mouseX, 207, super.mouseY, 0);
  6634. } else if(tabInterfaceIDs[tabID] != -1) {
  6635. buildInterfaceMenu(548, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], super.mouseX, 207, super.mouseY, 0);
  6636. }
  6637. }
  6638. if (anInt886 != anInt1048) {
  6639. needDrawTabArea = true;
  6640. tabAreaAltered = true;
  6641. anInt1048 = anInt886;
  6642. }
  6643. if (anInt1315 != anInt1044) {
  6644. needDrawTabArea = true;
  6645. tabAreaAltered = true;
  6646. anInt1044 = anInt1315;
  6647. }
  6648. anInt886 = 0;
  6649. anInt1315 = 0;
  6650. if(super.mouseX > 0 && super.mouseY > 338 && super.mouseX < 490 && super.mouseY < 463) {
  6651. if(backDialogID != -1) {
  6652. buildInterfaceMenu(20, RSInterface.interfaceCache[backDialogID], super.mouseX, 358, super.mouseY, 0);
  6653. } else if(super.mouseY < 463 && super.mouseX < 490) {
  6654. buildChatAreaMenu(super.mouseY - 338);
  6655. }
  6656. }
  6657. if (backDialogID != -1 && anInt886 != anInt1039) {
  6658. inputTaken = true;
  6659. anInt1039 = anInt886;
  6660. }
  6661. if (backDialogID != -1 && anInt1315 != anInt1500) {
  6662. inputTaken = true;
  6663. anInt1500 = anInt1315;
  6664. }
  6665. /* Enable custom right click areas */
  6666. if(super.mouseX > 4 && super.mouseY > 480 && super.mouseX < 516 && super.mouseY < 503)
  6667. rightClickChatButtons();
  6668. processMinimapActions();
  6669. /**/
  6670. boolean flag = false;
  6671. while (!flag) {
  6672. flag = true;
  6673. for (int j = 0; j < menuActionRow - 1; j++) {
  6674. if (menuActionID[j] < 1000 && menuActionID[j + 1] > 1000) {
  6675. String s = menuActionName[j];
  6676. menuActionName[j] = menuActionName[j + 1];
  6677. menuActionName[j + 1] = s;
  6678. int k = menuActionID[j];
  6679. menuActionID[j] = menuActionID[j + 1];
  6680. menuActionID[j + 1] = k;
  6681. k = menuActionCmd2[j];
  6682. menuActionCmd2[j] = menuActionCmd2[j + 1];
  6683. menuActionCmd2[j + 1] = k;
  6684. k = menuActionCmd3[j];
  6685. menuActionCmd3[j] = menuActionCmd3[j + 1];
  6686. menuActionCmd3[j + 1] = k;
  6687. k = menuActionCmd1[j];
  6688. menuActionCmd1[j] = menuActionCmd1[j + 1];
  6689. menuActionCmd1[j + 1] = k;
  6690. flag = false;
  6691. }
  6692. }
  6693. }
  6694. }
  6695.  
  6696. private int method83(int i, int j, int k)
  6697. {
  6698. int l = 256 - k;
  6699. return ((i & 0xff00ff) * l + (j & 0xff00ff) * k & 0xff00ff00) + ((i & 0xff00) * l + (j & 0xff00) * k & 0xff0000) >> 8;
  6700. }
  6701.  
  6702. private void login(String s, String s1, boolean flag)
  6703. {
  6704. signlink.errorname = s;
  6705. try
  6706. {
  6707. if (myUsername.length() < 1) {
  6708. loginMessage2 = "Please enter a valid username";
  6709. return;
  6710. } else if (myPassword.length() < 1) {
  6711. loginMessage2 = "Please enter a valid password";
  6712. return;
  6713. }
  6714. if (signlink.musicOn) {
  6715. stopMidi();
  6716. }
  6717. if(!flag)
  6718. {
  6719. loginMessage1 = "";
  6720. loginMessage2 = "Connecting to server...";
  6721. drawLoginScreen(true);
  6722. }
  6723. socketStream = new RSSocket(this, openSocket(43594 + portOff));
  6724. long l = TextClass.longForName(s);
  6725. int i = (int)(l >> 16 & 31L);
  6726. stream.currentOffset = 0;
  6727. stream.writeWordBigEndian(14);
  6728. stream.writeWordBigEndian(i);
  6729. socketStream.queueBytes(2, stream.buffer);
  6730. for(int j = 0; j < 8; j++)
  6731. socketStream.read();
  6732.  
  6733. int k = socketStream.read();
  6734. int i1 = k;
  6735. if(k == 0)
  6736. {
  6737. socketStream.flushInputStream(inStream.buffer, 8);
  6738. inStream.currentOffset = 0;
  6739. aLong1215 = inStream.readQWord();
  6740. int ai[] = new int[4];
  6741. ai[0] = (int)(Math.random() * 99999999D);
  6742. ai[1] = (int)(Math.random() * 99999999D);
  6743. ai[2] = (int)(aLong1215 >> 32);
  6744. ai[3] = (int)aLong1215;
  6745. stream.currentOffset = 0;
  6746. stream.writeWordBigEndian(10);
  6747. stream.writeDWord(ai[0]);
  6748. stream.writeDWord(ai[1]);
  6749. stream.writeDWord(ai[2]);
  6750. stream.writeDWord(ai[3]);
  6751. stream.writeDWord(signlink.uid);
  6752. stream.writeString(s);
  6753. stream.writeString(s1);
  6754. stream.doKeys();
  6755. aStream_847.currentOffset = 0;
  6756. if(flag)
  6757. aStream_847.writeWordBigEndian(18);
  6758. else
  6759. aStream_847.writeWordBigEndian(16);
  6760. aStream_847.writeWordBigEndian(stream.currentOffset + 36 + 1 + 1 + 2);
  6761. aStream_847.writeWordBigEndian(255);
  6762. aStream_847.writeWord(317);
  6763. aStream_847.writeWordBigEndian(lowMem ? 1 : 0);
  6764. for(int l1 = 0; l1 < 9; l1++)
  6765. aStream_847.writeDWord(expectedCRCs[l1]);
  6766.  
  6767. aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
  6768. stream.encryption = new ISAACRandomGen(ai);
  6769. for(int j2 = 0; j2 < 4; j2++)
  6770. ai[j2] += 50;
  6771.  
  6772. encryption = new ISAACRandomGen(ai);
  6773. socketStream.queueBytes(aStream_847.currentOffset, aStream_847.buffer);
  6774. k = socketStream.read();
  6775. }
  6776. if(k == 1)
  6777. {
  6778. try
  6779. {
  6780. Thread.sleep(2000L);
  6781. }
  6782. catch(Exception _ex) { }
  6783. login(s, s1, flag);
  6784. return;
  6785. }
  6786. if(k == 2)
  6787. {
  6788. myPrivilege = socketStream.read();
  6789. flagged = socketStream.read() == 1;
  6790. aLong1220 = 0L;
  6791. anInt1022 = 0;
  6792. mouseDetection.coordsIndex = 0;
  6793. super.awtFocus = true;
  6794. aBoolean954 = true;
  6795. loggedIn = true;
  6796. stream.currentOffset = 0;
  6797. inStream.currentOffset = 0;
  6798. pktType = -1;
  6799. anInt841 = -1;
  6800. anInt842 = -1;
  6801. anInt843 = -1;
  6802. pktSize = 0;
  6803. anInt1009 = 0;
  6804. anInt1104 = 0;
  6805. anInt1011 = 0;
  6806. anInt855 = 0;
  6807. menuActionRow = 0;
  6808. menuOpen = false;
  6809. super.idleTime = 0;
  6810. for(int j1 = 0; j1 < 500; j1++)
  6811. chatMessages[j1] = null;
  6812.  
  6813. itemSelected = 0;
  6814. spellSelected = 0;
  6815. loadingStage = 0;
  6816. anInt1062 = 0;
  6817. anInt1278 = (int)(Math.random() * 100D) - 50;
  6818. anInt1131 = (int)(Math.random() * 110D) - 55;
  6819. anInt896 = (int)(Math.random() * 80D) - 40;
  6820. minimapInt2 = (int)(Math.random() * 120D) - 60;
  6821. minimapInt3 = (int)(Math.random() * 30D) - 20;
  6822. minimapInt1 = (int)(Math.random() * 20D) - 10 & 0x7ff;
  6823. anInt1021 = 0;
  6824. anInt985 = -1;
  6825. destX = 0;
  6826. destY = 0;
  6827. playerCount = 0;
  6828. npcCount = 0;
  6829. for(int i2 = 0; i2 < maxPlayers; i2++)
  6830. {
  6831. playerArray[i2] = null;
  6832. aStreamArray895s[i2] = null;
  6833. }
  6834.  
  6835. for(int k2 = 0; k2 < 16384; k2++)
  6836. npcArray[k2] = null;
  6837.  
  6838. myPlayer = playerArray[myPlayerIndex] = new Player();
  6839. aClass19_1013.removeAll();
  6840. aClass19_1056.removeAll();
  6841. for(int l2 = 0; l2 < 4; l2++)
  6842. {
  6843. for(int i3 = 0; i3 < 104; i3++)
  6844. {
  6845. for(int k3 = 0; k3 < 104; k3++)
  6846. groundArray[l2][i3][k3] = null;
  6847.  
  6848. }
  6849.  
  6850. }
  6851.  
  6852. aClass19_1179 = new NodeList();
  6853. fullscreenInterfaceID = -1;
  6854. anInt900 = 0;
  6855. friendsCount = 0;
  6856. dialogID = -1;
  6857. backDialogID = -1;
  6858. openInterfaceID = -1;
  6859. invOverlayInterfaceID = -1;
  6860. anInt1018 = -1;
  6861. aBoolean1149 = false;
  6862. tabID = 3;
  6863. inputDialogState = 0;
  6864. menuOpen = false;
  6865. messagePromptRaised = false;
  6866. aString844 = null;
  6867. anInt1055 = 0;
  6868. anInt1054 = -1;
  6869. aBoolean1047 = true;
  6870. method45();
  6871. for(int j3 = 0; j3 < 5; j3++)
  6872. anIntArray990[j3] = 0;
  6873.  
  6874. for(int l3 = 0; l3 < 5; l3++)
  6875. {
  6876. atPlayerActions[l3] = null;
  6877. atPlayerArray[l3] = false;
  6878. }
  6879.  
  6880. anInt1175 = 0;
  6881. anInt1134 = 0;
  6882. anInt986 = 0;
  6883. anInt1288 = 0;
  6884. anInt924 = 0;
  6885. anInt1188 = 0;
  6886. anInt1155 = 0;
  6887. anInt1226 = 0;
  6888. int anInt941 = 0;
  6889. int anInt1260 = 0;
  6890. resetImageProducers2();
  6891. return;
  6892. }
  6893. if(k == 3)
  6894. {
  6895. loginMessage1 = "";
  6896. loginMessage2 = "Invalid username or password.";
  6897. return;
  6898. }
  6899. if(k == 4)
  6900. {
  6901. loginMessage1 = "Your account has been disabled.";
  6902. loginMessage2 = "Please check your message-center for details.";
  6903. return;
  6904. }
  6905. if(k == 5)
  6906. {
  6907. loginMessage1 = "Your account is already logged in.";
  6908. loginMessage2 = "Try again in 60 secs...";
  6909. return;
  6910. }
  6911. if(k == 6)
  6912. {
  6913. loginMessage1 = "Hidden Mirage has been updated!";
  6914. loginMessage2 = "Please reload this page.";
  6915. return;
  6916. }
  6917. if(k == 7)
  6918. {
  6919. loginMessage1 = "This world is full.";
  6920. loginMessage2 = "Please use a different world.";
  6921. return;
  6922. }
  6923. if(k == 8)
  6924. {
  6925. loginMessage1 = "Unable to connect.";
  6926. loginMessage2 = "Login server offline.";
  6927. return;
  6928. }
  6929. if(k == 9)
  6930. {
  6931. loginMessage1 = "Login limit exceeded.";
  6932. loginMessage2 = "Too many connections from your address.";
  6933. return;
  6934. }
  6935. if(k == 10)
  6936. {
  6937. loginMessage1 = "Unable to connect.";
  6938. loginMessage2 = "Bad session id.";
  6939. return;
  6940. }
  6941. if(k == 11)
  6942. {
  6943. loginMessage2 = "Login server rejected session.";
  6944. loginMessage2 = "Please try again.";
  6945. return;
  6946. }
  6947. if(k == 12)
  6948. {
  6949. loginMessage1 = "You need a members account to login to this world.";
  6950. loginMessage2 = "Please subscribe, or use a different world.";
  6951. return;
  6952. }
  6953. if(k == 13)
  6954. {
  6955. loginMessage1 = "Could not complete login.";
  6956. loginMessage2 = "Please try using a different world.";
  6957. return;
  6958. }
  6959. if(k == 14)
  6960. {
  6961. loginMessage1 = "The server is being updated.";
  6962. loginMessage2 = "Please wait 1 minute and try again.";
  6963. return;
  6964. }
  6965. if(k == 15)
  6966. {
  6967. loggedIn = true;
  6968. stream.currentOffset = 0;
  6969. inStream.currentOffset = 0;
  6970. pktType = -1;
  6971. anInt841 = -1;
  6972. anInt842 = -1;
  6973. anInt843 = -1;
  6974. pktSize = 0;
  6975. anInt1009 = 0;
  6976. anInt1104 = 0;
  6977. menuActionRow = 0;
  6978. menuOpen = false;
  6979. aLong824 = System.currentTimeMillis();
  6980. return;
  6981. }
  6982. if(k == 16)
  6983. {
  6984. loginMessage1 = "Login attempts exceeded.";
  6985. loginMessage2 = "Please wait 1 minute and try again.";
  6986. return;
  6987. }
  6988. if(k == 17)
  6989. {
  6990. loginMessage1 = "You are standing in a members-only area.";
  6991. loginMessage2 = "To play on this world move to a free area first";
  6992. return;
  6993. }
  6994. if(k == 20)
  6995. {
  6996. loginMessage1 = "Invalid loginserver requested";
  6997. loginMessage2 = "Please try using a different world.";
  6998. return;
  6999. }
  7000. if(k == 21)
  7001. {
  7002. for(int k1 = socketStream.read(); k1 >= 0; k1--)
  7003. {
  7004. loginMessage1 = "You have only just left another world";
  7005. loginMessage2 = "Your profile will be transferred in: " + k1 + " seconds";
  7006. drawLoginScreen(true);
  7007. try
  7008. {
  7009. Thread.sleep(1000L);
  7010. }
  7011. catch(Exception _ex) { }
  7012. }
  7013.  
  7014. login(s, s1, flag);
  7015. return;
  7016. }
  7017. if(k == -1)
  7018. {
  7019. if(i1 == 0)
  7020. {
  7021. if(loginFailures < 6)
  7022. {
  7023. try
  7024. {
  7025. Thread.sleep(2000L);
  7026. }
  7027. catch(Exception _ex) { }
  7028. loginFailures++;
  7029. login(s, s1, flag);
  7030. return;
  7031. } else
  7032. {
  7033. loginMessage1 = "The server has updated!";
  7034. loginMessage2 = "Please redownload/reload";
  7035. return;
  7036. }
  7037. } else
  7038. {
  7039. loginMessage1 = "No response from server";
  7040. loginMessage2 = "Please try using a different world.";
  7041. return;
  7042. }
  7043. } else
  7044. {
  7045. System.out.println("response:" + k);
  7046. loginMessage1 = "Unexpected server response";
  7047. loginMessage2 = "Please try using a different world.";
  7048. return;
  7049. }
  7050. }
  7051. catch(IOException _ex)
  7052. {
  7053. loginMessage1 = "";
  7054. }
  7055. loginMessage2 = "Error connecting to server.";
  7056. }
  7057.  
  7058. 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) {
  7059. byte byte0 = 104;
  7060. byte byte1 = 104;
  7061. for(int l2 = 0; l2 < byte0; l2++) {
  7062. for(int i3 = 0; i3 < byte1; i3++) {
  7063. anIntArrayArray901[l2][i3] = 0;
  7064. anIntArrayArray825[l2][i3] = 0x5f5e0ff;
  7065. }
  7066. }
  7067. int j3 = j2;
  7068. int k3 = j1;
  7069. anIntArrayArray901[j2][j1] = 99;
  7070. anIntArrayArray825[j2][j1] = 0;
  7071. int l3 = 0;
  7072. int i4 = 0;
  7073. bigX[l3] = j2;
  7074. bigY[l3++] = j1;
  7075. boolean flag1 = false;
  7076. int j4 = bigX.length;
  7077. int ai[][] = aClass11Array1230[plane].anIntArrayArray294;
  7078. while(i4 != l3)
  7079. {
  7080. j3 = bigX[i4];
  7081. k3 = bigY[i4];
  7082. i4 = (i4 + 1) % j4;
  7083. if(j3 == k2 && k3 == i2)
  7084. {
  7085. flag1 = true;
  7086. break;
  7087. }
  7088. if(i1 != 0)
  7089. {
  7090. if((i1 < 5 || i1 == 10) && aClass11Array1230[plane].method219(k2, j3, k3, j, i1 - 1, i2))
  7091. {
  7092. flag1 = true;
  7093. break;
  7094. }
  7095. if(i1 < 10 && aClass11Array1230[plane].method220(k2, i2, k3, i1 - 1, j, j3))
  7096. {
  7097. flag1 = true;
  7098. break;
  7099. }
  7100. }
  7101. if(k1 != 0 && k != 0 && aClass11Array1230[plane].method221(i2, k2, j3, k, l1, k1, k3))
  7102. {
  7103. flag1 = true;
  7104. break;
  7105. }
  7106. int l4 = anIntArrayArray825[j3][k3] + 1;
  7107. if(j3 > 0 && anIntArrayArray901[j3 - 1][k3] == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0)
  7108. {
  7109. bigX[l3] = j3 - 1;
  7110. bigY[l3] = k3;
  7111. l3 = (l3 + 1) % j4;
  7112. anIntArrayArray901[j3 - 1][k3] = 2;
  7113. anIntArrayArray825[j3 - 1][k3] = l4;
  7114. }
  7115. if(j3 < byte0 - 1 && anIntArrayArray901[j3 + 1][k3] == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0)
  7116. {
  7117. bigX[l3] = j3 + 1;
  7118. bigY[l3] = k3;
  7119. l3 = (l3 + 1) % j4;
  7120. anIntArrayArray901[j3 + 1][k3] = 8;
  7121. anIntArrayArray825[j3 + 1][k3] = l4;
  7122. }
  7123. if(k3 > 0 && anIntArrayArray901[j3][k3 - 1] == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0)
  7124. {
  7125. bigX[l3] = j3;
  7126. bigY[l3] = k3 - 1;
  7127. l3 = (l3 + 1) % j4;
  7128. anIntArrayArray901[j3][k3 - 1] = 1;
  7129. anIntArrayArray825[j3][k3 - 1] = l4;
  7130. }
  7131. if(k3 < byte1 - 1 && anIntArrayArray901[j3][k3 + 1] == 0 && (ai[j3][k3 + 1] & 0x1280120) == 0)
  7132. {
  7133. bigX[l3] = j3;
  7134. bigY[l3] = k3 + 1;
  7135. l3 = (l3 + 1) % j4;
  7136. anIntArrayArray901[j3][k3 + 1] = 4;
  7137. anIntArrayArray825[j3][k3 + 1] = l4;
  7138. }
  7139. 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)
  7140. {
  7141. bigX[l3] = j3 - 1;
  7142. bigY[l3] = k3 - 1;
  7143. l3 = (l3 + 1) % j4;
  7144. anIntArrayArray901[j3 - 1][k3 - 1] = 3;
  7145. anIntArrayArray825[j3 - 1][k3 - 1] = l4;
  7146. }
  7147. 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)
  7148. {
  7149. bigX[l3] = j3 + 1;
  7150. bigY[l3] = k3 - 1;
  7151. l3 = (l3 + 1) % j4;
  7152. anIntArrayArray901[j3 + 1][k3 - 1] = 9;
  7153. anIntArrayArray825[j3 + 1][k3 - 1] = l4;
  7154. }
  7155. 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)
  7156. {
  7157. bigX[l3] = j3 - 1;
  7158. bigY[l3] = k3 + 1;
  7159. l3 = (l3 + 1) % j4;
  7160. anIntArrayArray901[j3 - 1][k3 + 1] = 6;
  7161. anIntArrayArray825[j3 - 1][k3 + 1] = l4;
  7162. }
  7163. 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)
  7164. {
  7165. bigX[l3] = j3 + 1;
  7166. bigY[l3] = k3 + 1;
  7167. l3 = (l3 + 1) % j4;
  7168. anIntArrayArray901[j3 + 1][k3 + 1] = 12;
  7169. anIntArrayArray825[j3 + 1][k3 + 1] = l4;
  7170. }
  7171. }
  7172. anInt1264 = 0;
  7173. if(!flag1)
  7174. {
  7175. if(flag)
  7176. {
  7177. int i5 = 100;
  7178. for(int k5 = 1; k5 < 2; k5++)
  7179. {
  7180. for(int i6 = k2 - k5; i6 <= k2 + k5; i6++)
  7181. {
  7182. for(int l6 = i2 - k5; l6 <= i2 + k5; l6++)
  7183. if(i6 >= 0 && l6 >= 0 && i6 < 104 && l6 < 104 && anIntArrayArray825[i6][l6] < i5)
  7184. {
  7185. i5 = anIntArrayArray825[i6][l6];
  7186. j3 = i6;
  7187. k3 = l6;
  7188. anInt1264 = 1;
  7189. flag1 = true;
  7190. }
  7191.  
  7192. }
  7193.  
  7194. if(flag1)
  7195. break;
  7196. }
  7197.  
  7198. }
  7199. if(!flag1)
  7200. return false;
  7201. }
  7202. i4 = 0;
  7203. bigX[i4] = j3;
  7204. bigY[i4++] = k3;
  7205. int l5;
  7206. for(int j5 = l5 = anIntArrayArray901[j3][k3]; j3 != j2 || k3 != j1; j5 = anIntArrayArray901[j3][k3])
  7207. {
  7208. if(j5 != l5)
  7209. {
  7210. l5 = j5;
  7211. bigX[i4] = j3;
  7212. bigY[i4++] = k3;
  7213. }
  7214. if((j5 & 2) != 0)
  7215. j3++;
  7216. else
  7217. if((j5 & 8) != 0)
  7218. j3--;
  7219. if((j5 & 1) != 0)
  7220. k3++;
  7221. else
  7222. if((j5 & 4) != 0)
  7223. k3--;
  7224. }
  7225. // if(cancelWalk) { return i4 > 0; }
  7226.  
  7227.  
  7228. if(i4 > 0)
  7229. {
  7230. int k4 = i4;
  7231. if(k4 > 25)
  7232. k4 = 25;
  7233. i4--;
  7234. int k6 = bigX[i4];
  7235. int i7 = bigY[i4];
  7236. anInt1288 += k4;
  7237. if(anInt1288 >= 92)
  7238. {
  7239. stream.createFrame(36);
  7240. stream.writeDWord(0);
  7241. anInt1288 = 0;
  7242. }
  7243. if(i == 0)
  7244. {
  7245. stream.createFrame(164);
  7246. stream.writeWordBigEndian(k4 + k4 + 3);
  7247. }
  7248. if(i == 1)
  7249. {
  7250. stream.createFrame(248);
  7251. stream.writeWordBigEndian(k4 + k4 + 3 + 14);
  7252. }
  7253. if(i == 2)
  7254. {
  7255. stream.createFrame(98);
  7256. stream.writeWordBigEndian(k4 + k4 + 3);
  7257. }
  7258. stream.method433(k6 + baseX);
  7259. destX = bigX[0];
  7260. destY = bigY[0];
  7261. for(int j7 = 1; j7 < k4; j7++)
  7262. {
  7263. i4--;
  7264. stream.writeWordBigEndian(bigX[i4] - k6);
  7265. stream.writeWordBigEndian(bigY[i4] - i7);
  7266. }
  7267.  
  7268. stream.method431(i7 + baseY);
  7269. stream.method424(super.keyArray[5] != 1 ? 0 : 1);
  7270. return true;
  7271. }
  7272. return i != 1;
  7273. }
  7274.  
  7275. public void method86(Stream stream)
  7276. {
  7277. for(int j = 0; j < anInt893; j++)
  7278. {
  7279. int k = anIntArray894[j];
  7280. NPC npc = npcArray[k];
  7281. int l = stream.readUnsignedByte();
  7282. if((l & 0x10) != 0)
  7283. {
  7284. int i1 = stream.method434();
  7285. if(i1 == 65535)
  7286. i1 = -1;
  7287. int i2 = stream.readUnsignedByte();
  7288. if(i1 == npc.anim && i1 != -1)
  7289. {
  7290. int l2 = Animation.anims[i1].anInt365;
  7291. if(l2 == 1)
  7292. {
  7293. npc.anInt1527 = 0;
  7294. npc.anInt1528 = 0;
  7295. npc.anInt1529 = i2;
  7296. npc.anInt1530 = 0;
  7297. }
  7298. if(l2 == 2)
  7299. npc.anInt1530 = 0;
  7300. } else
  7301. if(i1 == -1 || npc.anim == -1 || Animation.anims[i1].anInt359 >= Animation.anims[npc.anim].anInt359)
  7302. {
  7303. npc.anim = i1;
  7304. npc.anInt1527 = 0;
  7305. npc.anInt1528 = 0;
  7306. npc.anInt1529 = i2;
  7307. npc.anInt1530 = 0;
  7308. npc.anInt1542 = npc.smallXYIndex;
  7309. }
  7310. }
  7311. if((l & 8) != 0)
  7312. {
  7313. int j1 = stream.method426();
  7314. int j2 = stream.method427();
  7315. npc.updateHitData(j2, j1, loopCycle);
  7316. npc.loopCycleStatus = loopCycle + 300;
  7317. npc.currentHealth = stream.method426();
  7318. npc.maxHealth = stream.readUnsignedByte();
  7319. }
  7320. if((l & 0x80) != 0)
  7321. {
  7322. npc.anInt1520 = stream.readUnsignedWord();
  7323. int k1 = stream.readDWord();
  7324. npc.anInt1524 = k1 >> 16;
  7325. npc.anInt1523 = loopCycle + (k1 & 0xffff);
  7326. npc.anInt1521 = 0;
  7327. npc.anInt1522 = 0;
  7328. if(npc.anInt1523 > loopCycle)
  7329. npc.anInt1521 = -1;
  7330. if(npc.anInt1520 == 65535)
  7331. npc.anInt1520 = -1;
  7332. }
  7333. if((l & 0x20) != 0)
  7334. {
  7335. npc.interactingEntity = stream.readUnsignedWord();
  7336. if(npc.interactingEntity == 65535)
  7337. npc.interactingEntity = -1;
  7338. }
  7339. if((l & 1) != 0)
  7340. {
  7341. npc.textSpoken = stream.readString();
  7342. npc.textCycle = 100;
  7343. // entityMessage(npc);
  7344.  
  7345. }
  7346. if((l & 0x40) != 0)
  7347. {
  7348. int l1 = stream.method427();
  7349. int k2 = stream.method428();
  7350. npc.updateHitData(k2, l1, loopCycle);
  7351. npc.loopCycleStatus = loopCycle + 300;
  7352. npc.currentHealth = stream.method428();
  7353. npc.maxHealth = stream.method427();
  7354. }
  7355. if((l & 2) != 0)
  7356. {
  7357. npc.desc = EntityDef.forID(stream.method436());
  7358. npc.anInt1540 = npc.desc.aByte68;
  7359. npc.anInt1504 = npc.desc.anInt79;
  7360. npc.anInt1554 = npc.desc.walkAnim;
  7361. npc.anInt1555 = npc.desc.anInt58;
  7362. npc.anInt1556 = npc.desc.anInt83;
  7363. npc.anInt1557 = npc.desc.anInt55;
  7364. npc.anInt1511 = npc.desc.standAnim;
  7365. }
  7366. if((l & 4) != 0)
  7367. {
  7368. npc.anInt1538 = stream.method434();
  7369. npc.anInt1539 = stream.method434();
  7370. }
  7371. }
  7372. }
  7373.  
  7374. public void buildAtNPCMenu(EntityDef entityDef, int i, int j, int k)
  7375. {
  7376. if(menuActionRow >= 400)
  7377. return;
  7378. if(entityDef.childrenIDs != null)
  7379. entityDef = entityDef.method161();
  7380. if(entityDef == null)
  7381. return;
  7382. if(!entityDef.aBoolean84)
  7383. return;
  7384. String s = entityDef.name;
  7385. if(entityDef.combatLevel != 0)
  7386. s = s + combatDiffColor(myPlayer.combatLevel, entityDef.combatLevel) + " (level-" + entityDef.combatLevel + ")";
  7387. if(itemSelected == 1)
  7388. {
  7389. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @yel@" + s;
  7390. menuActionID[menuActionRow] = 582;
  7391. menuActionCmd1[menuActionRow] = i;
  7392. menuActionCmd2[menuActionRow] = k;
  7393. menuActionCmd3[menuActionRow] = j;
  7394. menuActionRow++;
  7395. return;
  7396. }
  7397. if(spellSelected == 1)
  7398. {
  7399. if((spellUsableOn & 2) == 2)
  7400. {
  7401. menuActionName[menuActionRow] = spellTooltip + " @yel@" + s;
  7402. menuActionID[menuActionRow] = 413;
  7403. menuActionCmd1[menuActionRow] = i;
  7404. menuActionCmd2[menuActionRow] = k;
  7405. menuActionCmd3[menuActionRow] = j;
  7406. menuActionRow++;
  7407. }
  7408. } else
  7409. {
  7410. if(entityDef.actions != null)
  7411. {
  7412. for(int l = 4; l >= 0; l--)
  7413. if(entityDef.actions[l] != null && !entityDef.actions[l].equalsIgnoreCase("attack"))
  7414. {
  7415. menuActionName[menuActionRow] = entityDef.actions[l] + " @yel@" + s;
  7416. if(l == 0)
  7417. menuActionID[menuActionRow] = 20;
  7418. if(l == 1)
  7419. menuActionID[menuActionRow] = 412;
  7420. if(l == 2)
  7421. menuActionID[menuActionRow] = 225;
  7422. if(l == 3)
  7423. menuActionID[menuActionRow] = 965;
  7424. if(l == 4)
  7425. menuActionID[menuActionRow] = 478;
  7426. menuActionCmd1[menuActionRow] = i;
  7427. menuActionCmd2[menuActionRow] = k;
  7428. menuActionCmd3[menuActionRow] = j;
  7429. menuActionRow++;
  7430. }
  7431.  
  7432. }
  7433. if(entityDef.actions != null)
  7434. {
  7435. for(int i1 = 4; i1 >= 0; i1--)
  7436. if(entityDef.actions[i1] != null && entityDef.actions[i1].equalsIgnoreCase("attack"))
  7437. {
  7438. char c = '\0';
  7439. if(entityDef.combatLevel > myPlayer.combatLevel)
  7440. c = '\u07D0';
  7441. menuActionName[menuActionRow] = entityDef.actions[i1] + " @yel@" + s;
  7442. if(i1 == 0)
  7443. menuActionID[menuActionRow] = 20 + c;
  7444. if(i1 == 1)
  7445. menuActionID[menuActionRow] = 412 + c;
  7446. if(i1 == 2)
  7447. menuActionID[menuActionRow] = 225 + c;
  7448. if(i1 == 3)
  7449. menuActionID[menuActionRow] = 965 + c;
  7450. if(i1 == 4)
  7451. menuActionID[menuActionRow] = 478 + c;
  7452. menuActionCmd1[menuActionRow] = i;
  7453. menuActionCmd2[menuActionRow] = k;
  7454. menuActionCmd3[menuActionRow] = j;
  7455. menuActionRow++;
  7456. }
  7457.  
  7458. }
  7459. //menuActionName[menuActionRow] = "Examine @yel@" + s + " @gre@(@whi@" + entityDef.type + "@gre@)";
  7460. menuActionName[menuActionRow] = "Examine @yel@" + s;
  7461. menuActionID[menuActionRow] = 1025;
  7462. menuActionCmd1[menuActionRow] = i;
  7463. menuActionCmd2[menuActionRow] = k;
  7464. menuActionCmd3[menuActionRow] = j;
  7465. menuActionRow++;
  7466. }
  7467. }
  7468.  
  7469. public void buildAtPlayerMenu(int i, int j, Player player, int k)
  7470. {
  7471. String colorCode = "whi";
  7472. /*if(player.name.equalsIgnoreCase("genesis") || player.name.equalsIgnoreCase("lightning")) {
  7473. colorCode = "yel";
  7474. }*/
  7475. if(player == myPlayer)
  7476. return;
  7477. if(menuActionRow >= 400)
  7478. return;
  7479. String s;
  7480. if(player.skill == 0) {
  7481. //if(player.name.equalsIgnoreCase("lightning")) {
  7482. //s = player.name;
  7483. //} else {
  7484. s = player.name + combatDiffColor(myPlayer.combatLevel, player.combatLevel) + " (level-" + player.combatLevel + ")";
  7485. // }
  7486. } else {
  7487. s = player.name + " (skill-" + player.skill + ")";
  7488. }
  7489. if(itemSelected == 1)
  7490. {
  7491. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @"+ colorCode +"@" + s;
  7492. menuActionID[menuActionRow] = 491;
  7493. menuActionCmd1[menuActionRow] = j;
  7494. menuActionCmd2[menuActionRow] = i;
  7495. menuActionCmd3[menuActionRow] = k;
  7496. menuActionRow++;
  7497. } else
  7498. if(spellSelected == 1)
  7499. {
  7500. if((spellUsableOn & 8) == 8)
  7501. {
  7502. menuActionName[menuActionRow] = spellTooltip + " @"+ colorCode +"@" + s;
  7503. menuActionID[menuActionRow] = 365;
  7504. menuActionCmd1[menuActionRow] = j;
  7505. menuActionCmd2[menuActionRow] = i;
  7506. menuActionCmd3[menuActionRow] = k;
  7507. menuActionRow++;
  7508. }
  7509. } else
  7510. {
  7511. for(int l = 4; l >= 0; l--)
  7512. if(atPlayerActions[l] != null)
  7513. {
  7514. menuActionName[menuActionRow] = atPlayerActions[l] + " @"+ colorCode +"@" + s;
  7515. char c = '\0';
  7516. if(atPlayerActions[l].equalsIgnoreCase("attack"))
  7517. {
  7518. if(player.combatLevel > myPlayer.combatLevel)
  7519. c = '\u07D0';
  7520. if(myPlayer.team != 0 && player.team != 0)
  7521. if(myPlayer.team == player.team)
  7522. c = '\u07D0';
  7523. else
  7524. c = '\0';
  7525. } else
  7526. if(atPlayerArray[l])
  7527. c = '\u07D0';
  7528. if(l == 0)
  7529. menuActionID[menuActionRow] = 561 + c;
  7530. if(l == 1)
  7531. menuActionID[menuActionRow] = 779 + c;
  7532. if(l == 2)
  7533. menuActionID[menuActionRow] = 27 + c;
  7534. if(l == 3)
  7535. menuActionID[menuActionRow] = 577 + c;
  7536. if(l == 4)
  7537. menuActionID[menuActionRow] = 729 + c;
  7538. menuActionCmd1[menuActionRow] = j;
  7539. menuActionCmd2[menuActionRow] = i;
  7540. menuActionCmd3[menuActionRow] = k;
  7541. menuActionRow++;
  7542. }
  7543.  
  7544. }
  7545. for(int i1 = 0; i1 < menuActionRow; i1++)
  7546. if(menuActionID[i1] == 516)
  7547. {
  7548. menuActionName[i1] = "Walk here @"+ colorCode +"@" + s;
  7549. return;
  7550. }
  7551.  
  7552. }
  7553.  
  7554. public void method89(Class30_Sub1 class30_sub1)
  7555. {
  7556. int i = 0;
  7557. int j = -1;
  7558. int k = 0;
  7559. int l = 0;
  7560. if(class30_sub1.anInt1296 == 0)
  7561. i = worldController.method300(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7562. if(class30_sub1.anInt1296 == 1)
  7563. i = worldController.method301(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7564. if(class30_sub1.anInt1296 == 2)
  7565. i = worldController.method302(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7566. if(class30_sub1.anInt1296 == 3)
  7567. i = worldController.method303(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7568. if(i != 0)
  7569. {
  7570. int i1 = worldController.method304(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298, i);
  7571. j = i >> 14 & 0x7fff;
  7572. k = i1 & 0x1f;
  7573. l = i1 >> 6;
  7574. }
  7575. class30_sub1.anInt1299 = j;
  7576. class30_sub1.anInt1301 = k;
  7577. class30_sub1.anInt1300 = l;
  7578. }
  7579.  
  7580. public final void method90() {
  7581. for (int index = 0; index < anInt1062; index++) {
  7582. //if (anIntArray1250[index] <= 0) {
  7583. boolean flag1 = false;
  7584. try {
  7585. Stream stream = Sounds.method241(anIntArray1241[index], anIntArray1207[index]);
  7586. new SoundPlayer((InputStream) new ByteArrayInputStream(stream.buffer, 0, stream.currentOffset), soundVolume[index], anIntArray1250[index]);
  7587. if (System.currentTimeMillis() + (long) (stream.currentOffset / 22) > aLong1172 + (long) (anInt1257 / 22)) {
  7588. anInt1257 = stream.currentOffset;
  7589. aLong1172 = System.currentTimeMillis();
  7590. }
  7591. } catch (Exception exception) {
  7592. exception.printStackTrace();
  7593. }
  7594. if (!flag1 || anIntArray1250[index] == -5) {
  7595. anInt1062--;
  7596. for (int j = index; j < anInt1062; j++) {
  7597. anIntArray1207[j] = anIntArray1207 [j + 1];
  7598. anIntArray1241[j] = anIntArray1241[j + 1];
  7599. anIntArray1250[j] = anIntArray1250[j + 1];
  7600. soundVolume[j] = soundVolume[j + 1];
  7601. }
  7602. index--;
  7603. } else {
  7604. anIntArray1250[index] = -5;
  7605. }
  7606. /*} else {
  7607. anIntArray1250[index]--;
  7608. }*/
  7609. }
  7610.  
  7611. if (prevSong > 0) {
  7612. prevSong -= 20;
  7613. if (prevSong < 0)
  7614. prevSong = 0;
  7615. if (prevSong == 0 && musicEnabled) {
  7616. nextSong = currentSong;
  7617. songChanging = true;
  7618. onDemandFetcher.method558(2, nextSong);
  7619. }
  7620. }
  7621. }
  7622.  
  7623. public void playSound(int id, int type, int delay, int volume) {
  7624. anIntArray1207[anInt1062] = id;
  7625. anIntArray1241[anInt1062] = type;
  7626. anIntArray1250[anInt1062] = delay + Sounds.anIntArray326[id];
  7627. soundVolume[anInt1062] = volume;
  7628. anInt1062++;
  7629. }
  7630.  
  7631. public static void playMusic() {
  7632. try {
  7633. Sequencer sequencer = MidiSystem.getSequencer();
  7634. if (sequencer == null)
  7635. throw new MidiUnavailableException();
  7636. sequencer.open();
  7637. FileInputStream is = new FileInputStream(signlink.findcachedir() + "theme.mid");
  7638. Sequence mySeq = MidiSystem.getSequence(is);
  7639. sequencer.setSequence(mySeq);
  7640. sequencer.start();
  7641. } catch (Exception e) {
  7642. e.printStackTrace();
  7643. }
  7644. }
  7645.  
  7646. private int buttonMusicID;
  7647.  
  7648. public boolean button(int X, int Y) {
  7649. try {
  7650. //if(!aBoolean1157){
  7651. if(X >= 728 && X <= 763 && Y >= 480 && Y <= 515) {
  7652. if(!signlink.musicOn) {
  7653. if(signlink.music != null){
  7654. signlink.musicOn = false;
  7655. signlink.music.stop();
  7656. buttonMusicID = 0;
  7657. drawSoundButton();
  7658. }
  7659. } else {
  7660. if(signlink.music != null){
  7661. signlink.musicOn = true;
  7662. signlink.music.start();
  7663. buttonMusicID = 1;
  7664. drawSoundButton();
  7665. }
  7666. }
  7667. return true;
  7668. }
  7669. //}
  7670. } catch(Exception exception) {
  7671. exception.printStackTrace(); return false;
  7672. }
  7673. return false;
  7674. }
  7675. public void playMusicButton() {
  7676. if(signlink.musicOn) {
  7677. playSong(0);
  7678. }
  7679. }
  7680. public void musicButton() {
  7681. try {
  7682. if(!signlink.musicOn) {
  7683. signlink.musicOn = true;
  7684. buttonMusicID = 0;
  7685. drawSoundButton();
  7686. playSong(0);
  7687. } else {
  7688. signlink.musicOn = false;
  7689. buttonMusicID = 1;
  7690. drawSoundButton();
  7691. stopMidi();
  7692. currentSong = -1;
  7693. nextSong = -1;
  7694. prevSong = 0;
  7695. }
  7696. writeSettings();
  7697. } catch(Exception exception) {
  7698. exception.printStackTrace();
  7699. }
  7700. }
  7701. public boolean drawSoundButton() {
  7702. Graphics g = getGameComponent().getGraphics();
  7703. try {
  7704. if(buttonLocation(1) == null) return false;
  7705. File ButtonB = new File(buttonLocation(1));
  7706. Image buttonA = Toolkit.getDefaultToolkit().getImage(buttonLocation(1));
  7707. g.drawImage(buttonA,724,456,this);
  7708. return true;
  7709. } catch(Exception exception) {
  7710. exception.printStackTrace();
  7711. }
  7712. return false;
  7713. }
  7714. public String buttonLocation(int button) {
  7715. try {
  7716. switch(button){
  7717. case 1: buttonMusicID = signlink.musicOn ?0:1; return signlink.findcachedir()+"Sprites/Backgrounds/Login/Login_"+buttonMusicID+".PNG";
  7718. }
  7719. } catch(Exception exception){
  7720. exception.printStackTrace();
  7721. }
  7722. return null;
  7723. }
  7724.  
  7725. public boolean drawWorldSelectButton() {
  7726. Graphics g = getGameComponent().getGraphics();
  7727. try {
  7728. if(worldSelect(1) == null) return false;
  7729. File ButtonB = new File(worldSelect(1));
  7730. Image buttonA = Toolkit.getDefaultToolkit().getImage(worldSelect(1));
  7731. g.drawImage(buttonA,5,456,this);
  7732. smallText.method382(0xffff00, 50, "World Select", 25, true);
  7733. return true;
  7734. } catch(Exception exception) {
  7735. exception.printStackTrace();
  7736. }
  7737. return false;
  7738. }
  7739. public String worldSelect(int button) {
  7740. try {
  7741. switch(button){
  7742. case 0:
  7743. case 1:
  7744. return signlink.findcachedir()+"Sprites/Backgrounds/Login/WORLD_SELECT.PNG";
  7745. }
  7746. } catch(Exception exception){
  7747. exception.printStackTrace();
  7748. }
  7749. return null;
  7750. }
  7751.  
  7752. void startUp() {
  7753. new Thread(new MemoryMonitor()).start();
  7754. drawLoadingText(20, "Starting up");
  7755. new CacheDownloader(this).downloadCache();
  7756. if (signlink.sunjava)
  7757. super.minDelay = 5;
  7758. if (aBoolean993) {
  7759. // rsAlreadyLoaded = true;
  7760. // return;
  7761. }
  7762. aBoolean993 = true;
  7763. boolean flag = true;
  7764. String s = getDocumentBaseHost();
  7765. if (signlink.cache_dat != null) {
  7766. for (int i = 0; i < 5; i++)
  7767. decompressors[i] = new Decompressor(signlink.cache_dat,
  7768. signlink.cache_idx[i], i + 1);
  7769. }
  7770. //setNewMaps();
  7771. //repackCacheIndex(4);
  7772. try {
  7773. titleStreamLoader = streamLoaderForName(1, "title screen", "title",
  7774. expectedCRCs[1], 25);
  7775. smallText = new TextDrawingArea(false, "p11_full",
  7776. titleStreamLoader);
  7777. regularText = new TextDrawingArea(false, "p12_full",
  7778. titleStreamLoader);
  7779. boldText = new TextDrawingArea(false, "b12_full",
  7780. titleStreamLoader);
  7781. TextDrawingArea aTextDrawingArea_1273 = new TextDrawingArea(true,
  7782. "q8_full", titleStreamLoader);
  7783. drawLogo();
  7784. loadTitleScreen();
  7785. StreamLoader streamLoader = streamLoaderForName(2, "config",
  7786. "config", expectedCRCs[2], 30);
  7787. StreamLoader streamLoader_1 = streamLoaderForName(3, "interface",
  7788. "interface", expectedCRCs[3], 35);
  7789. StreamLoader streamLoader_2 = streamLoaderForName(4, "2d graphics",
  7790. "media", expectedCRCs[4], 40);
  7791. StreamLoader streamLoader_3 = streamLoaderForName(6, "textures",
  7792. "textures", expectedCRCs[6], 45);
  7793. StreamLoader streamLoader_4 = streamLoaderForName(7, "chat system",
  7794. "wordenc", expectedCRCs[7], 50);
  7795. StreamLoader streamLoader_5 = streamLoaderForName(8,
  7796. "sound effects", "sounds", expectedCRCs[8], 55);
  7797. byteGroundArray = new byte[4][104][104];
  7798. intGroundArray = new int[4][105][105];
  7799. worldController = new WorldController(intGroundArray);
  7800. for (int j = 0; j < 4; j++)
  7801. aClass11Array1230[j] = new Class11();
  7802.  
  7803. aClass30_Sub2_Sub1_Sub1_1263 = new Sprite(512, 512);
  7804. StreamLoader streamLoader_6 = streamLoaderForName(5, "update list",
  7805. "versionlist", expectedCRCs[5], 60);
  7806. drawLoadingText(60, "Connecting to update server");
  7807. onDemandFetcher = new OnDemandFetcher();
  7808. onDemandFetcher.start(streamLoader_6, this);
  7809. Model.method459(onDemandFetcher.getModelCount(), onDemandFetcher);
  7810. preloadModels();
  7811. //models();
  7812. drawLoadingText(80, "Unpacking media");
  7813. infinity = new Sprite("Other/infinity");
  7814. /* Custom sprite unpacking */
  7815. loadExtraSprites();
  7816. emptyOrb = new Sprite("emptyorb");
  7817. hoverOrb = new Sprite("hoverorb");
  7818. hoverorbrun2 = new Sprite("hoverorbrun2");
  7819. hoverorbrun = new Sprite("hoverorbrun");
  7820. runClick = new Sprite("runclick");
  7821. runorb = new Sprite("runorb");
  7822. hitPointsFill = new Sprite("hitpointsfill");
  7823. prayerFill = new Sprite("prayerfill");
  7824. hitPointsIcon = new Sprite("hitpointsicon");
  7825. chatArea = new Sprite("chatarea");
  7826. musicLoginButton = new Sprite("musicbutton");
  7827. tabArea = new Sprite("tabarea");
  7828. mapArea = new Sprite("maparea");
  7829. prayerIcon = new Sprite("prayericon");
  7830. worldMapIcon = new Sprite("mapicon");
  7831. worldMapIconH = new Sprite("mapiconh");
  7832. multiOverlay = new Sprite(streamLoader_2, "overlay_multiway", 0);
  7833. /**/
  7834. mapBack = new Background(streamLoader_2, "mapback", 0);
  7835. for (int c1 = 0; c1 <= 3; c1++)
  7836. chatButtons[c1] = new Sprite(streamLoader_2, "chatbuttons", c1);
  7837. for (int j3 = 0; j3 <= 14; j3++)
  7838. sideIcons[j3] = new Sprite(streamLoader_2, "sideicons", j3);
  7839. for (int r1 = 0; r1 < 5; r1++)
  7840. redStones[r1] = new Sprite("redstones " + r1);
  7841. compass = new Sprite(streamLoader_2, "compass", 0);
  7842. mapEdge = new Sprite(streamLoader_2, "mapedge", 0);
  7843. mapEdge.method345();
  7844. try {
  7845. for (int k3 = 0; k3 < 100; k3++)
  7846. mapScenes[k3] = new Background(streamLoader_2, "mapscene",
  7847. k3);
  7848. } catch (Exception _ex) {
  7849. }
  7850. try {
  7851. for (int l3 = 0; l3 < 100; l3++)
  7852. mapFunctions[l3] = new Sprite(streamLoader_2,
  7853. "mapfunction", l3);
  7854. } catch (Exception _ex) {
  7855. }
  7856. try {
  7857. for (int i4 = 0; i4 < 20; i4++)
  7858. hitMarks[i4] = new Sprite(streamLoader_2, "hitmarks", i4);
  7859. } catch (Exception _ex) {
  7860. }
  7861. try {
  7862. for (int h1 = 0; h1 < 6; h1++)
  7863. headIconsHint[h1] = new Sprite(streamLoader_2,
  7864. "headicons_hint", h1);
  7865. } catch (Exception _ex) {
  7866. }
  7867. try {
  7868. for (int j4 = 0; j4 < 8; j4++)
  7869. headIcons[j4] = new Sprite(streamLoader_2,
  7870. "headicons_prayer", j4);
  7871. for (int j45 = 0; j45 < 3; j45++)
  7872. skullIcons[j45] = new Sprite(streamLoader_2,
  7873. "headicons_pk", j45);
  7874. } catch (Exception _ex) {
  7875. }
  7876. mapFlag = new Sprite(streamLoader_2, "mapmarker", 0);
  7877. mapMarker = new Sprite(streamLoader_2, "mapmarker", 1);
  7878. for (int k4 = 0; k4 < 8; k4++)
  7879. crosses[k4] = new Sprite(streamLoader_2, "cross", k4);
  7880.  
  7881. mapDotItem = new Sprite(streamLoader_2, "mapdots", 0);
  7882. mapDotNPC = new Sprite(streamLoader_2, "mapdots", 1);
  7883. mapDotPlayer = new Sprite(streamLoader_2, "mapdots", 2);
  7884. mapDotFriend = new Sprite(streamLoader_2, "mapdots", 3);
  7885. mapDotTeam = new Sprite(streamLoader_2, "mapdots", 4);
  7886. mapDotClan = new Sprite(streamLoader_2, "mapdots", 5);
  7887. scrollBar1 = new Sprite(streamLoader_2, "scrollbar", 0);
  7888. scrollBar2 = new Sprite(streamLoader_2, "scrollbar", 1);
  7889.  
  7890. for (int l4 = 0; l4 < 3; l4++)
  7891. modIcons[l4] = new Background(streamLoader_2, "mod_icons", l4);
  7892.  
  7893. Sprite sprite = new Sprite(streamLoader_2, "screenframe", 0);
  7894. leftFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight,
  7895. getGameComponent());
  7896. sprite.method346(0, 0);
  7897. sprite = new Sprite(streamLoader_2, "screenframe", 1);
  7898. topFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight,
  7899. getGameComponent());
  7900. sprite.method346(0, 0);
  7901. sprite = new Sprite(streamLoader_2, "screenframe", 2);
  7902. rightFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight,
  7903. getGameComponent());
  7904. sprite.method346(0, 0);
  7905. sprite = new Sprite(streamLoader_2, "mapedge", 0);
  7906. mapEdgeIP = new RSImageProducer(sprite.myWidth, sprite.myHeight,
  7907. getGameComponent());
  7908. sprite.method346(0, 0);
  7909.  
  7910. int i5 = (int) (Math.random() * 21D) - 10;
  7911. int j5 = (int) (Math.random() * 21D) - 10;
  7912. int k5 = (int) (Math.random() * 21D) - 10;
  7913. int l5 = (int) (Math.random() * 41D) - 20;
  7914. for (int i6 = 0; i6 < 100; i6++) {
  7915. if (mapFunctions[i6] != null)
  7916. mapFunctions[i6].method344(i5 + l5, j5 + l5, k5 + l5);
  7917. if (mapScenes[i6] != null)
  7918. mapScenes[i6].method360(i5 + l5, j5 + l5, k5 + l5);
  7919. }
  7920.  
  7921. drawLoadingText(83, "Unpacking textures");
  7922. Texture.method368(streamLoader_3);
  7923. Texture.method372(0.80000000000000004D);
  7924. Texture.method367();
  7925. drawLoadingText(86, "Unpacking config");
  7926. Animation.unpackConfig(streamLoader);
  7927. ObjectDef.unpackConfig(streamLoader);
  7928. Flo.unpackConfig(streamLoader);
  7929. ItemDef.unpackConfig(streamLoader);
  7930. EntityDef.unpackConfig(streamLoader);
  7931. IDK.unpackConfig(streamLoader);
  7932. SpotAnim.unpackConfig(streamLoader);
  7933. Varp.unpackConfig(streamLoader);
  7934. VarBit.unpackConfig(streamLoader);
  7935. ItemDef.isMembers = isMembers;
  7936. if (!lowMem) {
  7937. drawLoadingText(90, "Unpacking sounds");
  7938. byte abyte0[] = streamLoader_5.getDataForName("sounds.dat");
  7939. Stream stream = new Stream(abyte0);
  7940. Sounds.unpack(stream);
  7941. }
  7942. drawLoadingText(95, "Unpacking interfaces");
  7943. TextDrawingArea aclass30_sub2_sub1_sub4s[] = { smallText,
  7944. regularText, boldText,
  7945. aTextDrawingArea_1273 };
  7946. RSInterface.unpack(streamLoader_1, aclass30_sub2_sub1_sub4s,
  7947. streamLoader_2);
  7948. drawLoadingText(100, "Preparing game engine");
  7949. for (int j6 = 0; j6 < 33; j6++) {
  7950. int k6 = 999;
  7951. int i7 = 0;
  7952. for (int k7 = 0; k7 < 34; k7++) {
  7953. if (mapBack.aByteArray1450[k7 + j6 * mapBack.anInt1452] == 0) {
  7954. if (k6 == 999)
  7955. k6 = k7;
  7956. continue;
  7957. }
  7958. if (k6 == 999)
  7959. continue;
  7960. i7 = k7;
  7961. break;
  7962. }
  7963.  
  7964. //anIntArray968[j6] = k6;
  7965. //anIntArray1057[j6] = i7 - k6;
  7966.  
  7967. anIntArray968[j6] = 0;
  7968. anIntArray1057[j6] = 36;
  7969. }
  7970.  
  7971. for (int y = 5; y < 157; y++) {
  7972. int j7 = 999;
  7973. int l7 = 0;
  7974. for (int j8 = 25; j8 < 172; j8++) {
  7975. if (mapBack.aByteArray1450[j8 + y * mapBack.anInt1452] == 0
  7976. && (j8 > 34 || y > 34)) {
  7977. if (j7 == 999)
  7978. j7 = j8;
  7979. continue;
  7980. }
  7981. if (j7 == 999)
  7982. continue;
  7983. l7 = j8;
  7984. break;
  7985. }
  7986.  
  7987. anIntArray1052[y - 5] = j7 - 25;
  7988. anIntArray1229[y - 5] = l7 - j7;
  7989. }
  7990.  
  7991. Texture.method365(765, 503);
  7992. fullScreenTextureArray = Texture.anIntArray1472;
  7993. Texture.method365(519, 165);
  7994. anIntArray1180 = Texture.anIntArray1472;
  7995. Texture.method365(246, 335);
  7996. anIntArray1181 = Texture.anIntArray1472;
  7997. Texture.method365(512, 334);
  7998. anIntArray1182 = Texture.anIntArray1472;
  7999. int ai[] = new int[9];
  8000. for (int i8 = 0; i8 < 9; i8++) {
  8001. int k8 = 128 + i8 * 32 + 15;
  8002. int l8 = 600 + k8 * 3;
  8003. int i9 = Texture.anIntArray1470[k8];
  8004. ai[i8] = l8 * i9 >> 16;
  8005. }
  8006.  
  8007. WorldController.method310(500, 800, 512, 334, ai);
  8008. Censor.loadConfig(streamLoader_4);
  8009. mouseDetection = new MouseDetection(this);
  8010. startRunnable(mouseDetection, 10);
  8011. Animable_Sub5.clientInstance = this;
  8012. ObjectDef.clientInstance = this;
  8013. EntityDef.clientInstance = this;
  8014. readSettings();
  8015. playMusicButton();
  8016. return;
  8017. } catch (Exception exception) {
  8018. exception.printStackTrace();
  8019. signlink.reporterror("loaderror " + aString1049 + " " + anInt1079);
  8020. }
  8021. loadingError = true;
  8022. }
  8023.  
  8024. public void method91(Stream stream, int i)
  8025. {
  8026. while(stream.bitPosition + 10 < i * 8)
  8027. {
  8028. int j = stream.readBits(11);
  8029. if(j == 2047)
  8030. break;
  8031. if(playerArray[j] == null)
  8032. {
  8033. playerArray[j] = new Player();
  8034. if(aStreamArray895s[j] != null)
  8035. playerArray[j].updatePlayer(aStreamArray895s[j]);
  8036. }
  8037. playerIndices[playerCount++] = j;
  8038. Player player = playerArray[j];
  8039. player.anInt1537 = loopCycle;
  8040. int k = stream.readBits(1);
  8041. if(k == 1)
  8042. anIntArray894[anInt893++] = j;
  8043. int l = stream.readBits(1);
  8044. int i1 = stream.readBits(5);
  8045. if(i1 > 15)
  8046. i1 -= 32;
  8047. int j1 = stream.readBits(5);
  8048. if(j1 > 15)
  8049. j1 -= 32;
  8050. player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1, l == 1);
  8051. }
  8052. stream.finishBitAccess();
  8053. }
  8054.  
  8055. public void processMainScreenClick() {
  8056. if(anInt1021 != 0)
  8057. return;
  8058. if(super.clickMode3 == 1) {
  8059. int i = super.saveClickX - 25 - 545;
  8060. int j = super.saveClickY - 5 - 4;
  8061. if(i >= 0 && j >= 0 && i < 146 && j < 151) {
  8062. i -= 73;
  8063. j -= 75;
  8064. int k = minimapInt1 + minimapInt2 & 0x7ff;
  8065. int i1 = Texture.anIntArray1470[k];
  8066. int j1 = Texture.anIntArray1471[k];
  8067. i1 = i1 * (minimapInt3 + 256) >> 8;
  8068. j1 = j1 * (minimapInt3 + 256) >> 8;
  8069. int k1 = j * i1 + i * j1 >> 11;
  8070. int l1 = j * j1 - i * i1 >> 11;
  8071. int i2 = myPlayer.x + k1 >> 7;
  8072. int j2 = myPlayer.y - l1 >> 7;
  8073. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0, j2, myPlayer.smallX[0], true, i2);
  8074. if(flag1) {
  8075. stream.writeWordBigEndian(i);
  8076. stream.writeWordBigEndian(j);
  8077. stream.writeWord(minimapInt1);
  8078. stream.writeWordBigEndian(57);
  8079. stream.writeWordBigEndian(minimapInt2);
  8080. stream.writeWordBigEndian(minimapInt3);
  8081. stream.writeWordBigEndian(89);
  8082. stream.writeWord(myPlayer.x);
  8083. stream.writeWord(myPlayer.y);
  8084. stream.writeWordBigEndian(anInt1264);
  8085. stream.writeWordBigEndian(63);
  8086. }
  8087. }
  8088. anInt1117++;
  8089. if(anInt1117 > 1151) {
  8090. anInt1117 = 0;
  8091. stream.createFrame(246);
  8092. stream.writeWordBigEndian(0);
  8093. int l = stream.currentOffset;
  8094. if((int)(Math.random() * 2D) == 0)
  8095. stream.writeWordBigEndian(101);
  8096. stream.writeWordBigEndian(197);
  8097. stream.writeWord((int)(Math.random() * 65536D));
  8098. stream.writeWordBigEndian((int)(Math.random() * 256D));
  8099. stream.writeWordBigEndian(67);
  8100. stream.writeWord(14214);
  8101. if((int)(Math.random() * 2D) == 0)
  8102. stream.writeWord(29487);
  8103. stream.writeWord((int)(Math.random() * 65536D));
  8104. if((int)(Math.random() * 2D) == 0)
  8105. stream.writeWordBigEndian(220);
  8106. stream.writeWordBigEndian(180);
  8107. stream.writeBytes(stream.currentOffset - l);
  8108. }
  8109. }
  8110. }
  8111.  
  8112. private String interfaceIntToString(int j) {
  8113. if(j < 0x3b9ac9ff)
  8114. return String.valueOf(j);
  8115. else
  8116. return "*";
  8117. }
  8118.  
  8119. public void showErrorScreen()
  8120. {
  8121. Graphics g = getGameComponent().getGraphics();
  8122. g.setColor(Color.black);
  8123. g.fillRect(0, 0, 765, 503);
  8124. method4(1);
  8125. if(loadingError)
  8126. {
  8127. aBoolean831 = false;
  8128. g.setFont(new Font("Helvetica", 1, 16));
  8129. g.setColor(Color.yellow);
  8130. int k = 35;
  8131. g.drawString("Sorry, an error has occured whilst loading Hidden-Mirage", 30, k);
  8132. k += 50;
  8133. g.setColor(Color.white);
  8134. g.drawString("To fix this try the following (in order):", 30, k);
  8135. k += 50;
  8136. g.setColor(Color.white);
  8137. g.setFont(new Font("Helvetica", 1, 12));
  8138. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, k);
  8139. k += 30;
  8140. g.drawString("2: Try clearing your web-browsers cache from tools->internet options", 30, k);
  8141. k += 30;
  8142. g.drawString("3: Try using a different game-world", 30, k);
  8143. k += 30;
  8144. g.drawString("4: Try rebooting your computer", 30, k);
  8145. k += 30;
  8146. g.drawString("5: Try selecting a different version of Java from the play-game menu", 30, k);
  8147. }
  8148. if(genericLoadingError)
  8149. {
  8150. aBoolean831 = false;
  8151. g.setFont(new Font("Helvetica", 1, 20));
  8152. g.setColor(Color.white);
  8153. g.drawString("Error - unable to load game!", 50, 50);
  8154. g.drawString("To play Hidden Mirage make sure you play from", 50, 100);
  8155. g.drawString("http://www.Hidden-Mirage.tk/", 50, 150);
  8156. }
  8157. if(rsAlreadyLoaded)
  8158. {
  8159. aBoolean831 = false;
  8160. g.setColor(Color.yellow);
  8161. int l = 35;
  8162. g.drawString("Error a copy of Hidden Mirage already appears to be loaded", 30, l);
  8163. l += 50;
  8164. g.setColor(Color.white);
  8165. g.drawString("To fix this try the following (in order):", 30, l);
  8166. l += 50;
  8167. g.setColor(Color.white);
  8168. g.setFont(new Font("Helvetica", 1, 12));
  8169. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, l);
  8170. l += 30;
  8171. g.drawString("2: Try rebooting your computer, and reloading", 30, l);
  8172. l += 30;
  8173. }
  8174. }
  8175.  
  8176. public URL getCodeBase() {
  8177. try {
  8178. return new URL(server +":" + (80 + portOff));
  8179. } catch(Exception _ex) {
  8180. }
  8181. return null;
  8182. }
  8183.  
  8184. public void method95() {
  8185. for(int j = 0; j < npcCount; j++) {
  8186. int k = npcIndices[j];
  8187. NPC npc = npcArray[k];
  8188. if(npc != null)
  8189. method96(npc);
  8190. }
  8191. }
  8192.  
  8193. public void method96(Entity entity)
  8194. {
  8195. if(entity.x < 128 || entity.y < 128 || entity.x >= 13184 || entity.y >= 13184)
  8196. {
  8197. entity.anim = -1;
  8198. entity.anInt1520 = -1;
  8199. entity.anInt1547 = 0;
  8200. entity.anInt1548 = 0;
  8201. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  8202. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  8203. entity.method446();
  8204. }
  8205. if(entity == myPlayer && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776))
  8206. {
  8207. entity.anim = -1;
  8208. entity.anInt1520 = -1;
  8209. entity.anInt1547 = 0;
  8210. entity.anInt1548 = 0;
  8211. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  8212. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  8213. entity.method446();
  8214. }
  8215. if(entity.anInt1547 > loopCycle)
  8216. method97(entity);
  8217. else
  8218. if(entity.anInt1548 >= loopCycle)
  8219. method98(entity);
  8220. else
  8221. method99(entity);
  8222. method100(entity);
  8223. method101(entity); //@todo add size here?
  8224. }
  8225.  
  8226. public void method97(Entity entity)
  8227. {
  8228. int i = entity.anInt1547 - loopCycle;
  8229. int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  8230. int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  8231. entity.x += (j - entity.x) / i;
  8232. entity.y += (k - entity.y) / i;
  8233. entity.anInt1503 = 0;
  8234. if(entity.anInt1549 == 0)
  8235. entity.turnDirection = 1024;
  8236. if(entity.anInt1549 == 1)
  8237. entity.turnDirection = 1536;
  8238. if(entity.anInt1549 == 2)
  8239. entity.turnDirection = 0;
  8240. if(entity.anInt1549 == 3)
  8241. entity.turnDirection = 512;
  8242. }
  8243.  
  8244. public void method98(Entity entity)
  8245. {
  8246. if(entity.anInt1548 == loopCycle || entity.anim == -1 || entity.anInt1529 != 0 || entity.anInt1528 + 1 > Animation.anims[entity.anim].method258(entity.anInt1527))
  8247. {
  8248. int i = entity.anInt1548 - entity.anInt1547;
  8249. int j = loopCycle - entity.anInt1547;
  8250. int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  8251. int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  8252. int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
  8253. int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
  8254. entity.x = (k * (i - j) + i1 * j) / i;
  8255. entity.y = (l * (i - j) + j1 * j) / i;
  8256. }
  8257. entity.anInt1503 = 0;
  8258. if(entity.anInt1549 == 0)
  8259. entity.turnDirection = 1024;
  8260. if(entity.anInt1549 == 1)
  8261. entity.turnDirection = 1536;
  8262. if(entity.anInt1549 == 2)
  8263. entity.turnDirection = 0;
  8264. if(entity.anInt1549 == 3)
  8265. entity.turnDirection = 512;
  8266. entity.anInt1552 = entity.turnDirection;
  8267. }
  8268.  
  8269. public void method99(Entity entity)
  8270. {
  8271. entity.anInt1517 = entity.anInt1511;
  8272. if(entity.smallXYIndex == 0)
  8273. {
  8274. entity.anInt1503 = 0;
  8275. return;
  8276. }
  8277. if(entity.anim != -1 && entity.anInt1529 == 0)
  8278. {
  8279. Animation animation = Animation.anims[entity.anim];
  8280. if(entity.anInt1542 > 0 && animation.anInt363 == 0)
  8281. {
  8282. entity.anInt1503++;
  8283. return;
  8284. }
  8285. if(entity.anInt1542 <= 0 && animation.anInt364 == 0)
  8286. {
  8287. entity.anInt1503++;
  8288. return;
  8289. }
  8290. }
  8291. int i = entity.x;
  8292. int j = entity.y;
  8293. int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  8294. int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  8295. if(k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256)
  8296. {
  8297. entity.x = k;
  8298. entity.y = l;
  8299. return;
  8300. }
  8301. if(i < k)
  8302. {
  8303. if(j < l)
  8304. entity.turnDirection = 1280;
  8305. else
  8306. if(j > l)
  8307. entity.turnDirection = 1792;
  8308. else
  8309. entity.turnDirection = 1536;
  8310. } else
  8311. if(i > k)
  8312. {
  8313. if(j < l)
  8314. entity.turnDirection = 768;
  8315. else
  8316. if(j > l)
  8317. entity.turnDirection = 256;
  8318. else
  8319. entity.turnDirection = 512;
  8320. } else
  8321. if(j < l)
  8322. entity.turnDirection = 1024;
  8323. else
  8324. entity.turnDirection = 0;
  8325. int i1 = entity.turnDirection - entity.anInt1552 & 0x7ff;
  8326. if(i1 > 1024)
  8327. i1 -= 2048;
  8328. int j1 = entity.anInt1555;
  8329. if(i1 >= -256 && i1 <= 256)
  8330. j1 = entity.anInt1554;
  8331. else
  8332. if(i1 >= 256 && i1 < 768)
  8333. j1 = entity.anInt1557;
  8334. else
  8335. if(i1 >= -768 && i1 <= -256)
  8336. j1 = entity.anInt1556;
  8337. if(j1 == -1)
  8338. j1 = entity.anInt1554;
  8339. entity.anInt1517 = j1;
  8340. int k1 = 4;
  8341. if(entity.anInt1552 != entity.turnDirection && entity.interactingEntity == -1 && entity.anInt1504 != 0)
  8342. k1 = 2;
  8343. if(entity.smallXYIndex > 2)
  8344. k1 = 6;
  8345. if(entity.smallXYIndex > 3)
  8346. k1 = 8;
  8347. if(entity.anInt1503 > 0 && entity.smallXYIndex > 1)
  8348. {
  8349. k1 = 8;
  8350. entity.anInt1503--;
  8351. }
  8352. if(entity.aBooleanArray1553[entity.smallXYIndex - 1])
  8353. k1 <<= 1;
  8354. if(k1 >= 8 && entity.anInt1517 == entity.anInt1554 && entity.anInt1505 != -1)
  8355. entity.anInt1517 = entity.anInt1505;
  8356. if(i < k)
  8357. {
  8358. entity.x += k1;
  8359. if(entity.x > k)
  8360. entity.x = k;
  8361. } else
  8362. if(i > k)
  8363. {
  8364. entity.x -= k1;
  8365. if(entity.x < k)
  8366. entity.x = k;
  8367. }
  8368. if(j < l)
  8369. {
  8370. entity.y += k1;
  8371. if(entity.y > l)
  8372. entity.y = l;
  8373. } else
  8374. if(j > l)
  8375. {
  8376. entity.y -= k1;
  8377. if(entity.y < l)
  8378. entity.y = l;
  8379. }
  8380. if(entity.x == k && entity.y == l)
  8381. {
  8382. entity.smallXYIndex--;
  8383. if(entity.anInt1542 > 0)
  8384. entity.anInt1542--;
  8385. }
  8386. }
  8387.  
  8388. public void method100(Entity entity)
  8389. {
  8390. if(entity.anInt1504 == 0)
  8391. return;
  8392. if(entity.interactingEntity != -1 && entity.interactingEntity < 32768)
  8393. {
  8394. NPC npc = npcArray[entity.interactingEntity];
  8395. if(npc != null)
  8396. {
  8397. int i1 = entity.x - npc.x;
  8398. int k1 = entity.y - npc.y;
  8399. if(i1 != 0 || k1 != 0)
  8400. entity.turnDirection = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  8401. }
  8402. }
  8403. if(entity.interactingEntity >= 32768)
  8404. {
  8405. int j = entity.interactingEntity - 32768;
  8406. if(j == unknownInt10)
  8407. j = myPlayerIndex;
  8408. if (j <= playerArray.length) {
  8409. Player player = playerArray[j];
  8410. if(player != null)
  8411. {
  8412. int l1 = entity.x - player.x;
  8413. int i2 = entity.y - player.y;
  8414. if(l1 != 0 || i2 != 0)
  8415. entity.turnDirection = (int)(Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  8416. }
  8417. }
  8418. }
  8419. if((entity.anInt1538 != 0 || entity.anInt1539 != 0) && (entity.smallXYIndex == 0 || entity.anInt1503 > 0))
  8420. {
  8421. int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
  8422. int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
  8423. if(k != 0 || j1 != 0)
  8424. entity.turnDirection = (int)(Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  8425. entity.anInt1538 = 0;
  8426. entity.anInt1539 = 0;
  8427. }
  8428. int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
  8429. if(l != 0)
  8430. {
  8431. if(l < entity.anInt1504 || l > 2048 - entity.anInt1504)
  8432. entity.anInt1552 = entity.turnDirection;
  8433. else
  8434. if(l > 1024)
  8435. entity.anInt1552 -= entity.anInt1504;
  8436. else
  8437. entity.anInt1552 += entity.anInt1504;
  8438. entity.anInt1552 &= 0x7ff;
  8439. if(entity.anInt1517 == entity.anInt1511 && entity.anInt1552 != entity.turnDirection)
  8440. {
  8441. if(entity.anInt1512 != -1)
  8442. {
  8443. entity.anInt1517 = entity.anInt1512;
  8444. return;
  8445. }
  8446. entity.anInt1517 = entity.anInt1554;
  8447. }
  8448. }
  8449. }
  8450.  
  8451. public void method101(Entity entity)
  8452. {
  8453. entity.aBoolean1541 = false;
  8454. if(entity.anInt1517 != -1)
  8455. {
  8456. Animation animation = Animation.anims[entity.anInt1517];
  8457. entity.anInt1519++;
  8458. if(entity.anInt1518 < animation.anInt352 && entity.anInt1519 > animation.method258(entity.anInt1518))
  8459. {
  8460. entity.anInt1519 = 0;
  8461. entity.anInt1518++;
  8462. }
  8463. if(entity.anInt1518 >= animation.anInt352)
  8464. {
  8465. entity.anInt1519 = 0;
  8466. entity.anInt1518 = 0;
  8467. }
  8468. }
  8469. if(entity.anInt1520 != -1 && loopCycle >= entity.anInt1523)
  8470. {
  8471. if(entity.anInt1521 < 0)
  8472. entity.anInt1521 = 0;
  8473. Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  8474. for(entity.anInt1522++; entity.anInt1521 < animation_1.anInt352 && entity.anInt1522 > animation_1.method258(entity.anInt1521); entity.anInt1521++)
  8475. entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  8476.  
  8477. if(entity.anInt1521 >= animation_1.anInt352 && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352))
  8478. entity.anInt1520 = -1;
  8479. }
  8480. if(entity.anim != -1 && entity.anInt1529 <= 1)
  8481. {
  8482. Animation animation_2 = Animation.anims[entity.anim];
  8483. if(animation_2.anInt363 == 1 && entity.anInt1542 > 0 && entity.anInt1547 <= loopCycle && entity.anInt1548 < loopCycle)
  8484. {
  8485. entity.anInt1529 = 1;
  8486. return;
  8487. }
  8488. }
  8489. if(entity.anim != -1 && entity.anInt1529 == 0)
  8490. {
  8491. Animation animation_3 = Animation.anims[entity.anim];
  8492. for(entity.anInt1528++; entity.anInt1527 < animation_3.anInt352 && entity.anInt1528 > animation_3.method258(entity.anInt1527); entity.anInt1527++)
  8493. entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  8494.  
  8495. if(entity.anInt1527 >= animation_3.anInt352)
  8496. {
  8497. entity.anInt1527 -= animation_3.anInt356;
  8498. entity.anInt1530++;
  8499. if(entity.anInt1530 >= animation_3.anInt362)
  8500. entity.anim = -1;
  8501. if(entity.anInt1527 < 0 || entity.anInt1527 >= animation_3.anInt352)
  8502. entity.anim = -1;
  8503. }
  8504. entity.aBoolean1541 = animation_3.aBoolean358;
  8505. }
  8506. if(entity.anInt1529 > 0)
  8507. entity.anInt1529--;
  8508. }
  8509.  
  8510. public void drawGameScreen()
  8511. {
  8512. if (fullscreenInterfaceID != -1 && (loadingStage == 2 || super.fullGameScreen != null)) {
  8513. if (loadingStage == 2) {
  8514. method119(anInt945, fullscreenInterfaceID);
  8515. if (openInterfaceID != -1) {
  8516. method119(anInt945, openInterfaceID);
  8517. }
  8518. anInt945 = 0;
  8519. resetAllImageProducers();
  8520. super.fullGameScreen.initDrawingArea();
  8521. Texture.anIntArray1472 = fullScreenTextureArray;
  8522. DrawingArea.setAllPixelsToZero();
  8523. welcomeScreenRaised = true;
  8524. if (openInterfaceID != -1) {
  8525. RSInterface rsInterface_1 = RSInterface.interfaceCache[openInterfaceID];
  8526. if (rsInterface_1.width == 512 && rsInterface_1.height == 334 && rsInterface_1.type == 0) {
  8527. rsInterface_1.width = 765;
  8528. rsInterface_1.height = 503;
  8529. }
  8530. drawInterface(0, 0, rsInterface_1, 8);
  8531. }
  8532. RSInterface rsInterface = RSInterface.interfaceCache[fullscreenInterfaceID];
  8533. if (rsInterface.width == 512 && rsInterface.height == 334 && rsInterface.type == 0) {
  8534. rsInterface.width = 765;
  8535. rsInterface.height = 503;
  8536. }
  8537. drawInterface(0, 0, rsInterface, 8);
  8538.  
  8539. if (!menuOpen) {
  8540. processRightClick();
  8541. drawTooltip();
  8542. } else {
  8543. drawMenu();
  8544. }
  8545. }
  8546. drawCount++;
  8547. super.fullGameScreen.drawGraphics(0, super.graphics, 0);
  8548. return;
  8549. } else {
  8550. if (drawCount != 0) {
  8551. resetImageProducers2();
  8552. }
  8553. }
  8554. if(welcomeScreenRaised) {
  8555. welcomeScreenRaised = false;
  8556. topFrame.drawGraphics(0, super.graphics, 0);
  8557. leftFrame.drawGraphics(4, super.graphics, 0);
  8558. rightFrame.drawGraphics(4, super.graphics, 516);
  8559. needDrawTabArea = true;
  8560. inputTaken = true;
  8561. tabAreaAltered = true;
  8562. aBoolean1233 = true;
  8563. if(loadingStage != 2) {
  8564. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  8565. aRSImageProducer_1164.drawGraphics(0, super.graphics, 519);
  8566. }
  8567. }
  8568. if(menuOpen && menuScreenArea == 1)
  8569. needDrawTabArea = true;
  8570. if(invOverlayInterfaceID != -1)
  8571. {
  8572. boolean flag1 = method119(anInt945, invOverlayInterfaceID);
  8573. if(flag1)
  8574. needDrawTabArea = true;
  8575. }
  8576. if(atInventoryInterfaceType == 2)
  8577. needDrawTabArea = true;
  8578. if(activeInterfaceType == 2)
  8579. needDrawTabArea = true;
  8580. if(needDrawTabArea)
  8581. {
  8582. drawTabArea();
  8583. needDrawTabArea = false;
  8584. }
  8585. if(backDialogID == -1)
  8586. {
  8587. aClass9_1059.scrollPosition = anInt1211 - anInt1089 - 110;
  8588. if(super.mouseX > 478 && super.mouseX < 580 && super.mouseY > 342)
  8589. method65(494, 110, super.mouseX - 0, super.mouseY - 348, aClass9_1059, 0, false, anInt1211);
  8590. int i = anInt1211 - 110 - aClass9_1059.scrollPosition;
  8591. if(i < 0)
  8592. i = 0;
  8593. if(i > anInt1211 - 110)
  8594. i = anInt1211 - 110;
  8595. if(anInt1089 != i)
  8596. {
  8597. anInt1089 = i;
  8598. inputTaken = true;
  8599. }
  8600. }
  8601. if(backDialogID != -1) {
  8602. boolean flag2 = method119(anInt945, backDialogID);
  8603. if(flag2)
  8604. inputTaken = true;
  8605. }
  8606. if(atInventoryInterfaceType == 3)
  8607. inputTaken = true;
  8608. if(activeInterfaceType == 3)
  8609. inputTaken = true;
  8610. if(aString844 != null)
  8611. inputTaken = true;
  8612. if(menuOpen && menuScreenArea == 2)
  8613. inputTaken = true;
  8614. if(inputTaken) {
  8615. drawChatArea();
  8616. drawConsoleArea();
  8617. inputTaken = false;
  8618. }
  8619. if(loadingStage == 2)
  8620. method146();
  8621. if(loadingStage == 2) {
  8622. drawMinimap();
  8623. aRSImageProducer_1164.drawGraphics(0, super.graphics, 519);
  8624. }
  8625. if(anInt1054 != -1)
  8626. tabAreaAltered = true;
  8627. if(tabAreaAltered)
  8628. {
  8629. if(anInt1054 != -1 && anInt1054 == tabID)
  8630. {
  8631. anInt1054 = -1;
  8632. stream.createFrame(120);
  8633. stream.writeWordBigEndian(tabID);
  8634. }
  8635. tabAreaAltered = false;
  8636. aRSImageProducer_1125.initDrawingArea();
  8637. aRSImageProducer_1165.initDrawingArea();
  8638. }
  8639. anInt945 = 0;
  8640. }
  8641.  
  8642. private boolean buildFriendsListMenu(RSInterface class9)
  8643. {
  8644. int i = class9.contentType;
  8645. if(i >= 1 && i <= 200 || i >= 701 && i <= 900)
  8646. {
  8647. if(i >= 801)
  8648. i -= 701;
  8649. else
  8650. if(i >= 701)
  8651. i -= 601;
  8652. else
  8653. if(i >= 101)
  8654. i -= 101;
  8655. else
  8656. i--;
  8657. menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
  8658. menuActionID[menuActionRow] = 792;
  8659. menuActionRow++;
  8660. menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
  8661. menuActionID[menuActionRow] = 639;
  8662. menuActionRow++;
  8663. return true;
  8664. }
  8665. if(i >= 401 && i <= 500)
  8666. {
  8667. menuActionName[menuActionRow] = "Remove @whi@" + class9.message;
  8668. menuActionID[menuActionRow] = 322;
  8669. menuActionRow++;
  8670. return true;
  8671. } else
  8672. {
  8673. return false;
  8674. }
  8675. }
  8676.  
  8677. public void method104()
  8678. {
  8679. Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetFirst();
  8680. for(; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetNext())
  8681. if(class30_sub2_sub4_sub3.anInt1560 != plane || class30_sub2_sub4_sub3.aBoolean1567)
  8682. class30_sub2_sub4_sub3.unlink();
  8683. else
  8684. if(loopCycle >= class30_sub2_sub4_sub3.anInt1564)
  8685. {
  8686. class30_sub2_sub4_sub3.method454(anInt945);
  8687. if(class30_sub2_sub4_sub3.aBoolean1567)
  8688. class30_sub2_sub4_sub3.unlink();
  8689. else
  8690. 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);
  8691. }
  8692.  
  8693. }
  8694.  
  8695. public void drawInterface(int j, int k, RSInterface class9, int l) {
  8696. if(class9.type != 0 || class9.children == null)
  8697. return;
  8698. if(class9.isMouseoverTriggered && anInt1026 != class9.id && anInt1048 != class9.id && anInt1039 != class9.id)
  8699. return;
  8700. int i1 = DrawingArea.topX;
  8701. int j1 = DrawingArea.topY;
  8702. int k1 = DrawingArea.bottomX;
  8703. int l1 = DrawingArea.bottomY;
  8704. DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  8705. int i2 = class9.children.length;
  8706. for(int j2 = 0; j2 < i2; j2++) {
  8707. int k2 = class9.childX[j2] + k;
  8708. int l2 = (class9.childY[j2] + l) - j;
  8709. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j2]];
  8710. k2 += class9_1.anInt263;
  8711. l2 += class9_1.anInt265;
  8712. if(class9_1.contentType > 0)
  8713. drawFriendsListOrWelcomeScreen(class9_1);
  8714. if(class9_1.type == 0) {
  8715. if(class9_1.scrollPosition > class9_1.scrollMax - class9_1.height)
  8716. class9_1.scrollPosition = class9_1.scrollMax - class9_1.height;
  8717. if(class9_1.scrollPosition < 0)
  8718. class9_1.scrollPosition = 0;
  8719. drawInterface(class9_1.scrollPosition, k2, class9_1, l2);
  8720. if(class9_1.scrollMax > class9_1.height)
  8721. drawScrollbar(class9_1.height, class9_1.scrollPosition, l2, k2 + class9_1.width, class9_1.scrollMax);
  8722. } else if(class9_1.type != 1)
  8723. if(class9_1.type == 2) {
  8724. int i3 = 0;
  8725. for(int l3 = 0; l3 < class9_1.height; l3++) {
  8726. for(int l4 = 0; l4 < class9_1.width; l4++) {
  8727. int k5 = k2 + l4 * (32 + class9_1.invSpritePadX);
  8728. int j6 = l2 + l3 * (32 + class9_1.invSpritePadY);
  8729. if(i3 < 20) {
  8730. k5 += class9_1.spritesX[i3];
  8731. j6 += class9_1.spritesY[i3];
  8732. }
  8733. if(class9_1.inv[i3] > 0) {
  8734. int k6 = 0;
  8735. int j7 = 0;
  8736. int j9 = class9_1.inv[i3] - 1;
  8737. if(k5 > DrawingArea.topX - 32 && k5 < DrawingArea.bottomX && j6 > DrawingArea.topY - 32 && j6 < DrawingArea.bottomY || activeInterfaceType != 0 && anInt1085 == i3) {
  8738. int l9 = 0;
  8739. if(itemSelected == 1 && anInt1283 == i3 && anInt1284 == class9_1.id)
  8740. l9 = 0xffffff;
  8741. Sprite class30_sub2_sub1_sub1_2 = ItemDef.getSprite(j9, class9_1.invStackSizes[i3], l9);
  8742. if(class30_sub2_sub1_sub1_2 != null) {
  8743. if(activeInterfaceType != 0 && anInt1085 == i3 && anInt1084 == class9_1.id) {
  8744. k6 = super.mouseX - anInt1087;
  8745. j7 = super.mouseY - anInt1088;
  8746. if(k6 < 5 && k6 > -5)
  8747. k6 = 0;
  8748. if(j7 < 5 && j7 > -5)
  8749. j7 = 0;
  8750. if(anInt989 < 5) {
  8751. k6 = 0;
  8752. j7 = 0;
  8753. }
  8754. class30_sub2_sub1_sub1_2.drawSprite1(k5 + k6, j6 + j7);
  8755. if(j6 + j7 < DrawingArea.topY && class9.scrollPosition > 0) {
  8756. int i10 = (anInt945 * (DrawingArea.topY - j6 - j7)) / 3;
  8757. if(i10 > anInt945 * 10)
  8758. i10 = anInt945 * 10;
  8759. if(i10 > class9.scrollPosition)
  8760. i10 = class9.scrollPosition;
  8761. class9.scrollPosition -= i10;
  8762. anInt1088 += i10;
  8763. }
  8764. if(j6 + j7 + 32 > DrawingArea.bottomY && class9.scrollPosition < class9.scrollMax - class9.height) {
  8765. int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  8766. if(j10 > anInt945 * 10)
  8767. j10 = anInt945 * 10;
  8768. if(j10 > class9.scrollMax - class9.height - class9.scrollPosition)
  8769. j10 = class9.scrollMax - class9.height - class9.scrollPosition;
  8770. class9.scrollPosition += j10;
  8771. anInt1088 -= j10;
  8772. }
  8773. } else if(atInventoryInterfaceType != 0 && atInventoryIndex == i3 && atInventoryInterface == class9_1.id)
  8774. class30_sub2_sub1_sub1_2.drawSprite1(k5, j6);
  8775. else
  8776. class30_sub2_sub1_sub1_2.drawSprite(k5, j6);
  8777. if(class30_sub2_sub1_sub1_2.anInt1444 == 33 || class9_1.invStackSizes[i3] != 1) {
  8778. int k10 = class9_1.invStackSizes[i3];
  8779. if(intToKOrMil(k10) == "@inf@") {
  8780. infinity.drawSprite(k5 + k6, j6 + j7);
  8781. } else {
  8782. if (k10 >= 1) {
  8783. smallText.method385(0,
  8784. intToKOrMil(k10), j6
  8785. + 10 + j7, k5
  8786. + k6 + 1);
  8787. smallText.method385(0xFFFF00,
  8788. intToKOrMil(k10), j6
  8789. + 9 + j7, k5
  8790. + k6);
  8791. }
  8792. if (k10 >= 100000) {
  8793. smallText.method385(0,
  8794. intToKOrMil(k10), j6
  8795. + 10 + j7, k5
  8796. + k6 + 1);
  8797. smallText.method385(0xFFFFFF,
  8798. intToKOrMil(k10), j6
  8799. + 9 + j7, k5
  8800. + k6);
  8801. }
  8802. if (k10 >= 10000000) {
  8803. smallText.method385(0,
  8804. intToKOrMil(k10), j6
  8805. + 10 + j7, k5
  8806. + k6 + 1);
  8807. smallText.method385(0x00FF80,
  8808. intToKOrMil(k10), j6
  8809. + 9 + j7, k5
  8810. + k6);
  8811. }
  8812. }
  8813. }
  8814. }
  8815. }
  8816. } else if(class9_1.sprites != null && i3 < 20) {
  8817. Sprite class30_sub2_sub1_sub1_1 = class9_1.sprites[i3];
  8818. if(class30_sub2_sub1_sub1_1 != null)
  8819. class30_sub2_sub1_sub1_1.drawSprite(k5, j6);
  8820. }
  8821. i3++;
  8822. }
  8823. }
  8824. } else if(class9_1.type == 3) {
  8825. boolean flag = false;
  8826. if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  8827. flag = true;
  8828. int j3;
  8829. if(interfaceIsSelected(class9_1)) {
  8830. j3 = class9_1.anInt219;
  8831. if(flag && class9_1.anInt239 != 0)
  8832. j3 = class9_1.anInt239;
  8833. } else {
  8834. j3 = class9_1.textColor;
  8835. if(flag && class9_1.anInt216 != 0)
  8836. j3 = class9_1.anInt216;
  8837. }
  8838. if(class9_1.aByte254 == 0) {
  8839. if(class9_1.aBoolean227)
  8840. DrawingArea.drawPixels(class9_1.height, l2, k2, j3, class9_1.width);
  8841. else
  8842. DrawingArea.fillPixels(k2, class9_1.width, class9_1.height, j3, l2);
  8843. } else if(class9_1.aBoolean227)
  8844. DrawingArea.method335(j3, l2, class9_1.width, class9_1.height, 256 - (class9_1.aByte254 & 0xff), k2);
  8845. else
  8846. DrawingArea.method338(l2, class9_1.height, 256 - (class9_1.aByte254 & 0xff), j3, class9_1.width, k2);
  8847. } else if(class9_1.type == 4) {
  8848. TextDrawingArea textDrawingArea = class9_1.textDrawingAreas;
  8849. String s = class9_1.message;
  8850. boolean flag1 = false;
  8851. if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  8852. flag1 = true;
  8853. int i4;
  8854. if(interfaceIsSelected(class9_1)) {
  8855. i4 = class9_1.anInt219;
  8856. if(flag1 && class9_1.anInt239 != 0)
  8857. i4 = class9_1.anInt239;
  8858. if(class9_1.aString228.length() > 0)
  8859. s = class9_1.aString228;
  8860. } else {
  8861. i4 = class9_1.textColor;
  8862. if(flag1 && class9_1.anInt216 != 0)
  8863. i4 = class9_1.anInt216;
  8864. }
  8865. if(class9_1.atActionType == 6 && aBoolean1149) {
  8866. s = "Please wait...";
  8867. i4 = class9_1.textColor;
  8868. }
  8869. if(DrawingArea.width == 519) {
  8870. if(i4 == 0xffff00)
  8871. i4 = 255;
  8872. if(i4 == 49152)
  8873. i4 = 0xffffff;
  8874. }
  8875. for(int l6 = l2 + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497)
  8876. {
  8877. if(s.indexOf("%") != -1)
  8878. {
  8879. do
  8880. {
  8881. int k7 = s.indexOf("%1");
  8882. if(k7 == -1)
  8883. break;
  8884. s = s.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  8885. } while(true);
  8886. do
  8887. {
  8888. int l7 = s.indexOf("%2");
  8889. if(l7 == -1)
  8890. break;
  8891. s = s.substring(0, l7) + interfaceIntToString(extractInterfaceValues(class9_1, 1)) + s.substring(l7 + 2);
  8892. } while(true);
  8893. do
  8894. {
  8895. int i8 = s.indexOf("%3");
  8896. if(i8 == -1)
  8897. break;
  8898. s = s.substring(0, i8) + interfaceIntToString(extractInterfaceValues(class9_1, 2)) + s.substring(i8 + 2);
  8899. } while(true);
  8900. do
  8901. {
  8902. int j8 = s.indexOf("%4");
  8903. if(j8 == -1)
  8904. break;
  8905. s = s.substring(0, j8) + interfaceIntToString(extractInterfaceValues(class9_1, 3)) + s.substring(j8 + 2);
  8906. } while(true);
  8907. do
  8908. {
  8909. int k8 = s.indexOf("%5");
  8910. if(k8 == -1)
  8911. break;
  8912. s = s.substring(0, k8) + interfaceIntToString(extractInterfaceValues(class9_1, 4)) + s.substring(k8 + 2);
  8913. } while(true);
  8914. }
  8915. int l8 = s.indexOf("\\n");
  8916. String s1;
  8917. if(l8 != -1)
  8918. {
  8919. s1 = s.substring(0, l8);
  8920. s = s.substring(l8 + 2);
  8921. } else
  8922. {
  8923. s1 = s;
  8924. s = "";
  8925. }
  8926. if(class9_1.centerText)
  8927. textDrawingArea.method382(i4, k2 + class9_1.width / 2, s1, l6, class9_1.textShadow);
  8928. else
  8929. textDrawingArea.method389(class9_1.textShadow, k2, i4, s1, l6);
  8930. }
  8931. } else if(class9_1.type == 5) {
  8932. Sprite sprite;
  8933. if(interfaceIsSelected(class9_1))
  8934. sprite = class9_1.sprite2;
  8935. else
  8936. sprite = class9_1.sprite1;
  8937. if(sprite != null)
  8938. if(class9_1.drawsTransparent == true)
  8939. sprite.drawSprite2(k2, l2);
  8940. else
  8941. sprite.drawSprite(k2, l2);
  8942. } else if(class9_1.type == 6) {
  8943. int k3 = Texture.textureInt1;
  8944. int j4 = Texture.textureInt2;
  8945. Texture.textureInt1 = k2 + class9_1.width / 2;
  8946. Texture.textureInt2 = l2 + class9_1.height / 2;
  8947. int i5 = Texture.anIntArray1470[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  8948. int l5 = Texture.anIntArray1471[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  8949. boolean flag2 = interfaceIsSelected(class9_1);
  8950. int i7;
  8951. if(flag2)
  8952. i7 = class9_1.anInt258;
  8953. else
  8954. i7 = class9_1.anInt257;
  8955. Model model;
  8956. if(i7 == -1) {
  8957. model = class9_1.method209(-1, -1, flag2);
  8958. } else {
  8959. Animation animation = Animation.anims[i7];
  8960. model = class9_1.method209(animation.anIntArray354[class9_1.anInt246], animation.anIntArray353[class9_1.anInt246], flag2);
  8961. }
  8962. if(model != null)
  8963. model.method482(class9_1.modelRotation2, 0, class9_1.modelRotation1, 0, i5, l5);
  8964. Texture.textureInt1 = k3;
  8965. Texture.textureInt2 = j4;
  8966. } else if(class9_1.type == 7) {
  8967. TextDrawingArea textDrawingArea_1 = class9_1.textDrawingAreas;
  8968. int k4 = 0;
  8969. for(int j5 = 0; j5 < class9_1.height; j5++) {
  8970. for(int i6 = 0; i6 < class9_1.width; i6++) {
  8971. if(class9_1.inv[k4] > 0) {
  8972. ItemDef itemDef = ItemDef.forID(class9_1.inv[k4] - 1);
  8973. String s2 = itemDef.name;
  8974. if(itemDef.stackable || class9_1.invStackSizes[k4] != 1)
  8975. s2 = s2 + " x" + intToKOrMilLongName(class9_1.invStackSizes[k4]);
  8976. int i9 = k2 + i6 * (115 + class9_1.invSpritePadX);
  8977. int k9 = l2 + j5 * (12 + class9_1.invSpritePadY);
  8978. if(class9_1.centerText)
  8979. textDrawingArea_1.method382(class9_1.textColor, i9 + class9_1.width / 2, s2, k9, class9_1.textShadow);
  8980. else
  8981. textDrawingArea_1.method389(class9_1.textShadow, i9, class9_1.textColor, s2, k9);
  8982. }
  8983. k4++;
  8984. }
  8985. }
  8986. } else if(class9_1.type == 8 && (anInt1500 == class9_1.id || anInt1044 == class9_1.id || anInt1129 == class9_1.id) && anInt1501 == 100) {
  8987. int boxWidth = 0;
  8988. int boxHeight = 0;
  8989. TextDrawingArea textDrawingArea_2 = regularText;
  8990. for(String s1 = class9_1.message; s1.length() > 0;) {
  8991. int l7 = s1.indexOf("\\n");
  8992. String s4;
  8993. if(l7 != -1) {
  8994. s4 = s1.substring(0, l7);
  8995. s1 = s1.substring(l7 + 2);
  8996. } else {
  8997. s4 = s1;
  8998. s1 = "";
  8999. }
  9000. int j10 = textDrawingArea_2.getTextWidth(s4);
  9001. if(j10 > boxWidth) {
  9002. boxWidth = j10;
  9003. }
  9004. boxHeight += textDrawingArea_2.anInt1497 + 1;
  9005. }
  9006. boxWidth += 6;
  9007. boxHeight += 7;
  9008. int xPos = (k2 + class9_1.width) - 5 - boxWidth;
  9009. int yPos = l2 + class9_1.height + 5;
  9010. if(xPos < k2 + 5) {
  9011. xPos = k2 + 5;
  9012. }
  9013. if(xPos + boxWidth > j + class9.width) {
  9014. xPos = (j + class9.width) - boxWidth;
  9015. }
  9016. if(yPos + boxHeight > k + class9.height) {
  9017. yPos = (k + class9.height) - boxHeight;
  9018. }
  9019. DrawingArea.drawPixels(boxHeight, yPos, xPos, 0xFFFFA0, boxWidth);
  9020. DrawingArea.fillPixels(xPos, boxWidth, boxHeight, 0, yPos);
  9021. String s2 = class9_1.message;
  9022. for(int j11 = yPos + textDrawingArea_2.anInt1497 + 2; s2.length() > 0; j11 += textDrawingArea_2.anInt1497 + 1) {
  9023. int l11 = s2.indexOf("\\n");
  9024. String s5;
  9025. if(l11 != -1) {
  9026. s5 = s2.substring(0, l11);
  9027. s2 = s2.substring(l11 + 2);
  9028. } else {
  9029. s5 = s2;
  9030. s2 = "";
  9031. }
  9032. textDrawingArea_2.method389(false, xPos + 3, 0, s5, j11);
  9033. }
  9034. } else if(class9_1.type == 9) {
  9035. drawHoverBox(k2, l2, class9_1.message);
  9036. }
  9037. }
  9038. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  9039. }
  9040.  
  9041. public void drawHoverBox(int xPos, int yPos, String text) {
  9042. String[] results = text.split("\n");
  9043. int height = (results.length * 16) + 6;
  9044. int width = regularText.getTextWidth(results[0]) + 6;
  9045. for(int i = 1; i < results.length; i++)
  9046. if(width <= regularText.getTextWidth(results[i]) + 6)
  9047. width = regularText.getTextWidth(results[i]) + 6;
  9048. DrawingArea.drawPixels(height - 2, yPos, xPos, 0xFFFFA0, width);
  9049. DrawingArea.fillPixels(xPos, width, height - 2, 0, yPos);
  9050. yPos += 14;
  9051. for(int i = 0; i < results.length; i++) {
  9052. regularText.method389(false, xPos + 3, 0, results[i], yPos);
  9053. yPos += 16;
  9054. }
  9055. }
  9056.  
  9057. public void randomizeBackground(Background background) {
  9058. int j = 256;
  9059. for(int k = 0; k < anIntArray1190.length; k++)
  9060. anIntArray1190[k] = 0;
  9061.  
  9062. for(int l = 0; l < 5000; l++) {
  9063. int i1 = (int)(Math.random() * 128D * (double)j);
  9064. anIntArray1190[i1] = (int)(Math.random() * 256D);
  9065. }
  9066. for(int j1 = 0; j1 < 20; j1++) {
  9067. for(int k1 = 1; k1 < j - 1; k1++) {
  9068. for(int i2 = 1; i2 < 127; i2++) {
  9069. int k2 = i2 + (k1 << 7);
  9070. anIntArray1191[k2] = (anIntArray1190[k2 - 1] + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128] + anIntArray1190[k2 + 128]) / 4;
  9071. }
  9072.  
  9073. }
  9074. int ai[] = anIntArray1190;
  9075. anIntArray1190 = anIntArray1191;
  9076. anIntArray1191 = ai;
  9077. }
  9078. if(background != null) {
  9079. int l1 = 0;
  9080. for(int j2 = 0; j2 < background.anInt1453; j2++) {
  9081. for(int l2 = 0; l2 < background.anInt1452; l2++)
  9082. if(background.aByteArray1450[l1++] != 0) {
  9083. int i3 = l2 + 16 + background.anInt1454;
  9084. int j3 = j2 + 16 + background.anInt1455;
  9085. int k3 = i3 + (j3 << 7);
  9086. anIntArray1190[k3] = 0;
  9087. }
  9088. }
  9089. }
  9090. }
  9091.  
  9092. public void method107(int i, int j, Stream stream, Player player)
  9093. {
  9094. if((i & 0x400) != 0)
  9095. {
  9096. player.anInt1543 = stream.method428();
  9097. player.anInt1545 = stream.method428();
  9098. player.anInt1544 = stream.method428();
  9099. player.anInt1546 = stream.method428();
  9100. player.anInt1547 = stream.method436() + loopCycle;
  9101. player.anInt1548 = stream.method435() + loopCycle;
  9102. player.anInt1549 = stream.method428();
  9103. player.method446();
  9104. }
  9105. if((i & 0x100) != 0)
  9106. {
  9107. player.anInt1520 = stream.method434();
  9108. int k = stream.readDWord();
  9109. player.anInt1524 = k >> 16;
  9110. player.anInt1523 = loopCycle + (k & 0xffff);
  9111. player.anInt1521 = 0;
  9112. player.anInt1522 = 0;
  9113. if(player.anInt1523 > loopCycle)
  9114. player.anInt1521 = -1;
  9115. if(player.anInt1520 == 65535)
  9116. player.anInt1520 = -1;
  9117. }
  9118. /*if ((i & 0x100) != 0) {
  9119. int graphic = stream.method434();
  9120. int k = stream.readDWord();
  9121. if (player.anInt1520 != -1) {
  9122. } else {
  9123. player.anInt1520 = graphic;
  9124. player.anInt1524 = k >> 16;
  9125. player.anInt1523 = loopCycle + (k & 0xffff);
  9126. player.anInt1521 = 0;
  9127. player.anInt1522 = 0;
  9128. if (player.anInt1523 > loopCycle)
  9129. player.anInt1521 = -1;
  9130. if (player.anInt1520 == 65535)
  9131. player.anInt1520 = -1;
  9132. }
  9133. }*/
  9134. if((i & 8) != 0)
  9135. {
  9136. int l = stream.method434();
  9137. if(l == 65535)
  9138. l = -1;
  9139. int i2 = stream.method427();
  9140. if(l == player.anim && l != -1)
  9141. {
  9142. int i3 = Animation.anims[l].anInt365;
  9143. if(i3 == 1)
  9144. {
  9145. player.anInt1527 = 0;
  9146. player.anInt1528 = 0;
  9147. player.anInt1529 = i2;
  9148. player.anInt1530 = 0;
  9149. }
  9150. if(i3 == 2)
  9151. player.anInt1530 = 0;
  9152. } else
  9153. if(l == -1 || player.anim == -1 || Animation.anims[l].anInt359 >= Animation.anims[player.anim].anInt359)
  9154. {
  9155. player.anim = l;
  9156. player.anInt1527 = 0;
  9157. player.anInt1528 = 0;
  9158. player.anInt1529 = i2;
  9159. player.anInt1530 = 0;
  9160. player.anInt1542 = player.smallXYIndex;
  9161. }
  9162. }
  9163. /*if ((i & 8) != 0) {
  9164. int anim = stream.method434();
  9165. if (anim == 65535)
  9166. anim = -1;
  9167. int delay = stream.method427();
  9168. if ((player.anim != -1)) {
  9169. } else {
  9170. if (anim == player.anim && anim != -1) {
  9171. int i3 = Animation.anims[anim].anInt365;
  9172. if (i3 == 1) {
  9173. player.anInt1527 = 0;
  9174. player.anInt1528 = 0;
  9175. player.anInt1529 = delay;
  9176. player.anInt1530 = 0;
  9177. }
  9178. if (i3 == 2)
  9179. player.anInt1530 = 0;
  9180. } else if (anim == -1 || player.anim == -1 || Animation.anims[anim].anInt359 >= Animation.anims[player.anim].anInt359) {
  9181. player.anim = anim;
  9182. player.anInt1527 = 0;
  9183. player.anInt1528 = 0;
  9184. player.anInt1529 = delay;
  9185. player.anInt1530 = 0;
  9186. player.anInt1542 = player.smallXYIndex;
  9187. }
  9188. }
  9189. }*/
  9190.  
  9191. /** **/
  9192. if((i & 4) != 0)
  9193. {
  9194. player.textSpoken = stream.readString();
  9195. if(player.textSpoken.charAt(0) == '~')
  9196. {
  9197. player.textSpoken = player.textSpoken.substring(1);
  9198. pushMessage(player.textSpoken, 2, player.name);
  9199. } else
  9200. if(player == myPlayer)
  9201. pushMessage(player.textSpoken, 2, player.name);
  9202. player.anInt1513 = 0;
  9203. player.anInt1531 = 0;
  9204. player.textCycle = 150;
  9205. }
  9206. if((i & 0x80) != 0)
  9207. {
  9208. int i1 = stream.method434();
  9209. int j2 = stream.readUnsignedByte();
  9210. int j3 = stream.method427();
  9211. int k3 = stream.currentOffset;
  9212. if(player.name != null && player.visible)
  9213. {
  9214. long l3 = TextClass.longForName(player.name);
  9215. boolean flag = false;
  9216. if(j2 <= 1)
  9217. {
  9218. for(int i4 = 0; i4 < ignoreCount; i4++)
  9219. {
  9220. if(ignoreListAsLongs[i4] != l3)
  9221. continue;
  9222. flag = true;
  9223. break;
  9224. }
  9225.  
  9226. }
  9227. if(!flag && anInt1251 == 0)
  9228. try
  9229. {
  9230. aStream_834.currentOffset = 0;
  9231. stream.method442(j3, 0, aStream_834.buffer);
  9232. aStream_834.currentOffset = 0;
  9233. String s = TextInput.method525(j3, aStream_834);
  9234. s = Censor.doCensor(s);
  9235. player.textSpoken = s;
  9236. player.anInt1513 = i1 >> 8;
  9237. player.privelage = j2;
  9238. player.anInt1531 = i1 & 0xff;
  9239. player.textCycle = 150;
  9240. if(j2 == 2 || j2 == 3)
  9241. pushMessage(s, 1, "@cr2@" + player.name);
  9242. else if(j2 == 1)
  9243. pushMessage(s, 1, "@cr1@" + player.name);
  9244. else if(j2 == 4)
  9245. pushMessage(s, 1, "@cr3@" + player.name);
  9246. else
  9247. pushMessage(s, 2, player.name);
  9248. }
  9249. catch(Exception exception)
  9250. {
  9251. signlink.reporterror("cde2");
  9252. }
  9253. }
  9254. stream.currentOffset = k3 + j3;
  9255. }
  9256. if((i & 1) != 0)
  9257. {
  9258. player.interactingEntity = stream.method434();
  9259. if(player.interactingEntity == 65535)
  9260. player.interactingEntity = -1;
  9261. }
  9262. if((i & 0x10) != 0)
  9263. {
  9264. int j1 = stream.method427();
  9265. byte abyte0[] = new byte[j1];
  9266. Stream stream_1 = new Stream(abyte0);
  9267. stream.readBytes(j1, 0, abyte0);
  9268. aStreamArray895s[j] = stream_1;
  9269. player.updatePlayer(stream_1);
  9270. }
  9271. if((i & 2) != 0)
  9272. {
  9273. player.anInt1538 = stream.method436();
  9274. player.anInt1539 = stream.method434();
  9275. }
  9276. if((i & 0x20) != 0)
  9277. {
  9278. int k1 = stream.readUnsignedByte();
  9279. int k2 = stream.method426();
  9280. player.updateHitData(k2, k1, loopCycle);
  9281. player.loopCycleStatus = loopCycle + 300;
  9282. player.currentHealth = stream.method427();
  9283. player.maxHealth = stream.readUnsignedByte();
  9284. }
  9285. if((i & 0x200) != 0)
  9286. {
  9287. int l1 = stream.readUnsignedByte();
  9288. int l2 = stream.method428();
  9289. player.updateHitData(l2, l1, loopCycle);
  9290. player.loopCycleStatus = loopCycle + 300;
  9291. player.currentHealth = stream.readUnsignedByte();
  9292. player.maxHealth = stream.method427();
  9293. }
  9294. }
  9295.  
  9296. public void method108()
  9297. {
  9298. try
  9299. {
  9300. int j = myPlayer.x + anInt1278;
  9301. int k = myPlayer.y + anInt1131;
  9302. if(anInt1014 - j < -500 || anInt1014 - j > 500 || anInt1015 - k < -500 || anInt1015 - k > 500)
  9303. {
  9304. anInt1014 = j;
  9305. anInt1015 = k;
  9306. }
  9307. if(anInt1014 != j)
  9308. anInt1014 += (j - anInt1014) / 16;
  9309. if(anInt1015 != k)
  9310. anInt1015 += (k - anInt1015) / 16;
  9311. if(super.keyArray[1] == 1)
  9312. anInt1186 += (-24 - anInt1186) / 2;
  9313. else
  9314. if(super.keyArray[2] == 1)
  9315. anInt1186 += (24 - anInt1186) / 2;
  9316. else
  9317. anInt1186 /= 2;
  9318. if(super.keyArray[3] == 1)
  9319. anInt1187 += (12 - anInt1187) / 2;
  9320. else
  9321. if(super.keyArray[4] == 1)
  9322. anInt1187 += (-12 - anInt1187) / 2;
  9323. else
  9324. anInt1187 /= 2;
  9325. minimapInt1 = minimapInt1 + anInt1186 / 2 & 0x7ff;
  9326. anInt1184 += anInt1187 / 2;
  9327. if(anInt1184 < 128)
  9328. anInt1184 = 128;
  9329. if(anInt1184 > 383)
  9330. anInt1184 = 383;
  9331. int l = anInt1014 >> 7;
  9332. int i1 = anInt1015 >> 7;
  9333. int j1 = method42(plane, anInt1015, anInt1014);
  9334. int k1 = 0;
  9335. if(l > 3 && i1 > 3 && l < 100 && i1 < 100)
  9336. {
  9337. for(int l1 = l - 4; l1 <= l + 4; l1++)
  9338. {
  9339. for(int k2 = i1 - 4; k2 <= i1 + 4; k2++)
  9340. {
  9341. int l2 = plane;
  9342. if(l2 < 3 && (byteGroundArray[1][l1][k2] & 2) == 2)
  9343. l2++;
  9344. int i3 = j1 - intGroundArray[l2][l1][k2];
  9345. if(i3 > k1)
  9346. k1 = i3;
  9347. }
  9348.  
  9349. }
  9350.  
  9351. }
  9352. anInt1005++;
  9353. if(anInt1005 > 1512)
  9354. {
  9355. anInt1005 = 0;
  9356. stream.createFrame(77);
  9357. stream.writeWordBigEndian(0);
  9358. int i2 = stream.currentOffset;
  9359. stream.writeWordBigEndian((int)(Math.random() * 256D));
  9360. stream.writeWordBigEndian(101);
  9361. stream.writeWordBigEndian(233);
  9362. stream.writeWord(45092);
  9363. if((int)(Math.random() * 2D) == 0)
  9364. stream.writeWord(35784);
  9365. stream.writeWordBigEndian((int)(Math.random() * 256D));
  9366. stream.writeWordBigEndian(64);
  9367. stream.writeWordBigEndian(38);
  9368. stream.writeWord((int)(Math.random() * 65536D));
  9369. stream.writeWord((int)(Math.random() * 65536D));
  9370. stream.writeBytes(stream.currentOffset - i2);
  9371. }
  9372. int j2 = k1 * 192;
  9373. if(j2 > 0x17f00)
  9374. j2 = 0x17f00;
  9375. if(j2 < 32768)
  9376. j2 = 32768;
  9377. if(j2 > anInt984)
  9378. {
  9379. anInt984 += (j2 - anInt984) / 24;
  9380. return;
  9381. }
  9382. if(j2 < anInt984)
  9383. {
  9384. anInt984 += (j2 - anInt984) / 80;
  9385. }
  9386. }
  9387. catch(Exception _ex)
  9388. {
  9389. signlink.reporterror("glfc_ex " + myPlayer.x + "," + myPlayer.y + "," + anInt1014 + "," + anInt1015 + "," + anInt1069 + "," + anInt1070 + "," + baseX + "," + baseY);
  9390. throw new RuntimeException("eek");
  9391. }
  9392. }
  9393.  
  9394. public void processDrawing()
  9395. {
  9396. if(rsAlreadyLoaded || loadingError || genericLoadingError)
  9397. {
  9398. showErrorScreen();
  9399. return;
  9400. }
  9401. anInt1061++;
  9402. if(!loggedIn)
  9403. drawLoginScreen(false);
  9404. else
  9405. drawGameScreen();
  9406. anInt1213 = 0;
  9407. }
  9408.  
  9409. private boolean isFriendOrSelf(String s)
  9410. {
  9411. if(s == null)
  9412. return false;
  9413. for(int i = 0; i < friendsCount; i++)
  9414. if(s.equalsIgnoreCase(friendsList[i]))
  9415. return true;
  9416. return s.equalsIgnoreCase(myPlayer.name);
  9417. }
  9418.  
  9419. private static String combatDiffColor(int i, int j)
  9420. {
  9421. int k = i - j;
  9422. if(k < -9)
  9423. return "@red@";
  9424. if(k < -6)
  9425. return "@or3@";
  9426. if(k < -3)
  9427. return "@or2@";
  9428. if(k < 0)
  9429. return "@or1@";
  9430. if(k > 9)
  9431. return "@gre@";
  9432. if(k > 6)
  9433. return "@gr3@";
  9434. if(k > 3)
  9435. return "@gr2@";
  9436. if(k > 0)
  9437. return "@gr1@";
  9438. else
  9439. return "@yel@";
  9440. }
  9441.  
  9442. public void setWaveVolume(int i)
  9443. {
  9444. signlink.wavevol = i;
  9445. }
  9446.  
  9447. public void draw3dScreen()
  9448. {
  9449. drawSplitPrivateChat();
  9450. if(crossType == 1)
  9451. {
  9452. crosses[crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  9453. anInt1142++;
  9454. if(anInt1142 > 67)
  9455. {
  9456. anInt1142 = 0;
  9457. stream.createFrame(78);
  9458. }
  9459. }
  9460. if(crossType == 2)
  9461. crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  9462. if(anInt1018 != -1)
  9463. {
  9464. method119(anInt945, anInt1018);
  9465. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 0);
  9466. }
  9467. if(openInterfaceID != -1)
  9468. {
  9469. method119(anInt945, openInterfaceID);
  9470. drawInterface(0, 0, RSInterface.interfaceCache[openInterfaceID], 0);
  9471. }
  9472. method70();
  9473. if(!menuOpen)
  9474. {
  9475. processRightClick();
  9476. drawTooltip();
  9477. } else
  9478. if(menuScreenArea == 0)
  9479. drawMenu();
  9480. if(anInt1055 == 1)
  9481. multiOverlay.drawSprite(472, 296);
  9482. if(fpsOn)
  9483. {
  9484. char c = '\u01FB';
  9485. int k = 20;
  9486. int i1 = 0xffff00;
  9487. if(super.fps < 15)
  9488. i1 = 0xff0000;
  9489. regularText.method380("Fps:" + super.fps, c, i1, k);
  9490. k += 15;
  9491. Runtime runtime = Runtime.getRuntime();
  9492. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  9493. i1 = 0xffff00;
  9494. if(j1 > 0x2000000 && lowMem)
  9495. i1 = 0xff0000;
  9496. regularText.method380("Mem:" + j1 + "k", c, 0xffff00, k);
  9497. k += 15;
  9498. }
  9499. int i1 = 0xffff00;
  9500. int x = baseX + (myPlayer.x - 6 >> 7);
  9501. int y = baseY + (myPlayer.y - 6 >> 7);
  9502. if (clientData)
  9503. {
  9504. char c = '\u01FB';
  9505. int k = 20;
  9506. if(super.fps < 15)
  9507. i1 = 0xff0000;
  9508. regularText.method385(0xffff00, "Fps: " + super.fps, 270, 5);
  9509. Runtime runtime = Runtime.getRuntime();
  9510. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  9511. i1 = 0xffff00;
  9512. if(j1 > 0x2000000 && lowMem)
  9513. i1 = 0xff0000;
  9514. k += 15;
  9515.  
  9516. regularText.method385(0xffff00, "PlayerListSize: " + playerCount, 285, 5);
  9517. regularText.method385(0xffff00, "Mem: " + j1 + "k", 299, 5);
  9518. regularText.method385(0xffff00, "Mouse X: " + super.mouseX + " , Mouse Y: " + super.mouseY, 314, 5);
  9519. regularText.method385(0xffff00, "Coords: " + x + ", " + y, 329, 5);
  9520. }
  9521. if(anInt1104 != 0)
  9522. {
  9523. int j = anInt1104 / 50;
  9524. int l = j / 60;
  9525. j %= 60;
  9526. if(j < 10)
  9527. regularText.method385(0xffff00, "System update in: " + l + ":0" + j, 329, 4);
  9528. else
  9529. regularText.method385(0xffff00, "System update in: " + l + ":" + j, 329, 4);
  9530. anInt849++;
  9531. if(anInt849 > 75)
  9532. {
  9533. anInt849 = 0;
  9534. stream.createFrame(148);
  9535. }
  9536. }
  9537. }
  9538.  
  9539. public void addIgnore(long l)
  9540. {
  9541. try
  9542. {
  9543. if(l == 0L)
  9544. return;
  9545. if(ignoreCount >= 100)
  9546. {
  9547. pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
  9548. return;
  9549. }
  9550. String s = TextClass.fixName(TextClass.nameForLong(l));
  9551. for(int j = 0; j < ignoreCount; j++)
  9552. if(ignoreListAsLongs[j] == l)
  9553. {
  9554. pushMessage(s + " is already on your ignore list", 0, "");
  9555. return;
  9556. }
  9557. for(int k = 0; k < friendsCount; k++)
  9558. if(friendsListAsLongs[k] == l)
  9559. {
  9560. pushMessage("Please remove " + s + " from your friend list first", 0, "");
  9561. return;
  9562. }
  9563.  
  9564. ignoreListAsLongs[ignoreCount++] = l;
  9565. needDrawTabArea = true;
  9566. stream.createFrame(133);
  9567. stream.writeQWord(l);
  9568. return;
  9569. }
  9570. catch(RuntimeException runtimeexception)
  9571. {
  9572. signlink.reporterror("45688, " + l + ", " + 4 + ", " + runtimeexception.toString());
  9573. }
  9574. throw new RuntimeException();
  9575. }
  9576.  
  9577. public void method114()
  9578. {
  9579. for(int i = -1; i < playerCount; i++)
  9580. {
  9581. int j;
  9582. if(i == -1)
  9583. j = myPlayerIndex;
  9584. else
  9585. j = playerIndices[i];
  9586. Player player = playerArray[j];
  9587. if(player != null)
  9588. method96(player);
  9589. }
  9590.  
  9591. }
  9592.  
  9593. public void method115()
  9594. {
  9595. if(loadingStage == 2)
  9596. {
  9597. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  9598. {
  9599. if(class30_sub1.anInt1294 > 0)
  9600. class30_sub1.anInt1294--;
  9601. if(class30_sub1.anInt1294 == 0)
  9602. {
  9603. if(class30_sub1.anInt1299 < 0 || ObjectManager.method178(class30_sub1.anInt1299, class30_sub1.anInt1301))
  9604. {
  9605. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1300, class30_sub1.anInt1301, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1299);
  9606. class30_sub1.unlink();
  9607. }
  9608. } else
  9609. {
  9610. if(class30_sub1.anInt1302 > 0)
  9611. class30_sub1.anInt1302--;
  9612. 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)))
  9613. {
  9614. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1292, class30_sub1.anInt1293, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1291);
  9615. class30_sub1.anInt1302 = -1;
  9616. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1299 == -1)
  9617. class30_sub1.unlink();
  9618. else
  9619. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1292 == class30_sub1.anInt1300 && class30_sub1.anInt1293 == class30_sub1.anInt1301)
  9620. class30_sub1.unlink();
  9621. }
  9622. }
  9623. }
  9624.  
  9625. }
  9626. }
  9627.  
  9628. public void determineMenuSize()
  9629. {
  9630. int i = boldText.getTextWidth("Choose Option");
  9631. for(int j = 0; j < menuActionRow; j++)
  9632. {
  9633. int k = boldText.getTextWidth(menuActionName[j]);
  9634. if(k > i)
  9635. i = k;
  9636. }
  9637.  
  9638. i += 8;
  9639. int l = 15 * menuActionRow + 21;
  9640. if(super.saveClickX > 4 && super.saveClickY > 4 && super.saveClickX < 516 && super.saveClickY < 338)
  9641. {
  9642. int i1 = super.saveClickX - 4 - i / 2;
  9643. if(i1 + i > 512)
  9644. i1 = 512 - i;
  9645. if(i1 < 0)
  9646. i1 = 0;
  9647. int l1 = super.saveClickY - 4;
  9648. if(l1 + l > 334)
  9649. l1 = 334 - l;
  9650. if(l1 < 0)
  9651. l1 = 0;
  9652. menuOpen = true;
  9653. menuScreenArea = 0;
  9654. menuOffsetX = i1;
  9655. menuOffsetY = l1;
  9656. menuWidth = i;
  9657. menuHeight = 15 * menuActionRow + 22;
  9658. }
  9659. if(super.saveClickX > 519 && super.saveClickY > 168 && super.saveClickX < 765 && super.saveClickY < 503)
  9660. {
  9661. int j1 = super.saveClickX - 519 - i / 2;
  9662. if(j1 < 0)
  9663. j1 = 0;
  9664. else
  9665. if(j1 + i > 245)
  9666. j1 = 245 - i;
  9667. int i2 = super.saveClickY - 168;
  9668. if(i2 < 0)
  9669. i2 = 0;
  9670. else
  9671. if(i2 + l > 333)
  9672. i2 = 333 - l;
  9673. menuOpen = true;
  9674. menuScreenArea = 1;
  9675. menuOffsetX = j1;
  9676. menuOffsetY = i2;
  9677. menuWidth = i;
  9678. menuHeight = 15 * menuActionRow + 22;
  9679. }
  9680. if(super.saveClickX > 0 && super.saveClickY > 338 && super.saveClickX < 516 && super.saveClickY < 503)
  9681. {
  9682. int k1 = super.saveClickX - 0 - i / 2;
  9683. if(k1 < 0)
  9684. k1 = 0;
  9685. else
  9686. if(k1 + i > 516)
  9687. k1 = 516 - i;
  9688. int j2 = super.saveClickY - 338;
  9689. if(j2 < 0)
  9690. j2 = 0;
  9691. else
  9692. if(j2 + l > 165)
  9693. j2 = 165 - l;
  9694. menuOpen = true;
  9695. menuScreenArea = 2;
  9696. menuOffsetX = k1;
  9697. menuOffsetY = j2;
  9698. menuWidth = i;
  9699. menuHeight = 15 * menuActionRow + 22;
  9700. }
  9701. }
  9702.  
  9703. public void method117(Stream stream)
  9704. {
  9705. stream.initBitAccess();
  9706. int j = stream.readBits(1);
  9707. if(j == 0)
  9708. return;
  9709. int k = stream.readBits(2);
  9710. if(k == 0)
  9711. {
  9712. anIntArray894[anInt893++] = myPlayerIndex;
  9713. return;
  9714. }
  9715. if(k == 1)
  9716. {
  9717. int l = stream.readBits(3);
  9718. myPlayer.moveInDir(false, l);
  9719. int k1 = stream.readBits(1);
  9720. if(k1 == 1)
  9721. anIntArray894[anInt893++] = myPlayerIndex;
  9722. return;
  9723. }
  9724. if(k == 2)
  9725. {
  9726. int i1 = stream.readBits(3);
  9727. myPlayer.moveInDir(true, i1);
  9728. int l1 = stream.readBits(3);
  9729. myPlayer.moveInDir(true, l1);
  9730. int j2 = stream.readBits(1);
  9731. if(j2 == 1)
  9732. anIntArray894[anInt893++] = myPlayerIndex;
  9733. return;
  9734. }
  9735. if(k == 3)
  9736. {
  9737. plane = stream.readBits(2);
  9738. int j1 = stream.readBits(1);
  9739. int i2 = stream.readBits(1);
  9740. if(i2 == 1)
  9741. anIntArray894[anInt893++] = myPlayerIndex;
  9742. int k2 = stream.readBits(7);
  9743. int l2 = stream.readBits(7);
  9744. myPlayer.setPos(l2, k2, j1 == 1);
  9745. }
  9746. }
  9747.  
  9748. public void nullLoader()
  9749. {
  9750. aBoolean831 = false;
  9751. while(drawingFlames)
  9752. {
  9753. aBoolean831 = false;
  9754. try
  9755. {
  9756. Thread.sleep(50L);
  9757. }
  9758. catch(Exception _ex) { }
  9759. }
  9760. aBackground_966 = null;
  9761. aBackground_967 = null;
  9762. aBackgroundArray1152s = null;
  9763. anIntArray850 = null;
  9764. anIntArray851 = null;
  9765. anIntArray852 = null;
  9766. anIntArray853 = null;
  9767. anIntArray1190 = null;
  9768. anIntArray1191 = null;
  9769. anIntArray828 = null;
  9770. anIntArray829 = null;
  9771. aClass30_Sub2_Sub1_Sub1_1201 = null;
  9772. aClass30_Sub2_Sub1_Sub1_1202 = null;
  9773. }
  9774.  
  9775. private boolean method119(int i, int j)
  9776. {
  9777. boolean flag1 = false;
  9778. RSInterface class9 = RSInterface.interfaceCache[j];
  9779. for(int k = 0; k < class9.children.length; k++)
  9780. {
  9781. if(class9.children[k] == -1)
  9782. break;
  9783. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
  9784. if(class9_1.type == 1)
  9785. flag1 |= method119(i, class9_1.id);
  9786. if(class9_1.type == 6 && (class9_1.anInt257 != -1 || class9_1.anInt258 != -1))
  9787. {
  9788. boolean flag2 = interfaceIsSelected(class9_1);
  9789. int l;
  9790. if(flag2)
  9791. l = class9_1.anInt258;
  9792. else
  9793. l = class9_1.anInt257;
  9794. if(l != -1)
  9795. {
  9796. Animation animation = Animation.anims[l];
  9797. for(class9_1.anInt208 += i; class9_1.anInt208 > animation.method258(class9_1.anInt246);)
  9798. {
  9799. class9_1.anInt208 -= animation.method258(class9_1.anInt246) + 1;
  9800. class9_1.anInt246++;
  9801. if(class9_1.anInt246 >= animation.anInt352)
  9802. {
  9803. class9_1.anInt246 -= animation.anInt356;
  9804. if(class9_1.anInt246 < 0 || class9_1.anInt246 >= animation.anInt352)
  9805. class9_1.anInt246 = 0;
  9806. }
  9807. flag1 = true;
  9808. }
  9809.  
  9810. }
  9811. }
  9812. }
  9813.  
  9814. return flag1;
  9815. }
  9816.  
  9817. private int method120()
  9818. {
  9819. int j = 3;
  9820. if(yCameraCurve < 310)
  9821. {
  9822. int k = xCameraPos >> 7;
  9823. int l = yCameraPos >> 7;
  9824. int i1 = myPlayer.x >> 7;
  9825. int j1 = myPlayer.y >> 7;
  9826. if((byteGroundArray[plane][k][l] & 4) != 0)
  9827. j = plane;
  9828. int k1;
  9829. if(i1 > k)
  9830. k1 = i1 - k;
  9831. else
  9832. k1 = k - i1;
  9833. int l1;
  9834. if(j1 > l)
  9835. l1 = j1 - l;
  9836. else
  9837. l1 = l - j1;
  9838. if(k1 > l1)
  9839. {
  9840. int i2 = (l1 * 0x10000) / k1;
  9841. int k2 = 32768;
  9842. while(k != i1)
  9843. {
  9844. if(k < i1)
  9845. k++;
  9846. else
  9847. if(k > i1)
  9848. k--;
  9849. if((byteGroundArray[plane][k][l] & 4) != 0)
  9850. j = plane;
  9851. k2 += i2;
  9852. if(k2 >= 0x10000)
  9853. {
  9854. k2 -= 0x10000;
  9855. if(l < j1)
  9856. l++;
  9857. else
  9858. if(l > j1)
  9859. l--;
  9860. if((byteGroundArray[plane][k][l] & 4) != 0)
  9861. j = plane;
  9862. }
  9863. }
  9864. } else
  9865. {
  9866. int j2 = (k1 * 0x10000) / l1;
  9867. int l2 = 32768;
  9868. while(l != j1)
  9869. {
  9870. if(l < j1)
  9871. l++;
  9872. else
  9873. if(l > j1)
  9874. l--;
  9875. if((byteGroundArray[plane][k][l] & 4) != 0)
  9876. j = plane;
  9877. l2 += j2;
  9878. if(l2 >= 0x10000)
  9879. {
  9880. l2 -= 0x10000;
  9881. if(k < i1)
  9882. k++;
  9883. else
  9884. if(k > i1)
  9885. k--;
  9886. if((byteGroundArray[plane][k][l] & 4) != 0)
  9887. j = plane;
  9888. }
  9889. }
  9890. }
  9891. }
  9892. if((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
  9893. j = plane;
  9894. return j;
  9895. }
  9896.  
  9897. private int method121()
  9898. {
  9899. int j = method42(plane, yCameraPos, xCameraPos);
  9900. if(j - zCameraPos < 800 && (byteGroundArray[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
  9901. return plane;
  9902. else
  9903. return 3;
  9904. }
  9905.  
  9906. public void delIgnore(long l)
  9907. {
  9908. try
  9909. {
  9910. if(l == 0L)
  9911. return;
  9912. for(int j = 0; j < ignoreCount; j++)
  9913. if(ignoreListAsLongs[j] == l)
  9914. {
  9915. ignoreCount--;
  9916. needDrawTabArea = true;
  9917. System.arraycopy(ignoreListAsLongs, j + 1, ignoreListAsLongs, j, ignoreCount - j);
  9918.  
  9919. stream.createFrame(74);
  9920. stream.writeQWord(l);
  9921. return;
  9922. }
  9923.  
  9924. return;
  9925. }
  9926. catch(RuntimeException runtimeexception)
  9927. {
  9928. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  9929. }
  9930. throw new RuntimeException();
  9931. }
  9932.  
  9933. private void chatJoin(long l) {
  9934. try {
  9935. if(l == 0L)
  9936. return;
  9937. stream.createFrame(60);
  9938. stream.writeQWord(l);
  9939. return;
  9940. }
  9941. catch(RuntimeException runtimeexception)
  9942. {
  9943. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  9944. }
  9945. throw new RuntimeException();
  9946.  
  9947. }
  9948.  
  9949. public String getParameter(String s)
  9950. {
  9951. if(signlink.mainapp != null)
  9952. return signlink.mainapp.getParameter(s);
  9953. else
  9954. return super.getParameter(s);
  9955. }
  9956.  
  9957. public void adjustVolume(boolean flag, int i) {
  9958. signlink.setVolume(i);
  9959. signlink.midivol = i;
  9960. if(flag)
  9961. signlink.midi = "voladjust";
  9962. }
  9963.  
  9964. private int extractInterfaceValues(RSInterface class9, int j)
  9965. {
  9966. if(class9.valueIndexArray == null || j >= class9.valueIndexArray.length)
  9967. return -2;
  9968. try
  9969. {
  9970. int ai[] = class9.valueIndexArray[j];
  9971. int k = 0;
  9972. int l = 0;
  9973. int i1 = 0;
  9974. do
  9975. {
  9976. int j1 = ai[l++];
  9977. int k1 = 0;
  9978. byte byte0 = 0;
  9979. if(j1 == 0)
  9980. return k;
  9981. if(j1 == 1)
  9982. k1 = currentStats[ai[l++]];
  9983. if(j1 == 2)
  9984. k1 = maxStats[ai[l++]];
  9985. if(j1 == 3)
  9986. k1 = currentExp[ai[l++]];
  9987. if(j1 == 4)
  9988. {
  9989. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  9990. int k2 = ai[l++];
  9991. if(k2 >= 0 && k2 < ItemDef.totalItems && (!ItemDef.forID(k2).membersObject || isMembers))
  9992. {
  9993. for(int j3 = 0; j3 < class9_1.inv.length; j3++)
  9994. if(class9_1.inv[j3] == k2 + 1)
  9995. k1 += class9_1.invStackSizes[j3];
  9996.  
  9997. }
  9998. }
  9999. if(j1 == 5)
  10000. k1 = variousSettings[ai[l++]];
  10001. if(j1 == 6)
  10002. k1 = anIntArray1019[maxStats[ai[l++]] - 1];
  10003. if(j1 == 7)
  10004. k1 = (variousSettings[ai[l++]] * 100) / 46875;
  10005. if(j1 == 8)
  10006. k1 = myPlayer.combatLevel;
  10007. if(j1 == 9)
  10008. {
  10009. for(int l1 = 0; l1 < Skills.skillsCount; l1++)
  10010. if(Skills.skillEnabled[l1])
  10011. k1 += maxStats[l1];
  10012.  
  10013. }
  10014. if(j1 == 10)
  10015. {
  10016. RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
  10017. int l2 = ai[l++] + 1;
  10018. if(l2 >= 0 && l2 < ItemDef.totalItems && (!ItemDef.forID(l2).membersObject || isMembers))
  10019. {
  10020. for(int k3 = 0; k3 < class9_2.inv.length; k3++)
  10021. {
  10022. if(class9_2.inv[k3] != l2)
  10023. continue;
  10024. k1 = 0x3b9ac9ff;
  10025. break;
  10026. }
  10027.  
  10028. }
  10029. }
  10030. if(j1 == 11)
  10031. k1 = energy;
  10032. if(j1 == 12)
  10033. k1 = weight;
  10034. if(j1 == 13)
  10035. {
  10036. int i2 = variousSettings[ai[l++]];
  10037. int i3 = ai[l++];
  10038. k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  10039. }
  10040. if(j1 == 14)
  10041. {
  10042. int j2 = ai[l++];
  10043. VarBit varBit = VarBit.cache[j2];
  10044. int l3 = varBit.anInt648;
  10045. int i4 = varBit.anInt649;
  10046. int j4 = varBit.anInt650;
  10047. int k4 = anIntArray1232[j4 - i4];
  10048. k1 = variousSettings[l3] >> i4 & k4;
  10049. }
  10050. if(j1 == 15)
  10051. byte0 = 1;
  10052. if(j1 == 16)
  10053. byte0 = 2;
  10054. if(j1 == 17)
  10055. byte0 = 3;
  10056. if(j1 == 18)
  10057. k1 = (myPlayer.x >> 7) + baseX;
  10058. if(j1 == 19)
  10059. k1 = (myPlayer.y >> 7) + baseY;
  10060. if(j1 == 20)
  10061. k1 = ai[l++];
  10062. if(byte0 == 0)
  10063. {
  10064. if(i1 == 0)
  10065. k += k1;
  10066. if(i1 == 1)
  10067. k -= k1;
  10068. if(i1 == 2 && k1 != 0)
  10069. k /= k1;
  10070. if(i1 == 3)
  10071. k *= k1;
  10072. i1 = 0;
  10073. } else
  10074. {
  10075. i1 = byte0;
  10076. }
  10077. } while(true);
  10078. }
  10079. catch(Exception _ex)
  10080. {
  10081. return -1;
  10082. }
  10083. }
  10084.  
  10085. public void drawTooltip() {
  10086. if(menuActionRow < 2 && itemSelected == 0 && spellSelected == 0)
  10087. return;
  10088. String s;
  10089. if(itemSelected == 1 && menuActionRow < 2)
  10090. s = "Use " + selectedItemName + " with...";
  10091. else if(spellSelected == 1 && menuActionRow < 2)
  10092. s = spellTooltip + "...";
  10093. else
  10094. s = menuActionName[menuActionRow - 1];
  10095. if(menuActionRow > 2)
  10096. s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
  10097. boldText.method390(4, 0xffffff, s, loopCycle / 1000, 15);
  10098. }
  10099.  
  10100. private void drawMinimap() {
  10101. aRSImageProducer_1164.initDrawingArea();
  10102. if(anInt1021 == 2) {
  10103. byte abyte0[] = mapBack.aByteArray1450;
  10104. int ai[] = DrawingArea.pixels;
  10105. int k2 = abyte0.length;
  10106. for(int i5 = 0; i5 < k2; i5++)
  10107. if(abyte0[i5] == 0)
  10108. ai[i5] = 0;
  10109. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, 0, 0, 33, 25);
  10110.  
  10111. aRSImageProducer_1165.initDrawingArea();
  10112. return;
  10113. }
  10114. int i = minimapInt1 + minimapInt2 & 0x7ff;
  10115. int j = 48 + myPlayer.x / 32;
  10116. int l2 = 464 - myPlayer.y / 32;
  10117. for (int x = 0; x < anIntArray1229.length; x++){
  10118. anIntArray1229[x] = 170;
  10119. anIntArray1052[x] = -23;
  10120. }
  10121. aClass30_Sub2_Sub1_Sub1_1263.method352(152, i, anIntArray1229, 256 + minimapInt3, anIntArray1052, l2, 9, 45, 146, j);
  10122. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, 8, 8, 33, 25);
  10123.  
  10124. for(int j5 = 0; j5 < anInt1071; j5++) {
  10125. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  10126. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  10127. markMinimap(aClass30_Sub2_Sub1_Sub1Array1140[j5], k, i3);
  10128. }
  10129. for(int k5 = 0; k5 < 104; k5++) {
  10130. for(int l5 = 0; l5 < 104; l5++) {
  10131. NodeList class19 = groundArray[plane][k5][l5];
  10132. if(class19 != null) {
  10133. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  10134. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  10135. markMinimap(mapDotItem, l, j3);
  10136. }
  10137. }
  10138. }
  10139. for(int i6 = 0; i6 < npcCount; i6++) {
  10140. NPC npc = npcArray[npcIndices[i6]];
  10141. if(npc != null && npc.isVisible()) {
  10142. EntityDef entityDef = npc.desc;
  10143. if(entityDef.childrenIDs != null)
  10144. entityDef = entityDef.method161();
  10145. if(entityDef != null && entityDef.aBoolean87 && entityDef.aBoolean84) {
  10146. int i1 = npc.x / 32 - myPlayer.x / 32;
  10147. int k3 = npc.y / 32 - myPlayer.y / 32;
  10148. markMinimap(mapDotNPC, i1, k3);
  10149. }
  10150. }
  10151. }
  10152. for(int j6 = 0; j6 < playerCount; j6++) {
  10153. Player player = playerArray[playerIndices[j6]];
  10154. if(player != null && player.isVisible()) {
  10155. int j1 = player.x / 32 - myPlayer.x / 32;
  10156. int l3 = player.y / 32 - myPlayer.y / 32;
  10157. boolean flag1 = false;
  10158. boolean flag3 = false;
  10159. for (int j3 = 0; j3 < clanList.length; j3++) {
  10160. if (clanList[j3] == null)
  10161. continue;
  10162. if (!clanList[j3].equalsIgnoreCase(player.name))
  10163. continue;
  10164. flag3 = true;
  10165. break;
  10166. }
  10167. long l6 = TextClass.longForName(player.name);
  10168. for(int k6 = 0; k6 < friendsCount; k6++) {
  10169. if(l6 != friendsListAsLongs[k6] || friendsNodeIDs[k6] == 0)
  10170. continue;
  10171. flag1 = true;
  10172. break;
  10173. }
  10174. boolean flag2 = false;
  10175. if(myPlayer.team != 0 && player.team != 0 && myPlayer.team == player.team)
  10176. flag2 = true;
  10177. // if(player.name.equalsIgnoreCase("genesis") || player.name.equalsIgnoreCase("lightning")) {
  10178. // markMinimap(mapDotNPC, j1, l3);
  10179. // } else {
  10180. if(flag1) {
  10181. markMinimap(mapDotFriend, j1, l3);
  10182. } else if(flag2) {
  10183. markMinimap(mapDotTeam, j1, l3);
  10184. } else if(flag3) {
  10185. markMinimap(mapDotClan, j1, l3);
  10186. } else {
  10187. markMinimap(mapDotPlayer, j1, l3);
  10188. }
  10189. // }
  10190. }
  10191. }
  10192. if(anInt855 != 0 && loopCycle % 20 < 10) {
  10193. if(anInt855 == 1 && anInt1222 >= 0 && anInt1222 < npcArray.length) {
  10194. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  10195. if(class30_sub2_sub4_sub1_sub1_1 != null) {
  10196. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32 - myPlayer.x / 32;
  10197. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32 - myPlayer.y / 32;
  10198. method81(mapMarker, i4, k1);
  10199. }
  10200. }
  10201. if(anInt855 == 2) {
  10202. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  10203. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  10204. method81(mapMarker, j4, l1);
  10205. }
  10206. if(anInt855 == 10 && anInt933 >= 0 && anInt933 < playerArray.length) {
  10207. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  10208. if(class30_sub2_sub4_sub1_sub2_1 != null) {
  10209. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32 - myPlayer.x / 32;
  10210. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32 - myPlayer.y / 32;
  10211. method81(mapMarker, k4, i2);
  10212. }
  10213. }
  10214. }
  10215. if(destX != 0) {
  10216. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  10217. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  10218. markMinimap(mapFlag, j2, l4);
  10219. }
  10220. DrawingArea.drawPixels(3, 84, 115, 0xffffff, 3);
  10221. mapArea.drawSprite(0, 0);
  10222. loadOrbs();
  10223. aRSImageProducer_1165.initDrawingArea();
  10224. }
  10225. public void loadOrbs() {
  10226. drawLogout();
  10227. drawHP();
  10228. drawPrayer();
  10229. drawRunOrb();
  10230. drawSumm();
  10231. }
  10232.  
  10233. public void npcScreenPos(Entity entity, int i) {
  10234. calcEntityScreenPos(entity.x, i, entity.y);
  10235. }
  10236.  
  10237. public void calcEntityScreenPos(int i, int j, int l) {
  10238. if(i < 128 || l < 128 || i > 13056 || l > 13056) {
  10239. spriteDrawX = -1;
  10240. spriteDrawY = -1;
  10241. return;
  10242. }
  10243. int i1 = method42(plane, l, i) - j;
  10244. i -= xCameraPos;
  10245. i1 -= zCameraPos;
  10246. l -= yCameraPos;
  10247. int j1 = Model.modelIntArray1[yCameraCurve];
  10248. int k1 = Model.modelIntArray2[yCameraCurve];
  10249. int l1 = Model.modelIntArray1[xCameraCurve];
  10250. int i2 = Model.modelIntArray2[xCameraCurve];
  10251. int j2 = l * l1 + i * i2 >> 16;
  10252. l = l * i2 - i * l1 >> 16;
  10253. i = j2;
  10254. j2 = i1 * k1 - l * j1 >> 16;
  10255. l = i1 * j1 + l * k1 >> 16;
  10256. i1 = j2;
  10257. if(l >= 50) {
  10258. spriteDrawX = Texture.textureInt1 + (i << 9) / l;
  10259. spriteDrawY = Texture.textureInt2 + (i1 << 9) / l;
  10260. } else {
  10261. spriteDrawX = -1;
  10262. spriteDrawY = -1;
  10263. }
  10264. }
  10265.  
  10266. public void buildSplitPrivateChatMenu()
  10267. {
  10268. if(splitPrivateChat == 0)
  10269. return;
  10270. int i = 0;
  10271. if(anInt1104 != 0)
  10272. i = 1;
  10273. for(int j = 0; j < 100; j++)
  10274. if(chatMessages[j] != null)
  10275. {
  10276. int k = chatTypes[j];
  10277. String s = chatNames[j];
  10278. boolean flag1 = false;
  10279. if(s != null && s.startsWith("@cr1@"))
  10280. {
  10281. s = s.substring(5);
  10282. boolean flag2 = true;
  10283. }
  10284. if(s != null && s.startsWith("@cr2@"))
  10285. {
  10286. s = s.substring(5);
  10287. byte byte0 = 2;
  10288. }
  10289. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  10290. {
  10291. int l = 329 - i * 13;
  10292. if(super.mouseX > 4 && super.mouseY - 4 > l - 10 && super.mouseY - 4 <= l + 3)
  10293. {
  10294. int i1 = regularText.getTextWidth("From: " + s + chatMessages[j]) + 25;
  10295. if(i1 > 450)
  10296. i1 = 450;
  10297. if(super.mouseX < 4 + i1)
  10298. {
  10299. if(myPrivilege >= 1)
  10300. {
  10301. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  10302. menuActionID[menuActionRow] = 2606;
  10303. menuActionRow++;
  10304. }
  10305. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  10306. menuActionID[menuActionRow] = 2042;
  10307. menuActionRow++;
  10308. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  10309. menuActionID[menuActionRow] = 2337;
  10310. menuActionRow++;
  10311. }
  10312. }
  10313. if(++i >= 5)
  10314. return;
  10315. }
  10316. if((k == 5 || k == 6) && privateChatMode < 2 && ++i >= 5)
  10317. return;
  10318. }
  10319.  
  10320. }
  10321.  
  10322. public void method130(int j, int k, int l, int i1, int j1, int k1,
  10323. int l1, int i2, int j2)
  10324. {
  10325. Class30_Sub1 class30_sub1 = null;
  10326. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  10327. {
  10328. if(class30_sub1_1.anInt1295 != l1 || class30_sub1_1.anInt1297 != i2 || class30_sub1_1.anInt1298 != j1 || class30_sub1_1.anInt1296 != i1)
  10329. continue;
  10330. class30_sub1 = class30_sub1_1;
  10331. break;
  10332. }
  10333.  
  10334. if(class30_sub1 == null)
  10335. {
  10336. class30_sub1 = new Class30_Sub1();
  10337. class30_sub1.anInt1295 = l1;
  10338. class30_sub1.anInt1296 = i1;
  10339. class30_sub1.anInt1297 = i2;
  10340. class30_sub1.anInt1298 = j1;
  10341. method89(class30_sub1);
  10342. aClass19_1179.insertHead(class30_sub1);
  10343. }
  10344. class30_sub1.anInt1291 = k;
  10345. class30_sub1.anInt1293 = k1;
  10346. class30_sub1.anInt1292 = l;
  10347. class30_sub1.anInt1302 = j2;
  10348. class30_sub1.anInt1294 = j;
  10349. }
  10350.  
  10351. private boolean interfaceIsSelected(RSInterface class9)
  10352. {
  10353. if(class9.anIntArray245 == null)
  10354. return false;
  10355. for(int i = 0; i < class9.anIntArray245.length; i++)
  10356. {
  10357. int j = extractInterfaceValues(class9, i);
  10358. int k = class9.anIntArray212[i];
  10359. if(class9.anIntArray245[i] == 2)
  10360. {
  10361. if(j >= k)
  10362. return false;
  10363. } else
  10364. if(class9.anIntArray245[i] == 3)
  10365. {
  10366. if(j <= k)
  10367. return false;
  10368. } else
  10369. if(class9.anIntArray245[i] == 4)
  10370. {
  10371. if(j == k)
  10372. return false;
  10373. } else
  10374. if(j != k)
  10375. return false;
  10376. }
  10377.  
  10378. return true;
  10379. }
  10380.  
  10381. private DataInputStream openJagGrabInputStream(String s)
  10382. throws IOException
  10383. {
  10384. // if(!aBoolean872)
  10385. // if(signlink.mainapp != null)
  10386. // return signlink.openurl(s);
  10387. // else
  10388. // return new DataInputStream((new URL(getCodeBase(), s)).openStream());
  10389. if(aSocket832 != null)
  10390. {
  10391. try
  10392. {
  10393. aSocket832.close();
  10394. }
  10395. catch(Exception _ex) { }
  10396. aSocket832 = null;
  10397. }
  10398. aSocket832 = openSocket(43595);
  10399. aSocket832.setSoTimeout(10000);
  10400. java.io.InputStream inputstream = aSocket832.getInputStream();
  10401. OutputStream outputstream = aSocket832.getOutputStream();
  10402. outputstream.write(("JAGGRAB /" + s + "\n\n").getBytes());
  10403. return new DataInputStream(inputstream);
  10404. }
  10405.  
  10406. public void doFlamesDrawing()
  10407. {
  10408. char c = '\u0100';
  10409. if(anInt1040 > 0)
  10410. {
  10411. for(int i = 0; i < 256; i++)
  10412. if(anInt1040 > 768)
  10413. anIntArray850[i] = method83(anIntArray851[i], anIntArray852[i], 1024 - anInt1040);
  10414. else
  10415. if(anInt1040 > 256)
  10416. anIntArray850[i] = anIntArray852[i];
  10417. else
  10418. anIntArray850[i] = method83(anIntArray852[i], anIntArray851[i], 256 - anInt1040);
  10419.  
  10420. } else
  10421. if(anInt1041 > 0)
  10422. {
  10423. for(int j = 0; j < 256; j++)
  10424. if(anInt1041 > 768)
  10425. anIntArray850[j] = method83(anIntArray851[j], anIntArray853[j], 1024 - anInt1041);
  10426. else
  10427. if(anInt1041 > 256)
  10428. anIntArray850[j] = anIntArray853[j];
  10429. else
  10430. anIntArray850[j] = method83(anIntArray853[j], anIntArray851[j], 256 - anInt1041);
  10431.  
  10432. } else
  10433. {
  10434. System.arraycopy(anIntArray851, 0, anIntArray850, 0, 256);
  10435.  
  10436. }
  10437. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, aRSImageProducer_1110.anIntArray315, 0, 33920);
  10438.  
  10439. int i1 = 0;
  10440. int j1 = 1152;
  10441. for(int k1 = 1; k1 < c - 1; k1++)
  10442. {
  10443. int l1 = (anIntArray969[k1] * (c - k1)) / c;
  10444. int j2 = 22 + l1;
  10445. if(j2 < 0)
  10446. j2 = 0;
  10447. i1 += j2;
  10448. for(int l2 = j2; l2 < 128; l2++)
  10449. {
  10450. int j3 = anIntArray828[i1++];
  10451. if(j3 != 0)
  10452. {
  10453. int l3 = j3;
  10454. int j4 = 256 - j3;
  10455. j3 = anIntArray850[j3];
  10456. int l4 = aRSImageProducer_1110.anIntArray315[j1];
  10457. aRSImageProducer_1110.anIntArray315[j1++] = ((j3 & 0xff00ff) * l3 + (l4 & 0xff00ff) * j4 & 0xff00ff00) + ((j3 & 0xff00) * l3 + (l4 & 0xff00) * j4 & 0xff0000) >> 8;
  10458. } else
  10459. {
  10460. j1++;
  10461. }
  10462. }
  10463.  
  10464. j1 += j2;
  10465. }
  10466.  
  10467. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  10468. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, aRSImageProducer_1111.anIntArray315, 0, 33920);
  10469.  
  10470. i1 = 0;
  10471. j1 = 1176;
  10472. for(int k2 = 1; k2 < c - 1; k2++)
  10473. {
  10474. int i3 = (anIntArray969[k2] * (c - k2)) / c;
  10475. int k3 = 103 - i3;
  10476. j1 += i3;
  10477. for(int i4 = 0; i4 < k3; i4++)
  10478. {
  10479. int k4 = anIntArray828[i1++];
  10480. if(k4 != 0)
  10481. {
  10482. int i5 = k4;
  10483. int j5 = 256 - k4;
  10484. k4 = anIntArray850[k4];
  10485. int k5 = aRSImageProducer_1111.anIntArray315[j1];
  10486. aRSImageProducer_1111.anIntArray315[j1++] = ((k4 & 0xff00ff) * i5 + (k5 & 0xff00ff) * j5 & 0xff00ff00) + ((k4 & 0xff00) * i5 + (k5 & 0xff00) * j5 & 0xff0000) >> 8;
  10487. } else
  10488. {
  10489. j1++;
  10490. }
  10491. }
  10492.  
  10493. i1 += 128 - k3;
  10494. j1 += 128 - k3 - i3;
  10495. }
  10496.  
  10497. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  10498. }
  10499.  
  10500. public void method134(Stream stream)
  10501. {
  10502. int j = stream.readBits(8);
  10503. if(j < playerCount)
  10504. {
  10505. for(int k = j; k < playerCount; k++)
  10506. anIntArray840[anInt839++] = playerIndices[k];
  10507.  
  10508. }
  10509. if(j > playerCount)
  10510. {
  10511. signlink.reporterror(myUsername + " Too many players");
  10512. throw new RuntimeException("eek");
  10513. }
  10514. playerCount = 0;
  10515. for(int l = 0; l < j; l++)
  10516. {
  10517. int i1 = playerIndices[l];
  10518. Player player = playerArray[i1];
  10519. int j1 = stream.readBits(1);
  10520. if(j1 == 0)
  10521. {
  10522. playerIndices[playerCount++] = i1;
  10523. player.anInt1537 = loopCycle;
  10524. } else
  10525. {
  10526. int k1 = stream.readBits(2);
  10527. if(k1 == 0)
  10528. {
  10529. playerIndices[playerCount++] = i1;
  10530. player.anInt1537 = loopCycle;
  10531. anIntArray894[anInt893++] = i1;
  10532. } else
  10533. if(k1 == 1)
  10534. {
  10535. playerIndices[playerCount++] = i1;
  10536. player.anInt1537 = loopCycle;
  10537. int l1 = stream.readBits(3);
  10538. player.moveInDir(false, l1);
  10539. int j2 = stream.readBits(1);
  10540. if(j2 == 1)
  10541. anIntArray894[anInt893++] = i1;
  10542. } else
  10543. if(k1 == 2)
  10544. {
  10545. playerIndices[playerCount++] = i1;
  10546. player.anInt1537 = loopCycle;
  10547. int i2 = stream.readBits(3);
  10548. player.moveInDir(true, i2);
  10549. int k2 = stream.readBits(3);
  10550. player.moveInDir(true, k2);
  10551. int l2 = stream.readBits(1);
  10552. if(l2 == 1)
  10553. anIntArray894[anInt893++] = i1;
  10554. } else
  10555. if(k1 == 3)
  10556. anIntArray840[anInt839++] = i1;
  10557. }
  10558. }
  10559. }
  10560.  
  10561. private void drawLoginScreen(boolean flag)
  10562. {
  10563. resetImageProducers();
  10564. aRSImageProducer_1109.initDrawingArea();
  10565. if (!hunterTitleButtons) {
  10566. aBackground_966.drawBackground(0, 0);
  10567. } else {
  10568. titleBox.drawSprite(0, 0);
  10569. }
  10570. drawSoundButton();
  10571. //drawWorldSelectButton();
  10572. char c = '\u0168';
  10573. char c1 = '\310';
  10574. if(loginScreenState == 0)
  10575. {
  10576. int i = c1 / 2 + 80;
  10577. smallText.method382(0x75a9a9, c / 2, onDemandFetcher.statusString, i, true);
  10578. i = c1 / 2 - 20;
  10579.  
  10580. if (clientDevelopment) {
  10581. int x = super.mouseX;
  10582. int y = super.mouseY;
  10583. if (super.mouseX != -1 || super.mouseY != -1) {
  10584. boldText.method382(0xffff00, c/2, "Mouse X: " + x + " , Mouse Y: " + y, i, true);
  10585. }
  10586. } else {
  10587. boldText.method382(0xffff00, c / 2, "Welcome to Hidden Mirage", i, true);
  10588. }
  10589. i += 30;
  10590. int l = c / 2 - 80;
  10591. int k1 = c1 / 2 + 20;
  10592. if (!hunterTitleButtons) {
  10593. aBackground_967.drawBackground(l - 73, k1 - 20);
  10594. } else {
  10595. titleButton.drawSprite(l - 73, k1 - 20);
  10596. }
  10597. boldText.method382(0xffffff, l, "New User", k1 + 5, true);
  10598. l = c / 2 + 80;
  10599. if (!hunterTitleButtons) {
  10600. aBackground_967.drawBackground(l - 73, k1 - 20);
  10601. } else {
  10602. titleButton.drawSprite(l - 73, k1 - 20);
  10603. }
  10604. boldText.method382(0xffffff, l, "Existing User", k1 + 5, true);
  10605. }
  10606. if(loginScreenState == 2)
  10607. {
  10608. int j = c1 / 2 - 40;
  10609. if(loginMessage1.length() > 0)
  10610. {
  10611. boldText.method382(0xffff00, c / 2, loginMessage1, j - 15, true);
  10612. boldText.method382(0xffff00, c / 2, loginMessage2, j, true);
  10613. j += 30;
  10614. } else
  10615. {
  10616. boldText.method382(0xffff00, c / 2, loginMessage2, j - 7, true);
  10617. j += 30;
  10618. }
  10619. boldText.method389(true, c / 2 - 90, 0xffffff, "Username: " + capitalize(myUsername) + ((loginScreenCursorPos == 0) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  10620. j += 15;
  10621. boldText.method389(true, c / 2 - 88, 0xffffff, "Password: " + TextClass.passwordAsterisks(myPassword) + ((loginScreenCursorPos == 1) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  10622. j += 15;
  10623. if(!flag)
  10624. {
  10625. int i1 = c / 2 - 80;
  10626. int l1 = c1 / 2 + 50;
  10627. if (!hunterTitleButtons) {
  10628. aBackground_967.drawBackground(i1 - 73, l1 - 20);
  10629. } else {
  10630. titleButton.drawSprite(i1 - 73, l1 - 20);
  10631. }
  10632. boldText.method382(0xffffff, i1, "Login", l1 + 5, true);
  10633. i1 = c / 2 + 80;
  10634. if (!hunterTitleButtons) {
  10635. aBackground_967.drawBackground(i1 - 73, l1 - 20);
  10636. } else {
  10637. titleButton.drawSprite(i1 - 73, l1 - 20);
  10638. }
  10639. boldText.method382(0xffffff, i1, "Cancel", l1 + 5, true);
  10640. }
  10641. }
  10642. if(loginScreenState == 3)
  10643. {
  10644. boldText.method382(0xffff00, c / 2, "Create a free account", c1 / 2 - 60, true);
  10645. int k = c1 / 2 - 35;
  10646. boldText.method382(0xffffff, c / 2, "To create a new account you need to", k, true);
  10647. //boldText.method382(0xffffff, c / 2, "To create a new account you need to", k, true);
  10648. k += 15;
  10649. boldText.method382(0xffffff, c / 2, "type in a username of your choice,", k, true);
  10650. //boldText.method382(0xffffff, c / 2, "go back to the main Falador webpage", k, true);
  10651. k += 15;
  10652. boldText.method382(0xffffff, c / 2, "choose a password that you can remember", k, true);
  10653. //boldText.method382(0xffffff, c / 2, "and choose the red 'create account'", k, true);
  10654. k += 15;
  10655. boldText.method382(0xffffff, c / 2, "and click login to play, have fun!", k, true);
  10656. //boldText.method382(0xffffff, c / 2, "button at the top right of that page.", k, true);
  10657. k += 15;
  10658. int j1 = c / 2;
  10659. int i2 = c1 / 2 + 50;
  10660. if (!hunterTitleButtons) {
  10661. aBackground_967.drawBackground(j1 - 73, i2 - 20);
  10662. } else {
  10663. titleButton.drawSprite(j1 - 73, i2 - 20);
  10664. }
  10665. boldText.method382(0xffffff, j1, "Cancel", i2 + 5, true);
  10666. }
  10667. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  10668. if(welcomeScreenRaised)
  10669. {
  10670. welcomeScreenRaised = false;
  10671. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  10672. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  10673. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  10674. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  10675. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  10676. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  10677. }
  10678. }
  10679.  
  10680. /*public void drawLoginScreen(boolean flag)
  10681. {
  10682. resetImageProducers();
  10683. aRSImageProducer_1109.initDrawingArea();
  10684. aBackground_966.drawBackground(0, 0);
  10685. char c = '\u0168';
  10686. char c1 = '\310';
  10687. if(loginScreenState == 0)
  10688. {
  10689. int i = c1 / 2 + 80;
  10690. smallText.method382(0x75a9a9, c / 2, onDemandFetcher.statusString, i, true);
  10691. i = c1 / 2 - 20;
  10692. boldText.method382(0xffff00, c / 2, "Welcome to Falador", i, true);
  10693. i += 30;
  10694. int l = c / 2 - 80;
  10695. int k1 = c1 / 2 + 20;
  10696. aBackground_967.drawBackground(l - 73, k1 - 20);
  10697. boldText.method382(0xffffff, l, "New User", k1 + 5, true);
  10698. l = c / 2 + 80;
  10699. aBackground_967.drawBackground(l - 73, k1 - 20);
  10700. boldText.method382(0xffffff, l, "Existing User", k1 + 5, true);
  10701. }
  10702. if(loginScreenState == 2)
  10703. {
  10704. int j = c1 / 2 - 40;
  10705. if(loginMessage1.length() > 0)
  10706. {
  10707. boldText.method382(0xffff00, c / 2, loginMessage1, j - 15, true);
  10708. boldText.method382(0xffff00, c / 2, loginMessage2, j, true);
  10709. j += 30;
  10710. } else
  10711. {
  10712. boldText.method382(0xffff00, c / 2, loginMessage2, j - 7, true);
  10713. j += 30;
  10714. }
  10715. boldText.method389(true, c / 2 - 90, 0xffffff, "Username: " + capitalize(myUsername) + ((loginScreenCursorPos == 0) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  10716. j += 15;
  10717. boldText.method389(true, c / 2 - 88, 0xffffff, "Password: " + TextClass.passwordAsterisks(myPassword) + ((loginScreenCursorPos == 1) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  10718. j += 15;
  10719. if(!flag)
  10720. {
  10721. int i1 = c / 2 - 80;
  10722. int l1 = c1 / 2 + 50;
  10723. aBackground_967.drawBackground(i1 - 73, l1 - 20);
  10724. boldText.method382(0xffffff, i1, "Login", l1 + 5, true);
  10725. i1 = c / 2 + 80;
  10726. aBackground_967.drawBackground(i1 - 73, l1 - 20);
  10727. boldText.method382(0xffffff, i1, "Cancel", l1 + 5, true);
  10728. }
  10729. }
  10730. if(loginScreenState == 3)
  10731. {
  10732. boldText.method382(0xffff00, c / 2, "Create a free account", c1 / 2 - 60, true);
  10733. int k = c1 / 2 - 35;
  10734. boldText.method382(0xffffff, c / 2, "To create a new account you need to", k, true);
  10735. k += 15;
  10736. boldText.method382(0xffffff, c / 2, "go back to the main Falador webpage", k, true);
  10737. k += 15;
  10738. boldText.method382(0xffffff, c / 2, "and choose the red 'create account'", k, true);
  10739. k += 15;
  10740. boldText.method382(0xffffff, c / 2, "button at the top right of that page.", k, true);
  10741. k += 15;
  10742. int j1 = c / 2;
  10743. int i2 = c1 / 2 + 50;
  10744. aBackground_967.drawBackground(j1 - 73, i2 - 20);
  10745. boldText.method382(0xffffff, j1, "Cancel", i2 + 5, true);
  10746. }
  10747. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  10748. if(welcomeScreenRaised)
  10749. {
  10750. welcomeScreenRaised = false;
  10751. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  10752. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  10753. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  10754. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  10755. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  10756. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  10757. }
  10758. }*/
  10759.  
  10760. public void drawFlames()
  10761. {
  10762. drawingFlames = true;
  10763. try
  10764. {
  10765. long l = System.currentTimeMillis();
  10766. int i = 0;
  10767. int j = 20;
  10768. while(aBoolean831)
  10769. {
  10770. anInt1208++;
  10771. calcFlamesPosition();
  10772. calcFlamesPosition();
  10773. doFlamesDrawing();
  10774. if(++i > 10)
  10775. {
  10776. long l1 = System.currentTimeMillis();
  10777. int k = (int)(l1 - l) / 10 - j;
  10778. j = 40 - k;
  10779. if(j < 5)
  10780. j = 5;
  10781. i = 0;
  10782. l = l1;
  10783. }
  10784. try
  10785. {
  10786. Thread.sleep(j);
  10787. }
  10788. catch(Exception _ex) { }
  10789. }
  10790. }
  10791. catch(Exception _ex) { }
  10792. drawingFlames = false;
  10793. }
  10794.  
  10795. public void raiseWelcomeScreen()
  10796. {
  10797. welcomeScreenRaised = true;
  10798. }
  10799.  
  10800. public void method137(Stream stream, int j)
  10801. {
  10802. if(j == 84)
  10803. {
  10804. int k = stream.readUnsignedByte();
  10805. int j3 = anInt1268 + (k >> 4 & 7);
  10806. int i6 = anInt1269 + (k & 7);
  10807. int l8 = stream.readUnsignedWord();
  10808. int k11 = stream.readUnsignedWord();
  10809. int l13 = stream.readUnsignedWord();
  10810. if(j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104)
  10811. {
  10812. NodeList class19_1 = groundArray[plane][j3][i6];
  10813. if(class19_1 != null)
  10814. {
  10815. 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())
  10816. {
  10817. if(class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff) || class30_sub2_sub4_sub2_3.anInt1559 != k11)
  10818. continue;
  10819. class30_sub2_sub4_sub2_3.anInt1559 = l13;
  10820. break;
  10821. }
  10822.  
  10823. spawnGroundItem(j3, i6);
  10824. }
  10825. }
  10826. return;
  10827. }
  10828. if(j == 105)
  10829. {
  10830. int l = stream.readUnsignedByte();
  10831. int k3 = anInt1268 + (l >> 4 & 7);
  10832. int j6 = anInt1269 + (l & 7);
  10833. int i9 = stream.readUnsignedWord();
  10834. int l11 = stream.readUnsignedByte();
  10835. int i14 = l11 >> 4 & 0xf;
  10836. int i16 = l11 & 7;
  10837. 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)
  10838. {
  10839. anIntArray1207[anInt1062] = i9;
  10840. anIntArray1241[anInt1062] = i16;
  10841. anIntArray1250[anInt1062] = Sounds.anIntArray326[i9];
  10842. anInt1062++;
  10843. }
  10844. }
  10845. if(j == 215)
  10846. {
  10847. int i1 = stream.method435();
  10848. int l3 = stream.method428();
  10849. int k6 = anInt1268 + (l3 >> 4 & 7);
  10850. int j9 = anInt1269 + (l3 & 7);
  10851. int i12 = stream.method435();
  10852. int j14 = stream.readUnsignedWord();
  10853. if(k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104 && i12 != unknownInt10)
  10854. {
  10855. Item class30_sub2_sub4_sub2_2 = new Item();
  10856. class30_sub2_sub4_sub2_2.ID = i1;
  10857. class30_sub2_sub4_sub2_2.anInt1559 = j14;
  10858. if(groundArray[plane][k6][j9] == null)
  10859. groundArray[plane][k6][j9] = new NodeList();
  10860. groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
  10861. spawnGroundItem(k6, j9);
  10862. }
  10863. return;
  10864. }
  10865. if(j == 156)
  10866. {
  10867. int j1 = stream.method426();
  10868. int i4 = anInt1268 + (j1 >> 4 & 7);
  10869. int l6 = anInt1269 + (j1 & 7);
  10870. int k9 = stream.readUnsignedWord();
  10871. if(i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104)
  10872. {
  10873. NodeList class19 = groundArray[plane][i4][l6];
  10874. if(class19 != null)
  10875. {
  10876. for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  10877. {
  10878. if(item.ID != (k9 & 0x7fff))
  10879. continue;
  10880. item.unlink();
  10881. break;
  10882. }
  10883.  
  10884. if(class19.reverseGetFirst() == null)
  10885. groundArray[plane][i4][l6] = null;
  10886. spawnGroundItem(i4, l6);
  10887. }
  10888. }
  10889. return;
  10890. }
  10891. if(j == 160)
  10892. {
  10893. int k1 = stream.method428();
  10894. int j4 = anInt1268 + (k1 >> 4 & 7);
  10895. int i7 = anInt1269 + (k1 & 7);
  10896. int l9 = stream.method428();
  10897. int j12 = l9 >> 2;
  10898. int k14 = l9 & 3;
  10899. int j16 = anIntArray1177[j12];
  10900. int j17 = stream.method435();
  10901. if(j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103)
  10902. {
  10903. int j18 = intGroundArray[plane][j4][i7];
  10904. int i19 = intGroundArray[plane][j4 + 1][i7];
  10905. int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
  10906. int k20 = intGroundArray[plane][j4][i7 + 1];
  10907. if(j16 == 0)
  10908. {
  10909. Object1 class10 = worldController.method296(plane, j4, i7);
  10910. if(class10 != null)
  10911. {
  10912. int k21 = class10.uid >> 14 & 0x7fff;
  10913. if(j12 == 2)
  10914. {
  10915. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, 4 + k14, 2, i19, l19, j18, k20, j17, false);
  10916. class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(k21, k14 + 1 & 3, 2, i19, l19, j18, k20, j17, false);
  10917. } else
  10918. {
  10919. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, k14, j12, i19, l19, j18, k20, j17, false);
  10920. }
  10921. }
  10922. }
  10923. if(j16 == 1)
  10924. {
  10925. Object2 class26 = worldController.method297(j4, i7, plane);
  10926. if(class26 != null)
  10927. class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(class26.uid >> 14 & 0x7fff, 0, 4, i19, l19, j18, k20, j17, false);
  10928. }
  10929. if(j16 == 2)
  10930. {
  10931. Object5 class28 = worldController.method298(j4, i7, plane);
  10932. if(j12 == 11)
  10933. j12 = 10;
  10934. if(class28 != null)
  10935. class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(class28.uid >> 14 & 0x7fff, k14, j12, i19, l19, j18, k20, j17, false);
  10936. }
  10937. if(j16 == 3)
  10938. {
  10939. Object3 class49 = worldController.method299(i7, j4, plane);
  10940. if(class49 != null)
  10941. class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(class49.uid >> 14 & 0x7fff, k14, 22, i19, l19, j18, k20, j17, false);
  10942. }
  10943. }
  10944. return;
  10945. }
  10946. if(j == 147)
  10947. {
  10948. int l1 = stream.method428();
  10949. int k4 = anInt1268 + (l1 >> 4 & 7);
  10950. int j7 = anInt1269 + (l1 & 7);
  10951. int i10 = stream.readUnsignedWord();
  10952. byte byte0 = stream.method430();
  10953. int l14 = stream.method434();
  10954. byte byte1 = stream.method429();
  10955. int k17 = stream.readUnsignedWord();
  10956. int k18 = stream.method428();
  10957. int j19 = k18 >> 2;
  10958. int i20 = k18 & 3;
  10959. int l20 = anIntArray1177[j19];
  10960. byte byte2 = stream.readSignedByte();
  10961. int l21 = stream.readUnsignedWord();
  10962. byte byte3 = stream.method429();
  10963. Player player;
  10964. if(i10 == unknownInt10)
  10965. player = myPlayer;
  10966. else
  10967. player = playerArray[i10];
  10968. if(player != null)
  10969. {
  10970. ObjectDef class46 = ObjectDef.forID(l21);
  10971. int i22 = intGroundArray[plane][k4][j7];
  10972. int j22 = intGroundArray[plane][k4 + 1][j7];
  10973. int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
  10974. int l22 = intGroundArray[plane][k4][j7 + 1];
  10975. Model model = class46.method578(j19, i20, i22, j22, k22, l22, -1);
  10976. if(model != null)
  10977. {
  10978. method130(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
  10979. player.anInt1707 = l14 + loopCycle;
  10980. player.anInt1708 = k17 + loopCycle;
  10981. player.aModel_1714 = model;
  10982. int i23 = class46.anInt744;
  10983. int j23 = class46.anInt761;
  10984. if(i20 == 1 || i20 == 3)
  10985. {
  10986. i23 = class46.anInt761;
  10987. j23 = class46.anInt744;
  10988. }
  10989. player.anInt1711 = k4 * 128 + i23 * 64;
  10990. player.anInt1713 = j7 * 128 + j23 * 64;
  10991. player.anInt1712 = method42(plane, player.anInt1713, player.anInt1711);
  10992. if(byte2 > byte0)
  10993. {
  10994. byte byte4 = byte2;
  10995. byte2 = byte0;
  10996. byte0 = byte4;
  10997. }
  10998. if(byte3 > byte1)
  10999. {
  11000. byte byte5 = byte3;
  11001. byte3 = byte1;
  11002. byte1 = byte5;
  11003. }
  11004. player.anInt1719 = k4 + byte2;
  11005. player.anInt1721 = k4 + byte0;
  11006. player.anInt1720 = j7 + byte3;
  11007. player.anInt1722 = j7 + byte1;
  11008. }
  11009. }
  11010. }
  11011. if(j == 151)
  11012. {
  11013. int i2 = stream.method426();
  11014. int l4 = anInt1268 + (i2 >> 4 & 7);
  11015. int k7 = anInt1269 + (i2 & 7);
  11016. int j10 = stream.method434();
  11017. int k12 = stream.method428();
  11018. int i15 = k12 >> 2;
  11019. int k16 = k12 & 3;
  11020. int l17 = anIntArray1177[i15];
  11021. if(l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104)
  11022. method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
  11023. return;
  11024. }
  11025. if(j == 4)
  11026. {
  11027. int j2 = stream.readUnsignedByte();
  11028. int i5 = anInt1268 + (j2 >> 4 & 7);
  11029. int l7 = anInt1269 + (j2 & 7);
  11030. int k10 = stream.readUnsignedWord();
  11031. int l12 = stream.readUnsignedByte();
  11032. int j15 = stream.readUnsignedWord();
  11033. if(i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104)
  11034. {
  11035. i5 = i5 * 128 + 64;
  11036. l7 = l7 * 128 + 64;
  11037. Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane, loopCycle, j15, k10, method42(plane, l7, i5) - l12, l7, i5);
  11038. aClass19_1056.insertHead(class30_sub2_sub4_sub3);
  11039. }
  11040. return;
  11041. }
  11042. if(j == 44)
  11043. {
  11044. int k2 = stream.method436();
  11045. int j5 = stream.readUnsignedWord();
  11046. int i8 = stream.readUnsignedByte();
  11047. int l10 = anInt1268 + (i8 >> 4 & 7);
  11048. int i13 = anInt1269 + (i8 & 7);
  11049. if(l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104)
  11050. {
  11051. Item class30_sub2_sub4_sub2_1 = new Item();
  11052. class30_sub2_sub4_sub2_1.ID = k2;
  11053. class30_sub2_sub4_sub2_1.anInt1559 = j5;
  11054. if(groundArray[plane][l10][i13] == null)
  11055. groundArray[plane][l10][i13] = new NodeList();
  11056. groundArray[plane][l10][i13].insertHead(class30_sub2_sub4_sub2_1);
  11057. spawnGroundItem(l10, i13);
  11058. }
  11059. return;
  11060. }
  11061. if(j == 101)
  11062. {
  11063. int l2 = stream.method427();
  11064. int k5 = l2 >> 2;
  11065. int j8 = l2 & 3;
  11066. int j13 = stream.readUnsignedByte();
  11067. if (k5 >= anIntArray1177.length) {
  11068. //System.out.println((baseX + anInt1268) + " " + (baseY + anInt1269));
  11069. //System.out.println(l2 + " " + j13);
  11070. return;
  11071. }
  11072. int i11 = anIntArray1177[k5];
  11073. int k15 = anInt1268 + (j13 >> 4 & 7);
  11074. int l16 = anInt1269 + (j13 & 7);
  11075. if(k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
  11076. method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
  11077. return;
  11078. }
  11079. if(j == 117)
  11080. {
  11081. int i3 = stream.readUnsignedByte();
  11082. int l5 = anInt1268 + (i3 >> 4 & 7);
  11083. int k8 = anInt1269 + (i3 & 7);
  11084. int j11 = l5 + stream.readSignedByte();
  11085. int k13 = k8 + stream.readSignedByte();
  11086. int l15 = stream.readSignedWord();
  11087. int i17 = stream.readUnsignedWord();
  11088. int i18 = stream.readUnsignedByte() * 4;
  11089. int l18 = stream.readUnsignedByte() * 4;
  11090. int k19 = stream.readUnsignedWord();
  11091. int j20 = stream.readUnsignedWord();
  11092. int i21 = stream.readUnsignedByte();
  11093. int j21 = stream.readUnsignedByte();
  11094. if(l5 >= 0 && k8 >= 0 && l5 < 104 && k8 < 104 && j11 >= 0 && k13 >= 0 && j11 < 104 && k13 < 104 && i17 != 65535)
  11095. {
  11096. l5 = l5 * 128 + 64;
  11097. k8 = k8 * 128 + 64;
  11098. j11 = j11 * 128 + 64;
  11099. k13 = k13 * 128 + 64;
  11100. 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);
  11101. class30_sub2_sub4_sub4.method455(k19 + loopCycle, k13, method42(plane, k13, j11) - l18, j11);
  11102. aClass19_1013.insertHead(class30_sub2_sub4_sub4);
  11103. }
  11104. }
  11105. }
  11106.  
  11107. private static void setLowMem()
  11108. {
  11109. WorldController.lowMem = true;
  11110. Texture.lowMem = true;
  11111. lowMem = true;
  11112. ObjectManager.lowMem = true;
  11113. ObjectDef.lowMem = true;
  11114. }
  11115.  
  11116. public void method139(Stream stream)
  11117. {
  11118. stream.initBitAccess();
  11119. int k = stream.readBits(8);
  11120. if(k < npcCount)
  11121. {
  11122. for(int l = k; l < npcCount; l++)
  11123. anIntArray840[anInt839++] = npcIndices[l];
  11124.  
  11125. }
  11126. if(k > npcCount)
  11127. {
  11128. signlink.reporterror(myUsername + " Too many npcs");
  11129. throw new RuntimeException("eek");
  11130. }
  11131. npcCount = 0;
  11132. for(int i1 = 0; i1 < k; i1++)
  11133. {
  11134. int j1 = npcIndices[i1];
  11135. NPC npc = npcArray[j1];
  11136. int k1 = stream.readBits(1);
  11137. if(k1 == 0)
  11138. {
  11139. npcIndices[npcCount++] = j1;
  11140. npc.anInt1537 = loopCycle;
  11141. } else
  11142. {
  11143. int l1 = stream.readBits(2);
  11144. if(l1 == 0)
  11145. {
  11146. npcIndices[npcCount++] = j1;
  11147. npc.anInt1537 = loopCycle;
  11148. anIntArray894[anInt893++] = j1;
  11149. } else
  11150. if(l1 == 1)
  11151. {
  11152. npcIndices[npcCount++] = j1;
  11153. npc.anInt1537 = loopCycle;
  11154. int i2 = stream.readBits(3);
  11155. npc.moveInDir(false, i2);
  11156. int k2 = stream.readBits(1);
  11157. if(k2 == 1)
  11158. anIntArray894[anInt893++] = j1;
  11159. } else
  11160. if(l1 == 2)
  11161. {
  11162. npcIndices[npcCount++] = j1;
  11163. npc.anInt1537 = loopCycle;
  11164. int j2 = stream.readBits(3);
  11165. npc.moveInDir(true, j2);
  11166. int l2 = stream.readBits(3);
  11167. npc.moveInDir(true, l2);
  11168. int i3 = stream.readBits(1);
  11169. if(i3 == 1)
  11170. anIntArray894[anInt893++] = j1;
  11171. } else
  11172. if(l1 == 3)
  11173. anIntArray840[anInt839++] = j1;
  11174. }
  11175. }
  11176.  
  11177. }
  11178.  
  11179. public void processLoginScreenInput()
  11180. {
  11181. if(loginScreenState == 0)
  11182. {
  11183. int i = super.myWidth / 2 - 80;
  11184. int l = super.myHeight / 2 + 20;
  11185. int x = super.mouseX;
  11186. int y = super.mouseY;
  11187. l += 20;
  11188. //@todo
  11189. if(super.clickMode3 == 1 && super.saveClickX >= 728 && super.saveClickX <= 763 && super.saveClickY >= 456 && super.saveClickY <= 488) {
  11190. musicButton();
  11191. }
  11192. if(super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20)
  11193. {
  11194. loginScreenState = 3;
  11195. loginScreenCursorPos = 0;
  11196. }
  11197. i = super.myWidth / 2 + 80;
  11198. if(super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20)
  11199. {
  11200. loginMessage1 = "";
  11201. loginMessage2 = "Enter your username & password.";
  11202. loginScreenState = 2;
  11203. loginScreenCursorPos = 0;
  11204. }
  11205. } else
  11206. {
  11207. if(loginScreenState == 2)
  11208. {
  11209. int j = super.myHeight / 2 - 40;
  11210. j += 30;
  11211. j += 25;
  11212. if(super.clickMode3 == 1 && super.saveClickX >= 728 && super.saveClickX <= 763 && super.saveClickY >= 456 && super.saveClickY <= 488) {
  11213. musicButton();
  11214. }
  11215. if(super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  11216. loginScreenCursorPos = 0;
  11217. j += 15;
  11218. if(super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  11219. loginScreenCursorPos = 1;
  11220. j += 15;
  11221. int i1 = super.myWidth / 2 - 80;
  11222. int k1 = super.myHeight / 2 + 50;
  11223. k1 += 20;
  11224. if(super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20)
  11225. {
  11226. loginFailures = 0;
  11227. login(capitalize(myUsername), myPassword, false);
  11228. if(loggedIn)
  11229. return;
  11230. }
  11231. i1 = super.myWidth / 2 + 80;
  11232. if(super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20)
  11233. {
  11234. loginScreenState = 0;
  11235. // myUsername = "";
  11236. // myPassword = "";
  11237. }
  11238. do
  11239. {
  11240. int l1 = readChar(-796);
  11241. if(l1 == -1)
  11242. break;
  11243. boolean flag1 = false;
  11244. for(int i2 = 0; i2 < validUserPassChars.length(); i2++)
  11245. {
  11246. if(l1 != validUserPassChars.charAt(i2))
  11247. continue;
  11248. flag1 = true;
  11249. break;
  11250. }
  11251.  
  11252. if(loginScreenCursorPos == 0)
  11253. {
  11254. if(l1 == 8 && myUsername.length() > 0)
  11255. myUsername = myUsername.substring(0, myUsername.length() - 1);
  11256. if(l1 == 9 || l1 == 10 || l1 == 13)
  11257. loginScreenCursorPos = 1;
  11258. if(flag1)
  11259. myUsername += (char)l1;
  11260. if(myUsername.length() > 12)
  11261. myUsername = capitalize(myUsername.substring(0, 12));
  11262. } else
  11263. if(loginScreenCursorPos == 1)
  11264. {
  11265. if(l1 == 8 && myPassword.length() > 0)
  11266. myPassword = myPassword.substring(0, myPassword.length() - 1);
  11267. if(l1 == 9 || l1 == 10 || l1 == 13)
  11268. loginScreenCursorPos = 0;
  11269. if(flag1)
  11270. myPassword += (char)l1;
  11271. if(myPassword.length() > 20)
  11272. myPassword = myPassword.substring(0, 20);
  11273. }
  11274. } while(true);
  11275. return;
  11276. }
  11277. if(loginScreenState == 3)
  11278. {
  11279. if(super.clickMode3 == 1 && super.saveClickX >= 728 && super.saveClickX <= 763 && super.saveClickY >= 456 && super.saveClickY <= 488) {
  11280. musicButton();
  11281. }
  11282. int k = super.myWidth / 2;
  11283. int j1 = super.myHeight / 2 + 50;
  11284. j1 += 20;
  11285. if(super.clickMode3 == 1 && super.saveClickX >= k - 75 && super.saveClickX <= k + 75 && super.saveClickY >= j1 - 20 && super.saveClickY <= j1 + 20)
  11286. loginScreenState = 0;
  11287. }
  11288. }
  11289. }
  11290.  
  11291. private void markMinimap(Sprite sprite, int i, int j) {
  11292. int k = minimapInt1 + minimapInt2 & 0x7ff;
  11293. int l = i * i + j * j;
  11294. if(l > 6400)
  11295. return;
  11296. int i1 = Model.modelIntArray1[k];
  11297. int j1 = Model.modelIntArray2[k];
  11298. i1 = (i1 * 256) / (minimapInt3 + 256);
  11299. j1 = (j1 * 256) / (minimapInt3 + 256);
  11300. int k1 = j * i1 + i * j1 >> 16;
  11301. int l1 = j * j1 - i * i1 >> 16;
  11302. if(l > 2500) {
  11303. sprite.drawSprite(((94 + k1) - sprite.anInt1444 / 2) + 4 + 20, 83 - l1 - sprite.anInt1445 / 2 - 4 + 5);
  11304. } else {
  11305. sprite.drawSprite(((94 + k1) - sprite.anInt1444 / 2) + 4 + 20, 83 - l1 - sprite.anInt1445 / 2 - 4 + 5);
  11306. }
  11307. }
  11308.  
  11309. public void method142(int i, int j, int k, int l, int i1, int j1, int k1
  11310. )
  11311. {
  11312. if(i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102)
  11313. {
  11314. if(lowMem && j != plane)
  11315. return;
  11316. int i2 = 0;
  11317. if(j1 == 0)
  11318. i2 = worldController.method300(j, i1, i);
  11319. if(j1 == 1)
  11320. i2 = worldController.method301(j, i1, i);
  11321. if(j1 == 2)
  11322. i2 = worldController.method302(j, i1, i);
  11323. if(j1 == 3)
  11324. i2 = worldController.method303(j, i1, i);
  11325. if(i2 != 0)
  11326. {
  11327. int i3 = worldController.method304(j, i1, i, i2);
  11328. int j2 = i2 >> 14 & 0x7fff;
  11329. int k2 = i3 & 0x1f;
  11330. int l2 = i3 >> 6;
  11331. if(j1 == 0)
  11332. {
  11333. worldController.method291(i1, j, i, (byte)-119);
  11334. ObjectDef class46 = ObjectDef.forID(j2);
  11335. if(class46.aBoolean767)
  11336. aClass11Array1230[j].method215(l2, k2, class46.aBoolean757, i1, i);
  11337. }
  11338. if(j1 == 1)
  11339. worldController.method292(i, j, i1);
  11340. if(j1 == 2)
  11341. {
  11342. worldController.method293(j, i1, i);
  11343. ObjectDef class46_1 = ObjectDef.forID(j2);
  11344. if(i1 + class46_1.anInt744 > 103 || i + class46_1.anInt744 > 103 || i1 + class46_1.anInt761 > 103 || i + class46_1.anInt761 > 103)
  11345. return;
  11346. if(class46_1.aBoolean767)
  11347. aClass11Array1230[j].method216(l2, class46_1.anInt744, i1, i, class46_1.anInt761, class46_1.aBoolean757);
  11348. }
  11349. if(j1 == 3)
  11350. {
  11351. worldController.method294(j, i, i1);
  11352. ObjectDef class46_2 = ObjectDef.forID(j2);
  11353. if(class46_2.aBoolean767 && class46_2.hasActions)
  11354. aClass11Array1230[j].method218(i, i1);
  11355. }
  11356. }
  11357. if(k1 >= 0)
  11358. {
  11359. int j3 = j;
  11360. if(j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
  11361. j3++;
  11362. ObjectManager.method188(worldController, k, i, l, j3, aClass11Array1230[j], intGroundArray, i1, k1, j);
  11363. }
  11364. }
  11365. }
  11366.  
  11367. private int size = 0;
  11368.  
  11369. public void updatePlayers(int i, Stream stream)
  11370. {
  11371. anInt839 = 0;
  11372. anInt893 = 0;
  11373. method117(stream);
  11374. method134(stream);
  11375. method91(stream, i);
  11376. method49(stream);
  11377. size = i;
  11378. for(int k = 0; k < anInt839; k++)
  11379. {
  11380. int l = anIntArray840[k];
  11381. if (playerArray[l] != null) {
  11382. if(playerArray[l].anInt1537 != loopCycle)
  11383. playerArray[l] = null;
  11384. }
  11385. }
  11386.  
  11387. if(stream.currentOffset != i)
  11388. {
  11389. signlink.reporterror("Error packet size mismatch in getplayer pos:" + stream.currentOffset + " psize:" + i);
  11390. //stream.currentOffset = i;
  11391. throw new RuntimeException("eek");
  11392. }
  11393. for(int i1 = 0; i1 < playerCount; i1++)
  11394. if(playerArray[playerIndices[i1]] == null)
  11395. {
  11396. signlink.reporterror(myUsername + " null entry in pl list - pos:" + i1 + " size:" + playerCount);
  11397. throw new RuntimeException("eek");
  11398. }
  11399.  
  11400. }
  11401.  
  11402. public void setCameraPos(int j, int k, int l, int i1, int j1, int k1)
  11403. {
  11404. int l1 = 2048 - k & 0x7ff;
  11405. int i2 = 2048 - j1 & 0x7ff;
  11406. int j2 = 0;
  11407. int k2 = 0;
  11408. int l2 = j;
  11409. if(l1 != 0)
  11410. {
  11411. int i3 = Model.modelIntArray1[l1];
  11412. int k3 = Model.modelIntArray2[l1];
  11413. int i4 = k2 * k3 - l2 * i3 >> 16;
  11414. l2 = k2 * i3 + l2 * k3 >> 16;
  11415. k2 = i4;
  11416. }
  11417. if(i2 != 0)
  11418. {
  11419. /* xxx if(cameratoggle){
  11420. if(zoom == 0)
  11421. zoom = k2;
  11422. if(lftrit == 0)
  11423. lftrit = j2;
  11424. if(fwdbwd == 0)
  11425. fwdbwd = l2;
  11426. k2 = zoom;
  11427. j2 = lftrit;
  11428. l2 = fwdbwd;
  11429. }
  11430. */
  11431. int j3 = Model.modelIntArray1[i2];
  11432. int l3 = Model.modelIntArray2[i2];
  11433. int j4 = l2 * j3 + j2 * l3 >> 16;
  11434. l2 = l2 * l3 - j2 * j3 >> 16;
  11435. j2 = j4;
  11436. }
  11437. xCameraPos = l - j2;
  11438. zCameraPos = i1 - k2;
  11439. yCameraPos = k1 - l2;
  11440. yCameraCurve = k;
  11441. xCameraCurve = j1;
  11442. }
  11443.  
  11444. public void updateStrings(String str, int i) {
  11445. switch(i) {
  11446. case 1675: sendFrame126(str, 17508); break;//Stab
  11447. case 1676: sendFrame126(str, 17509); break;//Slash
  11448. case 1677: sendFrame126(str, 17510); break;//Crush
  11449. case 1678: sendFrame126(str, 17511); break;//Magic
  11450. case 1679: sendFrame126(str, 17512); break;//Range
  11451. case 1680: sendFrame126(str, 17513); break;//Stab
  11452. case 1681: sendFrame126(str, 17514); break;//Slash
  11453. case 1682: sendFrame126(str, 17515); break;//Crush
  11454. case 1683: sendFrame126(str, 17516); break;//Magic
  11455. case 1684: sendFrame126(str, 17517); break;//Range
  11456. case 1686: sendFrame126(str, 17518); break;//Strength
  11457. case 1687: sendFrame126(str, 17519); break;//Prayer
  11458. }
  11459. }
  11460.  
  11461. public void sendFrame126(String str,int i) {
  11462. RSInterface.interfaceCache[i].message = str;
  11463. if(RSInterface.interfaceCache[i].parentID == tabInterfaceIDs[tabID])
  11464. needDrawTabArea = true;
  11465. }
  11466.  
  11467. public void sendPacket185(int button,int toggle,int type) {
  11468. switch(type) {
  11469. case 135:
  11470. RSInterface class9 = RSInterface.interfaceCache[button];
  11471. boolean flag8 = true;
  11472. if(class9.contentType > 0)
  11473. flag8 = promptUserForInput(class9);
  11474. if(flag8) {
  11475. stream.createFrame(185);
  11476. stream.writeWord(button);
  11477. }
  11478. break;
  11479. case 646:
  11480. stream.createFrame(185);
  11481. stream.writeWord(button);
  11482. RSInterface class9_2 = RSInterface.interfaceCache[button];
  11483. if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5) {
  11484. if(variousSettings[toggle] != class9_2.anIntArray212[0]) {
  11485. variousSettings[toggle] = class9_2.anIntArray212[0];
  11486. method33(toggle);
  11487. needDrawTabArea = true;
  11488. }
  11489. }
  11490. break;
  11491. case 169:
  11492. stream.createFrame(185);
  11493. stream.writeWord(button);
  11494. RSInterface class9_3 = RSInterface.interfaceCache[button];
  11495. if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5) {
  11496. variousSettings[toggle] = 1 - variousSettings[toggle];
  11497. method33(toggle);
  11498. needDrawTabArea = true;
  11499. }
  11500. switch(button) {
  11501. case 19136:
  11502. System.out.println("toggle = "+toggle);
  11503. if(toggle == 0)
  11504. sendFrame36(173,toggle);
  11505. if(toggle == 1)
  11506. sendPacket185(153,173,646);
  11507. break;
  11508. }
  11509. break;
  11510. }
  11511. }
  11512.  
  11513. public void sendFrame36(int id,int state) {
  11514. anIntArray1045[id] = state;
  11515. if(variousSettings[id] != state) {
  11516. variousSettings[id] = state;
  11517. method33(id);
  11518. needDrawTabArea = true;
  11519. if(dialogID != -1)
  11520. inputTaken = true;
  11521. }
  11522. }
  11523.  
  11524. public void sendFrame219() {
  11525. if(invOverlayInterfaceID != -1) {
  11526. invOverlayInterfaceID = -1;
  11527. needDrawTabArea = true;
  11528. tabAreaAltered = true;
  11529. }
  11530. if(backDialogID != -1) {
  11531. backDialogID = -1;
  11532. inputTaken = true;
  11533. }
  11534. if(inputDialogState != 0) {
  11535. inputDialogState = 0;
  11536. inputTaken = true;
  11537. }
  11538. openInterfaceID = -1;
  11539. aBoolean1149 = false;
  11540. }
  11541.  
  11542. public void sendFrame248(int interfaceID,int sideInterfaceID) {
  11543. if(backDialogID != -1) {
  11544. backDialogID = -1;
  11545. inputTaken = true;
  11546. }
  11547. if(inputDialogState != 0) {
  11548. inputDialogState = 0;
  11549. inputTaken = true;
  11550. }
  11551. openInterfaceID = interfaceID;
  11552. invOverlayInterfaceID = sideInterfaceID;
  11553. needDrawTabArea = true;
  11554. tabAreaAltered = true;
  11555. aBoolean1149 = false;
  11556. }
  11557.  
  11558. private static final Object[][] SKILL_DATA = new Object[][] {
  11559. new Object[] { "Attack", 50023 },
  11560. new Object[] { "Defence", 50065 },
  11561. new Object[] { "Strength", 50044 },
  11562. new Object[] { "Hitpoints", 50030 },
  11563. new Object[] { "Range", 50087 },
  11564. new Object[] { "Prayer", 50108 },
  11565. new Object[] { "Magic", 50129 },
  11566. new Object[] { "Cooking", 50101 },
  11567. new Object[] { "Woodcutting", 50143 },
  11568. new Object[] { "Fletching", 50136 },
  11569. new Object[] { "Fishing", 50080 },
  11570. new Object[] { "Firemaking", 50122 },
  11571. new Object[] { "Crafting", 50115 },
  11572. new Object[] { "Smithing", 50058 },
  11573. new Object[] { "Mining", 50037 },
  11574. new Object[] { "Herblore", 50072 },
  11575. new Object[] { "Agility", 50051 },
  11576. new Object[] { "Theiving", 50094 },
  11577. new Object[] { "Slayer", 50157 },
  11578. new Object[] { "Farming", 50164 },
  11579. new Object[] { "Runecrafting", 50150 },
  11580. new Object[] { "Construction", 50215 },
  11581. new Object[] { "Hunter", 50225 },
  11582. new Object[] { "Summoning", 50235 },
  11583. };
  11584.  
  11585. private boolean parsePacket() {
  11586. if(socketStream == null)
  11587. return false;
  11588. try {
  11589. int i = socketStream.available();
  11590. if(i == 0)
  11591. return false;
  11592. if(pktType == -1) {
  11593. socketStream.flushInputStream(inStream.buffer, 1);
  11594. pktType = inStream.buffer[0] & 0xff;
  11595. if(encryption != null)
  11596. pktType = pktType - encryption.getNextKey() & 0xff;
  11597. pktSize = SizeConstants.packetSizes[pktType];
  11598. i--;
  11599. }
  11600. if(pktSize == -1)
  11601. if(i > 0) {
  11602. socketStream.flushInputStream(inStream.buffer, 1);
  11603. pktSize = inStream.buffer[0] & 0xff;
  11604. i--;
  11605. } else {
  11606. return false;
  11607. }
  11608. if(pktSize == -2)
  11609. if(i > 1) {
  11610. socketStream.flushInputStream(inStream.buffer, 2);
  11611. inStream.currentOffset = 0;
  11612. pktSize = inStream.readUnsignedWord();
  11613. i -= 2;
  11614. } else {
  11615. return false;
  11616. }
  11617. if(i < pktSize)
  11618. return false;
  11619. inStream.currentOffset = 0;
  11620. socketStream.flushInputStream(inStream.buffer, pktSize);
  11621. anInt1009 = 0;
  11622. anInt843 = anInt842;
  11623. anInt842 = anInt841;
  11624. anInt841 = pktType;
  11625. switch(pktType) {
  11626. case 81:
  11627. try {
  11628. updatePlayers(pktSize, inStream);
  11629. } catch (Exception e) {
  11630. e.printStackTrace();
  11631. }
  11632. aBoolean1080 = false;
  11633. pktType = -1;
  11634. return true;
  11635.  
  11636. case 176:
  11637. daysSinceRecovChange = inStream.method427();
  11638. unreadMessages = inStream.method435();
  11639. membersInt = inStream.readUnsignedByte();
  11640. anInt1193 = inStream.method440();
  11641. daysSinceLastLogin = inStream.readUnsignedWord();
  11642. if(anInt1193 != 0 && openInterfaceID == -1) {
  11643. signlink.dnslookup(TextClass.method586(anInt1193));
  11644. clearTopInterfaces();
  11645. char c = '\u028A';
  11646. if(daysSinceRecovChange != 201 || membersInt == 1)
  11647. c = '\u028F';
  11648. reportAbuseInput = "";
  11649. canMute = false;
  11650. for(int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
  11651. if(RSInterface.interfaceCache[k9] == null || RSInterface.interfaceCache[k9].contentType != c)
  11652. continue;
  11653. openInterfaceID = RSInterface.interfaceCache[k9].parentID;
  11654.  
  11655. }
  11656. }
  11657. pktType = -1;
  11658. return true;
  11659.  
  11660. case 64:
  11661. anInt1268 = inStream.method427();
  11662. anInt1269 = inStream.method428();
  11663. for(int j = anInt1268; j < anInt1268 + 8; j++) {
  11664. for(int l9 = anInt1269; l9 < anInt1269 + 8; l9++)
  11665. if(groundArray[plane][j][l9] != null) {
  11666. groundArray[plane][j][l9] = null;
  11667. spawnGroundItem(j, l9);
  11668. }
  11669. }
  11670. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  11671. if(class30_sub1.anInt1297 >= anInt1268 && class30_sub1.anInt1297 < anInt1268 + 8 && class30_sub1.anInt1298 >= anInt1269 && class30_sub1.anInt1298 < anInt1269 + 8 && class30_sub1.anInt1295 == plane)
  11672. class30_sub1.anInt1294 = 0;
  11673. pktType = -1;
  11674. return true;
  11675.  
  11676. case 185:
  11677. int k = inStream.method436();
  11678. RSInterface.interfaceCache[k].anInt233 = 3;
  11679. if(myPlayer.desc == null)
  11680. 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];
  11681. else
  11682. RSInterface.interfaceCache[k].mediaID = (int)(0x12345678L + myPlayer.desc.type);
  11683. pktType = -1;
  11684. return true;
  11685.  
  11686. /* Clan message packet */
  11687. case 217:
  11688. try {
  11689. name = inStream.readString();
  11690. message = inStream.readString();
  11691. clanname = inStream.readString();
  11692. rights = inStream.readUnsignedWord();
  11693. //message = TextInput.processText(message);
  11694. message = Censor.doCensor(message);
  11695. //System.out.println(clanname);
  11696. pushMessage(message, 16, name);
  11697. } catch(Exception e) {
  11698. e.printStackTrace();
  11699. }
  11700. pktType = -1;
  11701. return true;
  11702.  
  11703. case 107:
  11704. aBoolean1160 = false;
  11705. for(int l = 0; l < 5; l++)
  11706. aBooleanArray876[l] = false;
  11707. pktType = -1;
  11708. return true;
  11709.  
  11710. case 72:
  11711. int i1 = inStream.method434();
  11712. RSInterface class9 = RSInterface.interfaceCache[i1];
  11713. for(int k15 = 0; k15 < class9.inv.length; k15++) {
  11714. class9.inv[k15] = -1;
  11715. class9.inv[k15] = 0;
  11716. }
  11717. pktType = -1;
  11718. return true;
  11719.  
  11720. case 214:
  11721. ignoreCount = pktSize / 8;
  11722. for(int j1 = 0; j1 < ignoreCount; j1++)
  11723. ignoreListAsLongs[j1] = inStream.readQWord();
  11724. pktType = -1;
  11725. return true;
  11726.  
  11727. case 166:
  11728. aBoolean1160 = true;
  11729. anInt1098 = inStream.readUnsignedByte();
  11730. anInt1099 = inStream.readUnsignedByte();
  11731. anInt1100 = inStream.readUnsignedWord();
  11732. anInt1101 = inStream.readUnsignedByte();
  11733. anInt1102 = inStream.readUnsignedByte();
  11734. if(anInt1102 >= 100) {
  11735. xCameraPos = anInt1098 * 128 + 64;
  11736. yCameraPos = anInt1099 * 128 + 64;
  11737. zCameraPos = method42(plane, yCameraPos, xCameraPos) - anInt1100;
  11738. }
  11739. pktType = -1;
  11740. return true;
  11741.  
  11742. case 134:
  11743. needDrawTabArea = true;
  11744. int skill = inStream.readUnsignedByte();
  11745. int experience = inStream.method439();
  11746. int level = inStream.readUnsignedByte();
  11747. currentExp[skill] = experience;
  11748. currentStats[skill] = level;
  11749. maxStats[skill] = 1;
  11750. for(int k20 = 0; k20 < 98; k20++) {
  11751. if(experience >= anIntArray1019[k20]) {
  11752. maxStats[skill] = k20 + 2;
  11753. }
  11754. }
  11755. int realLevel = maxStats[skill];
  11756. StringBuilder frameBuilder = new StringBuilder((String) SKILL_DATA[skill][0]);
  11757. frameBuilder.append(" Lvl: ");
  11758. frameBuilder.append(realLevel);
  11759. frameBuilder.append("\nCurrentXP: ");
  11760. frameBuilder.append(experience);
  11761. if (realLevel != 99) {
  11762. frameBuilder.append("\nNext Lvl: ");
  11763. int nextExp = anIntArray1019[realLevel - 1];
  11764. frameBuilder.append(nextExp);
  11765. frameBuilder.append("\nRemainder: ");
  11766. frameBuilder.append(nextExp - currentExp[skill]);
  11767. }
  11768. sendFrame126(frameBuilder.toString(), (Integer) SKILL_DATA[skill][1] + 1);
  11769. pktType = -1;
  11770. return true;
  11771.  
  11772. case 71://both
  11773. int l1 = inStream.readUnsignedWord();
  11774. int j10 = inStream.method426();
  11775. if(l1 == 65535)
  11776. l1 = -1;
  11777. tabInterfaceIDs[j10] = l1;
  11778. needDrawTabArea = true;
  11779. tabAreaAltered = true;
  11780. pktType = -1;
  11781. return true;
  11782.  
  11783. case 74:
  11784. int i2 = inStream.method434();
  11785. if(i2 == 65535)
  11786. i2 = -1;
  11787. if(i2 != currentSong && musicEnabled && !lowMem && prevSong == 0) {
  11788. nextSong = i2;
  11789. songChanging = true;
  11790. onDemandFetcher.method558(2, nextSong);
  11791. }
  11792. currentSong = i2;
  11793. pktType = -1;
  11794. return true;
  11795.  
  11796.  
  11797. case 121:
  11798. int j2 = inStream.method436();
  11799. int k10 = inStream.method435();
  11800. if(musicEnabled && !lowMem) {
  11801. nextSong = j2;
  11802. songChanging = false;
  11803. onDemandFetcher.method558(2, nextSong);
  11804. prevSong = k10;
  11805. }
  11806. pktType = -1;
  11807. return true;
  11808.  
  11809. case 109:
  11810. resetLogout();
  11811. pktType = -1;
  11812. return false;
  11813.  
  11814. case 70:
  11815. int k2 = inStream.readSignedWord();
  11816. int l10 = inStream.method437();
  11817. int i16 = inStream.method434();
  11818. RSInterface class9_5 = RSInterface.interfaceCache[i16];
  11819. class9_5.anInt263 = k2;
  11820. class9_5.anInt265 = l10;
  11821. pktType = -1;
  11822. return true;
  11823.  
  11824. case 73:
  11825. case 241:
  11826. int l2 = anInt1069;
  11827. int i11 = anInt1070;
  11828. if(pktType == 73) {
  11829. l2 = inStream.method435();
  11830. i11 = inStream.readUnsignedWord();
  11831. aBoolean1159 = false;
  11832. }
  11833. if(pktType == 241) {
  11834. i11 = inStream.method435();
  11835. inStream.initBitAccess();
  11836. for(int j16 = 0; j16 < 4; j16++) {
  11837. for(int l20 = 0; l20 < 13; l20++) {
  11838. for(int j23 = 0; j23 < 13; j23++) {
  11839. int i26 = inStream.readBits(1);
  11840. if(i26 == 1)
  11841. anIntArrayArrayArray1129[j16][l20][j23] = inStream.readBits(26);
  11842. else
  11843. anIntArrayArrayArray1129[j16][l20][j23] = -1;
  11844. }
  11845. }
  11846. }
  11847. inStream.finishBitAccess();
  11848. l2 = inStream.readUnsignedWord();
  11849. aBoolean1159 = true;
  11850. }
  11851. if(anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2) {
  11852. pktType = -1;
  11853. return true;
  11854. }
  11855. anInt1069 = l2;
  11856. anInt1070 = i11;
  11857. baseX = (anInt1069 - 6) * 8;
  11858. baseY = (anInt1070 - 6) * 8;
  11859. aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49) && anInt1070 / 8 == 48;
  11860. if(anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
  11861. aBoolean1141 = true;
  11862. loadingStage = 1;
  11863. aLong824 = System.currentTimeMillis();
  11864. aRSImageProducer_1165.initDrawingArea();
  11865. DrawingArea.fillPixels(2, 130, 22, 0xffffff, 2);
  11866. DrawingArea.drawPixels(20, 3, 3, 0, 128);
  11867. regularText.drawText(0, "Loading - Please Wait", 18, 68);
  11868. regularText.drawText(0xffffff, "Loading - Please Wait", 17, 67);
  11869. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  11870. if(pktType == 73) {
  11871. int k16 = 0;
  11872. for(int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++) {
  11873. for(int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
  11874. k16++;
  11875. }
  11876. aByteArrayArray1183 = new byte[k16][];
  11877. aByteArrayArray1247 = new byte[k16][];
  11878. anIntArray1234 = new int[k16];
  11879. anIntArray1235 = new int[k16];
  11880. anIntArray1236 = new int[k16];
  11881. k16 = 0;
  11882. for(int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++) {
  11883. for(int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++) {
  11884. anIntArray1234[k16] = (l23 << 8) + j26;
  11885. if(aBoolean1141 && (j26 == 49 || j26 == 149 || j26 == 147 || l23 == 50 || l23 == 49 && j26 == 47)) {
  11886. anIntArray1235[k16] = -1;
  11887. anIntArray1236[k16] = -1;
  11888. k16++;
  11889. } else {
  11890. int k28 = anIntArray1235[k16] = onDemandFetcher.method562(0, j26, l23);
  11891. if(k28 != -1)
  11892. onDemandFetcher.method558(3, k28);
  11893. int j30 = anIntArray1236[k16] = onDemandFetcher.method562(1, j26, l23);
  11894. if(j30 != -1)
  11895. onDemandFetcher.method558(3, j30);
  11896. k16++;
  11897. }
  11898. }
  11899. }
  11900. }
  11901. if(pktType == 241) {
  11902. int l16 = 0;
  11903. int ai[] = new int[676];
  11904. for(int i24 = 0; i24 < 4; i24++) {
  11905. for(int k26 = 0; k26 < 13; k26++) {
  11906. for(int l28 = 0; l28 < 13; l28++) {
  11907. int k30 = anIntArrayArrayArray1129[i24][k26][l28];
  11908. if(k30 != -1) {
  11909. int k31 = k30 >> 14 & 0x3ff;
  11910. int i32 = k30 >> 3 & 0x7ff;
  11911. int k32 = (k31 / 8 << 8) + i32 / 8;
  11912. for(int j33 = 0; j33 < l16; j33++) {
  11913. if(ai[j33] != k32)
  11914. continue;
  11915. k32 = -1;
  11916.  
  11917. }
  11918. if(k32 != -1)
  11919. ai[l16++] = k32;
  11920. }
  11921. }
  11922. }
  11923. }
  11924. aByteArrayArray1183 = new byte[l16][];
  11925. aByteArrayArray1247 = new byte[l16][];
  11926. anIntArray1234 = new int[l16];
  11927. anIntArray1235 = new int[l16];
  11928. anIntArray1236 = new int[l16];
  11929. for(int l26 = 0; l26 < l16; l26++) {
  11930. int i29 = anIntArray1234[l26] = ai[l26];
  11931. int l30 = i29 >> 8 & 0xff;
  11932. int l31 = i29 & 0xff;
  11933. int j32 = anIntArray1235[l26] = onDemandFetcher.method562(0, l31, l30);
  11934. if(j32 != -1)
  11935. onDemandFetcher.method558(3, j32);
  11936. int i33 = anIntArray1236[l26] = onDemandFetcher.method562(1, l31, l30);
  11937. if(i33 != -1)
  11938. onDemandFetcher.method558(3, i33);
  11939. }
  11940. }
  11941. int i17 = baseX - anInt1036;
  11942. int j21 = baseY - anInt1037;
  11943. anInt1036 = baseX;
  11944. anInt1037 = baseY;
  11945. for(int j24 = 0; j24 < 16384; j24++) {
  11946. NPC npc = npcArray[j24];
  11947. if(npc != null) {
  11948. for(int j29 = 0; j29 < 10; j29++) {
  11949. npc.smallX[j29] -= i17;
  11950. npc.smallY[j29] -= j21;
  11951. }
  11952. npc.x -= i17 * 128;
  11953. npc.y -= j21 * 128;
  11954. }
  11955. }
  11956. for(int i27 = 0; i27 < maxPlayers; i27++) {
  11957. Player player = playerArray[i27];
  11958. if(player != null) {
  11959. for(int i31 = 0; i31 < 10; i31++) {
  11960. player.smallX[i31] -= i17;
  11961. player.smallY[i31] -= j21;
  11962. }
  11963. player.x -= i17 * 128;
  11964. player.y -= j21 * 128;
  11965. }
  11966. }
  11967. aBoolean1080 = true;
  11968. byte byte1 = 0;
  11969. byte byte2 = 104;
  11970. byte byte3 = 1;
  11971. if(i17 < 0) {
  11972. byte1 = 103;
  11973. byte2 = -1;
  11974. byte3 = -1;
  11975. }
  11976. byte byte4 = 0;
  11977. byte byte5 = 104;
  11978. byte byte6 = 1;
  11979. if(j21 < 0) {
  11980. byte4 = 103;
  11981. byte5 = -1;
  11982. byte6 = -1;
  11983. }
  11984. for(int k33 = byte1; k33 != byte2; k33 += byte3) {
  11985. for(int l33 = byte4; l33 != byte5; l33 += byte6) {
  11986. int i34 = k33 + i17;
  11987. int j34 = l33 + j21;
  11988. for(int k34 = 0; k34 < 4; k34++)
  11989. if(i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
  11990. groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
  11991. else
  11992. groundArray[k34][k33][l33] = null;
  11993. }
  11994. }
  11995. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext()) {
  11996. class30_sub1_1.anInt1297 -= i17;
  11997. class30_sub1_1.anInt1298 -= j21;
  11998. if(class30_sub1_1.anInt1297 < 0 || class30_sub1_1.anInt1298 < 0 || class30_sub1_1.anInt1297 >= 104 || class30_sub1_1.anInt1298 >= 104)
  11999. class30_sub1_1.unlink();
  12000. }
  12001. if(destX != 0) {
  12002. destX -= i17;
  12003. destY -= j21;
  12004. }
  12005. aBoolean1160 = false;
  12006. pktType = -1;
  12007. return true;
  12008.  
  12009. case 208:
  12010. int i3 = inStream.method437();
  12011. if(i3 >= 0)
  12012. method60(i3);
  12013. anInt1018 = i3;
  12014. pktType = -1;
  12015. return true;
  12016.  
  12017. case 99:
  12018. anInt1021 = inStream.readUnsignedByte();
  12019. pktType = -1;
  12020. return true;
  12021.  
  12022. case 75:
  12023. int j3 = inStream.method436();
  12024. int j11 = inStream.method436();
  12025. RSInterface.interfaceCache[j11].anInt233 = 2;
  12026. RSInterface.interfaceCache[j11].mediaID = j3;
  12027. pktType = -1;
  12028. return true;
  12029.  
  12030. case 114:
  12031. anInt1104 = inStream.method434() * 30;
  12032. pktType = -1;
  12033. return true;
  12034.  
  12035. case 60:
  12036. anInt1269 = inStream.readUnsignedByte();
  12037. anInt1268 = inStream.method427();
  12038. while(inStream.currentOffset < pktSize) {
  12039. int k3 = inStream.readUnsignedByte();
  12040. method137(inStream, k3);
  12041. }
  12042. pktType = -1;
  12043. return true;
  12044.  
  12045. case 35:
  12046. int l3 = inStream.readUnsignedByte();
  12047. int k11 = inStream.readUnsignedByte();
  12048. int j17 = inStream.readUnsignedByte();
  12049. int k21 = inStream.readUnsignedByte();
  12050. aBooleanArray876[l3] = true;
  12051. anIntArray873[l3] = k11;
  12052. anIntArray1203[l3] = j17;
  12053. anIntArray928[l3] = k21;
  12054. anIntArray1030[l3] = 0;
  12055. pktType = -1;
  12056. return true;
  12057.  
  12058. case 174:
  12059. int soundId = inStream.readShort();
  12060. int type = inStream.readUByte();
  12061. int delay = inStream.readShort();
  12062. int volume = inStream.readShort();
  12063. anIntArray1207[anInt1062] = soundId;
  12064. anIntArray1241[anInt1062] = type;
  12065. anIntArray1250[anInt1062] = delay + Sounds.anIntArray326[soundId];
  12066. soundVolume[anInt1062] = volume;
  12067. anInt1062++;
  12068. pktType = -1;
  12069. return true;
  12070.  
  12071. case 104:
  12072. int j4 = inStream.method427();
  12073. int i12 = inStream.method426();
  12074. String s6 = inStream.readString();
  12075. if(j4 >= 1 && j4 <= 5) {
  12076. if(s6.equalsIgnoreCase("null"))
  12077. s6 = null;
  12078. atPlayerActions[j4 - 1] = s6;
  12079. atPlayerArray[j4 - 1] = i12 == 0;
  12080. }
  12081. pktType = -1;
  12082. return true;
  12083.  
  12084. case 78:
  12085. destX = 0;
  12086. pktType = -1;
  12087. return true;
  12088.  
  12089. case 253:
  12090. String s = inStream.readString();
  12091. if(s.endsWith(":tradereq:")) {
  12092. String s3 = s.substring(0, s.indexOf(":"));
  12093. long l17 = TextClass.longForName(s3);
  12094. boolean flag2 = false;
  12095. for(int j27 = 0; j27 < ignoreCount; j27++) {
  12096. if(ignoreListAsLongs[j27] != l17)
  12097. continue;
  12098. flag2 = true;
  12099.  
  12100. }
  12101. if(consoleOpen) {
  12102. printConsoleMessage(s, 1);
  12103. } else if(!flag2 && anInt1251 == 0)
  12104. pushMessage("wishes to trade with you.", 4, s3);
  12105. } else if (s.endsWith(":clan:")) {
  12106. String s4 = s.substring(0, s.indexOf(":"));
  12107. long l18 = TextClass.longForName(s4);
  12108. pushMessage("Clan: ", 8, s4);
  12109. } else if(s.endsWith("#url#")) {
  12110. String link = s.substring(0, s.indexOf("#"));
  12111. pushMessage("Join us at: ", 9, link);
  12112. } else if(s.endsWith(":duelreq:")) {
  12113. String s4 = s.substring(0, s.indexOf(":"));
  12114. long l18 = TextClass.longForName(s4);
  12115. boolean flag3 = false;
  12116. for(int k27 = 0; k27 < ignoreCount; k27++) {
  12117. if(ignoreListAsLongs[k27] != l18)
  12118. continue;
  12119. flag3 = true;
  12120.  
  12121. }
  12122. if(!flag3 && anInt1251 == 0)
  12123. pushMessage("wishes to duel with you.", 8, s4);
  12124. } else if(s.endsWith(":chalreq:")) {
  12125. String s5 = s.substring(0, s.indexOf(":"));
  12126. long l19 = TextClass.longForName(s5);
  12127. boolean flag4 = false;
  12128. for(int l27 = 0; l27 < ignoreCount; l27++) {
  12129. if(ignoreListAsLongs[l27] != l19)
  12130. continue;
  12131. flag4 = true;
  12132.  
  12133. }
  12134. if(!flag4 && anInt1251 == 0) {
  12135. String s8 = s.substring(s.indexOf(":") + 1, s.length() - 9);
  12136. pushMessage(s8, 8, s5);
  12137. }
  12138. } else {
  12139. pushMessage(s, 0, "");
  12140. }
  12141. pktType = -1;
  12142. return true;
  12143.  
  12144. case 1:
  12145. for(int k4 = 0; k4 < playerArray.length; k4++)
  12146. if(playerArray[k4] != null)
  12147. playerArray[k4].anim = -1;
  12148. for(int j12 = 0; j12 < npcArray.length; j12++)
  12149. if(npcArray[j12] != null)
  12150. npcArray[j12].anim = -1;
  12151. pktType = -1;
  12152. return true;
  12153.  
  12154. case 50:
  12155. long l4 = inStream.readQWord();
  12156. int i18 = inStream.readUnsignedByte();
  12157. String s7 = TextClass.fixName(TextClass.nameForLong(l4));
  12158. for(int k24 = 0; k24 < friendsCount; k24++) {
  12159. if(l4 != friendsListAsLongs[k24])
  12160. continue;
  12161. if(friendsNodeIDs[k24] != i18) {
  12162. friendsNodeIDs[k24] = i18;
  12163. needDrawTabArea = true;
  12164. if(i18 >= 2) {
  12165. pushMessage(s7 + " has logged in.", 5, "");
  12166. }
  12167. if(i18 <= 1) {
  12168. pushMessage(s7 + " has logged out.", 5, "");
  12169. }
  12170. }
  12171. s7 = null;
  12172.  
  12173. }
  12174. if(s7 != null && friendsCount < 200) {
  12175. friendsListAsLongs[friendsCount] = l4;
  12176. friendsList[friendsCount] = s7;
  12177. friendsNodeIDs[friendsCount] = i18;
  12178. friendsCount++;
  12179. needDrawTabArea = true;
  12180. }
  12181. for(boolean flag6 = false; !flag6;) {
  12182. flag6 = true;
  12183. for(int k29 = 0; k29 < friendsCount - 1; k29++)
  12184. if(friendsNodeIDs[k29] != nodeID && friendsNodeIDs[k29 + 1] == nodeID || friendsNodeIDs[k29] == 0 && friendsNodeIDs[k29 + 1] != 0) {
  12185. int j31 = friendsNodeIDs[k29];
  12186. friendsNodeIDs[k29] = friendsNodeIDs[k29 + 1];
  12187. friendsNodeIDs[k29 + 1] = j31;
  12188. String s10 = friendsList[k29];
  12189. friendsList[k29] = friendsList[k29 + 1];
  12190. friendsList[k29 + 1] = s10;
  12191. long l32 = friendsListAsLongs[k29];
  12192. friendsListAsLongs[k29] = friendsListAsLongs[k29 + 1];
  12193. friendsListAsLongs[k29 + 1] = l32;
  12194. needDrawTabArea = true;
  12195. flag6 = false;
  12196. }
  12197. }
  12198. pktType = -1;
  12199. return true;
  12200.  
  12201. case 110:
  12202. if(tabID == 12)
  12203. needDrawTabArea = true;
  12204. energy = inStream.readUnsignedByte();
  12205. pktType = -1;
  12206. return true;
  12207.  
  12208. case 254:
  12209. anInt855 = inStream.readUnsignedByte();
  12210. if(anInt855 == 1)
  12211. anInt1222 = inStream.readUnsignedWord();
  12212. if(anInt855 >= 2 && anInt855 <= 6) {
  12213. if(anInt855 == 2) {
  12214. anInt937 = 64;
  12215. anInt938 = 64;
  12216. }
  12217. if(anInt855 == 3) {
  12218. anInt937 = 0;
  12219. anInt938 = 64;
  12220. }
  12221. if(anInt855 == 4) {
  12222. anInt937 = 128;
  12223. anInt938 = 64;
  12224. }
  12225. if(anInt855 == 5) {
  12226. anInt937 = 64;
  12227. anInt938 = 0;
  12228. }
  12229. if(anInt855 == 6) {
  12230. anInt937 = 64;
  12231. anInt938 = 128;
  12232. }
  12233. anInt855 = 2;
  12234. anInt934 = inStream.readUnsignedWord();
  12235. anInt935 = inStream.readUnsignedWord();
  12236. anInt936 = inStream.readUnsignedByte();
  12237. }
  12238. if(anInt855 == 10)
  12239. anInt933 = inStream.readUnsignedWord();
  12240. pktType = -1;
  12241. return true;
  12242.  
  12243. case 248:
  12244. int i5 = inStream.method435();
  12245. int k12 = inStream.readUnsignedWord();
  12246. if(backDialogID != -1) {
  12247. backDialogID = -1;
  12248. inputTaken = true;
  12249. }
  12250. if(inputDialogState != 0) {
  12251. inputDialogState = 0;
  12252. inputTaken = true;
  12253. }
  12254. openInterfaceID = i5;
  12255. invOverlayInterfaceID = k12;
  12256. needDrawTabArea = true;
  12257. tabAreaAltered = true;
  12258. aBoolean1149 = false;
  12259. pktType = -1;
  12260. return true;
  12261.  
  12262. case 79:
  12263. int j5 = inStream.method434();
  12264. int l12 = inStream.method435();
  12265. RSInterface class9_3 = RSInterface.interfaceCache[j5];
  12266. if(class9_3 != null && class9_3.type == 0) {
  12267. if(l12 < 0)
  12268. l12 = 0;
  12269. if(l12 > class9_3.scrollMax - class9_3.height)
  12270. l12 = class9_3.scrollMax - class9_3.height;
  12271. class9_3.scrollPosition = l12;
  12272. }
  12273. pktType = -1;
  12274. return true;
  12275.  
  12276. case 68:
  12277. for(int k5 = 0; k5 < variousSettings.length; k5++)
  12278. if(variousSettings[k5] != anIntArray1045[k5]) {
  12279. variousSettings[k5] = anIntArray1045[k5];
  12280. method33(k5);
  12281. needDrawTabArea = true;
  12282. }
  12283. pktType = -1;
  12284. return true;
  12285.  
  12286. case 196:
  12287. long l5 = inStream.readQWord();
  12288. int j18 = inStream.readDWord();
  12289. int l21 = inStream.readUnsignedByte();
  12290. boolean flag5 = false;
  12291. if(l21 <= 1) {
  12292. for(int l29 = 0; l29 < ignoreCount; l29++) {
  12293. if(ignoreListAsLongs[l29] != l5)
  12294. continue;
  12295. flag5 = true;
  12296.  
  12297. }
  12298. }
  12299. if(!flag5 && anInt1251 == 0)
  12300. try {
  12301. String s9 = TextInput.method525(pktSize - 13, inStream);
  12302. //if(l21 != 3)
  12303. s9 = Censor.doCensor(s9);
  12304. if(l21 == 2 || l21 == 3)
  12305. pushMessage(s9, 7, "@cr2@" + TextClass.fixName(TextClass.nameForLong(l5)));
  12306. else
  12307. if(l21 == 1)
  12308. pushMessage(s9, 7, "@cr1@" + TextClass.fixName(TextClass.nameForLong(l5)));
  12309. else
  12310. if(l21 == 4)
  12311. pushMessage(s9, 7, "@cr3@" + TextClass.fixName(TextClass.nameForLong(l5)));
  12312. else
  12313. pushMessage(s9, 3, TextClass.fixName(TextClass.nameForLong(l5)));
  12314. } catch(Exception exception1) {
  12315. signlink.reporterror("cde1");
  12316. }
  12317. pktType = -1;
  12318. return true;
  12319.  
  12320. case 85:
  12321. anInt1269 = inStream.method427();
  12322. anInt1268 = inStream.method427();
  12323. pktType = -1;
  12324. return true;
  12325.  
  12326. case 24:
  12327. anInt1054 = inStream.method428();
  12328. if(anInt1054 == tabID) {
  12329. if(anInt1054 == 3)
  12330. tabID = 1;
  12331. else
  12332. tabID = 3;
  12333. needDrawTabArea = true;
  12334. }
  12335. pktType = -1;
  12336. return true;
  12337.  
  12338. case 246:
  12339. int i6 = inStream.method434();
  12340. int i13 = inStream.readUnsignedWord();
  12341. int k18 = inStream.readUnsignedWord();
  12342. if(k18 == 65535) {
  12343. RSInterface.interfaceCache[i6].anInt233 = 0;
  12344. pktType = -1;
  12345. return true;
  12346. } else {
  12347. ItemDef itemDef = ItemDef.forID(k18);
  12348. RSInterface.interfaceCache[i6].anInt233 = 4;
  12349. RSInterface.interfaceCache[i6].mediaID = k18;
  12350. RSInterface.interfaceCache[i6].modelRotation1 = itemDef.modelRotation1;
  12351. RSInterface.interfaceCache[i6].modelRotation2 = itemDef.modelRotation2;
  12352. RSInterface.interfaceCache[i6].modelZoom = (itemDef.modelZoom * 100) / i13;
  12353. pktType = -1;
  12354. return true;
  12355. }
  12356.  
  12357. case 171:
  12358. boolean flag1 = inStream.readUnsignedByte() == 1;
  12359. int j13 = inStream.readUnsignedWord();
  12360. RSInterface.interfaceCache[j13].isMouseoverTriggered = flag1;
  12361. pktType = -1;
  12362. return true;
  12363.  
  12364. case 142:
  12365. int j6 = inStream.method434();
  12366. method60(j6);
  12367. if(backDialogID != -1) {
  12368. backDialogID = -1;
  12369. inputTaken = true;
  12370. }
  12371. if(inputDialogState != 0) {
  12372. inputDialogState = 0;
  12373. inputTaken = true;
  12374. }
  12375. invOverlayInterfaceID = j6;
  12376. needDrawTabArea = true;
  12377. tabAreaAltered = true;
  12378. openInterfaceID = -1;
  12379. aBoolean1149 = false;
  12380. pktType = -1;
  12381. return true;
  12382.  
  12383. case 126:
  12384. String text = inStream.readString();
  12385. int frame = inStream.method435();
  12386. if (text.startsWith("www.")) {
  12387. launchURL(text);
  12388. pktType = -1;
  12389. return true;
  12390. }
  12391. updateStrings(text, frame);
  12392. sendFrame126(text, frame);
  12393. if (frame >= 18144 && frame <= 18244) {
  12394. clanList[frame - 18144] = text;
  12395. }
  12396. pktType = -1;
  12397. return true;
  12398.  
  12399. case 206:
  12400. publicChatMode = inStream.readUnsignedByte();
  12401. privateChatMode = inStream.readUnsignedByte();
  12402. tradeMode = inStream.readUnsignedByte();
  12403. aBoolean1233 = true;
  12404. inputTaken = true;
  12405. pktType = -1;
  12406. return true;
  12407.  
  12408. case 240:
  12409. if(tabID == 12)
  12410. needDrawTabArea = true;
  12411. weight = inStream.readSignedWord();
  12412. pktType = -1;
  12413. return true;
  12414.  
  12415. case 8:
  12416. int k6 = inStream.method436();
  12417. int l13 = inStream.readUnsignedWord();
  12418. RSInterface.interfaceCache[k6].anInt233 = 1;
  12419. RSInterface.interfaceCache[k6].mediaID = l13;
  12420. pktType = -1;
  12421. return true;
  12422.  
  12423. case 122:
  12424. int l6 = inStream.method436();
  12425. int i14 = inStream.method436();
  12426. int i19 = i14 >> 10 & 0x1f;
  12427. int i22 = i14 >> 5 & 0x1f;
  12428. int l24 = i14 & 0x1f;
  12429. RSInterface.interfaceCache[l6].textColor = (i19 << 19) + (i22 << 11) + (l24 << 3);
  12430. pktType = -1;
  12431. return true;
  12432.  
  12433. case 53:
  12434. needDrawTabArea = true;
  12435. int i7 = inStream.readUnsignedWord();
  12436. RSInterface class9_1 = RSInterface.interfaceCache[i7];
  12437. int j19 = inStream.readUnsignedWord();
  12438. for(int j22 = 0; j22 < j19; j22++) {
  12439. int i25 = inStream.readUnsignedByte();
  12440. if(i25 == 255)
  12441. i25 = inStream.method440();
  12442. class9_1.inv[j22] = inStream.method436();
  12443. class9_1.invStackSizes[j22] = i25;
  12444. }
  12445. for(int j25 = j19; j25 < class9_1.inv.length; j25++) {
  12446. class9_1.inv[j25] = 0;
  12447. class9_1.invStackSizes[j25] = 0;
  12448. }
  12449. pktType = -1;
  12450. return true;
  12451.  
  12452. case 230:
  12453. int j7 = inStream.method435();
  12454. int j14 = inStream.readUnsignedWord();
  12455. int k19 = inStream.readUnsignedWord();
  12456. int k22 = inStream.method436();
  12457. RSInterface.interfaceCache[j14].modelRotation1 = k19;
  12458. RSInterface.interfaceCache[j14].modelRotation2 = k22;
  12459. RSInterface.interfaceCache[j14].modelZoom = j7;
  12460. pktType = -1;
  12461. return true;
  12462.  
  12463. case 221:
  12464. anInt900 = inStream.readUnsignedByte();
  12465. needDrawTabArea = true;
  12466. pktType = -1;
  12467. return true;
  12468.  
  12469. case 177:
  12470. aBoolean1160 = true;
  12471. anInt995 = inStream.readUnsignedByte();
  12472. anInt996 = inStream.readUnsignedByte();
  12473. anInt997 = inStream.readUnsignedWord();
  12474. anInt998 = inStream.readUnsignedByte();
  12475. anInt999 = inStream.readUnsignedByte();
  12476. if(anInt999 >= 100) {
  12477. int k7 = anInt995 * 128 + 64;
  12478. int k14 = anInt996 * 128 + 64;
  12479. int i20 = method42(plane, k14, k7) - anInt997;
  12480. int l22 = k7 - xCameraPos;
  12481. int k25 = i20 - zCameraPos;
  12482. int j28 = k14 - yCameraPos;
  12483. int i30 = (int)Math.sqrt(l22 * l22 + j28 * j28);
  12484. yCameraCurve = (int)(Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  12485. xCameraCurve = (int)(Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  12486. if(yCameraCurve < 128)
  12487. yCameraCurve = 128;
  12488. if(yCameraCurve > 383)
  12489. yCameraCurve = 383;
  12490. }
  12491. pktType = -1;
  12492. return true;
  12493.  
  12494. case 249:
  12495. anInt1046 = inStream.method426();
  12496. unknownInt10 = inStream.method436();
  12497. pktType = -1;
  12498. return true;
  12499.  
  12500. case 65:
  12501. updateNPCs(inStream, pktSize);
  12502. pktType = -1;
  12503. return true;
  12504.  
  12505. case 27:
  12506. messagePromptRaised = false;
  12507. inputDialogState = 1;
  12508. amountOrNameInput = "";
  12509. inputTaken = true;
  12510. pktType = -1;
  12511. return true;
  12512.  
  12513. case 187:
  12514. messagePromptRaised = false;
  12515. inputDialogState = 2;
  12516. amountOrNameInput = "";
  12517. inputTaken = true;
  12518. pktType = -1;
  12519. return true;
  12520.  
  12521. case 97:
  12522. int l7 = inStream.readUnsignedWord();
  12523. method60(l7);
  12524. if (invOverlayInterfaceID != -1) {
  12525. invOverlayInterfaceID = -1;
  12526. needDrawTabArea = true;
  12527. tabAreaAltered = true;
  12528. }
  12529. if (backDialogID != -1) {
  12530. backDialogID = -1;
  12531. inputTaken = true;
  12532. }
  12533. if (inputDialogState != 0) {
  12534. inputDialogState = 0;
  12535. inputTaken = true;
  12536. }
  12537. //17511 = Question Type
  12538. //15819 = Christmas Type
  12539. //15812 = Security Type
  12540. //15801 = Item Scam Type
  12541. //15791 = Password Safety ?
  12542. //15774 = Good/Bad Password
  12543. //15767 = Drama Type ????
  12544. if (l7 == 15244) {
  12545. openInterfaceID = 15812;
  12546. fullscreenInterfaceID = 15244;
  12547. } else {
  12548. openInterfaceID = l7;
  12549. }
  12550. aBoolean1149 = false;
  12551. pktType = -1;
  12552. return true;
  12553.  
  12554. case 218:
  12555. int i8 = inStream.method438();
  12556. dialogID = i8;
  12557. inputTaken = true;
  12558. pktType = -1;
  12559. return true;
  12560.  
  12561. case 86:
  12562. followPlayer = 0;
  12563. followNPC = 0;
  12564. int l11z = inStream.readUnsignedWord();
  12565. int iq = inStream.readUnsignedByte();
  12566. followDistance = inStream.readUnsignedWord();
  12567. if (iq == 0) {
  12568. followNPC = l11z;
  12569. }
  12570. else if (iq == 1)
  12571. {
  12572. followPlayer = l11z;
  12573. }
  12574. pktType = -1;
  12575. return true;
  12576.  
  12577. case 87:
  12578. int j8 = inStream.method434();
  12579. int l14 = inStream.method439();
  12580. anIntArray1045[j8] = l14;
  12581. if(variousSettings[j8] != l14) {
  12582. variousSettings[j8] = l14;
  12583. method33(j8);
  12584. needDrawTabArea = true;
  12585. if(dialogID != -1)
  12586. inputTaken = true;
  12587. }
  12588. pktType = -1;
  12589. return true;
  12590.  
  12591. case 36:
  12592. int k8 = inStream.method434();
  12593. byte byte0 = inStream.readSignedByte();
  12594. anIntArray1045[k8] = byte0;
  12595. if(variousSettings[k8] != byte0) {
  12596. variousSettings[k8] = byte0;
  12597. method33(k8);
  12598. needDrawTabArea = true;
  12599. if(dialogID != -1)
  12600. inputTaken = true;
  12601. }
  12602. pktType = -1;
  12603. return true;
  12604.  
  12605. case 61:
  12606. anInt1055 = inStream.readUnsignedByte();
  12607. pktType = -1;
  12608. return true;
  12609.  
  12610. case 200:
  12611. int l8 = inStream.readUnsignedWord();
  12612. int i15 = inStream.readSignedWord();
  12613. RSInterface class9_4 = RSInterface.interfaceCache[l8];
  12614. class9_4.anInt257 = i15;
  12615. if(i15 == -1) {
  12616. class9_4.anInt246 = 0;
  12617. class9_4.anInt208 = 0;
  12618. }
  12619. pktType = -1;
  12620. return true;
  12621.  
  12622. case 219:
  12623. if(invOverlayInterfaceID != -1) {
  12624. invOverlayInterfaceID = -1;
  12625. needDrawTabArea = true;
  12626. tabAreaAltered = true;
  12627. }
  12628. if(backDialogID != -1) {
  12629. backDialogID = -1;
  12630. inputTaken = true;
  12631. }
  12632. if(inputDialogState != 0) {
  12633. inputDialogState = 0;
  12634. inputTaken = true;
  12635. }
  12636. openInterfaceID = -1;
  12637. aBoolean1149 = false;
  12638. pktType = -1;
  12639. return true;
  12640.  
  12641. case 34:
  12642. needDrawTabArea = true;
  12643. int i9 = inStream.readUnsignedWord();
  12644. RSInterface class9_2 = RSInterface.interfaceCache[i9];
  12645. while(inStream.currentOffset < pktSize) {
  12646. int j20 = inStream.method422();
  12647. int i23 = inStream.readUnsignedWord();
  12648. int l25 = inStream.readUnsignedByte();
  12649. if(l25 == 255)
  12650. l25 = inStream.readDWord();
  12651. if(j20 >= 0 && j20 < class9_2.inv.length) {
  12652. class9_2.inv[j20] = i23;
  12653. class9_2.invStackSizes[j20] = l25;
  12654. }
  12655. }
  12656. pktType = -1;
  12657. return true;
  12658.  
  12659. case 4:
  12660. case 44:
  12661. case 84:
  12662. case 101:
  12663. case 105:
  12664. case 117:
  12665. case 147:
  12666. case 151:
  12667. case 156:
  12668. case 160:
  12669. case 215:
  12670. method137(inStream, pktType);
  12671. pktType = -1;
  12672. return true;
  12673.  
  12674. case 106:
  12675. tabID = inStream.method427();
  12676. needDrawTabArea = true;
  12677. tabAreaAltered = true;
  12678. pktType = -1;
  12679. return true;
  12680.  
  12681. case 164:
  12682. int j9 = inStream.method434();
  12683. method60(j9);
  12684. if(invOverlayInterfaceID != -1) {
  12685. invOverlayInterfaceID = -1;
  12686. needDrawTabArea = true;
  12687. tabAreaAltered = true;
  12688. }
  12689. backDialogID = j9;
  12690. inputTaken = true;
  12691. openInterfaceID = -1;
  12692. aBoolean1149 = false;
  12693. pktType = -1;
  12694. return true;
  12695. case 123:
  12696. pktType = -1;
  12697. return true;
  12698. }
  12699. signlink.reporterror("T1 - " + pktType + "," + pktSize + " - " + anInt842 + "," + anInt843);
  12700. //resetLogout();
  12701. } catch(IOException _ex) {
  12702. dropClient();
  12703. } catch(Exception exception) {
  12704. exception.printStackTrace();
  12705. String s2 = "T2 - " + pktType + "," + anInt842 + "," + anInt843 + " - " + pktSize + "," + (baseX + myPlayer.smallX[0]) + "," + (baseY + myPlayer.smallY[0]) + " - ";
  12706. for(int j15 = 0; j15 < pktSize && j15 < 50; j15++)
  12707. s2 = s2 + inStream.buffer[j15] + ",";
  12708. signlink.reporterror(s2);
  12709. //resetLogout();
  12710. }
  12711. pktType = -1;
  12712. return true;
  12713. }
  12714.  
  12715. public void method146() {
  12716. anInt1265++;
  12717. method47(true);
  12718. method26(true);
  12719. method47(false);
  12720. method26(false);
  12721. method55();
  12722. method104();
  12723. if(!aBoolean1160) {
  12724. int i = anInt1184;
  12725. if(anInt984 / 256 > i)
  12726. i = anInt984 / 256;
  12727. if(aBooleanArray876[4] && anIntArray1203[4] + 128 > i)
  12728. i = anIntArray1203[4] + 128;
  12729. int k = minimapInt1 + anInt896 & 0x7ff;
  12730. setCameraPos(600 + i * 3, i, anInt1014, method42(plane, myPlayer.y, myPlayer.x) - 50, k, anInt1015);
  12731. }
  12732. int j;
  12733. if(!aBoolean1160)
  12734. j = method120();
  12735. else
  12736. j = method121();
  12737. int l = xCameraPos;
  12738. int i1 = zCameraPos;
  12739. int j1 = yCameraPos;
  12740. int k1 = yCameraCurve;
  12741. int l1 = xCameraCurve;
  12742. for(int i2 = 0; i2 < 5; i2++)
  12743. if(aBooleanArray876[i2]) {
  12744. 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]);
  12745. if(i2 == 0)
  12746. xCameraPos += j2;
  12747. if(i2 == 1)
  12748. zCameraPos += j2;
  12749. if(i2 == 2)
  12750. yCameraPos += j2;
  12751. if(i2 == 3)
  12752. xCameraCurve = xCameraCurve + j2 & 0x7ff;
  12753. if(i2 == 4) {
  12754. yCameraCurve += j2;
  12755. if(yCameraCurve < 128)
  12756. yCameraCurve = 128;
  12757. if(yCameraCurve > 383)
  12758. yCameraCurve = 383;
  12759. }
  12760. }
  12761. int k2 = Texture.anInt1481;
  12762. Model.aBoolean1684 = true;
  12763. Model.anInt1687 = 0;
  12764. Model.anInt1685 = super.mouseX - 4;
  12765. Model.anInt1686 = super.mouseY - 4;
  12766. DrawingArea.setAllPixelsToZero();
  12767. worldController.method313(xCameraPos, yCameraPos, xCameraCurve, zCameraPos, j, yCameraCurve);
  12768. worldController.clearObj5Cache();
  12769. updateEntities();
  12770. drawHeadIcon();
  12771. method37(k2);
  12772. draw3dScreen();
  12773. drawConsoleArea();
  12774. drawConsole();
  12775. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  12776. xCameraPos = l;
  12777. zCameraPos = i1;
  12778. yCameraPos = j1;
  12779. yCameraCurve = k1;
  12780. xCameraCurve = l1;
  12781. }
  12782.  
  12783. //public void drawRunOrb() {
  12784. /* Draws empty orb */
  12785. /* emptyOrb.drawSprite(190, 85);
  12786. if (!runClicked) {
  12787. if (super.mouseX > 710 && super.mouseX < 742 && super.mouseY > 88 && super.mouseY < 122) {
  12788. hoverorbrun.drawSprite(190, 85);
  12789. } else {
  12790. runorb.drawSprite(190, 85);
  12791.  
  12792. }
  12793. } else {
  12794. if (super.mouseX > 710 && super.mouseX < 742 && super.mouseY > 88 && super.mouseY < 122) {
  12795. hoverorbrun2.drawSprite(165, 85);
  12796. } else {
  12797. runClick.drawSprite(165, 85);
  12798. }
  12799. }
  12800. }*/
  12801.  
  12802. private void processMinimapActions() {
  12803. /*if(super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 95 && super.mouseY < 128){
  12804. if(!runClicked){
  12805. menuActionName[2] = "Toggle Run-Mode On";
  12806. } else if(runClicked){
  12807. menuActionName[2] = "Toggle Run-Mode Off";
  12808. }
  12809. menuActionID[2] = 1050;
  12810. menuActionRow = 2;
  12811. menuActionName[1] = "Rest";
  12812. menuActionID[1] = 1501;
  12813. menuActionRow = 3;
  12814. }*/
  12815. if (super.mouseX >= 695 && super.mouseX <= 751
  12816. && super.mouseY >= 134 && super.mouseY < 165) {
  12817. menuActionName[1] = "Familar Information";
  12818. menuActionID[1] = 1505;
  12819. menuActionRow = 2;
  12820. }
  12821. if(super.mouseX >= 742 && super.mouseX <= 764 && super.mouseY >= 1 && super.mouseY <= 24) {
  12822. menuActionName[1] = "Logout";
  12823. menuActionID[1] = 1004;
  12824. menuActionRow = 2;
  12825. } else if (super.mouseX > 713 && super.mouseX < 765 && super.mouseY > 83 && super.mouseY < 118) {
  12826. menuActionName[1] = "Run";
  12827. menuActionID[1] = 1051;
  12828. menuActionRow = 2;
  12829. }
  12830. }
  12831.  
  12832. public int getOrbFill(int statusInt){
  12833. if(statusInt <= 100 && statusInt >= 97) {
  12834. return 0;
  12835. } else if(statusInt <= 96 && statusInt >= 93) {
  12836. return 1;
  12837. } else if(statusInt <= 92 && statusInt >= 89) {
  12838. return 2;
  12839. } else if(statusInt <= 88 && statusInt >= 85) {
  12840. return 3;
  12841. } else if(statusInt <= 84 && statusInt >= 81) {
  12842. return 4;
  12843. } else if(statusInt <= 80 && statusInt >= 77) {
  12844. return 5;
  12845. } else if(statusInt <= 76 && statusInt >= 73) {
  12846. return 6;
  12847. } else if(statusInt <= 72 && statusInt >= 69) {
  12848. return 7;
  12849. } else if(statusInt <= 68 && statusInt >= 65) {
  12850. return 8;
  12851. } else if(statusInt <= 64 && statusInt >= 61) {
  12852. return 9;
  12853. } else if(statusInt <= 60 && statusInt >= 57) {
  12854. return 10;
  12855. } else if(statusInt <= 56 && statusInt >= 53) {
  12856. return 11;
  12857. } else if(statusInt <= 52 && statusInt >= 49) {
  12858. return 12;
  12859. } else if(statusInt <= 48 && statusInt >= 45) {
  12860. return 13;
  12861. } else if(statusInt <= 44 && statusInt >= 41) {
  12862. return 14;
  12863. } else if(statusInt <= 40 && statusInt >= 37) {
  12864. return 15;
  12865. } else if(statusInt <= 36 && statusInt >= 33) {
  12866. return 16;
  12867. } else if(statusInt <= 32 && statusInt >= 29) {
  12868. return 17;
  12869. } else if(statusInt <= 28 && statusInt >= 25) {
  12870. return 18;
  12871. } else if(statusInt <= 24 && statusInt >= 21) {
  12872. return 19;
  12873. } else if(statusInt <= 20 && statusInt >= 17) {
  12874. return 20;
  12875. } else if(statusInt <= 16 && statusInt >= 13) {
  12876. return 21;
  12877. } else if(statusInt <= 12 && statusInt >= 9) {
  12878. return 22;
  12879. } else if(statusInt <= 8 && statusInt >= 7) {
  12880. return 23;
  12881. } else if(statusInt <= 6 && statusInt >= 5) {
  12882. return 24;
  12883. } else if(statusInt <= 4 && statusInt >= 3) {
  12884. return 25;
  12885. } else if(statusInt <= 2 && statusInt >= 1) {
  12886. return 26;
  12887. } else if(statusInt <= 0) {
  12888. return 27;
  12889. }
  12890. return 0;
  12891. }
  12892.  
  12893. public boolean restOrb, musicOrb, prayClicked, prayHover, runHover;
  12894. public void loadExtraSprites(){
  12895. for(int i = 1; i <= 15; i++) {
  12896. ORBS[i] = new Sprite("Gameframe/Orbs/ORBS "+i+"");
  12897. }
  12898. for(int i = 0; i <= 4;i++) {
  12899. LOGOUT[i] = new Sprite("Gameframe/Orbs/X "+i+"");
  12900. }
  12901. }
  12902.  
  12903. public int getOrbTextColor(int statusInt){
  12904. if(statusInt >= 75 && statusInt <= 100){
  12905. return 0x00FF00;
  12906. } else if(statusInt >= 50 && statusInt <= 74){
  12907. return 0xFFFF00;
  12908. } else if(statusInt >= 25 && statusInt <= 49){
  12909. return 0xFF981F;
  12910. } else {
  12911. return 0xFF0000;
  12912. }
  12913. }
  12914.  
  12915. public int runState = 1;
  12916. public boolean logHover, summHover;
  12917. public Sprite[] ORBS = new Sprite[16];
  12918. public Sprite[] LOGOUT = new Sprite[5];
  12919. /*public void drawRunOrb(){
  12920. String OD = signlink.findcachedir()+"/Sprites/Gameframe/Orbs/";
  12921. ORBS[0] = new Sprite(OD+"ORBS 0.PNG", 27, getOrbFill(energy));
  12922. if(!runClicked){
  12923. if(runHover){
  12924. ORBS[15].drawSprite(190-4, 92-4);
  12925. } else{
  12926. ORBS[14].drawSprite(190-4, 92-4);
  12927. }
  12928. ORBS[10].drawSprite(193-4, 95-4);
  12929. if(energy != 100){
  12930. ORBS[0].drawSprite(193-4, 95-4);
  12931. }
  12932. ORBS[8].drawSprite(199-4, 100-4);
  12933. } else {
  12934. if(runHover){
  12935. ORBS[15].drawSprite(190-4, 92-4);
  12936. } else{
  12937. ORBS[14].drawSprite(190-4, 92-4);
  12938. }
  12939. ORBS[11].drawSprite(193-4, 95-4);
  12940. if(energy != 100){
  12941. ORBS[0].drawSprite(193-4, 95-4);
  12942. }
  12943. ORBS[9].drawSprite(199-4, 100-4);
  12944. }
  12945. int Y = 120-4;
  12946. smallText.method382(getOrbTextColor(energy), 234-4, ""+energy, Y, true);
  12947. }*/
  12948.  
  12949. public void drawRunOrb() {
  12950. /* Created by Shoes */
  12951. String cEnergy = RSInterface.interfaceCache[149].message;
  12952. cEnergy = cEnergy.replaceAll("%","");
  12953. int currentEnergy = Integer.parseInt(cEnergy);
  12954. int energyPercent = currentEnergy * 34 / 100;
  12955.  
  12956. String OD = signlink.findcachedir()+"/Sprites/Gameframe/Orbs/";
  12957. ORBS[0] = new Sprite(OD+"ORBS 0.PNG", 27, getOrbFill(energy));
  12958.  
  12959.  
  12960. Sprite orb = (runClicked ? ORBS[11] : ORBS[10]);
  12961. Sprite icon = (runClicked ? ORBS[9] : ORBS[8]);
  12962.  
  12963. Sprite orb1 = ORBS[10];
  12964. Sprite icon1 = ORBS[8];
  12965.  
  12966. Sprite orbDrawn = emptyOrb;
  12967. orbDrawn.drawSprite(185, 85);
  12968.  
  12969. if (currentEnergy > 0 && runClicked) {
  12970. orb.drawSprite(188, 88);
  12971. } else {
  12972. runClicked = false;
  12973. orb1.drawSprite(188, 88);
  12974. }
  12975. orbDrawn = new Sprite("emptyorb", 57, 34 - energyPercent);
  12976. orbDrawn.drawSprite(185, 85);
  12977. //if (super.mouseX > 713 && super.mouseX < 765 && super.mouseY > 83 && super.mouseY < 118)
  12978. //hoveredEmpty.drawSprite(185, 85);
  12979. if (currentEnergy > 0 && runClicked) {
  12980. icon.drawSprite(195, 93);
  12981. } else {
  12982. runClicked = false;
  12983. icon1.drawSprite(195, 93);
  12984. }
  12985. int colour;
  12986. if (currentEnergy >= 75)
  12987. colour = 65280;
  12988. else if (currentEnergy >= 50)
  12989. colour = 0xffff00;
  12990. else if (currentEnergy >= 25)
  12991. colour = 0xfca607;
  12992. else
  12993. colour = 0xf50d0d;
  12994. smallText.method382(colour, 229, cEnergy, 111 + 1, true);
  12995. }
  12996.  
  12997. public void drawSumm() {
  12998. int summ;
  12999. String OD = signlink.findcachedir() + "Sprites/Gameframe/Orbs/";
  13000. int currentPR = currentStats[23];
  13001. int maxPR2 = maxStats[23];
  13002. summ = (int) (((double) currentPR / (double) maxPR2) * 100D);
  13003. ORBS[0] = new Sprite(OD + "ORBS 0.PNG", 27, getOrbFill(summ));
  13004. if (summHover) {
  13005. ORBS[15].drawSprite(174-2, 130-10);
  13006. } else if (!summHover) {
  13007. ORBS[14].drawSprite(174-2, 130-10);
  13008. }
  13009. ORBS[12].drawSprite(177-2, 135-12);
  13010. ORBS[0].drawSprite(177-2, 136-8);
  13011. if (summ <= 25) {
  13012. if (loopCycle % 20 < 10) {
  13013. ORBS[13].drawSprite(181-2, 139-10);
  13014. }
  13015. } else {
  13016. ORBS[13].drawSprite(181-2, 139-10);
  13017. }
  13018. smallText.method382(getOrbTextColor(summ), 218-2, ""+1, 157-9, true);
  13019.  
  13020. }
  13021. public void drawHP() {
  13022. int health;
  13023. int currentHP = currentStats[3];
  13024. int maxHP2 = maxStats[3];
  13025. health = (int)(((double)currentHP / (double)maxHP2) * 100D);
  13026. Sprite orbDrawn = emptyOrb;
  13027. int hpPercent = currentHP * 34 / maxHP2;
  13028. orbDrawn.drawSprite(170, 13);
  13029. orbDrawn = new Sprite("emptyorb", 57, 34 - hpPercent);
  13030. hitPointsFill.drawSprite(173, 16);
  13031. orbDrawn.drawSprite(170, 13);
  13032. int colour;
  13033. if(health >= 75)
  13034. colour = 65280;
  13035. else if(health >= 50)
  13036. colour = 0xffff00;
  13037. else if(health >= 25)
  13038. colour = 0xfca607;
  13039. else
  13040. colour = 0xf50d0d;
  13041. if(health <= 25){
  13042. if(loopCycle % 20 < 10){
  13043. hitPointsIcon.drawSprite(179, 24);
  13044. }
  13045. } else {
  13046. hitPointsIcon.drawSprite(179, 24);
  13047. }
  13048. smallText.method382(colour, 213, String.valueOf(currentHP), 39+2, true);
  13049. /* Draws inside orb sprites */
  13050. if(health <= 0){
  13051. hitPointsIcon.drawSprite(179, 24);
  13052. }
  13053. }
  13054. public void drawLogout(){
  13055. if(tabID == 14) {
  13056. LOGOUT[4].drawSprite(223, 1);
  13057. } if(tabID != 14) {
  13058. LOGOUT[3].drawSprite(223, 1);
  13059. }
  13060. }
  13061.  
  13062. public void drawPrayer() {
  13063. int prayer;
  13064. int currentPrayer = currentStats[5];
  13065. int maxPrayer = maxStats[5];
  13066. prayer = (int)(((double)currentPrayer / (double)maxPrayer) * 100D);
  13067. int prayPercent = currentPrayer * 34 / maxPrayer;
  13068. Sprite orbDrawn = emptyOrb;
  13069. orbDrawn.drawSprite(184, 49);
  13070. orbDrawn = new Sprite("emptyorb", 57, 34 - prayPercent);
  13071. prayerFill.drawSprite(187, 52);
  13072. orbDrawn.drawSprite(184, 49);
  13073. int colour;
  13074. if(prayer >= 75)
  13075. colour = 65280;
  13076. else if(prayer >= 50)
  13077. colour = 0xffff00;
  13078. else if(prayer >= 25)
  13079. colour = 0xfca607;
  13080. else
  13081. colour = 0xf50d0d;
  13082. if(prayer <= 25) {
  13083. if(loopCycle % 20 < 10) {
  13084. prayerIcon.drawSprite(191, 56);
  13085. }
  13086. } else {
  13087. prayerIcon.drawSprite(191, 56);
  13088. }
  13089. smallText.method382(colour, 227, String.valueOf(currentPrayer), 75+2, true);
  13090. if(prayer <= 0) {
  13091. prayerIcon.drawSprite(191, 56);
  13092. }
  13093. }
  13094.  
  13095.  
  13096.  
  13097. public void clearTopInterfaces() {
  13098. stream.createFrame(130);
  13099. if (invOverlayInterfaceID != -1) {
  13100. invOverlayInterfaceID = -1;
  13101. needDrawTabArea = true;
  13102. aBoolean1149 = false;
  13103. tabAreaAltered = true;
  13104. }
  13105. if (backDialogID != -1) {
  13106. backDialogID = -1;
  13107. inputTaken = true;
  13108. aBoolean1149 = false;
  13109. }
  13110. openInterfaceID = -1;
  13111. fullscreenInterfaceID = -1;
  13112. }
  13113.  
  13114. public client() {
  13115. fullscreenInterfaceID = -1;
  13116. chatRights = new int[500];
  13117. chatTypeView = 0;
  13118. clanChatMode = 0;
  13119. cButtonHPos = -1;
  13120. cButtonHCPos = -1;
  13121. cButtonCPos = 0;
  13122. if (debugServerIP) {
  13123. server = "0.0.0.0";
  13124. }
  13125. anIntArrayArray825 = new int[104][104];
  13126. friendsNodeIDs = new int[200];
  13127. groundArray = new NodeList[4][104][104];
  13128. aBoolean831 = false;
  13129. aStream_834 = new Stream(new byte[5000]);
  13130. npcArray = new NPC[16384];
  13131. npcIndices = new int[16384];
  13132. anIntArray840 = new int[1000];
  13133. aStream_847 = Stream.create();
  13134. aBoolean848 = true;
  13135. openInterfaceID = -1;
  13136. currentExp = new int[Skills.skillsCount];
  13137. aBoolean872 = false;
  13138. anIntArray873 = new int[5];
  13139. anInt874 = -1;
  13140. aBooleanArray876 = new boolean[5];
  13141. drawFlames = false;
  13142. reportAbuseInput = "";
  13143. unknownInt10 = -1;
  13144. menuOpen = false;
  13145. inputString = "";
  13146. maxPlayers = 2048;
  13147. myPlayerIndex = 2047;
  13148. playerArray = new Player[maxPlayers];
  13149. playerIndices = new int[maxPlayers];
  13150. anIntArray894 = new int[maxPlayers];
  13151. aStreamArray895s = new Stream[maxPlayers];
  13152. anInt897 = 1;
  13153. anIntArrayArray901 = new int[104][104];
  13154. anInt902 = 0x766654;
  13155. aByteArray912 = new byte[16384];
  13156. currentStats = new int[Skills.skillsCount];
  13157. ignoreListAsLongs = new long[100];
  13158. loadingError = false;
  13159. consoleInput = "";
  13160. consoleOpen = false;
  13161. consoleMessages = new String[17];
  13162. anInt927 = 0x332d25;
  13163. anIntArray928 = new int[5];
  13164. anIntArrayArray929 = new int[104][104];
  13165. chatTypes = new int[500];
  13166. chatNames = new String[500];
  13167. chatMessages = new String[500];
  13168. chatButtons = new Sprite[4];
  13169. sideIcons = new Sprite[15];
  13170. redStones = new Sprite[5];
  13171. aBoolean954 = true;
  13172. friendsListAsLongs = new long[200];
  13173. currentSong = -1;
  13174. drawingFlames = false;
  13175. spriteDrawX = -1;
  13176. spriteDrawY = -1;
  13177. anIntArray968 = new int[33];
  13178. anIntArray969 = new int[256];
  13179. decompressors = new Decompressor[5];
  13180. variousSettings = new int[2000];
  13181. aBoolean972 = false;
  13182. anInt975 = 50;
  13183. anIntArray976 = new int[anInt975];
  13184. anIntArray977 = new int[anInt975];
  13185. anIntArray978 = new int[anInt975];
  13186. anIntArray979 = new int[anInt975];
  13187. anIntArray980 = new int[anInt975];
  13188. anIntArray981 = new int[anInt975];
  13189. anIntArray982 = new int[anInt975];
  13190. aStringArray983 = new String[anInt975];
  13191. anInt985 = -1;
  13192. hitMarks = new Sprite[20];
  13193. anIntArray990 = new int[5];
  13194. aBoolean994 = false;
  13195. anInt1002 = 0x23201b;
  13196. amountOrNameInput = "";
  13197. aClass19_1013 = new NodeList();
  13198. aBoolean1017 = false;
  13199. anInt1018 = -1;
  13200. anIntArray1030 = new int[5];
  13201. aBoolean1031 = false;
  13202. mapFunctions = new Sprite[100];
  13203. dialogID = -1;
  13204. maxStats = new int[Skills.skillsCount];
  13205. anIntArray1045 = new int[2000];
  13206. aBoolean1047 = true;
  13207. anIntArray1052 = new int[152];
  13208. anInt1054 = -1;
  13209. aClass19_1056 = new NodeList();
  13210. anIntArray1057 = new int[33];
  13211. aClass9_1059 = new RSInterface();
  13212. mapScenes = new Background[100];
  13213. barFillColor = 0x4d4233;
  13214. anIntArray1065 = new int[7];
  13215. anIntArray1072 = new int[1000];
  13216. anIntArray1073 = new int[1000];
  13217. aBoolean1080 = false;
  13218. friendsList = new String[200];
  13219. inStream = Stream.create();
  13220. expectedCRCs = new int[9];
  13221. menuActionCmd2 = new int[500];
  13222. menuActionCmd3 = new int[500];
  13223. menuActionID = new int[500];
  13224. menuActionCmd1 = new int[500];
  13225. headIcons = new Sprite[20];
  13226. skullIcons = new Sprite[20];
  13227. headIconsHint = new Sprite[20];
  13228. tabAreaAltered = false;
  13229. aString1121 = "";
  13230. atPlayerActions = new String[5];
  13231. atPlayerArray = new boolean[5];
  13232. anIntArrayArrayArray1129 = new int[4][13][13];
  13233. anInt1132 = 2;
  13234. aClass30_Sub2_Sub1_Sub1Array1140 = new Sprite[1000];
  13235. aBoolean1141 = false;
  13236. aBoolean1149 = false;
  13237. crosses = new Sprite[8];
  13238. musicEnabled = true;
  13239. needDrawTabArea = false;
  13240. loggedIn = false;
  13241. canMute = false;
  13242. aBoolean1159 = false;
  13243. aBoolean1160 = false;
  13244. anInt1171 = 1;
  13245. myUsername = "";
  13246. myPassword = "";
  13247. genericLoadingError = false;
  13248. reportAbuseInterfaceID = -1;
  13249. aClass19_1179 = new NodeList();
  13250. anInt1184 = 128;
  13251. invOverlayInterfaceID = -1;
  13252. stream = Stream.create();
  13253. menuActionName = new String[500];
  13254. anIntArray1203 = new int[5];
  13255. anIntArray1207 = new int[50];
  13256. anInt1210 = 2;
  13257. anInt1211 = 78;
  13258. promptInput = "";
  13259. modIcons = new Background[3];
  13260. tabID = 3;
  13261. inputTaken = false;
  13262. songChanging = true;
  13263. anIntArray1229 = new int[152];
  13264. aClass11Array1230 = new Class11[4];
  13265. aBoolean1233 = false;
  13266. anIntArray1240 = new int[100];
  13267. anIntArray1241 = new int[50];
  13268. aBoolean1242 = false;
  13269. anIntArray1250 = new int[50];
  13270. soundVolume = new int[50];
  13271. rsAlreadyLoaded = false;
  13272. welcomeScreenRaised = false;
  13273. messagePromptRaised = false;
  13274. loginMessage1 = "";
  13275. loginMessage2 = "";
  13276. backDialogID = -1;
  13277. anInt1279 = 2;
  13278. bigX = new int[4000];
  13279. bigY = new int[4000];
  13280. anInt1289 = -1;
  13281. }
  13282.  
  13283. public int rights;
  13284. public String name;
  13285. public String message;
  13286. public String clanname;
  13287. private final int[] chatRights;
  13288. public int chatTypeView;
  13289. public int clanChatMode;
  13290. public int duelMode;
  13291. /* Declare custom sprites */
  13292. private Sprite chatArea;
  13293. private Sprite musicLoginButton;
  13294. private Sprite[] chatButtons;
  13295. private Sprite titleButton;
  13296. private Sprite titleBox;
  13297. private Sprite tabArea;
  13298. private Sprite mapArea;
  13299. private Sprite emptyOrb;
  13300. private Sprite hoverOrb;
  13301. private Sprite hoverorbrun;
  13302. private Sprite hoverorbrun2;
  13303. private Sprite runClick;
  13304. private Sprite runorb;
  13305. private Sprite hitPointsFill;
  13306. private Sprite prayerFill;
  13307. private Sprite hitPointsIcon;
  13308. private Sprite prayerIcon;
  13309. private Sprite worldMapIcon;
  13310. private Sprite worldMapIconH;
  13311. public boolean runClicked = true;
  13312. /**/
  13313. private RSImageProducer leftFrame;
  13314. private RSImageProducer topFrame;
  13315. private RSImageProducer rightFrame;
  13316. private int ignoreCount;
  13317. private long aLong824;
  13318. private int[][] anIntArrayArray825;
  13319. private int[] friendsNodeIDs;
  13320. private NodeList[][][] groundArray;
  13321. private int[] anIntArray828;
  13322. private int[] anIntArray829;
  13323. private volatile boolean aBoolean831;
  13324. private Socket aSocket832;
  13325. private int loginScreenState;
  13326. private Stream aStream_834;
  13327. private NPC[] npcArray;
  13328. private int npcCount;
  13329. private int[] npcIndices;
  13330. private int anInt839;
  13331. private int[] anIntArray840;
  13332. private int anInt841;
  13333. private int anInt842;
  13334. private int anInt843;
  13335. private String aString844;
  13336. private int privateChatMode;
  13337. private Stream aStream_847;
  13338. private boolean aBoolean848;
  13339. private static int anInt849;
  13340. private int[] anIntArray850;
  13341. private int[] anIntArray851;
  13342. private int[] anIntArray852;
  13343. private int[] anIntArray853;
  13344. private static int anInt854;
  13345. private int anInt855;
  13346. private int openInterfaceID;
  13347. private int xCameraPos;
  13348. private int zCameraPos;
  13349. private int yCameraPos;
  13350. private int yCameraCurve;
  13351. private int xCameraCurve;
  13352. private int myPrivilege;
  13353. private final int[] currentExp;
  13354. private Sprite[] redStones;
  13355. private Sprite mapFlag;
  13356. private Sprite mapMarker;
  13357. private boolean aBoolean872;
  13358. private final int[] anIntArray873;
  13359. private int anInt874;
  13360. private final boolean[] aBooleanArray876;
  13361. private int weight;
  13362. private MouseDetection mouseDetection;
  13363. private volatile boolean drawFlames;
  13364. private String reportAbuseInput;
  13365. private int unknownInt10;
  13366. private boolean menuOpen;
  13367. private int anInt886;
  13368. private String inputString;
  13369. private final int maxPlayers;
  13370. private final int myPlayerIndex;
  13371. private Player[] playerArray;
  13372. private int playerCount;
  13373. private int[] playerIndices;
  13374. private int anInt893;
  13375. private int[] anIntArray894;
  13376. private Stream[] aStreamArray895s;
  13377. private int anInt896;
  13378. private int anInt897;
  13379. private int friendsCount;
  13380. private int anInt900;
  13381. private int[][] anIntArrayArray901;
  13382. private final int anInt902;
  13383. private byte[] aByteArray912;
  13384. private int anInt913;
  13385. private int crossX;
  13386. private int crossY;
  13387. private int crossIndex;
  13388. private int crossType;
  13389. private int plane;
  13390. private final int[] currentStats;
  13391. private static int anInt924;
  13392. private final long[] ignoreListAsLongs;
  13393. private boolean loadingError;
  13394. private final int anInt927;
  13395. private final int[] anIntArray928;
  13396. private int[][] anIntArrayArray929;
  13397. private Sprite aClass30_Sub2_Sub1_Sub1_931;
  13398. private Sprite aClass30_Sub2_Sub1_Sub1_932;
  13399. private int anInt933;
  13400. private int anInt934;
  13401. private int anInt935;
  13402. private int anInt936;
  13403. private int anInt937;
  13404. private int anInt938;
  13405. private static int anInt940;
  13406. private final int[] chatTypes;
  13407. private final String[] chatNames;
  13408. private final String[] chatMessages;
  13409. private int anInt945;
  13410. private WorldController worldController;
  13411. private Sprite[] sideIcons;
  13412. private int menuScreenArea;
  13413. private int menuOffsetX;
  13414. private int menuOffsetY;
  13415. private int menuWidth;
  13416. private int menuHeight;
  13417. private long aLong953;
  13418. private boolean aBoolean954;
  13419. private long[] friendsListAsLongs;
  13420. private String[] clanList = new String[100];
  13421. private int currentSong;
  13422. private static int nodeID = 10;
  13423. static int portOff;
  13424. static boolean clientData;
  13425. private static boolean isMembers = true;
  13426. private static boolean lowMem;
  13427. private volatile boolean drawingFlames;
  13428. private int spriteDrawX;
  13429. private int spriteDrawY;
  13430. private final int[] anIntArray965 = {
  13431. 0xffff00, 0xff0000, 65280, 65535, 0xff00ff, 0xffffff
  13432. };
  13433. private Background aBackground_966;
  13434. private Background aBackground_967;
  13435. private final int[] anIntArray968;
  13436. private final int[] anIntArray969;
  13437. final Decompressor[] decompressors;
  13438. public int variousSettings[];
  13439. private boolean aBoolean972;
  13440. private final int anInt975;
  13441. private final int[] anIntArray976;
  13442. private final int[] anIntArray977;
  13443. private final int[] anIntArray978;
  13444. private final int[] anIntArray979;
  13445. private final int[] anIntArray980;
  13446. private final int[] anIntArray981;
  13447. private final int[] anIntArray982;
  13448. private final String[] aStringArray983;
  13449. private int anInt984;
  13450. private int anInt985;
  13451. private static int anInt986;
  13452. private Sprite[] hitMarks;
  13453. private int anInt988;
  13454. private int anInt989;
  13455. private final int[] anIntArray990;
  13456. private static boolean aBoolean993;
  13457. private final boolean aBoolean994;
  13458. private int anInt995;
  13459. private int anInt996;
  13460. private int anInt997;
  13461. private int anInt998;
  13462. private int anInt999;
  13463. private ISAACRandomGen encryption;
  13464. private Sprite mapEdge;
  13465. private Sprite multiOverlay;
  13466. private final int anInt1002;
  13467. static final int[][] anIntArrayArray1003 = {
  13468. {
  13469. 6798, 107, 10283, 16, 4797, 7744, 5799, 4634, 33697, 22433,
  13470. 2983, 54193
  13471. }, {
  13472. 8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153,
  13473. 56621, 4783, 1341, 16578, 35003, 25239
  13474. }, {
  13475. 25238, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094,
  13476. 10153, 56621, 4783, 1341, 16578, 35003
  13477. }, {
  13478. 4626, 11146, 6439, 12, 4758, 10270
  13479. }, {
  13480. 4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574
  13481. }
  13482. };
  13483. private String amountOrNameInput;
  13484. private static int anInt1005;
  13485. private int daysSinceLastLogin;
  13486. private int pktSize;
  13487. private int pktType;
  13488. private int anInt1009;
  13489. private int anInt1010;
  13490. private int anInt1011;
  13491. private NodeList aClass19_1013;
  13492. private int anInt1014;
  13493. private int anInt1015;
  13494. private int anInt1016;
  13495. private boolean aBoolean1017;
  13496. private int anInt1018;
  13497. private static final int[] anIntArray1019;
  13498. private int anInt1021;
  13499. private int anInt1022;
  13500. private int loadingStage;
  13501. private Sprite scrollBar1;
  13502. private Sprite scrollBar2;
  13503. private int anInt1026;
  13504. private Background backBase1;
  13505. private Background backBase2;
  13506. private Background backHmid1;
  13507. private final int[] anIntArray1030;
  13508. private boolean aBoolean1031;
  13509. private Sprite[] mapFunctions;
  13510. private int baseX;
  13511. private int baseY;
  13512. private int anInt1036;
  13513. private int anInt1037;
  13514. private int loginFailures;
  13515. private int anInt1039;
  13516. private int anInt1040;
  13517. private int anInt1041;
  13518. private int dialogID;
  13519. private final int[] maxStats;
  13520. private final int[] anIntArray1045;
  13521. private int anInt1046;
  13522. private boolean aBoolean1047;
  13523. private int anInt1048;
  13524. private String aString1049;
  13525. private static int anInt1051;
  13526. private final int[] anIntArray1052;
  13527. private StreamLoader titleStreamLoader;
  13528. private int anInt1054;
  13529. private int anInt1055;
  13530. private NodeList aClass19_1056;
  13531. private final int[] anIntArray1057;
  13532. public final RSInterface aClass9_1059;
  13533. private Background[] mapScenes;
  13534. private static int anInt1061;
  13535. private int anInt1062;
  13536. private final int barFillColor;
  13537. private int friendsListAction;
  13538. private final int[] anIntArray1065;
  13539. private int mouseInvInterfaceIndex;
  13540. private int lastActiveInvInterface;
  13541. public OnDemandFetcher onDemandFetcher;
  13542. private int anInt1069;
  13543. private int anInt1070;
  13544. private int anInt1071;
  13545. private int[] anIntArray1072;
  13546. private int[] anIntArray1073;
  13547. private Sprite mapDotItem;
  13548. private Sprite mapDotNPC;
  13549. private Sprite mapDotPlayer;
  13550. private Sprite mapDotFriend;
  13551. private Sprite mapDotTeam;
  13552. private Sprite mapDotClan;
  13553. private int anInt1079;
  13554. private boolean aBoolean1080;
  13555. private String[] friendsList;
  13556. private Stream inStream;
  13557. private int anInt1084;
  13558. private int anInt1085;
  13559. private int activeInterfaceType;
  13560. private int anInt1087;
  13561. private int anInt1088;
  13562. public static int anInt1089;
  13563. private final int[] expectedCRCs;
  13564. private int[] menuActionCmd2;
  13565. private int[] menuActionCmd3;
  13566. private int[] menuActionID;
  13567. private int[] menuActionCmd1;
  13568. private Sprite[] headIcons;
  13569. private Sprite[] skullIcons;
  13570. private Sprite[] headIconsHint;
  13571. private static int anInt1097;
  13572. private int anInt1098;
  13573. private int anInt1099;
  13574. private int anInt1100;
  13575. private int anInt1101;
  13576. private int anInt1102;
  13577. private static boolean tabAreaAltered;
  13578. private int anInt1104;
  13579. private RSImageProducer aRSImageProducer_1107;
  13580. private RSImageProducer aRSImageProducer_1108;
  13581. private RSImageProducer aRSImageProducer_1109;
  13582. private RSImageProducer aRSImageProducer_1110;
  13583. private RSImageProducer aRSImageProducer_1111;
  13584. private RSImageProducer aRSImageProducer_1112;
  13585. private RSImageProducer aRSImageProducer_1113;
  13586. private RSImageProducer aRSImageProducer_1114;
  13587. private RSImageProducer aRSImageProducer_1115;
  13588. private static int anInt1117;
  13589. private int membersInt;
  13590. private String aString1121;
  13591. private Sprite compass;
  13592. private RSImageProducer aRSImageProducer_1123;
  13593. private RSImageProducer aRSImageProducer_1124;
  13594. private RSImageProducer aRSImageProducer_1125;
  13595. public static Player myPlayer;
  13596. private final String[] atPlayerActions;
  13597. private final boolean[] atPlayerArray;
  13598. private final int[][][] anIntArrayArrayArray1129;
  13599. private final int[] tabInterfaceIDs = {
  13600. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  13601. -1, -1, -1, -1, -1
  13602. };
  13603. private int anInt1131;
  13604. private int anInt1132;
  13605. private int menuActionRow;
  13606. private static int anInt1134;
  13607. private int spellSelected;
  13608. private int anInt1137;
  13609. private int spellUsableOn;
  13610. private String spellTooltip;
  13611. private Sprite[] aClass30_Sub2_Sub1_Sub1Array1140;
  13612. private boolean aBoolean1141;
  13613. private static int anInt1142;
  13614. private int energy;
  13615. private boolean aBoolean1149;
  13616. private Sprite[] crosses;
  13617. private boolean musicEnabled;
  13618. private Background[] aBackgroundArray1152s;
  13619. private static boolean needDrawTabArea;
  13620. private int unreadMessages;
  13621. private static int anInt1155;
  13622. private static boolean fpsOn;
  13623. public boolean loggedIn;
  13624. private boolean canMute;
  13625. private boolean aBoolean1159;
  13626. private boolean aBoolean1160;
  13627. static int loopCycle;
  13628. private static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  13629. private RSImageProducer aRSImageProducer_1163;
  13630. private RSImageProducer mapEdgeIP;
  13631. private RSImageProducer aRSImageProducer_1164;
  13632. private RSImageProducer aRSImageProducer_1165;
  13633. private RSImageProducer aRSImageProducer_1166;
  13634. private int daysSinceRecovChange;
  13635. private RSSocket socketStream;
  13636. private int anInt1169;
  13637. private int minimapInt3;
  13638. private int anInt1171;
  13639. private long aLong1172;
  13640. private String myUsername;
  13641. private String myPassword;
  13642. private static int anInt1175;
  13643. private boolean genericLoadingError;
  13644. private final int[] anIntArray1177 = {
  13645. 0, 0, 0, 0, 1, 1, 1, 1, 1, 2,
  13646. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  13647. 2, 2, 3
  13648. };
  13649. private int reportAbuseInterfaceID;
  13650. private NodeList aClass19_1179;
  13651. private int[] anIntArray1180;
  13652. private int[] anIntArray1181;
  13653. private int[] anIntArray1182;
  13654. private byte[][] aByteArrayArray1183;
  13655. private int anInt1184;
  13656. private int minimapInt1;
  13657. private int anInt1186;
  13658. private int anInt1187;
  13659. private static int anInt1188;
  13660. private int invOverlayInterfaceID;
  13661. private int[] anIntArray1190;
  13662. private int[] anIntArray1191;
  13663. private Stream stream;
  13664. private int anInt1193;
  13665. private int splitPrivateChat;
  13666. private Background mapBack;
  13667. private String[] menuActionName;
  13668. private Sprite aClass30_Sub2_Sub1_Sub1_1201;
  13669. private Sprite aClass30_Sub2_Sub1_Sub1_1202;
  13670. private final int[] anIntArray1203;
  13671. static final int[] anIntArray1204 = {
  13672. 9104, 10275, 7595, 3610, 7975, 8526, 918, 38802, 24466, 10145,
  13673. 58654, 5027, 1457, 16565, 34991, 25486
  13674. };
  13675. private static boolean flagged;
  13676. private final int[] anIntArray1207;
  13677. private int anInt1208;
  13678. private int minimapInt2;
  13679. private int anInt1210;
  13680. private int anInt1211;
  13681. private String promptInput;
  13682. private int anInt1213;
  13683. private int[][][] intGroundArray;
  13684. private long aLong1215;
  13685. private int loginScreenCursorPos;
  13686. private final Background[] modIcons;
  13687. private long aLong1220;
  13688. private static int tabID;
  13689. private int anInt1222;
  13690. public static boolean inputTaken;
  13691. private int inputDialogState;
  13692. private static int anInt1226;
  13693. private int nextSong;
  13694. private boolean songChanging;
  13695. private final int[] anIntArray1229;
  13696. private Class11[] aClass11Array1230;
  13697. public static int anIntArray1232[];
  13698. private boolean aBoolean1233;
  13699. private int[] anIntArray1234;
  13700. private int[] anIntArray1235;
  13701. private int[] anIntArray1236;
  13702. private int anInt1237;
  13703. private int anInt1238;
  13704. public final int anInt1239 = 100;
  13705. private final int[] anIntArray1240;
  13706. private final int[] anIntArray1241;
  13707. private boolean aBoolean1242;
  13708. private int atInventoryLoopCycle;
  13709. private int atInventoryInterface;
  13710. private int atInventoryIndex;
  13711. private int atInventoryInterfaceType;
  13712. private byte[][] aByteArrayArray1247;
  13713. private int tradeMode;
  13714. private int anInt1249;
  13715. private final int[] anIntArray1250;
  13716. private final int[] soundVolume;
  13717. private int anInt1251;
  13718. private final boolean rsAlreadyLoaded;
  13719. private int anInt1253;
  13720. private int anInt1254;
  13721. private boolean welcomeScreenRaised;
  13722. private boolean messagePromptRaised;
  13723. private int anInt1257;
  13724. private Sprite infinity;
  13725. private byte[][][] byteGroundArray;
  13726. private int prevSong;
  13727. private int destX;
  13728. private int destY;
  13729. private Sprite aClass30_Sub2_Sub1_Sub1_1263;
  13730. private int anInt1264;
  13731. private int anInt1265;
  13732. private String loginMessage1;
  13733. private String loginMessage2;
  13734. private int anInt1268;
  13735. private int anInt1269;
  13736. private TextDrawingArea smallText;
  13737. private TextDrawingArea regularText;
  13738. private TextDrawingArea boldText;
  13739. private int anInt1275;
  13740. private int backDialogID;
  13741. private int anInt1278;
  13742. private int anInt1279;
  13743. private int[] bigX;
  13744. private int[] bigY;
  13745. private int itemSelected;
  13746. private int anInt1283;
  13747. private int anInt1284;
  13748. private int anInt1285;
  13749. private String selectedItemName;
  13750. private int publicChatMode;
  13751. private static int anInt1288;
  13752. private int anInt1289;
  13753. public static int anInt1290;
  13754. public static String server = "Runescape.dxmvpn.com";
  13755. public int drawCount;
  13756. public int fullscreenInterfaceID;
  13757. public int anInt1044;//377
  13758. public int anInt1129;//377
  13759. public int anInt1315;//377
  13760. public int anInt1500;//377
  13761. public int anInt1501;//377
  13762. public int[] fullScreenTextureArray;
  13763. public void resetAllImageProducers() {
  13764. if (super.fullGameScreen != null) {
  13765. return;
  13766. }
  13767. aRSImageProducer_1166 = null;
  13768. aRSImageProducer_1164 = null;
  13769. aRSImageProducer_1163 = null;
  13770. aRSImageProducer_1165 = null;
  13771. aRSImageProducer_1123 = null;
  13772. aRSImageProducer_1124 = null;
  13773. aRSImageProducer_1125 = null;
  13774. aRSImageProducer_1107 = null;
  13775. aRSImageProducer_1108 = null;
  13776. aRSImageProducer_1109 = null;
  13777. aRSImageProducer_1110 = null;
  13778. aRSImageProducer_1111 = null;
  13779. aRSImageProducer_1112 = null;
  13780. aRSImageProducer_1113 = null;
  13781. aRSImageProducer_1114 = null;
  13782. aRSImageProducer_1115 = null;
  13783. super.fullGameScreen = new RSImageProducer(765, 503, getGameComponent());
  13784. welcomeScreenRaised = true;
  13785. }
  13786.  
  13787. public void launchURL(String url) {
  13788. String osName = System.getProperty("os.name");
  13789. try {
  13790. if (osName.startsWith("Mac OS")) {
  13791. Class fileMgr = Class.forName("com.apple.eio.FileManager");
  13792. Method openURL = fileMgr.getDeclaredMethod("openURL", new Class[] {String.class});
  13793. openURL.invoke(null, new Object[] {url});
  13794. } else if (osName.startsWith("Windows"))
  13795. Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
  13796. else { //assume Unix or Linux
  13797. String[] browsers = { "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape", "safari" };
  13798. String browser = null;
  13799. for (int count = 0; count < browsers.length && browser == null; count++)
  13800. if (Runtime.getRuntime().exec(new String[] {"which", browsers[count]}).waitFor() == 0)
  13801. browser = browsers[count];
  13802. if (browser == null) {
  13803. throw new Exception("Could not find web browser");
  13804. } else
  13805. Runtime.getRuntime().exec(new String[] {browser, url});
  13806. }
  13807. } catch (Exception e) {
  13808. pushMessage("Failed to open URL.", 0, "");
  13809. }
  13810. }
  13811.  
  13812. static {
  13813. anIntArray1019 = new int[99];
  13814. int i = 0;
  13815. for(int j = 0; j < 99; j++) {
  13816. int l = j + 1;
  13817. int i1 = (int)((double)l + 300D * Math.pow(2D, (double)l / 7D));
  13818. i += i1;
  13819. anIntArray1019[j] = i / 4;
  13820. }
  13821. anIntArray1232 = new int[32];
  13822. i = 2;
  13823. for(int k = 0; k < 32; k++) {
  13824. anIntArray1232[k] = i - 1;
  13825. i += i;
  13826. }
  13827. }
  13828. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement