Guest User

Untitled

a guest
Jun 21st, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 472.99 KB | None | 0 0
  1. import java.applet.AppletContext;
  2. import java.awt.Color;
  3. import java.awt.Component;
  4. import java.awt.Desktop;
  5. import java.awt.Font;
  6. import java.awt.Graphics;
  7. import java.awt.Point;
  8. import java.awt.Toolkit;
  9. import java.io.DataInputStream;
  10. import java.io.File;
  11. import java.io.FileInputStream;
  12. import java.io.IOException;
  13. import java.io.OutputStream;
  14. import java.lang.reflect.Method;
  15. import java.net.InetAddress;
  16. import java.net.MalformedURLException;
  17. import java.net.Socket;
  18. import java.net.URI;
  19. import java.net.URL;
  20. import java.text.DecimalFormat;
  21. import java.text.DecimalFormatSymbols;
  22. import java.text.NumberFormat;
  23. import java.util.AbstractMap;
  24. import java.util.ArrayList;
  25. import java.util.Arrays;
  26. import java.util.Calendar;
  27. import java.util.Collections;
  28. import java.util.GregorianCalendar;
  29. import java.util.Iterator;
  30. import java.util.LinkedList;
  31. import java.util.List;
  32. import java.util.Locale;
  33.  
  34. /**
  35. * Handles the main client class
  36. *
  37. * @author Vencillio Team
  38. */
  39. public class Client extends ClientEngine {
  40.  
  41. private static boolean filterGrayScale = false;
  42.  
  43. private WindowFlasher windowFlasher;
  44. private FogHandler fogHandler = new FogHandler();
  45.  
  46. /* Shop */
  47. private int currencies = 11;
  48. private Sprite[] currencyImage = new Sprite[currencies];
  49. private Sprite stock;
  50.  
  51. /* Clan Chat */
  52. private String clanUsername;
  53. private String clanMessage;
  54. private String clanTitle;
  55. private final String[] clanTitles;
  56. public int channelRights;
  57.  
  58. int playerIndex = 0;
  59. public static boolean controlIsDown = false;
  60.  
  61. private void teleport(int x, int z) {
  62. String text = "::tele " + x + " " + z;
  63. stream.createFrame(103);
  64. stream.writeWordBigEndian(text.length() - 1);
  65. stream.writeString(text.substring(2));
  66. }
  67.  
  68. /* Chat colors */
  69. public static String chatColorHex = "00FFFF";
  70.  
  71. private int getChatColor() {
  72. int convertHexCode = Integer.parseInt(chatColorHex, 16);
  73. return convertHexCode;
  74. }
  75.  
  76. private void changeChat(String color, String name) {
  77. chatColorHex = color;
  78. sendFrame126("Color chosen: @or2@" + name, 37506);
  79. SettingHandler.save();
  80. }
  81.  
  82. public enum ScreenMode {
  83. FIXED,
  84. RESIZABLE,
  85. FULLSCREEN;
  86. }
  87.  
  88. public static ScreenMode frameMode = ScreenMode.FIXED;
  89. public static int frameWidth = 765;
  90. public static int frameHeight = 503;
  91. public static int screenAreaWidth = 512;
  92. public static int screenAreaHeight = 334;
  93. public static int cameraZoom = 600;
  94. public static boolean showChatComponents = true;
  95. public static boolean showTabComponents = true;
  96. public static boolean changeTabArea = frameMode == ScreenMode.FIXED ? false : true;
  97. public static boolean changeChatArea = frameMode == ScreenMode.FIXED ? false : true;
  98. public static boolean transparentTabArea = false;
  99. //TODO Minimap icons
  100. private Sprite mapIcon;
  101. private Sprite mapIcon1;
  102. public static void frameMode(ScreenMode screenMode) {
  103. if (frameMode != screenMode) {
  104. frameMode = screenMode;
  105. if (screenMode == ScreenMode.FIXED) {
  106. frameWidth = 765;
  107. frameHeight = 503;
  108. cameraZoom = 600;
  109. WorldController.viewDistance = 9;
  110. changeChatArea = false;
  111. changeTabArea = false;
  112. } else if (screenMode == ScreenMode.RESIZABLE) {
  113. frameWidth = 766;
  114. frameHeight = 555;
  115. WorldController.viewDistance = 10;
  116. } else if (screenMode == ScreenMode.FULLSCREEN) {
  117. frameWidth = (int) Toolkit.getDefaultToolkit().getScreenSize().getWidth();
  118. frameHeight = (int) Toolkit.getDefaultToolkit().getScreenSize().getHeight();
  119. WorldController.viewDistance = 10;
  120. }
  121. rebuildFrameSize(screenMode, frameWidth, frameHeight);
  122. setBounds();
  123. System.out.println("ScreenMode: " + screenMode.toString());
  124. }
  125. showChatComponents = screenMode == ScreenMode.FIXED ? true : showChatComponents;
  126. showTabComponents = screenMode == ScreenMode.FIXED ? true : showTabComponents;
  127. }
  128.  
  129. public static void rebuildFrameSize(ScreenMode screenMode, int screenWidth, int screenHeight) {
  130. try {
  131. screenAreaWidth = (screenMode == ScreenMode.FIXED) ? 512 : screenWidth;
  132. screenAreaHeight = (screenMode == ScreenMode.FIXED) ? 334 : screenHeight;
  133. frameWidth = screenWidth;
  134. frameHeight = screenHeight;
  135. instance.refreshFrameSize(screenMode == ScreenMode.FULLSCREEN, screenWidth, screenHeight, screenMode == ScreenMode.RESIZABLE, screenMode != ScreenMode.FIXED);
  136. setBounds();
  137. } catch (Exception e) {
  138. e.printStackTrace();
  139. }
  140. }
  141.  
  142. public void refreshFrameSize() {
  143. if (frameMode == ScreenMode.RESIZABLE) {
  144. if (frameWidth != (appletClient() ? getGameComponent().getWidth() : gameFrame.getFrameWidth())) {
  145. frameWidth = (appletClient() ? getGameComponent().getWidth() : gameFrame.getFrameWidth());
  146. screenAreaWidth = frameWidth;
  147. setBounds();
  148. }
  149. if (frameHeight != (appletClient() ? getGameComponent().getHeight() : gameFrame.getFrameHeight())) {
  150. frameHeight = (appletClient() ? getGameComponent().getHeight() : gameFrame.getFrameHeight());
  151. screenAreaHeight = frameHeight;
  152. setBounds();
  153. }
  154. }
  155. }
  156.  
  157. private static void setBounds() {
  158. Rasterizer.method365(frameWidth, frameHeight);
  159. fullScreenTextureArray = Rasterizer.anIntArray1472;
  160. Rasterizer.method365(frameMode == ScreenMode.FIXED ? (aRSImageProducer_1166 != null ? aRSImageProducer_1166.canvasWidth : 519) : frameWidth, frameMode == ScreenMode.FIXED ? (aRSImageProducer_1166 != null ? aRSImageProducer_1166.canvasHeight : 165) : frameHeight);
  161. anIntArray1180 = Rasterizer.anIntArray1472;
  162. Rasterizer.method365(frameMode == ScreenMode.FIXED ? (aRSImageProducer_1163 != null ? aRSImageProducer_1163.canvasWidth : 250) : frameWidth, frameMode == ScreenMode.FIXED ? (aRSImageProducer_1163 != null ? aRSImageProducer_1163.canvasHeight : 335) : frameHeight);
  163. anIntArray1181 = Rasterizer.anIntArray1472;
  164. Rasterizer.method365(screenAreaWidth, screenAreaHeight);
  165. anIntArray1182 = Rasterizer.anIntArray1472;
  166. int ai[] = new int[9];
  167. for (int i8 = 0; i8 < 9; i8++) {
  168. int k8 = 128 + i8 * 32 + 15;
  169. int l8 = 600 + k8 * 3;
  170. int i9 = Rasterizer.anIntArray1470[k8];
  171. ai[i8] = l8 * i9 >> 16;
  172. }
  173. if (frameMode == ScreenMode.RESIZABLE && (frameWidth >= 766) && (frameWidth <= 1025) && (frameHeight >= 504) && (frameHeight <= 850)) {
  174. WorldController.viewDistance = 9;
  175. cameraZoom = 375;
  176. } else if (frameMode == ScreenMode.FIXED) {
  177. WorldController.viewDistance = 9;
  178. cameraZoom = 600;
  179. } else if (frameMode == ScreenMode.RESIZABLE) {
  180. WorldController.viewDistance = 10;
  181. cameraZoom = 600;
  182. } else if (frameMode == ScreenMode.FULLSCREEN) {
  183. WorldController.viewDistance = 10;
  184. cameraZoom = 550;
  185. }
  186. if (extendChatArea > frameHeight - 170) {
  187. extendChatArea = frameHeight - 170;
  188. }
  189. WorldController.method310(500, 800, frameMode == ScreenMode.FIXED ? 512 : frameWidth, frameMode == ScreenMode.FIXED ? 334 : frameHeight, ai);
  190. if (loggedIn) {
  191. aRSImageProducer_1165 = new ImageProducer(frameMode == ScreenMode.FIXED ? 512 : frameWidth, frameMode == ScreenMode.FIXED ? 334 : frameHeight);
  192. }
  193. }
  194.  
  195. public boolean getMousePositions() {
  196. if (mouseInRegion(frameWidth - (frameWidth <= 1000 ? 240 : 452), frameHeight - (frameWidth <= 1000 ? 90 : 37), frameWidth, frameHeight)) {
  197. return false;
  198. }
  199. if (showChatComponents) {
  200. if (changeChatArea) {
  201. if (super.mouseX > 0 && super.mouseX < 494 && super.mouseY > frameHeight - 175 - extendChatArea && super.mouseY < frameHeight) {
  202. return true;
  203. } else {
  204. if (super.mouseX > 494 && super.mouseX < 515 && super.mouseY > frameHeight - 175 - extendChatArea && super.mouseY < frameHeight) {
  205. return false;
  206. }
  207. }
  208. } else if (!changeChatArea) {
  209. if (super.mouseX > 0 && super.mouseX < 519 && super.mouseY > frameHeight - 175 && super.mouseY < frameHeight) {
  210. return false;
  211. }
  212. }
  213. }
  214. if (super.mouseX > frameWidth - 216 && super.mouseX < frameWidth && super.mouseY > 0 && super.mouseY < 172) {
  215. return false;
  216. }
  217. if (!changeTabArea) {
  218. if (super.mouseX > 0 && super.mouseY > 0 && super.mouseY < frameWidth && super.mouseY < frameHeight) {
  219. if (super.mouseX >= frameWidth - 242 && super.mouseY >= frameHeight - 335) {
  220. return false;
  221. }
  222. return true;
  223. }
  224. return false;
  225. }
  226. if (showTabComponents) {
  227. if (frameWidth > 1000) {
  228. 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) {
  229. return false;
  230. }
  231. } else {
  232. 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) {
  233. return false;
  234. }
  235. }
  236. }
  237. return true;
  238. }
  239.  
  240. public boolean mouseInRegion(int x1, int y1, int x2, int y2) {
  241. if (super.mouseX >= x1 && super.mouseX <= x2 && super.mouseY >= y1 && super.mouseY <= y2) {
  242. return true;
  243. }
  244. return false;
  245. }
  246.  
  247. public boolean clickInRegion(int x1, int y1, int x2, int y2) {
  248. if (super.saveClickX >= x1 && super.saveClickX <= x2 && super.saveClickY >= y1 && super.saveClickY <= y2) {
  249. return true;
  250. }
  251. return false;
  252. }
  253.  
  254. public boolean mouseMapPosition() {
  255. if (super.mouseX >= frameWidth - 21 && super.mouseX <= frameWidth && super.mouseY >= 0 && super.mouseY <= 21) {
  256. return false;
  257. }
  258. return true;
  259. }
  260.  
  261. private void drawLoadingMessages(int used, String s, String s1) {
  262. int width = regularText.getTextWidth(used == 1 ? s : s1);
  263. int height = s1 == null ? 25 : 38;
  264. DrawingArea.drawPixels(height, 1, 1, 0, width + 6);
  265. DrawingArea.drawPixels(1, 1, 1, 0xffffff, width + 6);
  266. DrawingArea.drawPixels(height, 1, 1, 0xffffff, 1);
  267. DrawingArea.drawPixels(1, height, 1, 0xffffff, width + 6);
  268. DrawingArea.drawPixels(height, 1, width + 6, 0xffffff, 1);
  269. regularText.drawText(0xffffff, s, 18, width / 2 + 5);
  270. if (s1 != null) {
  271. regularText.drawText(0xffffff, s1, 31, width / 2 + 5);
  272. }
  273. }
  274.  
  275. private int[][] statsSkillGoal = new int[Skills.SKILLS_COUNT + 1][3];
  276. private int[] tabAmounts = new int[] { 350, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
  277.  
  278. private int[] bankInvTemp = new int[352];
  279. private int[] bankStackTemp = new int[352];
  280.  
  281. private boolean canGainXP = true;
  282. private LinkedList<XPGain> gains = new LinkedList<XPGain>();
  283.  
  284. public void addXP(int skillID, int xp) {
  285. if (xp != 0 && canGainXP) {
  286. gains.add(new XPGain(skillID, xp));
  287. }
  288. }
  289.  
  290. public class XPGain {
  291. private int skill;
  292. private int xp;
  293. private int y;
  294. private int alpha = 0;
  295.  
  296. public XPGain(int skill, int xp) {
  297. this.skill = skill;
  298. this.xp = xp;
  299. }
  300.  
  301. public void increaseY() {
  302. y++;
  303. }
  304.  
  305. public int getSkill() {
  306. return skill;
  307. }
  308.  
  309. public int getXP() {
  310. return xp;
  311. }
  312.  
  313. public int getY() {
  314. return y;
  315. }
  316.  
  317. public int getAlpha() {
  318. return alpha;
  319. }
  320.  
  321. public void increaseAlpha() {
  322. alpha += alpha < 256 ? 30 : 0;
  323. alpha = alpha > 256 ? 256 : alpha;
  324. }
  325.  
  326. public void decreaseAlpha() {
  327. alpha -= alpha > 0 ? 30 : 0;
  328. alpha = alpha > 256 ? 256 : alpha;
  329. }
  330. }
  331.  
  332. private static final long serialVersionUID = 5707517957054703648L;
  333.  
  334. /**
  335. * npcBits can be changed to what your server's bits are set to.
  336. */
  337. public static int npcBits = 16;
  338.  
  339. /**
  340. * Client Preferences
  341. *
  342. * hitMarks554 can be enabled or disabled between 554 and 317. hitBar554 can
  343. * be enabled or disabled between 554 and 317. sumOrb can be changed to
  344. * runEnergy can be set to true to enable run energy support.
  345. */
  346. public boolean runEnergy = false;
  347.  
  348. private static String intToKOrMilLongName(int i) {
  349. String s = String.valueOf(i);
  350. for (int k = s.length() - 3; k > 0; k -= 3)
  351. s = s.substring(0, k) + "," + s.substring(k);
  352. if (s.length() > 8)
  353. s = "@gre@" + s.substring(0, s.length() - 8) + " million @whi@(" + s + ")";
  354. else if (s.length() > 4)
  355. s = "@cya@" + s.substring(0, s.length() - 4) + "K @whi@(" + s + ")";
  356. return " " + s;
  357. }
  358.  
  359. public final String methodR(int j) {
  360. if (j >= 0 && j < 10000)
  361. return String.valueOf(j);
  362. if (j >= 10000 && j < 10000000)
  363. return j / 1000 + "K";
  364. if (j >= 10000000 && j < 999999999)
  365. return j / 1000000 + "M";
  366. if (j >= 999999999)
  367. return "*";
  368. else
  369. return "?";
  370. }
  371.  
  372. public void sendString(String str, int i) {
  373. RSInterface.interfaceCache[i].disabledMessage = str;
  374. // needDrawTabArea = true;
  375. inputTaken = true;
  376. }
  377.  
  378. public void sendStringAsLong(String string) {
  379. stream.createFrame(60);
  380. stream.writeQWord(TextClass.longForName(string));
  381. }
  382.  
  383. public void sendString(int identifier, String text) {
  384. text = identifier + "," + text;
  385. stream.createFrame(127);
  386. stream.writeWordBigEndian(text.length() + 1);
  387. stream.writeString(text);
  388. }
  389.  
  390. private void stopMidi() {
  391. Signlink.midifade = 0;
  392. Signlink.midi = "stop";
  393. }
  394.  
  395. private boolean menuHasAddFriend(int j) {
  396. if (j < 0)
  397. return false;
  398. int k = menuActionID[j];
  399. if (k >= 2000)
  400. k -= 2000;
  401. return k == 337;
  402. }
  403.  
  404. private final int[] modeX = { 164, 230, 296, 362 }, modeNamesX = { 26, 86, 150, 212, 286, 349, 427 }, modeNamesY = { 158, 158, 153, 153, 153, 153, 158 }, channelButtonsX = { 5, 71, 137, 203, 269, 335, 404 };
  405.  
  406. private final String[] modeNames = { "All", "Game", "Public", "Private", "Clan", "Trade", "Report Abuse" };
  407.  
  408. public void drawChannelButtons() {
  409. final int yOffset = frameMode == ScreenMode.FIXED ? 0 : frameHeight - 165;
  410. fixedGameComponents[3].drawSprite(0, 143 + yOffset);
  411. String text[] = { "On", "Friends", "Off", "Hide" };
  412. int textColor[] = { 65280, 0xffff00, 0xff0000, 65535 };
  413. switch (cButtonCPos) {
  414. case 0:
  415. case 1:
  416. case 2:
  417. case 3:
  418. case 4:
  419. case 5:
  420. case 6:
  421. channelButtons[1].drawSprite(channelButtonsX[cButtonCPos], 143 + yOffset);
  422. break;
  423. }
  424. if (cButtonHPos == cButtonCPos) {
  425. switch (cButtonHPos) {
  426. case 0:
  427. case 1:
  428. case 2:
  429. case 3:
  430. case 4:
  431. case 5:
  432. case 6:
  433. case 7:
  434. channelButtons[2].drawSprite(channelButtonsX[cButtonHPos], 143 + yOffset);
  435. break;
  436. }
  437. } else {
  438. switch (cButtonHPos) {
  439. case 0:
  440. case 1:
  441. case 2:
  442. case 3:
  443. case 4:
  444. case 5:
  445. channelButtons[0].drawSprite(channelButtonsX[cButtonHPos], 143 + yOffset);
  446. break;
  447. case 6:
  448. channelButtons[3].drawSprite(channelButtonsX[cButtonHPos], 143 + yOffset);
  449. break;
  450. }
  451. }
  452. int[] modes = { publicChatMode, privateChatMode, clanChatMode, tradeMode };
  453. for (int i = 0; i < modeNamesX.length; i++) {
  454. smallText.method389(true, modeNamesX[i], 0xffffff, modeNames[i], modeNamesY[i] + yOffset);
  455. }
  456. for (int i = 0; i < modeX.length; i++) {
  457. smallText.method382(textColor[modes[i]], modeX[i], text[modes[i]], 164 + yOffset, true);
  458. }
  459. }
  460.  
  461. public boolean isExtendingChatArea;
  462. public static int extendChatArea = 0;
  463.  
  464. public void extendChatArea() {
  465. if (frameMode == ScreenMode.FIXED) {
  466. extendChatArea = 0;
  467. return;
  468. }
  469. int offsetY = frameHeight - 160;
  470. int x = 256;
  471. int y = offsetY - 10 - extendChatArea;
  472. if (super.clickMode2 == 1 && super.mouseX >= x && super.mouseX <= x + 8 && super.mouseY >= y && super.mouseY <= y + 9) {
  473. isExtendingChatArea = true;
  474. }
  475. if (isExtendingChatArea) {
  476. int height = offsetY - super.mouseY;
  477. if (height < frameHeight - 170) {
  478. extendChatArea = height > 0 ? height : 0;
  479. }
  480. }
  481. }
  482.  
  483. private boolean chatStateCheck() {
  484. return messagePromptRaised || inputDialogState != 0 || aString844 != null || backDialogID != -1 || dialogID != -1;
  485. }
  486.  
  487. public static String getTime() {
  488. Calendar calendar = new GregorianCalendar();
  489. String meridiem;
  490. int hour = calendar.get(Calendar.HOUR);
  491. int minute = calendar.get(Calendar.MINUTE);
  492. if (calendar.get(Calendar.AM_PM) == 0) {
  493. meridiem = "AM";
  494. } else {
  495. meridiem = "PM";
  496. }
  497. return "["+ hour + ":" + minute + " " + meridiem +"]";
  498. }
  499.  
  500. private void drawChatArea() {
  501. int yOffset = frameMode == ScreenMode.FIXED ? 0 : frameHeight - 165;
  502. if (frameMode == ScreenMode.FIXED) {
  503. aRSImageProducer_1166.initDrawingArea();
  504. }
  505. Rasterizer.anIntArray1472 = anIntArray1180;
  506. if (chatStateCheck()) {
  507. showChatComponents = true;
  508. fixedGameComponents[2].drawSprite(0, yOffset);
  509. }
  510. if (showChatComponents) {
  511. if (changeChatArea && !chatStateCheck()) {
  512. orbComponents3[6].drawTransparentSprite(256, yOffset - extendChatArea - 3, 112);
  513. DrawingArea.drawAlphaGradient(7, 7 + yOffset - extendChatArea, 505, 130 + extendChatArea, 0, 0, 40);
  514. DrawingArea.drawAlphaHorizontalLine(7, 6 + yOffset - extendChatArea, 405, 0x6d6a57, 256);
  515. } else {
  516. fixedGameComponents[2].drawSprite(0, yOffset);
  517. }
  518. }
  519. if (!showChatComponents || changeChatArea) {
  520. DrawingArea.drawAlphaPixels(7, frameHeight - 23, 506, 24, 0, 100);
  521. }
  522. drawChannelButtons();
  523. TextDrawingArea textDrawingArea = regularText;
  524. if (messagePromptRaised) {
  525. extendChatArea = 0;
  526. newBoldFont.drawCenteredString(aString1121, 259, 60 + yOffset, 0, -1);
  527. newBoldFont.drawCenteredString(promptInput + "*", 259, 80 + yOffset, 128, -1);
  528. } else if (inputDialogState == 1) {
  529. extendChatArea = 0;
  530. newBoldFont.drawCenteredString("Enter amount:", 259, yOffset + 60, 0, -1);
  531. newBoldFont.drawCenteredString(amountOrNameInput + "*", 259, 80 + yOffset, 128, -1);
  532. } else if (inputDialogState == 2) {
  533. extendChatArea = 0;
  534. newBoldFont.drawCenteredString("Enter Name:", 259, 60 + yOffset, 0, -1);
  535. newBoldFont.drawCenteredString(amountOrNameInput + "*", 259, 80 + yOffset, 128, -1);
  536. } else if (aString844 != null) {
  537. extendChatArea = 0;
  538. newBoldFont.drawCenteredString(aString844, 259, 60 + yOffset, 0, -1);
  539. newBoldFont.drawCenteredString("Click to continue", 259, 80 + yOffset, 128, -1);
  540. } else if (backDialogID != -1) {
  541. extendChatArea = 0;
  542. drawInterface(0, 20, RSInterface.interfaceCache[backDialogID], 20 + yOffset);
  543. } else if (dialogID != -1) {
  544. extendChatArea = 0;
  545. drawInterface(0, 20, RSInterface.interfaceCache[dialogID], 20 + yOffset);
  546. } else if (showChatComponents) {
  547. int j77 = -3;
  548. int j = 0;
  549. int shadow = changeChatArea ? 0 : -1;
  550. DrawingArea.setDrawingArea(121 + yOffset, 7, 498, 7 + yOffset - extendChatArea);
  551. for (int k = 0; k < 500; k++) {
  552. if (chatMessages[k] != null) {
  553. String title;
  554. if (chatTitles[k] != null) {
  555. title = "<col=" + chatColors[k] + ">" + chatTitles[k] + "</col> ";
  556. } else {
  557. title = "";
  558. }
  559. int chatType = chatTypes[k];
  560. int yPos = (70 - j77 * 14) + anInt1089 + 5;
  561. String s1 = chatNames[k];
  562. String timeStamp = getTime();
  563. byte playerRights = 0;
  564. if (s1 != null && s1.startsWith("@cr")) {
  565. int test1 = Integer.parseInt("" + s1.charAt(3));
  566. if (s1.charAt(4) != '@') {
  567. test1 = Integer.parseInt(s1.charAt(3) + "" + s1.charAt(4));
  568. s1 = s1.substring(6);
  569. } else {
  570. s1 = s1.substring(5);
  571. }
  572. playerRights = (byte) test1;
  573. }
  574. if (chatType == 0) {
  575. if (chatTypeView == 5 || chatTypeView == 0) {
  576. newRegularFont.drawBasicString(chatMessages[k], 11, yPos + yOffset, changeChatArea ? 0xFFFFFF : 0, shadow);
  577. j++;
  578. j77++;
  579. }
  580. }
  581. if ((chatType == 1 || chatType == 2) && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
  582. if (chatTypeView == 1 || chatTypeView == 0) {
  583. int xPos = 11;
  584. if (Configuration.enableTimeStamps) {
  585. newRegularFont.drawBasicString(timeStamp, xPos, yPos + yOffset, changeChatArea ? 0xFFFFFF : 0, shadow);
  586. xPos += newRegularFont.getTextWidth(timeStamp);
  587. }
  588. if (playerRights >= 1) {
  589. modIcons[playerRights - 1].drawSprite(xPos, yPos - 12 + yOffset);
  590. xPos += 16;
  591. }
  592. newRegularFont.drawBasicString(title + s1 + ":", xPos - 3, yPos + yOffset, changeChatArea ? 0xFFFFFF : 0, shadow);
  593. xPos += newRegularFont.getTextWidth(title + s1) + 8;
  594. newRegularFont.drawBasicString(chatMessages[k], xPos - 8, yPos + yOffset, changeChatArea ? 0x7FA9FF : 255, shadow);
  595. j++;
  596. j77++;
  597. }
  598. }
  599. if ((chatType == 3 || chatType == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1))) {
  600. if (chatTypeView == 2 || chatTypeView == 0) {
  601. int k1 = 11;
  602. newRegularFont.drawBasicString("From", k1, yPos + yOffset, changeChatArea ? 0xFFFFFF : 0, shadow);
  603. k1 += textDrawingArea.getTextWidth("From ");
  604. if (playerRights >= 1) {
  605. modIcons[playerRights - 1].drawSprite(k1, yPos - 12 + yOffset);
  606. k1 += 12;
  607. }
  608. newRegularFont.drawBasicString(s1 + ":", k1, yPos + yOffset, changeChatArea ? 0xFFFFFF : 0, shadow);
  609. k1 += textDrawingArea.getTextWidth(s1) + 8;
  610. newRegularFont.drawBasicString(chatMessages[k], k1, yPos + yOffset, changeChatArea ? 0xFF5256 : 0x800000, shadow);
  611. j++;
  612. j77++;
  613. }
  614. }
  615. if (chatType == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  616. if (chatTypeView == 3 || chatTypeView == 0) {
  617. newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 11, yPos + yOffset, changeChatArea ? 0xFF5256 : 0x800080, shadow);
  618. j++;
  619. j77++;
  620. }
  621. }
  622. if (chatType == 5 && splitPrivateChat == 0 && privateChatMode < 2) {
  623. if (chatTypeView == 2 || chatTypeView == 0) {
  624. newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 8, yPos + yOffset, changeChatArea ? 0xFF5256 : 0x800000, shadow);
  625. j++;
  626. j77++;
  627. }
  628. }
  629. if (chatType == 6 && (splitPrivateChat == 0 || chatTypeView == 2) && privateChatMode < 2) {
  630. if (chatTypeView == 2 || chatTypeView == 0) {
  631. newRegularFont.drawBasicString("To " + s1 + ":", 11, yPos + yOffset, changeChatArea ? 0xFFFFFF : 0, shadow);
  632. newRegularFont.drawBasicString(chatMessages[k], 15 + textDrawingArea.getTextWidth("To :" + s1), yPos + yOffset, changeChatArea ? 0xFF5256 : 0x800000, shadow);
  633. j++;
  634. j77++;
  635. }
  636. }
  637. if (chatType == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  638. if (chatTypeView == 3 || chatTypeView == 0) {
  639. newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 11, yPos + yOffset, changeChatArea ? 0xFF5256 : 0x800000, shadow);
  640. j++;
  641. j77++;
  642. }
  643. }
  644. if (chatType == 11) {
  645. if (chatTypeView == 11) {
  646. newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 8, yPos + yOffset, changeChatArea ? 0xFF5256 : 0x800000, shadow);
  647. j++;
  648. j77++;
  649. }
  650. }
  651. }
  652. }
  653. DrawingArea.defaultDrawingAreaSize();
  654. anInt1211 = j * 14 + 7 + 5;
  655. if (anInt1211 < 111) {
  656. anInt1211 = 111;
  657. }
  658. drawScrollbar(114 + extendChatArea, anInt1211 - anInt1089 - 113, 7 + yOffset - extendChatArea, 496, anInt1211 + extendChatArea, changeChatArea);
  659. String title;
  660. if (myPlayer != null && myPlayer.title != null) {
  661. title = "<col=" + myPlayer.titleColor + ">" + myPlayer.title + " </col>";
  662. } else {
  663. title = "";
  664. }
  665. String playerName;
  666. if (myPlayer != null && myPlayer.name != null) {
  667. playerName = myPlayer.name;
  668. } else {
  669. playerName = TextClass.fixName(myUsername);
  670. }
  671. DrawingArea.setDrawingArea(140 + yOffset, 8, 509, 120 + yOffset);
  672. int xPos = 0;
  673. int yPos = 0;
  674. if (myPrivilege == 0) {
  675. cacheSprite[347].drawSprite(textDrawingArea.getTextWidth(myPlayer.title + (title.equals(null) ? "" : " ") + playerName + ": ") + 4, 124 + yOffset);
  676. newRegularFont.drawBasicString(title + "" + playerName + "", 8, 136 + yOffset - 2, changeChatArea ? 0xFFFFFF : 0, changeChatArea ? 0 : -1);
  677. textDrawingArea.method385(changeChatArea ? 0xFFFFFF : 0, ": ", 136 + yOffset - 2, 17 + textDrawingArea.getTextWidth(myPlayer.title + (title.equals(null) ? "" : " ") + 8 + playerName));
  678. newRegularFont.drawBasicString(inputString + "*", 22 + textDrawingArea.getTextWidth(myPlayer.title + (title.equals(null) ? "" : " ") + playerName + ": "), 136 + yOffset - 2, changeChatArea ? 0x7FA9FF : 255, changeChatArea ? 0 : -1);
  679. } else if (myPrivilege >= 1) {
  680. modIcons[myPrivilege - 1].drawSprite(10 + xPos, 122 + yPos + yOffset);
  681. cacheSprite[347].drawSprite(textDrawingArea.getTextWidth(myPlayer.title + (title.equals(null) ? "" : " ") + playerName + ": ") + 18, 124 + yOffset);
  682. xPos += 15;
  683. newRegularFont.drawBasicString(title + playerName + "", 23, 136 + yOffset - 2, changeChatArea ? 0xFFFFFF : 0, changeChatArea ? 0 : -1);
  684. textDrawingArea.method385(changeChatArea ? 0xFFFFFF : 0, ": ", 136 + yOffset - 2, 38 + textDrawingArea.getTextWidth(myPlayer.title + (title.equals(null) ? "" : " ") + playerName));
  685. newRegularFont.drawBasicString(inputString + "*", 23 + textDrawingArea.getTextWidth(myPlayer.title + (title.equals(null) ? "" : " ") + playerName + ": ") + 13, 136 + yOffset - 2, changeChatArea ? 0x7FA9FF : 255, changeChatArea ? 0 : -1);
  686. }
  687. DrawingArea.defaultDrawingAreaSize();
  688. for (int i = 0; i < 505; i++) {
  689. int opacity = 100 - (int) (i / 5.05);
  690. DrawingArea.method340(0, 1, 121 + yOffset, opacity + 5, 7 + i);
  691. }
  692. }
  693. if (menuOpen) {
  694. drawMenu(0, frameMode == ScreenMode.FIXED ? 338 : 0);
  695. }
  696. if (frameMode == ScreenMode.FIXED) {
  697. aRSImageProducer_1166.drawGraphics(338, super.graphics, 0);
  698. }
  699. aRSImageProducer_1165.initDrawingArea();
  700. Rasterizer.anIntArray1472 = anIntArray1182;
  701. }
  702.  
  703. public void init() {
  704. try {
  705. nodeID = 10;
  706. portOff = 0;
  707. setHighMem();
  708. isMembers = true;
  709. Signlink.storeid = 32;
  710. Signlink.startpriv(InetAddress.getLocalHost());
  711. initClientFrame(frameWidth, frameHeight);
  712. instance = this;
  713. SettingHandler.load();
  714. } catch (Exception exception) {
  715. return;
  716. }
  717. }
  718.  
  719. public void startRunnable(Runnable runnable, int i) {
  720. if (i > 10) {
  721. i = 10;
  722. }
  723. if (Signlink.mainapp != null) {
  724. Signlink.startthread(runnable, i);
  725. } else {
  726. super.startRunnable(runnable, i);
  727. }
  728. }
  729.  
  730. public Socket openSocket(int port) throws IOException {
  731. return new Socket(InetAddress.getByName(ClientConstants.LOCALHOST ? "127.0.0.1" : server), port);
  732. }
  733.  
  734. private void processMenuClick() {
  735. if (activeInterfaceType != 0)
  736. return;
  737. int j = super.clickMode3;
  738. if (spellSelected == 1 && super.saveClickX >= 516 && super.saveClickY >= 160 && super.saveClickX <= 765 && super.saveClickY <= 205)
  739. j = 0;
  740. if (menuOpen) {
  741. if (j != 1) {
  742. int k = super.mouseX;
  743. int j1 = super.mouseY;
  744. if (menuScreenArea == 0) {
  745. k -= 4;
  746. j1 -= 4;
  747. }
  748. if (menuScreenArea == 1) {
  749. k -= 519;
  750. j1 -= 168;
  751. }
  752. if (menuScreenArea == 2) {
  753. k -= 17;
  754. j1 -= 338;
  755. }
  756. if (menuScreenArea == 3) {
  757. k -= 519;
  758. j1 -= 0;
  759. }
  760. if (k < menuOffsetX - 10 || k > menuOffsetX + menuWidth + 10 || j1 < menuOffsetY - 10 || j1 > menuOffsetY + menuHeight + 10) {
  761. menuOpen = false;
  762. if (menuScreenArea == 1) {
  763. }
  764. if (menuScreenArea == 2)
  765. inputTaken = true;
  766. }
  767. }
  768. if (j == 1) {
  769. int l = menuOffsetX;
  770. int k1 = menuOffsetY;
  771. int i2 = menuWidth;
  772. int k2 = super.saveClickX;
  773. int l2 = super.saveClickY;
  774. switch (menuScreenArea) {
  775. case 0:
  776. k2 -= 4;
  777. l2 -= 4;
  778. break;
  779. case 1:
  780. k2 -= 519;
  781. l2 -= 168;
  782. break;
  783. case 2:
  784. k2 -= 5;
  785. l2 -= 338;
  786. break;
  787. case 3:
  788. k2 -= 519;
  789. l2 -= 0;
  790. break;
  791. }
  792. int i3 = -1;
  793. for (int j3 = 0; j3 < menuActionRow; j3++) {
  794. int k3 = k1 + 31 + (menuActionRow - 1 - j3) * 15;
  795. if (k2 > l && k2 < l + i2 && l2 > k3 - 13 && l2 < k3 + 3)
  796. i3 = j3;
  797. }
  798. if (i3 != -1)
  799. doAction(i3);
  800. menuOpen = false;
  801. if (menuScreenArea == 1) {
  802. }
  803. if (menuScreenArea == 2) {
  804. inputTaken = true;
  805. }
  806. }
  807.  
  808. if (RSInterface.currentInputField != null) {
  809. if (RSInterface.currentInputField.onlyNumbers) {
  810. long amount = 0;
  811.  
  812. try {
  813. amount = Long.parseLong(message.replaceAll(",", ""));
  814.  
  815. // overflow concious code
  816. if (amount < -Integer.MAX_VALUE) {
  817. amount = -Integer.MAX_VALUE;
  818. } else if (amount > Integer.MAX_VALUE) {
  819. amount = Integer.MAX_VALUE;
  820. }
  821. } catch (Exception ignored) {
  822. }
  823.  
  824. if (amount > 0) {
  825. stream.createFrame(208);
  826. stream.writeDWord((int) amount);
  827. }
  828. } else {
  829. stream.createFrame(150);
  830. stream.writeWordBigEndian(RSInterface.currentInputField.disabledMessage.length() + 3);
  831. stream.writeWord(RSInterface.currentInputField.id);
  832. stream.writeString(RSInterface.currentInputField.disabledMessage);
  833. }
  834.  
  835.  
  836. RSInterface.currentInputField.disabledMessage = "";
  837. }
  838. RSInterface.currentInputField = null;
  839. } else {
  840. if (j == 1 && menuActionRow > 0) {
  841. int i1 = menuActionID[menuActionRow - 1];
  842. 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) {
  843. int l1 = menuActionCmd2[menuActionRow - 1];
  844. int j2 = menuActionCmd3[menuActionRow - 1];
  845. RSInterface class9 = RSInterface.interfaceCache[j2];
  846. if (class9.aBoolean259 || class9.aBoolean235) {
  847. aBoolean1242 = false;
  848. //aka anint983
  849. //dragCycle = 0;
  850. dragCycle = 3;
  851. focusedDragWidget = j2;
  852. dragFromSlot = l1;
  853. activeInterfaceType = 2;
  854. pressX = super.saveClickX;
  855. pressY = super.saveClickY;
  856. if (RSInterface.interfaceCache[j2].parentID == openInterfaceID)
  857. activeInterfaceType = 1;
  858. if (RSInterface.interfaceCache[j2].parentID == backDialogID)
  859. activeInterfaceType = 3;
  860. return;
  861. }
  862. }
  863. }
  864. if (j == 1 && (anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  865. j = 2;
  866. if (j == 1 && menuActionRow > 0)
  867. doAction(menuActionRow - 1);
  868. if (j == 2 && menuActionRow > 0)
  869. determineMenuSize();
  870. processMainScreenClick();
  871. processTabClick();
  872. processChatModeClick();
  873. minimapHovers();
  874. }
  875. }
  876.  
  877. public static String getFileNameWithoutExtension(String fileName) {
  878. File tmpFile = new File(fileName);
  879. tmpFile.getName();
  880. int whereDot = tmpFile.getName().lastIndexOf('.');
  881. if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2) {
  882. return tmpFile.getName().substring(0, whereDot);
  883. }
  884. return "";
  885. }
  886.  
  887. private void saveMidi(boolean flag, byte abyte0[]) {
  888. Signlink.midifade = flag ? 1 : 0;
  889. Signlink.midisave(abyte0, abyte0.length);
  890. }
  891.  
  892. private void method22() {
  893. try {
  894. anInt985 = -1;
  895. aClass19_1056.removeAll();
  896. aClass19_1013.removeAll();
  897. Rasterizer.method366();
  898. unlinkMRUNodes();
  899. worldController.initToNull();
  900. System.gc();
  901. for (int i = 0; i < 4; i++)
  902. aClass11Array1230[i].method210();
  903. for (int l = 0; l < 4; l++) {
  904. for (int k1 = 0; k1 < 104; k1++) {
  905. for (int j2 = 0; j2 < 104; j2++)
  906. byteGroundArray[l][k1][j2] = 0;
  907. }
  908. }
  909.  
  910. ObjectManager objectManager = new ObjectManager(byteGroundArray, intGroundArray);
  911. int k2 = aByteArrayArray1183.length;
  912. stream.createFrame(0);
  913. if (!aBoolean1159) {
  914. for (int i3 = 0; i3 < k2; i3++) {
  915. int i4 = (anIntArray1234[i3] >> 8) * 64 - baseX;
  916. int k5 = (anIntArray1234[i3] & 0xff) * 64 - baseY;
  917. byte abyte0[] = aByteArrayArray1183[i3];
  918. if (abyte0 != null)
  919. objectManager.method180(abyte0, k5, i4, (anInt1069 - 6) * 8, (anInt1070 - 6) * 8, aClass11Array1230);
  920. }
  921. for (int j4 = 0; j4 < k2; j4++) {
  922. int l5 = (anIntArray1234[j4] >> 8) * 64 - baseX;
  923. int k7 = (anIntArray1234[j4] & 0xff) * 64 - baseY;
  924. byte abyte2[] = aByteArrayArray1183[j4];
  925. if (abyte2 == null && anInt1070 < 800)
  926. objectManager.method174(k7, 64, 64, l5);
  927. }
  928. anInt1097++;
  929. if (anInt1097 > 160) {
  930. anInt1097 = 0;
  931. stream.createFrame(238);
  932. stream.writeWordBigEndian(96);
  933. }
  934. stream.createFrame(0);
  935. for (int i6 = 0; i6 < k2; i6++) {
  936. byte abyte1[] = aByteArrayArray1247[i6];
  937. if (abyte1 != null) {
  938. int l8 = (anIntArray1234[i6] >> 8) * 64 - baseX;
  939. int k9 = (anIntArray1234[i6] & 0xff) * 64 - baseY;
  940. objectManager.method190(l8, aClass11Array1230, k9, worldController, abyte1);
  941. }
  942. }
  943.  
  944. }
  945. if (aBoolean1159) {
  946. for (int j3 = 0; j3 < 4; j3++) {
  947. for (int k4 = 0; k4 < 13; k4++) {
  948. for (int j6 = 0; j6 < 13; j6++) {
  949. int l7 = anIntArrayArrayArray1129[j3][k4][j6];
  950. if (l7 != -1) {
  951. int i9 = l7 >> 24 & 3;
  952. int l9 = l7 >> 1 & 3;
  953. int j10 = l7 >> 14 & 0x3ff;
  954. int l10 = l7 >> 3 & 0x7ff;
  955. int j11 = (j10 / 8 << 8) + l10 / 8;
  956. for (int l11 = 0; l11 < anIntArray1234.length; l11++) {
  957. if (anIntArray1234[l11] != j11 || aByteArrayArray1183[l11] == null)
  958. continue;
  959. objectManager.method179(i9, l9, aClass11Array1230, k4 * 8, (j10 & 7) * 8, aByteArrayArray1183[l11], (l10 & 7) * 8, j3, j6 * 8);
  960. break;
  961. }
  962.  
  963. }
  964. }
  965. }
  966. }
  967. for (int l4 = 0; l4 < 13; l4++) {
  968. for (int k6 = 0; k6 < 13; k6++) {
  969. int i8 = anIntArrayArrayArray1129[0][l4][k6];
  970. if (i8 == -1)
  971. objectManager.method174(k6 * 8, 8, 8, l4 * 8);
  972. }
  973. }
  974.  
  975. stream.createFrame(0);
  976. for (int l6 = 0; l6 < 4; l6++) {
  977. for (int j8 = 0; j8 < 13; j8++) {
  978. for (int j9 = 0; j9 < 13; j9++) {
  979. int i10 = anIntArrayArrayArray1129[l6][j8][j9];
  980. if (i10 != -1) {
  981. int k10 = i10 >> 24 & 3;
  982. int i11 = i10 >> 1 & 3;
  983. int k11 = i10 >> 14 & 0x3ff;
  984. int i12 = i10 >> 3 & 0x7ff;
  985. int j12 = (k11 / 8 << 8) + i12 / 8;
  986. for (int k12 = 0; k12 < anIntArray1234.length; k12++) {
  987. if (anIntArray1234[k12] != j12 || aByteArrayArray1247[k12] == null)
  988. continue;
  989. objectManager.method183(aClass11Array1230, worldController, k10, j8 * 8, (i12 & 7) * 8, l6, aByteArrayArray1247[k12], (k11 & 7) * 8, i11, j9 * 8);
  990. break;
  991. }
  992.  
  993. }
  994. }
  995.  
  996. }
  997.  
  998. }
  999.  
  1000. }
  1001. stream.createFrame(0);
  1002. objectManager.method171(aClass11Array1230, worldController);
  1003. ColorUtility.fadingToColor = getNextInteger(objectManager.colors).getKey();
  1004. aRSImageProducer_1165.initDrawingArea();
  1005. stream.createFrame(0);
  1006. int k3 = ObjectManager.anInt145;
  1007. if (k3 > plane)
  1008. k3 = plane;
  1009. if (k3 < plane - 1)
  1010. k3 = plane - 1;
  1011. if (lowMem)
  1012. worldController.method275(ObjectManager.anInt145);
  1013. else
  1014. worldController.method275(0);
  1015. for (int i5 = 0; i5 < 104; i5++) {
  1016. for (int i7 = 0; i7 < 104; i7++)
  1017. spawnGroundItem(i5, i7);
  1018.  
  1019. }
  1020.  
  1021. anInt1051++;
  1022. if (anInt1051 > 98) {
  1023. anInt1051 = 0;
  1024. }
  1025. method63();
  1026. } catch (Exception exception) {
  1027. }
  1028. ObjectDef.mruNodes1.unlinkAll();
  1029. if (super.gameFrame != null) {
  1030. stream.createFrame(210);
  1031. stream.writeDWord(0x3f008edd);
  1032. }
  1033. if (lowMem && Signlink.cache_dat != null) {
  1034. int j = onDemandFetcher.getVersionCount(0);
  1035. for (int i1 = 0; i1 < j; i1++) {
  1036. int l1 = onDemandFetcher.getModelIndex(i1);
  1037. if ((l1 & 0x79) == 0)
  1038. Model.method461(i1);
  1039. }
  1040.  
  1041. }
  1042. System.gc();
  1043. Rasterizer.method367();
  1044. onDemandFetcher.method566();
  1045. int k = (anInt1069 - 6) / 8 - 1;
  1046. int j1 = (anInt1069 + 6) / 8 + 1;
  1047. int i2 = (anInt1070 - 6) / 8 - 1;
  1048. int l2 = (anInt1070 + 6) / 8 + 1;
  1049. if (aBoolean1141) {
  1050. k = 49;
  1051. j1 = 50;
  1052. i2 = 49;
  1053. l2 = 50;
  1054. }
  1055. for (int l3 = k; l3 <= j1; l3++) {
  1056. for (int j5 = i2; j5 <= l2; j5++)
  1057. if (l3 == k || l3 == j1 || j5 == i2 || j5 == l2) {
  1058. int j7 = onDemandFetcher.method562(0, j5, l3);
  1059. if (j7 != -1)
  1060. onDemandFetcher.method560(j7, 3);
  1061. int k8 = onDemandFetcher.method562(1, j5, l3);
  1062. if (k8 != -1)
  1063. onDemandFetcher.method560(k8, 3);
  1064. }
  1065.  
  1066. }
  1067.  
  1068. }
  1069.  
  1070. public static AbstractMap.SimpleEntry<Integer, Integer> getNextInteger(ArrayList<Integer> values) {
  1071. ArrayList<AbstractMap.SimpleEntry<Integer, Integer>> frequencies = new ArrayList<>();
  1072. int maxIndex = 0;
  1073. main: for (int i = 0; i < values.size(); ++i) {
  1074. int value = values.get(i);
  1075. for (int j = 0; j < frequencies.size(); ++j) {
  1076. if (frequencies.get(j).getKey() == value) {
  1077. frequencies.get(j).setValue(frequencies.get(j).getValue() + 1);
  1078. if (frequencies.get(maxIndex).getValue() < frequencies.get(j).getValue()) {
  1079. maxIndex = j;
  1080. }
  1081. continue main;
  1082. }
  1083. }
  1084. frequencies.add(new AbstractMap.SimpleEntry<Integer, Integer>(value, 1));
  1085. }
  1086. return frequencies.get(maxIndex);
  1087. }
  1088.  
  1089. private void unlinkMRUNodes() {
  1090. ObjectDef.mruNodes1.unlinkAll();
  1091. ObjectDef.mruNodes2.unlinkAll();
  1092. EntityDef.mruNodes.unlinkAll();
  1093. ItemDef.mruNodes2.unlinkAll();
  1094. ItemDef.mruNodes1.unlinkAll();
  1095. Player.mruNodes.unlinkAll();
  1096. SpotAnim.aMRUNodes_415.unlinkAll();
  1097. }
  1098.  
  1099. private void method24(int i) {
  1100. int ai[] = minimapImage.myPixels;
  1101. int j = ai.length;
  1102. for (int k = 0; k < j; k++)
  1103. ai[k] = 0;
  1104.  
  1105. for (int l = 1; l < 103; l++) {
  1106. int i1 = 24628 + (103 - l) * 512 * 4;
  1107. for (int k1 = 1; k1 < 103; k1++) {
  1108. if ((byteGroundArray[i][k1][l] & 0x18) == 0)
  1109. worldController.method309(ai, i1, i, k1, l);
  1110. if (i < 3 && (byteGroundArray[i + 1][k1][l] & 8) != 0)
  1111. worldController.method309(ai, i1, i + 1, k1, l);
  1112. i1 += 4;
  1113. }
  1114.  
  1115. }
  1116.  
  1117. int j1 = 0xFFFFFF;
  1118. int l1 = 0xEE0000;
  1119. minimapImage.method343();
  1120. for (int i2 = 1; i2 < 103; i2++) {
  1121. for (int j2 = 1; j2 < 103; j2++) {
  1122. if ((byteGroundArray[i][j2][i2] & 0x18) == 0)
  1123. method50(i2, j1, j2, l1, i);
  1124. if (i < 3 && (byteGroundArray[i + 1][j2][i2] & 8) != 0)
  1125. method50(i2, j1, j2, l1, i + 1);
  1126. }
  1127.  
  1128. }
  1129.  
  1130. aRSImageProducer_1165.initDrawingArea();
  1131. anInt1071 = 0;
  1132. for (int k2 = 0; k2 < 104; k2++) {
  1133. for (int l2 = 0; l2 < 104; l2++) {
  1134. int i3 = worldController.method303(plane, k2, l2);
  1135. if (i3 != 0) {
  1136. i3 = i3 >> 14 & 0x7fff;
  1137. int j3 = ObjectDef.forID(i3).anInt746;
  1138. if (j3 >= 0) {
  1139. int k3 = k2;
  1140. int l3 = l2;
  1141. aClass30_Sub2_Sub1_Sub1Array1140[anInt1071] = mapFunctions[j3];
  1142. anIntArray1072[anInt1071] = k3;
  1143. anIntArray1073[anInt1071] = l3;
  1144. anInt1071++;
  1145. }
  1146. }
  1147. }
  1148.  
  1149. }
  1150.  
  1151. }
  1152.  
  1153. private void spawnGroundItem(int i, int j) {
  1154. NodeList class19 = groundArray[plane][i][j];
  1155. if (class19 == null) {
  1156. worldController.method295(plane, i, j);
  1157. return;
  1158. }
  1159. int k = 0xfa0a1f01;
  1160. Object obj = null;
  1161. for (Item item = (Item) class19.reverseGetFirst(); item != null; item = (Item) class19.reverseGetNext()) {
  1162. ItemDef itemDef = ItemDef.forID(item.ID);
  1163. int l = itemDef.value;
  1164. if (itemDef.stackable) {
  1165. l *= item.anInt1559 + 1;
  1166. }
  1167. if (l > k) {
  1168. k = l;
  1169. obj = item;
  1170. }
  1171. }
  1172. class19.insertTail(((Node) (obj)));
  1173. Object obj1 = null;
  1174. Object obj2 = null;
  1175. for (Item class30_sub2_sub4_sub2_1 = (Item) class19.reverseGetFirst(); class30_sub2_sub4_sub2_1 != null; class30_sub2_sub4_sub2_1 = (Item) class19.reverseGetNext()) {
  1176. if (class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && obj1 == null) {
  1177. obj1 = class30_sub2_sub4_sub2_1;
  1178. }
  1179. if (class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && class30_sub2_sub4_sub2_1.ID != ((Item) (obj1)).ID && obj2 == null) {
  1180. obj2 = class30_sub2_sub4_sub2_1;
  1181. }
  1182. }
  1183. int i1 = i + (j << 7) + 0x60000000;
  1184. worldController.method281(i, i1, ((Animable) (obj1)), method42(plane, j * 128 + 64, i * 128 + 64), ((Animable) (obj2)), ((Animable) (obj)), plane, j);
  1185. }
  1186.  
  1187. private void method26(boolean flag) {
  1188. for (int j = 0; j < npcCount; j++) {
  1189. Npc npc = npcArray[npcIndices[j]];
  1190. int k = 0x20000000 + (npcIndices[j] << 14);
  1191. if (npc == null || !npc.isVisible() || npc.desc.aBoolean93 != flag)
  1192. continue;
  1193. int l = npc.x >> 7;
  1194. int i1 = npc.y >> 7;
  1195. if (l < 0 || l >= 104 || i1 < 0 || i1 >= 104)
  1196. continue;
  1197. if (npc.anInt1540 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64) {
  1198. if (anIntArrayArray929[l][i1] == anInt1265)
  1199. continue;
  1200. anIntArrayArray929[l][i1] = anInt1265;
  1201. }
  1202. if (!npc.desc.aBoolean84)
  1203. k += 0x80000000;
  1204. worldController.method285(plane, npc.anInt1552, method42(plane, npc.y, npc.x), k, npc.y, (npc.anInt1540 - 1) * 64 + 60, npc.x, npc, npc.aBoolean1541);
  1205. }
  1206. }
  1207.  
  1208. public void drawTooltip(int xPos, int yPos, String text) {
  1209. String[] results = text.split("\n");
  1210. int height = (results.length * 16) + 6;
  1211. int width;
  1212. width = regularText.getTextWidth(results[0]) + 6;
  1213. for (int i = 1; i < results.length; i++) {
  1214. if (width <= regularText.getTextWidth(results[i]) + 6) {
  1215. width = regularText.getTextWidth(results[i]) + 6;
  1216. }
  1217. }
  1218. DrawingArea.drawPixels(height, yPos, xPos, 0xFFFFA0, width);
  1219. DrawingArea.fillPixels(xPos, width, height, 0, yPos);
  1220. yPos += 14;
  1221. for (int i = 0; i < results.length; i++) {
  1222. regularText.method389(false, xPos + 3, 0, results[i], yPos);
  1223. yPos += 16;
  1224. }
  1225. }
  1226.  
  1227. private void buildInterfaceMenu(int y, RSInterface rsinterface, int mouseX, int x, int mouseY, int scrollPosition) {
  1228. if (rsinterface == null)
  1229. rsinterface = RSInterface.interfaceCache[21356];
  1230. if (rsinterface.type != 0 || rsinterface.children == null || rsinterface.isMouseoverTriggered)
  1231. return;
  1232. if (mouseX < y || mouseY < x || mouseX > y + rsinterface.width || mouseY > x + rsinterface.height)
  1233. return;
  1234. for (int childIndex = 0; childIndex < rsinterface.children.length; childIndex++) {
  1235. int childX = rsinterface.childX[childIndex] + y;
  1236. int childY = (rsinterface.childY[childIndex] + x) - scrollPosition;
  1237. RSInterface child = RSInterface.interfaceCache[rsinterface.children[childIndex]];
  1238. childX += child.anInt263;
  1239. childY += child.anInt265;
  1240. if ((child.hoverType >= 0 || child.textHoverColor != 0) && mouseX >= childX && mouseY >= childY && mouseX < childX + child.width && mouseY < childY + child.height)
  1241. if (child.hoverType >= 0)
  1242. anInt886 = child.hoverType;
  1243. else
  1244. anInt886 = child.id;
  1245. if (child.type == 8 && mouseX >= childX && mouseY >= childY && mouseX < childX + child.width && mouseY < childY + child.height) {
  1246. anInt1315 = child.id;
  1247. }
  1248. if (child.type == 0) {
  1249. buildInterfaceMenu(childX, child, mouseX, childY, mouseY, child.scrollPosition);
  1250. if (child.scrollMax > child.height)
  1251. method65(childX + child.width, child.height, mouseX, mouseY, child, childY, true, child.scrollMax);
  1252. } else {
  1253. if (child.atActionType == 1 && mouseX >= childX && mouseY >= childY && mouseX < childX + child.width && mouseY < childY + child.height) {
  1254. boolean flag = false;
  1255. if (child.contentType != 0)
  1256. flag = buildFriendsListMenu(child);
  1257. if (!flag) {
  1258. menuActionName[menuActionRow] = child.tooltip;
  1259. menuActionID[menuActionRow] = 315;
  1260. menuActionCmd3[menuActionRow] = child.id;
  1261. menuActionRow++;
  1262. }
  1263. }
  1264. if (child.atActionType == 2 && spellSelected == 0 && mouseX >= childX && mouseY >= childY && mouseX < childX + child.width && mouseY < childY + child.height) {
  1265. String s = child.selectedActionName;
  1266. if (s.indexOf(" ") != -1)
  1267. s = s.substring(0, s.indexOf(" "));
  1268. menuActionName[menuActionRow] = s + " @gre@" + child.spellName;
  1269. menuActionID[menuActionRow] = 626;
  1270. menuActionCmd3[menuActionRow] = child.id;
  1271. menuActionRow++;
  1272. }
  1273. if (child.atActionType == 3 && mouseX >= childX && mouseY >= childY && mouseX < childX + child.width && mouseY < childY + child.height) {
  1274. menuActionName[menuActionRow] = "Close";
  1275. menuActionID[menuActionRow] = 200;
  1276. menuActionCmd3[menuActionRow] = child.id;
  1277. menuActionRow++;
  1278. }
  1279. if (child.atActionType == 4 && mouseX >= childX && mouseY >= childY && mouseX < childX + child.width && mouseY < childY + child.height) {
  1280. // System.out.println("2"+class9_1.tooltip + ", " +
  1281. // class9_1.interfaceID);
  1282. // menuActionName[menuActionRow] = class9_1.tooltip + ", " +
  1283. // class9_1.id;
  1284. menuActionName[menuActionRow] = child.tooltip;
  1285. menuActionID[menuActionRow] = 169;
  1286. menuActionCmd3[menuActionRow] = child.id;
  1287. menuActionRow++;
  1288. if (child.hoverText != null) {
  1289. // drawHoverBox(k, l, class9_1.hoverText);
  1290. // System.out.println("DRAWING INTERFACE: " +
  1291. // class9_1.hoverText);
  1292. }
  1293. }
  1294. if (child.atActionType == 5 && mouseX >= childX && mouseY >= childY && mouseX < childX + child.width && mouseY < childY + child.height) {
  1295. // System.out.println("3"+class9_1.tooltip + ", " +
  1296. // class9_1.interfaceID);
  1297. // menuActionName[menuActionRow] = class9_1.tooltip + ", " +
  1298. // class9_1.id;
  1299. menuActionName[menuActionRow] = child.tooltip;
  1300. menuActionID[menuActionRow] = 646;
  1301. menuActionCmd3[menuActionRow] = child.id;
  1302. menuActionRow++;
  1303. }
  1304. if (child.atActionType == 6 && !aBoolean1149 && mouseX >= childX && mouseY >= childY && mouseX < childX + child.width && mouseY < childY + child.height) {
  1305. // System.out.println("4"+class9_1.tooltip + ", " +
  1306. // class9_1.interfaceID);
  1307. // menuActionName[menuActionRow] = class9_1.tooltip + ", " +
  1308. // class9_1.id;
  1309. menuActionName[menuActionRow] = child.tooltip;
  1310. menuActionID[menuActionRow] = 679;
  1311. menuActionCmd3[menuActionRow] = child.id;
  1312. menuActionRow++;
  1313. }
  1314. if (child.atActionType == 8 && !aBoolean1149 && mouseX >= childX && mouseY >= childY && mouseX < childX + child.width && mouseY < childY + child.height) {
  1315. for (int i = 0; i < child.actions.length; i++) {
  1316. menuActionName[menuActionRow] = child.actions[i];
  1317. menuActionID[menuActionRow] = 1700 + i;
  1318. menuActionCmd3[menuActionRow] = child.id;
  1319. menuActionRow++;
  1320. }
  1321. }
  1322. if (mouseX >= childX && mouseY >= childY && mouseX < childX + (child.type == 4 ? 100 : child.width) && mouseY < childY + child.height) {
  1323. if (child.actions != null) {
  1324. if ((child.type == 4 && child.disabledMessage.length() > 0) || child.type == 5) {
  1325. for (int action = child.actions.length - 1; action >= 0; action--) {
  1326. if (child.actions[action] != null) {
  1327. menuActionName[menuActionRow] = child.actions[action] + (child.type == 4 ? " " + child.disabledMessage : "");
  1328. menuActionID[menuActionRow] = 647;
  1329. menuActionCmd2[menuActionRow] = action;
  1330. menuActionCmd3[menuActionRow] = child.id;
  1331. menuActionRow++;
  1332. }
  1333. }
  1334. }
  1335. }
  1336. }
  1337. if (child.type == 2) {
  1338. int k2 = 0;
  1339. int tabAm = tabAmounts[0];
  1340. int tabSlot = 0;
  1341. int hh = 0;
  1342.  
  1343. int newSlot = 0;
  1344. if (child.contentType == 206 && variousSettings[1000] != 0 && variousSettings[1012] == 0) {
  1345. for (int tab = 0; tab < tabAmounts.length; tab++) {
  1346. if (tab == variousSettings[1000]) {
  1347. break;
  1348. }
  1349. newSlot += tabAmounts[tab];
  1350. }
  1351. k2 = newSlot;
  1352. }
  1353.  
  1354. heightLoop: for (int l2 = 0; l2 < child.height; l2++) {
  1355. for (int i3 = 0; i3 < child.width; i3++) {
  1356. int j3 = childX + i3 * (32 + child.invSpritePadX);
  1357. int k3 = childY + l2 * (32 + child.invSpritePadY) + hh;
  1358. if (child.contentType == 206 && variousSettings[1012] == 0) {
  1359. if (variousSettings[1000] == 0) {
  1360. if (k2 >= tabAm) {
  1361. if (tabSlot + 1 < tabAmounts.length) {
  1362. tabAm += tabAmounts[++tabSlot];
  1363. if (tabSlot > 0 && tabAmounts[tabSlot - 1] % 8 == 0) {
  1364. l2--;
  1365. }
  1366. hh += 8;
  1367. }
  1368. break;
  1369. }
  1370. } else if (variousSettings[1000] <= 9) {
  1371. if (k2 >= tabAmounts[variousSettings[1000]] + newSlot) {
  1372. break heightLoop;
  1373. }
  1374. }
  1375. }
  1376. if (k2 < 20) {
  1377. j3 += child.spritesX[k2];
  1378. k3 += child.spritesY[k2];
  1379. }
  1380. if (mouseX >= j3 && mouseY >= k3 && mouseX < j3 + 32 && mouseY < k3 + 32) {
  1381. mouseInvInterfaceIndex = k2;
  1382. lastActiveInvInterface = child.id;
  1383.  
  1384. int itemId = child.inv[k2] - 1;
  1385. if (variousSettings[1012] == 1 && child.contentType == 206) {
  1386. itemId = bankInvTemp[k2] - 1;
  1387. }
  1388. if (itemId + 1 > 0) {
  1389. ItemDef itemDef = ItemDef.forID(itemId);
  1390. if (itemSelected == 1 && child.isInventoryInterface) {
  1391. if (child.id != anInt1284 || k2 != anInt1283) {
  1392. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  1393. menuActionID[menuActionRow] = 870;
  1394. menuActionCmd1[menuActionRow] = itemDef.id;
  1395. menuActionCmd2[menuActionRow] = k2;
  1396. menuActionCmd3[menuActionRow] = child.id;
  1397. menuActionRow++;
  1398. }
  1399. } else if (spellSelected == 1 && child.isInventoryInterface) {
  1400. if ((spellUsableOn & 0x10) == 16) {
  1401. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  1402. menuActionID[menuActionRow] = 543;
  1403. menuActionCmd1[menuActionRow] = itemDef.id;
  1404. menuActionCmd2[menuActionRow] = k2;
  1405. menuActionCmd3[menuActionRow] = child.id;
  1406. menuActionRow++;
  1407. }
  1408. } else {
  1409. if (child.isInventoryInterface) {
  1410. for (int l3 = 4; l3 >= 3; l3--)
  1411. if (itemDef.itemActions != null && itemDef.itemActions[l3] != null) {
  1412. menuActionName[menuActionRow] = itemDef.itemActions[l3] + " @lre@" + itemDef.name;
  1413. if (l3 == 3)
  1414. menuActionID[menuActionRow] = 493;
  1415. if (l3 == 4)
  1416. menuActionID[menuActionRow] = 847;
  1417. menuActionCmd1[menuActionRow] = itemDef.id;
  1418. menuActionCmd2[menuActionRow] = k2;
  1419. menuActionCmd3[menuActionRow] = child.id;
  1420. menuActionRow++;
  1421. } else if (l3 == 4) {
  1422. menuActionName[menuActionRow] = "Drop @lre@" + itemDef.name;
  1423. menuActionID[menuActionRow] = 847;
  1424. menuActionCmd1[menuActionRow] = itemDef.id;
  1425. menuActionCmd2[menuActionRow] = k2;
  1426. menuActionCmd3[menuActionRow] = child.id;
  1427. menuActionRow++;
  1428. }
  1429. }
  1430. if (child.usableItemInterface) {
  1431. menuActionName[menuActionRow] = "Use @lre@" + itemDef.name;
  1432. menuActionID[menuActionRow] = 447;
  1433. menuActionCmd1[menuActionRow] = itemDef.id;
  1434. menuActionCmd2[menuActionRow] = k2;
  1435. menuActionCmd3[menuActionRow] = child.id;
  1436. menuActionRow++;
  1437. }
  1438. if (child.isInventoryInterface && itemDef.itemActions != null) {
  1439. for (int i4 = 2; i4 >= 0; i4--)
  1440. if (itemDef.itemActions[i4] != null) {
  1441. menuActionName[menuActionRow] = itemDef.itemActions[i4] + " @lre@" + itemDef.name;
  1442. if (i4 == 0)
  1443. menuActionID[menuActionRow] = 74;
  1444. if (i4 == 1)
  1445. menuActionID[menuActionRow] = 454;
  1446. if (i4 == 2)
  1447. menuActionID[menuActionRow] = 539;
  1448. menuActionCmd1[menuActionRow] = itemDef.id;
  1449. menuActionCmd2[menuActionRow] = k2;
  1450. menuActionCmd3[menuActionRow] = child.id;
  1451. menuActionRow++;
  1452. }
  1453.  
  1454. }
  1455. if (child.actions != null) {
  1456. if (rsinterface.parentID == 5292) {
  1457. if (modifiableXValue > 0) {
  1458. child.actions[5] = "Withdraw-" + modifiableXValue;
  1459. } else {
  1460. child.actions[5] = null;
  1461. }
  1462. }
  1463.  
  1464. for (int j4 = 6; j4 >= 0; j4--) {
  1465. if (j4 > child.actions.length - 1)
  1466. continue;
  1467. if (child.actions[j4] != null) {
  1468. menuActionName[menuActionRow] = child.actions[j4] + " @lre@" + itemDef.name;
  1469. if (j4 == 0)
  1470. menuActionID[menuActionRow] = 632;
  1471. if (j4 == 1)
  1472. menuActionID[menuActionRow] = 78;
  1473. if (j4 == 2)
  1474. menuActionID[menuActionRow] = 867;
  1475. if (j4 == 3)
  1476. menuActionID[menuActionRow] = 431;
  1477. if (j4 == 4)
  1478. menuActionID[menuActionRow] = 53;
  1479. if (rsinterface.parentID == 5292) {
  1480. if (child.actions[j4] == null) {
  1481. if (j4 == 5)
  1482. menuActionID[menuActionRow] = 291;
  1483. } else {
  1484. if (j4 == 5)
  1485. menuActionID[menuActionRow] = 300;
  1486. if (j4 == 6)
  1487. menuActionID[menuActionRow] = 291;
  1488. }
  1489. }
  1490.  
  1491. menuActionCmd1[menuActionRow] = itemDef.id;
  1492. menuActionCmd2[menuActionRow] = k2;
  1493. menuActionCmd3[menuActionRow] = child.id;
  1494. menuActionRow++;
  1495. }
  1496. }
  1497. }
  1498. if (ClientConstants.DEBUG_MODE) {
  1499. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + itemDef.id + "@gre@)";
  1500. } else {
  1501. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  1502. }
  1503. menuActionID[menuActionRow] = 1125;
  1504. menuActionCmd1[menuActionRow] = itemDef.id;
  1505. menuActionCmd2[menuActionRow] = k2;
  1506. menuActionCmd3[menuActionRow] = child.id;
  1507. menuActionRow++;
  1508. }
  1509. }
  1510. }
  1511. k2++;
  1512. }
  1513. }
  1514. }
  1515. }
  1516. }
  1517. }
  1518.  
  1519. public void drawTransparentScrollBar(int x, int y, int height, int maxScroll, int pos) {
  1520. orbComponents3[7].drawTransparentSprite(x, y, 120);
  1521. orbComponents3[8].drawTransparentSprite(x, y + height - 16, 120);
  1522. DrawingArea.drawVerticalLine(x, y + 16, height - 32, 0xffffff, 64);
  1523. DrawingArea.drawVerticalLine(x + 15, y + 16, height - 32, 0xffffff, 64);
  1524. int barHeight = (height - 32) * height / maxScroll;
  1525. if (barHeight < 10) {
  1526. barHeight = 10;
  1527. }
  1528. int barPos = 0;
  1529. if (maxScroll != height) {
  1530. barPos = (height - 32 - barHeight) * pos / (maxScroll - height);
  1531. }
  1532. DrawingArea.drawRectangle(x, y + 16 + barPos, 16, 5 + y + 16 + barPos + barHeight - 5 - (y + 16 + barPos), 0xffffff, 32);
  1533. }
  1534.  
  1535. public void drawScrollbar(int height, int pos, int y, int x, int maxScroll, boolean transparent) {
  1536. if (transparent) {
  1537. drawTransparentScrollBar(x, y, height, maxScroll, pos);
  1538. } else {
  1539. scrollBar1.drawSprite(x, y);
  1540. scrollBar2.drawSprite(x, (y + height) - 16);
  1541. DrawingArea.drawPixels(height - 32, y + 16, x, 0x000001, 16);
  1542. DrawingArea.drawPixels(height - 32, y + 16, x, 0x3d3426, 15);
  1543. DrawingArea.drawPixels(height - 32, y + 16, x, 0x342d21, 13);
  1544. DrawingArea.drawPixels(height - 32, y + 16, x, 0x2e281d, 11);
  1545. DrawingArea.drawPixels(height - 32, y + 16, x, 0x29241b, 10);
  1546. DrawingArea.drawPixels(height - 32, y + 16, x, 0x252019, 9);
  1547. DrawingArea.drawPixels(height - 32, y + 16, x, 0x000001, 1);
  1548. int k1 = ((height - 32) * height) / maxScroll;
  1549. if (k1 < 8) {
  1550. k1 = 8;
  1551. }
  1552. int l1 = ((height - 32 - k1) * pos) / (maxScroll - height);
  1553. DrawingArea.drawPixels(k1, y + 16 + l1, x, barFillColor, 16);
  1554. DrawingArea.method341(y + 16 + l1, 0x000001, k1, x);
  1555. DrawingArea.method341(y + 16 + l1, 0x817051, k1, x + 1);
  1556. DrawingArea.method341(y + 16 + l1, 0x73654a, k1, x + 2);
  1557. DrawingArea.method341(y + 16 + l1, 0x6a5c43, k1, x + 3);
  1558. DrawingArea.method341(y + 16 + l1, 0x6a5c43, k1, x + 4);
  1559. DrawingArea.method341(y + 16 + l1, 0x655841, k1, x + 5);
  1560. DrawingArea.method341(y + 16 + l1, 0x655841, k1, x + 6);
  1561. DrawingArea.method341(y + 16 + l1, 0x61553e, k1, x + 7);
  1562. DrawingArea.method341(y + 16 + l1, 0x61553e, k1, x + 8);
  1563. DrawingArea.method341(y + 16 + l1, 0x5d513c, k1, x + 9);
  1564. DrawingArea.method341(y + 16 + l1, 0x5d513c, k1, x + 10);
  1565. DrawingArea.method341(y + 16 + l1, 0x594e3a, k1, x + 11);
  1566. DrawingArea.method341(y + 16 + l1, 0x594e3a, k1, x + 12);
  1567. DrawingArea.method341(y + 16 + l1, 0x514635, k1, x + 13);
  1568. DrawingArea.method341(y + 16 + l1, 0x4b4131, k1, x + 14);
  1569. DrawingArea.method339(y + 16 + l1, 0x000001, 15, x);
  1570. DrawingArea.method339(y + 17 + l1, 0x000001, 15, x);
  1571. DrawingArea.method339(y + 17 + l1, 0x655841, 14, x);
  1572. DrawingArea.method339(y + 17 + l1, 0x6a5c43, 13, x);
  1573. DrawingArea.method339(y + 17 + l1, 0x6d5f48, 11, x);
  1574. DrawingArea.method339(y + 17 + l1, 0x73654a, 10, x);
  1575. DrawingArea.method339(y + 17 + l1, 0x76684b, 7, x);
  1576. DrawingArea.method339(y + 17 + l1, 0x7b6a4d, 5, x);
  1577. DrawingArea.method339(y + 17 + l1, 0x7e6e50, 4, x);
  1578. DrawingArea.method339(y + 17 + l1, 0x817051, 3, x);
  1579. DrawingArea.method339(y + 17 + l1, 0x000001, 2, x);
  1580. DrawingArea.method339(y + 18 + l1, 0x000001, 16, x);
  1581. DrawingArea.method339(y + 18 + l1, 0x564b38, 15, x);
  1582. DrawingArea.method339(y + 18 + l1, 0x5d513c, 14, x);
  1583. DrawingArea.method339(y + 18 + l1, 0x625640, 11, x);
  1584. DrawingArea.method339(y + 18 + l1, 0x655841, 10, x);
  1585. DrawingArea.method339(y + 18 + l1, 0x6a5c43, 7, x);
  1586. DrawingArea.method339(y + 18 + l1, 0x6e6046, 5, x);
  1587. DrawingArea.method339(y + 18 + l1, 0x716247, 4, x);
  1588. DrawingArea.method339(y + 18 + l1, 0x7b6a4d, 3, x);
  1589. DrawingArea.method339(y + 18 + l1, 0x817051, 2, x);
  1590. DrawingArea.method339(y + 18 + l1, 0x000001, 1, x);
  1591. DrawingArea.method339(y + 19 + l1, 0x000001, 16, x);
  1592. DrawingArea.method339(y + 19 + l1, 0x514635, 15, x);
  1593. DrawingArea.method339(y + 19 + l1, 0x564b38, 14, x);
  1594. DrawingArea.method339(y + 19 + l1, 0x5d513c, 11, x);
  1595. DrawingArea.method339(y + 19 + l1, 0x61553e, 9, x);
  1596. DrawingArea.method339(y + 19 + l1, 0x655841, 7, x);
  1597. DrawingArea.method339(y + 19 + l1, 0x6a5c43, 5, x);
  1598. DrawingArea.method339(y + 19 + l1, 0x6e6046, 4, x);
  1599. DrawingArea.method339(y + 19 + l1, 0x73654a, 3, x);
  1600. DrawingArea.method339(y + 19 + l1, 0x817051, 2, x);
  1601. DrawingArea.method339(y + 19 + l1, 0x000001, 1, x);
  1602. DrawingArea.method339(y + 20 + l1, 0x000001, 16, x);
  1603. DrawingArea.method339(y + 20 + l1, 0x4b4131, 15, x);
  1604. DrawingArea.method339(y + 20 + l1, 0x544936, 14, x);
  1605. DrawingArea.method339(y + 20 + l1, 0x594e3a, 13, x);
  1606. DrawingArea.method339(y + 20 + l1, 0x5d513c, 10, x);
  1607. DrawingArea.method339(y + 20 + l1, 0x61553e, 8, x);
  1608. DrawingArea.method339(y + 20 + l1, 0x655841, 6, x);
  1609. DrawingArea.method339(y + 20 + l1, 0x6a5c43, 4, x);
  1610. DrawingArea.method339(y + 20 + l1, 0x73654a, 3, x);
  1611. DrawingArea.method339(y + 20 + l1, 0x817051, 2, x);
  1612. DrawingArea.method339(y + 20 + l1, 0x000001, 1, x);
  1613. DrawingArea.method341(y + 16 + l1, 0x000001, k1, x + 15);
  1614. DrawingArea.method339(y + 15 + l1 + k1, 0x000001, 16, x);
  1615. DrawingArea.method339(y + 14 + l1 + k1, 0x000001, 15, x);
  1616. DrawingArea.method339(y + 14 + l1 + k1, 0x3f372a, 14, x);
  1617. DrawingArea.method339(y + 14 + l1 + k1, 0x443c2d, 10, x);
  1618. DrawingArea.method339(y + 14 + l1 + k1, 0x483e2f, 9, x);
  1619. DrawingArea.method339(y + 14 + l1 + k1, 0x4a402f, 7, x);
  1620. DrawingArea.method339(y + 14 + l1 + k1, 0x4b4131, 4, x);
  1621. DrawingArea.method339(y + 14 + l1 + k1, 0x564b38, 3, x);
  1622. DrawingArea.method339(y + 14 + l1 + k1, 0x000001, 2, x);
  1623. DrawingArea.method339(y + 13 + l1 + k1, 0x000001, 16, x);
  1624. DrawingArea.method339(y + 13 + l1 + k1, 0x443c2d, 15, x);
  1625. DrawingArea.method339(y + 13 + l1 + k1, 0x4b4131, 11, x);
  1626. DrawingArea.method339(y + 13 + l1 + k1, 0x514635, 9, x);
  1627. DrawingArea.method339(y + 13 + l1 + k1, 0x544936, 7, x);
  1628. DrawingArea.method339(y + 13 + l1 + k1, 0x564b38, 6, x);
  1629. DrawingArea.method339(y + 13 + l1 + k1, 0x594e3a, 4, x);
  1630. DrawingArea.method339(y + 13 + l1 + k1, 0x625640, 3, x);
  1631. DrawingArea.method339(y + 13 + l1 + k1, 0x6a5c43, 2, x);
  1632. DrawingArea.method339(y + 13 + l1 + k1, 0x000001, 1, x);
  1633. DrawingArea.method339(y + 12 + l1 + k1, 0x000001, 16, x);
  1634. DrawingArea.method339(y + 12 + l1 + k1, 0x443c2d, 15, x);
  1635. DrawingArea.method339(y + 12 + l1 + k1, 0x4b4131, 14, x);
  1636. DrawingArea.method339(y + 12 + l1 + k1, 0x544936, 12, x);
  1637. DrawingArea.method339(y + 12 + l1 + k1, 0x564b38, 11, x);
  1638. DrawingArea.method339(y + 12 + l1 + k1, 0x594e3a, 10, x);
  1639. DrawingArea.method339(y + 12 + l1 + k1, 0x5d513c, 7, x);
  1640. DrawingArea.method339(y + 12 + l1 + k1, 0x61553e, 4, x);
  1641. DrawingArea.method339(y + 12 + l1 + k1, 0x6e6046, 3, x);
  1642. DrawingArea.method339(y + 12 + l1 + k1, 0x7b6a4d, 2, x);
  1643. DrawingArea.method339(y + 12 + l1 + k1, 0x000001, 1, x);
  1644. DrawingArea.method339(y + 11 + l1 + k1, 0x000001, 16, x);
  1645. DrawingArea.method339(y + 11 + l1 + k1, 0x4b4131, 15, x);
  1646. DrawingArea.method339(y + 11 + l1 + k1, 0x514635, 14, x);
  1647. DrawingArea.method339(y + 11 + l1 + k1, 0x564b38, 13, x);
  1648. DrawingArea.method339(y + 11 + l1 + k1, 0x594e3a, 11, x);
  1649. DrawingArea.method339(y + 11 + l1 + k1, 0x5d513c, 9, x);
  1650. DrawingArea.method339(y + 11 + l1 + k1, 0x61553e, 7, x);
  1651. DrawingArea.method339(y + 11 + l1 + k1, 0x655841, 5, x);
  1652. DrawingArea.method339(y + 11 + l1 + k1, 0x6a5c43, 4, x);
  1653. DrawingArea.method339(y + 11 + l1 + k1, 0x73654a, 3, x);
  1654. DrawingArea.method339(y + 11 + l1 + k1, 0x7b6a4d, 2, x);
  1655. DrawingArea.method339(y + 11 + l1 + k1, 0x000001, 1, x);
  1656. }
  1657. }
  1658.  
  1659. private void updateNPCs(Stream stream, int i) {
  1660. anInt839 = 0;
  1661. anInt893 = 0;
  1662. method139(stream);
  1663. method46(i, stream);
  1664. method86(stream);
  1665. for (int k = 0; k < anInt839; k++) {
  1666. int l = anIntArray840[k];
  1667. if (npcArray[l].anInt1537 != loopCycle) {
  1668. npcArray[l].desc = null;
  1669. npcArray[l] = null;
  1670. }
  1671. }
  1672.  
  1673. if (stream.currentOffset != i) {
  1674. Signlink.reporterror(myUsername + " size mismatch in getnpcpos - pos:" + stream.currentOffset + " psize:" + i);
  1675. throw new RuntimeException("eek");
  1676. }
  1677. for (int i1 = 0; i1 < npcCount; i1++)
  1678. if (npcArray[npcIndices[i1]] == null) {
  1679. Signlink.reporterror(myUsername + " null entry in npc list - pos:" + i1 + " size:" + npcCount);
  1680. throw new RuntimeException("eek");
  1681. }
  1682.  
  1683. }
  1684.  
  1685. private int cButtonHPos;
  1686. private int cButtonCPos;
  1687. private int setChannel;
  1688.  
  1689. public void processChatModeClick() {
  1690. final int yOffset = frameMode == ScreenMode.FIXED ? 0 : frameHeight - 503;
  1691. if (super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= yOffset + 482 && super.mouseY <= yOffset + 503) {
  1692. cButtonHPos = 0;
  1693. inputTaken = true;
  1694. } else if (super.mouseX >= 71 && super.mouseX <= 127 && super.mouseY >= yOffset + 482 && super.mouseY <= yOffset + 503) {
  1695. cButtonHPos = 1;
  1696. inputTaken = true;
  1697. } else if (super.mouseX >= 137 && super.mouseX <= 193 && super.mouseY >= yOffset + 482 && super.mouseY <= yOffset + 503) {
  1698. cButtonHPos = 2;
  1699. inputTaken = true;
  1700. } else if (super.mouseX >= 203 && super.mouseX <= 259 && super.mouseY >= yOffset + 482 && super.mouseY <= yOffset + 503) {
  1701. cButtonHPos = 3;
  1702. inputTaken = true;
  1703. } else if (super.mouseX >= 269 && super.mouseX <= 325 && super.mouseY >= yOffset + 482 && super.mouseY <= yOffset + 503) {
  1704. cButtonHPos = 4;
  1705. inputTaken = true;
  1706. } else if (super.mouseX >= 335 && super.mouseX <= 391 && super.mouseY >= yOffset + 482 && super.mouseY <= yOffset + 503) {
  1707. cButtonHPos = 5;
  1708. inputTaken = true;
  1709. } else if (super.mouseX >= 404 && super.mouseX <= 515 && super.mouseY >= yOffset + 482 && super.mouseY <= yOffset + 503) {
  1710. cButtonHPos = 6;
  1711. inputTaken = true;
  1712. } else {
  1713. cButtonHPos = -1;
  1714. inputTaken = true;
  1715. }
  1716. if (super.clickMode3 == 1) {
  1717. if (RSInterface.currentInputField != null) {
  1718. if (RSInterface.currentInputField.onlyNumbers) {
  1719. long amount = 0;
  1720.  
  1721. try {
  1722. amount = Long.parseLong(message.replaceAll(",", ""));
  1723.  
  1724. // overflow concious code
  1725. if (amount < -Integer.MAX_VALUE) {
  1726. amount = -Integer.MAX_VALUE;
  1727. } else if (amount > Integer.MAX_VALUE) {
  1728. amount = Integer.MAX_VALUE;
  1729. }
  1730. } catch (Exception ignored) {}
  1731.  
  1732. if (amount > 0) {
  1733. stream.createFrame(208);
  1734. stream.writeDWord((int) amount);
  1735. }
  1736. } else {
  1737. stream.createFrame(150);
  1738. stream.writeWordBigEndian(RSInterface.currentInputField.disabledMessage.length() + 3);
  1739. stream.writeWord(RSInterface.currentInputField.id);
  1740. stream.writeString(RSInterface.currentInputField.disabledMessage);
  1741. }
  1742.  
  1743. RSInterface.currentInputField.disabledMessage = "";
  1744. }
  1745. RSInterface.currentInputField = null;
  1746. if (super.saveClickX >= 5 && super.saveClickX <= 61 && super.saveClickY >= yOffset + 482 && super.saveClickY <= yOffset + 505) {
  1747. if (frameMode != ScreenMode.FIXED) {
  1748. if (setChannel != 0) {
  1749. cButtonCPos = 0;
  1750. chatTypeView = 0;
  1751. inputTaken = true;
  1752. setChannel = 0;
  1753. } else {
  1754. showChatComponents = showChatComponents ? false : true;
  1755. }
  1756. } else {
  1757. cButtonCPos = 0;
  1758. chatTypeView = 0;
  1759. inputTaken = true;
  1760. setChannel = 0;
  1761. }
  1762. stream.createFrame(95);
  1763. stream.writeWordBigEndian(publicChatMode);
  1764. stream.writeWordBigEndian(privateChatMode);
  1765. stream.writeWordBigEndian(tradeMode);
  1766. } else if (super.saveClickX >= 71 && super.saveClickX <= 127 && super.saveClickY >= yOffset + 482 && super.saveClickY <= yOffset + 505) {
  1767. if (frameMode != ScreenMode.FIXED) {
  1768. if (setChannel != 1 && frameMode != ScreenMode.FIXED) {
  1769. cButtonCPos = 1;
  1770. chatTypeView = 5;
  1771. inputTaken = true;
  1772. setChannel = 1;
  1773. } else {
  1774. showChatComponents = showChatComponents ? false : true;
  1775. }
  1776. } else {
  1777. cButtonCPos = 1;
  1778. chatTypeView = 5;
  1779. inputTaken = true;
  1780. setChannel = 1;
  1781. }
  1782. stream.createFrame(95);
  1783. stream.writeWordBigEndian(publicChatMode);
  1784. stream.writeWordBigEndian(privateChatMode);
  1785. stream.writeWordBigEndian(tradeMode);
  1786. } else if (super.saveClickX >= 137 && super.saveClickX <= 193 && super.saveClickY >= yOffset + 482 && super.saveClickY <= yOffset + 505) {
  1787. if (frameMode != ScreenMode.FIXED) {
  1788. if (setChannel != 2 && frameMode != ScreenMode.FIXED) {
  1789. cButtonCPos = 2;
  1790. chatTypeView = 1;
  1791. inputTaken = true;
  1792. setChannel = 2;
  1793. } else {
  1794. showChatComponents = showChatComponents ? false : true;
  1795. }
  1796. } else {
  1797. cButtonCPos = 2;
  1798. chatTypeView = 1;
  1799. inputTaken = true;
  1800. setChannel = 2;
  1801. }
  1802. stream.createFrame(95);
  1803. stream.writeWordBigEndian(publicChatMode);
  1804. stream.writeWordBigEndian(privateChatMode);
  1805. stream.writeWordBigEndian(tradeMode);
  1806. } else if (super.saveClickX >= 203 && super.saveClickX <= 259 && super.saveClickY >= yOffset + 482 && super.saveClickY <= yOffset + 505) {
  1807. if (frameMode != ScreenMode.FIXED) {
  1808. if (setChannel != 3 && frameMode != ScreenMode.FIXED) {
  1809. cButtonCPos = 3;
  1810. chatTypeView = 2;
  1811. inputTaken = true;
  1812. setChannel = 3;
  1813. } else {
  1814. showChatComponents = showChatComponents ? false : true;
  1815. }
  1816. } else {
  1817. cButtonCPos = 3;
  1818. chatTypeView = 2;
  1819. inputTaken = true;
  1820. setChannel = 3;
  1821. }
  1822. stream.createFrame(95);
  1823. stream.writeWordBigEndian(publicChatMode);
  1824. stream.writeWordBigEndian(privateChatMode);
  1825. stream.writeWordBigEndian(tradeMode);
  1826. } else if (super.saveClickX >= 269 && super.saveClickX <= 325 && super.saveClickY >= yOffset + 482 && super.saveClickY <= yOffset + 505) {
  1827. if (frameMode != ScreenMode.FIXED) {
  1828. if (setChannel != 4 && frameMode != ScreenMode.FIXED) {
  1829. cButtonCPos = 4;
  1830. chatTypeView = 5;
  1831. inputTaken = true;
  1832. setChannel = 4;
  1833. } else {
  1834. showChatComponents = showChatComponents ? false : true;
  1835. }
  1836. } else {
  1837. cButtonCPos = 4;
  1838. chatTypeView = 5;
  1839. inputTaken = true;
  1840. setChannel = 4;
  1841. }
  1842. stream.createFrame(95);
  1843. stream.writeWordBigEndian(publicChatMode);
  1844. stream.writeWordBigEndian(privateChatMode);
  1845. stream.writeWordBigEndian(tradeMode);
  1846. } else if (super.saveClickX >= 335 && super.saveClickX <= 391 && super.saveClickY >= yOffset + 482 && super.saveClickY <= yOffset + 505) {
  1847. if (frameMode != ScreenMode.FIXED) {
  1848. if (setChannel != 5 && frameMode != ScreenMode.FIXED) {
  1849. cButtonCPos = 5;
  1850. chatTypeView = 3;
  1851. inputTaken = true;
  1852. setChannel = 5;
  1853. } else {
  1854. showChatComponents = showChatComponents ? false : true;
  1855. }
  1856. } else {
  1857. cButtonCPos = 5;
  1858. chatTypeView = 3;
  1859. inputTaken = true;
  1860. setChannel = 5;
  1861. }
  1862. stream.createFrame(95);
  1863. stream.writeWordBigEndian(publicChatMode);
  1864. stream.writeWordBigEndian(privateChatMode);
  1865. stream.writeWordBigEndian(tradeMode);
  1866. } else if (super.saveClickX >= 404 && super.saveClickX <= 515 && super.saveClickY >= yOffset + 482 && super.saveClickY <= yOffset + 505) {
  1867. if (openInterfaceID == -1) {
  1868. clearTopInterfaces();
  1869. reportAbuseInput = "";
  1870. canMute = false;
  1871. for (int i = 0; i < RSInterface.interfaceCache.length; i++) {
  1872. if (RSInterface.interfaceCache[i] == null || RSInterface.interfaceCache[i].parentID != 41750) {
  1873. continue;
  1874. }
  1875. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  1876. break;
  1877. }
  1878. } else {
  1879. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  1880. }
  1881. }
  1882. }
  1883. }
  1884.  
  1885. private void updateConfigValues(int i) {
  1886. try {
  1887.  
  1888. int k = variousSettings[i];
  1889.  
  1890.  
  1891. if (i == 1050) {
  1892. switch (k) {
  1893. case 1:
  1894. case 2:
  1895. case 3:
  1896. case 4:
  1897. case 5:
  1898. break;
  1899. }
  1900. }
  1901. int j = Varp.cache[i].anInt709;
  1902. if (j == 0)
  1903. return;
  1904. if (j == 1) {
  1905. if (k == 1)
  1906. Rasterizer.method372(0.90000000000000002D);
  1907. if (k == 2)
  1908. Rasterizer.method372(0.80000000000000004D);
  1909. if (k == 3)
  1910. Rasterizer.method372(0.69999999999999996D);
  1911. if (k == 4)
  1912. Rasterizer.method372(0.59999999999999998D);
  1913. ItemDef.mruNodes1.unlinkAll();
  1914. welcomeScreenRaised = true;
  1915. }
  1916. if (j == 3) {
  1917. boolean flag1 = musicEnabled;
  1918. if (k == 0) {
  1919. adjustVolume(musicEnabled, 0);
  1920. musicEnabled = true;
  1921. }
  1922. if (k == 1) {
  1923. adjustVolume(musicEnabled, -400);
  1924. musicEnabled = true;
  1925. }
  1926. if (k == 2) {
  1927. adjustVolume(musicEnabled, -800);
  1928. musicEnabled = true;
  1929. }
  1930. if (k == 3) {
  1931. adjustVolume(musicEnabled, -1200);
  1932. musicEnabled = true;
  1933. }
  1934. if (k == 4)
  1935. musicEnabled = false;
  1936. if (musicEnabled != flag1 && !lowMem) {
  1937. if (musicEnabled) {
  1938. nextSong = currentSong;
  1939. songChanging = true;
  1940. onDemandFetcher.method558(2, nextSong);
  1941. } else {
  1942. stopMidi();
  1943. }
  1944. prevSong = 0;
  1945. }
  1946. }
  1947. if (j == 4) {
  1948. if (k == 0) {
  1949. aBoolean848 = true;
  1950. setWaveVolume(0);
  1951. }
  1952. if (k == 1) {
  1953. aBoolean848 = true;
  1954. setWaveVolume(-400);
  1955. }
  1956. if (k == 2) {
  1957. aBoolean848 = true;
  1958. setWaveVolume(-800);
  1959. }
  1960. if (k == 3) {
  1961. aBoolean848 = true;
  1962. setWaveVolume(-1200);
  1963. }
  1964. if (k == 4)
  1965. aBoolean848 = false;
  1966. }
  1967. if (j == 5)
  1968. anInt1253 = k;
  1969. if (j == 6)
  1970. anInt1249 = k;
  1971. if (j == 8) {
  1972. splitPrivateChat = k;
  1973. inputTaken = true;
  1974. }
  1975. if (j == 9)
  1976. anInt913 = k;
  1977. } catch (Exception e) {
  1978. }
  1979. }
  1980.  
  1981. public StreamLoader mediaStreamLoader;
  1982.  
  1983. public void updateEntities() {
  1984. try {
  1985. int anInt974 = 0;
  1986. for (int j = -1; j < playerCount + npcCount; j++) {
  1987. Object obj;
  1988. if (j == -1)
  1989. obj = myPlayer;
  1990. else if (j < playerCount)
  1991. obj = playerArray[playerIndices[j]];
  1992. else
  1993. obj = npcArray[npcIndices[j - playerCount]];
  1994. if (obj == null || !((Entity) (obj)).isVisible())
  1995. continue;
  1996. if (obj instanceof Npc) {
  1997. EntityDef entityDef = ((Npc) obj).desc;
  1998. if (entityDef.childrenIDs != null)
  1999. entityDef = entityDef.method161();
  2000. if (entityDef == null)
  2001. continue;
  2002. }
  2003. if (j < playerCount) {
  2004. int l = 30;
  2005. Player player = (Player) obj;
  2006. if (player.headIcon >= 0) {
  2007. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2008. if (spriteDrawX > -1) {
  2009. if (player.skullIcon < 2) {
  2010. skullIcons[player.skullIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2011. l += 25;
  2012. }
  2013. if (player.headIcon < 13) {
  2014. headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2015. l += 18;
  2016. }
  2017. }
  2018. }
  2019. if (j >= 0 && anInt855 == 10 && anInt933 == playerIndices[j]) {
  2020. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2021. if (spriteDrawX > -1)
  2022. headIconsHint[player.hintIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2023. }
  2024. } else {
  2025. EntityDef entityDef_1 = ((Npc) obj).desc;
  2026. if (entityDef_1.anInt75 >= 0 && entityDef_1.anInt75 < headIcons.length) {
  2027. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2028. if (spriteDrawX > -1)
  2029. headIcons[entityDef_1.anInt75].drawSprite(spriteDrawX - 12, spriteDrawY - 30);
  2030. }
  2031. if (anInt855 == 1 && anInt1222 == npcIndices[j - playerCount] && loopCycle % 20 < 10) {
  2032. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2033. if (spriteDrawX > -1)
  2034. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  2035. }
  2036. }
  2037. if (((Entity) (obj)).textSpoken != null && (j >= playerCount || publicChatMode == 0 || publicChatMode == 3 || publicChatMode == 1 && isFriendOrSelf(((Player) obj).name))) {
  2038. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height);
  2039. if (spriteDrawX > -1 && anInt974 < anInt975) {
  2040. anIntArray979[anInt974] = boldText.method384(((Entity) (obj)).textSpoken) / 2;
  2041. anIntArray978[anInt974] = boldText.anInt1497;
  2042. anIntArray976[anInt974] = spriteDrawX;
  2043. anIntArray977[anInt974] = spriteDrawY;
  2044. anIntArray980[anInt974] = ((Entity) (obj)).anInt1513;
  2045. anIntArray981[anInt974] = ((Entity) (obj)).anInt1531;
  2046. anIntArray982[anInt974] = ((Entity) (obj)).textCycle;
  2047. aStringArray983[anInt974++] = ((Entity) (obj)).textSpoken;
  2048. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 >= 1 && ((Entity) (obj)).anInt1531 <= 3) {
  2049. anIntArray978[anInt974] += 10;
  2050. anIntArray977[anInt974] += 5;
  2051. }
  2052. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 4)
  2053. anIntArray979[anInt974] = 60;
  2054. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 5)
  2055. anIntArray978[anInt974] += 5;
  2056. }
  2057. }
  2058. if (((Entity) (obj)).loopCycleStatus > loopCycle) {
  2059. try {
  2060. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2061. if (spriteDrawX > -1) {
  2062. int i1 = (((Entity) (obj)).currentHealth * 30) / ((Entity) (obj)).maxHealth;
  2063. if (i1 > 30) {
  2064. i1 = 30;
  2065. }
  2066. int barWidth = hpBars[0].cropWidth;
  2067. int percent = (((Entity) (obj)).currentHealth * barWidth) / ((Entity) (obj)).maxHealth;
  2068. if (percent > barWidth) {
  2069. percent = barWidth;
  2070. }
  2071. if (!Configuration.enableNewHpBars) {
  2072. DrawingArea.drawPixels(5, spriteDrawY - 3, spriteDrawX - 15, 65280, i1);
  2073. DrawingArea.drawPixels(5, spriteDrawY - 3, (spriteDrawX - 15) + i1, 0xff0000, 30 - i1);
  2074. } else {
  2075. hpBars[1].drawSprite(spriteDrawX - (barWidth / 2), spriteDrawY - 3);
  2076. if (percent > 0) {
  2077. Sprite fullBar = new Sprite(hpBars[0], 0, 0, percent, 7);
  2078. fullBar.drawSprite(spriteDrawX - (barWidth / 2), spriteDrawY - 3);
  2079. }
  2080. }
  2081. if (Configuration.drawEntityFeed) {
  2082. /*String monster_name = ((Npc) obj).desc.name;
  2083. pushFeed(monster_name, ((Entity) obj).currentHealth, ((Entity) obj).maxHealth);
  2084. displayEntityFeed();*/
  2085. }
  2086. }
  2087. } catch (Exception e) {
  2088. }
  2089. }
  2090. if (Configuration.enableNewHitmarks) {
  2091. for (int j1 = 0; j1 < 4; j1++) {
  2092. if (((Entity) (obj)).hitsLoopCycle[j1] > loopCycle) {
  2093. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height / 2);
  2094. if (spriteDrawX > -1) {
  2095. switch (j1) {
  2096. case 1:
  2097. spriteDrawY += 20;
  2098. break;
  2099. case 2:
  2100. spriteDrawY += 40;
  2101. break;
  2102. case 3:
  2103. spriteDrawY += 60;
  2104. break;
  2105. case 4:
  2106. spriteDrawY += 80;
  2107. break;
  2108. case 5:
  2109. spriteDrawY += 100;
  2110. break;
  2111. case 6:
  2112. spriteDrawY += 120;
  2113. break;
  2114. }
  2115. Entity e = ((Entity) (obj));
  2116. if (e.hitmarkMove[j1] > -30)
  2117. e.hitmarkMove[j1]--;
  2118. if (e.hitmarkMove[j1] < -26)
  2119. e.hitmarkTrans[j1] -= 5;
  2120. hitmarkDraw(String.valueOf(e.hitArray[j1]).length(), e.hitMarkTypes[j1], e.hitIcon[j1], e.hitArray[j1], e.hitmarkMove[j1], e.hitmarkTrans[j1]);
  2121. }
  2122. }
  2123. }
  2124. } else {
  2125. for (int j1 = 0; j1 < 4; j1++) {
  2126. if (((Entity) (obj)).hitsLoopCycle[j1] > loopCycle) {
  2127. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height / 2);
  2128. if (spriteDrawX > -1) {
  2129. if (j1 == 1) {
  2130. spriteDrawY -= 20;
  2131. }
  2132. if (j1 == 2) {
  2133. spriteDrawX -= 15;
  2134. spriteDrawY -= 10;
  2135. }
  2136. if (j1 == 3) {
  2137. spriteDrawX += 15;
  2138. spriteDrawY -= 10;
  2139. }
  2140. hitMarks[((Entity) (obj)).hitMarkTypes[j1]].drawSprite(spriteDrawX - 12, spriteDrawY - 12);
  2141. smallText.drawText(0, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 4, spriteDrawX);
  2142. smallText.drawText(0xffffff, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 3, spriteDrawX - 1);
  2143. }
  2144. }
  2145. }
  2146. }
  2147. }
  2148. for (int k = 0; k < anInt974; k++) {
  2149. int k1 = anIntArray976[k];
  2150. int l1 = anIntArray977[k];
  2151. int j2 = anIntArray979[k];
  2152. int k2 = anIntArray978[k];
  2153. boolean flag = true;
  2154. while (flag) {
  2155. flag = false;
  2156. for (int l2 = 0; l2 < k; l2++)
  2157. 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) {
  2158. l1 = anIntArray977[l2] - anIntArray978[l2];
  2159. flag = true;
  2160. }
  2161.  
  2162. }
  2163. spriteDrawX = anIntArray976[k];
  2164. spriteDrawY = anIntArray977[k] = l1;
  2165. String s = aStringArray983[k];
  2166. if (anInt1249 == 0) {
  2167. int i3 = 0xffff00;
  2168. if (anIntArray980[k] < 6)
  2169. i3 = anIntArray965[anIntArray980[k]];
  2170. if (anIntArray980[k] == 6)
  2171. i3 = anInt1265 % 20 >= 10 ? 0xffff00 : 0xff0000;
  2172. if (anIntArray980[k] == 7)
  2173. i3 = anInt1265 % 20 >= 10 ? 65535 : 255;
  2174. if (anIntArray980[k] == 8)
  2175. i3 = anInt1265 % 20 >= 10 ? 0x80ff80 : 45056;
  2176. if (anIntArray980[k] == 9) {
  2177. int j3 = 150 - anIntArray982[k];
  2178. if (j3 < 50)
  2179. i3 = 0xff0000 + 1280 * j3;
  2180. else if (j3 < 100)
  2181. i3 = 0xffff00 - 0x50000 * (j3 - 50);
  2182. else if (j3 < 150)
  2183. i3 = 65280 + 5 * (j3 - 100);
  2184. }
  2185. if (anIntArray980[k] == 10) {
  2186. int k3 = 150 - anIntArray982[k];
  2187. if (k3 < 50)
  2188. i3 = 0xff0000 + 5 * k3;
  2189. else if (k3 < 100)
  2190. i3 = 0xff00ff - 0x50000 * (k3 - 50);
  2191. else if (k3 < 150)
  2192. i3 = (255 + 0x50000 * (k3 - 100)) - 5 * (k3 - 100);
  2193. }
  2194. if (anIntArray980[k] == 11) {
  2195. int l3 = 150 - anIntArray982[k];
  2196. if (l3 < 50)
  2197. i3 = 0xffffff - 0x50005 * l3;
  2198. else if (l3 < 100)
  2199. i3 = 65280 + 0x50005 * (l3 - 50);
  2200. else if (l3 < 150)
  2201. i3 = 0xffffff - 0x50000 * (l3 - 100);
  2202. }
  2203. if (anIntArray981[k] == 0) {
  2204. boldText.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  2205. boldText.drawText(i3, s, spriteDrawY, spriteDrawX);
  2206. }
  2207. if (anIntArray981[k] == 1) {
  2208. boldText.method386(0, s, spriteDrawX, anInt1265, spriteDrawY + 1);
  2209. boldText.method386(i3, s, spriteDrawX, anInt1265, spriteDrawY);
  2210. }
  2211. if (anIntArray981[k] == 2) {
  2212. boldText.method387(spriteDrawX, s, anInt1265, spriteDrawY + 1, 0);
  2213. boldText.method387(spriteDrawX, s, anInt1265, spriteDrawY, i3);
  2214. }
  2215. if (anIntArray981[k] == 3) {
  2216. boldText.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY + 1, spriteDrawX, 0);
  2217. boldText.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY, spriteDrawX, i3);
  2218. }
  2219. if (anIntArray981[k] == 4) {
  2220. int i4 = boldText.method384(s);
  2221. int k4 = ((150 - anIntArray982[k]) * (i4 + 100)) / 150;
  2222. DrawingArea.setDrawingArea(334, spriteDrawX - 50, spriteDrawX + 50, 0);
  2223. boldText.method385(0, s, spriteDrawY + 1, (spriteDrawX + 50) - k4);
  2224. boldText.method385(i3, s, spriteDrawY, (spriteDrawX + 50) - k4);
  2225. DrawingArea.defaultDrawingAreaSize();
  2226. }
  2227. if (anIntArray981[k] == 5) {
  2228. int j4 = 150 - anIntArray982[k];
  2229. int l4 = 0;
  2230. if (j4 < 25)
  2231. l4 = j4 - 25;
  2232. else if (j4 > 125)
  2233. l4 = j4 - 125;
  2234. DrawingArea.setDrawingArea(spriteDrawY + 5, 0, 512, spriteDrawY - boldText.anInt1497 - 1);
  2235. boldText.drawText(0, s, spriteDrawY + 1 + l4, spriteDrawX);
  2236. boldText.drawText(i3, s, spriteDrawY + l4, spriteDrawX);
  2237. DrawingArea.defaultDrawingAreaSize();
  2238. }
  2239. } else {
  2240. boldText.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  2241. boldText.drawText(0xffff00, s, spriteDrawY, spriteDrawX);
  2242. }
  2243. }
  2244. } catch (Exception e) {
  2245. }
  2246. }
  2247.  
  2248. private void delFriend(long l) {
  2249. try {
  2250. if (l == 0L)
  2251. return;
  2252. for (int i = 0; i < friendsCount; i++) {
  2253. if (friendsListAsLongs[i] != l)
  2254. continue;
  2255. friendsCount--;
  2256. for (int j = i; j < friendsCount; j++) {
  2257. friendsList[j] = friendsList[j + 1];
  2258. friendsNodeIDs[j] = friendsNodeIDs[j + 1];
  2259. friendsListAsLongs[j] = friendsListAsLongs[j + 1];
  2260. }
  2261.  
  2262. stream.createFrame(215);
  2263. stream.writeQWord(l);
  2264. break;
  2265. }
  2266. } catch (RuntimeException runtimeexception) {
  2267. Signlink.reporterror("18622, " + false + ", " + l + ", " + runtimeexception.toString());
  2268. throw new RuntimeException();
  2269. }
  2270. }
  2271.  
  2272. private final int[] sideIconsX = { 17, 49, 83, 114, 146, 180, 214, 16, 49, 82, 116, 148, 184, 216 }, sideIconsY = { 9, 7, 7, 5, 2, 3, 7, 306, 306, 306, 302, 305, 303, 303, 303 }, sideIconsId = { 0, 1, 2, 3, 4, 5, 6, 15, 8, 9, 7, 11, 12, -1 }, sideIconsTab = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 };
  2273.  
  2274. public void drawSideIcons() {
  2275. int xOffset = frameMode == ScreenMode.FIXED ? 0 : frameWidth - 247;
  2276. int yOffset = frameMode == ScreenMode.FIXED ? 0 : frameHeight - 336;
  2277. if (frameMode == ScreenMode.FIXED || frameMode != ScreenMode.FIXED && !changeTabArea) {
  2278. cacheSprite[370].drawSprite(sideIconsX[8] + xOffset + 168, sideIconsY[7] + yOffset);
  2279. for (int i = 0; i < sideIconsTab.length; i++) {
  2280. if (tabInterfaceIDs[sideIconsTab[i]] != -1) {
  2281. if (sideIconsId[i] != -1) {
  2282. sideIcons[sideIconsId[i]].drawSprite(sideIconsX[i] + xOffset, sideIconsY[i] + yOffset);
  2283. }
  2284. }
  2285. }
  2286. } else if (changeTabArea && frameWidth < 1000) {
  2287. int[] iconId = { 0, 1, 2, 3, 4, 5, 6, 15, 8, 9, 7, 11, 12, -1 };
  2288. int[] iconX = { 219, 189, 156, 126, 93, 62, 30, 219, 189, 156, 124, 92, 59, 28 };
  2289. int[] iconY = { 67, 69, 67, 69, 72, 72, 69, 28, 29, 29, 32, 30, 33, 31, 32 };
  2290. cacheSprite[370].drawSprite(frameWidth - 29, frameHeight - 29);
  2291. for (int i = 0; i < sideIconsTab.length; i++) {
  2292. if (tabInterfaceIDs[sideIconsTab[i]] != -1) {
  2293. if (iconId[i] != -1) {
  2294. sideIcons[iconId[i]].drawSprite(frameWidth - iconX[i], frameHeight - iconY[i]);
  2295. }
  2296. }
  2297. }
  2298. } else if (changeTabArea && frameWidth >= 1000) {
  2299. int[] iconId = { 0, 1, 2, 3, 4, 5, 6, 15, 8, 9, 7, 11, 12, -1 };
  2300. int[] iconX = { 19, 50, 82, 111, 144, 176, 208, 242, 273, 306, 338, 370, 404, 433 };
  2301. int[] iconY = { 30, 32, 30, 32, 34, 34, 32, 28, 29, 29, 32, 31, 32, 32, 32 };
  2302. cacheSprite[370].drawSprite(frameWidth - 27, frameHeight - 29);
  2303. for (int i = 0; i < sideIconsTab.length; i++) {
  2304. if (tabInterfaceIDs[sideIconsTab[i]] != -1) {
  2305. if (iconId[i] != -1) {
  2306. sideIcons[iconId[i]].drawSprite(frameWidth - 461 + iconX[i], frameHeight - iconY[i]);
  2307. }
  2308. }
  2309. }
  2310. }
  2311. }
  2312.  
  2313. private final int[] redStonesX = { 6, 44, 77, 110, 143, 176, 209, 6, 44, 77, 110, 143, 176, 209 }, redStonesY = { 0, 0, 0, 0, 0, 0, 0, 298, 298, 298, 298, 298, 298, 298 }, redStonesId = { 0, 4, 4, 4, 4, 4, 1, 2, 4, 4, 4, 4, 4, 3 };
  2314.  
  2315. private void drawRedStones() {
  2316. int xOffset = frameMode == ScreenMode.FIXED ? 0 : frameWidth - 247;
  2317. int yOffset = frameMode == ScreenMode.FIXED ? 0 : frameHeight - 336;
  2318. if (frameMode == ScreenMode.FIXED || frameMode != ScreenMode.FIXED && !changeTabArea) {
  2319. if (tabInterfaceIDs[tabID] != -1 && tabID != 14) {
  2320. redStones[redStonesId[tabID]].drawSprite(redStonesX[tabID] + xOffset, redStonesY[tabID] + yOffset);
  2321. }
  2322. } else if (changeTabArea && frameWidth < 1000) {
  2323. int[] stoneX = { 226, 194, 162, 130, 99, 65, 34, 219, 195, 161, 130, 98, 65, 33 };
  2324. int[] stoneY = { 73, 73, 73, 73, 73, 73, 73, -1, 37, 37, 37, 37, 37, 37, 37 };
  2325. if (tabInterfaceIDs[tabID] != -1 && tabID != 14 && showTabComponents) {
  2326. if (tabID == 7) {
  2327. redStones[4].drawSprite(frameWidth - 226, frameHeight - 37);
  2328. }
  2329. redStones[4].drawSprite(frameWidth - stoneX[tabID], frameHeight - stoneY[tabID]);
  2330. }
  2331. } else if (changeTabArea && frameWidth >= 1000) {
  2332. int[] stoneX = { 449, 417, 385, 353, 321, 289, 257, 225, 193, 161, 130, 98, 65, 33 };
  2333. if (tabInterfaceIDs[tabID] != -1 && tabID != 14 && showTabComponents) {
  2334. redStones[4].drawSprite(frameWidth - stoneX[tabID], frameHeight - 37);
  2335. }
  2336. }
  2337. }
  2338.  
  2339. private void drawTabArea() {
  2340. final int xOffset = frameMode == ScreenMode.FIXED ? 0 : frameWidth - 241;
  2341. final int yOffset = frameMode == ScreenMode.FIXED ? 0 : frameHeight - 336;
  2342. if (frameMode == ScreenMode.FIXED) {
  2343. aRSImageProducer_1163.initDrawingArea();
  2344. }
  2345. Rasterizer.anIntArray1472 = anIntArray1181;
  2346. if (frameMode == ScreenMode.FIXED) {
  2347. fixedGameComponents[1].drawSprite(0, 0);
  2348. } else if (frameMode != ScreenMode.FIXED && !changeTabArea) {
  2349. DrawingArea.method335(0x3E3529, frameHeight - 304, 195, 270, transparentTabArea ? 80 : 256, frameWidth - 217);
  2350. gameComponents[2].drawSprite(xOffset, yOffset);
  2351. } else {
  2352. if (frameWidth >= 1000) {
  2353. if (showTabComponents) {
  2354. DrawingArea.method335(0x3E3529, frameHeight - 304, 197, 265, transparentTabArea ? 80 : 256, frameWidth - 197);
  2355. gameComponents[4].drawSprite(frameWidth - 204, frameHeight - 311);
  2356. }
  2357. for (int x = frameWidth - 449, y = frameHeight - 37, index = 0; x <= frameWidth - 30 && index < 14; x += 32, index++) {
  2358. redStones[5].drawSprite(x, y);
  2359. }
  2360. } else if (frameWidth < 1000) {
  2361. if (showTabComponents) {
  2362. DrawingArea.method335(0x3E3529, frameHeight - 341, 195, 265, transparentTabArea ? 80 : 256, frameWidth - 197);
  2363. gameComponents[4].drawSprite(frameWidth - 204, frameHeight - 348);
  2364. }
  2365. for (int x = frameWidth - 226, y = frameHeight - 73, index = 0; x <= frameWidth - 32 && index < 7; x += 32, index++) {
  2366. redStones[5].drawSprite(x, y);
  2367. }
  2368. for (int x = frameWidth - 226, y = frameHeight - 37, index = 0; x <= frameWidth - 32 && index < 7; x += 32, index++) {
  2369. redStones[5].drawSprite(x, y);
  2370. }
  2371. }
  2372. }
  2373. if (invOverlayInterfaceID == -1) {
  2374. drawRedStones();
  2375. drawSideIcons();
  2376. }
  2377. if (showTabComponents) {
  2378. int x = frameMode == ScreenMode.FIXED ? 31 : frameWidth - 215;
  2379. int y = frameMode == ScreenMode.FIXED ? 37 : frameHeight - 299;
  2380. if (changeTabArea) {
  2381. x = frameWidth - 197;
  2382. y = frameWidth >= 1000 ? frameHeight - 303 : frameHeight - 340;
  2383. }
  2384. if (invOverlayInterfaceID != -1) {
  2385. drawInterface(0, x, RSInterface.interfaceCache[invOverlayInterfaceID], y);
  2386. } else if (tabInterfaceIDs[tabID] != -1) {
  2387. drawInterface(0, x, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], y);
  2388. }
  2389. }
  2390. if (menuOpen) {
  2391. drawMenu(frameMode == ScreenMode.FIXED ? 516 : 0, frameMode == ScreenMode.FIXED ? 168 : 0);
  2392. }
  2393. if (frameMode == ScreenMode.FIXED) {
  2394. aRSImageProducer_1163.drawGraphics(168, super.graphics, 516);
  2395. aRSImageProducer_1165.initDrawingArea();
  2396. }
  2397. Rasterizer.anIntArray1472 = anIntArray1182;
  2398. }
  2399.  
  2400. private void method37(int j) {
  2401. if (Configuration.enableMovingTextures) {
  2402. if (Rasterizer.anIntArray1480[17] >= j) {
  2403. Background background = Rasterizer.aBackgroundArray1474s[17];
  2404. int k = background.anInt1452 * background.anInt1453 - 1;
  2405. int j1 = background.anInt1452 * anInt945 * 2;
  2406. byte abyte0[] = background.aByteArray1450;
  2407. byte abyte3[] = aByteArray912;
  2408. for (int i2 = 0; i2 <= k; i2++)
  2409. abyte3[i2] = abyte0[i2 - j1 & k];
  2410.  
  2411. background.aByteArray1450 = abyte3;
  2412. aByteArray912 = abyte0;
  2413. Rasterizer.method370(17);
  2414. anInt854++;
  2415. if (anInt854 > 1235) {
  2416. anInt854 = 0;
  2417. stream.createFrame(226);
  2418. stream.writeWordBigEndian(0);
  2419. int l2 = stream.currentOffset;
  2420. stream.writeWord(58722);
  2421. stream.writeWordBigEndian(240);
  2422. stream.writeWord((int) (Math.random() * 65536D));
  2423. stream.writeWordBigEndian((int) (Math.random() * 256D));
  2424. if ((int) (Math.random() * 2D) == 0)
  2425. stream.writeWord(51825);
  2426. stream.writeWordBigEndian((int) (Math.random() * 256D));
  2427. stream.writeWord((int) (Math.random() * 65536D));
  2428. stream.writeWord(7130);
  2429. stream.writeWord((int) (Math.random() * 65536D));
  2430. stream.writeWord(61657);
  2431. stream.writeBytes(stream.currentOffset - l2);
  2432. }
  2433. }
  2434. if (Rasterizer.anIntArray1480[24] >= j) {
  2435. Background background_1 = Rasterizer.aBackgroundArray1474s[24];
  2436. int l = background_1.anInt1452 * background_1.anInt1453 - 1;
  2437. int k1 = background_1.anInt1452 * anInt945 * 2;
  2438. byte abyte1[] = background_1.aByteArray1450;
  2439. byte abyte4[] = aByteArray912;
  2440. for (int j2 = 0; j2 <= l; j2++)
  2441. abyte4[j2] = abyte1[j2 - k1 & l];
  2442.  
  2443. background_1.aByteArray1450 = abyte4;
  2444. aByteArray912 = abyte1;
  2445. Rasterizer.method370(24);
  2446. }
  2447. if (Rasterizer.anIntArray1480[34] >= j) {
  2448. Background background_2 = Rasterizer.aBackgroundArray1474s[34];
  2449. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  2450. int l1 = background_2.anInt1452 * anInt945 * 2;
  2451. byte abyte2[] = background_2.aByteArray1450;
  2452. byte abyte5[] = aByteArray912;
  2453. for (int k2 = 0; k2 <= i1; k2++)
  2454. abyte5[k2] = abyte2[k2 - l1 & i1];
  2455.  
  2456. background_2.aByteArray1450 = abyte5;
  2457. aByteArray912 = abyte2;
  2458. Rasterizer.method370(34);
  2459. }
  2460. if (Rasterizer.anIntArray1480[40] >= j) {
  2461. Background background_2 = Rasterizer.aBackgroundArray1474s[40];
  2462. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  2463. int l1 = background_2.anInt1452 * anInt945 * 2;
  2464. byte abyte2[] = background_2.aByteArray1450;
  2465. byte abyte5[] = aByteArray912;
  2466. for (int k2 = 0; k2 <= i1; k2++)
  2467. abyte5[k2] = abyte2[k2 - l1 & i1];
  2468.  
  2469. background_2.aByteArray1450 = abyte5;
  2470. aByteArray912 = abyte2;
  2471. Rasterizer.method370(40);
  2472. }
  2473. }
  2474. }
  2475.  
  2476. private void method38() {
  2477. for (int i = -1; i < playerCount; i++) {
  2478. int j;
  2479. if (i == -1)
  2480. j = myPlayerIndex;
  2481. else
  2482. j = playerIndices[i];
  2483. Player player = playerArray[j];
  2484. if (player != null && player.textCycle > 0) {
  2485. player.textCycle--;
  2486. if (player.textCycle == 0)
  2487. player.textSpoken = null;
  2488. }
  2489. }
  2490. for (int k = 0; k < npcCount; k++) {
  2491. int l = npcIndices[k];
  2492. Npc npc = npcArray[l];
  2493. if (npc != null && npc.textCycle > 0) {
  2494. npc.textCycle--;
  2495. if (npc.textCycle == 0)
  2496. npc.textSpoken = null;
  2497. }
  2498. }
  2499. }
  2500.  
  2501. private void calcCameraPos() {
  2502. int i = anInt1098 * 128 + 64;
  2503. int j = anInt1099 * 128 + 64;
  2504. int k = method42(plane, j, i) - anInt1100;
  2505. if (xCameraPos < i) {
  2506. xCameraPos += anInt1101 + ((i - xCameraPos) * anInt1102) / 1000;
  2507. if (xCameraPos > i)
  2508. xCameraPos = i;
  2509. }
  2510. if (xCameraPos > i) {
  2511. xCameraPos -= anInt1101 + ((xCameraPos - i) * anInt1102) / 1000;
  2512. if (xCameraPos < i)
  2513. xCameraPos = i;
  2514. }
  2515. if (zCameraPos < k) {
  2516. zCameraPos += anInt1101 + ((k - zCameraPos) * anInt1102) / 1000;
  2517. if (zCameraPos > k)
  2518. zCameraPos = k;
  2519. }
  2520. if (zCameraPos > k) {
  2521. zCameraPos -= anInt1101 + ((zCameraPos - k) * anInt1102) / 1000;
  2522. if (zCameraPos < k)
  2523. zCameraPos = k;
  2524. }
  2525. if (yCameraPos < j) {
  2526. yCameraPos += anInt1101 + ((j - yCameraPos) * anInt1102) / 1000;
  2527. if (yCameraPos > j)
  2528. yCameraPos = j;
  2529. }
  2530. if (yCameraPos > j) {
  2531. yCameraPos -= anInt1101 + ((yCameraPos - j) * anInt1102) / 1000;
  2532. if (yCameraPos < j)
  2533. yCameraPos = j;
  2534. }
  2535. i = anInt995 * 128 + 64;
  2536. j = anInt996 * 128 + 64;
  2537. k = method42(plane, j, i) - anInt997;
  2538. int l = i - xCameraPos;
  2539. int i1 = k - zCameraPos;
  2540. int j1 = j - yCameraPos;
  2541. int k1 = (int) Math.sqrt(l * l + j1 * j1);
  2542. int l1 = (int) (Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  2543. int i2 = (int) (Math.atan2(l, j1) * -325.94900000000001D) & 0x7ff;
  2544. if (l1 < 128)
  2545. l1 = 128;
  2546. if (l1 > 383)
  2547. l1 = 383;
  2548. if (yCameraCurve < l1) {
  2549. yCameraCurve += anInt998 + ((l1 - yCameraCurve) * anInt999) / 1000;
  2550. if (yCameraCurve > l1)
  2551. yCameraCurve = l1;
  2552. }
  2553. if (yCameraCurve > l1) {
  2554. yCameraCurve -= anInt998 + ((yCameraCurve - l1) * anInt999) / 1000;
  2555. if (yCameraCurve < l1)
  2556. yCameraCurve = l1;
  2557. }
  2558. int j2 = i2 - xCameraCurve;
  2559. if (j2 > 1024)
  2560. j2 -= 2048;
  2561. if (j2 < -1024)
  2562. j2 += 2048;
  2563. if (j2 > 0) {
  2564. xCameraCurve += anInt998 + (j2 * anInt999) / 1000;
  2565. xCameraCurve &= 0x7ff;
  2566. }
  2567. if (j2 < 0) {
  2568. xCameraCurve -= anInt998 + (-j2 * anInt999) / 1000;
  2569. xCameraCurve &= 0x7ff;
  2570. }
  2571. int k2 = i2 - xCameraCurve;
  2572. if (k2 > 1024)
  2573. k2 -= 2048;
  2574. if (k2 < -1024)
  2575. k2 += 2048;
  2576. if (k2 < 0 && j2 > 0 || k2 > 0 && j2 < 0)
  2577. xCameraCurve = i2;
  2578. }
  2579.  
  2580. private void drawMenu(int xOffSet, int yOffSet) {
  2581. int xPos = menuOffsetX - (xOffSet - 4);
  2582. int yPos = (-yOffSet + 4) + menuOffsetY;
  2583. int menuW = menuWidth;
  2584. int menuH = menuHeight + 1;
  2585. inputTaken = true;
  2586. tabAreaAltered = true;
  2587. if (!Configuration.enableNewMenus) {
  2588. int menuColor = 0x5d5447;
  2589. DrawingArea.drawPixels(menuH, yPos, xPos, menuColor, menuW);
  2590. DrawingArea.drawPixels(16, yPos + 1, xPos + 1, 0, menuW - 2);
  2591. DrawingArea.fillPixels(xPos + 1, menuW - 2, menuH - 19, 0, yPos + 18);
  2592. newBoldFont.drawBasicString("Choose Option", xPos + 3, yPos + 14, menuColor, 1);
  2593. int mouseX = super.mouseX - (xOffSet);
  2594. int mouseY = (-yOffSet) + super.mouseY;
  2595. for (int i = 0; i < menuActionRow; i++) {
  2596. int textY = yPos + 31 + (menuActionRow - 1 - i) * 15;
  2597. int textColor = 0xffffff;
  2598. if (mouseX > xPos && mouseX < xPos + menuW && mouseY > textY - 13 && mouseY < textY + 3) {
  2599. DrawingArea.drawPixels(15, textY - 11, xPos + 3, 0x6f695d, menuWidth - 6);
  2600. textColor = 0xffff00;
  2601. }
  2602. newBoldFont.drawBasicString(menuActionName[i], xPos + 3, textY, textColor, 1);
  2603. }
  2604. } else {
  2605. DrawingArea.drawPixels(menuH - 4, yPos + 2, xPos, 0x706a5e, menuW);
  2606. DrawingArea.drawPixels(menuH - 2, yPos + 1, xPos + 1, 0x706a5e, menuW - 2);
  2607. DrawingArea.drawPixels(menuH, yPos, xPos + 2, 0x706a5e, menuW - 4);
  2608. DrawingArea.drawPixels(menuH - 2, yPos + 1, xPos + 3, 0x2d2822, menuW - 6);
  2609. DrawingArea.drawPixels(menuH - 4, yPos + 2, xPos + 2, 0x2d2822, menuW - 4);
  2610. DrawingArea.drawPixels(menuH - 6, yPos + 3, xPos + 1, 0x2d2822, menuW - 2);
  2611. DrawingArea.drawPixels(menuH - 22, yPos + 19, xPos + 2, 0x524a3d, menuW - 4);
  2612. DrawingArea.drawPixels(menuH - 22, yPos + 20, xPos + 3, 0x524a3d, menuW - 6);
  2613. DrawingArea.drawPixels(menuH - 23, yPos + 20, xPos + 3, 0x2b271c, menuW - 6);
  2614. DrawingArea.fillPixels(xPos + 3, menuW - 6, 1, 0x2a291b, yPos + 2);
  2615. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x2a261b, yPos + 3);
  2616. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x252116, yPos + 4);
  2617. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x211e15, yPos + 5);
  2618. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x1e1b12, yPos + 6);
  2619. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x1a170e, yPos + 7);
  2620. DrawingArea.fillPixels(xPos + 2, menuW - 4, 2, 0x15120b, yPos + 8);
  2621. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x100d08, yPos + 10);
  2622. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 11);
  2623. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x080703, yPos + 12);
  2624. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 13);
  2625. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x070802, yPos + 14);
  2626. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 15);
  2627. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x070802, yPos + 16);
  2628. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 17);
  2629. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x2a291b, yPos + 18);
  2630. DrawingArea.fillPixels(xPos + 3, menuW - 6, 1, 0x564943, yPos + 19);
  2631. newBoldFont.drawBasicString("Choose Option", xPos + 3, yPos + 14, 0xc6b895, 1);
  2632. }
  2633. int mouseX = super.mouseX - (xOffSet);
  2634. int mouseY = (-yOffSet) + super.mouseY;
  2635. for (int l1 = 0; l1 < menuActionRow; l1++) {
  2636. int textY = yPos + 31 + (menuActionRow - 1 - l1) * 15;
  2637. int disColor = 0xc6b895;
  2638. if (mouseX > xPos && mouseX < xPos + menuW && mouseY > textY - 13 && mouseY < textY + 3) {
  2639. DrawingArea.drawPixels(15, textY - 11, xPos + 3, 0x6f695d, menuWidth - 6);
  2640. disColor = 0xeee5c6;
  2641. }
  2642. newBoldFont.drawBasicString(menuActionName[l1], xPos + 3, textY, disColor, 1);
  2643. }
  2644. }
  2645.  
  2646. private void addFriend(long l) {
  2647. try {
  2648. if (l == 0L)
  2649. return;
  2650. if (friendsCount >= 100 && anInt1046 != 1) {
  2651. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  2652. return;
  2653. }
  2654. if (friendsCount >= 200) {
  2655. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  2656. return;
  2657. }
  2658. String s = TextClass.fixName(TextClass.nameForLong(l));
  2659. for (int i = 0; i < friendsCount; i++)
  2660. if (friendsListAsLongs[i] == l) {
  2661. pushMessage(s + " is already on your friend list", 0, "");
  2662. return;
  2663. }
  2664. for (int j = 0; j < ignoreCount; j++)
  2665. if (ignoreListAsLongs[j] == l) {
  2666. pushMessage("Please remove " + s + " from your ignore list first", 0, "");
  2667. return;
  2668. }
  2669.  
  2670. if (s.equals(myPlayer.name)) {
  2671. pushMessage("You may not add yourself!", 0, "");
  2672. return;
  2673. } else {
  2674. friendsList[friendsCount] = s;
  2675. friendsListAsLongs[friendsCount] = l;
  2676. friendsNodeIDs[friendsCount] = 0;
  2677. friendsCount++;
  2678. stream.createFrame(188);
  2679. stream.writeQWord(l);
  2680. return;
  2681. }
  2682. } catch (RuntimeException runtimeexception) {
  2683. Signlink.reporterror("15283, " + (byte) 68 + ", " + l + ", " + runtimeexception.toString());
  2684. }
  2685. throw new RuntimeException();
  2686. }
  2687.  
  2688. private int method42(int i, int j, int k) {
  2689. int l = k >> 7;
  2690. int i1 = j >> 7;
  2691. if (l < 0 || i1 < 0 || l > 103 || i1 > 103)
  2692. return 0;
  2693. int j1 = i;
  2694. if (j1 < 3 && (byteGroundArray[1][l][i1] & 2) == 2)
  2695. j1++;
  2696. int k1 = k & 0x7f;
  2697. int l1 = j & 0x7f;
  2698. int i2 = intGroundArray[j1][l][i1] * (128 - k1) + intGroundArray[j1][l + 1][i1] * k1 >> 7;
  2699. int j2 = intGroundArray[j1][l][i1 + 1] * (128 - k1) + intGroundArray[j1][l + 1][i1 + 1] * k1 >> 7;
  2700. return i2 * (128 - l1) + j2 * l1 >> 7;
  2701. }
  2702.  
  2703. private static String intToKOrMil(int j) {
  2704. if (j < 0x186a0)
  2705. return String.valueOf(j);
  2706. if (j < 0x989680)
  2707. return j / 1000 + "K";
  2708. else
  2709. return j / 0xf4240 + "M";
  2710. }
  2711.  
  2712. public void resetLogout() {
  2713. try {
  2714. if (socketStream != null)
  2715. socketStream.close();
  2716. } catch (Exception _ex) {
  2717. }
  2718. if (rememberMe) {
  2719. AccountManager.saveAccount();
  2720. }
  2721. setBounds();
  2722. socketStream = null;
  2723. loggedIn = false;
  2724. loginScreenState = 0;
  2725. loginMessage1 = "Welcome to Lunar Isle";
  2726. loginMessage2 = "Enter in your account details and begin playing!";
  2727. if (!rememberMe) {
  2728. myUsername = "";
  2729. myPassword = "";
  2730. }
  2731. unlinkMRUNodes();
  2732. worldController.initToNull();
  2733. for (int i = 0; i < 4; i++)
  2734. aClass11Array1230[i].method210();
  2735. System.gc();
  2736. stopMidi();
  2737. currentSong = -1;
  2738. nextSong = -1;
  2739. prevSong = 0;
  2740. SettingHandler.save();
  2741. console.openConsole = false;
  2742. }
  2743.  
  2744. private void method45() {
  2745. aBoolean1031 = true;
  2746. for (int j = 0; j < 7; j++) {
  2747. anIntArray1065[j] = -1;
  2748. for (int k = 0; k < IdentityKit.length; k++) {
  2749. if (IdentityKit.cache[k].aBoolean662 || IdentityKit.cache[k].anInt657 != j + (aBoolean1047 ? 0 : 7))
  2750. continue;
  2751. anIntArray1065[j] = k;
  2752. break;
  2753. }
  2754. }
  2755. }
  2756.  
  2757. private void method46(int i, Stream stream) {
  2758. while (stream.bitPosition + 21 < i * 8) {
  2759. int k = stream.readBits(14);
  2760. if (k == 16383)
  2761. break;
  2762. if (npcArray[k] == null)
  2763. npcArray[k] = new Npc();
  2764. Npc npc = npcArray[k];
  2765. npcIndices[npcCount++] = k;
  2766. npc.anInt1537 = loopCycle;
  2767. int l = stream.readBits(5);
  2768. if (l > 15)
  2769. l -= 32;
  2770. int i1 = stream.readBits(5);
  2771. if (i1 > 15)
  2772. i1 -= 32;
  2773. int j1 = stream.readBits(1);
  2774. npc.desc = EntityDef.forID(stream.readBits(npcBits));
  2775. int k1 = stream.readBits(1);
  2776. if (k1 == 1)
  2777. anIntArray894[anInt893++] = k;
  2778. npc.anInt1540 = npc.desc.aByte68;
  2779. npc.anInt1504 = npc.desc.anInt79;
  2780. npc.anInt1554 = npc.desc.walkAnim;
  2781. npc.anInt1555 = npc.desc.anInt58;
  2782. npc.anInt1556 = npc.desc.anInt83;
  2783. npc.anInt1557 = npc.desc.anInt55;
  2784. npc.anInt1511 = npc.desc.standAnim;
  2785. npc.setPos(myPlayer.smallX[0] + i1, myPlayer.smallY[0] + l, j1 == 1);
  2786. }
  2787. stream.finishBitAccess();
  2788. }
  2789.  
  2790. public void processGameLoop() {
  2791. if (rsAlreadyLoaded || loadingError || genericLoadingError)
  2792. return;
  2793. loopCycle++;
  2794. if (!loggedIn)
  2795. loginRenderer.processLoginScreen();
  2796. else
  2797. mainGameProcessor();
  2798. processOnDemandQueue();
  2799. }
  2800.  
  2801. private void method47(boolean flag) {
  2802. if (myPlayer.x >> 7 == destX && myPlayer.y >> 7 == destY) {
  2803. destX = 0;
  2804. }
  2805. int j = playerCount;
  2806. if (flag) {
  2807. j = 1;
  2808. }
  2809. for (int l = 0; l < j; l++) {
  2810. Player player;
  2811. int i1;
  2812. if (flag) {
  2813. player = myPlayer;
  2814. i1 = myPlayerIndex << 14;
  2815. } else {
  2816. player = playerArray[playerIndices[l]];
  2817. i1 = playerIndices[l] << 14;
  2818. }
  2819. if (player == null || !player.isVisible()) {
  2820. continue;
  2821. }
  2822. player.aBoolean1699 = (lowMem && playerCount > 50 || playerCount > 200) && !flag && player.anInt1517 == player.anInt1511;
  2823. int j1 = player.x >> 7;
  2824. int k1 = player.y >> 7;
  2825. if (j1 < 0 || j1 >= 104 || k1 < 0 || k1 >= 104) {
  2826. continue;
  2827. }
  2828. if (player.aModel_1714 != null && loopCycle >= player.anInt1707 && loopCycle < player.anInt1708) {
  2829. player.aBoolean1699 = false;
  2830. player.anInt1709 = method42(plane, player.y, player.x);
  2831. worldController.method286(plane, player.y, player, player.anInt1552, player.anInt1722, player.x, player.anInt1709, player.anInt1719, player.anInt1721, i1, player.anInt1720);
  2832. continue;
  2833. }
  2834. if ((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  2835. if (anIntArrayArray929[j1][k1] == anInt1265) {
  2836. continue;
  2837. }
  2838. anIntArrayArray929[j1][k1] = anInt1265;
  2839. }
  2840. player.anInt1709 = method42(plane, player.y, player.x);
  2841. worldController.method285(plane, player.anInt1552, player.anInt1709, i1, player.y, 60, player.x, player, player.aBoolean1541);
  2842. }
  2843. }
  2844.  
  2845. private boolean promptUserForInput(RSInterface class9) {
  2846. int j = class9.contentType;
  2847. System.out.println(anInt900);
  2848. if (anInt900 == 2) {
  2849. if (j == 51504) {
  2850. inputTaken = true;
  2851. inputDialogState = 0;
  2852. messagePromptRaised = true;
  2853. promptInput = "";
  2854. friendsListAction = 51504;
  2855. aString1121 = "Enter the player's profile you want to view.";
  2856. }
  2857. if (j == 201) {
  2858. inputTaken = true;
  2859. inputDialogState = 0;
  2860. messagePromptRaised = true;
  2861. promptInput = "";
  2862. friendsListAction = 1;
  2863. aString1121 = "Enter name of friend to add to list";
  2864. }
  2865. if (j == 59800) {
  2866. inputTaken = true;
  2867. inputDialogState = 0;
  2868. messagePromptRaised = true;
  2869. promptInput = "";
  2870. friendsListAction = 59800;
  2871. aString1121 = "Enter the item name you are looking for";
  2872. }
  2873. if (j == 202) {
  2874. inputTaken = true;
  2875. inputDialogState = 0;
  2876. messagePromptRaised = true;
  2877. promptInput = "";
  2878. friendsListAction = 2;
  2879. aString1121 = "Enter name of friend to delete from list";
  2880. }
  2881. }
  2882. if (j == 0xBABE) {
  2883. int subShopIndex = (8 + (CustomInterfaces.shopCategories.length * 3)) - 1;
  2884. for (int index = 0, frame = 0; index < (CustomInterfaces.shopCategories.length * 3); index += 3) {
  2885. if (class9.id == (55000 + frame + 9)) {
  2886. // if ((class9.id != 55009) && (class9.id != 55237)) {
  2887. // pushMessage("Title category coming soon!", 0, "");
  2888. // return true;
  2889. // }
  2890. RSInterface.interfaceCache[55000].children[subShopIndex] = 55000 + frame + 13;
  2891. return true;
  2892. }
  2893. frame += (CustomInterfaces.shopContent[index / 3].length * 8) + 5;
  2894. }
  2895. return true;
  2896. }
  2897. if (j == 205) {
  2898. anInt1011 = 250;
  2899. return true;
  2900. }
  2901. if (j == 501) {
  2902. inputTaken = true;
  2903. inputDialogState = 0;
  2904. messagePromptRaised = true;
  2905. promptInput = "";
  2906. friendsListAction = 4;
  2907. aString1121 = "Enter name of player to add to list";
  2908. }
  2909. if (j == 502) {
  2910. inputTaken = true;
  2911. inputDialogState = 0;
  2912. messagePromptRaised = true;
  2913. promptInput = "";
  2914. friendsListAction = 5;
  2915. aString1121 = "Enter name of player to delete from list";
  2916. }
  2917. if (j == 550) {
  2918. inputTaken = true;
  2919. inputDialogState = 0;
  2920. messagePromptRaised = true;
  2921. promptInput = "";
  2922. friendsListAction = 6;
  2923. aString1121 = "Enter the name of the chat you wish to join";
  2924. }
  2925. if (j >= 300 && j <= 313) {
  2926. int k = (j - 300) / 2;
  2927. int j1 = j & 1;
  2928. int i2 = anIntArray1065[k];
  2929. if (i2 != -1) {
  2930. do {
  2931. if (j1 == 0 && --i2 < 0)
  2932. i2 = IdentityKit.length - 1;
  2933. if (j1 == 1 && ++i2 >= IdentityKit.length)
  2934. i2 = 0;
  2935. } while (IdentityKit.cache[i2].aBoolean662 || IdentityKit.cache[i2].anInt657 != k + (aBoolean1047 ? 0 : 7));
  2936. anIntArray1065[k] = i2;
  2937. aBoolean1031 = true;
  2938. }
  2939. }
  2940. if (j >= 314 && j <= 323) {
  2941. int l = (j - 314) / 2;
  2942. int k1 = j & 1;
  2943. int j2 = anIntArray990[l];
  2944. if (k1 == 0 && --j2 < 0)
  2945. j2 = anIntArrayArray1003[l].length - 1;
  2946. if (k1 == 1 && ++j2 >= anIntArrayArray1003[l].length)
  2947. j2 = 0;
  2948. anIntArray990[l] = j2;
  2949. aBoolean1031 = true;
  2950. }
  2951. if (j == 324 && !aBoolean1047) {
  2952. aBoolean1047 = true;
  2953. method45();
  2954. }
  2955. if (j == 325 && aBoolean1047) {
  2956. aBoolean1047 = false;
  2957. method45();
  2958. }
  2959. if (j == 326) {
  2960. stream.createFrame(101);
  2961. stream.writeWordBigEndian(aBoolean1047 ? 0 : 1);
  2962. for (int i1 = 0; i1 < 7; i1++)
  2963. stream.writeWordBigEndian(anIntArray1065[i1]);
  2964.  
  2965. for (int l1 = 0; l1 < 5; l1++)
  2966. stream.writeWordBigEndian(anIntArray990[l1]);
  2967.  
  2968. return true;
  2969. }
  2970. if (j == 613)
  2971. canMute = !canMute;
  2972. if (j >= 601 && j <= 612) {
  2973. clearTopInterfaces();
  2974. if (reportAbuseInput.length() > 0) {
  2975. stream.createFrame(218);
  2976. stream.writeQWord(TextClass.longForName(reportAbuseInput));
  2977. stream.writeWordBigEndian(j - 601);
  2978. stream.writeWordBigEndian(canMute ? 1 : 0);
  2979. }
  2980. }
  2981. return false;
  2982. }
  2983.  
  2984. private void method49(Stream stream) {
  2985. for (int j = 0; j < anInt893; j++) {
  2986. int k = anIntArray894[j];
  2987. Player player = playerArray[k];
  2988. int l = stream.readUnsignedByte();
  2989. if ((l & 0x40) != 0)
  2990. l += stream.readUnsignedByte() << 8;
  2991. appendPlayerUpdateMask(l, k, stream, player);
  2992. }
  2993. }
  2994.  
  2995. private void method50(int i, int k, int l, int i1, int j1) {
  2996. int k1 = worldController.method300(j1, l, i);
  2997. if (k1 != 0) {
  2998. int l1 = worldController.method304(j1, l, i, k1);
  2999. int k2 = l1 >> 6 & 3;
  3000. int i3 = l1 & 0x1f;
  3001. int k3 = k;
  3002. if (k1 > 0)
  3003. k3 = i1;
  3004. int ai[] = minimapImage.myPixels;
  3005. int k4 = 24624 + l * 4 + (103 - i) * 512 * 4;
  3006. int i5 = k1 >> 14 & 0x7fff;
  3007. ObjectDef class46_2 = ObjectDef.forID(i5);
  3008. if (class46_2.anInt758 != -1) {
  3009. Background background_2 = mapScenes[class46_2.anInt758];
  3010. if (background_2 != null) {
  3011. int i6 = (class46_2.anInt744 * 4 - background_2.anInt1452) / 2;
  3012. int j6 = (class46_2.anInt761 * 4 - background_2.anInt1453) / 2;
  3013. background_2.drawBackground(48 + l * 4 + i6, 48 + (104 - i - class46_2.anInt761) * 4 + j6);
  3014. }
  3015. } else {
  3016. if (i3 == 0 || i3 == 2)
  3017. if (k2 == 0) {
  3018. ai[k4] = k3;
  3019. ai[k4 + 512] = k3;
  3020. ai[k4 + 1024] = k3;
  3021. ai[k4 + 1536] = k3;
  3022. } else if (k2 == 1) {
  3023. ai[k4] = k3;
  3024. ai[k4 + 1] = k3;
  3025. ai[k4 + 2] = k3;
  3026. ai[k4 + 3] = k3;
  3027. } else if (k2 == 2) {
  3028. ai[k4 + 3] = k3;
  3029. ai[k4 + 3 + 512] = k3;
  3030. ai[k4 + 3 + 1024] = k3;
  3031. ai[k4 + 3 + 1536] = k3;
  3032. } else if (k2 == 3) {
  3033. ai[k4 + 1536] = k3;
  3034. ai[k4 + 1536 + 1] = k3;
  3035. ai[k4 + 1536 + 2] = k3;
  3036. ai[k4 + 1536 + 3] = k3;
  3037. }
  3038. if (i3 == 3)
  3039. if (k2 == 0)
  3040. ai[k4] = k3;
  3041. else if (k2 == 1)
  3042. ai[k4 + 3] = k3;
  3043. else if (k2 == 2)
  3044. ai[k4 + 3 + 1536] = k3;
  3045. else if (k2 == 3)
  3046. ai[k4 + 1536] = k3;
  3047. if (i3 == 2)
  3048. if (k2 == 3) {
  3049. ai[k4] = k3;
  3050. ai[k4 + 512] = k3;
  3051. ai[k4 + 1024] = k3;
  3052. ai[k4 + 1536] = k3;
  3053. } else if (k2 == 0) {
  3054. ai[k4] = k3;
  3055. ai[k4 + 1] = k3;
  3056. ai[k4 + 2] = k3;
  3057. ai[k4 + 3] = k3;
  3058. } else if (k2 == 1) {
  3059. ai[k4 + 3] = k3;
  3060. ai[k4 + 3 + 512] = k3;
  3061. ai[k4 + 3 + 1024] = k3;
  3062. ai[k4 + 3 + 1536] = k3;
  3063. } else if (k2 == 2) {
  3064. ai[k4 + 1536] = k3;
  3065. ai[k4 + 1536 + 1] = k3;
  3066. ai[k4 + 1536 + 2] = k3;
  3067. ai[k4 + 1536 + 3] = k3;
  3068. }
  3069. }
  3070. }
  3071. k1 = worldController.method302(j1, l, i);
  3072. if (k1 != 0) {
  3073. int i2 = worldController.method304(j1, l, i, k1);
  3074. int l2 = i2 >> 6 & 3;
  3075. int j3 = i2 & 0x1f;
  3076. int l3 = k1 >> 14 & 0x7fff;
  3077. ObjectDef class46_1 = ObjectDef.forID(l3);
  3078. if (class46_1.anInt758 != -1) {
  3079. Background background_1 = mapScenes[class46_1.anInt758];
  3080. if (background_1 != null) {
  3081. int j5 = (class46_1.anInt744 * 4 - background_1.anInt1452) / 2;
  3082. int k5 = (class46_1.anInt761 * 4 - background_1.anInt1453) / 2;
  3083. background_1.drawBackground(48 + l * 4 + j5, 48 + (104 - i - class46_1.anInt761) * 4 + k5);
  3084. }
  3085. } else if (j3 == 9) {
  3086. int l4 = 0xeeeeee;
  3087. if (k1 > 0)
  3088. l4 = 0xee0000;
  3089. int ai1[] = minimapImage.myPixels;
  3090. int l5 = 24624 + l * 4 + (103 - i) * 512 * 4;
  3091. if (l2 == 0 || l2 == 2) {
  3092. ai1[l5 + 1536] = l4;
  3093. ai1[l5 + 1024 + 1] = l4;
  3094. ai1[l5 + 512 + 2] = l4;
  3095. ai1[l5 + 3] = l4;
  3096. } else {
  3097. ai1[l5] = l4;
  3098. ai1[l5 + 512 + 1] = l4;
  3099. ai1[l5 + 1024 + 2] = l4;
  3100. ai1[l5 + 1536 + 3] = l4;
  3101. }
  3102. }
  3103. }
  3104. k1 = worldController.method303(j1, l, i);
  3105. if (k1 != 0) {
  3106. int j2 = k1 >> 14 & 0x7fff;
  3107. ObjectDef class46 = ObjectDef.forID(j2);
  3108. if (class46.anInt758 != -1) {
  3109. Background background = mapScenes[class46.anInt758];
  3110. if (background != null) {
  3111. int i4 = (class46.anInt744 * 4 - background.anInt1452) / 2;
  3112. int j4 = (class46.anInt761 * 4 - background.anInt1453) / 2;
  3113. background.drawBackground(48 + l * 4 + i4, 48 + (104 - i - class46.anInt761) * 4 + j4);
  3114. }
  3115. }
  3116. }
  3117. }
  3118.  
  3119. private void loadTitleScreen() {
  3120. aBackground_966 = new Background(titleStreamLoader, "titlebox", 0);
  3121. aBackground_967 = new Background(titleStreamLoader, "titlebutton", 0);
  3122. aBackgroundArray1152s = new Background[12];
  3123. int j = 0;
  3124. try {
  3125. j = Integer.parseInt(getParameter("fl_icon"));
  3126. } catch (Exception _ex) {
  3127. }
  3128. if (j == 0) {
  3129. for (int k = 0; k < 12; k++)
  3130. aBackgroundArray1152s[k] = new Background(titleStreamLoader, "runes", k);
  3131.  
  3132. } else {
  3133. for (int l = 0; l < 12; l++)
  3134. aBackgroundArray1152s[l] = new Background(titleStreamLoader, "runes", 12 + (l & 3));
  3135.  
  3136. }
  3137. aClass30_Sub2_Sub1_Sub1_1201 = new Sprite(128, 265);
  3138. aClass30_Sub2_Sub1_Sub1_1202 = new Sprite(128, 265);
  3139. System.arraycopy(aRSImageProducer_1110.canvasRaster, 0, aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, 33920);
  3140.  
  3141. System.arraycopy(aRSImageProducer_1111.canvasRaster, 0, aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, 33920);
  3142.  
  3143. anIntArray851 = new int[256];
  3144. for (int k1 = 0; k1 < 64; k1++)
  3145. anIntArray851[k1] = k1 * 0x40000;
  3146.  
  3147. for (int l1 = 0; l1 < 64; l1++)
  3148. anIntArray851[l1 + 64] = 0xff0000 + 1024 * l1;
  3149.  
  3150. for (int i2 = 0; i2 < 64; i2++)
  3151. anIntArray851[i2 + 128] = 0xffff00 + 4 * i2;
  3152.  
  3153. for (int j2 = 0; j2 < 64; j2++)
  3154. anIntArray851[j2 + 192] = 0xffffff;
  3155.  
  3156. anIntArray852 = new int[256];
  3157. for (int k2 = 0; k2 < 64; k2++)
  3158. anIntArray852[k2] = k2 * 1024;
  3159.  
  3160. for (int l2 = 0; l2 < 64; l2++)
  3161. anIntArray852[l2 + 64] = 65280 + 4 * l2;
  3162.  
  3163. for (int i3 = 0; i3 < 64; i3++)
  3164. anIntArray852[i3 + 128] = 65535 + 0x40000 * i3;
  3165.  
  3166. for (int j3 = 0; j3 < 64; j3++)
  3167. anIntArray852[j3 + 192] = 0xffffff;
  3168.  
  3169. anIntArray853 = new int[256];
  3170. for (int k3 = 0; k3 < 64; k3++)
  3171. anIntArray853[k3] = k3 * 4;
  3172.  
  3173. for (int l3 = 0; l3 < 64; l3++)
  3174. anIntArray853[l3 + 64] = 255 + 0x40000 * l3;
  3175.  
  3176. for (int i4 = 0; i4 < 64; i4++)
  3177. anIntArray853[i4 + 128] = 0xff00ff + 1024 * i4;
  3178.  
  3179. for (int j4 = 0; j4 < 64; j4++)
  3180. anIntArray853[j4 + 192] = 0xffffff;
  3181.  
  3182. anIntArray850 = new int[256];
  3183. anIntArray1190 = new int[32768];
  3184. anIntArray1191 = new int[32768];
  3185. randomizeBackground(null);
  3186. anIntArray828 = new int[32768];
  3187. anIntArray829 = new int[32768];
  3188. drawLoadingText(10, "Connecting to fileserver");
  3189. if (!aBoolean831) {
  3190. drawFlames = true;
  3191. aBoolean831 = true;
  3192. startRunnable(this, 2);
  3193. }
  3194. }
  3195.  
  3196. private static void setHighMem() {
  3197. WorldController.lowMem = false;
  3198. Rasterizer.lowMem = false;
  3199. lowMem = false;
  3200. ObjectManager.lowMem = false;
  3201. ObjectDef.lowMem = false;
  3202. }
  3203.  
  3204. public static void main(String args[]) {
  3205. try {
  3206. if (ClientConstants.LOCALHOST) {
  3207. server = "127.0.0.1";
  3208. } else if (args != null && args.length == 1) {
  3209. server = args[0];
  3210. }
  3211. nodeID = 10;
  3212. portOff = 0;
  3213. setHighMem();
  3214. isMembers = true;
  3215. Signlink.storeid = 32;
  3216. Signlink.startpriv(InetAddress.getLocalHost());
  3217. frameMode(ScreenMode.FIXED);
  3218. instance = new Client();
  3219. instance.createClientFrame(frameWidth, frameHeight);
  3220. SettingHandler.load();
  3221. } catch (Exception e) {
  3222. e.printStackTrace();
  3223. }
  3224. }
  3225.  
  3226. public static Client instance;
  3227.  
  3228. private void loadingStages() {
  3229. if (lowMem && loadingStage == 2 && ObjectManager.anInt131 != plane) {
  3230. aRSImageProducer_1165.initDrawingArea();
  3231. drawLoadingMessages(1, "Loading - please wait.", null);
  3232. aRSImageProducer_1165.drawGraphics(frameMode == ScreenMode.FIXED ? 4 : 0, super.graphics, frameMode == ScreenMode.FIXED ? 4 : 0);
  3233. loadingStage = 1;
  3234. aLong824 = System.currentTimeMillis();
  3235. }
  3236. if (loadingStage == 1) {
  3237. int j = method54();
  3238. if (j != 0 && System.currentTimeMillis() - aLong824 > 0x57e40L) {
  3239. Signlink.reporterror(myUsername + " glcfb " + aLong1215 + "," + j + "," + lowMem + "," + decompressors[0] + "," + onDemandFetcher.getNodeCount() + "," + plane + "," + anInt1069 + "," + anInt1070);
  3240. aLong824 = System.currentTimeMillis();
  3241. }
  3242. }
  3243. if (loadingStage == 2 && plane != anInt985) {
  3244. anInt985 = plane;
  3245. method24(plane);
  3246. }
  3247. }
  3248.  
  3249. private int method54() {
  3250. for (int i = 0; i < aByteArrayArray1183.length; i++) {
  3251. if (aByteArrayArray1183[i] == null && anIntArray1235[i] != -1)
  3252. return -1;
  3253. if (aByteArrayArray1247[i] == null && anIntArray1236[i] != -1)
  3254. return -2;
  3255. }
  3256. boolean flag = true;
  3257. for (int j = 0; j < aByteArrayArray1183.length; j++) {
  3258. byte abyte0[] = aByteArrayArray1247[j];
  3259. if (abyte0 != null) {
  3260. int k = (anIntArray1234[j] >> 8) * 64 - baseX;
  3261. int l = (anIntArray1234[j] & 0xff) * 64 - baseY;
  3262. if (aBoolean1159) {
  3263. k = 10;
  3264. l = 10;
  3265. }
  3266. flag &= ObjectManager.method189(k, abyte0, l);
  3267. }
  3268. }
  3269. if (!flag)
  3270. return -3;
  3271. if (aBoolean1080) {
  3272. return -4;
  3273. } else {
  3274. loadingStage = 2;
  3275. ObjectManager.anInt131 = plane;
  3276. method22();
  3277. stream.createFrame(121);
  3278. return 0;
  3279. }
  3280. }
  3281.  
  3282. private void method55() {
  3283. 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())
  3284. if (class30_sub2_sub4_sub4.anInt1597 != plane || loopCycle > class30_sub2_sub4_sub4.anInt1572)
  3285. class30_sub2_sub4_sub4.unlink();
  3286. else if (loopCycle >= class30_sub2_sub4_sub4.anInt1571) {
  3287. if (class30_sub2_sub4_sub4.anInt1590 > 0) {
  3288. Npc npc = npcArray[class30_sub2_sub4_sub4.anInt1590 - 1];
  3289. if (npc != null && npc.x >= 0 && npc.x < 13312 && npc.y >= 0 && npc.y < 13312)
  3290. 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);
  3291. }
  3292. if (class30_sub2_sub4_sub4.anInt1590 < 0) {
  3293. int j = -class30_sub2_sub4_sub4.anInt1590 - 1;
  3294. Player player;
  3295. if (j == unknownInt10)
  3296. player = myPlayer;
  3297. else
  3298. player = playerArray[j];
  3299. if (player != null && player.x >= 0 && player.x < 13312 && player.y >= 0 && player.y < 13312)
  3300. 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);
  3301. }
  3302. class30_sub2_sub4_sub4.method456(anInt945);
  3303. 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);
  3304. }
  3305.  
  3306. }
  3307.  
  3308. public AppletContext getAppletContext() {
  3309. if (Signlink.mainapp != null)
  3310. return Signlink.mainapp.getAppletContext();
  3311. else
  3312. return super.getAppletContext();
  3313. }
  3314.  
  3315. private void processOnDemandQueue() {
  3316. do {
  3317. OnDemandData onDemandData;
  3318. do {
  3319. onDemandData = onDemandFetcher.getNextNode();
  3320. if (onDemandData == null)
  3321. return;
  3322. if (onDemandData.dataType == 0) {
  3323. Model.method460(onDemandData.buffer, onDemandData.ID);
  3324. if (backDialogID != -1)
  3325. inputTaken = true;
  3326. }
  3327. if (onDemandData.dataType == 1) {
  3328. SequenceFrame.load(onDemandData.ID, onDemandData.buffer);
  3329. }
  3330. if (onDemandData.dataType == 2 && onDemandData.ID == nextSong && onDemandData.buffer != null)
  3331. saveMidi(songChanging, onDemandData.buffer);
  3332. /*
  3333. * if (onDemandData.dataType == 4) {
  3334. * Texture.decode(onDemandData.ID, onDemandData.buffer); }
  3335. */
  3336. if (onDemandData.dataType == 3 && loadingStage == 1) {
  3337. for (int i = 0; i < aByteArrayArray1183.length; i++) {
  3338. if (anIntArray1235[i] == onDemandData.ID) {
  3339. aByteArrayArray1183[i] = onDemandData.buffer;
  3340. if (onDemandData.buffer == null)
  3341. anIntArray1235[i] = -1;
  3342. break;
  3343. }
  3344. if (anIntArray1236[i] != onDemandData.ID)
  3345. continue;
  3346. aByteArrayArray1247[i] = onDemandData.buffer;
  3347. if (onDemandData.buffer == null)
  3348. anIntArray1236[i] = -1;
  3349. break;
  3350. }
  3351.  
  3352. }
  3353. } while (onDemandData.dataType != 93 || !onDemandFetcher.method564(onDemandData.ID));
  3354. ObjectManager.method173(new Stream(onDemandData.buffer), onDemandFetcher);
  3355. } while (true);
  3356. }
  3357.  
  3358. private void method60(int i) {
  3359. RSInterface class9 = RSInterface.interfaceCache[i];
  3360. if (class9 == null || class9.children == null) {
  3361. return;
  3362. }
  3363. for (int j = 0; j < class9.children.length; j++) {
  3364. if (class9.children[j] == -1)
  3365. break;
  3366. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j]];
  3367. if (class9_1.type == 1)
  3368. method60(class9_1.id);
  3369. class9_1.anInt246 = 0;
  3370. class9_1.anInt208 = 0;
  3371. }
  3372. }
  3373.  
  3374. private void drawHeadIcon() {
  3375. if (anInt855 != 2) {
  3376. return;
  3377. }
  3378. calcEntityScreenPos((anInt934 - baseX << 7) + anInt937, anInt936 * 2, (anInt935 - baseY << 7) + anInt938);
  3379. if (spriteDrawX > -1 && loopCycle % 20 < 10) {
  3380. headIconsHint[1].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  3381. }
  3382. }
  3383.  
  3384. private void mainGameProcessor() {
  3385. refreshFrameSize();
  3386. if (anInt1104 > 1)
  3387. anInt1104--;
  3388. if (anInt1011 > 0)
  3389. anInt1011--;
  3390. for (int j = 0; j < 1000; j++)
  3391. if (!parsePacket())
  3392. break;
  3393.  
  3394. if (!loggedIn)
  3395. return;
  3396. synchronized (mouseDetection.syncObject) {
  3397. if (flagged) {
  3398. if (super.clickMode3 != 0 || mouseDetection.coordsIndex >= 40) {
  3399. stream.createFrame(45);
  3400. stream.writeWordBigEndian(0);
  3401. int j2 = stream.currentOffset;
  3402. int j3 = 0;
  3403. for (int j4 = 0; j4 < mouseDetection.coordsIndex; j4++) {
  3404. if (j2 - stream.currentOffset >= 240)
  3405. break;
  3406. j3++;
  3407. int l4 = mouseDetection.coordsY[j4];
  3408. if (l4 < 0)
  3409. l4 = 0;
  3410. else if (l4 > 502)
  3411. l4 = 502;
  3412. int k5 = mouseDetection.coordsX[j4];
  3413. if (k5 < 0)
  3414. k5 = 0;
  3415. else if (k5 > 764)
  3416. k5 = 764;
  3417. int i6 = l4 * 765 + k5;
  3418. if (mouseDetection.coordsY[j4] == -1 && mouseDetection.coordsX[j4] == -1) {
  3419. k5 = -1;
  3420. l4 = -1;
  3421. i6 = 0x7ffff;
  3422. }
  3423. if (k5 == anInt1237 && l4 == anInt1238) {
  3424. if (anInt1022 < 2047)
  3425. anInt1022++;
  3426. } else {
  3427. int j6 = k5 - anInt1237;
  3428. anInt1237 = k5;
  3429. int k6 = l4 - anInt1238;
  3430. anInt1238 = l4;
  3431. if (anInt1022 < 8 && j6 >= -32 && j6 <= 31 && k6 >= -32 && k6 <= 31) {
  3432. j6 += 32;
  3433. k6 += 32;
  3434. stream.writeWord((anInt1022 << 12) + (j6 << 6) + k6);
  3435. anInt1022 = 0;
  3436. } else if (anInt1022 < 8) {
  3437. stream.writeDWordBigEndian(0x800000 + (anInt1022 << 19) + i6);
  3438. anInt1022 = 0;
  3439. } else {
  3440. stream.writeDWord(0xc0000000 + (anInt1022 << 19) + i6);
  3441. anInt1022 = 0;
  3442. }
  3443. }
  3444. }
  3445.  
  3446. stream.writeBytes(stream.currentOffset - j2);
  3447. if (j3 >= mouseDetection.coordsIndex) {
  3448. mouseDetection.coordsIndex = 0;
  3449. } else {
  3450. mouseDetection.coordsIndex -= j3;
  3451. for (int i5 = 0; i5 < mouseDetection.coordsIndex; i5++) {
  3452. mouseDetection.coordsX[i5] = mouseDetection.coordsX[i5 + j3];
  3453. mouseDetection.coordsY[i5] = mouseDetection.coordsY[i5 + j3];
  3454. }
  3455.  
  3456. }
  3457. }
  3458. } else {
  3459. mouseDetection.coordsIndex = 0;
  3460. }
  3461. }
  3462. if (super.clickMode3 != 0) {
  3463. long l = (super.aLong29 - aLong1220) / 50L;
  3464. if (l > 4095L)
  3465. l = 4095L;
  3466. aLong1220 = super.aLong29;
  3467. int k2 = super.saveClickY;
  3468. if (k2 < 0)
  3469. k2 = 0;
  3470. else if (k2 > 502)
  3471. k2 = 502;
  3472. int k3 = super.saveClickX;
  3473. if (k3 < 0)
  3474. k3 = 0;
  3475. else if (k3 > 764)
  3476. k3 = 764;
  3477. int k4 = k2 * 765 + k3;
  3478. int j5 = 0;
  3479. if (super.clickMode3 == 2)
  3480. j5 = 1;
  3481. int l5 = (int) l;
  3482. stream.createFrame(241);
  3483. stream.writeDWord((l5 << 20) + (j5 << 19) + k4);
  3484. }
  3485. if (anInt1016 > 0)
  3486. anInt1016--;
  3487. if (super.keyArray[1] == 1 || super.keyArray[2] == 1 || super.keyArray[3] == 1 || super.keyArray[4] == 1)
  3488. aBoolean1017 = true;
  3489. if (aBoolean1017 && anInt1016 <= 0) {
  3490. anInt1016 = 20;
  3491. aBoolean1017 = false;
  3492. stream.createFrame(86);
  3493. stream.writeWord(anInt1184);
  3494. stream.method432(minimapInt1);
  3495. }
  3496. if (super.awtFocus && !aBoolean954) {
  3497. aBoolean954 = true;
  3498. stream.createFrame(3);
  3499. stream.writeWordBigEndian(1);
  3500. }
  3501. if (!super.awtFocus && aBoolean954) {
  3502. aBoolean954 = false;
  3503. stream.createFrame(3);
  3504. stream.writeWordBigEndian(0);
  3505. }
  3506. loadingStages();
  3507. method115();
  3508. anInt1009++;
  3509. if (anInt1009 > 750)
  3510. dropClient();
  3511. method114();
  3512. method95();
  3513. method38();
  3514. anInt945++;
  3515. if (crossType != 0) {
  3516. crossIndex += 20;
  3517. if (crossIndex >= 400)
  3518. crossType = 0;
  3519. }
  3520. if (atInventoryInterfaceType != 0) {
  3521. atInventoryLoopCycle++;
  3522. if (atInventoryLoopCycle >= 15) {
  3523. if (atInventoryInterfaceType == 2) {
  3524. }
  3525. if (atInventoryInterfaceType == 3)
  3526. inputTaken = true;
  3527. atInventoryInterfaceType = 0;
  3528. }
  3529. }
  3530. if (activeInterfaceType != 0) {
  3531. dragCycle++;
  3532. if (super.mouseX > pressX + 5 || super.mouseX < pressX - 5 || super.mouseY > pressY + 5 || super.mouseY < pressY - 5)
  3533. aBoolean1242 = true;
  3534. if (super.clickMode2 == 0) {
  3535. if (activeInterfaceType == 2) {
  3536. }
  3537. if (activeInterfaceType == 3)
  3538. inputTaken = true;
  3539. activeInterfaceType = 0;
  3540. //if (aBoolean1242 && dragCycle >= 15) {
  3541. if (aBoolean1242 && dragCycle >= 10) {
  3542. lastActiveInvInterface = -1;
  3543. processRightClick();
  3544. if (focusedDragWidget == 5382) {
  3545. Point southWest, northEast;
  3546.  
  3547. if (frameMode == ScreenMode.FIXED) {
  3548. southWest = new Point(56, 81);
  3549. northEast = new Point(101, 41);
  3550. } else {
  3551. int xOffset = (frameWidth - 237 - RSInterface.interfaceCache[5292].width) / 2;
  3552. int yOffset = 36 + ((frameHeight - 503) / 2);
  3553. southWest = new Point(xOffset + 76, yOffset + 62);
  3554. northEast = new Point(xOffset + 117, yOffset + 22);
  3555. }
  3556.  
  3557. int[] slots = new int[10];
  3558.  
  3559. for (int i = 0; i < slots.length; i++) {
  3560. slots[i] = (40 * i) + (int) southWest.getX();
  3561. }
  3562.  
  3563. for (int i = 0; i < slots.length; i++) {
  3564. if ((super.mouseX >= slots[i]) && (super.mouseX <= (slots[i] + 41)) && (super.mouseY >= northEast.getY()) && (super.mouseY <= southWest.getY())) {
  3565. stream.createFrame(214);
  3566. stream.method433(focusedDragWidget);
  3567. stream.method424(2);
  3568. stream.method433(dragFromSlot);
  3569. stream.method431(i);
  3570. return;
  3571. }
  3572. }
  3573. }
  3574.  
  3575. if (lastActiveInvInterface == -1 && focusedDragWidget == 3214 && frameMode == ScreenMode.FIXED) {
  3576. if (super.mouseX <= 516 && super.mouseY <= 338 && super.mouseX >= 0 && super.mouseY >= 0) {
  3577. stream.createFrame(87);
  3578. stream.method432(RSInterface.interfaceCache[3214].inv[dragFromSlot] - 1);
  3579. stream.writeWord(focusedDragWidget);
  3580. stream.method432(dragFromSlot);
  3581. }
  3582. } else if (lastActiveInvInterface == focusedDragWidget && mouseInvInterfaceIndex != dragFromSlot) {
  3583. RSInterface class9 = RSInterface.interfaceCache[focusedDragWidget];
  3584. int j1 = 0;
  3585. if (anInt913 == 1 && class9.contentType == 206)
  3586. j1 = 1;
  3587. if (class9.inv[mouseInvInterfaceIndex] <= 0)
  3588. j1 = 0;
  3589. if (class9.aBoolean235) {
  3590. int l2 = dragFromSlot;
  3591. int l3 = mouseInvInterfaceIndex;
  3592. class9.inv[l3] = class9.inv[l2];
  3593. class9.invStackSizes[l3] = class9.invStackSizes[l2];
  3594. class9.inv[l2] = -1;
  3595. class9.invStackSizes[l2] = 0;
  3596. } else if (j1 == 0) {
  3597. class9.swapInventoryItems(dragFromSlot, mouseInvInterfaceIndex);
  3598. }
  3599.  
  3600. stream.createFrame(214);
  3601. stream.method433(focusedDragWidget);
  3602. stream.method424(j1);
  3603. stream.method433(dragFromSlot);
  3604. stream.method431(mouseInvInterfaceIndex);
  3605. }
  3606. } else if ((anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  3607. determineMenuSize();
  3608. else if (menuActionRow > 0)
  3609. doAction(menuActionRow - 1);
  3610. atInventoryLoopCycle = 10;
  3611. super.clickMode3 = 0;
  3612. }
  3613. }
  3614. if (WorldController.anInt470 != -1) {
  3615. int k = WorldController.anInt470;
  3616. int k1 = WorldController.anInt471;
  3617. boolean flag = doWalkTo(0, 0, 0, 0, myPlayer.smallY[0], 0, 0, k1, myPlayer.smallX[0], true, k);
  3618. WorldController.anInt470 = -1;
  3619. if (flag) {
  3620. crossX = super.saveClickX;
  3621. crossY = super.saveClickY;
  3622. crossType = 1;
  3623. crossIndex = 0;
  3624. }
  3625. }
  3626. if (super.clickMode3 == 1 && aString844 != null) {
  3627. aString844 = null;
  3628. inputTaken = true;
  3629. super.clickMode3 = 0;
  3630. }
  3631. processMenuClick();
  3632. if (super.clickMode2 == 1 || super.clickMode3 == 1)
  3633. anInt1213++;
  3634. if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  3635. if (anInt1501 < 0 && !menuOpen) {
  3636. anInt1501++;
  3637. if (anInt1501 == 0) {
  3638. if (anInt1500 != 0) {
  3639. inputTaken = true;
  3640. }
  3641. if (anInt1044 != 0) {
  3642. }
  3643. }
  3644. }
  3645. } else if (anInt1501 > 0) {
  3646. anInt1501--;
  3647. }
  3648. if (loadingStage == 2)
  3649. method108();
  3650. if (loadingStage == 2 && aBoolean1160)
  3651. calcCameraPos();
  3652. for (int i1 = 0; i1 < 5; i1++)
  3653. anIntArray1030[i1]++;
  3654.  
  3655. method73();
  3656. super.idleTime++;
  3657. if (super.idleTime > 4500) {
  3658. anInt1011 = 250;
  3659. super.idleTime -= 500;
  3660. stream.createFrame(202);
  3661. }
  3662. anInt1010++;
  3663. if (anInt1010 > 50)
  3664. stream.createFrame(0);
  3665. try {
  3666. if (socketStream != null && stream.currentOffset > 0) {
  3667. socketStream.queueBytes(stream.currentOffset, stream.buffer);
  3668. stream.currentOffset = 0;
  3669. anInt1010 = 0;
  3670. }
  3671. } catch (IOException _ex) {
  3672. dropClient();
  3673. } catch (Exception exception) {
  3674. resetLogout();
  3675. }
  3676. }
  3677.  
  3678. private void method63() {
  3679. Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179.reverseGetFirst();
  3680. for (; class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179.reverseGetNext())
  3681. if (class30_sub1.anInt1294 == -1) {
  3682. class30_sub1.anInt1302 = 0;
  3683. method89(class30_sub1);
  3684. } else {
  3685. class30_sub1.unlink();
  3686. }
  3687.  
  3688. }
  3689.  
  3690. void resetImageProducers() {
  3691. if (aRSImageProducer_1107 != null)
  3692. return;
  3693. super.fullGameScreen = null;
  3694. aRSImageProducer_1166 = null;
  3695. aRSImageProducer_1164 = null;
  3696. aRSImageProducer_1163 = null;
  3697. aRSImageProducer_1165 = null;
  3698. aRSImageProducer_1125 = null;
  3699. aRSImageProducer_1110 = new ImageProducer(128, 265);
  3700. DrawingArea.setAllPixelsToZero();
  3701. aRSImageProducer_1111 = new ImageProducer(128, 265);
  3702. DrawingArea.setAllPixelsToZero();
  3703. aRSImageProducer_1107 = new ImageProducer(509, 171);
  3704. DrawingArea.setAllPixelsToZero();
  3705. aRSImageProducer_1108 = new ImageProducer(360, 132);
  3706. DrawingArea.setAllPixelsToZero();
  3707. aRSImageProducer_1109 = new ImageProducer(frameWidth, frameHeight);
  3708. DrawingArea.setAllPixelsToZero();
  3709. aRSImageProducer_1112 = new ImageProducer(202, 238);
  3710. DrawingArea.setAllPixelsToZero();
  3711. aRSImageProducer_1113 = new ImageProducer(203, 238);
  3712. DrawingArea.setAllPixelsToZero();
  3713. aRSImageProducer_1114 = new ImageProducer(74, 94);
  3714. DrawingArea.setAllPixelsToZero();
  3715. aRSImageProducer_1115 = new ImageProducer(75, 94);
  3716. DrawingArea.setAllPixelsToZero();
  3717. welcomeScreenRaised = true;
  3718. }
  3719.  
  3720. public float loadPercent = 0.0F;
  3721.  
  3722. public void drawSmoothLoading(int percent, String message) {
  3723. for (float perc = loadPercent; perc < (float) percent; perc = (float) ((double) perc + 0.29999999999999999D)) {
  3724. drawLoadingText((int) perc, message);
  3725. }
  3726. loadPercent = percent;
  3727. }
  3728.  
  3729. private static Sprite BACKGROUND;
  3730. private static Sprite LOADING_BAR;
  3731.  
  3732. static {
  3733. try {
  3734. BACKGROUND = new Sprite(new URL("http://www.vencillio.com/Daniel/11.png"));
  3735. LOADING_BAR = new Sprite(new URL("http://www.vencillio.com/Daniel/12.png"));
  3736. } catch (MalformedURLException e) {
  3737. e.printStackTrace();
  3738. }
  3739. }
  3740.  
  3741. public void drawLoadingText(int percent, String message) {
  3742. anInt1079 = percent;
  3743. aString1049 = message;
  3744. resetImageProducers();
  3745. if (titleStreamLoader == null) {
  3746. super.drawLoadingText(percent, message);
  3747. return;
  3748. }
  3749. refreshFrameSize();
  3750. aRSImageProducer_1109.initDrawingArea();
  3751.  
  3752. BACKGROUND.drawSprite((frameWidth / 2) - (BACKGROUND.myWidth / 2), (frameHeight / 2) - (BACKGROUND.myHeight / 2));
  3753. LOADING_BAR.drawSprite((frameWidth / 2) - 274, (frameHeight / 2) - 10);
  3754. DrawingArea.drawPixels(36, (frameHeight / 2) - 10, ((frameWidth / 2) - 274 + percent), 0x302e2c, (530 - percent));
  3755. regularText.method382(0xffffff, (frameWidth / 2), message, (frameHeight / 2) + 12, true);
  3756. aRSImageProducer_1109.drawGraphics(0, super.graphics, 0);
  3757. if (welcomeScreenRaised) {
  3758. welcomeScreenRaised = false;
  3759. }
  3760. }
  3761.  
  3762. private void method65(int i, int j, int k, int l, RSInterface class9, int i1, boolean flag, int j1) {
  3763. int anInt992;
  3764. if (aBoolean972)
  3765. anInt992 = 32;
  3766. else
  3767. anInt992 = 0;
  3768. aBoolean972 = false;
  3769. if (k >= i && k < i + 16 && l >= i1 && l < i1 + 16) {
  3770. class9.scrollPosition -= anInt1213 * 4;
  3771. if (flag) {
  3772. }
  3773. } else if (k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j) {
  3774. class9.scrollPosition += anInt1213 * 4;
  3775. if (flag) {
  3776. }
  3777. } else if (k >= i - anInt992 && k < i + 16 + anInt992 && l >= i1 + 16 && l < (i1 + j) - 16 && anInt1213 > 0) {
  3778. int l1 = ((j - 32) * j) / j1;
  3779. if (l1 < 8)
  3780. l1 = 8;
  3781. int i2 = l - i1 - 16 - l1 / 2;
  3782. int j2 = j - 32 - l1;
  3783. class9.scrollPosition = ((j1 - j) * i2) / j2;
  3784. if (flag) {
  3785. }
  3786. aBoolean972 = true;
  3787. }
  3788. }
  3789.  
  3790. private boolean method66(int i, int j, int k) {
  3791. int i1 = i >> 14 & 0x7fff;
  3792. int j1 = worldController.method304(plane, k, j, i);
  3793. if (j1 == -1)
  3794. return false;
  3795. int k1 = j1 & 0x1f;
  3796. int l1 = j1 >> 6 & 3;
  3797. if (k1 == 10 || k1 == 11 || k1 == 22) {
  3798. ObjectDef class46 = ObjectDef.forID(i1);
  3799. int i2;
  3800. int j2;
  3801. if (l1 == 0 || l1 == 2) {
  3802. i2 = class46.anInt744;
  3803. j2 = class46.anInt761;
  3804. } else {
  3805. i2 = class46.anInt761;
  3806. j2 = class46.anInt744;
  3807. }
  3808. int k2 = class46.anInt768;
  3809. if (l1 != 0)
  3810. k2 = (k2 << l1 & 0xf) + (k2 >> 4 - l1);
  3811. doWalkTo(2, 0, j2, 0, myPlayer.smallY[0], i2, k2, j, myPlayer.smallX[0], false, k);
  3812. } else {
  3813. doWalkTo(2, l1, 0, k1 + 1, myPlayer.smallY[0], 0, 0, j, myPlayer.smallX[0], false, k);
  3814. }
  3815. crossX = super.saveClickX;
  3816. crossY = super.saveClickY;
  3817. crossType = 2;
  3818. crossIndex = 0;
  3819. return true;
  3820. }
  3821.  
  3822. private StreamLoader streamLoaderForName(int i, String s, String s1, int j, int k) {
  3823. byte abyte0[] = null;
  3824. int l = 5;
  3825. try {
  3826. if (decompressors[0] != null)
  3827. abyte0 = decompressors[0].decompress(i);
  3828. } catch (Exception _ex) {
  3829. }
  3830. if (abyte0 != null) {
  3831. // aCRC32_930.reset();
  3832. // aCRC32_930.update(abyte0);
  3833. // int i1 = (int)aCRC32_930.getValue();
  3834. // if(i1 != j)
  3835. }
  3836. if (abyte0 != null) {
  3837. StreamLoader streamLoader = new StreamLoader(abyte0);
  3838. return streamLoader;
  3839. }
  3840. int j1 = 0;
  3841. while (abyte0 == null) {
  3842. String s2 = "Unknown error";
  3843. drawLoadingText(k, "Requesting " + s);
  3844. try {
  3845. int k1 = 0;
  3846. DataInputStream datainputstream = openJagGrabInputStream(s1 + j);
  3847. byte abyte1[] = new byte[6];
  3848. datainputstream.readFully(abyte1, 0, 6);
  3849. Stream stream = new Stream(abyte1);
  3850. stream.currentOffset = 3;
  3851. int i2 = stream.read3Bytes() + 6;
  3852. int j2 = 6;
  3853. abyte0 = new byte[i2];
  3854. System.arraycopy(abyte1, 0, abyte0, 0, 6);
  3855.  
  3856. while (j2 < i2) {
  3857. int l2 = i2 - j2;
  3858. if (l2 > 1000)
  3859. l2 = 1000;
  3860. int j3 = datainputstream.read(abyte0, j2, l2);
  3861. if (j3 < 0) {
  3862. s2 = "Length error: " + j2 + "/" + i2;
  3863. throw new IOException("EOF");
  3864. }
  3865. j2 += j3;
  3866. int k3 = (j2 * 100) / i2;
  3867. if (k3 != k1)
  3868. drawLoadingText(k, "Loading " + s + " - " + k3 + "%");
  3869. k1 = k3;
  3870. }
  3871. datainputstream.close();
  3872. try {
  3873. if (decompressors[0] != null)
  3874. decompressors[0].method234(abyte0.length, abyte0, i);
  3875. } catch (Exception _ex) {
  3876. decompressors[0] = null;
  3877. }
  3878. /*
  3879. * if(abyte0 != null) { aCRC32_930.reset();
  3880. * aCRC32_930.update(abyte0); int i3 =
  3881. * (int)aCRC32_930.getValue(); if(i3 != j) { abyte0 = null;
  3882. * j1++; s2 = "Checksum error: " + i3; } }
  3883. */
  3884. } catch (IOException ioexception) {
  3885. if (s2.equals("Unknown error"))
  3886. s2 = "Connection error";
  3887. abyte0 = null;
  3888. } catch (NullPointerException _ex) {
  3889. s2 = "Null error";
  3890. abyte0 = null;
  3891. if (!Signlink.reporterror)
  3892. return null;
  3893. } catch (ArrayIndexOutOfBoundsException _ex) {
  3894. s2 = "Bounds error";
  3895. abyte0 = null;
  3896. if (!Signlink.reporterror)
  3897. return null;
  3898. } catch (Exception _ex) {
  3899. s2 = "Unexpected error";
  3900. abyte0 = null;
  3901. if (!Signlink.reporterror)
  3902. return null;
  3903. }
  3904. if (abyte0 == null) {
  3905. for (int l1 = l; l1 > 0; l1--) {
  3906. if (j1 >= 3) {
  3907. drawLoadingText(k, "Game updated - please reload page");
  3908. l1 = 10;
  3909. } else {
  3910. drawLoadingText(k, s2 + " - Retrying in " + l1);
  3911. }
  3912. try {
  3913. Thread.sleep(1000L);
  3914. } catch (Exception _ex) {
  3915. }
  3916. }
  3917.  
  3918. l *= 2;
  3919. if (l > 60)
  3920. l = 60;
  3921. aBoolean872 = !aBoolean872;
  3922. }
  3923.  
  3924. }
  3925.  
  3926. StreamLoader streamLoader_1 = new StreamLoader(abyte0);
  3927. return streamLoader_1;
  3928. }
  3929.  
  3930. private void dropClient() {
  3931. if (anInt1011 > 0) {
  3932. resetLogout();
  3933. return;
  3934. }
  3935. DrawingArea.fillPixels(2, 229, 39, 0xffffff, 2); // white box around
  3936. DrawingArea.drawPixels(37, 3, 3, 0, 227); // black fill
  3937. regularText.drawText(0, "Connection lost.", 19, 120);
  3938. regularText.drawText(0xffffff, "Connection lost.", 18, 119);
  3939. regularText.drawText(0, "Please wait - attempting to reestablish.", 34, 117);
  3940. regularText.drawText(0xffffff, "Please wait - attempting to reestablish.", 34, 116);
  3941. aRSImageProducer_1165.drawGraphics(frameMode == ScreenMode.FIXED ? 4 : 0, super.graphics, frameMode == ScreenMode.FIXED ? 4 : 0);
  3942. anInt1021 = 0;
  3943. destX = 0;
  3944. if (rememberMe) {
  3945. AccountManager.saveAccount();
  3946. }
  3947. RSSocket rsSocket = socketStream;
  3948. loggedIn = false;
  3949. loginFailures = 0;
  3950. setBounds();
  3951. login(myUsername, myPassword, true);
  3952. SettingHandler.save();
  3953. console.openConsole = false;
  3954. if (!loggedIn)
  3955. resetLogout();
  3956. try {
  3957. rsSocket.close();
  3958. } catch (Exception _ex) {
  3959. }
  3960. }
  3961.  
  3962. public void setNorth() {
  3963. anInt1278 = 0;
  3964. anInt1131 = 0;
  3965. anInt896 = 0;
  3966. minimapInt1 = 0;
  3967. minimapInt2 = 0;
  3968. minimapInt3 = 0;
  3969. }
  3970.  
  3971. private void doAction(int i) {
  3972. if (i < 0)
  3973. return;
  3974. if (inputDialogState != 0) {
  3975. inputDialogState = 0;
  3976. inputTaken = true;
  3977. }
  3978. int j = menuActionCmd2[i];
  3979. int k = menuActionCmd3[i];
  3980. int l = menuActionID[i];
  3981. int i1 = menuActionCmd1[i];
  3982.  
  3983. if (l >= 2000)
  3984. l -= 2000;
  3985. if (l == 701) {
  3986. extendChatArea();
  3987. }
  3988. if (l == 713) {
  3989. inputTaken = true;
  3990. messagePromptRaised = true;
  3991. amountOrNameInput = "";
  3992. promptInput = "";
  3993. inputDialogState = 0;
  3994. friendsListAction = 557;
  3995. aString1121 = "Enter amount to withdraw";
  3996. }
  3997. if (l == 714) {
  3998. stream.createFrame(185);
  3999. stream.writeWord(714);
  4000. }
  4001. if (l == 715) {
  4002. stream.createFrame(185);
  4003. stream.writeWord(715);
  4004. }
  4005. if (l == 850) {
  4006. stream.createFrame(185);
  4007. stream.writeWord(1507);
  4008. }
  4009. if (l == 291) {
  4010. stream.createFrame(140);
  4011. stream.method432(j);
  4012. stream.writeWord(k);
  4013. stream.method432(i1);
  4014. }
  4015.  
  4016. if (l == 300) {
  4017. stream.createFrame(141);
  4018. stream.method432(j);
  4019. stream.writeWord(k);
  4020. stream.method432(i1);
  4021. stream.writeDWord(modifiableXValue);
  4022. }
  4023. if (l == 474) {
  4024. counterOn = !counterOn;
  4025. }
  4026. if (l == 475) {
  4027. xpCounter = 0;
  4028. stream.createFrame(148);
  4029. }
  4030. if (l == 476) {
  4031. openInterfaceID = 32800;
  4032. }
  4033. if (l == 696) {
  4034. setNorth();
  4035. }
  4036. if (l == 1506) { // Select quick prayers
  4037. stream.createFrame(185);
  4038. stream.writeWord(5001);
  4039. }
  4040. if (l == 1500) { // Toggle quick prayers
  4041. prayClicked = !prayClicked;
  4042. stream.createFrame(185);
  4043. stream.writeWord(5000);
  4044. }
  4045. if (l == 104) {
  4046. RSInterface class9_1 = RSInterface.interfaceCache[k];
  4047. spellID = class9_1.id;
  4048. }
  4049. if (l == 582) {
  4050. Npc npc = npcArray[i1];
  4051. if (npc != null) {
  4052. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0], myPlayer.smallX[0], false, npc.smallX[0]);
  4053. crossX = super.saveClickX;
  4054. crossY = super.saveClickY;
  4055. crossType = 2;
  4056. crossIndex = 0;
  4057. stream.createFrame(57);
  4058. stream.method432(anInt1285);
  4059. stream.method432(i1);
  4060. stream.method431(anInt1283);
  4061. stream.method432(anInt1284);
  4062. }
  4063. }
  4064. if (l == 234) {
  4065. boolean flag1 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4066. if (!flag1)
  4067. flag1 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4068. crossX = super.saveClickX;
  4069. crossY = super.saveClickY;
  4070. crossType = 2;
  4071. crossIndex = 0;
  4072. stream.createFrame(236);
  4073. stream.method431(k + baseY);
  4074. stream.writeWord(i1);
  4075. stream.method431(j + baseX);
  4076. }
  4077. if (l == 62 && method66(i1, k, j)) {
  4078. stream.createFrame(192);
  4079. stream.writeWord(anInt1284);
  4080. stream.method431(i1 >> 14 & 0x7fff);
  4081. stream.method433(k + baseY);
  4082. stream.method431(anInt1283);
  4083. stream.method433(j + baseX);
  4084. stream.writeWord(anInt1285);
  4085. }
  4086. if (l == 511) {
  4087. boolean flag2 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4088. if (!flag2)
  4089. flag2 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4090. crossX = super.saveClickX;
  4091. crossY = super.saveClickY;
  4092. crossType = 2;
  4093. crossIndex = 0;
  4094. stream.createFrame(25);
  4095. stream.method431(anInt1284);
  4096. stream.method432(anInt1285);
  4097. stream.writeWord(i1);
  4098. stream.method432(k + baseY);
  4099. stream.method433(anInt1283);
  4100. stream.writeWord(j + baseX);
  4101. }
  4102. if (l == 74) {
  4103. stream.createFrame(122);
  4104. stream.method433(k);
  4105. stream.method432(j);
  4106. stream.method431(i1);
  4107. atInventoryLoopCycle = 0;
  4108. atInventoryInterface = k;
  4109. atInventoryIndex = j;
  4110. atInventoryInterfaceType = 2;
  4111. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4112. atInventoryInterfaceType = 1;
  4113. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4114. atInventoryInterfaceType = 3;
  4115. }
  4116. if (l == 315) {
  4117. RSInterface class9 = RSInterface.interfaceCache[k];
  4118. boolean flag8 = true;
  4119. if (class9.contentType > 0)
  4120. flag8 = promptUserForInput(class9);
  4121. if (flag8) {
  4122.  
  4123. if (SettingHandler.handle(k)) {
  4124. return;
  4125. }
  4126.  
  4127. switch (k) {
  4128. // Colors
  4129. case 37510:// White
  4130. changeChat("FFFFFF", "white");
  4131. break;
  4132. case 37513:// Black
  4133. changeChat("000000", "black");
  4134. break;
  4135. case 37516:// Grey
  4136. changeChat("94968F", "grey");
  4137. break;
  4138. case 37519:// Red
  4139. changeChat("ED0C0C", "red");
  4140. break;
  4141. case 37522:// Orange
  4142. changeChat("FF700A", "orange");
  4143. break;
  4144. case 37525:// Yellow
  4145. changeChat("FFF700", "yellow");
  4146. break;
  4147. case 37528:// Green
  4148. changeChat("4AD143", "green");
  4149. break;
  4150. case 37531:// Blue
  4151. changeChat("25B8F7", "blue");
  4152. break;
  4153. case 37534:// Purple
  4154. changeChat("DD0AF0", "purple");
  4155. break;
  4156. case 37537:// Pink
  4157. changeChat("FF21D6", "pink");
  4158. break;
  4159. case 37540:// Cyan
  4160. changeChat("00FFFF", "cyan");
  4161. break;
  4162. case 37543:// Turquoise
  4163. changeChat("1F9C9C", "turquoise");
  4164. break;
  4165. case 36004:
  4166. frameMode(ScreenMode.FIXED);
  4167. transparentTabArea = false;
  4168. changeChatArea = false;
  4169. changeTabArea = false;
  4170. break;
  4171. case 36007:
  4172. frameMode(ScreenMode.RESIZABLE);
  4173. break;
  4174. case 36010:
  4175. frameMode(ScreenMode.FULLSCREEN);
  4176. break;
  4177.  
  4178.  
  4179.  
  4180. case 19144:
  4181. sendFrame248(15106, 3213);
  4182. method60(15106);
  4183. inputTaken = true;
  4184. break;
  4185.  
  4186. default:
  4187. stream.createFrame(185);
  4188. stream.writeWord(k);
  4189. if (k >= 61101 && k <= 61200) {
  4190. int selected = k - 61101;
  4191. for (int ii = 0, slot = -1; ii < ItemDef.totalItems && slot < 100; ii++) {
  4192. ItemDef def = ItemDef.forID(ii);
  4193.  
  4194. if (def.name == null || def.certTemplateID == ii - 1 || def.certID == ii - 1 || RSInterface.interfaceCache[61254].disabledMessage.length() == 0) {
  4195. continue;
  4196. }
  4197.  
  4198. if (def.name.toLowerCase().contains(RSInterface.interfaceCache[61254].disabledMessage.toLowerCase())) {
  4199. slot++;
  4200. }
  4201.  
  4202. if (slot != selected) {
  4203. continue;
  4204. }
  4205.  
  4206. int id = def.id;
  4207. long num = Long.valueOf(RSInterface.interfaceCache[61255].disabledMessage.replaceAll(",", ""));
  4208.  
  4209. if (num > Integer.MAX_VALUE) {
  4210. num = Integer.MAX_VALUE;
  4211. }
  4212.  
  4213. stream.createFrame(149);
  4214. stream.writeWord(id);
  4215. stream.writeDWord((int) num);
  4216. stream.writeWordBigEndian(variousSettings[1075]);
  4217. break;
  4218. }
  4219. }
  4220. break;
  4221.  
  4222. }
  4223. }
  4224. }
  4225. if (l == 561) {
  4226. Player player = playerArray[i1];
  4227. if (player != null) {
  4228. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, player.smallY[0], myPlayer.smallX[0], false, player.smallX[0]);
  4229. crossX = super.saveClickX;
  4230. crossY = super.saveClickY;
  4231. crossType = 2;
  4232. crossIndex = 0;
  4233. anInt1188 += i1;
  4234. if (anInt1188 >= 90) {
  4235. stream.createFrame(136);
  4236. anInt1188 = 0;
  4237. }
  4238. stream.createFrame(128);
  4239. stream.writeWord(i1);
  4240. }
  4241. }
  4242. if (l == 20) {
  4243. Npc class30_sub2_sub4_sub1_sub1_1 = npcArray[i1];
  4244. if (class30_sub2_sub4_sub1_sub1_1 != null) {
  4245. 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]);
  4246. crossX = super.saveClickX;
  4247. crossY = super.saveClickY;
  4248. crossType = 2;
  4249. crossIndex = 0;
  4250. stream.createFrame(155);
  4251. stream.method431(i1);
  4252. }
  4253. }
  4254. if (l == 779) {
  4255. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[i1];
  4256. if (class30_sub2_sub4_sub1_sub2_1 != null) {
  4257. 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]);
  4258. crossX = super.saveClickX;
  4259. crossY = super.saveClickY;
  4260. crossType = 2;
  4261. crossIndex = 0;
  4262. stream.createFrame(153);
  4263. stream.method431(i1);
  4264. }
  4265. }
  4266. if (l == 519)
  4267. if (!menuOpen)
  4268. worldController.method312(super.saveClickY - 4, super.saveClickX - 4);
  4269. else
  4270. worldController.method312(k - 4, j - 4);
  4271. if (l == 1062) {
  4272. anInt924 += baseX;
  4273. if (anInt924 >= 113) {
  4274. stream.createFrame(183);
  4275. stream.writeDWordBigEndian(0xe63271);
  4276. anInt924 = 0;
  4277. }
  4278. method66(i1, k, j);
  4279. stream.createFrame(228);
  4280. stream.method432(i1 >> 14 & 0x7fff);
  4281. stream.method432(k + baseY);
  4282. stream.writeWord(j + baseX);
  4283. }
  4284. if (l == 679 && !aBoolean1149) {
  4285. stream.createFrame(40);
  4286. stream.writeWord(k);
  4287. aBoolean1149 = true;
  4288. }
  4289. if (l == 431) {
  4290. stream.createFrame(129);
  4291. stream.method432(j);
  4292. stream.writeWord(k);
  4293. stream.method432(i1);
  4294. atInventoryLoopCycle = 0;
  4295. atInventoryInterface = k;
  4296. atInventoryIndex = j;
  4297. atInventoryInterfaceType = 2;
  4298. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4299. atInventoryInterfaceType = 1;
  4300. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4301. atInventoryInterfaceType = 3;
  4302. }
  4303. if (l == 337 || l == 42 || l == 792 || l == 322) {
  4304. String s = menuActionName[i];
  4305. int k1 = s.indexOf("@whi@");
  4306. if (k1 != -1) {
  4307. long l3 = TextClass.longForName(s.substring(k1 + 5).trim());
  4308. if (l == 337)
  4309. addFriend(l3);
  4310. if (l == 42)
  4311. addIgnore(l3);
  4312. if (l == 792)
  4313. delFriend(l3);
  4314. if (l == 322)
  4315. delIgnore(l3);
  4316. }
  4317. }
  4318. if (l == 53) {
  4319. stream.createFrame(135);
  4320. stream.method431(j);
  4321. stream.method432(k);
  4322. stream.method431(i1);
  4323. atInventoryLoopCycle = 0;
  4324. atInventoryInterface = k;
  4325. atInventoryIndex = j;
  4326. atInventoryInterfaceType = 2;
  4327. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4328. atInventoryInterfaceType = 1;
  4329. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4330. atInventoryInterfaceType = 3;
  4331. }
  4332. if (l == 539) {
  4333. stream.createFrame(16);
  4334. stream.method432(i1);
  4335. stream.method433(j);
  4336. stream.method433(k);
  4337. atInventoryLoopCycle = 0;
  4338. atInventoryInterface = k;
  4339. atInventoryIndex = j;
  4340. atInventoryInterfaceType = 2;
  4341. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4342. atInventoryInterfaceType = 1;
  4343. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4344. atInventoryInterfaceType = 3;
  4345. }
  4346. if (l == 484 || l == 6) {
  4347. String s1 = menuActionName[i];
  4348. int l1 = s1.indexOf("@whi@");
  4349. if (l1 != -1) {
  4350. s1 = s1.substring(l1 + 5).trim();
  4351. String s7 = TextClass.fixName(TextClass.nameForLong(TextClass.longForName(s1)));
  4352. boolean flag9 = false;
  4353. for (int j3 = 0; j3 < playerCount; j3++) {
  4354. Player class30_sub2_sub4_sub1_sub2_7 = playerArray[playerIndices[j3]];
  4355. 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))
  4356. continue;
  4357. 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]);
  4358. if (l == 484) {
  4359. stream.createFrame(139);
  4360. stream.method431(playerIndices[j3]);
  4361. }
  4362. if (l == 6) {
  4363. anInt1188 += i1;
  4364. if (anInt1188 >= 90) {
  4365. stream.createFrame(136);
  4366. anInt1188 = 0;
  4367. }
  4368. stream.createFrame(128);
  4369. stream.writeWord(playerIndices[j3]);
  4370. }
  4371. flag9 = true;
  4372. break;
  4373. }
  4374.  
  4375. if (!flag9)
  4376. pushMessage("Unable to find " + s7, 0, "");
  4377. }
  4378. }
  4379. if (l == 870) {
  4380. stream.createFrame(53);
  4381. stream.writeWord(j);
  4382. stream.method432(anInt1283);
  4383. stream.method433(i1);
  4384. stream.writeWord(anInt1284);
  4385. stream.method431(anInt1285);
  4386. stream.writeWord(k);
  4387. atInventoryLoopCycle = 0;
  4388. atInventoryInterface = k;
  4389. atInventoryIndex = j;
  4390. atInventoryInterfaceType = 2;
  4391. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4392. atInventoryInterfaceType = 1;
  4393. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4394. atInventoryInterfaceType = 3;
  4395. }
  4396. if (l == 847) {
  4397. stream.createFrame(87);
  4398. stream.method432(i1);
  4399. stream.writeWord(k);
  4400. stream.method432(j);
  4401. atInventoryLoopCycle = 0;
  4402. atInventoryInterface = k;
  4403. atInventoryIndex = j;
  4404. atInventoryInterfaceType = 2;
  4405. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4406. atInventoryInterfaceType = 1;
  4407. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4408. atInventoryInterfaceType = 3;
  4409. }
  4410. if (l == 626) {
  4411. RSInterface class9_1 = RSInterface.interfaceCache[k];
  4412. spellSelected = 1;
  4413. spellID = class9_1.id;
  4414. anInt1137 = k;
  4415. spellUsableOn = class9_1.spellUsableOn;
  4416. itemSelected = 0;
  4417. String s4 = class9_1.selectedActionName;
  4418. if (s4.indexOf(" ") != -1)
  4419. s4 = s4.substring(0, s4.indexOf(" "));
  4420. String s8 = class9_1.selectedActionName;
  4421. if (s8.indexOf(" ") != -1)
  4422. s8 = s8.substring(s8.indexOf(" ") + 1);
  4423. spellTooltip = s4 + " " + class9_1.spellName + " " + s8;
  4424. // class9_1.sprite1.drawSprite(class9_1.anInt263, class9_1.anInt265,
  4425. // 0xffffff);
  4426. // class9_1.sprite1.drawSprite(200,200);
  4427. // System.out.println("Sprite: " + class9_1.sprite1.toString());
  4428. if (spellUsableOn == 16) {
  4429. tabID = 3;
  4430. tabAreaAltered = true;
  4431. }
  4432. return;
  4433. }
  4434. if (l == 78) {
  4435. stream.createFrame(117);
  4436. stream.method433(k);
  4437. stream.method433(i1);
  4438. stream.method431(j);
  4439. atInventoryLoopCycle = 0;
  4440. atInventoryInterface = k;
  4441. atInventoryIndex = j;
  4442. atInventoryInterfaceType = 2;
  4443. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4444. atInventoryInterfaceType = 1;
  4445. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4446. atInventoryInterfaceType = 3;
  4447. }
  4448. if (l == 27) {
  4449. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[i1];
  4450. if (class30_sub2_sub4_sub1_sub2_2 != null) {
  4451. 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]);
  4452. crossX = super.saveClickX;
  4453. crossY = super.saveClickY;
  4454. crossType = 2;
  4455. crossIndex = 0;
  4456. anInt986 += i1;
  4457. if (anInt986 >= 54) {
  4458. stream.createFrame(189);
  4459. stream.writeWordBigEndian(234);
  4460. anInt986 = 0;
  4461. }
  4462. stream.createFrame(73);
  4463. stream.method431(i1);
  4464. }
  4465. }
  4466. if (l == 213) {
  4467. boolean flag3 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4468. if (!flag3)
  4469. flag3 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4470. crossX = super.saveClickX;
  4471. crossY = super.saveClickY;
  4472. crossType = 2;
  4473. crossIndex = 0;
  4474. stream.createFrame(79);
  4475. stream.method431(k + baseY);
  4476. stream.writeWord(i1);
  4477. stream.method432(j + baseX);
  4478. }
  4479. if (l == 632) {
  4480. stream.createFrame(145);
  4481. stream.method432(k);
  4482. stream.method432(j);
  4483. stream.method432(i1);
  4484. atInventoryLoopCycle = 0;
  4485. atInventoryInterface = k;
  4486. atInventoryIndex = j;
  4487. atInventoryInterfaceType = 2;
  4488. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4489. atInventoryInterfaceType = 1;
  4490. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4491. atInventoryInterfaceType = 3;
  4492. }
  4493. if (l == 1050) {
  4494. stream.createFrame(185);
  4495. stream.writeWord(152);
  4496. }
  4497. if (l == 1004) {
  4498. if (tabInterfaceIDs[14] != -1) {
  4499. if (frameMode != ScreenMode.FIXED && changeTabArea) {
  4500. if (tabID == 14) {
  4501. showTabComponents = !showTabComponents;
  4502. } else {
  4503. showTabComponents = true;
  4504. }
  4505. }
  4506. tabID = 14;
  4507. tabAreaAltered = true;
  4508. }
  4509. }
  4510. if (l == 1003) {
  4511. clanChatMode = 2;
  4512. inputTaken = true;
  4513. }
  4514. if (l == 1002) {
  4515. clanChatMode = 1;
  4516. inputTaken = true;
  4517. }
  4518. if (l == 1001) {
  4519. clanChatMode = 0;
  4520. inputTaken = true;
  4521. }
  4522. if (l == 1000) {
  4523. cButtonCPos = 4;
  4524. chatTypeView = 11;
  4525. inputTaken = true;
  4526. }
  4527. if (l == 999) {
  4528. cButtonCPos = 0;
  4529. chatTypeView = 0;
  4530. inputTaken = true;
  4531. }
  4532. if (l == 998) {
  4533. cButtonCPos = 1;
  4534. chatTypeView = 5;
  4535. inputTaken = true;
  4536. }
  4537. if (l == 997) {
  4538. publicChatMode = 3;
  4539. inputTaken = true;
  4540. }
  4541. if (l == 996) {
  4542. publicChatMode = 2;
  4543. inputTaken = true;
  4544. }
  4545. if (l == 995) {
  4546. publicChatMode = 1;
  4547. inputTaken = true;
  4548. }
  4549. if (l == 994) {
  4550. publicChatMode = 0;
  4551. inputTaken = true;
  4552. }
  4553. if (l == 993) {
  4554. cButtonCPos = 2;
  4555. chatTypeView = 1;
  4556. inputTaken = true;
  4557. }
  4558. if (l == 992) {
  4559. privateChatMode = 2;
  4560. inputTaken = true;
  4561. }
  4562. if (l == 991) {
  4563. privateChatMode = 1;
  4564. inputTaken = true;
  4565. }
  4566. if (l == 990) {
  4567. privateChatMode = 0;
  4568. inputTaken = true;
  4569. }
  4570. if (l == 989) {
  4571. cButtonCPos = 3;
  4572. chatTypeView = 2;
  4573. inputTaken = true;
  4574. }
  4575. if (l == 987) {
  4576. tradeMode = 2;
  4577. inputTaken = true;
  4578. }
  4579. if (l == 986) {
  4580. tradeMode = 1;
  4581. inputTaken = true;
  4582. }
  4583. if (l == 985) {
  4584. tradeMode = 0;
  4585. inputTaken = true;
  4586. }
  4587. if (l == 984) {
  4588. cButtonCPos = 5;
  4589. chatTypeView = 3;
  4590. inputTaken = true;
  4591. }
  4592. if (l == 980) {
  4593. cButtonCPos = 6;
  4594. chatTypeView = 4;
  4595. inputTaken = true;
  4596. }
  4597. if (l == 647) {
  4598. stream.createFrame(213);
  4599. stream.writeWord(k);
  4600. stream.writeWord(j);
  4601. switch (k) {
  4602. case 43704:
  4603. if (j == 0) {
  4604. inputTaken = true;
  4605. inputDialogState = 0;
  4606. messagePromptRaised = true;
  4607. promptInput = "";
  4608. friendsListAction = 8;
  4609. aString1121 = "Enter your clan chat title";
  4610. }
  4611. break;
  4612. }
  4613. }
  4614. if (l == 493) {
  4615. stream.createFrame(75);
  4616. stream.method433(k);
  4617. stream.method431(j);
  4618. stream.method432(i1);
  4619. atInventoryLoopCycle = 0;
  4620. atInventoryInterface = k;
  4621. atInventoryIndex = j;
  4622. atInventoryInterfaceType = 2;
  4623. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4624. atInventoryInterfaceType = 1;
  4625. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4626. atInventoryInterfaceType = 3;
  4627. }
  4628. if (l == 652) {
  4629. boolean flag4 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4630. if (!flag4)
  4631. flag4 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4632. crossX = super.saveClickX;
  4633. crossY = super.saveClickY;
  4634. crossType = 2;
  4635. crossIndex = 0;
  4636. stream.createFrame(156);
  4637. stream.method432(j + baseX);
  4638. stream.method431(k + baseY);
  4639. stream.method433(i1);
  4640. }
  4641. if (l == 647) {
  4642. stream.createFrame(213);
  4643. stream.writeWord(k);
  4644. stream.writeWord(j);
  4645. switch (k) {
  4646. case 43704:
  4647. if (j == 0) {
  4648. inputTaken = true;
  4649. inputDialogState = 0;
  4650. messagePromptRaised = true;
  4651. promptInput = "";
  4652. friendsListAction = 8;
  4653. aString1121 = "Enter your clan chat title";
  4654. }
  4655. break;
  4656. }
  4657. }
  4658. if (l == 94) {
  4659. boolean flag5 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4660. if (!flag5)
  4661. flag5 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4662. crossX = super.saveClickX;
  4663. crossY = super.saveClickY;
  4664. crossType = 2;
  4665. crossIndex = 0;
  4666. stream.createFrame(181);
  4667. stream.method431(k + baseY);
  4668. stream.writeWord(i1);
  4669. stream.method431(j + baseX);
  4670. stream.method432(anInt1137);
  4671. }
  4672. if (l == 646) {
  4673. stream.createFrame(185);
  4674. stream.writeWord(k);
  4675. RSInterface class9_2 = RSInterface.interfaceCache[k];
  4676. if (class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5) {
  4677. int i2 = class9_2.valueIndexArray[0][1];
  4678. if (variousSettings[i2] != class9_2.anIntArray212[0]) {
  4679. variousSettings[i2] = class9_2.anIntArray212[0];
  4680. updateConfigValues(i2);
  4681. }
  4682. }
  4683. switch (k) {
  4684. // clan chat
  4685. case 18129:
  4686. if (RSInterface.interfaceCache[18135].disabledMessage.toLowerCase().contains("join")) {
  4687. inputTaken = true;
  4688. inputDialogState = 0;
  4689. messagePromptRaised = true;
  4690. promptInput = "";
  4691. friendsListAction = 6;
  4692. aString1121 = "Enter the name of the chat you wish to join";
  4693. } else {
  4694. sendString(0, "");
  4695. }
  4696. break;
  4697. case 18132:
  4698. openInterfaceID = 43700;
  4699. break;
  4700. case 43926:
  4701. inputTaken = true;
  4702. inputDialogState = 0;
  4703. messagePromptRaised = true;
  4704. promptInput = "";
  4705. friendsListAction = 9;
  4706. aString1121 = "Enter a name to add";
  4707. break;
  4708. case 43927:
  4709. inputTaken = true;
  4710. inputDialogState = 0;
  4711. messagePromptRaised = true;
  4712. promptInput = "";
  4713. friendsListAction = 10;
  4714. aString1121 = "Enter a name to add";
  4715. break;
  4716. }
  4717. }
  4718. if (l == 225) {
  4719. Npc class30_sub2_sub4_sub1_sub1_2 = npcArray[i1];
  4720. if (class30_sub2_sub4_sub1_sub1_2 != null) {
  4721. 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]);
  4722. crossX = super.saveClickX;
  4723. crossY = super.saveClickY;
  4724. crossType = 2;
  4725. crossIndex = 0;
  4726. anInt1226 += i1;
  4727. if (anInt1226 >= 85) {
  4728. stream.createFrame(230);
  4729. stream.writeWordBigEndian(239);
  4730. anInt1226 = 0;
  4731. }
  4732. stream.createFrame(17);
  4733. stream.method433(i1);
  4734. }
  4735. }
  4736. if (l == 965) {
  4737. Npc class30_sub2_sub4_sub1_sub1_3 = npcArray[i1];
  4738. if (class30_sub2_sub4_sub1_sub1_3 != null) {
  4739. 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]);
  4740. crossX = super.saveClickX;
  4741. crossY = super.saveClickY;
  4742. crossType = 2;
  4743. crossIndex = 0;
  4744. anInt1134++;
  4745. if (anInt1134 >= 96) {
  4746. stream.createFrame(152);
  4747. stream.writeWordBigEndian(88);
  4748. anInt1134 = 0;
  4749. }
  4750. stream.createFrame(21);
  4751. stream.writeWord(i1);
  4752. }
  4753. }
  4754. if (l == 413) {
  4755. Npc class30_sub2_sub4_sub1_sub1_4 = npcArray[i1];
  4756. if (class30_sub2_sub4_sub1_sub1_4 != null) {
  4757. 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]);
  4758. crossX = super.saveClickX;
  4759. crossY = super.saveClickY;
  4760. crossType = 2;
  4761. crossIndex = 0;
  4762. stream.createFrame(131);
  4763. stream.method433(i1);
  4764. stream.method432(anInt1137);
  4765. }
  4766. }
  4767. if (l == 200)
  4768. clearTopInterfaces();
  4769. if (l == 1025) {
  4770. Npc class30_sub2_sub4_sub1_sub1_5 = npcArray[i1];
  4771. if (class30_sub2_sub4_sub1_sub1_5 != null) {
  4772. EntityDef entityDef = class30_sub2_sub4_sub1_sub1_5.desc;
  4773. if (entityDef.childrenIDs != null)
  4774. entityDef = entityDef.method161();
  4775. if (entityDef != null) {
  4776. String s9;
  4777. if (entityDef.description != null)
  4778. s9 = new String(entityDef.description);
  4779. else
  4780. s9 = "It's a " + entityDef.name + ".";
  4781. pushMessage(s9, 0, "");
  4782. }
  4783. }
  4784. }
  4785. if (l == 900) {
  4786. method66(i1, k, j);
  4787. stream.createFrame(252);
  4788. stream.method433(i1 >> 14 & 0x7fff);
  4789. stream.method431(k + baseY);
  4790. stream.method432(j + baseX);
  4791. }
  4792. if (l == 412) {
  4793. Npc class30_sub2_sub4_sub1_sub1_6 = npcArray[i1];
  4794. if (class30_sub2_sub4_sub1_sub1_6 != null) {
  4795. 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]);
  4796. crossX = super.saveClickX;
  4797. crossY = super.saveClickY;
  4798. crossType = 2;
  4799. crossIndex = 0;
  4800. stream.createFrame(72);
  4801. stream.method432(i1);
  4802. }
  4803. }
  4804. if (l == 365) {
  4805. Player class30_sub2_sub4_sub1_sub2_3 = playerArray[i1];
  4806. if (class30_sub2_sub4_sub1_sub2_3 != null) {
  4807. 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]);
  4808. crossX = super.saveClickX;
  4809. crossY = super.saveClickY;
  4810. crossType = 2;
  4811. crossIndex = 0;
  4812. stream.createFrame(249);
  4813. stream.method432(i1);
  4814. stream.method431(anInt1137);
  4815. }
  4816. }
  4817. if (l == 729) {
  4818. Player class30_sub2_sub4_sub1_sub2_4 = playerArray[i1];
  4819. if (class30_sub2_sub4_sub1_sub2_4 != null) {
  4820. 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]);
  4821. crossX = super.saveClickX;
  4822. crossY = super.saveClickY;
  4823. crossType = 2;
  4824. crossIndex = 0;
  4825. stream.createFrame(39);
  4826. stream.method431(i1);
  4827. }
  4828. }
  4829. if (l == 577) {
  4830. Player class30_sub2_sub4_sub1_sub2_5 = playerArray[i1];
  4831. if (class30_sub2_sub4_sub1_sub2_5 != null) {
  4832. 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]);
  4833. crossX = super.saveClickX;
  4834. crossY = super.saveClickY;
  4835. crossType = 2;
  4836. crossIndex = 0;
  4837. stream.createFrame(139);
  4838. stream.method431(i1);
  4839. }
  4840. }
  4841. if (l == 956 && method66(i1, k, j)) {
  4842. stream.createFrame(35);
  4843. stream.method431(j + baseX);
  4844. stream.method432(anInt1137);
  4845. stream.method432(k + baseY);
  4846. stream.method431(i1 >> 14 & 0x7fff);
  4847. }
  4848. if (l == 567) {
  4849. boolean flag6 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4850. if (!flag6)
  4851. flag6 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4852. crossX = super.saveClickX;
  4853. crossY = super.saveClickY;
  4854. crossType = 2;
  4855. crossIndex = 0;
  4856. stream.createFrame(23);
  4857. stream.method431(k + baseY);
  4858. stream.method431(i1);
  4859. stream.method431(j + baseX);
  4860. }
  4861. if (l == 867) {
  4862. if ((i1 & 3) == 0)
  4863. anInt1175++;
  4864. if (anInt1175 >= 59) {
  4865. stream.createFrame(200);
  4866. stream.writeWord(25501);
  4867. anInt1175 = 0;
  4868. }
  4869. stream.createFrame(43);
  4870. stream.method431(k);
  4871. stream.method432(i1);
  4872. stream.method432(j);
  4873. atInventoryLoopCycle = 0;
  4874. atInventoryInterface = k;
  4875. atInventoryIndex = j;
  4876. atInventoryInterfaceType = 2;
  4877. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4878. atInventoryInterfaceType = 1;
  4879. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4880. atInventoryInterfaceType = 3;
  4881. }
  4882. if (l == 543) {
  4883. stream.createFrame(237);
  4884. stream.writeWord(j);
  4885. stream.method432(i1);
  4886. stream.writeWord(k);
  4887. stream.method432(anInt1137);
  4888. atInventoryLoopCycle = 0;
  4889. atInventoryInterface = k;
  4890. atInventoryIndex = j;
  4891. atInventoryInterfaceType = 2;
  4892. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4893. atInventoryInterfaceType = 1;
  4894. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4895. atInventoryInterfaceType = 3;
  4896. }
  4897. if (l == 606) {
  4898. stream.createFrame(185);
  4899. stream.writeWord(606);
  4900. }
  4901. if (l == 491) {
  4902. Player class30_sub2_sub4_sub1_sub2_6 = playerArray[i1];
  4903. if (class30_sub2_sub4_sub1_sub2_6 != null) {
  4904. 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]);
  4905. crossX = super.saveClickX;
  4906. crossY = super.saveClickY;
  4907. crossType = 2;
  4908. crossIndex = 0;
  4909. stream.createFrame(14);
  4910. stream.method432(anInt1284);
  4911. stream.writeWord(i1);
  4912. stream.writeWord(anInt1285);
  4913. stream.method431(anInt1283);
  4914. }
  4915. }
  4916. if (l == 639) {
  4917. String s3 = menuActionName[i];
  4918. int k2 = s3.indexOf("@whi@");
  4919. if (k2 != -1) {
  4920. long l4 = TextClass.longForName(s3.substring(k2 + 5).trim());
  4921. int k3 = -1;
  4922. for (int i4 = 0; i4 < friendsCount; i4++) {
  4923. if (friendsListAsLongs[i4] != l4)
  4924. continue;
  4925. k3 = i4;
  4926. break;
  4927. }
  4928.  
  4929. if (k3 != -1 && friendsNodeIDs[k3] > 0) {
  4930. inputTaken = true;
  4931. inputDialogState = 0;
  4932. messagePromptRaised = true;
  4933. promptInput = "";
  4934. friendsListAction = 3;
  4935. aLong953 = friendsListAsLongs[k3];
  4936. aString1121 = "Enter message to send to " + friendsList[k3];
  4937. }
  4938. }
  4939. }
  4940. if (l == 454) {
  4941. stream.createFrame(41);
  4942. stream.writeWord(i1);
  4943. stream.method432(j);
  4944. stream.method432(k);
  4945. atInventoryLoopCycle = 0;
  4946. atInventoryInterface = k;
  4947. atInventoryIndex = j;
  4948. atInventoryInterfaceType = 2;
  4949. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4950. atInventoryInterfaceType = 1;
  4951. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4952. atInventoryInterfaceType = 3;
  4953. }
  4954. if (l == 478) {
  4955. Npc class30_sub2_sub4_sub1_sub1_7 = npcArray[i1];
  4956. if (class30_sub2_sub4_sub1_sub1_7 != null) {
  4957. 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]);
  4958. crossX = super.saveClickX;
  4959. crossY = super.saveClickY;
  4960. crossType = 2;
  4961. crossIndex = 0;
  4962. if ((i1 & 3) == 0)
  4963. anInt1155++;
  4964. if (anInt1155 >= 53) {
  4965. stream.createFrame(85);
  4966. stream.writeWordBigEndian(66);
  4967. anInt1155 = 0;
  4968. }
  4969. stream.createFrame(18);
  4970. stream.method431(i1);
  4971. }
  4972. }
  4973. if (l == 113) {
  4974. method66(i1, k, j);
  4975. stream.createFrame(70);
  4976. stream.method431(j + baseX);
  4977. stream.writeWord(k + baseY);
  4978. stream.method433(i1 >> 14 & 0x7fff);
  4979. }
  4980. if (l == 872) {
  4981. method66(i1, k, j);
  4982. stream.createFrame(234);
  4983. stream.method433(j + baseX);
  4984. stream.method432(i1 >> 14 & 0x7fff);
  4985. stream.method433(k + baseY);
  4986. }
  4987. if (l == 502) {
  4988. method66(i1, k, j);
  4989. stream.createFrame(132);
  4990. stream.method433(j + baseX);
  4991. stream.writeWord(i1 >> 14 & 0x7fff);
  4992. stream.method432(k + baseY);
  4993. }
  4994. if (l == 1125) {
  4995. ItemDef itemDef = ItemDef.forID(i1);
  4996. RSInterface class9_4 = RSInterface.interfaceCache[k];
  4997. String s5;
  4998. if (class9_4 == null) {
  4999. return;
  5000. }
  5001. if (class9_4 != null && class9_4.invStackSizes != null && class9_4.invStackSizes[j] >= 0x186a0) {
  5002. DecimalFormatSymbols separator = new DecimalFormatSymbols();
  5003. separator.setGroupingSeparator(',');
  5004. DecimalFormat formatter = new DecimalFormat("#,###,###,###", separator);
  5005. s5 = formatter.format(class9_4.invStackSizes[j]) + " x " + itemDef.name;
  5006. } else if (itemDef.description != null)
  5007. s5 = new String(itemDef.description);
  5008. else
  5009. s5 = "It's a " + itemDef.name + ".";
  5010. pushMessage(s5, 0, "");
  5011. }
  5012. if (l == 169) {
  5013. stream.createFrame(185);
  5014. stream.writeWord(k);
  5015. RSInterface class9_3 = RSInterface.interfaceCache[k];
  5016. if (class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5) {
  5017. int l2 = class9_3.valueIndexArray[0][1];
  5018. variousSettings[l2] = 1 - variousSettings[l2];
  5019. updateConfigValues(l2);
  5020. }
  5021. }
  5022. if (l == 447) {
  5023. itemSelected = 1;
  5024. anInt1283 = j;
  5025. anInt1284 = k;
  5026. anInt1285 = i1;
  5027. selectedItemName = ItemDef.forID(i1).name;
  5028. spellSelected = 0;
  5029. return;
  5030. }
  5031. if (l == 1226) {
  5032. int j1 = i1 >> 14 & 0x7fff;
  5033. ObjectDef class46 = ObjectDef.forID(j1);
  5034. String s10;
  5035. if (class46.description != null)
  5036. s10 = new String(class46.description);
  5037. else
  5038. s10 = "It's a " + class46.name + ".";
  5039. pushMessage(s10, 0, "");
  5040. }
  5041. if (l == 244) {
  5042. boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  5043. if (!flag7)
  5044. flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  5045. crossX = super.saveClickX;
  5046. crossY = super.saveClickY;
  5047. crossType = 2;
  5048. crossIndex = 0;
  5049. stream.createFrame(253);
  5050. stream.method431(j + baseX);
  5051. stream.method433(k + baseY);
  5052. stream.method432(i1);
  5053. }
  5054. if (l == 1448) {
  5055. ItemDef itemDef_1 = ItemDef.forID(i1);
  5056. String s6;
  5057. if (itemDef_1.description != null) {
  5058. s6 = new String(itemDef_1.description);
  5059. } else {
  5060. s6 = "It's a " + itemDef_1.name + ".";
  5061. }
  5062. pushMessage(s6, 0, "");
  5063. }
  5064. itemSelected = 0;
  5065. spellSelected = 0;
  5066.  
  5067. }
  5068.  
  5069. @SuppressWarnings("unused")
  5070. private void method70() {
  5071. anInt1251 = 0;
  5072. int j = (myPlayer.x >> 7) + baseX;
  5073. int k = (myPlayer.y >> 7) + baseY;
  5074. if (j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
  5075. anInt1251 = 1;
  5076. if (j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
  5077. anInt1251 = 1;
  5078. if (anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
  5079. anInt1251 = 0;
  5080. }
  5081.  
  5082. public void run() {
  5083. if (drawFlames) {
  5084. drawFlames();
  5085. } else {
  5086. super.run();
  5087. }
  5088. }
  5089.  
  5090. private void build3dScreenMenu() {
  5091. if (itemSelected == 0 && spellSelected == 0) {
  5092. menuActionName[menuActionRow] = "Walk here";
  5093. menuActionID[menuActionRow] = 519;
  5094. menuActionCmd2[menuActionRow] = super.mouseX;
  5095. menuActionCmd3[menuActionRow] = super.mouseY;
  5096. menuActionRow++;
  5097. }
  5098. int j = -1;
  5099. for (int k = 0; k < Model.anInt1687; k++) {
  5100. int l = Model.anIntArray1688[k];
  5101. int i1 = l & 0x7f;
  5102. int j1 = l >> 7 & 0x7f;
  5103. int k1 = l >> 29 & 3;
  5104. int l1 = l >> 14 & 0x7fff;
  5105. if (l == j)
  5106. continue;
  5107. j = l;
  5108. if (k1 == 2) {
  5109. }
  5110. if (k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0) {
  5111. ObjectDef class46 = ObjectDef.forID(l1);
  5112. if (class46.childrenIDs != null)
  5113. class46 = class46.method580();
  5114. if (class46 == null) {
  5115. continue;
  5116. }
  5117. if (itemSelected == 1) {
  5118. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @cya@" + class46.name;
  5119. menuActionID[menuActionRow] = 62;
  5120. menuActionCmd1[menuActionRow] = l;
  5121. menuActionCmd2[menuActionRow] = i1;
  5122. menuActionCmd3[menuActionRow] = j1;
  5123. menuActionRow++;
  5124. } else if (spellSelected == 1) {
  5125. if ((spellUsableOn & 4) == 4) {
  5126. menuActionName[menuActionRow] = spellTooltip + " @cya@" + class46.name;
  5127. menuActionID[menuActionRow] = 956;
  5128. menuActionCmd1[menuActionRow] = l;
  5129. menuActionCmd2[menuActionRow] = i1;
  5130. menuActionCmd3[menuActionRow] = j1;
  5131. menuActionRow++;
  5132. }
  5133. } else {
  5134. if (class46.actions != null) {
  5135. for (int i2 = 4; i2 >= 0; i2--)
  5136. if (class46.actions[i2] != null) {
  5137. menuActionName[menuActionRow] = class46.actions[i2] + " @cya@" + class46.name;
  5138. if (i2 == 0)
  5139. menuActionID[menuActionRow] = 502;
  5140. if (i2 == 1)
  5141. menuActionID[menuActionRow] = 900;
  5142. if (i2 == 2)
  5143. menuActionID[menuActionRow] = 113;
  5144. if (i2 == 3)
  5145. menuActionID[menuActionRow] = 872;
  5146. if (i2 == 4)
  5147. menuActionID[menuActionRow] = 1062;
  5148. menuActionCmd1[menuActionRow] = l;
  5149. menuActionCmd2[menuActionRow] = i1;
  5150. menuActionCmd3[menuActionRow] = j1;
  5151. menuActionRow++;
  5152. }
  5153.  
  5154. }
  5155. if (ClientConstants.DEBUG_MODE) {
  5156. menuActionName[menuActionRow] = "Examine @cya@" + class46.name + " @gre@(@whi@" + l1 + "@gre@) (@whi@" + (i1 + baseX) + "," + (j1 + baseY) + "@gre@)";
  5157. } else {
  5158. menuActionName[menuActionRow] = "Examine @cya@" + class46.name;
  5159. }
  5160. menuActionID[menuActionRow] = 1226;
  5161. menuActionCmd1[menuActionRow] = class46.type << 14;
  5162. menuActionCmd2[menuActionRow] = i1;
  5163. menuActionCmd3[menuActionRow] = j1;
  5164. menuActionRow++;
  5165. }
  5166. }
  5167. if (k1 == 1) {
  5168. Npc npc = npcArray[l1];
  5169. try {
  5170. if (npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64) {
  5171. for (int j2 = 0; j2 < npcCount; j2++) {
  5172. Npc npc2 = npcArray[npcIndices[j2]];
  5173. if (npc2 != null && npc2 != npc && npc2.desc.aByte68 == 1 && npc2.x == npc.x && npc2.y == npc.y)
  5174. buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
  5175. }
  5176. for (int l2 = 0; l2 < playerCount; l2++) {
  5177. Player player = playerArray[playerIndices[l2]];
  5178. if (player != null && player.x == npc.x && player.y == npc.y)
  5179. buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
  5180. }
  5181. }
  5182. buildAtNPCMenu(npc.desc, l1, j1, i1);
  5183. } catch (Exception e) {
  5184. }
  5185. }
  5186. if (k1 == 0) {
  5187. Player player = playerArray[l1];
  5188. if ((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  5189. for (int k2 = 0; k2 < npcCount; k2++) {
  5190. Npc class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
  5191. 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)
  5192. buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc, npcIndices[k2], j1, i1);
  5193. }
  5194.  
  5195. for (int i3 = 0; i3 < playerCount; i3++) {
  5196. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
  5197. 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)
  5198. buildAtPlayerMenu(i1, playerIndices[i3], class30_sub2_sub4_sub1_sub2_2, j1);
  5199. }
  5200.  
  5201. }
  5202. buildAtPlayerMenu(i1, l1, player, j1);
  5203. }
  5204. if (k1 == 3) {
  5205. NodeList class19 = groundArray[plane][i1][j1];
  5206. if (class19 != null) {
  5207. for (Item item = (Item) class19.getFirst(); item != null; item = (Item) class19.getNext()) {
  5208. ItemDef itemDef = ItemDef.forID(item.ID);
  5209. if (itemSelected == 1) {
  5210. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  5211. menuActionID[menuActionRow] = 511;
  5212. menuActionCmd1[menuActionRow] = item.ID;
  5213. menuActionCmd2[menuActionRow] = i1;
  5214. menuActionCmd3[menuActionRow] = j1;
  5215. menuActionRow++;
  5216. } else if (spellSelected == 1) {
  5217. if ((spellUsableOn & 1) == 1) {
  5218. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  5219. menuActionID[menuActionRow] = 94;
  5220. menuActionCmd1[menuActionRow] = item.ID;
  5221. menuActionCmd2[menuActionRow] = i1;
  5222. menuActionCmd3[menuActionRow] = j1;
  5223. menuActionRow++;
  5224. }
  5225. } else {
  5226. for (int j3 = 4; j3 >= 0; j3--)
  5227. if (itemDef.groundActions != null && itemDef.groundActions[j3] != null) {
  5228. menuActionName[menuActionRow] = itemDef.groundActions[j3] + " @lre@" + itemDef.name;
  5229. if (j3 == 0)
  5230. menuActionID[menuActionRow] = 652;
  5231. if (j3 == 1)
  5232. menuActionID[menuActionRow] = 567;
  5233. if (j3 == 2)
  5234. menuActionID[menuActionRow] = 234;
  5235. if (j3 == 3)
  5236. menuActionID[menuActionRow] = 244;
  5237. if (j3 == 4)
  5238. menuActionID[menuActionRow] = 213;
  5239. menuActionCmd1[menuActionRow] = item.ID;
  5240. menuActionCmd2[menuActionRow] = i1;
  5241. menuActionCmd3[menuActionRow] = j1;
  5242. menuActionRow++;
  5243. } else if (j3 == 2) {
  5244. menuActionName[menuActionRow] = "Take @lre@" + itemDef.name;
  5245. menuActionID[menuActionRow] = 234;
  5246. menuActionCmd1[menuActionRow] = item.ID;
  5247. menuActionCmd2[menuActionRow] = i1;
  5248. menuActionCmd3[menuActionRow] = j1;
  5249. menuActionRow++;
  5250. }
  5251. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  5252. menuActionID[menuActionRow] = 1448;
  5253. menuActionCmd1[menuActionRow] = item.ID;
  5254. menuActionCmd2[menuActionRow] = i1;
  5255. menuActionCmd3[menuActionRow] = j1;
  5256. menuActionRow++;
  5257. }
  5258. }
  5259.  
  5260. }
  5261. }
  5262. }
  5263. }
  5264.  
  5265. public void cleanUpForQuit() {
  5266. Signlink.reporterror = false;
  5267. try {
  5268. if (socketStream != null) {
  5269. socketStream.close();
  5270. }
  5271. } catch (Exception _ex) {
  5272. }
  5273. socketStream = null;
  5274. stopMidi();
  5275. if (mouseDetection != null)
  5276. mouseDetection.running = false;
  5277. mouseDetection = null;
  5278. onDemandFetcher.disable();
  5279. onDemandFetcher = null;
  5280. aStream_834 = null;
  5281. stream = null;
  5282. aStream_847 = null;
  5283. inStream = null;
  5284. anIntArray1234 = null;
  5285. aByteArrayArray1183 = null;
  5286. aByteArrayArray1247 = null;
  5287. anIntArray1235 = null;
  5288. anIntArray1236 = null;
  5289. intGroundArray = null;
  5290. byteGroundArray = null;
  5291. worldController = null;
  5292. aClass11Array1230 = null;
  5293. anIntArrayArray901 = null;
  5294. anIntArrayArray825 = null;
  5295. bigX = null;
  5296. bigY = null;
  5297. aByteArray912 = null;
  5298. aRSImageProducer_1163 = null;
  5299. leftFrame = null;
  5300. topFrame = null;
  5301. aRSImageProducer_1164 = null;
  5302. aRSImageProducer_1165 = null;
  5303. aRSImageProducer_1166 = null;
  5304. aRSImageProducer_1125 = null;
  5305. /* Null pointers for custom sprites */
  5306. cacheSprite = null;
  5307. mapIcon = null;
  5308. mapIcon1 = null;
  5309. mapBack = null;
  5310. sideIcons = null;
  5311. compass = null;
  5312. hitMarks = null;
  5313. skillIcons = null;
  5314. newHitMarks = null;
  5315. channelButtons = null;
  5316. fixedGameComponents = null;
  5317. skillIcons = null;
  5318. gameComponents = null;
  5319. orbComponents = null;
  5320. orbComponents2 = null;
  5321. orbComponents3 = null;
  5322. redStones = null;
  5323. hpBars = null;
  5324. headIcons = null;
  5325. skullIcons = null;
  5326. headIconsHint = null;
  5327. crosses = null;
  5328. mapDotItem = null;
  5329. mapDotNPC = null;
  5330. mapDotPlayer = null;
  5331. mapDotFriend = null;
  5332. mapDotTeam = null;
  5333. mapScenes = null;
  5334. mapFunctions = null;
  5335. anIntArrayArray929 = null;
  5336. playerArray = null;
  5337. playerIndices = null;
  5338. anIntArray894 = null;
  5339. aStreamArray895s = null;
  5340. anIntArray840 = null;
  5341. npcArray = null;
  5342. npcIndices = null;
  5343. groundArray = null;
  5344. aClass19_1179 = null;
  5345. aClass19_1013 = null;
  5346. aClass19_1056 = null;
  5347. menuActionCmd2 = null;
  5348. menuActionCmd3 = null;
  5349. menuActionID = null;
  5350. menuActionCmd1 = null;
  5351. menuActionName = null;
  5352. variousSettings = null;
  5353. anIntArray1072 = null;
  5354. anIntArray1073 = null;
  5355. aClass30_Sub2_Sub1_Sub1Array1140 = null;
  5356. minimapImage = null;
  5357. friendsList = null;
  5358. friendsListAsLongs = null;
  5359. friendsNodeIDs = null;
  5360. aRSImageProducer_1110 = null;
  5361. aRSImageProducer_1111 = null;
  5362. aRSImageProducer_1107 = null;
  5363. aRSImageProducer_1108 = null;
  5364. aRSImageProducer_1109 = null;
  5365. aRSImageProducer_1112 = null;
  5366. aRSImageProducer_1113 = null;
  5367. aRSImageProducer_1114 = null;
  5368. aRSImageProducer_1115 = null;
  5369. multiOverlay = null;
  5370. nullLoader();
  5371. ObjectDef.nullLoader();
  5372. EntityDef.nullLoader();
  5373. ItemDef.nullLoader();
  5374. Floor.cache = null;
  5375. // OverlayFloor.overlayFloor = null;
  5376. IdentityKit.cache = null;
  5377. RSInterface.interfaceCache = null;
  5378. Animation.anims = null;
  5379. SpotAnim.cache = null;
  5380. SpotAnim.aMRUNodes_415 = null;
  5381. Varp.cache = null;
  5382. super.fullGameScreen = null;
  5383. Player.mruNodes = null;
  5384. Rasterizer.nullLoader();
  5385. WorldController.nullLoader();
  5386. Model.nullLoader();
  5387. SequenceFrame.nullLoader();
  5388. // Texture.reset();
  5389. System.gc();
  5390. }
  5391.  
  5392. Component getGameComponent() {
  5393. if (Signlink.mainapp != null)
  5394. return Signlink.mainapp;
  5395. if (super.gameFrame != null)
  5396. return super.gameFrame;
  5397. else
  5398. return this;
  5399. }
  5400.  
  5401. private void doTextField(RSInterface rsint) {
  5402.  
  5403. int rsid = rsint.parentID;
  5404.  
  5405. if (rsid == 6142) {
  5406. for (int slot = 0; slot < 100; slot++) {
  5407. RSInterface.interfaceCache[61266 + slot].disabledSprite = new Sprite(32, 32);
  5408. RSInterface.interfaceCache[61101 + slot].disabledMessage = "";
  5409. }
  5410.  
  5411. int found = 0;
  5412.  
  5413. for (int i = 0, slot = 0; i < ItemDef.totalItems && slot < 100; i++) {
  5414. if (ItemDef.forID(i).name == null || ItemDef.forID(i).certTemplateID == i - 1 || ItemDef.forID(i).certID == i - 1) {
  5415. continue;
  5416. }
  5417.  
  5418. if (ItemDef.forID(i).name.toLowerCase().contains(RSInterface.interfaceCache[RSInterface.currentInputField.id].disabledMessage.toLowerCase())) {
  5419. RSInterface.interfaceCache[61266 + slot].enabledSprite = ItemDef.getSprite(i, 1, 0);
  5420. RSInterface.interfaceCache[61266 + slot].disabledSprite = ItemDef.getSprite(i, 1, 0);
  5421. RSInterface.interfaceCache[61101 + slot++].disabledMessage = ItemDef.forID(i).name;
  5422. found++;
  5423. }
  5424. }
  5425.  
  5426. RSInterface.interfaceCache[61100].scrollMax = 40 * found + 12;
  5427. }
  5428. }
  5429.  
  5430. private void method73() {
  5431. do {
  5432. int j = readChar(-796);
  5433. if (j == -1)
  5434. break;
  5435. if (j == 96)
  5436. break;
  5437. if (RSInterface.currentInputField != null) {
  5438. boolean update = false;
  5439.  
  5440. RSInterface rsTextField = RSInterface.interfaceCache[RSInterface.currentInputField.id];
  5441.  
  5442. String message = TextClass.capitalize(rsTextField.disabledMessage);
  5443.  
  5444. if (j == 8 && message.length() > 0) {
  5445. message = message.substring(0, message.length() - 1);
  5446. if (message.length() > 0 && RSInterface.currentInputField.onlyNumbers && !RSInterface.currentInputField.displayAsterisks) {
  5447. long num = Long.valueOf(message.replaceAll(",", ""));
  5448.  
  5449. if (num > Integer.MAX_VALUE) {
  5450. num = Integer.MAX_VALUE;
  5451. rsTextField.disabledMessage = num + "";
  5452. }
  5453.  
  5454. message = NumberFormat.getInstance(Locale.US).format(num);
  5455. }
  5456. update = true;
  5457. }
  5458.  
  5459. if ((RSInterface.currentInputField.onlyNumbers ? (j >= 48 && j <= 57) : (j >= 32 && j <= 122)) && message.length() < RSInterface.currentInputField.characterLimit) {
  5460. message += (char) j;
  5461. if (RSInterface.currentInputField.onlyNumbers && !RSInterface.currentInputField.displayAsterisks) {
  5462. long num = Long.valueOf(message.replaceAll(",", ""));
  5463.  
  5464. if (num > Integer.MAX_VALUE) {
  5465. num = Integer.MAX_VALUE;
  5466. rsTextField.disabledMessage = num + "";
  5467. }
  5468.  
  5469. message = NumberFormat.getInstance(Locale.US).format(num);
  5470. }
  5471. update = true;
  5472. }
  5473.  
  5474. rsTextField.disabledMessage = message;
  5475.  
  5476. if ((j == 13 || j == 10) && rsTextField.disabledMessage.length() > 0) {
  5477. if (RSInterface.currentInputField.onlyNumbers) {
  5478. long amount = 0;
  5479.  
  5480. try {
  5481. amount = Long.parseLong(message.replaceAll(",", ""));
  5482.  
  5483. // overflow concious code
  5484. if (amount < -Integer.MAX_VALUE) {
  5485. amount = -Integer.MAX_VALUE;
  5486. } else if (amount > Integer.MAX_VALUE) {
  5487. amount = Integer.MAX_VALUE;
  5488. }
  5489. } catch (Exception ignored) {
  5490. }
  5491.  
  5492. if (amount > 0) {
  5493. stream.createFrame(208);
  5494. stream.writeDWord((int) amount);
  5495. }
  5496. } else {
  5497. stream.createFrame(150);
  5498. stream.writeWordBigEndian(RSInterface.currentInputField.disabledMessage.length() + 3);
  5499. stream.writeWord(RSInterface.currentInputField.id);
  5500. stream.writeString(RSInterface.currentInputField.disabledMessage);
  5501. }
  5502. RSInterface.currentInputField.disabledMessage = "";
  5503. RSInterface.currentInputField = null;
  5504. }
  5505.  
  5506. if (update) {
  5507. doTextField(rsTextField);
  5508. }
  5509. } else if (console.openConsole) {
  5510. if (j == 8 && console.consoleInput.length() > 0) {
  5511. console.consoleInput = console.consoleInput.substring(0, console.consoleInput.length() - 1);
  5512. }
  5513. if (j >= 32 && j <= 122 && console.consoleInput.length() < 80) {
  5514. console.consoleInput += (char) j;
  5515. }
  5516. if ((j == 13 || j == 10) && console.consoleInput.length() > 0) {
  5517. console.sendConsoleMessage(console.consoleInput, true);
  5518. console.sendConsoleCommands(console.consoleInput);
  5519. console.consoleInput = "";
  5520. inputTaken = true;
  5521. }
  5522. } else if (openInterfaceID != -1 && openInterfaceID == reportAbuseInterfaceID) {
  5523. if (j == 8 && reportAbuseInput.length() > 0)
  5524. reportAbuseInput = reportAbuseInput.substring(0, reportAbuseInput.length() - 1);
  5525. if ((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48 && j <= 57 || j == 32) && reportAbuseInput.length() < 12)
  5526. reportAbuseInput += (char) j;
  5527. } else if (messagePromptRaised) {
  5528. if (j >= 32 && j <= 122 && promptInput.length() < 80) {
  5529. promptInput += (char) j;
  5530. inputTaken = true;
  5531. }
  5532. if (j == 8 && promptInput.length() > 0) {
  5533. promptInput = promptInput.substring(0, promptInput.length() - 1);
  5534. inputTaken = true;
  5535. }
  5536. if (j == 13 || j == 10) {
  5537. messagePromptRaised = false;
  5538. inputTaken = true;
  5539. if (friendsListAction == 1) {
  5540. long l = TextClass.longForName(promptInput);
  5541. addFriend(l);
  5542. }
  5543. if (friendsListAction == 2 && friendsCount > 0) {
  5544. long l1 = TextClass.longForName(promptInput);
  5545. delFriend(l1);
  5546. }
  5547. if (friendsListAction == 557 && promptInput.length() > 0) {
  5548. inputString = "::withdrawmp " + promptInput;
  5549. sendPacket(103);
  5550. }
  5551. if (friendsListAction == 51504 && promptInput.length() > 0) {
  5552. inputString = "::find " + promptInput;
  5553. sendPacket(103);
  5554. }
  5555. if (friendsListAction == 59800 && promptInput.length() > 0) {
  5556. inputString = "::droptablesearch " + promptInput;
  5557. sendPacket(103);
  5558. }
  5559. if (friendsListAction == 3 && promptInput.length() > 0) {
  5560. stream.createFrame(126);
  5561. stream.writeWordBigEndian(0);
  5562. int k = stream.currentOffset;
  5563. stream.writeQWord(aLong953);
  5564. TextInput.method526(promptInput, stream);
  5565. stream.writeBytes(stream.currentOffset - k);
  5566. promptInput = TextInput.processText(promptInput);
  5567. // promptInput = Censor.doCensor(promptInput);
  5568. pushMessage(promptInput, 6, TextClass.fixName(TextClass.nameForLong(aLong953)));
  5569. if (privateChatMode == 2) {
  5570. privateChatMode = 1;
  5571. stream.createFrame(95);
  5572. stream.writeWordBigEndian(publicChatMode);
  5573. stream.writeWordBigEndian(privateChatMode);
  5574. stream.writeWordBigEndian(tradeMode);
  5575. }
  5576. }
  5577. if (friendsListAction == 4 && ignoreCount < 100) {
  5578. long l2 = TextClass.longForName(promptInput);
  5579. addIgnore(l2);
  5580. }
  5581. if (friendsListAction == 5 && ignoreCount > 0) {
  5582. long l3 = TextClass.longForName(promptInput);
  5583. delIgnore(l3);
  5584. }
  5585. if (friendsListAction == 6) {
  5586. sendStringAsLong(promptInput);
  5587. } else if (friendsListAction == 8) {
  5588. sendString(1, promptInput);
  5589. } else if (friendsListAction == 9) {
  5590. sendString(2, promptInput);
  5591. } else if (friendsListAction == 10) {
  5592. sendString(3, promptInput);
  5593. }
  5594. }
  5595. } else if (inputDialogState == 1) {
  5596. if (j >= 48 && j <= 57 && amountOrNameInput.length() < 10) {
  5597. amountOrNameInput += (char) j;
  5598. inputTaken = true;
  5599. }
  5600. if ((!amountOrNameInput.toLowerCase().contains("k") && !amountOrNameInput.toLowerCase().contains("m") && !amountOrNameInput.toLowerCase().contains("b")) && (j == 107 || j == 109) || j == 98) {
  5601. amountOrNameInput += (char) j;
  5602. inputTaken = true;
  5603. }
  5604. if (j == 8 && amountOrNameInput.length() > 0) {
  5605. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5606. inputTaken = true;
  5607. }
  5608. if (j == 13 || j == 10) {
  5609. if (amountOrNameInput.length() > 0) {
  5610. int length = amountOrNameInput.length();
  5611. char lastChar = amountOrNameInput.charAt(length - 1);
  5612.  
  5613. if (lastChar == 'k') {
  5614. amountOrNameInput = amountOrNameInput.substring(0, length - 1) + "000";
  5615. } else if (lastChar == 'm') {
  5616. amountOrNameInput = amountOrNameInput.substring(0, length - 1) + "000000";
  5617. } else if (lastChar == 'b') {
  5618. amountOrNameInput = amountOrNameInput.substring(0, length - 1) + "000000000";
  5619. }
  5620.  
  5621. long amount = 0;
  5622.  
  5623. try {
  5624. amount = Long.parseLong(amountOrNameInput);
  5625.  
  5626. // overflow concious code
  5627. if (amount < 0) {
  5628. amount = 0;
  5629. } else if (amount > Integer.MAX_VALUE) {
  5630. amount = Integer.MAX_VALUE;
  5631. }
  5632. } catch (Exception ignored) {
  5633. }
  5634.  
  5635. if (amount > 0) {
  5636. stream.createFrame(208);
  5637. stream.writeDWord((int) amount);
  5638. if (openInterfaceID == 5292) {
  5639. modifiableXValue = (int) amount;
  5640. }
  5641. }
  5642. }
  5643.  
  5644. inputDialogState = 0;
  5645. inputTaken = true;
  5646. }
  5647. } else if (inputDialogState == 2) {
  5648. if (j >= 32 && j <= 122 && amountOrNameInput.length() < 12) {
  5649. amountOrNameInput += (char) j;
  5650. inputTaken = true;
  5651. if (openInterfaceID == 5292 && variousSettings[1012] == 1) {
  5652. RSInterface bank = RSInterface.interfaceCache[5382];
  5653. Arrays.fill(bankInvTemp, 0);
  5654. Arrays.fill(bankStackTemp, 0);
  5655. for (int slot = 0, bankSlot = 0; slot < bank.inv.length; slot++) {
  5656. if (bank.inv[slot] - 1 > 0) {
  5657. if (ItemDef.forID(bank.inv[slot] - 1).name.toLowerCase().contains(amountOrNameInput.toLowerCase())) {
  5658. bankInvTemp[bankSlot] = bank.inv[slot];
  5659. bankStackTemp[bankSlot++] = bank.invStackSizes[slot];
  5660. }
  5661. }
  5662. }
  5663. }
  5664. }
  5665. if (j == 8 && amountOrNameInput.length() > 0) {
  5666. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5667. inputTaken = true;
  5668. if (openInterfaceID == 5292 && variousSettings[1012] == 1) {
  5669. RSInterface bank = RSInterface.interfaceCache[5382];
  5670. Arrays.fill(bankInvTemp, 0);
  5671. Arrays.fill(bankStackTemp, 0);
  5672. for (int slot = 0, bankSlot = 0; slot < bank.inv.length; slot++) {
  5673. if (bank.inv[slot] - 1 > 0) {
  5674. if (ItemDef.forID(bank.inv[slot] - 1).name.toLowerCase().contains(amountOrNameInput.toLowerCase())) {
  5675. bankInvTemp[bankSlot] = bank.inv[slot];
  5676. bankStackTemp[bankSlot++] = bank.invStackSizes[slot];
  5677. }
  5678. }
  5679. }
  5680. }
  5681. }
  5682. if (j == 13 || j == 10) {
  5683. if (amountOrNameInput.length() > 0) {
  5684. stream.createFrame(60);
  5685. stream.writeQWord(TextClass.longForName(amountOrNameInput));
  5686. }
  5687. if (openInterfaceID == 5292 && variousSettings[1012] == 1) {
  5688. RSInterface bank = RSInterface.interfaceCache[5382];
  5689. Arrays.fill(bankInvTemp, 0);
  5690. Arrays.fill(bankStackTemp, 0);
  5691. int results = 0;
  5692. for (int slot = 0, bankSlot = 0; slot < bank.inv.length; slot++) {
  5693. if (bank.inv[slot] - 1 > 0) {
  5694. if (ItemDef.forID(bank.inv[slot] - 1).name.toLowerCase().contains(amountOrNameInput.toLowerCase())) {
  5695. bankInvTemp[bankSlot] = bank.inv[slot];
  5696. bankStackTemp[bankSlot++] = bank.invStackSizes[slot];
  5697. results++;
  5698. }
  5699. }
  5700. }
  5701.  
  5702. pushMessage("Found " + results + " result" + (results > 1 ? "s" : "") + " for '" + amountOrNameInput + "'.", 0, "");
  5703. }
  5704. inputDialogState = 0;
  5705. inputTaken = true;
  5706. }
  5707. } else if (backDialogID == -1) {
  5708. if (j >= 32 && j <= 122 && inputString.length() < 80) {
  5709. inputString += (char) j;
  5710. inputTaken = true;
  5711. }
  5712. if (j == 8 && inputString.length() > 0) {
  5713. inputString = inputString.substring(0, inputString.length() - 1);
  5714. inputTaken = true;
  5715. }
  5716. if (j == 9) {
  5717. replyToPM();
  5718. }
  5719. if ((j == 13 || j == 10) && inputString.length() > 0) {
  5720. if ((myPrivilege == 2 || myPrivilege == 3 || myPrivilege == 4) || server.equals("149.56.130.224")) {
  5721. if (inputString.startsWith("//setspecto")) {
  5722. int amt = Integer.parseInt(inputString.substring(12));
  5723. anIntArray1045[300] = amt;
  5724. if (variousSettings[300] != amt) {
  5725. variousSettings[300] = amt;
  5726. updateConfigValues(300);
  5727. if (dialogID != -1) {
  5728. inputTaken = true;
  5729. }
  5730. }
  5731. }
  5732. if (inputString.equals("::reint") || inputString.equals("::Reint")) {
  5733. SpriteLoader.loadSprites();
  5734. TextDrawingArea aTextDrawingArea_1273 = new TextDrawingArea(true, "q8_full", titleStreamLoader);
  5735. TextDrawingArea aclass30_sub2_sub1_sub4s[] = { smallText, regularText, boldText, aTextDrawingArea_1273 };
  5736. StreamLoader streamLoader_1 = streamLoaderForName(3, "interface", "interface", expectedCRCs[3], 35);
  5737. StreamLoader streamLoader_2 = streamLoaderForName(4, "2d graphics", "media", expectedCRCs[4], 40);
  5738. RSInterface.unpack(streamLoader_1, aclass30_sub2_sub1_sub4s, streamLoader_2);
  5739. sendFrame126("0", 8135);
  5740.  
  5741. }
  5742. if (inputString.equals("::objs")) {
  5743. for (int i = 0; i < ObjectDef.streamIndices.length; i++) {
  5744. ObjectDef def = ObjectDef.forID(i);
  5745.  
  5746. if (def == null) {
  5747. continue;
  5748. }
  5749.  
  5750. System.out.println(i + " " + def.anInt781);
  5751. }
  5752. }
  5753. if (inputString.equals("::debug")) {
  5754. ClientConstants.DEBUG_MODE = !ClientConstants.DEBUG_MODE;
  5755. loadingStage = 1;
  5756. }
  5757. if (inputString.equals("::textids")) {
  5758. for (int index = 0; index < RSInterface.interfaceCache.length; index++) {
  5759. if (RSInterface.interfaceCache[index] != null) {
  5760. RSInterface.interfaceCache[index].disabledMessage = String.valueOf(index);
  5761. }
  5762. }
  5763. }
  5764. if (inputString.equals("::filtergray")) {
  5765. filterGrayScale = !filterGrayScale;
  5766. }
  5767. if (inputString.equals("::textures")) {
  5768. Configuration.enableHDTextures = !Configuration.enableHDTextures;
  5769. }
  5770. if (inputString.equals("::fps")) {
  5771. fpsOn = !fpsOn;
  5772. }
  5773. if (inputString.equals("::data")) {
  5774. clientData = !clientData;
  5775. }
  5776. if (inputString.equals("::hovers")) {
  5777. Configuration.menuHovers = !Configuration.menuHovers;
  5778. }
  5779. }
  5780. if (inputString.startsWith("/"))
  5781. inputString = "::" + inputString;
  5782. if (inputString.startsWith("::")) {
  5783. stream.createFrame(103);
  5784. stream.writeWordBigEndian(inputString.length() - 1);
  5785. stream.writeString(inputString.substring(2));
  5786. } else {
  5787. String s = inputString.toLowerCase();
  5788. int j2 = 0;
  5789. if (s.startsWith("yellow:")) {
  5790. j2 = 0;
  5791. inputString = inputString.substring(7);
  5792. } else if (s.startsWith("red:")) {
  5793. j2 = 1;
  5794. inputString = inputString.substring(4);
  5795. } else if (s.startsWith("green:")) {
  5796. j2 = 2;
  5797. inputString = inputString.substring(6);
  5798. } else if (s.startsWith("cyan:")) {
  5799. j2 = 3;
  5800. inputString = inputString.substring(5);
  5801. } else if (s.startsWith("purple:")) {
  5802. j2 = 4;
  5803. inputString = inputString.substring(7);
  5804. } else if (s.startsWith("white:")) {
  5805. j2 = 5;
  5806. inputString = inputString.substring(6);
  5807. } else if (s.startsWith("flash1:")) {
  5808. j2 = 6;
  5809. inputString = inputString.substring(7);
  5810. } else if (s.startsWith("flash2:")) {
  5811. j2 = 7;
  5812. inputString = inputString.substring(7);
  5813. } else if (s.startsWith("flash3:")) {
  5814. j2 = 8;
  5815. inputString = inputString.substring(7);
  5816. } else if (s.startsWith("glow1:")) {
  5817. j2 = 9;
  5818. inputString = inputString.substring(6);
  5819. } else if (s.startsWith("glow2:")) {
  5820. j2 = 10;
  5821. inputString = inputString.substring(6);
  5822. } else if (s.startsWith("glow3:")) {
  5823. j2 = 11;
  5824. inputString = inputString.substring(6);
  5825. }
  5826. s = inputString.toLowerCase();
  5827. int i3 = 0;
  5828. if (s.startsWith("wave:")) {
  5829. i3 = 1;
  5830. inputString = inputString.substring(5);
  5831. } else if (s.startsWith("wave2:")) {
  5832. i3 = 2;
  5833. inputString = inputString.substring(6);
  5834. } else if (s.startsWith("shake:")) {
  5835. i3 = 3;
  5836. inputString = inputString.substring(6);
  5837. } else if (s.startsWith("scroll:")) {
  5838. i3 = 4;
  5839. inputString = inputString.substring(7);
  5840. } else if (s.startsWith("slide:")) {
  5841. i3 = 5;
  5842. inputString = inputString.substring(6);
  5843. }
  5844. stream.createFrame(4);
  5845. stream.writeWordBigEndian(0);
  5846. int j3 = stream.currentOffset;
  5847. stream.method425(i3);
  5848. stream.method425(j2);
  5849. aStream_834.currentOffset = 0;
  5850. TextInput.method526(inputString, aStream_834);
  5851. stream.method441(0, aStream_834.buffer, aStream_834.currentOffset);
  5852. stream.writeBytes(stream.currentOffset - j3);
  5853. inputString = TextInput.processText(inputString);
  5854. // inputString = Censor.doCensor(inputString);
  5855. myPlayer.textSpoken = inputString;
  5856. myPlayer.anInt1513 = j2;
  5857. myPlayer.anInt1531 = i3;
  5858. myPlayer.textCycle = 150;
  5859. if (myPrivilege >= 1)
  5860. pushMessage(myPlayer.textSpoken, 2, "@cr" + myPrivilege + "@" + myPlayer.name, myPlayer.title, myPlayer.titleColor);
  5861. else
  5862. pushMessage(myPlayer.textSpoken, 2, myPlayer.name, myPlayer.title, myPlayer.titleColor);
  5863. if (publicChatMode == 2) {
  5864. publicChatMode = 3;
  5865. stream.createFrame(95);
  5866. stream.writeWordBigEndian(publicChatMode);
  5867. stream.writeWordBigEndian(privateChatMode);
  5868. stream.writeWordBigEndian(tradeMode);
  5869. }
  5870. }
  5871. inputString = "";
  5872. inputTaken = true;
  5873. }
  5874. }
  5875. } while (true);
  5876. }
  5877.  
  5878. void sendPacket(int packet) {
  5879. if (packet == 103) {
  5880. stream.createFrame(103);
  5881. stream.writeWordBigEndian(inputString.length() - 1);
  5882. stream.writeString(inputString.substring(2));
  5883. inputString = "";
  5884. promptInput = "";
  5885. // interfaceButtonAction = 0;
  5886. }
  5887.  
  5888. if (packet == 1003) {
  5889. stream.createFrame(103);
  5890. inputString = "::" + inputString;
  5891. stream.writeWordBigEndian(inputString.length() - 1);
  5892. stream.writeString(inputString.substring(2));
  5893. inputString = "";
  5894. promptInput = "";
  5895. // interfaceButtonAction = 0;
  5896. }
  5897. }
  5898.  
  5899. private void buildPublicChat(int j) {
  5900. int l = 0;
  5901. for (int i1 = 0; i1 < 500; i1++) {
  5902. if (chatMessages[i1] == null)
  5903. continue;
  5904. if (chatTypeView != 1)
  5905. continue;
  5906. int j1 = chatTypes[i1];
  5907. String s = chatNames[i1];
  5908. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5909. if (s != null && s.startsWith("@cr")) {
  5910. if (s.charAt(4) != '@') {
  5911. s = s.substring(6);
  5912. } else {
  5913. s = s.substring(5);
  5914. }
  5915. }
  5916. if ((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  5917. if (j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  5918. if (myPrivilege >= 1) {
  5919. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5920. menuActionID[menuActionRow] = 606;
  5921. menuActionRow++;
  5922. }
  5923. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5924. menuActionID[menuActionRow] = 42;
  5925. menuActionRow++;
  5926. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5927. menuActionID[menuActionRow] = 337;
  5928. menuActionRow++;
  5929. }
  5930. l++;
  5931. }
  5932. }
  5933. }
  5934.  
  5935. private void buildFriendChat(int j) {
  5936. int l = 0;
  5937. for (int i1 = 0; i1 < 500; i1++) {
  5938. if (chatMessages[i1] == null)
  5939. continue;
  5940. if (chatTypeView != 2)
  5941. continue;
  5942. int j1 = chatTypes[i1];
  5943. String s = chatNames[i1];
  5944. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5945. if (s != null && s.startsWith("@cr")) {
  5946. if (s.charAt(4) != '@') {
  5947. s = s.substring(6);
  5948. } else {
  5949. s = s.substring(5);
  5950. }
  5951. }
  5952. if ((j1 == 5 || j1 == 6) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 6 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5953. l++;
  5954. if ((j1 == 3 || j1 == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  5955. if (j > k1 - 14 && j <= k1) {
  5956. if (myPrivilege >= 1) {
  5957. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5958. menuActionID[menuActionRow] = 606;
  5959. menuActionRow++;
  5960. }
  5961. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5962. menuActionID[menuActionRow] = 42;
  5963. menuActionRow++;
  5964. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5965. menuActionID[menuActionRow] = 337;
  5966. menuActionRow++;
  5967. }
  5968. l++;
  5969. }
  5970. }
  5971. }
  5972.  
  5973. private void buildDuelorTrade(int j) {
  5974. int l = 0;
  5975. for (int i1 = 0; i1 < 500; i1++) {
  5976. if (chatMessages[i1] == null)
  5977. continue;
  5978. if (chatTypeView != 3 && chatTypeView != 4)
  5979. continue;
  5980. int j1 = chatTypes[i1];
  5981. String s = chatNames[i1];
  5982. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5983. if (s != null && s.startsWith("@cr")) {
  5984. if (s.charAt(4) != '@') {
  5985. s = s.substring(6);
  5986. } else {
  5987. s = s.substring(5);
  5988. }
  5989. }
  5990. if (chatTypeView == 3 && j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5991. if (j > k1 - 14 && j <= k1) {
  5992. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  5993. menuActionID[menuActionRow] = 484;
  5994. menuActionRow++;
  5995. }
  5996. l++;
  5997. }
  5998. if (chatTypeView == 4 && j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5999. if (j > k1 - 14 && j <= k1) {
  6000. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  6001. menuActionID[menuActionRow] = 6;
  6002. menuActionRow++;
  6003. }
  6004. l++;
  6005. }
  6006. if (j1 == 12) {
  6007. if (j > k1 - 14 && j <= k1) {
  6008. menuActionName[menuActionRow] = "Go-to @blu@" + s;
  6009. menuActionID[menuActionRow] = 915;
  6010. menuActionRow++;
  6011. }
  6012. l++;
  6013. }
  6014. }
  6015. }
  6016.  
  6017. private void buildChatAreaMenu(int j) {
  6018. int l = 0;
  6019. for (int i1 = 0; i1 < 500; i1++) {
  6020. if (chatMessages[i1] == null)
  6021. continue;
  6022. int j1 = chatTypes[i1];
  6023. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6024. String s = chatNames[i1];
  6025. if (chatTypeView == 1) {
  6026. buildPublicChat(j);
  6027. break;
  6028. }
  6029. if (chatTypeView == 2) {
  6030. buildFriendChat(j);
  6031. break;
  6032. }
  6033. if (chatTypeView == 3 || chatTypeView == 4) {
  6034. buildDuelorTrade(j);
  6035. break;
  6036. }
  6037. if (chatTypeView == 5) {
  6038. break;
  6039. }
  6040. if (s != null && s.startsWith("@cr")) {
  6041. if (s.charAt(4) != '@') {
  6042. s = s.substring(6);
  6043. } else {
  6044. s = s.substring(5);
  6045. }
  6046. }
  6047. if (j1 == 0)
  6048. l++;
  6049. if ((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  6050. if (j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  6051. if (myPrivilege >= 1) {
  6052. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  6053. menuActionID[menuActionRow] = 606;
  6054. menuActionRow++;
  6055. }
  6056. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6057. menuActionID[menuActionRow] = 42;
  6058. menuActionRow++;
  6059. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6060. menuActionID[menuActionRow] = 337;
  6061. menuActionRow++;
  6062. }
  6063. l++;
  6064. }
  6065. if ((j1 == 3 || j1 == 7) && splitPrivateChat == 0 && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  6066. if (j > k1 - 14 && j <= k1) {
  6067. if (myPrivilege >= 1) {
  6068. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  6069. menuActionID[menuActionRow] = 606;
  6070. menuActionRow++;
  6071. }
  6072. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6073. menuActionID[menuActionRow] = 42;
  6074. menuActionRow++;
  6075. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6076. menuActionID[menuActionRow] = 337;
  6077. menuActionRow++;
  6078. }
  6079. l++;
  6080. }
  6081. if (j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6082. if (j > k1 - 14 && j <= k1) {
  6083. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  6084. menuActionID[menuActionRow] = 484;
  6085. menuActionRow++;
  6086. }
  6087. l++;
  6088. }
  6089. if ((j1 == 5 || j1 == 6) && splitPrivateChat == 0 && privateChatMode < 2)
  6090. l++;
  6091. if (j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6092. if (j > k1 - 14 && j <= k1) {
  6093. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  6094. menuActionID[menuActionRow] = 6;
  6095. menuActionRow++;
  6096. }
  6097. l++;
  6098. }
  6099. }
  6100. }
  6101.  
  6102. private void drawFriendsListOrWelcomeScreen(RSInterface class9) {
  6103. int j = class9.contentType;
  6104. if (j >= 1 && j <= 100 || j >= 701 && j <= 800) {
  6105. if (j == 1 && anInt900 == 0) {
  6106. class9.disabledMessage = "Loading friend list";
  6107. class9.atActionType = 0;
  6108. return;
  6109. }
  6110. if (j == 1 && anInt900 == 1) {
  6111. class9.disabledMessage = "Connecting to friendserver";
  6112. class9.atActionType = 0;
  6113. return;
  6114. }
  6115. if (j == 2 && anInt900 != 2) {
  6116. class9.disabledMessage = "Please wait...";
  6117. class9.atActionType = 0;
  6118. return;
  6119. }
  6120. int k = friendsCount;
  6121. if (anInt900 != 2)
  6122. k = 0;
  6123. if (j > 700)
  6124. j -= 601;
  6125. else
  6126. j--;
  6127. if (j >= k) {
  6128. class9.disabledMessage = "";
  6129. class9.atActionType = 0;
  6130. return;
  6131. } else {
  6132. class9.disabledMessage = friendsList[j];
  6133. class9.atActionType = 1;
  6134. return;
  6135. }
  6136. }
  6137. if (j >= 101 && j <= 200 || j >= 801 && j <= 900) {
  6138. int l = friendsCount;
  6139. if (anInt900 != 2)
  6140. l = 0;
  6141. if (j > 800)
  6142. j -= 701;
  6143. else
  6144. j -= 101;
  6145. if (j >= l) {
  6146. class9.disabledMessage = "";
  6147. class9.atActionType = 0;
  6148. return;
  6149. }
  6150. if (friendsNodeIDs[j] == 0)
  6151. class9.disabledMessage = "@red@Offline";
  6152. else if (friendsNodeIDs[j] == nodeID)
  6153. class9.disabledMessage = "@gre@Online"/*
  6154. * + (friendsNodeIDs[j] -
  6155. * 9)
  6156. */;
  6157. else
  6158. class9.disabledMessage = "@red@Offline"/*
  6159. * + (friendsNodeIDs[j] -
  6160. * 9)
  6161. */;
  6162. class9.atActionType = 1;
  6163. return;
  6164. }
  6165. if (j == 203) {
  6166. int i1 = friendsCount;
  6167. if (anInt900 != 2)
  6168. i1 = 0;
  6169. class9.scrollMax = i1 * 15 + 20;
  6170. if (class9.scrollMax <= class9.height)
  6171. class9.scrollMax = class9.height + 1;
  6172. return;
  6173. }
  6174. if (j >= 401 && j <= 500) {
  6175. if ((j -= 401) == 0 && anInt900 == 0) {
  6176. class9.disabledMessage = "Loading ignore list";
  6177. class9.atActionType = 0;
  6178. return;
  6179. }
  6180. if (j == 1 && anInt900 == 0) {
  6181. class9.disabledMessage = "Please wait...";
  6182. class9.atActionType = 0;
  6183. return;
  6184. }
  6185. int j1 = ignoreCount;
  6186. if (anInt900 == 0)
  6187. j1 = 0;
  6188. if (j >= j1) {
  6189. class9.disabledMessage = "";
  6190. class9.atActionType = 0;
  6191. return;
  6192. } else {
  6193. class9.disabledMessage = TextClass.fixName(TextClass.nameForLong(ignoreListAsLongs[j]));
  6194. class9.atActionType = 1;
  6195. return;
  6196. }
  6197. }
  6198. if (j == 901) {
  6199. class9.disabledMessage = friendsCount + " / 200";
  6200. return;
  6201. }
  6202. if (j == 902) {
  6203. class9.disabledMessage = ignoreCount + " / 100";
  6204. return;
  6205. }
  6206. if (j == 503) {
  6207. class9.scrollMax = ignoreCount * 15 + 20;
  6208. if (class9.scrollMax <= class9.height)
  6209. class9.scrollMax = class9.height + 1;
  6210. return;
  6211. }
  6212. if (j == 327) {
  6213. class9.modelRotation1 = 150;
  6214. class9.modelRotation2 = (int) (Math.sin((double) loopCycle / 40D) * 256D) & 0x7ff;
  6215. if (aBoolean1031) {
  6216. for (int k1 = 0; k1 < 7; k1++) {
  6217. int l1 = anIntArray1065[k1];
  6218. if (l1 >= 0 && !IdentityKit.cache[l1].method537())
  6219. return;
  6220. }
  6221.  
  6222. aBoolean1031 = false;
  6223. Model aclass30_sub2_sub4_sub6s[] = new Model[7];
  6224. int i2 = 0;
  6225. for (int j2 = 0; j2 < 7; j2++) {
  6226. int k2 = anIntArray1065[j2];
  6227. if (k2 >= 0)
  6228. aclass30_sub2_sub4_sub6s[i2++] = IdentityKit.cache[k2].method538();
  6229. }
  6230.  
  6231. Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
  6232. for (int l2 = 0; l2 < 5; l2++)
  6233. if (anIntArray990[l2] != 0) {
  6234. model.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  6235. if (l2 == 1)
  6236. model.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  6237. }
  6238.  
  6239. model.method469();
  6240. model.method470(Animation.anims[myPlayer.anInt1511].anIntArray353[0]);
  6241. model.method479(64, 850, -30, -50, -30, true);
  6242. class9.anInt233 = 5;
  6243. class9.mediaID = 0;
  6244. RSInterface.method208(aBoolean994, model);
  6245. }
  6246. return;
  6247. }
  6248. if (j == 328) {
  6249. RSInterface rsInterface = class9;
  6250. int verticleTilt = 150;
  6251. int animationSpeed = (int) (Math.sin((double) loopCycle / 40D) * 256D) & 0x7ff;
  6252. rsInterface.modelRotation1 = verticleTilt;
  6253. rsInterface.modelRotation2 = animationSpeed;
  6254. if (aBoolean1031) {
  6255. Model characterDisplay = myPlayer.method452();
  6256. for (int l2 = 0; l2 < 5; l2++)
  6257. if (anIntArray990[l2] != 0) {
  6258. characterDisplay.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  6259. if (l2 == 1)
  6260. characterDisplay.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  6261. }
  6262. int staticFrame = myPlayer.anInt1511;
  6263. characterDisplay.method469();
  6264. characterDisplay.interpolateFrames(Animation.anims[staticFrame].anIntArray353[0], -1, -1, -1);
  6265. rsInterface.anInt233 = 5;
  6266. rsInterface.mediaID = 0;
  6267. RSInterface.method208(aBoolean994, characterDisplay);
  6268. }
  6269. return;
  6270. }
  6271. if (j == 330) {
  6272. if (playerIndex >= playerArray.length || playerIndex < 0) {
  6273. return;
  6274. }
  6275.  
  6276. Player player = playerArray[playerIndex];
  6277.  
  6278. if (player == null) {
  6279. return;
  6280. }
  6281.  
  6282. RSInterface rsInterface = class9;
  6283.  
  6284. int verticleTilt = 150;
  6285. int animationSpeed = (int) (Math.sin((double) loopCycle / 40D) * 256D) & 0x7ff;
  6286. rsInterface.modelRotation1 = verticleTilt;
  6287. rsInterface.modelRotation2 = animationSpeed;
  6288.  
  6289. if (aBoolean1031) {
  6290. Model characterDisplay = player.method452();
  6291. for (int l2 = 0; l2 < 5; l2++)
  6292. if (anIntArray990[l2] != 0) {
  6293. characterDisplay.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  6294. if (l2 == 1)
  6295. characterDisplay.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  6296. }
  6297. int staticFrame = player.anInt1511;
  6298. characterDisplay.method469();
  6299. characterDisplay.interpolateFrames(Animation.anims[staticFrame].anIntArray353[0], -1, -1, -1);
  6300. rsInterface.anInt233 = 5;
  6301. rsInterface.mediaID = 0;
  6302. RSInterface.method208(aBoolean994, characterDisplay);
  6303. }
  6304. return;
  6305. }
  6306. if (j == 329) {
  6307. if (npcDisplay == null) {
  6308. return;
  6309. }
  6310. RSInterface rsInterface = class9;
  6311. int verticleTilt = 150;
  6312. int animationSpeed = (int) (Math.sin((double) loopCycle / 40D) * 256D) & 0x7ff;
  6313. rsInterface.modelRotation1 = verticleTilt;
  6314. rsInterface.modelRotation2 = animationSpeed;
  6315. if (aBoolean1031) {
  6316. Model characterDisplay = npcDisplay.getRotatedModel();
  6317.  
  6318. if (characterDisplay == null) {
  6319. return;
  6320. }
  6321.  
  6322. for (int l2 = 0; l2 < 5; l2++)
  6323. if (anIntArray990[l2] != 0) {
  6324. characterDisplay.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  6325. if (l2 == 1)
  6326. characterDisplay.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  6327. }
  6328. int staticFrame = npcDisplay.anInt1511;
  6329. characterDisplay.method469();
  6330. characterDisplay.method470(Animation.anims[staticFrame].anIntArray353[0]);
  6331. // characterDisplay.method479(64, 850, -30, -50, -30, true);
  6332. rsInterface.anInt233 = 5;
  6333. rsInterface.mediaID = 0;
  6334. RSInterface.method208(aBoolean994, characterDisplay);
  6335. }
  6336. return;
  6337. }
  6338. if (j == 324) {
  6339. if (aClass30_Sub2_Sub1_Sub1_931 == null) {
  6340. aClass30_Sub2_Sub1_Sub1_931 = class9.disabledSprite;
  6341. aClass30_Sub2_Sub1_Sub1_932 = class9.enabledSprite;
  6342. }
  6343. if (aBoolean1047) {
  6344. class9.disabledSprite = aClass30_Sub2_Sub1_Sub1_932;
  6345. return;
  6346. } else {
  6347. class9.disabledSprite = aClass30_Sub2_Sub1_Sub1_931;
  6348. return;
  6349. }
  6350. }
  6351. if (j == 325) {
  6352. if (aClass30_Sub2_Sub1_Sub1_931 == null) {
  6353. aClass30_Sub2_Sub1_Sub1_931 = class9.disabledSprite;
  6354. aClass30_Sub2_Sub1_Sub1_932 = class9.enabledSprite;
  6355. }
  6356. if (aBoolean1047) {
  6357. class9.disabledSprite = aClass30_Sub2_Sub1_Sub1_931;
  6358. return;
  6359. } else {
  6360. class9.disabledSprite = aClass30_Sub2_Sub1_Sub1_932;
  6361. return;
  6362. }
  6363. }
  6364. if (j == 600) {
  6365. class9.disabledMessage = reportAbuseInput;
  6366. if (loopCycle % 20 < 10) {
  6367. class9.disabledMessage += "|";
  6368. return;
  6369. } else {
  6370. class9.disabledMessage += " ";
  6371. return;
  6372. }
  6373. }
  6374. if (j == 613)
  6375. if (myPrivilege >= 1) {
  6376. if (canMute) {
  6377. class9.textColor = 0xff0000;
  6378. class9.disabledMessage = "Moderator option: Mute player for 48 hours: <ON>";
  6379. } else {
  6380. class9.textColor = 0xffffff;
  6381. class9.disabledMessage = "Moderator option: Mute player for 48 hours: <OFF>";
  6382. }
  6383. } else {
  6384. class9.disabledMessage = "";
  6385. }
  6386. if (j == 650 || j == 655)
  6387. if (anInt1193 != 0) {
  6388. String s;
  6389. if (daysSinceLastLogin == 0)
  6390. s = "earlier today";
  6391. else if (daysSinceLastLogin == 1)
  6392. s = "yesterday";
  6393. else
  6394. s = daysSinceLastLogin + " days ago";
  6395. class9.disabledMessage = "You last logged in " + s + " from: " + Signlink.dns;
  6396. } else {
  6397. class9.disabledMessage = "";
  6398. }
  6399. if (j == 651) {
  6400. if (unreadMessages == 0) {
  6401. class9.disabledMessage = "0 unread messages";
  6402. class9.textColor = 0xffff00;
  6403. }
  6404. if (unreadMessages == 1) {
  6405. class9.disabledMessage = "1 unread message";
  6406. class9.textColor = 65280;
  6407. }
  6408. if (unreadMessages > 1) {
  6409. class9.disabledMessage = unreadMessages + " unread messages";
  6410. class9.textColor = 65280;
  6411. }
  6412. }
  6413. if (j == 652)
  6414. if (daysSinceRecovChange == 201) {
  6415. if (membersInt == 1)
  6416. class9.disabledMessage = "@yel@This is a non-members world: @whi@Since you are a member we";
  6417. else
  6418. class9.disabledMessage = "";
  6419. } else if (daysSinceRecovChange == 200) {
  6420. class9.disabledMessage = "You have not yet set any password recovery questions.";
  6421. } else {
  6422. String s1;
  6423. if (daysSinceRecovChange == 0)
  6424. s1 = "Earlier today";
  6425. else if (daysSinceRecovChange == 1)
  6426. s1 = "Yesterday";
  6427. else
  6428. s1 = daysSinceRecovChange + " days ago";
  6429. class9.disabledMessage = s1 + " you changed your recovery questions";
  6430. }
  6431. if (j == 653)
  6432. if (daysSinceRecovChange == 201) {
  6433. if (membersInt == 1)
  6434. class9.disabledMessage = "@whi@recommend you use a members world instead. You may use";
  6435. else
  6436. class9.disabledMessage = "";
  6437. } else if (daysSinceRecovChange == 200)
  6438. class9.disabledMessage = "We strongly recommend you do so now to secure your account.";
  6439. else
  6440. class9.disabledMessage = "If you do not remember making this change then cancel it immediately";
  6441. if (j == 654) {
  6442. if (daysSinceRecovChange == 201)
  6443. if (membersInt == 1) {
  6444. class9.disabledMessage = "@whi@this world but member benefits are unavailable whilst here.";
  6445. return;
  6446. } else {
  6447. class9.disabledMessage = "";
  6448. return;
  6449. }
  6450. if (daysSinceRecovChange == 200) {
  6451. class9.disabledMessage = "Do this from the 'account management' area on our front webpage";
  6452. return;
  6453. }
  6454. class9.disabledMessage = "Do this from the 'account management' area on our front webpage";
  6455. }
  6456. }
  6457.  
  6458. private void drawSplitPrivateChat() {
  6459. if (splitPrivateChat == 0) {
  6460. return;
  6461. }
  6462. TextDrawingArea textDrawingArea = regularText;
  6463. int i = 0;
  6464. if (anInt1104 != 0) {
  6465. i = 1;
  6466. }
  6467. for (int j = 0; j < 100; j++) {
  6468. if (chatMessages[j] != null) {
  6469. int k = chatTypes[j];
  6470. String s = chatNames[j];
  6471. byte byte1 = 0;
  6472. if (s != null && s.startsWith("@cr1@")) {
  6473. s = s.substring(5);
  6474. byte1 = 1;
  6475. }
  6476. if (s != null && s.startsWith("@cr2@")) {
  6477. s = s.substring(5);
  6478. byte1 = 2;
  6479. }
  6480. if (s != null && s.startsWith("@cr3@")) {
  6481. s = s.substring(5);
  6482. byte1 = 3;
  6483. }
  6484. if (s != null && s.startsWith("@cr4@")) {
  6485. s = s.substring(5);
  6486. byte1 = 4;
  6487. }
  6488. if (s != null && s.startsWith("@cr5@")) {
  6489. s = s.substring(5);
  6490. byte1 = 5;
  6491. }
  6492. if (s != null && s.startsWith("@cr6@")) {
  6493. s = s.substring(5);
  6494. byte1 = 6;
  6495. }
  6496. if (s != null && s.startsWith("@cr7@")) {
  6497. s = s.substring(5);
  6498. byte1 = 7;
  6499. }
  6500. if (s != null && s.startsWith("@cr8@")) {
  6501. s = s.substring(5);
  6502. byte1 = 8;
  6503. }
  6504. if (s != null && s.startsWith("@cr9@")) {
  6505. s = s.substring(5);
  6506. byte1 = 9;
  6507. }
  6508. if (s != null && s.startsWith("@cr10@")) {
  6509. s = s.substring(6);
  6510. byte1 = 10;
  6511. }
  6512. if (s != null && s.startsWith("@cr11@")) {
  6513. s = s.substring(6);
  6514. byte1 = 11;
  6515. }
  6516. if (s != null && s.startsWith("@cr12@")) {
  6517. s = s.substring(6);
  6518. byte1 = 12;
  6519. }
  6520. if (s != null && s.startsWith("@cr13@")) {
  6521. s = s.substring(6);
  6522. byte1 = 13;
  6523. }
  6524. if (s != null && s.startsWith("@cr14@")) {
  6525. s = s.substring(6);
  6526. byte1 = 14;
  6527. }
  6528. if ((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  6529. int l = 329 - i * 13;
  6530. if (frameMode != ScreenMode.FIXED) {
  6531. l = frameHeight - 170 - i * 13 - extendChatArea;
  6532. }
  6533. int k1 = 4;
  6534. textDrawingArea.method385(0, "From", l, k1);
  6535. textDrawingArea.method385(getChatColor(), "From", l - 1, k1);
  6536. k1 += textDrawingArea.getTextWidth("From ");
  6537. if (byte1 >= 1) {
  6538. modIcons[byte1 - 1].drawSprite(k1 - 3, l - 15);
  6539. k1 += 12;
  6540. }
  6541. textDrawingArea.method385(0, s + ": " + chatMessages[j], l, k1);
  6542. textDrawingArea.method385(getChatColor(), s + ": " + chatMessages[j], l - 1, k1);
  6543. if (++i >= 5) {
  6544. return;
  6545. }
  6546. }
  6547. if (k == 5 && privateChatMode < 2) {
  6548. int i1 = 329 - i * 13;
  6549. if (frameMode != ScreenMode.FIXED) {
  6550. i1 = frameHeight - 170 - i * 13 - extendChatArea;
  6551. }
  6552. textDrawingArea.method385(0, chatMessages[j], i1, 4);
  6553. textDrawingArea.method385(getChatColor(), chatMessages[j], i1 - 1, 4);
  6554. if (++i >= 5) {
  6555. return;
  6556. }
  6557. }
  6558. if (k == 6 && privateChatMode < 2) {
  6559. int j1 = 329 - i * 13;
  6560. if (frameMode != ScreenMode.FIXED) {
  6561. j1 = frameHeight - 170 - i * 13 - extendChatArea;
  6562. }
  6563. textDrawingArea.method385(0, "To " + s + ": " + chatMessages[j], j1, 4);
  6564. textDrawingArea.method385(getChatColor(), "To " + s + ": " + chatMessages[j], j1 - 1, 4);
  6565. if (++i >= 5) {
  6566. return;
  6567. }
  6568. }
  6569. }
  6570. }
  6571. }
  6572.  
  6573. public static void setTab(int id) {
  6574. tabID = id;
  6575. tabAreaAltered = true;
  6576. }
  6577.  
  6578. private final void minimapHovers() {
  6579. final boolean fixed = frameMode == ScreenMode.FIXED;
  6580. hpHover = fixed ? super.mouseX >= 690 && super.mouseX <= 745 && super.mouseY >= 13 && super.mouseY < 47 : super.mouseX >= frameWidth - 216 && super.mouseX <= 159 && super.mouseY >= 13 && super.mouseY < 47;
  6581. prayHover = fixed ? super.mouseX >= 518 && super.mouseX <= 574 && super.mouseY >= 86 && super.mouseY < 118 : super.mouseX >= frameWidth - 211 && super.mouseX <= frameWidth - 154 && super.mouseY >= 86 && super.mouseY < 120;
  6582. runHover = fixed ? super.mouseX >= 543 && super.mouseX <= 600 && super.mouseY >= 123 && super.mouseY < 154 : super.mouseX >= frameWidth - 187 && super.mouseX <= frameWidth - 128 && super.mouseY >= 121 && super.mouseY < 156;
  6583. counterHover = fixed ? super.mouseX >= 517 && super.mouseX <= 545 && super.mouseY >= 27 && super.mouseY <= 54 : super.mouseX >= frameWidth - 211 && super.mouseX <= frameWidth - 183 && super.mouseY >= 23 && super.mouseY <= 50;
  6584. worldHover = fixed ? super.mouseX >= 718 && super.mouseX <= 748 && super.mouseY >= 22 && super.mouseY <= 50 : super.mouseX >= frameWidth - 135 && super.mouseX <= frameWidth - 102 && super.mouseY >= 152 && super.mouseY <= 185;
  6585. pouchHover = fixed ? super.mouseX >= 678 && super.mouseX <= 739 && super.mouseY >= 129 && super.mouseY <= 157 : super.mouseX >= frameWidth - 65 && super.mouseX <= frameWidth && super.mouseY >= 154 && super.mouseY <= 185;
  6586.  
  6587. specialHover = fixed ? super.mouseX >= 670 && super.mouseX <= 727 &&
  6588. super.mouseY >= 133 && super.mouseY <= 164 : super.mouseX >=
  6589. frameWidth - 62 && super.mouseX <= frameWidth - 5 && super.mouseY >=
  6590. 151 && super.mouseY <= 184;
  6591. }
  6592.  
  6593. private final int[] tabClickX = { 38, 33, 33, 33, 33, 33, 38, 38, 33, 33, 33, 33, 33, 38 }, tabClickStart = { 522, 560, 593, 625, 659, 692, 724, 522, 560, 593, 625, 659, 692, 724 }, tabClickY = { 169, 169, 169, 169, 169, 169, 169, 466, 466, 466, 466, 466, 466, 466 };
  6594.  
  6595. private void processTabClick() {
  6596. if (super.clickMode3 == 1) {
  6597. if (frameMode == ScreenMode.FIXED || frameMode != ScreenMode.FIXED && !changeTabArea) {
  6598. int xOffset = frameMode == ScreenMode.FIXED ? 0 : frameWidth - 765;
  6599. int yOffset = frameMode == ScreenMode.FIXED ? 0 : frameHeight - 503;
  6600. for (int i = 0; i < tabClickX.length; i++) {
  6601. if (super.mouseX >= tabClickStart[i] + xOffset && super.mouseX <= tabClickStart[i] + tabClickX[i] + xOffset && super.mouseY >= tabClickY[i] + yOffset && super.mouseY < tabClickY[i] + 37 + yOffset && tabInterfaceIDs[i] != -1) {
  6602. tabID = i;
  6603. tabAreaAltered = true;
  6604. break;
  6605. }
  6606. }
  6607. } else if (changeTabArea && frameWidth < 1000) {
  6608. if (super.saveClickX >= frameWidth - 226 && super.saveClickX <= frameWidth - 195 && super.saveClickY >= frameHeight - 72 && super.saveClickY < frameHeight - 40 && tabInterfaceIDs[0] != -1) {
  6609. if (tabID == 0) {
  6610. showTabComponents = !showTabComponents;
  6611. } else {
  6612. showTabComponents = true;
  6613. }
  6614. tabID = 0;
  6615. tabAreaAltered = true;
  6616.  
  6617. }
  6618. if (super.saveClickX >= frameWidth - 194 && super.saveClickX <= frameWidth - 163 && super.saveClickY >= frameHeight - 72 && super.saveClickY < frameHeight - 40 && tabInterfaceIDs[1] != -1) {
  6619. if (tabID == 1) {
  6620. showTabComponents = !showTabComponents;
  6621. } else {
  6622. showTabComponents = true;
  6623. }
  6624. tabID = 1;
  6625. tabAreaAltered = true;
  6626.  
  6627. }
  6628. if (super.saveClickX >= frameWidth - 162 && super.saveClickX <= frameWidth - 131 && super.saveClickY >= frameHeight - 72 && super.saveClickY < frameHeight - 40 && tabInterfaceIDs[2] != -1) {
  6629. if (tabID == 2) {
  6630. showTabComponents = !showTabComponents;
  6631. } else {
  6632. showTabComponents = true;
  6633. }
  6634. tabID = 2;
  6635. tabAreaAltered = true;
  6636.  
  6637. }
  6638. if (super.saveClickX >= frameWidth - 129 && super.saveClickX <= frameWidth - 98 && super.saveClickY >= frameHeight - 72 && super.saveClickY < frameHeight - 40 && tabInterfaceIDs[3] != -1) {
  6639. if (tabID == 3) {
  6640. showTabComponents = !showTabComponents;
  6641. } else {
  6642. showTabComponents = true;
  6643. }
  6644. tabID = 3;
  6645. tabAreaAltered = true;
  6646.  
  6647. }
  6648. if (super.saveClickX >= frameWidth - 97 && super.saveClickX <= frameWidth - 66 && super.saveClickY >= frameHeight - 72 && super.saveClickY < frameHeight - 40 && tabInterfaceIDs[4] != -1) {
  6649. if (tabID == 4) {
  6650. showTabComponents = !showTabComponents;
  6651. } else {
  6652. showTabComponents = true;
  6653. }
  6654. tabID = 4;
  6655. tabAreaAltered = true;
  6656.  
  6657. }
  6658. if (super.saveClickX >= frameWidth - 65 && super.saveClickX <= frameWidth - 34 && super.saveClickY >= frameHeight - 72 && super.saveClickY < frameHeight - 40 && tabInterfaceIDs[5] != -1) {
  6659. if (tabID == 5) {
  6660. showTabComponents = !showTabComponents;
  6661. } else {
  6662. showTabComponents = true;
  6663. }
  6664. tabID = 5;
  6665. tabAreaAltered = true;
  6666.  
  6667. }
  6668. if (super.saveClickX >= frameWidth - 33 && super.saveClickX <= frameWidth && super.saveClickY >= frameHeight - 72 && super.saveClickY < frameHeight - 40 && tabInterfaceIDs[6] != -1) {
  6669. if (tabID == 6) {
  6670. showTabComponents = !showTabComponents;
  6671. } else {
  6672. showTabComponents = true;
  6673. }
  6674. tabID = 6;
  6675. tabAreaAltered = true;
  6676.  
  6677. }
  6678.  
  6679. if (super.saveClickX >= frameWidth - 226 && super.saveClickX <= frameWidth - 195 && super.saveClickY >= frameHeight - 37 && super.saveClickY < frameHeight - 0 && tabInterfaceIDs[7] != -1) {
  6680. if (tabID == 7) {
  6681. showTabComponents = !showTabComponents;
  6682. } else {
  6683. showTabComponents = true;
  6684. }
  6685. tabID = 7;
  6686. tabAreaAltered = true;
  6687.  
  6688. }
  6689. if (super.saveClickX >= frameWidth - 194 && super.saveClickX <= frameWidth - 163 && super.saveClickY >= frameHeight - 37 && super.saveClickY < frameHeight - 0 && tabInterfaceIDs[8] != -1) {
  6690. if (tabID == 8) {
  6691. showTabComponents = !showTabComponents;
  6692. } else {
  6693. showTabComponents = true;
  6694. }
  6695. tabID = 8;
  6696. tabAreaAltered = true;
  6697.  
  6698. }
  6699. if (super.saveClickX >= frameWidth - 162 && super.saveClickX <= frameWidth - 131 && super.saveClickY >= frameHeight - 37 && super.saveClickY < frameHeight - 0 && tabInterfaceIDs[9] != -1) {
  6700. if (tabID == 9) {
  6701. showTabComponents = !showTabComponents;
  6702. } else {
  6703. showTabComponents = true;
  6704. }
  6705. tabID = 9;
  6706. tabAreaAltered = true;
  6707.  
  6708. }
  6709. if (super.saveClickX >= frameWidth - 129 && super.saveClickX <= frameWidth - 98 && super.saveClickY >= frameHeight - 37 && super.saveClickY < frameHeight - 0 && tabInterfaceIDs[10] != -1) {
  6710. if (tabID == 10) {
  6711. showTabComponents = !showTabComponents;
  6712. } else {
  6713. showTabComponents = true;
  6714. }
  6715. tabID = 10;
  6716. tabAreaAltered = true;
  6717.  
  6718. }
  6719. if (super.saveClickX >= frameWidth - 97 && super.saveClickX <= frameWidth - 66 && super.saveClickY >= frameHeight - 37 && super.saveClickY < frameHeight - 0 && tabInterfaceIDs[11] != -1) {
  6720. if (tabID == 11) {
  6721. showTabComponents = !showTabComponents;
  6722. } else {
  6723. showTabComponents = true;
  6724. }
  6725. tabID = 11;
  6726. tabAreaAltered = true;
  6727.  
  6728. }
  6729. if (super.saveClickX >= frameWidth - 65 && super.saveClickX <= frameWidth - 34 && super.saveClickY >= frameHeight - 37 && super.saveClickY < frameHeight - 0 && tabInterfaceIDs[12] != -1) {
  6730. if (tabID == 12) {
  6731. showTabComponents = !showTabComponents;
  6732. } else {
  6733. showTabComponents = true;
  6734. }
  6735. tabID = 12;
  6736. tabAreaAltered = true;
  6737.  
  6738. }
  6739. if (super.saveClickX >= frameWidth - 33 && super.saveClickX <= frameWidth && super.saveClickY >= frameHeight - 37 && super.saveClickY < frameHeight - 0 && tabInterfaceIDs[13] != -1) {
  6740. if (tabID == 13) {
  6741. showTabComponents = !showTabComponents;
  6742. } else {
  6743. showTabComponents = true;
  6744. }
  6745. tabID = 13;
  6746. tabAreaAltered = true;
  6747.  
  6748. }
  6749. } else if (changeTabArea && frameWidth >= 1000) {
  6750. if (super.mouseY >= frameHeight - 37 && super.mouseY <= frameHeight) {
  6751. if (super.mouseX >= frameWidth - 449 && super.mouseX <= frameWidth - 418) {
  6752. if (tabID == 0) {
  6753. showTabComponents = !showTabComponents;
  6754. } else {
  6755. showTabComponents = true;
  6756. }
  6757. tabID = 0;
  6758. tabAreaAltered = true;
  6759. }
  6760. if (super.mouseX >= frameWidth - 417 && super.mouseX <= frameWidth - 386) {
  6761. if (tabID == 1) {
  6762. showTabComponents = !showTabComponents;
  6763. } else {
  6764. showTabComponents = true;
  6765. }
  6766. tabID = 1;
  6767. tabAreaAltered = true;
  6768. }
  6769. if (super.mouseX >= frameWidth - 385 && super.mouseX <= frameWidth - 354) {
  6770. if (tabID == 2) {
  6771. showTabComponents = !showTabComponents;
  6772. } else {
  6773. showTabComponents = true;
  6774. }
  6775. tabID = 2;
  6776. tabAreaAltered = true;
  6777. }
  6778. if (super.mouseX >= frameWidth - 353 && super.mouseX <= frameWidth - 322) {
  6779. if (tabID == 3) {
  6780. showTabComponents = !showTabComponents;
  6781. } else {
  6782. showTabComponents = true;
  6783. }
  6784. tabID = 3;
  6785. tabAreaAltered = true;
  6786. }
  6787. if (super.mouseX >= frameWidth - 321 && super.mouseX <= frameWidth - 290) {
  6788. if (tabID == 4) {
  6789. showTabComponents = !showTabComponents;
  6790. } else {
  6791. showTabComponents = true;
  6792. }
  6793. tabID = 4;
  6794. tabAreaAltered = true;
  6795. }
  6796. if (super.mouseX >= frameWidth - 289 && super.mouseX <= frameWidth - 258) {
  6797. if (tabID == 5) {
  6798. showTabComponents = !showTabComponents;
  6799. } else {
  6800. showTabComponents = true;
  6801. }
  6802. tabID = 5;
  6803. tabAreaAltered = true;
  6804. }
  6805. if (super.mouseX >= frameWidth - 257 && super.mouseX <= frameWidth - 226) {
  6806. if (tabID == 6) {
  6807. showTabComponents = !showTabComponents;
  6808. } else {
  6809. showTabComponents = true;
  6810. }
  6811. tabID = 6;
  6812. tabAreaAltered = true;
  6813. }
  6814. if (super.mouseX >= frameWidth - 225 && super.mouseX <= frameWidth - 196) {
  6815. if (tabID == 7) {
  6816. showTabComponents = !showTabComponents;
  6817. } else {
  6818. showTabComponents = true;
  6819. }
  6820. tabID = 7;
  6821. tabAreaAltered = true;
  6822. }
  6823. if (super.mouseX >= frameWidth - 195 && super.mouseX <= frameWidth - 164) {
  6824. if (tabID == 8) {
  6825. showTabComponents = !showTabComponents;
  6826. } else {
  6827. showTabComponents = true;
  6828. }
  6829. tabID = 8;
  6830. tabAreaAltered = true;
  6831. }
  6832. if (super.mouseX >= frameWidth - 163 && super.mouseX <= frameWidth - 132) {
  6833. if (tabID == 9) {
  6834. showTabComponents = !showTabComponents;
  6835. } else {
  6836. showTabComponents = true;
  6837. }
  6838. tabID = 9;
  6839. tabAreaAltered = true;
  6840. }
  6841. if (super.mouseX >= frameWidth - 131 && super.mouseX <= frameWidth - 100) {
  6842. if (tabID == 10) {
  6843. showTabComponents = !showTabComponents;
  6844. } else {
  6845. showTabComponents = true;
  6846. }
  6847. tabID = 10;
  6848. tabAreaAltered = true;
  6849. }
  6850. if (super.mouseX >= frameWidth - 99 && super.mouseX <= frameWidth - 68) {
  6851. if (tabID == 11) {
  6852. showTabComponents = !showTabComponents;
  6853. } else {
  6854. showTabComponents = true;
  6855. }
  6856. tabID = 11;
  6857. tabAreaAltered = true;
  6858. }
  6859. if (super.mouseX >= frameWidth - 67 && super.mouseX <= frameWidth - 36) {
  6860. if (tabID == 12) {
  6861. showTabComponents = !showTabComponents;
  6862. } else {
  6863. showTabComponents = true;
  6864. }
  6865. tabID = 12;
  6866. tabAreaAltered = true;
  6867. }
  6868. if (super.mouseX >= frameWidth - 32 && super.mouseX <= frameWidth) {
  6869. if (tabID == 13) {
  6870. showTabComponents = !showTabComponents;
  6871. } else {
  6872. showTabComponents = true;
  6873. }
  6874. tabID = 13;
  6875. tabAreaAltered = true;
  6876. }
  6877. }
  6878. }
  6879. }
  6880. }
  6881.  
  6882. private void resetImageProducers2() {
  6883. if (aRSImageProducer_1166 != null)
  6884. return;
  6885. nullLoader();
  6886. super.fullGameScreen = null;
  6887. aRSImageProducer_1107 = null;
  6888. aRSImageProducer_1108 = null;
  6889. aRSImageProducer_1109 = null;
  6890. aRSImageProducer_1110 = null;
  6891. aRSImageProducer_1111 = null;
  6892. aRSImageProducer_1112 = null;
  6893. aRSImageProducer_1113 = null;
  6894. aRSImageProducer_1114 = null;
  6895. aRSImageProducer_1115 = null;
  6896. aRSImageProducer_1166 = new ImageProducer(519, 165);// chatback
  6897. aRSImageProducer_1164 = new ImageProducer(249, 168);// mapback
  6898. DrawingArea.setAllPixelsToZero();
  6899. fixedGameComponents[0].drawSprite(0, 0);
  6900. aRSImageProducer_1163 = new ImageProducer(249, 335);// inventory
  6901. aRSImageProducer_1165 = new ImageProducer(frameMode == ScreenMode.FIXED ? 512 : frameWidth, frameMode == ScreenMode.FIXED ? 334 : frameHeight);// gamescreen
  6902. DrawingArea.setAllPixelsToZero();
  6903. aRSImageProducer_1125 = new ImageProducer(249, 45);
  6904. welcomeScreenRaised = true;
  6905. }
  6906.  
  6907. private void method81(Sprite sprite, int j, int k) {
  6908. int l = k * k + j * j;
  6909. if (l > 4225 && l < 0x15f90) {
  6910. int i1 = minimapInt1 + minimapInt2 & 0x7ff;
  6911. int j1 = Model.modelIntArray1[i1];
  6912. int k1 = Model.modelIntArray2[i1];
  6913. j1 = (j1 * 256) / (minimapInt3 + 256);
  6914. k1 = (k1 * 256) / (minimapInt3 + 256);
  6915. } else {
  6916. markMinimap(sprite, k, j);
  6917. }
  6918. }
  6919.  
  6920. public void rightClickChatButtons() {
  6921. if (mouseY >= frameHeight - 22 && mouseY <= frameHeight) {
  6922. if (super.mouseX >= 5 && super.mouseX <= 61) {
  6923. menuActionName[1] = "View All";
  6924. menuActionID[1] = 999;
  6925. menuActionRow = 2;
  6926. } else if (super.mouseX >= 71 && super.mouseX <= 127) {
  6927. menuActionName[1] = "View Game";
  6928. menuActionID[1] = 998;
  6929. menuActionRow = 2;
  6930. } else if (super.mouseX >= 137 && super.mouseX <= 193) {
  6931. menuActionName[1] = "Hide public";
  6932. menuActionID[1] = 997;
  6933. menuActionName[2] = "Off public";
  6934. menuActionID[2] = 996;
  6935. menuActionName[3] = "Friends public";
  6936. menuActionID[3] = 995;
  6937. menuActionName[4] = "On public";
  6938. menuActionID[4] = 994;
  6939. menuActionName[5] = "View public";
  6940. menuActionID[5] = 993;
  6941. menuActionRow = 6;
  6942. } else if (super.mouseX >= 203 && super.mouseX <= 259) {
  6943. menuActionName[1] = "Off private";
  6944. menuActionID[1] = 992;
  6945. menuActionName[2] = "Friends private";
  6946. menuActionID[2] = 991;
  6947. menuActionName[3] = "On private";
  6948. menuActionID[3] = 990;
  6949. menuActionName[4] = "View private";
  6950. menuActionID[4] = 989;
  6951. menuActionRow = 5;
  6952. } else if (super.mouseX >= 269 && super.mouseX <= 325) {
  6953. menuActionName[1] = "Off clan chat";
  6954. menuActionID[1] = 1003;
  6955. menuActionName[2] = "Friends clan chat";
  6956. menuActionID[2] = 1002;
  6957. menuActionName[3] = "On clan chat";
  6958. menuActionID[3] = 1001;
  6959. menuActionName[4] = "View clan chat";
  6960. menuActionID[4] = 1000;
  6961. menuActionRow = 5;
  6962. } else if (super.mouseX >= 335 && super.mouseX <= 391) {
  6963. menuActionName[1] = "Off trade";
  6964. menuActionID[1] = 987;
  6965. menuActionName[2] = "Friends trade";
  6966. menuActionID[2] = 986;
  6967. menuActionName[3] = "On trade";
  6968. menuActionID[3] = 985;
  6969. menuActionName[4] = "View trade";
  6970. menuActionID[4] = 984;
  6971. menuActionRow = 5;
  6972. } else if (super.mouseX >= 404 && super.mouseX <= 515) {
  6973. menuActionName[1] = "Report Abuse";
  6974. menuActionID[1] = 606;
  6975. menuActionRow = 2;
  6976. }
  6977. }
  6978. }
  6979.  
  6980. public void processRightClick() {
  6981. if (activeInterfaceType != 0) {
  6982. return;
  6983. }
  6984. menuActionName[0] = "Cancel";
  6985. menuActionID[0] = 1107;
  6986. menuActionRow = 1;
  6987. if (showChatComponents) {
  6988. buildSplitPrivateChatMenu();
  6989. }
  6990. anInt886 = 0;
  6991. anInt1315 = 0;
  6992. if (frameMode == ScreenMode.FIXED) {
  6993. if (super.mouseX > 4 && super.mouseY > 4 && super.mouseX < 516 && super.mouseY < 338) {
  6994. if (openInterfaceID != -1) {
  6995. buildInterfaceMenu(4, RSInterface.interfaceCache[openInterfaceID], super.mouseX, 4, super.mouseY, 0);
  6996. } else {
  6997. build3dScreenMenu();
  6998. }
  6999. }
  7000. } else if (frameMode != ScreenMode.FIXED) {
  7001. if (getMousePositions()) {
  7002. int w = 512, h = 334;
  7003. int x = (frameWidth / 2) - 256, y = (frameHeight / 2) - 167;
  7004. int x2 = (frameWidth / 2) + 256, y2 = (frameHeight / 2) + 167;
  7005. int count = !changeTabArea ? 4 : 3;
  7006. if (frameMode != ScreenMode.FIXED) {
  7007. for (int i = 0; i < count; i++) {
  7008. if (x + w > (frameWidth - 225)) {
  7009. x = x - 30;
  7010. x2 = x2 - 30;
  7011. if (x < 0) {
  7012. x = 0;
  7013. }
  7014. }
  7015. if (y + h > (frameHeight - 182)) {
  7016. y = y - 30;
  7017. y2 = y2 - 30;
  7018. if (y < 0) {
  7019. y = 0;
  7020. }
  7021. }
  7022. }
  7023. }
  7024. if (openInterfaceID == 5292) {
  7025. if (super.mouseX > (frameWidth / 2) - 356 && super.mouseY > (frameHeight / 2) - 230 && super.mouseX < ((frameWidth / 2) + 356) && super.mouseY < (frameHeight / 2) + 230) {
  7026. buildInterfaceMenu((frameWidth / 2) - 356, RSInterface.interfaceCache[openInterfaceID], super.mouseX, (frameHeight / 2) - 230, super.mouseY, 0);
  7027. } else {
  7028. build3dScreenMenu();
  7029. }
  7030. } else if (openInterfaceID != -1 && openInterfaceID != 5292 && super.mouseX > x && super.mouseY > y && super.mouseX < x2 && super.mouseY < y2) {
  7031. buildInterfaceMenu(x, RSInterface.interfaceCache[openInterfaceID], super.mouseX, y, super.mouseY, 0);
  7032. } else {
  7033. build3dScreenMenu();
  7034. }
  7035. }
  7036. }
  7037. if (anInt886 != anInt1026) {
  7038. anInt1026 = anInt886;
  7039. }
  7040. if (anInt1315 != anInt1129) {
  7041. anInt1129 = anInt1315;
  7042. }
  7043. anInt886 = 0;
  7044. anInt1315 = 0;
  7045. if (!changeTabArea) {
  7046. final int yOffset = frameMode == ScreenMode.FIXED ? 0 : frameHeight - 503;
  7047. final int xOffset = frameMode == ScreenMode.FIXED ? 0 : frameWidth - 765;
  7048. if (super.mouseX > 548 + xOffset && super.mouseX < 740 + xOffset && super.mouseY > 207 + yOffset && super.mouseY < 468 + yOffset) {
  7049. if (invOverlayInterfaceID != -1) {
  7050. buildInterfaceMenu(548 + xOffset, RSInterface.interfaceCache[invOverlayInterfaceID], super.mouseX, 207 + yOffset, super.mouseY, 0);
  7051. } else if (tabInterfaceIDs[tabID] != -1) {
  7052. buildInterfaceMenu(548 + xOffset, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], super.mouseX, 207 + yOffset, super.mouseY, 0);
  7053. }
  7054. }
  7055. } else if (changeTabArea) {
  7056. final int yOffset = frameWidth >= 1000 ? 37 : 74;
  7057. if (super.mouseX > frameWidth - 197 && super.mouseY > frameHeight - yOffset - 267 && super.mouseX < frameWidth - 7 && super.mouseY < frameHeight - yOffset - 7 && showTabComponents) {
  7058. if (invOverlayInterfaceID != -1) {
  7059. buildInterfaceMenu(frameWidth - 197, RSInterface.interfaceCache[invOverlayInterfaceID], super.mouseX, frameHeight - yOffset - 267, super.mouseY, 0);
  7060. } else if (tabInterfaceIDs[tabID] != -1) {
  7061. buildInterfaceMenu(frameWidth - 197, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], super.mouseX, frameHeight - yOffset - 267, super.mouseY, 0);
  7062. }
  7063. }
  7064. }
  7065. if (anInt886 != anInt1048) {
  7066. tabAreaAltered = true;
  7067. anInt1048 = anInt886;
  7068. }
  7069. if (anInt1315 != anInt1044) {
  7070. tabAreaAltered = true;
  7071. anInt1044 = anInt1315;
  7072. }
  7073. anInt886 = 0;
  7074. anInt1315 = 0;
  7075. if (super.mouseX > 0 && super.mouseY > (frameMode == ScreenMode.FIXED ? 338 : frameHeight - (165 + extendChatArea)) && super.mouseX < 490 && super.mouseY < (frameMode == ScreenMode.FIXED ? 463 : frameHeight - 40) && showChatComponents) {
  7076. if (backDialogID != -1) {
  7077. buildInterfaceMenu(20, RSInterface.interfaceCache[backDialogID], super.mouseX, (frameMode == ScreenMode.FIXED ? 358 : frameHeight - 145), super.mouseY, 0);
  7078. } else if (super.mouseY < (frameMode == ScreenMode.FIXED ? 463 : frameHeight - 40) && super.mouseX < 490) {
  7079. buildChatAreaMenu(super.mouseY - (frameMode == ScreenMode.FIXED ? 338 : frameHeight - 165));
  7080. }
  7081. }
  7082. if (backDialogID != -1 && anInt886 != anInt1039) {
  7083. inputTaken = true;
  7084. anInt1039 = anInt886;
  7085. }
  7086. if (backDialogID != -1 && anInt1315 != anInt1500) {
  7087. inputTaken = true;
  7088. anInt1500 = anInt1315;
  7089. }
  7090. if (super.mouseX > 4 && super.mouseY > 480 && super.mouseX < 516 && super.mouseY < frameHeight) {
  7091. rightClickChatButtons();
  7092. }
  7093. processMinimapActions();
  7094. boolean flag = false;
  7095. while (!flag) {
  7096. flag = true;
  7097. for (int j = 0; j < menuActionRow - 1; j++) {
  7098. if (menuActionID[j] < 1000 && menuActionID[j + 1] > 1000) {
  7099. String s = menuActionName[j];
  7100. menuActionName[j] = menuActionName[j + 1];
  7101. menuActionName[j + 1] = s;
  7102. int k = menuActionID[j];
  7103. menuActionID[j] = menuActionID[j + 1];
  7104. menuActionID[j + 1] = k;
  7105. k = menuActionCmd2[j];
  7106. menuActionCmd2[j] = menuActionCmd2[j + 1];
  7107. menuActionCmd2[j + 1] = k;
  7108. k = menuActionCmd3[j];
  7109. menuActionCmd3[j] = menuActionCmd3[j + 1];
  7110. menuActionCmd3[j + 1] = k;
  7111. k = menuActionCmd1[j];
  7112. menuActionCmd1[j] = menuActionCmd1[j + 1];
  7113. menuActionCmd1[j + 1] = k;
  7114. flag = false;
  7115. }
  7116. }
  7117. }
  7118. }
  7119.  
  7120. private AccountData currentAccount;
  7121.  
  7122. public void login(String username, String password, boolean flag) {
  7123. Signlink.errorname = username;
  7124. try {
  7125. if (rememberMe && username != null && password != null) {
  7126. SettingHandler.save();
  7127. }
  7128. if (!flag) {
  7129. loginMessage1 = "";
  7130. loginMessage2 = "Connecting to server...";
  7131. loginRenderer.displayLoginScreen();
  7132. }
  7133. server = ClientConstants.SERVER_IPS[ClientConstants.worldSelected - 1];
  7134. socketStream = new RSSocket(this, openSocket(ClientConstants.SERVER_PORT + portOff));
  7135. long l = TextClass.longForName(username);
  7136. int i = (int) (l >> 16 & 31L);
  7137. stream.currentOffset = 0;
  7138. stream.writeWordBigEndian(14);
  7139. stream.writeWordBigEndian(i);
  7140. socketStream.queueBytes(2, stream.buffer);
  7141. for (int j = 0; j < 8; j++)
  7142. socketStream.read();
  7143.  
  7144. int k = socketStream.read();
  7145. int i1 = k;
  7146. if (k == 0) {
  7147. socketStream.flushInputStream(inStream.buffer, 8);
  7148. inStream.currentOffset = 0;
  7149. aLong1215 = inStream.readQWord();
  7150. int ai[] = new int[4];
  7151. ai[0] = (int) (Math.random() * 99999999D);
  7152. ai[1] = (int) (Math.random() * 99999999D);
  7153. ai[2] = (int) (aLong1215 >> 32);
  7154. ai[3] = (int) aLong1215;
  7155. stream.currentOffset = 0;
  7156. stream.writeWordBigEndian(100);
  7157. stream.writeDWord(ai[0]);
  7158. stream.writeDWord(ai[1]);
  7159. stream.writeDWord(ai[2]);
  7160. stream.writeDWord(ai[3]);
  7161. stream.writeString(String.valueOf(IdentityResolver.resolve()));
  7162. stream.writeString(username);
  7163. stream.writeString(password);
  7164. stream.doKeys();
  7165. aStream_847.currentOffset = 0;
  7166. if (flag)
  7167. aStream_847.writeWordBigEndian(18);
  7168. else
  7169. aStream_847.writeWordBigEndian(16);
  7170. aStream_847.writeWordBigEndian(stream.currentOffset + 36 + 1 + 1 + 2);
  7171. aStream_847.writeWordBigEndian(255);
  7172. aStream_847.writeWord(217 + ClientConstants.CLIENT_VERSION_INT);
  7173. aStream_847.writeWordBigEndian(lowMem ? 1 : 0);
  7174. for (int l1 = 0; l1 < 9; l1++)
  7175. aStream_847.writeDWord(expectedCRCs[l1]);
  7176.  
  7177. aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
  7178. stream.encryption = new ISAACRandomGen(ai);
  7179. for (int j2 = 0; j2 < 4; j2++)
  7180. ai[j2] += 50;
  7181.  
  7182. encryption = new ISAACRandomGen(ai);
  7183. socketStream.queueBytes(aStream_847.currentOffset, aStream_847.buffer);
  7184. k = socketStream.read();
  7185. }
  7186. if (k == 1) {
  7187. try {
  7188. Thread.sleep(2000L);
  7189. } catch (Exception _ex) {
  7190. }
  7191. login(username, password, flag);
  7192. return;
  7193. }
  7194. if (k == 2) {
  7195. myUsername = username;
  7196. myPassword = password;
  7197. myPrivilege = socketStream.read();
  7198. final AccountData account = new AccountData(myPrivilege, username, password);
  7199. if (rememberMe) {
  7200. AccountManager.addAccount(account);
  7201. }
  7202. currentAccount = AccountManager.getAccount(username);
  7203. if (currentAccount == null) {
  7204. currentAccount = account;
  7205. }
  7206. if (rememberMe) {
  7207. AccountManager.saveAccount();
  7208. }
  7209. flagged = socketStream.read() == 1;
  7210. aLong1220 = 0L;
  7211. anInt1022 = 0;
  7212. mouseDetection.coordsIndex = 0;
  7213. super.awtFocus = true;
  7214. aBoolean954 = true;
  7215. loggedIn = true;
  7216. stream.currentOffset = 0;
  7217. inStream.currentOffset = 0;
  7218. pktType = -1;
  7219. anInt841 = -1;
  7220. anInt842 = -1;
  7221. anInt843 = -1;
  7222. pktSize = 0;
  7223. anInt1009 = 0;
  7224. anInt1104 = 0;
  7225. anInt1011 = 0;
  7226. anInt855 = 0;
  7227. menuActionRow = 0;
  7228. menuOpen = false;
  7229. super.idleTime = 0;
  7230. for (int j1 = 0; j1 < 500; j1++)
  7231. chatMessages[j1] = null;
  7232. itemSelected = 0;
  7233. spellSelected = 0;
  7234. loadingStage = 0;
  7235. anInt1062 = 0;
  7236. setNorth();
  7237. anInt1021 = 0;
  7238. anInt985 = -1;
  7239. destX = 0;
  7240. destY = 0;
  7241. playerCount = 0;
  7242. npcCount = 0;
  7243. for (int i2 = 0; i2 < maxPlayers; i2++) {
  7244. playerArray[i2] = null;
  7245. aStreamArray895s[i2] = null;
  7246. }
  7247. for (int index = 0; index < 17; index++) {
  7248. console.inputConsoleMessages[index] = "";
  7249. }
  7250. for (int k2 = 0; k2 < 16384; k2++)
  7251. npcArray[k2] = null;
  7252. myPlayer = playerArray[myPlayerIndex] = new Player();
  7253. aClass19_1013.removeAll();
  7254. aClass19_1056.removeAll();
  7255. for (int l2 = 0; l2 < 4; l2++) {
  7256. for (int i3 = 0; i3 < 104; i3++) {
  7257. for (int k3 = 0; k3 < 104; k3++)
  7258. groundArray[l2][i3][k3] = null;
  7259. }
  7260. }
  7261. aClass19_1179 = new NodeList();
  7262. fullscreenInterfaceID = -1;
  7263. anInt900 = 0;
  7264. friendsCount = 0;
  7265. dialogID = -1;
  7266. backDialogID = -1;
  7267. openInterfaceID = -1;
  7268. invOverlayInterfaceID = -1;
  7269. anInt1018 = -1;
  7270. aBoolean1149 = false;
  7271. tabID = 3;
  7272. inputDialogState = 0;
  7273. menuOpen = false;
  7274. messagePromptRaised = false;
  7275. aString844 = null;
  7276. anInt1055 = 0;
  7277. anInt1054 = -1;
  7278. aBoolean1047 = true;
  7279. method45();
  7280. for (int j3 = 0; j3 < 5; j3++)
  7281. anIntArray990[j3] = 0;
  7282. for (int l3 = 0; l3 < 5; l3++) {
  7283. atPlayerActions[l3] = null;
  7284. atPlayerArray[l3] = false;
  7285. }
  7286. anInt1175 = 0;
  7287. anInt1134 = 0;
  7288. anInt986 = 0;
  7289. anInt1288 = 0;
  7290. anInt924 = 0;
  7291. anInt1188 = 0;
  7292. anInt1155 = 0;
  7293. anInt1226 = 0;
  7294. sendFrame36(429, 1);
  7295. resetImageProducers2();
  7296. setBounds();
  7297. return;
  7298. }
  7299. if (k == 3) {
  7300. loginMessage1 = "Invalid username or password.";
  7301. loginMessage2 = "Please try again.";
  7302. return;
  7303. }
  7304. if (k == 4) {
  7305. loginMessage1 = "Your account has been disabled.";
  7306. loginMessage2 = "Please check your message-center for details.";
  7307. return;
  7308. }
  7309. if (k == 5) {
  7310. loginMessage1 = "Your account is already logged in.";
  7311. loginMessage2 = "Try again in 60 secs...";
  7312. return;
  7313. }
  7314. if (k == 6) {
  7315. loginMessage1 = "Lunar Isle has been updated!";
  7316. loginMessage2 = "Please download the newest client.";
  7317. openURL("http://www.vencillio.com/downloads/Client.jar");
  7318. return;
  7319. }
  7320. if (k == 7) {
  7321. loginMessage1 = "This world is full.";
  7322. loginMessage2 = "Please use a different world.";
  7323. return;
  7324. }
  7325. if (k == 8) {
  7326. loginMessage1 = "Unable to connect.";
  7327. loginMessage2 = "Login server offline.";
  7328. return;
  7329. }
  7330. if (k == 9) {
  7331. loginMessage1 = "Login limit exceeded.";
  7332. loginMessage2 = "Too many connections from your address.";
  7333. return;
  7334. }
  7335. if (k == 10) {
  7336. loginMessage1 = "Unable to connect.";
  7337. loginMessage2 = "Bad session id.";
  7338. return;
  7339. }
  7340. if (k == 11) {
  7341. loginMessage1 = "Login server rejected session.";
  7342. loginMessage2 = "Please try again.";
  7343. return;
  7344. }
  7345. if (k == 12) {
  7346. loginMessage1 = "You need a members account to login to this world.";
  7347. loginMessage2 = "Please subscribe, or use a different world.";
  7348. return;
  7349. }
  7350. if (k == 13) {
  7351. loginMessage1 = "Could not complete login.";
  7352. loginMessage2 = "Please try using a different world.";
  7353. return;
  7354. }
  7355. if (k == 14) {
  7356. loginMessage1 = "The server is being updated.";
  7357. loginMessage2 = "Please wait 1 minute and try again.";
  7358. return;
  7359. }
  7360. if (k == 15) {
  7361. loggedIn = true;
  7362. stream.currentOffset = 0;
  7363. inStream.currentOffset = 0;
  7364. pktType = -1;
  7365. anInt841 = -1;
  7366. anInt842 = -1;
  7367. anInt843 = -1;
  7368. pktSize = 0;
  7369. anInt1009 = 0;
  7370. anInt1104 = 0;
  7371. menuActionRow = 0;
  7372. menuOpen = false;
  7373. aLong824 = System.currentTimeMillis();
  7374. return;
  7375. }
  7376. if (k == 16) {
  7377. loginMessage1 = "Login attempts exceeded.";
  7378. loginMessage2 = "Please wait 1 minute and try again.";
  7379. return;
  7380. }
  7381. if (k == 17) {
  7382. loginMessage1 = "You are standing in a members-only area.";
  7383. loginMessage2 = "To play on this world move to a free area first";
  7384. return;
  7385. }
  7386. if (k == 20) {
  7387. loginMessage1 = "Invalid loginserver requested";
  7388. loginMessage2 = "Please try using a different world.";
  7389. return;
  7390. }
  7391. if (k == 21) {
  7392. for (int k1 = socketStream.read(); k1 >= 0; k1--) {
  7393. loginMessage1 = "You have only just left another world";
  7394. loginMessage2 = "Your profile will be transferred in: " + k1 + " seconds";
  7395. loginRenderer.displayLoginScreen();
  7396. try {
  7397. Thread.sleep(1000L);
  7398. } catch (Exception _ex) {
  7399. }
  7400. }
  7401. login(username, password, flag);
  7402. return;
  7403. }
  7404. if (k == 22) {
  7405. loginMessage1 = "The username '" + TextClass.capitalize(myUsername) + "' is restricted!";
  7406. loginMessage2 = "Please use a different one.";
  7407. return;
  7408. }
  7409. if (k == 23) {
  7410. loginMessage1 = "You do not have permission to do this!";
  7411. loginMessage2 = "Please try a different world.";
  7412. return;
  7413. }
  7414. if (k == -1) {
  7415. if (i1 == 0) {
  7416. if (loginFailures < 2) {
  7417. try {
  7418. Thread.sleep(2000L);
  7419. } catch (Exception _ex) {
  7420. }
  7421. loginFailures++;
  7422. login(username, password, flag);
  7423. return;
  7424. } else {
  7425. loginMessage1 = "No response from loginserver";
  7426. loginMessage2 = "Please wait 1 minute and try again.";
  7427. return;
  7428. }
  7429. } else {
  7430. loginMessage1 = "No response from server";
  7431. loginMessage2 = "Please try using a different world.";
  7432. return;
  7433. }
  7434. } else {
  7435. System.out.println("response:" + k);
  7436. loginMessage1 = "Unexpected server response";
  7437. loginMessage2 = "Please try using a different world.";
  7438. return;
  7439. }
  7440. } catch (IOException _ex) {
  7441. loginMessage1 = "";
  7442. }
  7443. loginMessage2 = "Error connecting to server.";
  7444. }
  7445.  
  7446. private boolean doWalkTo(int i, int j, int k, int i1, int j1, int k1, int l1, int i2, int j2, boolean flag, int k2) {
  7447. byte byte0 = 104;
  7448. byte byte1 = 104;
  7449. for (int l2 = 0; l2 < byte0; l2++) {
  7450. for (int i3 = 0; i3 < byte1; i3++) {
  7451. anIntArrayArray901[l2][i3] = 0;
  7452. anIntArrayArray825[l2][i3] = 0x5f5e0ff;
  7453. }
  7454. }
  7455. int j3 = j2;
  7456. int k3 = j1;
  7457. anIntArrayArray901[j2][j1] = 99;
  7458. anIntArrayArray825[j2][j1] = 0;
  7459. int l3 = 0;
  7460. int i4 = 0;
  7461. bigX[l3] = j2;
  7462. bigY[l3++] = j1;
  7463. boolean flag1 = false;
  7464. int j4 = bigX.length;
  7465. int ai[][] = aClass11Array1230[plane].anIntArrayArray294;
  7466. while (i4 != l3) {
  7467. j3 = bigX[i4];
  7468. k3 = bigY[i4];
  7469. i4 = (i4 + 1) % j4;
  7470. if (j3 == k2 && k3 == i2) {
  7471. flag1 = true;
  7472. break;
  7473. }
  7474. if (i1 != 0) {
  7475. if ((i1 < 5 || i1 == 10) && aClass11Array1230[plane].method219(k2, j3, k3, j, i1 - 1, i2)) {
  7476. flag1 = true;
  7477. break;
  7478. }
  7479. if (i1 < 10 && aClass11Array1230[plane].method220(k2, i2, k3, i1 - 1, j, j3)) {
  7480. flag1 = true;
  7481. break;
  7482. }
  7483. }
  7484. if (k1 != 0 && k != 0 && aClass11Array1230[plane].method221(i2, k2, j3, k, l1, k1, k3)) {
  7485. flag1 = true;
  7486. break;
  7487. }
  7488. int l4 = anIntArrayArray825[j3][k3] + 1;
  7489. if (j3 > 0 && anIntArrayArray901[j3 - 1][k3] == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0) {
  7490. bigX[l3] = j3 - 1;
  7491. bigY[l3] = k3;
  7492. l3 = (l3 + 1) % j4;
  7493. anIntArrayArray901[j3 - 1][k3] = 2;
  7494. anIntArrayArray825[j3 - 1][k3] = l4;
  7495. }
  7496. if (j3 < byte0 - 1 && anIntArrayArray901[j3 + 1][k3] == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0) {
  7497. bigX[l3] = j3 + 1;
  7498. bigY[l3] = k3;
  7499. l3 = (l3 + 1) % j4;
  7500. anIntArrayArray901[j3 + 1][k3] = 8;
  7501. anIntArrayArray825[j3 + 1][k3] = l4;
  7502. }
  7503. if (k3 > 0 && anIntArrayArray901[j3][k3 - 1] == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  7504. bigX[l3] = j3;
  7505. bigY[l3] = k3 - 1;
  7506. l3 = (l3 + 1) % j4;
  7507. anIntArrayArray901[j3][k3 - 1] = 1;
  7508. anIntArrayArray825[j3][k3 - 1] = l4;
  7509. }
  7510. if (k3 < byte1 - 1 && anIntArrayArray901[j3][k3 + 1] == 0 && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  7511. bigX[l3] = j3;
  7512. bigY[l3] = k3 + 1;
  7513. l3 = (l3 + 1) % j4;
  7514. anIntArrayArray901[j3][k3 + 1] = 4;
  7515. anIntArrayArray825[j3][k3 + 1] = l4;
  7516. }
  7517. 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) {
  7518. bigX[l3] = j3 - 1;
  7519. bigY[l3] = k3 - 1;
  7520. l3 = (l3 + 1) % j4;
  7521. anIntArrayArray901[j3 - 1][k3 - 1] = 3;
  7522. anIntArrayArray825[j3 - 1][k3 - 1] = l4;
  7523. }
  7524. 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) {
  7525. bigX[l3] = j3 + 1;
  7526. bigY[l3] = k3 - 1;
  7527. l3 = (l3 + 1) % j4;
  7528. anIntArrayArray901[j3 + 1][k3 - 1] = 9;
  7529. anIntArrayArray825[j3 + 1][k3 - 1] = l4;
  7530. }
  7531. 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) {
  7532. bigX[l3] = j3 - 1;
  7533. bigY[l3] = k3 + 1;
  7534. l3 = (l3 + 1) % j4;
  7535. anIntArrayArray901[j3 - 1][k3 + 1] = 6;
  7536. anIntArrayArray825[j3 - 1][k3 + 1] = l4;
  7537. }
  7538. 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) {
  7539. bigX[l3] = j3 + 1;
  7540. bigY[l3] = k3 + 1;
  7541. l3 = (l3 + 1) % j4;
  7542. anIntArrayArray901[j3 + 1][k3 + 1] = 12;
  7543. anIntArrayArray825[j3 + 1][k3 + 1] = l4;
  7544. }
  7545. }
  7546. anInt1264 = 0;
  7547. if (!flag1) {
  7548. if (flag) {
  7549. int i5 = 100;
  7550. for (int k5 = 1; k5 < 2; k5++) {
  7551. for (int i6 = k2 - k5; i6 <= k2 + k5; i6++) {
  7552. for (int l6 = i2 - k5; l6 <= i2 + k5; l6++) {
  7553. if (i6 >= 0 && l6 >= 0 && i6 < 104 && l6 < 104 && anIntArrayArray825[i6][l6] < i5) {
  7554. i5 = anIntArrayArray825[i6][l6];
  7555. j3 = i6;
  7556. k3 = l6;
  7557. anInt1264 = 1;
  7558. flag1 = true;
  7559. }
  7560. }
  7561. }
  7562. if (flag1)
  7563. break;
  7564. }
  7565. }
  7566. if (!flag1)
  7567. return false;
  7568. }
  7569. i4 = 0;
  7570. bigX[i4] = j3;
  7571. bigY[i4++] = k3;
  7572. int l5;
  7573. for (int j5 = l5 = anIntArrayArray901[j3][k3]; j3 != j2 || k3 != j1; j5 = anIntArrayArray901[j3][k3]) {
  7574. if (j5 != l5) {
  7575. l5 = j5;
  7576. bigX[i4] = j3;
  7577. bigY[i4++] = k3;
  7578. }
  7579. if ((j5 & 2) != 0)
  7580. j3++;
  7581. else if ((j5 & 8) != 0)
  7582. j3--;
  7583. if ((j5 & 1) != 0)
  7584. k3++;
  7585. else if ((j5 & 4) != 0)
  7586. k3--;
  7587. }
  7588. if (i4 > 0) {
  7589. int k4 = i4;
  7590. if (k4 > 25)
  7591. k4 = 25;
  7592. i4--;
  7593. int k6 = bigX[i4];
  7594. int i7 = bigY[i4];
  7595. anInt1288 += k4;
  7596. if (anInt1288 >= 92) {
  7597. stream.createFrame(36);
  7598. stream.writeDWord(0);
  7599. anInt1288 = 0;
  7600. }
  7601. if (i == 0) {
  7602. stream.createFrame(164);
  7603. stream.writeWordBigEndian(k4 + k4 + 3);
  7604. }
  7605. if (i == 1) {
  7606. stream.createFrame(248);
  7607. stream.writeWordBigEndian(k4 + k4 + 3 + 14);
  7608. }
  7609. if (i == 2) {
  7610. stream.createFrame(98);
  7611. stream.writeWordBigEndian(k4 + k4 + 3);
  7612. }
  7613. stream.method433(k6 + baseX);
  7614. destX = bigX[0];
  7615. destY = bigY[0];
  7616. for (int j7 = 1; j7 < k4; j7++) {
  7617. i4--;
  7618. stream.writeWordBigEndian(bigX[i4] - k6);
  7619. stream.writeWordBigEndian(bigY[i4] - i7);
  7620. }
  7621. stream.method431(i7 + baseY);
  7622. stream.method424(super.keyArray[5] != 1 ? 0 : 1);
  7623. return true;
  7624. }
  7625. return i != 1;
  7626. }
  7627.  
  7628. private void method86(Stream stream) {
  7629. for (int j = 0; j < anInt893; j++) {
  7630. int k = anIntArray894[j];
  7631. Npc npc = npcArray[k];
  7632. int l = stream.readUnsignedByte();
  7633. if ((l & 0x10) != 0) {
  7634. int i1 = stream.method434();
  7635. if (i1 == 65535)
  7636. i1 = -1;
  7637. int i2 = stream.readUnsignedByte();
  7638. if (i1 == npc.anim && i1 != -1) {
  7639. int l2 = Animation.anims[i1].anInt365;
  7640. if (l2 == 1) {
  7641. npc.anInt1527 = 0;
  7642. npc.anInt1528 = 0;
  7643. npc.anInt1529 = i2;
  7644. npc.anInt1530 = 0;
  7645. }
  7646. if (l2 == 2)
  7647. npc.anInt1530 = 0;
  7648. } else if (i1 == -1 || npc.anim == -1 || Animation.anims[i1].anInt359 >= Animation.anims[npc.anim].anInt359) {
  7649. npc.anim = i1;
  7650. npc.anInt1527 = 0;
  7651. npc.anInt1528 = 0;
  7652. npc.anInt1529 = i2;
  7653. npc.anInt1530 = 0;
  7654. npc.anInt1542 = npc.smallXYIndex;
  7655. }
  7656. }
  7657. if ((l & 8) != 0) {
  7658. int j1 = stream.method426();
  7659. int j2 = stream.method427();
  7660. int icon = stream.readUnsignedByte();
  7661. npc.updateHitData(j2, j1, loopCycle, icon);
  7662. npc.loopCycleStatus = loopCycle + 300;
  7663. npc.currentHealth = stream.method426();
  7664. npc.maxHealth = stream.readUnsignedByte();
  7665. }
  7666. if ((l & 0x80) != 0) {
  7667. npc.anInt1520 = stream.readUnsignedWord();
  7668. int k1 = stream.readDWord();
  7669. npc.anInt1524 = k1 >> 16;
  7670. npc.anInt1523 = loopCycle + (k1 & 0xffff);
  7671. npc.anInt1521 = 0;
  7672. npc.anInt1522 = 0;
  7673. if (npc.anInt1523 > loopCycle)
  7674. npc.anInt1521 = -1;
  7675. if (npc.anInt1520 == 65535)
  7676. npc.anInt1520 = -1;
  7677. }
  7678. if ((l & 0x20) != 0) {
  7679. npc.interactingEntity = stream.readUnsignedWord();
  7680. if (npc.interactingEntity == 65535)
  7681. npc.interactingEntity = -1;
  7682. }
  7683. if ((l & 1) != 0) {
  7684. npc.textSpoken = stream.readString();
  7685. npc.textCycle = 100;
  7686. }
  7687. if ((l & 0x40) != 0) {
  7688. int l1 = stream.method427();
  7689. int k2 = stream.method428();
  7690. int icon = stream.readUnsignedByte();
  7691. npc.updateHitData(k2, l1, loopCycle, icon);
  7692. npc.loopCycleStatus = loopCycle + 300;
  7693. npc.currentHealth = stream.method428();
  7694. npc.maxHealth = stream.method427();
  7695. }
  7696. if ((l & 2) != 0) {
  7697. npc.desc = EntityDef.forID(stream.method436());
  7698. npc.anInt1540 = npc.desc.aByte68;
  7699. npc.anInt1504 = npc.desc.anInt79;
  7700. npc.anInt1554 = npc.desc.walkAnim;
  7701. npc.anInt1555 = npc.desc.anInt58;
  7702. npc.anInt1556 = npc.desc.anInt83;
  7703. npc.anInt1557 = npc.desc.anInt55;
  7704. npc.anInt1511 = npc.desc.standAnim;
  7705. }
  7706. if ((l & 4) != 0) {
  7707. npc.anInt1538 = stream.method434();
  7708. npc.anInt1539 = stream.method434();
  7709. }
  7710. }
  7711. }
  7712.  
  7713. private void buildAtNPCMenu(EntityDef entityDef, int i, int j, int k) {
  7714. if (menuActionRow >= 400)
  7715. return;
  7716. if (entityDef.childrenIDs != null)
  7717. entityDef = entityDef.method161();
  7718. if (entityDef == null)
  7719. return;
  7720. if (!entityDef.aBoolean84)
  7721. return;
  7722. String s = entityDef.name;
  7723. if (entityDef.combatLevel != 0)
  7724. s = s + combatDiffColor(myPlayer.combatLevel, entityDef.combatLevel) + " (level-" + entityDef.combatLevel + ")";
  7725. if (itemSelected == 1) {
  7726. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @yel@" + s;
  7727. menuActionID[menuActionRow] = 582;
  7728. menuActionCmd1[menuActionRow] = i;
  7729. menuActionCmd2[menuActionRow] = k;
  7730. menuActionCmd3[menuActionRow] = j;
  7731. menuActionRow++;
  7732. return;
  7733. }
  7734. if (spellSelected == 1) {
  7735. if ((spellUsableOn & 2) == 2) {
  7736. menuActionName[menuActionRow] = spellTooltip + " @yel@" + s;
  7737. menuActionID[menuActionRow] = 413;
  7738. menuActionCmd1[menuActionRow] = i;
  7739. menuActionCmd2[menuActionRow] = k;
  7740. menuActionCmd3[menuActionRow] = j;
  7741. menuActionRow++;
  7742. }
  7743. } else {
  7744. if (entityDef.actions != null) {
  7745. for (int l = 4; l >= 0; l--)
  7746. if (entityDef.actions[l] != null && !entityDef.actions[l].equalsIgnoreCase("attack")) {
  7747. menuActionName[menuActionRow] = entityDef.actions[l] + " @yel@" + s;
  7748. if (l == 0)
  7749. menuActionID[menuActionRow] = 20;
  7750. if (l == 1)
  7751. menuActionID[menuActionRow] = 412;
  7752. if (l == 2)
  7753. menuActionID[menuActionRow] = 225;
  7754. if (l == 3)
  7755. menuActionID[menuActionRow] = 965;
  7756. if (l == 4)
  7757. menuActionID[menuActionRow] = 478;
  7758. menuActionCmd1[menuActionRow] = i;
  7759. menuActionCmd2[menuActionRow] = k;
  7760. menuActionCmd3[menuActionRow] = j;
  7761. menuActionRow++;
  7762. }
  7763.  
  7764. }
  7765. if (entityDef.actions != null) {
  7766. for (int i1 = 4; i1 >= 0; i1--)
  7767. if (entityDef.actions[i1] != null && entityDef.actions[i1].equalsIgnoreCase("attack")) {
  7768. char c = '\0';
  7769. if (Configuration.entityAttackPriority && entityDef.combatLevel > myPlayer.combatLevel) {
  7770. c = '\u07D0';
  7771. }
  7772. menuActionName[menuActionRow] = entityDef.actions[i1] + " @yel@" + s;
  7773. if (i1 == 0)
  7774. menuActionID[menuActionRow] = 20 + c;
  7775. if (i1 == 1)
  7776. menuActionID[menuActionRow] = 412 + c;
  7777. if (i1 == 2)
  7778. menuActionID[menuActionRow] = 225 + c;
  7779. if (i1 == 3)
  7780. menuActionID[menuActionRow] = 965 + c;
  7781. if (i1 == 4)
  7782. menuActionID[menuActionRow] = 478 + c;
  7783. menuActionCmd1[menuActionRow] = i;
  7784. menuActionCmd2[menuActionRow] = k;
  7785. menuActionCmd3[menuActionRow] = j;
  7786. menuActionRow++;
  7787. }
  7788.  
  7789. }
  7790. if (ClientConstants.DEBUG_MODE) {
  7791. menuActionName[menuActionRow] = "Examine @yel@" + s + "@whi@(ID: @yel@" + entityDef.interfaceType + "@whi@)";
  7792. } else {
  7793. menuActionName[menuActionRow] = "Examine @yel@" + s;
  7794. }
  7795. menuActionID[menuActionRow] = 1025;
  7796. menuActionCmd1[menuActionRow] = i;
  7797. menuActionCmd2[menuActionRow] = k;
  7798. menuActionCmd3[menuActionRow] = j;
  7799. menuActionRow++;
  7800. }
  7801. }
  7802.  
  7803. private void buildAtPlayerMenu(int i, int j, Player player, int k) {
  7804. if (player == myPlayer)
  7805. return;
  7806. if (menuActionRow >= 400)
  7807. return;
  7808. String s;
  7809. String title = player.title.length() > 0 ? (player.titlePrefix ? " " : "") + "<col=" + player.titleColor + ">" + player.title + "</col>" + (player.titlePrefix ? "" : " ") : "";
  7810. if (player.skill == 0) {
  7811. if (!player.titlePrefix) {
  7812. s = title + "<col=ffffff>" + player.name + "</col>" + combatDiffColor(myPlayer.combatLevel, player.combatLevel) + " (level-" + player.combatLevel + ")";
  7813. } else {
  7814. s = "</col>" + player.name + combatDiffColor(myPlayer.combatLevel, player.combatLevel) + title + " (level-" + player.combatLevel + ")";
  7815. }
  7816. } else {
  7817. if (!player.titlePrefix) {
  7818. s = title + player.name + " (skill-" + player.skill + ")";
  7819. } else {
  7820. s = player.name + title + " (skill-" + player.skill + ")";
  7821. }
  7822. }
  7823. if (itemSelected == 1) {
  7824. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @whi@" + s;
  7825. menuActionID[menuActionRow] = 491;
  7826. menuActionCmd1[menuActionRow] = j;
  7827. menuActionCmd2[menuActionRow] = i;
  7828. menuActionCmd3[menuActionRow] = k;
  7829. menuActionRow++;
  7830. } else if (spellSelected == 1) {
  7831. if ((spellUsableOn & 8) == 8) {
  7832. menuActionName[menuActionRow] = spellTooltip + " @whi@" + s;
  7833. menuActionID[menuActionRow] = 365;
  7834. menuActionCmd1[menuActionRow] = j;
  7835. menuActionCmd2[menuActionRow] = i;
  7836. menuActionCmd3[menuActionRow] = k;
  7837. menuActionRow++;
  7838. }
  7839. } else {
  7840. for (int l = 4; l >= 0; l--)
  7841. if (atPlayerActions[l] != null) {
  7842. menuActionName[menuActionRow] = atPlayerActions[l] + " @whi@" + s;
  7843. char c = '\0';
  7844. if (atPlayerActions[l].equalsIgnoreCase("attack")) {
  7845. if (Configuration.entityAttackPriority && player.combatLevel > myPlayer.combatLevel)
  7846. c = '\u07D0';
  7847. if (myPlayer.team != 0 && player.team != 0)
  7848. if (myPlayer.team == player.team)
  7849. c = '\u07D0';
  7850. else
  7851. c = '\0';
  7852. } else if (atPlayerArray[l])
  7853. c = '\u07D0';
  7854. if (l == 0)
  7855. menuActionID[menuActionRow] = 561 + c;
  7856. if (l == 1)
  7857. menuActionID[menuActionRow] = 779 + c;
  7858. if (l == 2)
  7859. menuActionID[menuActionRow] = 27 + c;
  7860. if (l == 3)
  7861. menuActionID[menuActionRow] = 577 + c;
  7862. if (l == 4)
  7863. menuActionID[menuActionRow] = 729 + c;
  7864. menuActionCmd1[menuActionRow] = j;
  7865. menuActionCmd2[menuActionRow] = i;
  7866. menuActionCmd3[menuActionRow] = k;
  7867. menuActionRow++;
  7868. }
  7869.  
  7870. }
  7871. for (int i1 = 0; i1 < menuActionRow; i1++) {
  7872. if (menuActionID[i1] == 519) {
  7873. menuActionName[i1] = "Walk here @whi@" + s;
  7874. return;
  7875. }
  7876. }
  7877. }
  7878.  
  7879. private void method89(Class30_Sub1 class30_sub1) {
  7880. int i = 0;
  7881. int j = -1;
  7882. int k = 0;
  7883. int l = 0;
  7884. if (class30_sub1.anInt1296 == 0)
  7885. i = worldController.method300(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7886. if (class30_sub1.anInt1296 == 1)
  7887. i = worldController.method301(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7888. if (class30_sub1.anInt1296 == 2)
  7889. i = worldController.method302(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7890. if (class30_sub1.anInt1296 == 3)
  7891. i = worldController.method303(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7892. if (i != 0) {
  7893. int i1 = worldController.method304(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298, i);
  7894. j = i >> 14 & 0x7fff;
  7895. k = i1 & 0x1f;
  7896. l = i1 >> 6;
  7897. }
  7898. class30_sub1.anInt1299 = j;
  7899. class30_sub1.anInt1301 = k;
  7900. class30_sub1.anInt1300 = l;
  7901. }
  7902.  
  7903. void startUp() {
  7904. rebuildFrameSize(frameMode, frameWidth, frameHeight);
  7905. //new CacheDownloader(this).run();
  7906. new CacheDownloader(this).downloadCache();
  7907.  
  7908. SpriteLoader.loadSprites();
  7909. cacheSprite = SpriteLoader.sprites;
  7910. loginRenderer = new LoginRenderer(this);
  7911. drawSmoothLoading(50, "Starting up");
  7912. if (Signlink.cache_dat != null) {
  7913. for (int i = 0; i < 5; i++)
  7914. decompressors[i] = new Decompressor(Signlink.cache_dat, Signlink.cache_idx[i], i + 1);
  7915. }
  7916. try {
  7917. titleStreamLoader = streamLoaderForName(1, "title screen", "title", expectedCRCs[1], 25);
  7918. smallText = new TextDrawingArea(false, "p11_full", titleStreamLoader);
  7919. regularText = new TextDrawingArea(false, "p12_full", titleStreamLoader);
  7920. boldText = new TextDrawingArea(false, "b12_full", titleStreamLoader);
  7921. newSmallFont = new RSFont(false, "p11_full", titleStreamLoader);
  7922. newRegularFont = new RSFont(false, "p12_full", titleStreamLoader);
  7923. newBoldFont = new RSFont(false, "b12_full", titleStreamLoader);
  7924. newFancyFont = new RSFont(true, "q8_full", titleStreamLoader);
  7925. loadTitleScreen();
  7926. TextDrawingArea aTextDrawingArea_1273 = new TextDrawingArea(true, "q8_full", titleStreamLoader);
  7927. StreamLoader streamLoader = streamLoaderForName(2, "config", "config", expectedCRCs[2], 30);
  7928. StreamLoader streamLoader_1 = streamLoaderForName(3, "interface", "interface", expectedCRCs[3], 35);
  7929. StreamLoader streamLoader_2 = streamLoaderForName(4, "2d graphics", "media", expectedCRCs[4], 40);
  7930. this.mediaStreamLoader = streamLoader_2;
  7931. StreamLoader streamLoader_3 = streamLoaderForName(6, "textures", "textures", expectedCRCs[6], 45);
  7932. StreamLoader streamLoader_4 = streamLoaderForName(7, "chat system", "wordenc", expectedCRCs[7], 50);
  7933. streamLoaderForName(8, "sound effects", "sounds", expectedCRCs[8], 55);
  7934. byteGroundArray = new byte[4][104][104];
  7935. intGroundArray = new int[4][105][105];
  7936. worldController = new WorldController(intGroundArray);
  7937. for (int j = 0; j < 4; j++)
  7938. aClass11Array1230[j] = new Class11();
  7939.  
  7940. minimapImage = new Sprite(512, 512);
  7941. StreamLoader streamLoader_6 = streamLoaderForName(5, "update list", "versionlist", expectedCRCs[5], 60);
  7942. drawSmoothLoading(100, "Connecting to update server");
  7943. onDemandFetcher = new OnDemandFetcher();
  7944. onDemandFetcher.start(streamLoader_6, this);
  7945. SequenceFrame.animationlist = new SequenceFrame[2500][0];
  7946. Model.method459(onDemandFetcher.getModelCount(), onDemandFetcher);
  7947. repackCacheIndex(1);
  7948. drawSmoothLoading(175, "Unpacking media");
  7949. Sprite[] clanIcons = new Sprite[10];
  7950. for (int index = 0; index < newHitMarks.length; index++) {
  7951. newHitMarks[index] = new Sprite(streamLoader_2, "newhitmarks", index);
  7952. }
  7953. for (int index = 0; index < channelButtons.length; index++) {
  7954. channelButtons[index] = new Sprite(streamLoader_2, "cbuttons", index);
  7955. }
  7956. for (int index = 0; index < fixedGameComponents.length; index++) {
  7957. fixedGameComponents[index] = new Sprite(streamLoader_2, "fixed", index);
  7958. }
  7959. for (int index = 0; index < skillIcons.length; index++) {
  7960. skillIcons[index] = new Sprite(streamLoader_2, "skillicons", index);
  7961. }
  7962. for (int index = 0; index < gameComponents.length; index++) {
  7963. gameComponents[index] = new Sprite(streamLoader_2, "fullscreen", index);
  7964. }
  7965. for (int index = 0; index < orbComponents.length; index++) {
  7966. orbComponents[index] = new Sprite(streamLoader_2, "orbs3", index);
  7967. }
  7968. for (int index = 0; index < orbComponents2.length; index++) {
  7969. orbComponents2[index] = new Sprite(streamLoader_2, "orbs4", index);
  7970. }
  7971. for (int index = 0; index < orbComponents3.length; index++) {
  7972. orbComponents3[index] = new Sprite(streamLoader_2, "orbs5", index);
  7973. }
  7974. for (int index = 0; index < redStones.length; index++) {
  7975. redStones[index] = new Sprite(streamLoader_2, "redstone1", index);
  7976. }
  7977. for (int index = 0; index < hpBars.length; index++) {
  7978. hpBars[index] = new Sprite(streamLoader_2, "hpbars", index);
  7979. }
  7980. for (int index = 0; index < clanIcons.length; index++) {
  7981. clanIcons[index] = new Sprite(streamLoader_2, "clanicons", index);
  7982. }
  7983. for (int index = 0; index < currencies; index++) {
  7984. currencyImage[index] = cacheSprite[407 + index];
  7985. }
  7986. newSmallFont.unpackImages(modIcons, clanIcons);
  7987. newRegularFont.unpackImages(modIcons, clanIcons);
  7988. newBoldFont.unpackImages(modIcons, clanIcons);
  7989. newFancyFont.unpackImages(modIcons, clanIcons);
  7990. mapIcon = new Sprite(mediaStreamLoader, "mapfunction", 0); //General store
  7991. mapIcon1 = new Sprite(mediaStreamLoader, "mapfunction", 5); //Bank
  7992. OSRSData.load();
  7993. multiOverlay = new Sprite(streamLoader_2, "overlay_multiway", 0);
  7994. mapBack = new Background(streamLoader_2, "mapback", 0);
  7995. for (int j3 = 0; j3 <= 16; j3++) {
  7996. sideIcons[j3] = new Sprite(streamLoader_2, "sideicons", j3);
  7997. }
  7998.  
  7999. for (int i4 = 475; i4 <= 483; i4++) {
  8000. hitMark[i4 - 475] = cacheSprite[i4];
  8001. }
  8002.  
  8003. for (int i4 = 484; i4 <= 489; i4++) {
  8004. hitIcon[i4 - 484] = cacheSprite[i4];
  8005. }
  8006. compass = new Sprite(streamLoader_2, "compass", 0);
  8007. try {
  8008. for (int k3 = 0; k3 < 100; k3++)
  8009. mapScenes[k3] = new Background(streamLoader_2, "mapscene", k3);
  8010. } catch (Exception _ex) {
  8011. }
  8012. try {
  8013. for (int l3 = 0; l3 < 100; l3++)
  8014. mapFunctions[l3] = new Sprite(streamLoader_2, "mapfunction", l3);
  8015. } catch (Exception _ex) {
  8016. }
  8017. try {
  8018. for (int i4 = 0; i4 < 20; i4++)
  8019. hitMarks[i4] = new Sprite(streamLoader_2, "hitmarks", i4);
  8020. } catch (Exception _ex) {
  8021. }
  8022. try {
  8023. for (int h1 = 0; h1 < 6; h1++)
  8024. headIconsHint[h1] = new Sprite(streamLoader_2, "headicons_hint", h1);
  8025. } catch (Exception _ex) {
  8026. }
  8027. try {
  8028. for (int j4 = 0; j4 < 8; j4++)
  8029. headIcons[j4] = new Sprite(streamLoader_2, "headicons_prayer", j4);
  8030. for (int j45 = 0; j45 < 3; j45++)
  8031. skullIcons[j45] = new Sprite(streamLoader_2, "headicons_pk", j45);
  8032. } catch (Exception _ex) {
  8033. }
  8034. mapFlag = new Sprite(streamLoader_2, "mapmarker", 0);
  8035. mapMarker = new Sprite(streamLoader_2, "mapmarker", 1);
  8036. for (int k4 = 0; k4 < 8; k4++)
  8037. crosses[k4] = new Sprite(streamLoader_2, "cross", k4);
  8038. mapDotItem = new Sprite(streamLoader_2, "mapdots", 0);
  8039. mapDotNPC = new Sprite(streamLoader_2, "mapdots", 1);
  8040. mapDotPlayer = new Sprite(streamLoader_2, "mapdots", 2);
  8041. mapDotFriend = new Sprite(streamLoader_2, "mapdots", 3);
  8042. mapDotTeam = new Sprite(streamLoader_2, "mapdots", 4);
  8043. mapDotClan = new Sprite(streamLoader_2, "mapdots", 5);
  8044. scrollBar1 = new Sprite(streamLoader_2, "scrollbar", 0);
  8045. scrollBar2 = new Sprite(streamLoader_2, "scrollbar", 1);
  8046. try {
  8047. for (int l4 = 0; l4 < ClientConstants.ICON_AMOUNT; l4++) {
  8048. modIcons[l4] = new Sprite(streamLoader_2, "mod_icons", l4);
  8049. }
  8050. } catch (Exception e) {
  8051. }
  8052. Sprite sprite = new Sprite(streamLoader_2, "screenframe", 0);
  8053. leftFrame = new ImageProducer(sprite.myWidth, sprite.myHeight);
  8054. sprite.method346(0, 0);
  8055. sprite = new Sprite(streamLoader_2, "screenframe", 1);
  8056. topFrame = new ImageProducer(sprite.myWidth, sprite.myHeight);
  8057. sprite.method346(0, 0);
  8058. int i5 = (int) (Math.random() * 21D) - 10;
  8059. int j5 = (int) (Math.random() * 21D) - 10;
  8060. int k5 = (int) (Math.random() * 21D) - 10;
  8061. int l5 = (int) (Math.random() * 41D) - 20;
  8062. for (int i6 = 0; i6 < 100; i6++) {
  8063. if (mapFunctions[i6] != null)
  8064. mapFunctions[i6].method344(i5 + l5, j5 + l5, k5 + l5);
  8065. if (mapScenes[i6] != null)
  8066. mapScenes[i6].method360(i5 + l5, j5 + l5, k5 + l5);
  8067. }
  8068. drawSmoothLoading(275, "Unpacking textures");
  8069. Rasterizer.method368(streamLoader_3);
  8070. Rasterizer.method372(0.80000000000000004D);
  8071. Rasterizer.method367();
  8072. //ken code, uncommted from http://prntscr.com/blkovl
  8073. //drawSmoothLoading(325, "Unpacking config");
  8074. Animation.unpackConfig(streamLoader);
  8075. ObjectDef.unpackConfig(streamLoader);
  8076. Floor.unpackConfig(streamLoader);
  8077. OverlayFloor.unpackConfig(streamLoader);
  8078. ItemDef.unpackConfig(streamLoader);
  8079. EntityDef.unpackConfig(streamLoader);
  8080. IdentityKit.unpackConfig(streamLoader);
  8081. SpotAnim.unpackConfig(streamLoader);
  8082. Varp.unpackConfig(streamLoader);
  8083. VarBit.unpackConfig(streamLoader);
  8084. ItemDef.isMembers = isMembers;
  8085. //drawSmoothLoading(450, "Unpacking interfaces");
  8086. TextDrawingArea aclass30_sub2_sub1_sub4s[] = { smallText, regularText, boldText, aTextDrawingArea_1273 };
  8087. RSInterface.unpack(streamLoader_1, aclass30_sub2_sub1_sub4s, streamLoader_2);
  8088. //drawSmoothLoading(550, "Preparing game engine");
  8089. for (int j6 = 0; j6 < 33; j6++) {
  8090. int k6 = 999;
  8091. int i7 = 0;
  8092. for (int k7 = 0; k7 < 34; k7++) {
  8093. if (mapBack.aByteArray1450[k7 + j6 * mapBack.anInt1452] == 0) {
  8094. if (k6 == 999)
  8095. k6 = k7;
  8096. continue;
  8097. }
  8098. if (k6 == 999)
  8099. continue;
  8100. i7 = k7;
  8101. break;
  8102. }
  8103. anIntArray968[j6] = k6;
  8104. anIntArray1057[j6] = i7 - k6;
  8105. }
  8106. for (int l6 = 1; l6 < 153; l6++) {
  8107. int j7 = 999;
  8108. int l7 = 0;
  8109. for (int j8 = 24; j8 < 177; j8++) {
  8110. if (mapBack.aByteArray1450[j8 + l6 * mapBack.anInt1452] == 0 && (j8 > 34 || l6 > 34)) {
  8111. if (j7 == 999) {
  8112. j7 = j8;
  8113. }
  8114. continue;
  8115. }
  8116. if (j7 == 999) {
  8117. continue;
  8118. }
  8119. l7 = j8;
  8120. break;
  8121. }
  8122. anIntArray1052[l6 - 1] = j7 - 24;
  8123. anIntArray1229[l6 - 1] = l7 - j7;
  8124. }
  8125. setBounds();
  8126. Censor.loadConfig(streamLoader_4);
  8127. mouseDetection = new MouseDetection(this);
  8128. startRunnable(mouseDetection, 10);
  8129. Animable_Sub5.clientInstance = this;
  8130. ObjectDef.clientInstance = this;
  8131. EntityDef.clientInstance = this;
  8132. AccountManager.loadAccount();
  8133. return;
  8134. } catch (Exception exception) {
  8135. exception.printStackTrace();
  8136. Signlink.reporterror("loaderror " + aString1049 + " " + anInt1079);
  8137. }
  8138. loadingError = true;
  8139. }
  8140.  
  8141.  
  8142.  
  8143.  
  8144. private void method91(Stream stream, int i) {
  8145. while (stream.bitPosition + 10 < i * 8) {
  8146. int j = stream.readBits(11);
  8147. if (j == 2047)
  8148. break;
  8149. if (playerArray[j] == null) {
  8150. playerArray[j] = new Player();
  8151. if (aStreamArray895s[j] != null)
  8152. playerArray[j].updatePlayer(aStreamArray895s[j]);
  8153. }
  8154. playerIndices[playerCount++] = j;
  8155. Player player = playerArray[j];
  8156. player.anInt1537 = loopCycle;
  8157. int k = stream.readBits(1);
  8158. if (k == 1)
  8159. anIntArray894[anInt893++] = j;
  8160. int l = stream.readBits(1);
  8161. int i1 = stream.readBits(5);
  8162. if (i1 > 15)
  8163. i1 -= 32;
  8164. int j1 = stream.readBits(5);
  8165. if (j1 > 15)
  8166. j1 -= 32;
  8167. player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1, l == 1);
  8168. }
  8169. stream.finishBitAccess();
  8170. }
  8171.  
  8172. public String indexLocation(int cacheIndex, int index) {
  8173. return "C:/Users/evan__000/Desktop/index" + cacheIndex + "/" + (index != -1 ? index + ".dat" : "");
  8174. }
  8175.  
  8176. public void repackCacheIndex(int cacheIndex) {
  8177. System.out.println("Started repacking index " + cacheIndex + ".");
  8178. int indexLength = new File(indexLocation(cacheIndex, -1)).listFiles().length;
  8179. File[] file = new File(indexLocation(cacheIndex, -1)).listFiles();
  8180. try {
  8181. for (int index = 0; index < indexLength; index++) {
  8182. int fileIndex = Integer.parseInt(getFileNameWithoutExtension(file[index].toString()));
  8183. byte[] data = fileToByteArray(cacheIndex, fileIndex);
  8184. if (data != null && data.length > 0) {
  8185. decompressors[cacheIndex].method234(data.length, data, fileIndex);
  8186. System.out.println("Repacked " + fileIndex + ".");
  8187. } else {
  8188. System.out.println("Unable to locate index " + fileIndex + ".");
  8189. }
  8190. }
  8191. } catch (Exception e) {
  8192. System.out.println("Error packing cache index " + cacheIndex + ".");
  8193. }
  8194. System.out.println("Finished repacking " + cacheIndex + ".");
  8195. }
  8196.  
  8197. public byte[] fileToByteArray(int cacheIndex, int index) {
  8198. try {
  8199. if (indexLocation(cacheIndex, index).length() <= 0 || indexLocation(cacheIndex, index) == null) {
  8200. return null;
  8201. }
  8202. File file = new File(indexLocation(cacheIndex, index));
  8203. byte[] fileData = new byte[(int) file.length()];
  8204. FileInputStream fis = new FileInputStream(file);
  8205. fis.read(fileData);
  8206. fis.close();
  8207. return fileData;
  8208. } catch (Exception e) {
  8209. return null;
  8210. }
  8211. }
  8212.  
  8213. public boolean inCircle(int circleX, int circleY, int clickX, int clickY, int radius) {
  8214. return java.lang.Math.pow((circleX + radius - clickX), 2) + java.lang.Math.pow((circleY + radius - clickY), 2) < java.lang.Math.pow(radius, 2);
  8215. }
  8216.  
  8217. private void processMainScreenClick() {
  8218. if (anInt1021 != 0)
  8219. return;
  8220. if (super.clickMode3 == 1) {
  8221. int i = super.saveClickX - 25 - 547;
  8222. int j = super.saveClickY - 5 - 3;
  8223. if (frameMode != ScreenMode.FIXED) {
  8224. i = super.saveClickX - (frameWidth - 182 + 24);
  8225. j = super.saveClickY - 8;
  8226. }
  8227.  
  8228. if (inCircle(0, 0, i, j, 76) && mouseMapPosition() && !runHover) {
  8229. i -= 73;
  8230. j -= 75;
  8231. int k = minimapInt1 + minimapInt2 & 0x7ff;
  8232. int i1 = Rasterizer.anIntArray1470[k];
  8233. int j1 = Rasterizer.anIntArray1471[k];
  8234. i1 = i1 * (minimapInt3 + 256) >> 8;
  8235. j1 = j1 * (minimapInt3 + 256) >> 8;
  8236. int k1 = j * i1 + i * j1 >> 11;
  8237. int l1 = j * j1 - i * i1 >> 11;
  8238. int i2 = myPlayer.x + k1 >> 7;
  8239. int j2 = myPlayer.y - l1 >> 7;
  8240. if ((myPrivilege == 2 || myPrivilege == 3 || myPrivilege == 4) && controlIsDown) {
  8241. teleport(baseX + i2, baseY + j2);
  8242. } else {
  8243. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0, j2, myPlayer.smallX[0], true, i2);
  8244. if (flag1) {
  8245. stream.writeWordBigEndian(i);
  8246. stream.writeWordBigEndian(j);
  8247. stream.writeWord(minimapInt1);
  8248. stream.writeWordBigEndian(57);
  8249. stream.writeWordBigEndian(minimapInt2);
  8250. stream.writeWordBigEndian(minimapInt3);
  8251. stream.writeWordBigEndian(89);
  8252. stream.writeWord(myPlayer.x);
  8253. stream.writeWord(myPlayer.y);
  8254. stream.writeWordBigEndian(anInt1264);
  8255. stream.writeWordBigEndian(63);
  8256. }
  8257. }
  8258. anInt1117++;
  8259. if (anInt1117 > 1151) {
  8260. anInt1117 = 0;
  8261. stream.createFrame(246);
  8262. stream.writeWordBigEndian(0);
  8263. int l = stream.currentOffset;
  8264. if ((int) (Math.random() * 2D) == 0)
  8265. stream.writeWordBigEndian(101);
  8266. stream.writeWordBigEndian(197);
  8267. stream.writeWord((int) (Math.random() * 65536D));
  8268. stream.writeWordBigEndian((int) (Math.random() * 256D));
  8269. stream.writeWordBigEndian(67);
  8270. stream.writeWord(14214);
  8271. if ((int) (Math.random() * 2D) == 0)
  8272. stream.writeWord(29487);
  8273. stream.writeWord((int) (Math.random() * 65536D));
  8274. if ((int) (Math.random() * 2D) == 0)
  8275. stream.writeWordBigEndian(220);
  8276. stream.writeWordBigEndian(180);
  8277. stream.writeBytes(stream.currentOffset - l);
  8278. }
  8279. }
  8280. }
  8281. }
  8282.  
  8283. private String interfaceIntToString(int j) {
  8284. if (j < 0x3b9ac9ff)
  8285. return String.valueOf(j);
  8286. else
  8287. return "*";
  8288. }
  8289.  
  8290. private void showErrorScreen() {
  8291. Graphics g = getGameComponent().getGraphics();
  8292. g.setColor(Color.black);
  8293. g.fillRect(0, 0, 765, 503);
  8294. method4(1);
  8295. if (loadingError) {
  8296. aBoolean831 = false;
  8297. g.setFont(new Font("Helvetica", 1, 16));
  8298. g.setColor(Color.yellow);
  8299. int k = 35;
  8300. g.drawString("Sorry, an error has occured whilst loading " + ClientConstants.CLIENT_NAME, 30, k);
  8301. k += 50;
  8302. g.setColor(Color.white);
  8303. g.drawString("To fix this try the following (in order):", 30, k);
  8304. k += 50;
  8305. g.setColor(Color.white);
  8306. g.setFont(new Font("Helvetica", 1, 12));
  8307. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, k);
  8308. k += 30;
  8309. g.drawString("2: Try clearing your web-browsers cache from tools->internet options", 30, k);
  8310. k += 30;
  8311. g.drawString("3: Try using a different game-world", 30, k);
  8312. k += 30;
  8313. g.drawString("4: Try rebooting your computer", 30, k);
  8314. k += 30;
  8315. g.drawString("5: Try selecting a different version of Java from the play-game menu", 30, k);
  8316. }
  8317. if (genericLoadingError) {
  8318. aBoolean831 = false;
  8319. g.setFont(new Font("Helvetica", 1, 20));
  8320. g.setColor(Color.white);
  8321. g.drawString("Error - unable to load game!", 50, 50);
  8322. g.drawString("To play " + ClientConstants.CLIENT_NAME + " make sure you play from", 50, 100);
  8323. g.drawString("http://www.UrlHere.com", 50, 150);
  8324. }
  8325. if (rsAlreadyLoaded) {
  8326. aBoolean831 = false;
  8327. g.setColor(Color.yellow);
  8328. int l = 35;
  8329. g.drawString("Error a copy of " + ClientConstants.CLIENT_NAME + " already appears to be loaded", 30, l);
  8330. l += 50;
  8331. g.setColor(Color.white);
  8332. g.drawString("To fix this try the following (in order):", 30, l);
  8333. l += 50;
  8334. g.setColor(Color.white);
  8335. g.setFont(new Font("Helvetica", 1, 12));
  8336. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, l);
  8337. l += 30;
  8338. g.drawString("2: Try rebooting your computer, and reloading", 30, l);
  8339. l += 30;
  8340. }
  8341. }
  8342.  
  8343. public URL getCodeBase() {
  8344. try {
  8345. return new URL(server + ":" + (80 + portOff));
  8346. } catch (Exception _ex) {
  8347. }
  8348. return null;
  8349. }
  8350.  
  8351. private void method95() {
  8352. for (int j = 0; j < npcCount; j++) {
  8353. int k = npcIndices[j];
  8354. Npc npc = npcArray[k];
  8355. if (npc != null)
  8356. method96(npc);
  8357. }
  8358. }
  8359.  
  8360. private void method96(Entity entity) {
  8361. if (entity.x < 128 || entity.y < 128 || entity.x >= 13184 || entity.y >= 13184) {
  8362. entity.anim = -1;
  8363. entity.anInt1520 = -1;
  8364. entity.anInt1547 = 0;
  8365. entity.anInt1548 = 0;
  8366. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  8367. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  8368. entity.method446();
  8369. }
  8370. if (entity == myPlayer && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776)) {
  8371. entity.anim = -1;
  8372. entity.anInt1520 = -1;
  8373. entity.anInt1547 = 0;
  8374. entity.anInt1548 = 0;
  8375. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  8376. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  8377. entity.method446();
  8378. }
  8379. if (entity.anInt1547 > loopCycle) {
  8380. method97(entity);
  8381. } else if (entity.anInt1548 >= loopCycle) {
  8382. method98(entity);
  8383. } else {
  8384. method99(entity);
  8385. }
  8386. method100(entity);
  8387. method101(entity);
  8388. }
  8389.  
  8390. private void method97(Entity entity) {
  8391. int i = entity.anInt1547 - loopCycle;
  8392. int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  8393. int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  8394. entity.x += (j - entity.x) / i;
  8395. entity.y += (k - entity.y) / i;
  8396. entity.anInt1503 = 0;
  8397. if (entity.anInt1549 == 0)
  8398. entity.turnDirection = 1024;
  8399. if (entity.anInt1549 == 1)
  8400. entity.turnDirection = 1536;
  8401. if (entity.anInt1549 == 2)
  8402. entity.turnDirection = 0;
  8403. if (entity.anInt1549 == 3)
  8404. entity.turnDirection = 512;
  8405. }
  8406.  
  8407. private void method98(Entity entity) {
  8408. if (entity.anInt1548 == loopCycle || entity.anim == -1 || entity.anInt1529 != 0 || entity.anInt1528 + 1 > Animation.anims[entity.anim].method258(entity.anInt1527)) {
  8409. int i = entity.anInt1548 - entity.anInt1547;
  8410. int j = loopCycle - entity.anInt1547;
  8411. int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  8412. int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  8413. int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
  8414. int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
  8415. entity.x = (k * (i - j) + i1 * j) / i;
  8416. entity.y = (l * (i - j) + j1 * j) / i;
  8417. }
  8418. entity.anInt1503 = 0;
  8419. if (entity.anInt1549 == 0)
  8420. entity.turnDirection = 1024;
  8421. if (entity.anInt1549 == 1)
  8422. entity.turnDirection = 1536;
  8423. if (entity.anInt1549 == 2)
  8424. entity.turnDirection = 0;
  8425. if (entity.anInt1549 == 3)
  8426. entity.turnDirection = 512;
  8427. entity.anInt1552 = entity.turnDirection;
  8428. }
  8429.  
  8430. private void method99(Entity entity) {
  8431. try {
  8432. entity.anInt1517 = entity.anInt1511;
  8433. if (entity.smallXYIndex == 0) {
  8434. entity.anInt1503 = 0;
  8435. return;
  8436. }
  8437. if (entity.anim != -1 && entity.anInt1529 == 0) {
  8438. Animation animation = Animation.anims[entity.anim];
  8439. if (entity.anInt1542 > 0 && animation.anInt363 == 0) {
  8440. entity.anInt1503++;
  8441. return;
  8442. }
  8443. if (entity.anInt1542 <= 0 && animation.anInt364 == 0) {
  8444. entity.anInt1503++;
  8445. return;
  8446. }
  8447. }
  8448. int i = entity.x;
  8449. int j = entity.y;
  8450. int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  8451. int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  8452. if (k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256) {
  8453. entity.x = k;
  8454. entity.y = l;
  8455. return;
  8456. }
  8457. if (i < k) {
  8458. if (j < l)
  8459. entity.turnDirection = 1280;
  8460. else if (j > l)
  8461. entity.turnDirection = 1792;
  8462. else
  8463. entity.turnDirection = 1536;
  8464. } else if (i > k) {
  8465. if (j < l)
  8466. entity.turnDirection = 768;
  8467. else if (j > l)
  8468. entity.turnDirection = 256;
  8469. else
  8470. entity.turnDirection = 512;
  8471. } else if (j < l)
  8472. entity.turnDirection = 1024;
  8473. else
  8474. entity.turnDirection = 0;
  8475. int i1 = entity.turnDirection - entity.anInt1552 & 0x7ff;
  8476. if (i1 > 1024)
  8477. i1 -= 2048;
  8478. int j1 = entity.anInt1555;
  8479. if (i1 >= -256 && i1 <= 256)
  8480. j1 = entity.anInt1554;
  8481. else if (i1 >= 256 && i1 < 768)
  8482. j1 = entity.anInt1557;
  8483. else if (i1 >= -768 && i1 <= -256)
  8484. j1 = entity.anInt1556;
  8485. if (j1 == -1)
  8486. j1 = entity.anInt1554;
  8487. entity.anInt1517 = j1;
  8488. int k1 = 4;
  8489. if (entity.anInt1552 != entity.turnDirection && entity.interactingEntity == -1 && entity.anInt1504 != 0)
  8490. k1 = 2;
  8491. if (entity.smallXYIndex > 2)
  8492. k1 = 6;
  8493. if (entity.smallXYIndex > 3)
  8494. k1 = 8;
  8495. if (entity.anInt1503 > 0 && entity.smallXYIndex > 1) {
  8496. k1 = 8;
  8497. entity.anInt1503--;
  8498. }
  8499. if (entity.aBooleanArray1553[entity.smallXYIndex - 1])
  8500. k1 <<= 1;
  8501. if (k1 >= 8 && entity.anInt1517 == entity.anInt1554 && entity.anInt1505 != -1)
  8502. entity.anInt1517 = entity.anInt1505;
  8503. if (i < k) {
  8504. entity.x += k1;
  8505. if (entity.x > k)
  8506. entity.x = k;
  8507. } else if (i > k) {
  8508. entity.x -= k1;
  8509. if (entity.x < k)
  8510. entity.x = k;
  8511. }
  8512. if (j < l) {
  8513. entity.y += k1;
  8514. if (entity.y > l)
  8515. entity.y = l;
  8516. } else if (j > l) {
  8517. entity.y -= k1;
  8518. if (entity.y < l)
  8519. entity.y = l;
  8520. }
  8521. if (entity.x == k && entity.y == l) {
  8522. entity.smallXYIndex--;
  8523. if (entity.anInt1542 > 0)
  8524. entity.anInt1542--;
  8525. }
  8526. } catch(Exception e) {
  8527.  
  8528. }
  8529. }
  8530.  
  8531. private void method100(Entity entity) {
  8532. if (entity.anInt1504 == 0)
  8533. return;
  8534. if (entity.interactingEntity != -1 && entity.interactingEntity < 32768) {
  8535. Npc npc = npcArray[entity.interactingEntity];
  8536. if (npc != null) {
  8537. int i1 = entity.x - npc.x;
  8538. int k1 = entity.y - npc.y;
  8539. if (i1 != 0 || k1 != 0)
  8540. entity.turnDirection = (int) (Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  8541. }
  8542. }
  8543. if (entity.interactingEntity >= 32768) {
  8544. int j = entity.interactingEntity - 32768;
  8545. if (j == unknownInt10)
  8546. j = myPlayerIndex;
  8547. Player player = playerArray[j];
  8548. if (player != null) {
  8549. int l1 = entity.x - player.x;
  8550. int i2 = entity.y - player.y;
  8551. if (l1 != 0 || i2 != 0)
  8552. entity.turnDirection = (int) (Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  8553. }
  8554. }
  8555. if ((entity.anInt1538 != 0 || entity.anInt1539 != 0) && (entity.smallXYIndex == 0 || entity.anInt1503 > 0)) {
  8556. int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
  8557. int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
  8558. if (k != 0 || j1 != 0)
  8559. entity.turnDirection = (int) (Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  8560. entity.anInt1538 = 0;
  8561. entity.anInt1539 = 0;
  8562. }
  8563. int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
  8564. if (l != 0) {
  8565. if (l < entity.anInt1504 || l > 2048 - entity.anInt1504)
  8566. entity.anInt1552 = entity.turnDirection;
  8567. else if (l > 1024)
  8568. entity.anInt1552 -= entity.anInt1504;
  8569. else
  8570. entity.anInt1552 += entity.anInt1504;
  8571. entity.anInt1552 &= 0x7ff;
  8572. if (entity.anInt1517 == entity.anInt1511 && entity.anInt1552 != entity.turnDirection) {
  8573. if (entity.anInt1512 != -1) {
  8574. entity.anInt1517 = entity.anInt1512;
  8575. return;
  8576. }
  8577. entity.anInt1517 = entity.anInt1554;
  8578. }
  8579. }
  8580. }
  8581.  
  8582. private void method101(Entity entity) {
  8583. try {
  8584. if (entity.anInt1517 > 13798) {
  8585. entity.anInt1517 = -1;
  8586. }
  8587. entity.aBoolean1541 = false;
  8588. if (entity.anInt1517 != -1) {
  8589. Animation animation = Animation.anims[entity.anInt1517];
  8590. entity.anInt1519++;
  8591. if (entity.anInt1518 < animation.anInt352 && entity.anInt1519 > animation.method258(entity.anInt1518)) {
  8592. entity.anInt1519 = 1;
  8593. entity.anInt1518++;
  8594. entity.nextIdleAnimFrame++;
  8595. }
  8596. entity.nextIdleAnimFrame = entity.anInt1518 + 1;
  8597. if (entity.nextIdleAnimFrame >= animation.anInt352) {
  8598. if (entity.nextIdleAnimFrame >= animation.anInt352) {
  8599. entity.nextIdleAnimFrame = 0;
  8600. }
  8601. }
  8602. if (entity.anInt1518 >= animation.anInt352) {
  8603. entity.anInt1519 = 1;
  8604. entity.anInt1518 = 0;
  8605. }
  8606. }
  8607. if (entity.anInt1520 != -1 && loopCycle >= entity.anInt1523) {
  8608. if (entity.anInt1521 < 0)
  8609. entity.anInt1521 = 0;
  8610. Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  8611. for (entity.anInt1522++; entity.anInt1521 < animation_1.anInt352 && entity.anInt1522 > animation_1.method258(entity.anInt1521); entity.anInt1521++)
  8612. entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  8613.  
  8614. if (entity.anInt1521 >= animation_1.anInt352 && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352)) {
  8615. entity.anInt1520 = -1;
  8616. }
  8617. if (Configuration.enableTweening) {
  8618. entity.nextIdleAnimFrame = entity.anInt1518 + 1;
  8619. }
  8620. if (entity.nextSpotAnimFrame >= animation_1.anInt352) {
  8621. entity.nextSpotAnimFrame = -1;
  8622. }
  8623. }
  8624. if (entity.anim != -1 && entity.anInt1529 <= 1) {
  8625. Animation animation_2 = Animation.anims[entity.anim];
  8626. if (animation_2.anInt363 == 1 && entity.anInt1542 > 0 && entity.anInt1547 <= loopCycle && entity.anInt1548 < loopCycle) {
  8627. entity.anInt1529 = 1;
  8628. return;
  8629. }
  8630. }
  8631. if (entity.anim != -1 && entity.anInt1529 == 0) {
  8632. Animation animation_3 = Animation.anims[entity.anim];
  8633. for (entity.anInt1528++; entity.anInt1527 < animation_3.anInt352 && entity.anInt1528 > animation_3.method258(entity.anInt1527); entity.anInt1527++)
  8634. entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  8635.  
  8636. if (entity.anInt1527 >= animation_3.anInt352) {
  8637. entity.anInt1527 -= animation_3.anInt356;
  8638. entity.anInt1530++;
  8639. if (entity.anInt1530 >= animation_3.anInt362)
  8640. entity.anim = -1;
  8641. if (entity.anInt1527 < 0 || entity.anInt1527 >= animation_3.anInt352)
  8642. entity.anim = -1;
  8643. }
  8644. if (Configuration.enableTweening) {
  8645. entity.nextAnimFrame = entity.anInt1527 + 1;
  8646. }
  8647. if (entity.nextAnimFrame >= animation_3.anInt352) {
  8648. entity.nextAnimFrame = -1;
  8649. }
  8650. entity.aBoolean1541 = animation_3.aBoolean358;
  8651. }
  8652. if (entity.anInt1529 > 0)
  8653. entity.anInt1529--;
  8654. } catch (Exception e) {
  8655.  
  8656. }
  8657. }
  8658.  
  8659.  
  8660. private void drawGameScreen() {
  8661. if (fullscreenInterfaceID != -1 && (loadingStage == 2 || super.fullGameScreen != null)) {
  8662. if (loadingStage == 2) {
  8663. method119(anInt945, fullscreenInterfaceID);
  8664. if (openInterfaceID != -1) {
  8665. method119(anInt945, openInterfaceID);
  8666. }
  8667. anInt945 = 0;
  8668. resetAllImageProducers();
  8669. super.fullGameScreen.initDrawingArea();
  8670. Rasterizer.anIntArray1472 = fullScreenTextureArray;
  8671. DrawingArea.setAllPixelsToZero();
  8672. welcomeScreenRaised = true;
  8673. if (openInterfaceID != -1) {
  8674. RSInterface rsInterface_1 = RSInterface.interfaceCache[openInterfaceID];
  8675. if (rsInterface_1.width == 512 && rsInterface_1.height == 334 && rsInterface_1.type == 0) {
  8676. rsInterface_1.width = 765;
  8677. rsInterface_1.height = 503;
  8678. }
  8679. drawInterface(0, 0, rsInterface_1, 8);
  8680. }
  8681. RSInterface rsInterface = RSInterface.interfaceCache[fullscreenInterfaceID];
  8682. if (rsInterface.width == 512 && rsInterface.height == 334 && rsInterface.type == 0) {
  8683. rsInterface.width = 765;
  8684. rsInterface.height = 503;
  8685. }
  8686. drawInterface(0, 0, rsInterface, 8);
  8687. if (!menuOpen) {
  8688. processRightClick();
  8689. drawTooltip();
  8690. } else {
  8691. drawMenu(frameMode == ScreenMode.FIXED ? 4 : 0, frameMode == ScreenMode.FIXED ? 4 : 0);
  8692. }
  8693. }
  8694. drawCount++;
  8695. super.fullGameScreen.drawGraphics(0, super.graphics, 0);
  8696. return;
  8697. } else {
  8698. if (drawCount != 0) {
  8699. resetImageProducers2();
  8700. }
  8701. }
  8702. if (welcomeScreenRaised) {
  8703. welcomeScreenRaised = false;
  8704. if (frameMode == ScreenMode.FIXED) {
  8705. topFrame.drawGraphics(0, super.graphics, 0);
  8706. leftFrame.drawGraphics(4, super.graphics, 0);
  8707. }
  8708. inputTaken = true;
  8709. tabAreaAltered = true;
  8710. if (loadingStage != 2) {
  8711. if (frameMode == ScreenMode.FIXED) {
  8712. aRSImageProducer_1165.drawGraphics(frameMode == ScreenMode.FIXED ? 4 : 0, super.graphics, frameMode == ScreenMode.FIXED ? 4 : 0);
  8713. aRSImageProducer_1164.drawGraphics(0, super.graphics, 516);
  8714. }
  8715. }
  8716. }
  8717. if (invOverlayInterfaceID != -1) {
  8718. method119(anInt945, invOverlayInterfaceID);
  8719. }
  8720. drawTabArea();
  8721. if (backDialogID == -1) {
  8722. aClass9_1059.scrollPosition = anInt1211 - anInt1089 - 110;
  8723. if (super.mouseX >= 496 && super.mouseX <= 511 && super.mouseY > (frameMode == ScreenMode.FIXED ? 345 : frameHeight - 158))
  8724. method65(494, 110, super.mouseX, super.mouseY - (frameMode == ScreenMode.FIXED ? 345 : frameHeight - 158), aClass9_1059, 0, false, anInt1211);
  8725. int i = anInt1211 - 110 - aClass9_1059.scrollPosition;
  8726. if (i < 0) {
  8727. i = 0;
  8728. }
  8729. if (i > anInt1211 - 110) {
  8730. i = anInt1211 - 110;
  8731. }
  8732. if (anInt1089 != i) {
  8733. anInt1089 = i;
  8734. inputTaken = true;
  8735. }
  8736. }
  8737. if (backDialogID != -1) {
  8738. boolean flag2 = method119(anInt945, backDialogID);
  8739. if (flag2)
  8740. inputTaken = true;
  8741. }
  8742. if (atInventoryInterfaceType == 3)
  8743. inputTaken = true;
  8744. if (activeInterfaceType == 3)
  8745. inputTaken = true;
  8746. if (aString844 != null)
  8747. inputTaken = true;
  8748. if (menuOpen && menuScreenArea == 2)
  8749. inputTaken = true;
  8750. extendChatArea();
  8751. if (inputTaken) {
  8752. drawChatArea();
  8753. inputTaken = false;
  8754. }
  8755. if (loadingStage == 2)
  8756. method146();
  8757. if (loadingStage == 2) {
  8758. if (frameMode == ScreenMode.FIXED) {
  8759. drawMinimap();
  8760. aRSImageProducer_1164.drawGraphics(0, super.graphics, 516);
  8761. }
  8762. }
  8763. if (anInt1054 != -1)
  8764. tabAreaAltered = true;
  8765. if (tabAreaAltered) {
  8766. if (anInt1054 != -1 && anInt1054 == tabID) {
  8767. anInt1054 = -1;
  8768. stream.createFrame(120);
  8769. stream.writeWordBigEndian(tabID);
  8770. }
  8771. tabAreaAltered = false;
  8772. aRSImageProducer_1125.initDrawingArea();
  8773. aRSImageProducer_1165.initDrawingArea();
  8774. }
  8775. anInt945 = 0;
  8776. }
  8777.  
  8778.  
  8779. private boolean buildFriendsListMenu(RSInterface class9) {
  8780. int i = class9.contentType;
  8781. if (i >= 1 && i <= 200 || i >= 701 && i <= 900) {
  8782. if (i >= 801)
  8783. i -= 701;
  8784. else if (i >= 701)
  8785. i -= 601;
  8786. else if (i >= 101)
  8787. i -= 101;
  8788. else
  8789. i--;
  8790. menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
  8791. menuActionID[menuActionRow] = 792;
  8792. menuActionRow++;
  8793. menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
  8794. menuActionID[menuActionRow] = 639;
  8795. menuActionRow++;
  8796. return true;
  8797. }
  8798.  
  8799.  
  8800. if (i >= 401 && i <= 500) {
  8801. menuActionName[menuActionRow] = "Remove @whi@" + class9.disabledMessage;
  8802. menuActionID[menuActionRow] = 322;
  8803. menuActionRow++;
  8804. return true;
  8805. } else {
  8806. return false;
  8807. }
  8808. }
  8809.  
  8810. private void method104() {
  8811. Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3) aClass19_1056.reverseGetFirst();
  8812. for (; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3) aClass19_1056.reverseGetNext())
  8813. if (class30_sub2_sub4_sub3.anInt1560 != plane || class30_sub2_sub4_sub3.aBoolean1567)
  8814. class30_sub2_sub4_sub3.unlink();
  8815. else if (loopCycle >= class30_sub2_sub4_sub3.anInt1564) {
  8816. class30_sub2_sub4_sub3.method454(anInt945);
  8817. if (class30_sub2_sub4_sub3.aBoolean1567)
  8818. class30_sub2_sub4_sub3.unlink();
  8819. else
  8820. 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);
  8821. }
  8822.  
  8823. }
  8824.  
  8825. public void drawBlackBox(int xPos, int yPos) {
  8826. DrawingArea.drawPixels(71, yPos - 1, xPos - 2, 0x726451, 1);
  8827. DrawingArea.drawPixels(69, yPos, xPos + 174, 0x726451, 1);
  8828. DrawingArea.drawPixels(1, yPos - 2, xPos - 2, 0x726451, 178);
  8829. DrawingArea.drawPixels(1, yPos + 68, xPos, 0x726451, 174);
  8830. DrawingArea.drawPixels(71, yPos - 1, xPos - 1, 0x2E2B23, 1);
  8831. DrawingArea.drawPixels(71, yPos - 1, xPos + 175, 0x2E2B23, 1);
  8832. DrawingArea.drawPixels(1, yPos - 1, xPos, 0x2E2B23, 175);
  8833. DrawingArea.drawPixels(1, yPos + 69, xPos, 0x2E2B23, 175);
  8834. DrawingArea.method335(0, yPos, 174, 68, 220, xPos);
  8835. }
  8836.  
  8837. public void refreshScreenOptions() {
  8838. int childIds[] = { 36004, 36007, 36010 };
  8839. int enabledIds[] = { 1, 3, 5 };
  8840. int disabledIds[] = { 0, 2, 4 };
  8841. ScreenMode modes[] = { ScreenMode.FIXED, ScreenMode.RESIZABLE, ScreenMode.FULLSCREEN };
  8842. for (int index = 0; index < modes.length; index++) {
  8843. RSInterface.interfaceCache[childIds[index]].setSprite(Client.cacheSprite[frameMode == modes[index] ? enabledIds[index] : disabledIds[index]]);
  8844. }
  8845. }
  8846.  
  8847. @SuppressWarnings("unused")
  8848. private void drawInterface(int j, int k, RSInterface class9, int l) {
  8849. refreshScreenOptions();
  8850. if (class9.parentID == 197 && frameMode != ScreenMode.FIXED) {
  8851. k = frameWidth - 120;
  8852. l = 170;
  8853. }
  8854. if (class9.type != 0 || class9.children == null) {
  8855. return;
  8856. }
  8857. if (class9.isMouseoverTriggered && anInt1026 != class9.id && anInt1048 != class9.id && anInt1039 != class9.id)
  8858. return;
  8859. int i1 = DrawingArea.topX;
  8860. int j1 = DrawingArea.topY;
  8861. int k1 = DrawingArea.bottomX;
  8862. int l1 = DrawingArea.bottomY;
  8863. DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  8864. int i2 = class9.children.length;
  8865. int alpha = class9.transparency;
  8866. for (int j2 = 0; j2 < i2; j2++) {
  8867. int k2 = class9.childX[j2] + k;
  8868. int l2 = (class9.childY[j2] + l) - j;
  8869. RSInterface child = RSInterface.interfaceCache[class9.children[j2]];
  8870. k2 += child.anInt263;
  8871. l2 += child.anInt265;
  8872. if (child.contentType > 0)
  8873. drawFriendsListOrWelcomeScreen(child);
  8874. // here
  8875. int[] IDs = { 1196, 1199, 1206, 1215, 1224, 1231, 1240, 1249, 1258, 1267, 1274, 1283, 1573, 1290, 1299, 1308, 1315, 1324, 1333, 1340, 1349, 1358, 1367, 1374, 1381, 1388, 1397, 1404, 1583, 12038, 1414, 1421, 1430, 1437, 1446, 1453, 1460, 1469, 15878, 1602, 1613, 1624, 7456, 1478, 1485, 1494, 1503, 1512, 1521, 1530, 1544, 1553, 1563, 1593, 1635, 12426, 12436, 12446, 12456, 6004, 18471,
  8876. /* Ancients */
  8877. 12940, 12988, 13036, 12902, 12862, 13046, 12964, 13012, 13054, 12920, 12882, 13062, 12952, 13000, 13070, 12912, 12872, 13080, 12976, 13024, 13088, 12930, 12892, 13096 };
  8878. for (int m5 = 0; m5 < IDs.length; m5++) {
  8879. if (child.id == IDs[m5] + 1) {
  8880. if (m5 > 61)
  8881. drawBlackBox(k2 + 1, l2);
  8882. else
  8883. drawBlackBox(k2, l2 + 1);
  8884. }
  8885. }
  8886. int[] runeChildren = { 1202, 1203, 1209, 1210, 1211, 1218, 1219, 1220, 1227, 1228, 1234, 1235, 1236, 1243, 1244, 1245, 1252, 1253, 1254, 1261, 1262, 1263, 1270, 1271, 1277, 1278, 1279, 1286, 1287, 1293, 1294, 1295, 1302, 1303, 1304, 1311, 1312, 1318, 1319, 1320, 1327, 1328, 1329, 1336, 1337, 1343, 1344, 1345, 1352, 1353, 1354, 1361, 1362, 1363, 1370, 1371, 1377, 1378, 1384, 1385, 1391, 1392, 1393, 1400, 1401, 1407, 1408, 1410, 1417, 1418, 1424, 1425, 1426, 1433, 1434, 1440, 1441, 1442, 1449, 1450, 1456, 1457, 1463, 1464, 1465, 1472, 1473, 1474, 1481, 1482, 1488, 1489, 1490, 1497, 1498, 1499, 1506, 1507, 1508, 1515, 1516, 1517, 1524, 1525, 1526, 1533, 1534, 1535, 1547, 1548, 1549, 1556, 1557, 1558, 1566, 1567, 1568, 1576, 1577, 1578, 1586, 1587, 1588, 1596, 1597, 1598, 1605,
  8887. 1606, 1607, 1616, 1617, 1618, 1627, 1628, 1629, 1638, 1639, 1640, 6007, 6008, 6011, 8673, 8674, 12041, 12042, 12429, 12430, 12431, 12439, 12440, 12441, 12449, 12450, 12451, 12459, 12460, 15881, 15882, 15885, 18474, 18475, 18478 };
  8888. for (int r = 0; r < runeChildren.length; r++)
  8889. if (child.id == runeChildren[r])
  8890. child.modelZoom = 775;
  8891. if (child.type == 0) {
  8892. if (child.scrollPosition > child.scrollMax - child.height)
  8893. child.scrollPosition = child.scrollMax - child.height;
  8894. if (child.scrollPosition < 0)
  8895. child.scrollPosition = 0;
  8896. drawInterface(child.scrollPosition, k2, child, l2);
  8897. if (child.id == 18143) {
  8898. int clanMates = 0;
  8899. for (int i = 18155; i < 18244; i++) {
  8900. RSInterface line = RSInterface.interfaceCache[i];
  8901. if (line.disabledMessage.length() > 0) {
  8902. clanMates++;
  8903. }
  8904. }
  8905. child.scrollMax = (clanMates * 14) + child.height + 1;
  8906. }
  8907. if (child.scrollMax > child.height)
  8908. drawScrollbar(child.height, child.scrollPosition, l2, k2 + child.width, child.scrollMax, false);
  8909. } else if (child.type != 1)
  8910. if (child.type == 2) {
  8911. int slot = 0;
  8912. int tabAm = 0;
  8913. int tabSlot = -1;
  8914. int hh = 2;
  8915. if (child.contentType == 206) {
  8916. int tabHeight = 0;
  8917. for (int i = 0; i < tabAmounts.length; i++) {
  8918. if (tabSlot + 1 < tabAmounts.length && tabAmounts[tabSlot + 1] > 0) {
  8919. tabAm += tabAmounts[++tabSlot];
  8920. tabHeight += (tabAmounts[tabSlot] >> 3) + (tabAmounts[tabSlot] % 8 == 0 ? 0 : 1);
  8921. if (tabSlot + 1 < tabAmounts.length && tabAmounts[tabSlot + 1] > 0 && variousSettings[1000] == 0 && variousSettings[1012] == 0) {
  8922. DrawingArea.method339((l2 + tabHeight * (32 + child.invSpritePadY) + hh) - 1, 0x3E3529, ((32 + child.invSpritePadX) << 3) - 10, k2);
  8923. DrawingArea.method339((l2 + tabHeight * (32 + child.invSpritePadY) + hh), 0x3E3529, ((32 + child.invSpritePadX) << 3) - 10, k2);
  8924. }
  8925. hh += 8;
  8926. }
  8927.  
  8928. if (i > 0) {
  8929. int itemSlot = tabAm - tabAmounts[i];
  8930. int xOffset = (frameWidth - 237 - RSInterface.interfaceCache[5292].width) / 2;
  8931. int yOffset = 36 + ((frameHeight - 503) / 2);
  8932. int x = xOffset + 77;
  8933. int y = yOffset + 25;
  8934. try {
  8935. int item = RSInterface.interfaceCache[5382].inv[itemSlot];
  8936. if (tabAmounts[i] > 0 && item > 0) {
  8937. Sprite icon = null;
  8938. if (variousSettings[1011] == 0) {
  8939. icon = ItemDef.getSprite(item - 1, child.invStackSizes[itemSlot], 0);
  8940. }
  8941. if (variousSettings[1011] == 1) {
  8942. icon = cacheSprite[118 + i];
  8943. }
  8944. if (variousSettings[1011] == 2) {
  8945. icon = cacheSprite[127 + i];
  8946. }
  8947. if (icon != null) {
  8948. icon.drawSprite1((frameMode == ScreenMode.FIXED ? 60 : x + 4) + 40 * i, (frameMode == ScreenMode.FIXED ? 41 : y + 2), 255, true);
  8949. }
  8950. RSInterface.interfaceCache[50013 + i * 4].anInt265 = 0;
  8951. RSInterface.interfaceCache[50014 + i * 4].anInt265 = 0;
  8952. RSInterface.interfaceCache[50014 + i * 4].tooltip = "View tab @or2@" + i;
  8953. RSInterface.interfaceCache[50014 + i * 4].disabledSprite = cacheSprite[109];
  8954. } else if (tabAmounts[i - 1] <= 0) {
  8955. RSInterface.interfaceCache[50013 + i * 4].anInt265 = -500;
  8956. if (i > 1) {
  8957. RSInterface.interfaceCache[50014 + i * 4].anInt265 = -500;
  8958. } else {
  8959. cacheSprite[114].drawSprite1((frameMode == ScreenMode.FIXED ? 59 : x) + 40 * i, (frameMode == ScreenMode.FIXED ? 41 : y), 255, true);
  8960. }
  8961. RSInterface.interfaceCache[50014 + i * 4].tooltip = "New tab";
  8962. } else {
  8963. RSInterface.interfaceCache[50013 + i * 4].anInt265 = -500;
  8964. RSInterface.interfaceCache[50014 + i * 4].anInt265 = 0;
  8965. RSInterface.interfaceCache[50014 + i * 4].tooltip = "New tab";
  8966. RSInterface.interfaceCache[50014 + i * 4].disabledSprite = cacheSprite[112];
  8967. cacheSprite[114].drawSprite1((frameMode == ScreenMode.FIXED ? 59 : x) + 40 * i, (frameMode == ScreenMode.FIXED ? 41 : y), 255, true);
  8968. }
  8969. } catch (Exception e) {
  8970. System.out.println("Bank tab icon error: tab [" + i + "], amount [" + tabAm + "], tabAmount [" + tabAmounts[i] + "], itemSlot [" + itemSlot + "]");
  8971. }
  8972. }
  8973. }
  8974. DrawingArea.bottomY += 3;
  8975. }
  8976.  
  8977. tabAm = tabAmounts[0];
  8978. tabSlot = 0;
  8979. hh = 0;
  8980.  
  8981. int dragX = 0, dragY = 0;
  8982. Sprite draggedItem = null;
  8983.  
  8984. int newSlot = 0;
  8985. if (child.contentType == 206 && variousSettings[1000] != 0 && variousSettings[1012] == 0) {
  8986. for (int i = 0; i < tabAmounts.length; i++) {
  8987. if (i == variousSettings[1000]) {
  8988. break;
  8989. }
  8990. newSlot += tabAmounts[i];
  8991. }
  8992. slot = newSlot;
  8993. }
  8994.  
  8995. heightLoop: for (int height = 0; height < child.height; height++) {
  8996. for (int width = 0; width < child.width; width++) {
  8997. int w = k2 + width * (32 + child.invSpritePadX);
  8998. int h = l2 + height * (32 + child.invSpritePadY) + hh;
  8999. if (child.contentType == 206 && variousSettings[1012] == 0) {
  9000. if (variousSettings[1000] == 0) {
  9001. if (slot == tabAm) {
  9002. if (tabSlot + 1 < tabAmounts.length) {
  9003. tabAm += tabAmounts[++tabSlot];
  9004. if (tabSlot > 0 && tabAmounts[tabSlot - 1] % 8 == 0) {
  9005. height--;
  9006. }
  9007. hh += 8;
  9008. }
  9009. break;
  9010. }
  9011. } else if (variousSettings[1000] <= 9) {
  9012. if (slot >= tabAmounts[variousSettings[1000]] + newSlot) {
  9013. break heightLoop;
  9014. }
  9015. }
  9016. }
  9017. if (slot < 20) {
  9018. w += child.spritesX[slot];
  9019. h += child.spritesY[slot];
  9020. }
  9021. int itemId = child.inv[slot] - 1;
  9022. if (variousSettings[1012] == 1 && child.contentType == 206) {
  9023. itemId = bankInvTemp[slot] - 1;
  9024. }
  9025. if (itemId + 1 > 0) {
  9026. if (child.id == 3900) {
  9027. if (stock == null) {
  9028. stock = cacheSprite[76];
  9029. }
  9030. stock.drawSprite(w - 7, h - 4);
  9031. }
  9032. int x = 0;
  9033. int y = 0;
  9034. if (w > DrawingArea.topX - 32 && w < DrawingArea.bottomX && h > DrawingArea.topY - 32 && h < DrawingArea.bottomY || activeInterfaceType != 0 && dragFromSlot == slot) {
  9035. int color = 0;
  9036. if (itemSelected == 1 && anInt1283 == slot && anInt1284 == child.id) {
  9037. color = 0xffffff;
  9038. }
  9039. Sprite itemSprite = ItemDef.getSprite(itemId, variousSettings[1012] == 1 && child.contentType == 206 ? bankStackTemp[slot] : child.invStackSizes[slot], color);
  9040.  
  9041. if (itemSprite != null) {
  9042. if (activeInterfaceType != 0 && dragFromSlot == slot && focusedDragWidget == child.id) {
  9043. draggedItem = itemSprite;
  9044. x = super.mouseX - pressX;
  9045. y = super.mouseY - pressY;
  9046. if (x < 5 && x > -5)
  9047. x = 0;
  9048. if (y < 5 && y > -5)
  9049. y = 0;
  9050. if (dragCycle < 10) {
  9051. x = 0;
  9052. y = 0;
  9053. }
  9054. dragX = w + x;
  9055. dragY = h + y;
  9056. if (h + y < DrawingArea.topY && class9.scrollPosition > 0) {
  9057. int i10 = (anInt945 * (DrawingArea.topY - h - y)) / 3;
  9058. if (i10 > anInt945 * 10)
  9059. i10 = anInt945 * 10;
  9060. if (i10 > class9.scrollPosition)
  9061. i10 = class9.scrollPosition;
  9062. class9.scrollPosition -= i10;
  9063. pressY += i10;
  9064. }
  9065.  
  9066. if (h + y + 32 > DrawingArea.bottomY && class9.scrollPosition < class9.scrollMax - class9.height) {
  9067. int j10 = (anInt945 * ((h + y + 32) - DrawingArea.bottomY)) / 3;
  9068. if (j10 > anInt945 * 10)
  9069. j10 = anInt945 * 10;
  9070. if (j10 > class9.scrollMax - class9.height - class9.scrollPosition)
  9071. j10 = class9.scrollMax - class9.height - class9.scrollPosition;
  9072. class9.scrollPosition += j10;
  9073. pressY -= j10;
  9074. }
  9075. } else if (atInventoryInterfaceType != 0 && atInventoryIndex == slot && atInventoryInterface == child.id) {
  9076. itemSprite.drawSprite1(w, h);
  9077. } else {
  9078. itemSprite.drawSprite(w, h);
  9079. }
  9080. if (child.parentID != 42752) {
  9081. if (itemSprite.cropWidth == 33 || child.invStackSizes[slot] != 1) {
  9082. int amount = child.invStackSizes[slot];
  9083.  
  9084. if (amount == 0) {
  9085. smallText.method385(0, "EMPTY", h + 45 + y, w + 3 + x);
  9086. smallText.method385(0xFFFFFF, "EMPTY", h + 44 + y, w + 2 + x);
  9087. } else if (amount >= 1000000000) {
  9088. smallText.method385(0, intToKOrMil(amount), h + 10 + y, w + x + 1);
  9089. smallText.method385(0x00FF80, intToKOrMil(amount), h + 9 + y, w + x);
  9090. } else if (amount >= 10000000) {
  9091. smallText.method385(0, intToKOrMil(amount), h + 10 + y, w + x + 1);
  9092. smallText.method385(0x00FF80, intToKOrMil(amount), h + 9 + y, w + x);
  9093. } else if (amount >= 100000) {
  9094. smallText.method385(0, intToKOrMil(amount), h + 10 + y, w + x + 1);
  9095. smallText.method385(0xFFFFFF, intToKOrMil(amount), h + 9 + y, w + x);
  9096. } else if (amount >= 1) {
  9097. smallText.method385(0, intToKOrMil(amount), h + 10 + y, w + x + 1);
  9098. smallText.method385(0xFFFF00, intToKOrMil(amount), h + 9 + y, w + x);
  9099. } else {
  9100. smallText.method385(0, intToKOrMil(amount), h + 10 + y, w + 1 + x);
  9101. smallText.method385(0xFFFF00, intToKOrMil(amount), h + 9 + y, w + x);
  9102. }
  9103. }
  9104. }
  9105. }
  9106. }
  9107. } else if (child.sprites != null && slot < 20) {
  9108. Sprite childSprite = child.sprites[slot];
  9109. if (childSprite != null)
  9110. childSprite.drawSprite(w, h);
  9111. }
  9112. slot++;
  9113. }
  9114. }
  9115. if (draggedItem != null) {
  9116. draggedItem.drawSprite1(dragX, dragY, 200 + (int) (50 * Math.sin(loopCycle / 10.0)), child.contentType == 206);
  9117. }
  9118. } else if (child.type == 3) {
  9119. boolean flag = false;
  9120. if (anInt1039 == child.id || anInt1048 == child.id || anInt1026 == child.id)
  9121. flag = true;
  9122. int color;
  9123. if (interfaceIsSelected(child)) {
  9124. color = child.anInt219;
  9125. if (flag && child.anInt239 != 0)
  9126. color = child.anInt239;
  9127. } else {
  9128. color = child.textColor;
  9129. if (flag && child.textHoverColor != 0)
  9130. color = child.textHoverColor;
  9131. }
  9132. if (child.opacity == 0) {
  9133. if (child.aBoolean227)
  9134. DrawingArea.drawPixels(child.height, l2, k2, color, child.width);
  9135. else
  9136. DrawingArea.fillPixels(k2, child.width, child.height, color, l2);
  9137. } else if (child.aBoolean227)
  9138. DrawingArea.method335(color, l2, child.width, child.height, 256 - (child.opacity & 0xff), k2);
  9139. else
  9140. DrawingArea.method338(l2, child.height, 256 - (child.opacity & 0xff), color, child.width, k2);
  9141. } else if (child.type == 4) {
  9142. TextDrawingArea textDrawingArea = child.textDrawingAreas;
  9143. String message = child.disabledMessage;
  9144. boolean hovered = false;
  9145. if (anInt1039 == child.id || anInt1048 == child.id || anInt1026 == child.id)
  9146. hovered = true;
  9147. int color;
  9148. if (interfaceIsSelected(child)) {
  9149. color = child.anInt219;
  9150. if (hovered && child.anInt239 != 0)
  9151. color = child.anInt239;
  9152. if (child.enabledMessage.length() > 0)
  9153. message = child.enabledMessage;
  9154. } else {
  9155. color = child.textColor;
  9156. if (hovered && child.textHoverColor != 0)
  9157. color = child.textHoverColor;
  9158. }
  9159. if (child.atActionType == 6 && aBoolean1149) {
  9160. message = "Please wait...";
  9161. color = child.textColor;
  9162. }
  9163. if (child.id >= 28000 && child.id < 28036) {
  9164. if (RSInterface.interfaceCache[3900].invStackSizes[child.id - 28000] > 0) {
  9165. String[] data = message.split(",");
  9166. int currency = 0;
  9167. if (data.length > 1) {
  9168. currency = Integer.parseInt(data[1]);
  9169. }
  9170. if (currencyImage[currency] == null) {
  9171. currencyImage[currency] = cacheSprite[407 + currency];
  9172. }
  9173. currencyImage[currency].drawSprite(k2 - 5, l2);
  9174. int value = Integer.parseInt(data[0]);
  9175. if (value >= 10_000_000) {
  9176. smallText.drawRightAlignedString((value / 1_000_000) + "M", k2 + 36, l2 + 1 + DrawingArea.height, 0);
  9177. smallText.drawRightAlignedString((value / 1_000_000) + "M", k2 + 35, l2 + DrawingArea.height, 0x00ff80);
  9178. } else if (value >= 1_000_000) {
  9179. smallText.drawRightAlignedString(String.valueOf(String.format("%.1f", (value / 1_000_000.0))).replace(".0", "") + "M", k2 + 36, l2 + 1 + DrawingArea.height, 0);
  9180. smallText.drawRightAlignedString(String.valueOf(String.format("%.1f", (value / 1_000_000.0))).replace(".0", "") + "M", k2 + 35, l2 + DrawingArea.height, 0xFFFFFF);
  9181. } else if (value >= 100_000) {
  9182. smallText.drawRightAlignedString((value / 1_000) + "K", k2 + 36, l2 + 1 + DrawingArea.height, 0);
  9183. smallText.drawRightAlignedString((value / 1_000) + "K", k2 + 35, l2 + DrawingArea.height, 0xFFFFFF);
  9184. } else if (value >= 10_000) {
  9185. smallText.drawRightAlignedString((value / 1_000) + "K", k2 + 36, l2 + 1 + DrawingArea.height, 0);
  9186. smallText.drawRightAlignedString((value / 1_000) + "K", k2 + 35, l2 + DrawingArea.height, 0xffff00);
  9187. } else if (value <= 0) {
  9188. smallText.drawRightAlignedString("FREE", k2 + 34, l2 + 1 + DrawingArea.height, 0);
  9189. smallText.drawRightAlignedString("FREE", k2 + 33, l2 + DrawingArea.height, 0xffff00);
  9190. } else {
  9191. smallText.drawRightAlignedString(value + "", k2 + 36, l2 + 1 + DrawingArea.height, 0);
  9192. smallText.drawRightAlignedString(value + "", k2 + 35, l2 + DrawingArea.height, 0xFFFF00);
  9193. }
  9194. }
  9195. continue;
  9196. }
  9197. if ((backDialogID != -1 || dialogID != -1 || child.disabledMessage.contains("Click here to continue")) && (class9.id == backDialogID || class9.id == dialogID)) {
  9198. if (color == 0xffff00) {
  9199. color = 255;
  9200. }
  9201. if (color == 49152) {
  9202. color = 0xffffff;
  9203. }
  9204. }
  9205. if((child.parentID == 1151) || (child.parentID == 12855)) {
  9206. switch (color) {
  9207. case 16773120:
  9208. color = 0xFE981F;
  9209. break;
  9210. case 7040819:
  9211. color = 0xAF6A1A;
  9212. break;
  9213. }
  9214. }
  9215. for (int l6 = l2 + textDrawingArea.anInt1497; message.length() > 0; l6 += textDrawingArea.anInt1497) {
  9216. if (message.indexOf("%") != -1) {
  9217. do {
  9218. int k7 = message.indexOf("%1");
  9219. if (k7 == -1)
  9220. break;
  9221. if (child.id < 4000 || child.id > 5000 && child.id != 13921 && child.id != 13922 && child.id != 12171 && child.id != 12172)
  9222. message = message.substring(0, k7) + methodR(extractInterfaceValues(child, 0)) + message.substring(k7 + 2);
  9223. else
  9224. message = message.substring(0, k7) + interfaceIntToString(extractInterfaceValues(child, 0)) + message.substring(k7 + 2);
  9225. } while (true);
  9226. do {
  9227. int l7 = message.indexOf("%2");
  9228. if (l7 == -1)
  9229. break;
  9230. message = message.substring(0, l7) + interfaceIntToString(extractInterfaceValues(child, 1)) + message.substring(l7 + 2);
  9231. } while (true);
  9232. do {
  9233. int i8 = message.indexOf("%3");
  9234. if (i8 == -1)
  9235. break;
  9236. message = message.substring(0, i8) + interfaceIntToString(extractInterfaceValues(child, 2)) + message.substring(i8 + 2);
  9237. } while (true);
  9238. do {
  9239. int j8 = message.indexOf("%4");
  9240. if (j8 == -1)
  9241. break;
  9242. message = message.substring(0, j8) + interfaceIntToString(extractInterfaceValues(child, 3)) + message.substring(j8 + 2);
  9243. } while (true);
  9244. do {
  9245. int k8 = message.indexOf("%5");
  9246. if (k8 == -1)
  9247. break;
  9248. message = message.substring(0, k8) + interfaceIntToString(extractInterfaceValues(child, 4)) + message.substring(k8 + 2);
  9249. } while (true);
  9250. }
  9251. int l8 = message.indexOf("\\n");
  9252. String s1;
  9253. if (l8 != -1) {
  9254. s1 = message.substring(0, l8);
  9255. message = message.substring(l8 + 2);
  9256. } else {
  9257. s1 = message;
  9258. message = "";
  9259. }
  9260. RSFont font;
  9261. if (textDrawingArea == smallText) {
  9262. font = newSmallFont;
  9263. } else if (textDrawingArea == regularText) {
  9264. font = newRegularFont;
  9265. } else if (textDrawingArea == boldText) {
  9266. font = newBoldFont;
  9267. } else {
  9268. font = newFancyFont;
  9269. }
  9270.  
  9271. if (child.centerText) {
  9272. font.drawCenteredString(s1, k2 + child.width / 2, l6, color, child.textShadow ? 0 : -1);
  9273. } else {
  9274. font.drawBasicString(s1, k2, l6, color, child.textShadow ? 0 : -1);
  9275. }
  9276. }
  9277. } else if (child.type == 5) {
  9278. Sprite sprite;
  9279. if (interfaceIsSelected(child))
  9280. sprite = child.enabledSprite;
  9281. else
  9282. sprite = child.disabledSprite;
  9283. if (spellSelected == 1 && child.id == spellID && spellID != 0 && sprite != null) {
  9284. sprite.drawSprite(k2, l2, 0xffffff);
  9285. if (child.drawsTransparent) {
  9286. sprite.drawTransparentSprite(k2, l2, 170);
  9287. } else {
  9288. sprite.drawSprite(k2, l2);
  9289. }
  9290. } else {
  9291. if (sprite != null)
  9292. if (child.drawsTransparent) {
  9293. sprite.drawTransparentSprite(k2, l2, 170);
  9294. } else {
  9295. // System.out.println("Hi");
  9296. sprite.drawSprite(k2, l2);
  9297. }
  9298. }
  9299. } else if (child.type == 6) {
  9300. int k3 = Rasterizer.centerX;
  9301. int j4 = Rasterizer.centerY;
  9302. Rasterizer.centerX = k2 + child.width / 2;
  9303. Rasterizer.centerY = l2 + child.height / 2;
  9304. int i5 = Rasterizer.anIntArray1470[child.modelRotation1] * child.modelZoom >> 16;
  9305. int l5 = Rasterizer.anIntArray1471[child.modelRotation1] * child.modelZoom >> 16;
  9306. boolean flag2 = interfaceIsSelected(child);
  9307. int i7;
  9308. if (flag2)
  9309. i7 = child.anInt258;
  9310. else
  9311. i7 = child.anInt257;
  9312. Model model;
  9313. if (i7 == -1) {
  9314. model = child.method209(-1, -1, flag2);
  9315. } else {
  9316. Animation animation = Animation.anims[i7];
  9317. model = child.method209(animation.anIntArray354[child.anInt246], animation.anIntArray353[child.anInt246], flag2);
  9318. }
  9319. if (model != null)
  9320. model.method482(child.modelRotation2, 0, child.modelRotation1, 0, i5, l5);
  9321. Rasterizer.centerX = k3;
  9322. Rasterizer.centerY = j4;
  9323. } else if (child.type == 7) {
  9324. TextDrawingArea textDrawingArea_1 = child.textDrawingAreas;
  9325. int k4 = 0;
  9326. for (int j5 = 0; j5 < child.height; j5++) {
  9327. for (int i6 = 0; i6 < child.width; i6++) {
  9328. if (child.inv[k4] > 0) {
  9329. ItemDef itemDef = ItemDef.forID(child.inv[k4] - 1);
  9330. String s2 = itemDef.name;
  9331. if (itemDef.stackable || child.invStackSizes[k4] != 1)
  9332. s2 = s2 + " x" + intToKOrMilLongName(child.invStackSizes[k4]);
  9333. int i9 = k2 + i6 * (115 + child.invSpritePadX);
  9334. int k9 = l2 + j5 * (12 + child.invSpritePadY);
  9335. if (child.centerText)
  9336. textDrawingArea_1.method382(child.textColor, i9 + child.width / 2, s2, k9, child.textShadow);
  9337. else
  9338. textDrawingArea_1.method389(child.textShadow, i9, child.textColor, s2, k9);
  9339. }
  9340. k4++;
  9341. }
  9342. }
  9343. } else if (child.type == 9) {
  9344. drawTooltip(k2, l2, child.popupString);
  9345. } else if (child.type == 8 && (anInt1500 == child.id || anInt1044 == child.id || anInt1129 == child.id) && anInt1501 == 0 && !menuOpen) {
  9346. int boxWidth = 0;
  9347. int boxHeight = 0;
  9348. String finalMessage = child.disabledMessage;
  9349. TextDrawingArea textDrawingArea_2 = regularText;
  9350.  
  9351. if (child.parentID == 3917 && extractInterfaceValues(child, 1) >= 99) {
  9352. String[] msg = finalMessage.split("\\\\n");
  9353. finalMessage = msg[0].concat("\\n").concat(msg[1]);
  9354. }
  9355.  
  9356. int skillId = child.parentID == 3917 ? finalMessage.split(":")[0].equals("Total level") ? 25 : Skills.getIdByName(finalMessage.split(":")[0]) : 0;
  9357.  
  9358. boolean showGoal = child.parentID == 3917 ? statsSkillGoal[skillId][0] > 0 : false;
  9359.  
  9360. int currentStats = 0;
  9361.  
  9362. if (showGoal) {
  9363. int remainder = 0;
  9364. if (skillId == 25) {
  9365. int exp = 0;
  9366. for (int i = 0; i < Skills.SKILLS_COUNT; i++)
  9367. if (Skills.SKILL_ENABLED[i])
  9368. exp += currentExp[i];
  9369. currentStats = exp;
  9370. remainder = statsSkillGoal[skillId][0] - exp;
  9371. } else {
  9372. currentStats = currentExp[skillId];
  9373. remainder = statsSkillGoal[skillId][1] == 1 ? (statsSkillGoal[skillId][0] - currentExp[skillId]) : (Skills.EXP_FOR_LEVEL[statsSkillGoal[skillId][0] - 2] - currentExp[skillId]);
  9374. }
  9375. if (remainder < 0) {
  9376. remainder = 0;
  9377. }
  9378. finalMessage = finalMessage.concat("\\n");
  9379. finalMessage = finalMessage.concat("Target " + (statsSkillGoal[skillId][1] == 1 ? " XP: " : "level: ") + NumberFormat.getInstance(Locale.US).format(statsSkillGoal[skillId][0]));
  9380. finalMessage = finalMessage.concat("\\n");
  9381. finalMessage = finalMessage.concat("Remainder: " + NumberFormat.getInstance(Locale.US).format(remainder));
  9382. boxHeight += 14;
  9383. }
  9384.  
  9385. for (String s1 = finalMessage; s1.length() > 0;) {
  9386. if (s1.indexOf("%") != -1) {
  9387. do {
  9388. int k7 = s1.indexOf("%1");
  9389. if (k7 == -1)
  9390. break;
  9391. s1 = s1.substring(0, k7) + NumberFormat.getInstance(Locale.US).format(extractInterfaceValues(child, 0)) + s1.substring(k7 + 2);
  9392. } while (true);
  9393. do {
  9394. int l7 = s1.indexOf("%2");
  9395. if (l7 == -1)
  9396. break;
  9397. s1 = s1.substring(0, l7) + NumberFormat.getInstance(Locale.US).format(extractInterfaceValues(child, 1)) + s1.substring(l7 + 2);
  9398. } while (true);
  9399. do {
  9400. int i8 = s1.indexOf("%3");
  9401. if (i8 == -1)
  9402. break;
  9403. s1 = s1.substring(0, i8) + NumberFormat.getInstance(Locale.US).format(extractInterfaceValues(child, 2)) + s1.substring(i8 + 2);
  9404. } while (true);
  9405. do {
  9406. int j8 = s1.indexOf("%4");
  9407. if (j8 == -1)
  9408. break;
  9409. s1 = s1.substring(0, j8) + NumberFormat.getInstance(Locale.US).format(extractInterfaceValues(child, 3)) + s1.substring(j8 + 2);
  9410. } while (true);
  9411. do {
  9412. int k8 = s1.indexOf("%5");
  9413. if (k8 == -1)
  9414. break;
  9415. s1 = s1.substring(0, k8) + NumberFormat.getInstance(Locale.US).format(extractInterfaceValues(child, 4)) + s1.substring(k8 + 2);
  9416. } while (true);
  9417. }
  9418. int l7 = s1.indexOf("\\n");
  9419. String s4;
  9420. if (l7 != -1) {
  9421. s4 = s1.substring(0, l7);
  9422. s1 = s1.substring(l7 + 2);
  9423. } else {
  9424. s4 = s1;
  9425. s1 = "";
  9426. }
  9427. int j10 = textDrawingArea_2.getTextWidth(s4);
  9428. if (j10 > boxWidth) {
  9429. boxWidth = j10;
  9430. }
  9431. boxHeight += textDrawingArea_2.anInt1497 + 2;
  9432. }
  9433. boxWidth += 6;
  9434. boxHeight += 7;
  9435.  
  9436. int xPos = (k2 + child.width) - 5 - boxWidth;
  9437. int yPos = l2 + child.height + 5;
  9438.  
  9439. if (xPos < k2 + 5) {
  9440. xPos = k2 + 5;
  9441. }
  9442.  
  9443. if (xPos + boxWidth > k + class9.width) {
  9444. xPos = (k + class9.width) - boxWidth;
  9445. }
  9446. if (yPos + boxHeight > l + class9.height) {
  9447. yPos = (l2 - boxHeight);
  9448. }
  9449.  
  9450. if (frameMode == ScreenMode.FIXED) {
  9451. if (skillHoverIds(child.id) == child.id && xPos + boxWidth + k + class9.width > 765) {
  9452. xPos = 765 - boxWidth - k - class9.width - 3;
  9453. }
  9454. } else {
  9455. if (skillHoverIds(child.id) == child.id && xPos + boxWidth > frameWidth) {
  9456. xPos = frameWidth - boxWidth - 15;
  9457. }
  9458. }
  9459. if (skillHoverIds(child.id) == child.id && yPos + boxHeight > frameHeight - (frameMode == ScreenMode.FIXED ? yPos + boxHeight - 118 : (frameWidth <= 1000 ? 75 : 35))) {
  9460. yPos -= boxHeight + 35;
  9461. }
  9462.  
  9463. DrawingArea.drawPixels(boxHeight, yPos, xPos, 0xFFFFA0, boxWidth);
  9464. DrawingArea.fillPixels(xPos, boxWidth, boxHeight, 0, yPos);
  9465.  
  9466. if (showGoal) {
  9467. int goal = statsSkillGoal[skillId][1] == 1 ? statsSkillGoal[skillId][0] : Skills.EXP_FOR_LEVEL[statsSkillGoal[skillId][0] - 2];
  9468. int init = statsSkillGoal[skillId][2];
  9469. double percentage = ((currentStats - init) / (double) (goal - init));
  9470. if (percentage > 1) {
  9471. percentage = 1;
  9472. }
  9473.  
  9474. DrawingArea.drawPixels(10, (yPos + boxHeight) - 16, xPos + 5, 0xFF0000, boxWidth - 10);
  9475. DrawingArea.drawPixels(10, (yPos + boxHeight) - 16, xPos + 5, 0x00FF00, (int) ((boxWidth - 10) * percentage));
  9476.  
  9477. DrawingArea.fillPixels(xPos + 4, boxWidth - 8, 12, 0, (yPos + boxHeight) - 17);
  9478.  
  9479. newSmallFont.drawCenteredString((int) (percentage * 100) + "%", xPos + 3 + (boxWidth / 2), (yPos + boxHeight) - 6, 0, -1);
  9480. }
  9481.  
  9482. String s2 = finalMessage;
  9483. for (int j11 = yPos + textDrawingArea_2.anInt1497 + 3; s2.length() > 0; j11 += textDrawingArea_2.anInt1497 + 2) {// anInt1497
  9484. if (s2.indexOf("%") != -1) {
  9485. do {
  9486. int k7 = s2.indexOf("%1");
  9487. if (k7 == -1)
  9488. break;
  9489. s2 = s2.substring(0, k7) + NumberFormat.getInstance(Locale.US).format(extractInterfaceValues(child, 0)) + s2.substring(k7 + 2);
  9490. } while (true);
  9491. do {
  9492. int l7 = s2.indexOf("%2");
  9493. if (l7 == -1)
  9494. break;
  9495. s2 = s2.substring(0, l7) + NumberFormat.getInstance(Locale.US).format(extractInterfaceValues(child, 1)) + s2.substring(l7 + 2);
  9496. } while (true);
  9497. do {
  9498. int i8 = s2.indexOf("%3");
  9499. if (i8 == -1)
  9500. break;
  9501. s2 = s2.substring(0, i8) + NumberFormat.getInstance(Locale.US).format(extractInterfaceValues(child, 2)) + s2.substring(i8 + 2);
  9502. } while (true);
  9503. do {
  9504. int j8 = s2.indexOf("%4");
  9505. if (j8 == -1)
  9506. break;
  9507. s2 = s2.substring(0, j8) + NumberFormat.getInstance(Locale.US).format(extractInterfaceValues(child, 3)) + s2.substring(j8 + 2);
  9508. } while (true);
  9509. do {
  9510. int k8 = s2.indexOf("%5");
  9511. if (k8 == -1)
  9512. break;
  9513. s2 = s2.substring(0, k8) + NumberFormat.getInstance(Locale.US).format(extractInterfaceValues(child, 4)) + s2.substring(k8 + 2);
  9514. } while (true);
  9515. }
  9516. int l11 = s2.indexOf("\\n");
  9517. String s5;
  9518. if (l11 != -1) {
  9519. s5 = s2.substring(0, l11);
  9520. s2 = s2.substring(l11 + 2);
  9521. } else {
  9522. s5 = s2;
  9523. s2 = "";
  9524. }
  9525. if (child.centerText) {
  9526. textDrawingArea_2.method382(yPos, xPos + child.width / 2, s5, j11, false);
  9527. } else {
  9528. if (s5.contains("\\r")) {
  9529. String text = s5.substring(0, s5.indexOf("\\r"));
  9530. String text2 = s5.substring(s5.indexOf("\\r") + 2);
  9531. textDrawingArea_2.method389(false, xPos + 3, 0, text, j11);
  9532. int rightX = boxWidth + xPos - textDrawingArea_2.getTextWidth(text2) - 2;
  9533. textDrawingArea_2.method389(false, rightX, 0, text2, j11);
  9534. System.out.println("Box: " + boxWidth + "");
  9535. } else {
  9536. if (s5.contains(":") && !s5.contains("/") && child.parentID == 3917) {
  9537. String[] result = s5.split(":");
  9538. textDrawingArea_2.method389(false, xPos + 3, 0, result[0] + ":", j11);
  9539. textDrawingArea_2.method389(false, xPos + boxWidth - textDrawingArea_2.getTextWidth(result[1]) - 3, 0, result[1], j11);
  9540. } else {
  9541. textDrawingArea_2.method389(false, xPos + 3, 0, s5, j11);
  9542. }
  9543. }
  9544. }
  9545. }
  9546. } else if (child.type == 16) {
  9547. int x = frameWidth - child.width - k2;
  9548. int y = frameHeight - class9.height + l2;
  9549.  
  9550. boolean hover = false;
  9551.  
  9552. int xx = class9.childX[j2] + (frameMode == ScreenMode.FIXED ? 0 : 0);
  9553. int yy = class9.childY[j2] + (frameMode == ScreenMode.FIXED ? 0 : 0);
  9554.  
  9555. if (tabInterfaceIDs[tabID] == child.parentID) {
  9556. xx = frameWidth - 197;
  9557. yy = frameWidth >= 1000 ? frameHeight - 280 : frameHeight - 262 + yy - j;
  9558. }
  9559.  
  9560. if (super.mouseX >= xx && super.mouseX <= xx + child.width && super.mouseY >= yy && super.mouseY <= yy + child.height) {
  9561. hover = true;
  9562. }
  9563.  
  9564. if (super.saveClickX >= xx && super.saveClickX <= xx + child.width && super.saveClickY >= yy && super.saveClickY <= yy + child.height) {
  9565. if (RSInterface.currentInputField != child) {
  9566. if (super.clickMode2 == 1 && !menuOpen) {
  9567. RSInterface.currentInputField = child;
  9568. }
  9569. }
  9570. }
  9571.  
  9572. int color;
  9573.  
  9574. if (RSInterface.currentInputField == child) {
  9575. color = child.anInt219;
  9576.  
  9577. if (hover) {
  9578. color = child.anInt239;
  9579. }
  9580. } else {
  9581. color = child.textColor;
  9582.  
  9583. if (hover) {
  9584. color = child.textHoverColor;
  9585. }
  9586. }
  9587.  
  9588. DrawingArea.drawPixels(child.height, l2, k2, color, child.width);
  9589. DrawingArea.fillPixels(k2, child.width, child.height, 0, l2);
  9590.  
  9591. x = k2;
  9592. y = l2;
  9593.  
  9594. StringBuilder builder = new StringBuilder();
  9595.  
  9596. String message = child.disabledMessage;
  9597.  
  9598. if (child.enabledMessage != null && RSInterface.currentInputField != child) {
  9599. message = child.enabledMessage;
  9600. }
  9601.  
  9602. if (child.displayAsterisks) {
  9603. boldText.method389(true, (x + 8), 0xFFFFFF, builder.append(TextClass.passwordAsterisks(message)).append(((RSInterface.currentInputField == child ? 1 : 0) & (loopCycle % 40 < 20 ? 1 : 0)) != 0 ? "|" : "").toString(), (y + (child.height / 2) + 6));
  9604. } else {
  9605. boldText.method389(true, (x + 8), 0xFFFFFF, builder.append(message).append(((RSInterface.currentInputField == child ? 1 : 0) & (loopCycle % 40 < 20 ? 1 : 0)) != 0 ? "|" : "").toString(), (y + (child.height / 2) + 6));
  9606. }
  9607. }
  9608. }
  9609. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  9610. }
  9611.  
  9612. public int skillHoverIds(int ids) {
  9613. int[] hoverIds = { 24138, 24139, 24140, 24141, 24142, 24143, 24144, 24145, 24146, 24147, 24148, 24149, 24150, 24151, 24152, 24153, 24154, 24155, 24156, 24157, 24158, 24159, 24160, 24161 };
  9614. for (int hover = 0; hover < hoverIds.length; hover++) {
  9615. if (hoverIds[hover] == ids) {
  9616. ids = hover;
  9617. return hoverIds[ids];
  9618. }
  9619. }
  9620. return 0;
  9621. }
  9622.  
  9623. private void randomizeBackground(Background background) {
  9624. int j = 256;
  9625. for (int k = 0; k < anIntArray1190.length; k++)
  9626. anIntArray1190[k] = 0;
  9627.  
  9628. for (int l = 0; l < 5000; l++) {
  9629. int i1 = (int) (Math.random() * 128D * (double) j);
  9630. anIntArray1190[i1] = (int) (Math.random() * 256D);
  9631. }
  9632. for (int j1 = 0; j1 < 20; j1++) {
  9633. for (int k1 = 1; k1 < j - 1; k1++) {
  9634. for (int i2 = 1; i2 < 127; i2++) {
  9635. int k2 = i2 + (k1 << 7);
  9636. anIntArray1191[k2] = (anIntArray1190[k2 - 1] + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128] + anIntArray1190[k2 + 128]) / 4;
  9637. }
  9638.  
  9639. }
  9640. int ai[] = anIntArray1190;
  9641. anIntArray1190 = anIntArray1191;
  9642. anIntArray1191 = ai;
  9643. }
  9644. if (background != null) {
  9645. int l1 = 0;
  9646. for (int j2 = 0; j2 < background.anInt1453; j2++) {
  9647. for (int l2 = 0; l2 < background.anInt1452; l2++)
  9648. if (background.aByteArray1450[l1++] != 0) {
  9649. int i3 = l2 + 16 + background.anInt1454;
  9650. int j3 = j2 + 16 + background.anInt1455;
  9651. int k3 = i3 + (j3 << 7);
  9652. anIntArray1190[k3] = 0;
  9653. }
  9654. }
  9655. }
  9656. }
  9657.  
  9658. private void appendPlayerUpdateMask(int i, int j, Stream stream, Player player) {
  9659. if ((i & 0x400) != 0) {
  9660. player.anInt1543 = stream.method428();
  9661. player.anInt1545 = stream.method428();
  9662. player.anInt1544 = stream.method428();
  9663. player.anInt1546 = stream.method428();
  9664. player.anInt1547 = stream.method436() + loopCycle;
  9665. player.anInt1548 = stream.method435() + loopCycle;
  9666. player.anInt1549 = stream.method428();
  9667. player.method446();
  9668. }
  9669. if ((i & 0x100) != 0) {
  9670. player.anInt1520 = stream.method434();
  9671. int k = stream.readDWord();
  9672. player.anInt1524 = k >> 16;
  9673. player.anInt1523 = loopCycle + (k & 0xffff);
  9674. player.anInt1521 = 0;
  9675. player.anInt1522 = 0;
  9676. if (player.anInt1523 > loopCycle)
  9677. player.anInt1521 = -1;
  9678. if (player.anInt1520 == 65535)
  9679. player.anInt1520 = -1;
  9680. }
  9681. if ((i & 8) != 0) {
  9682. int l = stream.method434();
  9683. if (l == 65535)
  9684. l = -1;
  9685. int i2 = stream.method427();
  9686. if (l == player.anim && l != -1) {
  9687. int i3 = Animation.anims[l].anInt365;
  9688. if (i3 == 1) {
  9689. player.anInt1527 = 0;
  9690. player.anInt1528 = 0;
  9691. player.anInt1529 = i2;
  9692. player.anInt1530 = 0;
  9693. }
  9694. if (i3 == 2)
  9695. player.anInt1530 = 0;
  9696. } else if (l == -1 || player.anim == -1 || Animation.anims[l].anInt359 >= Animation.anims[player.anim].anInt359) {
  9697. player.anim = l;
  9698. player.anInt1527 = 0;
  9699. player.anInt1528 = 0;
  9700. player.anInt1529 = i2;
  9701. player.anInt1530 = 0;
  9702. player.anInt1542 = player.smallXYIndex;
  9703. }
  9704. }
  9705. if ((i & 4) != 0) {
  9706. player.textSpoken = stream.readString();
  9707. if (player.textSpoken.charAt(0) == '~') {
  9708. player.textSpoken = player.textSpoken.substring(1);
  9709. pushMessage(player.textSpoken, 2, player.name, player.title, player.titleColor);
  9710. } else if (player == myPlayer)
  9711. pushMessage(player.textSpoken, 2, player.name, player.title, player.titleColor);
  9712. player.anInt1513 = 0;
  9713. player.anInt1531 = 0;
  9714. player.textCycle = 150;
  9715. }
  9716. if ((i & 0x80) != 0) {
  9717. // right fucking here
  9718. int i1 = stream.method434();
  9719. int j2 = stream.readUnsignedByte();
  9720. int j3 = stream.method427();
  9721. int k3 = stream.currentOffset;
  9722. if (player.name != null && player.visible) {
  9723. long l3 = TextClass.longForName(player.name);
  9724. boolean flag = false;
  9725. if (j2 <= 1) {
  9726. for (int i4 = 0; i4 < ignoreCount; i4++) {
  9727. if (ignoreListAsLongs[i4] != l3)
  9728. continue;
  9729. flag = true;
  9730. break;
  9731. }
  9732.  
  9733. }
  9734. if (!flag && anInt1251 == 0)
  9735. try {
  9736. aStream_834.currentOffset = 0;
  9737. stream.method442(j3, 0, aStream_834.buffer);
  9738. aStream_834.currentOffset = 0;
  9739. String s = TextInput.method525(j3, aStream_834);
  9740. // s = Censor.doCensor(s);
  9741. player.textSpoken = s;
  9742. player.anInt1513 = i1 >> 8;
  9743. player.privelage = j2;
  9744. player.anInt1531 = i1 & 0xff;
  9745. player.textCycle = 150;
  9746. if (j2 >= 1)
  9747. pushMessage(s, 1, "@cr" + j2 + "@" + player.name, player.title, player.titleColor);
  9748. else
  9749. pushMessage(s, 2, player.name, player.title, player.titleColor);
  9750. } catch (Exception exception) {
  9751. Signlink.reporterror("cde2");
  9752. exception.printStackTrace();
  9753. }
  9754. }
  9755. stream.currentOffset = k3 + j3;
  9756. }
  9757. if ((i & 1) != 0) {
  9758. player.interactingEntity = stream.method434();
  9759. if (player.interactingEntity == 65535)
  9760. player.interactingEntity = -1;
  9761. }
  9762. if ((i & 0x10) != 0) {
  9763. int j1 = stream.method427();
  9764. byte abyte0[] = new byte[j1];
  9765. Stream stream_1 = new Stream(abyte0);
  9766. stream.readBytes(j1, 0, abyte0);
  9767. aStreamArray895s[j] = stream_1;
  9768. player.updatePlayer(stream_1);
  9769. }
  9770. if ((i & 2) != 0) {
  9771. player.anInt1538 = stream.method436();
  9772. player.anInt1539 = stream.method434();
  9773. }
  9774. if ((i & 0x20) != 0) {
  9775. int k1 = stream.readUnsignedByte();
  9776. int k2 = stream.method426();
  9777. int icon = stream.readUnsignedByte();
  9778. player.updateHitData(k2, k1, loopCycle, icon);
  9779. player.loopCycleStatus = loopCycle + 300;
  9780. player.currentHealth = stream.method427();
  9781. player.maxHealth = stream.readUnsignedByte();
  9782. }
  9783. if ((i & 0x200) != 0) {
  9784. int l1 = stream.readUnsignedByte();
  9785. int l2 = stream.method428();
  9786. int icon = stream.readUnsignedByte();
  9787. player.updateHitData(l2, l1, loopCycle, icon);
  9788. player.loopCycleStatus = loopCycle + 300;
  9789. player.currentHealth = stream.readUnsignedByte();
  9790. player.maxHealth = stream.method427();
  9791. }
  9792. }
  9793.  
  9794. private void method108() {
  9795. try {
  9796. int x = myPlayer.x + anInt1278;
  9797. int y = myPlayer.y + anInt1131;
  9798. double rotSpeed = 2;
  9799. if (!Configuration.enableScreenGliding) {
  9800. screenGliding = 0;
  9801. }
  9802. if (anInt1014 - x < -500 || anInt1014 - x > 500 || anInt1015 - y < -500 || anInt1015 - y > 500) {
  9803. anInt1014 = x;
  9804. anInt1015 = y;
  9805. }
  9806. if (anInt1014 != x) {
  9807. anInt1014 += (x - anInt1014) / 16;
  9808. }
  9809. if (anInt1015 != y) {
  9810. anInt1015 += (y - anInt1015) / 16;
  9811. }
  9812. if (super.keyArray[1] == 1) {
  9813. anInt1186 += (-24 - anInt1186) / rotSpeed;
  9814. screenGliding++;
  9815. } else if (super.keyArray[2] == 1) {
  9816. anInt1186 += (24 - anInt1186) / rotSpeed;
  9817. screenGliding++;
  9818. } else {
  9819. if (screenGliding >= 10) {
  9820. if (anInt1186 > 0) {
  9821. anInt1186--;
  9822. } else if (anInt1186 < 0) {
  9823. anInt1186++;
  9824. }
  9825. } else {
  9826. anInt1186 /= rotSpeed;
  9827. }
  9828. }
  9829. if (super.keyArray[3] == 1) {
  9830. anInt1187 += (12 - anInt1187) / rotSpeed;
  9831. screenGliding++;
  9832. } else if (super.keyArray[4] == 1) {
  9833. anInt1187 += (-12 - anInt1187) / rotSpeed;
  9834. screenGliding++;
  9835. } else {
  9836. if (screenGliding >= 10) {
  9837. if (anInt1187 > 0) {
  9838. anInt1187--;
  9839. } else if (anInt1187 < 0) {
  9840. anInt1187++;
  9841. }
  9842. } else {
  9843. anInt1187 /= rotSpeed;
  9844. }
  9845. }
  9846. minimapInt1 = minimapInt1 + anInt1186 / (int) rotSpeed & 0x7ff;
  9847. anInt1184 += anInt1187 / rotSpeed;
  9848. if (anInt1184 < 128) {
  9849. anInt1184 = 128;
  9850. }
  9851. if (anInt1184 > 383) {
  9852. anInt1184 = 383;
  9853. }
  9854. int l = anInt1014 >> 7;
  9855. int i1 = anInt1015 >> 7;
  9856. int j1 = method42(plane, anInt1015, anInt1014);
  9857. int k1 = 0;
  9858. if (l > 3 && i1 > 3 && l < 100 && i1 < 100) {
  9859. for (int l1 = l - 4; l1 <= l + 4; l1++) {
  9860. for (int k2 = i1 - 4; k2 <= i1 + 4; k2++) {
  9861. int l2 = plane;
  9862. if (l2 < 3 && (byteGroundArray[1][l1][k2] & 2) == 2)
  9863. l2++;
  9864. int i3 = j1 - intGroundArray[l2][l1][k2];
  9865. if (i3 > k1)
  9866. k1 = i3;
  9867. }
  9868.  
  9869. }
  9870.  
  9871. }
  9872. anInt1005++;
  9873. if (anInt1005 > 1512) {
  9874. anInt1005 = 0;
  9875. stream.createFrame(77);
  9876. stream.writeWordBigEndian(0);
  9877. int i2 = stream.currentOffset;
  9878. stream.writeWordBigEndian((int) (Math.random() * 256D));
  9879. stream.writeWordBigEndian(101);
  9880. stream.writeWordBigEndian(233);
  9881. stream.writeWord(45092);
  9882. if ((int) (Math.random() * 2D) == 0)
  9883. stream.writeWord(35784);
  9884. stream.writeWordBigEndian((int) (Math.random() * 256D));
  9885. stream.writeWordBigEndian(64);
  9886. stream.writeWordBigEndian(38);
  9887. stream.writeWord((int) (Math.random() * 65536D));
  9888. stream.writeWord((int) (Math.random() * 65536D));
  9889. stream.writeBytes(stream.currentOffset - i2);
  9890. }
  9891. int j2 = k1 * 192;
  9892. if (j2 > 0x17f00)
  9893. j2 = 0x17f00;
  9894. if (j2 < 32768)
  9895. j2 = 32768;
  9896. if (j2 > anInt984) {
  9897. anInt984 += (j2 - anInt984) / 24;
  9898. return;
  9899. }
  9900. if (j2 < anInt984) {
  9901. anInt984 += (j2 - anInt984) / 80;
  9902. }
  9903. } catch (Exception _ex) {
  9904. Signlink.reporterror("glfc_ex " + myPlayer.x + "," + myPlayer.y + "," + anInt1014 + "," + anInt1015 + "," + anInt1069 + "," + anInt1070 + "," + baseX + "," + baseY);
  9905. throw new RuntimeException("eek");
  9906. }
  9907. }
  9908.  
  9909. public void processDrawing() {
  9910. if (rsAlreadyLoaded || loadingError || genericLoadingError) {
  9911. showErrorScreen();
  9912. return;
  9913. }
  9914. if (!loggedIn)
  9915. loginRenderer.displayLoginScreen();
  9916. else
  9917. drawGameScreen();
  9918. anInt1213 = 0;
  9919. }
  9920.  
  9921. private boolean isFriendOrSelf(String s) {
  9922. if (s == null)
  9923. return false;
  9924. for (int i = 0; i < friendsCount; i++)
  9925. if (s.equalsIgnoreCase(friendsList[i]))
  9926. return true;
  9927. return s.equalsIgnoreCase(myPlayer.name);
  9928. }
  9929.  
  9930. private static String combatDiffColor(int i, int j) {
  9931. int k = i - j;
  9932. if (k < -9)
  9933. return "@red@";
  9934. if (k < -6)
  9935. return "@or3@";
  9936. if (k < -3)
  9937. return "@or2@";
  9938. if (k < 0)
  9939. return "@or1@";
  9940. if (k > 9)
  9941. return "@gre@";
  9942. if (k > 6)
  9943. return "@gr3@";
  9944. if (k > 3)
  9945. return "@gr2@";
  9946. if (k > 0)
  9947. return "@gr1@";
  9948. else
  9949. return "@yel@";
  9950. }
  9951.  
  9952. private void setWaveVolume(int i) {
  9953. Signlink.wavevol = i;
  9954. }
  9955.  
  9956. public static String formatCoins(long amount) {
  9957. if (amount >= 1_000 && amount < 1_000_000) {
  9958. return "" + (amount / 1_000) + "K";
  9959. }
  9960.  
  9961. if (amount >= 1_000_000 && amount < 1_000_000_000) {
  9962. return "" + (amount / 1_000_000) + "M";
  9963. }
  9964.  
  9965. if (amount >= 1_000_000_000 && amount < 1_000_000_000_000L) {
  9966. return "" + (amount / 1_000_000_000) + "B";
  9967. }
  9968.  
  9969. if (amount >= 1_000_000_000_000L && amount < 1_000_000_000_000_000L) {
  9970. return "" + (amount / 1_000_000_000_000L) + "T";
  9971. }
  9972.  
  9973. if (amount >= 1_000_000_000_000_000L && amount < 1_000_000_000_000_000_000L) {
  9974. return "" + (amount / 1_000_000_000_000_000L) + "F";
  9975. }
  9976.  
  9977. if (amount >= 1_000_000_000_000_000_000L) {
  9978. return "" + (amount / 1_000_000_000_000_000_000L) + "A";
  9979. }
  9980. return "" + amount;
  9981. }
  9982.  
  9983. private int getMoneyOrbColor(long amount) {
  9984. if (amount >= 0 && amount <= 99999) {
  9985. return 0xFFFF00;
  9986. } else if (amount >= 100000 && amount <= 9999999) {
  9987. return 0xFFFFFF;
  9988. } else {
  9989. return 0x00FF80;
  9990. }
  9991. }
  9992.  
  9993. private void draw3dScreen() {
  9994. if (counterOn) {
  9995. drawCounterOnScreen();
  9996. }
  9997.  
  9998. if (showChatComponents) {
  9999. drawSplitPrivateChat();
  10000. }
  10001.  
  10002. BannerManager.drawMovingBanner();
  10003.  
  10004. if (crossType == 1) {
  10005. int offSet = frameMode == ScreenMode.FIXED ? 4 : 0;
  10006. crosses[crossIndex / 100].drawSprite(crossX - 8 - offSet, crossY - 8 - offSet);
  10007. anInt1142++;
  10008. if (anInt1142 > 67) {
  10009. anInt1142 = 0;
  10010. stream.createFrame(78);
  10011. }
  10012. }
  10013. if (crossType == 2) {
  10014. int offSet = frameMode == ScreenMode.FIXED ? 4 : 0;
  10015. crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - offSet, crossY - 8 - offSet);
  10016. }
  10017.  
  10018. /** Loading Walkable Interfaces */
  10019. if (inBarrows(baseX + (myPlayer.x - 6 >> 7), baseY + (myPlayer.y - 6 >> 7), plane)) {
  10020. anInt1018 = 59000;
  10021. } else if (inGWD(baseX + (myPlayer.x - 6 >> 7), baseY + (myPlayer.y - 6 >> 7), plane)) {
  10022. anInt1018 = 61750;
  10023. } else if (inWGLobby(baseX + (myPlayer.x - 6 >> 7), baseY + (myPlayer.y - 6 >> 7), plane)) {
  10024. anInt1018 = 41250;
  10025. } else if (inWGGame(baseX + (myPlayer.x - 6 >> 7), baseY + (myPlayer.y - 6 >> 7), plane)) {
  10026. anInt1018 = 41270;
  10027. } else if (inCyclops(baseX + (myPlayer.x - 6 >> 7), baseY + (myPlayer.y - 6 >> 7), plane)) {
  10028. anInt1018 = 51200;
  10029. } else if (inPcBoat(baseX + (myPlayer.x - 6 >> 7), baseY + (myPlayer.y - 6 >> 7), plane)) {
  10030. anInt1018 = 21119;
  10031. } else if (inPcGame(baseX + (myPlayer.x - 6 >> 7), baseY + (myPlayer.y - 6 >> 7), plane)) {
  10032. anInt1018 = 21100;
  10033. } else if (inWilderness(baseX + (myPlayer.x - 6 >> 7), baseY + (myPlayer.y - 6 >> 7), plane) && Configuration.economyWorld) {
  10034. anInt1018 = 23300;
  10035. } else if (inPvP(baseX + (myPlayer.x - 6 >> 7), baseY + (myPlayer.y - 6 >> 7), plane) && !Configuration.economyWorld) {
  10036. anInt1018 = 60250;
  10037. } else if (inSafe(baseX + (myPlayer.x - 6 >> 7), baseY + (myPlayer.y - 6 >> 7), plane) && !Configuration.economyWorld) {
  10038. anInt1018 = 60350;
  10039. } else if (Configuration.snow) {
  10040. anInt1018 = 11877;
  10041. } else {
  10042. anInt1018 = -1;
  10043. }
  10044. /** End */
  10045.  
  10046. if (anInt1018 != -1) {
  10047. RSInterface rsInterface = RSInterface.interfaceCache[anInt1018];
  10048. method119(anInt945, anInt1018);
  10049.  
  10050. if (anInt1018 == 11146 && frameMode != ScreenMode.FIXED) {
  10051. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], -5);
  10052. } else if (anInt1018 == 23300) {
  10053. drawInterface(0, frameWidth - rsInterface.width - 253, rsInterface, 0);
  10054. } else if (anInt1018 == 23300 && frameMode == ScreenMode.RESIZABLE) {
  10055. drawInterface(0, frameWidth / 2 - 780, RSInterface.interfaceCache[anInt1018], 80);
  10056. } else if ((anInt1018 == 2804 || anInt1018 == 11479) && frameMode != ScreenMode.FIXED) {
  10057. drawInterface(0, frameWidth / 2 - 1010, RSInterface.interfaceCache[anInt1018], 80);
  10058. } else if (anInt1018 == 41270 && frameMode != ScreenMode.FIXED) {
  10059. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 8);
  10060. } else if (anInt1018 == 41250 && frameMode != ScreenMode.FIXED) {
  10061. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 8);
  10062. } else if (anInt1018 == 201 && frameMode != ScreenMode.FIXED) {
  10063. drawInterface(0, frameWidth - 520, RSInterface.interfaceCache[anInt1018], -110);
  10064. } else if (anInt1018 == 41270 && frameMode != ScreenMode.FIXED) {
  10065. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 8);
  10066. } else if (anInt1018 == 41250 && frameMode != ScreenMode.FIXED) {
  10067. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 8);
  10068. } else if (anInt1018 == 59000 && frameMode != ScreenMode.FIXED) {
  10069. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], frameHeight - 495);
  10070. } else if (anInt1018 == 21119 && frameMode != ScreenMode.FIXED) {
  10071. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 5);
  10072. } else if (anInt1018 == 21100 && frameMode != ScreenMode.FIXED) {
  10073. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 5);
  10074. } else if (anInt1018 == 51200 && frameMode != ScreenMode.FIXED) {
  10075. drawInterface(0, frameWidth - 770, RSInterface.interfaceCache[anInt1018], 25);
  10076. } else if (anInt1018 == 61750 && frameMode != ScreenMode.FIXED) {
  10077. drawInterface(0, frameWidth - 800, RSInterface.interfaceCache[anInt1018], 5);
  10078. } else if (anInt1018 == 4535 && frameMode != ScreenMode.FIXED) {
  10079. drawInterface(0, -418, RSInterface.interfaceCache[anInt1018], -285);
  10080. } else if ((anInt1018 == 15892 || anInt1018 == 15917 || anInt1018 == 15931 || anInt1018 == 15962) && frameMode != ScreenMode.FIXED) {
  10081. drawInterface(0, (anInt1018 == 15892 ? -325 : -349), RSInterface.interfaceCache[anInt1018], 25);
  10082. } else
  10083. drawInterface(0, frameMode == ScreenMode.FIXED ? 0 : (frameWidth / 2) - -80, RSInterface.interfaceCache[anInt1018], frameMode == ScreenMode.FIXED ? 0 : (frameHeight / 2) - 550);
  10084. }
  10085. if (openInterfaceID == 5292) {
  10086. method119(anInt945, openInterfaceID);
  10087. drawInterface(0, frameMode == ScreenMode.FIXED ? 0 : (frameWidth / 2) - 356, RSInterface.interfaceCache[openInterfaceID], frameMode == ScreenMode.FIXED ? 0 : (frameHeight / 2) - 230);
  10088. } else if (openInterfaceID != -1 && openInterfaceID != 5292) {
  10089. method119(anInt945, openInterfaceID);
  10090. int w = 512, h = 334;
  10091. int x = frameMode == ScreenMode.FIXED ? 0 : (frameWidth / 2) - 256;
  10092. int y = frameMode == ScreenMode.FIXED ? 0 : (frameHeight / 2) - 167;
  10093. int count = !changeTabArea ? 4 : 3;
  10094. if (frameMode != ScreenMode.FIXED) {
  10095. for (int i = 0; i < count; i++) {
  10096. if (x + w > (frameWidth - 225)) {
  10097. x = x - 30;
  10098. if (x < 0) {
  10099. x = 0;
  10100. }
  10101. }
  10102. if (y + h > (frameHeight - 182)) {
  10103. y = y - 30;
  10104. if (y < 0) {
  10105. y = 0;
  10106. }
  10107. }
  10108. }
  10109. }
  10110. drawInterface(0, x, RSInterface.interfaceCache[openInterfaceID], y);
  10111. }
  10112. if (!menuOpen) {
  10113. processRightClick();
  10114. drawTooltip();
  10115. } else if (menuScreenArea == 0) {
  10116. drawMenu(frameMode == ScreenMode.FIXED ? 4 : 0, frameMode == ScreenMode.FIXED ? 4 : 0);
  10117. }
  10118. if (anInt1055 == 1) {
  10119. multiOverlay.drawSprite(frameMode == ScreenMode.FIXED ? 472 : frameWidth - 165, frameMode == ScreenMode.FIXED ? 296 : 160);
  10120. }
  10121. if (fpsOn) {
  10122. int textColour = 0xffff00;
  10123. if (super.fps < 15) {
  10124. textColour = 0xff0000;
  10125. }
  10126. regularText.method385(textColour, "Fps: " + super.fps, 12, 5);
  10127. Runtime runtime = Runtime.getRuntime();
  10128. int memUsage = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  10129. textColour = 0xffff00;
  10130. if (memUsage > 0x2000000 && lowMem) {
  10131. textColour = 0xff0000;
  10132. }
  10133. regularText.method385(textColour, "Mem: " + memUsage + "k", 27, 5);
  10134. }
  10135. int x = baseX + (myPlayer.x - 6 >> 7);
  10136. int y = baseY + (myPlayer.y - 6 >> 7);
  10137. final String screenMode = frameMode == ScreenMode.FIXED ? "Fixed" : "Resizable";
  10138. if (clientData) {
  10139. int textColour = 0xffff00;
  10140. int fpsColour = 0xffff00;
  10141. if (super.fps < 15) {
  10142. fpsColour = 0xff0000;
  10143. }
  10144. smallText.method385(textColour, "Frame Width: " + (mouseX - frameWidth) + ", Frame Height: " + (mouseY - frameHeight), frameHeight - 271, 5);
  10145. smallText.method385(textColour, "Client Zoom: " + cameraZoom, frameHeight - 257, 5);
  10146. smallText.method385(fpsColour, "Fps: " + super.fps, frameHeight - 243, 5);
  10147. Runtime runtime = Runtime.getRuntime();
  10148. int clientMemory = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  10149. smallText.method385(textColour, "Memory Usage: " + NumberFormat.getInstance().format(clientMemory) + "k", frameHeight - 229, 5);
  10150. smallText.method385(textColour, "Mouse X: " + mouseX + ", Mouse Y: " + mouseY, frameHeight - 215, 5);
  10151. smallText.method385(textColour, "Coords: " + x + ", " + y, frameHeight - 201, 5);
  10152. smallText.method385(textColour, "Client Mode: " + screenMode + "", frameHeight - 187, 5);
  10153. smallText.method385(textColour, "Client Resolution: " + frameWidth + "x" + frameHeight, frameHeight - 173, 5);
  10154. }
  10155. if (anInt1104 != 0) {
  10156. int j = anInt1104 / 50;
  10157. int l = j / 60;
  10158. int yOffset = frameMode == ScreenMode.FIXED ? 0 : frameHeight - 498;
  10159. j %= 60;
  10160. if (j < 10)
  10161. smallText.method385(0xffff00, "System update in: " + l + ":0" + j, 329 + yOffset, 4);
  10162. else
  10163. smallText.method385(0xffff00, "System update in: " + l + ":" + j, 329 + yOffset, 4);
  10164. anInt849++;
  10165. if (anInt849 > 75) {
  10166. anInt849 = 0;
  10167. stream.createFrame(148);
  10168. }
  10169. }
  10170. }
  10171.  
  10172. static final class BannerManager {
  10173.  
  10174. static class Banner {
  10175.  
  10176. private final String text;
  10177.  
  10178. private int x;
  10179.  
  10180. private final int color;
  10181.  
  10182. private int opacity = 0;
  10183.  
  10184. private long leasureTime = 0;
  10185.  
  10186. public Banner(String text, int color) {
  10187. this.text = text;
  10188. this.color = color;
  10189. this.x = frameWidth - (frameMode == ScreenMode.FIXED ? 253 : 155);
  10190. }
  10191.  
  10192. public int getColor() {
  10193. return color;
  10194. }
  10195.  
  10196. public String getText() {
  10197. return text;
  10198. }
  10199.  
  10200. public int getX() {
  10201. return x;
  10202. }
  10203.  
  10204. public int getOpacity() {
  10205. return opacity;
  10206. }
  10207.  
  10208. public void update() {
  10209. if (x <= 0) {
  10210. banner = null;
  10211. return;
  10212. }
  10213.  
  10214. int width = frameWidth - (frameMode == ScreenMode.FIXED ? 253 : 155);
  10215. int delta = 4 * (1 << (int) (width / (765.0 - (frameMode == ScreenMode.FIXED ? 253 : 155))));
  10216.  
  10217. if (x < width / 2.0) {
  10218. if (opacity - delta >= 0) {
  10219. opacity -= delta;
  10220. }
  10221. } else {
  10222. if (opacity + delta <= 255) {
  10223. opacity += delta;
  10224. }
  10225. }
  10226.  
  10227. if (System.currentTimeMillis() - leasureTime >= 2500) {
  10228. x -= delta;
  10229. }
  10230.  
  10231. if (leasureTime == 0) {
  10232. int center = (int) ((width + newFancyFont.getTextWidth(text)) / 2.0);
  10233.  
  10234. if (x >= center - delta && x <= center + delta) {
  10235. leasureTime = System.currentTimeMillis();
  10236. }
  10237. }
  10238. }
  10239. }
  10240.  
  10241. public static Client instance;
  10242.  
  10243. private static Banner banner;
  10244.  
  10245. public static void addBanner(String text, int color) {
  10246. System.out.println(text + " _ " + color);
  10247. banner = new Banner(text, color);
  10248. }
  10249.  
  10250. public static void drawMovingBanner() {
  10251.  
  10252. if (banner == null) {
  10253. return;
  10254. }
  10255.  
  10256. DrawingArea.drawAlphaPixels(0, 20, frameWidth, 50, banner.getColor(), banner.getOpacity());
  10257. newFancyFont.drawRAString(banner.getText(), banner.getX(), 52, 0xFFFFFF, 0x0);
  10258.  
  10259. banner.update();
  10260. }
  10261. }
  10262.  
  10263. private final boolean inBarrows(int x, int y, int z) {
  10264. return (x > 3539 && x < 3582 && y >= 9675 && y < 9722) || x > 3532 && x < 3546 && y > 9698 && y < 9709;
  10265. }
  10266.  
  10267. public final boolean inCyclops(int x, int y, int z) {
  10268. return (x >= 2847 && x <= 2876 && y >= 3534 && y <= 3556 && z == 2 || x >= 2838 && x <= 2847 && y >= 3543 && y <= 3556 && z == 2);
  10269. }
  10270.  
  10271. private final boolean inWGGame(int x, int y, int z) {
  10272. return (x > 2136 && x < 2166 && y > 5089 && y < 5108);
  10273. }
  10274.  
  10275. private final boolean inWGLobby(int x, int y, int z) {
  10276. return (x > 1859 && x < 1868 && y > 5316 && y < 5323);
  10277. }
  10278.  
  10279. private final boolean inGWD(int x, int y, int z) {
  10280. return (x > 2816 && x < 2960 && y >= 5243 && y < 5400);
  10281. }
  10282.  
  10283. public boolean inPcBoat(int x, int y, int z) {
  10284. return (x >= 2660 && x <= 2663 && y >= 2638 && y <= 2643);
  10285. }
  10286.  
  10287. public boolean inPcGame(int x, int y, int z) {
  10288. return (x >= 2624 && x <= 2690 && y >= 2550 && y <= 2619);
  10289. }
  10290.  
  10291. public boolean inWilderness(int x, int y, int z) {
  10292. return (x > 2941 && x < 3392 && y > 3521 && y < 3966) || (x > 2941 && x < 3392 && y > 9918 && y < 10366);
  10293. }
  10294.  
  10295. public boolean inMaze(int x, int y, int z) {
  10296. return (x > 1);
  10297. }
  10298.  
  10299. public boolean inSafe(int x, int y, int z) {
  10300. return (x >= 3180 && x <= 3190 && y >= 3433 && y <= 3447) || (x >= 3091 && x <= 3098 && y >= 3488 && y <= 3499);
  10301. }
  10302.  
  10303. public boolean inPvP(int x, int y, int z) {
  10304. return (inSafe(x, y, z) ? false : true);
  10305. }
  10306.  
  10307. private void addIgnore(long l) {
  10308. try {
  10309. if (l == 0L)
  10310. return;
  10311. if (ignoreCount >= 100) {
  10312. pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
  10313. return;
  10314. }
  10315. String s = TextClass.fixName(TextClass.nameForLong(l));
  10316. if (s.equals(myPlayer.name)) {
  10317. pushMessage("You may not ignore yourself!", 0, "");
  10318. return;
  10319. }
  10320. for (int j = 0; j < ignoreCount; j++)
  10321. if (ignoreListAsLongs[j] == l) {
  10322. pushMessage(s + " is already on your ignore list", 0, "");
  10323. return;
  10324. }
  10325. for (int k = 0; k < friendsCount; k++)
  10326. if (friendsListAsLongs[k] == l) {
  10327. pushMessage("Please remove " + s + " from your friend list first", 0, "");
  10328. return;
  10329. }
  10330.  
  10331. ignoreListAsLongs[ignoreCount++] = l;
  10332. stream.createFrame(133);
  10333. stream.writeQWord(l);
  10334. return;
  10335. } catch (RuntimeException runtimeexception) {
  10336. Signlink.reporterror("45688, " + l + ", " + 4 + ", " + runtimeexception.toString());
  10337. }
  10338. throw new RuntimeException();
  10339. }
  10340.  
  10341. private void method114() {
  10342. for (int i = -1; i < playerCount; i++) {
  10343. int j;
  10344. if (i == -1)
  10345. j = myPlayerIndex;
  10346. else
  10347. j = playerIndices[i];
  10348. Player player = playerArray[j];
  10349. if (player != null)
  10350. method96(player);
  10351. }
  10352.  
  10353. }
  10354.  
  10355. private void method115() {
  10356. if (loadingStage == 2) {
  10357. for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179.reverseGetNext()) {
  10358. if (class30_sub1.anInt1294 > 0)
  10359. class30_sub1.anInt1294--;
  10360. if (class30_sub1.anInt1294 == 0) {
  10361. if (class30_sub1.anInt1299 < 0 || ObjectManager.method178(class30_sub1.anInt1299, class30_sub1.anInt1301)) {
  10362. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1300, class30_sub1.anInt1301, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1299);
  10363. class30_sub1.unlink();
  10364. }
  10365. } else {
  10366. if (class30_sub1.anInt1302 > 0)
  10367. class30_sub1.anInt1302--;
  10368. 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))) {
  10369. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1292, class30_sub1.anInt1293, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1291);
  10370. class30_sub1.anInt1302 = -1;
  10371. if (class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1299 == -1)
  10372. class30_sub1.unlink();
  10373. else if (class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1292 == class30_sub1.anInt1300 && class30_sub1.anInt1293 == class30_sub1.anInt1301)
  10374. class30_sub1.unlink();
  10375. }
  10376. }
  10377. }
  10378.  
  10379. }
  10380. }
  10381.  
  10382. private void determineMenuSize() {
  10383. int boxLength = newBoldFont.getTextWidth("Choose option");
  10384. for (int row = 0; row < menuActionRow; row++) {
  10385. int actionLength = newBoldFont.getTextWidth(menuActionName[row]);
  10386. if (actionLength > boxLength) {
  10387. boxLength = actionLength;
  10388. }
  10389. }
  10390. boxLength += 8;
  10391. int offset = 15 * menuActionRow + 21;
  10392. if (super.saveClickX > 0 && super.saveClickY > 0 && super.saveClickX < frameWidth && super.saveClickY < frameHeight) {
  10393. int xClick = super.saveClickX - boxLength / 2;
  10394. if (xClick + boxLength > frameWidth - 4) {
  10395. xClick = frameWidth - 4 - boxLength;
  10396. }
  10397. if (xClick < 0) {
  10398. xClick = 0;
  10399. }
  10400. int yClick = super.saveClickY - 0;
  10401. if (yClick + offset > frameHeight - 6) {
  10402. yClick = frameHeight - 6 - offset;
  10403. }
  10404. if (yClick < 0) {
  10405. yClick = 0;
  10406. }
  10407. menuOpen = true;
  10408. menuOffsetX = xClick;
  10409. menuOffsetY = yClick;
  10410. menuWidth = boxLength;
  10411. menuHeight = 15 * menuActionRow + 22;
  10412. }
  10413. }
  10414.  
  10415. private void method117(Stream stream) {
  10416. stream.initBitAccess();
  10417. int j = stream.readBits(1);
  10418. if (j == 0)
  10419. return;
  10420. int k = stream.readBits(2);
  10421. if (k == 0) {
  10422. anIntArray894[anInt893++] = myPlayerIndex;
  10423. return;
  10424. }
  10425. if (k == 1) {
  10426. int l = stream.readBits(3);
  10427. myPlayer.moveInDir(false, l);
  10428. int k1 = stream.readBits(1);
  10429. if (k1 == 1)
  10430. anIntArray894[anInt893++] = myPlayerIndex;
  10431. return;
  10432. }
  10433. if (k == 2) {
  10434. int i1 = stream.readBits(3);
  10435. myPlayer.moveInDir(true, i1);
  10436. int l1 = stream.readBits(3);
  10437. myPlayer.moveInDir(true, l1);
  10438. int j2 = stream.readBits(1);
  10439. if (j2 == 1)
  10440. anIntArray894[anInt893++] = myPlayerIndex;
  10441. return;
  10442. }
  10443. if (k == 3) {
  10444. plane = stream.readBits(2);
  10445. int j1 = stream.readBits(1);
  10446. int i2 = stream.readBits(1);
  10447. if (i2 == 1)
  10448. anIntArray894[anInt893++] = myPlayerIndex;
  10449. int k2 = stream.readBits(7);
  10450. int l2 = stream.readBits(7);
  10451. myPlayer.setPos(l2, k2, j1 == 1);
  10452. }
  10453. }
  10454.  
  10455. private void nullLoader() {
  10456. aBoolean831 = false;
  10457. while (drawingFlames) {
  10458. aBoolean831 = false;
  10459. try {
  10460. Thread.sleep(50L);
  10461. } catch (Exception _ex) {
  10462. }
  10463. }
  10464. aBackground_966 = null;
  10465. aBackground_967 = null;
  10466. aBackgroundArray1152s = null;
  10467. anIntArray850 = null;
  10468. anIntArray851 = null;
  10469. anIntArray852 = null;
  10470. anIntArray853 = null;
  10471. anIntArray1190 = null;
  10472. anIntArray1191 = null;
  10473. anIntArray828 = null;
  10474. anIntArray829 = null;
  10475. aClass30_Sub2_Sub1_Sub1_1201 = null;
  10476. aClass30_Sub2_Sub1_Sub1_1202 = null;
  10477. }
  10478.  
  10479. private boolean method119(int i, int j) {
  10480. boolean flag1 = false;
  10481. RSInterface class9 = RSInterface.interfaceCache[j];
  10482. if (class9 == null || class9.children == null) {
  10483. return false;
  10484. }
  10485. for (int k = 0; k < class9.children.length; k++) {
  10486. if (class9.children[k] == -1)
  10487. break;
  10488. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
  10489. if (class9_1.type == 1)
  10490. flag1 |= method119(i, class9_1.id);
  10491. if (class9_1.type == 6 && (class9_1.anInt257 != -1 || class9_1.anInt258 != -1)) {
  10492. boolean flag2 = interfaceIsSelected(class9_1);
  10493. int l;
  10494. if (flag2)
  10495. l = class9_1.anInt258;
  10496. else
  10497. l = class9_1.anInt257;
  10498. if (l != -1) {
  10499. Animation animation = Animation.anims[l];
  10500. for (class9_1.anInt208 += i; class9_1.anInt208 > animation.method258(class9_1.anInt246);) {
  10501. class9_1.anInt208 -= animation.method258(class9_1.anInt246) + 1;
  10502. class9_1.anInt246++;
  10503. if (class9_1.anInt246 >= animation.anInt352) {
  10504. class9_1.anInt246 -= animation.anInt356;
  10505. if (class9_1.anInt246 < 0 || class9_1.anInt246 >= animation.anInt352)
  10506. class9_1.anInt246 = 0;
  10507. }
  10508. flag1 = true;
  10509. }
  10510.  
  10511. }
  10512. }
  10513. }
  10514.  
  10515. return flag1;
  10516. }
  10517.  
  10518. private int method120() {
  10519. if (!Configuration.enableRoofs) {
  10520. return plane;
  10521. }
  10522. int j = 3;
  10523. if (yCameraCurve < 310) {
  10524. int k = xCameraPos >> 7;
  10525. int l = yCameraPos >> 7;
  10526. int i1 = myPlayer.x >> 7;
  10527. int j1 = myPlayer.y >> 7;
  10528. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10529. j = plane;
  10530. int k1;
  10531. if (i1 > k)
  10532. k1 = i1 - k;
  10533. else
  10534. k1 = k - i1;
  10535. int l1;
  10536. if (j1 > l)
  10537. l1 = j1 - l;
  10538. else
  10539. l1 = l - j1;
  10540. if (k1 > l1) {
  10541. int i2 = (l1 * 0x10000) / k1;
  10542. int k2 = 32768;
  10543. while (k != i1) {
  10544. if (k < i1)
  10545. k++;
  10546. else if (k > i1)
  10547. k--;
  10548. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10549. j = plane;
  10550. k2 += i2;
  10551. if (k2 >= 0x10000) {
  10552. k2 -= 0x10000;
  10553. if (l < j1)
  10554. l++;
  10555. else if (l > j1)
  10556. l--;
  10557. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10558. j = plane;
  10559. }
  10560. }
  10561. } else {
  10562. int j2 = (k1 * 0x10000) / l1;
  10563. int l2 = 32768;
  10564. while (l != j1) {
  10565. if (l < j1)
  10566. l++;
  10567. else if (l > j1)
  10568. l--;
  10569. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10570. j = plane;
  10571. l2 += j2;
  10572. if (l2 >= 0x10000) {
  10573. l2 -= 0x10000;
  10574. if (k < i1)
  10575. k++;
  10576. else if (k > i1)
  10577. k--;
  10578. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10579. j = plane;
  10580. }
  10581. }
  10582. }
  10583. }
  10584. if ((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
  10585. j = plane;
  10586. return j;
  10587. }
  10588.  
  10589. private int method121() {
  10590. if (!Configuration.enableRoofs) {
  10591. return plane;
  10592. }
  10593. int j = method42(plane, yCameraPos, xCameraPos);
  10594. if (j - zCameraPos < 800 && (byteGroundArray[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
  10595. return plane;
  10596. else
  10597. return 3;
  10598. }
  10599.  
  10600. private void delIgnore(long l) {
  10601. try {
  10602. if (l == 0L)
  10603. return;
  10604. for (int j = 0; j < ignoreCount; j++)
  10605. if (ignoreListAsLongs[j] == l) {
  10606. ignoreCount--;
  10607. System.arraycopy(ignoreListAsLongs, j + 1, ignoreListAsLongs, j, ignoreCount - j);
  10608.  
  10609. stream.createFrame(74);
  10610. stream.writeQWord(l);
  10611. return;
  10612. }
  10613.  
  10614. return;
  10615. } catch (RuntimeException runtimeexception) {
  10616. Signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  10617. }
  10618. throw new RuntimeException();
  10619. }
  10620.  
  10621. public String getParameter(String s) {
  10622. if (Signlink.mainapp != null)
  10623. return Signlink.mainapp.getParameter(s);
  10624. else
  10625. return super.getParameter(s);
  10626. }
  10627.  
  10628. private void adjustVolume(boolean flag, int i) {
  10629. Signlink.midivol = i;
  10630. if (flag)
  10631. Signlink.midi = "voladjust";
  10632. }
  10633.  
  10634. private int extractInterfaceValues(RSInterface class9, int j) {
  10635. if (class9.valueIndexArray == null || j >= class9.valueIndexArray.length)
  10636. return -2;
  10637. try {
  10638. int ai[] = class9.valueIndexArray[j];
  10639. int k = 0;
  10640. int l = 0;
  10641. int i1 = 0;
  10642. do {
  10643. int j1 = ai[l++];
  10644. int k1 = 0;
  10645. byte byte0 = 0;
  10646. if (j1 == 0)
  10647. return k;
  10648. if (j1 == 1)
  10649. k1 = currentStats[ai[l++]];
  10650. if (j1 == 2)
  10651. k1 = maxStats[ai[l++]];
  10652. if (j1 == 3)
  10653. k1 = currentExp[ai[l++]];
  10654. if (j1 == 4) {
  10655. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  10656. int k2 = ai[l++];
  10657. if (k2 >= 0 && k2 < ItemDef.totalItems && (!ItemDef.forID(k2).membersObject || isMembers)) {
  10658. for (int j3 = 0; j3 < class9_1.inv.length; j3++) {
  10659. if (class9_1.inv[j3] == k2 + 1) {
  10660. k1 += class9_1.invStackSizes[j3];
  10661. }
  10662. }
  10663. }
  10664. }
  10665. if (j1 == 5)
  10666. k1 = variousSettings[ai[l++]];
  10667. if (j1 == 6)
  10668. k1 = Skills.EXP_FOR_LEVEL[maxStats[ai[l++]] - 1];
  10669. if (j1 == 7)
  10670. k1 = (variousSettings[ai[l++]] * 100) / 46875;
  10671. if (j1 == 8)
  10672. k1 = myPlayer.combatLevel;
  10673. if (j1 == 9) {
  10674. for (int l1 = 0; l1 < Skills.SKILLS_COUNT; l1++)
  10675. if (Skills.SKILL_ENABLED[l1])
  10676. k1 += maxStats[l1];
  10677.  
  10678. }
  10679. if (j1 == 10) {
  10680. RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
  10681. int l2 = ai[l++] + 1;
  10682. if (l2 >= 0 && l2 < ItemDef.totalItems && isMembers) {
  10683. for (int k3 = 0; k3 < class9_2.inv.length; k3++) {
  10684. if (class9_2.inv[k3] != l2)
  10685. continue;
  10686. k1 = 0x3b9ac9ff;
  10687. break;
  10688. }
  10689.  
  10690. }
  10691. }
  10692. if (j1 == 11)
  10693. k1 = energy;
  10694. if (j1 == 12)
  10695. k1 = weight;
  10696. if (j1 == 13) {
  10697. int i2 = variousSettings[ai[l++]];
  10698. int i3 = ai[l++];
  10699. k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  10700. }
  10701. if (j1 == 14) {
  10702. int j2 = ai[l++];
  10703. VarBit varBit = VarBit.cache[j2];
  10704. int l3 = varBit.anInt648;
  10705. int i4 = varBit.anInt649;
  10706. int j4 = varBit.anInt650;
  10707. int k4 = anIntArray1232[j4 - i4];
  10708. k1 = variousSettings[l3] >> i4 & k4;
  10709. }
  10710. if (j1 == 15)
  10711. byte0 = 1;
  10712. if (j1 == 16)
  10713. byte0 = 2;
  10714. if (j1 == 17)
  10715. byte0 = 3;
  10716. if (j1 == 18)
  10717. k1 = (myPlayer.x >> 7) + baseX;
  10718. if (j1 == 19)
  10719. k1 = (myPlayer.y >> 7) + baseY;
  10720. if (j1 == 20)
  10721. k1 = ai[l++];
  10722. if (j1 == 21)
  10723. k1 = tabAmounts[ai[l++]];
  10724. if (j1 == 22) {
  10725. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  10726. int initAmount = class9_1.inv.length;
  10727. for (int j3 = 0; j3 < class9_1.inv.length; j3++) {
  10728. if (class9_1.inv[j3] <= 0) {
  10729. initAmount--;
  10730. }
  10731. }
  10732. k1 += initAmount;
  10733. }
  10734. if (j1 == 23) {
  10735. for (int l1 = 0; l1 < Skills.SKILLS_COUNT; l1++)
  10736. if (Skills.SKILL_ENABLED[l1])
  10737. k1 += currentExp[l1];
  10738. }
  10739. if (byte0 == 0) {
  10740. if (i1 == 0)
  10741. k += k1;
  10742. if (i1 == 1)
  10743. k -= k1;
  10744. if (i1 == 2 && k1 != 0)
  10745. k /= k1;
  10746. if (i1 == 3)
  10747. k *= k1;
  10748. i1 = 0;
  10749. } else {
  10750. i1 = byte0;
  10751. }
  10752. } while (true);
  10753. } catch (Exception _ex) {
  10754. return -1;
  10755. }
  10756. }
  10757.  
  10758. private void drawTooltip() {
  10759. if (menuActionRow < 2 && itemSelected == 0 && spellSelected == 0) {
  10760. return;
  10761. }
  10762.  
  10763. String s;
  10764.  
  10765. if (itemSelected == 1 && menuActionRow < 2) {
  10766. s = "Use " + selectedItemName + " with...";
  10767. } else if (spellSelected == 1 && menuActionRow < 2) {
  10768. s = spellTooltip + "...";
  10769. } else {
  10770. s = menuActionName[menuActionRow - 1];
  10771. }
  10772.  
  10773. if (menuActionRow > 2 && !Configuration.menuHovers) {
  10774. s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
  10775. } else {
  10776. s = s + "@whi@";
  10777. }
  10778.  
  10779. if (Configuration.menuHovers && !s.contains("Walk here")) {
  10780. DrawingArea.drawAlphaPixels(super.mouseX, super.mouseY - 11, newBoldFont.getTextWidth(s.trim()) + 6, 17, 0, 100);
  10781. newBoldFont.drawBasicString(s, super.mouseX + 2, super.mouseY + 2, 0xFFFFFF, 1);
  10782. }
  10783. newBoldFont.drawBasicString(s, 4, 15, 0xFFFFFF, 1);
  10784. }
  10785.  
  10786. private void markMinimap(Sprite sprite, int x, int y) {
  10787. if (sprite == null) {
  10788. return;
  10789. }
  10790. int k = minimapInt1 + minimapInt2 & 0x7ff;
  10791. int l = x * x + y * y;
  10792. if (l > 6400) {
  10793. return;
  10794. }
  10795. int i1 = Model.modelIntArray1[k];
  10796. int j1 = Model.modelIntArray2[k];
  10797. i1 = (i1 * 256) / (minimapInt3 + 256);
  10798. j1 = (j1 * 256) / (minimapInt3 + 256);
  10799. int k1 = y * i1 + x * j1 >> 16;
  10800. int l1 = y * j1 - x * i1 >> 16;
  10801. if (frameMode == ScreenMode.FIXED) {
  10802. sprite.drawSprite(((94 + k1) - sprite.cropWidth / 2) + 4 + 30, 83 - l1 - sprite.anInt1445 / 2 - 4 + 5);
  10803. } else {
  10804. sprite.drawSprite(((77 + k1) - sprite.cropWidth / 2) + 4 + (frameWidth - 167), 85 - l1 - sprite.anInt1445 / 2 - 4);
  10805. }
  10806. }
  10807.  
  10808. private void drawMinimap() {
  10809. if (frameMode == ScreenMode.FIXED) {
  10810. aRSImageProducer_1164.initDrawingArea();
  10811. }
  10812. if (anInt1021 == 2) {
  10813. if (frameMode == ScreenMode.FIXED) {
  10814. fixedGameComponents[0].drawSprite(0, 0);
  10815. } else {
  10816. gameComponents[0].drawSprite(frameWidth - 181, 0);
  10817. gameComponents[1].drawSprite(frameWidth - 158, 7);
  10818. }
  10819. if (Configuration.enableStatusOrbs) {
  10820. if (frameMode == ScreenMode.FIXED ? super.mouseX >= 517 && super.mouseX <= 545 && super.mouseY >= 27 && super.mouseY <= 54 : super.mouseX >= frameWidth - 211 && super.mouseX <= frameWidth - 183 && super.mouseY >= 23 && super.mouseY <= 50) {
  10821. orbComponents3[1].drawSprite(frameMode == ScreenMode.FIXED ? 3 : frameWidth - 210, frameMode == ScreenMode.FIXED ? 27 : 23);
  10822. } else {
  10823. orbComponents3[0].drawSprite(frameMode == ScreenMode.FIXED ? 3 : frameWidth - 210, frameMode == ScreenMode.FIXED ? 27 : 23);
  10824. }
  10825. }
  10826. if (frameMode == ScreenMode.FIXED ? super.mouseX >= 742 && super.mouseX <= 765 && super.mouseY >= 0 && super.mouseY <= 24 : super.mouseX >= frameWidth - 26 && super.mouseX <= frameWidth - 1 && super.mouseY >= 2 && super.mouseY <= 24) {
  10827. cacheSprite[348].drawARGBSprite(frameMode == ScreenMode.FIXED ? 226 : frameWidth - 23, 0, 205);
  10828. } else {
  10829. cacheSprite[348].drawSprite(frameMode == ScreenMode.FIXED ? 226 : frameWidth - 23, 0);
  10830. }
  10831. if (tabID == 14) {
  10832. cacheSprite[349].drawSprite(frameMode == ScreenMode.FIXED ? 226 : frameWidth - 23, 0);
  10833. }
  10834. loadAllOrbs(frameMode == ScreenMode.FIXED ? 0 : frameWidth - 217);
  10835. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, (frameMode == ScreenMode.FIXED ? 25 : 24), 4, (frameMode == ScreenMode.FIXED ? 29 : frameWidth - 176), 33, 25);
  10836. if (menuOpen) {
  10837. drawMenu(frameMode == ScreenMode.FIXED ? 516 : 0, 0);
  10838. }
  10839. if (frameMode == ScreenMode.FIXED) {
  10840. aRSImageProducer_1164.initDrawingArea();
  10841. }
  10842. return;
  10843. }
  10844. int i = minimapInt1 + minimapInt2 & 0x7ff;
  10845. int j = 48 + myPlayer.x / 32;
  10846. int l2 = 464 - myPlayer.y / 32;
  10847. minimapImage.method352(151, i, anIntArray1229, 256 + minimapInt3, anIntArray1052, l2, (frameMode == ScreenMode.FIXED ? 9 : 7), (frameMode == ScreenMode.FIXED ? 54 : frameWidth - 158), 146, j);
  10848. for (int j5 = 0; j5 < anInt1071; j5++) {
  10849. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  10850. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  10851. markMinimap(aClass30_Sub2_Sub1_Sub1Array1140[j5], k, i3);
  10852. markMinimap(mapIcon, ((3488 - baseX) * 4 + 2) - myPlayer.x / 32, ((3496 - baseY) * 4 + 2) - myPlayer.y / 32);
  10853. markMinimap(mapIcon1, ((2199 - baseX) * 4 + 2) - myPlayer.x / 32, ((3257 - baseY) * 4 + 2) - myPlayer.y / 32);
  10854. }
  10855. for (int k5 = 0; k5 < 104; k5++) {
  10856. for (int l5 = 0; l5 < 104; l5++) {
  10857. NodeList class19 = groundArray[plane][k5][l5];
  10858. if (class19 != null) {
  10859. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  10860. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  10861. markMinimap(mapDotItem, l, j3);
  10862. }
  10863. }
  10864. }
  10865. for (int i6 = 0; i6 < npcCount; i6++) {
  10866. Npc npc = npcArray[npcIndices[i6]];
  10867. if (npc != null && npc.isVisible()) {
  10868. EntityDef entityDef = npc.desc;
  10869. if (entityDef.childrenIDs != null) {
  10870. entityDef = entityDef.method161();
  10871. }
  10872. if (entityDef != null && entityDef.aBoolean87 && entityDef.aBoolean84) {
  10873. int i1 = npc.x / 32 - myPlayer.x / 32;
  10874. int k3 = npc.y / 32 - myPlayer.y / 32;
  10875. markMinimap(mapDotNPC, i1, k3);
  10876. }
  10877. }
  10878. }
  10879. for (int j6 = 0; j6 < playerCount; j6++) {
  10880. Player player = playerArray[playerIndices[j6]];
  10881. if (player != null && player.isVisible()) {
  10882. int j1 = player.x / 32 - myPlayer.x / 32;
  10883. int l3 = player.y / 32 - myPlayer.y / 32;
  10884. boolean flag1 = false;
  10885. boolean flag3 = false;
  10886. for (int j3 = 0; j3 < clanList.length; j3++) {
  10887. if (clanList[j3] == null) {
  10888. continue;
  10889. }
  10890. if (!clanList[j3].equalsIgnoreCase(player.name)) {
  10891. continue;
  10892. }
  10893. flag3 = true;
  10894. break;
  10895. }
  10896. long l6 = TextClass.longForName(player.name);
  10897. for (int k6 = 0; k6 < friendsCount; k6++) {
  10898. if (l6 != friendsListAsLongs[k6] || friendsNodeIDs[k6] == 0) {
  10899. continue;
  10900. }
  10901. flag1 = true;
  10902. break;
  10903. }
  10904. boolean flag2 = false;
  10905. if (myPlayer.team != 0 && player.team != 0 && myPlayer.team == player.team) {
  10906. flag2 = true;
  10907. }
  10908. if (flag1) {
  10909. markMinimap(mapDotFriend, j1, l3);
  10910. } else if (flag3) {
  10911. markMinimap(mapDotClan, j1, l3);
  10912. } else if (flag2) {
  10913. markMinimap(mapDotTeam, j1, l3);
  10914. } else {
  10915. markMinimap(mapDotPlayer, j1, l3);
  10916. }
  10917. }
  10918. }
  10919. if (anInt855 != 0 && loopCycle % 20 < 10) {
  10920. if (anInt855 == 1 && anInt1222 >= 0 && anInt1222 < npcArray.length) {
  10921. Npc class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  10922. if (class30_sub2_sub4_sub1_sub1_1 != null) {
  10923. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32 - myPlayer.x / 32;
  10924. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32 - myPlayer.y / 32;
  10925. method81(mapMarker, i4, k1);
  10926. }
  10927. }
  10928. if (anInt855 == 2) {
  10929. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  10930. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  10931. method81(mapMarker, j4, l1);
  10932. }
  10933. if (anInt855 == 10 && anInt933 >= 0 && anInt933 < playerArray.length) {
  10934. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  10935. if (class30_sub2_sub4_sub1_sub2_1 != null) {
  10936. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32 - myPlayer.x / 32;
  10937. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32 - myPlayer.y / 32;
  10938. method81(mapMarker, k4, i2);
  10939. }
  10940. }
  10941. }
  10942. if (destX != 0) {
  10943. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  10944. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  10945. markMinimap(mapFlag, j2, l4);
  10946. }
  10947. DrawingArea.drawPixels(3, (frameMode == ScreenMode.FIXED ? 83 : 80), (frameMode == ScreenMode.FIXED ? 127 : frameWidth - 88), 0xffffff, 3);
  10948. if (frameMode == ScreenMode.FIXED) {
  10949. fixedGameComponents[0].drawSprite(0, 0);
  10950. } else {
  10951. gameComponents[0].drawSprite(frameWidth - 181, 0);
  10952. }
  10953. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, (frameMode == ScreenMode.FIXED ? 25 : 24), 4, (frameMode == ScreenMode.FIXED ? 29 : frameWidth - 176), 33, 25);
  10954. if (Configuration.enableStatusOrbs) {
  10955. if (frameMode == ScreenMode.FIXED ? super.mouseX >= 517 && super.mouseX <= 545 && super.mouseY >= 27 && super.mouseY <= 54 : super.mouseX >= frameWidth - 211 && super.mouseX <= frameWidth - 183 && super.mouseY >= 23 && super.mouseY <= 50) {
  10956. orbComponents3[1].drawSprite(frameMode == ScreenMode.FIXED ? 3 : frameWidth - 210, frameMode == ScreenMode.FIXED ? 27 : 23);
  10957. } else {
  10958. orbComponents3[0].drawSprite(frameMode == ScreenMode.FIXED ? 3 : frameWidth - 210, frameMode == ScreenMode.FIXED ? 27 : 23);
  10959. }
  10960. }
  10961. if (frameMode == ScreenMode.FIXED ? super.mouseX >= 742 && super.mouseX <= 765 && super.mouseY >= 0 && super.mouseY <= 24 : super.mouseX >= frameWidth - 26 && super.mouseX <= frameWidth - 1 && super.mouseY >= 2 && super.mouseY <= 24) {
  10962. cacheSprite[348].drawARGBSprite(frameMode == ScreenMode.FIXED ? 226 : frameWidth - 23, 0, 205);
  10963. } else {
  10964. cacheSprite[348].drawSprite(frameMode == ScreenMode.FIXED ? 226 : frameWidth - 23, 0);
  10965. }
  10966. if (tabID == 14) {
  10967. cacheSprite[349].drawSprite(frameMode == ScreenMode.FIXED ? 226 : frameWidth - 23, 0);
  10968. }
  10969. loadAllOrbs(frameMode == ScreenMode.FIXED ? 0 : frameWidth - 217);
  10970. if (menuOpen) {
  10971. drawMenu(frameMode == ScreenMode.FIXED ? 516 : 0, 0);
  10972. }
  10973. if (frameMode == ScreenMode.FIXED) {
  10974. aRSImageProducer_1165.initDrawingArea();
  10975. }
  10976. }
  10977.  
  10978. private void npcScreenPos(Entity entity, int i) {
  10979. calcEntityScreenPos(entity.x, i, entity.y);
  10980. }
  10981.  
  10982. private void calcEntityScreenPos(int i, int j, int l) {
  10983. if (i < 128 || l < 128 || i > 13056 || l > 13056) {
  10984. spriteDrawX = -1;
  10985. spriteDrawY = -1;
  10986. return;
  10987. }
  10988. int i1 = method42(plane, l, i) - j;
  10989. i -= xCameraPos;
  10990. i1 -= zCameraPos;
  10991. l -= yCameraPos;
  10992. int j1 = Model.modelIntArray1[yCameraCurve];
  10993. int k1 = Model.modelIntArray2[yCameraCurve];
  10994. int l1 = Model.modelIntArray1[xCameraCurve];
  10995. int i2 = Model.modelIntArray2[xCameraCurve];
  10996. int j2 = l * l1 + i * i2 >> 16;
  10997. l = l * i2 - i * l1 >> 16;
  10998. i = j2;
  10999. j2 = i1 * k1 - l * j1 >> 16;
  11000. l = i1 * j1 + l * k1 >> 16;
  11001. i1 = j2;
  11002. if (l >= 50) {
  11003. spriteDrawX = Rasterizer.centerX + (i << WorldController.viewDistance) / l;
  11004. spriteDrawY = Rasterizer.centerY + (i1 << WorldController.viewDistance) / l;
  11005. } else {
  11006. spriteDrawX = -1;
  11007. spriteDrawY = -1;
  11008. }
  11009. }
  11010.  
  11011. private void buildSplitPrivateChatMenu() {
  11012. if (splitPrivateChat == 0)
  11013. return;
  11014. int i = 0;
  11015. if (anInt1104 != 0)
  11016. i = 1;
  11017. for (int j = 0; j < 100; j++)
  11018. if (chatMessages[j] != null) {
  11019. int k = chatTypes[j];
  11020. String s = chatNames[j];
  11021. if (s != null && s.startsWith("@cr")) {
  11022. if (s.charAt(4) != '@') {
  11023. s = s.substring(6);
  11024. } else {
  11025. s = s.substring(5);
  11026. }
  11027. }
  11028. if ((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  11029. int offSet = frameMode == ScreenMode.FIXED ? 4 : 0;
  11030. int l = 329 - i * 13;
  11031. if (frameMode != ScreenMode.FIXED) {
  11032. l = frameHeight - 170 - i * 13 - extendChatArea;
  11033. }
  11034. if (super.mouseX > 4 && super.mouseY - offSet > l - 10 && super.mouseY - offSet <= l + 3) {
  11035. int i1 = regularText.getTextWidth("From: " + s + chatMessages[j]) + 25;
  11036. if (i1 > 450)
  11037. i1 = 450;
  11038. if (super.mouseX < 4 + i1) {
  11039. if (myPrivilege >= 1) {
  11040. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  11041. menuActionID[menuActionRow] = 2606;
  11042. menuActionRow++;
  11043. }
  11044. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  11045. menuActionID[menuActionRow] = 2042;
  11046. menuActionRow++;
  11047. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  11048. menuActionID[menuActionRow] = 2337;
  11049. menuActionRow++;
  11050. }
  11051. }
  11052. if (++i >= 5)
  11053. return;
  11054. }
  11055. if ((k == 5 || k == 6) && privateChatMode < 2 && ++i >= 5)
  11056. return;
  11057. }
  11058.  
  11059. }
  11060.  
  11061. private void method130(int j, int k, int l, int i1, int j1, int k1, int l1, int i2, int j2) {
  11062. Class30_Sub1 class30_sub1 = null;
  11063. for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179.reverseGetNext()) {
  11064. if (class30_sub1_1.anInt1295 != l1 || class30_sub1_1.anInt1297 != i2 || class30_sub1_1.anInt1298 != j1 || class30_sub1_1.anInt1296 != i1)
  11065. continue;
  11066. class30_sub1 = class30_sub1_1;
  11067. break;
  11068. }
  11069.  
  11070. if (class30_sub1 == null) {
  11071. class30_sub1 = new Class30_Sub1();
  11072. class30_sub1.anInt1295 = l1;
  11073. class30_sub1.anInt1296 = i1;
  11074. class30_sub1.anInt1297 = i2;
  11075. class30_sub1.anInt1298 = j1;
  11076. method89(class30_sub1);
  11077. aClass19_1179.insertHead(class30_sub1);
  11078. }
  11079. class30_sub1.anInt1291 = k;
  11080. class30_sub1.anInt1293 = k1;
  11081. class30_sub1.anInt1292 = l;
  11082. class30_sub1.anInt1302 = j2;
  11083. class30_sub1.anInt1294 = j;
  11084. }
  11085.  
  11086. private boolean interfaceIsSelected(RSInterface class9) {
  11087. if (class9.anIntArray245 == null)
  11088. return false;
  11089. for (int i = 0; i < class9.anIntArray245.length; i++) {
  11090. int j = extractInterfaceValues(class9, i);
  11091. int k = class9.anIntArray212[i];
  11092. if (class9.anIntArray245[i] == 2) {
  11093. if (j >= k)
  11094. return false;
  11095. } else if (class9.anIntArray245[i] == 3) {
  11096. if (j <= k)
  11097. return false;
  11098. } else if (class9.anIntArray245[i] == 4) {
  11099. if (j == k)
  11100. return false;
  11101. } else if (j != k)
  11102. return false;
  11103. }
  11104.  
  11105. return true;
  11106. }
  11107.  
  11108. private DataInputStream openJagGrabInputStream(String s) throws IOException {
  11109. // if(!aBoolean872)
  11110. // if(signlink.mainapp != null)
  11111. // return signlink.openurl(s);
  11112. // else
  11113. // return new DataInputStream((new URL(getCodeBase(), s)).openStream());
  11114. if (aSocket832 != null) {
  11115. try {
  11116. aSocket832.close();
  11117. } catch (Exception _ex) {
  11118. }
  11119. aSocket832 = null;
  11120. }
  11121. aSocket832 = openSocket(43595);
  11122. aSocket832.setSoTimeout(10000);
  11123. java.io.InputStream inputstream = aSocket832.getInputStream();
  11124. OutputStream outputstream = aSocket832.getOutputStream();
  11125. outputstream.write(("JAGGRAB /" + s + "\n\n").getBytes());
  11126. return new DataInputStream(inputstream);
  11127. }
  11128.  
  11129. private void method134(Stream stream) {
  11130. int j = stream.readBits(8);
  11131. if (j < playerCount) {
  11132. for (int k = j; k < playerCount; k++)
  11133. anIntArray840[anInt839++] = playerIndices[k];
  11134.  
  11135. }
  11136. if (j > playerCount) {
  11137. Signlink.reporterror(myUsername + " Too many players");
  11138. throw new RuntimeException("eek");
  11139. }
  11140. playerCount = 0;
  11141. for (int l = 0; l < j; l++) {
  11142. int i1 = playerIndices[l];
  11143. Player player = playerArray[i1];
  11144. int j1 = stream.readBits(1);
  11145. if (j1 == 0) {
  11146. playerIndices[playerCount++] = i1;
  11147. player.anInt1537 = loopCycle;
  11148. } else {
  11149. int k1 = stream.readBits(2);
  11150. if (k1 == 0) {
  11151. playerIndices[playerCount++] = i1;
  11152. player.anInt1537 = loopCycle;
  11153. anIntArray894[anInt893++] = i1;
  11154. } else if (k1 == 1) {
  11155. playerIndices[playerCount++] = i1;
  11156. player.anInt1537 = loopCycle;
  11157. int l1 = stream.readBits(3);
  11158. player.moveInDir(false, l1);
  11159. int j2 = stream.readBits(1);
  11160. if (j2 == 1)
  11161. anIntArray894[anInt893++] = i1;
  11162. } else if (k1 == 2) {
  11163. playerIndices[playerCount++] = i1;
  11164. player.anInt1537 = loopCycle;
  11165. int i2 = stream.readBits(3);
  11166. player.moveInDir(true, i2);
  11167. int k2 = stream.readBits(3);
  11168. player.moveInDir(true, k2);
  11169. int l2 = stream.readBits(1);
  11170. if (l2 == 1)
  11171. anIntArray894[anInt893++] = i1;
  11172. } else if (k1 == 3)
  11173. anIntArray840[anInt839++] = i1;
  11174. }
  11175. }
  11176. }
  11177.  
  11178. private void drawFlames() {
  11179.  
  11180. }
  11181.  
  11182. public void raiseWelcomeScreen() {
  11183. welcomeScreenRaised = true;
  11184. }
  11185.  
  11186. private final String[] chatTitles, chatColors;
  11187.  
  11188. private Npc npcDisplay;
  11189.  
  11190. public void pushMessage(String s, int i, String s1, String title, String color) {
  11191. if (i == 0 && dialogID != -1) {
  11192. aString844 = s;
  11193. super.clickMode3 = 0;
  11194. }
  11195. if (backDialogID == -1)
  11196. inputTaken = true;
  11197. for (int j = 499; j > 0; j--) {
  11198. chatTypes[j] = chatTypes[j - 1];
  11199. chatNames[j] = chatNames[j - 1];
  11200. chatMessages[j] = chatMessages[j - 1];
  11201. chatRights[j] = chatRights[j - 1];
  11202. chatTitles[j] = chatTitles[j - 1];
  11203. chatColors[j] = chatColors[j - 1];
  11204. }
  11205. chatTypes[0] = i;
  11206. chatNames[0] = s1;
  11207. chatMessages[0] = s;
  11208. chatRights[0] = rights;
  11209. chatTitles[0] = title;
  11210. chatColors[0] = color;
  11211. }
  11212.  
  11213. public void pushMessage(String s, int i, String s1) {
  11214. if (i == 0 && dialogID != -1) {
  11215. aString844 = s;
  11216. super.clickMode3 = 0;
  11217. }
  11218. if (backDialogID == -1) {
  11219. inputTaken = true;
  11220. }
  11221. for (int j = 499; j > 0; j--) {
  11222. chatTypes[j] = chatTypes[j - 1];
  11223. chatNames[j] = chatNames[j - 1];
  11224. chatMessages[j] = chatMessages[j - 1];
  11225. chatRights[j] = chatRights[j - 1];
  11226. chatTitles[j] = chatTitles[j - 1];
  11227. chatColors[j] = chatColors[j - 1];
  11228. clanTitles[j] = clanTitles[j - 1];
  11229. }
  11230. chatTypes[0] = i;
  11231. chatNames[0] = s1;
  11232. chatMessages[0] = s;
  11233. chatRights[0] = rights;
  11234. clanTitles[0] = clanTitle;
  11235. }
  11236.  
  11237. private void method137(Stream stream, int j) {
  11238. if (j == 84) {
  11239. int k = stream.readUnsignedByte();
  11240. int j3 = anInt1268 + (k >> 4 & 7);
  11241. int i6 = anInt1269 + (k & 7);
  11242. int l8 = stream.readUnsignedWord();
  11243. int k11 = stream.readUnsignedWord();
  11244. int l13 = stream.readUnsignedWord();
  11245. if (j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104) {
  11246. NodeList class19_1 = groundArray[plane][j3][i6];
  11247. if (class19_1 != null) {
  11248. 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()) {
  11249. if (class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff) || class30_sub2_sub4_sub2_3.anInt1559 != k11)
  11250. continue;
  11251. class30_sub2_sub4_sub2_3.anInt1559 = l13;
  11252. break;
  11253. }
  11254.  
  11255. spawnGroundItem(j3, i6);
  11256. }
  11257. }
  11258. return;
  11259. }
  11260. if (j == 105) {
  11261. int l = stream.readUnsignedByte();
  11262. int k3 = anInt1268 + (l >> 4 & 7);
  11263. int j6 = anInt1269 + (l & 7);
  11264. int i9 = stream.readUnsignedWord();
  11265. int l11 = stream.readUnsignedByte();
  11266. int i14 = l11 >> 4 & 0xf;
  11267. int i16 = l11 & 7;
  11268. if (myPlayer.smallX[0] >= k3 - i14 && myPlayer.smallX[0] <= k3 + i14 && myPlayer.smallY[0] >= j6 - i14 && myPlayer.smallY[0] <= j6 + i14 && aBoolean848 && !lowMem && anInt1062 < 50) {
  11269. anIntArray1207[anInt1062] = i9;
  11270. anIntArray1241[anInt1062] = i16;
  11271. anIntArray1250[anInt1062] = Sounds.anIntArray326[i9];
  11272. anInt1062++;
  11273. }
  11274. }
  11275. if (j == 215) {
  11276. int i1 = stream.method435();
  11277. int l3 = stream.method428();
  11278. int k6 = anInt1268 + (l3 >> 4 & 7);
  11279. int j9 = anInt1269 + (l3 & 7);
  11280. int i12 = stream.method435();
  11281. int j14 = stream.readUnsignedWord();
  11282. if (k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104 && i12 != unknownInt10) {
  11283. Item class30_sub2_sub4_sub2_2 = new Item();
  11284. class30_sub2_sub4_sub2_2.ID = i1;
  11285. class30_sub2_sub4_sub2_2.anInt1559 = j14;
  11286. if (groundArray[plane][k6][j9] == null)
  11287. groundArray[plane][k6][j9] = new NodeList();
  11288. groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
  11289. spawnGroundItem(k6, j9);
  11290. }
  11291. return;
  11292. }
  11293. if (j == 156) {
  11294. int j1 = stream.method426();
  11295. int i4 = anInt1268 + (j1 >> 4 & 7);
  11296. int l6 = anInt1269 + (j1 & 7);
  11297. int k9 = stream.readUnsignedWord();
  11298. if (i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104) {
  11299. NodeList class19 = groundArray[plane][i4][l6];
  11300. if (class19 != null) {
  11301. for (Item item = (Item) class19.reverseGetFirst(); item != null; item = (Item) class19.reverseGetNext()) {
  11302. if (item.ID != (k9 & 0x7fff))
  11303. continue;
  11304. item.unlink();
  11305. break;
  11306. }
  11307.  
  11308. if (class19.reverseGetFirst() == null)
  11309. groundArray[plane][i4][l6] = null;
  11310. spawnGroundItem(i4, l6);
  11311. }
  11312. }
  11313. return;
  11314. }
  11315. if (j == 160) {
  11316. int k1 = stream.method428();
  11317. int j4 = anInt1268 + (k1 >> 4 & 7);
  11318. int i7 = anInt1269 + (k1 & 7);
  11319. int l9 = stream.method428();
  11320. int j12 = l9 >> 2;
  11321. int k14 = l9 & 3;
  11322. int j16 = anIntArray1177[j12];
  11323. int j17 = stream.method435();
  11324. if (j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103) {
  11325. int j18 = intGroundArray[plane][j4][i7];
  11326. int i19 = intGroundArray[plane][j4 + 1][i7];
  11327. int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
  11328. int k20 = intGroundArray[plane][j4][i7 + 1];
  11329. if (j16 == 0) {
  11330. Object1 class10 = worldController.method296(plane, j4, i7);
  11331. if (class10 != null) {
  11332. int k21 = class10.uid >> 14 & 0x7fff;
  11333. if (j12 == 2) {
  11334. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, 4 + k14, 2, i19, l19, j18, k20, j17, false);
  11335. class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(k21, k14 + 1 & 3, 2, i19, l19, j18, k20, j17, false);
  11336. } else {
  11337. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, k14, j12, i19, l19, j18, k20, j17, false);
  11338. }
  11339. }
  11340. }
  11341. if (j16 == 1) {
  11342. Object2 class26 = worldController.method297(j4, i7, plane);
  11343. if (class26 != null)
  11344. class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(class26.uid >> 14 & 0x7fff, 0, 4, i19, l19, j18, k20, j17, false);
  11345. }
  11346. if (j16 == 2) {
  11347. Object5 class28 = worldController.method298(j4, i7, plane);
  11348. if (j12 == 11)
  11349. j12 = 10;
  11350. if (class28 != null)
  11351. class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(class28.uid >> 14 & 0x7fff, k14, j12, i19, l19, j18, k20, j17, false);
  11352. }
  11353. if (j16 == 3) {
  11354. Object3 class49 = worldController.method299(i7, j4, plane);
  11355. if (class49 != null)
  11356. class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(class49.uid >> 14 & 0x7fff, k14, 22, i19, l19, j18, k20, j17, false);
  11357. }
  11358. }
  11359. return;
  11360. }
  11361. if (j == 147) {
  11362. int l1 = stream.method428();
  11363. int k4 = anInt1268 + (l1 >> 4 & 7);
  11364. int j7 = anInt1269 + (l1 & 7);
  11365. int i10 = stream.readUnsignedWord();
  11366. byte byte0 = stream.method430();
  11367. int l14 = stream.method434();
  11368. byte byte1 = stream.method429();
  11369. int k17 = stream.readUnsignedWord();
  11370. int k18 = stream.method428();
  11371. int j19 = k18 >> 2;
  11372. int i20 = k18 & 3;
  11373. int l20 = anIntArray1177[j19];
  11374. byte byte2 = stream.readSignedByte();
  11375. int l21 = stream.readUnsignedWord();
  11376. byte byte3 = stream.method429();
  11377. Player player;
  11378. if (i10 == unknownInt10)
  11379. player = myPlayer;
  11380. else
  11381. player = playerArray[i10];
  11382. if (player != null) {
  11383. ObjectDef class46 = ObjectDef.forID(l21);
  11384. int i22 = intGroundArray[plane][k4][j7];
  11385. int j22 = intGroundArray[plane][k4 + 1][j7];
  11386. int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
  11387. int l22 = intGroundArray[plane][k4][j7 + 1];
  11388. Model model = class46.method578(j19, i20, i22, j22, k22, l22, -1);
  11389. if (model != null) {
  11390. method130(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
  11391. player.anInt1707 = l14 + loopCycle;
  11392. player.anInt1708 = k17 + loopCycle;
  11393. player.aModel_1714 = model;
  11394. int i23 = class46.anInt744;
  11395. int j23 = class46.anInt761;
  11396. if (i20 == 1 || i20 == 3) {
  11397. i23 = class46.anInt761;
  11398. j23 = class46.anInt744;
  11399. }
  11400. player.anInt1711 = k4 * 128 + i23 * 64;
  11401. player.anInt1713 = j7 * 128 + j23 * 64;
  11402. player.anInt1712 = method42(plane, player.anInt1713, player.anInt1711);
  11403. if (byte2 > byte0) {
  11404. byte byte4 = byte2;
  11405. byte2 = byte0;
  11406. byte0 = byte4;
  11407. }
  11408. if (byte3 > byte1) {
  11409. byte byte5 = byte3;
  11410. byte3 = byte1;
  11411. byte1 = byte5;
  11412. }
  11413. player.anInt1719 = k4 + byte2;
  11414. player.anInt1721 = k4 + byte0;
  11415. player.anInt1720 = j7 + byte3;
  11416. player.anInt1722 = j7 + byte1;
  11417. }
  11418. }
  11419. }
  11420. if (j == 151) {
  11421. int i2 = stream.method426();
  11422. int l4 = anInt1268 + (i2 >> 4 & 7);
  11423. int k7 = anInt1269 + (i2 & 7);
  11424. int j10 = stream.method434();
  11425. int k12 = stream.method428();
  11426. int i15 = k12 >> 2;
  11427. int k16 = k12 & 3;
  11428. int l17 = anIntArray1177[i15];
  11429. if (l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104)
  11430. method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
  11431. return;
  11432. }
  11433. if (j == 4) {
  11434. int j2 = stream.readUnsignedByte();
  11435. int i5 = anInt1268 + (j2 >> 4 & 7);
  11436. int l7 = anInt1269 + (j2 & 7);
  11437. int k10 = stream.readUnsignedWord();
  11438. int l12 = stream.readUnsignedByte();
  11439. int j15 = stream.readUnsignedWord();
  11440. if (i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104) {
  11441. i5 = i5 * 128 + 64;
  11442. l7 = l7 * 128 + 64;
  11443. Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane, loopCycle, j15, k10, method42(plane, l7, i5) - l12, l7, i5);
  11444. aClass19_1056.insertHead(class30_sub2_sub4_sub3);
  11445. }
  11446. return;
  11447. }
  11448. if (j == 44) {
  11449. int k2 = stream.method436();
  11450. int j5 = stream.readUnsignedWord();
  11451. int i8 = stream.readUnsignedByte();
  11452. int l10 = anInt1268 + (i8 >> 4 & 7);
  11453. int i13 = anInt1269 + (i8 & 7);
  11454. if (l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104) {
  11455. Item class30_sub2_sub4_sub2_1 = new Item();
  11456. class30_sub2_sub4_sub2_1.ID = k2;
  11457. class30_sub2_sub4_sub2_1.anInt1559 = j5;
  11458. if (groundArray[plane][l10][i13] == null)
  11459. groundArray[plane][l10][i13] = new NodeList();
  11460. groundArray[plane][l10][i13].insertHead(class30_sub2_sub4_sub2_1);
  11461. spawnGroundItem(l10, i13);
  11462. }
  11463. return;
  11464. }
  11465. if (j == 101) {
  11466. int l2 = stream.method427();
  11467. int k5 = l2 >> 2;
  11468. int j8 = l2 & 3;
  11469. int i11 = anIntArray1177[k5];
  11470. int j13 = stream.readUnsignedByte();
  11471. int k15 = anInt1268 + (j13 >> 4 & 7);
  11472. int l16 = anInt1269 + (j13 & 7);
  11473. if (k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
  11474. method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
  11475. return;
  11476. }
  11477. if (j == 117) {
  11478. int i3 = stream.readUnsignedByte();
  11479. int l5 = anInt1268 + (i3 >> 4 & 7);
  11480. int k8 = anInt1269 + (i3 & 7);
  11481. int j11 = l5 + stream.readSignedByte();
  11482. int k13 = k8 + stream.readSignedByte();
  11483. int l15 = stream.readSignedWord();
  11484. int i17 = stream.readUnsignedWord();
  11485. int i18 = stream.readUnsignedByte() * 4;
  11486. int l18 = stream.readUnsignedByte() * 4;
  11487. int k19 = stream.readUnsignedWord();
  11488. int j20 = stream.readUnsignedWord();
  11489. int i21 = stream.readUnsignedByte();
  11490. int j21 = stream.readUnsignedByte();
  11491. if (l5 >= 0 && k8 >= 0 && l5 < 104 && k8 < 104 && j11 >= 0 && k13 >= 0 && j11 < 104 && k13 < 104 && i17 != 65535) {
  11492. l5 = l5 * 128 + 64;
  11493. k8 = k8 * 128 + 64;
  11494. j11 = j11 * 128 + 64;
  11495. k13 = k13 * 128 + 64;
  11496. 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);
  11497. class30_sub2_sub4_sub4.method455(k19 + loopCycle, k13, method42(plane, k13, j11) - l18, j11);
  11498. aClass19_1013.insertHead(class30_sub2_sub4_sub4);
  11499. }
  11500. }
  11501. }
  11502.  
  11503. private void method139(Stream stream) {
  11504. stream.initBitAccess();
  11505. int k = stream.readBits(8);
  11506. if (k < npcCount) {
  11507. for (int l = k; l < npcCount; l++)
  11508. anIntArray840[anInt839++] = npcIndices[l];
  11509.  
  11510. }
  11511. if (k > npcCount) {
  11512. Signlink.reporterror(myUsername + " Too many npcs");
  11513. throw new RuntimeException("eek");
  11514. }
  11515. npcCount = 0;
  11516. for (int i1 = 0; i1 < k; i1++) {
  11517. int j1 = npcIndices[i1];
  11518. Npc npc = npcArray[j1];
  11519. int k1 = stream.readBits(1);
  11520. if (k1 == 0) {
  11521. npcIndices[npcCount++] = j1;
  11522. npc.anInt1537 = loopCycle;
  11523. } else {
  11524. int l1 = stream.readBits(2);
  11525. if (l1 == 0) {
  11526. npcIndices[npcCount++] = j1;
  11527. npc.anInt1537 = loopCycle;
  11528. anIntArray894[anInt893++] = j1;
  11529. } else if (l1 == 1) {
  11530. npcIndices[npcCount++] = j1;
  11531. npc.anInt1537 = loopCycle;
  11532. int i2 = stream.readBits(3);
  11533. npc.moveInDir(false, i2);
  11534. int k2 = stream.readBits(1);
  11535. if (k2 == 1)
  11536. anIntArray894[anInt893++] = j1;
  11537. } else if (l1 == 2) {
  11538. npcIndices[npcCount++] = j1;
  11539. npc.anInt1537 = loopCycle;
  11540. int j2 = stream.readBits(3);
  11541. npc.moveInDir(true, j2);
  11542. int l2 = stream.readBits(3);
  11543. npc.moveInDir(true, l2);
  11544. int i3 = stream.readBits(1);
  11545. if (i3 == 1)
  11546. anIntArray894[anInt893++] = j1;
  11547. } else if (l1 == 3)
  11548. anIntArray840[anInt839++] = j1;
  11549. }
  11550. }
  11551. }
  11552.  
  11553. private void method142(int i, int j, int k, int l, int i1, int j1, int k1) {
  11554. if (i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102) {
  11555. if (lowMem && j != plane)
  11556. return;
  11557. int i2 = 0;
  11558. if (j1 == 0)
  11559. i2 = worldController.method300(j, i1, i);
  11560. if (j1 == 1)
  11561. i2 = worldController.method301(j, i1, i);
  11562. if (j1 == 2)
  11563. i2 = worldController.method302(j, i1, i);
  11564. if (j1 == 3)
  11565. i2 = worldController.method303(j, i1, i);
  11566. if (i2 != 0) {
  11567. int i3 = worldController.method304(j, i1, i, i2);
  11568. int j2 = i2 >> 14 & 0x7fff;
  11569. int k2 = i3 & 0x1f;
  11570. int l2 = i3 >> 6;
  11571. if (j1 == 0) {
  11572. worldController.method291(i1, j, i, (byte) -119);
  11573. ObjectDef class46 = ObjectDef.forID(j2);
  11574. if (class46.aBoolean767)
  11575. aClass11Array1230[j].method215(l2, k2, class46.aBoolean757, i1, i);
  11576. }
  11577. if (j1 == 1)
  11578. worldController.method292(i, j, i1);
  11579. if (j1 == 2) {
  11580. worldController.method293(j, i1, i);
  11581. ObjectDef class46_1 = ObjectDef.forID(j2);
  11582. if (i1 + class46_1.anInt744 > 103 || i + class46_1.anInt744 > 103 || i1 + class46_1.anInt761 > 103 || i + class46_1.anInt761 > 103)
  11583. return;
  11584. if (class46_1.aBoolean767)
  11585. aClass11Array1230[j].method216(l2, class46_1.anInt744, i1, i, class46_1.anInt761, class46_1.aBoolean757);
  11586. }
  11587. if (j1 == 3) {
  11588. worldController.method294(j, i, i1);
  11589. ObjectDef class46_2 = ObjectDef.forID(j2);
  11590. if (class46_2.aBoolean767 && class46_2.hasActions)
  11591. aClass11Array1230[j].method218(i, i1);
  11592. }
  11593. }
  11594. if (k1 >= 0) {
  11595. int j3 = j;
  11596. if (j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
  11597. j3++;
  11598. ObjectManager.method188(worldController, k, i, l, j3, aClass11Array1230[j], intGroundArray, i1, k1, j);
  11599. }
  11600. }
  11601. }
  11602.  
  11603. private void updatePlayers(int i, Stream stream) {
  11604. anInt839 = 0;
  11605. anInt893 = 0;
  11606. method117(stream);
  11607. method134(stream);
  11608. method91(stream, i);
  11609. method49(stream);
  11610. for (int k = 0; k < anInt839; k++) {
  11611. int l = anIntArray840[k];
  11612. if (playerArray[l].anInt1537 != loopCycle)
  11613. playerArray[l] = null;
  11614. }
  11615.  
  11616. if (stream.currentOffset != i) {
  11617. Signlink.reporterror("Error packet size mismatch in getplayer pos:" + stream.currentOffset + " psize:" + i);
  11618. throw new RuntimeException("eek");
  11619. }
  11620. for (int i1 = 0; i1 < playerCount; i1++)
  11621. if (playerArray[playerIndices[i1]] == null) {
  11622. Signlink.reporterror(myUsername + " null entry in pl list - pos:" + i1 + " size:" + playerCount);
  11623. throw new RuntimeException("eek");
  11624. }
  11625.  
  11626. }
  11627.  
  11628. private void setCameraPos(int j, int k, int l, int i1, int j1, int k1) {
  11629. int l1 = 2048 - k & 0x7ff;
  11630. int i2 = 2048 - j1 & 0x7ff;
  11631. int j2 = 0;
  11632. int k2 = 0;
  11633. int l2 = j;
  11634. if (l1 != 0) {
  11635. int i3 = Model.modelIntArray1[l1];
  11636. int k3 = Model.modelIntArray2[l1];
  11637. int i4 = k2 * k3 - l2 * i3 >> 16;
  11638. l2 = k2 * i3 + l2 * k3 >> 16;
  11639. k2 = i4;
  11640. }
  11641. if (i2 != 0) {
  11642. int j3 = Model.modelIntArray1[i2];
  11643. int l3 = Model.modelIntArray2[i2];
  11644. int j4 = l2 * j3 + j2 * l3 >> 16;
  11645. l2 = l2 * l3 - j2 * j3 >> 16;
  11646. j2 = j4;
  11647. }
  11648. xCameraPos = l - j2;
  11649. zCameraPos = i1 - k2;
  11650. yCameraPos = k1 - l2;
  11651. yCameraCurve = k;
  11652. xCameraCurve = j1;
  11653. }
  11654.  
  11655. public static void updateStrings(String str, int i) {
  11656. switch (i) {
  11657. case 1675:
  11658. sendFrame126(str, 17508);
  11659. break;// Stab
  11660. case 1676:
  11661. sendFrame126(str, 17509);
  11662. break;// Slash
  11663. case 1677:
  11664. sendFrame126(str, 17510);
  11665. break;// Cursh
  11666. case 1678:
  11667. sendFrame126(str, 17511);
  11668. break;// Magic
  11669. case 1679:
  11670. sendFrame126(str, 17512);
  11671. break;// Range
  11672. case 1680:
  11673. sendFrame126(str, 17513);
  11674. break;// Stab
  11675. case 1681:
  11676. sendFrame126(str, 17514);
  11677. break;// Slash
  11678. case 1682:
  11679. sendFrame126(str, 17515);
  11680. break;// Crush
  11681. case 1683:
  11682. sendFrame126(str, 17516);
  11683. break;// Magic
  11684. case 1684:
  11685. sendFrame126(str, 17517);
  11686. break;// Range
  11687. case 1686:
  11688. sendFrame126(str, 17518);
  11689. break;// Strength
  11690. case 1687:
  11691. sendFrame126(str, 17519);
  11692. break;// Prayer
  11693. }
  11694. }
  11695.  
  11696. public static void sendFrame126(String str, int i) {
  11697. RSInterface.interfaceCache[i].disabledMessage = str;
  11698. if (RSInterface.interfaceCache[i].parentID == tabInterfaceIDs[tabID]) {
  11699. }
  11700. }
  11701.  
  11702. public void sendPacket185(int button, int toggle, int type) {
  11703. switch (type) {
  11704. case 135:
  11705. RSInterface class9 = RSInterface.interfaceCache[button];
  11706. boolean flag8 = true;
  11707. if (class9.contentType > 0)
  11708. flag8 = promptUserForInput(class9);
  11709. if (flag8) {
  11710. stream.createFrame(185);
  11711. stream.writeWord(button);
  11712. }
  11713. break;
  11714. case 646:
  11715. System.out.println("toggle = " + toggle);
  11716. stream.createFrame(185);
  11717. stream.writeWord(button);
  11718. RSInterface class9_2 = RSInterface.interfaceCache[button];
  11719. if (class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5) {
  11720. if (variousSettings[toggle] != class9_2.anIntArray212[0]) {
  11721. int temp = variousSettings[toggle];
  11722. variousSettings[toggle] = class9_2.anIntArray212[0];
  11723. if (class9_2.parentID == 50000 && !interfaceIsSelected(class9_2)) {
  11724. variousSettings[toggle] = temp;
  11725. }
  11726. updateConfigValues(toggle);
  11727. }
  11728. }
  11729. break;
  11730. case 169:
  11731. stream.createFrame(185);
  11732. stream.writeWord(button);
  11733. RSInterface class9_3 = RSInterface.interfaceCache[button];
  11734. if (class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5) {
  11735. variousSettings[toggle] = 1 - variousSettings[toggle];
  11736. updateConfigValues(toggle);
  11737. }
  11738. switch (button) {
  11739. case 74214:
  11740. System.out.println("toggle = " + toggle);
  11741. if (toggle == 0)
  11742. sendFrame36(173, toggle);
  11743. if (toggle == 1)
  11744. sendPacket185(153, 173, 646);
  11745. break;
  11746. }
  11747. break;
  11748. }
  11749. }
  11750.  
  11751. public void sendFrame36(int id, int state) {
  11752. anIntArray1045[id] = state;
  11753. if (variousSettings[id] != state) {
  11754. variousSettings[id] = state;
  11755. updateConfigValues(id);
  11756. if (dialogID != -1)
  11757. inputTaken = true;
  11758. }
  11759. }
  11760.  
  11761. public void sendFrame219() {
  11762. if (invOverlayInterfaceID != -1) {
  11763. invOverlayInterfaceID = -1;
  11764. tabAreaAltered = true;
  11765. }
  11766. if (backDialogID != -1) {
  11767. backDialogID = -1;
  11768. inputTaken = true;
  11769. }
  11770. if (inputDialogState != 0) {
  11771. inputDialogState = 0;
  11772. inputTaken = true;
  11773. }
  11774. openInterfaceID = -1;
  11775. aBoolean1149 = false;
  11776. }
  11777.  
  11778. public void sendFrame248(int interfaceID, int sideInterfaceID) {
  11779. if (backDialogID != -1) {
  11780. backDialogID = -1;
  11781. inputTaken = true;
  11782. }
  11783. if (inputDialogState != 0) {
  11784. inputDialogState = 0;
  11785. inputTaken = true;
  11786. }
  11787. openInterfaceID = interfaceID;
  11788. invOverlayInterfaceID = sideInterfaceID;
  11789. tabAreaAltered = true;
  11790. aBoolean1149 = false;
  11791. }
  11792.  
  11793. private boolean parsePacket() {
  11794. if (socketStream == null)
  11795. return false;
  11796. try {
  11797. int i = socketStream.available();
  11798. if (i == 0)
  11799. return false;
  11800. if (pktType == -1) {
  11801. socketStream.flushInputStream(inStream.buffer, 1);
  11802. pktType = inStream.buffer[0] & 0xff;
  11803. if (encryption != null)
  11804. pktType = pktType - encryption.getNextKey() & 0xff;
  11805. pktSize = SizeConstants.packetSizes[pktType];
  11806. i--;
  11807. }
  11808. if (pktSize == -1)
  11809. if (i > 0) {
  11810. socketStream.flushInputStream(inStream.buffer, 1);
  11811. pktSize = inStream.buffer[0] & 0xff;
  11812. i--;
  11813. } else {
  11814. return false;
  11815. }
  11816. if (pktSize == -2)
  11817. if (i > 1) {
  11818. socketStream.flushInputStream(inStream.buffer, 2);
  11819. inStream.currentOffset = 0;
  11820. pktSize = inStream.readUnsignedWord();
  11821. i -= 2;
  11822. } else {
  11823. return false;
  11824. }
  11825. if (i < pktSize)
  11826. return false;
  11827. inStream.currentOffset = 0;
  11828. socketStream.flushInputStream(inStream.buffer, pktSize);
  11829. anInt1009 = 0;
  11830. anInt843 = anInt842;
  11831. anInt842 = anInt841;
  11832. anInt841 = pktType;
  11833. switch (pktType) {
  11834. case 81:
  11835. updatePlayers(pktSize, inStream);
  11836. aBoolean1080 = false;
  11837. pktType = -1;
  11838. return true;
  11839.  
  11840. case 176:
  11841. daysSinceRecovChange = inStream.method427();
  11842. unreadMessages = inStream.method435();
  11843. membersInt = inStream.readUnsignedByte();
  11844. anInt1193 = inStream.method440();
  11845. daysSinceLastLogin = inStream.readUnsignedWord();
  11846. if (anInt1193 != 0 && openInterfaceID == -1) {
  11847. Signlink.dnslookup(TextClass.method586(anInt1193));
  11848. clearTopInterfaces();
  11849. char c = '\u028A';
  11850. if (daysSinceRecovChange != 201 || membersInt == 1)
  11851. c = '\u028F';
  11852. reportAbuseInput = "";
  11853. canMute = false;
  11854. for (int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
  11855. if (RSInterface.interfaceCache[k9] == null || RSInterface.interfaceCache[k9].contentType != c)
  11856. continue;
  11857. openInterfaceID = RSInterface.interfaceCache[k9].parentID;
  11858.  
  11859. }
  11860. }
  11861. pktType = -1;
  11862. return true;
  11863.  
  11864. case 64:
  11865. anInt1268 = inStream.method427();
  11866. anInt1269 = inStream.method428();
  11867. for (int j = anInt1268; j < anInt1268 + 8; j++) {
  11868. for (int l9 = anInt1269; l9 < anInt1269 + 8; l9++)
  11869. if (groundArray[plane][j][l9] != null) {
  11870. groundArray[plane][j][l9] = null;
  11871. spawnGroundItem(j, l9);
  11872. }
  11873. }
  11874. for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179.reverseGetNext())
  11875. if (class30_sub1.anInt1297 >= anInt1268 && class30_sub1.anInt1297 < anInt1268 + 8 && class30_sub1.anInt1298 >= anInt1269 && class30_sub1.anInt1298 < anInt1269 + 8 && class30_sub1.anInt1295 == plane)
  11876. class30_sub1.anInt1294 = 0;
  11877. pktType = -1;
  11878. return true;
  11879.  
  11880. case 185:
  11881. int k = inStream.method436();
  11882. RSInterface.interfaceCache[k].anInt233 = 3;
  11883. if (myPlayer.desc == null)
  11884. 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];
  11885. else
  11886. RSInterface.interfaceCache[k].mediaID = (int) (0x12345678L + myPlayer.desc.interfaceType);
  11887. pktType = -1;
  11888. return true;
  11889.  
  11890. /* Clan chat packet */
  11891. case 217:
  11892. try {
  11893. clanUsername = inStream.readString();
  11894. clanMessage = TextInput.processText(inStream.readString());
  11895. clanTitle = inStream.readString();
  11896. channelRights = inStream.readUnsignedWord();
  11897. pushMessage(clanMessage, 16, clanUsername);
  11898. } catch (Exception e) {
  11899. e.printStackTrace();
  11900. }
  11901. pktType = -1;
  11902. return true;
  11903.  
  11904. case 107:
  11905. aBoolean1160 = false;
  11906. for (int l = 0; l < 5; l++)
  11907. aBooleanArray876[l] = false;
  11908. xpCounter = 0;
  11909. pktType = -1;
  11910. return true;
  11911.  
  11912. case 72:
  11913. int i1 = inStream.method434();
  11914. RSInterface class9 = RSInterface.interfaceCache[i1];
  11915. for (int k15 = 0; k15 < class9.inv.length; k15++) {
  11916. class9.inv[k15] = -1;
  11917. class9.inv[k15] = 0;
  11918. }
  11919. pktType = -1;
  11920. return true;
  11921.  
  11922. case 214:
  11923. ignoreCount = pktSize / 8;
  11924. for (int j1 = 0; j1 < ignoreCount; j1++)
  11925. ignoreListAsLongs[j1] = inStream.readQWord();
  11926. pktType = -1;
  11927. return true;
  11928.  
  11929. case 166:
  11930. aBoolean1160 = true;
  11931. anInt1098 = inStream.readUnsignedByte();
  11932. anInt1099 = inStream.readUnsignedByte();
  11933. anInt1100 = inStream.readUnsignedWord();
  11934. anInt1101 = inStream.readUnsignedByte();
  11935. anInt1102 = inStream.readUnsignedByte();
  11936. if (anInt1102 >= 100) {
  11937. xCameraPos = anInt1098 * 128 + 64;
  11938. yCameraPos = anInt1099 * 128 + 64;
  11939. zCameraPos = method42(plane, yCameraPos, xCameraPos) - anInt1100;
  11940. }
  11941. pktType = -1;
  11942. return true;
  11943.  
  11944. case 134:
  11945. int k1 = inStream.readUnsignedByte();
  11946. inStream.readUnsignedByte();
  11947. int i10 = inStream.method439();
  11948. int l15 = inStream.readUnsignedByte();
  11949. currentExp[k1] = i10;
  11950. currentStats[k1] = l15;
  11951. maxStats[k1] = 1;
  11952. for (int k20 = 0; k20 < 98; k20++)
  11953. if (i10 >= Skills.EXP_FOR_LEVEL[k20])
  11954. maxStats[k1] = k20 + 2;
  11955. pktType = -1;
  11956. return true;
  11957.  
  11958. case 71:
  11959. int l1 = inStream.readUnsignedWord();
  11960. int j10 = inStream.method426();
  11961. if (l1 == 65535)
  11962. l1 = -1;
  11963. tabInterfaceIDs[j10] = l1;
  11964. tabAreaAltered = true;
  11965. pktType = -1;
  11966. return true;
  11967.  
  11968. case 74:
  11969. int i2 = inStream.method434();
  11970. if (i2 == 65535)
  11971. i2 = -1;
  11972. if (i2 != currentSong && musicEnabled && !lowMem && prevSong == 0) {
  11973. nextSong = i2;
  11974. songChanging = true;
  11975. onDemandFetcher.method558(2, nextSong);
  11976. }
  11977. currentSong = i2;
  11978. pktType = -1;
  11979. return true;
  11980.  
  11981. case 121:
  11982. int j2 = inStream.method436();
  11983. int k10 = inStream.method435();
  11984. if (musicEnabled && !lowMem) {
  11985. nextSong = j2;
  11986. songChanging = false;
  11987. onDemandFetcher.method558(2, nextSong);
  11988. prevSong = k10;
  11989. }
  11990. pktType = -1;
  11991. return true;
  11992.  
  11993. case 109:
  11994. resetLogout();
  11995. pktType = -1;
  11996. return false;
  11997.  
  11998. case 70:
  11999. int k2 = inStream.readSignedWord();
  12000. int l10 = inStream.method437();
  12001. int i16 = inStream.method434();
  12002. RSInterface class9_5 = RSInterface.interfaceCache[i16];
  12003. class9_5.anInt263 = k2;
  12004. class9_5.anInt265 = l10;
  12005. pktType = -1;
  12006. return true;
  12007.  
  12008. case 73:
  12009. case 241:
  12010. int l2 = anInt1069;
  12011. int i11 = anInt1070;
  12012. if (pktType == 73) {
  12013. l2 = inStream.method435();
  12014. i11 = inStream.readUnsignedWord();
  12015. aBoolean1159 = false;
  12016. }
  12017. if (pktType == 241) {
  12018. i11 = inStream.method435();
  12019. inStream.initBitAccess();
  12020. for (int j16 = 0; j16 < 4; j16++) {
  12021. for (int l20 = 0; l20 < 13; l20++) {
  12022. for (int j23 = 0; j23 < 13; j23++) {
  12023. int i26 = inStream.readBits(1);
  12024. if (i26 == 1)
  12025. anIntArrayArrayArray1129[j16][l20][j23] = inStream.readBits(26);
  12026. else
  12027. anIntArrayArrayArray1129[j16][l20][j23] = -1;
  12028. }
  12029. }
  12030. }
  12031. inStream.finishBitAccess();
  12032. l2 = inStream.readUnsignedWord();
  12033. aBoolean1159 = true;
  12034. }
  12035. if (anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2) {
  12036. pktType = -1;
  12037. return true;
  12038. }
  12039. anInt1069 = l2;
  12040. anInt1070 = i11;
  12041. baseX = (anInt1069 - 6) * 8;
  12042. baseY = (anInt1070 - 6) * 8;
  12043. aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49) && anInt1070 / 8 == 48;
  12044. if (anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
  12045. aBoolean1141 = true;
  12046. loadingStage = 1;
  12047. aLong824 = System.currentTimeMillis();
  12048. aRSImageProducer_1165.initDrawingArea();
  12049. drawLoadingMessages(1, "Loading - please wait.", null);
  12050. aRSImageProducer_1165.drawGraphics(frameMode == ScreenMode.FIXED ? 4 : 0, super.graphics, frameMode == ScreenMode.FIXED ? 4 : 0);
  12051. if (pktType == 73) {
  12052. int k16 = 0;
  12053. for (int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++) {
  12054. for (int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
  12055. k16++;
  12056. }
  12057. aByteArrayArray1183 = new byte[k16][];
  12058. aByteArrayArray1247 = new byte[k16][];
  12059. anIntArray1234 = new int[k16];
  12060. anIntArray1235 = new int[k16];
  12061. anIntArray1236 = new int[k16];
  12062. k16 = 0;
  12063. for (int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++) {
  12064. for (int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++) {
  12065. anIntArray1234[k16] = (l23 << 8) + j26;
  12066. if (aBoolean1141 && (j26 == 49 || j26 == 149 || j26 == 147 || l23 == 50 || l23 == 49 && j26 == 47)) {
  12067. anIntArray1235[k16] = -1;
  12068. anIntArray1236[k16] = -1;
  12069. k16++;
  12070. } else {
  12071. int k28 = anIntArray1235[k16] = onDemandFetcher.method562(0, j26, l23);
  12072. if (k28 != -1)
  12073. onDemandFetcher.method558(3, k28);
  12074. int j30 = anIntArray1236[k16] = onDemandFetcher.method562(1, j26, l23);
  12075. if (j30 != -1)
  12076. onDemandFetcher.method558(3, j30);
  12077. k16++;
  12078. }
  12079. }
  12080. }
  12081. }
  12082. if (pktType == 241) {
  12083. int l16 = 0;
  12084. int ai[] = new int[676];
  12085. for (int i24 = 0; i24 < 4; i24++) {
  12086. for (int k26 = 0; k26 < 13; k26++) {
  12087. for (int l28 = 0; l28 < 13; l28++) {
  12088. int k30 = anIntArrayArrayArray1129[i24][k26][l28];
  12089. if (k30 != -1) {
  12090. int k31 = k30 >> 14 & 0x3ff;
  12091. int i32 = k30 >> 3 & 0x7ff;
  12092. int k32 = (k31 / 8 << 8) + i32 / 8;
  12093. for (int j33 = 0; j33 < l16; j33++) {
  12094. if (ai[j33] != k32)
  12095. continue;
  12096. k32 = -1;
  12097.  
  12098. }
  12099. if (k32 != -1)
  12100. ai[l16++] = k32;
  12101. }
  12102. }
  12103. }
  12104. }
  12105. aByteArrayArray1183 = new byte[l16][];
  12106. aByteArrayArray1247 = new byte[l16][];
  12107. anIntArray1234 = new int[l16];
  12108. anIntArray1235 = new int[l16];
  12109. anIntArray1236 = new int[l16];
  12110. for (int l26 = 0; l26 < l16; l26++) {
  12111. int i29 = anIntArray1234[l26] = ai[l26];
  12112. int l30 = i29 >> 8 & 0xff;
  12113. int l31 = i29 & 0xff;
  12114. int j32 = anIntArray1235[l26] = onDemandFetcher.method562(0, l31, l30);
  12115. if (j32 != -1)
  12116. onDemandFetcher.method558(3, j32);
  12117. int i33 = anIntArray1236[l26] = onDemandFetcher.method562(1, l31, l30);
  12118. if (i33 != -1)
  12119. onDemandFetcher.method558(3, i33);
  12120. }
  12121. }
  12122. int i17 = baseX - anInt1036;
  12123. int j21 = baseY - anInt1037;
  12124. anInt1036 = baseX;
  12125. anInt1037 = baseY;
  12126. for (int j24 = 0; j24 < 16384; j24++) {
  12127. Npc npc = npcArray[j24];
  12128. if (npc != null) {
  12129. for (int j29 = 0; j29 < 10; j29++) {
  12130. npc.smallX[j29] -= i17;
  12131. npc.smallY[j29] -= j21;
  12132. }
  12133. npc.x -= i17 * 128;
  12134. npc.y -= j21 * 128;
  12135. }
  12136. }
  12137. for (int i27 = 0; i27 < maxPlayers; i27++) {
  12138. Player player = playerArray[i27];
  12139. if (player != null) {
  12140. for (int i31 = 0; i31 < 10; i31++) {
  12141. player.smallX[i31] -= i17;
  12142. player.smallY[i31] -= j21;
  12143. }
  12144. player.x -= i17 * 128;
  12145. player.y -= j21 * 128;
  12146. }
  12147. }
  12148. aBoolean1080 = true;
  12149. byte byte1 = 0;
  12150. byte byte2 = 104;
  12151. byte byte3 = 1;
  12152. if (i17 < 0) {
  12153. byte1 = 103;
  12154. byte2 = -1;
  12155. byte3 = -1;
  12156. }
  12157. byte byte4 = 0;
  12158. byte byte5 = 104;
  12159. byte byte6 = 1;
  12160. if (j21 < 0) {
  12161. byte4 = 103;
  12162. byte5 = -1;
  12163. byte6 = -1;
  12164. }
  12165. for (int k33 = byte1; k33 != byte2; k33 += byte3) {
  12166. for (int l33 = byte4; l33 != byte5; l33 += byte6) {
  12167. int i34 = k33 + i17;
  12168. int j34 = l33 + j21;
  12169. for (int k34 = 0; k34 < 4; k34++)
  12170. if (i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
  12171. groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
  12172. else
  12173. groundArray[k34][k33][l33] = null;
  12174. }
  12175. }
  12176. for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179.reverseGetNext()) {
  12177. class30_sub1_1.anInt1297 -= i17;
  12178. class30_sub1_1.anInt1298 -= j21;
  12179. if (class30_sub1_1.anInt1297 < 0 || class30_sub1_1.anInt1298 < 0 || class30_sub1_1.anInt1297 >= 104 || class30_sub1_1.anInt1298 >= 104)
  12180. class30_sub1_1.unlink();
  12181. }
  12182. if (destX != 0) {
  12183. destX -= i17;
  12184. destY -= j21;
  12185. }
  12186. aBoolean1160 = false;
  12187. pktType = -1;
  12188. return true;
  12189.  
  12190. case 208:
  12191. int i3 = inStream.method437();
  12192. if (i3 >= 0) {
  12193. method60(i3);
  12194. walkableInterfaceMode = true;
  12195. } else
  12196. walkableInterfaceMode = false;
  12197. anInt1018 = i3;
  12198. pktType = -1;
  12199. return true;
  12200.  
  12201. case 99:
  12202. anInt1021 = inStream.readUnsignedByte();
  12203. pktType = -1;
  12204. return true;
  12205.  
  12206. case 75:
  12207. int j3 = inStream.method436();
  12208. int j11 = inStream.method436();
  12209. RSInterface.interfaceCache[j11].anInt233 = 2;
  12210. RSInterface.interfaceCache[j11].mediaID = j3;
  12211. pktType = -1;
  12212. return true;
  12213.  
  12214. case 114:
  12215. anInt1104 = inStream.method434() * 30;
  12216. pktType = -1;
  12217. return true;
  12218.  
  12219. case 60:
  12220. anInt1269 = inStream.readUnsignedByte();
  12221. anInt1268 = inStream.method427();
  12222. while (inStream.currentOffset < pktSize) {
  12223. int k3 = inStream.readUnsignedByte();
  12224. method137(inStream, k3);
  12225. }
  12226. pktType = -1;
  12227. return true;
  12228.  
  12229. case 35:
  12230. int l3 = inStream.readUnsignedByte();
  12231. int k11 = inStream.readUnsignedByte();
  12232. int j17 = inStream.readUnsignedByte();
  12233. int k21 = inStream.readUnsignedByte();
  12234. aBooleanArray876[l3] = true;
  12235. anIntArray873[l3] = k11;
  12236. anIntArray1203[l3] = j17;
  12237. anIntArray928[l3] = k21;
  12238. anIntArray1030[l3] = 0;
  12239. pktType = -1;
  12240. return true;
  12241.  
  12242. case 174:
  12243. int i4 = inStream.readUnsignedWord();
  12244. int l11 = inStream.readUnsignedByte();
  12245. int k17 = inStream.readUnsignedWord();
  12246. if (aBoolean848 && !lowMem && anInt1062 < 50) {
  12247. anIntArray1207[anInt1062] = i4;
  12248. anIntArray1241[anInt1062] = l11;
  12249. anIntArray1250[anInt1062] = k17 + Sounds.anIntArray326[i4];
  12250. anInt1062++;
  12251. }
  12252. pktType = -1;
  12253. return true;
  12254.  
  12255. case 104:
  12256. int j4 = inStream.method427();
  12257. int i12 = inStream.method426();
  12258. String s6 = inStream.readString();
  12259. if (j4 >= 1 && j4 <= 5) {
  12260. if (s6.equalsIgnoreCase("null"))
  12261. s6 = null;
  12262. atPlayerActions[j4 - 1] = s6;
  12263. atPlayerArray[j4 - 1] = i12 == 0;
  12264. }
  12265. pktType = -1;
  12266. return true;
  12267.  
  12268. case 78:
  12269. destX = 0;
  12270. pktType = -1;
  12271. return true;
  12272.  
  12273. case 253:
  12274. String s = inStream.readString();
  12275. if (s.endsWith(":tradereq:")) {
  12276. String s3 = s.substring(0, s.indexOf(":"));
  12277. long l17 = TextClass.longForName(s3);
  12278. boolean flag2 = false;
  12279. for (int j27 = 0; j27 < ignoreCount; j27++) {
  12280. if (ignoreListAsLongs[j27] != l17)
  12281. continue;
  12282. flag2 = true;
  12283.  
  12284. }
  12285. if (!flag2 && anInt1251 == 0)
  12286. pushMessage("wishes to trade with you.", 4, s3);
  12287.  
  12288. } else if (s.startsWith(":updateSettings:")) {
  12289. SettingHandler.updateText();
  12290. } else if (s.startsWith(":defaultSettings:")) {
  12291. SettingHandler.defaultSettings();
  12292. } else if (s.startsWith(":saveSettings:")) {
  12293. SettingHandler.save();
  12294. } else if (s.startsWith(":transparentTab:")) {
  12295. if (frameMode != ScreenMode.FIXED) {
  12296. transparentTabArea = !transparentTabArea;
  12297. } else {
  12298. pushMessage("Settings are not applicable in fixed mode!", 0, "");
  12299. }
  12300. } else if (s.startsWith(":transparentChatbox:")) {
  12301. if (frameMode != ScreenMode.FIXED) {
  12302. changeChatArea = !changeChatArea;
  12303. } else {
  12304. pushMessage("Settings are not applicable in fixed mode!", 0, "");
  12305. }
  12306. } else if (s.startsWith(":sideStones:")) {
  12307. if (frameMode != ScreenMode.FIXED) {
  12308. changeTabArea = !changeTabArea;
  12309. } else {
  12310. pushMessage("Settings are not applicable in fixed mode!", 0, "");
  12311. }
  12312. } else if (s.startsWith(":prestigeColorsTrue:")) {
  12313. Configuration.enablePrestigeColors = true;
  12314. SettingHandler.updateText();
  12315. } else if (s.startsWith(":prestigeColorsFalse:")) {
  12316. Configuration.enablePrestigeColors = false;
  12317. SettingHandler.updateText();
  12318.  
  12319. } else if (s.endsWith(":clan:")) {
  12320. String s4 = s.substring(0, s.indexOf(":"));
  12321. TextClass.longForName(s4);
  12322. pushMessage("Clan: ", 8, s4);
  12323. } else if (s.endsWith("#url#")) {
  12324. String link = s.substring(0, s.indexOf("#"));
  12325. pushMessage("Join us at: ", 9, link);
  12326. } else if (s.endsWith(":duelreq:")) {
  12327. String s4 = s.substring(0, s.indexOf(":"));
  12328. long l18 = TextClass.longForName(s4);
  12329. boolean flag3 = false;
  12330. for (int k27 = 0; k27 < ignoreCount; k27++) {
  12331. if (ignoreListAsLongs[k27] != l18)
  12332. continue;
  12333. flag3 = true;
  12334.  
  12335. }
  12336. if (!flag3 && anInt1251 == 0)
  12337. pushMessage("wishes to duel with you.", 8, s4);
  12338. } else if (s.endsWith(":chalreq:")) {
  12339. String s5 = s.substring(0, s.indexOf(":"));
  12340. long l19 = TextClass.longForName(s5);
  12341. boolean flag4 = false;
  12342. for (int l27 = 0; l27 < ignoreCount; l27++) {
  12343. if (ignoreListAsLongs[l27] != l19)
  12344. continue;
  12345. flag4 = true;
  12346.  
  12347. }
  12348. if (!flag4 && anInt1251 == 0) {
  12349. String s8 = s.substring(s.indexOf(":") + 1, s.length() - 9);
  12350. pushMessage(s8, 8, s5);
  12351. }
  12352. } else {
  12353. pushMessage(s, 0, "");
  12354. }
  12355. pktType = -1;
  12356. return true;
  12357.  
  12358. case 1:
  12359. for (int k4 = 0; k4 < playerArray.length; k4++)
  12360. if (playerArray[k4] != null)
  12361. playerArray[k4].anim = -1;
  12362. for (int j12 = 0; j12 < npcArray.length; j12++)
  12363. if (npcArray[j12] != null)
  12364. npcArray[j12].anim = -1;
  12365. pktType = -1;
  12366. return true;
  12367.  
  12368. case 50:
  12369. long l4 = inStream.readQWord();
  12370. int i18 = inStream.readUnsignedByte();
  12371. String s7 = TextClass.fixName(TextClass.nameForLong(l4));
  12372. for (int k24 = 0; k24 < friendsCount; k24++) {
  12373. if (l4 != friendsListAsLongs[k24])
  12374. continue;
  12375. if (friendsNodeIDs[k24] != i18) {
  12376. friendsNodeIDs[k24] = i18;
  12377. if (i18 >= 2) {
  12378. pushMessage(s7 + " has logged in.", 5, "");
  12379. }
  12380. if (i18 <= 1) {
  12381. pushMessage(s7 + " has logged out.", 5, "");
  12382. }
  12383. }
  12384. s7 = null;
  12385.  
  12386. }
  12387. if (s7 != null && friendsCount < 200) {
  12388. friendsListAsLongs[friendsCount] = l4;
  12389. friendsList[friendsCount] = s7;
  12390. friendsNodeIDs[friendsCount] = i18;
  12391. friendsCount++;
  12392. }
  12393. for (boolean flag6 = false; !flag6;) {
  12394. flag6 = true;
  12395. for (int k29 = 0; k29 < friendsCount - 1; k29++)
  12396. if (friendsNodeIDs[k29] != nodeID && friendsNodeIDs[k29 + 1] == nodeID || friendsNodeIDs[k29] == 0 && friendsNodeIDs[k29 + 1] != 0) {
  12397. int j31 = friendsNodeIDs[k29];
  12398. friendsNodeIDs[k29] = friendsNodeIDs[k29 + 1];
  12399. friendsNodeIDs[k29 + 1] = j31;
  12400. String s10 = friendsList[k29];
  12401. friendsList[k29] = friendsList[k29 + 1];
  12402. friendsList[k29 + 1] = s10;
  12403. long l32 = friendsListAsLongs[k29];
  12404. friendsListAsLongs[k29] = friendsListAsLongs[k29 + 1];
  12405. friendsListAsLongs[k29 + 1] = l32;
  12406. flag6 = false;
  12407. }
  12408. }
  12409. pktType = -1;
  12410. return true;
  12411.  
  12412. case 110:
  12413. if (tabID == 12) {
  12414. }
  12415. energy = inStream.readUnsignedByte();
  12416. pktType = -1;
  12417. return true;
  12418.  
  12419. case 254:
  12420. anInt855 = inStream.readUnsignedByte();
  12421. if (anInt855 == 1)
  12422. anInt1222 = inStream.readUnsignedWord();
  12423. if (anInt855 >= 2 && anInt855 <= 6) {
  12424. if (anInt855 == 2) {
  12425. anInt937 = 64;
  12426. anInt938 = 64;
  12427. }
  12428. if (anInt855 == 3) {
  12429. anInt937 = 0;
  12430. anInt938 = 64;
  12431. }
  12432. if (anInt855 == 4) {
  12433. anInt937 = 128;
  12434. anInt938 = 64;
  12435. }
  12436. if (anInt855 == 5) {
  12437. anInt937 = 64;
  12438. anInt938 = 0;
  12439. }
  12440. if (anInt855 == 6) {
  12441. anInt937 = 64;
  12442. anInt938 = 128;
  12443. }
  12444. anInt855 = 2;
  12445. anInt934 = inStream.readUnsignedWord();
  12446. anInt935 = inStream.readUnsignedWord();
  12447. anInt936 = inStream.readUnsignedByte();
  12448. }
  12449. if (anInt855 == 10)
  12450. anInt933 = inStream.readUnsignedWord();
  12451. pktType = -1;
  12452. return true;
  12453.  
  12454. case 248:
  12455. int i5 = inStream.method435();
  12456. int k12 = inStream.readUnsignedWord();
  12457. if (backDialogID != -1) {
  12458. backDialogID = -1;
  12459. inputTaken = true;
  12460. }
  12461. if (inputDialogState != 0) {
  12462. inputDialogState = 0;
  12463. inputTaken = true;
  12464. }
  12465. openInterfaceID = i5;
  12466. invOverlayInterfaceID = k12;
  12467. tabAreaAltered = true;
  12468. aBoolean1149 = false;
  12469. pktType = -1;
  12470. return true;
  12471.  
  12472. case 79:
  12473. int j5 = inStream.method434();
  12474. int l12 = inStream.method435();
  12475. RSInterface class9_3 = RSInterface.interfaceCache[j5];
  12476. if (class9_3 != null && class9_3.type == 0) {
  12477. if (l12 < 0)
  12478. l12 = 0;
  12479. if (l12 > class9_3.scrollMax - class9_3.height)
  12480. l12 = class9_3.scrollMax - class9_3.height;
  12481. class9_3.scrollPosition = l12;
  12482. }
  12483. pktType = -1;
  12484. return true;
  12485.  
  12486. case 68:
  12487. for (int k5 = 0; k5 < variousSettings.length; k5++)
  12488. if (variousSettings[k5] != anIntArray1045[k5]) {
  12489. variousSettings[k5] = anIntArray1045[k5];
  12490. updateConfigValues(k5);
  12491. }
  12492. pktType = -1;
  12493. return true;
  12494.  
  12495. case 173:
  12496. try {
  12497. pushKill(inStream.readString(), inStream.readString(), inStream.readUnsignedWord(), inStream.readUnsignedByte() == 1);
  12498. } catch (Exception e) {
  12499. e.printStackTrace();
  12500. }
  12501. pktType = -1;
  12502. return true;
  12503.  
  12504. case 175:
  12505. try {
  12506. pushFeed(inStream.readString(), inStream.readUnsignedWord(), inStream.readUnsignedWord());
  12507. } catch (Exception e) {
  12508. e.printStackTrace();
  12509. }
  12510. pktType = -1;
  12511. return true;
  12512.  
  12513. case 196:
  12514. final long usernameHash = inStream.readQWord();
  12515. int j18 = inStream.readDWord();
  12516. int rights = inStream.readUnsignedByte();
  12517. boolean flag5 = false;
  12518. if (rights <= 1) {
  12519. for (int l29 = 0; l29 < ignoreCount; l29++) {
  12520. if (ignoreListAsLongs[l29] != usernameHash)
  12521. continue;
  12522. flag5 = true;
  12523.  
  12524. }
  12525. }
  12526. if (!flag5 && anInt1251 == 0)
  12527. try {
  12528. anIntArray1240[anInt1169] = j18;
  12529. anInt1169 = (anInt1169 + 1) % 100;
  12530. String s9 = TextInput.method525(pktSize - 13, inStream);
  12531. if (Configuration.showNotifications) {
  12532. if (gameFrame != null) {
  12533. if (windowFlasher == null) {
  12534. windowFlasher = new WindowFlasher(gameFrame);
  12535. }
  12536. windowFlasher.flashWindow();
  12537. }
  12538. }
  12539. if (rights >= 1) {
  12540. pushMessage(s9, 7, "@cr" + rights + "@" + TextClass.fixName(TextClass.nameForLong(usernameHash)));
  12541. } else {
  12542. pushMessage(s9, 3, TextClass.fixName(TextClass.nameForLong(usernameHash)));
  12543. }
  12544. } catch (Exception exception1) {
  12545. Signlink.reporterror("cde1");
  12546. }
  12547. pktType = -1;
  12548. return true;
  12549.  
  12550. case 85:
  12551. anInt1269 = inStream.method427();
  12552. anInt1268 = inStream.method427();
  12553. pktType = -1;
  12554. return true;
  12555.  
  12556. case 24:
  12557. anInt1054 = inStream.method428();
  12558. if (anInt1054 == tabID) {
  12559. if (anInt1054 == 3)
  12560. tabID = 1;
  12561. else
  12562. tabID = 3;
  12563. }
  12564. pktType = -1;
  12565. return true;
  12566.  
  12567. case 246:
  12568. int i6 = inStream.method434();
  12569. int i13 = inStream.readUnsignedWord();
  12570. int k18 = inStream.readUnsignedWord();
  12571. if (k18 == 65535) {
  12572. RSInterface.interfaceCache[i6].anInt233 = 0;
  12573. pktType = -1;
  12574. return true;
  12575. } else {
  12576. ItemDef itemDef = ItemDef.forID(k18);
  12577. RSInterface.interfaceCache[i6].anInt233 = 4;
  12578. RSInterface.interfaceCache[i6].mediaID = k18;
  12579. RSInterface.interfaceCache[i6].modelRotation1 = itemDef.modelRotationY;
  12580. RSInterface.interfaceCache[i6].modelRotation2 = itemDef.modelRotationX;
  12581. RSInterface.interfaceCache[i6].modelZoom = (itemDef.modelZoom * 100) / i13;
  12582. pktType = -1;
  12583. return true;
  12584. }
  12585.  
  12586. case 171:
  12587. boolean flag1 = inStream.readUnsignedByte() == 1;
  12588. int j13 = inStream.readUnsignedWord();
  12589. RSInterface.interfaceCache[j13].isMouseoverTriggered = flag1;
  12590. pktType = -1;
  12591. return true;
  12592.  
  12593. case 142:
  12594. int j6 = inStream.method434();
  12595. method60(j6);
  12596. if (backDialogID != -1) {
  12597. backDialogID = -1;
  12598. inputTaken = true;
  12599. }
  12600. if (inputDialogState != 0) {
  12601. inputDialogState = 0;
  12602. inputTaken = true;
  12603. }
  12604. invOverlayInterfaceID = j6;
  12605. tabAreaAltered = true;
  12606. openInterfaceID = -1;
  12607. aBoolean1149 = false;
  12608. pktType = -1;
  12609. return true;
  12610.  
  12611. case 126:
  12612. try {
  12613. String text = inStream.readString();
  12614. int frame = inStream.method435();
  12615. if (text.startsWith("www.") || text.startsWith("http://www.")) {
  12616. openURL(text);
  12617. }
  12618. if (text.startsWith(":quicks:"))
  12619. clickedQuickPrayers = text.substring(8).equalsIgnoreCase("on") ? true : false;
  12620. if (text.startsWith(":prayer:"))
  12621. prayerBook = text.substring(8);
  12622. updateStrings(text, frame);
  12623. sendFrame126(text, frame);
  12624. if (frame >= 18144 && frame <= 18244) {
  12625. clanList[frame - 18144] = text;
  12626. }
  12627. if (frame == 8135) {
  12628. RSInterface.interfaceCache[8135].opacity = 108;
  12629. }
  12630. } catch (Exception e) {
  12631. }
  12632. pktType = -1;
  12633. return true;
  12634.  
  12635. case 124:
  12636. try {
  12637. int npc = inStream.readUnsignedByte();
  12638. int size = inStream.readUnsignedByte();
  12639. if (npc <= 0) {
  12640. npcDisplay = null;
  12641. pktType = -1;
  12642. return true;
  12643. }
  12644. npcDisplay = new Npc();
  12645. npcDisplay.desc = EntityDef.forID(npc, false);
  12646. npcDisplay.anInt1540 = npcDisplay.desc.aByte68;
  12647. npcDisplay.anInt1504 = npcDisplay.desc.anInt79;
  12648. npcDisplay.desc.anInt86 = size;
  12649. npcDisplay.desc.anInt91 = size;
  12650. npcDisplay.anInt1511 = npcDisplay.desc.standAnim;
  12651. } catch (Exception e) {
  12652. e.printStackTrace();
  12653. }
  12654. pktType = -1;
  12655. return true;
  12656.  
  12657. case 127:
  12658. try {
  12659. int skill = inStream.readSignedByte();
  12660. int exp = inStream.readDWord();
  12661. xpCounter = inStream.readDWord();
  12662. addXP(skill, exp);
  12663. } catch (Exception e) {
  12664. }
  12665. pktType = -1;
  12666. return true;
  12667.  
  12668. case 125:
  12669. try {
  12670. int skill = inStream.readSignedByte();
  12671. statsSkillGoal[skill][2] = inStream.readDWord();
  12672. statsSkillGoal[skill][0] = inStream.readDWord();
  12673. statsSkillGoal[skill][1] = inStream.readSignedByte();
  12674. } catch (Exception e) {
  12675. }
  12676. pktType = -1;
  12677. return true;
  12678.  
  12679. case 202:
  12680. String msg = inStream.readString();
  12681. int col = inStream.readDWord();
  12682. BannerManager.addBanner(msg, col);
  12683. pktType = -1;
  12684. return true;
  12685.  
  12686. case 201:
  12687. try {
  12688. playerIndex = inStream.readUnsignedWord();
  12689. } catch (Exception e) {
  12690. }
  12691. pktType = -1;
  12692. return true;
  12693.  
  12694. case 206:
  12695. publicChatMode = inStream.readUnsignedByte();
  12696. privateChatMode = inStream.readUnsignedByte();
  12697. tradeMode = inStream.readUnsignedByte();
  12698. inputTaken = true;
  12699. pktType = -1;
  12700. return true;
  12701.  
  12702. case 240:
  12703. if (tabID == 12) {
  12704. }
  12705. weight = inStream.readSignedWord();
  12706. pktType = -1;
  12707. return true;
  12708.  
  12709. case 8:
  12710. int k6 = inStream.method436();
  12711. int l13 = inStream.readUnsignedWord();
  12712. RSInterface.interfaceCache[k6].anInt233 = 1;
  12713. RSInterface.interfaceCache[k6].mediaID = l13;
  12714. pktType = -1;
  12715. return true;
  12716.  
  12717. case 122:
  12718. int intId = inStream.method436();
  12719. int r = inStream.readUnsignedByte();
  12720. int g = inStream.readUnsignedByte();
  12721. int b = inStream.readUnsignedByte();
  12722. if (RSInterface.interfaceCache[intId] != null) {
  12723. RSInterface.interfaceCache[intId].textColor = r << 16 | g << 8 | b;
  12724. }
  12725. pktType = -1;
  12726. return true;
  12727.  
  12728. case 53:
  12729. int i7 = inStream.readUnsignedWord();
  12730. RSInterface class9_1 = RSInterface.interfaceCache[i7];
  12731. int j19 = inStream.readUnsignedWord();
  12732. for (int j22 = 0; j22 < j19; j22++) {
  12733. int i25 = inStream.readUnsignedByte();
  12734. if (i25 == 255)
  12735. i25 = inStream.method440();
  12736. class9_1.inv[j22] = inStream.method436();
  12737. class9_1.invStackSizes[j22] = i25;
  12738. }
  12739. for (int j25 = j19; j25 < class9_1.inv.length; j25++) {
  12740. class9_1.inv[j25] = 0;
  12741. class9_1.invStackSizes[j25] = 0;
  12742. }
  12743. if (class9_1.contentType == 206) {
  12744. for (int tab = 0; tab < 10; tab++) {
  12745. int amount = inStream.readSignedByte() << 8 | inStream.readUnsignedWord();
  12746. tabAmounts[tab] = amount;
  12747. }
  12748.  
  12749. if (variousSettings[1012] == 1) {
  12750. RSInterface bank = RSInterface.interfaceCache[5382];
  12751. Arrays.fill(bankInvTemp, 0);
  12752. Arrays.fill(bankStackTemp, 0);
  12753. for (int slot = 0, bankSlot = 0; slot < bank.inv.length; slot++) {
  12754. if (bank.inv[slot] - 1 > 0) {
  12755. if (ItemDef.forID(bank.inv[slot] - 1).name.toLowerCase().contains(promptInput.toLowerCase())) {
  12756. bankInvTemp[bankSlot] = bank.inv[slot];
  12757. bankStackTemp[bankSlot++] = bank.invStackSizes[slot];
  12758. }
  12759. }
  12760. }
  12761. }
  12762. }
  12763. pktType = -1;
  12764. return true;
  12765.  
  12766. case 230:
  12767. int j7 = inStream.method435();
  12768. int j14 = inStream.readUnsignedWord();
  12769. int k19 = inStream.readUnsignedWord();
  12770. int k22 = inStream.method436();
  12771. RSInterface.interfaceCache[j14].modelRotation1 = k19;
  12772. RSInterface.interfaceCache[j14].modelRotation2 = k22;
  12773. RSInterface.interfaceCache[j14].modelZoom = j7;
  12774. pktType = -1;
  12775. return true;
  12776.  
  12777. case 221:
  12778. anInt900 = inStream.readUnsignedByte();
  12779. pktType = -1;
  12780. return true;
  12781.  
  12782. case 177:
  12783. aBoolean1160 = true;
  12784. anInt995 = inStream.readUnsignedByte();
  12785. anInt996 = inStream.readUnsignedByte();
  12786. anInt997 = inStream.readUnsignedWord();
  12787. anInt998 = inStream.readUnsignedByte();
  12788. anInt999 = inStream.readUnsignedByte();
  12789. if (anInt999 >= 100) {
  12790. int k7 = anInt995 * 128 + 64;
  12791. int k14 = anInt996 * 128 + 64;
  12792. int i20 = method42(plane, k14, k7) - anInt997;
  12793. int l22 = k7 - xCameraPos;
  12794. int k25 = i20 - zCameraPos;
  12795. int j28 = k14 - yCameraPos;
  12796. int i30 = (int) Math.sqrt(l22 * l22 + j28 * j28);
  12797. yCameraCurve = (int) (Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  12798. xCameraCurve = (int) (Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  12799. if (yCameraCurve < 128)
  12800. yCameraCurve = 128;
  12801. if (yCameraCurve > 383)
  12802. yCameraCurve = 383;
  12803. }
  12804. pktType = -1;
  12805. return true;
  12806.  
  12807. case 249:
  12808. anInt1046 = inStream.method426();
  12809. unknownInt10 = inStream.method436();
  12810. pktType = -1;
  12811. return true;
  12812.  
  12813. case 65:
  12814. updateNPCs(inStream, pktSize);
  12815. pktType = -1;
  12816. return true;
  12817.  
  12818. case 27:
  12819. messagePromptRaised = false;
  12820. inputDialogState = 1;
  12821. amountOrNameInput = "";
  12822. inputTaken = true;
  12823. pktType = -1;
  12824. return true;
  12825.  
  12826. case 187:
  12827. messagePromptRaised = false;
  12828. inputDialogState = 2;
  12829. amountOrNameInput = "";
  12830. inputTaken = true;
  12831. pktType = -1;
  12832. return true;
  12833.  
  12834. case 97:
  12835. int l7 = inStream.readUnsignedWord();
  12836. method60(l7);
  12837. if (invOverlayInterfaceID != -1) {
  12838. invOverlayInterfaceID = -1;
  12839. tabAreaAltered = true;
  12840. }
  12841. if (backDialogID != -1) {
  12842. backDialogID = -1;
  12843. inputTaken = true;
  12844. }
  12845. if (inputDialogState != 0) {
  12846. inputDialogState = 0;
  12847. inputTaken = true;
  12848. }
  12849. openInterfaceID = l7;
  12850. aBoolean1149 = false;
  12851. pktType = -1;
  12852. return true;
  12853.  
  12854. case 218:
  12855. int i8 = inStream.method438();
  12856. dialogID = i8;
  12857. inputTaken = true;
  12858. pktType = -1;
  12859. return true;
  12860.  
  12861. case 87:
  12862. int j8 = inStream.method434();
  12863. int l14 = inStream.method439();
  12864. anIntArray1045[j8] = l14;
  12865. if (variousSettings[j8] != l14) {
  12866. variousSettings[j8] = l14;
  12867. updateConfigValues(j8);
  12868. if (dialogID != -1)
  12869. inputTaken = true;
  12870. }
  12871. pktType = -1;
  12872. return true;
  12873.  
  12874. case 36:
  12875. int k8 = inStream.method434();
  12876. byte byte0 = inStream.readSignedByte();
  12877. anIntArray1045[k8] = byte0;
  12878. if (variousSettings[k8] != byte0) {
  12879. variousSettings[k8] = byte0;
  12880. updateConfigValues(k8);
  12881. if (dialogID != -1)
  12882. inputTaken = true;
  12883. }
  12884. pktType = -1;
  12885. return true;
  12886.  
  12887. case 61:
  12888. anInt1055 = inStream.readUnsignedByte();
  12889. pktType = -1;
  12890. return true;
  12891.  
  12892. case 200:
  12893. int l8 = inStream.readUnsignedWord();
  12894. int i15 = inStream.readSignedWord();
  12895. RSInterface class9_4 = RSInterface.interfaceCache[l8];
  12896. class9_4.anInt257 = i15;
  12897. pktType = -1;
  12898. return true;
  12899.  
  12900. case 219:
  12901. if (invOverlayInterfaceID != -1) {
  12902. invOverlayInterfaceID = -1;
  12903. tabAreaAltered = true;
  12904. }
  12905. if (backDialogID != -1) {
  12906. backDialogID = -1;
  12907. inputTaken = true;
  12908. }
  12909. if (inputDialogState != 0) {
  12910. inputDialogState = 0;
  12911. inputTaken = true;
  12912. }
  12913. openInterfaceID = -1;
  12914. aBoolean1149 = false;
  12915. pktType = -1;
  12916. return true;
  12917.  
  12918. case 34:
  12919. int i9 = inStream.readUnsignedWord();
  12920. RSInterface class9_2 = RSInterface.interfaceCache[i9];
  12921. while (inStream.currentOffset < pktSize) {
  12922. int j20 = inStream.method422();
  12923. int i23 = inStream.readUnsignedWord();
  12924. int l25 = inStream.readUnsignedByte();
  12925. if (l25 == 255)
  12926. l25 = inStream.readDWord();
  12927. if (j20 >= 0 && j20 < class9_2.inv.length) {
  12928. class9_2.inv[j20] = i23;
  12929. class9_2.invStackSizes[j20] = l25;
  12930. }
  12931. }
  12932. pktType = -1;
  12933. return true;
  12934.  
  12935. case 4:
  12936. case 44:
  12937. case 84:
  12938. case 101:
  12939. case 105:
  12940. case 117:
  12941. case 147:
  12942. case 151:
  12943. case 156:
  12944. case 160:
  12945. case 215:
  12946. method137(inStream, pktType);
  12947. pktType = -1;
  12948. return true;
  12949.  
  12950. case 106:
  12951. tabID = inStream.method427();
  12952. tabAreaAltered = true;
  12953. pktType = -1;
  12954. return true;
  12955.  
  12956. case 164:
  12957. int j9 = inStream.method434();
  12958. method60(j9);
  12959. if (invOverlayInterfaceID != -1) {
  12960. invOverlayInterfaceID = -1;
  12961. tabAreaAltered = true;
  12962. }
  12963. backDialogID = j9;
  12964. inputTaken = true;
  12965. openInterfaceID = -1;
  12966. aBoolean1149 = false;
  12967. pktType = -1;
  12968. return true;
  12969.  
  12970. }
  12971. Signlink.reporterror("T1 - " + pktType + "," + pktSize + " - " + anInt842 + "," + anInt843);
  12972. // resetLogout();
  12973. } catch (IOException _ex) {
  12974. dropClient();
  12975. } catch (Exception exception) {
  12976. exception.printStackTrace();
  12977. String s2 = "T2 - " + pktType + "," + anInt842 + "," + anInt843 + " - " + pktSize + "," + (baseX + myPlayer.smallX[0]) + "," + (baseY + myPlayer.smallY[0]) + " - ";
  12978. for (int j15 = 0; j15 < pktSize && j15 < 50; j15++)
  12979. s2 = s2 + inStream.buffer[j15] + ",";
  12980. Signlink.reporterror(s2);
  12981. // resetLogout();
  12982. }
  12983. pktType = -1;
  12984. return true;
  12985. }
  12986.  
  12987. public void openURL(String url) {
  12988. try {
  12989. Desktop.getDesktop().browse(new URI(url));
  12990. } catch (Exception e) {
  12991. }
  12992. }
  12993.  
  12994. private void replyToPM() {
  12995. String name = null;
  12996. for (int k = 0; k < 100; k++) {
  12997. if (chatMessages[k] == null) {
  12998. continue;
  12999. }
  13000. int l = chatTypes[k];
  13001. if ((l == 3) || (l == 7)) {
  13002. name = chatNames[k];
  13003. break;
  13004. }
  13005. }
  13006. if (name == null) {
  13007. pushMessage("You haven't received any messages to which you can reply.", 0, "");
  13008. return;
  13009. }
  13010. if (name != null) {
  13011. if (name.indexOf("@") == 0) {
  13012. name = name.substring(5);
  13013. }
  13014. }
  13015. long nameAsLong = TextClass.longForName(name.trim());
  13016. int k3 = -1;
  13017. for (int i4 = 0; i4 < friendsCount; i4++) {
  13018. if (friendsListAsLongs[i4] != nameAsLong) {
  13019. continue;
  13020. }
  13021. k3 = i4;
  13022. break;
  13023. }
  13024. if (k3 != -1) {
  13025. if (friendsNodeIDs[k3] > 0) {
  13026. inputTaken = true;
  13027. inputDialogState = 0;
  13028. messagePromptRaised = true;
  13029. promptInput = "";
  13030. friendsListAction = 3;
  13031. aLong953 = friendsListAsLongs[k3];
  13032. aString1121 = "Enter message to send to " + friendsList[k3];
  13033. } else {
  13034. pushMessage("That player is currently offline.", 0, "");
  13035. }
  13036. }
  13037. }
  13038.  
  13039. private void method146() {
  13040. anInt1265++;
  13041. method47(true);
  13042. method26(true);
  13043. method47(false);
  13044. method26(false);
  13045. method55();
  13046. method104();
  13047. if (!aBoolean1160) {
  13048. int i = anInt1184;
  13049. if (anInt984 / 256 > i) {
  13050. i = anInt984 / 256;
  13051. }
  13052. if (aBooleanArray876[4] && anIntArray1203[4] + 128 > i) {
  13053. i = anIntArray1203[4] + 128;
  13054. }
  13055. int calc = minimapInt1 + anInt896 & 0x7ff;
  13056. setCameraPos(cameraZoom + (frameWidth >= 1024 ? i + cameraZoom - frameHeight / 200 : i) * (WorldController.viewDistance == 10 ? 1 : 3), i, anInt1014, method42(plane, myPlayer.y, myPlayer.x) - 50, calc, anInt1015);
  13057. }
  13058. int j;
  13059. if (!aBoolean1160)
  13060. j = method120();
  13061. else
  13062. j = method121();
  13063. int l = xCameraPos;
  13064. int i1 = zCameraPos;
  13065. int j1 = yCameraPos;
  13066. int k1 = yCameraCurve;
  13067. int l1 = xCameraCurve;
  13068. int k2 = Rasterizer.anInt1481;
  13069. for (int i2 = 0; i2 < 5; i2++)
  13070. if (aBooleanArray876[i2]) {
  13071. 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]);
  13072. if (i2 == 0)
  13073. xCameraPos += j2;
  13074. if (i2 == 1)
  13075. zCameraPos += j2;
  13076. if (i2 == 2)
  13077. yCameraPos += j2;
  13078. if (i2 == 3)
  13079. xCameraCurve = xCameraCurve + j2 & 0x7ff;
  13080. if (i2 == 4) {
  13081. yCameraCurve += j2;
  13082. if (yCameraCurve < 128)
  13083. yCameraCurve = 128;
  13084. if (yCameraCurve > 383)
  13085. yCameraCurve = 383;
  13086. }
  13087. }
  13088. Model.aBoolean1684 = true;
  13089. Model.anInt1687 = 0;
  13090. Model.anInt1685 = super.mouseX - (frameMode == ScreenMode.FIXED ? 4 : 0);
  13091. Model.anInt1686 = super.mouseY - (frameMode == ScreenMode.FIXED ? 4 : 0);
  13092. DrawingArea.setAllPixelsToZero();
  13093. if (Configuration.enableDistanceFog) {
  13094. DrawingArea.drawPixels(frameMode == ScreenMode.FIXED ? 334 : frameHeight, 0, 0, ColorUtility.fadingToColor, frameMode == ScreenMode.FIXED ? 512 : frameWidth);
  13095. }
  13096. worldController.method313(xCameraPos, yCameraPos, xCameraCurve, zCameraPos, j, yCameraCurve);
  13097. worldController.clearObj5Cache();
  13098. if (Configuration.enableDistanceFog) {
  13099. if (!ColorUtility.switchColor) {
  13100. if (fogHandler.fogColor != ColorUtility.fadingToColor) {
  13101. ColorUtility.switchColor = true;
  13102. }
  13103. }
  13104. if (ColorUtility.switchColor) {
  13105. ColorUtility.fadeStep++;
  13106. if (ColorUtility.fadeStep >= 100) {
  13107. ColorUtility.fadeStep = 1;
  13108. ColorUtility.switchColor = false;
  13109. fogHandler.fogColor = ColorUtility.fadingToColor;
  13110. } else {
  13111. fogHandler.fogColor = ColorUtility.fadeColors(new Color(fogHandler.fogColor), new Color(ColorUtility.fadingToColor), ColorUtility.fadeStep);
  13112. }
  13113. }
  13114. fogHandler.renderFog(aRSImageProducer_1165.canvasRaster, aRSImageProducer_1165.depthBuffer);
  13115. }
  13116. if (inMaze(baseX + (myPlayer.x - 6 >> 7), baseY + (myPlayer.y - 6 >> 7), plane) && filterGrayScale) {
  13117. DrawingArea.filterGrayscale(0, 0, frameMode == ScreenMode.FIXED ? 512 : frameWidth, frameMode == ScreenMode.FIXED ? 334 : frameHeight, 1);
  13118. }
  13119. updateEntities();
  13120. drawHeadIcon();
  13121. method37(k2);
  13122.  
  13123. if (Configuration.showKillFeed) {
  13124. displayKillFeed();
  13125. }
  13126. if (frameMode != ScreenMode.FIXED) {
  13127. drawChatArea();
  13128. drawMinimap();
  13129. drawTabArea();
  13130. }
  13131. draw3dScreen();
  13132. if (console.openConsole) {
  13133. console.drawConsole(frameMode == ScreenMode.FIXED ? super.myWidth : frameWidth, 334);
  13134. }
  13135. aRSImageProducer_1165.drawGraphics(frameMode == ScreenMode.FIXED ? 4 : 0, super.graphics, frameMode == ScreenMode.FIXED ? 4 : 0);
  13136. xCameraPos = l;
  13137. zCameraPos = i1;
  13138. yCameraPos = j1;
  13139. yCameraCurve = k1;
  13140. xCameraCurve = l1;
  13141. }
  13142.  
  13143. private void processMinimapActions() {
  13144. final boolean fixed = frameMode == ScreenMode.FIXED;
  13145. if (fixed ? super.mouseX >= 542 && super.mouseX <= 579 && super.mouseY >= 2 && super.mouseY <= 38 : super.mouseX >= frameWidth - 180 && super.mouseX <= frameWidth - 139 && super.mouseY >= 0 && super.mouseY <= 40) {
  13146. menuActionName[1] = "Face North";
  13147. menuActionID[1] = 696;
  13148. menuActionRow = 2;
  13149. }
  13150. if (changeChatArea) {
  13151. if (super.mouseX >= 256 && super.mouseX <= 264 && super.mouseY >= frameHeight - 170 - extendChatArea && super.mouseY <= frameHeight - 160 - extendChatArea) {
  13152. menuActionName[1] = "Drag to Extend Chat";
  13153. menuActionID[1] = 701;
  13154. menuActionRow = 2;
  13155. }
  13156. }
  13157. if (fixed ? super.mouseX >= 742 && super.mouseX <= 765 && super.mouseY >= 0 && super.mouseY <= 24 : super.mouseX >= frameWidth - 26 && super.mouseX <= frameWidth - 1 && super.mouseY >= 2 && super.mouseY <= 24) {
  13158. menuActionName[1] = "Logout";
  13159. menuActionID[1] = 1004;
  13160. menuActionRow = 2;
  13161. }
  13162. if (Configuration.enableStatusOrbs) {
  13163. if (counterHover) {
  13164. menuActionName[3] = counterOn ? "Toggle XP Display" : "Toggle XP Display";
  13165. menuActionID[3] = 474;
  13166. menuActionName[2] = "Reset XP Total";
  13167. menuActionID[2] = 475;
  13168. menuActionName[1] = "XP Settings";
  13169. menuActionID[1] = 476;
  13170. menuActionRow = 4;
  13171. }
  13172. if (worldHover) {
  13173. menuActionName[1] = "Teleports";
  13174. menuActionID[1] = 850;
  13175. menuActionRow = 2;
  13176. }
  13177. if (pouchHover & Configuration.enablePouch) {
  13178. menuActionName[3] = "Withdraw coins";
  13179. menuActionID[3] = 713;
  13180. menuActionName[2] = "Payment plans";
  13181. menuActionID[2] = 715;
  13182. menuActionName[1] = "Examine pouch";
  13183. menuActionID[1] = 714;
  13184. menuActionRow = 4;
  13185. }
  13186. if (prayHover) {
  13187. menuActionName[2] = prayClicked ? "Turn quick-prayers off" : "Turn quick-prayers on";
  13188. menuActionID[2] = 1500;
  13189. menuActionRow = 2;
  13190. menuActionName[1] = "Select quick-prayers";
  13191. menuActionID[1] = 1506;
  13192. menuActionRow = 3;
  13193. }
  13194. if (runHover) {
  13195. menuActionName[1] = variousSettings[173] == 0 ? "Turn run mode on" : "Turn run mode off";
  13196. menuActionID[1] = 1050;
  13197. menuActionRow = 2;
  13198. }
  13199. }
  13200. }
  13201.  
  13202. public int specialAttack;
  13203.  
  13204. public void drawSpecialOrb() {
  13205. if (specialHover) {
  13206. orbComponents2[2].drawSprite(frameMode == ScreenMode.FIXED ? 153 : frameWidth - 63, frameMode == ScreenMode.FIXED ? 131 : 150);
  13207. } else {
  13208. orbComponents2[0].drawSprite(frameMode == ScreenMode.FIXED ? 154 : frameWidth - 62, frameMode == ScreenMode.FIXED ? 132 : 151);
  13209. }
  13210. orbComponents[10].myHeight = (int) (specialAttack * 27 / 100.0);
  13211. orbComponents[10].drawSprite(frameMode == ScreenMode.FIXED ? 157 : frameWidth - 58, frameMode == ScreenMode.FIXED ? 135 : 155);
  13212. orbComponents[6].drawSprite(frameMode == ScreenMode.FIXED ? 157 : frameWidth - 58, frameMode == ScreenMode.FIXED ? 135 : 155);
  13213. orbComponents2[1].drawSprite(frameMode == ScreenMode.FIXED ? 162 : frameWidth - 53, frameMode == ScreenMode.FIXED ? 140 : 160);
  13214. smallText.method382(getOrbTextColor(specialAttack), frameMode == ScreenMode.FIXED ? 198 : frameWidth - 19, Integer.toString(specialAttack), frameMode == ScreenMode.FIXED ? 158 : 177, true);
  13215. }
  13216.  
  13217. public boolean isPoisoned, clickedQuickPrayers;
  13218.  
  13219. private void loadAllOrbs(int xOffset) {
  13220. int[] orbX = { 0, 0, 24 }, orbY = { 45, 85, 121 }, orbTextX = { 15, 16, 40 }, orbTextY = { 72, 111, 148 }, coloredOrbX = { 27, 27, 51 }, coloredOrbY = { 49, 88, 125 }, currentInterface = { 4016, 4012, 149 }, maximumInterface = { 4017, 4013, 149 }, orbIconX = { 33, 30, 58 }, orbIconY = { 56, 92, 130 };
  13221. if (!Configuration.enableStatusOrbs) {
  13222. return;
  13223. }
  13224.  
  13225. if (frameMode != ScreenMode.FIXED) {
  13226. xOffset += 5;
  13227. }
  13228.  
  13229. if (Configuration.enablePouch) {
  13230. DrawingArea.fillCircle((frameMode == ScreenMode.FIXED ? 179 : frameWidth - 49), (frameMode == ScreenMode.FIXED ? 142 : 168), 15, 0x6E6D6D);
  13231. cacheSprite[pouchHover ? 429 : 430].drawSprite((frameMode == ScreenMode.FIXED ? 162 : frameWidth - 65), (frameMode == ScreenMode.FIXED ? 127 : 153));
  13232. String amount = RSInterface.interfaceCache[8135].disabledMessage;
  13233. long getAmount = Long.parseLong(amount);
  13234. smallText.method382(getMoneyOrbColor(getAmount), (frameMode == ScreenMode.FIXED ? 205 : frameWidth - 22), formatCoins(getAmount) + "", (frameMode == ScreenMode.FIXED ? 153 : 178), true);
  13235. cacheSprite[428].drawSprite((frameMode == ScreenMode.FIXED ? 170 : frameWidth - 57), (frameMode == ScreenMode.FIXED ? 134 : 160));
  13236. }
  13237.  
  13238. int[] spriteID = { isPoisoned && hpHover ? 13 : 12, prayHover ? 13 : 12, runHover ? 13 : 12, sumActive && sumHover ? 13 : 12 }, coloredOrbSprite = { 0, clickedQuickPrayers ? 8 : 1, variousSettings[173] == 1 ? 9 : 8, sumActive ? 11 : 10 }, orbSprite = { 14, 2, (variousSettings[173] == 1 ? 4 : 3), 5 };
  13239. int currentHP = extractInterfaceValues(RSInterface.interfaceCache[4016], 0);
  13240. int currentEnergy = extractInterfaceValues(RSInterface.interfaceCache[19177], 0);
  13241. for (int i = 0; i < 3; i++) {
  13242. int currentLevel = extractInterfaceValues(RSInterface.interfaceCache[currentInterface[i]], 0), maxLevel = extractInterfaceValues(RSInterface.interfaceCache[maximumInterface[i]], 0), level = (int) ((currentLevel / (double) maxLevel) * 100D);
  13243. orbComponents[spriteID[i]].drawSprite(orbX[i] + xOffset, orbY[i]);
  13244. orbComponents[coloredOrbSprite[i]].drawSprite(coloredOrbX[i] + xOffset, coloredOrbY[i]);
  13245. double percent = (i == 2 ? currentEnergy / 100D : level / 100D);
  13246. int depleteFill = 26 - (int) (26 * percent);
  13247. orbComponents[6].myHeight = depleteFill;
  13248. try {
  13249. orbComponents[6].drawSprite(coloredOrbX[i] + xOffset, coloredOrbY[i]);
  13250. } catch (Exception e) {
  13251. }
  13252. if (level < 25) {
  13253. orbComponents[orbSprite[i]].drawSprite1(orbIconX[i] + xOffset, orbIconY[i], 125 + (int) (125 * Math.sin(loopCycle / 7.0)));
  13254. } else {
  13255. orbComponents[orbSprite[i]].drawSprite(orbIconX[i] + xOffset, orbIconY[i]);
  13256. }
  13257. smallText.method382(getOrbTextColor(i == 2 ? currentEnergy : level), orbTextX[i] + xOffset, "" + (i == 2 ? currentEnergy : i == 0 && Configuration.enable10xDamage ? currentHP * 10 : currentLevel), orbTextY[i], true);
  13258. }
  13259. if (frameMode == ScreenMode.FIXED) {
  13260. orbComponents2[worldHover ? 6 : 5].drawSprite(202, 20);
  13261. } else {
  13262. orbComponents2[worldHover ? 4 : 3].drawSprite(frameWidth - 135, 152);
  13263. }
  13264. }
  13265.  
  13266. public int digits = 0;
  13267.  
  13268. XPGain mainGain = null;
  13269. List<Sprite> gainSprites = new ArrayList<>();
  13270. private boolean walkableInterfaceMode = false;
  13271.  
  13272. private void drawCounterOnScreen() {
  13273. if (!Configuration.enableStatusOrbs) {
  13274. return;
  13275. }
  13276. int x = frameMode == ScreenMode.FIXED ? 500 : frameWidth - 260;
  13277. int y = walkableInterfaceMode ? 46 : 10;
  13278. digits = xpCounter == 0 ? 1 : 1 + (int) Math.floor(Math.log10(xpCounter));
  13279. int i = smallText.getTextWidth(Integer.toString(xpCounter)) - smallText.getTextWidth(Integer.toString(xpCounter)) / 2;
  13280. smallText.method382(0xffffff, x - 38 - i - digits - 12, "Total:", y + 50, true);
  13281. if (xpCounter >= 0) {
  13282. smallText.method382(0xffffff, x + 1 - i, "+" + NumberFormat.getIntegerInstance().format(xpCounter), y + 50, true);
  13283. }
  13284. int currentIndex = 0;
  13285. int offsetY = 0;
  13286. int stop = 40;
  13287. if (!gains.isEmpty()) {
  13288. Iterator<XPGain> gained = gains.iterator();
  13289. if ((gains.size() > 1)) {
  13290. if (mainGain == null) {
  13291. XPGain toGain = null;
  13292. while (gained.hasNext()) {
  13293. XPGain gain = gained.next();
  13294.  
  13295. if (toGain == null) {
  13296. toGain = new XPGain(gain.skill, 0);
  13297. }
  13298.  
  13299. Sprite sprite = cacheSprite[gain.getSkill() + 324];
  13300.  
  13301. if (!gainSprites.contains(sprite)) {
  13302. gainSprites.add(sprite);
  13303. }
  13304.  
  13305. toGain.xp += gain.getXP();
  13306. currentIndex++;
  13307. }
  13308.  
  13309. Collections.reverse(gainSprites);
  13310. mainGain = toGain;
  13311. }
  13312.  
  13313. if (mainGain == null) {
  13314. return;
  13315. }
  13316.  
  13317. if (mainGain.getY() < stop) {
  13318. if (mainGain.getY() <= 10) {
  13319. mainGain.increaseAlpha();
  13320. }
  13321. if (mainGain.getY() >= stop - 10) {
  13322. mainGain.decreaseAlpha();
  13323. }
  13324. mainGain.increaseY();
  13325. } else if (mainGain.getY() >= stop) {
  13326. mainGain = null;
  13327. gains.clear();
  13328. gainSprites.clear();
  13329. }
  13330.  
  13331. if (mainGain == null) {
  13332. return;
  13333. }
  13334.  
  13335. if (mainGain.getY() < stop) {
  13336. if (variousSettings[1030] == 0) {
  13337. for (int ii = 0; ii < gainSprites.size(); ii++) {
  13338. Sprite sprite = gainSprites.get(ii);
  13339. sprite.drawSprite1(x - ii * 25 - 75 - sprite.myWidth / 2, mainGain.getY() - 5 + offsetY + y + 65 - sprite.myHeight / 2, mainGain.getAlpha());
  13340. }
  13341. newSmallFont.drawBasicString("<trans=" + (mainGain.getAlpha()) + ">+" + String.format("%,d", mainGain.getXP()) + "xp", x - 55, mainGain.getY() + offsetY + y + 65, 0xFFFFFF, 0);
  13342. } else if (variousSettings[1030] == 1) {
  13343. for (int ii = 0; ii < gainSprites.size(); ii++) {
  13344. Sprite sprite = gainSprites.get(ii);
  13345. sprite.drawSprite1((-mainGain.getY() + frameWidth - 280) - ii * 25 - (sprite.myWidth / 2), 80 - (sprite.myHeight / 2) + currentIndex * 28, mainGain.getAlpha());
  13346. }
  13347. newSmallFont.drawBasicString("<trans=" + (mainGain.getAlpha()) + ">+" + String.format("%,d", mainGain.getXP()) + "xp", -mainGain.getY() + frameWidth - 260, 85 + (walkableInterfaceMode ? 36 : 0) + currentIndex * 28, 0xFFFFFF, 0);
  13348. } else if (variousSettings[1030] == 2) {
  13349. for (int ii = 0; ii < gainSprites.size(); ii++) {
  13350. Sprite sprite = gainSprites.get(ii);
  13351. sprite.drawSprite1(x - ii * 25 - 75 - sprite.myWidth / 2, mainGain.getY() - 5 + offsetY + y + 65 - sprite.myHeight / 2, mainGain.getAlpha());
  13352. }
  13353. newSmallFont.drawBasicString("<trans=" + (mainGain.getAlpha()) + ">+" + String.format("%,d", mainGain.getXP()) + "xp", -mainGain.getY() + frameWidth - 260, mainGain.getY() + offsetY + y + 65, 0xFFFFFF, 0);
  13354. }
  13355. }
  13356. } else {
  13357. while (gained.hasNext()) {
  13358. XPGain gain = gained.next();
  13359. if (gain.getY() < stop) {
  13360. if (gain.getY() <= 10) {
  13361. gain.increaseAlpha();
  13362. }
  13363. if (gain.getY() >= stop - 10) {
  13364. gain.decreaseAlpha();
  13365. }
  13366. gain.increaseY();
  13367. } else if (gain.getY() >= stop) {
  13368. gained.remove();
  13369. }
  13370. Sprite sprite = cacheSprite[gain.getSkill() + 324];
  13371. if (gain.getY() < stop) {
  13372. if (variousSettings[1030] == 0) {
  13373. sprite.drawSprite1(x - 75 - sprite.myWidth / 2, gain.getY() - 5 + offsetY + y + 65 - sprite.myHeight / 2, gain.getAlpha());
  13374. newSmallFont.drawBasicString("<trans=" + (gain.getAlpha()) + ">+" + String.format("%,d", gain.getXP()) + "xp", x - 55, gain.getY() + offsetY + y + 65, 0xFFFFFF, 0);
  13375. } else if (variousSettings[1030] == 1) {
  13376. sprite.drawSprite1((-gain.getY() + frameWidth - 280) - (sprite.myWidth / 2), 80 - (sprite.myHeight / 2) + currentIndex * 28, gain.getAlpha());
  13377. newSmallFont.drawBasicString("<trans=" + (gain.getAlpha()) + ">+" + String.format("%,d", gain.getXP()) + "xp", -gain.getY() + frameWidth - 260, 85 + (walkableInterfaceMode ? 36 : 0) + currentIndex * 28, 0xFFFFFF, 0);
  13378. } else if (variousSettings[1030] == 2) {
  13379. sprite.drawSprite1(x - 75 - sprite.myWidth / 2, gain.getY() - 5 + offsetY + y + 65 - sprite.myHeight / 2, gain.getAlpha());
  13380. newSmallFont.drawBasicString("<trans=" + (gain.getAlpha()) + ">+" + String.format("%,d", gain.getXP()) + "xp", -gain.getY() + frameWidth - 260, gain.getY() + offsetY + y + 65, 0xFFFFFF, 0);
  13381. }
  13382. }
  13383. currentIndex++;
  13384. }
  13385. }
  13386. }
  13387. }
  13388.  
  13389. public int xpCounter;
  13390.  
  13391. private boolean runHover, prayHover, hpHover, prayClicked, counterOn, sumHover, sumActive, counterHover, specialHover, worldHover, pouchHover;
  13392.  
  13393. public int getOrbTextColor(int statusInt) {
  13394. if (statusInt >= 75 && statusInt <= Integer.MAX_VALUE)
  13395. return 0x00FF00;
  13396. else if (statusInt >= 50 && statusInt <= 74)
  13397. return 0xFFFF00;
  13398. else if (statusInt >= 25 && statusInt <= 49)
  13399. return 0xFF981F;
  13400. else
  13401. return 0xFF0000;
  13402. }
  13403.  
  13404. public int getOrbFill(int statusInt) {
  13405. if (statusInt <= Integer.MAX_VALUE && statusInt >= 97)
  13406. return 0;
  13407. else if (statusInt <= 96 && statusInt >= 93)
  13408. return 1;
  13409. else if (statusInt <= 92 && statusInt >= 89)
  13410. return 2;
  13411. else if (statusInt <= 88 && statusInt >= 85)
  13412. return 3;
  13413. else if (statusInt <= 84 && statusInt >= 81)
  13414. return 4;
  13415. else if (statusInt <= 80 && statusInt >= 77)
  13416. return 5;
  13417. else if (statusInt <= 76 && statusInt >= 73)
  13418. return 6;
  13419. else if (statusInt <= 72 && statusInt >= 69)
  13420. return 7;
  13421. else if (statusInt <= 68 && statusInt >= 65)
  13422. return 8;
  13423. else if (statusInt <= 64 && statusInt >= 61)
  13424. return 9;
  13425. else if (statusInt <= 60 && statusInt >= 57)
  13426. return 10;
  13427. else if (statusInt <= 56 && statusInt >= 53)
  13428. return 11;
  13429. else if (statusInt <= 52 && statusInt >= 49)
  13430. return 12;
  13431. else if (statusInt <= 48 && statusInt >= 45)
  13432. return 13;
  13433. else if (statusInt <= 44 && statusInt >= 41)
  13434. return 14;
  13435. else if (statusInt <= 40 && statusInt >= 37)
  13436. return 15;
  13437. else if (statusInt <= 36 && statusInt >= 33)
  13438. return 16;
  13439. else if (statusInt <= 32 && statusInt >= 29)
  13440. return 17;
  13441. else if (statusInt <= 28 && statusInt >= 25)
  13442. return 18;
  13443. else if (statusInt <= 24 && statusInt >= 21)
  13444. return 19;
  13445. else if (statusInt <= 20 && statusInt >= 17)
  13446. return 20;
  13447. else if (statusInt <= 16 && statusInt >= 13)
  13448. return 21;
  13449. else if (statusInt <= 12 && statusInt >= 9)
  13450. return 22;
  13451. else if (statusInt <= 8 && statusInt >= 7)
  13452. return 23;
  13453. else if (statusInt <= 6 && statusInt >= 5)
  13454. return 24;
  13455. else if (statusInt <= 4 && statusInt >= 3)
  13456. return 25;
  13457. else if (statusInt <= 2 && statusInt >= 1)
  13458. return 26;
  13459. else if (statusInt <= 0)
  13460. return 27;
  13461. return 0;
  13462. }
  13463.  
  13464. public void clearTopInterfaces() {
  13465. stream.createFrame(130);
  13466. if (invOverlayInterfaceID != -1) {
  13467. invOverlayInterfaceID = -1;
  13468. aBoolean1149 = false;
  13469. tabAreaAltered = true;
  13470. }
  13471. if (backDialogID != -1) {
  13472. backDialogID = -1;
  13473. inputTaken = true;
  13474. aBoolean1149 = false;
  13475. }
  13476. openInterfaceID = -1;
  13477. fullscreenInterfaceID = -1;
  13478. }
  13479.  
  13480. public Client() {
  13481. ClientConstants.worldSelected = 1;
  13482. xpCounter = 0;
  13483. fullscreenInterfaceID = -1;
  13484. chatRights = new int[500];
  13485. chatTypeView = 0;
  13486. clanChatMode = 0;
  13487. cButtonHPos = -1;
  13488. cButtonCPos = 0;
  13489. chatRights = new int[500];
  13490. chatColors = new String[500];
  13491. chatTitles = new String[500];
  13492. clanTitles = new String[500];
  13493. server = ClientConstants.SERVER_IPS[ClientConstants.worldSelected - 1];
  13494. anIntArrayArray825 = new int[104][104];
  13495. friendsNodeIDs = new int[200];
  13496. groundArray = new NodeList[4][104][104];
  13497. aBoolean831 = false;
  13498. aStream_834 = new Stream(new byte[5000]);
  13499. npcArray = new Npc[16384];
  13500. npcIndices = new int[16384];
  13501. anIntArray840 = new int[1000];
  13502. aStream_847 = Stream.create();
  13503. aBoolean848 = true;
  13504. openInterfaceID = -1;
  13505. currentExp = new int[Skills.SKILLS_COUNT];
  13506. aBoolean872 = false;
  13507. anIntArray873 = new int[5];
  13508. aBooleanArray876 = new boolean[5];
  13509. drawFlames = false;
  13510. reportAbuseInput = "";
  13511. unknownInt10 = -1;
  13512. menuOpen = false;
  13513. inputString = "";
  13514. maxPlayers = 2048;
  13515. myPlayerIndex = 2047;
  13516. playerArray = new Player[maxPlayers];
  13517. playerIndices = new int[maxPlayers];
  13518. anIntArray894 = new int[maxPlayers];
  13519. aStreamArray895s = new Stream[maxPlayers];
  13520. anInt897 = 1;
  13521. anIntArrayArray901 = new int[104][104];
  13522. aByteArray912 = new byte[16384];
  13523. currentStats = new int[Skills.SKILLS_COUNT];
  13524. ignoreListAsLongs = new long[100];
  13525. loadingError = false;
  13526. anIntArray928 = new int[5];
  13527. anIntArrayArray929 = new int[104][104];
  13528. chatTypes = new int[500];
  13529. chatNames = new String[500];
  13530. chatMessages = new String[500];
  13531. sideIcons = new Sprite[17];
  13532. aBoolean954 = true;
  13533. friendsListAsLongs = new long[200];
  13534. currentSong = -1;
  13535. drawingFlames = false;
  13536. spriteDrawX = -1;
  13537. spriteDrawY = -1;
  13538. anIntArray968 = new int[33];
  13539. anIntArray969 = new int[256];
  13540. decompressors = new Decompressor[6];
  13541. variousSettings = new int[2000];
  13542. aBoolean972 = false;
  13543. anInt975 = 50;
  13544. anIntArray976 = new int[anInt975];
  13545. anIntArray977 = new int[anInt975];
  13546. anIntArray978 = new int[anInt975];
  13547. anIntArray979 = new int[anInt975];
  13548. anIntArray980 = new int[anInt975];
  13549. anIntArray981 = new int[anInt975];
  13550. anIntArray982 = new int[anInt975];
  13551. aStringArray983 = new String[anInt975];
  13552. anInt985 = -1;
  13553. hitMarks = new Sprite[20];
  13554. hitMark = new Sprite[20];
  13555. hitIcon = new Sprite[20];
  13556. anIntArray990 = new int[5];
  13557. aBoolean994 = false;
  13558. amountOrNameInput = "";
  13559. aClass19_1013 = new NodeList();
  13560. aBoolean1017 = false;
  13561. anInt1018 = -1;
  13562. anIntArray1030 = new int[5];
  13563. aBoolean1031 = false;
  13564. mapFunctions = new Sprite[100];
  13565. dialogID = -1;
  13566. maxStats = new int[Skills.SKILLS_COUNT];
  13567. anIntArray1045 = new int[2000];
  13568. aBoolean1047 = true;
  13569. anIntArray1052 = new int[152];
  13570. anIntArray1229 = new int[152];
  13571. anInt1054 = -1;
  13572. aClass19_1056 = new NodeList();
  13573. anIntArray1057 = new int[33];
  13574. aClass9_1059 = new RSInterface();
  13575. mapScenes = new Background[100];
  13576. barFillColor = 0x4d4233;
  13577. anIntArray1065 = new int[7];
  13578. anIntArray1072 = new int[1000];
  13579. anIntArray1073 = new int[1000];
  13580. aBoolean1080 = false;
  13581. friendsList = new String[200];
  13582. inStream = Stream.create();
  13583. expectedCRCs = new int[9];
  13584. menuActionCmd2 = new int[500];
  13585. menuActionCmd3 = new int[500];
  13586. menuActionID = new int[500];
  13587. menuActionCmd1 = new int[500];
  13588. headIcons = new Sprite[20];
  13589. skullIcons = new Sprite[20];
  13590. headIconsHint = new Sprite[20];
  13591. tabAreaAltered = false;
  13592. aString1121 = "";
  13593. atPlayerActions = new String[5];
  13594. atPlayerArray = new boolean[5];
  13595. anIntArrayArrayArray1129 = new int[4][13][13];
  13596. anInt1132 = 2;
  13597. aClass30_Sub2_Sub1_Sub1Array1140 = new Sprite[1000];
  13598. aBoolean1141 = false;
  13599. aBoolean1149 = false;
  13600. crosses = new Sprite[8];
  13601. musicEnabled = true;
  13602. loggedIn = false;
  13603. canMute = false;
  13604. aBoolean1159 = false;
  13605. aBoolean1160 = false;
  13606. anInt1171 = 1;
  13607. myUsername = "";
  13608. myPassword = "";
  13609. genericLoadingError = false;
  13610. reportAbuseInterfaceID = -1;
  13611. aClass19_1179 = new NodeList();
  13612. anInt1184 = 128;
  13613. invOverlayInterfaceID = -1;
  13614. stream = Stream.create();
  13615. menuActionName = new String[500];
  13616. anIntArray1203 = new int[5];
  13617. anIntArray1207 = new int[50];
  13618. anInt1210 = 2;
  13619. anInt1211 = 78;
  13620. promptInput = "";
  13621. modIcons = new Sprite[ClientConstants.ICON_AMOUNT];
  13622. tabID = 3;
  13623. inputTaken = false;
  13624. songChanging = true;
  13625. aClass11Array1230 = new Class11[4];
  13626. anIntArray1240 = new int[100];
  13627. anIntArray1241 = new int[50];
  13628. aBoolean1242 = false;
  13629. anIntArray1250 = new int[50];
  13630. rsAlreadyLoaded = false;
  13631. welcomeScreenRaised = false;
  13632. messagePromptRaised = false;
  13633. loginMessage1 = "Welcome to Lunar Isle";
  13634. loginMessage2 = "Enter in your account details and begin playing!";
  13635. backDialogID = -1;
  13636. anInt1279 = 2;
  13637. bigX = new int[4000];
  13638. bigY = new int[4000];
  13639. }
  13640.  
  13641. public int rights;
  13642. public String name;
  13643. public String message;
  13644. public String clanname;
  13645. private int[] chatRights;
  13646. public int chatTypeView;
  13647. public int clanChatMode;
  13648. public static Sprite[] cacheSprite;
  13649. private ImageProducer leftFrame;
  13650. private ImageProducer topFrame;
  13651. private int ignoreCount;
  13652. private long aLong824;
  13653. private int[][] anIntArrayArray825;
  13654. private int[] friendsNodeIDs;
  13655. private NodeList[][][] groundArray;
  13656. public int[] anIntArray828;
  13657. public int[] anIntArray829;
  13658. private volatile boolean aBoolean831;
  13659. private Socket aSocket832;
  13660. int loginScreenState;
  13661. private Stream aStream_834;
  13662. private Npc[] npcArray;
  13663. private int npcCount;
  13664. private int[] npcIndices;
  13665. private int anInt839;
  13666. private int[] anIntArray840;
  13667. private int anInt841;
  13668. private int anInt842;
  13669. private int anInt843;
  13670. private String aString844;
  13671. public String prayerBook;
  13672. private int privateChatMode;
  13673. private Stream aStream_847;
  13674. private boolean aBoolean848;
  13675. private static int anInt849;
  13676. public int[] anIntArray850;
  13677. private int[] anIntArray851;
  13678. private int[] anIntArray852;
  13679. private int[] anIntArray853;
  13680. private static int anInt854;
  13681. private int anInt855;
  13682. static int openInterfaceID;
  13683. private int xCameraPos;
  13684. private int zCameraPos;
  13685. private int yCameraPos;
  13686. private int yCameraCurve;
  13687. private int xCameraCurve;
  13688. static int myPrivilege;
  13689. private final int[] currentExp;
  13690. private Sprite mapFlag;
  13691. private Sprite mapMarker;
  13692. private boolean aBoolean872;
  13693. private final int[] anIntArray873;
  13694. private final boolean[] aBooleanArray876;
  13695. private int weight;
  13696. private MouseDetection mouseDetection;
  13697. private volatile boolean drawFlames;
  13698. private String reportAbuseInput;
  13699. private int unknownInt10;
  13700. private boolean menuOpen;
  13701. private int anInt886;
  13702. private String inputString;
  13703. private final int maxPlayers;
  13704. private final int myPlayerIndex;
  13705. private Player[] playerArray;
  13706. private int playerCount;
  13707. private int[] playerIndices;
  13708. private int anInt893;
  13709. private int[] anIntArray894;
  13710. private Stream[] aStreamArray895s;
  13711. private int anInt896;
  13712. public int anInt897;
  13713. private int friendsCount;
  13714. private int anInt900;
  13715. private int[][] anIntArrayArray901;
  13716. private byte[] aByteArray912;
  13717. private int anInt913;
  13718. private int crossX;
  13719. private int crossY;
  13720. private int crossIndex;
  13721. private int crossType;
  13722. private int plane;
  13723. private final int[] currentStats;
  13724. private static int anInt924;
  13725. private final long[] ignoreListAsLongs;
  13726. private boolean loadingError;
  13727. private final int[] anIntArray928;
  13728. private int[][] anIntArrayArray929;
  13729. private Sprite aClass30_Sub2_Sub1_Sub1_931;
  13730. private Sprite aClass30_Sub2_Sub1_Sub1_932;
  13731. private int anInt933;
  13732. private int anInt934;
  13733. private int anInt935;
  13734. private int anInt936;
  13735. private int anInt937;
  13736. private int anInt938;
  13737. private final int[] chatTypes;
  13738. private final String[] chatNames;
  13739. private final String[] chatMessages;
  13740. private int anInt945;
  13741. private WorldController worldController;
  13742. private Sprite[] sideIcons;
  13743. private int menuScreenArea;
  13744. private int menuOffsetX;
  13745. private int menuOffsetY;
  13746. private int menuWidth;
  13747. private int menuHeight;
  13748. private long aLong953;
  13749. private boolean aBoolean954;
  13750. private long[] friendsListAsLongs;
  13751. private String[] clanList = new String[100];
  13752. private int currentSong;
  13753. private static int nodeID = 10;
  13754. static int portOff;
  13755. static boolean clientData;
  13756. private static boolean isMembers = true;
  13757. private static boolean lowMem;
  13758. private volatile boolean drawingFlames;
  13759. private int spriteDrawX;
  13760. private int spriteDrawY;
  13761. private final int[] anIntArray965 = { 0xffff00, 0xff0000, 65280, 65535, 0xff00ff, 0xffffff };
  13762. public Background aBackground_966;
  13763. public Background aBackground_967;
  13764. private final int[] anIntArray968;
  13765. public final int[] anIntArray969;
  13766. final Decompressor[] decompressors;
  13767. public int variousSettings[];
  13768. private boolean aBoolean972;
  13769. private final int anInt975;
  13770. private final int[] anIntArray976;
  13771. private final int[] anIntArray977;
  13772. private final int[] anIntArray978;
  13773. private final int[] anIntArray979;
  13774. private final int[] anIntArray980;
  13775. private final int[] anIntArray981;
  13776. private final int[] anIntArray982;
  13777. private final String[] aStringArray983;
  13778. private int anInt984;
  13779. private int anInt985;
  13780. private static int anInt986;
  13781. private Sprite[] hitMarks;
  13782. private Sprite[] hitMark;
  13783. private Sprite[] hitIcon;
  13784. public int anInt988;
  13785. private int dragCycle;
  13786. private final int[] anIntArray990;
  13787. private final boolean aBoolean994;
  13788. private int anInt995;
  13789. private int anInt996;
  13790. private int anInt997;
  13791. private int anInt998;
  13792. private int anInt999;
  13793. private ISAACRandomGen encryption;
  13794. private Sprite multiOverlay;
  13795. static final int[][] anIntArrayArray1003 = { { 6798, 107, 10283, 16, 4797, 7744, 5799, 4634, 33697, 22433, 2983, 54193 }, { 8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153, 56621, 4783, 1341, 16578, 35003, 25239 }, { 25238, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153, 56621, 4783, 1341, 16578, 35003 }, { 4626, 11146, 6439, 12, 4758, 10270 }, { 4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574 } };
  13796. private String amountOrNameInput;
  13797. private static int anInt1005;
  13798. private int daysSinceLastLogin;
  13799. private int pktSize;
  13800. private int pktType;
  13801. private int anInt1009;
  13802. private int anInt1010;
  13803. private int anInt1011;
  13804. private NodeList aClass19_1013;
  13805. private int anInt1014;
  13806. private int anInt1015;
  13807. private int anInt1016;
  13808. private boolean aBoolean1017;
  13809. private int anInt1018;
  13810. private int anInt1021;
  13811. private int anInt1022;
  13812. public static int loadingStage;
  13813. private Sprite scrollBar1;
  13814. private Sprite scrollBar2;
  13815. private int anInt1026;
  13816. private final int[] anIntArray1030;
  13817. private boolean aBoolean1031;
  13818. private Sprite[] mapFunctions;
  13819. private int baseX;
  13820. private int baseY;
  13821. private int anInt1036;
  13822. private int anInt1037;
  13823. public int loginFailures;
  13824. private int anInt1039;
  13825. public int anInt1040;
  13826. public int anInt1041;
  13827. private int dialogID;
  13828. public Sprite[] skillIcons = new Sprite[22];
  13829. public Sprite[] newHitMarks = new Sprite[4];
  13830. public Sprite[] channelButtons = new Sprite[4];
  13831. public Sprite[] fixedGameComponents = new Sprite[4];
  13832. public Sprite[] gameComponents = new Sprite[5];
  13833. public Sprite[] orbComponents = new Sprite[15];
  13834. public Sprite[] orbComponents2 = new Sprite[7];
  13835. public Sprite[] orbComponents3 = new Sprite[10];
  13836. public Sprite[] redStones = new Sprite[6];
  13837. public Sprite[] hpBars = new Sprite[2];
  13838. private final int[] maxStats;
  13839. private final int[] anIntArray1045;
  13840. private int anInt1046;
  13841. private boolean aBoolean1047;
  13842. private int anInt1048;
  13843. private String aString1049;
  13844. private static int anInt1051;
  13845. private final int[] anIntArray1052;
  13846. private StreamLoader titleStreamLoader;
  13847. private int anInt1054;
  13848. private int anInt1055;
  13849. private NodeList aClass19_1056;
  13850. private final int[] anIntArray1057;
  13851. public final RSInterface aClass9_1059;
  13852. private Background[] mapScenes;
  13853. private int anInt1062;
  13854. private final int barFillColor;
  13855. private int friendsListAction;
  13856. private final int[] anIntArray1065;
  13857. private int mouseInvInterfaceIndex;
  13858. private int lastActiveInvInterface;
  13859. public OnDemandFetcher onDemandFetcher;
  13860. private int anInt1069;
  13861. private int anInt1070;
  13862. private int anInt1071;
  13863. private int[] anIntArray1072;
  13864. private int[] anIntArray1073;
  13865. private Sprite mapDotItem;
  13866. private Sprite mapDotNPC;
  13867. private Sprite mapDotPlayer;
  13868. private Sprite mapDotFriend;
  13869. private Sprite mapDotTeam;
  13870. private Sprite mapDotClan;
  13871. private int anInt1079;
  13872. private boolean aBoolean1080;
  13873. private String[] friendsList;
  13874. private Stream inStream;
  13875. private int focusedDragWidget;
  13876. private int dragFromSlot;
  13877. private int activeInterfaceType;
  13878. private int pressX;
  13879. private int pressY;
  13880. public static int anInt1089;
  13881. public static int spellID = 0;
  13882. public static int totalRead = 0;
  13883. private final int[] expectedCRCs;
  13884. private int[] menuActionCmd2;
  13885. private int[] menuActionCmd3;
  13886. private int[] menuActionID;
  13887. private int[] menuActionCmd1;
  13888. private Sprite[] headIcons;
  13889. private Sprite[] skullIcons;
  13890. private Sprite[] headIconsHint;
  13891. private static int anInt1097;
  13892. private int anInt1098;
  13893. private int anInt1099;
  13894. private int anInt1100;
  13895. private int anInt1101;
  13896. private int anInt1102;
  13897. private static boolean tabAreaAltered;
  13898. private int anInt1104;
  13899. private ImageProducer aRSImageProducer_1107;
  13900. public ImageProducer aRSImageProducer_1108;
  13901. static ImageProducer aRSImageProducer_1109;
  13902. private ImageProducer aRSImageProducer_1110;
  13903. private ImageProducer aRSImageProducer_1111;
  13904. public ImageProducer aRSImageProducer_1112;
  13905. public ImageProducer aRSImageProducer_1113;
  13906. public ImageProducer aRSImageProducer_1114;
  13907. public ImageProducer aRSImageProducer_1115;
  13908. private static int anInt1117;
  13909. private int membersInt;
  13910. private String aString1121;
  13911. private Sprite compass;
  13912. private ImageProducer aRSImageProducer_1125;
  13913. public static Player myPlayer;
  13914. private final String[] atPlayerActions;
  13915. private final boolean[] atPlayerArray;
  13916. private final int[][][] anIntArrayArrayArray1129;
  13917. public static final int[] tabInterfaceIDs = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 };
  13918. private int anInt1131;
  13919. public int anInt1132;
  13920. private int menuActionRow;
  13921. private static int anInt1134;
  13922. private int spellSelected;
  13923. private int anInt1137;
  13924. private int spellUsableOn;
  13925. private String spellTooltip;
  13926. private Sprite[] aClass30_Sub2_Sub1_Sub1Array1140;
  13927. private boolean aBoolean1141;
  13928. private static int anInt1142;
  13929. private int energy;
  13930. private boolean aBoolean1149;
  13931. private Sprite[] crosses;
  13932. private boolean musicEnabled;
  13933. private Background[] aBackgroundArray1152s;
  13934. private int unreadMessages;
  13935. private static int anInt1155;
  13936. private static boolean fpsOn;
  13937. public static boolean loggedIn;
  13938. private boolean canMute;
  13939. private boolean aBoolean1159;
  13940. private boolean aBoolean1160;
  13941. static int loopCycle;
  13942. public static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  13943. private static ImageProducer aRSImageProducer_1163;
  13944. private ImageProducer aRSImageProducer_1164;
  13945. private static ImageProducer aRSImageProducer_1165;
  13946. private static ImageProducer aRSImageProducer_1166;
  13947. private int daysSinceRecovChange;
  13948. private RSSocket socketStream;
  13949. private int anInt1169;
  13950. private int minimapInt3;
  13951. public int anInt1171;
  13952. static int getCombatLevel;
  13953. static String myUsername;
  13954. static String myPassword;
  13955. private static int anInt1175;
  13956. private boolean genericLoadingError;
  13957. private final int[] anIntArray1177 = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3 };
  13958. private int reportAbuseInterfaceID;
  13959. private NodeList aClass19_1179;
  13960. private static int[] anIntArray1180;
  13961. private static int[] anIntArray1181;
  13962. private static int[] anIntArray1182;
  13963. private byte[][] aByteArrayArray1183;
  13964. private int anInt1184;
  13965. private int minimapInt1;
  13966. private int anInt1186;
  13967. private int anInt1187;
  13968. private static int anInt1188;
  13969. private int invOverlayInterfaceID;
  13970. private int[] anIntArray1190;
  13971. private int[] anIntArray1191;
  13972. public static Stream stream;
  13973. private int anInt1193;
  13974. private int splitPrivateChat;
  13975. private Background mapBack;
  13976. private String[] menuActionName;
  13977. private Sprite aClass30_Sub2_Sub1_Sub1_1201;
  13978. private Sprite aClass30_Sub2_Sub1_Sub1_1202;
  13979. private final int[] anIntArray1203;
  13980. static final int[] anIntArray1204 = { 9104, 10275, 7595, 3610, 7975, 8526, 918, 38802, 24466, 10145, 58654, 5027, 1457, 16565, 34991, 25486 };
  13981. private static boolean flagged;
  13982. private final int[] anIntArray1207;
  13983. private int minimapInt2;
  13984. public int anInt1210;
  13985. static int anInt1211;
  13986. private String promptInput;
  13987. private int anInt1213;
  13988. private int[][][] intGroundArray;
  13989. private long aLong1215;
  13990. int loginScreenCursorPos;
  13991. private final Sprite[] modIcons;
  13992. private long aLong1220;
  13993. static int tabID;
  13994. private int anInt1222;
  13995. public static boolean inputTaken;
  13996. private int inputDialogState;
  13997. private static int anInt1226;
  13998. private int nextSong;
  13999. private boolean songChanging;
  14000. private final int[] anIntArray1229;
  14001. private Class11[] aClass11Array1230;
  14002. public static int anIntArray1232[];
  14003. private int[] anIntArray1234;
  14004. private int[] anIntArray1235;
  14005. private int[] anIntArray1236;
  14006. private int anInt1237;
  14007. private int anInt1238;
  14008. public final int anInt1239 = 100;
  14009. private final int[] anIntArray1240;
  14010. private final int[] anIntArray1241;
  14011. private boolean aBoolean1242;
  14012. private int atInventoryLoopCycle;
  14013. private int atInventoryInterface;
  14014. private int atInventoryIndex;
  14015. private int atInventoryInterfaceType;
  14016. private byte[][] aByteArrayArray1247;
  14017. private int tradeMode;
  14018. private int anInt1249;
  14019. private final int[] anIntArray1250;
  14020. private int anInt1251;
  14021. private final boolean rsAlreadyLoaded;
  14022. private int anInt1253;
  14023. public int anInt1254;
  14024. private boolean welcomeScreenRaised;
  14025. private boolean messagePromptRaised;
  14026. private byte[][][] byteGroundArray;
  14027. private int prevSong;
  14028. private int destX;
  14029. private int destY;
  14030. public static Sprite minimapImage;
  14031. private int anInt1264;
  14032. private int anInt1265;
  14033. String loginMessage1;
  14034. String loginMessage2;
  14035. private int anInt1268;
  14036. private int anInt1269;
  14037. public int drawCount;
  14038. public int fullscreenInterfaceID;
  14039. public int anInt1044;
  14040. public int anInt1129;
  14041. public int anInt1315;
  14042. public int anInt1500;
  14043. public int anInt1501;
  14044. public static int[] fullScreenTextureArray;
  14045. public static TextDrawingArea smallText;
  14046. public static TextDrawingArea regularText;
  14047. public static TextDrawingArea boldText;
  14048. public RSFont newSmallFont;
  14049. public static RSFont newRegularFont;
  14050. public static RSFont newBoldFont;
  14051. public static RSFont newFancyFont;
  14052. public int anInt1275;
  14053. public static int backDialogID;
  14054. private int anInt1278;
  14055. public int anInt1279;
  14056. private int[] bigX;
  14057. private int[] bigY;
  14058. private int itemSelected;
  14059. private int anInt1283;
  14060. private int anInt1284;
  14061. private int anInt1285;
  14062. private String selectedItemName;
  14063. private int publicChatMode;
  14064. private static int anInt1288;
  14065. public static int anInt1290;
  14066. //public static String server = "144.172.90.10";
  14067. public static String server = "127.0.0.1";
  14068. public static boolean rememberMe = false;
  14069. private int modifiableXValue = 0;
  14070.  
  14071. public void resetAllImageProducers() {
  14072. if (super.fullGameScreen != null) {
  14073. return;
  14074. }
  14075. aRSImageProducer_1166 = null;
  14076. aRSImageProducer_1164 = null;
  14077. aRSImageProducer_1163 = null;
  14078. aRSImageProducer_1165 = null;
  14079. aRSImageProducer_1125 = null;
  14080. aRSImageProducer_1107 = null;
  14081. aRSImageProducer_1108 = null;
  14082. aRSImageProducer_1109 = null;
  14083. aRSImageProducer_1110 = null;
  14084. aRSImageProducer_1111 = null;
  14085. aRSImageProducer_1112 = null;
  14086. aRSImageProducer_1113 = null;
  14087. aRSImageProducer_1114 = null;
  14088. aRSImageProducer_1115 = null;
  14089. super.fullGameScreen = new ImageProducer(765, 503);
  14090. welcomeScreenRaised = true;
  14091. }
  14092.  
  14093. public void mouseWheelDragged(int i, int j) {
  14094. if (!mouseWheelDown) {
  14095. return;
  14096. }
  14097. screenGliding = 0;
  14098. this.anInt1186 += i * 3;
  14099. this.anInt1187 += (j << 1);
  14100. }
  14101.  
  14102. public void launchURL(String url) {
  14103. String osName = System.getProperty("os.name");
  14104. try {
  14105. if (osName.startsWith("Mac OS")) {
  14106. Class<?> fileMgr = Class.forName("com.apple.eio.FileManager");
  14107. Method openURL = fileMgr.getDeclaredMethod("openURL", new Class[] { String.class });
  14108. openURL.invoke(null, new Object[] { url });
  14109. } else if (osName.startsWith("Windows"))
  14110. Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
  14111. else { // assume Unix or Linux
  14112. String[] browsers = { "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape", "safari" };
  14113. String browser = null;
  14114. for (int count = 0; count < browsers.length && browser == null; count++)
  14115. if (Runtime.getRuntime().exec(new String[] { "which", browsers[count] }).waitFor() == 0)
  14116. browser = browsers[count];
  14117. if (browser == null) {
  14118. throw new Exception("Could not find web browser");
  14119. } else
  14120. Runtime.getRuntime().exec(new String[] { browser, url });
  14121. }
  14122. } catch (Exception e) {
  14123. pushMessage("Failed to open URL.", 0, "");
  14124. }
  14125. }
  14126.  
  14127. public String entityFeedName;
  14128. public int entityFeedHP;
  14129. public int entityFeedMaxHP;
  14130. public int entityFeedHP2;
  14131. public int entityAlpha;
  14132.  
  14133. public void pushFeed(String entityName, int HP, int maxHP) {
  14134. entityFeedHP2 = entityFeedHP <= 0 ? entityFeedMaxHP : entityFeedHP;
  14135. entityFeedName = entityName;
  14136. entityFeedHP = HP;
  14137. entityFeedMaxHP = maxHP;
  14138. entityAlpha = 255;
  14139. }
  14140.  
  14141. @SuppressWarnings("unused")
  14142. private void displayEntityFeed() {
  14143. if (entityFeedName == null) {
  14144. return;
  14145. }
  14146. double percentage = entityFeedHP / (double) entityFeedMaxHP;
  14147. double percentage2 = (entityFeedHP2 - entityFeedHP) / (double) entityFeedMaxHP;
  14148. int width = (int) (135 * percentage);
  14149. int xOff = 3;
  14150. int yOff = 25;
  14151. DrawingArea.drawAlphaPixels(xOff, yOff, 145, 41, 0x000000, 115);
  14152. newBoldFont.drawCenteredString(entityFeedName, xOff + 72, yOff + 13, 0xFDFDFD, 0);
  14153. DrawingArea.drawAlphaPixels(xOff + 6 + width, yOff + 18, 135 - width, 15, 0xFF0000, 130);
  14154. DrawingArea.drawAlphaPixels(xOff + 6, yOff + 18, width, 15, 0x00DB00, 130);
  14155. if (entityAlpha > 0) {
  14156. entityAlpha -= 5;
  14157. DrawingArea.drawAlphaPixels(xOff + 6 + width, yOff + 18, (int) (135 * percentage2), 15, 0x00DB00, (int) (130 * entityAlpha / 255.0));
  14158. }
  14159. DrawingArea.drawAlphaPixels(xOff + 6, yOff + 18, width, 15, 0x00DB00, 130);
  14160. newBoldFont.drawCenteredString(NumberFormat.getInstance(Locale.US).format(entityFeedHP) + " / " + NumberFormat.getInstance(Locale.US).format(entityFeedMaxHP), xOff + 72, yOff + 31, 0xFDFDFD, 0);
  14161. }
  14162.  
  14163. public String[] feedKiller = new String[5];
  14164. public String[] feedVictim = new String[5];
  14165. public int[] feedWeapon = new int[5];
  14166. public boolean[] feedPoison = new boolean[5];
  14167. public Sprite[] feedImage = new Sprite[5];
  14168. public int[] feedAlpha = new int[5];
  14169. public int[] feedYPos = new int[5];
  14170. public int killsDisplayed = 5;
  14171.  
  14172. public void pushKill(String killer, String victim, int weapon, boolean poison) {
  14173. for (int index = killsDisplayed - 1; index > 0; index--) {
  14174. feedKiller[index] = feedKiller[index - 1];
  14175. feedVictim[index] = feedVictim[index - 1];
  14176. feedWeapon[index] = feedWeapon[index - 1];
  14177. feedPoison[index] = feedPoison[index - 1];
  14178. feedAlpha[index] = feedAlpha[index - 1];
  14179. feedYPos[index] = feedYPos[index - 1];
  14180. }
  14181. feedKiller[0] = killer;
  14182. feedVictim[0] = victim;
  14183. feedWeapon[0] = weapon;
  14184. feedPoison[0] = poison;
  14185. feedAlpha[0] = 0;
  14186. feedYPos[0] = 0;
  14187. }
  14188.  
  14189. public void displayKillFeed() {
  14190. int x = 5;
  14191. for (int index = 0; index < killsDisplayed; index++) {
  14192. if (feedKiller[index] != null && feedVictim[index] != null) {
  14193. if (feedKiller[index].length() > 0) {
  14194. if (feedWeapon[index] == -1) {
  14195. return;
  14196. }
  14197. if (feedKiller[index].equalsIgnoreCase(myUsername)) {
  14198. feedKiller[index] = "You";
  14199. }
  14200. if (feedVictim[index].equalsIgnoreCase(myUsername)) {
  14201. feedVictim[index] = "You";
  14202. }
  14203. if (feedYPos[index] < (index + 1) * 22) {
  14204. feedYPos[index] += 1;
  14205. if (index == 0) {
  14206. feedAlpha[index] += 256 / 22;
  14207. }
  14208. } else if (feedYPos[index] == (index + 1) * 22) {
  14209. if (feedAlpha[index] > 200) {
  14210. feedAlpha[index] -= 1;
  14211. } else if (feedAlpha[index] <= 200 && feedAlpha[index] > 0) {
  14212. feedAlpha[index] -= 5;
  14213. }
  14214. if (feedAlpha[index] < 0) {
  14215. feedAlpha[index] = 0;
  14216. }
  14217. if (feedAlpha[index] == 0) {
  14218. clearKill(index);
  14219. }
  14220. }
  14221. if (feedAlpha[index] != 0) {
  14222. String killerText = "[" + feedKiller[index] + "] ";
  14223. String victimText = " [" + feedVictim[index] + "]";
  14224. String posionText = " <col=00ff00>[poisoned]</col>";
  14225. DrawingArea.drawAlphaGradient(x, feedYPos[index], newSmallFont.getTextWidth(killerText + victimText + (feedPoison[index] ? posionText : "")) + 22, 19, 0, 0, feedAlpha[index]);
  14226. newSmallFont.drawBasicString("<trans=" + feedAlpha[index] + ">" + killerText, x + 3, feedYPos[index] + 14, 0xffffff, 0);
  14227. newSmallFont.drawBasicString("<trans=" + feedAlpha[index] + ">" + victimText + (feedPoison[index] ? posionText : ""), x + 3 + newSmallFont.getTextWidth(killerText) + 16, feedYPos[index] + 14, 0xffffff, 0);
  14228. if (feedWeapon[index] != -1 && feedWeapon[index] != 65535) {
  14229. feedImage[index] = ItemDef.getSprite(feedWeapon[index], 0, 0x000000, 2);
  14230. }
  14231. if (feedImage[index] != null) {
  14232. feedImage[index].drawTransparentSprite(newSmallFont.getTextWidth(killerText) + 0, feedYPos[index] - 6, feedAlpha[index]);
  14233. }
  14234. }
  14235. }
  14236. }
  14237. }
  14238. }
  14239.  
  14240. public void hitmarkDraw(int hitLength, int type, int icon, int damage, int move, int opacity) {
  14241. if (damage > 0) {
  14242. Sprite end1 = null, middle = null, end2 = null;
  14243. int x = 0;
  14244. switch (hitLength) {
  14245. case 1:
  14246. x = 8;
  14247. break;
  14248. case 2:
  14249. x = 4;
  14250. break;
  14251. case 3:
  14252. x = 1;
  14253. break;
  14254. }
  14255. switch (type) {
  14256. case 1:
  14257. end1 = hitMark[0];
  14258. middle = hitMark[1];
  14259. end2 = hitMark[2];
  14260. break;
  14261. case 3:
  14262. end1 = hitMark[3];
  14263. middle = hitMark[4];
  14264. end2 = hitMark[5];
  14265. break;
  14266. case 2:
  14267. end1 = hitMark[6];
  14268. middle = hitMark[7];
  14269. end2 = hitMark[8];
  14270. break;
  14271. }
  14272. if (icon <= 6)
  14273. hitIcon[icon].drawTransparentSprite(spriteDrawX - 34 + x, spriteDrawY - 14 + move, opacity);
  14274. end1.drawTransparentSprite(spriteDrawX - 12 + x, spriteDrawY - 12 + move, opacity);
  14275. x += 4;
  14276. for (int i = 0; i < hitLength * 2; i++) {
  14277. middle.drawTransparentSprite(spriteDrawX - 12 + x, spriteDrawY - 12 + move, opacity);
  14278. x += 4;
  14279. }
  14280. end2.drawTransparentSprite(spriteDrawX - 12 + x, spriteDrawY - 12 + move, opacity);
  14281. if (opacity > 100)
  14282. smallText.drawText(0xffffff, String.valueOf(damage), spriteDrawY + 3 + move, spriteDrawX + 4);
  14283. } else {
  14284. cacheSprite[474].drawTransparentSprite(spriteDrawX - 12, spriteDrawY - 14 + move, opacity);
  14285. }
  14286. }
  14287.  
  14288. public void clearKill(int index) {
  14289. feedKiller[index] = null;
  14290. feedVictim[index] = null;
  14291. feedWeapon[index] = -1;
  14292. feedPoison[index] = false;
  14293. feedAlpha[index] = -1;
  14294. feedYPos[index] = -1;
  14295. }
  14296.  
  14297. static {
  14298. anIntArray1232 = new int[32];
  14299. int i = 2;
  14300. for (int k = 0; k < 32; k++) {
  14301. anIntArray1232[k] = i - 1;
  14302. i += i;
  14303. }
  14304. }
  14305. }
Add Comment
Please, Sign In to add comment