Advertisement
Guest User

Untitled

a guest
Feb 1st, 2016
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 390.03 KB | None | 0 0
  1. package rs;
  2.  
  3. import rs.constants.SizeConstants;
  4. import rs.constants.Skills;
  5. import rs.animable.*;
  6. import rs.config.*;
  7. import rs.graphics.*;
  8. import rs.sign.signlink;
  9. import rs.stream.Stream;
  10. import rs.stream.StreamLoader;
  11. import rs.RSInterface;
  12. import rs.cache.Decompressor;
  13. import rs.cache.OnDemandFetcher;
  14. import rs.cache.OnDemandData;
  15. import rs.net.RSSocket;
  16. import rs.net.ISAACRandomGen;
  17.  
  18. import java.applet.AppletContext;
  19. import java.awt.*;
  20. import java.io.*;
  21. import java.net.InetAddress;
  22. import java.net.Socket;
  23. import java.net.URL;
  24. import java.text.DecimalFormat;
  25. import java.text.DecimalFormatSymbols;
  26. import java.text.NumberFormat;
  27.  
  28. @SuppressWarnings("serial")
  29. public class Client extends RSApplet {
  30.  
  31. public enum ScreenMode {
  32. FIXED,
  33. RESIZABLE,
  34. FULLSCREEN;
  35. }
  36.  
  37. public static WindowFlasher windowFlasher;
  38. private FogHandler fogHandler = new FogHandler();
  39. public static boolean hideGameFrame = false;
  40. public static ScreenMode frameMode = ScreenMode.FIXED;
  41. public static int frameWidth = 765;
  42. public static int frameHeight = 503;
  43. public static int screenAreaWidth = 512;
  44. public static int screenAreaHeight = 334;
  45. public static boolean fixedScreen = true;
  46. public static boolean showChatComponents = true;
  47. public static boolean showTabComponents = true;
  48. public static boolean changeTabArea = frameMode == ScreenMode.FIXED ? false : true;
  49. public static boolean changeChatArea = frameMode == ScreenMode.FIXED ? false : true;
  50. public static boolean transparentTabArea = false;
  51.  
  52. public static void frameMode(ScreenMode screenMode) {
  53. if (frameMode != screenMode) {
  54. frameMode = screenMode;
  55. if (screenMode == ScreenMode.FIXED) {
  56. frameWidth = 765;
  57. frameHeight = 503;
  58. cameraZoom = 600;
  59. WorldController.viewDistance = 9;
  60. changeChatArea = false;
  61. changeTabArea = false;
  62. } else if (screenMode == ScreenMode.RESIZABLE) {
  63. frameWidth = 766;
  64. frameHeight = 529;
  65. cameraZoom = 850;
  66. WorldController.viewDistance = 10;
  67. } else if (screenMode == ScreenMode.FULLSCREEN) {
  68. cameraZoom = 600;
  69. WorldController.viewDistance = 10;
  70. frameWidth = (int) Toolkit.getDefaultToolkit().getScreenSize().getWidth();
  71. frameHeight = (int) Toolkit.getDefaultToolkit().getScreenSize().getHeight();
  72. }
  73. rebuildFrameSize(screenMode, frameWidth, frameHeight);
  74. setBounds();
  75. System.out.println("ScreenMode: " + screenMode.toString());
  76. }
  77. showChatComponents = screenMode == ScreenMode.FIXED ? true : showChatComponents;
  78. showTabComponents = screenMode == ScreenMode.FIXED ? true : showTabComponents;
  79. }
  80.  
  81. public static void rebuildFrameSize(ScreenMode screenMode, int screenWidth, int screenHeight) {
  82. try {
  83. screenAreaWidth = (screenMode == ScreenMode.FIXED) ? 512 : screenWidth;
  84. screenAreaHeight = (screenMode == ScreenMode.FIXED) ? 334 : screenHeight;
  85. frameWidth = screenWidth;
  86. frameHeight = screenHeight;
  87. instance.refreshFrameSize(screenMode == ScreenMode.FULLSCREEN, screenWidth, screenHeight, screenMode == ScreenMode.RESIZABLE, screenMode != ScreenMode.FIXED);
  88. setBounds();
  89. } catch (Exception e) {
  90. e.printStackTrace();
  91. }
  92. }
  93.  
  94. public void refreshFrameSize() {
  95. if (frameMode == ScreenMode.RESIZABLE) {
  96. if (frameWidth != (appletClient() ? getGameComponent().getWidth() : gameFrame.getFrameWidth())) {
  97. frameWidth = (appletClient() ? getGameComponent().getWidth() : gameFrame.getFrameWidth());
  98. screenAreaWidth = frameWidth;
  99. setBounds();
  100. }
  101. if (frameHeight != (appletClient() ? getGameComponent().getHeight() : gameFrame.getFrameHeight())) {
  102. frameHeight = (appletClient() ? getGameComponent().getHeight() : gameFrame.getFrameHeight());
  103. screenAreaHeight = frameHeight;
  104. setBounds();
  105. }
  106. }
  107. }
  108.  
  109. private static void setBounds() {
  110. Texture.method365(frameWidth, frameHeight);
  111. fullScreenTextureArray = Texture.anIntArray1472;
  112. Texture.method365(frameMode == ScreenMode.FIXED ? (aRSImageProducer_1166 != null ? aRSImageProducer_1166.canvasWidth : 519) : frameWidth, frameMode == ScreenMode.FIXED ? (aRSImageProducer_1166 != null ? aRSImageProducer_1166.canvasHeight : 165) : frameHeight);
  113. anIntArray1180 = Texture.anIntArray1472;
  114. Texture.method365(frameMode == ScreenMode.FIXED ? (aRSImageProducer_1163 != null ? aRSImageProducer_1163.canvasWidth : 249) : frameWidth, frameMode == ScreenMode.FIXED ? (aRSImageProducer_1163 != null ? aRSImageProducer_1163.canvasHeight : 335) : frameHeight);
  115. anIntArray1181 = Texture.anIntArray1472;
  116. Texture.method365(screenAreaWidth, screenAreaHeight);
  117. anIntArray1182 = Texture.anIntArray1472;
  118. int ai[] = new int[9];
  119. for(int i8 = 0; i8 < 9; i8++) {
  120. int k8 = 128 + i8 * 32 + 15;
  121. int l8 = 600 + k8 * 3;
  122. int i9 = Texture.anIntArray1470[k8];
  123. ai[i8] = l8 * i9 >> 16;
  124. }
  125. if (frameMode == ScreenMode.RESIZABLE && (frameWidth >= 766) && (frameWidth <= 1025) && (frameHeight >= 504) && (frameHeight <= 850)) {
  126. WorldController.viewDistance = 9;
  127. cameraZoom = 575;
  128. } else if (frameMode == ScreenMode.FIXED) {
  129. cameraZoom = 600;
  130. } else if (frameMode == ScreenMode.RESIZABLE || frameMode == ScreenMode.FULLSCREEN) {
  131. WorldController.viewDistance = 10;
  132. cameraZoom = 600;
  133. }
  134. WorldController.method310(500, 800, screenAreaWidth, screenAreaHeight, ai);
  135. if (loggedIn) {
  136. aRSImageProducer_1165 = new ImageProducer(screenAreaWidth, screenAreaHeight);
  137. }
  138. }
  139.  
  140. public boolean getMousePositions() {
  141. if (mouseInRegion(frameWidth - (frameWidth <= 1000 ? 240 : 420), frameHeight - (frameWidth <= 1000 ? 90 : 37), frameWidth, frameHeight)) {
  142. return false;
  143. }
  144. if (showChatComponents) {
  145. if (changeChatArea) {
  146. if (super.mouseX > 0 && super.mouseX < 494 && super.mouseY > frameHeight - 175 && super.mouseY < frameHeight) {
  147. return true;
  148. } else {
  149. if (super.mouseX > 494 && super.mouseX < 515 && super.mouseY > frameHeight - 175 && super.mouseY < frameHeight) {
  150. return false;
  151. }
  152. }
  153. } else if (!changeChatArea) {
  154. if (super.mouseX > 0 && super.mouseX < 519 && super.mouseY > frameHeight - 175 && super.mouseY < frameHeight) {
  155. return false;
  156. }
  157. }
  158. }
  159. if (mouseInRegion(frameWidth - 216, 0, frameWidth, 172)) {
  160. return false;
  161. }
  162. if (!changeTabArea) {
  163. if (super.mouseX > 0 && super.mouseY > 0 && super.mouseY < frameWidth && super.mouseY < frameHeight) {
  164. if (super.mouseX >= frameWidth - 242 && super.mouseY >= frameHeight - 335) {
  165. return false;
  166. }
  167. return true;
  168. }
  169. return false;
  170. }
  171. if (showTabComponents) {
  172. if (frameWidth > 1000) {
  173. if (super.mouseX >= frameWidth - 420 && super.mouseX <= frameWidth && super.mouseY >= frameHeight - 37 && super.mouseY <= frameHeight || super.mouseX > frameWidth - 225 && super.mouseX < frameWidth && super.mouseY > frameHeight - 37 - 274 && super.mouseY < frameHeight) {
  174. return false;
  175. }
  176. } else {
  177. if (super.mouseX >= frameWidth - 210 && super.mouseX <= frameWidth && super.mouseY >= frameHeight - 74 && super.mouseY <= frameHeight || super.mouseX > frameWidth - 225 && super.mouseX < frameWidth && super.mouseY > frameHeight - 74 - 274 && super.mouseY < frameHeight) {
  178. return false;
  179. }
  180. }
  181. }
  182. return true;
  183. }
  184.  
  185. public boolean mouseInRegion(int x1, int y1, int x2, int y2) {
  186. if (super.mouseX >= x1 && super.mouseX <= x2 && super.mouseY >= y1 && super.mouseY <= y2) {
  187. return true;
  188. }
  189. return false;
  190. }
  191.  
  192. private static String intToKOrMilLongName(int i) {
  193. String s = String.valueOf(i);
  194. for (int k = s.length() - 3; k > 0; k -= 3)
  195. s = s.substring(0, k) + "," + s.substring(k);
  196. if (s.length() > 8)
  197. s = "@gre@" + s.substring(0, s.length() - 8) + " million @whi@(" + s + ")";
  198. else if (s.length() > 4)
  199. s = "@cya@" + s.substring(0, s.length() - 4) + "K @whi@(" + s + ")";
  200. return " " + s;
  201. }
  202.  
  203. public void stopMidi() {
  204. signlink.music.stop();
  205. signlink.fadeMidi = 0;
  206. signlink.midi = "stop";
  207. }
  208.  
  209. public void playSong(int id) {
  210. if (currentSong != id) {
  211. nextSong = id;
  212. songChanging = true;
  213. onDemandFetcher.method558(2, nextSong);
  214. currentSong = id;
  215. }
  216. }
  217.  
  218. public static void setTab(int id) {
  219. needDrawTabArea = true;
  220. tabID = id;
  221. tabAreaAltered = true;
  222. }
  223.  
  224. void mouseWheelDragged(int i, int j) {
  225. if (!mouseWheelDown)
  226. return;
  227. this.anInt1186 += i * 3;
  228. this.anInt1187 += (j << 1);
  229. }
  230.  
  231.  
  232.  
  233. private void connectServer() {
  234.  
  235. }
  236.  
  237. private boolean menuHasAddFriend(int j) {
  238. if (j < 0)
  239. return false;
  240. int k = menuActionID[j];
  241. if (k >= 2000)
  242. k -= 2000;
  243. return k == 337;
  244. }
  245.  
  246.  
  247. private void drawChatArea() {
  248. if (frameMode == ScreenMode.FIXED) {
  249. aRSImageProducer_1166.initDrawingArea();
  250. }
  251. int yOffset = frameMode == ScreenMode.FIXED ? 0 : frameHeight - 165;
  252. Texture.anIntArray1472 = anIntArray1180;
  253. if (frameMode == ScreenMode.FIXED) {
  254. cacheSprite[2].drawSprite(0, yOffset);
  255. } else {
  256. cacheSprite[30].drawAdvancedSprite(0, yOffset);
  257. }
  258.  
  259. drawChannelButtons();
  260. if (messagePromptRaised) {
  261. boldFontNE.drawCenteredString(aString1121, 259, 60 + yOffset, 0, -1);
  262. boldFontNE.drawCenteredString( promptInput + "*", 259, 80 + yOffset, 128, -1);
  263. } else if (inputDialogState == 1) {
  264. boldFontNE.drawCenteredString("Enter amount:", 259, 60 + yOffset, 0, -1);
  265. boldFontNE.drawCenteredString(amountOrNameInput + "*", 259, 80 + yOffset, 128, -1);
  266. } else if (inputDialogState == 2) {
  267. boldFontNE.drawCenteredString("Enter name:", 259, 60 + yOffset, 0, -1);
  268. boldFontNE.drawCenteredString(amountOrNameInput + "*", 259, 80 + yOffset, 128, -1);
  269. } else if (aString844 != null) {
  270. boldFontNE.drawCenteredString(aString844, 259, 60 + yOffset, 0, -1);
  271. boldFontNE.drawCenteredString("Click to continue", 259, 80 + yOffset, 128, -1);
  272. } else if (backDialogID != -1)
  273. drawInterface(0, 20, RSInterface.interfaceCache[backDialogID], 20 + yOffset);
  274. else if (dialogID != -1) {
  275. drawInterface(0, 20, RSInterface.interfaceCache[dialogID], 20 + yOffset);
  276. } else {
  277. TextDrawingArea textDrawingArea = regularText;
  278. int j = 0;
  279. DrawingArea.setDrawingArea(94 + yOffset, 0, 463, 19 + yOffset);
  280. for (int k = 0; k < 100; k++)
  281. if (chatMessages[k] != null) {
  282. int l = chatTypes[k];
  283. int yPos = (90 - j * 15) + anInt1089;
  284. String s1 = chatNames[k];
  285. byte byte0 = 0;
  286. if (s1 != null && s1.startsWith("@cr1@")) {
  287. s1 = s1.substring(5);
  288. byte0 = 1;
  289. }
  290. if (s1 != null && s1.startsWith("@cr2@")) {
  291. s1 = s1.substring(5);
  292. byte0 = 2;
  293. }
  294. if (l == 0) {
  295. if (yPos > 0 && yPos < 110)
  296. regularFontNE.drawString(chatMessages[k], 19, yPos + yOffset, 0, -1);
  297. j++;
  298. }
  299. if ((l == 1 || l == 2) && (l == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
  300. if (yPos > 0 && yPos < 110) {
  301. int xPos = 19;
  302. if (byte0 == 1) {
  303. modIcons[0].drawSprite(xPos, yPos - 12 + yOffset);
  304. xPos += 14;
  305. }
  306. if (byte0 == 2) {
  307. modIcons[1].drawSprite(xPos, yPos - 12 + yOffset);
  308. xPos += 14;
  309. }
  310. regularFontNE.drawString(s1 + ":", xPos, yPos + yOffset, 0, -1);
  311. xPos += regularFontNE.getDisplayedWidth(s1) + 8;
  312. regularFontNE.drawString(chatMessages[k], xPos, yPos + yOffset, 255, -1);
  313. }
  314. j++;
  315. }
  316. if ((l == 3 || l == 7) && splitPrivateChat == 0 && (l == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1))) {
  317. if (yPos > 0 && yPos < 110) {
  318. int k1 = 19;
  319. textDrawingArea.method385(0, "From", yPos + yOffset, k1);
  320. k1 += textDrawingArea.getTextWidth("From ");
  321. if (byte0 == 1) {
  322. modIcons[0].drawSprite(k1, yPos - 12 + yOffset);
  323. k1 += 14;
  324. }
  325. if (byte0 == 2) {
  326. modIcons[1].drawSprite(k1, yPos - 12 + yOffset);
  327. k1 += 14;
  328. }
  329. regularFontNE.drawString(s1 + ":", k1, yPos + yOffset, 0, -1);
  330. k1 += regularFontNE.getDisplayedWidth(s1) + 8;
  331. regularFontNE.drawString(chatMessages[k], k1, yPos + yOffset, 0x800000, -1);
  332. }
  333. j++;
  334. }
  335. if (l == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  336. if (yPos > 0 && yPos < 110)
  337. regularFontNE.drawString( s1 + " " + chatMessages[k], 18, yPos + yOffset, 0x800080, -1);
  338. j++;
  339. }
  340. if (l == 5 && splitPrivateChat == 0 && privateChatMode < 2) {
  341. if (yPos > 0 && yPos < 110)
  342. regularFontNE.drawString(chatMessages[k], 18, yPos + yOffset, 0x800000, -1);
  343.  
  344. j++;
  345. }
  346. if (l == 6 && splitPrivateChat == 0 && privateChatMode < 2) {
  347. if (yPos > 0 && yPos < 110) {
  348. regularFontNE.drawString("To " + s1 + ":", 18, yPos + yOffset, 0, -1);
  349. regularFontNE.drawString(chatMessages[k], 22 + regularFontNE.getDisplayedWidth("To :" + s1), yPos + yOffset, 0x800000, -1);
  350. }
  351. j++;
  352. }
  353. if (l == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  354. if (yPos > 0 && yPos < 110)
  355. regularFontNE.drawString(s1 + " " + chatMessages[k], 18, yPos + yOffset, 0x7e3200, -1);
  356. j++;
  357. }
  358. }
  359.  
  360. DrawingArea.defaultDrawingAreaSize();
  361. anInt1211 = j * 14 + 7;
  362. if (anInt1211 < 77)
  363. anInt1211 = 77;
  364. method30(81, anInt1211 - anInt1089 - 79, 18 + yOffset, 480, anInt1211);
  365. String s;
  366. if (myPlayer != null && myPlayer.name != null)
  367. s = myPlayer.name;
  368. else
  369. s = TextClass.fixName(myUsername);
  370. regularFontNE.drawString(s + ":", 19, 111 + yOffset, 0, -1);
  371. regularFontNE.drawString(inputString + "*", 20 + textDrawingArea.getTextWidth(s + ": "), 111 + yOffset, 255, -1);
  372. DrawingArea.method339(98 + yOffset, 0, 479, 17);
  373. }
  374. if(menuOpen) {
  375. drawMenu(0, frameMode == ScreenMode.FIXED ? 338 : 0);
  376. }
  377. if (frameMode == ScreenMode.FIXED) {
  378. aRSImageProducer_1166.drawGraphics(338, super.graphics, 0);
  379. }
  380. aRSImageProducer_1165.initDrawingArea();
  381. Texture.anIntArray1472 = anIntArray1182;
  382. }
  383.  
  384. public static void writeSettings() throws IOException {
  385. try {//continue srry Bruh today is not my day lol no worries lol as long as u can make it work, idc :P
  386. DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(signlink.cacheLocation() + "settings.dat")));
  387. out.writeUTF(myUsername);
  388. out.writeUTF(myPassword);
  389. out.writeBoolean(is317);
  390. out.writeBoolean(roofsOff);
  391. out.writeBoolean(Settings.enableTweening);
  392. out.close();
  393. } catch(Exception e) { }
  394. }
  395.  
  396. public static void readSettings() throws IOException {
  397. try {
  398. DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream(signlink.cacheLocation() + "settings.dat")));
  399. myUsername = in.readUTF();
  400. myPassword = in.readUTF();
  401. is317 = in.readBoolean();
  402. roofsOff = in.readBoolean();
  403. Settings.enableTweening = in.readBoolean();
  404. in.close();
  405. } catch(Exception e) { }
  406. }
  407.  
  408.  
  409. public void init() {
  410. try {
  411. nodeID = 10;
  412. portOff = 0;
  413. setHighMem();
  414. isMembers = true;
  415. signlink.storeid = 32;
  416. signlink.startpriv(InetAddress.getLocalHost());
  417. initClientFrame(frameWidth, frameHeight);
  418. instance = this;
  419. readSettings();
  420. } catch (Exception exception) {
  421. return;
  422. }
  423. }
  424.  
  425. public void startRunnable(Runnable runnable, int i) {
  426. if (i > 10)
  427. i = 10;
  428. if (signlink.mainapp != null) {
  429. signlink.startThread(runnable, i);
  430. } else {
  431. super.startRunnable(runnable, i);
  432. }
  433. }
  434.  
  435. public Socket openSocket(int i) throws IOException {
  436. if(signlink.mainapp != null)
  437. return signlink.openSocket(i);
  438. else
  439. return new Socket(InetAddress.getByName(serverAddress), i);
  440. }
  441.  
  442. private boolean processMenuClick() {
  443. if(activeInterfaceType != 0)
  444. return false;
  445. int j = super.clickMode3;
  446. if(spellSelected == 1 && super.saveClickX >= 503 && super.saveClickY >= 160 && super.saveClickX <= 765 && super.saveClickY <= 205)
  447. j = 0;
  448. if(menuOpen) {
  449. if(j != 1) {
  450. int k = super.mouseX;
  451. int j1 = super.mouseY;
  452. if(menuScreenArea == 0) {
  453. k -= 4;
  454. j1 -= 4;
  455. }
  456. if(menuScreenArea == 1) {
  457. k -= 516;
  458. j1 -= 168;
  459. }
  460. if(menuScreenArea == 2) {
  461. k -= 5;
  462. j1 -= 338;
  463. }
  464. if(menuScreenArea == 3) {
  465. k -= 516;
  466. j1 -= 0;
  467. }
  468. if(k < menuOffsetX - 10 || k > menuOffsetX + menuWidth + 10 || j1 < menuOffsetY - 10 || j1 > menuOffsetY + menuHeight + 10) {
  469. menuOpen = false;
  470. if(menuScreenArea == 1)
  471. needDrawTabArea = true;
  472. if(menuScreenArea == 2)
  473. inputTaken = true;
  474. }
  475. }
  476. if(j == 1) {
  477. int l = menuOffsetX;
  478. int k1 = menuOffsetY;
  479. int i2 = menuWidth;
  480. int k2 = super.saveClickX;
  481. int l2 = super.saveClickY;
  482. if(menuScreenArea == 0) {
  483. k2 -= 4;
  484. l2 -= 4;
  485. }
  486. if(menuScreenArea == 1) {
  487. k2 -= 516;//519
  488. l2 -= 168;
  489. }
  490. if(menuScreenArea == 2) {
  491. k2 -= 5;//17
  492. l2 -= 338;
  493. }
  494. if(menuScreenArea == 3) {
  495. k2 -= 516;//519
  496. l2 -= 0;
  497. }
  498. int i3 = -1;
  499. for(int j3 = 0; j3 < menuActionRow; j3++) {
  500. int k3 = k1 + 31 + (menuActionRow - 1 - j3) * 15;
  501. if(k2 > l && k2 < l + i2 && l2 > k3 - 13 && l2 < k3 + 3)
  502. i3 = j3;
  503. }
  504. System.out.println(i3);
  505. if(i3 != -1)
  506. doAction(i3);
  507. menuOpen = false;
  508. if(menuScreenArea == 1)
  509. needDrawTabArea = true;
  510. if(menuScreenArea == 2) {
  511. inputTaken = true;
  512. }
  513. }
  514. return true;
  515. } else {
  516. if(j == 1 && menuActionRow > 0) {
  517. int i1 = menuActionID[menuActionRow - 1];
  518. 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) {
  519. int l1 = menuActionCmd2[menuActionRow - 1];
  520. int j2 = menuActionCmd3[menuActionRow - 1];
  521. RSInterface class9 = RSInterface.interfaceCache[j2];
  522. if(class9.aBoolean259 || class9.aBoolean235) {
  523. aBoolean1242 = false;
  524. anInt989 = 0;
  525. anInt1084 = j2;
  526. anInt1085 = l1;
  527. activeInterfaceType = 2;
  528. anInt1087 = super.saveClickX;
  529. anInt1088 = super.saveClickY;
  530. if(RSInterface.interfaceCache[j2].parentID == openInterfaceID)
  531. activeInterfaceType = 1;
  532. if(RSInterface.interfaceCache[j2].parentID == backDialogID)
  533. activeInterfaceType = 3;
  534. return true;
  535. }
  536. }
  537. }
  538. if(j == 1 && (anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  539. j = 2;
  540. if(j == 1 && menuActionRow > 0)
  541. doAction(menuActionRow - 1);
  542. if(j == 2 && menuActionRow > 0)
  543. determineMenuSize();
  544. return false;
  545. }
  546.  
  547. }
  548.  
  549. private void saveMidi(boolean flag, byte abyte0[]) {
  550. signlink.fadeMidi = flag ? 1 : 0;
  551. signlink.saveMidi(abyte0, abyte0.length);
  552. }
  553.  
  554. private void method22() {
  555. try {
  556. anInt985 = -1;
  557. aClass19_1056.removeAll();
  558. aClass19_1013.removeAll();
  559. Texture.method366();
  560. unlinkMRUNodes();
  561. worldController.initToNull();
  562. System.gc();
  563. for (int i = 0; i < 4; i++)
  564. aClass11Array1230[i].method210();
  565.  
  566. for (int l = 0; l < 4; l++) {
  567. for (int k1 = 0; k1 < 104; k1++) {
  568. for (int j2 = 0; j2 < 104; j2++)
  569. byteGroundArray[l][k1][j2] = 0;
  570.  
  571. }
  572.  
  573. }
  574.  
  575. ObjectManager objectManager = new ObjectManager(byteGroundArray, intGroundArray);
  576. int k2 = aByteArrayArray1183.length;
  577. stream.createFrame(0);
  578. if (!aBoolean1159) {
  579. for (int i3 = 0; i3 < k2; i3++) {
  580. int i4 = (anIntArray1234[i3] >> 8) * 64 - baseX;
  581. int k5 = (anIntArray1234[i3] & 0xff) * 64 - baseY;
  582. byte abyte0[] = aByteArrayArray1183[i3];
  583. if (abyte0 != null)
  584. objectManager.method180(abyte0, k5, i4, (anInt1069 - 6) * 8, (anInt1070 - 6) * 8, aClass11Array1230);
  585. }
  586.  
  587. for (int j4 = 0; j4 < k2; j4++) {
  588. int l5 = (anIntArray1234[j4] >> 8) * 64 - baseX;
  589. int k7 = (anIntArray1234[j4] & 0xff) * 64 - baseY;
  590. byte abyte2[] = aByteArrayArray1183[j4];
  591. if (abyte2 == null && anInt1070 < 800)
  592. objectManager.method174(k7, 64, 64, l5);
  593. }
  594.  
  595. anInt1097++;
  596. if (anInt1097 > 160) {
  597. anInt1097 = 0;
  598. stream.createFrame(238);
  599. stream.writeWordBigEndian(96);
  600. }
  601. stream.createFrame(0);
  602. for (int i6 = 0; i6 < k2; i6++) {
  603. byte abyte1[] = aByteArrayArray1247[i6];
  604. if (abyte1 != null) {
  605. int l8 = (anIntArray1234[i6] >> 8) * 64 - baseX;
  606. int k9 = (anIntArray1234[i6] & 0xff) * 64 - baseY;
  607. objectManager.method190(l8, aClass11Array1230, k9, worldController, abyte1);
  608. }
  609. }
  610.  
  611. }
  612. if (aBoolean1159) {
  613. for (int j3 = 0; j3 < 4; j3++) {
  614. for (int k4 = 0; k4 < 13; k4++) {
  615. for (int j6 = 0; j6 < 13; j6++) {
  616. int l7 = anIntArrayArrayArray1129[j3][k4][j6];
  617. if (l7 != -1) {
  618. int i9 = l7 >> 24 & 3;
  619. int l9 = l7 >> 1 & 3;
  620. int j10 = l7 >> 14 & 0x3ff;
  621. int l10 = l7 >> 3 & 0x7ff;
  622. int j11 = (j10 / 8 << 8) + l10 / 8;
  623. for (int l11 = 0; l11 < anIntArray1234.length; l11++) {
  624. if (anIntArray1234[l11] != j11 || aByteArrayArray1183[l11] == null)
  625. continue;
  626. objectManager.method179(i9, l9, aClass11Array1230, k4 * 8, (j10 & 7) * 8, aByteArrayArray1183[l11], (l10 & 7) * 8, j3, j6 * 8);
  627. break;
  628. }
  629.  
  630. }
  631. }
  632.  
  633. }
  634.  
  635. }
  636.  
  637. for (int l4 = 0; l4 < 13; l4++) {
  638. for (int k6 = 0; k6 < 13; k6++) {
  639. int i8 = anIntArrayArrayArray1129[0][l4][k6];
  640. if (i8 == -1)
  641. objectManager.method174(k6 * 8, 8, 8, l4 * 8);
  642. }
  643.  
  644. }
  645.  
  646. stream.createFrame(0);
  647. for (int l6 = 0; l6 < 4; l6++) {
  648. for (int j8 = 0; j8 < 13; j8++) {
  649. for (int j9 = 0; j9 < 13; j9++) {
  650. int i10 = anIntArrayArrayArray1129[l6][j8][j9];
  651. if (i10 != -1) {
  652. int k10 = i10 >> 24 & 3;
  653. int i11 = i10 >> 1 & 3;
  654. int k11 = i10 >> 14 & 0x3ff;
  655. int i12 = i10 >> 3 & 0x7ff;
  656. int j12 = (k11 / 8 << 8) + i12 / 8;
  657. for (int k12 = 0; k12 < anIntArray1234.length; k12++) {
  658. if (anIntArray1234[k12] != j12 || aByteArrayArray1247[k12] == null)
  659. continue;
  660. objectManager.method183(aClass11Array1230, worldController, k10, j8 * 8, (i12 & 7) * 8, l6, aByteArrayArray1247[k12], (k11 & 7) * 8, i11, j9 * 8);
  661. break;
  662. }
  663.  
  664. }
  665. }
  666.  
  667. }
  668.  
  669. }
  670.  
  671. }
  672. stream.createFrame(0);
  673. objectManager.method171(aClass11Array1230, worldController);
  674. aRSImageProducer_1165.initDrawingArea();
  675. stream.createFrame(0);
  676. int k3 = ObjectManager.anInt145;
  677. if (k3 > plane)
  678. k3 = plane;
  679. if (k3 < plane - 1)
  680. k3 = plane - 1;
  681. if (lowMem)
  682. worldController.method275(ObjectManager.anInt145);
  683. else
  684. worldController.method275(0);
  685. for (int i5 = 0; i5 < 104; i5++) {
  686. for (int i7 = 0; i7 < 104; i7++)
  687. spawnGroundItem(i5, i7);
  688.  
  689. }
  690.  
  691. anInt1051++;
  692. if (anInt1051 > 98) {
  693. anInt1051 = 0;
  694. stream.createFrame(150);
  695. }
  696. method63();
  697. }
  698. catch (Exception exception) {
  699. }
  700. ObjectDef.modelCache.unlinkAll();
  701. if (super.gameFrame != null) {
  702. stream.createFrame(210);
  703. stream.writeDWord(0x3f008edd);
  704. }
  705. if (lowMem && signlink.cache_dat != null) {
  706. int j = onDemandFetcher.getVersionCount(0);
  707. for (int i1 = 0; i1 < j; i1++) {
  708. int l1 = onDemandFetcher.getModelIndex(i1);
  709. if ((l1 & 0x79) == 0)
  710. Model.method461(i1);
  711. }
  712.  
  713. }
  714. System.gc();
  715. Texture.method367();
  716. onDemandFetcher.method566();
  717. int k = (anInt1069 - 6) / 8 - 1;
  718. int j1 = (anInt1069 + 6) / 8 + 1;
  719. int i2 = (anInt1070 - 6) / 8 - 1;
  720. int l2 = (anInt1070 + 6) / 8 + 1;
  721. if (aBoolean1141) {
  722. k = 49;
  723. j1 = 50;
  724. i2 = 49;
  725. l2 = 50;
  726. }
  727. for (int l3 = k; l3 <= j1; l3++) {
  728. for (int j5 = i2; j5 <= l2; j5++)
  729. if (l3 == k || l3 == j1 || j5 == i2 || j5 == l2) {
  730. int j7 = onDemandFetcher.method562(0, j5, l3);
  731. if (j7 != -1)
  732. onDemandFetcher.method560(j7, 3);
  733. int k8 = onDemandFetcher.method562(1, j5, l3);
  734. if (k8 != -1)
  735. onDemandFetcher.method560(k8, 3);
  736. }
  737.  
  738. }
  739.  
  740. }
  741.  
  742. private void unlinkMRUNodes() {
  743. ObjectDef.modelCache.unlinkAll();
  744. ObjectDef.modelCache2.unlinkAll();
  745. EntityDef.mruNodes.unlinkAll();
  746. ItemDef.mruNodes2.unlinkAll();
  747. ItemDef.mruNodes1.unlinkAll();
  748. Player.mruNodes.unlinkAll();
  749. SpotAnim.aMRUNodes_415.unlinkAll();
  750. }
  751.  
  752. private void method24(int i) {
  753. int ai[] = minimapImage.myPixels;
  754. int j = ai.length;
  755. for (int k = 0; k < j; k++)
  756. ai[k] = 0;
  757.  
  758.  
  759. for (int l = 1; l < 103; l++) {
  760. int i1 = 24628 + (103 - l) * 512 * 4;
  761. for (int k1 = 1; k1 < 103; k1++) {
  762. if ((byteGroundArray[i][k1][l] & 0x18) == 0)
  763. worldController.method309(ai, i1, i, k1, l);
  764. if (i < 3 && (byteGroundArray[i + 1][k1][l] & 8) != 0)
  765. worldController.method309(ai, i1, i + 1, k1, l);
  766. i1 += 4;
  767. }
  768.  
  769. }
  770.  
  771. int j1 = ((238 + (int) (Math.random() * 20D)) - 10 << 16) + ((238 + (int) (Math.random() * 20D)) - 10 << 8) + ((238 + (int) (Math.random() * 20D)) - 10);
  772. int l1 = (238 + (int) (Math.random() * 20D)) - 10 << 16;
  773. minimapImage.method343();
  774. for (int i2 = 1; i2 < 103; i2++) {
  775. for (int j2 = 1; j2 < 103; j2++) {
  776. if ((byteGroundArray[i][j2][i2] & 0x18) == 0)
  777. method50(i2, j1, j2, l1, i);
  778. if (i < 3 && (byteGroundArray[i + 1][j2][i2] & 8) != 0)
  779. method50(i2, j1, j2, l1, i + 1);
  780. }
  781.  
  782. }
  783.  
  784. aRSImageProducer_1165.initDrawingArea();
  785. anInt1071 = 0;
  786. for (int k2 = 0; k2 < 104; k2++) {
  787. for (int l2 = 0; l2 < 104; l2++) {
  788. int i3 = worldController.method303(plane, k2, l2);
  789. if (i3 != 0) {
  790. i3 = i3 >> 14 & 0x7fff;
  791. int j3 = ObjectDef.forID(i3).anInt746;
  792. if (j3 >= 0) {
  793. int k3 = k2;
  794. int l3 = l2;
  795. if (j3 != 22 && j3 != 29 && j3 != 34 && j3 != 36 && j3 != 46 && j3 != 47 && j3 != 48) {
  796. byte byte0 = 104;
  797. byte byte1 = 104;
  798. int ai1[][] = aClass11Array1230[plane].anIntArrayArray294;
  799. for (int i4 = 0; i4 < 10; i4++) {
  800. int j4 = (int) (Math.random() * 4D);
  801. if (j4 == 0 && k3 > 0 && k3 > k2 - 3 && (ai1[k3 - 1][l3] & 0x1280108) == 0)
  802. k3--;
  803. if (j4 == 1 && k3 < byte0 - 1 && k3 < k2 + 3 && (ai1[k3 + 1][l3] & 0x1280180) == 0)
  804. k3++;
  805. if (j4 == 2 && l3 > 0 && l3 > l2 - 3 && (ai1[k3][l3 - 1] & 0x1280102) == 0)
  806. l3--;
  807. if (j4 == 3 && l3 < byte1 - 1 && l3 < l2 + 3 && (ai1[k3][l3 + 1] & 0x1280120) == 0)
  808. l3++;
  809. }
  810.  
  811. }
  812. aClass30_Sub2_Sub1_Sub1Array1140[anInt1071] = mapFunctions[j3];
  813. anIntArray1072[anInt1071] = k3;
  814. anIntArray1073[anInt1071] = l3;
  815. anInt1071++;
  816. }
  817. }
  818. }
  819.  
  820. }
  821.  
  822. }
  823.  
  824. private void spawnGroundItem(int i, int j) {
  825. NodeList class19 = groundArray[plane][i][j];
  826. if (class19 == null) {
  827. worldController.method295(plane, i, j);
  828. return;
  829. }
  830. int k = 0xfa0a1f01;
  831. Object obj = null;
  832. for (Item item = (Item) class19.reverseGetFirst(); item != null; item = (Item) class19.reverseGetNext()) {
  833. ItemDef itemDef = ItemDef.forID(item.ID);
  834. int l = itemDef.value;
  835. if (itemDef.stackable)
  836. l *= item.anInt1559 + 1;
  837. // notifyItemSpawn(item, i + baseX, j + baseY);
  838.  
  839. if (l > k) {
  840. k = l;
  841. obj = item;
  842. }
  843. }
  844.  
  845. class19.insertTail(((Node) (obj)));
  846. Object obj1 = null;
  847. Object obj2 = null;
  848. for (Item class30_sub2_sub4_sub2_1 = (Item) class19.reverseGetFirst(); class30_sub2_sub4_sub2_1 != null; class30_sub2_sub4_sub2_1 = (Item) class19.reverseGetNext())
  849. {
  850. if (class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && obj1 == null)
  851. obj1 = class30_sub2_sub4_sub2_1;
  852. if (class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && class30_sub2_sub4_sub2_1.ID != ((Item) (obj1)).ID && obj2 == null)
  853. obj2 = class30_sub2_sub4_sub2_1;
  854. }
  855.  
  856. int i1 = i + (j << 7) + 0x60000000;
  857. worldController.method281(i, i1, ((Animable) (obj1)), method42(plane, j * 128 + 64, i * 128 + 64), ((Animable) (obj2)), ((Animable) (obj)), plane, j);
  858. }
  859.  
  860. private void method26(boolean flag) {
  861. for (int j = 0; j < npcCount; j++) {
  862. NPC npc = npcArray[npcIndices[j]];
  863. int k = 0x20000000 + (npcIndices[j] << 14);
  864. if (npc == null || !npc.isVisible() || npc.desc.aBoolean93 != flag)
  865. continue;
  866. int l = npc.x >> 7;
  867. int i1 = npc.y >> 7;
  868. if (l < 0 || l >= 104 || i1 < 0 || i1 >= 104)
  869. continue;
  870. if (npc.anInt1540 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64) {
  871. if (anIntArrayArray929[l][i1] == anInt1265)
  872. continue;
  873. anIntArrayArray929[l][i1] = anInt1265;
  874. }
  875. if (!npc.desc.aBoolean84)
  876. k += 0x80000000;
  877. worldController.method285(plane, npc.anInt1552, method42(plane, npc.y, npc.x), k, npc.y, (npc.anInt1540 - 1) * 64 + 60, npc.x, npc, npc.aBoolean1541);
  878. }
  879. }
  880.  
  881. private boolean replayWave() {
  882. return signlink.replayWave();
  883. }
  884.  
  885. private void loadError() {
  886. String s = "ondemand";//was a constant parameter
  887. System.out.println(s);
  888. try {
  889. getAppletContext().showDocument(new URL(getCodeBase(), "loaderror_" + s + ".html"));
  890. }
  891. catch (Exception exception) {
  892. exception.printStackTrace();
  893. }
  894. do
  895. try {
  896. Thread.sleep(1000L);
  897. }
  898. catch (Exception _ex) {
  899. }
  900. while (true);
  901. }
  902.  
  903. public void setSidebarInterface(int id, int tab) {
  904. int l1 = id;
  905. int j10 = tab;
  906. if(l1 == 65535)
  907. l1 = -1;
  908. tabInterfaceIDs[j10] = l1;
  909. needDrawTabArea = true;
  910. tabAreaAltered = true;
  911. }
  912.  
  913. private void buildInterfaceMenu(int i, RSInterface class9, int k, int l, int i1, int j1) {
  914. if (class9.type != 0 || class9.children == null || class9.isMouseoverTriggered)
  915. return;
  916. if (k < i || i1 < l || k > i + class9.width || i1 > l + class9.height)
  917. return;
  918. int k1 = class9.children.length;
  919. for (int l1 = 0; l1 < k1; l1++) {
  920. int i2 = class9.childX[l1] + i;
  921. int j2 = (class9.childY[l1] + l) - j1;
  922. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[l1]];
  923. i2 += class9_1.anInt263;
  924. j2 += class9_1.anInt265;
  925. if ((class9_1.hoverType >= 0 || class9_1.anInt216 != 0) && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  926. if (class9_1.hoverType >= 0)
  927. anInt886 = class9_1.hoverType;
  928. else
  929. anInt886 = class9_1.id;
  930. if (class9_1.type == 8 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  931. anInt1315 = class9_1.id;
  932. }
  933. if (class9_1.type == 0) {
  934. buildInterfaceMenu(i2, class9_1, k, j2, i1, class9_1.scrollPosition);
  935. if (class9_1.scrollMax > class9_1.height)
  936. method65(i2 + class9_1.width, class9_1.height, k, i1, class9_1, j2, true, class9_1.scrollMax);
  937. } else {
  938. if (class9_1.atActionType == 1 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  939. boolean flag = false;
  940. if (class9_1.contentType != 0)
  941. flag = buildFriendsListMenu(class9_1);
  942. if (!flag) {
  943. menuActionName[menuActionRow] = class9_1.tooltip;// + ", " + class9_1.id;//thing
  944. menuActionID[menuActionRow] = 315;
  945. menuActionCmd3[menuActionRow] = class9_1.id;
  946. menuActionRow++;
  947. }
  948. }
  949. if (class9_1.atActionType == 2 && spellSelected == 0 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  950. String s = class9_1.selectedActionName;
  951. if (s.indexOf(" ") != -1)
  952. s = s.substring(0, s.indexOf(" "));
  953. menuActionName[menuActionRow] = s + " @gre@" + class9_1.spellName;
  954. menuActionID[menuActionRow] = 626;
  955. menuActionCmd3[menuActionRow] = class9_1.id;
  956. menuActionRow++;
  957. }
  958. if (class9_1.atActionType == 3 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  959. menuActionName[menuActionRow] = "Close";
  960. menuActionID[menuActionRow] = 200;
  961. menuActionCmd3[menuActionRow] = class9_1.id;
  962. menuActionRow++;
  963. }
  964. if (class9_1.atActionType == 4 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  965. menuActionName[menuActionRow] = class9_1.tooltip;
  966. menuActionID[menuActionRow] = 169;
  967. menuActionCmd3[menuActionRow] = class9_1.id;
  968. menuActionRow++;
  969. }
  970. if (class9_1.atActionType == 5 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  971. menuActionName[menuActionRow] = class9_1.tooltip;
  972. menuActionID[menuActionRow] = 646;
  973. menuActionCmd3[menuActionRow] = class9_1.id;
  974. menuActionRow++;
  975. }
  976. if (class9_1.atActionType == 6 && !aBoolean1149 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  977. menuActionName[menuActionRow] = class9_1.tooltip;
  978. menuActionID[menuActionRow] = 679;
  979. menuActionCmd3[menuActionRow] = class9_1.id;
  980. menuActionRow++;
  981. }
  982. if (class9_1.type == 2) {
  983. int k2 = 0;
  984. for (int l2 = 0; l2 < class9_1.height; l2++) {
  985. for (int i3 = 0; i3 < class9_1.width; i3++) {
  986. int j3 = i2 + i3 * (32 + class9_1.invSpritePadX);
  987. int k3 = j2 + l2 * (32 + class9_1.invSpritePadY);
  988. if (k2 < 20) {
  989. j3 += class9_1.spritesX[k2];
  990. k3 += class9_1.spritesY[k2];
  991. }
  992. if (k >= j3 && i1 >= k3 && k < j3 + 32 && i1 < k3 + 32) {
  993. mouseInvInterfaceIndex = k2;
  994. lastActiveInvInterface = class9_1.id;
  995. if (class9_1.inv[k2] > 0) {
  996. ItemDef itemDef = ItemDef.forID(class9_1.inv[k2] - 1);
  997. if (itemSelected == 1 && class9_1.isInventoryInterface) {
  998. if (class9_1.id != anInt1284 || k2 != anInt1283) {
  999. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  1000. menuActionID[menuActionRow] = 870;
  1001. menuActionCmd1[menuActionRow] = itemDef.id;
  1002. menuActionCmd2[menuActionRow] = k2;
  1003. menuActionCmd3[menuActionRow] = class9_1.id;
  1004. menuActionRow++;
  1005. }
  1006. } else if (spellSelected == 1 && class9_1.isInventoryInterface) {
  1007. if ((spellUsableOn & 0x10) == 16) {
  1008. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  1009. menuActionID[menuActionRow] = 543;
  1010. menuActionCmd1[menuActionRow] = itemDef.id;
  1011. menuActionCmd2[menuActionRow] = k2;
  1012. menuActionCmd3[menuActionRow] = class9_1.id;
  1013. menuActionRow++;
  1014. }
  1015. } else {
  1016. if (class9_1.isInventoryInterface) {
  1017. for (int l3 = 4; l3 >= 3; l3--)
  1018. if (itemDef.actions != null && itemDef.actions[l3] != null) {
  1019. menuActionName[menuActionRow] = itemDef.actions[l3] + " @lre@" + itemDef.name;
  1020. if (l3 == 3)
  1021. menuActionID[menuActionRow] = 493;
  1022. if (l3 == 4)
  1023. menuActionID[menuActionRow] = 847;
  1024. menuActionCmd1[menuActionRow] = itemDef.id;
  1025. menuActionCmd2[menuActionRow] = k2;
  1026. menuActionCmd3[menuActionRow] = class9_1.id;
  1027. menuActionRow++;
  1028. } else if (l3 == 4) {
  1029. menuActionName[menuActionRow] = "Drop @lre@" + itemDef.name;
  1030. menuActionID[menuActionRow] = 847;
  1031. menuActionCmd1[menuActionRow] = itemDef.id;
  1032. menuActionCmd2[menuActionRow] = k2;
  1033. menuActionCmd3[menuActionRow] = class9_1.id;
  1034. menuActionRow++;
  1035. }
  1036.  
  1037. }
  1038. if (class9_1.usableItemInterface) {
  1039. menuActionName[menuActionRow] = "Use @lre@" + itemDef.name;
  1040. menuActionID[menuActionRow] = 447;
  1041. menuActionCmd1[menuActionRow] = itemDef.id;
  1042. menuActionCmd2[menuActionRow] = k2;
  1043. menuActionCmd3[menuActionRow] = class9_1.id;
  1044. menuActionRow++;
  1045. }
  1046. if (class9_1.isInventoryInterface && itemDef.actions != null) {
  1047. for (int i4 = 2; i4 >= 0; i4--)
  1048. if (itemDef.actions[i4] != null) {
  1049. menuActionName[menuActionRow] = itemDef.actions[i4] + " @lre@" + itemDef.name;
  1050. if (i4 == 0)
  1051. menuActionID[menuActionRow] = 74;
  1052. if (i4 == 1)
  1053. menuActionID[menuActionRow] = 454;
  1054. if (i4 == 2)
  1055. menuActionID[menuActionRow] = 539;
  1056. menuActionCmd1[menuActionRow] = itemDef.id;
  1057. menuActionCmd2[menuActionRow] = k2;
  1058. menuActionCmd3[menuActionRow] = class9_1.id;
  1059. menuActionRow++;
  1060. }
  1061.  
  1062. }
  1063. if (class9_1.actions != null) {
  1064. for (int j4 = 4; j4 >= 0; j4--)
  1065. if (class9_1.actions[j4] != null) {
  1066. menuActionName[menuActionRow] = class9_1.actions[j4] + " @lre@" + itemDef.name;
  1067. if (j4 == 0)
  1068. menuActionID[menuActionRow] = 632;
  1069. if (j4 == 1)
  1070. menuActionID[menuActionRow] = 78;
  1071. if (j4 == 2)
  1072. menuActionID[menuActionRow] = 867;
  1073. if (j4 == 3)
  1074. menuActionID[menuActionRow] = 431;
  1075. if (j4 == 4)
  1076. menuActionID[menuActionRow] = 53;
  1077. menuActionCmd1[menuActionRow] = itemDef.id;
  1078. menuActionCmd2[menuActionRow] = k2;
  1079. menuActionCmd3[menuActionRow] = class9_1.id;
  1080. menuActionRow++;
  1081. }
  1082.  
  1083. }
  1084. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  1085. menuActionID[menuActionRow] = 1125;
  1086. menuActionCmd1[menuActionRow] = itemDef.id;
  1087. menuActionCmd2[menuActionRow] = k2;
  1088. menuActionCmd3[menuActionRow] = class9_1.id;
  1089. menuActionRow++;
  1090. }
  1091. }
  1092. }
  1093. k2++;
  1094. }
  1095.  
  1096. }
  1097.  
  1098. }
  1099. }
  1100. }
  1101.  
  1102. }
  1103.  
  1104. private void method30(int j, int k, int l, int i1, int j1) {
  1105. scrollBar1.method361(i1, l);
  1106. scrollBar2.method361(i1, (l + j) - 16);
  1107. DrawingArea.method336(j - 32, l + 16, i1, anInt1002, 16);
  1108. int k1 = ((j - 32) * j) / j1;
  1109. if (k1 < 8)
  1110. k1 = 8;
  1111. int l1 = ((j - 32 - k1) * k) / (j1 - j);
  1112. DrawingArea.method336(k1, l + 16 + l1, i1, anInt1063, 16);
  1113. DrawingArea.method341(l + 16 + l1, anInt902, k1, i1);
  1114. DrawingArea.method341(l + 16 + l1, anInt902, k1, i1 + 1);
  1115. DrawingArea.method339(l + 16 + l1, anInt902, 16, i1);
  1116. DrawingArea.method339(l + 17 + l1, anInt902, 16, i1);
  1117. DrawingArea.method341(l + 16 + l1, anInt927, k1, i1 + 15);
  1118. DrawingArea.method341(l + 17 + l1, anInt927, k1 - 1, i1 + 14);
  1119. DrawingArea.method339(l + 15 + l1 + k1, anInt927, 16, i1);
  1120. DrawingArea.method339(l + 14 + l1 + k1, anInt927, 15, i1 + 1);
  1121. }
  1122.  
  1123. private void updateNPCs(Stream stream, int i) {
  1124. anInt839 = 0;
  1125. anInt893 = 0;
  1126. method139(stream);
  1127. method46(i, stream);
  1128. method86(stream);
  1129. for (int k = 0; k < anInt839; k++) {
  1130. int l = anIntArray840[k];
  1131. if (npcArray[l].anInt1537 != loopCycle) {
  1132. npcArray[l].desc = null;
  1133. npcArray[l] = null;
  1134. }
  1135. }
  1136.  
  1137. if (stream.currentOffset != i) {
  1138. signlink.reporterror(myUsername + " size mismatch in getnpcpos - pos:" + stream.currentOffset + " psize:" + i);
  1139. throw new RuntimeException("eek");
  1140. }
  1141. for (int i1 = 0; i1 < npcCount; i1++)
  1142. if (npcArray[npcIndices[i1]] == null) {
  1143. signlink.reporterror(myUsername + " null entry in npc list - pos:" + i1 + " size:" + npcCount);
  1144. throw new RuntimeException("eek");
  1145. }
  1146.  
  1147. }
  1148.  
  1149. private void processChatModeClick()
  1150. {
  1151. final int yOffset = frameMode == ScreenMode.FIXED ? 0 : frameHeight - 503;
  1152. if(super.clickMode3 == 1)
  1153. {
  1154. if(super.saveClickX >= 6 && super.saveClickX <= 106 && super.saveClickY >= yOffset + 467 && super.saveClickY <= yOffset + 499)
  1155. {
  1156. publicChatMode = (publicChatMode + 1) % 4;
  1157. aBoolean1233 = true;
  1158. inputTaken = true;
  1159. stream.createFrame(95);
  1160. stream.writeWordBigEndian(publicChatMode);
  1161. stream.writeWordBigEndian(privateChatMode);
  1162. stream.writeWordBigEndian(tradeMode);
  1163. }
  1164. if(super.saveClickX >= 135 && super.saveClickX <= 235 && super.saveClickY >= yOffset + 467 && super.saveClickY <= yOffset + 499)
  1165. {
  1166. privateChatMode = (privateChatMode + 1) % 3;
  1167. aBoolean1233 = true;
  1168. inputTaken = true;
  1169. stream.createFrame(95);
  1170. stream.writeWordBigEndian(publicChatMode);
  1171. stream.writeWordBigEndian(privateChatMode);
  1172. stream.writeWordBigEndian(tradeMode);
  1173. }
  1174. if(super.saveClickX >= 273 && super.saveClickX <= 373 && super.saveClickY >= yOffset + 467 && super.saveClickY <= yOffset + 499)
  1175. {
  1176. tradeMode = (tradeMode + 1) % 3;
  1177. aBoolean1233 = true;
  1178. inputTaken = true;
  1179. stream.createFrame(95);
  1180. stream.writeWordBigEndian(publicChatMode);
  1181. stream.writeWordBigEndian(privateChatMode);
  1182. stream.writeWordBigEndian(tradeMode);
  1183. }
  1184. if(anInt940 > 1386)
  1185. {
  1186. anInt940 = 0;
  1187. stream.createFrame(165);
  1188. stream.writeWordBigEndian(0);
  1189. int j = stream.currentOffset;
  1190. stream.writeWordBigEndian(139);
  1191. stream.writeWordBigEndian(150);
  1192. stream.writeWord(32131);
  1193. stream.writeWordBigEndian((int)(Math.random() * 256D));
  1194. stream.writeWord(3250);
  1195. stream.writeWordBigEndian(177);
  1196. stream.writeWord(24859);
  1197. stream.writeWordBigEndian(119);
  1198. if((int)(Math.random() * 2D) == 0)
  1199. stream.writeWord(47234);
  1200. if((int)(Math.random() * 2D) == 0)
  1201. stream.writeWordBigEndian(21);
  1202. stream.writeBytes(stream.currentOffset - j);
  1203. }
  1204. }
  1205. }
  1206.  
  1207. public void tabToReplyPm() {
  1208. String name = null;
  1209. for (int k = 0; k < 100; k++) {
  1210. if (chatMessages[k] == null) {
  1211. continue;
  1212. }
  1213. int l = chatTypes[k];
  1214. if (l == 3 || l == 7) {
  1215. name = chatNames[k];
  1216. break;
  1217. }
  1218. }
  1219.  
  1220. if (name == null) {
  1221. pushMessage("You haven't received any messages to which you can reply.", 0, "");
  1222. return;
  1223. }
  1224.  
  1225. if (name.startsWith("@cr")) {
  1226. name = name.substring(5);
  1227. }
  1228.  
  1229. long nameAsLong = TextClass.longForName(name.trim());
  1230. int k3 = -1;
  1231. for (int i4 = 0; i4 < friendsCount; i4++) {
  1232. if (friendsListAsLongs[i4] != nameAsLong) continue;
  1233. k3 = i4;
  1234. break;
  1235. }
  1236.  
  1237. if (k3 != -1) {
  1238. if (friendsNodeIDs[k3] > 0) {
  1239. inputTaken = true;
  1240. inputDialogState = 0;
  1241. messagePromptRaised = true;
  1242. promptInput = "";
  1243. friendsListAction = 3;
  1244. aLong953 = friendsListAsLongs[k3];
  1245. aString1121 = "Enter message to send to " + friendsList[k3];
  1246. } else {
  1247. pushMessage("That player is currently offline.", 0, "");
  1248. }
  1249. }
  1250. }
  1251.  
  1252. private void method33(int i) {
  1253. int j = Varp.cache[i].anInt709;
  1254. if (j == 0)
  1255. return;
  1256. int k = variousSettings[i];
  1257. if (j == 1) {
  1258. if (k == 1)
  1259. Texture.method372(0.90000000000000002D);
  1260. if (k == 2)
  1261. Texture.method372(0.80000000000000004D);
  1262. if (k == 3)
  1263. Texture.method372(0.69999999999999996D);
  1264. if (k == 4)
  1265. Texture.method372(0.59999999999999998D);
  1266. ItemDef.mruNodes1.unlinkAll();
  1267. welcomeScreenRaised = true;
  1268. }
  1269. if (j == 3) {
  1270. boolean flag1 = musicEnabled;
  1271. if (k == 0) {
  1272. adjustVolume(musicEnabled, 500);
  1273. musicEnabled = true;
  1274. }
  1275. if (k == 1) {
  1276. adjustVolume(musicEnabled, 300);
  1277. musicEnabled = true;
  1278. }
  1279. if (k == 2) {
  1280. adjustVolume(musicEnabled, 100);
  1281. musicEnabled = true;
  1282. }
  1283. if (k == 3) {
  1284. adjustVolume(musicEnabled, 0);
  1285. musicEnabled = false;
  1286. }
  1287. if (k == 4) {
  1288. musicEnabled = false;
  1289. stopMidi();
  1290. }
  1291. if (musicEnabled != flag1) {
  1292. if (musicEnabled) {
  1293. nextSong = currentSong;
  1294. songChanging = true;
  1295. onDemandFetcher.method558(2, nextSong);
  1296. } else {
  1297. stopMidi();
  1298. }
  1299. prevSong = 0;
  1300. }
  1301. }
  1302. if (j == 4) {
  1303. SoundPlayer.setVolume(j);
  1304. if (k == 0) {
  1305. aBoolean848 = true;
  1306. setWaveVolume(0);
  1307. }
  1308. if (k == 1) {
  1309. aBoolean848 = true;
  1310. setWaveVolume(-400);
  1311. }
  1312. if (k == 2) {
  1313. aBoolean848 = true;
  1314. setWaveVolume(-800);
  1315. }
  1316. if (k == 3) {
  1317. aBoolean848 = true;
  1318. setWaveVolume(-1200);
  1319. }
  1320. if (k == 4)
  1321. aBoolean848 = false;
  1322. }
  1323. if (j == 5)
  1324. anInt1253 = k;
  1325. if (j == 6)
  1326. anInt1249 = k;
  1327. if (j == 8) {
  1328. splitPrivateChat = k;
  1329. inputTaken = true;
  1330. }
  1331. if (j == 9)
  1332. anInt913 = k;
  1333. }
  1334.  
  1335. private void updateEntities() {
  1336. try{
  1337. int anInt974 = 0;
  1338. for(int j = -1; j < playerCount + npcCount; j++) {
  1339. Object obj;
  1340. if(j == -1)
  1341. obj = myPlayer;
  1342. else
  1343. if(j < playerCount)
  1344. obj = playerArray[playerIndices[j]];
  1345. else
  1346. obj = npcArray[npcIndices[j - playerCount]];
  1347. if(obj == null || !((Entity) (obj)).isVisible())
  1348. continue;
  1349. if(obj instanceof NPC) {
  1350. EntityDef entityDef = ((NPC)obj).desc;
  1351. if(entityDef.childrenIDs != null)
  1352. entityDef = entityDef.method161();
  1353. if(entityDef == null)
  1354. continue;
  1355. }
  1356. if(j < playerCount) {
  1357. int l = 30;
  1358. Player player = (Player)obj;
  1359. if(player.headIcon >= 0) {
  1360. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1361. if(spriteDrawX > -1) {
  1362. if (player.skullIcon < 11) {
  1363. skullIcons[player.skullIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1364. l += 25;
  1365. }
  1366. if (player.headIcon < 7) {
  1367. headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1368. l += 18;
  1369. }
  1370. }
  1371. }
  1372. if(j >= 0 && anInt855 == 10 && anInt933 == playerIndices[j]) {
  1373. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1374. if(spriteDrawX > -1)
  1375. headIconsHint[player.hintIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1376. }
  1377. } else {
  1378. EntityDef entityDef_1 = ((NPC)obj).desc;
  1379. if(entityDef_1.anInt75 >= 0 && entityDef_1.anInt75 < headIcons.length) {
  1380. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1381. if(spriteDrawX > -1)
  1382. headIcons[entityDef_1.anInt75].drawSprite(spriteDrawX - 12, spriteDrawY - 30);
  1383. }
  1384. if(anInt855 == 1 && anInt1222 == npcIndices[j - playerCount] && loopCycle % 20 < 10) {
  1385. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1386. if(spriteDrawX > -1)
  1387. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  1388. }
  1389. }
  1390. if(((Entity) (obj)).textSpoken != null && (j >= playerCount || publicChatMode == 0 || publicChatMode == 3 || publicChatMode == 1 && isFriendOrSelf(((Player)obj).name)))
  1391. {
  1392. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height);
  1393. if(spriteDrawX > -1 && anInt974 < anInt975)
  1394. {
  1395. anIntArray979[anInt974] = chatTextDrawingArea.method384(((Entity) (obj)).textSpoken) / 2;
  1396. anIntArray978[anInt974] = chatTextDrawingArea.anInt1497;
  1397. anIntArray976[anInt974] = spriteDrawX;
  1398. anIntArray977[anInt974] = spriteDrawY;
  1399. anIntArray980[anInt974] = ((Entity) (obj)).anInt1513;
  1400. anIntArray981[anInt974] = ((Entity) (obj)).anInt1531;
  1401. anIntArray982[anInt974] = ((Entity) (obj)).textCycle;
  1402. aStringArray983[anInt974++] = ((Entity) (obj)).textSpoken;
  1403. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 >= 1 && ((Entity) (obj)).anInt1531 <= 3)
  1404. {
  1405. anIntArray978[anInt974] += 10;
  1406. anIntArray977[anInt974] += 5;
  1407. }
  1408. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 4)
  1409. anIntArray979[anInt974] = 60;
  1410. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 5)
  1411. anIntArray978[anInt974] += 5;
  1412. }
  1413. }
  1414. if(((Entity) (obj)).loopCycleStatus > loopCycle)
  1415. {
  1416. try{
  1417. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1418. if(spriteDrawX > -1)
  1419. {
  1420. int i1 = (((Entity) (obj)).currentHealth * 30) / ((Entity) (obj)).maxHealth;
  1421. if(i1 > 30)
  1422. i1 = 30;
  1423. DrawingArea.drawPixels(5, spriteDrawY - 3, spriteDrawX - 15, 65280, i1);
  1424. DrawingArea.drawPixels(5, spriteDrawY - 3, (spriteDrawX - 15) + i1, 0xff0000, 30 - i1);
  1425. }
  1426. }catch(Exception e){ }
  1427. }
  1428. for(int j1 = 0; j1 < 4; j1++)
  1429. if(((Entity) (obj)).hitsLoopCycle[j1] > loopCycle)
  1430. {
  1431. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height / 2);
  1432. if(spriteDrawX > -1)
  1433. {
  1434. if(j1 == 1)
  1435. spriteDrawY -= 20;
  1436. if(j1 == 2)
  1437. {
  1438. spriteDrawX -= 15;
  1439. spriteDrawY -= 10;
  1440. }
  1441. if(j1 == 3)
  1442. {
  1443. spriteDrawX += 15;
  1444. spriteDrawY -= 10;
  1445. }
  1446. hitMarks[((Entity) (obj)).hitMarkTypes[j1]].drawSprite(spriteDrawX - 12, spriteDrawY - 12);
  1447. smallText.drawText(0, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 4, spriteDrawX);
  1448. smallText.drawText(0xffffff, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 3, spriteDrawX - 1);
  1449. }
  1450. }
  1451. }
  1452. for(int k = 0; k < anInt974; k++) {
  1453. int k1 = anIntArray976[k];
  1454. int l1 = anIntArray977[k];
  1455. int j2 = anIntArray979[k];
  1456. int k2 = anIntArray978[k];
  1457. boolean flag = true;
  1458. while(flag)
  1459. {
  1460. flag = false;
  1461. for(int l2 = 0; l2 < k; l2++)
  1462. 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)
  1463. {
  1464. l1 = anIntArray977[l2] - anIntArray978[l2];
  1465. flag = true;
  1466. }
  1467.  
  1468. }
  1469. spriteDrawX = anIntArray976[k];
  1470. spriteDrawY = anIntArray977[k] = l1;
  1471. String s = aStringArray983[k];
  1472. if(anInt1249 == 0)
  1473. {
  1474. int i3 = 0xffff00;
  1475. if(anIntArray980[k] < 6)
  1476. i3 = anIntArray965[anIntArray980[k]];
  1477. if(anIntArray980[k] == 6)
  1478. i3 = anInt1265 % 20 >= 10 ? 0xffff00 : 0xff0000;
  1479. if(anIntArray980[k] == 7)
  1480. i3 = anInt1265 % 20 >= 10 ? 65535 : 255;
  1481. if(anIntArray980[k] == 8)
  1482. i3 = anInt1265 % 20 >= 10 ? 0x80ff80 : 45056;
  1483. if(anIntArray980[k] == 9) {
  1484. int j3 = 150 - anIntArray982[k];
  1485. if(j3 < 50)
  1486. i3 = 0xff0000 + 1280 * j3;
  1487. else
  1488. if(j3 < 100)
  1489. i3 = 0xffff00 - 0x50000 * (j3 - 50);
  1490. else
  1491. if(j3 < 150)
  1492. i3 = 65280 + 5 * (j3 - 100);
  1493. }
  1494. if(anIntArray980[k] == 10) {
  1495. int k3 = 150 - anIntArray982[k];
  1496. if(k3 < 50)
  1497. i3 = 0xff0000 + 5 * k3;
  1498. else
  1499. if(k3 < 100)
  1500. i3 = 0xff00ff - 0x50000 * (k3 - 50);
  1501. else
  1502. if(k3 < 150)
  1503. i3 = (255 + 0x50000 * (k3 - 100)) - 5 * (k3 - 100);
  1504. }
  1505. if(anIntArray980[k] == 11) {
  1506. int l3 = 150 - anIntArray982[k];
  1507. if(l3 < 50)
  1508. i3 = 0xffffff - 0x50005 * l3;
  1509. else
  1510. if(l3 < 100)
  1511. i3 = 65280 + 0x50005 * (l3 - 50);
  1512. else
  1513. if(l3 < 150)
  1514. i3 = 0xffffff - 0x50000 * (l3 - 100);
  1515. }
  1516. if(anIntArray981[k] == 0) {
  1517. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  1518. chatTextDrawingArea.drawText(i3, s, spriteDrawY, spriteDrawX);
  1519. }
  1520. if(anIntArray981[k] == 1) {
  1521. chatTextDrawingArea.method386(0, s, spriteDrawX, anInt1265, spriteDrawY + 1);
  1522. chatTextDrawingArea.method386(i3, s, spriteDrawX, anInt1265, spriteDrawY);
  1523. }
  1524. if(anIntArray981[k] == 2) {
  1525. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY + 1, 0);
  1526. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY, i3);
  1527. }
  1528. if(anIntArray981[k] == 3) {
  1529. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY + 1, spriteDrawX, 0);
  1530. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY, spriteDrawX, i3);
  1531. }
  1532. if(anIntArray981[k] == 4) {
  1533. int i4 = chatTextDrawingArea.method384(s);
  1534. int k4 = ((150 - anIntArray982[k]) * (i4 + 100)) / 150;
  1535. DrawingArea.setDrawingArea(334, spriteDrawX - 50, spriteDrawX + 50, 0);
  1536. chatTextDrawingArea.method385(0, s, spriteDrawY + 1, (spriteDrawX + 50) - k4);
  1537. chatTextDrawingArea.method385(i3, s, spriteDrawY, (spriteDrawX + 50) - k4);
  1538. DrawingArea.defaultDrawingAreaSize();
  1539. }
  1540. if(anIntArray981[k] == 5) {
  1541. int j4 = 150 - anIntArray982[k];
  1542. int l4 = 0;
  1543. if(j4 < 25)
  1544. l4 = j4 - 25;
  1545. else
  1546. if(j4 > 125)
  1547. l4 = j4 - 125;
  1548. DrawingArea.setDrawingArea(spriteDrawY + 5, 0, 512, spriteDrawY - chatTextDrawingArea.anInt1497 - 1);
  1549. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1 + l4, spriteDrawX);
  1550. chatTextDrawingArea.drawText(i3, s, spriteDrawY + l4, spriteDrawX);
  1551. DrawingArea.defaultDrawingAreaSize();
  1552. }
  1553. } else {
  1554. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  1555. chatTextDrawingArea.drawText(0xffff00, s, spriteDrawY, spriteDrawX);
  1556. }
  1557. }
  1558. } catch(Exception e){ }
  1559. }
  1560.  
  1561. private void delFriend(long l) {
  1562. try {
  1563. if (l == 0L)
  1564. return;
  1565. for (int i = 0; i < friendsCount; i++) {
  1566. if (friendsListAsLongs[i] != l)
  1567. continue;
  1568. friendsCount--;
  1569. needDrawTabArea = true;
  1570. for (int j = i; j < friendsCount; j++) {
  1571. friendsList[j] = friendsList[j + 1];
  1572. friendsNodeIDs[j] = friendsNodeIDs[j + 1];
  1573. friendsListAsLongs[j] = friendsListAsLongs[j + 1];
  1574. }
  1575.  
  1576. stream.createFrame(215);
  1577. stream.writeQWord(l);
  1578. break;
  1579. }
  1580. }
  1581. catch (RuntimeException runtimeexception) {
  1582. signlink.reporterror("18622, " + false + ", " + l + ", " + runtimeexception.toString());
  1583. throw new RuntimeException();
  1584. }
  1585. }
  1586.  
  1587. private void drawTabArea() {
  1588. final int xOffset = frameMode == ScreenMode.FIXED ? 0 : frameWidth - 243;
  1589. final int yOffset = frameMode == ScreenMode.FIXED ? 0 : frameHeight - 346;
  1590. if (frameMode == ScreenMode.FIXED) {
  1591. aRSImageProducer_1163.initDrawingArea();
  1592. }
  1593. Texture.anIntArray1472 = anIntArray1181;
  1594. if (frameMode == ScreenMode.FIXED) {
  1595. cacheSprite[0].drawSprite(0, 0);
  1596. } else if (frameMode != ScreenMode.FIXED){
  1597. cacheSprite[29].drawAdvancedSprite(xOffset, yOffset);
  1598. }
  1599. if(invOverlayInterfaceID == -1) {
  1600. drawRedStones();
  1601. drawSideIcons();
  1602. drawTabHover();
  1603. }
  1604. int x = frameMode == ScreenMode.FIXED ? 38 : frameWidth - 213;
  1605. int y = frameMode == ScreenMode.FIXED ? 38 : frameHeight - 296;
  1606. if(invOverlayInterfaceID != -1) {
  1607. drawInterface(0, x, RSInterface.interfaceCache[invOverlayInterfaceID], y);
  1608. } else if(tabInterfaceIDs[tabID] != -1) {
  1609. drawInterface(0, x, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], y);
  1610. }
  1611. if(menuOpen) {
  1612. drawMenu(frameMode == ScreenMode.FIXED ? 516 : 0, frameMode == ScreenMode.FIXED ? 168 : 0);
  1613. }
  1614. if (frameMode == ScreenMode.FIXED) {
  1615. aRSImageProducer_1163.drawGraphics(168, super.graphics, 516);
  1616. aRSImageProducer_1165.initDrawingArea();
  1617. }
  1618. Texture.anIntArray1472 = anIntArray1182;
  1619. }
  1620.  
  1621. private void drawTabHover() {
  1622. // Auto-generated method stub
  1623.  
  1624. }
  1625.  
  1626. public void drawRedStones() {
  1627. int xOffset = frameMode == ScreenMode.FIXED ? 0 : frameWidth - 250;
  1628. int yOffset = frameMode == ScreenMode.FIXED ? 0 : frameHeight - 336;
  1629. if(tabInterfaceIDs[tabID] != -1) {
  1630. switch(tabID) {
  1631. case 0:
  1632. cacheSprite[4].drawSprite(22 + xOffset, 0 + yOffset);
  1633. break;
  1634. case 1:
  1635. cacheSprite[5].drawSprite(54 + xOffset, 1 + yOffset);
  1636. break;
  1637. case 2:
  1638. cacheSprite[5].drawSprite(81 + xOffset, 1 + yOffset);
  1639. break;
  1640. case 3:
  1641. cacheSprite[6].drawSprite(110 + xOffset, 0 + yOffset);
  1642. break;
  1643. case 4:
  1644. cacheSprite[7].drawSprite(154 + xOffset, 1 + yOffset);
  1645. break;
  1646. case 5:
  1647. cacheSprite[7].drawSprite(180 + xOffset, 1 + yOffset);
  1648. break;
  1649. case 6:
  1650. cacheSprite[8].drawSprite(208 + xOffset, 2 + yOffset);
  1651. break;
  1652. /*case 7:
  1653. cacheSprite[9].drawSprite(9 + xOffset, 297 + yOffset);
  1654. break;*/
  1655. case 8:
  1656. cacheSprite[10].drawSprite(53 + xOffset, 297 + yOffset);
  1657. break;
  1658. case 9:
  1659. cacheSprite[10].drawSprite(81 + xOffset, 297 + yOffset);
  1660. break;
  1661. case 10:
  1662. cacheSprite[11].drawSprite(110 + xOffset, 299 + yOffset);
  1663. break;
  1664. case 11:
  1665. cacheSprite[12].drawSprite(154 + xOffset, 297 + yOffset);
  1666. break;
  1667. case 12:
  1668. cacheSprite[12].drawSprite(181 + xOffset, 297 + yOffset);
  1669. break;
  1670. case 13:
  1671. cacheSprite[13].drawSprite(209 + xOffset, 297 + yOffset);
  1672. break;
  1673. }
  1674. }
  1675. }
  1676.  
  1677.  
  1678.  
  1679. public void drawSideIcons(){
  1680. int xOffset = frameMode == ScreenMode.FIXED ? 0 : frameWidth - 250;
  1681. int yOffset = frameMode == ScreenMode.FIXED ? 0 : frameHeight - 336;
  1682. /* Top sideIcons */
  1683. if(tabInterfaceIDs[0] != -1)//attack
  1684. (is317 ? cacheSprite[14] : sideIcons[0]).drawSprite(is317 ? 32 + xOffset : 29 + xOffset, is317 ? 11 + yOffset : 6 + yOffset);
  1685. if(tabInterfaceIDs[1] != -1)//stat
  1686. (is317 ? cacheSprite[15] : sideIcons[1]).drawSprite(is317 ? 56 + xOffset : 54 + xOffset, is317 ? 7 + yOffset : 5 + yOffset);
  1687. if(tabInterfaceIDs[2] != -1)//quest
  1688. (is317 ? cacheSprite[16] : sideIcons[2]).drawSprite(is317 ? 86 + xOffset : 82 + xOffset, is317 ? 8 + yOffset : 5 + yOffset);
  1689. if(tabInterfaceIDs[3] != -1)//inventory
  1690. (is317 ? cacheSprite[17] : sideIcons[3]).drawSprite(is317 ? 116 + xOffset : 116 + xOffset, is317 ? 4 + yOffset : 3 + yOffset);
  1691. if(tabInterfaceIDs[4] != -1)//equipment
  1692. (is317 ? cacheSprite[18] : sideIcons[4]).drawSprite(is317 ? 156 + xOffset : 152 + xOffset, is317 ? 6 + yOffset : 2 + yOffset);
  1693. if(tabInterfaceIDs[5] != -1)//prayer
  1694. (is317 ? cacheSprite[19] : sideIcons[5]).drawSprite(is317 ? 184 + xOffset : 179 + xOffset, is317 ? 6 + yOffset : 3 + yOffset);
  1695. if(tabInterfaceIDs[6] != -1)//magic
  1696. (is317 ? cacheSprite[20] : sideIcons[6]).drawSprite(is317 ? 211 + xOffset : 207 + xOffset, is317 ? 9 + yOffset : 6 + yOffset);
  1697. /* Bottom sideIcons */
  1698. if(tabInterfaceIDs[8] != -1)//friends
  1699. (is317 ? cacheSprite[21] : sideIcons[8]).drawSprite(is317 ? 57 + xOffset : 57 + xOffset, is317 ? 305 + yOffset : 305 + yOffset);
  1700. if(tabInterfaceIDs[9] != -1)//ignore
  1701. (is317 ? cacheSprite[22] : sideIcons[9]).drawSprite(is317 ? 85 + xOffset : 85 + xOffset, is317 ? 305 + yOffset : 305 + yOffset);
  1702. if(tabInterfaceIDs[10] != -1)//logout
  1703. (is317 ? cacheSprite[23] : sideIcons[10]).drawSprite(is317 ? 120 + xOffset : 121 + xOffset, is317 ? 305 + yOffset : 302 + yOffset);
  1704. if(tabInterfaceIDs[11] != -1)//options
  1705. (is317 ? cacheSprite[24] : sideIcons[11]).drawSprite(is317 ? 156 + xOffset : 157 + xOffset, is317 ? 302 + yOffset : 304 + yOffset);
  1706. if(tabInterfaceIDs[12] != -1)//emotes
  1707. (is317 ? cacheSprite[25] : sideIcons[12]).drawSprite(is317 ? 188 + xOffset : 186 + xOffset, is317 ? 303 + yOffset : 301 + yOffset);
  1708. if(tabInterfaceIDs[13] != -1)//music
  1709. (is317 ? cacheSprite[26] : sideIcons[7]).drawSprite(is317 ? 212 + xOffset : 211 + xOffset, is317 ? 302 + yOffset : 301 + yOffset);
  1710. }
  1711.  
  1712. private void method37(int j) {
  1713. if (!lowMem) {
  1714. if (Texture.anIntArray1480[17] >= j) {
  1715. Background background = Texture.aBackgroundArray1474s[17];
  1716. int k = background.anInt1452 * background.anInt1453 - 1;
  1717. int j1 = background.anInt1452 * anInt945 * 2;
  1718. byte abyte0[] = background.aByteArray1450;
  1719. byte abyte3[] = aByteArray912;
  1720. for (int i2 = 0; i2 <= k; i2++)
  1721. abyte3[i2] = abyte0[i2 - j1 & k];
  1722.  
  1723. background.aByteArray1450 = abyte3;
  1724. aByteArray912 = abyte0;
  1725. Texture.method370(17);
  1726. anInt854++;
  1727. if (anInt854 > 1235) {
  1728. anInt854 = 0;
  1729. stream.createFrame(226);
  1730. stream.writeWordBigEndian(0);
  1731. int l2 = stream.currentOffset;
  1732. stream.writeWord(58722);
  1733. stream.writeWordBigEndian(240);
  1734. stream.writeWord((int) (Math.random() * 65536D));
  1735. stream.writeWordBigEndian((int) (Math.random() * 256D));
  1736. if ((int) (Math.random() * 2D) == 0)
  1737. stream.writeWord(51825);
  1738. stream.writeWordBigEndian((int) (Math.random() * 256D));
  1739. stream.writeWord((int) (Math.random() * 65536D));
  1740. stream.writeWord(7130);
  1741. stream.writeWord((int) (Math.random() * 65536D));
  1742. stream.writeWord(61657);
  1743. stream.writeBytes(stream.currentOffset - l2);
  1744. }
  1745. }
  1746. if(Texture.anIntArray1480[40] >= j)
  1747. {
  1748. Background background_2 = Texture.aBackgroundArray1474s[40];
  1749. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  1750. int l1 = background_2.anInt1452 * anInt945 * 2;
  1751. byte abyte2[] = background_2.aByteArray1450;
  1752. byte abyte5[] = aByteArray912;
  1753. for(int k2 = 0; k2 <= i1; k2++)
  1754. abyte5[k2] = abyte2[k2 - l1 & i1];
  1755. background_2.aByteArray1450 = abyte5;
  1756. aByteArray912 = abyte2;
  1757. Texture.method370(40);
  1758. }
  1759. if (Texture.anIntArray1480[24] >= j) {
  1760. Background background_1 = Texture.aBackgroundArray1474s[24];
  1761. int l = background_1.anInt1452 * background_1.anInt1453 - 1;
  1762. int k1 = background_1.anInt1452 * anInt945 * 2;
  1763. byte abyte1[] = background_1.aByteArray1450;
  1764. byte abyte4[] = aByteArray912;
  1765. for (int j2 = 0; j2 <= l; j2++)
  1766. abyte4[j2] = abyte1[j2 - k1 & l];
  1767.  
  1768. background_1.aByteArray1450 = abyte4;
  1769. aByteArray912 = abyte1;
  1770. Texture.method370(24);
  1771. }
  1772. if (Texture.anIntArray1480[34] >= j) {
  1773. Background background_2 = Texture.aBackgroundArray1474s[34];
  1774. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  1775. int l1 = background_2.anInt1452 * anInt945 * 2;
  1776. byte abyte2[] = background_2.aByteArray1450;
  1777. byte abyte5[] = aByteArray912;
  1778. for (int k2 = 0; k2 <= i1; k2++)
  1779. abyte5[k2] = abyte2[k2 - l1 & i1];
  1780.  
  1781. background_2.aByteArray1450 = abyte5;
  1782. aByteArray912 = abyte2;
  1783. Texture.method370(34);
  1784. }
  1785. }
  1786. }
  1787.  
  1788. private void method38() {
  1789. for (int i = -1; i < playerCount; i++) {
  1790. int j;
  1791. if (i == -1)
  1792. j = myPlayerIndex;
  1793. else
  1794. j = playerIndices[i];
  1795. Player player = playerArray[j];
  1796. if (player != null && player.textCycle > 0) {
  1797. player.textCycle--;
  1798. if (player.textCycle == 0)
  1799. player.textSpoken = null;
  1800. }
  1801. }
  1802.  
  1803. for (int k = 0; k < npcCount; k++) {
  1804. int l = npcIndices[k];
  1805. NPC npc = npcArray[l];
  1806. if (npc != null && npc.textCycle > 0) {
  1807. npc.textCycle--;
  1808. if (npc.textCycle == 0)
  1809. npc.textSpoken = null;
  1810. }
  1811. }
  1812.  
  1813. }
  1814.  
  1815. private void calcCameraPos() {
  1816. int i = anInt1098 * 128 + 64;
  1817. int j = anInt1099 * 128 + 64;
  1818. int k = method42(plane, j, i) - anInt1100;
  1819. if (xCameraPos < i) {
  1820. xCameraPos += anInt1101 + ((i - xCameraPos) * anInt1102) / 1000;
  1821. if (xCameraPos > i)
  1822. xCameraPos = i;
  1823. }
  1824. if (xCameraPos > i) {
  1825. xCameraPos -= anInt1101 + ((xCameraPos - i) * anInt1102) / 1000;
  1826. if (xCameraPos < i)
  1827. xCameraPos = i;
  1828. }
  1829. if (zCameraPos < k) {
  1830. zCameraPos += anInt1101 + ((k - zCameraPos) * anInt1102) / 1000;
  1831. if (zCameraPos > k)
  1832. zCameraPos = k;
  1833. }
  1834. if (zCameraPos > k) {
  1835. zCameraPos -= anInt1101 + ((zCameraPos - k) * anInt1102) / 1000;
  1836. if (zCameraPos < k)
  1837. zCameraPos = k;
  1838. }
  1839. if (yCameraPos < j) {
  1840. yCameraPos += anInt1101 + ((j - yCameraPos) * anInt1102) / 1000;
  1841. if (yCameraPos > j)
  1842. yCameraPos = j;
  1843. }
  1844. if (yCameraPos > j) {
  1845. yCameraPos -= anInt1101 + ((yCameraPos - j) * anInt1102) / 1000;
  1846. if (yCameraPos < j)
  1847. yCameraPos = j;
  1848. }
  1849. i = anInt995 * 128 + 64;
  1850. j = anInt996 * 128 + 64;
  1851. k = method42(plane, j, i) - anInt997;
  1852. int l = i - xCameraPos;
  1853. int i1 = k - zCameraPos;
  1854. int j1 = j - yCameraPos;
  1855. int k1 = (int) Math.sqrt(l * l + j1 * j1);
  1856. int l1 = (int) (Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  1857. int i2 = (int) (Math.atan2(l, j1) * -325.94900000000001D) & 0x7ff;
  1858. if (l1 < 128)
  1859. l1 = 128;
  1860. if (l1 > 383)
  1861. l1 = 383;
  1862. if (yCameraCurve < l1) {
  1863. yCameraCurve += anInt998 + ((l1 - yCameraCurve) * anInt999) / 1000;
  1864. if (yCameraCurve > l1)
  1865. yCameraCurve = l1;
  1866. }
  1867. if (yCameraCurve > l1) {
  1868. yCameraCurve -= anInt998 + ((yCameraCurve - l1) * anInt999) / 1000;
  1869. if (yCameraCurve < l1)
  1870. yCameraCurve = l1;
  1871. }
  1872. int j2 = i2 - xCameraCurve;
  1873. if (j2 > 1024)
  1874. j2 -= 2048;
  1875. if (j2 < -1024)
  1876. j2 += 2048;
  1877. if (j2 > 0) {
  1878. xCameraCurve += anInt998 + (j2 * anInt999) / 1000;
  1879. xCameraCurve &= 0x7ff;
  1880. }
  1881. if (j2 < 0) {
  1882. xCameraCurve -= anInt998 + (-j2 * anInt999) / 1000;
  1883. xCameraCurve &= 0x7ff;
  1884. }
  1885. int k2 = i2 - xCameraCurve;
  1886. if (k2 > 1024)
  1887. k2 -= 2048;
  1888. if (k2 < -1024)
  1889. k2 += 2048;
  1890. if (k2 < 0 && j2 > 0 || k2 > 0 && j2 < 0)
  1891. xCameraCurve = i2;
  1892. }
  1893.  
  1894. public void drawMenu(int xOffSet, int yOffSet) {
  1895. int xPos = menuOffsetX - (xOffSet - 4);
  1896. int yPos = (-yOffSet + 4) + menuOffsetY;
  1897. int menuW = menuWidth;
  1898. int menuH = menuHeight + 1;
  1899. inputTaken = true;
  1900. tabAreaAltered = true;
  1901. int i1 = 0x5d5447;
  1902. DrawingArea.drawPixels(menuH, yPos, xPos, i1, menuW);
  1903. DrawingArea.drawPixels(16, yPos + 1, xPos + 1, 0, menuW - 2);
  1904. DrawingArea.fillPixels(xPos + 1, menuW - 2, menuH - 19, 0, yPos + 18);
  1905. chatTextDrawingArea.method385(i1, "Choose Option", yPos + 14, xPos + 3);
  1906. int mouseX = super.mouseX - (xOffSet);
  1907. int mouseY = (-yOffSet) + super.mouseY;
  1908. for (int l1 = 0; l1 < menuActionRow; l1++) {
  1909. int textY = yPos + 31 + (menuActionRow - 1 - l1) * 15;
  1910. int disColor = 0xffffff;
  1911. if (mouseX > xPos && mouseX < xPos + menuW && mouseY > textY - 13 && mouseY < textY + 3) {
  1912. DrawingArea.drawPixels(15, textY - 11, xPos + 3, 0x6f695d, menuWidth - 6);
  1913. disColor = 0xffff00;
  1914. }
  1915. chatTextDrawingArea.method389(true, xPos + 3, disColor, menuActionName[l1], textY);
  1916. }
  1917. }
  1918.  
  1919. private void addFriend(long l) {
  1920. try {
  1921. if (l == 0L)
  1922. return;
  1923. if (friendsCount >= 100 && anInt1046 != 1) {
  1924. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  1925. return;
  1926. }
  1927. if (friendsCount >= 200) {
  1928. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  1929. return;
  1930. }
  1931. String s = TextClass.fixName(TextClass.nameForLong(l));
  1932. for (int i = 0; i < friendsCount; i++)
  1933. if (friendsListAsLongs[i] == l) {
  1934. pushMessage(s + " is already on your friend list", 0, "");
  1935. return;
  1936. }
  1937. for (int j = 0; j < ignoreCount; j++)
  1938. if (ignoreListAsLongs[j] == l) {
  1939. pushMessage("Please remove " + s + " from your ignore list first", 0, "");
  1940. return;
  1941. }
  1942.  
  1943. if (s.equals(myPlayer.name)) {
  1944. return;
  1945. } else {
  1946. friendsList[friendsCount] = s;
  1947. friendsListAsLongs[friendsCount] = l;
  1948. friendsNodeIDs[friendsCount] = 0;
  1949. friendsCount++;
  1950. needDrawTabArea = true;
  1951. stream.createFrame(188);
  1952. stream.writeQWord(l);
  1953. return;
  1954. }
  1955. }
  1956. catch (RuntimeException runtimeexception) {
  1957. signlink.reporterror("15283, " + (byte) 68 + ", " + l + ", " + runtimeexception.toString());
  1958. }
  1959. throw new RuntimeException();
  1960. }
  1961.  
  1962. private int method42(int i, int j, int k) {
  1963. int l = k >> 7;
  1964. int i1 = j >> 7;
  1965. if (l < 0 || i1 < 0 || l > 103 || i1 > 103)
  1966. return 0;
  1967. int j1 = i;
  1968. if (j1 < 3 && (byteGroundArray[1][l][i1] & 2) == 2)
  1969. j1++;
  1970. int k1 = k & 0x7f;
  1971. int l1 = j & 0x7f;
  1972. int i2 = intGroundArray[j1][l][i1] * (128 - k1) + intGroundArray[j1][l + 1][i1] * k1 >> 7;
  1973. int j2 = intGroundArray[j1][l][i1 + 1] * (128 - k1) + intGroundArray[j1][l + 1][i1 + 1] * k1 >> 7;
  1974. return i2 * (128 - l1) + j2 * l1 >> 7;
  1975. }
  1976.  
  1977. private static String intToKOrMil(int j) {
  1978. if (j < 0x186a0)
  1979. return String.valueOf(j);
  1980. if (j < 0x989680)
  1981. return j / 1000 + "K";
  1982. else
  1983. return j / 0xf4240 + "M";
  1984. }
  1985.  
  1986. private void resetLogout() {
  1987. try {
  1988. if (socketStream != null)
  1989. socketStream.close();
  1990. }
  1991. catch (Exception _ex) {
  1992. }
  1993. socketStream = null;
  1994. loggedIn = false;
  1995. loginScreenState = 0;
  1996. unlinkMRUNodes();
  1997. worldController.initToNull();
  1998. for (int i = 0; i < 4; i++)
  1999. aClass11Array1230[i].method210();
  2000.  
  2001. System.gc();
  2002. stopMidi();
  2003. currentSong = -1;
  2004. nextSong = -1;
  2005. prevSong = 0;
  2006. playSong(0);
  2007. frameMode(ScreenMode.FIXED);
  2008. }
  2009.  
  2010. private void method45() {
  2011. aBoolean1031 = true;
  2012. for (int j = 0; j < 7; j++) {
  2013. anIntArray1065[j] = -1;
  2014. for (int k = 0; k < IDK.length; k++) {
  2015. if (IDK.cache[k].aBoolean662 || IDK.cache[k].anInt657 != j + (aBoolean1047 ? 0 : 7))
  2016. continue;
  2017. anIntArray1065[j] = k;
  2018. break;
  2019. }
  2020.  
  2021. }
  2022.  
  2023. }
  2024.  
  2025.  
  2026. private void method46(int i, Stream stream) {
  2027. while (stream.bitPosition + 21 < i * 8) {
  2028. int k = stream.readBits(14);
  2029. if (k == 16383)
  2030. break;
  2031. if (npcArray[k] == null)
  2032. npcArray[k] = new NPC();
  2033. NPC npc = npcArray[k];
  2034. npcIndices[npcCount++] = k;
  2035. npc.anInt1537 = loopCycle;
  2036. int l = stream.readBits(5);
  2037. if (l > 15)
  2038. l -= 32;
  2039. int i1 = stream.readBits(5);
  2040. if (i1 > 15)
  2041. i1 -= 32;
  2042. int j1 = stream.readBits(1);
  2043. npc.desc = EntityDef.forID(stream.readBits(Settings.npcBits));
  2044. int k1 = stream.readBits(1);
  2045. if (k1 == 1)
  2046. anIntArray894[anInt893++] = k;
  2047. npc.anInt1540 = npc.desc.aByte68;
  2048. npc.anInt1504 = npc.desc.anInt79;
  2049. npc.anInt1554 = npc.desc.walkAnim;
  2050. npc.anInt1555 = npc.desc.walkBackAnim;
  2051. npc.anInt1556 = npc.desc.walkLeftAnim;
  2052. npc.anInt1557 = npc.desc.walkRightAnim;
  2053. npc.anInt1511 = npc.desc.standAnim;
  2054. npc.setPos(myPlayer.smallX[0] + i1, myPlayer.smallY[0] + l, j1 == 1);
  2055. }
  2056. stream.finishBitAccess();
  2057. }
  2058.  
  2059. public void processGameLoop() {
  2060. if (rsAlreadyLoaded || loadingError || genericLoadingError)
  2061. return;
  2062. loopCycle++;
  2063. if (!loggedIn)
  2064. processLoginScreenInput();
  2065. else
  2066. mainGameProcessor();
  2067. processOnDemandQueue();
  2068. }
  2069.  
  2070. private void method47(boolean flag) {
  2071. if (myPlayer.x >> 7 == destX && myPlayer.y >> 7 == destY)
  2072. destX = 0;
  2073. int j = playerCount;
  2074. if (flag)
  2075. j = 1;
  2076. for (int l = 0; l < j; l++) {
  2077. Player player;
  2078. int i1;
  2079. if (flag) {
  2080. player = myPlayer;
  2081. i1 = myPlayerIndex << 14;
  2082. } else {
  2083. player = playerArray[playerIndices[l]];
  2084. i1 = playerIndices[l] << 14;
  2085. }
  2086. if (player == null || !player.isVisible())
  2087. continue;
  2088. player.aBoolean1699 = (lowMem && playerCount > 50 || playerCount > 200) && !flag && player.anInt1517 == player.anInt1511;
  2089. int j1 = player.x >> 7;
  2090. int k1 = player.y >> 7;
  2091. if (j1 < 0 || j1 >= 104 || k1 < 0 || k1 >= 104)
  2092. continue;
  2093. if (player.aModel_1714 != null && loopCycle >= player.anInt1707 && loopCycle < player.anInt1708) {
  2094. player.aBoolean1699 = false;
  2095. player.anInt1709 = method42(plane, player.y, player.x);
  2096. worldController.method286(plane, player.y, player, player.anInt1552, player.anInt1722, player.x, player.anInt1709, player.anInt1719, player.anInt1721, i1, player.anInt1720);
  2097. continue;
  2098. }
  2099. if ((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  2100. if (anIntArrayArray929[j1][k1] == anInt1265)
  2101. continue;
  2102. anIntArrayArray929[j1][k1] = anInt1265;
  2103. }
  2104. player.anInt1709 = method42(plane, player.y, player.x);
  2105. worldController.method285(plane, player.anInt1552, player.anInt1709, i1, player.y, 60, player.x, player, player.aBoolean1541);
  2106. }
  2107.  
  2108. }
  2109.  
  2110. private boolean promptUserForInput(RSInterface class9) {
  2111. int j = class9.contentType;
  2112. if (anInt900 == 2) {
  2113. if (j == 201) {
  2114. inputTaken = true;
  2115. inputDialogState = 0;
  2116. messagePromptRaised = true;
  2117. promptInput = "";
  2118. friendsListAction = 1;
  2119. aString1121 = "Enter name of friend to add to list";
  2120. }
  2121. if (j == 202) {
  2122. inputTaken = true;
  2123. inputDialogState = 0;
  2124. messagePromptRaised = true;
  2125. promptInput = "";
  2126. friendsListAction = 2;
  2127. aString1121 = "Enter name of friend to delete from list";
  2128. }
  2129. }
  2130. if (j == 205) {
  2131. anInt1011 = 250;
  2132. return true;
  2133. }
  2134. if (j == 501) {
  2135. inputTaken = true;
  2136. inputDialogState = 0;
  2137. messagePromptRaised = true;
  2138. promptInput = "";
  2139. friendsListAction = 4;
  2140. aString1121 = "Enter name of player to add to list";
  2141. }
  2142. if (j == 502) {
  2143. inputTaken = true;
  2144. inputDialogState = 0;
  2145. messagePromptRaised = true;
  2146. promptInput = "";
  2147. friendsListAction = 5;
  2148. aString1121 = "Enter name of player to delete from list";
  2149. }
  2150. if (j >= 300 && j <= 313) {
  2151. int k = (j - 300) / 2;
  2152. int j1 = j & 1;
  2153. int i2 = anIntArray1065[k];
  2154. if (i2 != -1) {
  2155. do {
  2156. if (j1 == 0 && --i2 < 0)
  2157. i2 = IDK.length - 1;
  2158. if (j1 == 1 && ++i2 >= IDK.length)
  2159. i2 = 0;
  2160. } while (IDK.cache[i2].aBoolean662 || IDK.cache[i2].anInt657 != k + (aBoolean1047 ? 0 : 7));
  2161. anIntArray1065[k] = i2;
  2162. aBoolean1031 = true;
  2163. }
  2164. }
  2165. if (j >= 314 && j <= 323) {
  2166. int l = (j - 314) / 2;
  2167. int k1 = j & 1;
  2168. int j2 = anIntArray990[l];
  2169. if (k1 == 0 && --j2 < 0)
  2170. j2 = anIntArrayArray1003[l].length - 1;
  2171. if (k1 == 1 && ++j2 >= anIntArrayArray1003[l].length)
  2172. j2 = 0;
  2173. anIntArray990[l] = j2;
  2174. aBoolean1031 = true;
  2175. }
  2176. if (j == 324 && !aBoolean1047) {
  2177. aBoolean1047 = true;
  2178. method45();
  2179. }
  2180. if (j == 325 && aBoolean1047) {
  2181. aBoolean1047 = false;
  2182. method45();
  2183. }
  2184. if (j == 326) {
  2185. stream.createFrame(101);
  2186. stream.writeWordBigEndian(aBoolean1047 ? 0 : 1);
  2187. for (int i1 = 0; i1 < 7; i1++)
  2188. stream.writeWordBigEndian(anIntArray1065[i1]);
  2189.  
  2190. for (int l1 = 0; l1 < 5; l1++)
  2191. stream.writeWordBigEndian(anIntArray990[l1]);
  2192.  
  2193. return true;
  2194. }
  2195. if (j == 613)
  2196. canMute = !canMute;
  2197. if (j >= 601 && j <= 612) {
  2198. clearTopInterfaces();
  2199. if (reportAbuseInput.length() > 0) {
  2200. stream.createFrame(218);
  2201. stream.writeQWord(TextClass.longForName(reportAbuseInput));
  2202. stream.writeWordBigEndian(j - 601);
  2203. stream.writeWordBigEndian(canMute ? 1 : 0);
  2204. }
  2205. }
  2206. return false;
  2207. }
  2208.  
  2209. private boolean rollingCharacter = false;
  2210.  
  2211. private void method49(Stream stream) {
  2212. for (int j = 0; j < anInt893; j++) {
  2213. int k = anIntArray894[j];
  2214. Player player = playerArray[k];
  2215. int l = stream.readUnsignedByte();
  2216. if ((l & 0x40) != 0)
  2217. l += stream.readUnsignedByte() << 8;
  2218. method107(l, k, stream, player);
  2219. }
  2220.  
  2221. }
  2222.  
  2223. private void method50(int i, int k, int l, int i1, int j1) {
  2224. int k1 = worldController.method300(j1, l, i);
  2225. if (k1 != 0) {
  2226. int l1 = worldController.method304(j1, l, i, k1);
  2227. int k2 = l1 >> 6 & 3;
  2228. int i3 = l1 & 0x1f;
  2229. int k3 = k;
  2230. if (k1 > 0)
  2231. k3 = i1;
  2232. int ai[] = minimapImage.myPixels;
  2233. int k4 = 24624 + l * 4 + (103 - i) * 512 * 4;
  2234. int i5 = k1 >> 14 & 0x7fff;
  2235. ObjectDef class46_2 = ObjectDef.forID(i5);
  2236. if (class46_2.anInt758 != -1) {
  2237. Background background_2 = mapScenes[class46_2.anInt758];
  2238. if (background_2 != null) {
  2239. int i6 = (class46_2.anInt744 * 4 - background_2.anInt1452) / 2;
  2240. int j6 = (class46_2.anInt761 * 4 - background_2.anInt1453) / 2;
  2241. background_2.method361(48 + l * 4 + i6, 48 + (104 - i - class46_2.anInt761) * 4 + j6);
  2242. }
  2243. } else {
  2244. if (i3 == 0 || i3 == 2)
  2245. if (k2 == 0) {
  2246. ai[k4] = k3;
  2247. ai[k4 + 512] = k3;
  2248. ai[k4 + 1024] = k3;
  2249. ai[k4 + 1536] = k3;
  2250. } else if (k2 == 1) {
  2251. ai[k4] = k3;
  2252. ai[k4 + 1] = k3;
  2253. ai[k4 + 2] = k3;
  2254. ai[k4 + 3] = k3;
  2255. } else if (k2 == 2) {
  2256. ai[k4 + 3] = k3;
  2257. ai[k4 + 3 + 512] = k3;
  2258. ai[k4 + 3 + 1024] = k3;
  2259. ai[k4 + 3 + 1536] = k3;
  2260. } else if (k2 == 3) {
  2261. ai[k4 + 1536] = k3;
  2262. ai[k4 + 1536 + 1] = k3;
  2263. ai[k4 + 1536 + 2] = k3;
  2264. ai[k4 + 1536 + 3] = k3;
  2265. }
  2266. if (i3 == 3)
  2267. if (k2 == 0)
  2268. ai[k4] = k3;
  2269. else if (k2 == 1)
  2270. ai[k4 + 3] = k3;
  2271. else if (k2 == 2)
  2272. ai[k4 + 3 + 1536] = k3;
  2273. else if (k2 == 3)
  2274. ai[k4 + 1536] = k3;
  2275. if (i3 == 2)
  2276. if (k2 == 3) {
  2277. ai[k4] = k3;
  2278. ai[k4 + 512] = k3;
  2279. ai[k4 + 1024] = k3;
  2280. ai[k4 + 1536] = k3;
  2281. } else if (k2 == 0) {
  2282. ai[k4] = k3;
  2283. ai[k4 + 1] = k3;
  2284. ai[k4 + 2] = k3;
  2285. ai[k4 + 3] = k3;
  2286. } else if (k2 == 1) {
  2287. ai[k4 + 3] = k3;
  2288. ai[k4 + 3 + 512] = k3;
  2289. ai[k4 + 3 + 1024] = k3;
  2290. ai[k4 + 3 + 1536] = k3;
  2291. } else if (k2 == 2) {
  2292. ai[k4 + 1536] = k3;
  2293. ai[k4 + 1536 + 1] = k3;
  2294. ai[k4 + 1536 + 2] = k3;
  2295. ai[k4 + 1536 + 3] = k3;
  2296. }
  2297. }
  2298. }
  2299. k1 = worldController.method302(j1, l, i);
  2300. if (k1 != 0) {
  2301. int i2 = worldController.method304(j1, l, i, k1);
  2302. int l2 = i2 >> 6 & 3;
  2303. int j3 = i2 & 0x1f;
  2304. int l3 = k1 >> 14 & 0x7fff;
  2305. ObjectDef class46_1 = ObjectDef.forID(l3);
  2306. if (class46_1.anInt758 != -1) {
  2307. Background background_1 = mapScenes[class46_1.anInt758];
  2308. if (background_1 != null) {
  2309. int j5 = (class46_1.anInt744 * 4 - background_1.anInt1452) / 2;
  2310. int k5 = (class46_1.anInt761 * 4 - background_1.anInt1453) / 2;
  2311. background_1.method361(48 + l * 4 + j5, 48 + (104 - i - class46_1.anInt761) * 4 + k5);
  2312. }
  2313. } else if (j3 == 9) {
  2314. int l4 = 0xeeeeee;
  2315. if (k1 > 0)
  2316. l4 = 0xee0000;
  2317. int ai1[] = minimapImage.myPixels;
  2318. int l5 = 24624 + l * 4 + (103 - i) * 512 * 4;
  2319. if (l2 == 0 || l2 == 2) {
  2320. ai1[l5 + 1536] = l4;
  2321. ai1[l5 + 1024 + 1] = l4;
  2322. ai1[l5 + 512 + 2] = l4;
  2323. ai1[l5 + 3] = l4;
  2324. } else {
  2325. ai1[l5] = l4;
  2326. ai1[l5 + 512 + 1] = l4;
  2327. ai1[l5 + 1024 + 2] = l4;
  2328. ai1[l5 + 1536 + 3] = l4;
  2329. }
  2330. }
  2331. }
  2332. k1 = worldController.method303(j1, l, i);
  2333. if (k1 != 0) {
  2334. int j2 = k1 >> 14 & 0x7fff;
  2335. ObjectDef class46 = ObjectDef.forID(j2);
  2336. if (class46.anInt758 != -1) {
  2337. Background background = mapScenes[class46.anInt758];
  2338. if (background != null) {
  2339. int i4 = (class46.anInt744 * 4 - background.anInt1452) / 2;
  2340. int j4 = (class46.anInt761 * 4 - background.anInt1453) / 2;
  2341. background.method361(48 + l * 4 + i4, 48 + (104 - i - class46.anInt761) * 4 + j4);
  2342. }
  2343. }
  2344. }
  2345. }
  2346.  
  2347. private void loadTitleScreen() {
  2348. aBackground_966 = new Background(titleStreamLoader, "titlebox", 0);
  2349. aBackground_967 = new Background(titleStreamLoader, "titlebutton", 0);
  2350. aBackgroundArray1152s = new Background[12];
  2351. int j = 0;
  2352. try {
  2353. j = Integer.parseInt(getParameter("fl_icon"));
  2354. }
  2355. catch (Exception _ex) {
  2356. }
  2357. if (j == 0) {
  2358. for (int k = 0; k < 12; k++)
  2359. aBackgroundArray1152s[k] = new Background(titleStreamLoader, "runes", k);
  2360.  
  2361. } else {
  2362. for (int l = 0; l < 12; l++)
  2363. aBackgroundArray1152s[l] = new Background(titleStreamLoader, "runes", 12 + (l & 3));
  2364.  
  2365. }
  2366. aClass30_Sub2_Sub1_Sub1_1201 = new Sprite(128, 265);
  2367. aClass30_Sub2_Sub1_Sub1_1202 = new Sprite(128, 265);
  2368. System.arraycopy(aRSImageProducer_1110.canvasRaster, 0, aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, 33920);
  2369.  
  2370. System.arraycopy(aRSImageProducer_1111.canvasRaster, 0, aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, 33920);
  2371.  
  2372. anIntArray851 = new int[256];
  2373. for (int k1 = 0; k1 < 64; k1++)
  2374. anIntArray851[k1] = k1 * 0x40000;
  2375.  
  2376. for (int l1 = 0; l1 < 64; l1++)
  2377. anIntArray851[l1 + 64] = 0xff0000 + 1024 * l1;
  2378.  
  2379. for (int i2 = 0; i2 < 64; i2++)
  2380. anIntArray851[i2 + 128] = 0xffff00 + 4 * i2;
  2381.  
  2382. for (int j2 = 0; j2 < 64; j2++)
  2383. anIntArray851[j2 + 192] = 0xffffff;
  2384.  
  2385. anIntArray852 = new int[256];
  2386. for (int k2 = 0; k2 < 64; k2++)
  2387. anIntArray852[k2] = k2 * 1024;
  2388.  
  2389. for (int l2 = 0; l2 < 64; l2++)
  2390. anIntArray852[l2 + 64] = 65280 + 4 * l2;
  2391.  
  2392. for (int i3 = 0; i3 < 64; i3++)
  2393. anIntArray852[i3 + 128] = 65535 + 0x40000 * i3;
  2394.  
  2395. for (int j3 = 0; j3 < 64; j3++)
  2396. anIntArray852[j3 + 192] = 0xffffff;
  2397.  
  2398. anIntArray853 = new int[256];
  2399. for (int k3 = 0; k3 < 64; k3++)
  2400. anIntArray853[k3] = k3 * 4;
  2401.  
  2402. for (int l3 = 0; l3 < 64; l3++)
  2403. anIntArray853[l3 + 64] = 255 + 0x40000 * l3;
  2404.  
  2405. for (int i4 = 0; i4 < 64; i4++)
  2406. anIntArray853[i4 + 128] = 0xff00ff + 1024 * i4;
  2407.  
  2408. for (int j4 = 0; j4 < 64; j4++)
  2409. anIntArray853[j4 + 192] = 0xffffff;
  2410.  
  2411. anIntArray850 = new int[256];
  2412. anIntArray1190 = new int[32768];
  2413. anIntArray1191 = new int[32768];
  2414. randomizeBackground(null);
  2415. anIntArray828 = new int[32768];
  2416. anIntArray829 = new int[32768];
  2417. drawSmoothLoading(10, "Connecting to fileserver");
  2418. if (!aBoolean831) {
  2419. drawFlames = true;
  2420. aBoolean831 = true;
  2421. startRunnable(this, 2);
  2422. }
  2423. }
  2424.  
  2425. private static void setHighMem() {
  2426. WorldController.lowMem = false;
  2427. Texture.lowMem = false;
  2428. lowMem = false;
  2429. ObjectManager.lowMem = false;
  2430. ObjectDef.lowMem = false;
  2431. }
  2432.  
  2433.  
  2434. public static void main(String args[]) {
  2435. try {
  2436. System.out.println("RS2 user client - release #" + 317);
  2437. nodeID = 10;
  2438. portOff = 0;
  2439. setHighMem();
  2440. isMembers = true;
  2441. signlink.storeid = 32;
  2442. signlink.startpriv(InetAddress.getLocalHost());
  2443. frameMode(ScreenMode.FIXED);
  2444. instance = new Client();
  2445. instance.createClientFrame(frameWidth, frameHeight);
  2446. } catch (Exception e) {
  2447. e.printStackTrace();
  2448. }
  2449. }
  2450.  
  2451. private void drawLoadingMessages(int used, String s, String s1) {
  2452. int width = regularText.getTextWidth(used == 1 ? s : s1);
  2453. int height = s1 == null ? 25 : 38;
  2454. DrawingArea.drawPixels(height, 1, 1, 0, width + 6);
  2455. DrawingArea.drawPixels(1, 1, 1, 0xffffff, width + 6);
  2456. DrawingArea.drawPixels(height, 1, 1, 0xffffff, 1);
  2457. DrawingArea.drawPixels(1, height, 1, 0xffffff, width + 6);
  2458. DrawingArea.drawPixels(height, 1, width + 6, 0xffffff, 1);
  2459. regularText.drawText(0xffffff, s, 18, width / 2 + 5);
  2460. if (s1 != null) {
  2461. regularText.drawText(0xffffff, s1, 31, width / 2 + 5);
  2462. }
  2463. }
  2464.  
  2465. private void loadingStages() {
  2466. if (lowMem && loadingStage == 2 && ObjectManager.anInt131 != plane) {
  2467. aRSImageProducer_1165.initDrawingArea();
  2468. drawLoadingMessages(1, "Loading - please wait.", null);
  2469. aRSImageProducer_1165.drawGraphics(frameMode == ScreenMode.FIXED ? 4 : 0, super.graphics, frameMode == ScreenMode.FIXED ? 4 : 0);
  2470. loadingStage = 1;
  2471. aLong824 = System.currentTimeMillis();
  2472. }
  2473. if (loadingStage == 1) {
  2474. int j = method54();
  2475. if (j != 0 && System.currentTimeMillis() - aLong824 > 0x57e40L) {
  2476. signlink.reporterror(myUsername + " glcfb " + aLong1215 + "," + j + "," + lowMem + "," + decompressors[0] + "," + onDemandFetcher.getNodeCount() + "," + plane + "," + anInt1069 + "," + anInt1070);
  2477. aLong824 = System.currentTimeMillis();
  2478. }
  2479. }
  2480. if (loadingStage == 2 && plane != anInt985) {
  2481. anInt985 = plane;
  2482. method24(plane);
  2483. }
  2484. }
  2485.  
  2486. private int method54() {
  2487. for (int i = 0; i < aByteArrayArray1183.length; i++) {
  2488. if (aByteArrayArray1183[i] == null && anIntArray1235[i] != -1)
  2489. return -1;
  2490. if (aByteArrayArray1247[i] == null && anIntArray1236[i] != -1)
  2491. return -2;
  2492. }
  2493.  
  2494. boolean flag = true;
  2495. for (int j = 0; j < aByteArrayArray1183.length; j++) {
  2496. byte abyte0[] = aByteArrayArray1247[j];
  2497. if (abyte0 != null) {
  2498. int k = (anIntArray1234[j] >> 8) * 64 - baseX;
  2499. int l = (anIntArray1234[j] & 0xff) * 64 - baseY;
  2500. if (aBoolean1159) {
  2501. k = 10;
  2502. l = 10;
  2503. }
  2504. flag &= ObjectManager.method189(k, abyte0, l);
  2505. }
  2506. }
  2507.  
  2508. if (!flag)
  2509. return -3;
  2510. if (aBoolean1080) {
  2511. return -4;
  2512. } else {
  2513. loadingStage = 2;
  2514. ObjectManager.anInt131 = plane;
  2515. method22();
  2516. stream.createFrame(121);
  2517. return 0;
  2518. }
  2519. }
  2520.  
  2521. private void method55() {
  2522. 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())
  2523. if (class30_sub2_sub4_sub4.anInt1597 != plane || loopCycle > class30_sub2_sub4_sub4.anInt1572)
  2524. class30_sub2_sub4_sub4.unlink();
  2525. else if (loopCycle >= class30_sub2_sub4_sub4.anInt1571) {
  2526. if (class30_sub2_sub4_sub4.anInt1590 > 0) {
  2527. NPC npc = npcArray[class30_sub2_sub4_sub4.anInt1590 - 1];
  2528. if (npc != null && npc.x >= 0 && npc.x < 13312 && npc.y >= 0 && npc.y < 13312)
  2529. 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);
  2530. }
  2531. if (class30_sub2_sub4_sub4.anInt1590 < 0) {
  2532. int j = -class30_sub2_sub4_sub4.anInt1590 - 1;
  2533. Player player;
  2534. if (j == unknownInt10)
  2535. player = myPlayer;
  2536. else
  2537. player = playerArray[j];
  2538. if (player != null && player.x >= 0 && player.x < 13312 && player.y >= 0 && player.y < 13312)
  2539. 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);
  2540. }
  2541. class30_sub2_sub4_sub4.method456(anInt945);
  2542. 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);
  2543. }
  2544.  
  2545. }
  2546.  
  2547. public AppletContext getAppletContext() {
  2548. if (signlink.mainapp != null)
  2549. return signlink.mainapp.getAppletContext();
  2550. else
  2551. return super.getAppletContext();
  2552. }
  2553.  
  2554. private void drawLogo() {
  2555. byte abyte0[] = titleStreamLoader.getDataForName("title.dat");
  2556. Sprite sprite = new Sprite(abyte0, this);
  2557. aRSImageProducer_1110.initDrawingArea();
  2558. sprite.method346(0, 0);
  2559. aRSImageProducer_1111.initDrawingArea();
  2560. sprite.method346(-637, 0);
  2561. aRSImageProducer_1107.initDrawingArea();
  2562. sprite.method346(-128, 0);
  2563. aRSImageProducer_1108.initDrawingArea();
  2564. sprite.method346(-202, -371);
  2565. aRSImageProducer_1109.initDrawingArea();
  2566. sprite.method346(-202, -171);
  2567. aRSImageProducer_1112.initDrawingArea();
  2568. sprite.method346(0, -265);
  2569. aRSImageProducer_1113.initDrawingArea();
  2570. sprite.method346(-562, -265);
  2571. aRSImageProducer_1114.initDrawingArea();
  2572. sprite.method346(-128, -171);
  2573. aRSImageProducer_1115.initDrawingArea();
  2574. sprite.method346(-562, -171);
  2575. int ai[] = new int[sprite.myWidth];
  2576. for (int j = 0; j < sprite.myHeight; j++) {
  2577. for (int k = 0; k < sprite.myWidth; k++)
  2578. ai[k] = sprite.myPixels[(sprite.myWidth - k - 1) + sprite.myWidth * j];
  2579.  
  2580. System.arraycopy(ai, 0, sprite.myPixels, sprite.myWidth * j, sprite.myWidth);
  2581.  
  2582. }
  2583.  
  2584. aRSImageProducer_1110.initDrawingArea();
  2585. sprite.method346(382, 0);
  2586. aRSImageProducer_1111.initDrawingArea();
  2587. sprite.method346(-255, 0);
  2588. aRSImageProducer_1107.initDrawingArea();
  2589. sprite.method346(254, 0);
  2590. aRSImageProducer_1108.initDrawingArea();
  2591. sprite.method346(180, -371);
  2592. aRSImageProducer_1109.initDrawingArea();
  2593. sprite.method346(180, -171);
  2594. aRSImageProducer_1112.initDrawingArea();
  2595. sprite.method346(382, -265);
  2596. aRSImageProducer_1113.initDrawingArea();
  2597. sprite.method346(-180, -265);
  2598. aRSImageProducer_1114.initDrawingArea();
  2599. sprite.method346(254, -171);
  2600. aRSImageProducer_1115.initDrawingArea();
  2601. sprite.method346(-180, -171);
  2602. aRSImageProducer_1107.initDrawingArea();
  2603. sprite = null;
  2604. Object obj = null;
  2605. Object obj1 = null;
  2606. System.gc();
  2607.  
  2608. }
  2609.  
  2610.  
  2611. public void playSound(int id, int type, int delay, int volume) {
  2612. sound[currentSound] = id;
  2613. soundType[currentSound] = type;
  2614. soundDelay[currentSound] = delay + Sounds.anIntArray326[id];
  2615. soundVolume[currentSound] = volume;
  2616. currentSound++;
  2617. }
  2618.  
  2619. private void processOnDemandQueue() {
  2620. do {
  2621. OnDemandData onDemandData;
  2622. do {
  2623. onDemandData = onDemandFetcher.getNextNode();
  2624. if (onDemandData == null)
  2625. return;
  2626. if (onDemandData.dataType == 0) {
  2627. Model.method460(onDemandData.buffer, onDemandData.ID);
  2628. if ((onDemandFetcher.getModelIndex(onDemandData.ID) & 0x62) != 0) {
  2629. needDrawTabArea = true;
  2630. if (backDialogID != -1)
  2631. inputTaken = true;
  2632. }
  2633. }
  2634. if (onDemandData.dataType == 1) {
  2635. FrameReader.load(onDemandData.buffer, onDemandData.ID);
  2636. }
  2637. if (onDemandData.dataType == 2 && onDemandData.ID == nextSong && onDemandData.buffer != null)
  2638. saveMidi(songChanging, onDemandData.buffer);
  2639. if (onDemandData.dataType == 3 && loadingStage == 1) {
  2640. for (int i = 0; i < aByteArrayArray1183.length; i++) {
  2641. if (anIntArray1235[i] == onDemandData.ID) {
  2642. aByteArrayArray1183[i] = onDemandData.buffer;
  2643. if (onDemandData.buffer == null)
  2644. anIntArray1235[i] = -1;
  2645. break;
  2646. }
  2647. if (anIntArray1236[i] != onDemandData.ID)
  2648. continue;
  2649. aByteArrayArray1247[i] = onDemandData.buffer;
  2650. if (onDemandData.buffer == null)
  2651. anIntArray1236[i] = -1;
  2652. break;
  2653. }
  2654.  
  2655. }
  2656. } while (onDemandData.dataType != 93 || !onDemandFetcher.method564(onDemandData.ID));
  2657. ObjectManager.method173(new Stream(onDemandData.buffer), onDemandFetcher);
  2658. } while (true);
  2659. }
  2660.  
  2661. private void calcFlamesPosition() {
  2662. char c = '\u0100';
  2663. for (int j = 10; j < 117; j++) {
  2664. int k = (int) (Math.random() * 100D);
  2665. if (k < 50)
  2666. anIntArray828[j + (c - 2 << 7)] = 255;
  2667. }
  2668. for (int l = 0; l < 100; l++) {
  2669. int i1 = (int) (Math.random() * 124D) + 2;
  2670. int k1 = (int) (Math.random() * 128D) + 128;
  2671. int k2 = i1 + (k1 << 7);
  2672. anIntArray828[k2] = 192;
  2673. }
  2674.  
  2675. for (int j1 = 1; j1 < c - 1; j1++) {
  2676. for (int l1 = 1; l1 < 127; l1++) {
  2677. int l2 = l1 + (j1 << 7);
  2678. anIntArray829[l2] = (anIntArray828[l2 - 1] + anIntArray828[l2 + 1] + anIntArray828[l2 - 128] + anIntArray828[l2 + 128]) / 4;
  2679. }
  2680.  
  2681. }
  2682.  
  2683. anInt1275 += 128;
  2684. if (anInt1275 > anIntArray1190.length) {
  2685. anInt1275 -= anIntArray1190.length;
  2686. int i2 = (int) (Math.random() * 12D);
  2687. randomizeBackground(aBackgroundArray1152s[i2]);
  2688. }
  2689. for (int j2 = 1; j2 < c - 1; j2++) {
  2690. for (int i3 = 1; i3 < 127; i3++) {
  2691. int k3 = i3 + (j2 << 7);
  2692. int i4 = anIntArray829[k3 + 128] - anIntArray1190[k3 + anInt1275 & anIntArray1190.length - 1] / 5;
  2693. if (i4 < 0)
  2694. i4 = 0;
  2695. anIntArray828[k3] = i4;
  2696. }
  2697.  
  2698. }
  2699.  
  2700. System.arraycopy(anIntArray969, 1, anIntArray969, 0, c - 1);
  2701.  
  2702. anIntArray969[c - 1] = (int) (Math.sin((double) loopCycle / 14D) * 16D + Math.sin((double) loopCycle / 15D) * 14D + Math.sin((double) loopCycle / 16D) * 12D);
  2703. if (anInt1040 > 0)
  2704. anInt1040 -= 4;
  2705. if (anInt1041 > 0)
  2706. anInt1041 -= 4;
  2707. if (anInt1040 == 0 && anInt1041 == 0) {
  2708. int l3 = (int) (Math.random() * 2000D);
  2709. if (l3 == 0)
  2710. anInt1040 = 1024;
  2711. if (l3 == 1)
  2712. anInt1041 = 1024;
  2713. }
  2714. }
  2715.  
  2716. private boolean saveWave(byte abyte0[], int i) {
  2717. return abyte0 == null || signlink.saveWave(abyte0, i);
  2718. }
  2719.  
  2720. private void method60(int i) {
  2721. RSInterface class9 = RSInterface.interfaceCache[i];
  2722. for (int j = 0; j < class9.children.length; j++) {
  2723. if (class9.children[j] == -1)
  2724. break;
  2725. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j]];
  2726. if (class9_1.type == 1)
  2727. method60(class9_1.id);
  2728. class9_1.anInt246 = 0;
  2729. class9_1.anInt208 = 0;
  2730. }
  2731. }
  2732.  
  2733. private void drawHeadIcon() {
  2734. if (anInt855 != 2)
  2735. return;
  2736. calcEntityScreenPos((anInt934 - baseX << 7) + anInt937, anInt936 * 2, (anInt935 - baseY << 7) + anInt938);
  2737. if (spriteDrawX > -1 && loopCycle % 20 < 10)
  2738. headIcons[2].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  2739. }
  2740.  
  2741. private void mainGameProcessor() {
  2742. refreshFrameSize();
  2743. if (anInt1104 > 1)
  2744. anInt1104--;
  2745. if (anInt1011 > 0)
  2746. anInt1011--;
  2747. for (int j = 0; j < 5; j++)
  2748. if (!parsePacket())
  2749. break;
  2750.  
  2751. if (!loggedIn)
  2752. return;
  2753. if (super.clickMode3 != 0) {
  2754. long l = (super.aLong29 - aLong1220) / 50L;
  2755. if (l > 4095L)
  2756. l = 4095L;
  2757. aLong1220 = super.aLong29;
  2758. int k2 = super.saveClickY;
  2759. if (k2 < 0)
  2760. k2 = 0;
  2761. else if (k2 > 502)
  2762. k2 = 502;
  2763. int k3 = super.saveClickX;
  2764. if (k3 < 0)
  2765. k3 = 0;
  2766. else if (k3 > 764)
  2767. k3 = 764;
  2768. int k4 = k2 * 765 + k3;
  2769. int j5 = 0;
  2770. if (super.clickMode3 == 2)
  2771. j5 = 1;
  2772. int l5 = (int) l;
  2773. stream.createFrame(241);
  2774. stream.writeDWord((l5 << 20) + (j5 << 19) + k4);
  2775. }
  2776. if (anInt1016 > 0)
  2777. anInt1016--;
  2778. if (super.keyArray[1] == 1 || super.keyArray[2] == 1 || super.keyArray[3] == 1 || super.keyArray[4] == 1)
  2779. aBoolean1017 = true;
  2780. if (aBoolean1017 && anInt1016 <= 0) {
  2781. anInt1016 = 20;
  2782. aBoolean1017 = false;
  2783. stream.createFrame(86);
  2784. stream.writeWord(anInt1184);
  2785. stream.method432(viewRotation);
  2786. }
  2787. if (super.awtFocus && !aBoolean954) {
  2788. aBoolean954 = true;
  2789. stream.createFrame(3);
  2790. stream.writeWordBigEndian(1);
  2791. }
  2792. if (!super.awtFocus && aBoolean954) {
  2793. aBoolean954 = false;
  2794. stream.createFrame(3);
  2795. stream.writeWordBigEndian(0);
  2796. }
  2797. loadingStages();
  2798. method115();
  2799. method90();
  2800. anInt1009++;
  2801. if (anInt1009 > 750)
  2802. dropClient();
  2803. method114();
  2804. method95();
  2805. method38();
  2806. anInt945++;
  2807. if (crossType != 0) {
  2808. crossIndex += 20;
  2809. if (crossIndex >= 400)
  2810. crossType = 0;
  2811. }
  2812. if (atInventoryInterfaceType != 0) {
  2813. atInventoryLoopCycle++;
  2814. if (atInventoryLoopCycle >= 15) {
  2815. if (atInventoryInterfaceType == 2)
  2816. needDrawTabArea = true;
  2817. if (atInventoryInterfaceType == 3)
  2818. inputTaken = true;
  2819. atInventoryInterfaceType = 0;
  2820. }
  2821. }
  2822. if (activeInterfaceType != 0) {
  2823. anInt989++;
  2824. if (super.mouseX > anInt1087 + 5 || super.mouseX < anInt1087 - 5 || super.mouseY > anInt1088 + 5 || super.mouseY < anInt1088 - 5)
  2825. aBoolean1242 = true;
  2826. if (super.clickMode2 == 0) {
  2827. if (activeInterfaceType == 2)
  2828. needDrawTabArea = true;
  2829. if (activeInterfaceType == 3)
  2830. inputTaken = true;
  2831. activeInterfaceType = 0;
  2832. if (aBoolean1242 && anInt989 >= 10) {
  2833. lastActiveInvInterface = -1;
  2834. processRightClick();
  2835. if (lastActiveInvInterface == anInt1084 && mouseInvInterfaceIndex != anInt1085) {
  2836. RSInterface class9 = RSInterface.interfaceCache[anInt1084];
  2837. int j1 = 0;
  2838. if (anInt913 == 1 && class9.contentType == 206)
  2839. j1 = 1;
  2840. if (class9.inv[mouseInvInterfaceIndex] <= 0)
  2841. j1 = 0;
  2842. if (class9.aBoolean235) {
  2843. int l2 = anInt1085;
  2844. int l3 = mouseInvInterfaceIndex;
  2845. class9.inv[l3] = class9.inv[l2];
  2846. class9.invStackSizes[l3] = class9.invStackSizes[l2];
  2847. class9.inv[l2] = -1;
  2848. class9.invStackSizes[l2] = 0;
  2849. } else if (j1 == 1) {
  2850. int i3 = anInt1085;
  2851. for (int i4 = mouseInvInterfaceIndex; i3 != i4;)
  2852. if (i3 > i4) {
  2853. class9.swapInventoryItems(i3, i3 - 1);
  2854. i3--;
  2855. } else if (i3 < i4) {
  2856. class9.swapInventoryItems(i3, i3 + 1);
  2857. i3++;
  2858. }
  2859.  
  2860. } else {
  2861. class9.swapInventoryItems(anInt1085, mouseInvInterfaceIndex);
  2862. }
  2863. stream.createFrame(214);
  2864. stream.method433(anInt1084);
  2865. stream.method424(j1);
  2866. stream.method433(anInt1085);
  2867. stream.method431(mouseInvInterfaceIndex);
  2868. }
  2869. } else if ((anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  2870. determineMenuSize();
  2871. else if (menuActionRow > 0)
  2872. doAction(menuActionRow - 1);
  2873. atInventoryLoopCycle = 10;
  2874. super.clickMode3 = 0;
  2875. }
  2876. }
  2877. if (WorldController.anInt470 != -1) {
  2878. int k = WorldController.anInt470;
  2879. int k1 = WorldController.anInt471;
  2880. boolean flag = doWalkTo(0, 0, 0, 0, myPlayer.smallY[0], 0, 0, k1, myPlayer.smallX[0], true, k);
  2881. WorldController.anInt470 = -1;
  2882. if (flag) {
  2883. crossX = super.saveClickX;
  2884. crossY = super.saveClickY;
  2885. crossType = 1;
  2886. crossIndex = 0;
  2887. }
  2888. }
  2889. if (super.clickMode3 == 1 && aString844 != null) {
  2890. aString844 = null;
  2891. inputTaken = true;
  2892. super.clickMode3 = 0;
  2893. }
  2894. if(!processMenuClick()) {
  2895. processMainScreenClick();
  2896. processTabClick();
  2897. processChatModeClick();
  2898. }
  2899. if (super.clickMode2 == 1 || super.clickMode3 == 1)
  2900. anInt1213++;
  2901. if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  2902. if (hoverTime < 20 && !menuOpen) {
  2903. hoverTime++;
  2904. if (hoverTime == 20) {
  2905. if (anInt1500 != 0) {
  2906. inputTaken = true;
  2907. }
  2908. if (anInt1044 != 0) {
  2909. needDrawTabArea = true;
  2910. }
  2911. }
  2912. }
  2913. } else if (hoverTime > 0) {
  2914. hoverTime--;
  2915. }
  2916. if (loadingStage == 2)
  2917. method108();
  2918. if (loadingStage == 2 && aBoolean1160)
  2919. calcCameraPos();
  2920. for (int i1 = 0; i1 < 5; i1++)
  2921. anIntArray1030[i1]++;
  2922.  
  2923. method73();
  2924. super.idleTime++;
  2925. if (super.idleTime > 4500) {
  2926. anInt1011 = 250;
  2927. super.idleTime -= 500;
  2928. stream.createFrame(202);
  2929. }
  2930. anInt1010++;
  2931. if (anInt1010 > 50)
  2932. stream.createFrame(0);
  2933. try {
  2934. if (socketStream != null && stream.currentOffset > 0) {
  2935. socketStream.queueBytes(stream.currentOffset, stream.buffer);
  2936. stream.currentOffset = 0;
  2937. anInt1010 = 0;
  2938. }
  2939. }
  2940. catch (IOException _ex) {
  2941. dropClient();
  2942. }
  2943. catch (Exception exception) {
  2944. resetLogout();
  2945. }
  2946. }
  2947.  
  2948. private void method63() {
  2949. Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179.reverseGetFirst();
  2950. for (; class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179.reverseGetNext())
  2951. if (class30_sub1.anInt1294 == -1) {
  2952. class30_sub1.anInt1302 = 0;
  2953. method89(class30_sub1);
  2954. } else {
  2955. class30_sub1.unlink();
  2956. }
  2957.  
  2958. }
  2959.  
  2960. private void resetImageProducers() {
  2961. if (aRSImageProducer_1107 != null)
  2962. return;
  2963. super.fullGameScreen = null;
  2964. aRSImageProducer_1166 = null;
  2965. aRSImageProducer_1164 = null;
  2966. aRSImageProducer_1163 = null;
  2967. aRSImageProducer_1165 = null;
  2968. aRSImageProducer_1125 = null;
  2969. aRSImageProducer_1110 = new ImageProducer(128, 265);
  2970. DrawingArea.setAllPixelsToZero();
  2971. aRSImageProducer_1111 = new ImageProducer(128, 265);
  2972. DrawingArea.setAllPixelsToZero();
  2973. aRSImageProducer_1107 = new ImageProducer(509, 171);
  2974. DrawingArea.setAllPixelsToZero();
  2975. aRSImageProducer_1108 = new ImageProducer(360, 132);
  2976. DrawingArea.setAllPixelsToZero();
  2977. aRSImageProducer_1109 = new ImageProducer(360, 200);
  2978. DrawingArea.setAllPixelsToZero();
  2979. aRSImageProducer_1112 = new ImageProducer(202, 238);
  2980. DrawingArea.setAllPixelsToZero();
  2981. aRSImageProducer_1113 = new ImageProducer(203, 238);
  2982. DrawingArea.setAllPixelsToZero();
  2983. aRSImageProducer_1114 = new ImageProducer(74, 94);
  2984. DrawingArea.setAllPixelsToZero();
  2985. aRSImageProducer_1115 = new ImageProducer(75, 94);
  2986. DrawingArea.setAllPixelsToZero();
  2987. if (titleStreamLoader != null) {
  2988. drawLogo();
  2989. loadTitleScreen();
  2990. }
  2991. welcomeScreenRaised = true;
  2992. }
  2993.  
  2994.  
  2995. public void drawSmoothLoading(int i, String s)
  2996. {
  2997. for(float f = LP; f < (float)i; f = (float)((double)f + 0.29999999999999999D))
  2998. drawLoadingText((int)f, s);
  2999.  
  3000. LP = i;
  3001. }
  3002.  
  3003. void drawLoadingText(int i, String s) {
  3004. anInt1079 = i;
  3005. aString1049 = s;
  3006. resetImageProducers();
  3007. if (titleStreamLoader == null) {
  3008. super.drawLoadingText(i, s);
  3009. return;
  3010. }
  3011. aRSImageProducer_1109.initDrawingArea();
  3012. char c = '\u0168';
  3013. char c1 = '\310';
  3014. byte byte1 = 20;
  3015. chatTextDrawingArea.drawText(0xffffff, "RuneScape is loading - please wait...", c1 / 2 - 26 - byte1, c / 2);
  3016. int j = c1 / 2 - 18 - byte1;
  3017. DrawingArea.fillPixels(c / 2 - 152, 304, 34, 0x8c1111, j);
  3018. DrawingArea.fillPixels(c / 2 - 151, 302, 32, 0, j + 1);
  3019. DrawingArea.method336(30, j + 2, c / 2 - 150, 0x8c1111, i * 3);
  3020. DrawingArea.method336(30, j + 2, (c / 2 - 150) + i * 3, 0, 300 - i * 3);
  3021. chatTextDrawingArea.drawText(0xffffff, s, (c1 / 2 + 5) - byte1, c / 2);
  3022. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  3023. if (welcomeScreenRaised) {
  3024. welcomeScreenRaised = false;
  3025. if (!aBoolean831) {
  3026. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  3027. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  3028. }
  3029. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  3030. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  3031. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  3032. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  3033. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  3034. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  3035. }
  3036. }
  3037.  
  3038. private void method65(int i, int j, int k, int l, RSInterface class9, int i1, boolean flag, int j1) {
  3039. try {
  3040. int anInt992;
  3041. if (aBoolean972)
  3042. anInt992 = 32;
  3043. else
  3044. anInt992 = 0;
  3045. aBoolean972 = false;
  3046. if (k >= i && k < i + 16 && l >= i1 && l < i1 + 16) {
  3047. class9.scrollPosition -= anInt1213 * 4;
  3048. if (flag) {
  3049. needDrawTabArea = true;
  3050. }
  3051. } else if (k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j) {
  3052. class9.scrollPosition += anInt1213 * 4;
  3053. if (flag) {
  3054. needDrawTabArea = true;
  3055. }
  3056. } else if (k >= i - anInt992 && k < i + 16 + anInt992 && l >= i1 + 16 && l < (i1 + j) - 16 && anInt1213 > 0) {
  3057. int l1 = ((j - 32) * j) / j1;
  3058. if (l1 < 8)
  3059. l1 = 8;
  3060. int i2 = l - i1 - 16 - l1 / 2;
  3061. int j2 = j - 32 - l1;
  3062. class9.scrollPosition = ((j1 - j) * i2) / j2;
  3063. if (flag)
  3064. needDrawTabArea = true;
  3065. aBoolean972 = true;
  3066. }
  3067. } catch(Exception e) {
  3068. e.printStackTrace();
  3069. }
  3070. }
  3071.  
  3072. private boolean method66(int i, int j, int k) {
  3073. int i1 = i >> 14 & 0x7fff;
  3074. int j1 = worldController.method304(plane, k, j, i);
  3075. if (j1 == -1)
  3076. return false;
  3077. int k1 = j1 & 0x1f;
  3078. int l1 = j1 >> 6 & 3;
  3079. if (k1 == 10 || k1 == 11 || k1 == 22) {
  3080. ObjectDef class46 = ObjectDef.forID(i1);
  3081. int i2;
  3082. int j2;
  3083. if (l1 == 0 || l1 == 2) {
  3084. i2 = class46.anInt744;
  3085. j2 = class46.anInt761;
  3086. } else {
  3087. i2 = class46.anInt761;
  3088. j2 = class46.anInt744;
  3089. }
  3090. int k2 = class46.anInt768;
  3091. if (l1 != 0)
  3092. k2 = (k2 << l1 & 0xf) + (k2 >> 4 - l1);
  3093. doWalkTo(2, 0, j2, 0, myPlayer.smallY[0], i2, k2, j, myPlayer.smallX[0], false, k);
  3094. } else {
  3095. doWalkTo(2, l1, 0, k1 + 1, myPlayer.smallY[0], 0, 0, j, myPlayer.smallX[0], false, k);
  3096. }
  3097. crossX = super.saveClickX;
  3098. crossY = super.saveClickY;
  3099. crossType = 2;
  3100. crossIndex = 0;
  3101. return true;
  3102. }
  3103.  
  3104. private StreamLoader streamLoaderForName(int i, String s, String s1, int j, int k) {
  3105. byte abyte0[] = null;
  3106. int l = 5;
  3107. try {
  3108. if (decompressors[0] != null)
  3109. abyte0 = decompressors[0].decompress(i);
  3110. }
  3111. catch (Exception _ex) {
  3112. }
  3113. if (abyte0 != null) {
  3114. // aCRC32_930.reset();
  3115. // aCRC32_930.update(abyte0);
  3116. // int i1 = (int)aCRC32_930.getValue();
  3117. // if(i1 != j)
  3118. }
  3119. if (abyte0 != null)
  3120. return new StreamLoader(abyte0);
  3121. int j1 = 0;
  3122. while (abyte0 == null) {
  3123. String s2 = "Unknown error";
  3124. drawSmoothLoading(k, "Requesting " + s);
  3125. Object obj = null;
  3126. try {
  3127. int k1 = 0;
  3128. DataInputStream datainputstream = openJagGrabInputStream(s1 + j);
  3129. byte abyte1[] = new byte[6];
  3130. datainputstream.readFully(abyte1, 0, 6);
  3131. Stream stream = new Stream(abyte1);
  3132. stream.currentOffset = 3;
  3133. int i2 = stream.read3Bytes() + 6;
  3134. int j2 = 6;
  3135. abyte0 = new byte[i2];
  3136. System.arraycopy(abyte1, 0, abyte0, 0, 6);
  3137.  
  3138. while (j2 < i2) {
  3139. int l2 = i2 - j2;
  3140. if (l2 > 1000)
  3141. l2 = 1000;
  3142. int j3 = datainputstream.read(abyte0, j2, l2);
  3143. if (j3 < 0) {
  3144. s2 = "Length error: " + j2 + "/" + i2;
  3145. throw new IOException("EOF");
  3146. }
  3147. j2 += j3;
  3148. int k3 = (j2 * 100) / i2;
  3149. if (k3 != k1)
  3150. drawSmoothLoading(k, "Loading " + s + " - " + k3 + "%");
  3151. k1 = k3;
  3152. }
  3153. datainputstream.close();
  3154. try {
  3155. if (decompressors[0] != null)
  3156. decompressors[0].method234(abyte0.length, abyte0, i);
  3157. }
  3158. catch (Exception _ex) {
  3159. decompressors[0] = null;
  3160. }
  3161. /* if(abyte0 != null)
  3162. {
  3163. aCRC32_930.reset();
  3164. aCRC32_930.update(abyte0);
  3165. int i3 = (int)aCRC32_930.getValue();
  3166. if(i3 != j)
  3167. {
  3168. abyte0 = null;
  3169. j1++;
  3170. s2 = "Checksum error: " + i3;
  3171. }
  3172. }
  3173. */
  3174. }
  3175. catch (IOException ioexception) {
  3176. if (s2.equals("Unknown error"))
  3177. s2 = "Connection error";
  3178. abyte0 = null;
  3179. }
  3180. catch (NullPointerException _ex) {
  3181. s2 = "Null error";
  3182. abyte0 = null;
  3183. if (!signlink.reporterror)
  3184. return null;
  3185. }
  3186. catch (ArrayIndexOutOfBoundsException _ex) {
  3187. s2 = "Bounds error";
  3188. abyte0 = null;
  3189. if (!signlink.reporterror)
  3190. return null;
  3191. }
  3192. catch (Exception _ex) {
  3193. s2 = "Unexpected error";
  3194. abyte0 = null;
  3195. if (!signlink.reporterror)
  3196. return null;
  3197. }
  3198. if (abyte0 == null) {
  3199. for (int l1 = l; l1 > 0; l1--) {
  3200. if (j1 >= 3) {
  3201. drawSmoothLoading(k, "Game updated - please reload page");
  3202. l1 = 10;
  3203. } else {
  3204. drawSmoothLoading(k, s2 + " - Retrying in " + l1);
  3205. }
  3206. try {
  3207. Thread.sleep(1000L);
  3208. }
  3209. catch (Exception _ex) {
  3210. }
  3211. }
  3212.  
  3213. l *= 2;
  3214. if (l > 60)
  3215. l = 60;
  3216. aBoolean872 = !aBoolean872;
  3217. }
  3218.  
  3219. }
  3220. return new StreamLoader(abyte0);
  3221. }
  3222.  
  3223. private void dropClient() {
  3224. if (anInt1011 > 0) {
  3225. resetLogout();
  3226. return;
  3227. }
  3228. DrawingArea.fillPixels(2, 229, 39, 0xffffff, 2); // white box around
  3229. DrawingArea.drawPixels(37, 3, 3, 0, 227); // black fill
  3230. regularText.drawText(0, "Connection lost.", 19, 120);
  3231. regularText.drawText(0xffffff, "Connection lost.", 18, 119);
  3232. regularText.drawText(0, "Please wait - attempting to reestablish.", 34, 117);
  3233. regularText.drawText(0xffffff, "Please wait - attempting to reestablish.", 34, 116);
  3234. aRSImageProducer_1165.drawGraphics(frameMode == ScreenMode.FIXED ? 4 : 0, super.graphics, frameMode == ScreenMode.FIXED ? 4 : 0);
  3235. anInt1021 = 0;
  3236. destX = 0;
  3237. RSSocket rsSocket = socketStream;
  3238. loggedIn = false;
  3239. loginFailures = 0;
  3240. login(myUsername, myPassword, true);
  3241. if (!loggedIn)
  3242. resetLogout();
  3243. try {
  3244. rsSocket.close();
  3245. } catch (Exception _ex) {
  3246. }
  3247. }
  3248.  
  3249. public void sendFrame248(int interfaceID,int sideInterfaceID){
  3250. if(backDialogID != -1){
  3251. backDialogID = -1;
  3252. inputTaken = true;
  3253. }
  3254. if(inputDialogState != 0){
  3255. inputDialogState = 0;
  3256. inputTaken = true;
  3257. }
  3258. openInterfaceID = interfaceID;
  3259. invOverlayInterfaceID = sideInterfaceID;
  3260. needDrawTabArea = true;
  3261. tabAreaAltered = true;
  3262. aBoolean1149 = false;
  3263. }
  3264.  
  3265. private void doAction(int i) {
  3266. if (i < 0)
  3267. return;
  3268. if (inputDialogState != 0) {
  3269. inputDialogState = 0;
  3270. inputTaken = true;
  3271. }
  3272. int j = menuActionCmd2[i];
  3273. int k = menuActionCmd3[i];
  3274. int l = menuActionID[i];
  3275. int i1 = menuActionCmd1[i];
  3276. if (l >= 2000)
  3277. l -= 2000;
  3278. if (l == 582) {
  3279. NPC npc = npcArray[i1];
  3280. if (npc != null) {
  3281. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0], myPlayer.smallX[0], false, npc.smallX[0]);
  3282. crossX = super.saveClickX;
  3283. crossY = super.saveClickY;
  3284. crossType = 2;
  3285. crossIndex = 0;
  3286. stream.createFrame(57);
  3287. stream.method432(anInt1285);
  3288. stream.method432(i1);
  3289. stream.method431(anInt1283);
  3290. stream.method432(anInt1284);
  3291. }
  3292. }
  3293. if (l == 234) {
  3294. boolean flag1 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  3295. if (!flag1)
  3296. flag1 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  3297. crossX = super.saveClickX;
  3298. crossY = super.saveClickY;
  3299. crossType = 2;
  3300. crossIndex = 0;
  3301. stream.createFrame(236);
  3302. stream.method431(k + baseY);
  3303. stream.writeWord(i1);
  3304. stream.method431(j + baseX);
  3305. }
  3306. if (l == 62 && method66(i1, k, j)) {
  3307. stream.createFrame(192);
  3308. stream.writeWord(anInt1284);
  3309. stream.method431(i1 >> 14 & 0x7fff);
  3310. stream.method433(k + baseY);
  3311. stream.method431(anInt1283);
  3312. stream.method433(j + baseX);
  3313. stream.writeWord(anInt1285);
  3314. }
  3315. if (l == 511) {
  3316. boolean flag2 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  3317. if (!flag2)
  3318. flag2 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  3319. crossX = super.saveClickX;
  3320. crossY = super.saveClickY;
  3321. crossType = 2;
  3322. crossIndex = 0;
  3323. stream.createFrame(25);
  3324. stream.method431(anInt1284);
  3325. stream.method432(anInt1285);
  3326. stream.writeWord(i1);
  3327. stream.method432(k + baseY);
  3328. stream.method433(anInt1283);
  3329. stream.writeWord(j + baseX);
  3330. }
  3331. if (l == 74) {
  3332. stream.createFrame(122);
  3333. stream.method433(k);
  3334. stream.method432(j);
  3335. stream.method431(i1);
  3336. atInventoryLoopCycle = 0;
  3337. atInventoryInterface = k;
  3338. atInventoryIndex = j;
  3339. atInventoryInterfaceType = 2;
  3340. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3341. atInventoryInterfaceType = 1;
  3342. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  3343. atInventoryInterfaceType = 3;
  3344. }
  3345. if (l == 315) {
  3346. RSInterface class9 = RSInterface.interfaceCache[k];
  3347. boolean flag8 = true;
  3348. if (class9.contentType > 0)
  3349. flag8 = promptUserForInput(class9);
  3350. if(flag8) {
  3351. /* Client-sided button clicking */
  3352. switch(k) {
  3353.  
  3354. // case 24172:
  3355. // frameMode(ScreenMode.FIXED);
  3356. // break;
  3357. // case 24173:
  3358. // frameMode(ScreenMode.RESIZABLE);
  3359. // break;
  3360. // case 24174:
  3361. // Settings.enableTweening =! Settings.enableTweening;
  3362. // pushMessage("Tweening is now " + (Settings.enableTweening ? "on..." : "off..."), 0, "");
  3363. // try {
  3364. // writeSettings();
  3365. // } catch(Exception e) {
  3366. //
  3367. // }
  3368. // break;
  3369. // case 24175:
  3370. // roofsOff =! roofsOff;
  3371. // pushMessage("Roofs are now " + (roofsOff ? "off..." : "on..."), 0, "");
  3372. // try {
  3373. // writeSettings();
  3374. // } catch(Exception e) {
  3375. //
  3376. // }
  3377. // break;
  3378. // case 24176:
  3379. // is317 =! is317;
  3380. // pushMessage("317 sprites are now " + (is317 ? "on..." : "off..."), 0, "");
  3381. // try {
  3382. // writeSettings();
  3383. // } catch(Exception e) {
  3384. //
  3385. // }
  3386. // break;
  3387. // case 24177:
  3388. // if (frameMode == ScreenMode.FIXED) {
  3389. // pushMessage("You cannot do this while in fixed mode...", 0, "");
  3390. // } else {
  3391. // hideGameFrame =! hideGameFrame;
  3392. // }
  3393. // break;
  3394.  
  3395. case 19157:
  3396. if(fixedScreen){
  3397. frameMode(ScreenMode.RESIZABLE);
  3398. fixedScreen = false;
  3399. } else {
  3400. frameMode(ScreenMode.FIXED);
  3401. fixedScreen = true;
  3402. }
  3403. pushMessage("Your client is set to: " + (fixedScreen ? "<col=255>fixed" : "<col=255>resizable"), 0, "");
  3404. break;
  3405.  
  3406. // case 24169:
  3407. // System.out.println("2");
  3408. // setSidebarInterface(904, 11);
  3409. // break;
  3410. //
  3411. case 21345:
  3412. System.out.println("3");
  3413. setSidebarInterface(24126, 2);
  3414. break;
  3415.  
  3416. case 24127:
  3417. System.out.println("4");
  3418. setSidebarInterface(638, 2);
  3419. break;
  3420.  
  3421. case 21341:
  3422. System.out.println("5");
  3423. openInterfaceID = 21172;
  3424. break;
  3425.  
  3426. case 21299:
  3427. System.out.println("6");
  3428. openInterfaceID = -1;
  3429. break;
  3430.  
  3431. default:
  3432. System.out.println("7");
  3433. stream.createFrame(185);
  3434. stream.writeWord(k);
  3435. break;
  3436. }
  3437. }
  3438. }
  3439. if (l == 561) {
  3440. Player player = playerArray[i1];
  3441. if (player != null) {
  3442. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, player.smallY[0], myPlayer.smallX[0], false, player.smallX[0]);
  3443. crossX = super.saveClickX;
  3444. crossY = super.saveClickY;
  3445. crossType = 2;
  3446. crossIndex = 0;
  3447. anInt1188 += i1;
  3448. if (anInt1188 >= 90) {
  3449. stream.createFrame(136);
  3450. anInt1188 = 0;
  3451. }
  3452. stream.createFrame(128);
  3453. stream.writeWord(i1);
  3454. }
  3455. }
  3456. if (l == 20) {
  3457. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[i1];
  3458. if (class30_sub2_sub4_sub1_sub1_1 != null) {
  3459. 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]);
  3460. crossX = super.saveClickX;
  3461. crossY = super.saveClickY;
  3462. crossType = 2;
  3463. crossIndex = 0;
  3464. stream.createFrame(155);
  3465. stream.method431(i1);
  3466. }
  3467. }
  3468. if (l == 779) {
  3469. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[i1];
  3470. if (class30_sub2_sub4_sub1_sub2_1 != null) {
  3471. 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]);
  3472. crossX = super.saveClickX;
  3473. crossY = super.saveClickY;
  3474. crossType = 2;
  3475. crossIndex = 0;
  3476. stream.createFrame(153);
  3477. stream.method431(i1);
  3478. }
  3479. }
  3480. if (l == 516)
  3481. if (!menuOpen)
  3482. worldController.method312(super.saveClickY - 4, super.saveClickX - 4);
  3483. else
  3484. worldController.method312(k - 4, j - 4);
  3485. if (l == 1062) {
  3486. anInt924 += baseX;
  3487. if (anInt924 >= 113) {
  3488. stream.createFrame(183);
  3489. stream.writeDWordBigEndian(0xe63271);
  3490. anInt924 = 0;
  3491. }
  3492. method66(i1, k, j);
  3493. stream.createFrame(228);
  3494. stream.method432(i1 >> 14 & 0x7fff);
  3495. stream.method432(k + baseY);
  3496. stream.writeWord(j + baseX);
  3497. }
  3498. if (l == 679 && !aBoolean1149) {
  3499. stream.createFrame(40);
  3500. stream.writeWord(k);
  3501. aBoolean1149 = true;
  3502. }
  3503. if (l == 431) {
  3504. stream.createFrame(129);
  3505. stream.method432(j);
  3506. stream.writeWord(k);
  3507. stream.method432(i1);
  3508. atInventoryLoopCycle = 0;
  3509. atInventoryInterface = k;
  3510. atInventoryIndex = j;
  3511. atInventoryInterfaceType = 2;
  3512. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3513. atInventoryInterfaceType = 1;
  3514. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  3515. atInventoryInterfaceType = 3;
  3516. }
  3517. if (l == 337 || l == 42 || l == 792 || l == 322) {
  3518. String s = menuActionName[i];
  3519. int k1 = s.indexOf("@whi@");
  3520. if (k1 != -1) {
  3521. long l3 = TextClass.longForName(s.substring(k1 + 5).trim());
  3522. if (l == 337)
  3523. addFriend(l3);
  3524. if (l == 42)
  3525. addIgnore(l3);
  3526. if (l == 792)
  3527. delFriend(l3);
  3528. if (l == 322)
  3529. delIgnore(l3);
  3530. }
  3531. }
  3532. if (l == 53) {
  3533. stream.createFrame(135);
  3534. stream.method431(j);
  3535. stream.method432(k);
  3536. stream.method431(i1);
  3537. atInventoryLoopCycle = 0;
  3538. atInventoryInterface = k;
  3539. atInventoryIndex = j;
  3540. atInventoryInterfaceType = 2;
  3541. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3542. atInventoryInterfaceType = 1;
  3543. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  3544. atInventoryInterfaceType = 3;
  3545. }
  3546. if (l == 539) {
  3547. stream.createFrame(16);
  3548. stream.method432(i1);
  3549. stream.method433(j);
  3550. stream.method433(k);
  3551. atInventoryLoopCycle = 0;
  3552. atInventoryInterface = k;
  3553. atInventoryIndex = j;
  3554. atInventoryInterfaceType = 2;
  3555. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3556. atInventoryInterfaceType = 1;
  3557. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  3558. atInventoryInterfaceType = 3;
  3559. }
  3560. if (l == 484 || l == 6) {
  3561. String s1 = menuActionName[i];
  3562. int l1 = s1.indexOf("@whi@");
  3563. if (l1 != -1) {
  3564. s1 = s1.substring(l1 + 5).trim();
  3565. String s7 = TextClass.fixName(TextClass.nameForLong(TextClass.longForName(s1)));
  3566. boolean flag9 = false;
  3567. for (int j3 = 0; j3 < playerCount; j3++) {
  3568. Player class30_sub2_sub4_sub1_sub2_7 = playerArray[playerIndices[j3]];
  3569. 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))
  3570. continue;
  3571. 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]);
  3572. if (l == 484) {
  3573. stream.createFrame(39);
  3574. stream.method431(playerIndices[j3]);
  3575. }
  3576. if (l == 6) {
  3577. anInt1188 += i1;
  3578. if (anInt1188 >= 90) {
  3579. stream.createFrame(136);
  3580. anInt1188 = 0;
  3581. }
  3582. stream.createFrame(128);
  3583. stream.writeWord(playerIndices[j3]);
  3584. }
  3585. flag9 = true;
  3586. break;
  3587. }
  3588.  
  3589. if (!flag9)
  3590. pushMessage("Unable to find " + s7, 0, "");
  3591. }
  3592. }
  3593. if (l == 870) {
  3594. stream.createFrame(53);
  3595. stream.writeWord(j);
  3596. stream.method432(anInt1283);
  3597. stream.method433(i1);
  3598. stream.writeWord(anInt1284);
  3599. stream.method431(anInt1285);
  3600. stream.writeWord(k);
  3601. atInventoryLoopCycle = 0;
  3602. atInventoryInterface = k;
  3603. atInventoryIndex = j;
  3604. atInventoryInterfaceType = 2;
  3605. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3606. atInventoryInterfaceType = 1;
  3607. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  3608. atInventoryInterfaceType = 3;
  3609. }
  3610. if (l == 847) {
  3611. stream.createFrame(87);
  3612. stream.method432(i1);
  3613. stream.writeWord(k);
  3614. stream.method432(j);
  3615. atInventoryLoopCycle = 0;
  3616. atInventoryInterface = k;
  3617. atInventoryIndex = j;
  3618. atInventoryInterfaceType = 2;
  3619. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3620. atInventoryInterfaceType = 1;
  3621. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  3622. atInventoryInterfaceType = 3;
  3623. }
  3624. if (l == 626) {
  3625. RSInterface class9_1 = RSInterface.interfaceCache[k];
  3626. spellSelected = 1;
  3627. spellID = class9_1.id;
  3628. anInt1137 = k;
  3629. spellUsableOn = class9_1.spellUsableOn;
  3630. itemSelected = 0;
  3631. needDrawTabArea = true;
  3632. String s4 = class9_1.selectedActionName;
  3633. if (s4.indexOf(" ") != -1)
  3634. s4 = s4.substring(0, s4.indexOf(" "));
  3635. String s8 = class9_1.selectedActionName;
  3636. if (s8.indexOf(" ") != -1)
  3637. s8 = s8.substring(s8.indexOf(" ") + 1);
  3638. spellTooltip = s4 + " " + class9_1.spellName + " " + s8;
  3639. if (spellUsableOn == 16) {
  3640. needDrawTabArea = true;
  3641. tabID = 3;
  3642. tabAreaAltered = true;
  3643. }
  3644. return;
  3645. }
  3646. if (l == 78) {
  3647. stream.createFrame(117);
  3648. stream.method433(k);
  3649. stream.method433(i1);
  3650. stream.method431(j);
  3651. atInventoryLoopCycle = 0;
  3652. atInventoryInterface = k;
  3653. atInventoryIndex = j;
  3654. atInventoryInterfaceType = 2;
  3655. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3656. atInventoryInterfaceType = 1;
  3657. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  3658. atInventoryInterfaceType = 3;
  3659. }
  3660. if (l == 27) {
  3661. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[i1];
  3662. if (class30_sub2_sub4_sub1_sub2_2 != null) {
  3663. 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]);
  3664. crossX = super.saveClickX;
  3665. crossY = super.saveClickY;
  3666. crossType = 2;
  3667. crossIndex = 0;
  3668. anInt986 += i1;
  3669. if (anInt986 >= 54) {
  3670. stream.createFrame(189);
  3671. stream.writeWordBigEndian(234);
  3672. anInt986 = 0;
  3673. }
  3674. stream.createFrame(73);
  3675. stream.method431(i1);
  3676. }
  3677. }
  3678. if (l == 213) {
  3679. boolean flag3 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  3680. if (!flag3)
  3681. flag3 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  3682. crossX = super.saveClickX;
  3683. crossY = super.saveClickY;
  3684. crossType = 2;
  3685. crossIndex = 0;
  3686. stream.createFrame(79);
  3687. stream.method431(k + baseY);
  3688. stream.writeWord(i1);
  3689. stream.method432(j + baseX);
  3690. }
  3691. if (l == 632) {
  3692. stream.createFrame(145);
  3693. stream.method432(k);
  3694. stream.method432(j);
  3695. stream.method432(i1);
  3696. atInventoryLoopCycle = 0;
  3697. atInventoryInterface = k;
  3698. atInventoryIndex = j;
  3699. atInventoryInterfaceType = 2;
  3700. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3701. atInventoryInterfaceType = 1;
  3702. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  3703. atInventoryInterfaceType = 3;
  3704. }
  3705. if (l == 493) {
  3706. stream.createFrame(75);
  3707. stream.method433(k);
  3708. stream.method431(j);
  3709. stream.method432(i1);
  3710. atInventoryLoopCycle = 0;
  3711. atInventoryInterface = k;
  3712. atInventoryIndex = j;
  3713. atInventoryInterfaceType = 2;
  3714. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3715. atInventoryInterfaceType = 1;
  3716. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  3717. atInventoryInterfaceType = 3;
  3718. }
  3719. if (l == 652) {
  3720. boolean flag4 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  3721. if (!flag4)
  3722. flag4 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  3723. crossX = super.saveClickX;
  3724. crossY = super.saveClickY;
  3725. crossType = 2;
  3726. crossIndex = 0;
  3727. stream.createFrame(156);
  3728. stream.method432(j + baseX);
  3729. stream.method431(k + baseY);
  3730. stream.method433(i1);
  3731. }
  3732. if (l == 94) {
  3733. boolean flag5 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  3734. if (!flag5)
  3735. flag5 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  3736. crossX = super.saveClickX;
  3737. crossY = super.saveClickY;
  3738. crossType = 2;
  3739. crossIndex = 0;
  3740. stream.createFrame(181);
  3741. stream.method431(k + baseY);
  3742. stream.writeWord(i1);
  3743. stream.method431(j + baseX);
  3744. stream.method432(anInt1137);
  3745. }
  3746. if (l == 646) {
  3747. stream.createFrame(185);
  3748. stream.writeWord(k);
  3749. RSInterface class9_2 = RSInterface.interfaceCache[k];
  3750. if (class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5) {
  3751. int i2 = class9_2.valueIndexArray[0][1];
  3752. if (variousSettings[i2] != class9_2.anIntArray212[0]) {
  3753. variousSettings[i2] = class9_2.anIntArray212[0];
  3754. method33(i2);
  3755. needDrawTabArea = true;
  3756. }
  3757. }
  3758. }
  3759. if (l == 225) {
  3760. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[i1];
  3761. if (class30_sub2_sub4_sub1_sub1_2 != null) {
  3762. 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]);
  3763. crossX = super.saveClickX;
  3764. crossY = super.saveClickY;
  3765. crossType = 2;
  3766. crossIndex = 0;
  3767. anInt1226 += i1;
  3768. if (anInt1226 >= 85) {
  3769. stream.createFrame(230);
  3770. stream.writeWordBigEndian(239);
  3771. anInt1226 = 0;
  3772. }
  3773. stream.createFrame(17);
  3774. stream.method433(i1);
  3775. }
  3776. }
  3777. if (l == 965) {
  3778. NPC class30_sub2_sub4_sub1_sub1_3 = npcArray[i1];
  3779. if (class30_sub2_sub4_sub1_sub1_3 != null) {
  3780. 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]);
  3781. crossX = super.saveClickX;
  3782. crossY = super.saveClickY;
  3783. crossType = 2;
  3784. crossIndex = 0;
  3785. anInt1134++;
  3786. if (anInt1134 >= 96) {
  3787. stream.createFrame(152);
  3788. stream.writeWordBigEndian(88);
  3789. anInt1134 = 0;
  3790. }
  3791. stream.createFrame(21);
  3792. stream.writeWord(i1);
  3793. }
  3794. }
  3795. if (l == 413) {
  3796. NPC class30_sub2_sub4_sub1_sub1_4 = npcArray[i1];
  3797. if (class30_sub2_sub4_sub1_sub1_4 != null) {
  3798. 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]);
  3799. crossX = super.saveClickX;
  3800. crossY = super.saveClickY;
  3801. crossType = 2;
  3802. crossIndex = 0;
  3803. stream.createFrame(131);
  3804. stream.method433(i1);
  3805. stream.method432(anInt1137);
  3806. }
  3807. }
  3808. if (l == 200)
  3809. clearTopInterfaces();
  3810. if (l == 1025) {
  3811. NPC class30_sub2_sub4_sub1_sub1_5 = npcArray[i1];
  3812. if (class30_sub2_sub4_sub1_sub1_5 != null) {
  3813. EntityDef entityDef = class30_sub2_sub4_sub1_sub1_5.desc;
  3814. if (entityDef.childrenIDs != null)
  3815. entityDef = entityDef.method161();
  3816. if (entityDef != null) {
  3817. String s9;
  3818. if (entityDef.description != null)
  3819. s9 = new String(entityDef.description);
  3820. else
  3821. s9 = "It's a " + entityDef.name + ".";
  3822. pushMessage(s9, 0, "");
  3823. }
  3824. }
  3825. }
  3826. if (l == 900) {
  3827. method66(i1, k, j);
  3828. stream.createFrame(252);
  3829. stream.method433(i1 >> 14 & 0x7fff);
  3830. stream.method431(k + baseY);
  3831. stream.method432(j + baseX);
  3832. }
  3833. if (l == 412) {
  3834. NPC class30_sub2_sub4_sub1_sub1_6 = npcArray[i1];
  3835. if (class30_sub2_sub4_sub1_sub1_6 != null) {
  3836. 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]);
  3837. crossX = super.saveClickX;
  3838. crossY = super.saveClickY;
  3839. crossType = 2;
  3840. crossIndex = 0;
  3841. stream.createFrame(72);
  3842. stream.method432(i1);
  3843. }
  3844. }
  3845. if (l == 365) {
  3846. Player class30_sub2_sub4_sub1_sub2_3 = playerArray[i1];
  3847. if (class30_sub2_sub4_sub1_sub2_3 != null) {
  3848. 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]);
  3849. crossX = super.saveClickX;
  3850. crossY = super.saveClickY;
  3851. crossType = 2;
  3852. crossIndex = 0;
  3853. stream.createFrame(249);
  3854. stream.method432(i1);
  3855. stream.method431(anInt1137);
  3856. }
  3857. }
  3858. if (l == 729) {
  3859. Player class30_sub2_sub4_sub1_sub2_4 = playerArray[i1];
  3860. if (class30_sub2_sub4_sub1_sub2_4 != null) {
  3861. 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]);
  3862. crossX = super.saveClickX;
  3863. crossY = super.saveClickY;
  3864. crossType = 2;
  3865. crossIndex = 0;
  3866. stream.createFrame(39);
  3867. stream.method431(i1);
  3868. }
  3869. }
  3870. if (l == 577) {
  3871. Player class30_sub2_sub4_sub1_sub2_5 = playerArray[i1];
  3872. if (class30_sub2_sub4_sub1_sub2_5 != null) {
  3873. 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]);
  3874. crossX = super.saveClickX;
  3875. crossY = super.saveClickY;
  3876. crossType = 2;
  3877. crossIndex = 0;
  3878. stream.createFrame(139);
  3879. stream.method431(i1);
  3880. }
  3881. }
  3882. if (l == 956 && method66(i1, k, j)) {
  3883. stream.createFrame(35);
  3884. stream.method431(j + baseX);
  3885. stream.method432(anInt1137);
  3886. stream.method432(k + baseY);
  3887. stream.method431(i1 >> 14 & 0x7fff);
  3888. }
  3889. if (l == 567) {
  3890. boolean flag6 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  3891. if (!flag6)
  3892. flag6 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  3893. crossX = super.saveClickX;
  3894. crossY = super.saveClickY;
  3895. crossType = 2;
  3896. crossIndex = 0;
  3897. stream.createFrame(23);
  3898. stream.method431(k + baseY);
  3899. stream.method431(i1);
  3900. stream.method431(j + baseX);
  3901. }
  3902. if (l == 867) {
  3903. if ((i1 & 3) == 0)
  3904. anInt1175++;
  3905. if (anInt1175 >= 59) {
  3906. stream.createFrame(200);
  3907. stream.writeWord(25501);
  3908. anInt1175 = 0;
  3909. }
  3910. stream.createFrame(43);
  3911. stream.method431(k);
  3912. stream.method432(i1);
  3913. stream.method432(j);
  3914. atInventoryLoopCycle = 0;
  3915. atInventoryInterface = k;
  3916. atInventoryIndex = j;
  3917. atInventoryInterfaceType = 2;
  3918. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3919. atInventoryInterfaceType = 1;
  3920. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  3921. atInventoryInterfaceType = 3;
  3922. }
  3923. if (l == 543) {
  3924. stream.createFrame(237);
  3925. stream.writeWord(j);
  3926. stream.method432(i1);
  3927. stream.writeWord(k);
  3928. stream.method432(anInt1137);
  3929. atInventoryLoopCycle = 0;
  3930. atInventoryInterface = k;
  3931. atInventoryIndex = j;
  3932. atInventoryInterfaceType = 2;
  3933. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3934. atInventoryInterfaceType = 1;
  3935. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  3936. atInventoryInterfaceType = 3;
  3937. }
  3938. if (l == 606) {
  3939. String s2 = menuActionName[i];
  3940. int j2 = s2.indexOf("@whi@");
  3941. if (j2 != -1)
  3942. if (openInterfaceID == -1) {
  3943. clearTopInterfaces();
  3944. reportAbuseInput = s2.substring(j2 + 5).trim();
  3945. canMute = false;
  3946. for (int i3 = 0; i3 < RSInterface.interfaceCache.length; i3++) {
  3947. if (RSInterface.interfaceCache[i3] == null || RSInterface.interfaceCache[i3].contentType != 600)
  3948. continue;
  3949. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i3].parentID;
  3950. break;
  3951. }
  3952.  
  3953. } else {
  3954. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  3955. }
  3956. }
  3957. if (l == 491) {
  3958. Player class30_sub2_sub4_sub1_sub2_6 = playerArray[i1];
  3959. if (class30_sub2_sub4_sub1_sub2_6 != null) {
  3960. 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]);
  3961. crossX = super.saveClickX;
  3962. crossY = super.saveClickY;
  3963. crossType = 2;
  3964. crossIndex = 0;
  3965. stream.createFrame(14);
  3966. stream.method432(anInt1284);
  3967. stream.writeWord(i1);
  3968. stream.writeWord(anInt1285);
  3969. stream.method431(anInt1283);
  3970. }
  3971. }
  3972. if (l == 639) {
  3973. String s3 = menuActionName[i];
  3974. int k2 = s3.indexOf("@whi@");
  3975. if (k2 != -1) {
  3976. long l4 = TextClass.longForName(s3.substring(k2 + 5).trim());
  3977. int k3 = -1;
  3978. for (int i4 = 0; i4 < friendsCount; i4++) {
  3979. if (friendsListAsLongs[i4] != l4)
  3980. continue;
  3981. k3 = i4;
  3982. break;
  3983. }
  3984.  
  3985. if (k3 != -1 && friendsNodeIDs[k3] > 0) {
  3986. inputTaken = true;
  3987. inputDialogState = 0;
  3988. messagePromptRaised = true;
  3989. promptInput = "";
  3990. friendsListAction = 3;
  3991. aLong953 = friendsListAsLongs[k3];
  3992. aString1121 = "Enter message to send to " + friendsList[k3];
  3993. }
  3994. }
  3995. }
  3996. if (l == 454) {
  3997. stream.createFrame(41);
  3998. stream.writeWord(i1);
  3999. stream.method432(j);
  4000. stream.method432(k);
  4001. atInventoryLoopCycle = 0;
  4002. atInventoryInterface = k;
  4003. atInventoryIndex = j;
  4004. atInventoryInterfaceType = 2;
  4005. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4006. atInventoryInterfaceType = 1;
  4007. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4008. atInventoryInterfaceType = 3;
  4009. }
  4010. if (l == 478) {
  4011. NPC class30_sub2_sub4_sub1_sub1_7 = npcArray[i1];
  4012. if (class30_sub2_sub4_sub1_sub1_7 != null) {
  4013. 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]);
  4014. crossX = super.saveClickX;
  4015. crossY = super.saveClickY;
  4016. crossType = 2;
  4017. crossIndex = 0;
  4018. if ((i1 & 3) == 0)
  4019. anInt1155++;
  4020. if (anInt1155 >= 53) {
  4021. stream.createFrame(85);
  4022. stream.writeWordBigEndian(66);
  4023. anInt1155 = 0;
  4024. }
  4025. stream.createFrame(18);
  4026. stream.method431(i1);
  4027. }
  4028. }
  4029. if (l == 113) {
  4030. method66(i1, k, j);
  4031. stream.createFrame(70);
  4032. stream.method431(j + baseX);
  4033. stream.writeWord(k + baseY);
  4034. stream.method433(i1 >> 14 & 0x7fff);
  4035. }
  4036. if (l == 872) {
  4037. method66(i1, k, j);
  4038. stream.createFrame(234);
  4039. stream.method433(j + baseX);
  4040. stream.method432(i1 >> 14 & 0x7fff);
  4041. stream.method433(k + baseY);
  4042. }
  4043. if (l == 502) {
  4044. method66(i1, k, j);
  4045. stream.createFrame(132);
  4046. stream.method433(j + baseX);
  4047. stream.writeWord(i1 >> 14 & 0x7fff);
  4048. stream.method432(k + baseY);
  4049. }
  4050. if (l == 1125) {
  4051. ItemDef itemDef = ItemDef.forID(i1);
  4052. RSInterface class9_4 = RSInterface.interfaceCache[k];
  4053. String s5;
  4054. if (class9_4 != null && class9_4.invStackSizes[j] >= 0x186a0) {
  4055. DecimalFormatSymbols separator = new DecimalFormatSymbols();
  4056. separator.setGroupingSeparator(',');
  4057. DecimalFormat formatter = new DecimalFormat("#,###,###,###", separator);
  4058. s5 = formatter.format(class9_4.invStackSizes[j]) + " x " + itemDef.name;
  4059. } else if (itemDef.description != null)
  4060. s5 = new String(itemDef.description);
  4061. else
  4062. s5 = "It's a " + itemDef.name + ".";
  4063. pushMessage(s5, 0, "");
  4064. }
  4065. if (l == 169) {
  4066. stream.createFrame(185);
  4067. stream.writeWord(k);
  4068. RSInterface class9_3 = RSInterface.interfaceCache[k];
  4069. if (class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5) {
  4070. int l2 = class9_3.valueIndexArray[0][1];
  4071. variousSettings[l2] = 1 - variousSettings[l2];
  4072. method33(l2);
  4073. needDrawTabArea = true;
  4074. }
  4075. }
  4076. if (l == 447) {
  4077. itemSelected = 1;
  4078. anInt1283 = j;
  4079. anInt1284 = k;
  4080. anInt1285 = i1;
  4081. selectedItemName = ItemDef.forID(i1).name;
  4082. spellSelected = 0;
  4083. needDrawTabArea = true;
  4084. return;
  4085. }
  4086. if (l == 1226) {
  4087. int j1 = i1 >> 14 & 0x7fff;
  4088. ObjectDef class46 = ObjectDef.forID(j1);
  4089. String s10;
  4090. if (class46.description != null)
  4091. s10 = new String(class46.description);
  4092. else
  4093. s10 = "It's a " + class46.name + ".";
  4094. pushMessage(s10, 0, "");
  4095. }
  4096. if (l == 244) {
  4097. boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4098. if (!flag7)
  4099. flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4100. crossX = super.saveClickX;
  4101. crossY = super.saveClickY;
  4102. crossType = 2;
  4103. crossIndex = 0;
  4104. stream.createFrame(253);
  4105. stream.method431(j + baseX);
  4106. stream.method433(k + baseY);
  4107. stream.method432(i1);
  4108. }
  4109. if (l == 1448) {
  4110. ItemDef itemDef_1 = ItemDef.forID(i1);
  4111. String s6;
  4112. if (itemDef_1.description != null)
  4113. s6 = new String(itemDef_1.description);
  4114. else
  4115. s6 = "It's a " + itemDef_1.name + ".";
  4116. pushMessage(s6, 0, "");
  4117. }
  4118. itemSelected = 0;
  4119. spellSelected = 0;
  4120. needDrawTabArea = true;
  4121.  
  4122. }
  4123.  
  4124. private void method70() {
  4125. anInt1251 = 0;
  4126. int j = (myPlayer.x >> 7) + baseX;
  4127. int k = (myPlayer.y >> 7) + baseY;
  4128. if (j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
  4129. anInt1251 = 1;
  4130. if (j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
  4131. anInt1251 = 1;
  4132. if (anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
  4133. anInt1251 = 0;
  4134. }
  4135.  
  4136. public void run() {
  4137. if (drawFlames) {
  4138. drawFlames();
  4139. } else {
  4140. super.run();
  4141. }
  4142. }
  4143.  
  4144. private void build3dScreenMenu() {
  4145. if (itemSelected == 0 && spellSelected == 0) {
  4146. menuActionName[menuActionRow] = "Walk here";
  4147. menuActionID[menuActionRow] = 516;
  4148. menuActionCmd2[menuActionRow] = super.mouseX;
  4149. menuActionCmd3[menuActionRow] = super.mouseY;
  4150. menuActionRow++;
  4151. }
  4152. int j = -1;
  4153. for (int k = 0; k < Model.anInt1687; k++) {
  4154. int l = Model.anIntArray1688[k];
  4155. int i1 = l & 0x7f;
  4156. int j1 = l >> 7 & 0x7f;
  4157. int k1 = l >> 29 & 3;
  4158. int l1 = l >> 14 & 0x7fff;
  4159. if (l == j)
  4160. continue;
  4161. j = l;
  4162. if (k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0) {
  4163. ObjectDef class46 = ObjectDef.forID(l1);
  4164. if (class46.childrenIDs != null)
  4165. class46 = class46.method580();
  4166. if (class46 == null)
  4167. continue;
  4168. if (itemSelected == 1) {
  4169. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @cya@" + class46.name;
  4170. menuActionID[menuActionRow] = 62;
  4171. menuActionCmd1[menuActionRow] = l;
  4172. menuActionCmd2[menuActionRow] = i1;
  4173. menuActionCmd3[menuActionRow] = j1;
  4174. menuActionRow++;
  4175. } else if (spellSelected == 1) {
  4176. if ((spellUsableOn & 4) == 4) {
  4177. menuActionName[menuActionRow] = spellTooltip + " @cya@" + class46.name;
  4178. menuActionID[menuActionRow] = 956;
  4179. menuActionCmd1[menuActionRow] = l;
  4180. menuActionCmd2[menuActionRow] = i1;
  4181. menuActionCmd3[menuActionRow] = j1;
  4182. menuActionRow++;
  4183. }
  4184. } else {
  4185. if (class46.actions != null) {
  4186. for (int i2 = 4; i2 >= 0; i2--)
  4187. if (class46.actions[i2] != null) {
  4188. menuActionName[menuActionRow] = class46.actions[i2] + " @cya@" + class46.name;
  4189. if (i2 == 0)
  4190. menuActionID[menuActionRow] = 502;
  4191. if (i2 == 1)
  4192. menuActionID[menuActionRow] = 900;
  4193. if (i2 == 2)
  4194. menuActionID[menuActionRow] = 113;
  4195. if (i2 == 3)
  4196. menuActionID[menuActionRow] = 872;
  4197. if (i2 == 4)
  4198. menuActionID[menuActionRow] = 1062;
  4199. menuActionCmd1[menuActionRow] = l;
  4200. menuActionCmd2[menuActionRow] = i1;
  4201. menuActionCmd3[menuActionRow] = j1;
  4202. menuActionRow++;
  4203. }
  4204.  
  4205. }
  4206. menuActionName[menuActionRow] = "Examine @cya@" + class46.name;
  4207. menuActionID[menuActionRow] = 1226;
  4208. menuActionCmd1[menuActionRow] = class46.type << 14;
  4209. menuActionCmd2[menuActionRow] = i1;
  4210. menuActionCmd3[menuActionRow] = j1;
  4211. menuActionRow++;
  4212. }
  4213. }
  4214. if (k1 == 1) {
  4215. NPC npc = npcArray[l1];
  4216. if (npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64) {
  4217. for (int j2 = 0; j2 < npcCount; j2++) {
  4218. NPC npc2 = npcArray[npcIndices[j2]];
  4219. if (npc2 != null && npc2 != npc && npc2.desc.aByte68 == 1 && npc2.x == npc.x && npc2.y == npc.y)
  4220. buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
  4221. }
  4222.  
  4223. for (int l2 = 0; l2 < playerCount; l2++) {
  4224. Player player = playerArray[playerIndices[l2]];
  4225. if (player != null && player.x == npc.x && player.y == npc.y)
  4226. buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
  4227. }
  4228.  
  4229. }
  4230. buildAtNPCMenu(npc.desc, l1, j1, i1);
  4231. }
  4232. if (k1 == 0) {
  4233. Player player = playerArray[l1];
  4234. if ((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  4235. for (int k2 = 0; k2 < npcCount; k2++) {
  4236. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
  4237. 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)
  4238. buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc, npcIndices[k2], j1, i1);
  4239. }
  4240.  
  4241. for (int i3 = 0; i3 < playerCount; i3++) {
  4242. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
  4243. 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)
  4244. buildAtPlayerMenu(i1, playerIndices[i3], class30_sub2_sub4_sub1_sub2_2, j1);
  4245. }
  4246.  
  4247. }
  4248. buildAtPlayerMenu(i1, l1, player, j1);
  4249. }
  4250. if (k1 == 3) {
  4251. NodeList class19 = groundArray[plane][i1][j1];
  4252. if (class19 != null) {
  4253. for (Item item = (Item) class19.getFirst(); item != null; item = (Item) class19.getNext()) {
  4254. ItemDef itemDef = ItemDef.forID(item.ID);
  4255. if (itemSelected == 1) {
  4256. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  4257. menuActionID[menuActionRow] = 511;
  4258. menuActionCmd1[menuActionRow] = item.ID;
  4259. menuActionCmd2[menuActionRow] = i1;
  4260. menuActionCmd3[menuActionRow] = j1;
  4261. menuActionRow++;
  4262. } else if (spellSelected == 1) {
  4263. if ((spellUsableOn & 1) == 1) {
  4264. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  4265. menuActionID[menuActionRow] = 94;
  4266. menuActionCmd1[menuActionRow] = item.ID;
  4267. menuActionCmd2[menuActionRow] = i1;
  4268. menuActionCmd3[menuActionRow] = j1;
  4269. menuActionRow++;
  4270. }
  4271. } else {
  4272. for (int j3 = 4; j3 >= 0; j3--)
  4273. if (itemDef.groundActions != null && itemDef.groundActions[j3] != null) {
  4274. menuActionName[menuActionRow] = itemDef.groundActions[j3] + " @lre@" + itemDef.name;
  4275. if (j3 == 0)
  4276. menuActionID[menuActionRow] = 652;
  4277. if (j3 == 1)
  4278. menuActionID[menuActionRow] = 567;
  4279. if (j3 == 2)
  4280. menuActionID[menuActionRow] = 234;
  4281. if (j3 == 3)
  4282. menuActionID[menuActionRow] = 244;
  4283. if (j3 == 4)
  4284. menuActionID[menuActionRow] = 213;
  4285. menuActionCmd1[menuActionRow] = item.ID;
  4286. menuActionCmd2[menuActionRow] = i1;
  4287. menuActionCmd3[menuActionRow] = j1;
  4288. menuActionRow++;
  4289. } else if (j3 == 2) {
  4290. menuActionName[menuActionRow] = "Take @lre@" + itemDef.name;
  4291. menuActionID[menuActionRow] = 234;
  4292. menuActionCmd1[menuActionRow] = item.ID;
  4293. menuActionCmd2[menuActionRow] = i1;
  4294. menuActionCmd3[menuActionRow] = j1;
  4295. menuActionRow++;
  4296. }
  4297.  
  4298. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  4299. menuActionID[menuActionRow] = 1448;
  4300. menuActionCmd1[menuActionRow] = item.ID;
  4301. menuActionCmd2[menuActionRow] = i1;
  4302. menuActionCmd3[menuActionRow] = j1;
  4303. menuActionRow++;
  4304. }
  4305. }
  4306.  
  4307. }
  4308. }
  4309. }
  4310. }
  4311.  
  4312. public void cleanUpForQuit() {
  4313. signlink.reporterror = false;
  4314. try {
  4315. if (socketStream != null)
  4316. socketStream.close();
  4317. }
  4318. catch (Exception _ex) {
  4319. }
  4320. socketStream = null;
  4321. stopMidi();
  4322. onDemandFetcher.disable();
  4323. onDemandFetcher = null;
  4324. aStream_834 = null;
  4325. stream = null;
  4326. aStream_847 = null;
  4327. inStream = null;
  4328. anIntArray1234 = null;
  4329. aByteArrayArray1183 = null;
  4330. aByteArrayArray1247 = null;
  4331. anIntArray1235 = null;
  4332. anIntArray1236 = null;
  4333. intGroundArray = null;
  4334. byteGroundArray = null;
  4335. worldController = null;
  4336. aClass11Array1230 = null;
  4337. anIntArrayArray901 = null;
  4338. anIntArrayArray825 = null;
  4339. bigX = null;
  4340. bigY = null;
  4341. aByteArray912 = null;
  4342. leftFrame = null;
  4343. topFrame = null;
  4344. aRSImageProducer_1163 = null;
  4345. aRSImageProducer_1164 = null;
  4346. aRSImageProducer_1165 = null;
  4347. aRSImageProducer_1166 = null;
  4348. aRSImageProducer_1123 = null;
  4349. aRSImageProducer_1124 = null;
  4350. aRSImageProducer_1125 = null;
  4351. invBack = null;
  4352. mapBack = null;
  4353. chatBack = null;
  4354. backBase1 = null;
  4355. backBase2 = null;
  4356. backHmid1 = null;
  4357. sideIcons = null;
  4358. redStone1 = null;
  4359. redStone2 = null;
  4360. redStone3 = null;
  4361. redStone1_2 = null;
  4362. redStone2_2 = null;
  4363. redStone1_3 = null;
  4364. redStone2_3 = null;
  4365. redStone3_2 = null;
  4366. redStone1_4 = null;
  4367. redStone2_4 = null;
  4368. compass = null;
  4369. hitMarks = null;
  4370. headIcons = null;
  4371. skullIcons = null;
  4372. cacheSprite = null;
  4373. cacheInterface = null;
  4374. headIconsHint = null;
  4375. multiOverlay = null;
  4376. crosses = null;
  4377. mapDotItem = null;
  4378. mapDotNPC = null;
  4379. mapDotPlayer = null;
  4380. mapDotFriend = null;
  4381. mapDotTeam = null;
  4382. mapScenes = null;
  4383. mapFunctions = null;
  4384. anIntArrayArray929 = null;
  4385. playerArray = null;
  4386. playerIndices = null;
  4387. anIntArray894 = null;
  4388. aStreamArray895s = null;
  4389. anIntArray840 = null;
  4390. npcArray = null;
  4391. npcIndices = null;
  4392. groundArray = null;
  4393. aClass19_1179 = null;
  4394. aClass19_1013 = null;
  4395. aClass19_1056 = null;
  4396. menuActionCmd2 = null;
  4397. menuActionCmd3 = null;
  4398. menuActionID = null;
  4399. menuActionCmd1 = null;
  4400. menuActionName = null;
  4401. variousSettings = null;
  4402. anIntArray1072 = null;
  4403. anIntArray1073 = null;
  4404. aClass30_Sub2_Sub1_Sub1Array1140 = null;
  4405. minimapImage = null;
  4406. friendsList = null;
  4407. friendsListAsLongs = null;
  4408. friendsNodeIDs = null;
  4409. aRSImageProducer_1110 = null;
  4410. aRSImageProducer_1111 = null;
  4411. aRSImageProducer_1107 = null;
  4412. aRSImageProducer_1108 = null;
  4413. aRSImageProducer_1109 = null;
  4414. aRSImageProducer_1112 = null;
  4415. aRSImageProducer_1113 = null;
  4416. aRSImageProducer_1114 = null;
  4417. aRSImageProducer_1115 = null;
  4418. nullLoader();
  4419. ObjectDef.nullLoader();
  4420. EntityDef.nullLoader();
  4421. ItemDef.nullLoader();
  4422. Flo.cache = null;
  4423. IDK.cache = null;
  4424. RSInterface.interfaceCache = null;
  4425. Animation.anims = null;
  4426. SpotAnim.cache = null;
  4427. SpotAnim.aMRUNodes_415 = null;
  4428. Varp.cache = null;
  4429. super.fullGameScreen = null;
  4430. Player.mruNodes = null;
  4431. Texture.nullLoader();
  4432. WorldController.nullLoader();
  4433. Model.nullLoader();
  4434. FrameReader.nullLoader();
  4435. System.gc();
  4436. }
  4437.  
  4438. private void printDebug() {
  4439. System.out.println("============");
  4440. System.out.println("flame-cycle:" + anInt1208);
  4441. if (onDemandFetcher != null)
  4442. System.out.println("Od-cycle:" + onDemandFetcher.onDemandCycle);
  4443. System.out.println("loop-cycle:" + loopCycle);
  4444. System.out.println("draw-cycle:" + anInt1061);
  4445. System.out.println("ptype:" + pktType);
  4446. System.out.println("psize:" + pktSize);
  4447. if (socketStream != null)
  4448. socketStream.printDebug();
  4449. super.shouldDebug = true;
  4450. }
  4451.  
  4452. Component getGameComponent() {
  4453. if (signlink.mainapp != null)
  4454. return signlink.mainapp;
  4455. if (super.gameFrame != null)
  4456. return super.gameFrame;
  4457. else
  4458. return this;
  4459. }
  4460.  
  4461. private void method73() {
  4462. do {
  4463. int j = readChar(-796);
  4464. if (j == -1)
  4465. break;
  4466. if(j == 96)
  4467. break;
  4468. if (console.openConsole) {
  4469. if (j == 8 && console.consoleInput.length() > 0)
  4470. console.consoleInput = console.consoleInput.substring(0, console.consoleInput.length() - 1);
  4471. if (j >= 32 && j <= 122 && console.consoleInput.length() < 80)
  4472. console.consoleInput += (char) j;
  4473.  
  4474. if ((j == 13 || j == 10) && console.consoleInput.length() > 0) {
  4475. console.sendConsoleMessage(console.consoleInput, true);
  4476. console.sendConsoleCommands(console.consoleInput);
  4477. console.consoleInput = "";
  4478. inputTaken = true;
  4479. }
  4480. }
  4481. else
  4482. if (openInterfaceID != -1 && openInterfaceID == reportAbuseInterfaceID) {
  4483. if (j == 8 && reportAbuseInput.length() > 0)
  4484. reportAbuseInput = reportAbuseInput.substring(0, reportAbuseInput.length() - 1);
  4485. if ((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48 && j <= 57 || j == 32) && reportAbuseInput.length() < 12)
  4486. reportAbuseInput += (char) j;
  4487. } else if (messagePromptRaised) {
  4488. if (j >= 32 && j <= 122 && promptInput.length() < 80) {
  4489. promptInput += (char) j;
  4490. inputTaken = true;
  4491. }
  4492. if (j == 8 && promptInput.length() > 0) {
  4493. promptInput = promptInput.substring(0, promptInput.length() - 1);
  4494. inputTaken = true;
  4495. }
  4496. if (j == 13 || j == 10) {
  4497. messagePromptRaised = false;
  4498. inputTaken = true;
  4499. if (friendsListAction == 1) {
  4500. long l = TextClass.longForName(promptInput);
  4501. addFriend(l);
  4502. }
  4503. if (friendsListAction == 2 && friendsCount > 0) {
  4504. long l1 = TextClass.longForName(promptInput);
  4505. delFriend(l1);
  4506. }
  4507. if (friendsListAction == 3 && promptInput.length() > 0) {
  4508. stream.createFrame(126);
  4509. stream.writeWordBigEndian(0);
  4510. int k = stream.currentOffset;
  4511. stream.writeQWord(aLong953);
  4512. TextInput.method526(promptInput, stream);
  4513. stream.writeBytes(stream.currentOffset - k);
  4514. promptInput = TextInput.processText(promptInput);
  4515. // promptInput = Censor.doCensor(promptInput);
  4516. pushMessage(promptInput, 6, TextClass.fixName(TextClass.nameForLong(aLong953)));
  4517. if (privateChatMode == 2) {
  4518. privateChatMode = 1;
  4519. aBoolean1233 = true;
  4520. stream.createFrame(95);
  4521. stream.writeWordBigEndian(publicChatMode);
  4522. stream.writeWordBigEndian(privateChatMode);
  4523. stream.writeWordBigEndian(tradeMode);
  4524. }
  4525. }
  4526. if (friendsListAction == 4 && ignoreCount < 100) {
  4527. long l2 = TextClass.longForName(promptInput);
  4528. addIgnore(l2);
  4529. }
  4530. if (friendsListAction == 5 && ignoreCount > 0) {
  4531. long l3 = TextClass.longForName(promptInput);
  4532. delIgnore(l3);
  4533. }
  4534. }
  4535. } else if (inputDialogState == 1) {
  4536. if (j >= 48 && j <= 57 && amountOrNameInput.length() < 10) {
  4537. amountOrNameInput += (char) j;
  4538. inputTaken = true;
  4539. }
  4540. if ((!amountOrNameInput.toLowerCase().contains("k") && !amountOrNameInput.toLowerCase().contains("m") && !amountOrNameInput.toLowerCase().contains("b")) && (j == 107 || j == 109) || j == 98) {
  4541. amountOrNameInput += (char) j;
  4542. inputTaken = true;
  4543. }
  4544. if (j == 8 && amountOrNameInput.length() > 0) {
  4545. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  4546. inputTaken = true;
  4547. }
  4548. if (j == 13 || j == 10) {
  4549. if (amountOrNameInput.length() > 0) {
  4550. if (amountOrNameInput.toLowerCase().contains("k")) {
  4551. amountOrNameInput = amountOrNameInput.replaceAll("k", "000");
  4552. } else if (amountOrNameInput.toLowerCase().contains("m")) {
  4553. amountOrNameInput = amountOrNameInput.replaceAll("m", "000000");
  4554. } else if (amountOrNameInput.toLowerCase().contains("b")) {
  4555. amountOrNameInput = amountOrNameInput.replaceAll("b", "000000000");
  4556. }
  4557. int amount = 0;
  4558. amount = Integer.parseInt(amountOrNameInput);
  4559. stream.createFrame(208);
  4560. stream.writeDWord(amount);
  4561. }
  4562. inputDialogState = 0;
  4563. inputTaken = true;
  4564. }
  4565. } else if (inputDialogState == 2) {
  4566. if (j >= 32 && j <= 122 && amountOrNameInput.length() < 12) {
  4567. amountOrNameInput += (char) j;
  4568. inputTaken = true;
  4569. }
  4570. if (j == 8 && amountOrNameInput.length() > 0) {
  4571. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  4572. inputTaken = true;
  4573. }
  4574. if (j == 13 || j == 10) {
  4575. if (amountOrNameInput.length() > 0) {
  4576. stream.createFrame(60);
  4577. stream.writeQWord(TextClass.longForName(amountOrNameInput));
  4578. }
  4579. inputDialogState = 0;
  4580. inputTaken = true;
  4581. }
  4582. } else if (backDialogID == -1) {
  4583. if (j >= 32 && j <= 122 && inputString.length() < 80) {
  4584. inputString += (char) j;
  4585. inputTaken = true;
  4586. }
  4587. if (j == 8 && inputString.length() > 0) {
  4588. inputString = inputString.substring(0, inputString.length() - 1);
  4589. inputTaken = true;
  4590. }
  4591. if (j == 9) tabToReplyPm();
  4592. if ((j == 13 || j == 10) && inputString.length() > 0) {
  4593. if (myPrivilege == 2) {
  4594. if (inputString.equals("::clientdrop")) {
  4595. dropClient();
  4596. }
  4597. if (inputString.equals("::lag")) {
  4598. printDebug();
  4599. }
  4600. }
  4601. if(inputString.equals("::123")){
  4602. // updateEntities();
  4603. // drawHeadIcon();
  4604. // draw3dScreen();
  4605. // refreshFrameSize();
  4606. setBounds();
  4607. }
  4608. if (inputString.equals("::toggleroofs")) {
  4609. roofsOff =! roofsOff;
  4610. pushMessage("Roofs are now " + (roofsOff ? "off..." : "on..."), 0, "");
  4611. try {
  4612. writeSettings();
  4613. } catch(Exception e) {
  4614.  
  4615. }
  4616. }
  4617. if(inputString.equals("::fixed")) {
  4618. frameMode(ScreenMode.FIXED);
  4619. }
  4620. if(inputString.equals("::resize")) {
  4621. frameMode(ScreenMode.RESIZABLE);
  4622. }
  4623. if(inputString.equals("::tweening")) {
  4624. Settings.enableTweening =! Settings.enableTweening;
  4625. pushMessage("Tweening is now " + (Settings.enableTweening ? "on..." : "off..."), 0, "");
  4626. try {
  4627. writeSettings();
  4628. } catch(Exception e) {
  4629.  
  4630. }
  4631. }
  4632. if(inputString.equals("::fog"))
  4633. if (Settings.FogToggle) {
  4634. Settings.FogToggle = false;
  4635. } else {
  4636. Settings.FogToggle = true;
  4637. }
  4638. if (inputString.equals("::data")) {
  4639. clientData =! clientData;
  4640. }
  4641. if (inputString.equalsIgnoreCase("::fps")) {
  4642. fpsOn =! fpsOn;
  4643. }
  4644. if (inputString.equals("::317")) {
  4645. is317 =! is317;
  4646. pushMessage("317 sprites are now " + (is317 ? "on..." : "off..."), 0, "");
  4647. try {
  4648. writeSettings();
  4649. } catch(Exception e) {
  4650.  
  4651. }
  4652. }
  4653. if(inputString.equals("::low")){
  4654. setLowMem();
  4655. }
  4656. if(inputString.equals("::high")){
  4657. setHighMem();
  4658. }
  4659. if(inputString.equals("::hide")) {
  4660. if (frameMode == ScreenMode.FIXED) {
  4661. pushMessage("You cannot do this while in fixed mode...", 0, "");
  4662. } else {
  4663. hideGameFrame =! hideGameFrame;
  4664. }
  4665. }
  4666. if(inputString.equals("::unhide")) {
  4667. if (frameMode == ScreenMode.FIXED) {
  4668. pushMessage("You cannot do this while in fixed mode...", 0, "");
  4669. } else {
  4670. if (hideGameFrame == false ) {
  4671. pushMessage("You cannot do this while the gameframe is showing...", 0, "");
  4672. } else {
  4673. hideGameFrame = false;
  4674. }
  4675. }
  4676. }
  4677. if (inputString.startsWith("::")) {
  4678. stream.createFrame(103);
  4679. stream.writeWordBigEndian(inputString.length() - 1);
  4680. stream.writeString(inputString.substring(2));
  4681. } else {
  4682. String s = inputString.toLowerCase();
  4683. int j2 = 0;
  4684. if (s.startsWith("yellow:")) {
  4685. j2 = 0;
  4686. inputString = inputString.substring(7);
  4687. } else if (s.startsWith("red:")) {
  4688. j2 = 1;
  4689. inputString = inputString.substring(4);
  4690. } else if (s.startsWith("green:")) {
  4691. j2 = 2;
  4692. inputString = inputString.substring(6);
  4693. } else if (s.startsWith("cyan:")) {
  4694. j2 = 3;
  4695. inputString = inputString.substring(5);
  4696. } else if (s.startsWith("purple:")) {
  4697. j2 = 4;
  4698. inputString = inputString.substring(7);
  4699. } else if (s.startsWith("white:")) {
  4700. j2 = 5;
  4701. inputString = inputString.substring(6);
  4702. } else if (s.startsWith("flash1:")) {
  4703. j2 = 6;
  4704. inputString = inputString.substring(7);
  4705. } else if (s.startsWith("flash2:")) {
  4706. j2 = 7;
  4707. inputString = inputString.substring(7);
  4708. } else if (s.startsWith("flash3:")) {
  4709. j2 = 8;
  4710. inputString = inputString.substring(7);
  4711. } else if (s.startsWith("glow1:")) {
  4712. j2 = 9;
  4713. inputString = inputString.substring(6);
  4714. } else if (s.startsWith("glow2:")) {
  4715. j2 = 10;
  4716. inputString = inputString.substring(6);
  4717. } else if (s.startsWith("glow3:")) {
  4718. j2 = 11;
  4719. inputString = inputString.substring(6);
  4720. }
  4721. s = inputString.toLowerCase();
  4722. int i3 = 0;
  4723. if (s.startsWith("wave:")) {
  4724. i3 = 1;
  4725. inputString = inputString.substring(5);
  4726. } else if (s.startsWith("wave2:")) {
  4727. i3 = 2;
  4728. inputString = inputString.substring(6);
  4729. } else if (s.startsWith("shake:")) {
  4730. i3 = 3;
  4731. inputString = inputString.substring(6);
  4732. } else if (s.startsWith("scroll:")) {
  4733. i3 = 4;
  4734. inputString = inputString.substring(7);
  4735. } else if (s.startsWith("slide:")) {
  4736. i3 = 5;
  4737. inputString = inputString.substring(6);
  4738. }
  4739. stream.createFrame(4);
  4740. stream.writeWordBigEndian(0);
  4741. int j3 = stream.currentOffset;
  4742. stream.method425(i3);
  4743. stream.method425(j2);
  4744. aStream_834.currentOffset = 0;
  4745. TextInput.method526(inputString, aStream_834);
  4746. stream.method441(0, aStream_834.buffer, aStream_834.currentOffset);
  4747. stream.writeBytes(stream.currentOffset - j3);
  4748. inputString = TextInput.processText(inputString);
  4749. // inputString = Censor.doCensor(inputString);
  4750. myPlayer.textSpoken = inputString;
  4751. myPlayer.anInt1513 = j2;
  4752. myPlayer.anInt1531 = i3;
  4753. myPlayer.textCycle = 150;
  4754. if (myPrivilege == 2)
  4755. pushMessage(myPlayer.textSpoken, 2, "@cr2@" + myPlayer.name);
  4756. else if (myPrivilege == 1)
  4757. pushMessage(myPlayer.textSpoken, 2, "@cr1@" + myPlayer.name);
  4758. else
  4759. pushMessage(myPlayer.textSpoken, 2, myPlayer.name);
  4760. if (publicChatMode == 2) {
  4761. publicChatMode = 3;
  4762. aBoolean1233 = true;
  4763. stream.createFrame(95);
  4764. stream.writeWordBigEndian(publicChatMode);
  4765. stream.writeWordBigEndian(privateChatMode);
  4766. stream.writeWordBigEndian(tradeMode);
  4767. }
  4768. }
  4769. inputString = "";
  4770. inputTaken = true;
  4771. }
  4772. }
  4773. } while (true);
  4774. }
  4775.  
  4776. private void buildChatAreaMenu(int j) {
  4777. int l = 0;
  4778. for (int i1 = 0; i1 < 100; i1++) {
  4779. if (chatMessages[i1] == null)
  4780. continue;
  4781. int j1 = chatTypes[i1];
  4782. int k1 = (70 - l * 14) + anInt1089 + 4;
  4783. if (k1 < -20)
  4784. break;
  4785. String s = chatNames[i1];
  4786. boolean flag = false;
  4787. if (s != null && s.startsWith("@cr1@")) {
  4788. s = s.substring(5);
  4789. boolean flag1 = true;
  4790. }
  4791. if (s != null && s.startsWith("@cr2@")) {
  4792. s = s.substring(5);
  4793. byte byte0 = 2;
  4794. }
  4795. if (j1 == 0)
  4796. l++;
  4797. if ((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  4798. if (j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  4799. if (myPrivilege >= 1) {
  4800. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  4801. menuActionID[menuActionRow] = 606;
  4802. menuActionRow++;
  4803. }
  4804. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  4805. menuActionID[menuActionRow] = 42;
  4806. menuActionRow++;
  4807. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  4808. menuActionID[menuActionRow] = 337;
  4809. menuActionRow++;
  4810. }
  4811. l++;
  4812. }
  4813. if ((j1 == 3 || j1 == 7) && splitPrivateChat == 0 && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  4814. if (j > k1 - 14 && j <= k1) {
  4815. if (myPrivilege >= 1) {
  4816. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  4817. menuActionID[menuActionRow] = 606;
  4818. menuActionRow++;
  4819. }
  4820. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  4821. menuActionID[menuActionRow] = 42;
  4822. menuActionRow++;
  4823. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  4824. menuActionID[menuActionRow] = 337;
  4825. menuActionRow++;
  4826. }
  4827. l++;
  4828. }
  4829. if (j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  4830. if (j > k1 - 14 && j <= k1) {
  4831. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  4832. menuActionID[menuActionRow] = 484;
  4833. menuActionRow++;
  4834. }
  4835. l++;
  4836. }
  4837. if ((j1 == 5 || j1 == 6) && splitPrivateChat == 0 && privateChatMode < 2)
  4838. l++;
  4839. if (j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  4840. if (j > k1 - 14 && j <= k1) {
  4841. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  4842. menuActionID[menuActionRow] = 6;
  4843. menuActionRow++;
  4844. }
  4845. l++;
  4846. }
  4847. }
  4848.  
  4849. }
  4850.  
  4851. public int getXPForLevel(int level)
  4852. {
  4853. int points = 0;
  4854. int output = 0;
  4855. for (int lvl = 1; lvl <= level; lvl++) {
  4856. points += Math.floor(lvl + 300.0 * Math.pow(2.0, lvl / 7.0));
  4857. if (lvl >= level)
  4858. {
  4859. return output;
  4860. }
  4861. output = (int) Math.floor(points / 4);
  4862. }
  4863. return 0;
  4864. }
  4865.  
  4866. public int expAdded;
  4867.  
  4868. public long xpCounter;
  4869.  
  4870. private void drawFriendsListOrWelcomeScreen(RSInterface class9) {
  4871. int j = class9.contentType;
  4872. if (j >= 1 && j <= 100 || j >= 701 && j <= 800) {
  4873. if (j == 1 && anInt900 == 0) {
  4874. class9.message = "Loading friend list";
  4875. class9.atActionType = 0;
  4876. return;
  4877. }
  4878. if (j == 1 && anInt900 == 1) {
  4879. class9.message = "Connecting to friendserver";
  4880. class9.atActionType = 0;
  4881. return;
  4882. }
  4883. if (j == 2 && anInt900 != 2) {
  4884. class9.message = "Please wait...";
  4885. class9.atActionType = 0;
  4886. return;
  4887. }
  4888. int k = friendsCount;
  4889. if (anInt900 != 2)
  4890. k = 0;
  4891. if (j > 700)
  4892. j -= 601;
  4893. else
  4894. j--;
  4895. if (j >= k) {
  4896. class9.message = "";
  4897. class9.atActionType = 0;
  4898. return;
  4899. } else {
  4900. class9.message = friendsList[j];
  4901. class9.atActionType = 1;
  4902. return;
  4903. }
  4904. }
  4905. if (j >= 101 && j <= 200 || j >= 801 && j <= 900) {
  4906. int l = friendsCount;
  4907. if (anInt900 != 2)
  4908. l = 0;
  4909. if (j > 800)
  4910. j -= 701;
  4911. else
  4912. j -= 101;
  4913. if (j >= l) {
  4914. class9.message = "";
  4915. class9.atActionType = 0;
  4916. return;
  4917. }
  4918. if (friendsNodeIDs[j] == 0)
  4919. class9.message = "@red@Offline";
  4920. else if (friendsNodeIDs[j] == nodeID)
  4921. class9.message = "@gre@Online"/* + (friendsNodeIDs[j] - 9) */;
  4922. else
  4923. class9.message = "@red@Offline"/* + (friendsNodeIDs[j] - 9) */;
  4924. class9.atActionType = 1;
  4925. return;
  4926. }
  4927. /** Skill Tab **/
  4928. if (j == 210)
  4929. {
  4930. class9.message = "Total XP: " + NumberFormat.getIntegerInstance().format(xpCounter);
  4931. return;
  4932. }
  4933. if (j == 211)
  4934. {
  4935. if (maxStats[0] == 99) {
  4936. class9.message = "Attack XP: " + NumberFormat.getIntegerInstance().format(currentExp[0]);
  4937. return;
  4938. } else {
  4939. class9.message = "Attack XP: " + NumberFormat.getIntegerInstance().format(currentExp[0]) + "\\nNext Level at: " + NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[0] + 1))
  4940. + "\\nRemainder: " + (NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[0] + 1 ) - (currentExp[0])));
  4941.  
  4942. }
  4943. return;
  4944. }
  4945. if (j == 212)
  4946. {
  4947. if (maxStats[2] == 99) {
  4948. class9.message = "Strength XP: " + NumberFormat.getIntegerInstance().format(currentExp[2]);
  4949. return;
  4950. } else {
  4951. class9.message = "Strength XP: " + NumberFormat.getIntegerInstance().format(currentExp[2]) + "\\nNext Level at: " + NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[2] + 1))
  4952. + "\\nRemainder: " + (NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[2] + 1 ) - (currentExp[2])));
  4953.  
  4954. }
  4955. return;
  4956. }
  4957. if (j == 213)
  4958. {
  4959. if (maxStats[3] == 99) {
  4960. class9.message = "Hitpoints XP: " + NumberFormat.getIntegerInstance().format(currentExp[3]);
  4961. return;
  4962. } else {
  4963. class9.message = "Hitpoints XP: " + NumberFormat.getIntegerInstance().format(currentExp[3]) + "\\nNext Level at: " + NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[3] + 1))
  4964. + "\\nRemainder: " + (NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[3] + 1 ) - (currentExp[3])));
  4965.  
  4966. }
  4967. return;
  4968. }
  4969. if (j == 214)
  4970. {
  4971. if (maxStats[1] == 99) {
  4972. class9.message = "Defence XP: " + NumberFormat.getIntegerInstance().format(currentExp[1]);
  4973. return;
  4974. } else {
  4975. class9.message = "Defence XP: " + NumberFormat.getIntegerInstance().format(currentExp[1]) + "\\nNext Level at: " + NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[1] + 1))
  4976. + "\\nRemainder: " + (NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[1] + 1 ) - (currentExp[1])));
  4977.  
  4978. }
  4979. return;
  4980. }
  4981. if (j == 215)
  4982. {
  4983. if (maxStats[4] == 99) {
  4984. class9.message = "Ranged XP: " + NumberFormat.getIntegerInstance().format(currentExp[4]);
  4985. return;
  4986. } else {
  4987. class9.message = "Ranged XP: " + NumberFormat.getIntegerInstance().format(currentExp[4]) + "\\nNext Level at: " + NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[4] + 1))
  4988. + "\\nRemainder: " + (NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[4] + 1 ) - (currentExp[4])));
  4989.  
  4990. }
  4991. return;
  4992. }
  4993. if (j == 216)
  4994. {
  4995. if (maxStats[5] == 99) {
  4996. class9.message = "Prayer XP: " + NumberFormat.getIntegerInstance().format(currentExp[5]);
  4997. return;
  4998. } else {
  4999. class9.message = "Prayer XP: " + NumberFormat.getIntegerInstance().format(currentExp[5]) + "\\nNext Level at: " + NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[5] + 1))
  5000. + "\\nRemainder: " + (NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[5] + 1 ) - (currentExp[5])));
  5001.  
  5002. }
  5003. return;
  5004. }
  5005. if (j == 217)
  5006. {
  5007. if (maxStats[6] == 99) {
  5008. class9.message = "Magic XP: " + NumberFormat.getIntegerInstance().format(currentExp[6]);
  5009. return;
  5010. } else {
  5011. class9.message = "Magic XP: " + NumberFormat.getIntegerInstance().format(currentExp[6]) + "\\nNext Level at: " + NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[6] + 1))
  5012. + "\\nRemainder: " + (NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[6] + 1 ) - (currentExp[6])));
  5013.  
  5014. }
  5015. return;
  5016. }
  5017. if (j == 218)
  5018. {
  5019. if (maxStats[7] == 99) {
  5020. class9.message = "Cooking XP: " + NumberFormat.getIntegerInstance().format(currentExp[7]);
  5021. return;
  5022. } else {
  5023. class9.message = "Cooking XP: " + NumberFormat.getIntegerInstance().format(currentExp[7]) + "\\nNext Level at: " + NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[7] + 1))
  5024. + "\\nRemainder: " + (NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[7] + 1 ) - (currentExp[7])));
  5025.  
  5026. }
  5027. return;
  5028. }
  5029. if (j == 219)
  5030. {
  5031. if (maxStats[8] == 99) {
  5032. class9.message = "Woodcutting XP: " + NumberFormat.getIntegerInstance().format(currentExp[8]);
  5033. return;
  5034. } else {
  5035. class9.message = "Woodcutting XP: " + NumberFormat.getIntegerInstance().format(currentExp[8]) + "\\nNext Level at: " + NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[8] + 1))
  5036. + "\\nRemainder: " + (NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[8] + 1 ) - (currentExp[8])));
  5037.  
  5038. }
  5039. return;
  5040. }
  5041. if (j == 220)
  5042. {
  5043. if (maxStats[9] == 99) {
  5044. class9.message = "Fletching XP: " + NumberFormat.getIntegerInstance().format(currentExp[9]);
  5045. return;
  5046. } else {
  5047. class9.message = "Fletching XP: " + NumberFormat.getIntegerInstance().format(currentExp[9]) + "\\nNext Level at: " + NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[9] + 1))
  5048. + "\\nRemainder: " + (NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[9] + 1 ) - (currentExp[9])));
  5049.  
  5050. }
  5051. return;
  5052. }
  5053. if (j == 221)
  5054. {
  5055. if (maxStats[10] == 99) {
  5056. class9.message = "Fishing XP: " + NumberFormat.getIntegerInstance().format(currentExp[10]);
  5057. return;
  5058. } else {
  5059. class9.message = "Fishing XP: " + NumberFormat.getIntegerInstance().format(currentExp[10]) + "\\nNext Level at: " + NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[10] + 1))
  5060. + "\\nRemainder: " + (NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[10] + 1 ) - (currentExp[10])));
  5061.  
  5062. }
  5063. return;
  5064. }
  5065. if (j == 222)
  5066. {
  5067. if (maxStats[11] == 99) {
  5068. class9.message = "Firemaking XP: " + NumberFormat.getIntegerInstance().format(currentExp[11]);
  5069. return;
  5070. } else {
  5071. class9.message = "Firemaking XP: " + NumberFormat.getIntegerInstance().format(currentExp[11]) + "\\nNext Level at: " + NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[11] + 1))
  5072. + "\\nRemainder: " + (NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[11] + 1 ) - (currentExp[11])));
  5073.  
  5074. }
  5075. return;
  5076. }
  5077. if (j == 223)
  5078. {
  5079. if (maxStats[12] == 99) {
  5080. class9.message = "Crafting XP: " + NumberFormat.getIntegerInstance().format(currentExp[12]);
  5081. return;
  5082. } else {
  5083. class9.message = "Crafting XP: " + NumberFormat.getIntegerInstance().format(currentExp[12]) + "\\nNext Level at: " + NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[12] + 1))
  5084. + "\\nRemainder: " + (NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[12] + 1 ) - (currentExp[12])));
  5085.  
  5086. }
  5087. return;
  5088. }
  5089. if (j == 224)
  5090. {
  5091. if (maxStats[13] == 99) {
  5092. class9.message = "Smithing XP: " + NumberFormat.getIntegerInstance().format(currentExp[13]);
  5093. return;
  5094. } else {
  5095. class9.message = "Smithing XP: " + NumberFormat.getIntegerInstance().format(currentExp[13]) + "\\nNext Level at: " + NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[13] + 1))
  5096. + "\\nRemainder: " + (NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[13] + 1 ) - (currentExp[13])));
  5097.  
  5098. }
  5099. return;
  5100. }
  5101. if (j == 225)
  5102. {
  5103. if (maxStats[14] == 99) {
  5104. class9.message = "Mining XP: " + NumberFormat.getIntegerInstance().format(currentExp[14]);
  5105. return;
  5106. } else {
  5107. class9.message = "Mining XP: " + NumberFormat.getIntegerInstance().format(currentExp[14]) + "\\nNext Level at: " + NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[14] + 1))
  5108. + "\\nRemainder: " + (NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[14] + 1 ) - (currentExp[14])));
  5109.  
  5110. }
  5111. return;
  5112. }
  5113. if (j == 226)
  5114. {
  5115. if (maxStats[15] == 99) {
  5116. class9.message = "Herblore XP: " + NumberFormat.getIntegerInstance().format(currentExp[15]);
  5117. return;
  5118. } else {
  5119. class9.message = "Herblore XP: " + NumberFormat.getIntegerInstance().format(currentExp[15]) + "\\nNext Level at: " + NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[15] + 1))
  5120. + "\\nRemainder: " + (NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[15] + 1 ) - (currentExp[15])));
  5121.  
  5122. }
  5123. return;
  5124. }
  5125. if (j == 227)
  5126. {
  5127. if (maxStats[16] == 99) {
  5128. class9.message = "Agility XP: " + NumberFormat.getIntegerInstance().format(currentExp[16]);
  5129. return;
  5130. } else {
  5131. class9.message = "Agility XP: " + NumberFormat.getIntegerInstance().format(currentExp[16]) + "\\nNext Level at: " + NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[16] + 1))
  5132. + "\\nRemainder: " + (NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[16] + 1 ) - (currentExp[16])));
  5133.  
  5134. }
  5135. return;
  5136. }
  5137. if (j == 228)
  5138. {
  5139. if (maxStats[17] == 99) {
  5140. class9.message = "Thieving XP: " + NumberFormat.getIntegerInstance().format(currentExp[17]);
  5141. return;
  5142. } else {
  5143. class9.message = "Thieving XP: " + NumberFormat.getIntegerInstance().format(currentExp[17]) + "\\nNext Level at: " + NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[17] + 1))
  5144. + "\\nRemainder: " + (NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[17] + 1 ) - (currentExp[17])));
  5145.  
  5146. }
  5147. return;
  5148. }
  5149. if (j == 229)
  5150. {
  5151. if (maxStats[18] == 99) {
  5152. class9.message = "Slayer XP: " + NumberFormat.getIntegerInstance().format(currentExp[18]);
  5153. return;
  5154. } else {
  5155. class9.message = "Slayer XP: " + NumberFormat.getIntegerInstance().format(currentExp[18]) + "\\nNext Level at: " + NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[18] + 1))
  5156. + "\\nRemainder: " + (NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[18] + 1 ) - (currentExp[18])));
  5157.  
  5158. }
  5159. return;
  5160. }
  5161. if (j == 230)
  5162. {
  5163. if (maxStats[19] == 99) {
  5164. class9.message = "Farming XP: " + NumberFormat.getIntegerInstance().format(currentExp[19]);
  5165. return;
  5166. } else {
  5167. class9.message = "Farming XP: " + NumberFormat.getIntegerInstance().format(currentExp[19]) + "\\nNext Level at: " + NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[19] + 1))
  5168. + "\\nRemainder: " + (NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[19] + 1 ) - (currentExp[19])));
  5169.  
  5170. }
  5171. return;
  5172. }
  5173. if (j == 231)
  5174. {
  5175. if (maxStats[20] == 99) {
  5176. class9.message = "Runecrafting XP: " + NumberFormat.getIntegerInstance().format(currentExp[20]);
  5177. return;
  5178. } else {
  5179. class9.message = "Runecrafting XP: " + NumberFormat.getIntegerInstance().format(currentExp[20]) + "\\nNext Level at: " + NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[20] + 1))
  5180. + "\\nRemainder: " + (NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[20] +1 ) - (currentExp[20])));
  5181.  
  5182. }
  5183. return;
  5184. }
  5185. /*if (j == 232)
  5186. {
  5187. if (maxStats[21] == 99) {
  5188. class9.message = "Hunter XP: " + NumberFormat.getIntegerInstance().format(currentExp[21]);
  5189. return;
  5190. } else {
  5191. class9.message = "Hunter XP: " + NumberFormat.getIntegerInstance().format(currentExp[21]) + "\\nNext Level at: " + NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[21] + 1))
  5192. + "\\nRemainder: " + (NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[21] + 1 ) - (currentExp[21])));
  5193. }
  5194. return;
  5195. }
  5196. if (j == 233)
  5197. {
  5198. if (maxStats[22] == 99) {
  5199. class9.message = "Construction XP: " + NumberFormat.getIntegerInstance().format(currentExp[22]);
  5200. return;
  5201. } else {
  5202. class9.message = "Construction XP: " + NumberFormat.getIntegerInstance().format(currentExp[22]) + "\\nNext Level at: " + NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[22] + 1))
  5203. + "\\nRemainder: " + (NumberFormat.getIntegerInstance().format(getXPForLevel(maxStats[22] + 1 ) - (currentExp[22])));
  5204. }
  5205. return;
  5206. }*/
  5207. if (j == 203) {
  5208. int i1 = friendsCount;
  5209. if (anInt900 != 2)
  5210. i1 = 0;
  5211. class9.scrollMax = i1 * 15 + 20;
  5212. if (class9.scrollMax <= class9.height)
  5213. class9.scrollMax = class9.height + 1;
  5214. return;
  5215. }
  5216. if (j >= 401 && j <= 500) {
  5217. if ((j -= 401) == 0 && anInt900 == 0) {
  5218. class9.message = "Loading ignore list";
  5219. class9.atActionType = 0;
  5220. return;
  5221. }
  5222. if (j == 1 && anInt900 == 0) {
  5223. class9.message = "Please wait...";
  5224. class9.atActionType = 0;
  5225. return;
  5226. }
  5227. int j1 = ignoreCount;
  5228. if (anInt900 == 0)
  5229. j1 = 0;
  5230. if (j >= j1) {
  5231. class9.message = "";
  5232. class9.atActionType = 0;
  5233. return;
  5234. } else {
  5235. class9.message = TextClass.fixName(TextClass.nameForLong(ignoreListAsLongs[j]));
  5236. class9.atActionType = 1;
  5237. return;
  5238. }
  5239. }
  5240. if (j == 503) {
  5241. class9.scrollMax = ignoreCount * 15 + 20;
  5242. if (class9.scrollMax <= class9.height)
  5243. class9.scrollMax = class9.height + 1;
  5244. return;
  5245. }
  5246. if(j == 327)
  5247. {
  5248. class9.modelRotation1 = 150;
  5249. class9.modelRotation2 = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  5250. if(aBoolean1031)
  5251. {
  5252. for(int k1 = 0; k1 < 7; k1++)
  5253. {
  5254. int l1 = anIntArray1065[k1];
  5255. if(l1 >= 0 && !IDK.cache[l1].method537())
  5256. return;
  5257. }
  5258.  
  5259. aBoolean1031 = false;
  5260. Model aclass30_sub2_sub4_sub6s[] = new Model[7];
  5261. int i2 = 0;
  5262. for(int j2 = 0; j2 < 7; j2++)
  5263. {
  5264. int k2 = anIntArray1065[j2];
  5265. if(k2 >= 0)
  5266. aclass30_sub2_sub4_sub6s[i2++] = IDK.cache[k2].method538();
  5267. }
  5268.  
  5269. Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
  5270. for(int l2 = 0; l2 < 5; l2++)
  5271. if(anIntArray990[l2] != 0)
  5272. {
  5273. model.setColor(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  5274. if(l2 == 1)
  5275. model.setColor(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  5276. }
  5277.  
  5278. model.createBones();
  5279. model.applyAnimation(Animation.anims[myPlayer.anInt1511].frame2IDS[0]);
  5280. model.setLighting(64, 850, -30, -50, -30, true);
  5281. class9.anInt233 = 5;
  5282. class9.mediaID = 0;
  5283. RSInterface.method208(aBoolean994, model);
  5284. }
  5285. return;
  5286. }
  5287. if(j == 328) {
  5288. RSInterface rsInterface = class9;
  5289. rsInterface.modelZoom = 550;
  5290. rsInterface.modelRotation1 = 100;
  5291. //if(rollingCharacter) {
  5292. if(rsInterface.modelRotation2 >= 0)
  5293. rsInterface.modelRotation2 -= 8;
  5294. if(rsInterface.modelRotation2 < 0)
  5295. rsInterface.modelRotation2 = 2047;
  5296. /*} else {
  5297. if(rsInterface.modelRotation2 != 0) {
  5298. if(rsInterface.modelRotation2 > 1023)
  5299. rsInterface.modelRotation2 += 20;
  5300. else
  5301. rsInterface.modelRotation2 -= 20;
  5302. if(rsInterface.modelRotation2 < 0 || rsInterface.modelRotation2 > 2047)
  5303. rsInterface.modelRotation2 = 0;
  5304. }
  5305. }*/
  5306. if(aBoolean1031) {
  5307. Model characterDisplay = myPlayer.method452();
  5308. for(int l2 = 0; l2 < 5; l2++)
  5309. if(anIntArray990[l2] != 0) {
  5310. characterDisplay.setColor(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  5311. if(l2 == 1)
  5312. characterDisplay.setColor(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  5313. }
  5314. int staticFrame = myPlayer.anInt1511;
  5315. characterDisplay.createBones();
  5316. characterDisplay.applyAnimation(Animation.anims[staticFrame].frame2IDS[0]);
  5317. rsInterface.anInt233 = 5;
  5318. rsInterface.mediaID = 0;
  5319. RSInterface.method208(aBoolean994, characterDisplay);
  5320. }
  5321. }
  5322. if (j == 324) {
  5323. if (aClass30_Sub2_Sub1_Sub1_931 == null) {
  5324. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  5325. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  5326. }
  5327. if (aBoolean1047) {
  5328. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  5329. return;
  5330. } else {
  5331. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  5332. return;
  5333. }
  5334. }
  5335. if (j == 325) {
  5336. if (aClass30_Sub2_Sub1_Sub1_931 == null) {
  5337. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  5338. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  5339. }
  5340. if (aBoolean1047) {
  5341. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  5342. return;
  5343. } else {
  5344. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  5345. return;
  5346. }
  5347. }
  5348. if (j == 600) {
  5349. class9.message = reportAbuseInput;
  5350. if (loopCycle % 20 < 10) {
  5351. class9.message += "|";
  5352. return;
  5353. } else {
  5354. class9.message += " ";
  5355. return;
  5356. }
  5357. }
  5358. if (j == 613)
  5359. if (myPrivilege >= 1) {
  5360. if (canMute) {
  5361. class9.textColor = 0xff0000;
  5362. class9.message = "Moderator option: Mute player for 48 hours: <ON>";
  5363. } else {
  5364. class9.textColor = 0xffffff;
  5365. class9.message = "Moderator option: Mute player for 48 hours: <OFF>";
  5366. }
  5367. } else {
  5368. class9.message = "";
  5369. }
  5370. if (j == 650 || j == 655)
  5371. if (anInt1193 != 0) {
  5372. String s;
  5373. if (daysSinceLastLogin == 0)
  5374. s = "earlier today";
  5375. else if (daysSinceLastLogin == 1)
  5376. s = "yesterday";
  5377. else
  5378. s = daysSinceLastLogin + " days ago";
  5379. class9.message = "You last logged in " + s + " from: " + signlink.dns;
  5380. } else {
  5381. class9.message = "";
  5382. }
  5383. if (j == 651) {
  5384. if (unreadMessages == 0) {
  5385. class9.message = "0 unread messages";
  5386. class9.textColor = 0xffff00;
  5387. }
  5388. if (unreadMessages == 1) {
  5389. class9.message = "1 unread message";
  5390. class9.textColor = 65280;
  5391. }
  5392. if (unreadMessages > 1) {
  5393. class9.message = unreadMessages + " unread messages";
  5394. class9.textColor = 65280;
  5395. }
  5396. }
  5397. if (j == 652)
  5398. if (daysSinceRecovChange == 201) {
  5399. if (membersInt == 1)
  5400. class9.message = "@yel@This is a non-members world: @whi@Since you are a member we";
  5401. else
  5402. class9.message = "";
  5403. } else if (daysSinceRecovChange == 200) {
  5404. class9.message = "You have not yet set any password recovery questions.";
  5405. } else {
  5406. String s1;
  5407. if (daysSinceRecovChange == 0)
  5408. s1 = "Earlier today";
  5409. else if (daysSinceRecovChange == 1)
  5410. s1 = "Yesterday";
  5411. else
  5412. s1 = daysSinceRecovChange + " days ago";
  5413. class9.message = s1 + " you changed your recovery questions";
  5414. }
  5415. if (j == 653)
  5416. if (daysSinceRecovChange == 201) {
  5417. if (membersInt == 1)
  5418. class9.message = "@whi@recommend you use a members world instead. You may use";
  5419. else
  5420. class9.message = "";
  5421. } else if (daysSinceRecovChange == 200)
  5422. class9.message = "We strongly recommend you do so now to secure your account.";
  5423. else
  5424. class9.message = "If you do not remember making this change then cancel it immediately";
  5425. if (j == 654) {
  5426. if (daysSinceRecovChange == 201)
  5427. if (membersInt == 1) {
  5428. class9.message = "@whi@this world but member benefits are unavailable whilst here.";
  5429. return;
  5430. } else {
  5431. class9.message = "";
  5432. return;
  5433. }
  5434. if (daysSinceRecovChange == 200) {
  5435. class9.message = "Do this from the 'account management' area on our front webpage";
  5436. return;
  5437. }
  5438. class9.message = "Do this from the 'account management' area on our front webpage";
  5439. }
  5440. }
  5441.  
  5442.  
  5443. private void drawSplitPrivateChat() {
  5444. if (splitPrivateChat == 0) {
  5445. return;
  5446. }
  5447. TextDrawingArea textDrawingArea = regularText;
  5448. int i = 0;
  5449. if (anInt1104 != 0) {
  5450. i = 1;
  5451. }
  5452. for (int j = 0; j < 100; j++) {
  5453. if (chatMessages[j] != null) {
  5454. int k = chatTypes[j];
  5455. String s = chatNames[j];
  5456. byte byte1 = 0;
  5457. if (s != null && s.startsWith("@cr1@")) {
  5458. s = s.substring(5);
  5459. byte1 = 1;
  5460. }
  5461. if (s != null && s.startsWith("@cr2@")) {
  5462. s = s.substring(5);
  5463. byte1 = 2;
  5464. }
  5465. if ((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  5466. int l = 329 - i * 13;
  5467. if (frameMode != ScreenMode.FIXED) {
  5468. l = frameHeight - 170 - i * 13;
  5469. }
  5470. int k1 = 4;
  5471. textDrawingArea.method385(0, "From", l, k1);
  5472. textDrawingArea.method385(65535, "From", l - 1, k1);
  5473. k1 += textDrawingArea.getTextWidth("From ");
  5474.  
  5475. if (byte1 == 1) {
  5476. modIcons[0].drawSprite(k1, l - 12);
  5477. k1 += 12;
  5478. }
  5479. if (byte1 == 2) {
  5480. modIcons[1].drawSprite(k1, l - 12);
  5481. k1 += 12;
  5482. }
  5483. textDrawingArea.method385(0, s + ": " + chatMessages[j], l, k1);
  5484. textDrawingArea.method385(65535, s + ": " + chatMessages[j], l - 1, k1);
  5485. if (++i >= 5) {
  5486. return;
  5487. }
  5488. }
  5489. if (k == 5 && privateChatMode < 2) {
  5490. int i1 = 329 - i * 13;
  5491. if (frameMode != ScreenMode.FIXED) {
  5492. i1 = frameHeight - 170 - i * 13;
  5493. }
  5494. textDrawingArea.method385(0, chatMessages[j], i1, 4);
  5495. textDrawingArea.method385(65535, chatMessages[j], i1 - 1, 4);
  5496.  
  5497. if (++i >= 5) {
  5498. return;
  5499. }
  5500. }
  5501. if (k == 6 && privateChatMode < 2) {
  5502. int j1 = 329 - i * 13;
  5503. if (frameMode != ScreenMode.FIXED) {
  5504. j1 = frameHeight - 170 - i * 13;
  5505. }
  5506. textDrawingArea.method385(0, "To " + s + ": " + chatMessages[j], j1, 4);
  5507. textDrawingArea.method385(65535, "To " + s + ": " + chatMessages[j], j1 - 1, 4);
  5508.  
  5509. if (++i >= 5) {
  5510. return;
  5511. }
  5512. }
  5513. }
  5514. }
  5515. }
  5516.  
  5517.  
  5518. private void pushMessage(String s, int i, String s1) {
  5519. if (i == 0 && dialogID != -1) {
  5520. aString844 = s;
  5521. super.clickMode3 = 0;
  5522. }
  5523. if (backDialogID == -1)
  5524. inputTaken = true;
  5525. for (int j = 99; j > 0; j--) {
  5526. chatTypes[j] = chatTypes[j - 1];
  5527. chatNames[j] = chatNames[j - 1];
  5528. chatMessages[j] = chatMessages[j - 1];
  5529. }
  5530.  
  5531. chatTypes[0] = i;
  5532. chatNames[0] = s1;
  5533. chatMessages[0] = s;
  5534. }
  5535.  
  5536. private void processTabClick() {
  5537. if (frameMode == ScreenMode.FIXED) {
  5538. if (super.clickMode3 == 1) {
  5539. if (super.saveClickX >= 539 && super.saveClickX <= 573 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[0] != -1) {
  5540. needDrawTabArea = true;
  5541. tabID = 0;
  5542. tabAreaAltered = true;
  5543. }
  5544. if (super.saveClickX >= 569 && super.saveClickX <= 599 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[1] != -1) {
  5545. needDrawTabArea = true;
  5546. tabID = 1;
  5547. tabAreaAltered = true;
  5548. }
  5549. if (super.saveClickX >= 597 && super.saveClickX <= 627 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[2] != -1) {
  5550. needDrawTabArea = true;
  5551. tabID = 2;
  5552. tabAreaAltered = true;
  5553. }
  5554. if (super.saveClickX >= 625 && super.saveClickX <= 669 && super.saveClickY >= 168 && super.saveClickY < 203 && tabInterfaceIDs[3] != -1) {
  5555. needDrawTabArea = true;
  5556. tabID = 3;
  5557. tabAreaAltered = true;
  5558. }
  5559. if (super.saveClickX >= 666 && super.saveClickX <= 696 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[4] != -1) {
  5560. needDrawTabArea = true;
  5561. tabID = 4;
  5562. tabAreaAltered = true;
  5563. }
  5564. if (super.saveClickX >= 694 && super.saveClickX <= 724 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[5] != -1) {
  5565. needDrawTabArea = true;
  5566. tabID = 5;
  5567. tabAreaAltered = true;
  5568. }
  5569. if (super.saveClickX >= 722 && super.saveClickX <= 756 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[6] != -1) {
  5570. needDrawTabArea = true;
  5571. tabID = 6;
  5572. tabAreaAltered = true;
  5573. }
  5574. if (super.saveClickX >= 540 && super.saveClickX <= 574 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[7] != -1) {
  5575. needDrawTabArea = true;
  5576. tabID = 7;
  5577. tabAreaAltered = true;
  5578. }
  5579. if (super.saveClickX >= 572 && super.saveClickX <= 602 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[8] != -1) {
  5580. needDrawTabArea = true;
  5581. tabID = 8;
  5582. tabAreaAltered = true;
  5583. }
  5584. if (super.saveClickX >= 599 && super.saveClickX <= 629 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[9] != -1) {
  5585. needDrawTabArea = true;
  5586. tabID = 9;
  5587. tabAreaAltered = true;
  5588. }
  5589. if (super.saveClickX >= 627 && super.saveClickX <= 671 && super.saveClickY >= 467 && super.saveClickY < 502 && tabInterfaceIDs[10] != -1) {
  5590. needDrawTabArea = true;
  5591. tabID = 10;
  5592. tabAreaAltered = true;
  5593. }
  5594. if (super.saveClickX >= 669 && super.saveClickX <= 699 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[11] != -1) {
  5595. needDrawTabArea = true;
  5596. tabID = 11;
  5597. tabAreaAltered = true;
  5598. }
  5599. if (super.saveClickX >= 696 && super.saveClickX <= 726 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[12] != -1) {
  5600. needDrawTabArea = true;
  5601. tabID = 12;
  5602. tabAreaAltered = true;
  5603. }
  5604. if (super.saveClickX >= 724 && super.saveClickX <= 758 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[13] != -1) {
  5605. needDrawTabArea = true;
  5606. tabID = 13;
  5607. tabAreaAltered = true;
  5608. }
  5609. }
  5610. } else {
  5611. if (super.clickMode3 == 1) {
  5612. if (super.saveClickX >= frameWidth - 228 && super.saveClickX <= frameWidth - 197 && super.saveClickY >= frameHeight - 329 && super.saveClickY < frameHeight - 297 && tabInterfaceIDs[0] != -1) {
  5613. needDrawTabArea = true;
  5614. tabID = 0;
  5615. tabAreaAltered = true;
  5616. }
  5617. if (super.saveClickX >= frameWidth - 196 && super.saveClickX <= frameWidth - 169 && super.saveClickY >= frameHeight - 329 && super.saveClickY < frameHeight - 297 && tabInterfaceIDs[1] != -1) {
  5618. needDrawTabArea = true;
  5619. tabID = 1;
  5620. tabAreaAltered = true;
  5621. }
  5622. if (super.saveClickX >= frameWidth - 168 && super.saveClickX <= frameWidth - 141 && super.saveClickY >= frameHeight - 329 && super.saveClickY < frameHeight - 297 && tabInterfaceIDs[2] != -1) {
  5623. needDrawTabArea = true;
  5624. tabID = 2;
  5625. tabAreaAltered = true;
  5626. }
  5627. if (super.saveClickX >= frameWidth - 140 && super.saveClickX <= frameWidth - 97 && super.saveClickY >= frameHeight - 329 && super.saveClickY < frameHeight - 297 && tabInterfaceIDs[3] != -1) {
  5628. needDrawTabArea = true;
  5629. tabID = 3;
  5630. tabAreaAltered = true;
  5631. }
  5632. if (super.saveClickX >= frameWidth - 96 && super.saveClickX <= frameWidth - 69 && super.saveClickY >= frameHeight - 329 && super.saveClickY < frameHeight - 297 && tabInterfaceIDs[4] != -1) {
  5633. needDrawTabArea = true;
  5634. tabID = 4;
  5635. tabAreaAltered = true;
  5636. }
  5637. if (super.saveClickX >= frameWidth - 68 && super.saveClickX <= frameWidth - 40 && super.saveClickY >= frameHeight - 329 && super.saveClickY < frameHeight - 297 && tabInterfaceIDs[5] != -1) {
  5638. needDrawTabArea = true;
  5639. tabID = 5;
  5640. tabAreaAltered = true;
  5641. }
  5642. if (super.saveClickX >= frameWidth - 39 && super.saveClickX <= frameWidth - 11 && super.saveClickY >= frameHeight - 329 && super.saveClickY < frameHeight - 297 && tabInterfaceIDs[6] != -1) {
  5643. needDrawTabArea = true;
  5644. tabID = 6;
  5645. tabAreaAltered = true;
  5646. }
  5647. if (super.saveClickX >= frameWidth - 228 && super.saveClickX <= frameWidth - 197 && super.saveClickY >= frameHeight - 36 && super.saveClickY < frameHeight - 2 && tabInterfaceIDs[7] != -1) {
  5648. needDrawTabArea = true;
  5649. tabID = 7;
  5650. tabAreaAltered = true;
  5651. }
  5652. if (super.saveClickX >= frameWidth - 196 && super.saveClickX <= frameWidth - 169 && super.saveClickY >= frameHeight - 36 && super.saveClickY < frameHeight - 2 && tabInterfaceIDs[8] != -1) {
  5653. needDrawTabArea = true;
  5654. tabID = 8;
  5655. tabAreaAltered = true;
  5656. }
  5657. if (super.saveClickX >= frameWidth - 168 && super.saveClickX <= frameWidth - 141 && super.saveClickY >= frameHeight - 36 && super.saveClickY < frameHeight - 2 && tabInterfaceIDs[9] != -1) {
  5658. needDrawTabArea = true;
  5659. tabID = 9;
  5660. tabAreaAltered = true;
  5661. }
  5662. if (super.saveClickX >= frameWidth - 140 && super.saveClickX <= frameWidth - 97 && super.saveClickY >= frameHeight - 36 && super.saveClickY < frameHeight - 2 && tabInterfaceIDs[10] != -1) {
  5663. needDrawTabArea = true;
  5664. tabID = 10;
  5665. tabAreaAltered = true;
  5666. }
  5667. if (super.saveClickX >= frameWidth - 96 && super.saveClickX <= frameWidth - 69 && super.saveClickY >= frameHeight - 36 && super.saveClickY < frameHeight - 2 && tabInterfaceIDs[11] != -1) {
  5668. needDrawTabArea = true;
  5669. tabID = 11;
  5670. tabAreaAltered = true;
  5671. }
  5672. if (super.saveClickX >= frameWidth - 68 && super.saveClickX <= frameWidth - 40 && super.saveClickY >= frameHeight - 36 && super.saveClickY < frameHeight - 2 && tabInterfaceIDs[12] != -1) {
  5673. needDrawTabArea = true;
  5674. tabID = 12;
  5675. tabAreaAltered = true;
  5676. }
  5677. if (super.saveClickX >= frameWidth - 39 && super.saveClickX <= frameWidth - 11 && super.saveClickY >= frameHeight - 36 && super.saveClickY < frameHeight - 2 && tabInterfaceIDs[13] != -1) {
  5678. needDrawTabArea = true;
  5679. tabID = 13;
  5680. tabAreaAltered = true;
  5681. }
  5682. }
  5683. }
  5684. }
  5685.  
  5686. private void resetImageProducers2() {
  5687. if (aRSImageProducer_1166 != null)
  5688. return;
  5689. nullLoader();
  5690. super.fullGameScreen = null;
  5691. aRSImageProducer_1107 = null;
  5692. aRSImageProducer_1108 = null;
  5693. aRSImageProducer_1109 = null;
  5694. aRSImageProducer_1110 = null;
  5695. aRSImageProducer_1111 = null;
  5696. aRSImageProducer_1112 = null;
  5697. aRSImageProducer_1113 = null;
  5698. aRSImageProducer_1114 = null;
  5699. aRSImageProducer_1115 = null;
  5700. aRSImageProducer_1166 = new ImageProducer(516, 165);// chatback
  5701. aRSImageProducer_1164 = new ImageProducer(249, 168);// mapback
  5702. DrawingArea.setAllPixelsToZero();
  5703. cacheSprite[1].drawSprite(0, 0);
  5704. aRSImageProducer_1163 = new ImageProducer(249, 335);// inventory
  5705. aRSImageProducer_1165 = new ImageProducer(512, 334);// gamescreen
  5706. DrawingArea.setAllPixelsToZero();
  5707. aRSImageProducer_1125 = new ImageProducer(249, 45);
  5708. welcomeScreenRaised = true;
  5709. }
  5710.  
  5711.  
  5712.  
  5713. public String getDocumentBaseHost() {
  5714. if(signlink.mainapp != null)
  5715. return signlink.mainapp.getDocumentBase().getHost().toLowerCase();
  5716. if(super.gameFrame != null)
  5717. return "runescape.com";
  5718. else
  5719. return serverAddress;
  5720. }
  5721.  
  5722.  
  5723. private void method81(Sprite sprite, int j, int k) {
  5724. int l = k * k + j * j;
  5725. if (l > 4225 && l < 0x15f90) {
  5726. int i1 = viewRotation + viewRotationOffset & 0x7ff;
  5727. int j1 = Model.modelIntArray1[i1];
  5728. int k1 = Model.modelIntArray2[i1];
  5729. j1 = (j1 * 256) / (minimapZoom + 256);
  5730. k1 = (k1 * 256) / (minimapZoom + 256);
  5731. } else {
  5732. markMinimap(sprite, k, j);
  5733. }
  5734. }
  5735.  
  5736.  
  5737.  
  5738. public void processRightClick() {
  5739. if (activeInterfaceType != 0) {
  5740. return;
  5741. }
  5742. menuActionName[0] = "Cancel";
  5743. menuActionID[0] = 1107;
  5744. menuActionRow = 1;
  5745. buildSplitPrivateChatMenu();
  5746. anInt886 = 0;
  5747. anInt1315 = 0;
  5748. if (frameMode == ScreenMode.FIXED ) {
  5749. if (super.mouseX > 4 && super.mouseY > 4 && super.mouseX < 516 && super.mouseY < 338) {
  5750. if (openInterfaceID != -1) {
  5751. buildInterfaceMenu(4, RSInterface.interfaceCache[openInterfaceID], super.mouseX, 4, super.mouseY, 0);
  5752. } else {
  5753. build3dScreenMenu();
  5754. }
  5755. }
  5756. } else if (frameMode != ScreenMode.FIXED ) {
  5757. if (getMousePositions()) {
  5758. if (super.mouseX > (frameWidth / 2) - 356 && super.mouseY > (frameHeight / 2) - 230 && super.mouseX < ((frameWidth / 2) + 356) && super.mouseY < (frameHeight / 2) + 230 && openInterfaceID != -1) {
  5759. buildInterfaceMenu((frameWidth / 2) - 356, RSInterface.interfaceCache[openInterfaceID], super.mouseX, (frameHeight / 2) - 230, super.mouseY, 0);
  5760. } else {
  5761. build3dScreenMenu();
  5762. }
  5763. }
  5764. }
  5765. if (anInt886 != anInt1026) {
  5766. anInt1026 = anInt886;
  5767. }
  5768. if (anInt1315 != anInt1129) {
  5769. anInt1129 = anInt1315;
  5770. }
  5771. anInt886 = 0;
  5772. anInt1315 = 0;
  5773. if (!changeTabArea) {
  5774. final int yOffset = frameMode == ScreenMode.FIXED ? 0 : frameHeight - 503;
  5775. final int xOffset = frameMode == ScreenMode.FIXED ? 0 : frameWidth - 765;
  5776. if(super.mouseX > 548 + xOffset && super.mouseX < 740 + xOffset && super.mouseY > 207 + yOffset && super.mouseY < 468 + yOffset) {
  5777. if(invOverlayInterfaceID != -1) {
  5778. buildInterfaceMenu(548 + xOffset, RSInterface.interfaceCache[invOverlayInterfaceID], super.mouseX, 207 + yOffset, super.mouseY, 0);
  5779. } else if(tabInterfaceIDs[tabID] != -1) {
  5780. buildInterfaceMenu(548 + xOffset, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], super.mouseX, 207 + yOffset, super.mouseY, 0);
  5781. }
  5782. }
  5783. } else if (changeTabArea) {
  5784. final int yOffset = frameWidth >= 1000 ? 37 : 74;
  5785. if (super.mouseX > frameWidth - 197 && super.mouseY > frameHeight - yOffset - 267 && super.mouseX < frameWidth - 7 && super.mouseY < frameHeight - yOffset - 7 && showTabComponents) {
  5786. if (invOverlayInterfaceID != -1) {
  5787. buildInterfaceMenu(frameWidth - 197, RSInterface.interfaceCache[invOverlayInterfaceID], super.mouseX, frameHeight - yOffset - 267, super.mouseY, 0);
  5788. } else if (tabInterfaceIDs[tabID] != -1) {
  5789. buildInterfaceMenu(frameWidth - 197, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], super.mouseX, frameHeight - yOffset - 267, super.mouseY, 0);
  5790. }
  5791. }
  5792. }
  5793. if (anInt886 != anInt1048) {
  5794. tabAreaAltered = true;
  5795. anInt1048 = anInt886;
  5796. }
  5797. if (anInt1315 != anInt1044) {
  5798. tabAreaAltered = true;
  5799. anInt1044 = anInt1315;
  5800. }
  5801. anInt886 = 0;
  5802. anInt1315 = 0;
  5803. if (super.mouseX > 0 && super.mouseY > (frameMode == ScreenMode.FIXED ? 338 : frameHeight - 165) && super.mouseX < 490 && super.mouseY < (frameMode == ScreenMode.FIXED ? 463 : frameHeight - 40) && showChatComponents) {
  5804. if (backDialogID != -1) {
  5805. buildInterfaceMenu(20, RSInterface.interfaceCache[backDialogID], super.mouseX, (frameMode == ScreenMode.FIXED ? 358 : frameHeight - 145), super.mouseY, 0);
  5806. } else if (super.mouseY < (frameMode == ScreenMode.FIXED ? 463 : frameHeight - 40) && super.mouseX < 490) {
  5807. buildChatAreaMenu(super.mouseY - (frameMode == ScreenMode.FIXED ? 338 : frameHeight - 165));
  5808. }
  5809. }
  5810. if (backDialogID != -1 && anInt886 != anInt1039) {
  5811. inputTaken = true;
  5812. anInt1039 = anInt886;
  5813. }
  5814. if (backDialogID != -1 && anInt1315 != anInt1500) {
  5815. inputTaken = true;
  5816. anInt1500 = anInt1315;
  5817. }
  5818. boolean flag = false;
  5819. while (!flag) {
  5820. flag = true;
  5821. for (int j = 0; j < menuActionRow - 1; j++) {
  5822. if (menuActionID[j] < 1000 && menuActionID[j + 1] > 1000) {
  5823. String s = menuActionName[j];
  5824. menuActionName[j] = menuActionName[j + 1];
  5825. menuActionName[j + 1] = s;
  5826. int k = menuActionID[j];
  5827. menuActionID[j] = menuActionID[j + 1];
  5828. menuActionID[j + 1] = k;
  5829. k = menuActionCmd2[j];
  5830. menuActionCmd2[j] = menuActionCmd2[j + 1];
  5831. menuActionCmd2[j + 1] = k;
  5832. k = menuActionCmd3[j];
  5833. menuActionCmd3[j] = menuActionCmd3[j + 1];
  5834. menuActionCmd3[j + 1] = k;
  5835. k = menuActionCmd1[j];
  5836. menuActionCmd1[j] = menuActionCmd1[j + 1];
  5837. menuActionCmd1[j + 1] = k;
  5838. flag = false;
  5839. }
  5840. }
  5841. }
  5842. }
  5843.  
  5844.  
  5845.  
  5846. private int method83(int i, int j, int k) {
  5847. int l = 256 - k;
  5848. return ((i & 0xff00ff) * l + (j & 0xff00ff) * k & 0xff00ff00) + ((i & 0xff00) * l + (j & 0xff00) * k & 0xff0000) >> 8;
  5849. }
  5850.  
  5851. private void login(String s, String s1, boolean flag) {
  5852. signlink.errorname = s;
  5853. try {
  5854. try {
  5855. writeSettings();
  5856. } catch(Exception e) {
  5857.  
  5858. }
  5859. if (!flag) {
  5860. loginMessage1 = "";
  5861. loginMessage2 = "Connecting to server...";
  5862. drawLoginScreen(true);
  5863. }
  5864. stopMidi();
  5865. socketStream = new RSSocket(this, openSocket(43594 + portOff));
  5866. long l = TextClass.longForName(s);
  5867. int i = (int) (l >> 16 & 31L);
  5868. stream.currentOffset = 0;
  5869. stream.writeWordBigEndian(14);
  5870. stream.writeWordBigEndian(i);
  5871. socketStream.queueBytes(2, stream.buffer);
  5872. for (int j = 0; j < 8; j++)
  5873. socketStream.read();
  5874.  
  5875. int k = socketStream.read();
  5876. int i1 = k;
  5877. if (k == 0) {
  5878. socketStream.flushInputStream(inStream.buffer, 8);
  5879. inStream.currentOffset = 0;
  5880. aLong1215 = inStream.readQWord();
  5881. int ai[] = new int[4];
  5882. ai[0] = (int) (Math.random() * 99999999D);
  5883. ai[1] = (int) (Math.random() * 99999999D);
  5884. ai[2] = (int) (aLong1215 >> 32);
  5885. ai[3] = (int) aLong1215;
  5886. stream.currentOffset = 0;
  5887. stream.writeWordBigEndian(10);
  5888. stream.writeDWord(ai[0]);
  5889. stream.writeDWord(ai[1]);
  5890. stream.writeDWord(ai[2]);
  5891. stream.writeDWord(ai[3]);
  5892. stream.writeDWord(signlink.uid);
  5893. stream.writeString(s);
  5894. stream.writeString(s1);
  5895. stream.doKeys();
  5896. aStream_847.currentOffset = 0;
  5897. if (flag)
  5898. aStream_847.writeWordBigEndian(18);
  5899. else
  5900. aStream_847.writeWordBigEndian(16);
  5901. aStream_847.writeWordBigEndian(stream.currentOffset + 36 + 1 + 1 + 2);
  5902. aStream_847.writeWordBigEndian(255);
  5903. aStream_847.writeWord(317);
  5904. aStream_847.writeWordBigEndian(lowMem ? 1 : 0);
  5905. for (int l1 = 0; l1 < 9; l1++)
  5906. aStream_847.writeDWord(expectedCRCs[l1]);
  5907.  
  5908. aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
  5909. stream.encryption = new ISAACRandomGen(ai);
  5910. for (int j2 = 0; j2 < 4; j2++)
  5911. ai[j2] += 50;
  5912.  
  5913. encryption = new ISAACRandomGen(ai);
  5914. socketStream.queueBytes(aStream_847.currentOffset, aStream_847.buffer);
  5915. k = socketStream.read();
  5916. }
  5917. if (k == 1) {
  5918. try {
  5919. Thread.sleep(2000L);
  5920. }
  5921. catch (Exception _ex) {
  5922. }
  5923. login(s, s1, flag);
  5924. return;
  5925. }
  5926. if (k == 2) {
  5927. myPrivilege = socketStream.read();
  5928. flagged = socketStream.read() == 1;
  5929. aLong1220 = 0L;
  5930. anInt1022 = 0;
  5931. super.awtFocus = true;
  5932. aBoolean954 = true;
  5933. loggedIn = true;
  5934. stream.currentOffset = 0;
  5935. inStream.currentOffset = 0;
  5936. pktType = -1;
  5937. anInt841 = -1;
  5938. anInt842 = -1;
  5939. anInt843 = -1;
  5940. pktSize = 0;
  5941. anInt1009 = 0;
  5942. anInt1104 = 0;
  5943. anInt1011 = 0;
  5944. anInt855 = 0;
  5945. menuActionRow = 0;
  5946. menuOpen = false;
  5947. super.idleTime = 0;
  5948. for (int j1 = 0; j1 < 100; j1++)
  5949. chatMessages[j1] = null;
  5950.  
  5951. itemSelected = 0;
  5952. spellSelected = 0;
  5953. loadingStage = 0;
  5954. currentSound = 0;
  5955. setNorth();
  5956. anInt1021 = 0;
  5957. anInt985 = -1;
  5958. destX = 0;
  5959. destY = 0;
  5960. playerCount = 0;
  5961. npcCount = 0;
  5962. for (int i2 = 0; i2 < maxPlayers; i2++) {
  5963. playerArray[i2] = null;
  5964. aStreamArray895s[i2] = null;
  5965. }
  5966.  
  5967. for (int index = 0; index < 17; index++) {
  5968. console.inputConsoleMessages[index] = "";
  5969. }
  5970. for (int k2 = 0; k2 < 16384; k2++)
  5971. npcArray[k2] = null;
  5972.  
  5973. myPlayer = playerArray[myPlayerIndex] = new Player();
  5974. aClass19_1013.removeAll();
  5975. aClass19_1056.removeAll();
  5976. for (int l2 = 0; l2 < 4; l2++) {
  5977. for (int i3 = 0; i3 < 104; i3++) {
  5978. for (int k3 = 0; k3 < 104; k3++)
  5979. groundArray[l2][i3][k3] = null;
  5980.  
  5981. }
  5982.  
  5983. }
  5984.  
  5985. aClass19_1179 = new NodeList();
  5986. anInt900 = 0;
  5987. friendsCount = 0;
  5988. dialogID = -1;
  5989. fullscreenInterfaceID = -1;
  5990. backDialogID = -1;
  5991. openInterfaceID = -1;
  5992. invOverlayInterfaceID = -1;
  5993. anInt1018 = -1;
  5994. aBoolean1149 = false;
  5995. tabID = 3;
  5996. inputDialogState = 0;
  5997. menuOpen = false;
  5998. messagePromptRaised = false;
  5999. aString844 = null;
  6000. anInt1055 = 0;
  6001. anInt1054 = -1;
  6002. aBoolean1047 = true;
  6003. method45();
  6004. for (int j3 = 0; j3 < 5; j3++)
  6005. anIntArray990[j3] = 0;
  6006.  
  6007. for (int l3 = 0; l3 < 5; l3++) {
  6008. atPlayerActions[l3] = null;
  6009. atPlayerArray[l3] = false;
  6010. }
  6011.  
  6012. anInt1175 = 0;
  6013. anInt1134 = 0;
  6014. anInt986 = 0;
  6015. anInt1288 = 0;
  6016. anInt924 = 0;
  6017. anInt1188 = 0;
  6018. anInt1155 = 0;
  6019. anInt1226 = 0;
  6020. int anInt941 = 0;
  6021. int anInt1260 = 0;
  6022. resetImageProducers2();
  6023. return;
  6024. }
  6025. if (k == 3) {
  6026. loginMessage1 = "";
  6027. loginMessage2 = "Invalid username or password.";
  6028. return;
  6029. }
  6030. if (k == 4) {
  6031. loginMessage1 = "Your account has been disabled.";
  6032. loginMessage2 = "Please check your message-center for details.";
  6033. return;
  6034. }
  6035. if (k == 5) {
  6036. loginMessage1 = "Your account is already logged in.";
  6037. loginMessage2 = "Try again in 60 secs...";
  6038. return;
  6039. }
  6040. if (k == 6) {
  6041. loginMessage1 = "RuneScape has been updated!";
  6042. loginMessage2 = "Please reload this page.";
  6043. return;
  6044. }
  6045. if (k == 7) {
  6046. loginMessage1 = "This world is full.";
  6047. loginMessage2 = "Please use a different world.";
  6048. return;
  6049. }
  6050. if (k == 8) {
  6051. loginMessage1 = "Unable to connect.";
  6052. loginMessage2 = "Login server offline.";
  6053. return;
  6054. }
  6055. if (k == 9) {
  6056. loginMessage1 = "Login limit exceeded.";
  6057. loginMessage2 = "Too many connections from your address.";
  6058. return;
  6059. }
  6060. if (k == 10) {
  6061. loginMessage1 = "Unable to connect.";
  6062. loginMessage2 = "Bad session id.";
  6063. return;
  6064. }
  6065. if (k == 11) {
  6066. loginMessage2 = "Login server rejected session.";
  6067. loginMessage2 = "Please try again.";
  6068. return;
  6069. }
  6070. if (k == 12) {
  6071. loginMessage1 = "You need a members account to login to this world.";
  6072. loginMessage2 = "Please subscribe, or use a different world.";
  6073. return;
  6074. }
  6075. if (k == 13) {
  6076. loginMessage1 = "Could not complete login.";
  6077. loginMessage2 = "Please try using a different world.";
  6078. return;
  6079. }
  6080. if (k == 14) {
  6081. loginMessage1 = "The server is being updated.";
  6082. loginMessage2 = "Please wait 1 minute and try again.";
  6083. return;
  6084. }
  6085. if (k == 15) {
  6086. loggedIn = true;
  6087. stream.currentOffset = 0;
  6088. inStream.currentOffset = 0;
  6089. pktType = -1;
  6090. anInt841 = -1;
  6091. anInt842 = -1;
  6092. anInt843 = -1;
  6093. pktSize = 0;
  6094. anInt1009 = 0;
  6095. anInt1104 = 0;
  6096. menuActionRow = 0;
  6097. menuOpen = false;
  6098. aLong824 = System.currentTimeMillis();
  6099. return;
  6100. }
  6101. if (k == 16) {
  6102. loginMessage1 = "Login attempts exceeded.";
  6103. loginMessage2 = "Please wait 1 minute and try again.";
  6104. return;
  6105. }
  6106. if (k == 17) {
  6107. loginMessage1 = "You are standing in a members-only area.";
  6108. loginMessage2 = "To play on this world move to a free area first";
  6109. return;
  6110. }
  6111. if (k == 20) {
  6112. loginMessage1 = "Invalid loginserver requested";
  6113. loginMessage2 = "Please try using a different world.";
  6114. return;
  6115. }
  6116. if (k == 21) {
  6117. for (int k1 = socketStream.read(); k1 >= 0; k1--) {
  6118. loginMessage1 = "You have only just left another world";
  6119. loginMessage2 = "Your profile will be transferred in: " + k1 + " seconds";
  6120. drawLoginScreen(true);
  6121. try {
  6122. Thread.sleep(1000L);
  6123. }
  6124. catch (Exception _ex) {
  6125. }
  6126. }
  6127.  
  6128. login(s, s1, flag);
  6129. return;
  6130. }
  6131. if (k == -1) {
  6132. if (i1 == 0) {
  6133. if (loginFailures < 2) {
  6134. try {
  6135. Thread.sleep(2000L);
  6136. }
  6137. catch (Exception _ex) {
  6138. }
  6139. loginFailures++;
  6140. login(s, s1, flag);
  6141. return;
  6142. } else {
  6143. loginMessage1 = "No response from loginserver";
  6144. loginMessage2 = "Please wait 1 minute and try again.";
  6145. return;
  6146. }
  6147. } else {
  6148. loginMessage1 = "No response from server";
  6149. loginMessage2 = "Please try using a different world.";
  6150. return;
  6151. }
  6152. } else {
  6153. System.out.println("response:" + k);
  6154. loginMessage1 = "Unexpected server response";
  6155. loginMessage2 = "Please try using a different world.";
  6156. return;
  6157. }
  6158. }
  6159. catch (IOException _ex) {
  6160. loginMessage1 = "";
  6161. }
  6162. loginMessage2 = "Error connecting to server.";
  6163. }
  6164.  
  6165. public void setNorth() {
  6166. cameraOffsetX = 0;
  6167. cameraOffsetY = 0;
  6168. viewRotationOffset = 0;
  6169. viewRotation = 0;
  6170. minimapRotation = 0;
  6171. minimapZoom = 0;
  6172. }
  6173.  
  6174. private boolean doWalkTo(int i, int j, int k, int i1, int j1, int k1,
  6175. int l1, int i2, int j2, boolean flag, int k2) {
  6176. byte byte0 = 104;
  6177. byte byte1 = 104;
  6178. for (int l2 = 0; l2 < byte0; l2++) {
  6179. for (int i3 = 0; i3 < byte1; i3++) {
  6180. anIntArrayArray901[l2][i3] = 0;
  6181. anIntArrayArray825[l2][i3] = 0x5f5e0ff;
  6182. }
  6183.  
  6184. }
  6185.  
  6186. int j3 = j2;
  6187. int k3 = j1;
  6188. anIntArrayArray901[j2][j1] = 99;
  6189. anIntArrayArray825[j2][j1] = 0;
  6190. int l3 = 0;
  6191. int i4 = 0;
  6192. bigX[l3] = j2;
  6193. bigY[l3++] = j1;
  6194. boolean flag1 = false;
  6195. int j4 = bigX.length;
  6196. int ai[][] = aClass11Array1230[plane].anIntArrayArray294;
  6197. while (i4 != l3) {
  6198. j3 = bigX[i4];
  6199. k3 = bigY[i4];
  6200. i4 = (i4 + 1) % j4;
  6201. if (j3 == k2 && k3 == i2) {
  6202. flag1 = true;
  6203. break;
  6204. }
  6205. if (i1 != 0) {
  6206. if ((i1 < 5 || i1 == 10) && aClass11Array1230[plane].method219(k2, j3, k3, j, i1 - 1, i2)) {
  6207. flag1 = true;
  6208. break;
  6209. }
  6210. if (i1 < 10 && aClass11Array1230[plane].method220(k2, i2, k3, i1 - 1, j, j3)) {
  6211. flag1 = true;
  6212. break;
  6213. }
  6214. }
  6215. if (k1 != 0 && k != 0 && aClass11Array1230[plane].method221(i2, k2, j3, k, l1, k1, k3)) {
  6216. flag1 = true;
  6217. break;
  6218. }
  6219. int l4 = anIntArrayArray825[j3][k3] + 1;
  6220. if (j3 > 0 && anIntArrayArray901[j3 - 1][k3] == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0) {
  6221. bigX[l3] = j3 - 1;
  6222. bigY[l3] = k3;
  6223. l3 = (l3 + 1) % j4;
  6224. anIntArrayArray901[j3 - 1][k3] = 2;
  6225. anIntArrayArray825[j3 - 1][k3] = l4;
  6226. }
  6227. if (j3 < byte0 - 1 && anIntArrayArray901[j3 + 1][k3] == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0) {
  6228. bigX[l3] = j3 + 1;
  6229. bigY[l3] = k3;
  6230. l3 = (l3 + 1) % j4;
  6231. anIntArrayArray901[j3 + 1][k3] = 8;
  6232. anIntArrayArray825[j3 + 1][k3] = l4;
  6233. }
  6234. if (k3 > 0 && anIntArrayArray901[j3][k3 - 1] == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  6235. bigX[l3] = j3;
  6236. bigY[l3] = k3 - 1;
  6237. l3 = (l3 + 1) % j4;
  6238. anIntArrayArray901[j3][k3 - 1] = 1;
  6239. anIntArrayArray825[j3][k3 - 1] = l4;
  6240. }
  6241. if (k3 < byte1 - 1 && anIntArrayArray901[j3][k3 + 1] == 0 && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  6242. bigX[l3] = j3;
  6243. bigY[l3] = k3 + 1;
  6244. l3 = (l3 + 1) % j4;
  6245. anIntArrayArray901[j3][k3 + 1] = 4;
  6246. anIntArrayArray825[j3][k3 + 1] = l4;
  6247. }
  6248. 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) {
  6249. bigX[l3] = j3 - 1;
  6250. bigY[l3] = k3 - 1;
  6251. l3 = (l3 + 1) % j4;
  6252. anIntArrayArray901[j3 - 1][k3 - 1] = 3;
  6253. anIntArrayArray825[j3 - 1][k3 - 1] = l4;
  6254. }
  6255. 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) {
  6256. bigX[l3] = j3 + 1;
  6257. bigY[l3] = k3 - 1;
  6258. l3 = (l3 + 1) % j4;
  6259. anIntArrayArray901[j3 + 1][k3 - 1] = 9;
  6260. anIntArrayArray825[j3 + 1][k3 - 1] = l4;
  6261. }
  6262. 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) {
  6263. bigX[l3] = j3 - 1;
  6264. bigY[l3] = k3 + 1;
  6265. l3 = (l3 + 1) % j4;
  6266. anIntArrayArray901[j3 - 1][k3 + 1] = 6;
  6267. anIntArrayArray825[j3 - 1][k3 + 1] = l4;
  6268. }
  6269. 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) {
  6270. bigX[l3] = j3 + 1;
  6271. bigY[l3] = k3 + 1;
  6272. l3 = (l3 + 1) % j4;
  6273. anIntArrayArray901[j3 + 1][k3 + 1] = 12;
  6274. anIntArrayArray825[j3 + 1][k3 + 1] = l4;
  6275. }
  6276. }
  6277. anInt1264 = 0;
  6278. if (!flag1) {
  6279. if (flag) {
  6280. int i5 = 100;
  6281. for (int k5 = 1; k5 < 2; k5++) {
  6282. for (int i6 = k2 - k5; i6 <= k2 + k5; i6++) {
  6283. for (int l6 = i2 - k5; l6 <= i2 + k5; l6++)
  6284. if (i6 >= 0 && l6 >= 0 && i6 < 104 && l6 < 104 && anIntArrayArray825[i6][l6] < i5) {
  6285. i5 = anIntArrayArray825[i6][l6];
  6286. j3 = i6;
  6287. k3 = l6;
  6288. anInt1264 = 1;
  6289. flag1 = true;
  6290. }
  6291.  
  6292. }
  6293.  
  6294. if (flag1)
  6295. break;
  6296. }
  6297.  
  6298. }
  6299. if (!flag1)
  6300. return false;
  6301. }
  6302. i4 = 0;
  6303. bigX[i4] = j3;
  6304. bigY[i4++] = k3;
  6305. int l5;
  6306. for (int j5 = l5 = anIntArrayArray901[j3][k3]; j3 != j2 || k3 != j1; j5 = anIntArrayArray901[j3][k3]) {
  6307. if (j5 != l5) {
  6308. l5 = j5;
  6309. bigX[i4] = j3;
  6310. bigY[i4++] = k3;
  6311. }
  6312. if ((j5 & 2) != 0)
  6313. j3++;
  6314. else if ((j5 & 8) != 0)
  6315. j3--;
  6316. if ((j5 & 1) != 0)
  6317. k3++;
  6318. else if ((j5 & 4) != 0)
  6319. k3--;
  6320. }
  6321. // if(cancelWalk) { return i4 > 0; }
  6322.  
  6323.  
  6324. if (i4 > 0) {
  6325. int k4 = i4;
  6326. if (k4 > 25)
  6327. k4 = 25;
  6328. i4--;
  6329. int k6 = bigX[i4];
  6330. int i7 = bigY[i4];
  6331. anInt1288 += k4;
  6332. if (anInt1288 >= 92) {
  6333. stream.createFrame(36);
  6334. stream.writeDWord(0);
  6335. anInt1288 = 0;
  6336. }
  6337. if (i == 0) {
  6338. stream.createFrame(164);
  6339. stream.writeWordBigEndian(k4 + k4 + 3);
  6340. }
  6341. if (i == 1) {
  6342. stream.createFrame(248);
  6343. stream.writeWordBigEndian(k4 + k4 + 3 + 14);
  6344. }
  6345. if (i == 2) {
  6346. stream.createFrame(98);
  6347. stream.writeWordBigEndian(k4 + k4 + 3);
  6348. }
  6349. stream.method433(k6 + baseX);
  6350. destX = bigX[0];
  6351. destY = bigY[0];
  6352. for (int j7 = 1; j7 < k4; j7++) {
  6353. i4--;
  6354. stream.writeWordBigEndian(bigX[i4] - k6);
  6355. stream.writeWordBigEndian(bigY[i4] - i7);
  6356. }
  6357.  
  6358. stream.method431(i7 + baseY);
  6359. stream.method424(super.keyArray[5] != 1 ? 0 : 1);
  6360. return true;
  6361. }
  6362. return i != 1;
  6363. }
  6364.  
  6365. private void method86(Stream stream) {
  6366. for (int j = 0; j < anInt893; j++) {
  6367. int k = anIntArray894[j];
  6368. NPC npc = npcArray[k];
  6369. int l = stream.readUnsignedByte();
  6370. if ((l & 0x10) != 0) {
  6371. int i1 = stream.method434();
  6372. if (i1 == 65535)
  6373. i1 = -1;
  6374. int i2 = stream.readUnsignedByte();
  6375. if (i1 == npc.anim && i1 != -1) {
  6376. int l2 = Animation.anims[i1].anInt365;
  6377. if (l2 == 1) {
  6378. npc.anInt1527 = 0;
  6379. npc.anInt1528 = 0;
  6380. npc.anInt1529 = i2;
  6381. npc.anInt1530 = 0;
  6382. }
  6383. if (l2 == 2)
  6384. npc.anInt1530 = 0;
  6385. } else
  6386. if (i1 == -1 || npc.anim == -1 || Animation.anims[i1].anInt359 >= Animation.anims[npc.anim].anInt359) {
  6387. npc.anim = i1;
  6388. npc.anInt1527 = 0;
  6389. npc.anInt1528 = 0;
  6390. npc.anInt1529 = i2;
  6391. npc.anInt1530 = 0;
  6392. npc.anInt1542 = npc.smallXYIndex;
  6393. }
  6394. }
  6395. if ((l & 8) != 0) {
  6396. int j1 = stream.method426();
  6397. int j2 = stream.method427();
  6398. npc.updateHitData(j2, j1, loopCycle);
  6399. npc.loopCycleStatus = loopCycle + 300;
  6400. npc.currentHealth = stream.method426();
  6401. npc.maxHealth = stream.readUnsignedByte();
  6402. }
  6403. if ((l & 0x80) != 0) {
  6404. npc.anInt1520 = stream.readUnsignedWord();
  6405. int k1 = stream.readDWord();
  6406. npc.anInt1524 = k1 >> 16;
  6407. npc.anInt1523 = loopCycle + (k1 & 0xffff);
  6408. npc.anInt1521 = 0;
  6409. npc.anInt1522 = 0;
  6410. if (npc.anInt1523 > loopCycle)
  6411. npc.anInt1521 = -1;
  6412. if (npc.anInt1520 == 65535)
  6413. npc.anInt1520 = -1;
  6414. }
  6415. if ((l & 0x20) != 0) {
  6416. npc.interactingEntity = stream.readUnsignedWord();
  6417. if (npc.interactingEntity == 65535)
  6418. npc.interactingEntity = -1;
  6419. }
  6420. if ((l & 1) != 0) {
  6421. npc.textSpoken = stream.readString();
  6422. npc.textCycle = 100;
  6423. // entityMessage(npc);
  6424.  
  6425. }
  6426. if ((l & 0x40) != 0) {
  6427. int l1 = stream.method427();
  6428. int k2 = stream.method428();
  6429. npc.updateHitData(k2, l1, loopCycle);
  6430. npc.loopCycleStatus = loopCycle + 300;
  6431. npc.currentHealth = stream.method428();
  6432. npc.maxHealth = stream.method427();
  6433. }
  6434. if ((l & 2) != 0) {
  6435. npc.desc = EntityDef.forID(stream.method436());
  6436. npc.anInt1540 = npc.desc.aByte68;
  6437. npc.anInt1504 = npc.desc.anInt79;
  6438. npc.anInt1554 = npc.desc.walkAnim;
  6439. npc.anInt1555 = npc.desc.walkBackAnim;
  6440. npc.anInt1556 = npc.desc.walkLeftAnim;
  6441. npc.anInt1557 = npc.desc.walkRightAnim;
  6442. npc.anInt1511 = npc.desc.standAnim;
  6443. }
  6444. if ((l & 4) != 0) {
  6445. npc.anInt1538 = stream.method434();
  6446. npc.anInt1539 = stream.method434();
  6447. }
  6448. }
  6449. }
  6450.  
  6451. private void buildAtNPCMenu(EntityDef entityDef, int i, int j, int k) {
  6452. if (menuActionRow >= 400)
  6453. return;
  6454. if (entityDef.childrenIDs != null)
  6455. entityDef = entityDef.method161();
  6456. if (entityDef == null)
  6457. return;
  6458. if (!entityDef.aBoolean84)
  6459. return;
  6460. String s = entityDef.name;
  6461. if (entityDef.combatLevel != 0)
  6462. s = s + combatDiffColor(myPlayer.combatLevel, entityDef.combatLevel) + " (level-" + entityDef.combatLevel + ")";
  6463. if (itemSelected == 1) {
  6464. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @yel@" + s;
  6465. menuActionID[menuActionRow] = 582;
  6466. menuActionCmd1[menuActionRow] = i;
  6467. menuActionCmd2[menuActionRow] = k;
  6468. menuActionCmd3[menuActionRow] = j;
  6469. menuActionRow++;
  6470. return;
  6471. }
  6472. if (spellSelected == 1) {
  6473. if ((spellUsableOn & 2) == 2) {
  6474. menuActionName[menuActionRow] = spellTooltip + " @yel@" + s;
  6475. menuActionID[menuActionRow] = 413;
  6476. menuActionCmd1[menuActionRow] = i;
  6477. menuActionCmd2[menuActionRow] = k;
  6478. menuActionCmd3[menuActionRow] = j;
  6479. menuActionRow++;
  6480. }
  6481. } else {
  6482. if (entityDef.actions != null) {
  6483. for (int l = 4; l >= 0; l--)
  6484. if (entityDef.actions[l] != null && !entityDef.actions[l].equalsIgnoreCase("attack")) {
  6485. menuActionName[menuActionRow] = entityDef.actions[l] + " @yel@" + s;
  6486. if (l == 0)
  6487. menuActionID[menuActionRow] = 20;
  6488. if (l == 1)
  6489. menuActionID[menuActionRow] = 412;
  6490. if (l == 2)
  6491. menuActionID[menuActionRow] = 225;
  6492. if (l == 3)
  6493. menuActionID[menuActionRow] = 965;
  6494. if (l == 4)
  6495. menuActionID[menuActionRow] = 478;
  6496. menuActionCmd1[menuActionRow] = i;
  6497. menuActionCmd2[menuActionRow] = k;
  6498. menuActionCmd3[menuActionRow] = j;
  6499. menuActionRow++;
  6500. }
  6501.  
  6502. }
  6503. if (entityDef.actions != null) {
  6504. for (int i1 = 4; i1 >= 0; i1--)
  6505. if (entityDef.actions[i1] != null && entityDef.actions[i1].equalsIgnoreCase("attack")) {
  6506. char c = '\0';
  6507. if (entityDef.combatLevel > myPlayer.combatLevel)
  6508. c = '\u07D0';
  6509. menuActionName[menuActionRow] = entityDef.actions[i1] + " @yel@" + s;
  6510. if (i1 == 0)
  6511. menuActionID[menuActionRow] = 20 + c;
  6512. if (i1 == 1)
  6513. menuActionID[menuActionRow] = 412 + c;
  6514. if (i1 == 2)
  6515. menuActionID[menuActionRow] = 225 + c;
  6516. if (i1 == 3)
  6517. menuActionID[menuActionRow] = 965 + c;
  6518. if (i1 == 4)
  6519. menuActionID[menuActionRow] = 478 + c;
  6520. menuActionCmd1[menuActionRow] = i;
  6521. menuActionCmd2[menuActionRow] = k;
  6522. menuActionCmd3[menuActionRow] = j;
  6523. menuActionRow++;
  6524. }
  6525.  
  6526. }
  6527. menuActionName[menuActionRow] = "Examine @yel@" + s;
  6528. menuActionID[menuActionRow] = 1025;
  6529. menuActionCmd1[menuActionRow] = i;
  6530. menuActionCmd2[menuActionRow] = k;
  6531. menuActionCmd3[menuActionRow] = j;
  6532. menuActionRow++;
  6533. }
  6534. }
  6535.  
  6536. private void buildAtPlayerMenu(int i, int j, Player player, int k) {
  6537. if (player == myPlayer)
  6538. return;
  6539. if (menuActionRow >= 400)
  6540. return;
  6541. String s;
  6542. if (player.skill == 0)
  6543. s = player.name + combatDiffColor(myPlayer.combatLevel, player.combatLevel) + " (level-" + player.combatLevel + ")";
  6544. else
  6545. s = player.name + " (skill-" + player.skill + ")";
  6546. if (itemSelected == 1) {
  6547. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @whi@" + s;
  6548. menuActionID[menuActionRow] = 491;
  6549. menuActionCmd1[menuActionRow] = j;
  6550. menuActionCmd2[menuActionRow] = i;
  6551. menuActionCmd3[menuActionRow] = k;
  6552. menuActionRow++;
  6553. } else if (spellSelected == 1) {
  6554. if ((spellUsableOn & 8) == 8) {
  6555. menuActionName[menuActionRow] = spellTooltip + " @whi@" + s;
  6556. menuActionID[menuActionRow] = 365;
  6557. menuActionCmd1[menuActionRow] = j;
  6558. menuActionCmd2[menuActionRow] = i;
  6559. menuActionCmd3[menuActionRow] = k;
  6560. menuActionRow++;
  6561. }
  6562. } else {
  6563. for (int l = 4; l >= 0; l--)
  6564. if (atPlayerActions[l] != null) {
  6565. menuActionName[menuActionRow] = atPlayerActions[l] + " @whi@" + s;
  6566. char c = '\0';
  6567. if (atPlayerActions[l].equalsIgnoreCase("attack")) {
  6568. if (player.combatLevel > myPlayer.combatLevel)
  6569. c = '\u07D0';
  6570. if (myPlayer.team != 0 && player.team != 0)
  6571. if (myPlayer.team == player.team)
  6572. c = '\u07D0';
  6573. else
  6574. c = '\0';
  6575. } else if (atPlayerArray[l])
  6576. c = '\u07D0';
  6577. if (l == 0)
  6578. menuActionID[menuActionRow] = 561 + c;
  6579. if (l == 1)
  6580. menuActionID[menuActionRow] = 779 + c;
  6581. if (l == 2)
  6582. menuActionID[menuActionRow] = 27 + c;
  6583. if (l == 3)
  6584. menuActionID[menuActionRow] = 577 + c;
  6585. if (l == 4)
  6586. menuActionID[menuActionRow] = 729 + c;
  6587. menuActionCmd1[menuActionRow] = j;
  6588. menuActionCmd2[menuActionRow] = i;
  6589. menuActionCmd3[menuActionRow] = k;
  6590. menuActionRow++;
  6591. }
  6592.  
  6593. }
  6594. for (int i1 = 0; i1 < menuActionRow; i1++)
  6595. if (menuActionID[i1] == 516) {
  6596. menuActionName[i1] = "Walk here @whi@" + s;
  6597. return;
  6598. }
  6599.  
  6600. }
  6601.  
  6602. private void method89(Class30_Sub1 class30_sub1) {
  6603. int i = 0;
  6604. int j = -1;
  6605. int k = 0;
  6606. int l = 0;
  6607. if (class30_sub1.anInt1296 == 0)
  6608. i = worldController.method300(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  6609. if (class30_sub1.anInt1296 == 1)
  6610. i = worldController.method301(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  6611. if (class30_sub1.anInt1296 == 2)
  6612. i = worldController.method302(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  6613. if (class30_sub1.anInt1296 == 3)
  6614. i = worldController.method303(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  6615. if (i != 0) {
  6616. int i1 = worldController.method304(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298, i);
  6617. j = i >> 14 & 0x7fff;
  6618. k = i1 & 0x1f;
  6619. l = i1 >> 6;
  6620. }
  6621. class30_sub1.anInt1299 = j;
  6622. class30_sub1.anInt1301 = k;
  6623. class30_sub1.anInt1300 = l;
  6624. }
  6625.  
  6626. public final void method90() {
  6627. for (int index = 0; index < currentSound; index++) {
  6628. //if (soundDelay[index] <= 0) {
  6629. boolean flag1 = false;
  6630. try {
  6631. Stream stream = Sounds.method241(soundType[index], sound[index]);
  6632. new SoundPlayer((InputStream) new ByteArrayInputStream(stream.buffer, 0, stream.currentOffset), soundVolume[index], soundDelay[index]);
  6633. if (System.currentTimeMillis() + (long) (stream.currentOffset / 22) > aLong1172 + (long) (anInt1257 / 22)) {
  6634. anInt1257 = stream.currentOffset;
  6635. aLong1172 = System.currentTimeMillis();
  6636. }
  6637. } catch (Exception exception) {
  6638. exception.printStackTrace();
  6639. }
  6640. if (!flag1 || soundDelay[index] == -5) {
  6641. currentSound--;
  6642. for (int j = index; j < currentSound; j++) {
  6643. sound[j] = sound[j + 1];
  6644. soundType[j] = soundType[j + 1];
  6645. soundDelay[j] = soundDelay[j + 1];
  6646. soundVolume[j] = soundVolume[j + 1];
  6647. }
  6648. index--;
  6649. } else {
  6650. soundDelay[index] = -5;
  6651. }
  6652. /*} else {
  6653. soundDelay[index]--;
  6654. }*/
  6655. }
  6656.  
  6657. if (prevSong > 0) {
  6658. prevSong -= 20;
  6659. if (prevSong < 0)
  6660. prevSong = 0;
  6661. if (prevSong == 0 && musicEnabled) {
  6662. nextSong = currentSong;
  6663. songChanging = true;
  6664. onDemandFetcher.method558(2, nextSong);
  6665. }
  6666. }
  6667. }
  6668.  
  6669. /*private void method90() {
  6670. for (int i = 0; i < currentSound; i++)
  6671. if (soundDelay[i] <= 0) {
  6672. boolean flag1 = false;
  6673. try {
  6674. if (sound[i] == anInt874 && soundType[i] == anInt1289) {
  6675. if (!replayWave())
  6676. flag1 = true;
  6677. } else {
  6678. Stream stream = Sounds.method241(soundType[i], sound[i]);
  6679. if (System.currentTimeMillis() + (long) (stream.currentOffset / 22) > aLong1172 + (long) (anInt1257 / 22)) {
  6680. anInt1257 = stream.currentOffset;
  6681. aLong1172 = System.currentTimeMillis();
  6682. if (saveWave(stream.buffer, stream.currentOffset)) {
  6683. anInt874 = sound[i];
  6684. anInt1289 = soundType[i];
  6685. } else {
  6686. flag1 = true;
  6687. }
  6688. }
  6689. }
  6690. }
  6691. catch (Exception exception) {
  6692. }
  6693. if (!flag1 || soundDelay[i] == -5) {
  6694. currentSound--;
  6695. for (int j = i; j < currentSound; j++) {
  6696. sound[j] = sound[j + 1];
  6697. soundType[j] = soundType[j + 1];
  6698. soundDelay[j] = soundDelay[j + 1];
  6699. }
  6700.  
  6701. i--;
  6702. } else {
  6703. soundDelay[i] = -5;
  6704. }
  6705. } else {
  6706. soundDelay[i]--;
  6707. }
  6708.  
  6709. if (prevSong > 0) {
  6710. prevSong -= 20;
  6711. if (prevSong < 0)
  6712. prevSong = 0;
  6713. if (prevSong == 0 && musicEnabled && !lowMem) {
  6714. nextSong = currentSong;
  6715. songChanging = true;
  6716. onDemandFetcher.method558(2, nextSong);
  6717. }
  6718. }
  6719. }*/
  6720.  
  6721. public String indexLocation(int cacheIndex, int index) {
  6722. return signlink.cacheLocation() + "index" + cacheIndex + "/" + (index != -1 ? index + ".gz" : "");
  6723. }
  6724.  
  6725. public static String getFileNameWithoutExtension(String fileName) {
  6726. File tmpFile = new File(fileName);
  6727. tmpFile.getName();
  6728. int whereDot = tmpFile.getName().lastIndexOf('.');
  6729. if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2) {
  6730. return tmpFile.getName().substring(0, whereDot);
  6731. }
  6732. return "";
  6733. }
  6734.  
  6735. public void repackCacheIndex(int cacheIndex) {
  6736. System.out.println("Started repacking index " + cacheIndex + ".");
  6737. int indexLength = new File(indexLocation(cacheIndex, -1)).listFiles().length;
  6738. File[] file = new File(indexLocation(cacheIndex, -1)).listFiles();
  6739. try {
  6740. for (int index = 0; index < indexLength; index++) {
  6741. int fileIndex = Integer.parseInt(getFileNameWithoutExtension(file[index].toString()));
  6742. byte[] data = fileToByteArray(cacheIndex, fileIndex);
  6743. if(data != null && data.length > 0) {
  6744. decompressors[cacheIndex].method234(data.length, data, fileIndex);
  6745. System.out.println("Repacked " + fileIndex + ".");
  6746. } else {
  6747. System.out.println("Unable to locate index " + fileIndex + ".");
  6748. }
  6749. }
  6750. } catch(Exception e) {
  6751. System.out.println("Error packing cache index " + cacheIndex + ".");
  6752. }
  6753. System.out.println("Finished repacking " + cacheIndex + ".");
  6754. }
  6755.  
  6756. public byte[] fileToByteArray(int cacheIndex, int index) {
  6757. try {
  6758. if (indexLocation(cacheIndex, index).length() <= 0 || indexLocation(cacheIndex, index) == null) {
  6759. return null;
  6760. }
  6761. File file = new File(indexLocation(cacheIndex, index));
  6762. byte[] fileData = new byte[(int)file.length()];
  6763. FileInputStream fis = new FileInputStream(file);
  6764. fis.read(fileData);
  6765. fis.close();
  6766. return fileData;
  6767. } catch(Exception e) {
  6768. return null;
  6769. }
  6770. }
  6771.  
  6772.  
  6773. public static Client instance;
  6774.  
  6775. void startUp() {
  6776. drawSmoothLoading(20, "Starting up");
  6777. new CacheDownloader(this).downloadCache();
  6778. if (signlink.sunjava)
  6779. super.minDelay = 5;
  6780. if (aBoolean993) {
  6781. // rsAlreadyLoaded = true;
  6782. // return;
  6783. }
  6784. aBoolean993 = true;
  6785. boolean flag = true;
  6786. String s = getDocumentBaseHost();
  6787. if (s.endsWith("jagex.com"))
  6788. flag = true;
  6789. if (s.endsWith("runescape.com"))
  6790. flag = true;
  6791. if (s.endsWith("192.168.1.2"))
  6792. flag = true;
  6793. if (s.endsWith("192.168.1.229"))
  6794. flag = true;
  6795. if (s.endsWith("192.168.1.228"))
  6796. flag = true;
  6797. if (s.endsWith("192.168.1.227"))
  6798. flag = true;
  6799. if (s.endsWith("192.168.1.226"))
  6800. flag = true;
  6801. if (s.endsWith("127.0.0.1"))
  6802. flag = true;
  6803. if (!flag) {
  6804. genericLoadingError = true;
  6805. return;
  6806. }
  6807. if (signlink.cache_dat != null) {
  6808. for (int i = 0; i < 5; i++)
  6809. decompressors[i] = new Decompressor(signlink.cache_dat, signlink.cache_idx[i], i + 1);
  6810.  
  6811. }
  6812. try {
  6813. connectServer();
  6814. titleStreamLoader = streamLoaderForName(1, "title screen", "title", expectedCRCs[1], 25);
  6815. smallText = new TextDrawingArea(false, "p11_full", titleStreamLoader);
  6816. regularText = new TextDrawingArea(false, "p12_full", titleStreamLoader);
  6817. chatTextDrawingArea = new TextDrawingArea(false, "b12_full", titleStreamLoader);
  6818. TextDrawingArea aTextDrawingArea_1273 = new TextDrawingArea(true, "q8_full", titleStreamLoader);
  6819. smallFontNE = new GameFont(false, "p11_full", titleStreamLoader);
  6820. regularFontNE = new GameFont(false, "p12_full", titleStreamLoader);
  6821. boldFontNE = new GameFont(false, "b12_full", titleStreamLoader);
  6822. fancyFontNE = new GameFont(true, "q8_full", titleStreamLoader);
  6823. drawLogo();
  6824. loadTitleScreen();
  6825. // repackCacheIndex(1);
  6826. StreamLoader streamLoader = streamLoaderForName(2, "config", "config", expectedCRCs[2], 30);
  6827. StreamLoader streamLoader_1 = streamLoaderForName(3, "interface", "interface", expectedCRCs[3], 35);
  6828. StreamLoader streamLoader_2 = streamLoaderForName(4, "2d graphics", "media", expectedCRCs[4], 40);
  6829. StreamLoader streamLoader_3 = streamLoaderForName(6, "textures", "textures", expectedCRCs[6], 45);
  6830. StreamLoader streamLoader_4 = streamLoaderForName(7, "chat system", "wordenc", expectedCRCs[7], 50);
  6831. StreamLoader streamLoader_5 = streamLoaderForName(8, "sound effects", "sounds", expectedCRCs[8], 55);
  6832. byteGroundArray = new byte[4][104][104];
  6833. intGroundArray = new int[4][105][105];
  6834. worldController = new WorldController(intGroundArray);
  6835. for (int j = 0; j < 4; j++)
  6836. aClass11Array1230[j] = new Class11();
  6837.  
  6838. minimapImage = new Sprite(512, 512);
  6839. StreamLoader streamLoader_6 = streamLoaderForName(5, "update list", "versionlist", expectedCRCs[5], 60);
  6840. drawSmoothLoading(60, "Connecting to update server");
  6841. onDemandFetcher = new OnDemandFetcher();
  6842. onDemandFetcher.start(streamLoader_6, this);
  6843. //Class36.method528(onDemandFetcher.getAnimCount());
  6844. Model.method459(onDemandFetcher.getVersionCount(0), onDemandFetcher);
  6845.  
  6846. if (!lowMem) {
  6847. nextSong = 0;
  6848. try {
  6849. nextSong = Integer.parseInt(getParameter("music"));
  6850. }
  6851. catch (Exception _ex) {
  6852. }
  6853. songChanging = true;
  6854. onDemandFetcher.method558(2, nextSong);
  6855. while (onDemandFetcher.getNodeCount() > 0) {
  6856. processOnDemandQueue();
  6857. try {
  6858. Thread.sleep(100L);
  6859. }
  6860. catch (Exception _ex) {
  6861. }
  6862. if (onDemandFetcher.anInt1349 > 3) {
  6863. loadError();
  6864. return;
  6865. }
  6866. }
  6867. }
  6868. //drawSmoothLoading(65, "Requesting animations");
  6869. int k = onDemandFetcher.getVersionCount(1);
  6870. /*for(int i1 = 0; i1 < k; i1++)
  6871. onDemandFetcher.method558(1, i1);
  6872.  
  6873. while(onDemandFetcher.getNodeCount() > 0)
  6874. {
  6875. int j1 = k - onDemandFetcher.getNodeCount();
  6876. if(j1 > 0)
  6877. drawSmoothLoading(65, "Loading animations - " + (j1 * 100) / k + "%");
  6878. processOnDemandQueue();
  6879. try
  6880. {
  6881. Thread.sleep(100L);
  6882. }
  6883. catch(Exception _ex) { }
  6884. if(onDemandFetcher.anInt1349 > 3)
  6885. {
  6886. loadError();
  6887. return;
  6888. }
  6889. }*/
  6890. drawSmoothLoading(70, "Requesting models");
  6891. k = onDemandFetcher.getVersionCount(0);
  6892. for (int k1 = 0; k1 < k; k1++) {
  6893. int l1 = onDemandFetcher.getModelIndex(k1);
  6894. if ((l1 & 1) != 0)
  6895. onDemandFetcher.method558(0, k1);
  6896. }
  6897.  
  6898. k = onDemandFetcher.getNodeCount();
  6899. while (onDemandFetcher.getNodeCount() > 0) {
  6900. int i2 = k - onDemandFetcher.getNodeCount();
  6901. if (i2 > 0)
  6902. drawSmoothLoading(70, "Loading models - " + (i2 * 100) / k + "%");
  6903. processOnDemandQueue();
  6904. try {
  6905. Thread.sleep(100L);
  6906. }
  6907. catch (Exception _ex) {
  6908. }
  6909. }
  6910. if (decompressors[0] != null) {
  6911. drawSmoothLoading(75, "Requesting maps");
  6912. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 47));
  6913. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 47));
  6914. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 48));
  6915. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 48));
  6916. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 49));
  6917. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 49));
  6918. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 47, 47));
  6919. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 47, 47));
  6920. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 47, 48));
  6921. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 47, 48));
  6922. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 148, 48));
  6923. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 148, 48));
  6924. k = onDemandFetcher.getNodeCount();
  6925. while (onDemandFetcher.getNodeCount() > 0) {
  6926. int j2 = k - onDemandFetcher.getNodeCount();
  6927. if (j2 > 0)
  6928. drawSmoothLoading(75, "Loading maps - " + (j2 * 100) / k + "%");
  6929. processOnDemandQueue();
  6930. try {
  6931. Thread.sleep(100L);
  6932. }
  6933. catch (Exception _ex) {
  6934. }
  6935. }
  6936. }
  6937. k = onDemandFetcher.getVersionCount(0);
  6938. for (int k2 = 0; k2 < k; k2++) {
  6939. int l2 = onDemandFetcher.getModelIndex(k2);
  6940. byte byte0 = 0;
  6941. if ((l2 & 8) != 0)
  6942. byte0 = 10;
  6943. else if ((l2 & 0x20) != 0)
  6944. byte0 = 9;
  6945. else if ((l2 & 0x10) != 0)
  6946. byte0 = 8;
  6947. else if ((l2 & 0x40) != 0)
  6948. byte0 = 7;
  6949. else if ((l2 & 0x80) != 0)
  6950. byte0 = 6;
  6951. else if ((l2 & 2) != 0)
  6952. byte0 = 5;
  6953. else if ((l2 & 4) != 0)
  6954. byte0 = 4;
  6955. if ((l2 & 1) != 0)
  6956. byte0 = 3;
  6957. if (byte0 != 0)
  6958. onDemandFetcher.method563(byte0, 0, k2);
  6959. }
  6960.  
  6961. onDemandFetcher.method554(isMembers);
  6962. if (!lowMem) {
  6963. int l = onDemandFetcher.getVersionCount(2);
  6964. for (int i3 = 1; i3 < l; i3++)
  6965. if (onDemandFetcher.method569(i3))
  6966. onDemandFetcher.method563((byte) 1, 2, i3);
  6967.  
  6968. }
  6969. drawSmoothLoading(80, "Unpacking media");
  6970. for(int bh = 2; bh < 7; bh++) {
  6971. bountyHunter[bh] = new Sprite("bounty "+bh+"");
  6972. }
  6973. SpriteLoader.loadSprites(streamLoader);
  6974. cacheSprite = SpriteLoader.sprites;
  6975. try {
  6976. InterfaceLoader.loadInterfaces(streamLoader);
  6977. cacheInterface = InterfaceLoader.sprites;
  6978. } catch (Exception e) {
  6979. }
  6980. invBack = new Background(streamLoader_2, "invback", 0);
  6981. chatBack = new Background(streamLoader_2, "chatback", 0);
  6982. mapBack = new Background(streamLoader_2, "mapback", 0);
  6983. backBase1 = new Background(streamLoader_2, "backbase1", 0);
  6984. backBase2 = new Background(streamLoader_2, "backbase2", 0);
  6985. backHmid1 = new Background(streamLoader_2, "backhmid1", 0);
  6986. for (int j3 = 0; j3 < 13; j3++)
  6987. sideIcons[j3] = new Sprite(streamLoader_2, "sideicons", j3);
  6988.  
  6989. compass = new Sprite(streamLoader_2, "compass", 0);
  6990. mapEdge = new Sprite(streamLoader_2, "mapedge", 0);
  6991. multiOverlay = new Sprite(streamLoader_2, "overlay_multiway", 0);
  6992. mapEdge.method345();
  6993. try {
  6994. for (int k3 = 0; k3 < 100; k3++)
  6995. mapScenes[k3] = new Background(streamLoader_2, "mapscene", k3);
  6996.  
  6997. }
  6998. catch (Exception _ex) {
  6999. }
  7000. try {
  7001. for (int l3 = 0; l3 < 100; l3++)
  7002. mapFunctions[l3] = new Sprite(streamLoader_2,"mapfunction", l3);
  7003.  
  7004. }
  7005. catch (Exception _ex) {
  7006. }
  7007. try {
  7008. for (int i4 = 0; i4 < 20; i4++)
  7009. hitMarks[i4] = new Sprite(streamLoader_2, "hitmarks", i4);
  7010.  
  7011. }
  7012. catch (Exception _ex) {
  7013. }
  7014. try {
  7015. for(int j4 = 0; j4 < 8; j4++)
  7016. headIcons[j4] = new Sprite(streamLoader_2, "headicons_prayer", j4);
  7017. for(int j45 = 0; j45 < 11; j45++)
  7018. skullIcons[j45] = new Sprite(streamLoader_2, "headicons_pk", j45 );
  7019.  
  7020. }
  7021. catch (Exception _ex) {
  7022. }
  7023. mapFlag = new Sprite(streamLoader_2, "mapmarker", 0);
  7024. mapMarker = new Sprite(streamLoader_2, "mapmarker", 1);
  7025. for (int k4 = 0; k4 < 8; k4++)
  7026. crosses[k4] = new Sprite(streamLoader_2, "cross", k4);
  7027.  
  7028. mapDotItem = new Sprite(streamLoader_2, "mapdots", 0);
  7029. mapDotNPC = new Sprite(streamLoader_2, "mapdots", 1);
  7030. mapDotPlayer = new Sprite(streamLoader_2, "mapdots", 2);
  7031. mapDotFriend = new Sprite(streamLoader_2, "mapdots", 3);
  7032. mapDotTeam = new Sprite(streamLoader_2, "mapdots", 4);
  7033. mapDotClan = new Sprite(streamLoader_2, "mapdots", 5);
  7034. scrollBar1 = new Background(streamLoader_2, "scrollbar", 0);
  7035. scrollBar2 = new Background(streamLoader_2, "scrollbar", 1);
  7036. redStone1 = new Background(streamLoader_2, "redstone1", 0);
  7037. redStone2 = new Background(streamLoader_2, "redstone2", 0);
  7038. redStone3 = new Background(streamLoader_2, "redstone3", 0);
  7039. redStone1_2 = new Background(streamLoader_2, "redstone1", 0);
  7040. redStone1_2.method358();
  7041. redStone2_2 = new Background(streamLoader_2, "redstone2", 0);
  7042. redStone2_2.method358();
  7043. redStone1_3 = new Background(streamLoader_2, "redstone1", 0);
  7044. redStone1_3.method359();
  7045. redStone2_3 = new Background(streamLoader_2, "redstone2", 0);
  7046. redStone2_3.method359();
  7047. redStone3_2 = new Background(streamLoader_2, "redstone3", 0);
  7048. redStone3_2.method359();
  7049. redStone1_4 = new Background(streamLoader_2, "redstone1", 0);
  7050. redStone1_4.method358();
  7051. redStone1_4.method359();
  7052. redStone2_4 = new Background(streamLoader_2, "redstone2", 0);
  7053. redStone2_4.method358();
  7054. redStone2_4.method359();
  7055. for (int l4 = 0; l4 < 2; l4++)
  7056. modIcons[l4] = new Sprite(streamLoader_2, "mod_icons", l4);
  7057.  
  7058. Sprite sprite = new Sprite(streamLoader_2, "screenframe", 0);
  7059. leftFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  7060. sprite.method346(0, 0);
  7061. sprite = new Sprite(streamLoader_2, "screenframe", 1);
  7062. topFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  7063. sprite.method346(0, 0);
  7064. int i5 = (int) (Math.random() * 21D) - 10;
  7065. int j5 = (int) (Math.random() * 21D) - 10;
  7066. int k5 = (int) (Math.random() * 21D) - 10;
  7067. int l5 = (int) (Math.random() * 41D) - 20;
  7068. for (int i6 = 0; i6 < 100; i6++) {
  7069. if (mapFunctions[i6] != null)
  7070. mapFunctions[i6].method344(i5 + l5, j5 + l5, k5 + l5);
  7071. if (mapScenes[i6] != null)
  7072. mapScenes[i6].method360(i5 + l5, j5 + l5, k5 + l5);
  7073. }
  7074.  
  7075. drawSmoothLoading(83, "Unpacking textures");
  7076. Texture.method368(streamLoader_3);
  7077. Texture.method372(0.80000000000000004D);
  7078. Texture.method367();
  7079. drawSmoothLoading(86, "Unpacking config");
  7080. Animation.unpackConfig(streamLoader);
  7081. ObjectDef.unpackConfig(streamLoader);
  7082. Flo.unpackConfig(streamLoader);
  7083. ItemDef.unpackConfig(streamLoader);
  7084. EntityDef.unpackConfig(streamLoader);
  7085. IDK.unpackConfig(streamLoader);
  7086. SpotAnim.unpackConfig(streamLoader);
  7087. Varp.unpackConfig(streamLoader);
  7088. VarBit.unpackConfig(streamLoader);
  7089. ItemDef.isMembers = isMembers;
  7090. if (!lowMem) {
  7091. drawSmoothLoading(90, "Unpacking sounds");
  7092. byte abyte0[] = streamLoader_5.getDataForName("sounds.dat");
  7093. Stream stream = new Stream(abyte0);
  7094. Sounds.unpack(stream);
  7095. }
  7096. drawSmoothLoading(95, "Unpacking interfaces");
  7097. GameFont neFonts[] = {
  7098. smallFontNE, regularFontNE, boldFontNE, fancyFontNE
  7099. };
  7100. for(GameFont nef: neFonts){
  7101. nef.setmodIcons(modIcons, (int[])null);
  7102. }
  7103. TextDrawingArea aclass30_sub2_sub1_sub4s[] = {
  7104. smallText, regularText, chatTextDrawingArea, aTextDrawingArea_1273
  7105. };
  7106. RSInterface.unpack(streamLoader_1, aclass30_sub2_sub1_sub4s, streamLoader_2);
  7107. drawSmoothLoading(100, "Preparing game engine");
  7108. for (int j6 = 0; j6 < 33; j6++) {
  7109. int k6 = 999;
  7110. int i7 = 0;
  7111. for (int k7 = 0; k7 < 34; k7++) {
  7112. if (mapBack.aByteArray1450[k7 + j6 * mapBack.anInt1452] == 0) {
  7113. if (k6 == 999)
  7114. k6 = k7;
  7115. continue;
  7116. }
  7117. if (k6 == 999)
  7118. continue;
  7119. i7 = k7;
  7120. break;
  7121. }
  7122.  
  7123. anIntArray968[j6] = k6;
  7124. anIntArray1057[j6] = i7 - k6;
  7125. }
  7126.  
  7127. for (int l6 = 5; l6 < 156; l6++) {
  7128. int j7 = 999;
  7129. int l7 = 0;
  7130. for (int j8 = 25; j8 < 172; j8++) {
  7131. if (mapBack.aByteArray1450[j8 + l6 * mapBack.anInt1452] == 0 && (j8 > 34 || l6 > 34)) {
  7132. if (j7 == 999)
  7133. j7 = j8;
  7134. continue;
  7135. }
  7136. if (j7 == 999)
  7137. continue;
  7138. l7 = j8;
  7139. break;
  7140. }
  7141.  
  7142. anIntArray1052[l6 - 5] = j7 - 25;
  7143. anIntArray1229[l6 - 5] = l7 - j7;
  7144. }
  7145. setBounds();
  7146. // Censor.loadConfig(streamLoader_4);
  7147. Animable_Sub5.clientInstance = this;
  7148. ObjectDef.clientInstance = this;
  7149. EntityDef.clientInstance = this;
  7150. return;
  7151. }
  7152. catch (Exception exception) {
  7153. signlink.reporterror("loaderror " + aString1049 + " " + anInt1079);
  7154. }
  7155. loadingError = true;
  7156. }
  7157.  
  7158. private void method91(Stream stream, int i) {
  7159. while (stream.bitPosition + 10 < i * 8) {
  7160. int j = stream.readBits(11);
  7161. if (j == 2047)
  7162. break;
  7163. if (playerArray[j] == null) {
  7164. playerArray[j] = new Player();
  7165. if (aStreamArray895s[j] != null)
  7166. playerArray[j].updatePlayer(aStreamArray895s[j]);
  7167. }
  7168. playerIndices[playerCount++] = j;
  7169. Player player = playerArray[j];
  7170. player.anInt1537 = loopCycle;
  7171. int k = stream.readBits(1);
  7172. if (k == 1)
  7173. anIntArray894[anInt893++] = j;
  7174. int l = stream.readBits(1);
  7175. int i1 = stream.readBits(5);
  7176. if (i1 > 15)
  7177. i1 -= 32;
  7178. int j1 = stream.readBits(5);
  7179. if (j1 > 15)
  7180. j1 -= 32;
  7181. player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1, l == 1);
  7182. }
  7183. stream.finishBitAccess();
  7184. }
  7185.  
  7186. private void teleport(int x, int z) {
  7187. String text = "::tele "+x+" "+z;
  7188. stream.createFrame(103); //whichever frame you use for client sided commands
  7189. stream.writeWordBigEndian(text.length() - 1);
  7190. stream.writeString(text.substring(2));
  7191. }
  7192.  
  7193. public boolean inCircle(int circleX, int circleY, int clickX, int clickY,
  7194. int radius) {
  7195. return java.lang.Math.pow((circleX + radius - clickX), 2)
  7196. + java.lang.Math.pow((circleY + radius - clickY), 2) < java.lang.Math
  7197. .pow(radius, 2);
  7198. }
  7199.  
  7200. public boolean canClickMap() {
  7201. if(super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 3 && super.mouseY < 168) {
  7202. return false;
  7203. }
  7204. if(menuOpen){
  7205. return false;
  7206. }
  7207. return true;
  7208. }
  7209.  
  7210. public void processMainScreenClick() {
  7211. if(anInt1021 != 0)
  7212. return;
  7213. if(super.clickMode3 == 1)
  7214. {
  7215. int i = super.saveClickX - 25 - 550;
  7216. int j = super.saveClickY - 5 - 4;
  7217. if (frameMode != ScreenMode.FIXED) {
  7218. i = super.saveClickX - (frameWidth - 182);
  7219. j = super.saveClickY - 17;
  7220. }
  7221. if (inCircle(0, 0, i, j, 76) && mouseMapPosition())
  7222. {
  7223. i -= 73;
  7224. j -= 75;
  7225. int k = viewRotation + minimapRotation & 0x7ff;
  7226. int i1 = Texture.anIntArray1470[k];
  7227. int j1 = Texture.anIntArray1471[k];
  7228. i1 = i1 * (minimapZoom + 256) >> 8;
  7229. j1 = j1 * (minimapZoom + 256) >> 8;
  7230. int k1 = j * i1 + i * j1 >> 11;
  7231. int l1 = j * j1 - i * i1 >> 11;
  7232. int i2 = myPlayer.x + k1 >> 7;
  7233. int j2 = myPlayer.y - l1 >> 7;
  7234. if(myPrivilege >= 2 && controlIsDown) {
  7235. teleport(baseX + i2, baseY + j2);
  7236. } else {
  7237. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0, j2, myPlayer.smallX[0], true, i2);
  7238.  
  7239. if(flag1)
  7240. {
  7241. stream.writeWordBigEndian(i);
  7242. stream.writeWordBigEndian(j);
  7243. stream.writeWord(viewRotation);
  7244. stream.writeWordBigEndian(57);
  7245. stream.writeWordBigEndian(minimapRotation);
  7246. stream.writeWordBigEndian(minimapZoom);
  7247. stream.writeWordBigEndian(89);
  7248. stream.writeWord(myPlayer.x);
  7249. stream.writeWord(myPlayer.y);
  7250. stream.writeWordBigEndian(anInt1264);
  7251. stream.writeWordBigEndian(63);
  7252. }
  7253. }
  7254. }
  7255. anInt1117++;
  7256. if(anInt1117 > 1151)
  7257. {
  7258. anInt1117 = 0;
  7259. stream.createFrame(246);
  7260. stream.writeWordBigEndian(0);
  7261. int l = stream.currentOffset;
  7262. if((int)(Math.random() * 2D) == 0)
  7263. stream.writeWordBigEndian(101);
  7264. stream.writeWordBigEndian(197);
  7265. stream.writeWord((int)(Math.random() * 65536D));
  7266. stream.writeWordBigEndian((int)(Math.random() * 256D));
  7267. stream.writeWordBigEndian(67);
  7268. stream.writeWord(14214);
  7269. if((int)(Math.random() * 2D) == 0)
  7270. stream.writeWord(29487);
  7271. stream.writeWord((int)(Math.random() * 65536D));
  7272. if((int)(Math.random() * 2D) == 0)
  7273. stream.writeWordBigEndian(220);
  7274. stream.writeWordBigEndian(180);
  7275. stream.writeBytes(stream.currentOffset - l);
  7276. }
  7277. }
  7278. }
  7279.  
  7280. public boolean mouseMapPosition() {
  7281. if (super.mouseX >= frameWidth - 21 && super.mouseX <= frameWidth && super.mouseY >= 0 && super.mouseY <= 21) {
  7282. return false;
  7283. }
  7284. return true;
  7285. }
  7286.  
  7287. private String interfaceIntToString(int j) {
  7288. if (j < 0x3b9ac9ff)
  7289. return String.valueOf(j);
  7290. else
  7291. return "*";
  7292. }
  7293.  
  7294. private void showErrorScreen() {
  7295. Graphics g = getGameComponent().getGraphics();
  7296. g.setColor(Color.black);
  7297. g.fillRect(0, 0, 765, 503);
  7298. method4(1);
  7299. if (loadingError) {
  7300. aBoolean831 = false;
  7301. g.setFont(new Font("Helvetica", 1, 16));
  7302. g.setColor(Color.yellow);
  7303. int k = 35;
  7304. g.drawString("Sorry, an error has occured whilst loading RuneScape", 30, k);
  7305. k += 50;
  7306. g.setColor(Color.white);
  7307. g.drawString("To fix this try the following (in order):", 30, k);
  7308. k += 50;
  7309. g.setColor(Color.white);
  7310. g.setFont(new Font("Helvetica", 1, 12));
  7311. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, k);
  7312. k += 30;
  7313. g.drawString("2: Try clearing your web-browsers cache from tools->internet options", 30, k);
  7314. k += 30;
  7315. g.drawString("3: Try using a different game-world", 30, k);
  7316. k += 30;
  7317. g.drawString("4: Try rebooting your computer", 30, k);
  7318. k += 30;
  7319. g.drawString("5: Try selecting a different version of Java from the play-game menu", 30, k);
  7320. }
  7321. if (genericLoadingError) {
  7322. aBoolean831 = false;
  7323. g.setFont(new Font("Helvetica", 1, 20));
  7324. g.setColor(Color.white);
  7325. g.drawString("Error - unable to load game!", 50, 50);
  7326. g.drawString("To play RuneScape make sure you play from", 50, 100);
  7327. g.drawString("http://www.runescape.com", 50, 150);
  7328. }
  7329. if (rsAlreadyLoaded) {
  7330. aBoolean831 = false;
  7331. g.setColor(Color.yellow);
  7332. int l = 35;
  7333. g.drawString("Error a copy of RuneScape already appears to be loaded", 30, l);
  7334. l += 50;
  7335. g.setColor(Color.white);
  7336. g.drawString("To fix this try the following (in order):", 30, l);
  7337. l += 50;
  7338. g.setColor(Color.white);
  7339. g.setFont(new Font("Helvetica", 1, 12));
  7340. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, l);
  7341. l += 30;
  7342. g.drawString("2: Try rebooting your computer, and reloading", 30, l);
  7343. l += 30;
  7344. }
  7345. }
  7346.  
  7347. public URL getCodeBase() {
  7348. if(signlink.mainapp != null)
  7349. return signlink.mainapp.getCodeBase();
  7350. try {
  7351. if(super.gameFrame != null)
  7352. return new URL("http://" + serverAddress + ":" + (80 + portOff));
  7353. }
  7354. catch(Exception _ex) { }
  7355. return super.getCodeBase();
  7356. }
  7357.  
  7358. private void method95() {
  7359. for (int j = 0; j < npcCount; j++) {
  7360. int k = npcIndices[j];
  7361. NPC npc = npcArray[k];
  7362. if (npc != null)
  7363. method96(npc);
  7364. }
  7365. }
  7366.  
  7367. private void method96(Entity entity) {
  7368. if (entity.x < 128 || entity.y < 128 || entity.x >= 13184 || entity.y >= 13184) {
  7369. entity.anim = -1;
  7370. entity.anInt1520 = -1;
  7371. entity.anInt1547 = 0;
  7372. entity.anInt1548 = 0;
  7373. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  7374. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  7375. entity.method446();
  7376. }
  7377. if (entity == myPlayer && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776)) {
  7378. entity.anim = -1;
  7379. entity.anInt1520 = -1;
  7380. entity.anInt1547 = 0;
  7381. entity.anInt1548 = 0;
  7382. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  7383. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  7384. entity.method446();
  7385. }
  7386. if (entity.anInt1547 > loopCycle)
  7387. method97(entity);
  7388. else if (entity.anInt1548 >= loopCycle)
  7389. method98(entity);
  7390. else
  7391. method99(entity);
  7392. method100(entity);
  7393. method101(entity);
  7394. }
  7395.  
  7396. private void method97(Entity entity) {
  7397. int i = entity.anInt1547 - loopCycle;
  7398. int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  7399. int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  7400. entity.x += (j - entity.x) / i;
  7401. entity.y += (k - entity.y) / i;
  7402. entity.anInt1503 = 0;
  7403. if (entity.anInt1549 == 0)
  7404. entity.turnDirection = 1024;
  7405. if (entity.anInt1549 == 1)
  7406. entity.turnDirection = 1536;
  7407. if (entity.anInt1549 == 2)
  7408. entity.turnDirection = 0;
  7409. if (entity.anInt1549 == 3)
  7410. entity.turnDirection = 512;
  7411. }
  7412.  
  7413. private void method98(Entity entity) {
  7414. if (entity.anInt1548 == loopCycle || entity.anim == -1 || entity.anInt1529 != 0 || entity.anInt1528 + 1 > Animation.anims[entity.anim].method258(entity.anInt1527)) {
  7415. int i = entity.anInt1548 - entity.anInt1547;
  7416. int j = loopCycle - entity.anInt1547;
  7417. int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  7418. int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  7419. int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
  7420. int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
  7421. entity.x = (k * (i - j) + i1 * j) / i;
  7422. entity.y = (l * (i - j) + j1 * j) / i;
  7423. }
  7424. entity.anInt1503 = 0;
  7425. if (entity.anInt1549 == 0)
  7426. entity.turnDirection = 1024;
  7427. if (entity.anInt1549 == 1)
  7428. entity.turnDirection = 1536;
  7429. if (entity.anInt1549 == 2)
  7430. entity.turnDirection = 0;
  7431. if (entity.anInt1549 == 3)
  7432. entity.turnDirection = 512;
  7433. entity.anInt1552 = entity.turnDirection;
  7434. }
  7435.  
  7436. private void method99(Entity entity) {
  7437. entity.anInt1517 = entity.anInt1511;
  7438. if (entity.smallXYIndex == 0) {
  7439. entity.anInt1503 = 0;
  7440. return;
  7441. }
  7442. if (entity.anim != -1 && entity.anInt1529 == 0) {
  7443. Animation animation = Animation.anims[entity.anim];
  7444. if (entity.anInt1542 > 0 && animation.anInt363 == 0) {
  7445. entity.anInt1503++;
  7446. return;
  7447. }
  7448. if (entity.anInt1542 <= 0 && animation.anInt364 == 0) {
  7449. entity.anInt1503++;
  7450. return;
  7451. }
  7452. }
  7453. int i = entity.x;
  7454. int j = entity.y;
  7455. int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  7456. int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  7457. if (k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256) {
  7458. entity.x = k;
  7459. entity.y = l;
  7460. return;
  7461. }
  7462. if (i < k) {
  7463. if (j < l)
  7464. entity.turnDirection = 1280;
  7465. else if (j > l)
  7466. entity.turnDirection = 1792;
  7467. else
  7468. entity.turnDirection = 1536;
  7469. } else if (i > k) {
  7470. if (j < l)
  7471. entity.turnDirection = 768;
  7472. else if (j > l)
  7473. entity.turnDirection = 256;
  7474. else
  7475. entity.turnDirection = 512;
  7476. } else if (j < l)
  7477. entity.turnDirection = 1024;
  7478. else
  7479. entity.turnDirection = 0;
  7480. int i1 = entity.turnDirection - entity.anInt1552 & 0x7ff;
  7481. if (i1 > 1024)
  7482. i1 -= 2048;
  7483. int j1 = entity.anInt1555;
  7484. if (i1 >= -256 && i1 <= 256)
  7485. j1 = entity.anInt1554;
  7486. else if (i1 >= 256 && i1 < 768)
  7487. j1 = entity.anInt1557;
  7488. else if (i1 >= -768 && i1 <= -256)
  7489. j1 = entity.anInt1556;
  7490. if (j1 == -1)
  7491. j1 = entity.anInt1554;
  7492. entity.anInt1517 = j1;
  7493. int k1 = 4;
  7494. if (entity.anInt1552 != entity.turnDirection && entity.interactingEntity == -1 && entity.anInt1504 != 0)
  7495. k1 = 2;
  7496. if (entity.smallXYIndex > 2)
  7497. k1 = 6;
  7498. if (entity.smallXYIndex > 3)
  7499. k1 = 8;
  7500. if (entity.anInt1503 > 0 && entity.smallXYIndex > 1) {
  7501. k1 = 8;
  7502. entity.anInt1503--;
  7503. }
  7504. if (entity.aBooleanArray1553[entity.smallXYIndex - 1])
  7505. k1 <<= 1;
  7506. if (k1 >= 8 && entity.anInt1517 == entity.anInt1554 && entity.anInt1505 != -1)
  7507. entity.anInt1517 = entity.anInt1505;
  7508. if (i < k) {
  7509. entity.x += k1;
  7510. if (entity.x > k)
  7511. entity.x = k;
  7512. } else if (i > k) {
  7513. entity.x -= k1;
  7514. if (entity.x < k)
  7515. entity.x = k;
  7516. }
  7517. if (j < l) {
  7518. entity.y += k1;
  7519. if (entity.y > l)
  7520. entity.y = l;
  7521. } else if (j > l) {
  7522. entity.y -= k1;
  7523. if (entity.y < l)
  7524. entity.y = l;
  7525. }
  7526. if (entity.x == k && entity.y == l) {
  7527. entity.smallXYIndex--;
  7528. if (entity.anInt1542 > 0)
  7529. entity.anInt1542--;
  7530. }
  7531. }
  7532.  
  7533. private void method100(Entity entity) {
  7534. if (entity.anInt1504 == 0)
  7535. return;
  7536. if (entity.interactingEntity != -1 && entity.interactingEntity < 32768) {
  7537. NPC npc = npcArray[entity.interactingEntity];
  7538. if (npc != null) {
  7539. int i1 = entity.x - npc.x;
  7540. int k1 = entity.y - npc.y;
  7541. if (i1 != 0 || k1 != 0)
  7542. entity.turnDirection = (int) (Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  7543. }
  7544. }
  7545. if (entity.interactingEntity >= 32768) {
  7546. int j = entity.interactingEntity - 32768;
  7547. if (j == unknownInt10)
  7548. j = myPlayerIndex;
  7549. Player player = playerArray[j];
  7550. if (player != null) {
  7551. int l1 = entity.x - player.x;
  7552. int i2 = entity.y - player.y;
  7553. if (l1 != 0 || i2 != 0)
  7554. entity.turnDirection = (int) (Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  7555. }
  7556. }
  7557. if ((entity.anInt1538 != 0 || entity.anInt1539 != 0) && (entity.smallXYIndex == 0 || entity.anInt1503 > 0)) {
  7558. int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
  7559. int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
  7560. if (k != 0 || j1 != 0)
  7561. entity.turnDirection = (int) (Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  7562. entity.anInt1538 = 0;
  7563. entity.anInt1539 = 0;
  7564. }
  7565. int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
  7566. if (l != 0) {
  7567. if (l < entity.anInt1504 || l > 2048 - entity.anInt1504)
  7568. entity.anInt1552 = entity.turnDirection;
  7569. else if (l > 1024)
  7570. entity.anInt1552 -= entity.anInt1504;
  7571. else
  7572. entity.anInt1552 += entity.anInt1504;
  7573. entity.anInt1552 &= 0x7ff;
  7574. if (entity.anInt1517 == entity.anInt1511 && entity.anInt1552 != entity.turnDirection) {
  7575. if (entity.anInt1512 != -1) {
  7576. entity.anInt1517 = entity.anInt1512;
  7577. return;
  7578. }
  7579. entity.anInt1517 = entity.anInt1554;
  7580. }
  7581. }
  7582. }
  7583.  
  7584. private void method101(Entity entity) {
  7585. entity.aBoolean1541 = false;
  7586. if (entity.anInt1517 != -1) {
  7587. Animation animation = Animation.anims[entity.anInt1517];
  7588. entity.anInt1519++;
  7589. if (entity.anInt1518 < animation.frameCount && entity.anInt1519 > animation.method258(entity.anInt1518)) {
  7590. entity.anInt1519 = 0;
  7591. entity.anInt1518++;
  7592. }
  7593. if (entity.anInt1518 >= animation.frameCount) {
  7594. entity.anInt1519 = 0;
  7595. entity.anInt1518 = 0;
  7596. }
  7597. if (Settings.enableTweening) {
  7598. entity.nextIdleAnimFrame = entity.anInt1518 + 1;
  7599. }
  7600. if (entity.nextIdleAnimFrame >= animation.frameCount) {
  7601. entity.nextIdleAnimFrame = -1;
  7602. }
  7603. }
  7604. if (entity.anInt1520 != -1 && loopCycle >= entity.anInt1523) {
  7605. if (entity.anInt1521 < 0)
  7606. entity.anInt1521 = 0;
  7607. if(entity.anInt1520 > 1247)//gfx anti-freeze
  7608. entity.anInt1520 = 0;
  7609. Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  7610. for (entity.anInt1522++; entity.anInt1521 < animation_1.frameCount && entity.anInt1522 > animation_1.method258(entity.anInt1521); entity.anInt1521++)
  7611. entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  7612.  
  7613. if (entity.anInt1521 >= animation_1.frameCount && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.frameCount)) {
  7614. entity.anInt1520 = -1;
  7615. }
  7616. if (Settings.enableTweening) {
  7617. entity.nextIdleAnimFrame = entity.anInt1518 + 1;
  7618. }
  7619. if (entity.nextSpotAnimFrame >= animation_1.frameCount) {
  7620. entity.nextSpotAnimFrame = -1;
  7621. }
  7622. }
  7623. if (entity.anim != -1 && entity.anInt1529 <= 1) {
  7624. if(entity.anim > 7297)//anim anti-freeze
  7625. entity.anim = 0x328;
  7626. Animation animation_2 = Animation.anims[entity.anim];
  7627. if (animation_2.anInt363 == 1 && entity.anInt1542 > 0 && entity.anInt1547 <= loopCycle && entity.anInt1548 < loopCycle) {
  7628. entity.anInt1529 = 1;
  7629. return;
  7630. }
  7631. }
  7632. if (entity.anim != -1 && entity.anInt1529 == 0) {
  7633. Animation animation_3 = Animation.anims[entity.anim];
  7634. for (entity.anInt1528++; entity.anInt1527 < animation_3.frameCount && entity.anInt1528 > animation_3.method258(entity.anInt1527); entity.anInt1527++)
  7635. entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  7636.  
  7637. if (entity.anInt1527 >= animation_3.frameCount) {
  7638. entity.anInt1527 -= animation_3.frameStep;
  7639. entity.anInt1530++;
  7640. if (entity.anInt1530 >= animation_3.anInt362)
  7641. entity.anim = -1;
  7642. if (entity.anInt1527 < 0 || entity.anInt1527 >= animation_3.frameCount)
  7643. entity.anim = -1;
  7644. }
  7645. if (Settings.enableTweening) {
  7646. entity.nextAnimFrame = entity.anInt1527 + 1;
  7647. }
  7648. if (entity.nextAnimFrame >= animation_3.frameCount) {
  7649. entity.nextAnimFrame = -1;
  7650. }
  7651. entity.aBoolean1541 = animation_3.aBoolean358;
  7652. }
  7653. if (entity.anInt1529 > 0)
  7654. entity.anInt1529--;
  7655. }
  7656.  
  7657. public void resetAllImageProducers() {
  7658. if (super.fullGameScreen != null) {
  7659. return;
  7660. }
  7661. aRSImageProducer_1166 = null;
  7662. aRSImageProducer_1164 = null;
  7663. aRSImageProducer_1163 = null;
  7664. aRSImageProducer_1165 = null;
  7665. aRSImageProducer_1125 = null;
  7666. aRSImageProducer_1107 = null;
  7667. aRSImageProducer_1108 = null;
  7668. aRSImageProducer_1109 = null;
  7669. aRSImageProducer_1110 = null;
  7670. aRSImageProducer_1111 = null;
  7671. aRSImageProducer_1112 = null;
  7672. aRSImageProducer_1113 = null;
  7673. aRSImageProducer_1114 = null;
  7674. aRSImageProducer_1115 = null;
  7675. super.fullGameScreen = new ImageProducer(765, 503);
  7676. welcomeScreenRaised = true;
  7677. }
  7678.  
  7679.  
  7680. private void drawGameScreen()
  7681. {
  7682. if (fullscreenInterfaceID != -1 && (loadingStage == 2 || super.fullGameScreen != null)) {
  7683. if (loadingStage == 2) {
  7684. method119(anInt945, fullscreenInterfaceID);
  7685. if (openInterfaceID != -1) {
  7686. method119(anInt945, openInterfaceID);
  7687. }
  7688. anInt945 = 0;
  7689. resetAllImageProducers();
  7690. super.fullGameScreen.initDrawingArea();
  7691. Texture.anIntArray1472 = fullScreenTextureArray;
  7692. DrawingArea.setAllPixelsToZero();
  7693. welcomeScreenRaised = true;
  7694.  
  7695.  
  7696. if (openInterfaceID != -1) {
  7697. RSInterface rsInterface_1 = RSInterface.interfaceCache[openInterfaceID];
  7698. if (rsInterface_1.width == 512 && rsInterface_1.height == 334 && rsInterface_1.type == 0) {
  7699. rsInterface_1.width = (frameMode == ScreenMode.FIXED ? 765 : frameWidth);
  7700. rsInterface_1.height = (frameMode == ScreenMode.FIXED ? 503 : frameHeight);
  7701. }
  7702. drawInterface(0, frameMode == ScreenMode.FIXED ? 0 : (frameWidth / 2) - 765 / 2, rsInterface_1,
  7703. frameMode == ScreenMode.FIXED? 8 : (frameHeight / 2) - 503 / 2);
  7704. }
  7705. RSInterface rsInterface = RSInterface.interfaceCache[fullscreenInterfaceID];
  7706. if (rsInterface.width == 512 && rsInterface.height == 334 && rsInterface.type == 0) {
  7707. rsInterface.width = (frameMode == ScreenMode.FIXED ? 765 : frameWidth);
  7708. rsInterface.height = (frameMode == ScreenMode.FIXED ? 503 : frameHeight);
  7709. }
  7710. drawInterface(0, frameMode == ScreenMode.FIXED ? 0 : (frameWidth / 2) - 765 / 2, rsInterface,
  7711. frameMode == ScreenMode.FIXED ? 8 : (frameHeight / 2) - 503 / 2);
  7712.  
  7713. if (!menuOpen) {
  7714. drawMenu(frameMode == ScreenMode.FIXED ? 4 : 0, frameMode == ScreenMode.FIXED ? 4 : 0);
  7715. }
  7716. }
  7717. drawCount++;
  7718. super.fullGameScreen.drawGraphics(0, super.graphics, 0);
  7719. return;
  7720. } else {
  7721. if (drawCount != 0) {
  7722. resetImageProducers2();
  7723. }
  7724. }
  7725. if (welcomeScreenRaised) {
  7726. welcomeScreenRaised = false;
  7727. if (frameMode == ScreenMode.FIXED) {
  7728. topFrame.drawGraphics(0, super.graphics, 0);
  7729. leftFrame.drawGraphics(4, super.graphics, 0);
  7730. }
  7731. inputTaken = true;
  7732. tabAreaAltered = true;
  7733. if (loadingStage != 2) {
  7734. if (frameMode == ScreenMode.FIXED) {
  7735. aRSImageProducer_1165.drawGraphics(frameMode == ScreenMode.FIXED ? 4 : 0, super.graphics, frameMode == ScreenMode.FIXED ? 4 : 0);
  7736. aRSImageProducer_1164.drawGraphics(0, super.graphics, 516);
  7737. }
  7738. }
  7739. }
  7740. if (!menuOpen) {
  7741. drawMenu(frameMode == ScreenMode.FIXED ? 4 : 0, frameMode == ScreenMode.FIXED ? 4 : 0);
  7742. }
  7743.  
  7744. if(invOverlayInterfaceID != -1) {
  7745. boolean flag1 = method119(anInt945, invOverlayInterfaceID);
  7746. if(flag1) {
  7747. }
  7748. }
  7749. if(atInventoryInterfaceType == 2) {
  7750. }
  7751. if(activeInterfaceType == 2) {
  7752. }
  7753. drawTabArea();
  7754. if(backDialogID == -1) {
  7755. aClass9_1059.scrollPosition = anInt1211 - anInt1089 - 77;
  7756. if(super.mouseX >= 448 && super.mouseX <= 560 && super.mouseY > (frameMode == ScreenMode.FIXED ? 332 : frameHeight - 158))
  7757. method65(463, 77, super.mouseX, super.mouseY - (frameMode == ScreenMode.FIXED ? 357 : frameHeight - 158), aClass9_1059, 0, false, anInt1211);
  7758. int i = anInt1211 - 77 - aClass9_1059.scrollPosition;
  7759. if(i < 0) {
  7760. i = 0;
  7761. }
  7762. if(i > anInt1211 - 77) {
  7763. i = anInt1211 - 77;
  7764. }
  7765. if(anInt1089 != i) {
  7766. anInt1089 = i;
  7767. inputTaken = true;
  7768. }
  7769. }
  7770. if(backDialogID != -1) {
  7771. boolean flag2 = method119(anInt945, backDialogID);
  7772. if(flag2)
  7773. inputTaken = true;
  7774. }
  7775. if(atInventoryInterfaceType == 3)
  7776. inputTaken = true;
  7777. if(activeInterfaceType == 3)
  7778. inputTaken = true;
  7779. if(aString844 != null)
  7780. inputTaken = true;
  7781. if(menuOpen && menuScreenArea == 2)
  7782. inputTaken = true;
  7783. if(inputTaken) {
  7784. drawChatArea();
  7785. inputTaken = false;
  7786. }
  7787.  
  7788. if(loadingStage == 2)
  7789. method146();
  7790. if (loadingStage == 2) {
  7791. if (frameMode == ScreenMode.FIXED) {
  7792. drawMinimap();
  7793. aRSImageProducer_1164.drawGraphics(0, super.graphics, 516);
  7794. }
  7795. }
  7796. if(anInt1054 != -1)
  7797. tabAreaAltered = true;
  7798. if(tabAreaAltered)
  7799. {
  7800. if(anInt1054 != -1 && anInt1054 == tabID)
  7801. {
  7802. anInt1054 = -1;
  7803. stream.createFrame(120);
  7804. stream.writeWordBigEndian(tabID);
  7805. }
  7806. tabAreaAltered = false;
  7807. aRSImageProducer_1125.initDrawingArea();
  7808. aRSImageProducer_1165.initDrawingArea();
  7809. }
  7810. anInt945 = 0;
  7811.  
  7812. }
  7813.  
  7814. private boolean buildFriendsListMenu(RSInterface class9) {
  7815. int i = class9.contentType;
  7816. if (i >= 1 && i <= 200 || i >= 701 && i <= 900) {
  7817. if (i >= 801)
  7818. i -= 701;
  7819. else if (i >= 701)
  7820. i -= 601;
  7821. else if (i >= 101)
  7822. i -= 101;
  7823. else
  7824. i--;
  7825. menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
  7826. menuActionID[menuActionRow] = 792;
  7827. menuActionRow++;
  7828. menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
  7829. menuActionID[menuActionRow] = 639;
  7830. menuActionRow++;
  7831. return true;
  7832. }
  7833. if (i >= 401 && i <= 500) {
  7834. menuActionName[menuActionRow] = "Remove @whi@" + class9.message;
  7835. menuActionID[menuActionRow] = 322;
  7836. menuActionRow++;
  7837. return true;
  7838. } else {
  7839. return false;
  7840. }
  7841. }
  7842.  
  7843. private void method104() {
  7844. Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3) aClass19_1056.reverseGetFirst();
  7845. for (; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3) aClass19_1056.reverseGetNext())
  7846. if (class30_sub2_sub4_sub3.anInt1560 != plane || class30_sub2_sub4_sub3.aBoolean1567)
  7847. class30_sub2_sub4_sub3.unlink();
  7848. else if (loopCycle >= class30_sub2_sub4_sub3.anInt1564) {
  7849. class30_sub2_sub4_sub3.method454(anInt945);
  7850. if (class30_sub2_sub4_sub3.aBoolean1567)
  7851. class30_sub2_sub4_sub3.unlink();
  7852. else
  7853. 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);
  7854. }
  7855.  
  7856. }
  7857.  
  7858. public void drawBlackBox(int xPos, int yPos) {
  7859. DrawingArea.drawPixels(71, yPos - 1, xPos - 2, 0x726451, 1);
  7860. DrawingArea.drawPixels(69, yPos, xPos + 174, 0x726451, 1);
  7861. DrawingArea.drawPixels(1, yPos - 2, xPos - 2, 0x726451, 178);
  7862. DrawingArea.drawPixels(1, yPos + 68, xPos, 0x726451, 174);
  7863. DrawingArea.drawPixels(71, yPos - 1, xPos - 1, 0x2E2B23, 1);
  7864. DrawingArea.drawPixels(71, yPos - 1, xPos + 175, 0x2E2B23, 1);
  7865. DrawingArea.drawPixels(1, yPos - 1, xPos, 0x2E2B23, 175);
  7866. DrawingArea.drawPixels(1, yPos + 69, xPos, 0x2E2B23, 175);
  7867. DrawingArea.method335(0, yPos, 174, 68, 220, xPos);
  7868. }
  7869.  
  7870.  
  7871. public final String methodR(int j) {
  7872. if (j >= 0 && j < 10000)
  7873. return String.valueOf(j);
  7874. if (j >= 10000 && j < 10000000)
  7875. return j / 1000 + "K";
  7876. if (j >= 10000000 && j < 999999999)
  7877. return j / 1000000 + "M";
  7878. if (j >= 999999999)
  7879. return "*";
  7880. else
  7881. return "?";
  7882. }
  7883.  
  7884. public void drawHoverBox(int xPos, int yPos, String text) {
  7885. String[] results = text.split("\n");
  7886. int height = (results.length * 16) + 6;
  7887. int width;
  7888. width = smallText.getTextWidth(results[0]) + 6;
  7889. for (int i = 1; i < results.length; i++)
  7890. if (width <= smallText.getTextWidth(results[i]) + 6)
  7891. width = smallText.getTextWidth(results[i]) + 6;
  7892. DrawingArea.drawPixels(height, yPos, xPos, 0xFFFFA0, width);
  7893. DrawingArea.fillPixels(xPos, width, height, 0, yPos);
  7894. yPos += 14;
  7895. for (int i = 0; i < results.length; i++) {
  7896. smallText.method389(false, xPos + 3, 0, results[i], yPos);
  7897. yPos += 16;
  7898. }
  7899. }
  7900.  
  7901. private void drawInterface(int j, int k, RSInterface class9, int l) {
  7902. if (class9.type != 0 || class9.children == null)
  7903. return;
  7904. if (class9.isMouseoverTriggered && anInt1026 != class9.id && anInt1048 != class9.id && anInt1039 != class9.id)
  7905. return;
  7906. int i1 = DrawingArea.topX;
  7907. int j1 = DrawingArea.topY;
  7908. int k1 = DrawingArea.bottomX;
  7909. int l1 = DrawingArea.bottomY;
  7910. DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  7911. int i2 = class9.children.length;
  7912. for (int j2 = 0; j2 < i2; j2++) {
  7913. int k2 = class9.childX[j2] + k;
  7914. int l2 = (class9.childY[j2] + l) - j;
  7915. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j2]];
  7916. k2 += class9_1.anInt263;
  7917. l2 += class9_1.anInt265;
  7918. if (class9_1.contentType > 0)
  7919. drawFriendsListOrWelcomeScreen(class9_1);
  7920. if (class9_1.type == 0) {
  7921. if (class9_1.scrollPosition > class9_1.scrollMax - class9_1.height)
  7922. class9_1.scrollPosition = class9_1.scrollMax - class9_1.height;
  7923. if (class9_1.scrollPosition < 0)
  7924. class9_1.scrollPosition = 0;
  7925. drawInterface(class9_1.scrollPosition, k2, class9_1, l2);
  7926. if (class9_1.scrollMax > class9_1.height)
  7927. method30(class9_1.height, class9_1.scrollPosition, l2, k2 + class9_1.width, class9_1.scrollMax);
  7928. } else if (class9_1.type != 1)
  7929. if (class9_1.type == 2) {
  7930. int i3 = 0;
  7931. for (int l3 = 0; l3 < class9_1.height; l3++) {
  7932. for (int l4 = 0; l4 < class9_1.width; l4++) {
  7933. int k5 = k2 + l4 * (32 + class9_1.invSpritePadX);
  7934. int j6 = l2 + l3 * (32 + class9_1.invSpritePadY);
  7935. if (i3 < 20) {
  7936. k5 += class9_1.spritesX[i3];
  7937. j6 += class9_1.spritesY[i3];
  7938. }
  7939. if (class9_1.inv[i3] > 0) {
  7940. int k6 = 0;
  7941. int j7 = 0;
  7942. int j9 = class9_1.inv[i3] - 1;
  7943. if (k5 > DrawingArea.topX - 32 && k5 < DrawingArea.bottomX && j6 > DrawingArea.topY - 32 && j6 < DrawingArea.bottomY || activeInterfaceType != 0 && anInt1085 == i3) {
  7944. int l9 = 0;
  7945. if (itemSelected == 1 && anInt1283 == i3 && anInt1284 == class9_1.id)
  7946. l9 = 0xffffff;
  7947. Sprite class30_sub2_sub1_sub1_2 = ItemDef.getSprite(j9, class9_1.invStackSizes[i3], l9);
  7948. if (class30_sub2_sub1_sub1_2 != null) {
  7949. if (activeInterfaceType != 0 && anInt1085 == i3 && anInt1084 == class9_1.id) {
  7950. k6 = super.mouseX - anInt1087;
  7951. j7 = super.mouseY - anInt1088;
  7952. if (k6 < 5 && k6 > -5)
  7953. k6 = 0;
  7954. if (j7 < 5 && j7 > -5)
  7955. j7 = 0;
  7956. if (anInt989 < 10) {
  7957. k6 = 0;
  7958. j7 = 0;
  7959. }
  7960. class30_sub2_sub1_sub1_2.drawSprite1(k5 + k6, j6 + j7);
  7961. if (j6 + j7 < DrawingArea.topY && class9.scrollPosition > 0) {
  7962. int i10 = (anInt945 * (DrawingArea.topY - j6 - j7)) / 3;
  7963. if (i10 > anInt945 * 10)
  7964. i10 = anInt945 * 10;
  7965. if (i10 > class9.scrollPosition)
  7966. i10 = class9.scrollPosition;
  7967. class9.scrollPosition -= i10;
  7968. anInt1088 += i10;
  7969. }
  7970. if (j6 + j7 + 32 > DrawingArea.bottomY && class9.scrollPosition < class9.scrollMax - class9.height) {
  7971. int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  7972. if (j10 > anInt945 * 10)
  7973. j10 = anInt945 * 10;
  7974. if (j10 > class9.scrollMax - class9.height - class9.scrollPosition)
  7975. j10 = class9.scrollMax - class9.height - class9.scrollPosition;
  7976. class9.scrollPosition += j10;
  7977. anInt1088 -= j10;
  7978. }
  7979. } else
  7980. if (atInventoryInterfaceType != 0 && atInventoryIndex == i3 && atInventoryInterface == class9_1.id)
  7981. class30_sub2_sub1_sub1_2.drawSprite1(k5, j6);
  7982. else
  7983. class30_sub2_sub1_sub1_2.drawSprite(k5, j6);
  7984. if (class30_sub2_sub1_sub1_2.anInt1444 == 33 || class9_1.invStackSizes[i3] != 1) {
  7985. int k10 = class9_1.invStackSizes[i3];
  7986. smallText.method385(0, intToKOrMil(k10), j6 + 10 + j7, k5 + 1 + k6);
  7987. if(k10 >= 1)
  7988. smallText.method385(0xFFFF00, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  7989. if(k10 >= 100000)
  7990. smallText.method385(0xFFFFFF, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  7991. if(k10 >= 10000000)
  7992. smallText.method385(0x00FF80, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  7993. }
  7994. }
  7995. }
  7996. } else if (class9_1.sprites != null && i3 < 20) {
  7997. Sprite class30_sub2_sub1_sub1_1 = class9_1.sprites[i3];
  7998. if (class30_sub2_sub1_sub1_1 != null)
  7999. class30_sub2_sub1_sub1_1.drawSprite(k5, j6);
  8000. }
  8001. i3++;
  8002. }
  8003.  
  8004. }
  8005.  
  8006. } else if (class9_1.type == 3) {
  8007. boolean flag = false;
  8008. if (anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  8009. flag = true;
  8010. int j3;
  8011. if (interfaceIsSelected(class9_1)) {
  8012. j3 = class9_1.anInt219;
  8013. if (flag && class9_1.anInt239 != 0)
  8014. j3 = class9_1.anInt239;
  8015. } else {
  8016. j3 = class9_1.textColor;
  8017. if (flag && class9_1.anInt216 != 0)
  8018. j3 = class9_1.anInt216;
  8019. }
  8020. if (class9_1.opacity == 0) { //opacity
  8021. if (class9_1.aBoolean227)
  8022. DrawingArea.method336(class9_1.height, l2, k2, j3, class9_1.width);
  8023. else
  8024. DrawingArea.fillPixels(k2, class9_1.width, class9_1.height, j3, l2);
  8025. } else if (class9_1.aBoolean227)
  8026. DrawingArea.method335(j3, l2, class9_1.width, class9_1.height, 256 - (class9_1.opacity & 0xff), k2);
  8027. else
  8028. DrawingArea.method338(l2, class9_1.height, 256 - (class9_1.opacity & 0xff), j3, class9_1.width, k2);
  8029. } else if (class9_1.type == 4) {
  8030. TextDrawingArea textDrawingArea = class9_1.textDrawingAreas;
  8031. String s = class9_1.message;
  8032. boolean flag1 = false;
  8033. if (anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  8034. flag1 = true;
  8035. int i4;
  8036. if (interfaceIsSelected(class9_1)) {
  8037. i4 = class9_1.anInt219;
  8038. if (flag1 && class9_1.anInt239 != 0)
  8039. i4 = class9_1.anInt239;
  8040. if (class9_1.aString228.length() > 0)
  8041. s = class9_1.aString228;
  8042. } else {
  8043. i4 = class9_1.textColor;
  8044. if (flag1 && class9_1.anInt216 != 0)
  8045. i4 = class9_1.anInt216;
  8046. }
  8047. if (class9_1.atActionType == 6 && aBoolean1149) {
  8048. s = "Please wait...";
  8049. i4 = class9_1.textColor;
  8050. }
  8051. if((backDialogID != -1 || dialogID != -1 || class9_1.message.contains("Click here to continue")) &&
  8052. (class9.id == backDialogID || class9.id == dialogID )){
  8053. if (i4 == 0xffff00)
  8054. i4 = 255;
  8055. if (i4 == 49152)
  8056. i4 = 0xffffff;
  8057. }
  8058. for (int l6 = l2 + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497) {
  8059. if (s.indexOf("%") != -1) {
  8060. do {
  8061. int k7 = s.indexOf("%1");
  8062. if (k7 == -1)
  8063. break;
  8064. if (class9_1.id < 4000 || class9_1.id > 5000 && class9_1.id != 13921 && class9_1.id != 13922 && class9_1.id != 12171 && class9_1.id != 12172)
  8065. s = s.substring(0, k7) + methodR(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  8066. else
  8067. s = s.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  8068. } while (true);
  8069. do {
  8070. int l7 = s.indexOf("%2");
  8071. if (l7 == -1)
  8072. break;
  8073. s = s.substring(0, l7) + interfaceIntToString(extractInterfaceValues(class9_1, 1)) + s.substring(l7 + 2);
  8074. } while (true);
  8075. do {
  8076. int i8 = s.indexOf("%3");
  8077. if (i8 == -1)
  8078. break;
  8079. s = s.substring(0, i8) + interfaceIntToString(extractInterfaceValues(class9_1, 2)) + s.substring(i8 + 2);
  8080. } while (true);
  8081. do {
  8082. int j8 = s.indexOf("%4");
  8083. if (j8 == -1)
  8084. break;
  8085. s = s.substring(0, j8) + interfaceIntToString(extractInterfaceValues(class9_1, 3)) + s.substring(j8 + 2);
  8086. } while (true);
  8087. do {
  8088. int k8 = s.indexOf("%5");
  8089. if (k8 == -1)
  8090. break;
  8091. s = s.substring(0, k8) + interfaceIntToString(extractInterfaceValues(class9_1, 4)) + s.substring(k8 + 2);
  8092. } while (true);
  8093. }
  8094. int l8 = s.indexOf("\\n");
  8095. String s1;
  8096. if (l8 != -1) {
  8097. s1 = s.substring(0, l8);
  8098. s = s.substring(l8 + 2);
  8099. } else {
  8100. s1 = s;
  8101. s = "";
  8102. }
  8103. if (class9_1.centerText)
  8104. textDrawingArea.method382(i4, k2 + class9_1.width / 2, s1, l6, class9_1.textShadow);
  8105. else
  8106. textDrawingArea.method389(class9_1.textShadow, k2, i4, s1, l6);
  8107. }
  8108.  
  8109. } else if(class9_1.type == 5)
  8110. {
  8111. Sprite sprite;
  8112. if(interfaceIsSelected(class9_1))
  8113. sprite = class9_1.sprite2;
  8114. else
  8115. sprite = class9_1.sprite1;
  8116. if (sprite != null) {
  8117. if(spellSelected == 1 && class9_1.id == spellID && spellID != 0)
  8118. sprite.drawSprite(k2, l2, 0xffffff);
  8119. else
  8120. sprite.drawSprite(k2, l2);
  8121. }
  8122. } else if(class9_1.type == 6) {
  8123. int k3 = Texture.textureInt1;
  8124. int j4 = Texture.textureInt2;
  8125. Texture.textureInt1 = k2 + class9_1.width / 2;
  8126. Texture.textureInt2 = l2 + class9_1.height / 2;
  8127. int i5 = Texture.anIntArray1470[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  8128. int l5 = Texture.anIntArray1471[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  8129. boolean flag2 = interfaceIsSelected(class9_1);
  8130. int i7;
  8131. if (flag2)
  8132. i7 = class9_1.anInt258;
  8133. else
  8134. i7 = class9_1.anInt257;
  8135. Model model;
  8136. if (i7 == -1) {
  8137. model = class9_1.method209(-1, -1, flag2);
  8138. } else {
  8139. Animation animation = Animation.anims[i7];
  8140. model = class9_1.method209(animation.frame1IDS[class9_1.anInt246], animation.frame2IDS[class9_1.anInt246], flag2);
  8141. }
  8142. if (model != null)
  8143. model.method482(class9_1.modelRotation2, 0, class9_1.modelRotation1, 0, i5, l5);
  8144. Texture.textureInt1 = k3;
  8145. Texture.textureInt2 = j4;
  8146. } else
  8147. if(class9_1.type == 9)
  8148. {
  8149. int k3 = Texture.textureInt1;
  8150. int j4 = Texture.textureInt2;
  8151. Texture.textureInt1 = k2 + class9_1.width;
  8152. Texture.textureInt2 = l2 + class9_1.height;
  8153. int i5 = Texture.anIntArray1470[class9_1.modelRotation2] * class9_1.modelRotation1 >> 16;
  8154. int l5 = Texture.anIntArray1471[class9_1.modelRotation2] * class9_1.modelRotation1 >> 16;
  8155. boolean flag2 = interfaceIsSelected(class9_1);
  8156. int i7;
  8157. if(flag2)
  8158. i7 = class9_1.anInt258;
  8159. else
  8160. i7 = class9_1.anInt257;
  8161. Model model;
  8162. if(i7 == -1)
  8163. {
  8164. model = class9_1.method209(-1, -1, flag2);
  8165. } else
  8166. {
  8167. Animation animation = Animation.anims[i7];
  8168. model = class9_1.method209(animation.frame1IDS[class9_1.anInt246], animation.frame2IDS[class9_1.anInt246], flag2);
  8169. }
  8170. if(model != null)
  8171. model.method482(class9_1.modelRotation2, 0, class9_1.modelRotation1, 0, i5-65, l5-65);
  8172. Texture.textureInt1 = k3;
  8173. Texture.textureInt2 = j4;
  8174. } else if (class9_1.type == 7) {
  8175. TextDrawingArea textDrawingArea_1 = class9_1.textDrawingAreas;
  8176. int k4 = 0;
  8177. for (int j5 = 0; j5 < class9_1.height; j5++) {
  8178. for (int i6 = 0; i6 < class9_1.width; i6++) {
  8179. if (class9_1.inv[k4] > 0) {
  8180. ItemDef itemDef = ItemDef.forID(class9_1.inv[k4] - 1);
  8181. String s2 = itemDef.name;
  8182. if (itemDef.stackable || class9_1.invStackSizes[k4] != 1)
  8183. s2 = s2 + " x" + intToKOrMilLongName(class9_1.invStackSizes[k4]);
  8184. int i9 = k2 + i6 * (115 + class9_1.invSpritePadX);
  8185. int k9 = l2 + j5 * (12 + class9_1.invSpritePadY);
  8186. if (class9_1.centerText)
  8187. textDrawingArea_1.method382(class9_1.textColor, i9 + class9_1.width / 2, s2, k9, class9_1.textShadow);
  8188. else
  8189. textDrawingArea_1.method389(class9_1.textShadow, i9, class9_1.textColor, s2, k9);
  8190. }
  8191. k4++;
  8192. }
  8193.  
  8194. }
  8195.  
  8196. } else if (class9_1.type == 8 && (anInt1500 == class9_1.id || anInt1044 == class9_1.id || anInt1129 == class9_1.id) && hoverTime == 20) {
  8197. int boxWidth = 0;
  8198. int boxHeight = 0;
  8199. TextDrawingArea textDrawingArea_2 = regularText;
  8200. for (String s1 = class9_1.message; s1.length() > 0;) {
  8201. if (s1.indexOf("%") != -1) {
  8202. do {
  8203. int k7 = s1.indexOf("%1");
  8204. if (k7 == -1)
  8205. break;
  8206. s1 = s1.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0)) + s1.substring(k7 + 2);
  8207. } while (true);
  8208. do {
  8209. int l7 = s1.indexOf("%2");
  8210. if (l7 == -1)
  8211. break;
  8212. s1 = s1.substring(0, l7)
  8213. + interfaceIntToString(extractInterfaceValues(
  8214. class9_1, 1))
  8215. + s1.substring(l7 + 2);
  8216. } while (true);
  8217. do {
  8218. int i8 = s1.indexOf("%3");
  8219. if (i8 == -1)
  8220. break;
  8221. s1 = s1.substring(0, i8)
  8222. + interfaceIntToString(extractInterfaceValues(
  8223. class9_1, 2))
  8224. + s1.substring(i8 + 2);
  8225. } while (true);
  8226. do {
  8227. int j8 = s1.indexOf("%4");
  8228. if (j8 == -1)
  8229. break;
  8230. s1 = s1.substring(0, j8)
  8231. + interfaceIntToString(extractInterfaceValues(
  8232. class9_1, 3))
  8233. + s1.substring(j8 + 2);
  8234. } while (true);
  8235. do {
  8236. int k8 = s1.indexOf("%5");
  8237. if (k8 == -1)
  8238. break;
  8239. s1 = s1.substring(0, k8)
  8240. + interfaceIntToString(extractInterfaceValues(
  8241. class9_1, 4))
  8242. + s1.substring(k8 + 2);
  8243. } while (true);
  8244. }
  8245. int l7 = s1.indexOf("\\n");
  8246. String s4;
  8247. if (l7 != -1) {
  8248. s4 = s1.substring(0, l7);
  8249. s1 = s1.substring(l7 + 2);
  8250. } else {
  8251. s4 = s1;
  8252. s1 = "";
  8253. }
  8254. int j10 = textDrawingArea_2.getTextWidth(s4);
  8255. if (j10 > boxWidth) {
  8256. boxWidth = j10;
  8257. }
  8258. boxHeight += textDrawingArea_2.anInt1497 + 1;
  8259. }
  8260. boxWidth += 6;
  8261. boxHeight += 7;
  8262. int xPos = (k2 + class9_1.width) - 5 - boxWidth;
  8263. int yPos = l2 + class9_1.height + 5;
  8264. if (xPos < k2 + 5)
  8265. xPos = k2 + 5;
  8266. if (xPos + boxWidth > k + class9.width)
  8267. xPos = (k + class9.width) - boxWidth;
  8268. if (yPos + boxHeight > l + class9.height)
  8269. yPos = (l2 - boxHeight);
  8270. DrawingArea.drawPixels(boxHeight, yPos, xPos, 0xFFFFA0,
  8271. boxWidth);
  8272. DrawingArea.fillPixels(xPos, boxWidth, boxHeight, 0, yPos);
  8273. String s2 = class9_1.message;
  8274. for (int j11 = yPos + textDrawingArea_2.anInt1497 + 2; s2
  8275. .length() > 0; j11 += textDrawingArea_2.anInt1497 + 1) {// anInt1497
  8276. if (s2.indexOf("%") != -1) {
  8277. do {
  8278. int k7 = s2.indexOf("%1");
  8279. if (k7 == -1)
  8280. break;
  8281. s2 = s2.substring(0, k7)
  8282. + interfaceIntToString(extractInterfaceValues(
  8283. class9_1, 0))
  8284. + s2.substring(k7 + 2);
  8285. } while (true);
  8286. do {
  8287. int l7 = s2.indexOf("%2");
  8288. if (l7 == -1)
  8289. break;
  8290. s2 = s2.substring(0, l7)
  8291. + interfaceIntToString(extractInterfaceValues(
  8292. class9_1, 1))
  8293. + s2.substring(l7 + 2);
  8294. } while (true);
  8295. do {
  8296. int i8 = s2.indexOf("%3");
  8297. if (i8 == -1)
  8298. break;
  8299. s2 = s2.substring(0, i8)
  8300. + interfaceIntToString(extractInterfaceValues(
  8301. class9_1, 2))
  8302. + s2.substring(i8 + 2);
  8303. } while (true);
  8304. do {
  8305. int j8 = s2.indexOf("%4");
  8306. if (j8 == -1)
  8307. break;
  8308. s2 = s2.substring(0, j8)
  8309. + interfaceIntToString(extractInterfaceValues(
  8310. class9_1, 3))
  8311. + s2.substring(j8 + 2);
  8312. } while (true);
  8313. do {
  8314. int k8 = s2.indexOf("%5");
  8315. if (k8 == -1)
  8316. break;
  8317. s2 = s2.substring(0, k8)
  8318. + interfaceIntToString(extractInterfaceValues(
  8319. class9_1, 4))
  8320. + s2.substring(k8 + 2);
  8321. } while (true);
  8322. }
  8323. int l11 = s2.indexOf("\\n");
  8324. String s5;
  8325. if (l11 != -1) {
  8326. s5 = s2.substring(0, l11);
  8327. s2 = s2.substring(l11 + 2);
  8328. } else {
  8329. s5 = s2;
  8330. s2 = "";
  8331. }
  8332. if (class9_1.centerText) {
  8333. textDrawingArea_2.method382(yPos, xPos
  8334. + class9_1.width / 2, s5, j11, false);
  8335. } else {
  8336. if (s5.contains("\\r")) {
  8337. String text = s5
  8338. .substring(0, s5.indexOf("\\r"));
  8339. String text2 = s5
  8340. .substring(s5.indexOf("\\r") + 2);
  8341. textDrawingArea_2.method389(false, xPos + 3, 0,
  8342. text, j11);
  8343. int rightX = boxWidth + xPos
  8344. - textDrawingArea_2.getTextWidth(text2)
  8345. - 2;
  8346. textDrawingArea_2.method389(false, rightX, 0,
  8347. text2, j11);
  8348. System.out.println("Box: " + boxWidth + "");
  8349. } else
  8350. textDrawingArea_2.method389(false, xPos + 3, 0,
  8351. s5, j11);
  8352. }
  8353. }
  8354. }
  8355. }
  8356. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  8357. }
  8358.  
  8359. public static String[] splitString(GameFont font, String prefix, String string, int maxWidth, boolean ranked) {
  8360. maxWidth -= font.getDisplayedWidth(prefix) + (ranked ? 14 : 0);
  8361. if (font.getDisplayedWidth(prefix + string) + (ranked ? 14 : 0) <= maxWidth) {
  8362. return new String[]{ string };
  8363. }
  8364. String line = "";
  8365. String[] cut = new String[2];
  8366. boolean split = false;
  8367. char[] characters = string.toCharArray();
  8368. int space = -1;
  8369. for (int index = 0; index < characters.length; index++) {
  8370. char c = characters[index];
  8371. line += c;
  8372. if (c == ' ') {
  8373. space = index;
  8374. }
  8375. if (!split) {
  8376. if (font.getDisplayedWidth(line) + 10 > maxWidth) {
  8377. if (space != -1 && characters[index - 1] != ' ') {
  8378. cut[0] = line.substring(0, space);
  8379. line = line.substring(space);
  8380. } else {
  8381. cut[0] = line;
  8382. line = "";
  8383. }
  8384. split = true;
  8385. }
  8386. }
  8387. }
  8388. if (line.length() > 0) {
  8389. cut[1] = line;
  8390. }
  8391. return cut;
  8392. }
  8393.  
  8394. private void randomizeBackground(Background background) {
  8395. int j = 256;
  8396. for (int k = 0; k < anIntArray1190.length; k++)
  8397. anIntArray1190[k] = 0;
  8398.  
  8399. for (int l = 0; l < 5000; l++) {
  8400. int i1 = (int) (Math.random() * 128D * (double) j);
  8401. anIntArray1190[i1] = (int) (Math.random() * 256D);
  8402. }
  8403.  
  8404. for (int j1 = 0; j1 < 20; j1++) {
  8405. for (int k1 = 1; k1 < j - 1; k1++) {
  8406. for (int i2 = 1; i2 < 127; i2++) {
  8407. int k2 = i2 + (k1 << 7);
  8408. anIntArray1191[k2] = (anIntArray1190[k2 - 1] + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128] + anIntArray1190[k2 + 128]) / 4;
  8409. }
  8410.  
  8411. }
  8412.  
  8413. int ai[] = anIntArray1190;
  8414. anIntArray1190 = anIntArray1191;
  8415. anIntArray1191 = ai;
  8416. }
  8417.  
  8418. if (background != null) {
  8419. int l1 = 0;
  8420. for (int j2 = 0; j2 < background.anInt1453; j2++) {
  8421. for (int l2 = 0; l2 < background.anInt1452; l2++)
  8422. if (background.aByteArray1450[l1++] != 0) {
  8423. int i3 = l2 + 16 + background.anInt1454;
  8424. int j3 = j2 + 16 + background.anInt1455;
  8425. int k3 = i3 + (j3 << 7);
  8426. anIntArray1190[k3] = 0;
  8427. }
  8428.  
  8429. }
  8430.  
  8431. }
  8432. }
  8433.  
  8434. private void method107(int i, int j, Stream stream, Player player) {
  8435. if ((i & 0x400) != 0) {
  8436. player.anInt1543 = stream.method428();
  8437. player.anInt1545 = stream.method428();
  8438. player.anInt1544 = stream.method428();
  8439. player.anInt1546 = stream.method428();
  8440. player.anInt1547 = stream.method436() + loopCycle;
  8441. player.anInt1548 = stream.method435() + loopCycle;
  8442. player.anInt1549 = stream.method428();
  8443. player.method446();
  8444. }
  8445. if((i & 0x100) != 0)
  8446. {
  8447. player.anInt1520 = stream.method434();
  8448. int k = stream.readDWord();
  8449. player.anInt1524 = k >> 16;
  8450. player.anInt1523 = loopCycle + (k & 0xffff);
  8451. player.anInt1521 = 0;
  8452. player.anInt1522 = 0;
  8453. if(player.anInt1523 > loopCycle)
  8454. player.anInt1521 = -1;
  8455. if(player.anInt1520 == 65535)
  8456. player.anInt1520 = -1;
  8457. }
  8458. if((i & 8) != 0)
  8459. {
  8460. int l = stream.method434();
  8461. if(l == 65535)
  8462. l = -1;
  8463. int i2 = stream.method427();
  8464. if(l == player.anim && l != -1)
  8465. {
  8466. int i3 = Animation.anims[l].anInt365;
  8467. if(i3 == 1)
  8468. {
  8469. player.anInt1527 = 0;
  8470. player.anInt1528 = 0;
  8471. player.anInt1529 = i2;
  8472. player.anInt1530 = 0;
  8473. }
  8474. if(i3 == 2)
  8475. player.anInt1530 = 0;
  8476. } else
  8477. if(l == -1 || player.anim == -1 || Animation.anims[l].anInt359 >= Animation.anims[player.anim].anInt359)
  8478. {
  8479. player.anim = l;
  8480. player.anInt1527 = 0;
  8481. player.anInt1528 = 0;
  8482. player.anInt1529 = i2;
  8483. player.anInt1530 = 0;
  8484. player.anInt1542 = player.smallXYIndex;
  8485. }
  8486. }
  8487. if ((i & 4) != 0) {
  8488. player.textSpoken = stream.readString();
  8489. if (player.textSpoken.charAt(0) == '~') {
  8490. player.textSpoken = player.textSpoken.substring(1);
  8491. pushMessage(player.textSpoken, 2, player.name);
  8492. } else if (player == myPlayer)
  8493. pushMessage(player.textSpoken, 2, player.name);
  8494. player.anInt1513 = 0;
  8495. player.anInt1531 = 0;
  8496. player.textCycle = 150;
  8497. }
  8498. if ((i & 0x80) != 0) {
  8499. int i1 = stream.method434();
  8500. int j2 = stream.readUnsignedByte();
  8501. int j3 = stream.method427();
  8502. int k3 = stream.currentOffset;
  8503. if (player.name != null && player.visible) {
  8504. long l3 = TextClass.longForName(player.name);
  8505. boolean flag = false;
  8506. if (j2 <= 1) {
  8507. for (int i4 = 0; i4 < ignoreCount; i4++) {
  8508. if (ignoreListAsLongs[i4] != l3)
  8509. continue;
  8510. flag = true;
  8511. break;
  8512. }
  8513.  
  8514. }
  8515. if (!flag && anInt1251 == 0)
  8516. try {
  8517. aStream_834.currentOffset = 0;
  8518. stream.method442(j3, 0, aStream_834.buffer);
  8519. aStream_834.currentOffset = 0;
  8520. String s = TextInput.method525(j3, aStream_834);
  8521. // s = Censor.doCensor(s);
  8522. player.textSpoken = s;
  8523. player.anInt1513 = i1 >> 8;
  8524. player.privelage = j2;
  8525.  
  8526. //entityMessage(player);
  8527.  
  8528. player.anInt1531 = i1 & 0xff;
  8529. player.textCycle = 150;
  8530. if (j2 == 2 || j2 == 3)
  8531. pushMessage(s, 1, "@cr2@" + player.name);
  8532. else if (j2 == 1)
  8533. pushMessage(s, 1, "@cr1@" + player.name);
  8534. else
  8535. pushMessage(s, 2, player.name);
  8536. }
  8537. catch (Exception exception) {
  8538. signlink.reporterror("cde2");
  8539. }
  8540. }
  8541. stream.currentOffset = k3 + j3;
  8542. }
  8543. if ((i & 1) != 0) {
  8544. player.interactingEntity = stream.method434();
  8545. if (player.interactingEntity == 65535)
  8546. player.interactingEntity = -1;
  8547. }
  8548. if ((i & 0x10) != 0) {
  8549. int j1 = stream.method427();
  8550. byte abyte0[] = new byte[j1];
  8551. Stream stream_1 = new Stream(abyte0);
  8552. stream.readBytes(j1, 0, abyte0);
  8553. aStreamArray895s[j] = stream_1;
  8554. player.updatePlayer(stream_1);
  8555. }
  8556. if ((i & 2) != 0) {
  8557. player.anInt1538 = stream.method436();
  8558. player.anInt1539 = stream.method434();
  8559. }
  8560. if ((i & 0x20) != 0) {
  8561. int k1 = stream.readUnsignedByte();
  8562. int k2 = stream.method426();
  8563. player.updateHitData(k2, k1, loopCycle);
  8564. player.loopCycleStatus = loopCycle + 300;
  8565. player.currentHealth = stream.method427();
  8566. player.maxHealth = stream.readUnsignedByte();
  8567. }
  8568. if ((i & 0x200) != 0) {
  8569. int l1 = stream.readUnsignedByte();
  8570. int l2 = stream.method428();
  8571. player.updateHitData(l2, l1, loopCycle);
  8572. player.loopCycleStatus = loopCycle + 300;
  8573. player.currentHealth = stream.readUnsignedByte();
  8574. player.maxHealth = stream.method427();
  8575. }
  8576. }
  8577.  
  8578. private void method108() {
  8579. try {
  8580. int j = myPlayer.x + cameraOffsetX;
  8581. int k = myPlayer.y + cameraOffsetY;
  8582. if (anInt1014 - j < -500 || anInt1014 - j > 500 || anInt1015 - k < -500 || anInt1015 - k > 500) {
  8583. anInt1014 = j;
  8584. anInt1015 = k;
  8585. }
  8586. if (anInt1014 != j)
  8587. anInt1014 += (j - anInt1014) / 16;
  8588. if (anInt1015 != k)
  8589. anInt1015 += (k - anInt1015) / 16;
  8590. if (super.keyArray[1] == 1)
  8591. anInt1186 += (-24 - anInt1186) / 2;
  8592. else if (super.keyArray[2] == 1)
  8593. anInt1186 += (24 - anInt1186) / 2;
  8594. else
  8595. anInt1186 /= 2;
  8596. if (super.keyArray[3] == 1)
  8597. anInt1187 += (12 - anInt1187) / 2;
  8598. else if (super.keyArray[4] == 1)
  8599. anInt1187 += (-12 - anInt1187) / 2;
  8600. else
  8601. anInt1187 /= 2;
  8602. viewRotation = viewRotation + anInt1186 / 2 & 0x7ff;
  8603. anInt1184 += anInt1187 / 2;
  8604. if (anInt1184 < 128)
  8605. anInt1184 = 128;
  8606. if (anInt1184 > 383)
  8607. anInt1184 = 383;
  8608. int l = anInt1014 >> 7;
  8609. int i1 = anInt1015 >> 7;
  8610. int j1 = method42(plane, anInt1015, anInt1014);
  8611. int k1 = 0;
  8612. if (l > 3 && i1 > 3 && l < 100 && i1 < 100) {
  8613. for (int l1 = l - 4; l1 <= l + 4; l1++) {
  8614. for (int k2 = i1 - 4; k2 <= i1 + 4; k2++) {
  8615. int l2 = plane;
  8616. if (l2 < 3 && (byteGroundArray[1][l1][k2] & 2) == 2)
  8617. l2++;
  8618. int i3 = j1 - intGroundArray[l2][l1][k2];
  8619. if (i3 > k1)
  8620. k1 = i3;
  8621. }
  8622.  
  8623. }
  8624.  
  8625. }
  8626. anInt1005++;
  8627. if (anInt1005 > 1512) {
  8628. anInt1005 = 0;
  8629. stream.createFrame(77);
  8630. stream.writeWordBigEndian(0);
  8631. int i2 = stream.currentOffset;
  8632. stream.writeWordBigEndian((int) (Math.random() * 256D));
  8633. stream.writeWordBigEndian(101);
  8634. stream.writeWordBigEndian(233);
  8635. stream.writeWord(45092);
  8636. if ((int) (Math.random() * 2D) == 0)
  8637. stream.writeWord(35784);
  8638. stream.writeWordBigEndian((int) (Math.random() * 256D));
  8639. stream.writeWordBigEndian(64);
  8640. stream.writeWordBigEndian(38);
  8641. stream.writeWord((int) (Math.random() * 65536D));
  8642. stream.writeWord((int) (Math.random() * 65536D));
  8643. stream.writeBytes(stream.currentOffset - i2);
  8644. }
  8645. int j2 = k1 * 192;
  8646. if (j2 > 0x17f00)
  8647. j2 = 0x17f00;
  8648. if (j2 < 32768)
  8649. j2 = 32768;
  8650. if (j2 > anInt984) {
  8651. anInt984 += (j2 - anInt984) / 24;
  8652. return;
  8653. }
  8654. if (j2 < anInt984) {
  8655. anInt984 += (j2 - anInt984) / 80;
  8656. }
  8657. }
  8658. catch (Exception _ex) {
  8659. signlink.reporterror("glfc_ex " + myPlayer.x + "," + myPlayer.y + "," + anInt1014 + "," + anInt1015 + "," + anInt1069 + "," + anInt1070 + "," + baseX + "," + baseY);
  8660. throw new RuntimeException("eek");
  8661. }
  8662. }
  8663.  
  8664. public void processDrawing() {
  8665. if (rsAlreadyLoaded || loadingError || genericLoadingError) {
  8666. showErrorScreen();
  8667. return;
  8668. }
  8669. anInt1061++;
  8670. if (!loggedIn){
  8671. drawLoginScreen(false);
  8672. }else{
  8673. drawGameScreen();
  8674. }
  8675. anInt1213 = 0;
  8676. }
  8677.  
  8678. private boolean isFriendOrSelf(String s) {
  8679. if (s == null)
  8680. return false;
  8681. for (int i = 0; i < friendsCount; i++)
  8682. if (s.equalsIgnoreCase(friendsList[i]))
  8683. return true;
  8684. return s.equalsIgnoreCase(myPlayer.name);
  8685. }
  8686.  
  8687. private static String combatDiffColor(int i, int j) {
  8688. int k = i - j;
  8689. if (k < -9)
  8690. return "@red@";
  8691. if (k < -6)
  8692. return "@or3@";
  8693. if (k < -3)
  8694. return "@or2@";
  8695. if (k < 0)
  8696. return "@or1@";
  8697. if (k > 9)
  8698. return "@gre@";
  8699. if (k > 6)
  8700. return "@gr3@";
  8701. if (k > 3)
  8702. return "@gr2@";
  8703. if (k > 0)
  8704. return "@gr1@";
  8705. else
  8706. return "@yel@";
  8707. }
  8708.  
  8709. private void setWaveVolume(int i) {
  8710. signlink.wavevol = i;
  8711. }
  8712.  
  8713. private void draw3dScreen() {
  8714. if (showChatComponents) {
  8715. drawSplitPrivateChat();
  8716. }
  8717. if (crossType == 1) {
  8718. int offSet = frameMode == ScreenMode.FIXED ? 4 : 0;
  8719. crosses[crossIndex / 100].drawSprite(crossX - 8 - offSet, crossY - 8 - offSet);
  8720. anInt1142++;
  8721. if (anInt1142 > 67) {
  8722. anInt1142 = 0;
  8723. stream.createFrame(78);
  8724. }
  8725. }
  8726. if (crossType == 2) {
  8727. int offSet = frameMode == ScreenMode.FIXED ? 4 : 0;
  8728. crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - offSet, crossY - 8 - offSet);
  8729. }
  8730. if (anInt1018 != -1) {
  8731. method119(anInt945, anInt1018);
  8732. if (anInt1018 == 197 && frameMode != ScreenMode.FIXED) {
  8733. skullIcons[0].drawSprite(frameWidth - 157, 168);
  8734. String text = RSInterface.interfaceCache[199].message.replace("@yel@", "");
  8735. regularText.drawChatInput(0xE1981D, frameWidth - 165, text, 207, true);
  8736. } else if (anInt1018 == 201 && frameMode != ScreenMode.FIXED) {
  8737. drawInterface(0, frameWidth - 560, RSInterface.interfaceCache[anInt1018], -109);
  8738. } else {
  8739. drawInterface(0, frameMode == ScreenMode.FIXED ? 0 : (frameWidth / 2) - 356, RSInterface.interfaceCache[anInt1018], frameMode == ScreenMode.FIXED ? 0 : (frameHeight / 2) - 230);
  8740. }
  8741. }
  8742. if (openInterfaceID != -1) {
  8743. method119(anInt945, openInterfaceID);
  8744. drawInterface(0, frameMode == ScreenMode.FIXED ? 0 : (frameWidth / 2) - 356, RSInterface.interfaceCache[openInterfaceID], frameMode == ScreenMode.FIXED ? 0 : (frameHeight / 2) - 230);
  8745. }
  8746. //method70();
  8747. if(!menuOpen)
  8748. {
  8749. processRightClick();
  8750. drawTooltip();
  8751. } else {
  8752. drawMenu(frameMode == ScreenMode.FIXED ? 4 : 0, frameMode == ScreenMode.FIXED ? 4 : 0);
  8753. }
  8754. if (anInt1055 == 1) {
  8755. multiOverlay.drawSprite(frameMode == ScreenMode.FIXED ? 472 : frameWidth - 85, frameMode == ScreenMode.FIXED ? 296 : 186);
  8756. }
  8757. if(fpsOn) {
  8758. int textColour = 0xffff00;
  8759. if(super.fps < 15) {
  8760. textColour = 0xff0000;
  8761. }
  8762. regularText.method385(textColour, "Fps: " + super.fps, 45, frameMode == ScreenMode.FIXED ? 470 : frameWidth - 265);
  8763. Runtime runtime = Runtime.getRuntime();
  8764. int memUsage = (int)((runtime.totalMemory() - runtime.freeMemory()) / 2048L);
  8765. textColour = 0xffff00;
  8766. if(memUsage > 0x2000000 && lowMem) {
  8767. textColour = 0xff0000;
  8768. }
  8769. regularText.method385(textColour, "Mem: " + memUsage + "k", 60, frameMode == ScreenMode.FIXED ? 428 : frameWidth - 265);
  8770. }
  8771. int x = baseX + (myPlayer.x - 6 >> 7);
  8772. int y = baseY + (myPlayer.y - 6 >> 7);
  8773. final String screenMode = frameMode == ScreenMode.FIXED ? "Fixed" : "Resizable";
  8774. if (clientData){
  8775. int textColour = 0xffff00;
  8776. int fpsColour = 0xffff00;
  8777. if(super.fps < 15) {
  8778. fpsColour = 0xff0000;
  8779. }
  8780. regularText.method385(textColour, "frameWidth: " + (mouseX - frameWidth) + ", frameHeight: " + (mouseY - frameHeight), frameHeight - 271, 5);
  8781. regularText.method385(textColour, "Client Zoom: " + cameraZoom, frameHeight - 257, 5);
  8782. regularText.method385(fpsColour, "Fps: " + super.fps, frameHeight - 243, 5);
  8783. Runtime runtime = Runtime.getRuntime();
  8784. int clientMemory = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 2048L);
  8785. regularText.method385(textColour, "Memory Usage: " + clientMemory + "k", frameHeight - 229, 5);
  8786. regularText.method385(textColour, "Mouse X: " + mouseX + ", Mouse Y: " + mouseY,frameHeight - 215, 5);
  8787. regularText.method385(textColour, "Coords: " + x + ", " + y, frameHeight - 201, 5);
  8788. regularText.method385(textColour, "Client Mode: " + screenMode + "", frameHeight - 187, 5);
  8789. regularText.method385(textColour, "Client Resolution: " + frameWidth + "x" + frameHeight, frameHeight - 173, 5);
  8790. }
  8791. if (anInt1104 != 0) {
  8792. int j = anInt1104 / 50;
  8793. int l = j / 60;
  8794. int yOffset = frameMode == ScreenMode.FIXED ? 0 : frameHeight - 498;
  8795. j %= 60;
  8796. if (j < 10)
  8797. regularText.method385(0xffff00, "System update in: " + l + ":0" + j, 329 + yOffset, 4);
  8798. else
  8799. regularText.method385(0xffff00, "System update in: " + l + ":" + j, 329 + yOffset, 4);
  8800. anInt849++;
  8801. if (anInt849 > 75) {
  8802. anInt849 = 0;
  8803. stream.createFrame(148);
  8804. }
  8805. }
  8806. }
  8807.  
  8808. private void addIgnore(long l) {
  8809. try {
  8810. if (l == 0L)
  8811. return;
  8812. if (ignoreCount >= 100) {
  8813. pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
  8814. return;
  8815. }
  8816. String s = TextClass.fixName(TextClass.nameForLong(l));
  8817. for (int j = 0; j < ignoreCount; j++)
  8818. if (ignoreListAsLongs[j] == l) {
  8819. pushMessage(s + " is already on your ignore list", 0, "");
  8820. return;
  8821. }
  8822. for (int k = 0; k < friendsCount; k++)
  8823. if (friendsListAsLongs[k] == l) {
  8824. pushMessage("Please remove " + s + " from your friend list first", 0, "");
  8825. return;
  8826. }
  8827.  
  8828. ignoreListAsLongs[ignoreCount++] = l;
  8829. needDrawTabArea = true;
  8830. stream.createFrame(133);
  8831. stream.writeQWord(l);
  8832. return;
  8833. }
  8834. catch (RuntimeException runtimeexception) {
  8835. signlink.reporterror("45688, " + l + ", " + 4 + ", " + runtimeexception.toString());
  8836. }
  8837. throw new RuntimeException();
  8838. }
  8839.  
  8840. private void method114() {
  8841. for (int i = -1; i < playerCount; i++) {
  8842. int j;
  8843. if (i == -1)
  8844. j = myPlayerIndex;
  8845. else
  8846. j = playerIndices[i];
  8847. Player player = playerArray[j];
  8848. if (player != null)
  8849. method96(player);
  8850. }
  8851.  
  8852. }
  8853.  
  8854. private void method115() {
  8855. if (loadingStage == 2) {
  8856. for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179.reverseGetNext())
  8857. {
  8858. if (class30_sub1.anInt1294 > 0)
  8859. class30_sub1.anInt1294--;
  8860. if (class30_sub1.anInt1294 == 0) {
  8861. if (class30_sub1.anInt1299 < 0 || ObjectManager.method178(class30_sub1.anInt1299, class30_sub1.anInt1301)) {
  8862. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1300, class30_sub1.anInt1301, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1299);
  8863. class30_sub1.unlink();
  8864. }
  8865. } else {
  8866. if (class30_sub1.anInt1302 > 0)
  8867. class30_sub1.anInt1302--;
  8868. 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))) {
  8869. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1292, class30_sub1.anInt1293, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1291);
  8870. class30_sub1.anInt1302 = -1;
  8871. if (class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1299 == -1)
  8872. class30_sub1.unlink();
  8873. else
  8874. if (class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1292 == class30_sub1.anInt1300 && class30_sub1.anInt1293 == class30_sub1.anInt1301)
  8875. class30_sub1.unlink();
  8876. }
  8877. }
  8878. }
  8879.  
  8880. }
  8881. }
  8882.  
  8883. private void determineMenuSize() {
  8884. int boxLength = chatTextDrawingArea.getTextWidth("Choose Option");
  8885. for(int row = 0; row < menuActionRow; row++)
  8886. {
  8887. int actionLength = chatTextDrawingArea.getTextWidth(menuActionName[row]);
  8888. if(actionLength > boxLength)
  8889. boxLength = actionLength;
  8890. }
  8891.  
  8892. boxLength += 8;
  8893. int offset = 15 * menuActionRow + 21;
  8894. if(super.saveClickX > 0 && super.saveClickY > 0 && super.saveClickX < frameWidth && super.saveClickY < frameHeight) {
  8895. int xClick = super.saveClickX - boxLength / 2;
  8896. if (xClick + boxLength > frameWidth - 4) {
  8897. xClick = frameWidth - 4 - boxLength;
  8898. }
  8899. if (xClick < 0) {
  8900. xClick = 0;
  8901. }
  8902. int yClick = super.saveClickY - 0;
  8903. if (yClick + offset > frameHeight - 6) {
  8904. yClick = frameHeight - 6 - offset;
  8905. }
  8906. if (yClick < 0) {
  8907. yClick = 0;
  8908. }
  8909. menuOpen = true;
  8910. menuOffsetX = xClick;
  8911. menuOffsetY = yClick;
  8912. menuWidth = boxLength;
  8913. menuHeight = 15 * menuActionRow + 22;
  8914. }
  8915. }
  8916.  
  8917. private void method117(Stream stream) {
  8918. stream.initBitAccess();
  8919. int j = stream.readBits(1);
  8920. if (j == 0)
  8921. return;
  8922. int k = stream.readBits(2);
  8923. if (k == 0) {
  8924. anIntArray894[anInt893++] = myPlayerIndex;
  8925. return;
  8926. }
  8927. if (k == 1) {
  8928. int l = stream.readBits(3);
  8929. myPlayer.moveInDir(false, l);
  8930. int k1 = stream.readBits(1);
  8931. if (k1 == 1)
  8932. anIntArray894[anInt893++] = myPlayerIndex;
  8933. return;
  8934. }
  8935. if (k == 2) {
  8936. int i1 = stream.readBits(3);
  8937. myPlayer.moveInDir(true, i1);
  8938. int l1 = stream.readBits(3);
  8939. myPlayer.moveInDir(true, l1);
  8940. int j2 = stream.readBits(1);
  8941. if (j2 == 1)
  8942. anIntArray894[anInt893++] = myPlayerIndex;
  8943. return;
  8944. }
  8945. if (k == 3) {
  8946. plane = stream.readBits(2);
  8947. int j1 = stream.readBits(1);
  8948. int i2 = stream.readBits(1);
  8949. if (i2 == 1)
  8950. anIntArray894[anInt893++] = myPlayerIndex;
  8951. int k2 = stream.readBits(7);
  8952. int l2 = stream.readBits(7);
  8953. myPlayer.setPos(l2, k2, j1 == 1);
  8954. }
  8955. }
  8956.  
  8957. private void nullLoader() {
  8958. aBoolean831 = false;
  8959. while (drawingFlames) {
  8960. aBoolean831 = false;
  8961. try {
  8962. Thread.sleep(50L);
  8963. }
  8964. catch (Exception _ex) {
  8965. }
  8966. }
  8967. aBackground_966 = null;
  8968. aBackground_967 = null;
  8969. aBackgroundArray1152s = null;
  8970. anIntArray850 = null;
  8971. anIntArray851 = null;
  8972. anIntArray852 = null;
  8973. anIntArray853 = null;
  8974. anIntArray1190 = null;
  8975. anIntArray1191 = null;
  8976. anIntArray828 = null;
  8977. anIntArray829 = null;
  8978. aClass30_Sub2_Sub1_Sub1_1201 = null;
  8979. aClass30_Sub2_Sub1_Sub1_1202 = null;
  8980. }
  8981.  
  8982. private boolean method119(int i, int j) {
  8983. boolean flag1 = false;
  8984. RSInterface class9 = RSInterface.interfaceCache[j];
  8985. for (int k = 0; k < class9.children.length; k++) {
  8986. if (class9.children[k] == -1)
  8987. break;
  8988. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
  8989. if (class9_1.type == 1)
  8990. flag1 |= method119(i, class9_1.id);
  8991. if (class9_1.type == 6 && (class9_1.anInt257 != -1 || class9_1.anInt258 != -1)) {
  8992. boolean flag2 = interfaceIsSelected(class9_1);
  8993. int l;
  8994. if (flag2)
  8995. l = class9_1.anInt258;
  8996. else
  8997. l = class9_1.anInt257;
  8998. if (l != -1) {
  8999. Animation animation = Animation.anims[l];
  9000. for (class9_1.anInt208 += i; class9_1.anInt208 > animation.method258(class9_1.anInt246);) {
  9001. class9_1.anInt208 -= animation.method258(class9_1.anInt246) + 1;
  9002. class9_1.anInt246++;
  9003. if (class9_1.anInt246 >= animation.frameCount) {
  9004. class9_1.anInt246 -= animation.frameStep;
  9005. if (class9_1.anInt246 < 0 || class9_1.anInt246 >= animation.frameCount)
  9006. class9_1.anInt246 = 0;
  9007. }
  9008. flag1 = true;
  9009. }
  9010.  
  9011. }
  9012. }
  9013. }
  9014.  
  9015. return flag1;
  9016. }
  9017.  
  9018. private int method120() {
  9019. if (roofsOff) {
  9020. return plane;
  9021. }
  9022. int j = 3;
  9023. if (yCameraCurve < 310) {
  9024. int k = xCameraPos >> 7;
  9025. int l = yCameraPos >> 7;
  9026. int i1 = myPlayer.x >> 7;
  9027. int j1 = myPlayer.y >> 7;
  9028. if ((byteGroundArray[plane][k][l] & 4) != 0)
  9029. j = plane;
  9030. int k1;
  9031. if (i1 > k)
  9032. k1 = i1 - k;
  9033. else
  9034. k1 = k - i1;
  9035. int l1;
  9036. if (j1 > l)
  9037. l1 = j1 - l;
  9038. else
  9039. l1 = l - j1;
  9040. if (k1 > l1) {
  9041. int i2 = (l1 * 0x10000) / k1;
  9042. int k2 = 32768;
  9043. while (k != i1) {
  9044. if (k < i1)
  9045. k++;
  9046. else if (k > i1)
  9047. k--;
  9048. if ((byteGroundArray[plane][k][l] & 4) != 0)
  9049. j = plane;
  9050. k2 += i2;
  9051. if (k2 >= 0x10000) {
  9052. k2 -= 0x10000;
  9053. if (l < j1)
  9054. l++;
  9055. else if (l > j1)
  9056. l--;
  9057. if ((byteGroundArray[plane][k][l] & 4) != 0)
  9058. j = plane;
  9059. }
  9060. }
  9061. } else {
  9062. int j2 = (k1 * 0x10000) / l1;
  9063. int l2 = 32768;
  9064. while (l != j1) {
  9065. if (l < j1)
  9066. l++;
  9067. else if (l > j1)
  9068. l--;
  9069. if ((byteGroundArray[plane][k][l] & 4) != 0)
  9070. j = plane;
  9071. l2 += j2;
  9072. if (l2 >= 0x10000) {
  9073. l2 -= 0x10000;
  9074. if (k < i1)
  9075. k++;
  9076. else if (k > i1)
  9077. k--;
  9078. if ((byteGroundArray[plane][k][l] & 4) != 0)
  9079. j = plane;
  9080. }
  9081. }
  9082. }
  9083. }
  9084. if ((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
  9085. j = plane;
  9086. return j;
  9087. }
  9088.  
  9089.  
  9090. private int method121() {
  9091. if (roofsOff) {
  9092. return plane;
  9093. }
  9094. int j = method42(plane, yCameraPos, xCameraPos);
  9095. if (j - zCameraPos < 800 && (byteGroundArray[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
  9096. return plane;
  9097. else
  9098. return 3;
  9099. }
  9100.  
  9101. private void delIgnore(long l) {
  9102. try {
  9103. if (l == 0L)
  9104. return;
  9105. for (int j = 0; j < ignoreCount; j++)
  9106. if (ignoreListAsLongs[j] == l) {
  9107. ignoreCount--;
  9108. needDrawTabArea = true;
  9109. System.arraycopy(ignoreListAsLongs, j + 1, ignoreListAsLongs, j, ignoreCount - j);
  9110.  
  9111. stream.createFrame(74);
  9112. stream.writeQWord(l);
  9113. return;
  9114. }
  9115.  
  9116. return;
  9117. }
  9118. catch (RuntimeException runtimeexception) {
  9119. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  9120. }
  9121. throw new RuntimeException();
  9122. }
  9123.  
  9124. public String getParameter(String s) {
  9125. if (signlink.mainapp != null)
  9126. return signlink.mainapp.getParameter(s);
  9127. else
  9128. return super.getParameter(s);
  9129. }
  9130.  
  9131. private void adjustVolume(boolean updateMidi, int volume) {
  9132. signlink.setVolume(volume);
  9133. if (updateMidi) {
  9134. signlink.midi = "voladjust";
  9135. }
  9136. }
  9137.  
  9138. private int extractInterfaceValues(RSInterface class9, int j) {
  9139. if (class9.valueIndexArray == null || j >= class9.valueIndexArray.length)
  9140. return -2;
  9141. try {
  9142. int ai[] = class9.valueIndexArray[j];
  9143. int k = 0;
  9144. int l = 0;
  9145. int i1 = 0;
  9146. do {
  9147. int j1 = ai[l++];
  9148. int k1 = 0;
  9149. byte byte0 = 0;
  9150. if (j1 == 0)
  9151. return k;
  9152. if (j1 == 1)
  9153. k1 = currentStats[ai[l++]];
  9154. if (j1 == 2)
  9155. k1 = maxStats[ai[l++]];
  9156. if (j1 == 3)
  9157. k1 = currentExp[ai[l++]];
  9158. if (j1 == 4) {
  9159. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  9160. int k2 = ai[l++];
  9161. if (k2 >= 0 && k2 < ItemDef.totalItems && (!ItemDef.forID(k2).membersObject || isMembers)) {
  9162. for (int j3 = 0; j3 < class9_1.inv.length; j3++)
  9163. if (class9_1.inv[j3] == k2 + 1)
  9164. k1 += class9_1.invStackSizes[j3];
  9165.  
  9166. }
  9167. }
  9168. if (j1 == 5)
  9169. k1 = variousSettings[ai[l++]];
  9170. if (j1 == 6)
  9171. k1 = anIntArray1019[maxStats[ai[l++]] - 1];
  9172. if (j1 == 7)
  9173. k1 = (variousSettings[ai[l++]] * 100) / 46875;
  9174. if (j1 == 8)
  9175. k1 = myPlayer.combatLevel;
  9176. if (j1 == 9) {
  9177. for (int l1 = 0; l1 < Skills.skillsCount; l1++)
  9178. if (Skills.skillEnabled[l1])
  9179. k1 += maxStats[l1];
  9180.  
  9181. }
  9182. if (j1 == 10) {
  9183. RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
  9184. int l2 = ai[l++] + 1;
  9185. if (l2 >= 0 && l2 < ItemDef.totalItems && (!ItemDef.forID(l2).membersObject || isMembers)) {
  9186. for (int k3 = 0; k3 < class9_2.inv.length; k3++) {
  9187. if (class9_2.inv[k3] != l2)
  9188. continue;
  9189. k1 = 0x3b9ac9ff;
  9190. break;
  9191. }
  9192.  
  9193. }
  9194. }
  9195. if (j1 == 11)
  9196. k1 = energy;
  9197. if (j1 == 12)
  9198. k1 = weight;
  9199. if (j1 == 13) {
  9200. int i2 = variousSettings[ai[l++]];
  9201. int i3 = ai[l++];
  9202. k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  9203. }
  9204. if (j1 == 14) {
  9205. int j2 = ai[l++];
  9206. VarBit varBit = VarBit.cache[j2];
  9207. int l3 = varBit.anInt648;
  9208. int i4 = varBit.anInt649;
  9209. int j4 = varBit.anInt650;
  9210. int k4 = anIntArray1232[j4 - i4];
  9211. k1 = variousSettings[l3] >> i4 & k4;
  9212. }
  9213. if (j1 == 15)
  9214. byte0 = 1;
  9215. if (j1 == 16)
  9216. byte0 = 2;
  9217. if (j1 == 17)
  9218. byte0 = 3;
  9219. if (j1 == 18)
  9220. k1 = (myPlayer.x >> 7) + baseX;
  9221. if (j1 == 19)
  9222. k1 = (myPlayer.y >> 7) + baseY;
  9223. if (j1 == 20)
  9224. k1 = ai[l++];
  9225. if (byte0 == 0) {
  9226. if (i1 == 0)
  9227. k += k1;
  9228. if (i1 == 1)
  9229. k -= k1;
  9230. if (i1 == 2 && k1 != 0)
  9231. k /= k1;
  9232. if (i1 == 3)
  9233. k *= k1;
  9234. i1 = 0;
  9235. } else {
  9236. i1 = byte0;
  9237. }
  9238. } while (true);
  9239. }
  9240. catch (Exception _ex) {
  9241. return -1;
  9242. }
  9243. }
  9244.  
  9245. private void drawTooltip() {
  9246. if (menuActionRow < 2 && itemSelected == 0 && spellSelected == 0)
  9247. return;
  9248. String s;
  9249. if (itemSelected == 1 && menuActionRow < 2)
  9250. s = "Use " + selectedItemName + " with...";
  9251. else if (spellSelected == 1 && menuActionRow < 2)
  9252. s = spellTooltip + "...";
  9253. else
  9254. s = menuActionName[menuActionRow - 1];
  9255. if (menuActionRow > 2)
  9256. s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
  9257. chatTextDrawingArea.method390(4, 0xffffff, s, loopCycle / 1000, 15);
  9258. }
  9259.  
  9260. public void drawChannelButtons() {
  9261. final int yOffset = frameMode == ScreenMode.FIXED ? 0 : frameHeight - 165;
  9262. regularText.method382(0xffffff, 55, "Public chat", 142 + yOffset, true);
  9263. if(publicChatMode == 0)
  9264. regularText.method382(65280, 55, "On", 154 + yOffset, true);
  9265. if(publicChatMode == 1)
  9266. regularText.method382(0xffff00, 55, "Friends", 154 + yOffset, true);
  9267. if(publicChatMode == 2)
  9268. regularText.method382(0xff0000, 55, "Off", 154 + yOffset, true);
  9269. if(publicChatMode == 3)
  9270. regularText.method382(65535, 55, "Hide", 154 + yOffset, true);
  9271. regularText.method382(0xffffff, 184, "Private chat", 142 + yOffset, true);
  9272. if(privateChatMode == 0)
  9273. regularText.method382(65280, 184, "On", 154 + yOffset, true);
  9274. if(privateChatMode == 1)
  9275. regularText.method382(0xffff00, 184, "Friends", 154 + yOffset, true);
  9276. if(privateChatMode == 2)
  9277. regularText.method382(0xff0000, 184, "Off", 154 + yOffset, true);
  9278. regularText.method382(0xffffff, 324, "Trade/compete", 142 + yOffset, true);
  9279. if(tradeMode == 0)
  9280. regularText.method382(65280, 324, "On", 154 + yOffset, true);
  9281. if(tradeMode == 1)
  9282. regularText.method382(0xffff00, 324, "Friends", 154 + yOffset, true);
  9283. if(tradeMode == 2)
  9284. regularText.method382(0xff0000, 324, "Off", 154 + yOffset, true);
  9285. regularText.method382(0xffffff, 460, "Report abuse", 147 + yOffset, true);
  9286. }
  9287.  
  9288. public void drawMinimap() {
  9289. if (frameMode == ScreenMode.FIXED) {
  9290. aRSImageProducer_1164.initDrawingArea();
  9291. }
  9292. if(frameMode != ScreenMode.FIXED) {
  9293. for(int i = 0; i < 76; i++) {
  9294. int amt = (int)(Math.sqrt(Math.pow(77, 2) - Math.pow(75-i, 2)));
  9295. anIntArray1229[i] = 2 * amt + 2;
  9296. anIntArray1229[150-i] = 2 * amt + 2;
  9297. anIntArray1052[i] = -amt + 73;
  9298. anIntArray1052[150-i] = -amt + 73;
  9299. }
  9300. }
  9301. if(anInt1021 == 2) {
  9302. byte abyte0[] = mapBack.aByteArray1450;
  9303. int ai[] = DrawingArea.pixels;
  9304. int k2 = abyte0.length;
  9305. for(int i5 = 0; i5 < k2; i5++)
  9306. if(abyte0[i5] == 0)
  9307. ai[i5] = 0;
  9308. if (frameMode == ScreenMode.FIXED) {
  9309. (is317 ? cacheSprite[27] : compass).method352(33, viewRotation, anIntArray1057, 256, anIntArray968, 25, 8, 11, 33, 25);
  9310. }
  9311. if(menuOpen){
  9312. drawMenu(516, 0);
  9313. }
  9314. aRSImageProducer_1165.initDrawingArea();
  9315. return;
  9316. }
  9317. int i = viewRotation + viewRotationOffset & 0x7ff;
  9318. int j = 48 + myPlayer.x / 32;
  9319. int l2 = 464 - myPlayer.y / 32;
  9320. int x2 = frameWidth - 182;
  9321. if (frameMode == ScreenMode.FIXED) {
  9322. minimapImage.method352(151, i, anIntArray1229, 256 + minimapZoom, anIntArray1052, l2, 9, 59, 146, j);
  9323. } else {
  9324. minimapImage.method352(152, i, anIntArray1229, 256 + minimapZoom, anIntArray1052, l2, 14, x2, 146, j);
  9325. }
  9326. for(int j5 = 0; j5 < anInt1071; j5++) {
  9327. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  9328. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  9329. markMinimap(aClass30_Sub2_Sub1_Sub1Array1140[j5], k, i3);
  9330. }
  9331.  
  9332. for(int k5 = 0; k5 < 104; k5++) {
  9333. for(int l5 = 0; l5 < 104; l5++) {
  9334. NodeList class19 = groundArray[plane][k5][l5];
  9335. if(class19 != null) {
  9336. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  9337. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  9338. markMinimap(mapDotItem, l, j3);
  9339. }
  9340. }
  9341. }
  9342.  
  9343. for(int i6 = 0; i6 < npcCount; i6++) {
  9344. NPC npc = npcArray[npcIndices[i6]];
  9345. if(npc != null && npc.isVisible()) {
  9346. EntityDef entityDef = npc.desc;
  9347. if(entityDef.childrenIDs != null)
  9348. entityDef = entityDef.method161();
  9349. if(entityDef != null && entityDef.aBoolean87 && entityDef.aBoolean84) {
  9350. int i1 = npc.x / 32 - myPlayer.x / 32;
  9351. int k3 = npc.y / 32 - myPlayer.y / 32;
  9352. markMinimap(mapDotNPC, i1, k3);
  9353. }
  9354. }
  9355. }
  9356.  
  9357. for(int j6 = 0; j6 < playerCount; j6++) {
  9358. Player player = playerArray[playerIndices[j6]];
  9359. if(player != null && player.isVisible()) {
  9360. int j1 = player.x / 32 - myPlayer.x / 32;
  9361. int l3 = player.y / 32 - myPlayer.y / 32;
  9362. boolean flag1 = false;
  9363. long l6 = TextClass.longForName(player.name);
  9364. for(int k6 = 0; k6 < friendsCount; k6++) {
  9365. if(l6 != friendsListAsLongs[k6] || friendsNodeIDs[k6] == 0)
  9366. continue;
  9367. flag1 = true;
  9368. break;
  9369. }
  9370. if(myPlayer.team != 0 && player.team != 0 && myPlayer.team == player.team) {
  9371. }
  9372. if(flag1)
  9373. markMinimap(mapDotFriend, j1, l3);
  9374. else
  9375. markMinimap(mapDotPlayer, j1, l3);
  9376. }
  9377. }
  9378.  
  9379. if(anInt855 != 0 && loopCycle % 20 < 10) {
  9380. if(anInt855 == 1 && anInt1222 >= 0 && anInt1222 < npcArray.length) {
  9381. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  9382. if(class30_sub2_sub4_sub1_sub1_1 != null)
  9383. {
  9384. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32 - myPlayer.x / 32;
  9385. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32 - myPlayer.y / 32;
  9386. method81(mapMarker, i4, k1);
  9387. }
  9388. }
  9389.  
  9390. if(anInt855 == 2) {
  9391. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  9392. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  9393. method81(mapMarker, j4, l1);
  9394. }
  9395. if(anInt855 == 10 && anInt933 >= 0 && anInt933 < playerArray.length)
  9396. {
  9397. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  9398. if(class30_sub2_sub4_sub1_sub2_1 != null) {
  9399. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32 - myPlayer.x / 32;
  9400. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32 - myPlayer.y / 32;
  9401. method81(mapMarker, k4, i2);
  9402. }
  9403. }
  9404. }
  9405. if(destX != 0) {
  9406. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  9407. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  9408. markMinimap(mapFlag, j2, l4);
  9409. }
  9410. DrawingArea.drawPixels(3, (frameMode == ScreenMode.FIXED ? 83 : 89), (frameMode == ScreenMode.FIXED ? 99+32 : frameWidth - 110), 0xffffff, 3);
  9411. //DrawingArea.drawPixels(3, 78+5, 99+32, 0xffffff, 3);
  9412. (is317 ? cacheSprite[27] : compass).method352(33, viewRotation, anIntArray1057, 256, anIntArray968, (frameMode == ScreenMode.FIXED ? 25 : 25), (frameMode == ScreenMode.FIXED ? 4 : 9), (frameMode == ScreenMode.FIXED ? 34 : frameWidth - 207), 33, 25);
  9413.  
  9414. if (frameMode == ScreenMode.FIXED) {
  9415. cacheSprite[1].drawSprite(0, 0);
  9416. } else {
  9417. cacheSprite[28].drawAdvancedSprite(frameWidth - 241, 0); //181
  9418. }
  9419. if(menuOpen) {
  9420. drawMenu(frameMode == ScreenMode.FIXED ? 516 : 0, 0);
  9421. }
  9422. aRSImageProducer_1165.initDrawingArea();
  9423. }
  9424.  
  9425. private void npcScreenPos(Entity entity, int i) {
  9426. calcEntityScreenPos(entity.x, i, entity.y);
  9427.  
  9428. //aryan entity.entScreenX = spriteDrawX; entity.entScreenY = spriteDrawY;
  9429. }
  9430.  
  9431. private void calcEntityScreenPos(int i, int j, int l) {
  9432. if (i < 128 || l < 128 || i > 13056 || l > 13056) {
  9433. spriteDrawX = -1;
  9434. spriteDrawY = -1;
  9435. return;
  9436. }
  9437. int i1 = method42(plane, l, i) - j;
  9438. i -= xCameraPos;
  9439. i1 -= zCameraPos;
  9440. l -= yCameraPos;
  9441. int j1 = Model.modelIntArray1[yCameraCurve];
  9442. int k1 = Model.modelIntArray2[yCameraCurve];
  9443. int l1 = Model.modelIntArray1[xCameraCurve];
  9444. int i2 = Model.modelIntArray2[xCameraCurve];
  9445. int j2 = l * l1 + i * i2 >> 16;
  9446. l = l * i2 - i * l1 >> 16;
  9447. i = j2;
  9448. j2 = i1 * k1 - l * j1 >> 16;
  9449. l = i1 * j1 + l * k1 >> 16;
  9450. i1 = j2;
  9451. if (l >= 50) {
  9452. spriteDrawX = Texture.textureInt1 + (i << WorldController.viewDistance) / l;
  9453. spriteDrawY = Texture.textureInt2 + (i1 << WorldController.viewDistance) / l;
  9454. } else {
  9455. spriteDrawX = -1;
  9456. spriteDrawY = -1;
  9457. }
  9458. }
  9459.  
  9460. private void buildSplitPrivateChatMenu() {
  9461. if (splitPrivateChat == 0)
  9462. return;
  9463. int i = 0;
  9464. if (anInt1104 != 0)
  9465. i = 1;
  9466. for (int j = 0; j < 100; j++)
  9467. if (chatMessages[j] != null) {
  9468. int k = chatTypes[j];
  9469. String s = chatNames[j];
  9470. boolean flag1 = false;
  9471. if (s != null && s.startsWith("@cr1@")) {
  9472. s = s.substring(5);
  9473. boolean flag2 = true;
  9474. }
  9475. if (s != null && s.startsWith("@cr2@")) {
  9476. s = s.substring(5);
  9477. byte byte0 = 2;
  9478. }
  9479. if ((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  9480. int offSet = frameMode == ScreenMode.FIXED ? 4 : 0;
  9481. int l = 329 - i * 13;
  9482. if (frameMode != ScreenMode.FIXED) {
  9483. l = frameHeight - 170 - i * 13;
  9484. }
  9485. if (super.mouseX > 4 && super.mouseY - offSet > l - 10 && super.mouseY - offSet <= l + 3) {
  9486. int i1 = regularText.getTextWidth("From: " + s + chatMessages[j]) + 25;
  9487. if (i1 > 450)
  9488. i1 = 450;
  9489. if (super.mouseX < 4 + i1) {
  9490. if (myPrivilege >= 1) {
  9491. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  9492. menuActionID[menuActionRow] = 2606;
  9493. menuActionRow++;
  9494. }
  9495. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  9496. menuActionID[menuActionRow] = 2042;
  9497. menuActionRow++;
  9498. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  9499. menuActionID[menuActionRow] = 2337;
  9500. menuActionRow++;
  9501. }
  9502. }
  9503. if (++i >= 5)
  9504. return;
  9505. }
  9506. if ((k == 5 || k == 6) && privateChatMode < 2 && ++i >= 5)
  9507. return;
  9508. }
  9509.  
  9510. }
  9511.  
  9512. private void method130(int j, int k, int l, int i1, int j1, int k1,
  9513. int l1, int i2, int j2) {
  9514. Class30_Sub1 class30_sub1 = null;
  9515. for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179.reverseGetNext())
  9516. {
  9517. if (class30_sub1_1.anInt1295 != l1 || class30_sub1_1.anInt1297 != i2 || class30_sub1_1.anInt1298 != j1 || class30_sub1_1.anInt1296 != i1)
  9518. continue;
  9519. class30_sub1 = class30_sub1_1;
  9520. break;
  9521. }
  9522.  
  9523. if (class30_sub1 == null) {
  9524. class30_sub1 = new Class30_Sub1();
  9525. class30_sub1.anInt1295 = l1;
  9526. class30_sub1.anInt1296 = i1;
  9527. class30_sub1.anInt1297 = i2;
  9528. class30_sub1.anInt1298 = j1;
  9529. method89(class30_sub1);
  9530. aClass19_1179.insertHead(class30_sub1);
  9531. }
  9532. class30_sub1.anInt1291 = k;
  9533. class30_sub1.anInt1293 = k1;
  9534. class30_sub1.anInt1292 = l;
  9535. class30_sub1.anInt1302 = j2;
  9536. class30_sub1.anInt1294 = j;
  9537. }
  9538.  
  9539. private boolean interfaceIsSelected(RSInterface class9) {
  9540. if (class9.anIntArray245 == null)
  9541. return false;
  9542. for (int i = 0; i < class9.anIntArray245.length; i++) {
  9543. int j = extractInterfaceValues(class9, i);
  9544. int k = class9.anIntArray212[i];
  9545. if (class9.anIntArray245[i] == 2) {
  9546. if (j >= k)
  9547. return false;
  9548. } else if (class9.anIntArray245[i] == 3) {
  9549. if (j <= k)
  9550. return false;
  9551. } else if (class9.anIntArray245[i] == 4) {
  9552. if (j == k)
  9553. return false;
  9554. } else if (j != k)
  9555. return false;
  9556. }
  9557.  
  9558. return true;
  9559. }
  9560.  
  9561. private DataInputStream openJagGrabInputStream(String s)
  9562. throws IOException {
  9563. // if(!aBoolean872)
  9564. // if(signlink.mainapp != null)
  9565. // return signlink.openurl(s);
  9566. // else
  9567. // return new DataInputStream((new URL(getCodeBase(), s)).openStream());
  9568. if (aSocket832 != null) {
  9569. try {
  9570. aSocket832.close();
  9571. }
  9572. catch (Exception _ex) {
  9573. }
  9574. aSocket832 = null;
  9575. }
  9576. aSocket832 = openSocket(43595);
  9577. aSocket832.setSoTimeout(10000);
  9578. java.io.InputStream inputstream = aSocket832.getInputStream();
  9579. OutputStream outputstream = aSocket832.getOutputStream();
  9580. outputstream.write(("JAGGRAB /" + s + "\n\n").getBytes());
  9581. return new DataInputStream(inputstream);
  9582. }
  9583.  
  9584. private void doFlamesDrawing() {
  9585. char c = '\u0100';
  9586. if (anInt1040 > 0) {
  9587. for (int i = 0; i < 256; i++)
  9588. if (anInt1040 > 768)
  9589. anIntArray850[i] = method83(anIntArray851[i], anIntArray852[i], 1024 - anInt1040);
  9590. else if (anInt1040 > 256)
  9591. anIntArray850[i] = anIntArray852[i];
  9592. else
  9593. anIntArray850[i] = method83(anIntArray852[i], anIntArray851[i], 256 - anInt1040);
  9594.  
  9595. } else if (anInt1041 > 0) {
  9596. for (int j = 0; j < 256; j++)
  9597. if (anInt1041 > 768)
  9598. anIntArray850[j] = method83(anIntArray851[j], anIntArray853[j], 1024 - anInt1041);
  9599. else if (anInt1041 > 256)
  9600. anIntArray850[j] = anIntArray853[j];
  9601. else
  9602. anIntArray850[j] = method83(anIntArray853[j], anIntArray851[j], 256 - anInt1041);
  9603.  
  9604. } else {
  9605. System.arraycopy(anIntArray851, 0, anIntArray850, 0, 256);
  9606.  
  9607. }
  9608. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, aRSImageProducer_1110.canvasRaster, 0, 33920);
  9609.  
  9610. int i1 = 0;
  9611. int j1 = 1152;
  9612. for (int k1 = 1; k1 < c - 1; k1++) {
  9613. int l1 = (anIntArray969[k1] * (c - k1)) / c;
  9614. int j2 = 22 + l1;
  9615. if (j2 < 0)
  9616. j2 = 0;
  9617. i1 += j2;
  9618. for (int l2 = j2; l2 < 128; l2++) {
  9619. int j3 = anIntArray828[i1++];
  9620. if (j3 != 0) {
  9621. int l3 = j3;
  9622. int j4 = 256 - j3;
  9623. j3 = anIntArray850[j3];
  9624. int l4 = aRSImageProducer_1110.canvasRaster[j1];
  9625. aRSImageProducer_1110.canvasRaster[j1++] = ((j3 & 0xff00ff) * l3 + (l4 & 0xff00ff) * j4 & 0xff00ff00) + ((j3 & 0xff00) * l3 + (l4 & 0xff00) * j4 & 0xff0000) >> 8;
  9626. } else {
  9627. j1++;
  9628. }
  9629. }
  9630.  
  9631. j1 += j2;
  9632. }
  9633.  
  9634. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  9635. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, aRSImageProducer_1111.canvasRaster, 0, 33920);
  9636.  
  9637. i1 = 0;
  9638. j1 = 1176;
  9639. for (int k2 = 1; k2 < c - 1; k2++) {
  9640. int i3 = (anIntArray969[k2] * (c - k2)) / c;
  9641. int k3 = 103 - i3;
  9642. j1 += i3;
  9643. for (int i4 = 0; i4 < k3; i4++) {
  9644. int k4 = anIntArray828[i1++];
  9645. if (k4 != 0) {
  9646. int i5 = k4;
  9647. int j5 = 256 - k4;
  9648. k4 = anIntArray850[k4];
  9649. int k5 = aRSImageProducer_1111.canvasRaster[j1];
  9650. aRSImageProducer_1111.canvasRaster[j1++] = ((k4 & 0xff00ff) * i5 + (k5 & 0xff00ff) * j5 & 0xff00ff00) + ((k4 & 0xff00) * i5 + (k5 & 0xff00) * j5 & 0xff0000) >> 8;
  9651. } else {
  9652. j1++;
  9653. }
  9654. }
  9655.  
  9656. i1 += 128 - k3;
  9657. j1 += 128 - k3 - i3;
  9658. }
  9659.  
  9660. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  9661. }
  9662.  
  9663. private void method134(Stream stream) {
  9664. int j = stream.readBits(8);
  9665. if (j < playerCount) {
  9666. for (int k = j; k < playerCount; k++)
  9667. anIntArray840[anInt839++] = playerIndices[k];
  9668.  
  9669. }
  9670. if (j > playerCount) {
  9671. signlink.reporterror(myUsername + " Too many players");
  9672. throw new RuntimeException("eek");
  9673. }
  9674. playerCount = 0;
  9675. for (int l = 0; l < j; l++) {
  9676. int i1 = playerIndices[l];
  9677. Player player = playerArray[i1];
  9678. int j1 = stream.readBits(1);
  9679. if (j1 == 0) {
  9680. playerIndices[playerCount++] = i1;
  9681. player.anInt1537 = loopCycle;
  9682. } else {
  9683. int k1 = stream.readBits(2);
  9684. if (k1 == 0) {
  9685. playerIndices[playerCount++] = i1;
  9686. player.anInt1537 = loopCycle;
  9687. anIntArray894[anInt893++] = i1;
  9688. } else if (k1 == 1) {
  9689. playerIndices[playerCount++] = i1;
  9690. player.anInt1537 = loopCycle;
  9691. int l1 = stream.readBits(3);
  9692. player.moveInDir(false, l1);
  9693. int j2 = stream.readBits(1);
  9694. if (j2 == 1)
  9695. anIntArray894[anInt893++] = i1;
  9696. } else if (k1 == 2) {
  9697. playerIndices[playerCount++] = i1;
  9698. player.anInt1537 = loopCycle;
  9699. int i2 = stream.readBits(3);
  9700. player.moveInDir(true, i2);
  9701. int k2 = stream.readBits(3);
  9702. player.moveInDir(true, k2);
  9703. int l2 = stream.readBits(1);
  9704. if (l2 == 1)
  9705. anIntArray894[anInt893++] = i1;
  9706. } else if (k1 == 3)
  9707. anIntArray840[anInt839++] = i1;
  9708. }
  9709. }
  9710. }
  9711.  
  9712. private void drawLoginScreen(boolean flag) {
  9713. resetImageProducers();
  9714. aRSImageProducer_1109.initDrawingArea();
  9715. drawbutton();
  9716. aBackground_966.method361(0, 0);
  9717. char c = '\u0168';
  9718. char c1 = '\310';
  9719. if (loginScreenState == 0) {
  9720. int i = c1 / 2 + 80;
  9721. smallText.method382(0x75a9a9, c / 2, onDemandFetcher.statusString, i, true);
  9722. i = c1 / 2 - 20;
  9723. chatTextDrawingArea.method382(0xffff00, c / 2, "Welcome to RuneScape", i, true);
  9724. i += 30;
  9725. int l = c / 2 - 80;
  9726. int k1 = c1 / 2 + 20;
  9727. aBackground_967.method361(l - 73, k1 - 20);
  9728. chatTextDrawingArea.method382(0xffffff, l, "New User", k1 + 5, true);
  9729. l = c / 2 + 80;
  9730. aBackground_967.method361(l - 73, k1 - 20);
  9731. chatTextDrawingArea.method382(0xffffff, l, "Existing User", k1 + 5, true);
  9732. }
  9733. if (loginScreenState == 2) {
  9734. int j = c1 / 2 - 40;
  9735. if (loginMessage1.length() > 0) {
  9736. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage1, j - 15, true);
  9737. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2, j, true);
  9738. j += 30;
  9739. } else {
  9740. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2, j - 7, true);
  9741. j += 30;
  9742. }
  9743. chatTextDrawingArea.method389(true, c / 2 - 90, 0xffffff, "Username: " + myUsername + ((loginScreenCursorPos == 0) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  9744. j += 15;
  9745. chatTextDrawingArea.method389(true, c / 2 - 88, 0xffffff, "Password: " + TextClass.passwordAsterisks(myPassword) + ((loginScreenCursorPos == 1) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  9746. j += 15;
  9747. if (!flag) {
  9748. int i1 = c / 2 - 80;
  9749. int l1 = c1 / 2 + 50;
  9750. aBackground_967.method361(i1 - 73, l1 - 20);
  9751. chatTextDrawingArea.method382(0xffffff, i1, "Login", l1 + 5, true);
  9752. i1 = c / 2 + 80;
  9753. aBackground_967.method361(i1 - 73, l1 - 20);
  9754. chatTextDrawingArea.method382(0xffffff, i1, "Cancel", l1 + 5, true);
  9755. }
  9756. }
  9757. if (loginScreenState == 3) {
  9758. stopMidi();
  9759. chatTextDrawingArea.method382(0xffff00, c / 2, "Create a free account", c1 / 2 - 60, true);
  9760. int k = c1 / 2 - 35;
  9761. chatTextDrawingArea.method382(0xffffff, c / 2, "To create a new account you need to", k, true);
  9762. k += 15;
  9763. chatTextDrawingArea.method382(0xffffff, c / 2, "go back to the main RuneScape webpage", k, true);
  9764. k += 15;
  9765. chatTextDrawingArea.method382(0xffffff, c / 2, "and choose the red 'create account'", k, true);
  9766. k += 15;
  9767. chatTextDrawingArea.method382(0xffffff, c / 2, "button at the top right of that page.", k, true);
  9768. k += 15;
  9769. int j1 = c / 2;
  9770. int i2 = c1 / 2 + 50;
  9771. aBackground_967.method361(j1 - 73, i2 - 20);
  9772. chatTextDrawingArea.method382(0xffffff, j1, "Cancel", i2 + 5, true);
  9773. }
  9774. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  9775. if (welcomeScreenRaised) {
  9776. welcomeScreenRaised = false;
  9777. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  9778. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  9779. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  9780. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  9781. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  9782. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  9783. }
  9784. }
  9785.  
  9786. private void drawFlames() {
  9787. drawingFlames = true;
  9788. try {
  9789. long l = System.currentTimeMillis();
  9790. int i = 0;
  9791. int j = 20;
  9792. while (aBoolean831) {
  9793. anInt1208++;
  9794. // calcFlamesPosition();
  9795. // calcFlamesPosition();
  9796. doFlamesDrawing();
  9797. if (++i > 10) {
  9798. long l1 = System.currentTimeMillis();
  9799. int k = (int) (l1 - l) / 10 - j;
  9800. j = 40 - k;
  9801. if (j < 5)
  9802. j = 5;
  9803. i = 0;
  9804. l = l1;
  9805. }
  9806. try {
  9807. Thread.sleep(j);
  9808. }
  9809. catch (Exception _ex) {
  9810. }
  9811. }
  9812. }
  9813. catch (Exception _ex) {
  9814. }
  9815. drawingFlames = false;
  9816. }
  9817.  
  9818. public void raiseWelcomeScreen() {
  9819. welcomeScreenRaised = true;
  9820. }
  9821.  
  9822. private void method137(Stream stream, int j) {
  9823. if (j == 84) {
  9824. int k = stream.readUnsignedByte();
  9825. int j3 = anInt1268 + (k >> 4 & 7);
  9826. int i6 = anInt1269 + (k & 7);
  9827. int l8 = stream.readUnsignedWord();
  9828. int k11 = stream.readUnsignedWord();
  9829. int l13 = stream.readUnsignedWord();
  9830. if (j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104) {
  9831. NodeList class19_1 = groundArray[plane][j3][i6];
  9832. if (class19_1 != null) {
  9833. 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())
  9834. {
  9835. if (class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff) || class30_sub2_sub4_sub2_3.anInt1559 != k11)
  9836. continue;
  9837. class30_sub2_sub4_sub2_3.anInt1559 = l13;
  9838. break;
  9839. }
  9840.  
  9841. spawnGroundItem(j3, i6);
  9842. }
  9843. }
  9844. return;
  9845. }
  9846. if (j == 105) {
  9847. int l = stream.readUnsignedByte();
  9848. int k3 = anInt1268 + (l >> 4 & 7);
  9849. int j6 = anInt1269 + (l & 7);
  9850. int i9 = stream.readUnsignedWord();
  9851. int l11 = stream.readUnsignedByte();
  9852. int i14 = l11 >> 4 & 0xf;
  9853. int i16 = l11 & 7;
  9854. if (myPlayer.smallX[0] >= k3 - i14 && myPlayer.smallX[0] <= k3 + i14 && myPlayer.smallY[0] >= j6 - i14 && myPlayer.smallY[0] <= j6 + i14 && aBoolean848 && !lowMem && currentSound < 50) {
  9855. sound[currentSound] = i9;
  9856. soundType[currentSound] = i16;
  9857. soundDelay[currentSound] = Sounds.anIntArray326[i9];
  9858. currentSound++;
  9859. }
  9860. }
  9861. if (j == 215) {
  9862. int i1 = stream.method435();
  9863. int l3 = stream.method428();
  9864. int k6 = anInt1268 + (l3 >> 4 & 7);
  9865. int j9 = anInt1269 + (l3 & 7);
  9866. int i12 = stream.method435();
  9867. int j14 = stream.readUnsignedWord();
  9868. if (k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104 && i12 != unknownInt10) {
  9869. Item class30_sub2_sub4_sub2_2 = new Item();
  9870. class30_sub2_sub4_sub2_2.ID = i1;
  9871. class30_sub2_sub4_sub2_2.anInt1559 = j14;
  9872. if (groundArray[plane][k6][j9] == null)
  9873. groundArray[plane][k6][j9] = new NodeList();
  9874. groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
  9875. spawnGroundItem(k6, j9);
  9876. }
  9877. return;
  9878. }
  9879. if (j == 156) {
  9880. int j1 = stream.method426();
  9881. int i4 = anInt1268 + (j1 >> 4 & 7);
  9882. int l6 = anInt1269 + (j1 & 7);
  9883. int k9 = stream.readUnsignedWord();
  9884. if (i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104) {
  9885. NodeList class19 = groundArray[plane][i4][l6];
  9886. if (class19 != null) {
  9887. for (Item item = (Item) class19.reverseGetFirst(); item != null; item = (Item) class19.reverseGetNext())
  9888. {
  9889. if (item.ID != (k9 & 0x7fff))
  9890. continue;
  9891. item.unlink();
  9892. break;
  9893. }
  9894.  
  9895. if (class19.reverseGetFirst() == null)
  9896. groundArray[plane][i4][l6] = null;
  9897. spawnGroundItem(i4, l6);
  9898. }
  9899. }
  9900. return;
  9901. }
  9902. if (j == 160) {
  9903. int k1 = stream.method428();
  9904. int j4 = anInt1268 + (k1 >> 4 & 7);
  9905. int i7 = anInt1269 + (k1 & 7);
  9906. int l9 = stream.method428();
  9907. int j12 = l9 >> 2;
  9908. int k14 = l9 & 3;
  9909. int j16 = anIntArray1177[j12];
  9910. int j17 = stream.method435();
  9911. if (j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103) {
  9912. int j18 = intGroundArray[plane][j4][i7];
  9913. int i19 = intGroundArray[plane][j4 + 1][i7];
  9914. int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
  9915. int k20 = intGroundArray[plane][j4][i7 + 1];
  9916. if (j16 == 0) {
  9917. Object1 class10 = worldController.method296(plane, j4, i7);
  9918. if (class10 != null) {
  9919. int k21 = class10.uid >> 14 & 0x7fff;
  9920. if (j12 == 2) {
  9921. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, 4 + k14, 2, i19, l19, j18, k20, j17, false);
  9922. class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(k21, k14 + 1 & 3, 2, i19, l19, j18, k20, j17, false);
  9923. } else {
  9924. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, k14, j12, i19, l19, j18, k20, j17, false);
  9925. }
  9926. }
  9927. }
  9928. if (j16 == 1) {
  9929. Object2 class26 = worldController.method297(j4, i7, plane);
  9930. if (class26 != null)
  9931. class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(class26.uid >> 14 & 0x7fff, 0, 4, i19, l19, j18, k20, j17, false);
  9932. }
  9933. if (j16 == 2) {
  9934. Object5 class28 = worldController.method298(j4, i7, plane);
  9935. if (j12 == 11)
  9936. j12 = 10;
  9937. if (class28 != null)
  9938. class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(class28.uid >> 14 & 0x7fff, k14, j12, i19, l19, j18, k20, j17, false);
  9939. }
  9940. if (j16 == 3) {
  9941. Object3 class49 = worldController.method299(i7, j4, plane);
  9942. if (class49 != null)
  9943. class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(class49.uid >> 14 & 0x7fff, k14, 22, i19, l19, j18, k20, j17, false);
  9944. }
  9945. }
  9946. return;
  9947. }
  9948. if (j == 147) {
  9949. int l1 = stream.method428();
  9950. int k4 = anInt1268 + (l1 >> 4 & 7);
  9951. int j7 = anInt1269 + (l1 & 7);
  9952. int i10 = stream.readUnsignedWord();
  9953. byte byte0 = stream.method430();
  9954. int l14 = stream.method434();
  9955. byte byte1 = stream.method429();
  9956. int k17 = stream.readUnsignedWord();
  9957. int k18 = stream.method428();
  9958. int j19 = k18 >> 2;
  9959. int i20 = k18 & 3;
  9960. int l20 = anIntArray1177[j19];
  9961. byte byte2 = stream.readSignedByte();
  9962. int l21 = stream.readUnsignedWord();
  9963. byte byte3 = stream.method429();
  9964. Player player;
  9965. if (i10 == unknownInt10)
  9966. player = myPlayer;
  9967. else
  9968. player = playerArray[i10];
  9969. if (player != null) {
  9970. ObjectDef class46 = ObjectDef.forID(l21);
  9971. int i22 = intGroundArray[plane][k4][j7];
  9972. int j22 = intGroundArray[plane][k4 + 1][j7];
  9973. int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
  9974. int l22 = intGroundArray[plane][k4][j7 + 1];
  9975. Model model = class46.generateModel(j19, i20, i22, j22, k22, l22, -1, -1, -1, -1);
  9976. if (model != null) {
  9977. method130(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
  9978. player.anInt1707 = l14 + loopCycle;
  9979. player.anInt1708 = k17 + loopCycle;
  9980. player.aModel_1714 = model;
  9981. int i23 = class46.anInt744;
  9982. int j23 = class46.anInt761;
  9983. if (i20 == 1 || i20 == 3) {
  9984. i23 = class46.anInt761;
  9985. j23 = class46.anInt744;
  9986. }
  9987. player.anInt1711 = k4 * 128 + i23 * 64;
  9988. player.anInt1713 = j7 * 128 + j23 * 64;
  9989. player.anInt1712 = method42(plane, player.anInt1713, player.anInt1711);
  9990. if (byte2 > byte0) {
  9991. byte byte4 = byte2;
  9992. byte2 = byte0;
  9993. byte0 = byte4;
  9994. }
  9995. if (byte3 > byte1) {
  9996. byte byte5 = byte3;
  9997. byte3 = byte1;
  9998. byte1 = byte5;
  9999. }
  10000. player.anInt1719 = k4 + byte2;
  10001. player.anInt1721 = k4 + byte0;
  10002. player.anInt1720 = j7 + byte3;
  10003. player.anInt1722 = j7 + byte1;
  10004. }
  10005. }
  10006. }
  10007. if (j == 151) {
  10008. int i2 = stream.method426();
  10009. int l4 = anInt1268 + (i2 >> 4 & 7);
  10010. int k7 = anInt1269 + (i2 & 7);
  10011. int j10 = stream.method434();
  10012. int k12 = stream.method428();
  10013. int i15 = k12 >> 2;
  10014. int k16 = k12 & 3;
  10015. int l17 = anIntArray1177[i15];
  10016. if (l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104)
  10017. method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
  10018. return;
  10019. }
  10020. if (j == 4) {
  10021. int j2 = stream.readUnsignedByte();
  10022. int i5 = anInt1268 + (j2 >> 4 & 7);
  10023. int l7 = anInt1269 + (j2 & 7);
  10024. int k10 = stream.readUnsignedWord();
  10025. int l12 = stream.readUnsignedByte();
  10026. int j15 = stream.readUnsignedWord();
  10027. if (i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104) {
  10028. i5 = i5 * 128 + 64;
  10029. l7 = l7 * 128 + 64;
  10030. Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane, loopCycle, j15, k10, method42(plane, l7, i5) - l12, l7, i5);
  10031. aClass19_1056.insertHead(class30_sub2_sub4_sub3);
  10032. }
  10033. return;
  10034. }
  10035. if (j == 44) {
  10036. int k2 = stream.method436();
  10037. int j5 = stream.readUnsignedWord();
  10038. int i8 = stream.readUnsignedByte();
  10039. int l10 = anInt1268 + (i8 >> 4 & 7);
  10040. int i13 = anInt1269 + (i8 & 7);
  10041. if (l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104) {
  10042. Item class30_sub2_sub4_sub2_1 = new Item();
  10043. class30_sub2_sub4_sub2_1.ID = k2;
  10044. class30_sub2_sub4_sub2_1.anInt1559 = j5;
  10045. if (groundArray[plane][l10][i13] == null)
  10046. groundArray[plane][l10][i13] = new NodeList();
  10047. groundArray[plane][l10][i13].insertHead(class30_sub2_sub4_sub2_1);
  10048. spawnGroundItem(l10, i13);
  10049. }
  10050. return;
  10051. }
  10052. if (j == 101) {
  10053. int l2 = stream.method427();
  10054. int k5 = l2 >> 2;
  10055. int j8 = l2 & 3;
  10056. int i11 = anIntArray1177[k5];
  10057. int j13 = stream.readUnsignedByte();
  10058. int k15 = anInt1268 + (j13 >> 4 & 7);
  10059. int l16 = anInt1269 + (j13 & 7);
  10060. if (k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
  10061. method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
  10062. return;
  10063. }
  10064. if (j == 117) {
  10065. int i3 = stream.readUnsignedByte();
  10066. int l5 = anInt1268 + (i3 >> 4 & 7);
  10067. int k8 = anInt1269 + (i3 & 7);
  10068. int j11 = l5 + stream.readSignedByte();
  10069. int k13 = k8 + stream.readSignedByte();
  10070. int l15 = stream.readSignedWord();
  10071. int i17 = stream.readUnsignedWord();
  10072. int i18 = stream.readUnsignedByte() * 4;
  10073. int l18 = stream.readUnsignedByte() * 4;
  10074. int k19 = stream.readUnsignedWord();
  10075. int j20 = stream.readUnsignedWord();
  10076. int i21 = stream.readUnsignedByte();
  10077. int j21 = stream.readUnsignedByte();
  10078. if (l5 >= 0 && k8 >= 0 && l5 < 104 && k8 < 104 && j11 >= 0 && k13 >= 0 && j11 < 104 && k13 < 104 && i17 != 65535) {
  10079. l5 = l5 * 128 + 64;
  10080. k8 = k8 * 128 + 64;
  10081. j11 = j11 * 128 + 64;
  10082. k13 = k13 * 128 + 64;
  10083. 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);
  10084. class30_sub2_sub4_sub4.method455(k19 + loopCycle, k13, method42(plane, k13, j11) - l18, j11);
  10085. aClass19_1013.insertHead(class30_sub2_sub4_sub4);
  10086. }
  10087. }
  10088. }
  10089.  
  10090. private static void setLowMem() {
  10091. WorldController.lowMem = true;
  10092. Texture.lowMem = true;
  10093. lowMem = true;
  10094. ObjectManager.lowMem = true;
  10095. ObjectDef.lowMem = true;
  10096. }
  10097.  
  10098. private void method139(Stream stream) {
  10099. stream.initBitAccess();
  10100. int k = stream.readBits(8);
  10101. if (k < npcCount) {
  10102. for (int l = k; l < npcCount; l++)
  10103. anIntArray840[anInt839++] = npcIndices[l];
  10104.  
  10105. }
  10106. if (k > npcCount) {
  10107. signlink.reporterror(myUsername + " Too many npcs");
  10108. throw new RuntimeException("eek");
  10109. }
  10110. npcCount = 0;
  10111. for (int i1 = 0; i1 < k; i1++) {
  10112. int j1 = npcIndices[i1];
  10113. NPC npc = npcArray[j1];
  10114. int k1 = stream.readBits(1);
  10115. if (k1 == 0) {
  10116. npcIndices[npcCount++] = j1;
  10117. npc.anInt1537 = loopCycle;
  10118. } else {
  10119. int l1 = stream.readBits(2);
  10120. if (l1 == 0) {
  10121. npcIndices[npcCount++] = j1;
  10122. npc.anInt1537 = loopCycle;
  10123. anIntArray894[anInt893++] = j1;
  10124. } else if (l1 == 1) {
  10125. npcIndices[npcCount++] = j1;
  10126. npc.anInt1537 = loopCycle;
  10127. int i2 = stream.readBits(3);
  10128. npc.moveInDir(false, i2);
  10129. int k2 = stream.readBits(1);
  10130. if (k2 == 1)
  10131. anIntArray894[anInt893++] = j1;
  10132. } else if (l1 == 2) {
  10133. npcIndices[npcCount++] = j1;
  10134. npc.anInt1537 = loopCycle;
  10135. int j2 = stream.readBits(3);
  10136. npc.moveInDir(true, j2);
  10137. int l2 = stream.readBits(3);
  10138. npc.moveInDir(true, l2);
  10139. int i3 = stream.readBits(1);
  10140. if (i3 == 1)
  10141. anIntArray894[anInt893++] = j1;
  10142. } else if (l1 == 3)
  10143. anIntArray840[anInt839++] = j1;
  10144. }
  10145. }
  10146.  
  10147. }
  10148.  
  10149. private void processLoginScreenInput() {
  10150. if (loginScreenState == 0) {
  10151. int i = super.myWidth / 2 - 80;
  10152. int l = super.myHeight / 2 + 20;
  10153. l += 20;
  10154. if (super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20) {
  10155. loginScreenState = 3;
  10156. loginScreenCursorPos = 0;
  10157. }
  10158. i = super.myWidth / 2 + 80;
  10159. if (super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20) {
  10160. loginMessage1 = "";
  10161. loginMessage2 = "Enter your username & password.";
  10162. loginScreenState = 2;
  10163. loginScreenCursorPos = 0;
  10164. }
  10165. } else {
  10166. if (loginScreenState == 2) {
  10167. int j = super.myHeight / 2 - 40;
  10168. j += 30;
  10169. j += 25;
  10170. if (super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  10171. loginScreenCursorPos = 0;
  10172. j += 15;
  10173. if (super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  10174. loginScreenCursorPos = 1;
  10175. j += 15;
  10176. int i1 = super.myWidth / 2 - 80;
  10177. int k1 = super.myHeight / 2 + 50;
  10178. k1 += 20;
  10179. if (super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20) {
  10180. loginFailures = 0;
  10181. login(myUsername, myPassword, false);
  10182. if (loggedIn)
  10183. return;
  10184. }
  10185. i1 = super.myWidth / 2 + 80;
  10186. if (super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20) {
  10187. loginScreenState = 0;
  10188. // myUsername = "";
  10189. // myPassword = "";
  10190. }
  10191. do {
  10192. int l1 = readChar(-796);
  10193. if (l1 == -1)
  10194. break;
  10195. boolean flag1 = false;
  10196. for (int i2 = 0; i2 < validUserPassChars.length(); i2++) {
  10197. if (l1 != validUserPassChars.charAt(i2))
  10198. continue;
  10199. flag1 = true;
  10200. break;
  10201. }
  10202.  
  10203. if (loginScreenCursorPos == 0) {
  10204. if (l1 == 8 && myUsername.length() > 0)
  10205. myUsername = myUsername.substring(0, myUsername.length() - 1);
  10206. if (l1 == 9 || l1 == 10 || l1 == 13)
  10207. loginScreenCursorPos = 1;
  10208. if (flag1)
  10209. myUsername += (char) l1;
  10210. if (myUsername.length() > 12)
  10211. myUsername = myUsername.substring(0, 12);
  10212. } else if (loginScreenCursorPos == 1) {
  10213. if (l1 == 8 && myPassword.length() > 0)
  10214. myPassword = myPassword.substring(0, myPassword.length() - 1);
  10215. if (l1 == 9 || l1 == 10 || l1 == 13)
  10216. loginScreenCursorPos = 0;
  10217. if (flag1)
  10218. myPassword += (char) l1;
  10219. if (myPassword.length() > 20)
  10220. myPassword = myPassword.substring(0, 20);
  10221. }
  10222. } while (true);
  10223. return;
  10224. }
  10225. if (loginScreenState == 3) {
  10226. int k = super.myWidth / 2;
  10227. int j1 = super.myHeight / 2 + 50;
  10228. j1 += 20;
  10229. if (super.clickMode3 == 1 && super.saveClickX >= k - 75 && super.saveClickX <= k + 75 && super.saveClickY >= j1 - 20 && super.saveClickY <= j1 + 20)
  10230. loginScreenState = 0;
  10231. }
  10232. }
  10233. }
  10234.  
  10235. private void markMinimap(Sprite sprite, int x, int y) {
  10236. if (sprite == null) {
  10237. return;
  10238. }
  10239. int k = viewRotation + viewRotationOffset & 0x7ff;
  10240. int l = x * x + y * y;
  10241. if (l > 6400) {
  10242. return;
  10243. }
  10244. int i1 = Model.modelIntArray1[k];
  10245. int j1 = Model.modelIntArray2[k];
  10246. i1 = (i1 * 256) / (minimapZoom + 256);
  10247. j1 = (j1 * 256) / (minimapZoom + 256);
  10248. int k1 = y * i1 + x * j1 >> 16;
  10249. int l1 = y * j1 - x * i1 >> 16;
  10250. if (frameMode == ScreenMode.FIXED) {
  10251. sprite.drawSprite(((99 + k1) - sprite.anInt1444 / 2) + 4 + 30, 82 - l1 - sprite.anInt1445 / 2 - 4 + 5);
  10252. } else {
  10253. sprite.drawSprite(((77 + k1) - sprite.anInt1444 / 2) + 4 + (frameWidth - 189), 88 - l1 - sprite.anInt1445 / 2);
  10254. }
  10255. }
  10256.  
  10257. /*public void markMinimap(Sprite sprite, int i, int j) {
  10258. int k = viewRotation + viewRotationOffset & 0x7ff;
  10259. int l = i * i + j * j;
  10260. if(l > 6400)
  10261. return;
  10262. int i1 = Model.modelIntArray1[k];
  10263. int j1 = Model.modelIntArray2[k];
  10264. i1 = (i1 * 256) / (minimapZoom + 256);
  10265. j1 = (j1 * 256) / (minimapZoom + 256);
  10266. int k1 = j * i1 + i * j1 >> 16;
  10267. int l1 = j * j1 - i * i1 >> 16;
  10268. if (frameMode == ScreenMode.FIXED) {
  10269. if(l > 2500) {
  10270. if(sprite == null)
  10271. return;
  10272. sprite.drawSprite(((99 + k1) - sprite.anInt1444 / 2) + 4 + 30, 82 - l1 - sprite.anInt1445 / 2 - 4 + 5);
  10273. } else {
  10274. if(sprite == null)
  10275. return;
  10276. sprite.drawSprite(((99 + k1) - sprite.anInt1444 / 2) + 4 + 30, 82 - l1 - sprite.anInt1445 / 2 - 4 + 5);
  10277. }
  10278. } else {
  10279. sprite.drawSprite(((77 + k1) - sprite.anInt1444 / 2) + 4 + (frameWidth - 167), 85 - l1 - sprite.anInt1445 / 2 - 4);
  10280. }
  10281. }*/
  10282.  
  10283.  
  10284.  
  10285.  
  10286.  
  10287.  
  10288. private void method142(int i, int j, int k, int l, int i1, int j1, int k1
  10289. ) {
  10290. if (i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102) {
  10291. if (lowMem && j != plane)
  10292. return;
  10293. int i2 = 0;
  10294. if (j1 == 0)
  10295. i2 = worldController.method300(j, i1, i);
  10296. if (j1 == 1)
  10297. i2 = worldController.method301(j, i1, i);
  10298. if (j1 == 2)
  10299. i2 = worldController.method302(j, i1, i);
  10300. if (j1 == 3)
  10301. i2 = worldController.method303(j, i1, i);
  10302. if (i2 != 0) {
  10303. int i3 = worldController.method304(j, i1, i, i2);
  10304. int j2 = i2 >> 14 & 0x7fff;
  10305. int k2 = i3 & 0x1f;
  10306. int l2 = i3 >> 6;
  10307. if (j1 == 0) {
  10308. worldController.method291(i1, j, i, (byte) -119);
  10309. ObjectDef class46 = ObjectDef.forID(j2);
  10310. if (class46.aBoolean767)
  10311. aClass11Array1230[j].method215(l2, k2, class46.aBoolean757, i1, i);
  10312. }
  10313. if (j1 == 1)
  10314. worldController.method292(i, j, i1);
  10315. if (j1 == 2) {
  10316. worldController.method293(j, i1, i);
  10317. ObjectDef class46_1 = ObjectDef.forID(j2);
  10318. if (i1 + class46_1.anInt744 > 103 || i + class46_1.anInt744 > 103 || i1 + class46_1.anInt761 > 103 || i + class46_1.anInt761 > 103)
  10319. return;
  10320. if (class46_1.aBoolean767)
  10321. aClass11Array1230[j].method216(l2, class46_1.anInt744, i1, i, class46_1.anInt761, class46_1.aBoolean757);
  10322. }
  10323. if (j1 == 3) {
  10324. worldController.method294(j, i, i1);
  10325. ObjectDef class46_2 = ObjectDef.forID(j2);
  10326. if (class46_2.aBoolean767 && class46_2.hasActions)
  10327. aClass11Array1230[j].method218(i, i1);
  10328. }
  10329. }
  10330. if (k1 >= 0) {
  10331. int j3 = j;
  10332. if (j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
  10333. j3++;
  10334. ObjectManager.method188(worldController, k, i, l, j3, aClass11Array1230[j], intGroundArray, i1, k1, j);
  10335. }
  10336. }
  10337. }
  10338.  
  10339. private void updatePlayers(int i, Stream stream) {
  10340. anInt839 = 0;
  10341. anInt893 = 0;
  10342. method117(stream);
  10343. method134(stream);
  10344. method91(stream, i);
  10345. method49(stream);
  10346. for (int k = 0; k < anInt839; k++) {
  10347. int l = anIntArray840[k];
  10348. if (playerArray[l].anInt1537 != loopCycle)
  10349. playerArray[l] = null;
  10350. }
  10351.  
  10352. if (stream.currentOffset != i) {
  10353. signlink.reporterror("Error packet size mismatch in getplayer pos:" + stream.currentOffset + " psize:" + i);
  10354. throw new RuntimeException("eek");
  10355. }
  10356. for (int i1 = 0; i1 < playerCount; i1++)
  10357. if (playerArray[playerIndices[i1]] == null) {
  10358. signlink.reporterror(myUsername + " null entry in pl list - pos:" + i1 + " size:" + playerCount);
  10359. throw new RuntimeException("eek");
  10360. }
  10361.  
  10362. }
  10363.  
  10364. private void setCameraPos(int j, int k, int l, int i1, int j1, int k1) {
  10365. int l1 = 2048 - k & 0x7ff;
  10366. int i2 = 2048 - j1 & 0x7ff;
  10367. int j2 = 0;
  10368. int k2 = 0;
  10369. int l2 = j;
  10370. if (l1 != 0) {
  10371. int i3 = Model.modelIntArray1[l1];
  10372. int k3 = Model.modelIntArray2[l1];
  10373. int i4 = k2 * k3 - l2 * i3 >> 16;
  10374. l2 = k2 * i3 + l2 * k3 >> 16;
  10375. k2 = i4;
  10376. }
  10377. if (i2 != 0) {
  10378. /* xxx if(cameratoggle){
  10379. if(zoom == 0)
  10380. zoom = k2;
  10381. if(lftrit == 0)
  10382. lftrit = j2;
  10383. if(fwdbwd == 0)
  10384. fwdbwd = l2;
  10385. k2 = zoom;
  10386. j2 = lftrit;
  10387. l2 = fwdbwd;
  10388. }
  10389. */
  10390. int j3 = Model.modelIntArray1[i2];
  10391. int l3 = Model.modelIntArray2[i2];
  10392. int j4 = l2 * j3 + j2 * l3 >> 16;
  10393. l2 = l2 * l3 - j2 * j3 >> 16;
  10394. j2 = j4;
  10395. }
  10396. xCameraPos = l - j2;
  10397. zCameraPos = i1 - k2;
  10398. yCameraPos = k1 - l2;
  10399. yCameraCurve = k;
  10400. xCameraCurve = j1;
  10401. }
  10402.  
  10403. private boolean parsePacket() {
  10404. if (socketStream == null)
  10405. return false;
  10406. try {
  10407. int i = socketStream.available();
  10408. if (i == 0)
  10409. return false;
  10410. if (pktType == -1) {
  10411. socketStream.flushInputStream(inStream.buffer, 1);
  10412. pktType = inStream.buffer[0] & 0xff;
  10413. if (encryption != null)
  10414. pktType = pktType - encryption.getNextKey() & 0xff;
  10415. pktSize = SizeConstants.packetSizes[pktType];
  10416. i--;
  10417. }
  10418. if (pktSize == -1)
  10419. if (i > 0) {
  10420. socketStream.flushInputStream(inStream.buffer, 1);
  10421. pktSize = inStream.buffer[0] & 0xff;
  10422. i--;
  10423. } else {
  10424. return false;
  10425. }
  10426. if (pktSize == -2)
  10427. if (i > 1) {
  10428. socketStream.flushInputStream(inStream.buffer, 2);
  10429. inStream.currentOffset = 0;
  10430. pktSize = inStream.readUnsignedWord();
  10431. i -= 2;
  10432. } else {
  10433. return false;
  10434. }
  10435. if (i < pktSize)
  10436. return false;
  10437. inStream.currentOffset = 0;
  10438. socketStream.flushInputStream(inStream.buffer, pktSize);
  10439. anInt1009 = 0;
  10440. anInt843 = anInt842;
  10441. anInt842 = anInt841;
  10442. anInt841 = pktType;
  10443. if (pktType == 81) {
  10444. updatePlayers(pktSize, inStream);
  10445. aBoolean1080 = false;
  10446. pktType = -1;
  10447. return true;
  10448. }
  10449. if (pktType == 176) {
  10450. daysSinceRecovChange = inStream.method427();
  10451. unreadMessages = inStream.method435();
  10452. membersInt = inStream.readUnsignedByte();
  10453. anInt1193 = inStream.method440();
  10454. daysSinceLastLogin = inStream.readUnsignedWord();
  10455. if (anInt1193 != 0 && openInterfaceID == -1) {
  10456. signlink.dnslookup(TextClass.method586(anInt1193));
  10457. clearTopInterfaces();
  10458. char c = '\u028A';
  10459. if (daysSinceRecovChange != 201 || membersInt == 1)
  10460. c = '\u028F';
  10461. reportAbuseInput = "";
  10462. canMute = false;
  10463. for (int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
  10464. if (RSInterface.interfaceCache[k9] == null || RSInterface.interfaceCache[k9].contentType != c)
  10465. continue;
  10466. openInterfaceID = RSInterface.interfaceCache[k9].parentID;
  10467. break;
  10468. }
  10469.  
  10470. }
  10471. pktType = -1;
  10472. return true;
  10473. }
  10474. if (pktType == 64) {
  10475. anInt1268 = inStream.method427();
  10476. anInt1269 = inStream.method428();
  10477. for (int j = anInt1268; j < anInt1268 + 8; j++) {
  10478. for (int l9 = anInt1269; l9 < anInt1269 + 8; l9++)
  10479. if (groundArray[plane][j][l9] != null) {
  10480. groundArray[plane][j][l9] = null;
  10481. spawnGroundItem(j, l9);
  10482. }
  10483.  
  10484. }
  10485.  
  10486. for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179.reverseGetNext())
  10487. if (class30_sub1.anInt1297 >= anInt1268 && class30_sub1.anInt1297 < anInt1268 + 8 && class30_sub1.anInt1298 >= anInt1269 && class30_sub1.anInt1298 < anInt1269 + 8 && class30_sub1.anInt1295 == plane)
  10488. class30_sub1.anInt1294 = 0;
  10489.  
  10490. pktType = -1;
  10491. return true;
  10492. }
  10493. if (pktType == 185) {
  10494. int k = inStream.method436();
  10495. RSInterface.interfaceCache[k].anInt233 = 3;
  10496. if (myPlayer.desc == null)
  10497. 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];
  10498. else
  10499. RSInterface.interfaceCache[k].mediaID = (int) (0x12345678L + myPlayer.desc.type);
  10500. pktType = -1;
  10501. return true;
  10502. }
  10503. if (pktType == 107) {
  10504. aBoolean1160 = false;
  10505. for (int l = 0; l < 5; l++)
  10506. aBooleanArray876[l] = false;
  10507.  
  10508. pktType = -1;
  10509. return true;
  10510. }
  10511. if (pktType == 72) {
  10512. int i1 = inStream.method434();
  10513. RSInterface class9 = RSInterface.interfaceCache[i1];
  10514. for (int k15 = 0; k15 < class9.inv.length; k15++) {
  10515. class9.inv[k15] = -1;
  10516. class9.inv[k15] = 0;
  10517. }
  10518.  
  10519. pktType = -1;
  10520. return true;
  10521. }
  10522. if (pktType == 214) {
  10523. ignoreCount = pktSize / 8;
  10524. for (int j1 = 0; j1 < ignoreCount; j1++)
  10525. ignoreListAsLongs[j1] = inStream.readQWord();
  10526.  
  10527. pktType = -1;
  10528. return true;
  10529. }
  10530. if (pktType == 166) {
  10531. aBoolean1160 = true;
  10532. anInt1098 = inStream.readUnsignedByte();
  10533. anInt1099 = inStream.readUnsignedByte();
  10534. anInt1100 = inStream.readUnsignedWord();
  10535. anInt1101 = inStream.readUnsignedByte();
  10536. anInt1102 = inStream.readUnsignedByte();
  10537. if (anInt1102 >= 100) {
  10538. xCameraPos = anInt1098 * 128 + 64;
  10539. yCameraPos = anInt1099 * 128 + 64;
  10540. zCameraPos = method42(plane, yCameraPos, xCameraPos) - anInt1100;
  10541. }
  10542. pktType = -1;
  10543. return true;
  10544. }
  10545. if (pktType == 134) {
  10546. needDrawTabArea = true;
  10547. int k1 = inStream.readUnsignedByte();
  10548. int i10 = inStream.method439();
  10549. int l15 = inStream.readUnsignedByte();
  10550. int xp = currentExp[k1];
  10551. currentExp[k1] = i10;
  10552. currentStats[k1] = l15;
  10553. maxStats[k1] = 1;
  10554. xpCounter += currentExp[k1] - xp;
  10555. expAdded = currentExp[k1] - xp;
  10556. for (int k20 = 0; k20 < 98; k20++)
  10557. if (i10 >= anIntArray1019[k20])
  10558. maxStats[k1] = k20 + 2;
  10559.  
  10560. pktType = -1;
  10561. return true;
  10562. }
  10563. if (pktType == 71) {
  10564. int l1 = inStream.readUnsignedWord();
  10565. int j10 = inStream.method426();
  10566. if (l1 == 65535)
  10567. l1 = -1;
  10568. tabInterfaceIDs[j10] = l1;
  10569. needDrawTabArea = true;
  10570. tabAreaAltered = true;
  10571. pktType = -1;
  10572. return true;
  10573. }
  10574. if (pktType == 123) {
  10575. pktType = -1;
  10576. return true;
  10577. }
  10578. if (pktType == 74) {
  10579. int songID = inStream.method434();
  10580. if (songID == 65535) {
  10581. songID = -1;
  10582. }
  10583. if (songID != currentSong && prevSong == 0) {
  10584. nextSong = songID;
  10585. songChanging = true;
  10586. onDemandFetcher.method558(2, nextSong);
  10587. }
  10588. currentSong = songID ;
  10589. pktType = -1;
  10590. return true;
  10591. }
  10592. if (pktType == 121) {
  10593. int songId = inStream.method436();
  10594. int songDelay = inStream.method435();
  10595. if (musicEnabled && !lowMem) {
  10596. nextSong = songId;
  10597. songChanging = false;
  10598. onDemandFetcher.method558(2, nextSong);
  10599. prevSong = songDelay;
  10600. }
  10601. pktType = -1;
  10602. return true;
  10603. }
  10604. if (pktType == 109) {
  10605. resetLogout();
  10606. pktType = -1;
  10607. return false;
  10608. }
  10609. if (pktType == 70) {
  10610. int k2 = inStream.readSignedWord();
  10611. int l10 = inStream.method437();
  10612. int i16 = inStream.method434();
  10613. RSInterface class9_5 = RSInterface.interfaceCache[i16];
  10614. class9_5.anInt263 = k2;
  10615. class9_5.anInt265 = l10;
  10616. pktType = -1;
  10617. return true;
  10618. }
  10619. if (pktType == 73 || pktType == 241) {
  10620.  
  10621. //mapReset();
  10622. int l2 = anInt1069;
  10623. int i11 = anInt1070;
  10624. if (pktType == 73) {
  10625. l2 = inStream.method435();
  10626. i11 = inStream.readUnsignedWord();
  10627. aBoolean1159 = false;
  10628. }
  10629. if (pktType == 241) {
  10630. i11 = inStream.method435();
  10631. inStream.initBitAccess();
  10632. for (int j16 = 0; j16 < 4; j16++) {
  10633. for (int l20 = 0; l20 < 13; l20++) {
  10634. for (int j23 = 0; j23 < 13; j23++) {
  10635. int i26 = inStream.readBits(1);
  10636. if (i26 == 1)
  10637. anIntArrayArrayArray1129[j16][l20][j23] = inStream.readBits(26);
  10638. else
  10639. anIntArrayArrayArray1129[j16][l20][j23] = -1;
  10640. }
  10641.  
  10642. }
  10643.  
  10644. }
  10645.  
  10646. inStream.finishBitAccess();
  10647. l2 = inStream.readUnsignedWord();
  10648. aBoolean1159 = true;
  10649. }
  10650. if (anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2) {
  10651. pktType = -1;
  10652. return true;
  10653. }
  10654. anInt1069 = l2;
  10655. anInt1070 = i11;
  10656. baseX = (anInt1069 - 6) * 8;
  10657. baseY = (anInt1070 - 6) * 8;
  10658. aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49) && anInt1070 / 8 == 48;
  10659. if (anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
  10660. aBoolean1141 = true;
  10661. loadingStage = 1;
  10662. aLong824 = System.currentTimeMillis();
  10663. aRSImageProducer_1165.initDrawingArea();
  10664. regularText.drawText(0, "Loading - please wait.", 151, 257);
  10665. regularText.drawText(0xffffff, "Loading - please wait.", 150, 256);
  10666. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  10667. if (pktType == 73) {
  10668. int k16 = 0;
  10669. for (int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++) {
  10670. for (int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
  10671. k16++;
  10672.  
  10673. }
  10674.  
  10675. aByteArrayArray1183 = new byte[k16][];
  10676. aByteArrayArray1247 = new byte[k16][];
  10677. anIntArray1234 = new int[k16];
  10678. anIntArray1235 = new int[k16];
  10679. anIntArray1236 = new int[k16];
  10680. k16 = 0;
  10681. for (int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++) {
  10682. for (int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++) {
  10683. anIntArray1234[k16] = (l23 << 8) + j26;
  10684. if (aBoolean1141 && (j26 == 49 || j26 == 149 || j26 == 147 || l23 == 50 || l23 == 49 && j26 == 47)) {
  10685. anIntArray1235[k16] = -1;
  10686. anIntArray1236[k16] = -1;
  10687. k16++;
  10688. } else {
  10689. int k28 = anIntArray1235[k16] = onDemandFetcher.method562(0, j26, l23);
  10690. if (k28 != -1)
  10691. onDemandFetcher.method558(3, k28);
  10692. int j30 = anIntArray1236[k16] = onDemandFetcher.method562(1, j26, l23);
  10693. if (j30 != -1)
  10694. onDemandFetcher.method558(3, j30);
  10695. k16++;
  10696. }
  10697. }
  10698.  
  10699. }
  10700.  
  10701. }
  10702. if (pktType == 241) {
  10703. int l16 = 0;
  10704. int ai[] = new int[676];
  10705. for (int i24 = 0; i24 < 4; i24++) {
  10706. for (int k26 = 0; k26 < 13; k26++) {
  10707. for (int l28 = 0; l28 < 13; l28++) {
  10708. int k30 = anIntArrayArrayArray1129[i24][k26][l28];
  10709. if (k30 != -1) {
  10710. int k31 = k30 >> 14 & 0x3ff;
  10711. int i32 = k30 >> 3 & 0x7ff;
  10712. int k32 = (k31 / 8 << 8) + i32 / 8;
  10713. for (int j33 = 0; j33 < l16; j33++) {
  10714. if (ai[j33] != k32)
  10715. continue;
  10716. k32 = -1;
  10717. break;
  10718. }
  10719.  
  10720. if (k32 != -1)
  10721. ai[l16++] = k32;
  10722. }
  10723. }
  10724.  
  10725. }
  10726.  
  10727. }
  10728.  
  10729. aByteArrayArray1183 = new byte[l16][];
  10730. aByteArrayArray1247 = new byte[l16][];
  10731. anIntArray1234 = new int[l16];
  10732. anIntArray1235 = new int[l16];
  10733. anIntArray1236 = new int[l16];
  10734. for (int l26 = 0; l26 < l16; l26++) {
  10735. int i29 = anIntArray1234[l26] = ai[l26];
  10736. int l30 = i29 >> 8 & 0xff;
  10737. int l31 = i29 & 0xff;
  10738. int j32 = anIntArray1235[l26] = onDemandFetcher.method562(0, l31, l30);
  10739. if (j32 != -1)
  10740. onDemandFetcher.method558(3, j32);
  10741. int i33 = anIntArray1236[l26] = onDemandFetcher.method562(1, l31, l30);
  10742. if (i33 != -1)
  10743. onDemandFetcher.method558(3, i33);
  10744. }
  10745.  
  10746. }
  10747. int i17 = baseX - anInt1036;
  10748. int j21 = baseY - anInt1037;
  10749. anInt1036 = baseX;
  10750. anInt1037 = baseY;
  10751. for (int j24 = 0; j24 < 16384; j24++) {
  10752. NPC npc = npcArray[j24];
  10753. if (npc != null) {
  10754. for (int j29 = 0; j29 < 10; j29++) {
  10755. npc.smallX[j29] -= i17;
  10756. npc.smallY[j29] -= j21;
  10757. }
  10758.  
  10759. npc.x -= i17 * 128;
  10760. npc.y -= j21 * 128;
  10761. }
  10762. }
  10763.  
  10764. for (int i27 = 0; i27 < maxPlayers; i27++) {
  10765. Player player = playerArray[i27];
  10766. if (player != null) {
  10767. for (int i31 = 0; i31 < 10; i31++) {
  10768. player.smallX[i31] -= i17;
  10769. player.smallY[i31] -= j21;
  10770. }
  10771.  
  10772. player.x -= i17 * 128;
  10773. player.y -= j21 * 128;
  10774. }
  10775. }
  10776.  
  10777. aBoolean1080 = true;
  10778. byte byte1 = 0;
  10779. byte byte2 = 104;
  10780. byte byte3 = 1;
  10781. if (i17 < 0) {
  10782. byte1 = 103;
  10783. byte2 = -1;
  10784. byte3 = -1;
  10785. }
  10786. byte byte4 = 0;
  10787. byte byte5 = 104;
  10788. byte byte6 = 1;
  10789. if (j21 < 0) {
  10790. byte4 = 103;
  10791. byte5 = -1;
  10792. byte6 = -1;
  10793. }
  10794. for (int k33 = byte1; k33 != byte2; k33 += byte3) {
  10795. for (int l33 = byte4; l33 != byte5; l33 += byte6) {
  10796. int i34 = k33 + i17;
  10797. int j34 = l33 + j21;
  10798. for (int k34 = 0; k34 < 4; k34++)
  10799. if (i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
  10800. groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
  10801. else
  10802. groundArray[k34][k33][l33] = null;
  10803.  
  10804. }
  10805.  
  10806. }
  10807.  
  10808. for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179.reverseGetNext())
  10809. {
  10810. class30_sub1_1.anInt1297 -= i17;
  10811. class30_sub1_1.anInt1298 -= j21;
  10812. if (class30_sub1_1.anInt1297 < 0 || class30_sub1_1.anInt1298 < 0 || class30_sub1_1.anInt1297 >= 104 || class30_sub1_1.anInt1298 >= 104)
  10813. class30_sub1_1.unlink();
  10814. }
  10815.  
  10816. if (destX != 0) {
  10817. destX -= i17;
  10818. destY -= j21;
  10819. }
  10820. aBoolean1160 = false;
  10821. pktType = -1;
  10822. return true;
  10823. }
  10824. if (pktType == 208) {
  10825. int i3 = inStream.method437();
  10826. if (i3 >= 0)
  10827. method60(i3);
  10828. anInt1018 = i3;
  10829. pktType = -1;
  10830. return true;
  10831. }
  10832. if (pktType == 99) {
  10833. anInt1021 = inStream.readUnsignedByte();
  10834. pktType = -1;
  10835. return true;
  10836. }
  10837. if (pktType == 75) {
  10838. int j3 = inStream.method436();
  10839. int j11 = inStream.method436();
  10840. RSInterface.interfaceCache[j11].anInt233 = 2;
  10841. RSInterface.interfaceCache[j11].mediaID = j3;
  10842. pktType = -1;
  10843. return true;
  10844. }
  10845. if (pktType == 114) {
  10846. anInt1104 = inStream.method434() * 30;
  10847. pktType = -1;
  10848. return true;
  10849. }
  10850. if (pktType == 60) {
  10851. anInt1269 = inStream.readUnsignedByte();
  10852. anInt1268 = inStream.method427();
  10853. while (inStream.currentOffset < pktSize) {
  10854. int k3 = inStream.readUnsignedByte();
  10855. method137(inStream, k3);
  10856. }
  10857. pktType = -1;
  10858. return true;
  10859. }
  10860. if (pktType == 35) {
  10861. int l3 = inStream.readUnsignedByte();
  10862. int k11 = inStream.readUnsignedByte();
  10863. int j17 = inStream.readUnsignedByte();
  10864. int k21 = inStream.readUnsignedByte();
  10865. aBooleanArray876[l3] = true;
  10866. anIntArray873[l3] = k11;
  10867. anIntArray1203[l3] = j17;
  10868. anIntArray928[l3] = k21;
  10869. anIntArray1030[l3] = 0;
  10870. pktType = -1;
  10871. return true;
  10872. }
  10873. if (pktType == 174) {
  10874. int soundId = inStream.readUnsignedWord();
  10875. //int type = inStream.readUnsignedByte();
  10876. int delay = inStream.readUnsignedWord();
  10877. int volume = inStream.readUnsignedWord();
  10878. sound[currentSound] = soundId;
  10879. // soundType[currentSound] = type;
  10880. soundDelay[currentSound] = delay + Sounds.anIntArray326[soundId];
  10881. soundVolume[currentSound] = volume;
  10882. currentSound++;
  10883. pktType = -1;
  10884. return true;
  10885. }
  10886. if (pktType == 104) {
  10887. int j4 = inStream.method427();
  10888. int i12 = inStream.method426();
  10889. String s6 = inStream.readString();
  10890. if (j4 >= 1 && j4 <= 5) {
  10891. if (s6.equalsIgnoreCase("null"))
  10892. s6 = null;
  10893. atPlayerActions[j4 - 1] = s6;
  10894. atPlayerArray[j4 - 1] = i12 == 0;
  10895. }
  10896. pktType = -1;
  10897. return true;
  10898. }
  10899. if (pktType == 78) {
  10900. destX = 0;
  10901. pktType = -1;
  10902. return true;
  10903. }
  10904. if (pktType == 253) {
  10905. String s = inStream.readString();
  10906. if (s.endsWith(":tradereq:")) {
  10907. String s3 = s.substring(0, s.indexOf(":"));
  10908. long l17 = TextClass.longForName(s3);
  10909. boolean flag2 = false;
  10910. for (int j27 = 0; j27 < ignoreCount; j27++) {
  10911. if (ignoreListAsLongs[j27] != l17)
  10912. continue;
  10913. flag2 = true;
  10914. break;
  10915. }
  10916.  
  10917. if (!flag2 && anInt1251 == 0)
  10918. pushMessage("wishes to trade with you.", 4, s3);
  10919. if (gameFrame != null) {
  10920. if (windowFlasher == null) {
  10921. windowFlasher = new WindowFlasher(gameFrame);
  10922. }
  10923. WindowFlasher.flashWindow();
  10924. }
  10925. } else if (s.endsWith(":duelreq:")) {
  10926. String s4 = s.substring(0, s.indexOf(":"));
  10927. long l18 = TextClass.longForName(s4);
  10928. boolean flag3 = false;
  10929. for (int k27 = 0; k27 < ignoreCount; k27++) {
  10930. if (ignoreListAsLongs[k27] != l18)
  10931. continue;
  10932. flag3 = true;
  10933. break;
  10934. }
  10935.  
  10936. if (!flag3 && anInt1251 == 0)
  10937. pushMessage("wishes to duel with you.", 8, s4);
  10938. if (gameFrame != null) {
  10939. if (windowFlasher == null) {
  10940. windowFlasher = new WindowFlasher(gameFrame);
  10941. }
  10942. WindowFlasher.flashWindow();
  10943. }
  10944. } else if (s.endsWith(":chalreq:")) {
  10945. String s5 = s.substring(0, s.indexOf(":"));
  10946. long l19 = TextClass.longForName(s5);
  10947. boolean flag4 = false;
  10948. for (int l27 = 0; l27 < ignoreCount; l27++) {
  10949. if (ignoreListAsLongs[l27] != l19)
  10950. continue;
  10951. flag4 = true;
  10952. break;
  10953. }
  10954.  
  10955. if (!flag4 && anInt1251 == 0) {
  10956. String s8 = s.substring(s.indexOf(":") + 1, s.length() - 9);
  10957. pushMessage(s8, 8, s5);
  10958. }
  10959. } else {
  10960. pushMessage(s, 0, "");
  10961. }
  10962. pktType = -1;
  10963. //serverMessage(s);
  10964.  
  10965. return true;
  10966. }
  10967. if (pktType == 1) {
  10968. for (int k4 = 0; k4 < playerArray.length; k4++)
  10969. if (playerArray[k4] != null)
  10970. playerArray[k4].anim = -1;
  10971.  
  10972. for (int j12 = 0; j12 < npcArray.length; j12++)
  10973. if (npcArray[j12] != null)
  10974. npcArray[j12].anim = -1;
  10975.  
  10976. pktType = -1;
  10977. return true;
  10978. }
  10979. if (pktType == 50) {
  10980. long l4 = inStream.readQWord();
  10981. int i18 = inStream.readUnsignedByte();
  10982. String s7 = TextClass.fixName(TextClass.nameForLong(l4));
  10983. for (int k24 = 0; k24 < friendsCount; k24++) {
  10984. if (l4 != friendsListAsLongs[k24])
  10985. continue;
  10986. if (friendsNodeIDs[k24] != i18) {
  10987. friendsNodeIDs[k24] = i18;
  10988. needDrawTabArea = true;
  10989. if (i18 >= 2) {
  10990. pushMessage(s7 + " has logged in.", 5, "");
  10991. }
  10992. if (i18 <= 1) {
  10993. pushMessage(s7 + " has logged out.", 5, "");
  10994. }
  10995. }
  10996. s7 = null;
  10997. break;
  10998. }
  10999.  
  11000. if (s7 != null && friendsCount < 200) {
  11001. friendsListAsLongs[friendsCount] = l4;
  11002. friendsList[friendsCount] = s7;
  11003. friendsNodeIDs[friendsCount] = i18;
  11004. friendsCount++;
  11005. needDrawTabArea = true;
  11006. }
  11007. for (boolean flag6 = false; !flag6;) {
  11008. flag6 = true;
  11009. for (int k29 = 0; k29 < friendsCount - 1; k29++)
  11010. if (friendsNodeIDs[k29] != nodeID && friendsNodeIDs[k29 + 1] == nodeID || friendsNodeIDs[k29] == 0 && friendsNodeIDs[k29 + 1] != 0) {
  11011. int j31 = friendsNodeIDs[k29];
  11012. friendsNodeIDs[k29] = friendsNodeIDs[k29 + 1];
  11013. friendsNodeIDs[k29 + 1] = j31;
  11014. String s10 = friendsList[k29];
  11015. friendsList[k29] = friendsList[k29 + 1];
  11016. friendsList[k29 + 1] = s10;
  11017. long l32 = friendsListAsLongs[k29];
  11018. friendsListAsLongs[k29] = friendsListAsLongs[k29 + 1];
  11019. friendsListAsLongs[k29 + 1] = l32;
  11020. needDrawTabArea = true;
  11021. flag6 = false;
  11022. }
  11023.  
  11024. }
  11025.  
  11026. pktType = -1;
  11027. return true;
  11028. }
  11029. if (pktType == 110) {
  11030. if (tabID == 11)
  11031. needDrawTabArea = true;
  11032. energy = inStream.readUnsignedByte();
  11033. pktType = -1;
  11034. return true;
  11035. }
  11036. if (pktType == 254) {
  11037. anInt855 = inStream.readUnsignedByte();
  11038. if (anInt855 == 1)
  11039. anInt1222 = inStream.readUnsignedWord();
  11040. if (anInt855 >= 2 && anInt855 <= 6) {
  11041. if (anInt855 == 2) {
  11042. anInt937 = 64;
  11043. anInt938 = 64;
  11044. }
  11045. if (anInt855 == 3) {
  11046. anInt937 = 0;
  11047. anInt938 = 64;
  11048. }
  11049. if (anInt855 == 4) {
  11050. anInt937 = 128;
  11051. anInt938 = 64;
  11052. }
  11053. if (anInt855 == 5) {
  11054. anInt937 = 64;
  11055. anInt938 = 0;
  11056. }
  11057. if (anInt855 == 6) {
  11058. anInt937 = 64;
  11059. anInt938 = 128;
  11060. }
  11061. anInt855 = 2;
  11062. anInt934 = inStream.readUnsignedWord();
  11063. anInt935 = inStream.readUnsignedWord();
  11064. anInt936 = inStream.readUnsignedByte();
  11065. }
  11066. if (anInt855 == 10)
  11067. anInt933 = inStream.readUnsignedWord();
  11068. pktType = -1;
  11069. return true;
  11070. }
  11071. if (pktType == 248) {
  11072. int i5 = inStream.method435();
  11073. int k12 = inStream.readUnsignedWord();
  11074. if (backDialogID != -1) {
  11075. backDialogID = -1;
  11076. inputTaken = true;
  11077. }
  11078. if (inputDialogState != 0) {
  11079. inputDialogState = 0;
  11080. inputTaken = true;
  11081. }
  11082. openInterfaceID = i5;
  11083. invOverlayInterfaceID = k12;
  11084. needDrawTabArea = true;
  11085. tabAreaAltered = true;
  11086. aBoolean1149 = false;
  11087. pktType = -1;
  11088. return true;
  11089. }
  11090. if (pktType == 79) {
  11091. int j5 = inStream.method434();
  11092. int l12 = inStream.method435();
  11093. RSInterface class9_3 = RSInterface.interfaceCache[j5];
  11094. if (class9_3 != null && class9_3.type == 0) {
  11095. if (l12 < 0)
  11096. l12 = 0;
  11097. if (l12 > class9_3.scrollMax - class9_3.height)
  11098. l12 = class9_3.scrollMax - class9_3.height;
  11099. class9_3.scrollPosition = l12;
  11100. }
  11101. pktType = -1;
  11102. return true;
  11103. }
  11104. if (pktType == 68) {
  11105. for (int k5 = 0; k5 < variousSettings.length; k5++)
  11106. if (variousSettings[k5] != anIntArray1045[k5]) {
  11107. variousSettings[k5] = anIntArray1045[k5];
  11108. method33(k5);
  11109. needDrawTabArea = true;
  11110. }
  11111.  
  11112. pktType = -1;
  11113. return true;
  11114. }
  11115. if (pktType == 196) {
  11116. long l5 = inStream.readQWord();
  11117. int j18 = inStream.readDWord();
  11118. int l21 = inStream.readUnsignedByte();
  11119. boolean flag5 = false;
  11120. for (int i28 = 0; i28 < 100; i28++) {
  11121. if (anIntArray1240[i28] != j18)
  11122. continue;
  11123. flag5 = true;
  11124. break;
  11125. }
  11126.  
  11127. if (l21 <= 1) {
  11128. for (int l29 = 0; l29 < ignoreCount; l29++) {
  11129. if (ignoreListAsLongs[l29] != l5)
  11130. continue;
  11131. flag5 = true;
  11132. break;
  11133. }
  11134.  
  11135. }
  11136. if (!flag5 && anInt1251 == 0)
  11137. try {
  11138. anIntArray1240[anInt1169] = j18;
  11139. anInt1169 = (anInt1169 + 1) % 100;
  11140. String s9 = TextInput.method525(pktSize - 13, inStream);
  11141. // if (l21 != 3)
  11142. // s9 = Censor.doCensor(s9);
  11143. if (l21 == 2 || l21 == 3)
  11144. pushMessage(s9, 7, "@cr2@" + TextClass.fixName(TextClass.nameForLong(l5)));
  11145. else if (l21 == 1)
  11146. pushMessage(s9, 7, "@cr1@" + TextClass.fixName(TextClass.nameForLong(l5)));
  11147. else
  11148. pushMessage(s9, 3, TextClass.fixName(TextClass.nameForLong(l5)));
  11149. }
  11150. catch (Exception exception1) {
  11151. signlink.reporterror("cde1");
  11152. }
  11153. pktType = -1;
  11154. return true;
  11155. }
  11156. if (pktType == 85) {
  11157. anInt1269 = inStream.method427();
  11158. anInt1268 = inStream.method427();
  11159. pktType = -1;
  11160. return true;
  11161. }
  11162. if (pktType == 24) {
  11163. anInt1054 = inStream.method428();
  11164. if (anInt1054 == tabID) {
  11165. if (anInt1054 == 3)
  11166. tabID = 1;
  11167. else
  11168. tabID = 3;
  11169. needDrawTabArea = true;
  11170. }
  11171. pktType = -1;
  11172. return true;
  11173. }
  11174. if (pktType == 246) {
  11175. int i6 = inStream.method434();
  11176. int i13 = inStream.readUnsignedWord();
  11177. int k18 = inStream.readUnsignedWord();
  11178. if (k18 == 65535) {
  11179. RSInterface.interfaceCache[i6].anInt233 = 0;
  11180. pktType = -1;
  11181. return true;
  11182. } else {
  11183. ItemDef itemDef = ItemDef.forID(k18);
  11184. RSInterface.interfaceCache[i6].anInt233 = 4;
  11185. RSInterface.interfaceCache[i6].mediaID = k18;
  11186. RSInterface.interfaceCache[i6].modelRotation1 = itemDef.modelRotation1;
  11187. RSInterface.interfaceCache[i6].modelRotation2 = itemDef.modelRotation2;
  11188. RSInterface.interfaceCache[i6].modelZoom = (itemDef.modelZoom * 100) / i13;
  11189. pktType = -1;
  11190. return true;
  11191. }
  11192. }
  11193. if (pktType == 171) {
  11194. boolean flag1 = inStream.readUnsignedByte() == 1;
  11195. int j13 = inStream.readUnsignedWord();
  11196. RSInterface.interfaceCache[j13].isMouseoverTriggered = flag1;
  11197. pktType = -1;
  11198. return true;
  11199. }
  11200. if (pktType == 142) {
  11201. int j6 = inStream.method434();
  11202. method60(j6);
  11203. if (backDialogID != -1) {
  11204. backDialogID = -1;
  11205. inputTaken = true;
  11206. }
  11207. if (inputDialogState != 0) {
  11208. inputDialogState = 0;
  11209. inputTaken = true;
  11210. }
  11211. invOverlayInterfaceID = j6;
  11212. needDrawTabArea = true;
  11213. tabAreaAltered = true;
  11214. openInterfaceID = -1;
  11215. aBoolean1149 = false;
  11216. pktType = -1;
  11217. return true;
  11218. }
  11219. if (pktType == 126) {
  11220. String s1 = inStream.readString();
  11221. int k13 = inStream.method435();
  11222. RSInterface.interfaceCache[k13].message = s1;
  11223. if (RSInterface.interfaceCache[k13].parentID == tabInterfaceIDs[tabID])
  11224. needDrawTabArea = true;
  11225. pktType = -1;
  11226. return true;
  11227. }
  11228. if (pktType == 206) {
  11229. publicChatMode = inStream.readUnsignedByte();
  11230. privateChatMode = inStream.readUnsignedByte();
  11231. tradeMode = inStream.readUnsignedByte();
  11232. aBoolean1233 = true;
  11233. inputTaken = true;
  11234. pktType = -1;
  11235. return true;
  11236. }
  11237. if (pktType == 240) {
  11238. if (tabID == 12)
  11239. needDrawTabArea = true;
  11240. weight = inStream.readSignedWord();
  11241. pktType = -1;
  11242. return true;
  11243. }
  11244. if (pktType == 8) {
  11245. int k6 = inStream.method436();
  11246. int l13 = inStream.readUnsignedWord();
  11247. RSInterface.interfaceCache[k6].anInt233 = 1;
  11248. RSInterface.interfaceCache[k6].mediaID = l13;
  11249. pktType = -1;
  11250. return true;
  11251. }
  11252. if (pktType == 122) {
  11253. int l6 = inStream.method436();
  11254. int i14 = inStream.method436();
  11255. int i19 = i14 >> 10 & 0x1f;
  11256. int i22 = i14 >> 5 & 0x1f;
  11257. int l24 = i14 & 0x1f;
  11258. RSInterface.interfaceCache[l6].textColor = (i19 << 19) + (i22 << 11) + (l24 << 3);
  11259. pktType = -1;
  11260. return true;
  11261. }
  11262. if (pktType == 53) {
  11263. needDrawTabArea = true;
  11264. int i7 = inStream.readUnsignedWord();
  11265. RSInterface class9_1 = RSInterface.interfaceCache[i7];
  11266. int j19 = inStream.readUnsignedWord();
  11267. for (int j22 = 0; j22 < j19; j22++) {
  11268. int i25 = inStream.readUnsignedByte();
  11269. if (i25 == 255)
  11270. i25 = inStream.method440();
  11271. class9_1.inv[j22] = inStream.method436();
  11272. class9_1.invStackSizes[j22] = i25;
  11273. }
  11274.  
  11275. for (int j25 = j19; j25 < class9_1.inv.length; j25++) {
  11276. class9_1.inv[j25] = 0;
  11277. class9_1.invStackSizes[j25] = 0;
  11278. }
  11279.  
  11280. pktType = -1;
  11281. return true;
  11282. }
  11283. if (pktType == 230) {
  11284. int j7 = inStream.method435();
  11285. int j14 = inStream.readUnsignedWord();
  11286. int k19 = inStream.readUnsignedWord();
  11287. int k22 = inStream.method436();
  11288. RSInterface.interfaceCache[j14].modelRotation1 = k19;
  11289. RSInterface.interfaceCache[j14].modelRotation2 = k22;
  11290. RSInterface.interfaceCache[j14].modelZoom = j7;
  11291. pktType = -1;
  11292. return true;
  11293. }
  11294. if (pktType == 221) {
  11295. anInt900 = inStream.readUnsignedByte();
  11296. needDrawTabArea = true;
  11297. pktType = -1;
  11298. return true;
  11299. }
  11300. if (pktType == 177) {
  11301. aBoolean1160 = true;
  11302. anInt995 = inStream.readUnsignedByte();
  11303. anInt996 = inStream.readUnsignedByte();
  11304. anInt997 = inStream.readUnsignedWord();
  11305. anInt998 = inStream.readUnsignedByte();
  11306. anInt999 = inStream.readUnsignedByte();
  11307. if (anInt999 >= 100) {
  11308. int k7 = anInt995 * 128 + 64;
  11309. int k14 = anInt996 * 128 + 64;
  11310. int i20 = method42(plane, k14, k7) - anInt997;
  11311. int l22 = k7 - xCameraPos;
  11312. int k25 = i20 - zCameraPos;
  11313. int j28 = k14 - yCameraPos;
  11314. int i30 = (int) Math.sqrt(l22 * l22 + j28 * j28);
  11315. yCameraCurve = (int) (Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  11316. xCameraCurve = (int) (Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  11317. if (yCameraCurve < 128)
  11318. yCameraCurve = 128;
  11319. if (yCameraCurve > 383)
  11320. yCameraCurve = 383;
  11321. }
  11322. pktType = -1;
  11323. return true;
  11324. }
  11325. if (pktType == 249) {
  11326. anInt1046 = inStream.method426();
  11327. unknownInt10 = inStream.method436();
  11328. pktType = -1;
  11329. return true;
  11330. }
  11331. if (pktType == 65) {
  11332. updateNPCs(inStream, pktSize);
  11333. pktType = -1;
  11334. return true;
  11335. }
  11336. if (pktType == 27) {
  11337. messagePromptRaised = false;
  11338. inputDialogState = 1;
  11339. amountOrNameInput = "";
  11340. inputTaken = true;
  11341. pktType = -1;
  11342. return true;
  11343. }
  11344. if (pktType == 187) {
  11345. messagePromptRaised = false;
  11346. inputDialogState = 2;
  11347. amountOrNameInput = "";
  11348. inputTaken = true;
  11349. pktType = -1;
  11350. return true;
  11351. }
  11352. if (pktType == 97) {
  11353. int l7 = inStream.readUnsignedWord();
  11354. method60(l7);
  11355. if (invOverlayInterfaceID != -1) {
  11356. invOverlayInterfaceID = -1;
  11357. needDrawTabArea = true;
  11358. tabAreaAltered = true;
  11359. }
  11360. if (backDialogID != -1) {
  11361. backDialogID = -1;
  11362. inputTaken = true;
  11363. }
  11364. if (inputDialogState != 0) {
  11365. inputDialogState = 0;
  11366. inputTaken = true;
  11367. }
  11368. openInterfaceID = l7;
  11369. aBoolean1149 = false;
  11370. pktType = -1;
  11371. return true;
  11372. }
  11373. if (pktType == 218) {
  11374. dialogID = inStream.method438();
  11375. inputTaken = true;
  11376. pktType = -1;
  11377. return true;
  11378. }
  11379. if (pktType == 87) {
  11380. int j8 = inStream.method434();
  11381. int l14 = inStream.method439();
  11382. anIntArray1045[j8] = l14;
  11383. if (variousSettings[j8] != l14) {
  11384. variousSettings[j8] = l14;
  11385. method33(j8);
  11386. needDrawTabArea = true;
  11387. if (dialogID != -1)
  11388. inputTaken = true;
  11389. }
  11390. pktType = -1;
  11391. return true;
  11392. }
  11393. if (pktType == 36) {
  11394. int k8 = inStream.method434();
  11395. byte byte0 = inStream.readSignedByte();
  11396. anIntArray1045[k8] = byte0;
  11397. if (variousSettings[k8] != byte0) {
  11398. variousSettings[k8] = byte0;
  11399. method33(k8);
  11400. needDrawTabArea = true;
  11401. if (dialogID != -1)
  11402. inputTaken = true;
  11403. }
  11404. pktType = -1;
  11405. return true;
  11406. }
  11407. if (pktType == 61) {
  11408. anInt1055 = inStream.readUnsignedByte();
  11409. pktType = -1;
  11410. return true;
  11411. }
  11412. if (pktType == 200) {
  11413. int l8 = inStream.readUnsignedWord();
  11414. int i15 = inStream.readSignedWord();
  11415. RSInterface class9_4 = RSInterface.interfaceCache[l8];
  11416. class9_4.anInt257 = i15;
  11417. if (i15 == -1) {
  11418. class9_4.anInt246 = 0;
  11419. class9_4.anInt208 = 0;
  11420. }
  11421. pktType = -1;
  11422. return true;
  11423. }
  11424. if (pktType == 219) {
  11425. if (invOverlayInterfaceID != -1) {
  11426. invOverlayInterfaceID = -1;
  11427. needDrawTabArea = true;
  11428. tabAreaAltered = true;
  11429. }
  11430. if (backDialogID != -1) {
  11431. backDialogID = -1;
  11432. inputTaken = true;
  11433. }
  11434. if (inputDialogState != 0) {
  11435. inputDialogState = 0;
  11436. inputTaken = true;
  11437. }
  11438. openInterfaceID = -1;
  11439. aBoolean1149 = false;
  11440. pktType = -1;
  11441. return true;
  11442. }
  11443. if (pktType == 34) {
  11444. needDrawTabArea = true;
  11445. int i9 = inStream.readUnsignedWord();
  11446. RSInterface class9_2 = RSInterface.interfaceCache[i9];
  11447. while (inStream.currentOffset < pktSize) {
  11448. int j20 = inStream.method422();
  11449. int i23 = inStream.readUnsignedWord();
  11450. int l25 = inStream.readUnsignedByte();
  11451. if (l25 == 255)
  11452. l25 = inStream.readDWord();
  11453. if (j20 >= 0 && j20 < class9_2.inv.length) {
  11454. class9_2.inv[j20] = i23;
  11455. class9_2.invStackSizes[j20] = l25;
  11456. }
  11457. }
  11458. pktType = -1;
  11459. return true;
  11460. }
  11461. if (pktType == 105 || pktType == 84 || pktType == 147 || pktType == 215 || pktType == 4 || pktType == 117 || pktType == 156 || pktType == 44 || pktType == 160 || pktType == 101 || pktType == 151) {
  11462. method137(inStream, pktType);
  11463. pktType = -1;
  11464. return true;
  11465. }
  11466. if (pktType == 106) {
  11467. tabID = inStream.method427();
  11468. needDrawTabArea = true;
  11469. tabAreaAltered = true;
  11470. pktType = -1;
  11471. return true;
  11472. }
  11473. if (pktType == 164) {
  11474. int j9 = inStream.method434();
  11475. method60(j9);
  11476. if (invOverlayInterfaceID != -1) {
  11477. invOverlayInterfaceID = -1;
  11478. needDrawTabArea = true;
  11479. tabAreaAltered = true;
  11480. }
  11481. backDialogID = j9;
  11482. inputTaken = true;
  11483. openInterfaceID = -1;
  11484. aBoolean1149 = false;
  11485. pktType = -1;
  11486. return true;
  11487. }
  11488. signlink.reporterror("T1 - " + pktType + "," + pktSize + " - " + anInt842 + "," + anInt843);
  11489. resetLogout();
  11490. }
  11491. catch (IOException _ex) {
  11492. dropClient();
  11493. }
  11494. catch (Exception exception) {
  11495. String s2 = "T2 - " + pktType + "," + anInt842 + "," + anInt843 + " - " + pktSize + "," + (baseX + myPlayer.smallX[0]) + "," + (baseY + myPlayer.smallY[0]) + " - ";
  11496. for (int j15 = 0; j15 < pktSize && j15 < 50; j15++)
  11497. s2 = s2 + inStream.buffer[j15] + ",";
  11498.  
  11499. signlink.reporterror(s2);
  11500. resetLogout();
  11501. }
  11502. return true;
  11503. }
  11504.  
  11505. private void method146() {
  11506. anInt1265++;
  11507. method47(true);
  11508. method26(true);
  11509. method47(false);
  11510. method26(false);
  11511. method55();
  11512. method104();
  11513. if (!aBoolean1160) {
  11514. int i = anInt1184;
  11515. if (anInt984 / 256 > i)
  11516. i = anInt984 / 256;
  11517. if (aBooleanArray876[4] && anIntArray1203[4] + 128 > i)
  11518. i = anIntArray1203[4] + 128;
  11519. int k = viewRotation + viewRotationOffset & 0x7ff;
  11520. setCameraPos(cameraZoom + i * ((WorldController.viewDistance == 9) && (frameMode == ScreenMode.RESIZABLE) ? 2 : WorldController.viewDistance == 10 ? 5 : 3), i, anInt1014, method42(plane, myPlayer.y, myPlayer.x) - 50, k, anInt1015);
  11521. }
  11522. int j;
  11523. if (!aBoolean1160)
  11524. j = method120();
  11525. else
  11526. j = method121();
  11527. int l = xCameraPos;
  11528. int i1 = zCameraPos;
  11529. int j1 = yCameraPos;
  11530. int k1 = yCameraCurve;
  11531. int l1 = xCameraCurve;
  11532. for (int i2 = 0; i2 < 5; i2++)
  11533. if (aBooleanArray876[i2]) {
  11534. 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]);
  11535. if (i2 == 0)
  11536. xCameraPos += j2;
  11537. if (i2 == 1)
  11538. zCameraPos += j2;
  11539. if (i2 == 2)
  11540. yCameraPos += j2;
  11541. if (i2 == 3)
  11542. xCameraCurve = xCameraCurve + j2 & 0x7ff;
  11543. if (i2 == 4) {
  11544. yCameraCurve += j2;
  11545. if (yCameraCurve < 128)
  11546. yCameraCurve = 128;
  11547. if (yCameraCurve > 383)
  11548. yCameraCurve = 383;
  11549. }
  11550. }
  11551.  
  11552. int k2 = Texture.anInt1481;
  11553. Model.aBoolean1684 = true;
  11554. Model.anInt1687 = 0;
  11555. Model.anInt1685 = super.mouseX - (frameMode == ScreenMode.FIXED ? 4 : 0);
  11556. Model.anInt1686 = super.mouseY - (frameMode == ScreenMode.FIXED ? 4 : 0);
  11557. DrawingArea.setAllPixelsToZero();
  11558. //xxx disables graphics if(graphicsEnabled){
  11559. worldController.method313(xCameraPos, yCameraPos, xCameraCurve, zCameraPos, j, yCameraCurve);
  11560. worldController.clearObj5Cache();
  11561. int x = (baseX + (myPlayer.x - 6 >> 7)) >> 3;
  11562. int y = (baseY + (myPlayer.y - 6 >> 7)) >> 3;
  11563. if(Settings.FogToggle) {
  11564. double fogDistance = Math.sqrt(Math.pow(zCameraPos, 2));
  11565. int fogStartDistance = 1430;
  11566. int fogEndDistance = 2100;
  11567. fogHandler.setFogDistance((float) fogDistance);
  11568. fogHandler.renderFog(false, fogStartDistance, fogEndDistance, 3);
  11569. }
  11570. updateEntities();
  11571. drawHeadIcon();
  11572. method37(k2);
  11573. draw3dScreen();
  11574. if(!firstLogin){
  11575. setBounds();
  11576. firstLogin = true;
  11577. }
  11578. if (frameMode != ScreenMode.FIXED && hideGameFrame == false) {
  11579. drawChatArea();
  11580. drawMinimap();
  11581. drawTabArea();
  11582. }
  11583. if (console.openConsole) {
  11584. console.drawConsole(frameWidth, 334);
  11585. }
  11586. aRSImageProducer_1165.drawGraphics(frameMode == ScreenMode.FIXED ? 4 : 0, super.graphics, frameMode == ScreenMode.FIXED ? 4 : 0);
  11587. xCameraPos = l;
  11588. zCameraPos = i1;
  11589. yCameraPos = j1;
  11590. yCameraCurve = k1;
  11591. xCameraCurve = l1;
  11592. // }
  11593. }
  11594.  
  11595. private void clearTopInterfaces() {
  11596. stream.createFrame(130);
  11597. if (invOverlayInterfaceID != -1) {
  11598. invOverlayInterfaceID = -1;
  11599. needDrawTabArea = true;
  11600. aBoolean1149 = false;
  11601. tabAreaAltered = true;
  11602. }
  11603. if (backDialogID != -1) {
  11604. backDialogID = -1;
  11605. inputTaken = true;
  11606. aBoolean1149 = false;
  11607. }
  11608. openInterfaceID = -1;
  11609. fullscreenInterfaceID = -1;
  11610. }
  11611.  
  11612.  
  11613.  
  11614.  
  11615.  
  11616.  
  11617. public Client() {
  11618. // server = "131.153.26.53";
  11619. consoleInput = "";
  11620. consoleOpen = false;
  11621. consoleMessages = new String[17];
  11622. LP = 0.0F;
  11623. fullscreenInterfaceID = -1;
  11624. anIntArrayArray825 = new int[104][104];
  11625. friendsNodeIDs = new int[200];
  11626. groundArray = new NodeList[4][104][104];
  11627. aBoolean831 = false;
  11628. aStream_834 = new Stream(new byte[5000]);
  11629. npcArray = new NPC[16384];
  11630. npcIndices = new int[16384];
  11631. anIntArray840 = new int[1000];
  11632. aStream_847 = Stream.create();
  11633. aBoolean848 = true;
  11634. openInterfaceID = -1;
  11635. currentExp = new int[Skills.skillsCount];
  11636. aBoolean872 = false;
  11637. anIntArray873 = new int[5];
  11638. anInt874 = -1;
  11639. aBooleanArray876 = new boolean[5];
  11640. drawFlames = false;
  11641. reportAbuseInput = "";
  11642. unknownInt10 = -1;
  11643. menuOpen = false;
  11644. inputString = "";
  11645. maxPlayers = 2048;
  11646. myPlayerIndex = 2047;
  11647. playerArray = new Player[maxPlayers];
  11648. playerIndices = new int[maxPlayers];
  11649. anIntArray894 = new int[maxPlayers];
  11650. aStreamArray895s = new Stream[maxPlayers];
  11651. anInt897 = 1;
  11652. anIntArrayArray901 = new int[104][104];
  11653. anInt902 = 0x766654;
  11654. aByteArray912 = new byte[16384];
  11655. currentStats = new int[Skills.skillsCount];
  11656. ignoreListAsLongs = new long[100];
  11657. loadingError = false;
  11658. anInt927 = 0x332d25;
  11659. anIntArray928 = new int[5];
  11660. anIntArrayArray929 = new int[104][104];
  11661. chatTypes = new int[100];
  11662. chatNames = new String[100];
  11663. chatMessages = new String[100];
  11664. sideIcons = new Sprite[13];
  11665. aBoolean954 = true;
  11666. friendsListAsLongs = new long[200];
  11667. currentSong = -1;
  11668. drawingFlames = false;
  11669. spriteDrawX = -1;
  11670. spriteDrawY = -1;
  11671. anIntArray968 = new int[33];
  11672. anIntArray969 = new int[256];
  11673. decompressors = new Decompressor[5];
  11674. variousSettings = new int[2000];
  11675. aBoolean972 = false;
  11676. anInt975 = 50;
  11677. anIntArray976 = new int[anInt975];
  11678. anIntArray977 = new int[anInt975];
  11679. anIntArray978 = new int[anInt975];
  11680. anIntArray979 = new int[anInt975];
  11681. anIntArray980 = new int[anInt975];
  11682. anIntArray981 = new int[anInt975];
  11683. anIntArray982 = new int[anInt975];
  11684. aStringArray983 = new String[anInt975];
  11685. anInt985 = -1;
  11686. hitMarks = new Sprite[20];
  11687. anIntArray990 = new int[5];
  11688. aBoolean994 = false;
  11689. anInt1002 = 0x23201b;
  11690. amountOrNameInput = "";
  11691. aClass19_1013 = new NodeList();
  11692. aBoolean1017 = false;
  11693. anInt1018 = -1;
  11694. anIntArray1030 = new int[5];
  11695. aBoolean1031 = false;
  11696. mapFunctions = new Sprite[100];
  11697. dialogID = -1;
  11698. maxStats = new int[Skills.skillsCount];
  11699. anIntArray1045 = new int[2000];
  11700. aBoolean1047 = true;
  11701. anIntArray1052 = new int[151];
  11702. anInt1054 = -1;
  11703. aClass19_1056 = new NodeList();
  11704. anIntArray1057 = new int[33];
  11705. aClass9_1059 = new RSInterface();
  11706. mapScenes = new Background[100];
  11707. anInt1063 = 0x4d4233;
  11708. anIntArray1065 = new int[7];
  11709. anIntArray1072 = new int[1000];
  11710. anIntArray1073 = new int[1000];
  11711. aBoolean1080 = false;
  11712. friendsList = new String[200];
  11713. inStream = Stream.create();
  11714. expectedCRCs = new int[9];
  11715. menuActionCmd2 = new int[500];
  11716. menuActionCmd3 = new int[500];
  11717. menuActionID = new int[500];
  11718. menuActionCmd1 = new int[500];
  11719. headIcons = new Sprite[20];
  11720. bountyHunter = new Sprite[10];
  11721. skullIcons = new Sprite[20];
  11722. headIconsHint = new Sprite[20];
  11723. tabAreaAltered = false;
  11724. aString1121 = "";
  11725. atPlayerActions = new String[5];
  11726. atPlayerArray = new boolean[5];
  11727. anIntArrayArrayArray1129 = new int[4][13][13];
  11728. anInt1132 = 2;
  11729. aClass30_Sub2_Sub1_Sub1Array1140 = new Sprite[1000];
  11730. aBoolean1141 = false;
  11731. aBoolean1149 = false;
  11732. crosses = new Sprite[8];
  11733. musicEnabled = true;
  11734. needDrawTabArea = false;
  11735. loggedIn = false;
  11736. canMute = false;
  11737. aBoolean1159 = false;
  11738. aBoolean1160 = false;
  11739. anInt1171 = 1;
  11740. myUsername = "";
  11741. myPassword = "";
  11742. genericLoadingError = false;
  11743. reportAbuseInterfaceID = -1;
  11744. aClass19_1179 = new NodeList();
  11745. anInt1184 = 128;
  11746. invOverlayInterfaceID = -1;
  11747. stream = Stream.create();
  11748. menuActionName = new String[500];
  11749. anIntArray1203 = new int[5];
  11750. sound = new int[50];
  11751. anInt1210 = 2;
  11752. anInt1211 = 78;
  11753. promptInput = "";
  11754. modIcons = new Sprite[2];
  11755. tabID = 3;
  11756. inputTaken = false;
  11757. songChanging = true;
  11758. anIntArray1229 = new int[151];
  11759. aClass11Array1230 = new Class11[4];
  11760. aBoolean1233 = false;
  11761. anIntArray1240 = new int[100];
  11762. soundType = new int[50];
  11763. aBoolean1242 = false;
  11764. soundDelay = new int[50];
  11765. soundVolume = new int[50];
  11766. rsAlreadyLoaded = false;
  11767. welcomeScreenRaised = false;
  11768. messagePromptRaised = false;
  11769. loginMessage1 = "";
  11770. loginMessage2 = "";
  11771. backDialogID = -1;
  11772. anInt1279 = 2;
  11773. bigX = new int[4000];
  11774. bigY = new int[4000];
  11775. anInt1289 = -1;
  11776. }
  11777.  
  11778. public static Sprite[] cacheSprite;
  11779. public static Sprite[] cacheInterface;
  11780. private RSImageProducer leftFrame;
  11781. private RSImageProducer topFrame;
  11782. private int ignoreCount;
  11783. private long aLong824;
  11784. private int[][] anIntArrayArray825;
  11785. private int[] friendsNodeIDs;
  11786. private NodeList[][][] groundArray;
  11787. private int[] anIntArray828;
  11788. private int[] anIntArray829;
  11789. public float LP;
  11790. public int autoCastId = 0;
  11791. public boolean autocast;
  11792. private volatile boolean aBoolean831;
  11793. private Socket aSocket832;
  11794. private int loginScreenState;
  11795. private Stream aStream_834;
  11796. private NPC[] npcArray;
  11797. private int npcCount;
  11798. private int[] npcIndices;
  11799. private int anInt839;
  11800. private int[] anIntArray840;
  11801. private int anInt841;
  11802. private int anInt842;
  11803. private int anInt843;
  11804. private String aString844;
  11805. private int privateChatMode;
  11806. private Stream aStream_847;
  11807. private boolean aBoolean848;
  11808. private static int anInt849;
  11809. private int[] anIntArray850;
  11810. private int[] anIntArray851;
  11811. private int[] anIntArray852;
  11812. private int[] anIntArray853;
  11813. private static int anInt854;
  11814. private int anInt855;
  11815. public static int openInterfaceID;
  11816. private int xCameraPos;
  11817. private int zCameraPos;
  11818. private int yCameraPos;
  11819. private int yCameraCurve;
  11820. private int xCameraCurve;
  11821. private int myPrivilege;
  11822. private final int[] currentExp;
  11823. private Background redStone1_3;
  11824. private Background redStone2_3;
  11825. private Background redStone3_2;
  11826. private Background redStone1_4;
  11827. private Background redStone2_4;
  11828. private Sprite mapFlag;
  11829. public Sprite multiOverlay;
  11830. private Sprite mapMarker;
  11831. private boolean aBoolean872;
  11832. private final int[] anIntArray873;
  11833. private int anInt874;
  11834. private final boolean[] aBooleanArray876;
  11835. private int weight;
  11836. private volatile boolean drawFlames;
  11837. private String reportAbuseInput;
  11838. private int unknownInt10;
  11839. private boolean menuOpen;
  11840. private int anInt886;
  11841. private String inputString;
  11842. private final int maxPlayers;
  11843. private final int myPlayerIndex;
  11844. private Player[] playerArray;
  11845. private int playerCount;
  11846. private int[] playerIndices;
  11847. private int anInt893;
  11848. private int[] anIntArray894;
  11849. private Stream[] aStreamArray895s;
  11850. private int viewRotationOffset;
  11851. private int anInt897;
  11852. private int friendsCount;
  11853. private int anInt900;
  11854. private int[][] anIntArrayArray901;
  11855. private final int anInt902;
  11856. private byte[] aByteArray912;
  11857. private int anInt913;
  11858. private int crossX;
  11859. private int crossY;
  11860. private int crossIndex;
  11861. private int crossType;
  11862. private int plane;
  11863. private final int[] currentStats;
  11864. private static int anInt924;
  11865. private final long[] ignoreListAsLongs;
  11866. private boolean loadingError;
  11867. private final int anInt927;
  11868. private final int[] anIntArray928;
  11869. private int[][] anIntArrayArray929;
  11870. private Sprite aClass30_Sub2_Sub1_Sub1_931;
  11871. private Sprite aClass30_Sub2_Sub1_Sub1_932;
  11872. private int anInt933;
  11873. private int anInt934;
  11874. private int anInt935;
  11875. private int anInt936;
  11876. private int anInt937;
  11877. private int anInt938;
  11878. private static int anInt940;
  11879. private final int[] chatTypes;
  11880. private final String[] chatNames;
  11881. private final String[] chatMessages;
  11882. private int anInt945;
  11883. private WorldController worldController;
  11884. private Sprite[] sideIcons;
  11885. private int menuScreenArea;
  11886. private int menuOffsetX;
  11887. private int menuOffsetY;
  11888. private int menuWidth;
  11889. private int menuHeight;
  11890. private long aLong953;
  11891. private boolean aBoolean954;
  11892. private long[] friendsListAsLongs;
  11893. private String[] clanList = new String[100];
  11894. private int currentSong;
  11895. private static int nodeID = 10;
  11896. public static int portOff;
  11897. private static boolean isMembers = true;
  11898. private static boolean lowMem;
  11899. private volatile boolean drawingFlames;
  11900. private int spriteDrawX;
  11901. private int spriteDrawY;
  11902. private final int[] anIntArray965 = {
  11903. 0xffff00, 0xff0000, 65280, 65535, 0xff00ff, 0xffffff
  11904. };
  11905. private Background aBackground_966;
  11906. private Background aBackground_967;
  11907. private final int[] anIntArray968;
  11908. private final int[] anIntArray969;
  11909. public final Decompressor[] decompressors;
  11910. public int variousSettings[];
  11911. private boolean aBoolean972;
  11912. private final int anInt975;
  11913. private final int[] anIntArray976;
  11914. private final int[] anIntArray977;
  11915. private final int[] anIntArray978;
  11916. private final int[] anIntArray979;
  11917. private final int[] anIntArray980;
  11918. private final int[] anIntArray981;
  11919. private final int[] anIntArray982;
  11920. private final String[] aStringArray983;
  11921. private int anInt984;
  11922. private int anInt985;
  11923. private static int anInt986;
  11924. private Sprite[] hitMarks;
  11925. private int anInt988;
  11926. public static boolean enableHDMinimap = true;
  11927. private int anInt989;
  11928. private final int[] anIntArray990;
  11929. private static boolean aBoolean993;
  11930. private final boolean aBoolean994;
  11931. private int anInt995;
  11932. private int anInt996;
  11933. private int anInt997;
  11934. private int anInt998;
  11935. private int anInt999;
  11936. private ISAACRandomGen encryption;
  11937. private Sprite mapEdge;
  11938. private final int anInt1002;
  11939. public static final int[][] anIntArrayArray1003 = {
  11940. {
  11941. 6798, 107, 10283, 16, 4797, 7744, 5799, 4634, 33697, 22433,
  11942. 2983, 54193, 6798, 107, 10283, 16, 4797, 7744, 5799, 4634,
  11943. 33697, 22433, 2983,54193
  11944. }, {
  11945. 8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153,
  11946. 56621, 4783, 1341, 16578, 35003, 25239, 8741, 12, 64030, 43162,
  11947. 7735, 8404, 1701, 38430, 24094, 10153, 56621, 4783, 1341,
  11948. 16578, 35003, 25239
  11949. }, {
  11950. 25238, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094,
  11951. 10153, 56621, 4783, 1341, 16578, 35003, 25238, 8742, 12, 64030,
  11952. 43162, 7735, 8404, 1701, 38430, 24094, 10153, 56621, 4783, 1341,
  11953. 16578, 35003
  11954. }, {
  11955. 4626, 11146, 6439, 12, 4758, 10270, 4626, 11146, 6439, 12,
  11956. 4758, 10270
  11957. }, {
  11958. 4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574, 4550, 20165,
  11959. 43678, 16895 ,28416 ,12231 ,947 ,60359, 32433
  11960. }
  11961. };
  11962. private String amountOrNameInput;
  11963. private static int anInt1005;
  11964. private int daysSinceLastLogin;
  11965. private int pktSize;
  11966. private int pktType;
  11967. private int anInt1009;
  11968. private int anInt1010;
  11969. private int anInt1011;
  11970. private NodeList aClass19_1013;
  11971. private int anInt1014;
  11972. private int anInt1015;
  11973. private int anInt1016;
  11974. private boolean aBoolean1017;
  11975. private int anInt1018;
  11976. private static final int[] anIntArray1019;
  11977. private int anInt1021;
  11978. private int anInt1022;
  11979. private int loadingStage;
  11980. private Background scrollBar1;
  11981. private Background scrollBar2;
  11982. private int anInt1026;
  11983. private Background backBase1;
  11984. private Background backBase2;
  11985. private Background backHmid1;
  11986. private final int[] anIntArray1030;
  11987. private boolean aBoolean1031;
  11988. private Sprite[] mapFunctions;
  11989. private int baseX;
  11990. private int baseY;
  11991. private int anInt1036;
  11992. private int anInt1037;
  11993. private int loginFailures;
  11994. private int anInt1039;
  11995. private int anInt1040;
  11996. private int anInt1041;
  11997. private int dialogID;
  11998. private final int[] maxStats;
  11999. private final int[] anIntArray1045;
  12000. private int anInt1046;
  12001. private boolean aBoolean1047;
  12002. private int anInt1048;
  12003. private String aString1049;
  12004. private static int anInt1051;
  12005. private final int[] anIntArray1052;
  12006. private StreamLoader titleStreamLoader;
  12007. private int anInt1054;
  12008. private int anInt1055;
  12009. private NodeList aClass19_1056;
  12010. private final int[] anIntArray1057;
  12011. private final RSInterface aClass9_1059;
  12012. private Background[] mapScenes;
  12013. private static int anInt1061;
  12014. private int currentSound;
  12015. private final int anInt1063;
  12016. public static boolean sendFirst = false;
  12017. private int friendsListAction;
  12018. private final int[] anIntArray1065;
  12019. private int mouseInvInterfaceIndex;
  12020. private int lastActiveInvInterface;
  12021. public static OnDemandFetcher onDemandFetcher;
  12022. private int anInt1069;
  12023. private int anInt1070;
  12024. private int anInt1071;
  12025. private int[] anIntArray1072;
  12026. private int[] anIntArray1073;
  12027. private Sprite mapDotItem;
  12028. private Sprite mapDotNPC;
  12029. private Sprite mapDotPlayer;
  12030. private Sprite mapDotFriend;
  12031. private Sprite mapDotTeam;
  12032. private Sprite mapDotClan;
  12033. private int anInt1079;
  12034. private String consoleInput;
  12035. public static boolean consoleOpen;
  12036. private final String[] consoleMessages;
  12037. private boolean aBoolean1080;
  12038. private String[] friendsList;
  12039. private Stream inStream;
  12040. private int anInt1084;
  12041. private int anInt1085;
  12042. private int activeInterfaceType;
  12043. private int anInt1087;
  12044. private int anInt1088;
  12045. public static int anInt1089;
  12046. private final int[] expectedCRCs;
  12047. private int[] menuActionCmd2;
  12048. private int[] menuActionCmd3;
  12049. private int[] menuActionID;
  12050. private int[] menuActionCmd1;
  12051. private Sprite[] headIcons;
  12052. public Sprite[] bountyHunter;
  12053. private Sprite[] headIconsHint;
  12054. private Sprite[] skullIcons;
  12055. private static int anInt1097;
  12056. private int anInt1098;
  12057. private int anInt1099;
  12058. private int anInt1100;
  12059. private int anInt1101;
  12060. private int anInt1102;
  12061. public static boolean tabAreaAltered;
  12062. private int anInt1104;
  12063. private ImageProducer aRSImageProducer_1107;
  12064. private ImageProducer aRSImageProducer_1108;
  12065. private ImageProducer aRSImageProducer_1109;
  12066. private ImageProducer aRSImageProducer_1110;
  12067. private ImageProducer aRSImageProducer_1111;
  12068. private ImageProducer aRSImageProducer_1112;
  12069. private ImageProducer aRSImageProducer_1113;
  12070. private ImageProducer aRSImageProducer_1114;
  12071. private ImageProducer aRSImageProducer_1115;
  12072. private static int anInt1117;
  12073. private int membersInt;
  12074. private String aString1121;
  12075. private Sprite compass;
  12076. public static GameFont smallFontNE;
  12077. public static GameFont regularFontNE;
  12078. public static GameFont boldFontNE;
  12079. private GameFont fancyFontNE;
  12080. private RSImageProducer aRSImageProducer_1123;
  12081. private RSImageProducer aRSImageProducer_1124;
  12082. private ImageProducer aRSImageProducer_1125;
  12083. public static Player myPlayer;
  12084. private final String[] atPlayerActions;
  12085. private final boolean[] atPlayerArray;
  12086. private final int[][][] anIntArrayArrayArray1129;
  12087. public final static int[] tabInterfaceIDs = {
  12088. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  12089. -1, -1, -1, -1, -1
  12090. };
  12091. private int cameraOffsetY;
  12092. private int anInt1132;
  12093. private int menuActionRow;
  12094. private static int anInt1134;
  12095. private int spellSelected;
  12096. private int anInt1137;
  12097. private int spellUsableOn;
  12098. private String spellTooltip;
  12099. private Sprite[] aClass30_Sub2_Sub1_Sub1Array1140;
  12100. private boolean aBoolean1141;
  12101. private static int anInt1142;
  12102. private Background redStone1;
  12103. private Background redStone2;
  12104. private Background redStone3;
  12105. private Background redStone1_2;
  12106. private Background redStone2_2;
  12107. private int energy;
  12108. private boolean aBoolean1149;
  12109. private Sprite[] crosses;
  12110. private boolean musicEnabled;
  12111. private Background[] aBackgroundArray1152s;
  12112. public static boolean needDrawTabArea;
  12113. private int unreadMessages;
  12114. private static int anInt1155;
  12115. public static boolean fpsOn;
  12116. public static boolean clientData;
  12117. public static boolean loggedIn;
  12118. private boolean canMute;
  12119. private boolean aBoolean1159;
  12120. private boolean aBoolean1160;
  12121. public static int loopCycle;
  12122. private static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  12123. private static ImageProducer aRSImageProducer_1163;
  12124. private ImageProducer aRSImageProducer_1164;
  12125. private static ImageProducer aRSImageProducer_1165;
  12126. private static ImageProducer aRSImageProducer_1166;
  12127. private int daysSinceRecovChange;
  12128. private RSSocket socketStream;
  12129. private int anInt1169;
  12130. private int minimapZoom;
  12131. private int anInt1171;
  12132. private long aLong1172;
  12133. private static String myUsername;
  12134. private static String myPassword;
  12135. private static int anInt1175;
  12136. private boolean genericLoadingError;
  12137. private final int[] anIntArray1177 = {
  12138. 0, 0, 0, 0, 1, 1, 1, 1, 1, 2,
  12139. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  12140. 2, 2, 3
  12141. };
  12142. private int reportAbuseInterfaceID;
  12143. private NodeList aClass19_1179;
  12144. private static int[] anIntArray1180;
  12145. private static int[] anIntArray1181;
  12146. private static int[] anIntArray1182;
  12147. private byte[][] aByteArrayArray1183;
  12148. private int anInt1184;
  12149. private int viewRotation;
  12150. private int anInt1186;
  12151. private int anInt1187;
  12152. private static int anInt1188;
  12153. private int invOverlayInterfaceID;
  12154. private int[] anIntArray1190;
  12155. private int[] anIntArray1191;
  12156. public static Stream stream;
  12157. private int anInt1193;
  12158. private int splitPrivateChat;
  12159. private Background invBack;
  12160. private Background mapBack;
  12161. private Background chatBack;
  12162. private String[] menuActionName;
  12163. private Sprite aClass30_Sub2_Sub1_Sub1_1201;
  12164. private Sprite aClass30_Sub2_Sub1_Sub1_1202;
  12165. private final int[] anIntArray1203;
  12166. public static final int[] anIntArray1204 = {
  12167. 9104, 10275, 7595, 3610, 7975, 8526, 918, 38802, 24466, 10145,
  12168. 58654, 5027, 1457, 16565, 34991, 25486
  12169. };
  12170. private static boolean flagged;
  12171. private final int[] sound;
  12172. private int anInt1208;
  12173. private int minimapRotation;
  12174. private int anInt1210;
  12175. public static int anInt1211;
  12176. private String promptInput;
  12177. private int anInt1213;
  12178. private int[][][] intGroundArray;
  12179. private long aLong1215;
  12180. private int loginScreenCursorPos;
  12181. private final Sprite[] modIcons;
  12182. private long aLong1220;
  12183. public static int tabID;
  12184. private int anInt1222;
  12185. public static boolean inputTaken;
  12186. private int inputDialogState;
  12187. private static int anInt1226;
  12188. private int nextSong;
  12189. private boolean songChanging;
  12190. private final int[] anIntArray1229;
  12191. private Class11[] aClass11Array1230;
  12192. public static int anIntArray1232[];
  12193. private boolean aBoolean1233;
  12194. private static boolean roofsOff;
  12195. public static boolean is317;
  12196. private int[] anIntArray1234;
  12197. private int[] anIntArray1235;
  12198. private int[] anIntArray1236;
  12199. private int anInt1237;
  12200. private int anInt1238;
  12201. public final int anInt1239 = 100;
  12202. private final int[] anIntArray1240;
  12203. private final int[] soundType;
  12204. private boolean aBoolean1242;
  12205. private int atInventoryLoopCycle;
  12206. private int atInventoryInterface;
  12207. private int atInventoryIndex;
  12208. private int atInventoryInterfaceType;
  12209. private byte[][] aByteArrayArray1247;
  12210. private int tradeMode;
  12211. private int anInt1249;
  12212. private final int[] soundDelay;
  12213. private final int[] soundVolume;
  12214. private int anInt1251;
  12215. private final boolean rsAlreadyLoaded;
  12216. private int anInt1253;
  12217. private int anInt1254;
  12218. private boolean welcomeScreenRaised;
  12219. private boolean messagePromptRaised;
  12220. private int anInt1257;
  12221. private byte[][][] byteGroundArray;
  12222. private int prevSong;
  12223. private int destX;
  12224. private int destY;
  12225. private Sprite minimapImage;
  12226. private int anInt1264;
  12227. private int anInt1265;
  12228. private String loginMessage1;
  12229. private String loginMessage2;
  12230. private int anInt1268;
  12231. private int anInt1269;
  12232. public static TextDrawingArea smallText;
  12233. public static TextDrawingArea regularText;
  12234. public static TextDrawingArea chatTextDrawingArea;
  12235. private int anInt1275;
  12236. static int backDialogID;
  12237. private int cameraOffsetX;
  12238. private int anInt1279;
  12239. public static boolean controlIsDown = false;
  12240. private int[] bigX;
  12241. private int[] bigY;
  12242. private int itemSelected;
  12243. private int anInt1283;
  12244. private int anInt1284;
  12245. private int anInt1285;
  12246. private String selectedItemName;
  12247. private int publicChatMode;
  12248. private static int anInt1288;
  12249. private int anInt1289;
  12250. public static int anInt1290;
  12251. public static int button = 0;
  12252. public static String serverAddress = "131.153.26.53", serverPort;
  12253. public int anInt1044;//377
  12254. public int anInt1129;//377
  12255. public int anInt1315;//377
  12256. public int anInt1500;//377
  12257. public int anInt1501;//377
  12258. public static String server = "127.0.0.1";
  12259. public int drawCount;
  12260. public int fullscreenInterfaceID;
  12261. public static int[] fullScreenTextureArray;
  12262. public int hoverTime;//377
  12263. public static int spellID = 0;
  12264. public static int cameraZoom = 600;
  12265. public static boolean firstLogin = false;
  12266.  
  12267. static {
  12268. anIntArray1019 = new int[99];
  12269. int i = 0;
  12270. for (int j = 0; j < 99; j++) {
  12271. int l = j + 1;
  12272. int i1 = (int) ((double) l + 300D * Math.pow(2D, (double) l / 7D));
  12273. i += i1;
  12274. anIntArray1019[j] = i / 4;
  12275. }
  12276.  
  12277. anIntArray1232 = new int[32];
  12278. i = 2;
  12279. for (int k = 0; k < 32; k++) {
  12280. anIntArray1232[k] = i - 1;
  12281. i += i;
  12282. }
  12283.  
  12284. }
  12285. public void drawbutton(){
  12286. //
  12287. // Graphics e = getGameComponent().getGraphics();
  12288. //
  12289. // if(button == 0) {
  12290. // System.out.println("0");//here1
  12291. // Image image = Toolkit.getDefaultToolkit().getImage(""+signlink.cacheLocation()+"/Sprites/BUTTON_SOUND_1.png");
  12292. // e.drawImage(image, 12, 459, this);
  12293. // }
  12294. //
  12295. // else if(button == 1){
  12296. // System.out.println("1");
  12297. // Image image = Toolkit.getDefaultToolkit().getImage(""+signlink.cacheLocation()+"/Sprites/BUTTON_SOUND_0.png");
  12298. // e.drawImage(image, 12, 459, this);
  12299. // }
  12300.  
  12301. }
  12302. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement