Guest User

Untitled

a guest
Aug 24th, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 472.21 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.  
  100. public static void frameMode(ScreenMode screenMode) {
  101. if (frameMode != screenMode) {
  102. frameMode = screenMode;
  103. if (screenMode == ScreenMode.FIXED) {
  104. frameWidth = 765;
  105. frameHeight = 503;
  106. cameraZoom = 600;
  107. WorldController.viewDistance = 9;
  108. changeChatArea = false;
  109. changeTabArea = false;
  110. } else if (screenMode == ScreenMode.RESIZABLE) {
  111. frameWidth = 766;
  112. frameHeight = 555;
  113. WorldController.viewDistance = 10;
  114. } else if (screenMode == ScreenMode.FULLSCREEN) {
  115. frameWidth = (int) Toolkit.getDefaultToolkit().getScreenSize().getWidth();
  116. frameHeight = (int) Toolkit.getDefaultToolkit().getScreenSize().getHeight();
  117. WorldController.viewDistance = 10;
  118. }
  119. rebuildFrameSize(screenMode, frameWidth, frameHeight);
  120. setBounds();
  121. System.out.println("ScreenMode: " + screenMode.toString());
  122. }
  123. showChatComponents = screenMode == ScreenMode.FIXED ? true : showChatComponents;
  124. showTabComponents = screenMode == ScreenMode.FIXED ? true : showTabComponents;
  125. }
  126.  
  127. public static void rebuildFrameSize(ScreenMode screenMode, int screenWidth, int screenHeight) {
  128. try {
  129. screenAreaWidth = (screenMode == ScreenMode.FIXED) ? 512 : screenWidth;
  130. screenAreaHeight = (screenMode == ScreenMode.FIXED) ? 334 : screenHeight;
  131. frameWidth = screenWidth;
  132. frameHeight = screenHeight;
  133. instance.refreshFrameSize(screenMode == ScreenMode.FULLSCREEN, screenWidth, screenHeight, screenMode == ScreenMode.RESIZABLE, screenMode != ScreenMode.FIXED);
  134. setBounds();
  135. } catch (Exception e) {
  136. e.printStackTrace();
  137. }
  138. }
  139.  
  140. public void refreshFrameSize() {
  141. if (frameMode == ScreenMode.RESIZABLE) {
  142. if (frameWidth != (appletClient() ? getGameComponent().getWidth() : gameFrame.getFrameWidth())) {
  143. frameWidth = (appletClient() ? getGameComponent().getWidth() : gameFrame.getFrameWidth());
  144. screenAreaWidth = frameWidth;
  145. setBounds();
  146. }
  147. if (frameHeight != (appletClient() ? getGameComponent().getHeight() : gameFrame.getFrameHeight())) {
  148. frameHeight = (appletClient() ? getGameComponent().getHeight() : gameFrame.getFrameHeight());
  149. screenAreaHeight = frameHeight;
  150. setBounds();
  151. }
  152. }
  153. }
  154.  
  155. private static void setBounds() {
  156. Rasterizer.method365(frameWidth, frameHeight);
  157. fullScreenTextureArray = Rasterizer.anIntArray1472;
  158. Rasterizer.method365(frameMode == ScreenMode.FIXED ? (aRSImageProducer_1166 != null ? aRSImageProducer_1166.canvasWidth : 519) : frameWidth, frameMode == ScreenMode.FIXED ? (aRSImageProducer_1166 != null ? aRSImageProducer_1166.canvasHeight : 165) : frameHeight);
  159. anIntArray1180 = Rasterizer.anIntArray1472;
  160. Rasterizer.method365(frameMode == ScreenMode.FIXED ? (aRSImageProducer_1163 != null ? aRSImageProducer_1163.canvasWidth : 250) : frameWidth, frameMode == ScreenMode.FIXED ? (aRSImageProducer_1163 != null ? aRSImageProducer_1163.canvasHeight : 335) : frameHeight);
  161. anIntArray1181 = Rasterizer.anIntArray1472;
  162. Rasterizer.method365(screenAreaWidth, screenAreaHeight);
  163. anIntArray1182 = Rasterizer.anIntArray1472;
  164. int ai[] = new int[9];
  165. for (int i8 = 0; i8 < 9; i8++) {
  166. int k8 = 128 + i8 * 32 + 15;
  167. int l8 = 600 + k8 * 3;
  168. int i9 = Rasterizer.anIntArray1470[k8];
  169. ai[i8] = l8 * i9 >> 16;
  170. }
  171. if (frameMode == ScreenMode.RESIZABLE && (frameWidth >= 766) && (frameWidth <= 1025) && (frameHeight >= 504) && (frameHeight <= 850)) {
  172. WorldController.viewDistance = 9;
  173. cameraZoom = 375;
  174. } else if (frameMode == ScreenMode.FIXED) {
  175. WorldController.viewDistance = 9;
  176. cameraZoom = 600;
  177. } else if (frameMode == ScreenMode.RESIZABLE) {
  178. WorldController.viewDistance = 10;
  179. cameraZoom = 600;
  180. } else if (frameMode == ScreenMode.FULLSCREEN) {
  181. WorldController.viewDistance = 10;
  182. cameraZoom = 550;
  183. }
  184. if (extendChatArea > frameHeight - 170) {
  185. extendChatArea = frameHeight - 170;
  186. }
  187. WorldController.method310(500, 800, frameMode == ScreenMode.FIXED ? 512 : frameWidth, frameMode == ScreenMode.FIXED ? 334 : frameHeight, ai);
  188. if (loggedIn) {
  189. aRSImageProducer_1165 = new ImageProducer(frameMode == ScreenMode.FIXED ? 512 : frameWidth, frameMode == ScreenMode.FIXED ? 334 : frameHeight);
  190. }
  191. }
  192.  
  193. public boolean getMousePositions() {
  194. if (mouseInRegion(frameWidth - (frameWidth <= 1000 ? 240 : 452), frameHeight - (frameWidth <= 1000 ? 90 : 37), frameWidth, frameHeight)) {
  195. return false;
  196. }
  197. if (showChatComponents) {
  198. if (changeChatArea) {
  199. if (super.mouseX > 0 && super.mouseX < 494 && super.mouseY > frameHeight - 175 - extendChatArea && super.mouseY < frameHeight) {
  200. return true;
  201. } else {
  202. if (super.mouseX > 494 && super.mouseX < 515 && super.mouseY > frameHeight - 175 - extendChatArea && super.mouseY < frameHeight) {
  203. return false;
  204. }
  205. }
  206. } else if (!changeChatArea) {
  207. if (super.mouseX > 0 && super.mouseX < 519 && super.mouseY > frameHeight - 175 && super.mouseY < frameHeight) {
  208. return false;
  209. }
  210. }
  211. }
  212. if (super.mouseX > frameWidth - 216 && super.mouseX < frameWidth && super.mouseY > 0 && super.mouseY < 172) {
  213. return false;
  214. }
  215. if (!changeTabArea) {
  216. if (super.mouseX > 0 && super.mouseY > 0 && super.mouseY < frameWidth && super.mouseY < frameHeight) {
  217. if (super.mouseX >= frameWidth - 242 && super.mouseY >= frameHeight - 335) {
  218. return false;
  219. }
  220. return true;
  221. }
  222. return false;
  223. }
  224. if (showTabComponents) {
  225. if (frameWidth > 1000) {
  226. 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) {
  227. return false;
  228. }
  229. } else {
  230. 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) {
  231. return false;
  232. }
  233. }
  234. }
  235. return true;
  236. }
  237.  
  238. public boolean mouseInRegion(int x1, int y1, int x2, int y2) {
  239. if (super.mouseX >= x1 && super.mouseX <= x2 && super.mouseY >= y1 && super.mouseY <= y2) {
  240. return true;
  241. }
  242. return false;
  243. }
  244.  
  245. public boolean clickInRegion(int x1, int y1, int x2, int y2) {
  246. if (super.saveClickX >= x1 && super.saveClickX <= x2 && super.saveClickY >= y1 && super.saveClickY <= y2) {
  247. return true;
  248. }
  249. return false;
  250. }
  251.  
  252. public boolean mouseMapPosition() {
  253. if (super.mouseX >= frameWidth - 21 && super.mouseX <= frameWidth && super.mouseY >= 0 && super.mouseY <= 21) {
  254. return false;
  255. }
  256. return true;
  257. }
  258.  
  259. private void drawLoadingMessages(int used, String s, String s1) {
  260. int width = regularText.getTextWidth(used == 1 ? s : s1);
  261. int height = s1 == null ? 25 : 38;
  262. DrawingArea.drawPixels(height, 1, 1, 0, width + 6);
  263. DrawingArea.drawPixels(1, 1, 1, 0xffffff, width + 6);
  264. DrawingArea.drawPixels(height, 1, 1, 0xffffff, 1);
  265. DrawingArea.drawPixels(1, height, 1, 0xffffff, width + 6);
  266. DrawingArea.drawPixels(height, 1, width + 6, 0xffffff, 1);
  267. regularText.drawText(0xffffff, s, 18, width / 2 + 5);
  268. if (s1 != null) {
  269. regularText.drawText(0xffffff, s1, 31, width / 2 + 5);
  270. }
  271. }
  272.  
  273. private int[][] statsSkillGoal = new int[Skills.SKILLS_COUNT + 1][3];
  274. private int[] tabAmounts = new int[] { 350, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
  275.  
  276. private int[] bankInvTemp = new int[352];
  277. private int[] bankStackTemp = new int[352];
  278.  
  279. private boolean canGainXP = true;
  280. private LinkedList<XPGain> gains = new LinkedList<XPGain>();
  281.  
  282. public void addXP(int skillID, int xp) {
  283. if (xp != 0 && canGainXP) {
  284. gains.add(new XPGain(skillID, xp));
  285. }
  286. }
  287.  
  288. public class XPGain {
  289. private int skill;
  290. private int xp;
  291. private int y;
  292. private int alpha = 0;
  293.  
  294. public XPGain(int skill, int xp) {
  295. this.skill = skill;
  296. this.xp = xp;
  297. }
  298.  
  299. public void increaseY() {
  300. y++;
  301. }
  302.  
  303. public int getSkill() {
  304. return skill;
  305. }
  306.  
  307. public int getXP() {
  308. return xp;
  309. }
  310.  
  311. public int getY() {
  312. return y;
  313. }
  314.  
  315. public int getAlpha() {
  316. return alpha;
  317. }
  318.  
  319. public void increaseAlpha() {
  320. alpha += alpha < 256 ? 30 : 0;
  321. alpha = alpha > 256 ? 256 : alpha;
  322. }
  323.  
  324. public void decreaseAlpha() {
  325. alpha -= alpha > 0 ? 30 : 0;
  326. alpha = alpha > 256 ? 256 : alpha;
  327. }
  328. }
  329.  
  330. private static final long serialVersionUID = 5707517957054703648L;
  331.  
  332. /**
  333. * npcBits can be changed to what your server's bits are set to.
  334. */
  335. public static int npcBits = 16;
  336.  
  337. /**
  338. * Client Preferences
  339. *
  340. * hitMarks554 can be enabled or disabled between 554 and 317. hitBar554 can
  341. * be enabled or disabled between 554 and 317. sumOrb can be changed to
  342. * runEnergy can be set to true to enable run energy support.
  343. */
  344. public boolean runEnergy = false;
  345.  
  346. private static String intToKOrMilLongName(int i) {
  347. String s = String.valueOf(i);
  348. for (int k = s.length() - 3; k > 0; k -= 3)
  349. s = s.substring(0, k) + "," + s.substring(k);
  350. if (s.length() > 8)
  351. s = "@gre@" + s.substring(0, s.length() - 8) + " million @whi@(" + s + ")";
  352. else if (s.length() > 4)
  353. s = "@cya@" + s.substring(0, s.length() - 4) + "K @whi@(" + s + ")";
  354. return " " + s;
  355. }
  356.  
  357. public final String methodR(int j) {
  358. if (j >= 0 && j < 10000)
  359. return String.valueOf(j);
  360. if (j >= 10000 && j < 10000000)
  361. return j / 1000 + "K";
  362. if (j >= 10000000 && j < 999999999)
  363. return j / 1000000 + "M";
  364. if (j >= 999999999)
  365. return "*";
  366. else
  367. return "?";
  368. }
  369.  
  370. public void sendString(String str, int i) {
  371. RSInterface.interfaceCache[i].disabledMessage = str;
  372. // needDrawTabArea = true;
  373. inputTaken = true;
  374. }
  375.  
  376. public void sendStringAsLong(String string) {
  377. stream.createFrame(60);
  378. stream.writeQWord(TextClass.longForName(string));
  379. }
  380.  
  381. public void sendString(int identifier, String text) {
  382. text = identifier + "," + text;
  383. stream.createFrame(127);
  384. stream.writeWordBigEndian(text.length() + 1);
  385. stream.writeString(text);
  386. }
  387.  
  388. private void stopMidi() {
  389. Signlink.midifade = 0;
  390. Signlink.midi = "stop";
  391. }
  392.  
  393. private boolean menuHasAddFriend(int j) {
  394. if (j < 0)
  395. return false;
  396. int k = menuActionID[j];
  397. if (k >= 2000)
  398. k -= 2000;
  399. return k == 337;
  400. }
  401.  
  402. 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 };
  403.  
  404. private final String[] modeNames = { "All", "Game", "Public", "Private", "Clan", "Trade", "Report Abuse" };
  405.  
  406. public void drawChannelButtons() {
  407. final int yOffset = frameMode == ScreenMode.FIXED ? 0 : frameHeight - 165;
  408. fixedGameComponents[3].drawSprite(0, 143 + yOffset);
  409. String text[] = { "On", "Friends", "Off", "Hide" };
  410. int textColor[] = { 65280, 0xffff00, 0xff0000, 65535 };
  411. switch (cButtonCPos) {
  412. case 0:
  413. case 1:
  414. case 2:
  415. case 3:
  416. case 4:
  417. case 5:
  418. case 6:
  419. channelButtons[1].drawSprite(channelButtonsX[cButtonCPos], 143 + yOffset);
  420. break;
  421. }
  422. if (cButtonHPos == cButtonCPos) {
  423. switch (cButtonHPos) {
  424. case 0:
  425. case 1:
  426. case 2:
  427. case 3:
  428. case 4:
  429. case 5:
  430. case 6:
  431. case 7:
  432. channelButtons[2].drawSprite(channelButtonsX[cButtonHPos], 143 + yOffset);
  433. break;
  434. }
  435. } else {
  436. switch (cButtonHPos) {
  437. case 0:
  438. case 1:
  439. case 2:
  440. case 3:
  441. case 4:
  442. case 5:
  443. channelButtons[0].drawSprite(channelButtonsX[cButtonHPos], 143 + yOffset);
  444. break;
  445. case 6:
  446. channelButtons[3].drawSprite(channelButtonsX[cButtonHPos], 143 + yOffset);
  447. break;
  448. }
  449. }
  450. int[] modes = { publicChatMode, privateChatMode, clanChatMode, tradeMode };
  451. for (int i = 0; i < modeNamesX.length; i++) {
  452. smallText.method389(true, modeNamesX[i], 0xffffff, modeNames[i], modeNamesY[i] + yOffset);
  453. }
  454. for (int i = 0; i < modeX.length; i++) {
  455. smallText.method382(textColor[modes[i]], modeX[i], text[modes[i]], 164 + yOffset, true);
  456. }
  457. }
  458.  
  459. public boolean isExtendingChatArea;
  460. public static int extendChatArea = 0;
  461.  
  462. public void extendChatArea() {
  463. if (frameMode == ScreenMode.FIXED) {
  464. extendChatArea = 0;
  465. return;
  466. }
  467. int offsetY = frameHeight - 160;
  468. int x = 256;
  469. int y = offsetY - 10 - extendChatArea;
  470. if (super.clickMode2 == 1 && super.mouseX >= x && super.mouseX <= x + 8 && super.mouseY >= y && super.mouseY <= y + 9) {
  471. isExtendingChatArea = true;
  472. }
  473. if (isExtendingChatArea) {
  474. int height = offsetY - super.mouseY;
  475. if (height < frameHeight - 170) {
  476. extendChatArea = height > 0 ? height : 0;
  477. }
  478. }
  479. }
  480.  
  481. private boolean chatStateCheck() {
  482. return messagePromptRaised || inputDialogState != 0 || aString844 != null || backDialogID != -1 || dialogID != -1;
  483. }
  484.  
  485. public static String getTime() {
  486. Calendar calendar = new GregorianCalendar();
  487. String meridiem;
  488. int hour = calendar.get(Calendar.HOUR);
  489. int minute = calendar.get(Calendar.MINUTE);
  490. if (calendar.get(Calendar.AM_PM) == 0) {
  491. meridiem = "AM";
  492. } else {
  493. meridiem = "PM";
  494. }
  495. return "["+ hour + ":" + minute + " " + meridiem +"]";
  496. }
  497.  
  498. private void drawChatArea() {
  499. int yOffset = frameMode == ScreenMode.FIXED ? 0 : frameHeight - 165;
  500. if (frameMode == ScreenMode.FIXED) {
  501. aRSImageProducer_1166.initDrawingArea();
  502. }
  503. Rasterizer.anIntArray1472 = anIntArray1180;
  504. if (chatStateCheck()) {
  505. showChatComponents = true;
  506. fixedGameComponents[2].drawSprite(0, yOffset);
  507. }
  508. if (showChatComponents) {
  509. if (changeChatArea && !chatStateCheck()) {
  510. orbComponents3[6].drawTransparentSprite(256, yOffset - extendChatArea - 3, 112);
  511. DrawingArea.drawAlphaGradient(7, 7 + yOffset - extendChatArea, 505, 130 + extendChatArea, 0, 0, 40);
  512. DrawingArea.drawAlphaHorizontalLine(7, 6 + yOffset - extendChatArea, 405, 0x6d6a57, 256);
  513. } else {
  514. fixedGameComponents[2].drawSprite(0, yOffset);
  515. }
  516. }
  517. if (!showChatComponents || changeChatArea) {
  518. DrawingArea.drawAlphaPixels(7, frameHeight - 23, 506, 24, 0, 100);
  519. }
  520. drawChannelButtons();
  521. TextDrawingArea textDrawingArea = regularText;
  522. if (messagePromptRaised) {
  523. extendChatArea = 0;
  524. newBoldFont.drawCenteredString(aString1121, 259, 60 + yOffset, 0, -1);
  525. newBoldFont.drawCenteredString(promptInput + "*", 259, 80 + yOffset, 128, -1);
  526. } else if (inputDialogState == 1) {
  527. extendChatArea = 0;
  528. newBoldFont.drawCenteredString("Enter amount:", 259, yOffset + 60, 0, -1);
  529. newBoldFont.drawCenteredString(amountOrNameInput + "*", 259, 80 + yOffset, 128, -1);
  530. } else if (inputDialogState == 2) {
  531. extendChatArea = 0;
  532. newBoldFont.drawCenteredString("Enter Name:", 259, 60 + yOffset, 0, -1);
  533. newBoldFont.drawCenteredString(amountOrNameInput + "*", 259, 80 + yOffset, 128, -1);
  534. } else if (aString844 != null) {
  535. extendChatArea = 0;
  536. newBoldFont.drawCenteredString(aString844, 259, 60 + yOffset, 0, -1);
  537. newBoldFont.drawCenteredString("Click to continue", 259, 80 + yOffset, 128, -1);
  538. } else if (backDialogID != -1) {
  539. extendChatArea = 0;
  540. drawInterface(0, 20, RSInterface.interfaceCache[backDialogID], 20 + yOffset);
  541. } else if (dialogID != -1) {
  542. extendChatArea = 0;
  543. drawInterface(0, 20, RSInterface.interfaceCache[dialogID], 20 + yOffset);
  544. } else if (showChatComponents) {
  545. int j77 = -3;
  546. int j = 0;
  547. int shadow = changeChatArea ? 0 : -1;
  548. DrawingArea.setDrawingArea(121 + yOffset, 7, 498, 7 + yOffset - extendChatArea);
  549. for (int k = 0; k < 500; k++) {
  550. if (chatMessages[k] != null) {
  551. String title;
  552. if (chatTitles[k] != null) {
  553. title = "<col=" + chatColors[k] + ">" + chatTitles[k] + "</col> ";
  554. } else {
  555. title = "";
  556. }
  557. int chatType = chatTypes[k];
  558. int yPos = (70 - j77 * 14) + anInt1089 + 5;
  559. String s1 = chatNames[k];
  560. String timeStamp = getTime();
  561. byte playerRights = 0;
  562. if (s1 != null && s1.startsWith("@cr")) {
  563. int test1 = Integer.parseInt("" + s1.charAt(3));
  564. if (s1.charAt(4) != '@') {
  565. test1 = Integer.parseInt(s1.charAt(3) + "" + s1.charAt(4));
  566. s1 = s1.substring(6);
  567. } else {
  568. s1 = s1.substring(5);
  569. }
  570. playerRights = (byte) test1;
  571. }
  572. if (chatType == 0) {
  573. if (chatTypeView == 5 || chatTypeView == 0) {
  574. newRegularFont.drawBasicString(chatMessages[k], 11, yPos + yOffset, changeChatArea ? 0xFFFFFF : 0, shadow);
  575. j++;
  576. j77++;
  577. }
  578. }
  579. if ((chatType == 1 || chatType == 2) && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
  580. if (chatTypeView == 1 || chatTypeView == 0) {
  581. int xPos = 11;
  582. if (Configuration.enableTimeStamps) {
  583. newRegularFont.drawBasicString(timeStamp, xPos, yPos + yOffset, changeChatArea ? 0xFFFFFF : 0, shadow);
  584. xPos += newRegularFont.getTextWidth(timeStamp);
  585. }
  586. if (playerRights >= 1) {
  587. modIcons[playerRights - 1].drawSprite(xPos, yPos - 12 + yOffset);
  588. xPos += 16;
  589. }
  590. newRegularFont.drawBasicString(title + s1 + ":", xPos - 3, yPos + yOffset, changeChatArea ? 0xFFFFFF : 0, shadow);
  591. xPos += newRegularFont.getTextWidth(title + s1) + 8;
  592. newRegularFont.drawBasicString(chatMessages[k], xPos - 8, yPos + yOffset, changeChatArea ? 0x7FA9FF : 255, shadow);
  593. j++;
  594. j77++;
  595. }
  596. }
  597. if ((chatType == 3 || chatType == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1))) {
  598. if (chatTypeView == 2 || chatTypeView == 0) {
  599. int k1 = 11;
  600. newRegularFont.drawBasicString("From", k1, yPos + yOffset, changeChatArea ? 0xFFFFFF : 0, shadow);
  601. k1 += textDrawingArea.getTextWidth("From ");
  602. if (playerRights >= 1) {
  603. modIcons[playerRights - 1].drawSprite(k1, yPos - 12 + yOffset);
  604. k1 += 12;
  605. }
  606. newRegularFont.drawBasicString(s1 + ":", k1, yPos + yOffset, changeChatArea ? 0xFFFFFF : 0, shadow);
  607. k1 += textDrawingArea.getTextWidth(s1) + 8;
  608. newRegularFont.drawBasicString(chatMessages[k], k1, yPos + yOffset, changeChatArea ? 0xFF5256 : 0x800000, shadow);
  609. j++;
  610. j77++;
  611. }
  612. }
  613. if (chatType == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  614. if (chatTypeView == 3 || chatTypeView == 0) {
  615. newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 11, yPos + yOffset, changeChatArea ? 0xFF5256 : 0x800080, shadow);
  616. j++;
  617. j77++;
  618. }
  619. }
  620. if (chatType == 5 && splitPrivateChat == 0 && privateChatMode < 2) {
  621. if (chatTypeView == 2 || chatTypeView == 0) {
  622. newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 8, yPos + yOffset, changeChatArea ? 0xFF5256 : 0x800000, shadow);
  623. j++;
  624. j77++;
  625. }
  626. }
  627. if (chatType == 6 && (splitPrivateChat == 0 || chatTypeView == 2) && privateChatMode < 2) {
  628. if (chatTypeView == 2 || chatTypeView == 0) {
  629. newRegularFont.drawBasicString("To " + s1 + ":", 11, yPos + yOffset, changeChatArea ? 0xFFFFFF : 0, shadow);
  630. newRegularFont.drawBasicString(chatMessages[k], 15 + textDrawingArea.getTextWidth("To :" + s1), yPos + yOffset, changeChatArea ? 0xFF5256 : 0x800000, shadow);
  631. j++;
  632. j77++;
  633. }
  634. }
  635. if (chatType == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  636. if (chatTypeView == 3 || chatTypeView == 0) {
  637. newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 11, yPos + yOffset, changeChatArea ? 0xFF5256 : 0x800000, shadow);
  638. j++;
  639. j77++;
  640. }
  641. }
  642. if (chatType == 11) {
  643. if (chatTypeView == 11) {
  644. newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 8, yPos + yOffset, changeChatArea ? 0xFF5256 : 0x800000, shadow);
  645. j++;
  646. j77++;
  647. }
  648. }
  649. }
  650. }
  651. DrawingArea.defaultDrawingAreaSize();
  652. anInt1211 = j * 14 + 7 + 5;
  653. if (anInt1211 < 111) {
  654. anInt1211 = 111;
  655. }
  656. drawScrollbar(114 + extendChatArea, anInt1211 - anInt1089 - 113, 7 + yOffset - extendChatArea, 496, anInt1211 + extendChatArea, changeChatArea);
  657. String title;
  658. if (myPlayer != null && myPlayer.title != null) {
  659. title = "<col=" + myPlayer.titleColor + ">" + myPlayer.title + " </col>";
  660. } else {
  661. title = "";
  662. }
  663. String playerName;
  664. if (myPlayer != null && myPlayer.name != null) {
  665. playerName = myPlayer.name;
  666. } else {
  667. playerName = TextClass.fixName(myUsername);
  668. }
  669. DrawingArea.setDrawingArea(140 + yOffset, 8, 509, 120 + yOffset);
  670. int xPos = 0;
  671. int yPos = 0;
  672. if (myPrivilege == 0) {
  673. cacheSprite[347].drawSprite(textDrawingArea.getTextWidth(myPlayer.title + (title.equals(null) ? "" : " ") + playerName + ": ") + 4, 124 + yOffset);
  674. newRegularFont.drawBasicString(title + "" + playerName + "", 8, 136 + yOffset - 2, changeChatArea ? 0xFFFFFF : 0, changeChatArea ? 0 : -1);
  675. textDrawingArea.method385(changeChatArea ? 0xFFFFFF : 0, ": ", 136 + yOffset - 2, 17 + textDrawingArea.getTextWidth(myPlayer.title + (title.equals(null) ? "" : " ") + 8 + playerName));
  676. newRegularFont.drawBasicString(inputString + "*", 22 + textDrawingArea.getTextWidth(myPlayer.title + (title.equals(null) ? "" : " ") + playerName + ": "), 136 + yOffset - 2, changeChatArea ? 0x7FA9FF : 255, changeChatArea ? 0 : -1);
  677. } else if (myPrivilege >= 1) {
  678. modIcons[myPrivilege - 1].drawSprite(10 + xPos, 122 + yPos + yOffset);
  679. cacheSprite[347].drawSprite(textDrawingArea.getTextWidth(myPlayer.title + (title.equals(null) ? "" : " ") + playerName + ": ") + 18, 124 + yOffset);
  680. xPos += 15;
  681. newRegularFont.drawBasicString(title + playerName + "", 23, 136 + yOffset - 2, changeChatArea ? 0xFFFFFF : 0, changeChatArea ? 0 : -1);
  682. textDrawingArea.method385(changeChatArea ? 0xFFFFFF : 0, ": ", 136 + yOffset - 2, 38 + textDrawingArea.getTextWidth(myPlayer.title + (title.equals(null) ? "" : " ") + playerName));
  683. newRegularFont.drawBasicString(inputString + "*", 23 + textDrawingArea.getTextWidth(myPlayer.title + (title.equals(null) ? "" : " ") + playerName + ": ") + 13, 136 + yOffset - 2, changeChatArea ? 0x7FA9FF : 255, changeChatArea ? 0 : -1);
  684. }
  685. DrawingArea.defaultDrawingAreaSize();
  686. for (int i = 0; i < 505; i++) {
  687. int opacity = 100 - (int) (i / 5.05);
  688. DrawingArea.method340(0, 1, 121 + yOffset, opacity + 5, 7 + i);
  689. }
  690. }
  691. if (menuOpen) {
  692. drawMenu(0, frameMode == ScreenMode.FIXED ? 338 : 0);
  693. }
  694. if (frameMode == ScreenMode.FIXED) {
  695. aRSImageProducer_1166.drawGraphics(338, super.graphics, 0);
  696. }
  697. aRSImageProducer_1165.initDrawingArea();
  698. Rasterizer.anIntArray1472 = anIntArray1182;
  699. }
  700.  
  701. public void init() {
  702. try {
  703. nodeID = 10;
  704. portOff = 0;
  705. setHighMem();
  706. isMembers = true;
  707. Signlink.storeid = 32;
  708. Signlink.startpriv(InetAddress.getLocalHost());
  709. initClientFrame(frameWidth, frameHeight);
  710. instance = this;
  711. SettingHandler.load();
  712. } catch (Exception exception) {
  713. return;
  714. }
  715. }
  716.  
  717. public void startRunnable(Runnable runnable, int i) {
  718. if (i > 10) {
  719. i = 10;
  720. }
  721. if (Signlink.mainapp != null) {
  722. Signlink.startthread(runnable, i);
  723. } else {
  724. super.startRunnable(runnable, i);
  725. }
  726. }
  727.  
  728. public Socket openSocket(int port) throws IOException {
  729. return new Socket(InetAddress.getByName(ClientConstants.LOCALHOST ? "localhost" : server), port);
  730. }
  731.  
  732. private void processMenuClick() {
  733. if (activeInterfaceType != 0)
  734. return;
  735. int j = super.clickMode3;
  736. if (spellSelected == 1 && super.saveClickX >= 516 && super.saveClickY >= 160 && super.saveClickX <= 765 && super.saveClickY <= 205)
  737. j = 0;
  738. if (menuOpen) {
  739. if (j != 1) {
  740. int k = super.mouseX;
  741. int j1 = super.mouseY;
  742. if (menuScreenArea == 0) {
  743. k -= 4;
  744. j1 -= 4;
  745. }
  746. if (menuScreenArea == 1) {
  747. k -= 519;
  748. j1 -= 168;
  749. }
  750. if (menuScreenArea == 2) {
  751. k -= 17;
  752. j1 -= 338;
  753. }
  754. if (menuScreenArea == 3) {
  755. k -= 519;
  756. j1 -= 0;
  757. }
  758. if (k < menuOffsetX - 10 || k > menuOffsetX + menuWidth + 10 || j1 < menuOffsetY - 10 || j1 > menuOffsetY + menuHeight + 10) {
  759. menuOpen = false;
  760. if (menuScreenArea == 1) {
  761. }
  762. if (menuScreenArea == 2)
  763. inputTaken = true;
  764. }
  765. }
  766. if (j == 1) {
  767. int l = menuOffsetX;
  768. int k1 = menuOffsetY;
  769. int i2 = menuWidth;
  770. int k2 = super.saveClickX;
  771. int l2 = super.saveClickY;
  772. switch (menuScreenArea) {
  773. case 0:
  774. k2 -= 4;
  775. l2 -= 4;
  776. break;
  777. case 1:
  778. k2 -= 519;
  779. l2 -= 168;
  780. break;
  781. case 2:
  782. k2 -= 5;
  783. l2 -= 338;
  784. break;
  785. case 3:
  786. k2 -= 519;
  787. l2 -= 0;
  788. break;
  789. }
  790. int i3 = -1;
  791. for (int j3 = 0; j3 < menuActionRow; j3++) {
  792. int k3 = k1 + 31 + (menuActionRow - 1 - j3) * 15;
  793. if (k2 > l && k2 < l + i2 && l2 > k3 - 13 && l2 < k3 + 3)
  794. i3 = j3;
  795. }
  796. if (i3 != -1)
  797. doAction(i3);
  798. menuOpen = false;
  799. if (menuScreenArea == 1) {
  800. }
  801. if (menuScreenArea == 2) {
  802. inputTaken = true;
  803. }
  804. }
  805.  
  806. if (RSInterface.currentInputField != null) {
  807. if (RSInterface.currentInputField.onlyNumbers) {
  808. long amount = 0;
  809.  
  810. try {
  811. amount = Long.parseLong(message.replaceAll(",", ""));
  812.  
  813. // overflow concious code
  814. if (amount < -Integer.MAX_VALUE) {
  815. amount = -Integer.MAX_VALUE;
  816. } else if (amount > Integer.MAX_VALUE) {
  817. amount = Integer.MAX_VALUE;
  818. }
  819. } catch (Exception ignored) {
  820. }
  821.  
  822. if (amount > 0) {
  823. stream.createFrame(208);
  824. stream.writeDWord((int) amount);
  825. }
  826. } else {
  827. stream.createFrame(150);
  828. stream.writeWordBigEndian(RSInterface.currentInputField.disabledMessage.length() + 3);
  829. stream.writeWord(RSInterface.currentInputField.id);
  830. stream.writeString(RSInterface.currentInputField.disabledMessage);
  831. }
  832.  
  833.  
  834. RSInterface.currentInputField.disabledMessage = "";
  835. }
  836. RSInterface.currentInputField = null;
  837. } else {
  838. if (j == 1 && menuActionRow > 0) {
  839. int i1 = menuActionID[menuActionRow - 1];
  840. 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) {
  841. int l1 = menuActionCmd2[menuActionRow - 1];
  842. int j2 = menuActionCmd3[menuActionRow - 1];
  843. RSInterface class9 = RSInterface.interfaceCache[j2];
  844. if (class9.aBoolean259 || class9.aBoolean235) {
  845. aBoolean1242 = false;
  846. dragCycle = 0;
  847. focusedDragWidget = j2;
  848. dragFromSlot = l1;
  849. activeInterfaceType = 2;
  850. pressX = super.saveClickX;
  851. pressY = super.saveClickY;
  852. if (RSInterface.interfaceCache[j2].parentID == openInterfaceID)
  853. activeInterfaceType = 1;
  854. if (RSInterface.interfaceCache[j2].parentID == backDialogID)
  855. activeInterfaceType = 3;
  856. return;
  857. }
  858. }
  859. }
  860. if (j == 1 && (anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  861. j = 2;
  862. if (j == 1 && menuActionRow > 0)
  863. doAction(menuActionRow - 1);
  864. if (j == 2 && menuActionRow > 0)
  865. determineMenuSize();
  866. processMainScreenClick();
  867. processTabClick();
  868. processChatModeClick();
  869. minimapHovers();
  870. }
  871. }
  872.  
  873. public static String getFileNameWithoutExtension(String fileName) {
  874. File tmpFile = new File(fileName);
  875. tmpFile.getName();
  876. int whereDot = tmpFile.getName().lastIndexOf('.');
  877. if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2) {
  878. return tmpFile.getName().substring(0, whereDot);
  879. }
  880. return "";
  881. }
  882.  
  883. private void saveMidi(boolean flag, byte abyte0[]) {
  884. Signlink.midifade = flag ? 1 : 0;
  885. Signlink.midisave(abyte0, abyte0.length);
  886. }
  887.  
  888. private void method22() {
  889. try {
  890. anInt985 = -1;
  891. aClass19_1056.removeAll();
  892. aClass19_1013.removeAll();
  893. Rasterizer.method366();
  894. unlinkMRUNodes();
  895. worldController.initToNull();
  896. System.gc();
  897. for (int i = 0; i < 4; i++)
  898. aClass11Array1230[i].method210();
  899. for (int l = 0; l < 4; l++) {
  900. for (int k1 = 0; k1 < 104; k1++) {
  901. for (int j2 = 0; j2 < 104; j2++)
  902. byteGroundArray[l][k1][j2] = 0;
  903. }
  904. }
  905.  
  906. ObjectManager objectManager = new ObjectManager(byteGroundArray, intGroundArray);
  907. int k2 = aByteArrayArray1183.length;
  908. stream.createFrame(0);
  909. if (!aBoolean1159) {
  910. for (int i3 = 0; i3 < k2; i3++) {
  911. int i4 = (anIntArray1234[i3] >> 8) * 64 - baseX;
  912. int k5 = (anIntArray1234[i3] & 0xff) * 64 - baseY;
  913. byte abyte0[] = aByteArrayArray1183[i3];
  914. if (abyte0 != null)
  915. objectManager.method180(abyte0, k5, i4, (anInt1069 - 6) * 8, (anInt1070 - 6) * 8, aClass11Array1230);
  916. }
  917. for (int j4 = 0; j4 < k2; j4++) {
  918. int l5 = (anIntArray1234[j4] >> 8) * 64 - baseX;
  919. int k7 = (anIntArray1234[j4] & 0xff) * 64 - baseY;
  920. byte abyte2[] = aByteArrayArray1183[j4];
  921. if (abyte2 == null && anInt1070 < 800)
  922. objectManager.method174(k7, 64, 64, l5);
  923. }
  924. anInt1097++;
  925. if (anInt1097 > 160) {
  926. anInt1097 = 0;
  927. stream.createFrame(238);
  928. stream.writeWordBigEndian(96);
  929. }
  930. stream.createFrame(0);
  931. for (int i6 = 0; i6 < k2; i6++) {
  932. byte abyte1[] = aByteArrayArray1247[i6];
  933. if (abyte1 != null) {
  934. int l8 = (anIntArray1234[i6] >> 8) * 64 - baseX;
  935. int k9 = (anIntArray1234[i6] & 0xff) * 64 - baseY;
  936. objectManager.method190(l8, aClass11Array1230, k9, worldController, abyte1);
  937. }
  938. }
  939.  
  940. }
  941. if (aBoolean1159) {
  942. for (int j3 = 0; j3 < 4; j3++) {
  943. for (int k4 = 0; k4 < 13; k4++) {
  944. for (int j6 = 0; j6 < 13; j6++) {
  945. int l7 = anIntArrayArrayArray1129[j3][k4][j6];
  946. if (l7 != -1) {
  947. int i9 = l7 >> 24 & 3;
  948. int l9 = l7 >> 1 & 3;
  949. int j10 = l7 >> 14 & 0x3ff;
  950. int l10 = l7 >> 3 & 0x7ff;
  951. int j11 = (j10 / 8 << 8) + l10 / 8;
  952. for (int l11 = 0; l11 < anIntArray1234.length; l11++) {
  953. if (anIntArray1234[l11] != j11 || aByteArrayArray1183[l11] == null)
  954. continue;
  955. objectManager.method179(i9, l9, aClass11Array1230, k4 * 8, (j10 & 7) * 8, aByteArrayArray1183[l11], (l10 & 7) * 8, j3, j6 * 8);
  956. break;
  957. }
  958.  
  959. }
  960. }
  961. }
  962. }
  963. for (int l4 = 0; l4 < 13; l4++) {
  964. for (int k6 = 0; k6 < 13; k6++) {
  965. int i8 = anIntArrayArrayArray1129[0][l4][k6];
  966. if (i8 == -1)
  967. objectManager.method174(k6 * 8, 8, 8, l4 * 8);
  968. }
  969. }
  970.  
  971. stream.createFrame(0);
  972. for (int l6 = 0; l6 < 4; l6++) {
  973. for (int j8 = 0; j8 < 13; j8++) {
  974. for (int j9 = 0; j9 < 13; j9++) {
  975. int i10 = anIntArrayArrayArray1129[l6][j8][j9];
  976. if (i10 != -1) {
  977. int k10 = i10 >> 24 & 3;
  978. int i11 = i10 >> 1 & 3;
  979. int k11 = i10 >> 14 & 0x3ff;
  980. int i12 = i10 >> 3 & 0x7ff;
  981. int j12 = (k11 / 8 << 8) + i12 / 8;
  982. for (int k12 = 0; k12 < anIntArray1234.length; k12++) {
  983. if (anIntArray1234[k12] != j12 || aByteArrayArray1247[k12] == null)
  984. continue;
  985. objectManager.method183(aClass11Array1230, worldController, k10, j8 * 8, (i12 & 7) * 8, l6, aByteArrayArray1247[k12], (k11 & 7) * 8, i11, j9 * 8);
  986. break;
  987. }
  988.  
  989. }
  990. }
  991.  
  992. }
  993.  
  994. }
  995.  
  996. }
  997. stream.createFrame(0);
  998. objectManager.method171(aClass11Array1230, worldController);
  999. ColorUtility.fadingToColor = getNextInteger(objectManager.colors).getKey();
  1000. aRSImageProducer_1165.initDrawingArea();
  1001. stream.createFrame(0);
  1002. int k3 = ObjectManager.anInt145;
  1003. if (k3 > plane)
  1004. k3 = plane;
  1005. if (k3 < plane - 1)
  1006. k3 = plane - 1;
  1007. if (lowMem)
  1008. worldController.method275(ObjectManager.anInt145);
  1009. else
  1010. worldController.method275(0);
  1011. for (int i5 = 0; i5 < 104; i5++) {
  1012. for (int i7 = 0; i7 < 104; i7++)
  1013. spawnGroundItem(i5, i7);
  1014.  
  1015. }
  1016.  
  1017. anInt1051++;
  1018. if (anInt1051 > 98) {
  1019. anInt1051 = 0;
  1020. }
  1021. method63();
  1022. } catch (Exception exception) {
  1023. }
  1024. ObjectDef.mruNodes1.unlinkAll();
  1025. if (super.gameFrame != null) {
  1026. stream.createFrame(210);
  1027. stream.writeDWord(0x3f008edd);
  1028. }
  1029. if (lowMem && Signlink.cache_dat != null) {
  1030. int j = onDemandFetcher.getVersionCount(0);
  1031. for (int i1 = 0; i1 < j; i1++) {
  1032. int l1 = onDemandFetcher.getModelIndex(i1);
  1033. if ((l1 & 0x79) == 0)
  1034. Model.method461(i1);
  1035. }
  1036.  
  1037. }
  1038. System.gc();
  1039. Rasterizer.method367();
  1040. onDemandFetcher.method566();
  1041. int k = (anInt1069 - 6) / 8 - 1;
  1042. int j1 = (anInt1069 + 6) / 8 + 1;
  1043. int i2 = (anInt1070 - 6) / 8 - 1;
  1044. int l2 = (anInt1070 + 6) / 8 + 1;
  1045. if (aBoolean1141) {
  1046. k = 49;
  1047. j1 = 50;
  1048. i2 = 49;
  1049. l2 = 50;
  1050. }
  1051. for (int l3 = k; l3 <= j1; l3++) {
  1052. for (int j5 = i2; j5 <= l2; j5++)
  1053. if (l3 == k || l3 == j1 || j5 == i2 || j5 == l2) {
  1054. int j7 = onDemandFetcher.method562(0, j5, l3);
  1055. if (j7 != -1)
  1056. onDemandFetcher.method560(j7, 3);
  1057. int k8 = onDemandFetcher.method562(1, j5, l3);
  1058. if (k8 != -1)
  1059. onDemandFetcher.method560(k8, 3);
  1060. }
  1061.  
  1062. }
  1063.  
  1064. }
  1065.  
  1066. public static AbstractMap.SimpleEntry<Integer, Integer> getNextInteger(ArrayList<Integer> values) {
  1067. ArrayList<AbstractMap.SimpleEntry<Integer, Integer>> frequencies = new ArrayList<>();
  1068. int maxIndex = 0;
  1069. main: for (int i = 0; i < values.size(); ++i) {
  1070. int value = values.get(i);
  1071. for (int j = 0; j < frequencies.size(); ++j) {
  1072. if (frequencies.get(j).getKey() == value) {
  1073. frequencies.get(j).setValue(frequencies.get(j).getValue() + 1);
  1074. if (frequencies.get(maxIndex).getValue() < frequencies.get(j).getValue()) {
  1075. maxIndex = j;
  1076. }
  1077. continue main;
  1078. }
  1079. }
  1080. frequencies.add(new AbstractMap.SimpleEntry<Integer, Integer>(value, 1));
  1081. }
  1082. return frequencies.get(maxIndex);
  1083. }
  1084.  
  1085. private void unlinkMRUNodes() {
  1086. ObjectDef.mruNodes1.unlinkAll();
  1087. ObjectDef.mruNodes2.unlinkAll();
  1088. EntityDef.mruNodes.unlinkAll();
  1089. ItemDef.mruNodes2.unlinkAll();
  1090. ItemDef.mruNodes1.unlinkAll();
  1091. Player.mruNodes.unlinkAll();
  1092. SpotAnim.aMRUNodes_415.unlinkAll();
  1093. }
  1094.  
  1095. private void method24(int i) {
  1096. int ai[] = minimapImage.myPixels;
  1097. int j = ai.length;
  1098. for (int k = 0; k < j; k++)
  1099. ai[k] = 0;
  1100.  
  1101. for (int l = 1; l < 103; l++) {
  1102. int i1 = 24628 + (103 - l) * 512 * 4;
  1103. for (int k1 = 1; k1 < 103; k1++) {
  1104. if ((byteGroundArray[i][k1][l] & 0x18) == 0)
  1105. worldController.method309(ai, i1, i, k1, l);
  1106. if (i < 3 && (byteGroundArray[i + 1][k1][l] & 8) != 0)
  1107. worldController.method309(ai, i1, i + 1, k1, l);
  1108. i1 += 4;
  1109. }
  1110.  
  1111. }
  1112.  
  1113. int j1 = 0xFFFFFF;
  1114. int l1 = 0xEE0000;
  1115. minimapImage.method343();
  1116. for (int i2 = 1; i2 < 103; i2++) {
  1117. for (int j2 = 1; j2 < 103; j2++) {
  1118. if ((byteGroundArray[i][j2][i2] & 0x18) == 0)
  1119. method50(i2, j1, j2, l1, i);
  1120. if (i < 3 && (byteGroundArray[i + 1][j2][i2] & 8) != 0)
  1121. method50(i2, j1, j2, l1, i + 1);
  1122. }
  1123.  
  1124. }
  1125.  
  1126. aRSImageProducer_1165.initDrawingArea();
  1127. anInt1071 = 0;
  1128. for (int k2 = 0; k2 < 104; k2++) {
  1129. for (int l2 = 0; l2 < 104; l2++) {
  1130. int i3 = worldController.method303(plane, k2, l2);
  1131. if (i3 != 0) {
  1132. i3 = i3 >> 14 & 0x7fff;
  1133. int j3 = ObjectDef.forID(i3).anInt746;
  1134. if (j3 >= 0) {
  1135. int k3 = k2;
  1136. int l3 = l2;
  1137. aClass30_Sub2_Sub1_Sub1Array1140[anInt1071] = mapFunctions[j3];
  1138. anIntArray1072[anInt1071] = k3;
  1139. anIntArray1073[anInt1071] = l3;
  1140. anInt1071++;
  1141. }
  1142. }
  1143. }
  1144.  
  1145. }
  1146.  
  1147. }
  1148.  
  1149. private void spawnGroundItem(int i, int j) {
  1150. NodeList class19 = groundArray[plane][i][j];
  1151. if (class19 == null) {
  1152. worldController.method295(plane, i, j);
  1153. return;
  1154. }
  1155. int k = 0xfa0a1f01;
  1156. Object obj = null;
  1157. for (Item item = (Item) class19.reverseGetFirst(); item != null; item = (Item) class19.reverseGetNext()) {
  1158. ItemDef itemDef = ItemDef.forID(item.ID);
  1159. int l = itemDef.value;
  1160. if (itemDef.stackable) {
  1161. l *= item.anInt1559 + 1;
  1162. }
  1163. if (l > k) {
  1164. k = l;
  1165. obj = item;
  1166. }
  1167. }
  1168. class19.insertTail(((Node) (obj)));
  1169. Object obj1 = null;
  1170. Object obj2 = null;
  1171. for (Item class30_sub2_sub4_sub2_1 = (Item) class19.reverseGetFirst(); class30_sub2_sub4_sub2_1 != null; class30_sub2_sub4_sub2_1 = (Item) class19.reverseGetNext()) {
  1172. if (class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && obj1 == null) {
  1173. obj1 = class30_sub2_sub4_sub2_1;
  1174. }
  1175. if (class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && class30_sub2_sub4_sub2_1.ID != ((Item) (obj1)).ID && obj2 == null) {
  1176. obj2 = class30_sub2_sub4_sub2_1;
  1177. }
  1178. }
  1179. int i1 = i + (j << 7) + 0x60000000;
  1180. worldController.method281(i, i1, ((Animable) (obj1)), method42(plane, j * 128 + 64, i * 128 + 64), ((Animable) (obj2)), ((Animable) (obj)), plane, j);
  1181. }
  1182.  
  1183. private void method26(boolean flag) {
  1184. for (int j = 0; j < npcCount; j++) {
  1185. Npc npc = npcArray[npcIndices[j]];
  1186. int k = 0x20000000 + (npcIndices[j] << 14);
  1187. if (npc == null || !npc.isVisible() || npc.desc.aBoolean93 != flag)
  1188. continue;
  1189. int l = npc.x >> 7;
  1190. int i1 = npc.y >> 7;
  1191. if (l < 0 || l >= 104 || i1 < 0 || i1 >= 104)
  1192. continue;
  1193. if (npc.anInt1540 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64) {
  1194. if (anIntArrayArray929[l][i1] == anInt1265)
  1195. continue;
  1196. anIntArrayArray929[l][i1] = anInt1265;
  1197. }
  1198. if (!npc.desc.aBoolean84)
  1199. k += 0x80000000;
  1200. worldController.method285(plane, npc.anInt1552, method42(plane, npc.y, npc.x), k, npc.y, (npc.anInt1540 - 1) * 64 + 60, npc.x, npc, npc.aBoolean1541);
  1201. }
  1202. }
  1203.  
  1204. public void drawTooltip(int xPos, int yPos, String text) {
  1205. String[] results = text.split("\n");
  1206. int height = (results.length * 16) + 6;
  1207. int width;
  1208. width = regularText.getTextWidth(results[0]) + 6;
  1209. for (int i = 1; i < results.length; i++) {
  1210. if (width <= regularText.getTextWidth(results[i]) + 6) {
  1211. width = regularText.getTextWidth(results[i]) + 6;
  1212. }
  1213. }
  1214. DrawingArea.drawPixels(height, yPos, xPos, 0xFFFFA0, width);
  1215. DrawingArea.fillPixels(xPos, width, height, 0, yPos);
  1216. yPos += 14;
  1217. for (int i = 0; i < results.length; i++) {
  1218. regularText.method389(false, xPos + 3, 0, results[i], yPos);
  1219. yPos += 16;
  1220. }
  1221. }
  1222.  
  1223. private void buildInterfaceMenu(int y, RSInterface rsinterface, int mouseX, int x, int mouseY, int scrollPosition) {
  1224. if (rsinterface == null)
  1225. rsinterface = RSInterface.interfaceCache[21356];
  1226. if (rsinterface.type != 0 || rsinterface.children == null || rsinterface.isMouseoverTriggered)
  1227. return;
  1228. if (mouseX < y || mouseY < x || mouseX > y + rsinterface.width || mouseY > x + rsinterface.height)
  1229. return;
  1230. for (int childIndex = 0; childIndex < rsinterface.children.length; childIndex++) {
  1231. int childX = rsinterface.childX[childIndex] + y;
  1232. int childY = (rsinterface.childY[childIndex] + x) - scrollPosition;
  1233. RSInterface child = RSInterface.interfaceCache[rsinterface.children[childIndex]];
  1234. childX += child.anInt263;
  1235. childY += child.anInt265;
  1236. if ((child.hoverType >= 0 || child.textHoverColor != 0) && mouseX >= childX && mouseY >= childY && mouseX < childX + child.width && mouseY < childY + child.height)
  1237. if (child.hoverType >= 0)
  1238. anInt886 = child.hoverType;
  1239. else
  1240. anInt886 = child.id;
  1241. if (child.type == 8 && mouseX >= childX && mouseY >= childY && mouseX < childX + child.width && mouseY < childY + child.height) {
  1242. anInt1315 = child.id;
  1243. }
  1244. if (child.type == 0) {
  1245. buildInterfaceMenu(childX, child, mouseX, childY, mouseY, child.scrollPosition);
  1246. if (child.scrollMax > child.height)
  1247. method65(childX + child.width, child.height, mouseX, mouseY, child, childY, true, child.scrollMax);
  1248. } else {
  1249. if (child.atActionType == 1 && mouseX >= childX && mouseY >= childY && mouseX < childX + child.width && mouseY < childY + child.height) {
  1250. boolean flag = false;
  1251. if (child.contentType != 0)
  1252. flag = buildFriendsListMenu(child);
  1253. if (!flag) {
  1254. menuActionName[menuActionRow] = child.tooltip;
  1255. menuActionID[menuActionRow] = 315;
  1256. menuActionCmd3[menuActionRow] = child.id;
  1257. menuActionRow++;
  1258. }
  1259. }
  1260. if (child.atActionType == 2 && spellSelected == 0 && mouseX >= childX && mouseY >= childY && mouseX < childX + child.width && mouseY < childY + child.height) {
  1261. String s = child.selectedActionName;
  1262. if (s.indexOf(" ") != -1)
  1263. s = s.substring(0, s.indexOf(" "));
  1264. menuActionName[menuActionRow] = s + " @gre@" + child.spellName;
  1265. menuActionID[menuActionRow] = 626;
  1266. menuActionCmd3[menuActionRow] = child.id;
  1267. menuActionRow++;
  1268. }
  1269. if (child.atActionType == 3 && mouseX >= childX && mouseY >= childY && mouseX < childX + child.width && mouseY < childY + child.height) {
  1270. menuActionName[menuActionRow] = "Close";
  1271. menuActionID[menuActionRow] = 200;
  1272. menuActionCmd3[menuActionRow] = child.id;
  1273. menuActionRow++;
  1274. }
  1275. if (child.atActionType == 4 && mouseX >= childX && mouseY >= childY && mouseX < childX + child.width && mouseY < childY + child.height) {
  1276. // System.out.println("2"+class9_1.tooltip + ", " +
  1277. // class9_1.interfaceID);
  1278. // menuActionName[menuActionRow] = class9_1.tooltip + ", " +
  1279. // class9_1.id;
  1280. menuActionName[menuActionRow] = child.tooltip;
  1281. menuActionID[menuActionRow] = 169;
  1282. menuActionCmd3[menuActionRow] = child.id;
  1283. menuActionRow++;
  1284. if (child.hoverText != null) {
  1285. // drawHoverBox(k, l, class9_1.hoverText);
  1286. // System.out.println("DRAWING INTERFACE: " +
  1287. // class9_1.hoverText);
  1288. }
  1289. }
  1290. if (child.atActionType == 5 && mouseX >= childX && mouseY >= childY && mouseX < childX + child.width && mouseY < childY + child.height) {
  1291. // System.out.println("3"+class9_1.tooltip + ", " +
  1292. // class9_1.interfaceID);
  1293. // menuActionName[menuActionRow] = class9_1.tooltip + ", " +
  1294. // class9_1.id;
  1295. menuActionName[menuActionRow] = child.tooltip;
  1296. menuActionID[menuActionRow] = 646;
  1297. menuActionCmd3[menuActionRow] = child.id;
  1298. menuActionRow++;
  1299. }
  1300. if (child.atActionType == 6 && !aBoolean1149 && mouseX >= childX && mouseY >= childY && mouseX < childX + child.width && mouseY < childY + child.height) {
  1301. // System.out.println("4"+class9_1.tooltip + ", " +
  1302. // class9_1.interfaceID);
  1303. // menuActionName[menuActionRow] = class9_1.tooltip + ", " +
  1304. // class9_1.id;
  1305. menuActionName[menuActionRow] = child.tooltip;
  1306. menuActionID[menuActionRow] = 679;
  1307. menuActionCmd3[menuActionRow] = child.id;
  1308. menuActionRow++;
  1309. }
  1310. if (child.atActionType == 8 && !aBoolean1149 && mouseX >= childX && mouseY >= childY && mouseX < childX + child.width && mouseY < childY + child.height) {
  1311. for (int i = 0; i < child.actions.length; i++) {
  1312. menuActionName[menuActionRow] = child.actions[i];
  1313. menuActionID[menuActionRow] = 1700 + i;
  1314. menuActionCmd3[menuActionRow] = child.id;
  1315. menuActionRow++;
  1316. }
  1317. }
  1318. if (mouseX >= childX && mouseY >= childY && mouseX < childX + (child.type == 4 ? 100 : child.width) && mouseY < childY + child.height) {
  1319. if (child.actions != null) {
  1320. if ((child.type == 4 && child.disabledMessage.length() > 0) || child.type == 5) {
  1321. for (int action = child.actions.length - 1; action >= 0; action--) {
  1322. if (child.actions[action] != null) {
  1323. menuActionName[menuActionRow] = child.actions[action] + (child.type == 4 ? " " + child.disabledMessage : "");
  1324. menuActionID[menuActionRow] = 647;
  1325. menuActionCmd2[menuActionRow] = action;
  1326. menuActionCmd3[menuActionRow] = child.id;
  1327. menuActionRow++;
  1328. }
  1329. }
  1330. }
  1331. }
  1332. }
  1333. if (child.type == 2) {
  1334. int k2 = 0;
  1335. int tabAm = tabAmounts[0];
  1336. int tabSlot = 0;
  1337. int hh = 0;
  1338.  
  1339. int newSlot = 0;
  1340. if (child.contentType == 206 && variousSettings[1000] != 0 && variousSettings[1012] == 0) {
  1341. for (int tab = 0; tab < tabAmounts.length; tab++) {
  1342. if (tab == variousSettings[1000]) {
  1343. break;
  1344. }
  1345. newSlot += tabAmounts[tab];
  1346. }
  1347. k2 = newSlot;
  1348. }
  1349.  
  1350. heightLoop: for (int l2 = 0; l2 < child.height; l2++) {
  1351. for (int i3 = 0; i3 < child.width; i3++) {
  1352. int j3 = childX + i3 * (32 + child.invSpritePadX);
  1353. int k3 = childY + l2 * (32 + child.invSpritePadY) + hh;
  1354. if (child.contentType == 206 && variousSettings[1012] == 0) {
  1355. if (variousSettings[1000] == 0) {
  1356. if (k2 >= tabAm) {
  1357. if (tabSlot + 1 < tabAmounts.length) {
  1358. tabAm += tabAmounts[++tabSlot];
  1359. if (tabSlot > 0 && tabAmounts[tabSlot - 1] % 8 == 0) {
  1360. l2--;
  1361. }
  1362. hh += 8;
  1363. }
  1364. break;
  1365. }
  1366. } else if (variousSettings[1000] <= 9) {
  1367. if (k2 >= tabAmounts[variousSettings[1000]] + newSlot) {
  1368. break heightLoop;
  1369. }
  1370. }
  1371. }
  1372. if (k2 < 20) {
  1373. j3 += child.spritesX[k2];
  1374. k3 += child.spritesY[k2];
  1375. }
  1376. if (mouseX >= j3 && mouseY >= k3 && mouseX < j3 + 32 && mouseY < k3 + 32) {
  1377. mouseInvInterfaceIndex = k2;
  1378. lastActiveInvInterface = child.id;
  1379.  
  1380. int itemId = child.inv[k2] - 1;
  1381. if (variousSettings[1012] == 1 && child.contentType == 206) {
  1382. itemId = bankInvTemp[k2] - 1;
  1383. }
  1384. if (itemId + 1 > 0) {
  1385. ItemDef itemDef = ItemDef.forID(itemId);
  1386. if (itemSelected == 1 && child.isInventoryInterface) {
  1387. if (child.id != anInt1284 || k2 != anInt1283) {
  1388. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  1389. menuActionID[menuActionRow] = 870;
  1390. menuActionCmd1[menuActionRow] = itemDef.id;
  1391. menuActionCmd2[menuActionRow] = k2;
  1392. menuActionCmd3[menuActionRow] = child.id;
  1393. menuActionRow++;
  1394. }
  1395. } else if (spellSelected == 1 && child.isInventoryInterface) {
  1396. if ((spellUsableOn & 0x10) == 16) {
  1397. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  1398. menuActionID[menuActionRow] = 543;
  1399. menuActionCmd1[menuActionRow] = itemDef.id;
  1400. menuActionCmd2[menuActionRow] = k2;
  1401. menuActionCmd3[menuActionRow] = child.id;
  1402. menuActionRow++;
  1403. }
  1404. } else {
  1405. if (child.isInventoryInterface) {
  1406. for (int l3 = 4; l3 >= 3; l3--)
  1407. if (itemDef.itemActions != null && itemDef.itemActions[l3] != null) {
  1408. menuActionName[menuActionRow] = itemDef.itemActions[l3] + " @lre@" + itemDef.name;
  1409. if (l3 == 3)
  1410. menuActionID[menuActionRow] = 493;
  1411. if (l3 == 4)
  1412. menuActionID[menuActionRow] = 847;
  1413. menuActionCmd1[menuActionRow] = itemDef.id;
  1414. menuActionCmd2[menuActionRow] = k2;
  1415. menuActionCmd3[menuActionRow] = child.id;
  1416. menuActionRow++;
  1417. } else if (l3 == 4) {
  1418. menuActionName[menuActionRow] = "Drop @lre@" + itemDef.name;
  1419. menuActionID[menuActionRow] = 847;
  1420. menuActionCmd1[menuActionRow] = itemDef.id;
  1421. menuActionCmd2[menuActionRow] = k2;
  1422. menuActionCmd3[menuActionRow] = child.id;
  1423. menuActionRow++;
  1424. }
  1425. }
  1426. if (child.usableItemInterface) {
  1427. menuActionName[menuActionRow] = "Use @lre@" + itemDef.name;
  1428. menuActionID[menuActionRow] = 447;
  1429. menuActionCmd1[menuActionRow] = itemDef.id;
  1430. menuActionCmd2[menuActionRow] = k2;
  1431. menuActionCmd3[menuActionRow] = child.id;
  1432. menuActionRow++;
  1433. }
  1434. if (child.isInventoryInterface && itemDef.itemActions != null) {
  1435. for (int i4 = 2; i4 >= 0; i4--)
  1436. if (itemDef.itemActions[i4] != null) {
  1437. menuActionName[menuActionRow] = itemDef.itemActions[i4] + " @lre@" + itemDef.name;
  1438. if (i4 == 0)
  1439. menuActionID[menuActionRow] = 74;
  1440. if (i4 == 1)
  1441. menuActionID[menuActionRow] = 454;
  1442. if (i4 == 2)
  1443. menuActionID[menuActionRow] = 539;
  1444. menuActionCmd1[menuActionRow] = itemDef.id;
  1445. menuActionCmd2[menuActionRow] = k2;
  1446. menuActionCmd3[menuActionRow] = child.id;
  1447. menuActionRow++;
  1448. }
  1449.  
  1450. }
  1451. if (child.actions != null) {
  1452. if (rsinterface.parentID == 5292) {
  1453. if (modifiableXValue > 0) {
  1454. child.actions[5] = "Withdraw-" + modifiableXValue;
  1455. } else {
  1456. child.actions[5] = null;
  1457. }
  1458. }
  1459.  
  1460. for (int j4 = 6; j4 >= 0; j4--) {
  1461. if (j4 > child.actions.length - 1)
  1462. continue;
  1463. if (child.actions[j4] != null) {
  1464. menuActionName[menuActionRow] = child.actions[j4] + " @lre@" + itemDef.name;
  1465. if (j4 == 0)
  1466. menuActionID[menuActionRow] = 632;
  1467. if (j4 == 1)
  1468. menuActionID[menuActionRow] = 78;
  1469. if (j4 == 2)
  1470. menuActionID[menuActionRow] = 867;
  1471. if (j4 == 3)
  1472. menuActionID[menuActionRow] = 431;
  1473. if (j4 == 4)
  1474. menuActionID[menuActionRow] = 53;
  1475. if (rsinterface.parentID == 5292) {
  1476. if (child.actions[j4] == null) {
  1477. if (j4 == 5)
  1478. menuActionID[menuActionRow] = 291;
  1479. } else {
  1480. if (j4 == 5)
  1481. menuActionID[menuActionRow] = 300;
  1482. if (j4 == 6)
  1483. menuActionID[menuActionRow] = 291;
  1484. }
  1485. }
  1486.  
  1487. menuActionCmd1[menuActionRow] = itemDef.id;
  1488. menuActionCmd2[menuActionRow] = k2;
  1489. menuActionCmd3[menuActionRow] = child.id;
  1490. menuActionRow++;
  1491. }
  1492. }
  1493. }
  1494. if (ClientConstants.DEBUG_MODE) {
  1495. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + itemDef.id + "@gre@)";
  1496. } else {
  1497. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  1498. }
  1499. menuActionID[menuActionRow] = 1125;
  1500. menuActionCmd1[menuActionRow] = itemDef.id;
  1501. menuActionCmd2[menuActionRow] = k2;
  1502. menuActionCmd3[menuActionRow] = child.id;
  1503. menuActionRow++;
  1504. }
  1505. }
  1506. }
  1507. k2++;
  1508. }
  1509. }
  1510. }
  1511. }
  1512. }
  1513. }
  1514.  
  1515. public void drawTransparentScrollBar(int x, int y, int height, int maxScroll, int pos) {
  1516. orbComponents3[7].drawTransparentSprite(x, y, 120);
  1517. orbComponents3[8].drawTransparentSprite(x, y + height - 16, 120);
  1518. DrawingArea.drawVerticalLine(x, y + 16, height - 32, 0xffffff, 64);
  1519. DrawingArea.drawVerticalLine(x + 15, y + 16, height - 32, 0xffffff, 64);
  1520. int barHeight = (height - 32) * height / maxScroll;
  1521. if (barHeight < 10) {
  1522. barHeight = 10;
  1523. }
  1524. int barPos = 0;
  1525. if (maxScroll != height) {
  1526. barPos = (height - 32 - barHeight) * pos / (maxScroll - height);
  1527. }
  1528. DrawingArea.drawRectangle(x, y + 16 + barPos, 16, 5 + y + 16 + barPos + barHeight - 5 - (y + 16 + barPos), 0xffffff, 32);
  1529. }
  1530.  
  1531. public void drawScrollbar(int height, int pos, int y, int x, int maxScroll, boolean transparent) {
  1532. if (transparent) {
  1533. drawTransparentScrollBar(x, y, height, maxScroll, pos);
  1534. } else {
  1535. scrollBar1.drawSprite(x, y);
  1536. scrollBar2.drawSprite(x, (y + height) - 16);
  1537. DrawingArea.drawPixels(height - 32, y + 16, x, 0x000001, 16);
  1538. DrawingArea.drawPixels(height - 32, y + 16, x, 0x3d3426, 15);
  1539. DrawingArea.drawPixels(height - 32, y + 16, x, 0x342d21, 13);
  1540. DrawingArea.drawPixels(height - 32, y + 16, x, 0x2e281d, 11);
  1541. DrawingArea.drawPixels(height - 32, y + 16, x, 0x29241b, 10);
  1542. DrawingArea.drawPixels(height - 32, y + 16, x, 0x252019, 9);
  1543. DrawingArea.drawPixels(height - 32, y + 16, x, 0x000001, 1);
  1544. int k1 = ((height - 32) * height) / maxScroll;
  1545. if (k1 < 8) {
  1546. k1 = 8;
  1547. }
  1548. int l1 = ((height - 32 - k1) * pos) / (maxScroll - height);
  1549. DrawingArea.drawPixels(k1, y + 16 + l1, x, barFillColor, 16);
  1550. DrawingArea.method341(y + 16 + l1, 0x000001, k1, x);
  1551. DrawingArea.method341(y + 16 + l1, 0x817051, k1, x + 1);
  1552. DrawingArea.method341(y + 16 + l1, 0x73654a, k1, x + 2);
  1553. DrawingArea.method341(y + 16 + l1, 0x6a5c43, k1, x + 3);
  1554. DrawingArea.method341(y + 16 + l1, 0x6a5c43, k1, x + 4);
  1555. DrawingArea.method341(y + 16 + l1, 0x655841, k1, x + 5);
  1556. DrawingArea.method341(y + 16 + l1, 0x655841, k1, x + 6);
  1557. DrawingArea.method341(y + 16 + l1, 0x61553e, k1, x + 7);
  1558. DrawingArea.method341(y + 16 + l1, 0x61553e, k1, x + 8);
  1559. DrawingArea.method341(y + 16 + l1, 0x5d513c, k1, x + 9);
  1560. DrawingArea.method341(y + 16 + l1, 0x5d513c, k1, x + 10);
  1561. DrawingArea.method341(y + 16 + l1, 0x594e3a, k1, x + 11);
  1562. DrawingArea.method341(y + 16 + l1, 0x594e3a, k1, x + 12);
  1563. DrawingArea.method341(y + 16 + l1, 0x514635, k1, x + 13);
  1564. DrawingArea.method341(y + 16 + l1, 0x4b4131, k1, x + 14);
  1565. DrawingArea.method339(y + 16 + l1, 0x000001, 15, x);
  1566. DrawingArea.method339(y + 17 + l1, 0x000001, 15, x);
  1567. DrawingArea.method339(y + 17 + l1, 0x655841, 14, x);
  1568. DrawingArea.method339(y + 17 + l1, 0x6a5c43, 13, x);
  1569. DrawingArea.method339(y + 17 + l1, 0x6d5f48, 11, x);
  1570. DrawingArea.method339(y + 17 + l1, 0x73654a, 10, x);
  1571. DrawingArea.method339(y + 17 + l1, 0x76684b, 7, x);
  1572. DrawingArea.method339(y + 17 + l1, 0x7b6a4d, 5, x);
  1573. DrawingArea.method339(y + 17 + l1, 0x7e6e50, 4, x);
  1574. DrawingArea.method339(y + 17 + l1, 0x817051, 3, x);
  1575. DrawingArea.method339(y + 17 + l1, 0x000001, 2, x);
  1576. DrawingArea.method339(y + 18 + l1, 0x000001, 16, x);
  1577. DrawingArea.method339(y + 18 + l1, 0x564b38, 15, x);
  1578. DrawingArea.method339(y + 18 + l1, 0x5d513c, 14, x);
  1579. DrawingArea.method339(y + 18 + l1, 0x625640, 11, x);
  1580. DrawingArea.method339(y + 18 + l1, 0x655841, 10, x);
  1581. DrawingArea.method339(y + 18 + l1, 0x6a5c43, 7, x);
  1582. DrawingArea.method339(y + 18 + l1, 0x6e6046, 5, x);
  1583. DrawingArea.method339(y + 18 + l1, 0x716247, 4, x);
  1584. DrawingArea.method339(y + 18 + l1, 0x7b6a4d, 3, x);
  1585. DrawingArea.method339(y + 18 + l1, 0x817051, 2, x);
  1586. DrawingArea.method339(y + 18 + l1, 0x000001, 1, x);
  1587. DrawingArea.method339(y + 19 + l1, 0x000001, 16, x);
  1588. DrawingArea.method339(y + 19 + l1, 0x514635, 15, x);
  1589. DrawingArea.method339(y + 19 + l1, 0x564b38, 14, x);
  1590. DrawingArea.method339(y + 19 + l1, 0x5d513c, 11, x);
  1591. DrawingArea.method339(y + 19 + l1, 0x61553e, 9, x);
  1592. DrawingArea.method339(y + 19 + l1, 0x655841, 7, x);
  1593. DrawingArea.method339(y + 19 + l1, 0x6a5c43, 5, x);
  1594. DrawingArea.method339(y + 19 + l1, 0x6e6046, 4, x);
  1595. DrawingArea.method339(y + 19 + l1, 0x73654a, 3, x);
  1596. DrawingArea.method339(y + 19 + l1, 0x817051, 2, x);
  1597. DrawingArea.method339(y + 19 + l1, 0x000001, 1, x);
  1598. DrawingArea.method339(y + 20 + l1, 0x000001, 16, x);
  1599. DrawingArea.method339(y + 20 + l1, 0x4b4131, 15, x);
  1600. DrawingArea.method339(y + 20 + l1, 0x544936, 14, x);
  1601. DrawingArea.method339(y + 20 + l1, 0x594e3a, 13, x);
  1602. DrawingArea.method339(y + 20 + l1, 0x5d513c, 10, x);
  1603. DrawingArea.method339(y + 20 + l1, 0x61553e, 8, x);
  1604. DrawingArea.method339(y + 20 + l1, 0x655841, 6, x);
  1605. DrawingArea.method339(y + 20 + l1, 0x6a5c43, 4, x);
  1606. DrawingArea.method339(y + 20 + l1, 0x73654a, 3, x);
  1607. DrawingArea.method339(y + 20 + l1, 0x817051, 2, x);
  1608. DrawingArea.method339(y + 20 + l1, 0x000001, 1, x);
  1609. DrawingArea.method341(y + 16 + l1, 0x000001, k1, x + 15);
  1610. DrawingArea.method339(y + 15 + l1 + k1, 0x000001, 16, x);
  1611. DrawingArea.method339(y + 14 + l1 + k1, 0x000001, 15, x);
  1612. DrawingArea.method339(y + 14 + l1 + k1, 0x3f372a, 14, x);
  1613. DrawingArea.method339(y + 14 + l1 + k1, 0x443c2d, 10, x);
  1614. DrawingArea.method339(y + 14 + l1 + k1, 0x483e2f, 9, x);
  1615. DrawingArea.method339(y + 14 + l1 + k1, 0x4a402f, 7, x);
  1616. DrawingArea.method339(y + 14 + l1 + k1, 0x4b4131, 4, x);
  1617. DrawingArea.method339(y + 14 + l1 + k1, 0x564b38, 3, x);
  1618. DrawingArea.method339(y + 14 + l1 + k1, 0x000001, 2, x);
  1619. DrawingArea.method339(y + 13 + l1 + k1, 0x000001, 16, x);
  1620. DrawingArea.method339(y + 13 + l1 + k1, 0x443c2d, 15, x);
  1621. DrawingArea.method339(y + 13 + l1 + k1, 0x4b4131, 11, x);
  1622. DrawingArea.method339(y + 13 + l1 + k1, 0x514635, 9, x);
  1623. DrawingArea.method339(y + 13 + l1 + k1, 0x544936, 7, x);
  1624. DrawingArea.method339(y + 13 + l1 + k1, 0x564b38, 6, x);
  1625. DrawingArea.method339(y + 13 + l1 + k1, 0x594e3a, 4, x);
  1626. DrawingArea.method339(y + 13 + l1 + k1, 0x625640, 3, x);
  1627. DrawingArea.method339(y + 13 + l1 + k1, 0x6a5c43, 2, x);
  1628. DrawingArea.method339(y + 13 + l1 + k1, 0x000001, 1, x);
  1629. DrawingArea.method339(y + 12 + l1 + k1, 0x000001, 16, x);
  1630. DrawingArea.method339(y + 12 + l1 + k1, 0x443c2d, 15, x);
  1631. DrawingArea.method339(y + 12 + l1 + k1, 0x4b4131, 14, x);
  1632. DrawingArea.method339(y + 12 + l1 + k1, 0x544936, 12, x);
  1633. DrawingArea.method339(y + 12 + l1 + k1, 0x564b38, 11, x);
  1634. DrawingArea.method339(y + 12 + l1 + k1, 0x594e3a, 10, x);
  1635. DrawingArea.method339(y + 12 + l1 + k1, 0x5d513c, 7, x);
  1636. DrawingArea.method339(y + 12 + l1 + k1, 0x61553e, 4, x);
  1637. DrawingArea.method339(y + 12 + l1 + k1, 0x6e6046, 3, x);
  1638. DrawingArea.method339(y + 12 + l1 + k1, 0x7b6a4d, 2, x);
  1639. DrawingArea.method339(y + 12 + l1 + k1, 0x000001, 1, x);
  1640. DrawingArea.method339(y + 11 + l1 + k1, 0x000001, 16, x);
  1641. DrawingArea.method339(y + 11 + l1 + k1, 0x4b4131, 15, x);
  1642. DrawingArea.method339(y + 11 + l1 + k1, 0x514635, 14, x);
  1643. DrawingArea.method339(y + 11 + l1 + k1, 0x564b38, 13, x);
  1644. DrawingArea.method339(y + 11 + l1 + k1, 0x594e3a, 11, x);
  1645. DrawingArea.method339(y + 11 + l1 + k1, 0x5d513c, 9, x);
  1646. DrawingArea.method339(y + 11 + l1 + k1, 0x61553e, 7, x);
  1647. DrawingArea.method339(y + 11 + l1 + k1, 0x655841, 5, x);
  1648. DrawingArea.method339(y + 11 + l1 + k1, 0x6a5c43, 4, x);
  1649. DrawingArea.method339(y + 11 + l1 + k1, 0x73654a, 3, x);
  1650. DrawingArea.method339(y + 11 + l1 + k1, 0x7b6a4d, 2, x);
  1651. DrawingArea.method339(y + 11 + l1 + k1, 0x000001, 1, x);
  1652. }
  1653. }
  1654.  
  1655. private void updateNPCs(Stream stream, int i) {
  1656. anInt839 = 0;
  1657. anInt893 = 0;
  1658. method139(stream);
  1659. method46(i, stream);
  1660. method86(stream);
  1661. for (int k = 0; k < anInt839; k++) {
  1662. int l = anIntArray840[k];
  1663. if (npcArray[l].anInt1537 != loopCycle) {
  1664. npcArray[l].desc = null;
  1665. npcArray[l] = null;
  1666. }
  1667. }
  1668.  
  1669. if (stream.currentOffset != i) {
  1670. Signlink.reporterror(myUsername + " size mismatch in getnpcpos - pos:" + stream.currentOffset + " psize:" + i);
  1671. throw new RuntimeException("eek");
  1672. }
  1673. for (int i1 = 0; i1 < npcCount; i1++)
  1674. if (npcArray[npcIndices[i1]] == null) {
  1675. Signlink.reporterror(myUsername + " null entry in npc list - pos:" + i1 + " size:" + npcCount);
  1676. throw new RuntimeException("eek");
  1677. }
  1678.  
  1679. }
  1680.  
  1681. private int cButtonHPos;
  1682. private int cButtonCPos;
  1683. private int setChannel;
  1684.  
  1685. public void processChatModeClick() {
  1686. final int yOffset = frameMode == ScreenMode.FIXED ? 0 : frameHeight - 503;
  1687. if (super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= yOffset + 482 && super.mouseY <= yOffset + 503) {
  1688. cButtonHPos = 0;
  1689. inputTaken = true;
  1690. } else if (super.mouseX >= 71 && super.mouseX <= 127 && super.mouseY >= yOffset + 482 && super.mouseY <= yOffset + 503) {
  1691. cButtonHPos = 1;
  1692. inputTaken = true;
  1693. } else if (super.mouseX >= 137 && super.mouseX <= 193 && super.mouseY >= yOffset + 482 && super.mouseY <= yOffset + 503) {
  1694. cButtonHPos = 2;
  1695. inputTaken = true;
  1696. } else if (super.mouseX >= 203 && super.mouseX <= 259 && super.mouseY >= yOffset + 482 && super.mouseY <= yOffset + 503) {
  1697. cButtonHPos = 3;
  1698. inputTaken = true;
  1699. } else if (super.mouseX >= 269 && super.mouseX <= 325 && super.mouseY >= yOffset + 482 && super.mouseY <= yOffset + 503) {
  1700. cButtonHPos = 4;
  1701. inputTaken = true;
  1702. } else if (super.mouseX >= 335 && super.mouseX <= 391 && super.mouseY >= yOffset + 482 && super.mouseY <= yOffset + 503) {
  1703. cButtonHPos = 5;
  1704. inputTaken = true;
  1705. } else if (super.mouseX >= 404 && super.mouseX <= 515 && super.mouseY >= yOffset + 482 && super.mouseY <= yOffset + 503) {
  1706. cButtonHPos = 6;
  1707. inputTaken = true;
  1708. } else {
  1709. cButtonHPos = -1;
  1710. inputTaken = true;
  1711. }
  1712. if (super.clickMode3 == 1) {
  1713. if (RSInterface.currentInputField != null) {
  1714. if (RSInterface.currentInputField.onlyNumbers) {
  1715. long amount = 0;
  1716.  
  1717. try {
  1718. amount = Long.parseLong(message.replaceAll(",", ""));
  1719.  
  1720. // overflow concious code
  1721. if (amount < -Integer.MAX_VALUE) {
  1722. amount = -Integer.MAX_VALUE;
  1723. } else if (amount > Integer.MAX_VALUE) {
  1724. amount = Integer.MAX_VALUE;
  1725. }
  1726. } catch (Exception ignored) {}
  1727.  
  1728. if (amount > 0) {
  1729. stream.createFrame(208);
  1730. stream.writeDWord((int) amount);
  1731. }
  1732. } else {
  1733. stream.createFrame(150);
  1734. stream.writeWordBigEndian(RSInterface.currentInputField.disabledMessage.length() + 3);
  1735. stream.writeWord(RSInterface.currentInputField.id);
  1736. stream.writeString(RSInterface.currentInputField.disabledMessage);
  1737. }
  1738.  
  1739. RSInterface.currentInputField.disabledMessage = "";
  1740. }
  1741. RSInterface.currentInputField = null;
  1742. if (super.saveClickX >= 5 && super.saveClickX <= 61 && super.saveClickY >= yOffset + 482 && super.saveClickY <= yOffset + 505) {
  1743. if (frameMode != ScreenMode.FIXED) {
  1744. if (setChannel != 0) {
  1745. cButtonCPos = 0;
  1746. chatTypeView = 0;
  1747. inputTaken = true;
  1748. setChannel = 0;
  1749. } else {
  1750. showChatComponents = showChatComponents ? false : true;
  1751. }
  1752. } else {
  1753. cButtonCPos = 0;
  1754. chatTypeView = 0;
  1755. inputTaken = true;
  1756. setChannel = 0;
  1757. }
  1758. stream.createFrame(95);
  1759. stream.writeWordBigEndian(publicChatMode);
  1760. stream.writeWordBigEndian(privateChatMode);
  1761. stream.writeWordBigEndian(tradeMode);
  1762. } else if (super.saveClickX >= 71 && super.saveClickX <= 127 && super.saveClickY >= yOffset + 482 && super.saveClickY <= yOffset + 505) {
  1763. if (frameMode != ScreenMode.FIXED) {
  1764. if (setChannel != 1 && frameMode != ScreenMode.FIXED) {
  1765. cButtonCPos = 1;
  1766. chatTypeView = 5;
  1767. inputTaken = true;
  1768. setChannel = 1;
  1769. } else {
  1770. showChatComponents = showChatComponents ? false : true;
  1771. }
  1772. } else {
  1773. cButtonCPos = 1;
  1774. chatTypeView = 5;
  1775. inputTaken = true;
  1776. setChannel = 1;
  1777. }
  1778. stream.createFrame(95);
  1779. stream.writeWordBigEndian(publicChatMode);
  1780. stream.writeWordBigEndian(privateChatMode);
  1781. stream.writeWordBigEndian(tradeMode);
  1782. } else if (super.saveClickX >= 137 && super.saveClickX <= 193 && super.saveClickY >= yOffset + 482 && super.saveClickY <= yOffset + 505) {
  1783. if (frameMode != ScreenMode.FIXED) {
  1784. if (setChannel != 2 && frameMode != ScreenMode.FIXED) {
  1785. cButtonCPos = 2;
  1786. chatTypeView = 1;
  1787. inputTaken = true;
  1788. setChannel = 2;
  1789. } else {
  1790. showChatComponents = showChatComponents ? false : true;
  1791. }
  1792. } else {
  1793. cButtonCPos = 2;
  1794. chatTypeView = 1;
  1795. inputTaken = true;
  1796. setChannel = 2;
  1797. }
  1798. stream.createFrame(95);
  1799. stream.writeWordBigEndian(publicChatMode);
  1800. stream.writeWordBigEndian(privateChatMode);
  1801. stream.writeWordBigEndian(tradeMode);
  1802. } else if (super.saveClickX >= 203 && super.saveClickX <= 259 && super.saveClickY >= yOffset + 482 && super.saveClickY <= yOffset + 505) {
  1803. if (frameMode != ScreenMode.FIXED) {
  1804. if (setChannel != 3 && frameMode != ScreenMode.FIXED) {
  1805. cButtonCPos = 3;
  1806. chatTypeView = 2;
  1807. inputTaken = true;
  1808. setChannel = 3;
  1809. } else {
  1810. showChatComponents = showChatComponents ? false : true;
  1811. }
  1812. } else {
  1813. cButtonCPos = 3;
  1814. chatTypeView = 2;
  1815. inputTaken = true;
  1816. setChannel = 3;
  1817. }
  1818. stream.createFrame(95);
  1819. stream.writeWordBigEndian(publicChatMode);
  1820. stream.writeWordBigEndian(privateChatMode);
  1821. stream.writeWordBigEndian(tradeMode);
  1822. } else if (super.saveClickX >= 269 && super.saveClickX <= 325 && super.saveClickY >= yOffset + 482 && super.saveClickY <= yOffset + 505) {
  1823. if (frameMode != ScreenMode.FIXED) {
  1824. if (setChannel != 4 && frameMode != ScreenMode.FIXED) {
  1825. cButtonCPos = 4;
  1826. chatTypeView = 5;
  1827. inputTaken = true;
  1828. setChannel = 4;
  1829. } else {
  1830. showChatComponents = showChatComponents ? false : true;
  1831. }
  1832. } else {
  1833. cButtonCPos = 4;
  1834. chatTypeView = 5;
  1835. inputTaken = true;
  1836. setChannel = 4;
  1837. }
  1838. stream.createFrame(95);
  1839. stream.writeWordBigEndian(publicChatMode);
  1840. stream.writeWordBigEndian(privateChatMode);
  1841. stream.writeWordBigEndian(tradeMode);
  1842. } else if (super.saveClickX >= 335 && super.saveClickX <= 391 && super.saveClickY >= yOffset + 482 && super.saveClickY <= yOffset + 505) {
  1843. if (frameMode != ScreenMode.FIXED) {
  1844. if (setChannel != 5 && frameMode != ScreenMode.FIXED) {
  1845. cButtonCPos = 5;
  1846. chatTypeView = 3;
  1847. inputTaken = true;
  1848. setChannel = 5;
  1849. } else {
  1850. showChatComponents = showChatComponents ? false : true;
  1851. }
  1852. } else {
  1853. cButtonCPos = 5;
  1854. chatTypeView = 3;
  1855. inputTaken = true;
  1856. setChannel = 5;
  1857. }
  1858. stream.createFrame(95);
  1859. stream.writeWordBigEndian(publicChatMode);
  1860. stream.writeWordBigEndian(privateChatMode);
  1861. stream.writeWordBigEndian(tradeMode);
  1862. } else if (super.saveClickX >= 404 && super.saveClickX <= 515 && super.saveClickY >= yOffset + 482 && super.saveClickY <= yOffset + 505) {
  1863. if (openInterfaceID == -1) {
  1864. clearTopInterfaces();
  1865. reportAbuseInput = "";
  1866. canMute = false;
  1867. for (int i = 0; i < RSInterface.interfaceCache.length; i++) {
  1868. if (RSInterface.interfaceCache[i] == null || RSInterface.interfaceCache[i].parentID != 41750) {
  1869. continue;
  1870. }
  1871. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  1872. break;
  1873. }
  1874. } else {
  1875. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  1876. }
  1877. }
  1878. }
  1879. }
  1880.  
  1881. private void updateConfigValues(int i) {
  1882. try {
  1883.  
  1884. int k = variousSettings[i];
  1885.  
  1886.  
  1887. if (i == 1050) {
  1888. switch (k) {
  1889. case 1:
  1890. case 2:
  1891. case 3:
  1892. case 4:
  1893. case 5:
  1894. break;
  1895. }
  1896. }
  1897. int j = Varp.cache[i].anInt709;
  1898. if (j == 0)
  1899. return;
  1900. if (j == 1) {
  1901. if (k == 1)
  1902. Rasterizer.method372(0.90000000000000002D);
  1903. if (k == 2)
  1904. Rasterizer.method372(0.80000000000000004D);
  1905. if (k == 3)
  1906. Rasterizer.method372(0.69999999999999996D);
  1907. if (k == 4)
  1908. Rasterizer.method372(0.59999999999999998D);
  1909. ItemDef.mruNodes1.unlinkAll();
  1910. welcomeScreenRaised = true;
  1911. }
  1912. if (j == 3) {
  1913. boolean flag1 = musicEnabled;
  1914. if (k == 0) {
  1915. adjustVolume(musicEnabled, 0);
  1916. musicEnabled = true;
  1917. }
  1918. if (k == 1) {
  1919. adjustVolume(musicEnabled, -400);
  1920. musicEnabled = true;
  1921. }
  1922. if (k == 2) {
  1923. adjustVolume(musicEnabled, -800);
  1924. musicEnabled = true;
  1925. }
  1926. if (k == 3) {
  1927. adjustVolume(musicEnabled, -1200);
  1928. musicEnabled = true;
  1929. }
  1930. if (k == 4)
  1931. musicEnabled = false;
  1932. if (musicEnabled != flag1 && !lowMem) {
  1933. if (musicEnabled) {
  1934. nextSong = currentSong;
  1935. songChanging = true;
  1936. onDemandFetcher.method558(2, nextSong);
  1937. } else {
  1938. stopMidi();
  1939. }
  1940. prevSong = 0;
  1941. }
  1942. }
  1943. if (j == 4) {
  1944. if (k == 0) {
  1945. aBoolean848 = true;
  1946. setWaveVolume(0);
  1947. }
  1948. if (k == 1) {
  1949. aBoolean848 = true;
  1950. setWaveVolume(-400);
  1951. }
  1952. if (k == 2) {
  1953. aBoolean848 = true;
  1954. setWaveVolume(-800);
  1955. }
  1956. if (k == 3) {
  1957. aBoolean848 = true;
  1958. setWaveVolume(-1200);
  1959. }
  1960. if (k == 4)
  1961. aBoolean848 = false;
  1962. }
  1963. if (j == 5)
  1964. anInt1253 = k;
  1965. if (j == 6)
  1966. anInt1249 = k;
  1967. if (j == 8) {
  1968. splitPrivateChat = k;
  1969. inputTaken = true;
  1970. }
  1971. if (j == 9)
  1972. anInt913 = k;
  1973. } catch (Exception e) {
  1974. }
  1975. }
  1976.  
  1977. public StreamLoader mediaStreamLoader;
  1978.  
  1979. public void updateEntities() {
  1980. try {
  1981. int anInt974 = 0;
  1982. for (int j = -1; j < playerCount + npcCount; j++) {
  1983. Object obj;
  1984. if (j == -1)
  1985. obj = myPlayer;
  1986. else if (j < playerCount)
  1987. obj = playerArray[playerIndices[j]];
  1988. else
  1989. obj = npcArray[npcIndices[j - playerCount]];
  1990. if (obj == null || !((Entity) (obj)).isVisible())
  1991. continue;
  1992. if (obj instanceof Npc) {
  1993. EntityDef entityDef = ((Npc) obj).desc;
  1994. if (entityDef.childrenIDs != null)
  1995. entityDef = entityDef.method161();
  1996. if (entityDef == null)
  1997. continue;
  1998. }
  1999. if (j < playerCount) {
  2000. int l = 30;
  2001. Player player = (Player) obj;
  2002. if (player.headIcon >= 0) {
  2003. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2004. if (spriteDrawX > -1) {
  2005. if (player.skullIcon < 2) {
  2006. skullIcons[player.skullIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2007. l += 25;
  2008. }
  2009. if (player.headIcon < 13) {
  2010. headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2011. l += 18;
  2012. }
  2013. }
  2014. }
  2015. if (j >= 0 && anInt855 == 10 && anInt933 == playerIndices[j]) {
  2016. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2017. if (spriteDrawX > -1)
  2018. headIconsHint[player.hintIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2019. }
  2020. } else {
  2021. EntityDef entityDef_1 = ((Npc) obj).desc;
  2022. if (entityDef_1.anInt75 >= 0 && entityDef_1.anInt75 < headIcons.length) {
  2023. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2024. if (spriteDrawX > -1)
  2025. headIcons[entityDef_1.anInt75].drawSprite(spriteDrawX - 12, spriteDrawY - 30);
  2026. }
  2027. if (anInt855 == 1 && anInt1222 == npcIndices[j - playerCount] && loopCycle % 20 < 10) {
  2028. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2029. if (spriteDrawX > -1)
  2030. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  2031. }
  2032. }
  2033. if (((Entity) (obj)).textSpoken != null && (j >= playerCount || publicChatMode == 0 || publicChatMode == 3 || publicChatMode == 1 && isFriendOrSelf(((Player) obj).name))) {
  2034. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height);
  2035. if (spriteDrawX > -1 && anInt974 < anInt975) {
  2036. anIntArray979[anInt974] = boldText.method384(((Entity) (obj)).textSpoken) / 2;
  2037. anIntArray978[anInt974] = boldText.anInt1497;
  2038. anIntArray976[anInt974] = spriteDrawX;
  2039. anIntArray977[anInt974] = spriteDrawY;
  2040. anIntArray980[anInt974] = ((Entity) (obj)).anInt1513;
  2041. anIntArray981[anInt974] = ((Entity) (obj)).anInt1531;
  2042. anIntArray982[anInt974] = ((Entity) (obj)).textCycle;
  2043. aStringArray983[anInt974++] = ((Entity) (obj)).textSpoken;
  2044. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 >= 1 && ((Entity) (obj)).anInt1531 <= 3) {
  2045. anIntArray978[anInt974] += 10;
  2046. anIntArray977[anInt974] += 5;
  2047. }
  2048. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 4)
  2049. anIntArray979[anInt974] = 60;
  2050. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 5)
  2051. anIntArray978[anInt974] += 5;
  2052. }
  2053. }
  2054. if (((Entity) (obj)).loopCycleStatus > loopCycle) {
  2055. try {
  2056. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2057. if (spriteDrawX > -1) {
  2058. int i1 = (((Entity) (obj)).currentHealth * 30) / ((Entity) (obj)).maxHealth;
  2059. if (i1 > 30) {
  2060. i1 = 30;
  2061. }
  2062. int barWidth = hpBars[0].cropWidth;
  2063. int percent = (((Entity) (obj)).currentHealth * barWidth) / ((Entity) (obj)).maxHealth;
  2064. if (percent > barWidth) {
  2065. percent = barWidth;
  2066. }
  2067. if (!Configuration.enableNewHpBars) {
  2068. DrawingArea.drawPixels(5, spriteDrawY - 3, spriteDrawX - 15, 65280, i1);
  2069. DrawingArea.drawPixels(5, spriteDrawY - 3, (spriteDrawX - 15) + i1, 0xff0000, 30 - i1);
  2070. } else {
  2071. hpBars[1].drawSprite(spriteDrawX - (barWidth / 2), spriteDrawY - 3);
  2072. if (percent > 0) {
  2073. Sprite fullBar = new Sprite(hpBars[0], 0, 0, percent, 7);
  2074. fullBar.drawSprite(spriteDrawX - (barWidth / 2), spriteDrawY - 3);
  2075. }
  2076. }
  2077. if (Configuration.drawEntityFeed) {
  2078. /*String monster_name = ((Npc) obj).desc.name;
  2079. pushFeed(monster_name, ((Entity) obj).currentHealth, ((Entity) obj).maxHealth);
  2080. displayEntityFeed();*/
  2081. }
  2082. }
  2083. } catch (Exception e) {
  2084. }
  2085. }
  2086. if (Configuration.enableNewHitmarks) {
  2087. for (int j1 = 0; j1 < 4; j1++) {
  2088. if (((Entity) (obj)).hitsLoopCycle[j1] > loopCycle) {
  2089. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height / 2);
  2090. if (spriteDrawX > -1) {
  2091. switch (j1) {
  2092. case 1:
  2093. spriteDrawY += 20;
  2094. break;
  2095. case 2:
  2096. spriteDrawY += 40;
  2097. break;
  2098. case 3:
  2099. spriteDrawY += 60;
  2100. break;
  2101. case 4:
  2102. spriteDrawY += 80;
  2103. break;
  2104. case 5:
  2105. spriteDrawY += 100;
  2106. break;
  2107. case 6:
  2108. spriteDrawY += 120;
  2109. break;
  2110. }
  2111. Entity e = ((Entity) (obj));
  2112. if (e.hitmarkMove[j1] > -30)
  2113. e.hitmarkMove[j1]--;
  2114. if (e.hitmarkMove[j1] < -26)
  2115. e.hitmarkTrans[j1] -= 5;
  2116. hitmarkDraw(String.valueOf(e.hitArray[j1]).length(), e.hitMarkTypes[j1], e.hitIcon[j1], e.hitArray[j1], e.hitmarkMove[j1], e.hitmarkTrans[j1]);
  2117. }
  2118. }
  2119. }
  2120. } else {
  2121. for (int j1 = 0; j1 < 4; j1++) {
  2122. if (((Entity) (obj)).hitsLoopCycle[j1] > loopCycle) {
  2123. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height / 2);
  2124. if (spriteDrawX > -1) {
  2125. if (j1 == 1) {
  2126. spriteDrawY -= 20;
  2127. }
  2128. if (j1 == 2) {
  2129. spriteDrawX -= 15;
  2130. spriteDrawY -= 10;
  2131. }
  2132. if (j1 == 3) {
  2133. spriteDrawX += 15;
  2134. spriteDrawY -= 10;
  2135. }
  2136. hitMarks[((Entity) (obj)).hitMarkTypes[j1]].drawSprite(spriteDrawX - 12, spriteDrawY - 12);
  2137. smallText.drawText(0, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 4, spriteDrawX);
  2138. smallText.drawText(0xffffff, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 3, spriteDrawX - 1);
  2139. }
  2140. }
  2141. }
  2142. }
  2143. }
  2144. for (int k = 0; k < anInt974; k++) {
  2145. int k1 = anIntArray976[k];
  2146. int l1 = anIntArray977[k];
  2147. int j2 = anIntArray979[k];
  2148. int k2 = anIntArray978[k];
  2149. boolean flag = true;
  2150. while (flag) {
  2151. flag = false;
  2152. for (int l2 = 0; l2 < k; l2++)
  2153. 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) {
  2154. l1 = anIntArray977[l2] - anIntArray978[l2];
  2155. flag = true;
  2156. }
  2157.  
  2158. }
  2159. spriteDrawX = anIntArray976[k];
  2160. spriteDrawY = anIntArray977[k] = l1;
  2161. String s = aStringArray983[k];
  2162. if (anInt1249 == 0) {
  2163. int i3 = 0xffff00;
  2164. if (anIntArray980[k] < 6)
  2165. i3 = anIntArray965[anIntArray980[k]];
  2166. if (anIntArray980[k] == 6)
  2167. i3 = anInt1265 % 20 >= 10 ? 0xffff00 : 0xff0000;
  2168. if (anIntArray980[k] == 7)
  2169. i3 = anInt1265 % 20 >= 10 ? 65535 : 255;
  2170. if (anIntArray980[k] == 8)
  2171. i3 = anInt1265 % 20 >= 10 ? 0x80ff80 : 45056;
  2172. if (anIntArray980[k] == 9) {
  2173. int j3 = 150 - anIntArray982[k];
  2174. if (j3 < 50)
  2175. i3 = 0xff0000 + 1280 * j3;
  2176. else if (j3 < 100)
  2177. i3 = 0xffff00 - 0x50000 * (j3 - 50);
  2178. else if (j3 < 150)
  2179. i3 = 65280 + 5 * (j3 - 100);
  2180. }
  2181. if (anIntArray980[k] == 10) {
  2182. int k3 = 150 - anIntArray982[k];
  2183. if (k3 < 50)
  2184. i3 = 0xff0000 + 5 * k3;
  2185. else if (k3 < 100)
  2186. i3 = 0xff00ff - 0x50000 * (k3 - 50);
  2187. else if (k3 < 150)
  2188. i3 = (255 + 0x50000 * (k3 - 100)) - 5 * (k3 - 100);
  2189. }
  2190. if (anIntArray980[k] == 11) {
  2191. int l3 = 150 - anIntArray982[k];
  2192. if (l3 < 50)
  2193. i3 = 0xffffff - 0x50005 * l3;
  2194. else if (l3 < 100)
  2195. i3 = 65280 + 0x50005 * (l3 - 50);
  2196. else if (l3 < 150)
  2197. i3 = 0xffffff - 0x50000 * (l3 - 100);
  2198. }
  2199. if (anIntArray981[k] == 0) {
  2200. boldText.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  2201. boldText.drawText(i3, s, spriteDrawY, spriteDrawX);
  2202. }
  2203. if (anIntArray981[k] == 1) {
  2204. boldText.method386(0, s, spriteDrawX, anInt1265, spriteDrawY + 1);
  2205. boldText.method386(i3, s, spriteDrawX, anInt1265, spriteDrawY);
  2206. }
  2207. if (anIntArray981[k] == 2) {
  2208. boldText.method387(spriteDrawX, s, anInt1265, spriteDrawY + 1, 0);
  2209. boldText.method387(spriteDrawX, s, anInt1265, spriteDrawY, i3);
  2210. }
  2211. if (anIntArray981[k] == 3) {
  2212. boldText.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY + 1, spriteDrawX, 0);
  2213. boldText.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY, spriteDrawX, i3);
  2214. }
  2215. if (anIntArray981[k] == 4) {
  2216. int i4 = boldText.method384(s);
  2217. int k4 = ((150 - anIntArray982[k]) * (i4 + 100)) / 150;
  2218. DrawingArea.setDrawingArea(334, spriteDrawX - 50, spriteDrawX + 50, 0);
  2219. boldText.method385(0, s, spriteDrawY + 1, (spriteDrawX + 50) - k4);
  2220. boldText.method385(i3, s, spriteDrawY, (spriteDrawX + 50) - k4);
  2221. DrawingArea.defaultDrawingAreaSize();
  2222. }
  2223. if (anIntArray981[k] == 5) {
  2224. int j4 = 150 - anIntArray982[k];
  2225. int l4 = 0;
  2226. if (j4 < 25)
  2227. l4 = j4 - 25;
  2228. else if (j4 > 125)
  2229. l4 = j4 - 125;
  2230. DrawingArea.setDrawingArea(spriteDrawY + 5, 0, 512, spriteDrawY - boldText.anInt1497 - 1);
  2231. boldText.drawText(0, s, spriteDrawY + 1 + l4, spriteDrawX);
  2232. boldText.drawText(i3, s, spriteDrawY + l4, spriteDrawX);
  2233. DrawingArea.defaultDrawingAreaSize();
  2234. }
  2235. } else {
  2236. boldText.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  2237. boldText.drawText(0xffff00, s, spriteDrawY, spriteDrawX);
  2238. }
  2239. }
  2240. } catch (Exception e) {
  2241. }
  2242. }
  2243.  
  2244. private void delFriend(long l) {
  2245. try {
  2246. if (l == 0L)
  2247. return;
  2248. for (int i = 0; i < friendsCount; i++) {
  2249. if (friendsListAsLongs[i] != l)
  2250. continue;
  2251. friendsCount--;
  2252. for (int j = i; j < friendsCount; j++) {
  2253. friendsList[j] = friendsList[j + 1];
  2254. friendsNodeIDs[j] = friendsNodeIDs[j + 1];
  2255. friendsListAsLongs[j] = friendsListAsLongs[j + 1];
  2256. }
  2257.  
  2258. stream.createFrame(215);
  2259. stream.writeQWord(l);
  2260. break;
  2261. }
  2262. } catch (RuntimeException runtimeexception) {
  2263. Signlink.reporterror("18622, " + false + ", " + l + ", " + runtimeexception.toString());
  2264. throw new RuntimeException();
  2265. }
  2266. }
  2267.  
  2268. 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 };
  2269.  
  2270. public void drawSideIcons() {
  2271. int xOffset = frameMode == ScreenMode.FIXED ? 0 : frameWidth - 247;
  2272. int yOffset = frameMode == ScreenMode.FIXED ? 0 : frameHeight - 336;
  2273. if (frameMode == ScreenMode.FIXED || frameMode != ScreenMode.FIXED && !changeTabArea) {
  2274. cacheSprite[370].drawSprite(sideIconsX[8] + xOffset + 168, sideIconsY[7] + yOffset);
  2275. for (int i = 0; i < sideIconsTab.length; i++) {
  2276. if (tabInterfaceIDs[sideIconsTab[i]] != -1) {
  2277. if (sideIconsId[i] != -1) {
  2278. sideIcons[sideIconsId[i]].drawSprite(sideIconsX[i] + xOffset, sideIconsY[i] + yOffset);
  2279. }
  2280. }
  2281. }
  2282. } else if (changeTabArea && frameWidth < 1000) {
  2283. int[] iconId = { 0, 1, 2, 3, 4, 5, 6, 15, 8, 9, 7, 11, 12, -1 };
  2284. int[] iconX = { 219, 189, 156, 126, 93, 62, 30, 219, 189, 156, 124, 92, 59, 28 };
  2285. int[] iconY = { 67, 69, 67, 69, 72, 72, 69, 28, 29, 29, 32, 30, 33, 31, 32 };
  2286. cacheSprite[370].drawSprite(frameWidth - 29, frameHeight - 29);
  2287. for (int i = 0; i < sideIconsTab.length; i++) {
  2288. if (tabInterfaceIDs[sideIconsTab[i]] != -1) {
  2289. if (iconId[i] != -1) {
  2290. sideIcons[iconId[i]].drawSprite(frameWidth - iconX[i], frameHeight - iconY[i]);
  2291. }
  2292. }
  2293. }
  2294. } else if (changeTabArea && frameWidth >= 1000) {
  2295. int[] iconId = { 0, 1, 2, 3, 4, 5, 6, 15, 8, 9, 7, 11, 12, -1 };
  2296. int[] iconX = { 19, 50, 82, 111, 144, 176, 208, 242, 273, 306, 338, 370, 404, 433 };
  2297. int[] iconY = { 30, 32, 30, 32, 34, 34, 32, 28, 29, 29, 32, 31, 32, 32, 32 };
  2298. cacheSprite[370].drawSprite(frameWidth - 27, frameHeight - 29);
  2299. for (int i = 0; i < sideIconsTab.length; i++) {
  2300. if (tabInterfaceIDs[sideIconsTab[i]] != -1) {
  2301. if (iconId[i] != -1) {
  2302. sideIcons[iconId[i]].drawSprite(frameWidth - 461 + iconX[i], frameHeight - iconY[i]);
  2303. }
  2304. }
  2305. }
  2306. }
  2307. }
  2308.  
  2309. 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 };
  2310.  
  2311. private void drawRedStones() {
  2312. int xOffset = frameMode == ScreenMode.FIXED ? 0 : frameWidth - 247;
  2313. int yOffset = frameMode == ScreenMode.FIXED ? 0 : frameHeight - 336;
  2314. if (frameMode == ScreenMode.FIXED || frameMode != ScreenMode.FIXED && !changeTabArea) {
  2315. if (tabInterfaceIDs[tabID] != -1 && tabID != 14) {
  2316. redStones[redStonesId[tabID]].drawSprite(redStonesX[tabID] + xOffset, redStonesY[tabID] + yOffset);
  2317. }
  2318. } else if (changeTabArea && frameWidth < 1000) {
  2319. int[] stoneX = { 226, 194, 162, 130, 99, 65, 34, 219, 195, 161, 130, 98, 65, 33 };
  2320. int[] stoneY = { 73, 73, 73, 73, 73, 73, 73, -1, 37, 37, 37, 37, 37, 37, 37 };
  2321. if (tabInterfaceIDs[tabID] != -1 && tabID != 14 && showTabComponents) {
  2322. if (tabID == 7) {
  2323. redStones[4].drawSprite(frameWidth - 226, frameHeight - 37);
  2324. }
  2325. redStones[4].drawSprite(frameWidth - stoneX[tabID], frameHeight - stoneY[tabID]);
  2326. }
  2327. } else if (changeTabArea && frameWidth >= 1000) {
  2328. int[] stoneX = { 449, 417, 385, 353, 321, 289, 257, 225, 193, 161, 130, 98, 65, 33 };
  2329. if (tabInterfaceIDs[tabID] != -1 && tabID != 14 && showTabComponents) {
  2330. redStones[4].drawSprite(frameWidth - stoneX[tabID], frameHeight - 37);
  2331. }
  2332. }
  2333. }
  2334.  
  2335. private void drawTabArea() {
  2336. final int xOffset = frameMode == ScreenMode.FIXED ? 0 : frameWidth - 241;
  2337. final int yOffset = frameMode == ScreenMode.FIXED ? 0 : frameHeight - 336;
  2338. if (frameMode == ScreenMode.FIXED) {
  2339. aRSImageProducer_1163.initDrawingArea();
  2340. }
  2341. Rasterizer.anIntArray1472 = anIntArray1181;
  2342. if (frameMode == ScreenMode.FIXED) {
  2343. fixedGameComponents[1].drawSprite(0, 0);
  2344. } else if (frameMode != ScreenMode.FIXED && !changeTabArea) {
  2345. DrawingArea.method335(0x3E3529, frameHeight - 304, 195, 270, transparentTabArea ? 80 : 256, frameWidth - 217);
  2346. gameComponents[2].drawSprite(xOffset, yOffset);
  2347. } else {
  2348. if (frameWidth >= 1000) {
  2349. if (showTabComponents) {
  2350. DrawingArea.method335(0x3E3529, frameHeight - 304, 197, 265, transparentTabArea ? 80 : 256, frameWidth - 197);
  2351. gameComponents[4].drawSprite(frameWidth - 204, frameHeight - 311);
  2352. }
  2353. for (int x = frameWidth - 449, y = frameHeight - 37, index = 0; x <= frameWidth - 30 && index < 14; x += 32, index++) {
  2354. redStones[5].drawSprite(x, y);
  2355. }
  2356. } else if (frameWidth < 1000) {
  2357. if (showTabComponents) {
  2358. DrawingArea.method335(0x3E3529, frameHeight - 341, 195, 265, transparentTabArea ? 80 : 256, frameWidth - 197);
  2359. gameComponents[4].drawSprite(frameWidth - 204, frameHeight - 348);
  2360. }
  2361. for (int x = frameWidth - 226, y = frameHeight - 73, index = 0; x <= frameWidth - 32 && index < 7; x += 32, index++) {
  2362. redStones[5].drawSprite(x, y);
  2363. }
  2364. for (int x = frameWidth - 226, y = frameHeight - 37, index = 0; x <= frameWidth - 32 && index < 7; x += 32, index++) {
  2365. redStones[5].drawSprite(x, y);
  2366. }
  2367. }
  2368. }
  2369. if (invOverlayInterfaceID == -1) {
  2370. drawRedStones();
  2371. drawSideIcons();
  2372. }
  2373. if (showTabComponents) {
  2374. int x = frameMode == ScreenMode.FIXED ? 31 : frameWidth - 215;
  2375. int y = frameMode == ScreenMode.FIXED ? 37 : frameHeight - 299;
  2376. if (changeTabArea) {
  2377. x = frameWidth - 197;
  2378. y = frameWidth >= 1000 ? frameHeight - 303 : frameHeight - 340;
  2379. }
  2380. if (invOverlayInterfaceID != -1) {
  2381. drawInterface(0, x, RSInterface.interfaceCache[invOverlayInterfaceID], y);
  2382. } else if (tabInterfaceIDs[tabID] != -1) {
  2383. drawInterface(0, x, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], y);
  2384. }
  2385. }
  2386. if (menuOpen) {
  2387. drawMenu(frameMode == ScreenMode.FIXED ? 516 : 0, frameMode == ScreenMode.FIXED ? 168 : 0);
  2388. }
  2389. if (frameMode == ScreenMode.FIXED) {
  2390. aRSImageProducer_1163.drawGraphics(168, super.graphics, 516);
  2391. aRSImageProducer_1165.initDrawingArea();
  2392. }
  2393. Rasterizer.anIntArray1472 = anIntArray1182;
  2394. }
  2395.  
  2396. private void method37(int j) {
  2397. if (Configuration.enableMovingTextures) {
  2398. if (Rasterizer.anIntArray1480[17] >= j) {
  2399. Background background = Rasterizer.aBackgroundArray1474s[17];
  2400. int k = background.anInt1452 * background.anInt1453 - 1;
  2401. int j1 = background.anInt1452 * anInt945 * 2;
  2402. byte abyte0[] = background.aByteArray1450;
  2403. byte abyte3[] = aByteArray912;
  2404. for (int i2 = 0; i2 <= k; i2++)
  2405. abyte3[i2] = abyte0[i2 - j1 & k];
  2406.  
  2407. background.aByteArray1450 = abyte3;
  2408. aByteArray912 = abyte0;
  2409. Rasterizer.method370(17);
  2410. anInt854++;
  2411. if (anInt854 > 1235) {
  2412. anInt854 = 0;
  2413. stream.createFrame(226);
  2414. stream.writeWordBigEndian(0);
  2415. int l2 = stream.currentOffset;
  2416. stream.writeWord(58722);
  2417. stream.writeWordBigEndian(240);
  2418. stream.writeWord((int) (Math.random() * 65536D));
  2419. stream.writeWordBigEndian((int) (Math.random() * 256D));
  2420. if ((int) (Math.random() * 2D) == 0)
  2421. stream.writeWord(51825);
  2422. stream.writeWordBigEndian((int) (Math.random() * 256D));
  2423. stream.writeWord((int) (Math.random() * 65536D));
  2424. stream.writeWord(7130);
  2425. stream.writeWord((int) (Math.random() * 65536D));
  2426. stream.writeWord(61657);
  2427. stream.writeBytes(stream.currentOffset - l2);
  2428. }
  2429. }
  2430. if (Rasterizer.anIntArray1480[24] >= j) {
  2431. Background background_1 = Rasterizer.aBackgroundArray1474s[24];
  2432. int l = background_1.anInt1452 * background_1.anInt1453 - 1;
  2433. int k1 = background_1.anInt1452 * anInt945 * 2;
  2434. byte abyte1[] = background_1.aByteArray1450;
  2435. byte abyte4[] = aByteArray912;
  2436. for (int j2 = 0; j2 <= l; j2++)
  2437. abyte4[j2] = abyte1[j2 - k1 & l];
  2438.  
  2439. background_1.aByteArray1450 = abyte4;
  2440. aByteArray912 = abyte1;
  2441. Rasterizer.method370(24);
  2442. }
  2443. if (Rasterizer.anIntArray1480[34] >= j) {
  2444. Background background_2 = Rasterizer.aBackgroundArray1474s[34];
  2445. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  2446. int l1 = background_2.anInt1452 * anInt945 * 2;
  2447. byte abyte2[] = background_2.aByteArray1450;
  2448. byte abyte5[] = aByteArray912;
  2449. for (int k2 = 0; k2 <= i1; k2++)
  2450. abyte5[k2] = abyte2[k2 - l1 & i1];
  2451.  
  2452. background_2.aByteArray1450 = abyte5;
  2453. aByteArray912 = abyte2;
  2454. Rasterizer.method370(34);
  2455. }
  2456. if (Rasterizer.anIntArray1480[40] >= j) {
  2457. Background background_2 = Rasterizer.aBackgroundArray1474s[40];
  2458. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  2459. int l1 = background_2.anInt1452 * anInt945 * 2;
  2460. byte abyte2[] = background_2.aByteArray1450;
  2461. byte abyte5[] = aByteArray912;
  2462. for (int k2 = 0; k2 <= i1; k2++)
  2463. abyte5[k2] = abyte2[k2 - l1 & i1];
  2464.  
  2465. background_2.aByteArray1450 = abyte5;
  2466. aByteArray912 = abyte2;
  2467. Rasterizer.method370(40);
  2468. }
  2469. }
  2470. }
  2471.  
  2472. private void method38() {
  2473. for (int i = -1; i < playerCount; i++) {
  2474. int j;
  2475. if (i == -1)
  2476. j = myPlayerIndex;
  2477. else
  2478. j = playerIndices[i];
  2479. Player player = playerArray[j];
  2480. if (player != null && player.textCycle > 0) {
  2481. player.textCycle--;
  2482. if (player.textCycle == 0)
  2483. player.textSpoken = null;
  2484. }
  2485. }
  2486. for (int k = 0; k < npcCount; k++) {
  2487. int l = npcIndices[k];
  2488. Npc npc = npcArray[l];
  2489. if (npc != null && npc.textCycle > 0) {
  2490. npc.textCycle--;
  2491. if (npc.textCycle == 0)
  2492. npc.textSpoken = null;
  2493. }
  2494. }
  2495. }
  2496.  
  2497. private void calcCameraPos() {
  2498. int i = anInt1098 * 128 + 64;
  2499. int j = anInt1099 * 128 + 64;
  2500. int k = method42(plane, j, i) - anInt1100;
  2501. if (xCameraPos < i) {
  2502. xCameraPos += anInt1101 + ((i - xCameraPos) * anInt1102) / 1000;
  2503. if (xCameraPos > i)
  2504. xCameraPos = i;
  2505. }
  2506. if (xCameraPos > i) {
  2507. xCameraPos -= anInt1101 + ((xCameraPos - i) * anInt1102) / 1000;
  2508. if (xCameraPos < i)
  2509. xCameraPos = i;
  2510. }
  2511. if (zCameraPos < k) {
  2512. zCameraPos += anInt1101 + ((k - zCameraPos) * anInt1102) / 1000;
  2513. if (zCameraPos > k)
  2514. zCameraPos = k;
  2515. }
  2516. if (zCameraPos > k) {
  2517. zCameraPos -= anInt1101 + ((zCameraPos - k) * anInt1102) / 1000;
  2518. if (zCameraPos < k)
  2519. zCameraPos = k;
  2520. }
  2521. if (yCameraPos < j) {
  2522. yCameraPos += anInt1101 + ((j - yCameraPos) * anInt1102) / 1000;
  2523. if (yCameraPos > j)
  2524. yCameraPos = j;
  2525. }
  2526. if (yCameraPos > j) {
  2527. yCameraPos -= anInt1101 + ((yCameraPos - j) * anInt1102) / 1000;
  2528. if (yCameraPos < j)
  2529. yCameraPos = j;
  2530. }
  2531. i = anInt995 * 128 + 64;
  2532. j = anInt996 * 128 + 64;
  2533. k = method42(plane, j, i) - anInt997;
  2534. int l = i - xCameraPos;
  2535. int i1 = k - zCameraPos;
  2536. int j1 = j - yCameraPos;
  2537. int k1 = (int) Math.sqrt(l * l + j1 * j1);
  2538. int l1 = (int) (Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  2539. int i2 = (int) (Math.atan2(l, j1) * -325.94900000000001D) & 0x7ff;
  2540. if (l1 < 128)
  2541. l1 = 128;
  2542. if (l1 > 383)
  2543. l1 = 383;
  2544. if (yCameraCurve < l1) {
  2545. yCameraCurve += anInt998 + ((l1 - yCameraCurve) * anInt999) / 1000;
  2546. if (yCameraCurve > l1)
  2547. yCameraCurve = l1;
  2548. }
  2549. if (yCameraCurve > l1) {
  2550. yCameraCurve -= anInt998 + ((yCameraCurve - l1) * anInt999) / 1000;
  2551. if (yCameraCurve < l1)
  2552. yCameraCurve = l1;
  2553. }
  2554. int j2 = i2 - xCameraCurve;
  2555. if (j2 > 1024)
  2556. j2 -= 2048;
  2557. if (j2 < -1024)
  2558. j2 += 2048;
  2559. if (j2 > 0) {
  2560. xCameraCurve += anInt998 + (j2 * anInt999) / 1000;
  2561. xCameraCurve &= 0x7ff;
  2562. }
  2563. if (j2 < 0) {
  2564. xCameraCurve -= anInt998 + (-j2 * anInt999) / 1000;
  2565. xCameraCurve &= 0x7ff;
  2566. }
  2567. int k2 = i2 - xCameraCurve;
  2568. if (k2 > 1024)
  2569. k2 -= 2048;
  2570. if (k2 < -1024)
  2571. k2 += 2048;
  2572. if (k2 < 0 && j2 > 0 || k2 > 0 && j2 < 0)
  2573. xCameraCurve = i2;
  2574. }
  2575.  
  2576. private void drawMenu(int xOffSet, int yOffSet) {
  2577. int xPos = menuOffsetX - (xOffSet - 4);
  2578. int yPos = (-yOffSet + 4) + menuOffsetY;
  2579. int menuW = menuWidth;
  2580. int menuH = menuHeight + 1;
  2581. inputTaken = true;
  2582. tabAreaAltered = true;
  2583. if (!Configuration.enableNewMenus) {
  2584. int menuColor = 0x5d5447;
  2585. DrawingArea.drawPixels(menuH, yPos, xPos, menuColor, menuW);
  2586. DrawingArea.drawPixels(16, yPos + 1, xPos + 1, 0, menuW - 2);
  2587. DrawingArea.fillPixels(xPos + 1, menuW - 2, menuH - 19, 0, yPos + 18);
  2588. newBoldFont.drawBasicString("Choose Option", xPos + 3, yPos + 14, menuColor, 1);
  2589. int mouseX = super.mouseX - (xOffSet);
  2590. int mouseY = (-yOffSet) + super.mouseY;
  2591. for (int i = 0; i < menuActionRow; i++) {
  2592. int textY = yPos + 31 + (menuActionRow - 1 - i) * 15;
  2593. int textColor = 0xffffff;
  2594. if (mouseX > xPos && mouseX < xPos + menuW && mouseY > textY - 13 && mouseY < textY + 3) {
  2595. DrawingArea.drawPixels(15, textY - 11, xPos + 3, 0x6f695d, menuWidth - 6);
  2596. textColor = 0xffff00;
  2597. }
  2598. newBoldFont.drawBasicString(menuActionName[i], xPos + 3, textY, textColor, 1);
  2599. }
  2600. } else {
  2601. DrawingArea.drawPixels(menuH - 4, yPos + 2, xPos, 0x706a5e, menuW);
  2602. DrawingArea.drawPixels(menuH - 2, yPos + 1, xPos + 1, 0x706a5e, menuW - 2);
  2603. DrawingArea.drawPixels(menuH, yPos, xPos + 2, 0x706a5e, menuW - 4);
  2604. DrawingArea.drawPixels(menuH - 2, yPos + 1, xPos + 3, 0x2d2822, menuW - 6);
  2605. DrawingArea.drawPixels(menuH - 4, yPos + 2, xPos + 2, 0x2d2822, menuW - 4);
  2606. DrawingArea.drawPixels(menuH - 6, yPos + 3, xPos + 1, 0x2d2822, menuW - 2);
  2607. DrawingArea.drawPixels(menuH - 22, yPos + 19, xPos + 2, 0x524a3d, menuW - 4);
  2608. DrawingArea.drawPixels(menuH - 22, yPos + 20, xPos + 3, 0x524a3d, menuW - 6);
  2609. DrawingArea.drawPixels(menuH - 23, yPos + 20, xPos + 3, 0x2b271c, menuW - 6);
  2610. DrawingArea.fillPixels(xPos + 3, menuW - 6, 1, 0x2a291b, yPos + 2);
  2611. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x2a261b, yPos + 3);
  2612. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x252116, yPos + 4);
  2613. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x211e15, yPos + 5);
  2614. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x1e1b12, yPos + 6);
  2615. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x1a170e, yPos + 7);
  2616. DrawingArea.fillPixels(xPos + 2, menuW - 4, 2, 0x15120b, yPos + 8);
  2617. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x100d08, yPos + 10);
  2618. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 11);
  2619. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x080703, yPos + 12);
  2620. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 13);
  2621. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x070802, yPos + 14);
  2622. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 15);
  2623. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x070802, yPos + 16);
  2624. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 17);
  2625. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x2a291b, yPos + 18);
  2626. DrawingArea.fillPixels(xPos + 3, menuW - 6, 1, 0x564943, yPos + 19);
  2627. newBoldFont.drawBasicString("Choose Option", xPos + 3, yPos + 14, 0xc6b895, 1);
  2628. }
  2629. int mouseX = super.mouseX - (xOffSet);
  2630. int mouseY = (-yOffSet) + super.mouseY;
  2631. for (int l1 = 0; l1 < menuActionRow; l1++) {
  2632. int textY = yPos + 31 + (menuActionRow - 1 - l1) * 15;
  2633. int disColor = 0xc6b895;
  2634. if (mouseX > xPos && mouseX < xPos + menuW && mouseY > textY - 13 && mouseY < textY + 3) {
  2635. DrawingArea.drawPixels(15, textY - 11, xPos + 3, 0x6f695d, menuWidth - 6);
  2636. disColor = 0xeee5c6;
  2637. }
  2638. newBoldFont.drawBasicString(menuActionName[l1], xPos + 3, textY, disColor, 1);
  2639. }
  2640. }
  2641.  
  2642. private void addFriend(long l) {
  2643. try {
  2644. if (l == 0L)
  2645. return;
  2646. if (friendsCount >= 100 && anInt1046 != 1) {
  2647. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  2648. return;
  2649. }
  2650. if (friendsCount >= 200) {
  2651. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  2652. return;
  2653. }
  2654. String s = TextClass.fixName(TextClass.nameForLong(l));
  2655. for (int i = 0; i < friendsCount; i++)
  2656. if (friendsListAsLongs[i] == l) {
  2657. pushMessage(s + " is already on your friend list", 0, "");
  2658. return;
  2659. }
  2660. for (int j = 0; j < ignoreCount; j++)
  2661. if (ignoreListAsLongs[j] == l) {
  2662. pushMessage("Please remove " + s + " from your ignore list first", 0, "");
  2663. return;
  2664. }
  2665.  
  2666. if (s.equals(myPlayer.name)) {
  2667. pushMessage("You may not add yourself!", 0, "");
  2668. return;
  2669. } else {
  2670. friendsList[friendsCount] = s;
  2671. friendsListAsLongs[friendsCount] = l;
  2672. friendsNodeIDs[friendsCount] = 0;
  2673. friendsCount++;
  2674. stream.createFrame(188);
  2675. stream.writeQWord(l);
  2676. return;
  2677. }
  2678. } catch (RuntimeException runtimeexception) {
  2679. Signlink.reporterror("15283, " + (byte) 68 + ", " + l + ", " + runtimeexception.toString());
  2680. }
  2681. throw new RuntimeException();
  2682. }
  2683.  
  2684. private int method42(int i, int j, int k) {
  2685. int l = k >> 7;
  2686. int i1 = j >> 7;
  2687. if (l < 0 || i1 < 0 || l > 103 || i1 > 103)
  2688. return 0;
  2689. int j1 = i;
  2690. if (j1 < 3 && (byteGroundArray[1][l][i1] & 2) == 2)
  2691. j1++;
  2692. int k1 = k & 0x7f;
  2693. int l1 = j & 0x7f;
  2694. int i2 = intGroundArray[j1][l][i1] * (128 - k1) + intGroundArray[j1][l + 1][i1] * k1 >> 7;
  2695. int j2 = intGroundArray[j1][l][i1 + 1] * (128 - k1) + intGroundArray[j1][l + 1][i1 + 1] * k1 >> 7;
  2696. return i2 * (128 - l1) + j2 * l1 >> 7;
  2697. }
  2698.  
  2699. private static String intToKOrMil(int j) {
  2700. if (j < 0x186a0)
  2701. return String.valueOf(j);
  2702. if (j < 0x989680)
  2703. return j / 1000 + "K";
  2704. else
  2705. return j / 0xf4240 + "M";
  2706. }
  2707.  
  2708. public void resetLogout() {
  2709. try {
  2710. if (socketStream != null)
  2711. socketStream.close();
  2712. } catch (Exception _ex) {
  2713. }
  2714. if (rememberMe) {
  2715. AccountManager.saveAccount();
  2716. }
  2717. setBounds();
  2718. socketStream = null;
  2719. loggedIn = false;
  2720. loginScreenState = 0;
  2721. loginMessage1 = "Welcome to Vencillo";
  2722. loginMessage2 = "Enter in your account details and begin playing!";
  2723. if (!rememberMe) {
  2724. myUsername = "";
  2725. myPassword = "";
  2726. }
  2727. unlinkMRUNodes();
  2728. worldController.initToNull();
  2729. for (int i = 0; i < 4; i++)
  2730. aClass11Array1230[i].method210();
  2731. System.gc();
  2732. stopMidi();
  2733. currentSong = -1;
  2734. nextSong = -1;
  2735. prevSong = 0;
  2736. SettingHandler.save();
  2737. console.openConsole = false;
  2738. }
  2739.  
  2740. private void method45() {
  2741. aBoolean1031 = true;
  2742. for (int j = 0; j < 7; j++) {
  2743. anIntArray1065[j] = -1;
  2744. for (int k = 0; k < IdentityKit.length; k++) {
  2745. if (IdentityKit.cache[k].aBoolean662 || IdentityKit.cache[k].anInt657 != j + (aBoolean1047 ? 0 : 7))
  2746. continue;
  2747. anIntArray1065[j] = k;
  2748. break;
  2749. }
  2750. }
  2751. }
  2752.  
  2753. private void method46(int i, Stream stream) {
  2754. while (stream.bitPosition + 21 < i * 8) {
  2755. int k = stream.readBits(14);
  2756. if (k == 16383)
  2757. break;
  2758. if (npcArray[k] == null)
  2759. npcArray[k] = new Npc();
  2760. Npc npc = npcArray[k];
  2761. npcIndices[npcCount++] = k;
  2762. npc.anInt1537 = loopCycle;
  2763. int l = stream.readBits(5);
  2764. if (l > 15)
  2765. l -= 32;
  2766. int i1 = stream.readBits(5);
  2767. if (i1 > 15)
  2768. i1 -= 32;
  2769. int j1 = stream.readBits(1);
  2770. npc.desc = EntityDef.forID(stream.readBits(npcBits));
  2771. int k1 = stream.readBits(1);
  2772. if (k1 == 1)
  2773. anIntArray894[anInt893++] = k;
  2774. npc.anInt1540 = npc.desc.aByte68;
  2775. npc.anInt1504 = npc.desc.anInt79;
  2776. npc.anInt1554 = npc.desc.walkAnim;
  2777. npc.anInt1555 = npc.desc.anInt58;
  2778. npc.anInt1556 = npc.desc.anInt83;
  2779. npc.anInt1557 = npc.desc.anInt55;
  2780. npc.anInt1511 = npc.desc.standAnim;
  2781. npc.setPos(myPlayer.smallX[0] + i1, myPlayer.smallY[0] + l, j1 == 1);
  2782. }
  2783. stream.finishBitAccess();
  2784. }
  2785.  
  2786. public void processGameLoop() {
  2787. if (rsAlreadyLoaded || loadingError || genericLoadingError)
  2788. return;
  2789. loopCycle++;
  2790. if (!loggedIn)
  2791. loginRenderer.processLoginScreen();
  2792. else
  2793. mainGameProcessor();
  2794. processOnDemandQueue();
  2795. }
  2796.  
  2797. private void method47(boolean flag) {
  2798. if (myPlayer.x >> 7 == destX && myPlayer.y >> 7 == destY) {
  2799. destX = 0;
  2800. }
  2801. int j = playerCount;
  2802. if (flag) {
  2803. j = 1;
  2804. }
  2805. for (int l = 0; l < j; l++) {
  2806. Player player;
  2807. int i1;
  2808. if (flag) {
  2809. player = myPlayer;
  2810. i1 = myPlayerIndex << 14;
  2811. } else {
  2812. player = playerArray[playerIndices[l]];
  2813. i1 = playerIndices[l] << 14;
  2814. }
  2815. if (player == null || !player.isVisible()) {
  2816. continue;
  2817. }
  2818. player.aBoolean1699 = (lowMem && playerCount > 50 || playerCount > 200) && !flag && player.anInt1517 == player.anInt1511;
  2819. int j1 = player.x >> 7;
  2820. int k1 = player.y >> 7;
  2821. if (j1 < 0 || j1 >= 104 || k1 < 0 || k1 >= 104) {
  2822. continue;
  2823. }
  2824. if (player.aModel_1714 != null && loopCycle >= player.anInt1707 && loopCycle < player.anInt1708) {
  2825. player.aBoolean1699 = false;
  2826. player.anInt1709 = method42(plane, player.y, player.x);
  2827. worldController.method286(plane, player.y, player, player.anInt1552, player.anInt1722, player.x, player.anInt1709, player.anInt1719, player.anInt1721, i1, player.anInt1720);
  2828. continue;
  2829. }
  2830. if ((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  2831. if (anIntArrayArray929[j1][k1] == anInt1265) {
  2832. continue;
  2833. }
  2834. anIntArrayArray929[j1][k1] = anInt1265;
  2835. }
  2836. player.anInt1709 = method42(plane, player.y, player.x);
  2837. worldController.method285(plane, player.anInt1552, player.anInt1709, i1, player.y, 60, player.x, player, player.aBoolean1541);
  2838. }
  2839. }
  2840.  
  2841. private boolean promptUserForInput(RSInterface class9) {
  2842. int j = class9.contentType;
  2843. System.out.println(anInt900);
  2844. if (anInt900 == 2) {
  2845. if (j == 51504) {
  2846. inputTaken = true;
  2847. inputDialogState = 0;
  2848. messagePromptRaised = true;
  2849. promptInput = "";
  2850. friendsListAction = 51504;
  2851. aString1121 = "Enter the player's profile you want to view.";
  2852. }
  2853. if (j == 201) {
  2854. inputTaken = true;
  2855. inputDialogState = 0;
  2856. messagePromptRaised = true;
  2857. promptInput = "";
  2858. friendsListAction = 1;
  2859. aString1121 = "Enter name of friend to add to list";
  2860. }
  2861. if (j == 59800) {
  2862. inputTaken = true;
  2863. inputDialogState = 0;
  2864. messagePromptRaised = true;
  2865. promptInput = "";
  2866. friendsListAction = 59800;
  2867. aString1121 = "Enter the item name you are looking for";
  2868. }
  2869. if (j == 202) {
  2870. inputTaken = true;
  2871. inputDialogState = 0;
  2872. messagePromptRaised = true;
  2873. promptInput = "";
  2874. friendsListAction = 2;
  2875. aString1121 = "Enter name of friend to delete from list";
  2876. }
  2877. }
  2878. if (j == 0xBABE) {
  2879. int subShopIndex = (8 + (CustomInterfaces.shopCategories.length * 3)) - 1;
  2880. for (int index = 0, frame = 0; index < (CustomInterfaces.shopCategories.length * 3); index += 3) {
  2881. if (class9.id == (55000 + frame + 9)) {
  2882. // if ((class9.id != 55009) && (class9.id != 55237)) {
  2883. // pushMessage("Title category coming soon!", 0, "");
  2884. // return true;
  2885. // }
  2886. RSInterface.interfaceCache[55000].children[subShopIndex] = 55000 + frame + 13;
  2887. return true;
  2888. }
  2889. frame += (CustomInterfaces.shopContent[index / 3].length * 8) + 5;
  2890. }
  2891. return true;
  2892. }
  2893. if (j == 205) {
  2894. anInt1011 = 250;
  2895. return true;
  2896. }
  2897. if (j == 501) {
  2898. inputTaken = true;
  2899. inputDialogState = 0;
  2900. messagePromptRaised = true;
  2901. promptInput = "";
  2902. friendsListAction = 4;
  2903. aString1121 = "Enter name of player to add to list";
  2904. }
  2905. if (j == 502) {
  2906. inputTaken = true;
  2907. inputDialogState = 0;
  2908. messagePromptRaised = true;
  2909. promptInput = "";
  2910. friendsListAction = 5;
  2911. aString1121 = "Enter name of player to delete from list";
  2912. }
  2913. if (j == 550) {
  2914. inputTaken = true;
  2915. inputDialogState = 0;
  2916. messagePromptRaised = true;
  2917. promptInput = "";
  2918. friendsListAction = 6;
  2919. aString1121 = "Enter the name of the chat you wish to join";
  2920. }
  2921. if (j >= 300 && j <= 313) {
  2922. int k = (j - 300) / 2;
  2923. int j1 = j & 1;
  2924. int i2 = anIntArray1065[k];
  2925. if (i2 != -1) {
  2926. do {
  2927. if (j1 == 0 && --i2 < 0)
  2928. i2 = IdentityKit.length - 1;
  2929. if (j1 == 1 && ++i2 >= IdentityKit.length)
  2930. i2 = 0;
  2931. } while (IdentityKit.cache[i2].aBoolean662 || IdentityKit.cache[i2].anInt657 != k + (aBoolean1047 ? 0 : 7));
  2932. anIntArray1065[k] = i2;
  2933. aBoolean1031 = true;
  2934. }
  2935. }
  2936. if (j >= 314 && j <= 323) {
  2937. int l = (j - 314) / 2;
  2938. int k1 = j & 1;
  2939. int j2 = anIntArray990[l];
  2940. if (k1 == 0 && --j2 < 0)
  2941. j2 = anIntArrayArray1003[l].length - 1;
  2942. if (k1 == 1 && ++j2 >= anIntArrayArray1003[l].length)
  2943. j2 = 0;
  2944. anIntArray990[l] = j2;
  2945. aBoolean1031 = true;
  2946. }
  2947. if (j == 324 && !aBoolean1047) {
  2948. aBoolean1047 = true;
  2949. method45();
  2950. }
  2951. if (j == 325 && aBoolean1047) {
  2952. aBoolean1047 = false;
  2953. method45();
  2954. }
  2955. if (j == 326) {
  2956. stream.createFrame(101);
  2957. stream.writeWordBigEndian(aBoolean1047 ? 0 : 1);
  2958. for (int i1 = 0; i1 < 7; i1++)
  2959. stream.writeWordBigEndian(anIntArray1065[i1]);
  2960.  
  2961. for (int l1 = 0; l1 < 5; l1++)
  2962. stream.writeWordBigEndian(anIntArray990[l1]);
  2963.  
  2964. return true;
  2965. }
  2966. if (j == 613)
  2967. canMute = !canMute;
  2968. if (j >= 601 && j <= 612) {
  2969. clearTopInterfaces();
  2970. if (reportAbuseInput.length() > 0) {
  2971. stream.createFrame(218);
  2972. stream.writeQWord(TextClass.longForName(reportAbuseInput));
  2973. stream.writeWordBigEndian(j - 601);
  2974. stream.writeWordBigEndian(canMute ? 1 : 0);
  2975. }
  2976. }
  2977. return false;
  2978. }
  2979.  
  2980. private void method49(Stream stream) {
  2981. for (int j = 0; j < anInt893; j++) {
  2982. int k = anIntArray894[j];
  2983. Player player = playerArray[k];
  2984. int l = stream.readUnsignedByte();
  2985. if ((l & 0x40) != 0)
  2986. l += stream.readUnsignedByte() << 8;
  2987. appendPlayerUpdateMask(l, k, stream, player);
  2988. }
  2989. }
  2990.  
  2991. private void method50(int i, int k, int l, int i1, int j1) {
  2992. int k1 = worldController.method300(j1, l, i);
  2993. if (k1 != 0) {
  2994. int l1 = worldController.method304(j1, l, i, k1);
  2995. int k2 = l1 >> 6 & 3;
  2996. int i3 = l1 & 0x1f;
  2997. int k3 = k;
  2998. if (k1 > 0)
  2999. k3 = i1;
  3000. int ai[] = minimapImage.myPixels;
  3001. int k4 = 24624 + l * 4 + (103 - i) * 512 * 4;
  3002. int i5 = k1 >> 14 & 0x7fff;
  3003. ObjectDef class46_2 = ObjectDef.forID(i5);
  3004. if (class46_2.anInt758 != -1) {
  3005. Background background_2 = mapScenes[class46_2.anInt758];
  3006. if (background_2 != null) {
  3007. int i6 = (class46_2.anInt744 * 4 - background_2.anInt1452) / 2;
  3008. int j6 = (class46_2.anInt761 * 4 - background_2.anInt1453) / 2;
  3009. background_2.drawBackground(48 + l * 4 + i6, 48 + (104 - i - class46_2.anInt761) * 4 + j6);
  3010. }
  3011. } else {
  3012. if (i3 == 0 || i3 == 2)
  3013. if (k2 == 0) {
  3014. ai[k4] = k3;
  3015. ai[k4 + 512] = k3;
  3016. ai[k4 + 1024] = k3;
  3017. ai[k4 + 1536] = k3;
  3018. } else if (k2 == 1) {
  3019. ai[k4] = k3;
  3020. ai[k4 + 1] = k3;
  3021. ai[k4 + 2] = k3;
  3022. ai[k4 + 3] = k3;
  3023. } else if (k2 == 2) {
  3024. ai[k4 + 3] = k3;
  3025. ai[k4 + 3 + 512] = k3;
  3026. ai[k4 + 3 + 1024] = k3;
  3027. ai[k4 + 3 + 1536] = k3;
  3028. } else if (k2 == 3) {
  3029. ai[k4 + 1536] = k3;
  3030. ai[k4 + 1536 + 1] = k3;
  3031. ai[k4 + 1536 + 2] = k3;
  3032. ai[k4 + 1536 + 3] = k3;
  3033. }
  3034. if (i3 == 3)
  3035. if (k2 == 0)
  3036. ai[k4] = k3;
  3037. else if (k2 == 1)
  3038. ai[k4 + 3] = k3;
  3039. else if (k2 == 2)
  3040. ai[k4 + 3 + 1536] = k3;
  3041. else if (k2 == 3)
  3042. ai[k4 + 1536] = k3;
  3043. if (i3 == 2)
  3044. if (k2 == 3) {
  3045. ai[k4] = k3;
  3046. ai[k4 + 512] = k3;
  3047. ai[k4 + 1024] = k3;
  3048. ai[k4 + 1536] = k3;
  3049. } else if (k2 == 0) {
  3050. ai[k4] = k3;
  3051. ai[k4 + 1] = k3;
  3052. ai[k4 + 2] = k3;
  3053. ai[k4 + 3] = k3;
  3054. } else if (k2 == 1) {
  3055. ai[k4 + 3] = k3;
  3056. ai[k4 + 3 + 512] = k3;
  3057. ai[k4 + 3 + 1024] = k3;
  3058. ai[k4 + 3 + 1536] = k3;
  3059. } else if (k2 == 2) {
  3060. ai[k4 + 1536] = k3;
  3061. ai[k4 + 1536 + 1] = k3;
  3062. ai[k4 + 1536 + 2] = k3;
  3063. ai[k4 + 1536 + 3] = k3;
  3064. }
  3065. }
  3066. }
  3067. k1 = worldController.method302(j1, l, i);
  3068. if (k1 != 0) {
  3069. int i2 = worldController.method304(j1, l, i, k1);
  3070. int l2 = i2 >> 6 & 3;
  3071. int j3 = i2 & 0x1f;
  3072. int l3 = k1 >> 14 & 0x7fff;
  3073. ObjectDef class46_1 = ObjectDef.forID(l3);
  3074. if (class46_1.anInt758 != -1) {
  3075. Background background_1 = mapScenes[class46_1.anInt758];
  3076. if (background_1 != null) {
  3077. int j5 = (class46_1.anInt744 * 4 - background_1.anInt1452) / 2;
  3078. int k5 = (class46_1.anInt761 * 4 - background_1.anInt1453) / 2;
  3079. background_1.drawBackground(48 + l * 4 + j5, 48 + (104 - i - class46_1.anInt761) * 4 + k5);
  3080. }
  3081. } else if (j3 == 9) {
  3082. int l4 = 0xeeeeee;
  3083. if (k1 > 0)
  3084. l4 = 0xee0000;
  3085. int ai1[] = minimapImage.myPixels;
  3086. int l5 = 24624 + l * 4 + (103 - i) * 512 * 4;
  3087. if (l2 == 0 || l2 == 2) {
  3088. ai1[l5 + 1536] = l4;
  3089. ai1[l5 + 1024 + 1] = l4;
  3090. ai1[l5 + 512 + 2] = l4;
  3091. ai1[l5 + 3] = l4;
  3092. } else {
  3093. ai1[l5] = l4;
  3094. ai1[l5 + 512 + 1] = l4;
  3095. ai1[l5 + 1024 + 2] = l4;
  3096. ai1[l5 + 1536 + 3] = l4;
  3097. }
  3098. }
  3099. }
  3100. k1 = worldController.method303(j1, l, i);
  3101. if (k1 != 0) {
  3102. int j2 = k1 >> 14 & 0x7fff;
  3103. ObjectDef class46 = ObjectDef.forID(j2);
  3104. if (class46.anInt758 != -1) {
  3105. Background background = mapScenes[class46.anInt758];
  3106. if (background != null) {
  3107. int i4 = (class46.anInt744 * 4 - background.anInt1452) / 2;
  3108. int j4 = (class46.anInt761 * 4 - background.anInt1453) / 2;
  3109. background.drawBackground(48 + l * 4 + i4, 48 + (104 - i - class46.anInt761) * 4 + j4);
  3110. }
  3111. }
  3112. }
  3113. }
  3114.  
  3115. private void loadTitleScreen() {
  3116. aBackground_966 = new Background(titleStreamLoader, "titlebox", 0);
  3117. aBackground_967 = new Background(titleStreamLoader, "titlebutton", 0);
  3118. aBackgroundArray1152s = new Background[12];
  3119. int j = 0;
  3120. try {
  3121. j = Integer.parseInt(getParameter("fl_icon"));
  3122. } catch (Exception _ex) {
  3123. }
  3124. if (j == 0) {
  3125. for (int k = 0; k < 12; k++)
  3126. aBackgroundArray1152s[k] = new Background(titleStreamLoader, "runes", k);
  3127.  
  3128. } else {
  3129. for (int l = 0; l < 12; l++)
  3130. aBackgroundArray1152s[l] = new Background(titleStreamLoader, "runes", 12 + (l & 3));
  3131.  
  3132. }
  3133. aClass30_Sub2_Sub1_Sub1_1201 = new Sprite(128, 265);
  3134. aClass30_Sub2_Sub1_Sub1_1202 = new Sprite(128, 265);
  3135. System.arraycopy(aRSImageProducer_1110.canvasRaster, 0, aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, 33920);
  3136.  
  3137. System.arraycopy(aRSImageProducer_1111.canvasRaster, 0, aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, 33920);
  3138.  
  3139. anIntArray851 = new int[256];
  3140. for (int k1 = 0; k1 < 64; k1++)
  3141. anIntArray851[k1] = k1 * 0x40000;
  3142.  
  3143. for (int l1 = 0; l1 < 64; l1++)
  3144. anIntArray851[l1 + 64] = 0xff0000 + 1024 * l1;
  3145.  
  3146. for (int i2 = 0; i2 < 64; i2++)
  3147. anIntArray851[i2 + 128] = 0xffff00 + 4 * i2;
  3148.  
  3149. for (int j2 = 0; j2 < 64; j2++)
  3150. anIntArray851[j2 + 192] = 0xffffff;
  3151.  
  3152. anIntArray852 = new int[256];
  3153. for (int k2 = 0; k2 < 64; k2++)
  3154. anIntArray852[k2] = k2 * 1024;
  3155.  
  3156. for (int l2 = 0; l2 < 64; l2++)
  3157. anIntArray852[l2 + 64] = 65280 + 4 * l2;
  3158.  
  3159. for (int i3 = 0; i3 < 64; i3++)
  3160. anIntArray852[i3 + 128] = 65535 + 0x40000 * i3;
  3161.  
  3162. for (int j3 = 0; j3 < 64; j3++)
  3163. anIntArray852[j3 + 192] = 0xffffff;
  3164.  
  3165. anIntArray853 = new int[256];
  3166. for (int k3 = 0; k3 < 64; k3++)
  3167. anIntArray853[k3] = k3 * 4;
  3168.  
  3169. for (int l3 = 0; l3 < 64; l3++)
  3170. anIntArray853[l3 + 64] = 255 + 0x40000 * l3;
  3171.  
  3172. for (int i4 = 0; i4 < 64; i4++)
  3173. anIntArray853[i4 + 128] = 0xff00ff + 1024 * i4;
  3174.  
  3175. for (int j4 = 0; j4 < 64; j4++)
  3176. anIntArray853[j4 + 192] = 0xffffff;
  3177.  
  3178. anIntArray850 = new int[256];
  3179. anIntArray1190 = new int[32768];
  3180. anIntArray1191 = new int[32768];
  3181. randomizeBackground(null);
  3182. anIntArray828 = new int[32768];
  3183. anIntArray829 = new int[32768];
  3184. drawLoadingText(10, "Connecting to fileserver");
  3185. if (!aBoolean831) {
  3186. drawFlames = true;
  3187. aBoolean831 = true;
  3188. startRunnable(this, 2);
  3189. }
  3190. }
  3191.  
  3192. private static void setHighMem() {
  3193. WorldController.lowMem = false;
  3194. Rasterizer.lowMem = false;
  3195. lowMem = false;
  3196. ObjectManager.lowMem = false;
  3197. ObjectDef.lowMem = false;
  3198. }
  3199.  
  3200. public static void main(String args[]) {
  3201. try {
  3202. if (ClientConstants.LOCALHOST) {
  3203. server = "localhost";
  3204. } else if (args != null && args.length == 1) {
  3205. server = args[0];
  3206. }
  3207. nodeID = 10;
  3208. portOff = 0;
  3209. setHighMem();
  3210. isMembers = true;
  3211. Signlink.storeid = 32;
  3212. Signlink.startpriv(InetAddress.getLocalHost());
  3213. frameMode(ScreenMode.FIXED);
  3214. instance = new Client();
  3215. instance.createClientFrame(frameWidth, frameHeight);
  3216. SettingHandler.load();
  3217. } catch (Exception e) {
  3218. e.printStackTrace();
  3219. }
  3220. }
  3221.  
  3222. public static Client instance;
  3223.  
  3224. private void loadingStages() {
  3225. if (lowMem && loadingStage == 2 && ObjectManager.anInt131 != plane) {
  3226. aRSImageProducer_1165.initDrawingArea();
  3227. drawLoadingMessages(1, "Loading - please wait.", null);
  3228. aRSImageProducer_1165.drawGraphics(frameMode == ScreenMode.FIXED ? 4 : 0, super.graphics, frameMode == ScreenMode.FIXED ? 4 : 0);
  3229. loadingStage = 1;
  3230. aLong824 = System.currentTimeMillis();
  3231. }
  3232. if (loadingStage == 1) {
  3233. int j = method54();
  3234. if (j != 0 && System.currentTimeMillis() - aLong824 > 0x57e40L) {
  3235. Signlink.reporterror(myUsername + " glcfb " + aLong1215 + "," + j + "," + lowMem + "," + decompressors[0] + "," + onDemandFetcher.getNodeCount() + "," + plane + "," + anInt1069 + "," + anInt1070);
  3236. aLong824 = System.currentTimeMillis();
  3237. }
  3238. }
  3239. if (loadingStage == 2 && plane != anInt985) {
  3240. anInt985 = plane;
  3241. method24(plane);
  3242. }
  3243. }
  3244.  
  3245. private int method54() {
  3246. for (int i = 0; i < aByteArrayArray1183.length; i++) {
  3247. if (aByteArrayArray1183[i] == null && anIntArray1235[i] != -1)
  3248. return -1;
  3249. if (aByteArrayArray1247[i] == null && anIntArray1236[i] != -1)
  3250. return -2;
  3251. }
  3252. boolean flag = true;
  3253. for (int j = 0; j < aByteArrayArray1183.length; j++) {
  3254. byte abyte0[] = aByteArrayArray1247[j];
  3255. if (abyte0 != null) {
  3256. int k = (anIntArray1234[j] >> 8) * 64 - baseX;
  3257. int l = (anIntArray1234[j] & 0xff) * 64 - baseY;
  3258. if (aBoolean1159) {
  3259. k = 10;
  3260. l = 10;
  3261. }
  3262. flag &= ObjectManager.method189(k, abyte0, l);
  3263. }
  3264. }
  3265. if (!flag)
  3266. return -3;
  3267. if (aBoolean1080) {
  3268. return -4;
  3269. } else {
  3270. loadingStage = 2;
  3271. ObjectManager.anInt131 = plane;
  3272. method22();
  3273. stream.createFrame(121);
  3274. return 0;
  3275. }
  3276. }
  3277.  
  3278. private void method55() {
  3279. 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())
  3280. if (class30_sub2_sub4_sub4.anInt1597 != plane || loopCycle > class30_sub2_sub4_sub4.anInt1572)
  3281. class30_sub2_sub4_sub4.unlink();
  3282. else if (loopCycle >= class30_sub2_sub4_sub4.anInt1571) {
  3283. if (class30_sub2_sub4_sub4.anInt1590 > 0) {
  3284. Npc npc = npcArray[class30_sub2_sub4_sub4.anInt1590 - 1];
  3285. if (npc != null && npc.x >= 0 && npc.x < 13312 && npc.y >= 0 && npc.y < 13312)
  3286. 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);
  3287. }
  3288. if (class30_sub2_sub4_sub4.anInt1590 < 0) {
  3289. int j = -class30_sub2_sub4_sub4.anInt1590 - 1;
  3290. Player player;
  3291. if (j == unknownInt10)
  3292. player = myPlayer;
  3293. else
  3294. player = playerArray[j];
  3295. if (player != null && player.x >= 0 && player.x < 13312 && player.y >= 0 && player.y < 13312)
  3296. 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);
  3297. }
  3298. class30_sub2_sub4_sub4.method456(anInt945);
  3299. 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);
  3300. }
  3301.  
  3302. }
  3303.  
  3304. public AppletContext getAppletContext() {
  3305. if (Signlink.mainapp != null)
  3306. return Signlink.mainapp.getAppletContext();
  3307. else
  3308. return super.getAppletContext();
  3309. }
  3310.  
  3311. private void processOnDemandQueue() {
  3312. do {
  3313. OnDemandData onDemandData;
  3314. do {
  3315. onDemandData = onDemandFetcher.getNextNode();
  3316. if (onDemandData == null)
  3317. return;
  3318. if (onDemandData.dataType == 0) {
  3319. Model.method460(onDemandData.buffer, onDemandData.ID);
  3320. if (backDialogID != -1)
  3321. inputTaken = true;
  3322. }
  3323. if (onDemandData.dataType == 1) {
  3324. SequenceFrame.load(onDemandData.ID, onDemandData.buffer);
  3325. }
  3326. if (onDemandData.dataType == 2 && onDemandData.ID == nextSong && onDemandData.buffer != null)
  3327. saveMidi(songChanging, onDemandData.buffer);
  3328. /*
  3329. * if (onDemandData.dataType == 4) {
  3330. * Texture.decode(onDemandData.ID, onDemandData.buffer); }
  3331. */
  3332. if (onDemandData.dataType == 3 && loadingStage == 1) {
  3333. for (int i = 0; i < aByteArrayArray1183.length; i++) {
  3334. if (anIntArray1235[i] == onDemandData.ID) {
  3335. aByteArrayArray1183[i] = onDemandData.buffer;
  3336. if (onDemandData.buffer == null)
  3337. anIntArray1235[i] = -1;
  3338. break;
  3339. }
  3340. if (anIntArray1236[i] != onDemandData.ID)
  3341. continue;
  3342. aByteArrayArray1247[i] = onDemandData.buffer;
  3343. if (onDemandData.buffer == null)
  3344. anIntArray1236[i] = -1;
  3345. break;
  3346. }
  3347.  
  3348. }
  3349. } while (onDemandData.dataType != 93 || !onDemandFetcher.method564(onDemandData.ID));
  3350. ObjectManager.method173(new Stream(onDemandData.buffer), onDemandFetcher);
  3351. } while (true);
  3352. }
  3353.  
  3354. private void method60(int i) {
  3355. RSInterface class9 = RSInterface.interfaceCache[i];
  3356. if (class9 == null || class9.children == null) {
  3357. return;
  3358. }
  3359. for (int j = 0; j < class9.children.length; j++) {
  3360. if (class9.children[j] == -1)
  3361. break;
  3362. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j]];
  3363. if (class9_1.type == 1)
  3364. method60(class9_1.id);
  3365. class9_1.anInt246 = 0;
  3366. class9_1.anInt208 = 0;
  3367. }
  3368. }
  3369.  
  3370. private void drawHeadIcon() {
  3371. if (anInt855 != 2) {
  3372. return;
  3373. }
  3374. calcEntityScreenPos((anInt934 - baseX << 7) + anInt937, anInt936 * 2, (anInt935 - baseY << 7) + anInt938);
  3375. if (spriteDrawX > -1 && loopCycle % 20 < 10) {
  3376. headIconsHint[1].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  3377. }
  3378. }
  3379.  
  3380. private void mainGameProcessor() {
  3381. refreshFrameSize();
  3382. if (anInt1104 > 1)
  3383. anInt1104--;
  3384. if (anInt1011 > 0)
  3385. anInt1011--;
  3386. for (int j = 0; j < 5; j++)
  3387. if (!parsePacket())
  3388. break;
  3389.  
  3390. if (!loggedIn)
  3391. return;
  3392. synchronized (mouseDetection.syncObject) {
  3393. if (flagged) {
  3394. if (super.clickMode3 != 0 || mouseDetection.coordsIndex >= 40) {
  3395. stream.createFrame(45);
  3396. stream.writeWordBigEndian(0);
  3397. int j2 = stream.currentOffset;
  3398. int j3 = 0;
  3399. for (int j4 = 0; j4 < mouseDetection.coordsIndex; j4++) {
  3400. if (j2 - stream.currentOffset >= 240)
  3401. break;
  3402. j3++;
  3403. int l4 = mouseDetection.coordsY[j4];
  3404. if (l4 < 0)
  3405. l4 = 0;
  3406. else if (l4 > 502)
  3407. l4 = 502;
  3408. int k5 = mouseDetection.coordsX[j4];
  3409. if (k5 < 0)
  3410. k5 = 0;
  3411. else if (k5 > 764)
  3412. k5 = 764;
  3413. int i6 = l4 * 765 + k5;
  3414. if (mouseDetection.coordsY[j4] == -1 && mouseDetection.coordsX[j4] == -1) {
  3415. k5 = -1;
  3416. l4 = -1;
  3417. i6 = 0x7ffff;
  3418. }
  3419. if (k5 == anInt1237 && l4 == anInt1238) {
  3420. if (anInt1022 < 2047)
  3421. anInt1022++;
  3422. } else {
  3423. int j6 = k5 - anInt1237;
  3424. anInt1237 = k5;
  3425. int k6 = l4 - anInt1238;
  3426. anInt1238 = l4;
  3427. if (anInt1022 < 8 && j6 >= -32 && j6 <= 31 && k6 >= -32 && k6 <= 31) {
  3428. j6 += 32;
  3429. k6 += 32;
  3430. stream.writeWord((anInt1022 << 12) + (j6 << 6) + k6);
  3431. anInt1022 = 0;
  3432. } else if (anInt1022 < 8) {
  3433. stream.writeDWordBigEndian(0x800000 + (anInt1022 << 19) + i6);
  3434. anInt1022 = 0;
  3435. } else {
  3436. stream.writeDWord(0xc0000000 + (anInt1022 << 19) + i6);
  3437. anInt1022 = 0;
  3438. }
  3439. }
  3440. }
  3441.  
  3442. stream.writeBytes(stream.currentOffset - j2);
  3443. if (j3 >= mouseDetection.coordsIndex) {
  3444. mouseDetection.coordsIndex = 0;
  3445. } else {
  3446. mouseDetection.coordsIndex -= j3;
  3447. for (int i5 = 0; i5 < mouseDetection.coordsIndex; i5++) {
  3448. mouseDetection.coordsX[i5] = mouseDetection.coordsX[i5 + j3];
  3449. mouseDetection.coordsY[i5] = mouseDetection.coordsY[i5 + j3];
  3450. }
  3451.  
  3452. }
  3453. }
  3454. } else {
  3455. mouseDetection.coordsIndex = 0;
  3456. }
  3457. }
  3458. if (super.clickMode3 != 0) {
  3459. long l = (super.aLong29 - aLong1220) / 50L;
  3460. if (l > 4095L)
  3461. l = 4095L;
  3462. aLong1220 = super.aLong29;
  3463. int k2 = super.saveClickY;
  3464. if (k2 < 0)
  3465. k2 = 0;
  3466. else if (k2 > 502)
  3467. k2 = 502;
  3468. int k3 = super.saveClickX;
  3469. if (k3 < 0)
  3470. k3 = 0;
  3471. else if (k3 > 764)
  3472. k3 = 764;
  3473. int k4 = k2 * 765 + k3;
  3474. int j5 = 0;
  3475. if (super.clickMode3 == 2)
  3476. j5 = 1;
  3477. int l5 = (int) l;
  3478. stream.createFrame(241);
  3479. stream.writeDWord((l5 << 20) + (j5 << 19) + k4);
  3480. }
  3481. if (anInt1016 > 0)
  3482. anInt1016--;
  3483. if (super.keyArray[1] == 1 || super.keyArray[2] == 1 || super.keyArray[3] == 1 || super.keyArray[4] == 1)
  3484. aBoolean1017 = true;
  3485. if (aBoolean1017 && anInt1016 <= 0) {
  3486. anInt1016 = 20;
  3487. aBoolean1017 = false;
  3488. stream.createFrame(86);
  3489. stream.writeWord(anInt1184);
  3490. stream.method432(minimapInt1);
  3491. }
  3492. if (super.awtFocus && !aBoolean954) {
  3493. aBoolean954 = true;
  3494. stream.createFrame(3);
  3495. stream.writeWordBigEndian(1);
  3496. }
  3497. if (!super.awtFocus && aBoolean954) {
  3498. aBoolean954 = false;
  3499. stream.createFrame(3);
  3500. stream.writeWordBigEndian(0);
  3501. }
  3502. loadingStages();
  3503. method115();
  3504. anInt1009++;
  3505. if (anInt1009 > 750)
  3506. dropClient();
  3507. method114();
  3508. method95();
  3509. method38();
  3510. anInt945++;
  3511. if (crossType != 0) {
  3512. crossIndex += 20;
  3513. if (crossIndex >= 400)
  3514. crossType = 0;
  3515. }
  3516. if (atInventoryInterfaceType != 0) {
  3517. atInventoryLoopCycle++;
  3518. if (atInventoryLoopCycle >= 15) {
  3519. if (atInventoryInterfaceType == 2) {
  3520. }
  3521. if (atInventoryInterfaceType == 3)
  3522. inputTaken = true;
  3523. atInventoryInterfaceType = 0;
  3524. }
  3525. }
  3526. if (activeInterfaceType != 0) {
  3527. dragCycle++;
  3528. if (super.mouseX > pressX + 5 || super.mouseX < pressX - 5 || super.mouseY > pressY + 5 || super.mouseY < pressY - 5)
  3529. aBoolean1242 = true;
  3530. if (super.clickMode2 == 0) {
  3531. if (activeInterfaceType == 2) {
  3532. }
  3533. if (activeInterfaceType == 3)
  3534. inputTaken = true;
  3535. activeInterfaceType = 0;
  3536. if (aBoolean1242 && dragCycle >= 15) {
  3537. lastActiveInvInterface = -1;
  3538. processRightClick();
  3539. if (focusedDragWidget == 5382) {
  3540. Point southWest, northEast;
  3541.  
  3542. if (frameMode == ScreenMode.FIXED) {
  3543. southWest = new Point(56, 81);
  3544. northEast = new Point(101, 41);
  3545. } else {
  3546. int xOffset = (frameWidth - 237 - RSInterface.interfaceCache[5292].width) / 2;
  3547. int yOffset = 36 + ((frameHeight - 503) / 2);
  3548. southWest = new Point(xOffset + 76, yOffset + 62);
  3549. northEast = new Point(xOffset + 117, yOffset + 22);
  3550. }
  3551.  
  3552. int[] slots = new int[10];
  3553.  
  3554. for (int i = 0; i < slots.length; i++) {
  3555. slots[i] = (40 * i) + (int) southWest.getX();
  3556. }
  3557.  
  3558. for (int i = 0; i < slots.length; i++) {
  3559. if ((super.mouseX >= slots[i]) && (super.mouseX <= (slots[i] + 41)) && (super.mouseY >= northEast.getY()) && (super.mouseY <= southWest.getY())) {
  3560. stream.createFrame(214);
  3561. stream.method433(focusedDragWidget);
  3562. stream.method424(2);
  3563. stream.method433(dragFromSlot);
  3564. stream.method431(i);
  3565. return;
  3566. }
  3567. }
  3568. }
  3569.  
  3570. if (lastActiveInvInterface == -1 && focusedDragWidget == 3214 && frameMode == ScreenMode.FIXED) {
  3571. if (super.mouseX <= 516 && super.mouseY <= 338 && super.mouseX >= 0 && super.mouseY >= 0) {
  3572. stream.createFrame(87);
  3573. stream.method432(RSInterface.interfaceCache[3214].inv[dragFromSlot] - 1);
  3574. stream.writeWord(focusedDragWidget);
  3575. stream.method432(dragFromSlot);
  3576. }
  3577. } else if (lastActiveInvInterface == focusedDragWidget && mouseInvInterfaceIndex != dragFromSlot) {
  3578. RSInterface class9 = RSInterface.interfaceCache[focusedDragWidget];
  3579. int j1 = 0;
  3580. if (anInt913 == 1 && class9.contentType == 206)
  3581. j1 = 1;
  3582. if (class9.inv[mouseInvInterfaceIndex] <= 0)
  3583. j1 = 0;
  3584. if (class9.aBoolean235) {
  3585. int l2 = dragFromSlot;
  3586. int l3 = mouseInvInterfaceIndex;
  3587. class9.inv[l3] = class9.inv[l2];
  3588. class9.invStackSizes[l3] = class9.invStackSizes[l2];
  3589. class9.inv[l2] = -1;
  3590. class9.invStackSizes[l2] = 0;
  3591. } else if (j1 == 0) {
  3592. class9.swapInventoryItems(dragFromSlot, mouseInvInterfaceIndex);
  3593. }
  3594.  
  3595. stream.createFrame(214);
  3596. stream.method433(focusedDragWidget);
  3597. stream.method424(j1);
  3598. stream.method433(dragFromSlot);
  3599. stream.method431(mouseInvInterfaceIndex);
  3600. }
  3601. } else if ((anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  3602. determineMenuSize();
  3603. else if (menuActionRow > 0)
  3604. doAction(menuActionRow - 1);
  3605. atInventoryLoopCycle = 10;
  3606. super.clickMode3 = 0;
  3607. }
  3608. }
  3609. if (WorldController.anInt470 != -1) {
  3610. int k = WorldController.anInt470;
  3611. int k1 = WorldController.anInt471;
  3612. boolean flag = doWalkTo(0, 0, 0, 0, myPlayer.smallY[0], 0, 0, k1, myPlayer.smallX[0], true, k);
  3613. WorldController.anInt470 = -1;
  3614. if (flag) {
  3615. crossX = super.saveClickX;
  3616. crossY = super.saveClickY;
  3617. crossType = 1;
  3618. crossIndex = 0;
  3619. }
  3620. }
  3621. if (super.clickMode3 == 1 && aString844 != null) {
  3622. aString844 = null;
  3623. inputTaken = true;
  3624. super.clickMode3 = 0;
  3625. }
  3626. processMenuClick();
  3627. if (super.clickMode2 == 1 || super.clickMode3 == 1)
  3628. anInt1213++;
  3629. if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  3630. if (anInt1501 < 0 && !menuOpen) {
  3631. anInt1501++;
  3632. if (anInt1501 == 0) {
  3633. if (anInt1500 != 0) {
  3634. inputTaken = true;
  3635. }
  3636. if (anInt1044 != 0) {
  3637. }
  3638. }
  3639. }
  3640. } else if (anInt1501 > 0) {
  3641. anInt1501--;
  3642. }
  3643. if (loadingStage == 2)
  3644. method108();
  3645. if (loadingStage == 2 && aBoolean1160)
  3646. calcCameraPos();
  3647. for (int i1 = 0; i1 < 5; i1++)
  3648. anIntArray1030[i1]++;
  3649.  
  3650. method73();
  3651. super.idleTime++;
  3652. if (super.idleTime > 4500) {
  3653. anInt1011 = 250;
  3654. super.idleTime -= 500;
  3655. stream.createFrame(202);
  3656. }
  3657. anInt1010++;
  3658. if (anInt1010 > 50)
  3659. stream.createFrame(0);
  3660. try {
  3661. if (socketStream != null && stream.currentOffset > 0) {
  3662. socketStream.queueBytes(stream.currentOffset, stream.buffer);
  3663. stream.currentOffset = 0;
  3664. anInt1010 = 0;
  3665. }
  3666. } catch (IOException _ex) {
  3667. dropClient();
  3668. } catch (Exception exception) {
  3669. resetLogout();
  3670. }
  3671. }
  3672.  
  3673. private void method63() {
  3674. Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179.reverseGetFirst();
  3675. for (; class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179.reverseGetNext())
  3676. if (class30_sub1.anInt1294 == -1) {
  3677. class30_sub1.anInt1302 = 0;
  3678. method89(class30_sub1);
  3679. } else {
  3680. class30_sub1.unlink();
  3681. }
  3682.  
  3683. }
  3684.  
  3685. void resetImageProducers() {
  3686. if (aRSImageProducer_1107 != null)
  3687. return;
  3688. super.fullGameScreen = null;
  3689. aRSImageProducer_1166 = null;
  3690. aRSImageProducer_1164 = null;
  3691. aRSImageProducer_1163 = null;
  3692. aRSImageProducer_1165 = null;
  3693. aRSImageProducer_1125 = null;
  3694. aRSImageProducer_1110 = new ImageProducer(128, 265);
  3695. DrawingArea.setAllPixelsToZero();
  3696. aRSImageProducer_1111 = new ImageProducer(128, 265);
  3697. DrawingArea.setAllPixelsToZero();
  3698. aRSImageProducer_1107 = new ImageProducer(509, 171);
  3699. DrawingArea.setAllPixelsToZero();
  3700. aRSImageProducer_1108 = new ImageProducer(360, 132);
  3701. DrawingArea.setAllPixelsToZero();
  3702. aRSImageProducer_1109 = new ImageProducer(frameWidth, frameHeight);
  3703. DrawingArea.setAllPixelsToZero();
  3704. aRSImageProducer_1112 = new ImageProducer(202, 238);
  3705. DrawingArea.setAllPixelsToZero();
  3706. aRSImageProducer_1113 = new ImageProducer(203, 238);
  3707. DrawingArea.setAllPixelsToZero();
  3708. aRSImageProducer_1114 = new ImageProducer(74, 94);
  3709. DrawingArea.setAllPixelsToZero();
  3710. aRSImageProducer_1115 = new ImageProducer(75, 94);
  3711. DrawingArea.setAllPixelsToZero();
  3712. welcomeScreenRaised = true;
  3713. }
  3714.  
  3715. public float loadPercent = 0.0F;
  3716.  
  3717. public void drawSmoothLoading(int percent, String message) {
  3718. for (float perc = loadPercent; perc < (float) percent; perc = (float) ((double) perc + 0.29999999999999999D)) {
  3719. drawLoadingText((int) perc, message);
  3720. }
  3721. loadPercent = percent;
  3722. }
  3723.  
  3724. private static Sprite BACKGROUND;
  3725. private static Sprite LOADING_BAR;
  3726.  
  3727. static {
  3728. try {
  3729. BACKGROUND = new Sprite(new URL("http://www.vencillio.com/Daniel/11.png"));
  3730. LOADING_BAR = new Sprite(new URL("http://www.vencillio.com/Daniel/12.png"));
  3731. } catch (MalformedURLException e) {
  3732. e.printStackTrace();
  3733. }
  3734. }
  3735.  
  3736. public void drawLoadingText(int percent, String message) {
  3737. anInt1079 = percent;
  3738. aString1049 = message;
  3739. resetImageProducers();
  3740. if (titleStreamLoader == null) {
  3741. super.drawLoadingText(percent, message);
  3742. return;
  3743. }
  3744. refreshFrameSize();
  3745. aRSImageProducer_1109.initDrawingArea();
  3746.  
  3747. BACKGROUND.drawSprite((frameWidth / 2) - (BACKGROUND.myWidth / 2), (frameHeight / 2) - (BACKGROUND.myHeight / 2));
  3748. LOADING_BAR.drawSprite((frameWidth / 2) - 274, (frameHeight / 2) - 10);
  3749. DrawingArea.drawPixels(36, (frameHeight / 2) - 10, ((frameWidth / 2) - 274 + percent), 0x302e2c, (530 - percent));
  3750. regularText.method382(0xffffff, (frameWidth / 2), message, (frameHeight / 2) + 12, true);
  3751. aRSImageProducer_1109.drawGraphics(0, super.graphics, 0);
  3752. if (welcomeScreenRaised) {
  3753. welcomeScreenRaised = false;
  3754. }
  3755. }
  3756.  
  3757. private void method65(int i, int j, int k, int l, RSInterface class9, int i1, boolean flag, int j1) {
  3758. int anInt992;
  3759. if (aBoolean972)
  3760. anInt992 = 32;
  3761. else
  3762. anInt992 = 0;
  3763. aBoolean972 = false;
  3764. if (k >= i && k < i + 16 && l >= i1 && l < i1 + 16) {
  3765. class9.scrollPosition -= anInt1213 * 4;
  3766. if (flag) {
  3767. }
  3768. } else if (k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j) {
  3769. class9.scrollPosition += anInt1213 * 4;
  3770. if (flag) {
  3771. }
  3772. } else if (k >= i - anInt992 && k < i + 16 + anInt992 && l >= i1 + 16 && l < (i1 + j) - 16 && anInt1213 > 0) {
  3773. int l1 = ((j - 32) * j) / j1;
  3774. if (l1 < 8)
  3775. l1 = 8;
  3776. int i2 = l - i1 - 16 - l1 / 2;
  3777. int j2 = j - 32 - l1;
  3778. class9.scrollPosition = ((j1 - j) * i2) / j2;
  3779. if (flag) {
  3780. }
  3781. aBoolean972 = true;
  3782. }
  3783. }
  3784.  
  3785. private boolean method66(int i, int j, int k) {
  3786. int i1 = i >> 14 & 0x7fff;
  3787. int j1 = worldController.method304(plane, k, j, i);
  3788. if (j1 == -1)
  3789. return false;
  3790. int k1 = j1 & 0x1f;
  3791. int l1 = j1 >> 6 & 3;
  3792. if (k1 == 10 || k1 == 11 || k1 == 22) {
  3793. ObjectDef class46 = ObjectDef.forID(i1);
  3794. int i2;
  3795. int j2;
  3796. if (l1 == 0 || l1 == 2) {
  3797. i2 = class46.anInt744;
  3798. j2 = class46.anInt761;
  3799. } else {
  3800. i2 = class46.anInt761;
  3801. j2 = class46.anInt744;
  3802. }
  3803. int k2 = class46.anInt768;
  3804. if (l1 != 0)
  3805. k2 = (k2 << l1 & 0xf) + (k2 >> 4 - l1);
  3806. doWalkTo(2, 0, j2, 0, myPlayer.smallY[0], i2, k2, j, myPlayer.smallX[0], false, k);
  3807. } else {
  3808. doWalkTo(2, l1, 0, k1 + 1, myPlayer.smallY[0], 0, 0, j, myPlayer.smallX[0], false, k);
  3809. }
  3810. crossX = super.saveClickX;
  3811. crossY = super.saveClickY;
  3812. crossType = 2;
  3813. crossIndex = 0;
  3814. return true;
  3815. }
  3816.  
  3817. private StreamLoader streamLoaderForName(int i, String s, String s1, int j, int k) {
  3818. byte abyte0[] = null;
  3819. int l = 5;
  3820. try {
  3821. if (decompressors[0] != null)
  3822. abyte0 = decompressors[0].decompress(i);
  3823. } catch (Exception _ex) {
  3824. }
  3825. if (abyte0 != null) {
  3826. // aCRC32_930.reset();
  3827. // aCRC32_930.update(abyte0);
  3828. // int i1 = (int)aCRC32_930.getValue();
  3829. // if(i1 != j)
  3830. }
  3831. if (abyte0 != null) {
  3832. StreamLoader streamLoader = new StreamLoader(abyte0);
  3833. return streamLoader;
  3834. }
  3835. int j1 = 0;
  3836. while (abyte0 == null) {
  3837. String s2 = "Unknown error";
  3838. drawLoadingText(k, "Requesting " + s);
  3839. try {
  3840. int k1 = 0;
  3841. DataInputStream datainputstream = openJagGrabInputStream(s1 + j);
  3842. byte abyte1[] = new byte[6];
  3843. datainputstream.readFully(abyte1, 0, 6);
  3844. Stream stream = new Stream(abyte1);
  3845. stream.currentOffset = 3;
  3846. int i2 = stream.read3Bytes() + 6;
  3847. int j2 = 6;
  3848. abyte0 = new byte[i2];
  3849. System.arraycopy(abyte1, 0, abyte0, 0, 6);
  3850.  
  3851. while (j2 < i2) {
  3852. int l2 = i2 - j2;
  3853. if (l2 > 1000)
  3854. l2 = 1000;
  3855. int j3 = datainputstream.read(abyte0, j2, l2);
  3856. if (j3 < 0) {
  3857. s2 = "Length error: " + j2 + "/" + i2;
  3858. throw new IOException("EOF");
  3859. }
  3860. j2 += j3;
  3861. int k3 = (j2 * 100) / i2;
  3862. if (k3 != k1)
  3863. drawLoadingText(k, "Loading " + s + " - " + k3 + "%");
  3864. k1 = k3;
  3865. }
  3866. datainputstream.close();
  3867. try {
  3868. if (decompressors[0] != null)
  3869. decompressors[0].method234(abyte0.length, abyte0, i);
  3870. } catch (Exception _ex) {
  3871. decompressors[0] = null;
  3872. }
  3873. /*
  3874. * if(abyte0 != null) { aCRC32_930.reset();
  3875. * aCRC32_930.update(abyte0); int i3 =
  3876. * (int)aCRC32_930.getValue(); if(i3 != j) { abyte0 = null;
  3877. * j1++; s2 = "Checksum error: " + i3; } }
  3878. */
  3879. } catch (IOException ioexception) {
  3880. if (s2.equals("Unknown error"))
  3881. s2 = "Connection error";
  3882. abyte0 = null;
  3883. } catch (NullPointerException _ex) {
  3884. s2 = "Null error";
  3885. abyte0 = null;
  3886. if (!Signlink.reporterror)
  3887. return null;
  3888. } catch (ArrayIndexOutOfBoundsException _ex) {
  3889. s2 = "Bounds error";
  3890. abyte0 = null;
  3891. if (!Signlink.reporterror)
  3892. return null;
  3893. } catch (Exception _ex) {
  3894. s2 = "Unexpected error";
  3895. abyte0 = null;
  3896. if (!Signlink.reporterror)
  3897. return null;
  3898. }
  3899. if (abyte0 == null) {
  3900. for (int l1 = l; l1 > 0; l1--) {
  3901. if (j1 >= 3) {
  3902. drawLoadingText(k, "Game updated - please reload page");
  3903. l1 = 10;
  3904. } else {
  3905. drawLoadingText(k, s2 + " - Retrying in " + l1);
  3906. }
  3907. try {
  3908. Thread.sleep(1000L);
  3909. } catch (Exception _ex) {
  3910. }
  3911. }
  3912.  
  3913. l *= 2;
  3914. if (l > 60)
  3915. l = 60;
  3916. aBoolean872 = !aBoolean872;
  3917. }
  3918.  
  3919. }
  3920.  
  3921. StreamLoader streamLoader_1 = new StreamLoader(abyte0);
  3922. return streamLoader_1;
  3923. }
  3924.  
  3925. private void dropClient() {
  3926. if (anInt1011 > 0) {
  3927. resetLogout();
  3928. return;
  3929. }
  3930. DrawingArea.fillPixels(2, 229, 39, 0xffffff, 2); // white box around
  3931. DrawingArea.drawPixels(37, 3, 3, 0, 227); // black fill
  3932. regularText.drawText(0, "Connection lost.", 19, 120);
  3933. regularText.drawText(0xffffff, "Connection lost.", 18, 119);
  3934. regularText.drawText(0, "Please wait - attempting to reestablish.", 34, 117);
  3935. regularText.drawText(0xffffff, "Please wait - attempting to reestablish.", 34, 116);
  3936. aRSImageProducer_1165.drawGraphics(frameMode == ScreenMode.FIXED ? 4 : 0, super.graphics, frameMode == ScreenMode.FIXED ? 4 : 0);
  3937. anInt1021 = 0;
  3938. destX = 0;
  3939. if (rememberMe) {
  3940. AccountManager.saveAccount();
  3941. }
  3942. RSSocket rsSocket = socketStream;
  3943. loggedIn = false;
  3944. loginFailures = 0;
  3945. setBounds();
  3946. login(myUsername, myPassword, true);
  3947. SettingHandler.save();
  3948. console.openConsole = false;
  3949. if (!loggedIn)
  3950. resetLogout();
  3951. try {
  3952. rsSocket.close();
  3953. } catch (Exception _ex) {
  3954. }
  3955. }
  3956.  
  3957. public void setNorth() {
  3958. anInt1278 = 0;
  3959. anInt1131 = 0;
  3960. anInt896 = 0;
  3961. minimapInt1 = 0;
  3962. minimapInt2 = 0;
  3963. minimapInt3 = 0;
  3964. }
  3965.  
  3966. private void doAction(int i) {
  3967. if (i < 0)
  3968. return;
  3969. if (inputDialogState != 0) {
  3970. inputDialogState = 0;
  3971. inputTaken = true;
  3972. }
  3973. int j = menuActionCmd2[i];
  3974. int k = menuActionCmd3[i];
  3975. int l = menuActionID[i];
  3976. int i1 = menuActionCmd1[i];
  3977.  
  3978. if (l >= 2000)
  3979. l -= 2000;
  3980. if (l == 701) {
  3981. extendChatArea();
  3982. }
  3983. if (l == 713) {
  3984. inputTaken = true;
  3985. messagePromptRaised = true;
  3986. amountOrNameInput = "";
  3987. promptInput = "";
  3988. inputDialogState = 0;
  3989. friendsListAction = 557;
  3990. aString1121 = "Enter amount to withdraw";
  3991. }
  3992. if (l == 714) {
  3993. stream.createFrame(185);
  3994. stream.writeWord(714);
  3995. }
  3996. if (l == 715) {
  3997. stream.createFrame(185);
  3998. stream.writeWord(715);
  3999. }
  4000. if (l == 850) {
  4001. stream.createFrame(185);
  4002. stream.writeWord(1507);
  4003. }
  4004. if (l == 291) {
  4005. stream.createFrame(140);
  4006. stream.method432(j);
  4007. stream.writeWord(k);
  4008. stream.method432(i1);
  4009. }
  4010.  
  4011. if (l == 300) {
  4012. stream.createFrame(141);
  4013. stream.method432(j);
  4014. stream.writeWord(k);
  4015. stream.method432(i1);
  4016. stream.writeDWord(modifiableXValue);
  4017. }
  4018. if (l == 474) {
  4019. counterOn = !counterOn;
  4020. }
  4021. if (l == 475) {
  4022. xpCounter = 0;
  4023. stream.createFrame(148);
  4024. }
  4025. if (l == 476) {
  4026. openInterfaceID = 32800;
  4027. }
  4028. if (l == 696) {
  4029. setNorth();
  4030. }
  4031. if (l == 1506) { // Select quick prayers
  4032. stream.createFrame(185);
  4033. stream.writeWord(5001);
  4034. }
  4035. if (l == 1500) { // Toggle quick prayers
  4036. prayClicked = !prayClicked;
  4037. stream.createFrame(185);
  4038. stream.writeWord(5000);
  4039. }
  4040. if (l == 104) {
  4041. RSInterface class9_1 = RSInterface.interfaceCache[k];
  4042. spellID = class9_1.id;
  4043. }
  4044. if (l == 582) {
  4045. Npc npc = npcArray[i1];
  4046. if (npc != null) {
  4047. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0], myPlayer.smallX[0], false, npc.smallX[0]);
  4048. crossX = super.saveClickX;
  4049. crossY = super.saveClickY;
  4050. crossType = 2;
  4051. crossIndex = 0;
  4052. stream.createFrame(57);
  4053. stream.method432(anInt1285);
  4054. stream.method432(i1);
  4055. stream.method431(anInt1283);
  4056. stream.method432(anInt1284);
  4057. }
  4058. }
  4059. if (l == 234) {
  4060. boolean flag1 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4061. if (!flag1)
  4062. flag1 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4063. crossX = super.saveClickX;
  4064. crossY = super.saveClickY;
  4065. crossType = 2;
  4066. crossIndex = 0;
  4067. stream.createFrame(236);
  4068. stream.method431(k + baseY);
  4069. stream.writeWord(i1);
  4070. stream.method431(j + baseX);
  4071. }
  4072. if (l == 62 && method66(i1, k, j)) {
  4073. stream.createFrame(192);
  4074. stream.writeWord(anInt1284);
  4075. stream.method431(i1 >> 14 & 0x7fff);
  4076. stream.method433(k + baseY);
  4077. stream.method431(anInt1283);
  4078. stream.method433(j + baseX);
  4079. stream.writeWord(anInt1285);
  4080. }
  4081. if (l == 511) {
  4082. boolean flag2 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4083. if (!flag2)
  4084. flag2 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4085. crossX = super.saveClickX;
  4086. crossY = super.saveClickY;
  4087. crossType = 2;
  4088. crossIndex = 0;
  4089. stream.createFrame(25);
  4090. stream.method431(anInt1284);
  4091. stream.method432(anInt1285);
  4092. stream.writeWord(i1);
  4093. stream.method432(k + baseY);
  4094. stream.method433(anInt1283);
  4095. stream.writeWord(j + baseX);
  4096. }
  4097. if (l == 74) {
  4098. stream.createFrame(122);
  4099. stream.method433(k);
  4100. stream.method432(j);
  4101. stream.method431(i1);
  4102. atInventoryLoopCycle = 0;
  4103. atInventoryInterface = k;
  4104. atInventoryIndex = j;
  4105. atInventoryInterfaceType = 2;
  4106. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4107. atInventoryInterfaceType = 1;
  4108. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4109. atInventoryInterfaceType = 3;
  4110. }
  4111. if (l == 315) {
  4112. RSInterface class9 = RSInterface.interfaceCache[k];
  4113. boolean flag8 = true;
  4114. if (class9.contentType > 0)
  4115. flag8 = promptUserForInput(class9);
  4116. if (flag8) {
  4117.  
  4118. if (SettingHandler.handle(k)) {
  4119. return;
  4120. }
  4121.  
  4122. switch (k) {
  4123. // Colors
  4124. case 37510:// White
  4125. changeChat("FFFFFF", "white");
  4126. break;
  4127. case 37513:// Black
  4128. changeChat("000000", "black");
  4129. break;
  4130. case 37516:// Grey
  4131. changeChat("94968F", "grey");
  4132. break;
  4133. case 37519:// Red
  4134. changeChat("ED0C0C", "red");
  4135. break;
  4136. case 37522:// Orange
  4137. changeChat("FF700A", "orange");
  4138. break;
  4139. case 37525:// Yellow
  4140. changeChat("FFF700", "yellow");
  4141. break;
  4142. case 37528:// Green
  4143. changeChat("4AD143", "green");
  4144. break;
  4145. case 37531:// Blue
  4146. changeChat("25B8F7", "blue");
  4147. break;
  4148. case 37534:// Purple
  4149. changeChat("DD0AF0", "purple");
  4150. break;
  4151. case 37537:// Pink
  4152. changeChat("FF21D6", "pink");
  4153. break;
  4154. case 37540:// Cyan
  4155. changeChat("00FFFF", "cyan");
  4156. break;
  4157. case 37543:// Turquoise
  4158. changeChat("1F9C9C", "turquoise");
  4159. break;
  4160. case 36004:
  4161. frameMode(ScreenMode.FIXED);
  4162. transparentTabArea = false;
  4163. changeChatArea = false;
  4164. changeTabArea = false;
  4165. break;
  4166. case 36007:
  4167. frameMode(ScreenMode.RESIZABLE);
  4168. break;
  4169. case 36010:
  4170. frameMode(ScreenMode.FULLSCREEN);
  4171. break;
  4172.  
  4173.  
  4174.  
  4175. case 19144:
  4176. sendFrame248(15106, 3213);
  4177. method60(15106);
  4178. inputTaken = true;
  4179. break;
  4180.  
  4181. default:
  4182. stream.createFrame(185);
  4183. stream.writeWord(k);
  4184. if (k >= 61101 && k <= 61200) {
  4185. int selected = k - 61101;
  4186. for (int ii = 0, slot = -1; ii < ItemDef.totalItems && slot < 100; ii++) {
  4187. ItemDef def = ItemDef.forID(ii);
  4188.  
  4189. if (def.name == null || def.certTemplateID == ii - 1 || def.certID == ii - 1 || RSInterface.interfaceCache[61254].disabledMessage.length() == 0) {
  4190. continue;
  4191. }
  4192.  
  4193. if (def.name.toLowerCase().contains(RSInterface.interfaceCache[61254].disabledMessage.toLowerCase())) {
  4194. slot++;
  4195. }
  4196.  
  4197. if (slot != selected) {
  4198. continue;
  4199. }
  4200.  
  4201. int id = def.id;
  4202. long num = Long.valueOf(RSInterface.interfaceCache[61255].disabledMessage.replaceAll(",", ""));
  4203.  
  4204. if (num > Integer.MAX_VALUE) {
  4205. num = Integer.MAX_VALUE;
  4206. }
  4207.  
  4208. stream.createFrame(149);
  4209. stream.writeWord(id);
  4210. stream.writeDWord((int) num);
  4211. stream.writeWordBigEndian(variousSettings[1075]);
  4212. break;
  4213. }
  4214. }
  4215. break;
  4216.  
  4217. }
  4218. }
  4219. }
  4220. if (l == 561) {
  4221. Player player = playerArray[i1];
  4222. if (player != null) {
  4223. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, player.smallY[0], myPlayer.smallX[0], false, player.smallX[0]);
  4224. crossX = super.saveClickX;
  4225. crossY = super.saveClickY;
  4226. crossType = 2;
  4227. crossIndex = 0;
  4228. anInt1188 += i1;
  4229. if (anInt1188 >= 90) {
  4230. stream.createFrame(136);
  4231. anInt1188 = 0;
  4232. }
  4233. stream.createFrame(128);
  4234. stream.writeWord(i1);
  4235. }
  4236. }
  4237. if (l == 20) {
  4238. Npc class30_sub2_sub4_sub1_sub1_1 = npcArray[i1];
  4239. if (class30_sub2_sub4_sub1_sub1_1 != null) {
  4240. 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]);
  4241. crossX = super.saveClickX;
  4242. crossY = super.saveClickY;
  4243. crossType = 2;
  4244. crossIndex = 0;
  4245. stream.createFrame(155);
  4246. stream.method431(i1);
  4247. }
  4248. }
  4249. if (l == 779) {
  4250. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[i1];
  4251. if (class30_sub2_sub4_sub1_sub2_1 != null) {
  4252. 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]);
  4253. crossX = super.saveClickX;
  4254. crossY = super.saveClickY;
  4255. crossType = 2;
  4256. crossIndex = 0;
  4257. stream.createFrame(153);
  4258. stream.method431(i1);
  4259. }
  4260. }
  4261. if (l == 519)
  4262. if (!menuOpen)
  4263. worldController.method312(super.saveClickY - 4, super.saveClickX - 4);
  4264. else
  4265. worldController.method312(k - 4, j - 4);
  4266. if (l == 1062) {
  4267. anInt924 += baseX;
  4268. if (anInt924 >= 113) {
  4269. stream.createFrame(183);
  4270. stream.writeDWordBigEndian(0xe63271);
  4271. anInt924 = 0;
  4272. }
  4273. method66(i1, k, j);
  4274. stream.createFrame(228);
  4275. stream.method432(i1 >> 14 & 0x7fff);
  4276. stream.method432(k + baseY);
  4277. stream.writeWord(j + baseX);
  4278. }
  4279. if (l == 679 && !aBoolean1149) {
  4280. stream.createFrame(40);
  4281. stream.writeWord(k);
  4282. aBoolean1149 = true;
  4283. }
  4284. if (l == 431) {
  4285. stream.createFrame(129);
  4286. stream.method432(j);
  4287. stream.writeWord(k);
  4288. stream.method432(i1);
  4289. atInventoryLoopCycle = 0;
  4290. atInventoryInterface = k;
  4291. atInventoryIndex = j;
  4292. atInventoryInterfaceType = 2;
  4293. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4294. atInventoryInterfaceType = 1;
  4295. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4296. atInventoryInterfaceType = 3;
  4297. }
  4298. if (l == 337 || l == 42 || l == 792 || l == 322) {
  4299. String s = menuActionName[i];
  4300. int k1 = s.indexOf("@whi@");
  4301. if (k1 != -1) {
  4302. long l3 = TextClass.longForName(s.substring(k1 + 5).trim());
  4303. if (l == 337)
  4304. addFriend(l3);
  4305. if (l == 42)
  4306. addIgnore(l3);
  4307. if (l == 792)
  4308. delFriend(l3);
  4309. if (l == 322)
  4310. delIgnore(l3);
  4311. }
  4312. }
  4313. if (l == 53) {
  4314. stream.createFrame(135);
  4315. stream.method431(j);
  4316. stream.method432(k);
  4317. stream.method431(i1);
  4318. atInventoryLoopCycle = 0;
  4319. atInventoryInterface = k;
  4320. atInventoryIndex = j;
  4321. atInventoryInterfaceType = 2;
  4322. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4323. atInventoryInterfaceType = 1;
  4324. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4325. atInventoryInterfaceType = 3;
  4326. }
  4327. if (l == 539) {
  4328. stream.createFrame(16);
  4329. stream.method432(i1);
  4330. stream.method433(j);
  4331. stream.method433(k);
  4332. atInventoryLoopCycle = 0;
  4333. atInventoryInterface = k;
  4334. atInventoryIndex = j;
  4335. atInventoryInterfaceType = 2;
  4336. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4337. atInventoryInterfaceType = 1;
  4338. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4339. atInventoryInterfaceType = 3;
  4340. }
  4341. if (l == 484 || l == 6) {
  4342. String s1 = menuActionName[i];
  4343. int l1 = s1.indexOf("@whi@");
  4344. if (l1 != -1) {
  4345. s1 = s1.substring(l1 + 5).trim();
  4346. String s7 = TextClass.fixName(TextClass.nameForLong(TextClass.longForName(s1)));
  4347. boolean flag9 = false;
  4348. for (int j3 = 0; j3 < playerCount; j3++) {
  4349. Player class30_sub2_sub4_sub1_sub2_7 = playerArray[playerIndices[j3]];
  4350. 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))
  4351. continue;
  4352. 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]);
  4353. if (l == 484) {
  4354. stream.createFrame(139);
  4355. stream.method431(playerIndices[j3]);
  4356. }
  4357. if (l == 6) {
  4358. anInt1188 += i1;
  4359. if (anInt1188 >= 90) {
  4360. stream.createFrame(136);
  4361. anInt1188 = 0;
  4362. }
  4363. stream.createFrame(128);
  4364. stream.writeWord(playerIndices[j3]);
  4365. }
  4366. flag9 = true;
  4367. break;
  4368. }
  4369.  
  4370. if (!flag9)
  4371. pushMessage("Unable to find " + s7, 0, "");
  4372. }
  4373. }
  4374. if (l == 870) {
  4375. stream.createFrame(53);
  4376. stream.writeWord(j);
  4377. stream.method432(anInt1283);
  4378. stream.method433(i1);
  4379. stream.writeWord(anInt1284);
  4380. stream.method431(anInt1285);
  4381. stream.writeWord(k);
  4382. atInventoryLoopCycle = 0;
  4383. atInventoryInterface = k;
  4384. atInventoryIndex = j;
  4385. atInventoryInterfaceType = 2;
  4386. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4387. atInventoryInterfaceType = 1;
  4388. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4389. atInventoryInterfaceType = 3;
  4390. }
  4391. if (l == 847) {
  4392. stream.createFrame(87);
  4393. stream.method432(i1);
  4394. stream.writeWord(k);
  4395. stream.method432(j);
  4396. atInventoryLoopCycle = 0;
  4397. atInventoryInterface = k;
  4398. atInventoryIndex = j;
  4399. atInventoryInterfaceType = 2;
  4400. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4401. atInventoryInterfaceType = 1;
  4402. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4403. atInventoryInterfaceType = 3;
  4404. }
  4405. if (l == 626) {
  4406. RSInterface class9_1 = RSInterface.interfaceCache[k];
  4407. spellSelected = 1;
  4408. spellID = class9_1.id;
  4409. anInt1137 = k;
  4410. spellUsableOn = class9_1.spellUsableOn;
  4411. itemSelected = 0;
  4412. String s4 = class9_1.selectedActionName;
  4413. if (s4.indexOf(" ") != -1)
  4414. s4 = s4.substring(0, s4.indexOf(" "));
  4415. String s8 = class9_1.selectedActionName;
  4416. if (s8.indexOf(" ") != -1)
  4417. s8 = s8.substring(s8.indexOf(" ") + 1);
  4418. spellTooltip = s4 + " " + class9_1.spellName + " " + s8;
  4419. // class9_1.sprite1.drawSprite(class9_1.anInt263, class9_1.anInt265,
  4420. // 0xffffff);
  4421. // class9_1.sprite1.drawSprite(200,200);
  4422. // System.out.println("Sprite: " + class9_1.sprite1.toString());
  4423. if (spellUsableOn == 16) {
  4424. tabID = 3;
  4425. tabAreaAltered = true;
  4426. }
  4427. return;
  4428. }
  4429. if (l == 78) {
  4430. stream.createFrame(117);
  4431. stream.method433(k);
  4432. stream.method433(i1);
  4433. stream.method431(j);
  4434. atInventoryLoopCycle = 0;
  4435. atInventoryInterface = k;
  4436. atInventoryIndex = j;
  4437. atInventoryInterfaceType = 2;
  4438. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4439. atInventoryInterfaceType = 1;
  4440. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4441. atInventoryInterfaceType = 3;
  4442. }
  4443. if (l == 27) {
  4444. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[i1];
  4445. if (class30_sub2_sub4_sub1_sub2_2 != null) {
  4446. 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]);
  4447. crossX = super.saveClickX;
  4448. crossY = super.saveClickY;
  4449. crossType = 2;
  4450. crossIndex = 0;
  4451. anInt986 += i1;
  4452. if (anInt986 >= 54) {
  4453. stream.createFrame(189);
  4454. stream.writeWordBigEndian(234);
  4455. anInt986 = 0;
  4456. }
  4457. stream.createFrame(73);
  4458. stream.method431(i1);
  4459. }
  4460. }
  4461. if (l == 213) {
  4462. boolean flag3 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4463. if (!flag3)
  4464. flag3 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4465. crossX = super.saveClickX;
  4466. crossY = super.saveClickY;
  4467. crossType = 2;
  4468. crossIndex = 0;
  4469. stream.createFrame(79);
  4470. stream.method431(k + baseY);
  4471. stream.writeWord(i1);
  4472. stream.method432(j + baseX);
  4473. }
  4474. if (l == 632) {
  4475. stream.createFrame(145);
  4476. stream.method432(k);
  4477. stream.method432(j);
  4478. stream.method432(i1);
  4479. atInventoryLoopCycle = 0;
  4480. atInventoryInterface = k;
  4481. atInventoryIndex = j;
  4482. atInventoryInterfaceType = 2;
  4483. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4484. atInventoryInterfaceType = 1;
  4485. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4486. atInventoryInterfaceType = 3;
  4487. }
  4488. if (l == 1050) {
  4489. stream.createFrame(185);
  4490. stream.writeWord(152);
  4491. }
  4492. if (l == 1004) {
  4493. if (tabInterfaceIDs[14] != -1) {
  4494. if (frameMode != ScreenMode.FIXED && changeTabArea) {
  4495. if (tabID == 14) {
  4496. showTabComponents = !showTabComponents;
  4497. } else {
  4498. showTabComponents = true;
  4499. }
  4500. }
  4501. tabID = 14;
  4502. tabAreaAltered = true;
  4503. }
  4504. }
  4505. if (l == 1003) {
  4506. clanChatMode = 2;
  4507. inputTaken = true;
  4508. }
  4509. if (l == 1002) {
  4510. clanChatMode = 1;
  4511. inputTaken = true;
  4512. }
  4513. if (l == 1001) {
  4514. clanChatMode = 0;
  4515. inputTaken = true;
  4516. }
  4517. if (l == 1000) {
  4518. cButtonCPos = 4;
  4519. chatTypeView = 11;
  4520. inputTaken = true;
  4521. }
  4522. if (l == 999) {
  4523. cButtonCPos = 0;
  4524. chatTypeView = 0;
  4525. inputTaken = true;
  4526. }
  4527. if (l == 998) {
  4528. cButtonCPos = 1;
  4529. chatTypeView = 5;
  4530. inputTaken = true;
  4531. }
  4532. if (l == 997) {
  4533. publicChatMode = 3;
  4534. inputTaken = true;
  4535. }
  4536. if (l == 996) {
  4537. publicChatMode = 2;
  4538. inputTaken = true;
  4539. }
  4540. if (l == 995) {
  4541. publicChatMode = 1;
  4542. inputTaken = true;
  4543. }
  4544. if (l == 994) {
  4545. publicChatMode = 0;
  4546. inputTaken = true;
  4547. }
  4548. if (l == 993) {
  4549. cButtonCPos = 2;
  4550. chatTypeView = 1;
  4551. inputTaken = true;
  4552. }
  4553. if (l == 992) {
  4554. privateChatMode = 2;
  4555. inputTaken = true;
  4556. }
  4557. if (l == 991) {
  4558. privateChatMode = 1;
  4559. inputTaken = true;
  4560. }
  4561. if (l == 990) {
  4562. privateChatMode = 0;
  4563. inputTaken = true;
  4564. }
  4565. if (l == 989) {
  4566. cButtonCPos = 3;
  4567. chatTypeView = 2;
  4568. inputTaken = true;
  4569. }
  4570. if (l == 987) {
  4571. tradeMode = 2;
  4572. inputTaken = true;
  4573. }
  4574. if (l == 986) {
  4575. tradeMode = 1;
  4576. inputTaken = true;
  4577. }
  4578. if (l == 985) {
  4579. tradeMode = 0;
  4580. inputTaken = true;
  4581. }
  4582. if (l == 984) {
  4583. cButtonCPos = 5;
  4584. chatTypeView = 3;
  4585. inputTaken = true;
  4586. }
  4587. if (l == 980) {
  4588. cButtonCPos = 6;
  4589. chatTypeView = 4;
  4590. inputTaken = true;
  4591. }
  4592. if (l == 647) {
  4593. stream.createFrame(213);
  4594. stream.writeWord(k);
  4595. stream.writeWord(j);
  4596. switch (k) {
  4597. case 43704:
  4598. if (j == 0) {
  4599. inputTaken = true;
  4600. inputDialogState = 0;
  4601. messagePromptRaised = true;
  4602. promptInput = "";
  4603. friendsListAction = 8;
  4604. aString1121 = "Enter your clan chat title";
  4605. }
  4606. break;
  4607. }
  4608. }
  4609. if (l == 493) {
  4610. stream.createFrame(75);
  4611. stream.method433(k);
  4612. stream.method431(j);
  4613. stream.method432(i1);
  4614. atInventoryLoopCycle = 0;
  4615. atInventoryInterface = k;
  4616. atInventoryIndex = j;
  4617. atInventoryInterfaceType = 2;
  4618. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4619. atInventoryInterfaceType = 1;
  4620. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4621. atInventoryInterfaceType = 3;
  4622. }
  4623. if (l == 652) {
  4624. boolean flag4 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4625. if (!flag4)
  4626. flag4 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4627. crossX = super.saveClickX;
  4628. crossY = super.saveClickY;
  4629. crossType = 2;
  4630. crossIndex = 0;
  4631. stream.createFrame(156);
  4632. stream.method432(j + baseX);
  4633. stream.method431(k + baseY);
  4634. stream.method433(i1);
  4635. }
  4636. if (l == 647) {
  4637. stream.createFrame(213);
  4638. stream.writeWord(k);
  4639. stream.writeWord(j);
  4640. switch (k) {
  4641. case 43704:
  4642. if (j == 0) {
  4643. inputTaken = true;
  4644. inputDialogState = 0;
  4645. messagePromptRaised = true;
  4646. promptInput = "";
  4647. friendsListAction = 8;
  4648. aString1121 = "Enter your clan chat title";
  4649. }
  4650. break;
  4651. }
  4652. }
  4653. if (l == 94) {
  4654. boolean flag5 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4655. if (!flag5)
  4656. flag5 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4657. crossX = super.saveClickX;
  4658. crossY = super.saveClickY;
  4659. crossType = 2;
  4660. crossIndex = 0;
  4661. stream.createFrame(181);
  4662. stream.method431(k + baseY);
  4663. stream.writeWord(i1);
  4664. stream.method431(j + baseX);
  4665. stream.method432(anInt1137);
  4666. }
  4667. if (l == 646) {
  4668. stream.createFrame(185);
  4669. stream.writeWord(k);
  4670. RSInterface class9_2 = RSInterface.interfaceCache[k];
  4671. if (class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5) {
  4672. int i2 = class9_2.valueIndexArray[0][1];
  4673. if (variousSettings[i2] != class9_2.anIntArray212[0]) {
  4674. variousSettings[i2] = class9_2.anIntArray212[0];
  4675. updateConfigValues(i2);
  4676. }
  4677. }
  4678. switch (k) {
  4679. // clan chat
  4680. case 18129:
  4681. if (RSInterface.interfaceCache[18135].disabledMessage.toLowerCase().contains("join")) {
  4682. inputTaken = true;
  4683. inputDialogState = 0;
  4684. messagePromptRaised = true;
  4685. promptInput = "";
  4686. friendsListAction = 6;
  4687. aString1121 = "Enter the name of the chat you wish to join";
  4688. } else {
  4689. sendString(0, "");
  4690. }
  4691. break;
  4692. case 18132:
  4693. openInterfaceID = 43700;
  4694. break;
  4695. case 43926:
  4696. inputTaken = true;
  4697. inputDialogState = 0;
  4698. messagePromptRaised = true;
  4699. promptInput = "";
  4700. friendsListAction = 9;
  4701. aString1121 = "Enter a name to add";
  4702. break;
  4703. case 43927:
  4704. inputTaken = true;
  4705. inputDialogState = 0;
  4706. messagePromptRaised = true;
  4707. promptInput = "";
  4708. friendsListAction = 10;
  4709. aString1121 = "Enter a name to add";
  4710. break;
  4711. }
  4712. }
  4713. if (l == 225) {
  4714. Npc class30_sub2_sub4_sub1_sub1_2 = npcArray[i1];
  4715. if (class30_sub2_sub4_sub1_sub1_2 != null) {
  4716. 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]);
  4717. crossX = super.saveClickX;
  4718. crossY = super.saveClickY;
  4719. crossType = 2;
  4720. crossIndex = 0;
  4721. anInt1226 += i1;
  4722. if (anInt1226 >= 85) {
  4723. stream.createFrame(230);
  4724. stream.writeWordBigEndian(239);
  4725. anInt1226 = 0;
  4726. }
  4727. stream.createFrame(17);
  4728. stream.method433(i1);
  4729. }
  4730. }
  4731. if (l == 965) {
  4732. Npc class30_sub2_sub4_sub1_sub1_3 = npcArray[i1];
  4733. if (class30_sub2_sub4_sub1_sub1_3 != null) {
  4734. 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]);
  4735. crossX = super.saveClickX;
  4736. crossY = super.saveClickY;
  4737. crossType = 2;
  4738. crossIndex = 0;
  4739. anInt1134++;
  4740. if (anInt1134 >= 96) {
  4741. stream.createFrame(152);
  4742. stream.writeWordBigEndian(88);
  4743. anInt1134 = 0;
  4744. }
  4745. stream.createFrame(21);
  4746. stream.writeWord(i1);
  4747. }
  4748. }
  4749. if (l == 413) {
  4750. Npc class30_sub2_sub4_sub1_sub1_4 = npcArray[i1];
  4751. if (class30_sub2_sub4_sub1_sub1_4 != null) {
  4752. 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]);
  4753. crossX = super.saveClickX;
  4754. crossY = super.saveClickY;
  4755. crossType = 2;
  4756. crossIndex = 0;
  4757. stream.createFrame(131);
  4758. stream.method433(i1);
  4759. stream.method432(anInt1137);
  4760. }
  4761. }
  4762. if (l == 200)
  4763. clearTopInterfaces();
  4764. if (l == 1025) {
  4765. Npc class30_sub2_sub4_sub1_sub1_5 = npcArray[i1];
  4766. if (class30_sub2_sub4_sub1_sub1_5 != null) {
  4767. EntityDef entityDef = class30_sub2_sub4_sub1_sub1_5.desc;
  4768. if (entityDef.childrenIDs != null)
  4769. entityDef = entityDef.method161();
  4770. if (entityDef != null) {
  4771. String s9;
  4772. if (entityDef.description != null)
  4773. s9 = new String(entityDef.description);
  4774. else
  4775. s9 = "It's a " + entityDef.name + ".";
  4776. pushMessage(s9, 0, "");
  4777. }
  4778. }
  4779. }
  4780. if (l == 900) {
  4781. method66(i1, k, j);
  4782. stream.createFrame(252);
  4783. stream.method433(i1 >> 14 & 0x7fff);
  4784. stream.method431(k + baseY);
  4785. stream.method432(j + baseX);
  4786. }
  4787. if (l == 412) {
  4788. Npc class30_sub2_sub4_sub1_sub1_6 = npcArray[i1];
  4789. if (class30_sub2_sub4_sub1_sub1_6 != null) {
  4790. 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]);
  4791. crossX = super.saveClickX;
  4792. crossY = super.saveClickY;
  4793. crossType = 2;
  4794. crossIndex = 0;
  4795. stream.createFrame(72);
  4796. stream.method432(i1);
  4797. }
  4798. }
  4799. if (l == 365) {
  4800. Player class30_sub2_sub4_sub1_sub2_3 = playerArray[i1];
  4801. if (class30_sub2_sub4_sub1_sub2_3 != null) {
  4802. 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]);
  4803. crossX = super.saveClickX;
  4804. crossY = super.saveClickY;
  4805. crossType = 2;
  4806. crossIndex = 0;
  4807. stream.createFrame(249);
  4808. stream.method432(i1);
  4809. stream.method431(anInt1137);
  4810. }
  4811. }
  4812. if (l == 729) {
  4813. Player class30_sub2_sub4_sub1_sub2_4 = playerArray[i1];
  4814. if (class30_sub2_sub4_sub1_sub2_4 != null) {
  4815. 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]);
  4816. crossX = super.saveClickX;
  4817. crossY = super.saveClickY;
  4818. crossType = 2;
  4819. crossIndex = 0;
  4820. stream.createFrame(39);
  4821. stream.method431(i1);
  4822. }
  4823. }
  4824. if (l == 577) {
  4825. Player class30_sub2_sub4_sub1_sub2_5 = playerArray[i1];
  4826. if (class30_sub2_sub4_sub1_sub2_5 != null) {
  4827. 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]);
  4828. crossX = super.saveClickX;
  4829. crossY = super.saveClickY;
  4830. crossType = 2;
  4831. crossIndex = 0;
  4832. stream.createFrame(139);
  4833. stream.method431(i1);
  4834. }
  4835. }
  4836. if (l == 956 && method66(i1, k, j)) {
  4837. stream.createFrame(35);
  4838. stream.method431(j + baseX);
  4839. stream.method432(anInt1137);
  4840. stream.method432(k + baseY);
  4841. stream.method431(i1 >> 14 & 0x7fff);
  4842. }
  4843. if (l == 567) {
  4844. boolean flag6 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4845. if (!flag6)
  4846. flag6 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4847. crossX = super.saveClickX;
  4848. crossY = super.saveClickY;
  4849. crossType = 2;
  4850. crossIndex = 0;
  4851. stream.createFrame(23);
  4852. stream.method431(k + baseY);
  4853. stream.method431(i1);
  4854. stream.method431(j + baseX);
  4855. }
  4856. if (l == 867) {
  4857. if ((i1 & 3) == 0)
  4858. anInt1175++;
  4859. if (anInt1175 >= 59) {
  4860. stream.createFrame(200);
  4861. stream.writeWord(25501);
  4862. anInt1175 = 0;
  4863. }
  4864. stream.createFrame(43);
  4865. stream.method431(k);
  4866. stream.method432(i1);
  4867. stream.method432(j);
  4868. atInventoryLoopCycle = 0;
  4869. atInventoryInterface = k;
  4870. atInventoryIndex = j;
  4871. atInventoryInterfaceType = 2;
  4872. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4873. atInventoryInterfaceType = 1;
  4874. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4875. atInventoryInterfaceType = 3;
  4876. }
  4877. if (l == 543) {
  4878. stream.createFrame(237);
  4879. stream.writeWord(j);
  4880. stream.method432(i1);
  4881. stream.writeWord(k);
  4882. stream.method432(anInt1137);
  4883. atInventoryLoopCycle = 0;
  4884. atInventoryInterface = k;
  4885. atInventoryIndex = j;
  4886. atInventoryInterfaceType = 2;
  4887. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4888. atInventoryInterfaceType = 1;
  4889. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4890. atInventoryInterfaceType = 3;
  4891. }
  4892. if (l == 606) {
  4893. stream.createFrame(185);
  4894. stream.writeWord(606);
  4895. }
  4896. if (l == 491) {
  4897. Player class30_sub2_sub4_sub1_sub2_6 = playerArray[i1];
  4898. if (class30_sub2_sub4_sub1_sub2_6 != null) {
  4899. 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]);
  4900. crossX = super.saveClickX;
  4901. crossY = super.saveClickY;
  4902. crossType = 2;
  4903. crossIndex = 0;
  4904. stream.createFrame(14);
  4905. stream.method432(anInt1284);
  4906. stream.writeWord(i1);
  4907. stream.writeWord(anInt1285);
  4908. stream.method431(anInt1283);
  4909. }
  4910. }
  4911. if (l == 639) {
  4912. String s3 = menuActionName[i];
  4913. int k2 = s3.indexOf("@whi@");
  4914. if (k2 != -1) {
  4915. long l4 = TextClass.longForName(s3.substring(k2 + 5).trim());
  4916. int k3 = -1;
  4917. for (int i4 = 0; i4 < friendsCount; i4++) {
  4918. if (friendsListAsLongs[i4] != l4)
  4919. continue;
  4920. k3 = i4;
  4921. break;
  4922. }
  4923.  
  4924. if (k3 != -1 && friendsNodeIDs[k3] > 0) {
  4925. inputTaken = true;
  4926. inputDialogState = 0;
  4927. messagePromptRaised = true;
  4928. promptInput = "";
  4929. friendsListAction = 3;
  4930. aLong953 = friendsListAsLongs[k3];
  4931. aString1121 = "Enter message to send to " + friendsList[k3];
  4932. }
  4933. }
  4934. }
  4935. if (l == 454) {
  4936. stream.createFrame(41);
  4937. stream.writeWord(i1);
  4938. stream.method432(j);
  4939. stream.method432(k);
  4940. atInventoryLoopCycle = 0;
  4941. atInventoryInterface = k;
  4942. atInventoryIndex = j;
  4943. atInventoryInterfaceType = 2;
  4944. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4945. atInventoryInterfaceType = 1;
  4946. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4947. atInventoryInterfaceType = 3;
  4948. }
  4949. if (l == 478) {
  4950. Npc class30_sub2_sub4_sub1_sub1_7 = npcArray[i1];
  4951. if (class30_sub2_sub4_sub1_sub1_7 != null) {
  4952. 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]);
  4953. crossX = super.saveClickX;
  4954. crossY = super.saveClickY;
  4955. crossType = 2;
  4956. crossIndex = 0;
  4957. if ((i1 & 3) == 0)
  4958. anInt1155++;
  4959. if (anInt1155 >= 53) {
  4960. stream.createFrame(85);
  4961. stream.writeWordBigEndian(66);
  4962. anInt1155 = 0;
  4963. }
  4964. stream.createFrame(18);
  4965. stream.method431(i1);
  4966. }
  4967. }
  4968. if (l == 113) {
  4969. method66(i1, k, j);
  4970. stream.createFrame(70);
  4971. stream.method431(j + baseX);
  4972. stream.writeWord(k + baseY);
  4973. stream.method433(i1 >> 14 & 0x7fff);
  4974. }
  4975. if (l == 872) {
  4976. method66(i1, k, j);
  4977. stream.createFrame(234);
  4978. stream.method433(j + baseX);
  4979. stream.method432(i1 >> 14 & 0x7fff);
  4980. stream.method433(k + baseY);
  4981. }
  4982. if (l == 502) {
  4983. method66(i1, k, j);
  4984. stream.createFrame(132);
  4985. stream.method433(j + baseX);
  4986. stream.writeWord(i1 >> 14 & 0x7fff);
  4987. stream.method432(k + baseY);
  4988. }
  4989. if (l == 1125) {
  4990. ItemDef itemDef = ItemDef.forID(i1);
  4991. RSInterface class9_4 = RSInterface.interfaceCache[k];
  4992. String s5;
  4993. if (class9_4 == null) {
  4994. return;
  4995. }
  4996. if (class9_4 != null && class9_4.invStackSizes != null && class9_4.invStackSizes[j] >= 0x186a0) {
  4997. DecimalFormatSymbols separator = new DecimalFormatSymbols();
  4998. separator.setGroupingSeparator(',');
  4999. DecimalFormat formatter = new DecimalFormat("#,###,###,###", separator);
  5000. s5 = formatter.format(class9_4.invStackSizes[j]) + " x " + itemDef.name;
  5001. } else if (itemDef.description != null)
  5002. s5 = new String(itemDef.description);
  5003. else
  5004. s5 = "It's a " + itemDef.name + ".";
  5005. pushMessage(s5, 0, "");
  5006. }
  5007. if (l == 169) {
  5008. stream.createFrame(185);
  5009. stream.writeWord(k);
  5010. RSInterface class9_3 = RSInterface.interfaceCache[k];
  5011. if (class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5) {
  5012. int l2 = class9_3.valueIndexArray[0][1];
  5013. variousSettings[l2] = 1 - variousSettings[l2];
  5014. updateConfigValues(l2);
  5015. }
  5016. }
  5017. if (l == 447) {
  5018. itemSelected = 1;
  5019. anInt1283 = j;
  5020. anInt1284 = k;
  5021. anInt1285 = i1;
  5022. selectedItemName = ItemDef.forID(i1).name;
  5023. spellSelected = 0;
  5024. return;
  5025. }
  5026. if (l == 1226) {
  5027. int j1 = i1 >> 14 & 0x7fff;
  5028. ObjectDef class46 = ObjectDef.forID(j1);
  5029. String s10;
  5030. if (class46.description != null)
  5031. s10 = new String(class46.description);
  5032. else
  5033. s10 = "It's a " + class46.name + ".";
  5034. pushMessage(s10, 0, "");
  5035. }
  5036. if (l == 244) {
  5037. boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  5038. if (!flag7)
  5039. flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  5040. crossX = super.saveClickX;
  5041. crossY = super.saveClickY;
  5042. crossType = 2;
  5043. crossIndex = 0;
  5044. stream.createFrame(253);
  5045. stream.method431(j + baseX);
  5046. stream.method433(k + baseY);
  5047. stream.method432(i1);
  5048. }
  5049. if (l == 1448) {
  5050. ItemDef itemDef_1 = ItemDef.forID(i1);
  5051. String s6;
  5052. if (itemDef_1.description != null) {
  5053. s6 = new String(itemDef_1.description);
  5054. } else {
  5055. s6 = "It's a " + itemDef_1.name + ".";
  5056. }
  5057. pushMessage(s6, 0, "");
  5058. }
  5059. itemSelected = 0;
  5060. spellSelected = 0;
  5061.  
  5062. }
  5063.  
  5064. @SuppressWarnings("unused")
  5065. private void method70() {
  5066. anInt1251 = 0;
  5067. int j = (myPlayer.x >> 7) + baseX;
  5068. int k = (myPlayer.y >> 7) + baseY;
  5069. if (j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
  5070. anInt1251 = 1;
  5071. if (j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
  5072. anInt1251 = 1;
  5073. if (anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
  5074. anInt1251 = 0;
  5075. }
  5076.  
  5077. public void run() {
  5078. if (drawFlames) {
  5079. drawFlames();
  5080. } else {
  5081. super.run();
  5082. }
  5083. }
  5084.  
  5085. private void build3dScreenMenu() {
  5086. if (itemSelected == 0 && spellSelected == 0) {
  5087. menuActionName[menuActionRow] = "Walk here";
  5088. menuActionID[menuActionRow] = 519;
  5089. menuActionCmd2[menuActionRow] = super.mouseX;
  5090. menuActionCmd3[menuActionRow] = super.mouseY;
  5091. menuActionRow++;
  5092. }
  5093. int j = -1;
  5094. for (int k = 0; k < Model.anInt1687; k++) {
  5095. int l = Model.anIntArray1688[k];
  5096. int i1 = l & 0x7f;
  5097. int j1 = l >> 7 & 0x7f;
  5098. int k1 = l >> 29 & 3;
  5099. int l1 = l >> 14 & 0x7fff;
  5100. if (l == j)
  5101. continue;
  5102. j = l;
  5103. if (k1 == 2) {
  5104. }
  5105. if (k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0) {
  5106. ObjectDef class46 = ObjectDef.forID(l1);
  5107. if (class46.childrenIDs != null)
  5108. class46 = class46.method580();
  5109. if (class46 == null) {
  5110. continue;
  5111. }
  5112. if (itemSelected == 1) {
  5113. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @cya@" + class46.name;
  5114. menuActionID[menuActionRow] = 62;
  5115. menuActionCmd1[menuActionRow] = l;
  5116. menuActionCmd2[menuActionRow] = i1;
  5117. menuActionCmd3[menuActionRow] = j1;
  5118. menuActionRow++;
  5119. } else if (spellSelected == 1) {
  5120. if ((spellUsableOn & 4) == 4) {
  5121. menuActionName[menuActionRow] = spellTooltip + " @cya@" + class46.name;
  5122. menuActionID[menuActionRow] = 956;
  5123. menuActionCmd1[menuActionRow] = l;
  5124. menuActionCmd2[menuActionRow] = i1;
  5125. menuActionCmd3[menuActionRow] = j1;
  5126. menuActionRow++;
  5127. }
  5128. } else {
  5129. if (class46.actions != null) {
  5130. for (int i2 = 4; i2 >= 0; i2--)
  5131. if (class46.actions[i2] != null) {
  5132. menuActionName[menuActionRow] = class46.actions[i2] + " @cya@" + class46.name;
  5133. if (i2 == 0)
  5134. menuActionID[menuActionRow] = 502;
  5135. if (i2 == 1)
  5136. menuActionID[menuActionRow] = 900;
  5137. if (i2 == 2)
  5138. menuActionID[menuActionRow] = 113;
  5139. if (i2 == 3)
  5140. menuActionID[menuActionRow] = 872;
  5141. if (i2 == 4)
  5142. menuActionID[menuActionRow] = 1062;
  5143. menuActionCmd1[menuActionRow] = l;
  5144. menuActionCmd2[menuActionRow] = i1;
  5145. menuActionCmd3[menuActionRow] = j1;
  5146. menuActionRow++;
  5147. }
  5148.  
  5149. }
  5150. if (ClientConstants.DEBUG_MODE) {
  5151. menuActionName[menuActionRow] = "Examine @cya@" + class46.name + " @gre@(@whi@" + l1 + "@gre@) (@whi@" + (i1 + baseX) + "," + (j1 + baseY) + "@gre@)";
  5152. } else {
  5153. menuActionName[menuActionRow] = "Examine @cya@" + class46.name;
  5154. }
  5155. menuActionID[menuActionRow] = 1226;
  5156. menuActionCmd1[menuActionRow] = class46.type << 14;
  5157. menuActionCmd2[menuActionRow] = i1;
  5158. menuActionCmd3[menuActionRow] = j1;
  5159. menuActionRow++;
  5160. }
  5161. }
  5162. if (k1 == 1) {
  5163. Npc npc = npcArray[l1];
  5164. try {
  5165. if (npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64) {
  5166. for (int j2 = 0; j2 < npcCount; j2++) {
  5167. Npc npc2 = npcArray[npcIndices[j2]];
  5168. if (npc2 != null && npc2 != npc && npc2.desc.aByte68 == 1 && npc2.x == npc.x && npc2.y == npc.y)
  5169. buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
  5170. }
  5171. for (int l2 = 0; l2 < playerCount; l2++) {
  5172. Player player = playerArray[playerIndices[l2]];
  5173. if (player != null && player.x == npc.x && player.y == npc.y)
  5174. buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
  5175. }
  5176. }
  5177. buildAtNPCMenu(npc.desc, l1, j1, i1);
  5178. } catch (Exception e) {
  5179. }
  5180. }
  5181. if (k1 == 0) {
  5182. Player player = playerArray[l1];
  5183. if ((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  5184. for (int k2 = 0; k2 < npcCount; k2++) {
  5185. Npc class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
  5186. 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)
  5187. buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc, npcIndices[k2], j1, i1);
  5188. }
  5189.  
  5190. for (int i3 = 0; i3 < playerCount; i3++) {
  5191. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
  5192. 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)
  5193. buildAtPlayerMenu(i1, playerIndices[i3], class30_sub2_sub4_sub1_sub2_2, j1);
  5194. }
  5195.  
  5196. }
  5197. buildAtPlayerMenu(i1, l1, player, j1);
  5198. }
  5199. if (k1 == 3) {
  5200. NodeList class19 = groundArray[plane][i1][j1];
  5201. if (class19 != null) {
  5202. for (Item item = (Item) class19.getFirst(); item != null; item = (Item) class19.getNext()) {
  5203. ItemDef itemDef = ItemDef.forID(item.ID);
  5204. if (itemSelected == 1) {
  5205. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  5206. menuActionID[menuActionRow] = 511;
  5207. menuActionCmd1[menuActionRow] = item.ID;
  5208. menuActionCmd2[menuActionRow] = i1;
  5209. menuActionCmd3[menuActionRow] = j1;
  5210. menuActionRow++;
  5211. } else if (spellSelected == 1) {
  5212. if ((spellUsableOn & 1) == 1) {
  5213. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  5214. menuActionID[menuActionRow] = 94;
  5215. menuActionCmd1[menuActionRow] = item.ID;
  5216. menuActionCmd2[menuActionRow] = i1;
  5217. menuActionCmd3[menuActionRow] = j1;
  5218. menuActionRow++;
  5219. }
  5220. } else {
  5221. for (int j3 = 4; j3 >= 0; j3--)
  5222. if (itemDef.groundActions != null && itemDef.groundActions[j3] != null) {
  5223. menuActionName[menuActionRow] = itemDef.groundActions[j3] + " @lre@" + itemDef.name;
  5224. if (j3 == 0)
  5225. menuActionID[menuActionRow] = 652;
  5226. if (j3 == 1)
  5227. menuActionID[menuActionRow] = 567;
  5228. if (j3 == 2)
  5229. menuActionID[menuActionRow] = 234;
  5230. if (j3 == 3)
  5231. menuActionID[menuActionRow] = 244;
  5232. if (j3 == 4)
  5233. menuActionID[menuActionRow] = 213;
  5234. menuActionCmd1[menuActionRow] = item.ID;
  5235. menuActionCmd2[menuActionRow] = i1;
  5236. menuActionCmd3[menuActionRow] = j1;
  5237. menuActionRow++;
  5238. } else if (j3 == 2) {
  5239. menuActionName[menuActionRow] = "Take @lre@" + itemDef.name;
  5240. menuActionID[menuActionRow] = 234;
  5241. menuActionCmd1[menuActionRow] = item.ID;
  5242. menuActionCmd2[menuActionRow] = i1;
  5243. menuActionCmd3[menuActionRow] = j1;
  5244. menuActionRow++;
  5245. }
  5246. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  5247. menuActionID[menuActionRow] = 1448;
  5248. menuActionCmd1[menuActionRow] = item.ID;
  5249. menuActionCmd2[menuActionRow] = i1;
  5250. menuActionCmd3[menuActionRow] = j1;
  5251. menuActionRow++;
  5252. }
  5253. }
  5254.  
  5255. }
  5256. }
  5257. }
  5258. }
  5259.  
  5260. public void cleanUpForQuit() {
  5261. Signlink.reporterror = false;
  5262. try {
  5263. if (socketStream != null) {
  5264. socketStream.close();
  5265. }
  5266. } catch (Exception _ex) {
  5267. }
  5268. socketStream = null;
  5269. stopMidi();
  5270. if (mouseDetection != null)
  5271. mouseDetection.running = false;
  5272. mouseDetection = null;
  5273. onDemandFetcher.disable();
  5274. onDemandFetcher = null;
  5275. aStream_834 = null;
  5276. stream = null;
  5277. aStream_847 = null;
  5278. inStream = null;
  5279. anIntArray1234 = null;
  5280. aByteArrayArray1183 = null;
  5281. aByteArrayArray1247 = null;
  5282. anIntArray1235 = null;
  5283. anIntArray1236 = null;
  5284. intGroundArray = null;
  5285. byteGroundArray = null;
  5286. worldController = null;
  5287. aClass11Array1230 = null;
  5288. anIntArrayArray901 = null;
  5289. anIntArrayArray825 = null;
  5290. bigX = null;
  5291. bigY = null;
  5292. aByteArray912 = null;
  5293. aRSImageProducer_1163 = null;
  5294. leftFrame = null;
  5295. topFrame = null;
  5296. aRSImageProducer_1164 = null;
  5297. aRSImageProducer_1165 = null;
  5298. aRSImageProducer_1166 = null;
  5299. aRSImageProducer_1125 = null;
  5300. /* Null pointers for custom sprites */
  5301. cacheSprite = null;
  5302. mapBack = null;
  5303. sideIcons = null;
  5304. compass = null;
  5305. hitMarks = null;
  5306. skillIcons = null;
  5307. newHitMarks = null;
  5308. channelButtons = null;
  5309. fixedGameComponents = null;
  5310. skillIcons = null;
  5311. gameComponents = null;
  5312. orbComponents = null;
  5313. orbComponents2 = null;
  5314. orbComponents3 = null;
  5315. redStones = null;
  5316. hpBars = null;
  5317. headIcons = null;
  5318. skullIcons = null;
  5319. headIconsHint = null;
  5320. crosses = null;
  5321. mapDotItem = null;
  5322. mapDotNPC = null;
  5323. mapDotPlayer = null;
  5324. mapDotFriend = null;
  5325. mapDotTeam = null;
  5326. mapScenes = null;
  5327. mapFunctions = null;
  5328. anIntArrayArray929 = null;
  5329. playerArray = null;
  5330. playerIndices = null;
  5331. anIntArray894 = null;
  5332. aStreamArray895s = null;
  5333. anIntArray840 = null;
  5334. npcArray = null;
  5335. npcIndices = null;
  5336. groundArray = null;
  5337. aClass19_1179 = null;
  5338. aClass19_1013 = null;
  5339. aClass19_1056 = null;
  5340. menuActionCmd2 = null;
  5341. menuActionCmd3 = null;
  5342. menuActionID = null;
  5343. menuActionCmd1 = null;
  5344. menuActionName = null;
  5345. variousSettings = null;
  5346. anIntArray1072 = null;
  5347. anIntArray1073 = null;
  5348. aClass30_Sub2_Sub1_Sub1Array1140 = null;
  5349. minimapImage = null;
  5350. friendsList = null;
  5351. friendsListAsLongs = null;
  5352. friendsNodeIDs = null;
  5353. aRSImageProducer_1110 = null;
  5354. aRSImageProducer_1111 = null;
  5355. aRSImageProducer_1107 = null;
  5356. aRSImageProducer_1108 = null;
  5357. aRSImageProducer_1109 = null;
  5358. aRSImageProducer_1112 = null;
  5359. aRSImageProducer_1113 = null;
  5360. aRSImageProducer_1114 = null;
  5361. aRSImageProducer_1115 = null;
  5362. multiOverlay = null;
  5363. nullLoader();
  5364. ObjectDef.nullLoader();
  5365. EntityDef.nullLoader();
  5366. ItemDef.nullLoader();
  5367. Floor.cache = null;
  5368. // OverlayFloor.overlayFloor = null;
  5369. IdentityKit.cache = null;
  5370. RSInterface.interfaceCache = null;
  5371. Animation.anims = null;
  5372. SpotAnim.cache = null;
  5373. SpotAnim.aMRUNodes_415 = null;
  5374. Varp.cache = null;
  5375. super.fullGameScreen = null;
  5376. Player.mruNodes = null;
  5377. Rasterizer.nullLoader();
  5378. WorldController.nullLoader();
  5379. Model.nullLoader();
  5380. SequenceFrame.nullLoader();
  5381. // Texture.reset();
  5382. System.gc();
  5383. }
  5384.  
  5385. Component getGameComponent() {
  5386. if (Signlink.mainapp != null)
  5387. return Signlink.mainapp;
  5388. if (super.gameFrame != null)
  5389. return super.gameFrame;
  5390. else
  5391. return this;
  5392. }
  5393.  
  5394. private void doTextField(RSInterface rsint) {
  5395.  
  5396. int rsid = rsint.parentID;
  5397.  
  5398. if (rsid == 6142) {
  5399. for (int slot = 0; slot < 100; slot++) {
  5400. RSInterface.interfaceCache[61266 + slot].disabledSprite = new Sprite(32, 32);
  5401. RSInterface.interfaceCache[61101 + slot].disabledMessage = "";
  5402. }
  5403.  
  5404. int found = 0;
  5405.  
  5406. for (int i = 0, slot = 0; i < ItemDef.totalItems && slot < 100; i++) {
  5407. if (ItemDef.forID(i).name == null || ItemDef.forID(i).certTemplateID == i - 1 || ItemDef.forID(i).certID == i - 1) {
  5408. continue;
  5409. }
  5410.  
  5411. if (ItemDef.forID(i).name.toLowerCase().contains(RSInterface.interfaceCache[RSInterface.currentInputField.id].disabledMessage.toLowerCase())) {
  5412. RSInterface.interfaceCache[61266 + slot].enabledSprite = ItemDef.getSprite(i, 1, 0);
  5413. RSInterface.interfaceCache[61266 + slot].disabledSprite = ItemDef.getSprite(i, 1, 0);
  5414. RSInterface.interfaceCache[61101 + slot++].disabledMessage = ItemDef.forID(i).name;
  5415. found++;
  5416. }
  5417. }
  5418.  
  5419. RSInterface.interfaceCache[61100].scrollMax = 40 * found + 12;
  5420. }
  5421. }
  5422.  
  5423. private void method73() {
  5424. do {
  5425. int j = readChar(-796);
  5426. if (j == -1)
  5427. break;
  5428. if (j == 96)
  5429. break;
  5430. if (RSInterface.currentInputField != null) {
  5431. boolean update = false;
  5432.  
  5433. RSInterface rsTextField = RSInterface.interfaceCache[RSInterface.currentInputField.id];
  5434.  
  5435. String message = TextClass.capitalize(rsTextField.disabledMessage);
  5436.  
  5437. if (j == 8 && message.length() > 0) {
  5438. message = message.substring(0, message.length() - 1);
  5439. if (message.length() > 0 && RSInterface.currentInputField.onlyNumbers && !RSInterface.currentInputField.displayAsterisks) {
  5440. long num = Long.valueOf(message.replaceAll(",", ""));
  5441.  
  5442. if (num > Integer.MAX_VALUE) {
  5443. num = Integer.MAX_VALUE;
  5444. rsTextField.disabledMessage = num + "";
  5445. }
  5446.  
  5447. message = NumberFormat.getInstance(Locale.US).format(num);
  5448. }
  5449. update = true;
  5450. }
  5451.  
  5452. if ((RSInterface.currentInputField.onlyNumbers ? (j >= 48 && j <= 57) : (j >= 32 && j <= 122)) && message.length() < RSInterface.currentInputField.characterLimit) {
  5453. message += (char) j;
  5454. if (RSInterface.currentInputField.onlyNumbers && !RSInterface.currentInputField.displayAsterisks) {
  5455. long num = Long.valueOf(message.replaceAll(",", ""));
  5456.  
  5457. if (num > Integer.MAX_VALUE) {
  5458. num = Integer.MAX_VALUE;
  5459. rsTextField.disabledMessage = num + "";
  5460. }
  5461.  
  5462. message = NumberFormat.getInstance(Locale.US).format(num);
  5463. }
  5464. update = true;
  5465. }
  5466.  
  5467. rsTextField.disabledMessage = message;
  5468.  
  5469. if ((j == 13 || j == 10) && rsTextField.disabledMessage.length() > 0) {
  5470. if (RSInterface.currentInputField.onlyNumbers) {
  5471. long amount = 0;
  5472.  
  5473. try {
  5474. amount = Long.parseLong(message.replaceAll(",", ""));
  5475.  
  5476. // overflow concious code
  5477. if (amount < -Integer.MAX_VALUE) {
  5478. amount = -Integer.MAX_VALUE;
  5479. } else if (amount > Integer.MAX_VALUE) {
  5480. amount = Integer.MAX_VALUE;
  5481. }
  5482. } catch (Exception ignored) {
  5483. }
  5484.  
  5485. if (amount > 0) {
  5486. stream.createFrame(208);
  5487. stream.writeDWord((int) amount);
  5488. }
  5489. } else {
  5490. stream.createFrame(150);
  5491. stream.writeWordBigEndian(RSInterface.currentInputField.disabledMessage.length() + 3);
  5492. stream.writeWord(RSInterface.currentInputField.id);
  5493. stream.writeString(RSInterface.currentInputField.disabledMessage);
  5494. }
  5495. RSInterface.currentInputField.disabledMessage = "";
  5496. RSInterface.currentInputField = null;
  5497. }
  5498.  
  5499. if (update) {
  5500. doTextField(rsTextField);
  5501. }
  5502. } else if (console.openConsole) {
  5503. if (j == 8 && console.consoleInput.length() > 0) {
  5504. console.consoleInput = console.consoleInput.substring(0, console.consoleInput.length() - 1);
  5505. }
  5506. if (j >= 32 && j <= 122 && console.consoleInput.length() < 80) {
  5507. console.consoleInput += (char) j;
  5508. }
  5509. if ((j == 13 || j == 10) && console.consoleInput.length() > 0) {
  5510. console.sendConsoleMessage(console.consoleInput, true);
  5511. console.sendConsoleCommands(console.consoleInput);
  5512. console.consoleInput = "";
  5513. inputTaken = true;
  5514. }
  5515. } else if (openInterfaceID != -1 && openInterfaceID == reportAbuseInterfaceID) {
  5516. if (j == 8 && reportAbuseInput.length() > 0)
  5517. reportAbuseInput = reportAbuseInput.substring(0, reportAbuseInput.length() - 1);
  5518. if ((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48 && j <= 57 || j == 32) && reportAbuseInput.length() < 12)
  5519. reportAbuseInput += (char) j;
  5520. } else if (messagePromptRaised) {
  5521. if (j >= 32 && j <= 122 && promptInput.length() < 80) {
  5522. promptInput += (char) j;
  5523. inputTaken = true;
  5524. }
  5525. if (j == 8 && promptInput.length() > 0) {
  5526. promptInput = promptInput.substring(0, promptInput.length() - 1);
  5527. inputTaken = true;
  5528. }
  5529. if (j == 13 || j == 10) {
  5530. messagePromptRaised = false;
  5531. inputTaken = true;
  5532. if (friendsListAction == 1) {
  5533. long l = TextClass.longForName(promptInput);
  5534. addFriend(l);
  5535. }
  5536. if (friendsListAction == 2 && friendsCount > 0) {
  5537. long l1 = TextClass.longForName(promptInput);
  5538. delFriend(l1);
  5539. }
  5540. if (friendsListAction == 557 && promptInput.length() > 0) {
  5541. inputString = "::withdrawmp " + promptInput;
  5542. sendPacket(103);
  5543. }
  5544. if (friendsListAction == 51504 && promptInput.length() > 0) {
  5545. inputString = "::find " + promptInput;
  5546. sendPacket(103);
  5547. }
  5548. if (friendsListAction == 59800 && promptInput.length() > 0) {
  5549. inputString = "::droptablesearch " + promptInput;
  5550. sendPacket(103);
  5551. }
  5552. if (friendsListAction == 3 && promptInput.length() > 0) {
  5553. stream.createFrame(126);
  5554. stream.writeWordBigEndian(0);
  5555. int k = stream.currentOffset;
  5556. stream.writeQWord(aLong953);
  5557. TextInput.method526(promptInput, stream);
  5558. stream.writeBytes(stream.currentOffset - k);
  5559. promptInput = TextInput.processText(promptInput);
  5560. // promptInput = Censor.doCensor(promptInput);
  5561. pushMessage(promptInput, 6, TextClass.fixName(TextClass.nameForLong(aLong953)));
  5562. if (privateChatMode == 2) {
  5563. privateChatMode = 1;
  5564. stream.createFrame(95);
  5565. stream.writeWordBigEndian(publicChatMode);
  5566. stream.writeWordBigEndian(privateChatMode);
  5567. stream.writeWordBigEndian(tradeMode);
  5568. }
  5569. }
  5570. if (friendsListAction == 4 && ignoreCount < 100) {
  5571. long l2 = TextClass.longForName(promptInput);
  5572. addIgnore(l2);
  5573. }
  5574. if (friendsListAction == 5 && ignoreCount > 0) {
  5575. long l3 = TextClass.longForName(promptInput);
  5576. delIgnore(l3);
  5577. }
  5578. if (friendsListAction == 6) {
  5579. sendStringAsLong(promptInput);
  5580. } else if (friendsListAction == 8) {
  5581. sendString(1, promptInput);
  5582. } else if (friendsListAction == 9) {
  5583. sendString(2, promptInput);
  5584. } else if (friendsListAction == 10) {
  5585. sendString(3, promptInput);
  5586. }
  5587. }
  5588. } else if (inputDialogState == 1) {
  5589. if (j >= 48 && j <= 57 && amountOrNameInput.length() < 10) {
  5590. amountOrNameInput += (char) j;
  5591. inputTaken = true;
  5592. }
  5593. if ((!amountOrNameInput.toLowerCase().contains("k") && !amountOrNameInput.toLowerCase().contains("m") && !amountOrNameInput.toLowerCase().contains("b")) && (j == 107 || j == 109) || j == 98) {
  5594. amountOrNameInput += (char) j;
  5595. inputTaken = true;
  5596. }
  5597. if (j == 8 && amountOrNameInput.length() > 0) {
  5598. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5599. inputTaken = true;
  5600. }
  5601. if (j == 13 || j == 10) {
  5602. if (amountOrNameInput.length() > 0) {
  5603. int length = amountOrNameInput.length();
  5604. char lastChar = amountOrNameInput.charAt(length - 1);
  5605.  
  5606. if (lastChar == 'k') {
  5607. amountOrNameInput = amountOrNameInput.substring(0, length - 1) + "000";
  5608. } else if (lastChar == 'm') {
  5609. amountOrNameInput = amountOrNameInput.substring(0, length - 1) + "000000";
  5610. } else if (lastChar == 'b') {
  5611. amountOrNameInput = amountOrNameInput.substring(0, length - 1) + "000000000";
  5612. }
  5613.  
  5614. long amount = 0;
  5615.  
  5616. try {
  5617. amount = Long.parseLong(amountOrNameInput);
  5618.  
  5619. // overflow concious code
  5620. if (amount < 0) {
  5621. amount = 0;
  5622. } else if (amount > Integer.MAX_VALUE) {
  5623. amount = Integer.MAX_VALUE;
  5624. }
  5625. } catch (Exception ignored) {
  5626. }
  5627.  
  5628. if (amount > 0) {
  5629. stream.createFrame(208);
  5630. stream.writeDWord((int) amount);
  5631. if (openInterfaceID == 5292) {
  5632. modifiableXValue = (int) amount;
  5633. }
  5634. }
  5635. }
  5636.  
  5637. inputDialogState = 0;
  5638. inputTaken = true;
  5639. }
  5640. } else if (inputDialogState == 2) {
  5641. if (j >= 32 && j <= 122 && amountOrNameInput.length() < 12) {
  5642. amountOrNameInput += (char) j;
  5643. inputTaken = true;
  5644. if (openInterfaceID == 5292 && variousSettings[1012] == 1) {
  5645. RSInterface bank = RSInterface.interfaceCache[5382];
  5646. Arrays.fill(bankInvTemp, 0);
  5647. Arrays.fill(bankStackTemp, 0);
  5648. for (int slot = 0, bankSlot = 0; slot < bank.inv.length; slot++) {
  5649. if (bank.inv[slot] - 1 > 0) {
  5650. if (ItemDef.forID(bank.inv[slot] - 1).name.toLowerCase().contains(amountOrNameInput.toLowerCase())) {
  5651. bankInvTemp[bankSlot] = bank.inv[slot];
  5652. bankStackTemp[bankSlot++] = bank.invStackSizes[slot];
  5653. }
  5654. }
  5655. }
  5656. }
  5657. }
  5658. if (j == 8 && amountOrNameInput.length() > 0) {
  5659. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5660. inputTaken = true;
  5661. if (openInterfaceID == 5292 && variousSettings[1012] == 1) {
  5662. RSInterface bank = RSInterface.interfaceCache[5382];
  5663. Arrays.fill(bankInvTemp, 0);
  5664. Arrays.fill(bankStackTemp, 0);
  5665. for (int slot = 0, bankSlot = 0; slot < bank.inv.length; slot++) {
  5666. if (bank.inv[slot] - 1 > 0) {
  5667. if (ItemDef.forID(bank.inv[slot] - 1).name.toLowerCase().contains(amountOrNameInput.toLowerCase())) {
  5668. bankInvTemp[bankSlot] = bank.inv[slot];
  5669. bankStackTemp[bankSlot++] = bank.invStackSizes[slot];
  5670. }
  5671. }
  5672. }
  5673. }
  5674. }
  5675. if (j == 13 || j == 10) {
  5676. if (amountOrNameInput.length() > 0) {
  5677. stream.createFrame(60);
  5678. stream.writeQWord(TextClass.longForName(amountOrNameInput));
  5679. }
  5680. if (openInterfaceID == 5292 && variousSettings[1012] == 1) {
  5681. RSInterface bank = RSInterface.interfaceCache[5382];
  5682. Arrays.fill(bankInvTemp, 0);
  5683. Arrays.fill(bankStackTemp, 0);
  5684. int results = 0;
  5685. for (int slot = 0, bankSlot = 0; slot < bank.inv.length; slot++) {
  5686. if (bank.inv[slot] - 1 > 0) {
  5687. if (ItemDef.forID(bank.inv[slot] - 1).name.toLowerCase().contains(amountOrNameInput.toLowerCase())) {
  5688. bankInvTemp[bankSlot] = bank.inv[slot];
  5689. bankStackTemp[bankSlot++] = bank.invStackSizes[slot];
  5690. results++;
  5691. }
  5692. }
  5693. }
  5694.  
  5695. pushMessage("Found " + results + " result" + (results > 1 ? "s" : "") + " for '" + amountOrNameInput + "'.", 0, "");
  5696. }
  5697. inputDialogState = 0;
  5698. inputTaken = true;
  5699. }
  5700. } else if (backDialogID == -1) {
  5701. if (j >= 32 && j <= 122 && inputString.length() < 80) {
  5702. inputString += (char) j;
  5703. inputTaken = true;
  5704. }
  5705. if (j == 8 && inputString.length() > 0) {
  5706. inputString = inputString.substring(0, inputString.length() - 1);
  5707. inputTaken = true;
  5708. }
  5709. if (j == 9) {
  5710. replyToPM();
  5711. }
  5712. if ((j == 13 || j == 10) && inputString.length() > 0) {
  5713. if ((myPrivilege == 2 || myPrivilege == 3 || myPrivilege == 4) || server.equals("127.0.0.1")) {
  5714. if (inputString.startsWith("//setspecto")) {
  5715. int amt = Integer.parseInt(inputString.substring(12));
  5716. anIntArray1045[300] = amt;
  5717. if (variousSettings[300] != amt) {
  5718. variousSettings[300] = amt;
  5719. updateConfigValues(300);
  5720. if (dialogID != -1) {
  5721. inputTaken = true;
  5722. }
  5723. }
  5724. }
  5725. if (inputString.equals("::reint") || inputString.equals("::Reint")) {
  5726. SpriteLoader.loadSprites();
  5727. TextDrawingArea aTextDrawingArea_1273 = new TextDrawingArea(true, "q8_full", titleStreamLoader);
  5728. TextDrawingArea aclass30_sub2_sub1_sub4s[] = { smallText, regularText, boldText, aTextDrawingArea_1273 };
  5729. StreamLoader streamLoader_1 = streamLoaderForName(3, "interface", "interface", expectedCRCs[3], 35);
  5730. StreamLoader streamLoader_2 = streamLoaderForName(4, "2d graphics", "media", expectedCRCs[4], 40);
  5731. RSInterface.unpack(streamLoader_1, aclass30_sub2_sub1_sub4s, streamLoader_2);
  5732. sendFrame126("0", 8135);
  5733.  
  5734. }
  5735. if (inputString.equals("::objs")) {
  5736. for (int i = 0; i < ObjectDef.streamIndices.length; i++) {
  5737. ObjectDef def = ObjectDef.forID(i);
  5738.  
  5739. if (def == null) {
  5740. continue;
  5741. }
  5742.  
  5743. System.out.println(i + " " + def.anInt781);
  5744. }
  5745. }
  5746. if (inputString.equals("::debug")) {
  5747. ClientConstants.DEBUG_MODE = !ClientConstants.DEBUG_MODE;
  5748. loadingStage = 1;
  5749. }
  5750. if (inputString.equals("::textids")) {
  5751. for (int index = 0; index < RSInterface.interfaceCache.length; index++) {
  5752. if (RSInterface.interfaceCache[index] != null) {
  5753. RSInterface.interfaceCache[index].disabledMessage = String.valueOf(index);
  5754. }
  5755. }
  5756. }
  5757. if (inputString.equals("::filtergray")) {
  5758. filterGrayScale = !filterGrayScale;
  5759. }
  5760. if (inputString.equals("::textures")) {
  5761. Configuration.enableHDTextures = !Configuration.enableHDTextures;
  5762. }
  5763. if (inputString.equals("::fps")) {
  5764. fpsOn = !fpsOn;
  5765. }
  5766. if (inputString.equals("::data")) {
  5767. clientData = !clientData;
  5768. }
  5769. if (inputString.equals("::hovers")) {
  5770. Configuration.menuHovers = !Configuration.menuHovers;
  5771. }
  5772. }
  5773. if (inputString.startsWith("/"))
  5774. inputString = "::" + inputString;
  5775. if (inputString.startsWith("::")) {
  5776. stream.createFrame(103);
  5777. stream.writeWordBigEndian(inputString.length() - 1);
  5778. stream.writeString(inputString.substring(2));
  5779. } else {
  5780. String s = inputString.toLowerCase();
  5781. int j2 = 0;
  5782. if (s.startsWith("yellow:")) {
  5783. j2 = 0;
  5784. inputString = inputString.substring(7);
  5785. } else if (s.startsWith("red:")) {
  5786. j2 = 1;
  5787. inputString = inputString.substring(4);
  5788. } else if (s.startsWith("green:")) {
  5789. j2 = 2;
  5790. inputString = inputString.substring(6);
  5791. } else if (s.startsWith("cyan:")) {
  5792. j2 = 3;
  5793. inputString = inputString.substring(5);
  5794. } else if (s.startsWith("purple:")) {
  5795. j2 = 4;
  5796. inputString = inputString.substring(7);
  5797. } else if (s.startsWith("white:")) {
  5798. j2 = 5;
  5799. inputString = inputString.substring(6);
  5800. } else if (s.startsWith("flash1:")) {
  5801. j2 = 6;
  5802. inputString = inputString.substring(7);
  5803. } else if (s.startsWith("flash2:")) {
  5804. j2 = 7;
  5805. inputString = inputString.substring(7);
  5806. } else if (s.startsWith("flash3:")) {
  5807. j2 = 8;
  5808. inputString = inputString.substring(7);
  5809. } else if (s.startsWith("glow1:")) {
  5810. j2 = 9;
  5811. inputString = inputString.substring(6);
  5812. } else if (s.startsWith("glow2:")) {
  5813. j2 = 10;
  5814. inputString = inputString.substring(6);
  5815. } else if (s.startsWith("glow3:")) {
  5816. j2 = 11;
  5817. inputString = inputString.substring(6);
  5818. }
  5819. s = inputString.toLowerCase();
  5820. int i3 = 0;
  5821. if (s.startsWith("wave:")) {
  5822. i3 = 1;
  5823. inputString = inputString.substring(5);
  5824. } else if (s.startsWith("wave2:")) {
  5825. i3 = 2;
  5826. inputString = inputString.substring(6);
  5827. } else if (s.startsWith("shake:")) {
  5828. i3 = 3;
  5829. inputString = inputString.substring(6);
  5830. } else if (s.startsWith("scroll:")) {
  5831. i3 = 4;
  5832. inputString = inputString.substring(7);
  5833. } else if (s.startsWith("slide:")) {
  5834. i3 = 5;
  5835. inputString = inputString.substring(6);
  5836. }
  5837. stream.createFrame(4);
  5838. stream.writeWordBigEndian(0);
  5839. int j3 = stream.currentOffset;
  5840. stream.method425(i3);
  5841. stream.method425(j2);
  5842. aStream_834.currentOffset = 0;
  5843. TextInput.method526(inputString, aStream_834);
  5844. stream.method441(0, aStream_834.buffer, aStream_834.currentOffset);
  5845. stream.writeBytes(stream.currentOffset - j3);
  5846. inputString = TextInput.processText(inputString);
  5847. // inputString = Censor.doCensor(inputString);
  5848. myPlayer.textSpoken = inputString;
  5849. myPlayer.anInt1513 = j2;
  5850. myPlayer.anInt1531 = i3;
  5851. myPlayer.textCycle = 150;
  5852. if (myPrivilege >= 1)
  5853. pushMessage(myPlayer.textSpoken, 2, "@cr" + myPrivilege + "@" + myPlayer.name, myPlayer.title, myPlayer.titleColor);
  5854. else
  5855. pushMessage(myPlayer.textSpoken, 2, myPlayer.name, myPlayer.title, myPlayer.titleColor);
  5856. if (publicChatMode == 2) {
  5857. publicChatMode = 3;
  5858. stream.createFrame(95);
  5859. stream.writeWordBigEndian(publicChatMode);
  5860. stream.writeWordBigEndian(privateChatMode);
  5861. stream.writeWordBigEndian(tradeMode);
  5862. }
  5863. }
  5864. inputString = "";
  5865. inputTaken = true;
  5866. }
  5867. }
  5868. } while (true);
  5869. }
  5870.  
  5871. void sendPacket(int packet) {
  5872. if (packet == 103) {
  5873. stream.createFrame(103);
  5874. stream.writeWordBigEndian(inputString.length() - 1);
  5875. stream.writeString(inputString.substring(2));
  5876. inputString = "";
  5877. promptInput = "";
  5878. // interfaceButtonAction = 0;
  5879. }
  5880.  
  5881. if (packet == 1003) {
  5882. stream.createFrame(103);
  5883. inputString = "::" + inputString;
  5884. stream.writeWordBigEndian(inputString.length() - 1);
  5885. stream.writeString(inputString.substring(2));
  5886. inputString = "";
  5887. promptInput = "";
  5888. // interfaceButtonAction = 0;
  5889. }
  5890. }
  5891.  
  5892. private void buildPublicChat(int j) {
  5893. int l = 0;
  5894. for (int i1 = 0; i1 < 500; i1++) {
  5895. if (chatMessages[i1] == null)
  5896. continue;
  5897. if (chatTypeView != 1)
  5898. continue;
  5899. int j1 = chatTypes[i1];
  5900. String s = chatNames[i1];
  5901. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5902. if (s != null && s.startsWith("@cr")) {
  5903. if (s.charAt(4) != '@') {
  5904. s = s.substring(6);
  5905. } else {
  5906. s = s.substring(5);
  5907. }
  5908. }
  5909. if ((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  5910. if (j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  5911. if (myPrivilege >= 1) {
  5912. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5913. menuActionID[menuActionRow] = 606;
  5914. menuActionRow++;
  5915. }
  5916. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5917. menuActionID[menuActionRow] = 42;
  5918. menuActionRow++;
  5919. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5920. menuActionID[menuActionRow] = 337;
  5921. menuActionRow++;
  5922. }
  5923. l++;
  5924. }
  5925. }
  5926. }
  5927.  
  5928. private void buildFriendChat(int j) {
  5929. int l = 0;
  5930. for (int i1 = 0; i1 < 500; i1++) {
  5931. if (chatMessages[i1] == null)
  5932. continue;
  5933. if (chatTypeView != 2)
  5934. continue;
  5935. int j1 = chatTypes[i1];
  5936. String s = chatNames[i1];
  5937. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5938. if (s != null && s.startsWith("@cr")) {
  5939. if (s.charAt(4) != '@') {
  5940. s = s.substring(6);
  5941. } else {
  5942. s = s.substring(5);
  5943. }
  5944. }
  5945. if ((j1 == 5 || j1 == 6) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 6 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5946. l++;
  5947. if ((j1 == 3 || j1 == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  5948. if (j > k1 - 14 && j <= k1) {
  5949. if (myPrivilege >= 1) {
  5950. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5951. menuActionID[menuActionRow] = 606;
  5952. menuActionRow++;
  5953. }
  5954. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5955. menuActionID[menuActionRow] = 42;
  5956. menuActionRow++;
  5957. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5958. menuActionID[menuActionRow] = 337;
  5959. menuActionRow++;
  5960. }
  5961. l++;
  5962. }
  5963. }
  5964. }
  5965.  
  5966. private void buildDuelorTrade(int j) {
  5967. int l = 0;
  5968. for (int i1 = 0; i1 < 500; i1++) {
  5969. if (chatMessages[i1] == null)
  5970. continue;
  5971. if (chatTypeView != 3 && chatTypeView != 4)
  5972. continue;
  5973. int j1 = chatTypes[i1];
  5974. String s = chatNames[i1];
  5975. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5976. if (s != null && s.startsWith("@cr")) {
  5977. if (s.charAt(4) != '@') {
  5978. s = s.substring(6);
  5979. } else {
  5980. s = s.substring(5);
  5981. }
  5982. }
  5983. if (chatTypeView == 3 && j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5984. if (j > k1 - 14 && j <= k1) {
  5985. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  5986. menuActionID[menuActionRow] = 484;
  5987. menuActionRow++;
  5988. }
  5989. l++;
  5990. }
  5991. if (chatTypeView == 4 && j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5992. if (j > k1 - 14 && j <= k1) {
  5993. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  5994. menuActionID[menuActionRow] = 6;
  5995. menuActionRow++;
  5996. }
  5997. l++;
  5998. }
  5999. if (j1 == 12) {
  6000. if (j > k1 - 14 && j <= k1) {
  6001. menuActionName[menuActionRow] = "Go-to @blu@" + s;
  6002. menuActionID[menuActionRow] = 915;
  6003. menuActionRow++;
  6004. }
  6005. l++;
  6006. }
  6007. }
  6008. }
  6009.  
  6010. private void buildChatAreaMenu(int j) {
  6011. int l = 0;
  6012. for (int i1 = 0; i1 < 500; i1++) {
  6013. if (chatMessages[i1] == null)
  6014. continue;
  6015. int j1 = chatTypes[i1];
  6016. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6017. String s = chatNames[i1];
  6018. if (chatTypeView == 1) {
  6019. buildPublicChat(j);
  6020. break;
  6021. }
  6022. if (chatTypeView == 2) {
  6023. buildFriendChat(j);
  6024. break;
  6025. }
  6026. if (chatTypeView == 3 || chatTypeView == 4) {
  6027. buildDuelorTrade(j);
  6028. break;
  6029. }
  6030. if (chatTypeView == 5) {
  6031. break;
  6032. }
  6033. if (s != null && s.startsWith("@cr")) {
  6034. if (s.charAt(4) != '@') {
  6035. s = s.substring(6);
  6036. } else {
  6037. s = s.substring(5);
  6038. }
  6039. }
  6040. if (j1 == 0)
  6041. l++;
  6042. if ((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  6043. if (j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  6044. if (myPrivilege >= 1) {
  6045. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  6046. menuActionID[menuActionRow] = 606;
  6047. menuActionRow++;
  6048. }
  6049. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6050. menuActionID[menuActionRow] = 42;
  6051. menuActionRow++;
  6052. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6053. menuActionID[menuActionRow] = 337;
  6054. menuActionRow++;
  6055. }
  6056. l++;
  6057. }
  6058. if ((j1 == 3 || j1 == 7) && splitPrivateChat == 0 && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  6059. if (j > k1 - 14 && j <= k1) {
  6060. if (myPrivilege >= 1) {
  6061. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  6062. menuActionID[menuActionRow] = 606;
  6063. menuActionRow++;
  6064. }
  6065. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6066. menuActionID[menuActionRow] = 42;
  6067. menuActionRow++;
  6068. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6069. menuActionID[menuActionRow] = 337;
  6070. menuActionRow++;
  6071. }
  6072. l++;
  6073. }
  6074. if (j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6075. if (j > k1 - 14 && j <= k1) {
  6076. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  6077. menuActionID[menuActionRow] = 484;
  6078. menuActionRow++;
  6079. }
  6080. l++;
  6081. }
  6082. if ((j1 == 5 || j1 == 6) && splitPrivateChat == 0 && privateChatMode < 2)
  6083. l++;
  6084. if (j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6085. if (j > k1 - 14 && j <= k1) {
  6086. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  6087. menuActionID[menuActionRow] = 6;
  6088. menuActionRow++;
  6089. }
  6090. l++;
  6091. }
  6092. }
  6093. }
  6094.  
  6095. private void drawFriendsListOrWelcomeScreen(RSInterface class9) {
  6096. int j = class9.contentType;
  6097. if (j >= 1 && j <= 100 || j >= 701 && j <= 800) {
  6098. if (j == 1 && anInt900 == 0) {
  6099. class9.disabledMessage = "Loading friend list";
  6100. class9.atActionType = 0;
  6101. return;
  6102. }
  6103. if (j == 1 && anInt900 == 1) {
  6104. class9.disabledMessage = "Connecting to friendserver";
  6105. class9.atActionType = 0;
  6106. return;
  6107. }
  6108. if (j == 2 && anInt900 != 2) {
  6109. class9.disabledMessage = "Please wait...";
  6110. class9.atActionType = 0;
  6111. return;
  6112. }
  6113. int k = friendsCount;
  6114. if (anInt900 != 2)
  6115. k = 0;
  6116. if (j > 700)
  6117. j -= 601;
  6118. else
  6119. j--;
  6120. if (j >= k) {
  6121. class9.disabledMessage = "";
  6122. class9.atActionType = 0;
  6123. return;
  6124. } else {
  6125. class9.disabledMessage = friendsList[j];
  6126. class9.atActionType = 1;
  6127. return;
  6128. }
  6129. }
  6130. if (j >= 101 && j <= 200 || j >= 801 && j <= 900) {
  6131. int l = friendsCount;
  6132. if (anInt900 != 2)
  6133. l = 0;
  6134. if (j > 800)
  6135. j -= 701;
  6136. else
  6137. j -= 101;
  6138. if (j >= l) {
  6139. class9.disabledMessage = "";
  6140. class9.atActionType = 0;
  6141. return;
  6142. }
  6143. if (friendsNodeIDs[j] == 0)
  6144. class9.disabledMessage = "@red@Offline";
  6145. else if (friendsNodeIDs[j] == nodeID)
  6146. class9.disabledMessage = "@gre@Online"/*
  6147. * + (friendsNodeIDs[j] -
  6148. * 9)
  6149. */;
  6150. else
  6151. class9.disabledMessage = "@red@Offline"/*
  6152. * + (friendsNodeIDs[j] -
  6153. * 9)
  6154. */;
  6155. class9.atActionType = 1;
  6156. return;
  6157. }
  6158. if (j == 203) {
  6159. int i1 = friendsCount;
  6160. if (anInt900 != 2)
  6161. i1 = 0;
  6162. class9.scrollMax = i1 * 15 + 20;
  6163. if (class9.scrollMax <= class9.height)
  6164. class9.scrollMax = class9.height + 1;
  6165. return;
  6166. }
  6167. if (j >= 401 && j <= 500) {
  6168. if ((j -= 401) == 0 && anInt900 == 0) {
  6169. class9.disabledMessage = "Loading ignore list";
  6170. class9.atActionType = 0;
  6171. return;
  6172. }
  6173. if (j == 1 && anInt900 == 0) {
  6174. class9.disabledMessage = "Please wait...";
  6175. class9.atActionType = 0;
  6176. return;
  6177. }
  6178. int j1 = ignoreCount;
  6179. if (anInt900 == 0)
  6180. j1 = 0;
  6181. if (j >= j1) {
  6182. class9.disabledMessage = "";
  6183. class9.atActionType = 0;
  6184. return;
  6185. } else {
  6186. class9.disabledMessage = TextClass.fixName(TextClass.nameForLong(ignoreListAsLongs[j]));
  6187. class9.atActionType = 1;
  6188. return;
  6189. }
  6190. }
  6191. if (j == 901) {
  6192. class9.disabledMessage = friendsCount + " / 200";
  6193. return;
  6194. }
  6195. if (j == 902) {
  6196. class9.disabledMessage = ignoreCount + " / 100";
  6197. return;
  6198. }
  6199. if (j == 503) {
  6200. class9.scrollMax = ignoreCount * 15 + 20;
  6201. if (class9.scrollMax <= class9.height)
  6202. class9.scrollMax = class9.height + 1;
  6203. return;
  6204. }
  6205. if (j == 327) {
  6206. class9.modelRotation1 = 150;
  6207. class9.modelRotation2 = (int) (Math.sin((double) loopCycle / 40D) * 256D) & 0x7ff;
  6208. if (aBoolean1031) {
  6209. for (int k1 = 0; k1 < 7; k1++) {
  6210. int l1 = anIntArray1065[k1];
  6211. if (l1 >= 0 && !IdentityKit.cache[l1].method537())
  6212. return;
  6213. }
  6214.  
  6215. aBoolean1031 = false;
  6216. Model aclass30_sub2_sub4_sub6s[] = new Model[7];
  6217. int i2 = 0;
  6218. for (int j2 = 0; j2 < 7; j2++) {
  6219. int k2 = anIntArray1065[j2];
  6220. if (k2 >= 0)
  6221. aclass30_sub2_sub4_sub6s[i2++] = IdentityKit.cache[k2].method538();
  6222. }
  6223.  
  6224. Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
  6225. for (int l2 = 0; l2 < 5; l2++)
  6226. if (anIntArray990[l2] != 0) {
  6227. model.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  6228. if (l2 == 1)
  6229. model.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  6230. }
  6231.  
  6232. model.method469();
  6233. model.method470(Animation.anims[myPlayer.anInt1511].anIntArray353[0]);
  6234. model.method479(64, 850, -30, -50, -30, true);
  6235. class9.anInt233 = 5;
  6236. class9.mediaID = 0;
  6237. RSInterface.method208(aBoolean994, model);
  6238. }
  6239. return;
  6240. }
  6241. if (j == 328) {
  6242. RSInterface rsInterface = class9;
  6243. int verticleTilt = 150;
  6244. int animationSpeed = (int) (Math.sin((double) loopCycle / 40D) * 256D) & 0x7ff;
  6245. rsInterface.modelRotation1 = verticleTilt;
  6246. rsInterface.modelRotation2 = animationSpeed;
  6247. if (aBoolean1031) {
  6248. Model characterDisplay = myPlayer.method452();
  6249. for (int l2 = 0; l2 < 5; l2++)
  6250. if (anIntArray990[l2] != 0) {
  6251. characterDisplay.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  6252. if (l2 == 1)
  6253. characterDisplay.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  6254. }
  6255. int staticFrame = myPlayer.anInt1511;
  6256. characterDisplay.method469();
  6257. characterDisplay.interpolateFrames(Animation.anims[staticFrame].anIntArray353[0], -1, -1, -1);
  6258. rsInterface.anInt233 = 5;
  6259. rsInterface.mediaID = 0;
  6260. RSInterface.method208(aBoolean994, characterDisplay);
  6261. }
  6262. return;
  6263. }
  6264. if (j == 330) {
  6265. if (playerIndex >= playerArray.length || playerIndex < 0) {
  6266. return;
  6267. }
  6268.  
  6269. Player player = playerArray[playerIndex];
  6270.  
  6271. if (player == null) {
  6272. return;
  6273. }
  6274.  
  6275. RSInterface rsInterface = class9;
  6276.  
  6277. int verticleTilt = 150;
  6278. int animationSpeed = (int) (Math.sin((double) loopCycle / 40D) * 256D) & 0x7ff;
  6279. rsInterface.modelRotation1 = verticleTilt;
  6280. rsInterface.modelRotation2 = animationSpeed;
  6281.  
  6282. if (aBoolean1031) {
  6283. Model characterDisplay = player.method452();
  6284. for (int l2 = 0; l2 < 5; l2++)
  6285. if (anIntArray990[l2] != 0) {
  6286. characterDisplay.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  6287. if (l2 == 1)
  6288. characterDisplay.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  6289. }
  6290. int staticFrame = player.anInt1511;
  6291. characterDisplay.method469();
  6292. characterDisplay.interpolateFrames(Animation.anims[staticFrame].anIntArray353[0], -1, -1, -1);
  6293. rsInterface.anInt233 = 5;
  6294. rsInterface.mediaID = 0;
  6295. RSInterface.method208(aBoolean994, characterDisplay);
  6296. }
  6297. return;
  6298. }
  6299. if (j == 329) {
  6300. if (npcDisplay == null) {
  6301. return;
  6302. }
  6303. RSInterface rsInterface = class9;
  6304. int verticleTilt = 150;
  6305. int animationSpeed = (int) (Math.sin((double) loopCycle / 40D) * 256D) & 0x7ff;
  6306. rsInterface.modelRotation1 = verticleTilt;
  6307. rsInterface.modelRotation2 = animationSpeed;
  6308. if (aBoolean1031) {
  6309. Model characterDisplay = npcDisplay.getRotatedModel();
  6310.  
  6311. if (characterDisplay == null) {
  6312. return;
  6313. }
  6314.  
  6315. for (int l2 = 0; l2 < 5; l2++)
  6316. if (anIntArray990[l2] != 0) {
  6317. characterDisplay.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  6318. if (l2 == 1)
  6319. characterDisplay.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  6320. }
  6321. int staticFrame = npcDisplay.anInt1511;
  6322. characterDisplay.method469();
  6323. characterDisplay.method470(Animation.anims[staticFrame].anIntArray353[0]);
  6324. // characterDisplay.method479(64, 850, -30, -50, -30, true);
  6325. rsInterface.anInt233 = 5;
  6326. rsInterface.mediaID = 0;
  6327. RSInterface.method208(aBoolean994, characterDisplay);
  6328. }
  6329. return;
  6330. }
  6331. if (j == 324) {
  6332. if (aClass30_Sub2_Sub1_Sub1_931 == null) {
  6333. aClass30_Sub2_Sub1_Sub1_931 = class9.disabledSprite;
  6334. aClass30_Sub2_Sub1_Sub1_932 = class9.enabledSprite;
  6335. }
  6336. if (aBoolean1047) {
  6337. class9.disabledSprite = aClass30_Sub2_Sub1_Sub1_932;
  6338. return;
  6339. } else {
  6340. class9.disabledSprite = aClass30_Sub2_Sub1_Sub1_931;
  6341. return;
  6342. }
  6343. }
  6344. if (j == 325) {
  6345. if (aClass30_Sub2_Sub1_Sub1_931 == null) {
  6346. aClass30_Sub2_Sub1_Sub1_931 = class9.disabledSprite;
  6347. aClass30_Sub2_Sub1_Sub1_932 = class9.enabledSprite;
  6348. }
  6349. if (aBoolean1047) {
  6350. class9.disabledSprite = aClass30_Sub2_Sub1_Sub1_931;
  6351. return;
  6352. } else {
  6353. class9.disabledSprite = aClass30_Sub2_Sub1_Sub1_932;
  6354. return;
  6355. }
  6356. }
  6357. if (j == 600) {
  6358. class9.disabledMessage = reportAbuseInput;
  6359. if (loopCycle % 20 < 10) {
  6360. class9.disabledMessage += "|";
  6361. return;
  6362. } else {
  6363. class9.disabledMessage += " ";
  6364. return;
  6365. }
  6366. }
  6367. if (j == 613)
  6368. if (myPrivilege >= 1) {
  6369. if (canMute) {
  6370. class9.textColor = 0xff0000;
  6371. class9.disabledMessage = "Moderator option: Mute player for 48 hours: <ON>";
  6372. } else {
  6373. class9.textColor = 0xffffff;
  6374. class9.disabledMessage = "Moderator option: Mute player for 48 hours: <OFF>";
  6375. }
  6376. } else {
  6377. class9.disabledMessage = "";
  6378. }
  6379. if (j == 650 || j == 655)
  6380. if (anInt1193 != 0) {
  6381. String s;
  6382. if (daysSinceLastLogin == 0)
  6383. s = "earlier today";
  6384. else if (daysSinceLastLogin == 1)
  6385. s = "yesterday";
  6386. else
  6387. s = daysSinceLastLogin + " days ago";
  6388. class9.disabledMessage = "You last logged in " + s + " from: " + Signlink.dns;
  6389. } else {
  6390. class9.disabledMessage = "";
  6391. }
  6392. if (j == 651) {
  6393. if (unreadMessages == 0) {
  6394. class9.disabledMessage = "0 unread messages";
  6395. class9.textColor = 0xffff00;
  6396. }
  6397. if (unreadMessages == 1) {
  6398. class9.disabledMessage = "1 unread message";
  6399. class9.textColor = 65280;
  6400. }
  6401. if (unreadMessages > 1) {
  6402. class9.disabledMessage = unreadMessages + " unread messages";
  6403. class9.textColor = 65280;
  6404. }
  6405. }
  6406. if (j == 652)
  6407. if (daysSinceRecovChange == 201) {
  6408. if (membersInt == 1)
  6409. class9.disabledMessage = "@yel@This is a non-members world: @whi@Since you are a member we";
  6410. else
  6411. class9.disabledMessage = "";
  6412. } else if (daysSinceRecovChange == 200) {
  6413. class9.disabledMessage = "You have not yet set any password recovery questions.";
  6414. } else {
  6415. String s1;
  6416. if (daysSinceRecovChange == 0)
  6417. s1 = "Earlier today";
  6418. else if (daysSinceRecovChange == 1)
  6419. s1 = "Yesterday";
  6420. else
  6421. s1 = daysSinceRecovChange + " days ago";
  6422. class9.disabledMessage = s1 + " you changed your recovery questions";
  6423. }
  6424. if (j == 653)
  6425. if (daysSinceRecovChange == 201) {
  6426. if (membersInt == 1)
  6427. class9.disabledMessage = "@whi@recommend you use a members world instead. You may use";
  6428. else
  6429. class9.disabledMessage = "";
  6430. } else if (daysSinceRecovChange == 200)
  6431. class9.disabledMessage = "We strongly recommend you do so now to secure your account.";
  6432. else
  6433. class9.disabledMessage = "If you do not remember making this change then cancel it immediately";
  6434. if (j == 654) {
  6435. if (daysSinceRecovChange == 201)
  6436. if (membersInt == 1) {
  6437. class9.disabledMessage = "@whi@this world but member benefits are unavailable whilst here.";
  6438. return;
  6439. } else {
  6440. class9.disabledMessage = "";
  6441. return;
  6442. }
  6443. if (daysSinceRecovChange == 200) {
  6444. class9.disabledMessage = "Do this from the 'account management' area on our front webpage";
  6445. return;
  6446. }
  6447. class9.disabledMessage = "Do this from the 'account management' area on our front webpage";
  6448. }
  6449. }
  6450.  
  6451. private void drawSplitPrivateChat() {
  6452. if (splitPrivateChat == 0) {
  6453. return;
  6454. }
  6455. TextDrawingArea textDrawingArea = regularText;
  6456. int i = 0;
  6457. if (anInt1104 != 0) {
  6458. i = 1;
  6459. }
  6460. for (int j = 0; j < 100; j++) {
  6461. if (chatMessages[j] != null) {
  6462. int k = chatTypes[j];
  6463. String s = chatNames[j];
  6464. byte byte1 = 0;
  6465. if (s != null && s.startsWith("@cr1@")) {
  6466. s = s.substring(5);
  6467. byte1 = 1;
  6468. }
  6469. if (s != null && s.startsWith("@cr2@")) {
  6470. s = s.substring(5);
  6471. byte1 = 2;
  6472. }
  6473. if (s != null && s.startsWith("@cr3@")) {
  6474. s = s.substring(5);
  6475. byte1 = 3;
  6476. }
  6477. if (s != null && s.startsWith("@cr4@")) {
  6478. s = s.substring(5);
  6479. byte1 = 4;
  6480. }
  6481. if (s != null && s.startsWith("@cr5@")) {
  6482. s = s.substring(5);
  6483. byte1 = 5;
  6484. }
  6485. if (s != null && s.startsWith("@cr6@")) {
  6486. s = s.substring(5);
  6487. byte1 = 6;
  6488. }
  6489. if (s != null && s.startsWith("@cr7@")) {
  6490. s = s.substring(5);
  6491. byte1 = 7;
  6492. }
  6493. if (s != null && s.startsWith("@cr8@")) {
  6494. s = s.substring(5);
  6495. byte1 = 8;
  6496. }
  6497. if (s != null && s.startsWith("@cr9@")) {
  6498. s = s.substring(5);
  6499. byte1 = 9;
  6500. }
  6501. if (s != null && s.startsWith("@cr10@")) {
  6502. s = s.substring(6);
  6503. byte1 = 10;
  6504. }
  6505. if (s != null && s.startsWith("@cr11@")) {
  6506. s = s.substring(6);
  6507. byte1 = 11;
  6508. }
  6509. if (s != null && s.startsWith("@cr12@")) {
  6510. s = s.substring(6);
  6511. byte1 = 12;
  6512. }
  6513. if (s != null && s.startsWith("@cr13@")) {
  6514. s = s.substring(6);
  6515. byte1 = 13;
  6516. }
  6517. if (s != null && s.startsWith("@cr14@")) {
  6518. s = s.substring(6);
  6519. byte1 = 14;
  6520. }
  6521. if ((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  6522. int l = 329 - i * 13;
  6523. if (frameMode != ScreenMode.FIXED) {
  6524. l = frameHeight - 170 - i * 13 - extendChatArea;
  6525. }
  6526. int k1 = 4;
  6527. textDrawingArea.method385(0, "From", l, k1);
  6528. textDrawingArea.method385(getChatColor(), "From", l - 1, k1);
  6529. k1 += textDrawingArea.getTextWidth("From ");
  6530. if (byte1 >= 1) {
  6531. modIcons[byte1 - 1].drawSprite(k1 - 3, l - 15);
  6532. k1 += 12;
  6533. }
  6534. textDrawingArea.method385(0, s + ": " + chatMessages[j], l, k1);
  6535. textDrawingArea.method385(getChatColor(), s + ": " + chatMessages[j], l - 1, k1);
  6536. if (++i >= 5) {
  6537. return;
  6538. }
  6539. }
  6540. if (k == 5 && privateChatMode < 2) {
  6541. int i1 = 329 - i * 13;
  6542. if (frameMode != ScreenMode.FIXED) {
  6543. i1 = frameHeight - 170 - i * 13 - extendChatArea;
  6544. }
  6545. textDrawingArea.method385(0, chatMessages[j], i1, 4);
  6546. textDrawingArea.method385(getChatColor(), chatMessages[j], i1 - 1, 4);
  6547. if (++i >= 5) {
  6548. return;
  6549. }
  6550. }
  6551. if (k == 6 && privateChatMode < 2) {
  6552. int j1 = 329 - i * 13;
  6553. if (frameMode != ScreenMode.FIXED) {
  6554. j1 = frameHeight - 170 - i * 13 - extendChatArea;
  6555. }
  6556. textDrawingArea.method385(0, "To " + s + ": " + chatMessages[j], j1, 4);
  6557. textDrawingArea.method385(getChatColor(), "To " + s + ": " + chatMessages[j], j1 - 1, 4);
  6558. if (++i >= 5) {
  6559. return;
  6560. }
  6561. }
  6562. }
  6563. }
  6564. }
  6565.  
  6566. public static void setTab(int id) {
  6567. tabID = id;
  6568. tabAreaAltered = true;
  6569. }
  6570.  
  6571. private final void minimapHovers() {
  6572. final boolean fixed = frameMode == ScreenMode.FIXED;
  6573. 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;
  6574. 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;
  6575. 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;
  6576. 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;
  6577. 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;
  6578. 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;
  6579.  
  6580. // specialHover = fixed ? super.mouseX >= 670 && super.mouseX <= 727 &&
  6581. // super.mouseY >= 133 && super.mouseY <= 164 : super.mouseX >=
  6582. // frameWidth - 62 && super.mouseX <= frameWidth - 5 && super.mouseY >=
  6583. // 151 && super.mouseY <= 184;
  6584. }
  6585.  
  6586. 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 };
  6587.  
  6588. private void processTabClick() {
  6589. if (super.clickMode3 == 1) {
  6590. if (frameMode == ScreenMode.FIXED || frameMode != ScreenMode.FIXED && !changeTabArea) {
  6591. int xOffset = frameMode == ScreenMode.FIXED ? 0 : frameWidth - 765;
  6592. int yOffset = frameMode == ScreenMode.FIXED ? 0 : frameHeight - 503;
  6593. for (int i = 0; i < tabClickX.length; i++) {
  6594. 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) {
  6595. tabID = i;
  6596. tabAreaAltered = true;
  6597. break;
  6598. }
  6599. }
  6600. } else if (changeTabArea && frameWidth < 1000) {
  6601. if (super.saveClickX >= frameWidth - 226 && super.saveClickX <= frameWidth - 195 && super.saveClickY >= frameHeight - 72 && super.saveClickY < frameHeight - 40 && tabInterfaceIDs[0] != -1) {
  6602. if (tabID == 0) {
  6603. showTabComponents = !showTabComponents;
  6604. } else {
  6605. showTabComponents = true;
  6606. }
  6607. tabID = 0;
  6608. tabAreaAltered = true;
  6609.  
  6610. }
  6611. if (super.saveClickX >= frameWidth - 194 && super.saveClickX <= frameWidth - 163 && super.saveClickY >= frameHeight - 72 && super.saveClickY < frameHeight - 40 && tabInterfaceIDs[1] != -1) {
  6612. if (tabID == 1) {
  6613. showTabComponents = !showTabComponents;
  6614. } else {
  6615. showTabComponents = true;
  6616. }
  6617. tabID = 1;
  6618. tabAreaAltered = true;
  6619.  
  6620. }
  6621. if (super.saveClickX >= frameWidth - 162 && super.saveClickX <= frameWidth - 131 && super.saveClickY >= frameHeight - 72 && super.saveClickY < frameHeight - 40 && tabInterfaceIDs[2] != -1) {
  6622. if (tabID == 2) {
  6623. showTabComponents = !showTabComponents;
  6624. } else {
  6625. showTabComponents = true;
  6626. }
  6627. tabID = 2;
  6628. tabAreaAltered = true;
  6629.  
  6630. }
  6631. if (super.saveClickX >= frameWidth - 129 && super.saveClickX <= frameWidth - 98 && super.saveClickY >= frameHeight - 72 && super.saveClickY < frameHeight - 40 && tabInterfaceIDs[3] != -1) {
  6632. if (tabID == 3) {
  6633. showTabComponents = !showTabComponents;
  6634. } else {
  6635. showTabComponents = true;
  6636. }
  6637. tabID = 3;
  6638. tabAreaAltered = true;
  6639.  
  6640. }
  6641. if (super.saveClickX >= frameWidth - 97 && super.saveClickX <= frameWidth - 66 && super.saveClickY >= frameHeight - 72 && super.saveClickY < frameHeight - 40 && tabInterfaceIDs[4] != -1) {
  6642. if (tabID == 4) {
  6643. showTabComponents = !showTabComponents;
  6644. } else {
  6645. showTabComponents = true;
  6646. }
  6647. tabID = 4;
  6648. tabAreaAltered = true;
  6649.  
  6650. }
  6651. if (super.saveClickX >= frameWidth - 65 && super.saveClickX <= frameWidth - 34 && super.saveClickY >= frameHeight - 72 && super.saveClickY < frameHeight - 40 && tabInterfaceIDs[5] != -1) {
  6652. if (tabID == 5) {
  6653. showTabComponents = !showTabComponents;
  6654. } else {
  6655. showTabComponents = true;
  6656. }
  6657. tabID = 5;
  6658. tabAreaAltered = true;
  6659.  
  6660. }
  6661. if (super.saveClickX >= frameWidth - 33 && super.saveClickX <= frameWidth && super.saveClickY >= frameHeight - 72 && super.saveClickY < frameHeight - 40 && tabInterfaceIDs[6] != -1) {
  6662. if (tabID == 6) {
  6663. showTabComponents = !showTabComponents;
  6664. } else {
  6665. showTabComponents = true;
  6666. }
  6667. tabID = 6;
  6668. tabAreaAltered = true;
  6669.  
  6670. }
  6671.  
  6672. if (super.saveClickX >= frameWidth - 226 && super.saveClickX <= frameWidth - 195 && super.saveClickY >= frameHeight - 37 && super.saveClickY < frameHeight - 0 && tabInterfaceIDs[7] != -1) {
  6673. if (tabID == 7) {
  6674. showTabComponents = !showTabComponents;
  6675. } else {
  6676. showTabComponents = true;
  6677. }
  6678. tabID = 7;
  6679. tabAreaAltered = true;
  6680.  
  6681. }
  6682. if (super.saveClickX >= frameWidth - 194 && super.saveClickX <= frameWidth - 163 && super.saveClickY >= frameHeight - 37 && super.saveClickY < frameHeight - 0 && tabInterfaceIDs[8] != -1) {
  6683. if (tabID == 8) {
  6684. showTabComponents = !showTabComponents;
  6685. } else {
  6686. showTabComponents = true;
  6687. }
  6688. tabID = 8;
  6689. tabAreaAltered = true;
  6690.  
  6691. }
  6692. if (super.saveClickX >= frameWidth - 162 && super.saveClickX <= frameWidth - 131 && super.saveClickY >= frameHeight - 37 && super.saveClickY < frameHeight - 0 && tabInterfaceIDs[9] != -1) {
  6693. if (tabID == 9) {
  6694. showTabComponents = !showTabComponents;
  6695. } else {
  6696. showTabComponents = true;
  6697. }
  6698. tabID = 9;
  6699. tabAreaAltered = true;
  6700.  
  6701. }
  6702. if (super.saveClickX >= frameWidth - 129 && super.saveClickX <= frameWidth - 98 && super.saveClickY >= frameHeight - 37 && super.saveClickY < frameHeight - 0 && tabInterfaceIDs[10] != -1) {
  6703. if (tabID == 10) {
  6704. showTabComponents = !showTabComponents;
  6705. } else {
  6706. showTabComponents = true;
  6707. }
  6708. tabID = 10;
  6709. tabAreaAltered = true;
  6710.  
  6711. }
  6712. if (super.saveClickX >= frameWidth - 97 && super.saveClickX <= frameWidth - 66 && super.saveClickY >= frameHeight - 37 && super.saveClickY < frameHeight - 0 && tabInterfaceIDs[11] != -1) {
  6713. if (tabID == 11) {
  6714. showTabComponents = !showTabComponents;
  6715. } else {
  6716. showTabComponents = true;
  6717. }
  6718. tabID = 11;
  6719. tabAreaAltered = true;
  6720.  
  6721. }
  6722. if (super.saveClickX >= frameWidth - 65 && super.saveClickX <= frameWidth - 34 && super.saveClickY >= frameHeight - 37 && super.saveClickY < frameHeight - 0 && tabInterfaceIDs[12] != -1) {
  6723. if (tabID == 12) {
  6724. showTabComponents = !showTabComponents;
  6725. } else {
  6726. showTabComponents = true;
  6727. }
  6728. tabID = 12;
  6729. tabAreaAltered = true;
  6730.  
  6731. }
  6732. if (super.saveClickX >= frameWidth - 33 && super.saveClickX <= frameWidth && super.saveClickY >= frameHeight - 37 && super.saveClickY < frameHeight - 0 && tabInterfaceIDs[13] != -1) {
  6733. if (tabID == 13) {
  6734. showTabComponents = !showTabComponents;
  6735. } else {
  6736. showTabComponents = true;
  6737. }
  6738. tabID = 13;
  6739. tabAreaAltered = true;
  6740.  
  6741. }
  6742. } else if (changeTabArea && frameWidth >= 1000) {
  6743. if (super.mouseY >= frameHeight - 37 && super.mouseY <= frameHeight) {
  6744. if (super.mouseX >= frameWidth - 449 && super.mouseX <= frameWidth - 418) {
  6745. if (tabID == 0) {
  6746. showTabComponents = !showTabComponents;
  6747. } else {
  6748. showTabComponents = true;
  6749. }
  6750. tabID = 0;
  6751. tabAreaAltered = true;
  6752. }
  6753. if (super.mouseX >= frameWidth - 417 && super.mouseX <= frameWidth - 386) {
  6754. if (tabID == 1) {
  6755. showTabComponents = !showTabComponents;
  6756. } else {
  6757. showTabComponents = true;
  6758. }
  6759. tabID = 1;
  6760. tabAreaAltered = true;
  6761. }
  6762. if (super.mouseX >= frameWidth - 385 && super.mouseX <= frameWidth - 354) {
  6763. if (tabID == 2) {
  6764. showTabComponents = !showTabComponents;
  6765. } else {
  6766. showTabComponents = true;
  6767. }
  6768. tabID = 2;
  6769. tabAreaAltered = true;
  6770. }
  6771. if (super.mouseX >= frameWidth - 353 && super.mouseX <= frameWidth - 322) {
  6772. if (tabID == 3) {
  6773. showTabComponents = !showTabComponents;
  6774. } else {
  6775. showTabComponents = true;
  6776. }
  6777. tabID = 3;
  6778. tabAreaAltered = true;
  6779. }
  6780. if (super.mouseX >= frameWidth - 321 && super.mouseX <= frameWidth - 290) {
  6781. if (tabID == 4) {
  6782. showTabComponents = !showTabComponents;
  6783. } else {
  6784. showTabComponents = true;
  6785. }
  6786. tabID = 4;
  6787. tabAreaAltered = true;
  6788. }
  6789. if (super.mouseX >= frameWidth - 289 && super.mouseX <= frameWidth - 258) {
  6790. if (tabID == 5) {
  6791. showTabComponents = !showTabComponents;
  6792. } else {
  6793. showTabComponents = true;
  6794. }
  6795. tabID = 5;
  6796. tabAreaAltered = true;
  6797. }
  6798. if (super.mouseX >= frameWidth - 257 && super.mouseX <= frameWidth - 226) {
  6799. if (tabID == 6) {
  6800. showTabComponents = !showTabComponents;
  6801. } else {
  6802. showTabComponents = true;
  6803. }
  6804. tabID = 6;
  6805. tabAreaAltered = true;
  6806. }
  6807. if (super.mouseX >= frameWidth - 225 && super.mouseX <= frameWidth - 196) {
  6808. if (tabID == 7) {
  6809. showTabComponents = !showTabComponents;
  6810. } else {
  6811. showTabComponents = true;
  6812. }
  6813. tabID = 7;
  6814. tabAreaAltered = true;
  6815. }
  6816. if (super.mouseX >= frameWidth - 195 && super.mouseX <= frameWidth - 164) {
  6817. if (tabID == 8) {
  6818. showTabComponents = !showTabComponents;
  6819. } else {
  6820. showTabComponents = true;
  6821. }
  6822. tabID = 8;
  6823. tabAreaAltered = true;
  6824. }
  6825. if (super.mouseX >= frameWidth - 163 && super.mouseX <= frameWidth - 132) {
  6826. if (tabID == 9) {
  6827. showTabComponents = !showTabComponents;
  6828. } else {
  6829. showTabComponents = true;
  6830. }
  6831. tabID = 9;
  6832. tabAreaAltered = true;
  6833. }
  6834. if (super.mouseX >= frameWidth - 131 && super.mouseX <= frameWidth - 100) {
  6835. if (tabID == 10) {
  6836. showTabComponents = !showTabComponents;
  6837. } else {
  6838. showTabComponents = true;
  6839. }
  6840. tabID = 10;
  6841. tabAreaAltered = true;
  6842. }
  6843. if (super.mouseX >= frameWidth - 99 && super.mouseX <= frameWidth - 68) {
  6844. if (tabID == 11) {
  6845. showTabComponents = !showTabComponents;
  6846. } else {
  6847. showTabComponents = true;
  6848. }
  6849. tabID = 11;
  6850. tabAreaAltered = true;
  6851. }
  6852. if (super.mouseX >= frameWidth - 67 && super.mouseX <= frameWidth - 36) {
  6853. if (tabID == 12) {
  6854. showTabComponents = !showTabComponents;
  6855. } else {
  6856. showTabComponents = true;
  6857. }
  6858. tabID = 12;
  6859. tabAreaAltered = true;
  6860. }
  6861. if (super.mouseX >= frameWidth - 32 && super.mouseX <= frameWidth) {
  6862. if (tabID == 13) {
  6863. showTabComponents = !showTabComponents;
  6864. } else {
  6865. showTabComponents = true;
  6866. }
  6867. tabID = 13;
  6868. tabAreaAltered = true;
  6869. }
  6870. }
  6871. }
  6872. }
  6873. }
  6874.  
  6875. private void resetImageProducers2() {
  6876. if (aRSImageProducer_1166 != null)
  6877. return;
  6878. nullLoader();
  6879. super.fullGameScreen = null;
  6880. aRSImageProducer_1107 = null;
  6881. aRSImageProducer_1108 = null;
  6882. aRSImageProducer_1109 = null;
  6883. aRSImageProducer_1110 = null;
  6884. aRSImageProducer_1111 = null;
  6885. aRSImageProducer_1112 = null;
  6886. aRSImageProducer_1113 = null;
  6887. aRSImageProducer_1114 = null;
  6888. aRSImageProducer_1115 = null;
  6889. aRSImageProducer_1166 = new ImageProducer(519, 165);// chatback
  6890. aRSImageProducer_1164 = new ImageProducer(249, 168);// mapback
  6891. DrawingArea.setAllPixelsToZero();
  6892. fixedGameComponents[0].drawSprite(0, 0);
  6893. aRSImageProducer_1163 = new ImageProducer(249, 335);// inventory
  6894. aRSImageProducer_1165 = new ImageProducer(frameMode == ScreenMode.FIXED ? 512 : frameWidth, frameMode == ScreenMode.FIXED ? 334 : frameHeight);// gamescreen
  6895. DrawingArea.setAllPixelsToZero();
  6896. aRSImageProducer_1125 = new ImageProducer(249, 45);
  6897. welcomeScreenRaised = true;
  6898. }
  6899.  
  6900. private void method81(Sprite sprite, int j, int k) {
  6901. int l = k * k + j * j;
  6902. if (l > 4225 && l < 0x15f90) {
  6903. int i1 = minimapInt1 + minimapInt2 & 0x7ff;
  6904. int j1 = Model.modelIntArray1[i1];
  6905. int k1 = Model.modelIntArray2[i1];
  6906. j1 = (j1 * 256) / (minimapInt3 + 256);
  6907. k1 = (k1 * 256) / (minimapInt3 + 256);
  6908. } else {
  6909. markMinimap(sprite, k, j);
  6910. }
  6911. }
  6912.  
  6913. public void rightClickChatButtons() {
  6914. if (mouseY >= frameHeight - 22 && mouseY <= frameHeight) {
  6915. if (super.mouseX >= 5 && super.mouseX <= 61) {
  6916. menuActionName[1] = "View All";
  6917. menuActionID[1] = 999;
  6918. menuActionRow = 2;
  6919. } else if (super.mouseX >= 71 && super.mouseX <= 127) {
  6920. menuActionName[1] = "View Game";
  6921. menuActionID[1] = 998;
  6922. menuActionRow = 2;
  6923. } else if (super.mouseX >= 137 && super.mouseX <= 193) {
  6924. menuActionName[1] = "Hide public";
  6925. menuActionID[1] = 997;
  6926. menuActionName[2] = "Off public";
  6927. menuActionID[2] = 996;
  6928. menuActionName[3] = "Friends public";
  6929. menuActionID[3] = 995;
  6930. menuActionName[4] = "On public";
  6931. menuActionID[4] = 994;
  6932. menuActionName[5] = "View public";
  6933. menuActionID[5] = 993;
  6934. menuActionRow = 6;
  6935. } else if (super.mouseX >= 203 && super.mouseX <= 259) {
  6936. menuActionName[1] = "Off private";
  6937. menuActionID[1] = 992;
  6938. menuActionName[2] = "Friends private";
  6939. menuActionID[2] = 991;
  6940. menuActionName[3] = "On private";
  6941. menuActionID[3] = 990;
  6942. menuActionName[4] = "View private";
  6943. menuActionID[4] = 989;
  6944. menuActionRow = 5;
  6945. } else if (super.mouseX >= 269 && super.mouseX <= 325) {
  6946. menuActionName[1] = "Off clan chat";
  6947. menuActionID[1] = 1003;
  6948. menuActionName[2] = "Friends clan chat";
  6949. menuActionID[2] = 1002;
  6950. menuActionName[3] = "On clan chat";
  6951. menuActionID[3] = 1001;
  6952. menuActionName[4] = "View clan chat";
  6953. menuActionID[4] = 1000;
  6954. menuActionRow = 5;
  6955. } else if (super.mouseX >= 335 && super.mouseX <= 391) {
  6956. menuActionName[1] = "Off trade";
  6957. menuActionID[1] = 987;
  6958. menuActionName[2] = "Friends trade";
  6959. menuActionID[2] = 986;
  6960. menuActionName[3] = "On trade";
  6961. menuActionID[3] = 985;
  6962. menuActionName[4] = "View trade";
  6963. menuActionID[4] = 984;
  6964. menuActionRow = 5;
  6965. } else if (super.mouseX >= 404 && super.mouseX <= 515) {
  6966. menuActionName[1] = "Report Abuse";
  6967. menuActionID[1] = 606;
  6968. menuActionRow = 2;
  6969. }
  6970. }
  6971. }
  6972.  
  6973. public void processRightClick() {
  6974. if (activeInterfaceType != 0) {
  6975. return;
  6976. }
  6977. menuActionName[0] = "Cancel";
  6978. menuActionID[0] = 1107;
  6979. menuActionRow = 1;
  6980. if (showChatComponents) {
  6981. buildSplitPrivateChatMenu();
  6982. }
  6983. anInt886 = 0;
  6984. anInt1315 = 0;
  6985. if (frameMode == ScreenMode.FIXED) {
  6986. if (super.mouseX > 4 && super.mouseY > 4 && super.mouseX < 516 && super.mouseY < 338) {
  6987. if (openInterfaceID != -1) {
  6988. buildInterfaceMenu(4, RSInterface.interfaceCache[openInterfaceID], super.mouseX, 4, super.mouseY, 0);
  6989. } else {
  6990. build3dScreenMenu();
  6991. }
  6992. }
  6993. } else if (frameMode != ScreenMode.FIXED) {
  6994. if (getMousePositions()) {
  6995. int w = 512, h = 334;
  6996. int x = (frameWidth / 2) - 256, y = (frameHeight / 2) - 167;
  6997. int x2 = (frameWidth / 2) + 256, y2 = (frameHeight / 2) + 167;
  6998. int count = !changeTabArea ? 4 : 3;
  6999. if (frameMode != ScreenMode.FIXED) {
  7000. for (int i = 0; i < count; i++) {
  7001. if (x + w > (frameWidth - 225)) {
  7002. x = x - 30;
  7003. x2 = x2 - 30;
  7004. if (x < 0) {
  7005. x = 0;
  7006. }
  7007. }
  7008. if (y + h > (frameHeight - 182)) {
  7009. y = y - 30;
  7010. y2 = y2 - 30;
  7011. if (y < 0) {
  7012. y = 0;
  7013. }
  7014. }
  7015. }
  7016. }
  7017. if (openInterfaceID == 5292) {
  7018. if (super.mouseX > (frameWidth / 2) - 356 && super.mouseY > (frameHeight / 2) - 230 && super.mouseX < ((frameWidth / 2) + 356) && super.mouseY < (frameHeight / 2) + 230) {
  7019. buildInterfaceMenu((frameWidth / 2) - 356, RSInterface.interfaceCache[openInterfaceID], super.mouseX, (frameHeight / 2) - 230, super.mouseY, 0);
  7020. } else {
  7021. build3dScreenMenu();
  7022. }
  7023. } else if (openInterfaceID != -1 && openInterfaceID != 5292 && super.mouseX > x && super.mouseY > y && super.mouseX < x2 && super.mouseY < y2) {
  7024. buildInterfaceMenu(x, RSInterface.interfaceCache[openInterfaceID], super.mouseX, y, super.mouseY, 0);
  7025. } else {
  7026. build3dScreenMenu();
  7027. }
  7028. }
  7029. }
  7030. if (anInt886 != anInt1026) {
  7031. anInt1026 = anInt886;
  7032. }
  7033. if (anInt1315 != anInt1129) {
  7034. anInt1129 = anInt1315;
  7035. }
  7036. anInt886 = 0;
  7037. anInt1315 = 0;
  7038. if (!changeTabArea) {
  7039. final int yOffset = frameMode == ScreenMode.FIXED ? 0 : frameHeight - 503;
  7040. final int xOffset = frameMode == ScreenMode.FIXED ? 0 : frameWidth - 765;
  7041. if (super.mouseX > 548 + xOffset && super.mouseX < 740 + xOffset && super.mouseY > 207 + yOffset && super.mouseY < 468 + yOffset) {
  7042. if (invOverlayInterfaceID != -1) {
  7043. buildInterfaceMenu(548 + xOffset, RSInterface.interfaceCache[invOverlayInterfaceID], super.mouseX, 207 + yOffset, super.mouseY, 0);
  7044. } else if (tabInterfaceIDs[tabID] != -1) {
  7045. buildInterfaceMenu(548 + xOffset, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], super.mouseX, 207 + yOffset, super.mouseY, 0);
  7046. }
  7047. }
  7048. } else if (changeTabArea) {
  7049. final int yOffset = frameWidth >= 1000 ? 37 : 74;
  7050. if (super.mouseX > frameWidth - 197 && super.mouseY > frameHeight - yOffset - 267 && super.mouseX < frameWidth - 7 && super.mouseY < frameHeight - yOffset - 7 && showTabComponents) {
  7051. if (invOverlayInterfaceID != -1) {
  7052. buildInterfaceMenu(frameWidth - 197, RSInterface.interfaceCache[invOverlayInterfaceID], super.mouseX, frameHeight - yOffset - 267, super.mouseY, 0);
  7053. } else if (tabInterfaceIDs[tabID] != -1) {
  7054. buildInterfaceMenu(frameWidth - 197, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], super.mouseX, frameHeight - yOffset - 267, super.mouseY, 0);
  7055. }
  7056. }
  7057. }
  7058. if (anInt886 != anInt1048) {
  7059. tabAreaAltered = true;
  7060. anInt1048 = anInt886;
  7061. }
  7062. if (anInt1315 != anInt1044) {
  7063. tabAreaAltered = true;
  7064. anInt1044 = anInt1315;
  7065. }
  7066. anInt886 = 0;
  7067. anInt1315 = 0;
  7068. 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) {
  7069. if (backDialogID != -1) {
  7070. buildInterfaceMenu(20, RSInterface.interfaceCache[backDialogID], super.mouseX, (frameMode == ScreenMode.FIXED ? 358 : frameHeight - 145), super.mouseY, 0);
  7071. } else if (super.mouseY < (frameMode == ScreenMode.FIXED ? 463 : frameHeight - 40) && super.mouseX < 490) {
  7072. buildChatAreaMenu(super.mouseY - (frameMode == ScreenMode.FIXED ? 338 : frameHeight - 165));
  7073. }
  7074. }
  7075. if (backDialogID != -1 && anInt886 != anInt1039) {
  7076. inputTaken = true;
  7077. anInt1039 = anInt886;
  7078. }
  7079. if (backDialogID != -1 && anInt1315 != anInt1500) {
  7080. inputTaken = true;
  7081. anInt1500 = anInt1315;
  7082. }
  7083. if (super.mouseX > 4 && super.mouseY > 480 && super.mouseX < 516 && super.mouseY < frameHeight) {
  7084. rightClickChatButtons();
  7085. }
  7086. processMinimapActions();
  7087. boolean flag = false;
  7088. while (!flag) {
  7089. flag = true;
  7090. for (int j = 0; j < menuActionRow - 1; j++) {
  7091. if (menuActionID[j] < 1000 && menuActionID[j + 1] > 1000) {
  7092. String s = menuActionName[j];
  7093. menuActionName[j] = menuActionName[j + 1];
  7094. menuActionName[j + 1] = s;
  7095. int k = menuActionID[j];
  7096. menuActionID[j] = menuActionID[j + 1];
  7097. menuActionID[j + 1] = k;
  7098. k = menuActionCmd2[j];
  7099. menuActionCmd2[j] = menuActionCmd2[j + 1];
  7100. menuActionCmd2[j + 1] = k;
  7101. k = menuActionCmd3[j];
  7102. menuActionCmd3[j] = menuActionCmd3[j + 1];
  7103. menuActionCmd3[j + 1] = k;
  7104. k = menuActionCmd1[j];
  7105. menuActionCmd1[j] = menuActionCmd1[j + 1];
  7106. menuActionCmd1[j + 1] = k;
  7107. flag = false;
  7108. }
  7109. }
  7110. }
  7111. }
  7112.  
  7113. private AccountData currentAccount;
  7114.  
  7115. public void login(String username, String password, boolean flag) {
  7116. Signlink.errorname = username;
  7117. try {
  7118. if (rememberMe && username != null && password != null) {
  7119. SettingHandler.save();
  7120. }
  7121. if (!flag) {
  7122. loginMessage1 = "";
  7123. loginMessage2 = "Connecting to server...";
  7124. loginRenderer.displayLoginScreen();
  7125. }
  7126. server = ClientConstants.SERVER_IPS[ClientConstants.worldSelected - 1];
  7127. socketStream = new RSSocket(this, openSocket(ClientConstants.SERVER_PORT + portOff));
  7128. long l = TextClass.longForName(username);
  7129. int i = (int) (l >> 16 & 31L);
  7130. stream.currentOffset = 0;
  7131. stream.writeWordBigEndian(14);
  7132. stream.writeWordBigEndian(i);
  7133. socketStream.queueBytes(2, stream.buffer);
  7134. for (int j = 0; j < 8; j++)
  7135. socketStream.read();
  7136.  
  7137. int k = socketStream.read();
  7138. int i1 = k;
  7139. if (k == 0) {
  7140. socketStream.flushInputStream(inStream.buffer, 8);
  7141. inStream.currentOffset = 0;
  7142. aLong1215 = inStream.readQWord();
  7143. int ai[] = new int[4];
  7144. ai[0] = (int) (Math.random() * 99999999D);
  7145. ai[1] = (int) (Math.random() * 99999999D);
  7146. ai[2] = (int) (aLong1215 >> 32);
  7147. ai[3] = (int) aLong1215;
  7148. stream.currentOffset = 0;
  7149. stream.writeWordBigEndian(100);
  7150. stream.writeDWord(ai[0]);
  7151. stream.writeDWord(ai[1]);
  7152. stream.writeDWord(ai[2]);
  7153. stream.writeDWord(ai[3]);
  7154. stream.writeString(String.valueOf(IdentityResolver.resolve()));
  7155. stream.writeString(username);
  7156. stream.writeString(password);
  7157. stream.doKeys();
  7158. aStream_847.currentOffset = 0;
  7159. if (flag)
  7160. aStream_847.writeWordBigEndian(18);
  7161. else
  7162. aStream_847.writeWordBigEndian(16);
  7163. aStream_847.writeWordBigEndian(stream.currentOffset + 36 + 1 + 1 + 2);
  7164. aStream_847.writeWordBigEndian(255);
  7165. aStream_847.writeWord(217 + ClientConstants.CLIENT_VERSION_INT);
  7166. aStream_847.writeWordBigEndian(lowMem ? 1 : 0);
  7167. for (int l1 = 0; l1 < 9; l1++)
  7168. aStream_847.writeDWord(expectedCRCs[l1]);
  7169.  
  7170. aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
  7171. stream.encryption = new ISAACRandomGen(ai);
  7172. for (int j2 = 0; j2 < 4; j2++)
  7173. ai[j2] += 50;
  7174.  
  7175. encryption = new ISAACRandomGen(ai);
  7176. socketStream.queueBytes(aStream_847.currentOffset, aStream_847.buffer);
  7177. k = socketStream.read();
  7178. }
  7179. if (k == 1) {
  7180. try {
  7181. Thread.sleep(2000L);
  7182. } catch (Exception _ex) {
  7183. }
  7184. login(username, password, flag);
  7185. return;
  7186. }
  7187. if (k == 2) {
  7188. myUsername = username;
  7189. myPassword = password;
  7190. myPrivilege = socketStream.read();
  7191. final AccountData account = new AccountData(myPrivilege, username, password);
  7192. if (rememberMe) {
  7193. AccountManager.addAccount(account);
  7194. }
  7195. currentAccount = AccountManager.getAccount(username);
  7196. if (currentAccount == null) {
  7197. currentAccount = account;
  7198. }
  7199. if (rememberMe) {
  7200. AccountManager.saveAccount();
  7201. }
  7202. flagged = socketStream.read() == 1;
  7203. aLong1220 = 0L;
  7204. anInt1022 = 0;
  7205. mouseDetection.coordsIndex = 0;
  7206. super.awtFocus = true;
  7207. aBoolean954 = true;
  7208. loggedIn = true;
  7209. stream.currentOffset = 0;
  7210. inStream.currentOffset = 0;
  7211. pktType = -1;
  7212. anInt841 = -1;
  7213. anInt842 = -1;
  7214. anInt843 = -1;
  7215. pktSize = 0;
  7216. anInt1009 = 0;
  7217. anInt1104 = 0;
  7218. anInt1011 = 0;
  7219. anInt855 = 0;
  7220. menuActionRow = 0;
  7221. menuOpen = false;
  7222. super.idleTime = 0;
  7223. for (int j1 = 0; j1 < 500; j1++)
  7224. chatMessages[j1] = null;
  7225. itemSelected = 0;
  7226. spellSelected = 0;
  7227. loadingStage = 0;
  7228. anInt1062 = 0;
  7229. setNorth();
  7230. anInt1021 = 0;
  7231. anInt985 = -1;
  7232. destX = 0;
  7233. destY = 0;
  7234. playerCount = 0;
  7235. npcCount = 0;
  7236. for (int i2 = 0; i2 < maxPlayers; i2++) {
  7237. playerArray[i2] = null;
  7238. aStreamArray895s[i2] = null;
  7239. }
  7240. for (int index = 0; index < 17; index++) {
  7241. console.inputConsoleMessages[index] = "";
  7242. }
  7243. for (int k2 = 0; k2 < 16384; k2++)
  7244. npcArray[k2] = null;
  7245. myPlayer = playerArray[myPlayerIndex] = new Player();
  7246. aClass19_1013.removeAll();
  7247. aClass19_1056.removeAll();
  7248. for (int l2 = 0; l2 < 4; l2++) {
  7249. for (int i3 = 0; i3 < 104; i3++) {
  7250. for (int k3 = 0; k3 < 104; k3++)
  7251. groundArray[l2][i3][k3] = null;
  7252. }
  7253. }
  7254. aClass19_1179 = new NodeList();
  7255. fullscreenInterfaceID = -1;
  7256. anInt900 = 0;
  7257. friendsCount = 0;
  7258. dialogID = -1;
  7259. backDialogID = -1;
  7260. openInterfaceID = -1;
  7261. invOverlayInterfaceID = -1;
  7262. anInt1018 = -1;
  7263. aBoolean1149 = false;
  7264. tabID = 3;
  7265. inputDialogState = 0;
  7266. menuOpen = false;
  7267. messagePromptRaised = false;
  7268. aString844 = null;
  7269. anInt1055 = 0;
  7270. anInt1054 = -1;
  7271. aBoolean1047 = true;
  7272. method45();
  7273. for (int j3 = 0; j3 < 5; j3++)
  7274. anIntArray990[j3] = 0;
  7275. for (int l3 = 0; l3 < 5; l3++) {
  7276. atPlayerActions[l3] = null;
  7277. atPlayerArray[l3] = false;
  7278. }
  7279. anInt1175 = 0;
  7280. anInt1134 = 0;
  7281. anInt986 = 0;
  7282. anInt1288 = 0;
  7283. anInt924 = 0;
  7284. anInt1188 = 0;
  7285. anInt1155 = 0;
  7286. anInt1226 = 0;
  7287. sendFrame36(429, 1);
  7288. resetImageProducers2();
  7289. setBounds();
  7290. return;
  7291. }
  7292. if (k == 3) {
  7293. loginMessage1 = "Invalid username or password.";
  7294. loginMessage2 = "Please try again.";
  7295. return;
  7296. }
  7297. if (k == 4) {
  7298. loginMessage1 = "Your account has been disabled.";
  7299. loginMessage2 = "Please check your message-center for details.";
  7300. return;
  7301. }
  7302. if (k == 5) {
  7303. loginMessage1 = "Your account is already logged in.";
  7304. loginMessage2 = "Try again in 60 secs...";
  7305. return;
  7306. }
  7307. if (k == 6) {
  7308. loginMessage1 = "Vencillio has been updated!";
  7309. loginMessage2 = "Please download the newest client.";
  7310. openURL("http://www.vencillio.com/downloads/Client.jar");
  7311. return;
  7312. }
  7313. if (k == 7) {
  7314. loginMessage1 = "This world is full.";
  7315. loginMessage2 = "Please use a different world.";
  7316. return;
  7317. }
  7318. if (k == 8) {
  7319. loginMessage1 = "Unable to connect.";
  7320. loginMessage2 = "Login server offline.";
  7321. return;
  7322. }
  7323. if (k == 9) {
  7324. loginMessage1 = "Login limit exceeded.";
  7325. loginMessage2 = "Too many connections from your address.";
  7326. return;
  7327. }
  7328. if (k == 10) {
  7329. loginMessage1 = "Unable to connect.";
  7330. loginMessage2 = "Bad session id.";
  7331. return;
  7332. }
  7333. if (k == 11) {
  7334. loginMessage1 = "Login server rejected session.";
  7335. loginMessage2 = "Please try again.";
  7336. return;
  7337. }
  7338. if (k == 12) {
  7339. loginMessage1 = "You need a members account to login to this world.";
  7340. loginMessage2 = "Please subscribe, or use a different world.";
  7341. return;
  7342. }
  7343. if (k == 13) {
  7344. loginMessage1 = "Could not complete login.";
  7345. loginMessage2 = "Please try using a different world.";
  7346. return;
  7347. }
  7348. if (k == 14) {
  7349. loginMessage1 = "The server is being updated.";
  7350. loginMessage2 = "Please wait 1 minute and try again.";
  7351. return;
  7352. }
  7353. if (k == 15) {
  7354. loggedIn = true;
  7355. stream.currentOffset = 0;
  7356. inStream.currentOffset = 0;
  7357. pktType = -1;
  7358. anInt841 = -1;
  7359. anInt842 = -1;
  7360. anInt843 = -1;
  7361. pktSize = 0;
  7362. anInt1009 = 0;
  7363. anInt1104 = 0;
  7364. menuActionRow = 0;
  7365. menuOpen = false;
  7366. aLong824 = System.currentTimeMillis();
  7367. return;
  7368. }
  7369. if (k == 16) {
  7370. loginMessage1 = "Login attempts exceeded.";
  7371. loginMessage2 = "Please wait 1 minute and try again.";
  7372. return;
  7373. }
  7374. if (k == 17) {
  7375. loginMessage1 = "You are standing in a members-only area.";
  7376. loginMessage2 = "To play on this world move to a free area first";
  7377. return;
  7378. }
  7379. if (k == 20) {
  7380. loginMessage1 = "Invalid loginserver requested";
  7381. loginMessage2 = "Please try using a different world.";
  7382. return;
  7383. }
  7384. if (k == 21) {
  7385. for (int k1 = socketStream.read(); k1 >= 0; k1--) {
  7386. loginMessage1 = "You have only just left another world";
  7387. loginMessage2 = "Your profile will be transferred in: " + k1 + " seconds";
  7388. loginRenderer.displayLoginScreen();
  7389. try {
  7390. Thread.sleep(1000L);
  7391. } catch (Exception _ex) {
  7392. }
  7393. }
  7394. login(username, password, flag);
  7395. return;
  7396. }
  7397. if (k == 22) {
  7398. loginMessage1 = "The username '" + TextClass.capitalize(myUsername) + "' is restricted!";
  7399. loginMessage2 = "Please use a different one.";
  7400. return;
  7401. }
  7402. if (k == 23) {
  7403. loginMessage1 = "You do not have permission to do this!";
  7404. loginMessage2 = "Please try a different world.";
  7405. return;
  7406. }
  7407. if (k == -1) {
  7408. if (i1 == 0) {
  7409. if (loginFailures < 2) {
  7410. try {
  7411. Thread.sleep(2000L);
  7412. } catch (Exception _ex) {
  7413. }
  7414. loginFailures++;
  7415. login(username, password, flag);
  7416. return;
  7417. } else {
  7418. loginMessage1 = "No response from loginserver";
  7419. loginMessage2 = "Please wait 1 minute and try again.";
  7420. return;
  7421. }
  7422. } else {
  7423. loginMessage1 = "No response from server";
  7424. loginMessage2 = "Please try using a different world.";
  7425. return;
  7426. }
  7427. } else {
  7428. System.out.println("response:" + k);
  7429. loginMessage1 = "Unexpected server response";
  7430. loginMessage2 = "Please try using a different world.";
  7431. return;
  7432. }
  7433. } catch (IOException _ex) {
  7434. loginMessage1 = "";
  7435. }
  7436. loginMessage2 = "Error connecting to server.";
  7437. }
  7438.  
  7439. 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) {
  7440. byte byte0 = 104;
  7441. byte byte1 = 104;
  7442. for (int l2 = 0; l2 < byte0; l2++) {
  7443. for (int i3 = 0; i3 < byte1; i3++) {
  7444. anIntArrayArray901[l2][i3] = 0;
  7445. anIntArrayArray825[l2][i3] = 0x5f5e0ff;
  7446. }
  7447. }
  7448. int j3 = j2;
  7449. int k3 = j1;
  7450. anIntArrayArray901[j2][j1] = 99;
  7451. anIntArrayArray825[j2][j1] = 0;
  7452. int l3 = 0;
  7453. int i4 = 0;
  7454. bigX[l3] = j2;
  7455. bigY[l3++] = j1;
  7456. boolean flag1 = false;
  7457. int j4 = bigX.length;
  7458. int ai[][] = aClass11Array1230[plane].anIntArrayArray294;
  7459. while (i4 != l3) {
  7460. j3 = bigX[i4];
  7461. k3 = bigY[i4];
  7462. i4 = (i4 + 1) % j4;
  7463. if (j3 == k2 && k3 == i2) {
  7464. flag1 = true;
  7465. break;
  7466. }
  7467. if (i1 != 0) {
  7468. if ((i1 < 5 || i1 == 10) && aClass11Array1230[plane].method219(k2, j3, k3, j, i1 - 1, i2)) {
  7469. flag1 = true;
  7470. break;
  7471. }
  7472. if (i1 < 10 && aClass11Array1230[plane].method220(k2, i2, k3, i1 - 1, j, j3)) {
  7473. flag1 = true;
  7474. break;
  7475. }
  7476. }
  7477. if (k1 != 0 && k != 0 && aClass11Array1230[plane].method221(i2, k2, j3, k, l1, k1, k3)) {
  7478. flag1 = true;
  7479. break;
  7480. }
  7481. int l4 = anIntArrayArray825[j3][k3] + 1;
  7482. if (j3 > 0 && anIntArrayArray901[j3 - 1][k3] == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0) {
  7483. bigX[l3] = j3 - 1;
  7484. bigY[l3] = k3;
  7485. l3 = (l3 + 1) % j4;
  7486. anIntArrayArray901[j3 - 1][k3] = 2;
  7487. anIntArrayArray825[j3 - 1][k3] = l4;
  7488. }
  7489. if (j3 < byte0 - 1 && anIntArrayArray901[j3 + 1][k3] == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0) {
  7490. bigX[l3] = j3 + 1;
  7491. bigY[l3] = k3;
  7492. l3 = (l3 + 1) % j4;
  7493. anIntArrayArray901[j3 + 1][k3] = 8;
  7494. anIntArrayArray825[j3 + 1][k3] = l4;
  7495. }
  7496. if (k3 > 0 && anIntArrayArray901[j3][k3 - 1] == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  7497. bigX[l3] = j3;
  7498. bigY[l3] = k3 - 1;
  7499. l3 = (l3 + 1) % j4;
  7500. anIntArrayArray901[j3][k3 - 1] = 1;
  7501. anIntArrayArray825[j3][k3 - 1] = l4;
  7502. }
  7503. if (k3 < byte1 - 1 && anIntArrayArray901[j3][k3 + 1] == 0 && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  7504. bigX[l3] = j3;
  7505. bigY[l3] = k3 + 1;
  7506. l3 = (l3 + 1) % j4;
  7507. anIntArrayArray901[j3][k3 + 1] = 4;
  7508. anIntArrayArray825[j3][k3 + 1] = l4;
  7509. }
  7510. 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) {
  7511. bigX[l3] = j3 - 1;
  7512. bigY[l3] = k3 - 1;
  7513. l3 = (l3 + 1) % j4;
  7514. anIntArrayArray901[j3 - 1][k3 - 1] = 3;
  7515. anIntArrayArray825[j3 - 1][k3 - 1] = l4;
  7516. }
  7517. 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) {
  7518. bigX[l3] = j3 + 1;
  7519. bigY[l3] = k3 - 1;
  7520. l3 = (l3 + 1) % j4;
  7521. anIntArrayArray901[j3 + 1][k3 - 1] = 9;
  7522. anIntArrayArray825[j3 + 1][k3 - 1] = l4;
  7523. }
  7524. 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) {
  7525. bigX[l3] = j3 - 1;
  7526. bigY[l3] = k3 + 1;
  7527. l3 = (l3 + 1) % j4;
  7528. anIntArrayArray901[j3 - 1][k3 + 1] = 6;
  7529. anIntArrayArray825[j3 - 1][k3 + 1] = l4;
  7530. }
  7531. 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) {
  7532. bigX[l3] = j3 + 1;
  7533. bigY[l3] = k3 + 1;
  7534. l3 = (l3 + 1) % j4;
  7535. anIntArrayArray901[j3 + 1][k3 + 1] = 12;
  7536. anIntArrayArray825[j3 + 1][k3 + 1] = l4;
  7537. }
  7538. }
  7539. anInt1264 = 0;
  7540. if (!flag1) {
  7541. if (flag) {
  7542. int i5 = 100;
  7543. for (int k5 = 1; k5 < 2; k5++) {
  7544. for (int i6 = k2 - k5; i6 <= k2 + k5; i6++) {
  7545. for (int l6 = i2 - k5; l6 <= i2 + k5; l6++) {
  7546. if (i6 >= 0 && l6 >= 0 && i6 < 104 && l6 < 104 && anIntArrayArray825[i6][l6] < i5) {
  7547. i5 = anIntArrayArray825[i6][l6];
  7548. j3 = i6;
  7549. k3 = l6;
  7550. anInt1264 = 1;
  7551. flag1 = true;
  7552. }
  7553. }
  7554. }
  7555. if (flag1)
  7556. break;
  7557. }
  7558. }
  7559. if (!flag1)
  7560. return false;
  7561. }
  7562. i4 = 0;
  7563. bigX[i4] = j3;
  7564. bigY[i4++] = k3;
  7565. int l5;
  7566. for (int j5 = l5 = anIntArrayArray901[j3][k3]; j3 != j2 || k3 != j1; j5 = anIntArrayArray901[j3][k3]) {
  7567. if (j5 != l5) {
  7568. l5 = j5;
  7569. bigX[i4] = j3;
  7570. bigY[i4++] = k3;
  7571. }
  7572. if ((j5 & 2) != 0)
  7573. j3++;
  7574. else if ((j5 & 8) != 0)
  7575. j3--;
  7576. if ((j5 & 1) != 0)
  7577. k3++;
  7578. else if ((j5 & 4) != 0)
  7579. k3--;
  7580. }
  7581. if (i4 > 0) {
  7582. int k4 = i4;
  7583. if (k4 > 25)
  7584. k4 = 25;
  7585. i4--;
  7586. int k6 = bigX[i4];
  7587. int i7 = bigY[i4];
  7588. anInt1288 += k4;
  7589. if (anInt1288 >= 92) {
  7590. stream.createFrame(36);
  7591. stream.writeDWord(0);
  7592. anInt1288 = 0;
  7593. }
  7594. if (i == 0) {
  7595. stream.createFrame(164);
  7596. stream.writeWordBigEndian(k4 + k4 + 3);
  7597. }
  7598. if (i == 1) {
  7599. stream.createFrame(248);
  7600. stream.writeWordBigEndian(k4 + k4 + 3 + 14);
  7601. }
  7602. if (i == 2) {
  7603. stream.createFrame(98);
  7604. stream.writeWordBigEndian(k4 + k4 + 3);
  7605. }
  7606. stream.method433(k6 + baseX);
  7607. destX = bigX[0];
  7608. destY = bigY[0];
  7609. for (int j7 = 1; j7 < k4; j7++) {
  7610. i4--;
  7611. stream.writeWordBigEndian(bigX[i4] - k6);
  7612. stream.writeWordBigEndian(bigY[i4] - i7);
  7613. }
  7614. stream.method431(i7 + baseY);
  7615. stream.method424(super.keyArray[5] != 1 ? 0 : 1);
  7616. return true;
  7617. }
  7618. return i != 1;
  7619. }
  7620.  
  7621. private void method86(Stream stream) {
  7622. for (int j = 0; j < anInt893; j++) {
  7623. int k = anIntArray894[j];
  7624. Npc npc = npcArray[k];
  7625. int l = stream.readUnsignedByte();
  7626. if ((l & 0x10) != 0) {
  7627. int i1 = stream.method434();
  7628. if (i1 == 65535)
  7629. i1 = -1;
  7630. int i2 = stream.readUnsignedByte();
  7631. if (i1 == npc.anim && i1 != -1) {
  7632. int l2 = Animation.anims[i1].anInt365;
  7633. if (l2 == 1) {
  7634. npc.anInt1527 = 0;
  7635. npc.anInt1528 = 0;
  7636. npc.anInt1529 = i2;
  7637. npc.anInt1530 = 0;
  7638. }
  7639. if (l2 == 2)
  7640. npc.anInt1530 = 0;
  7641. } else if (i1 == -1 || npc.anim == -1 || Animation.anims[i1].anInt359 >= Animation.anims[npc.anim].anInt359) {
  7642. npc.anim = i1;
  7643. npc.anInt1527 = 0;
  7644. npc.anInt1528 = 0;
  7645. npc.anInt1529 = i2;
  7646. npc.anInt1530 = 0;
  7647. npc.anInt1542 = npc.smallXYIndex;
  7648. }
  7649. }
  7650. if ((l & 8) != 0) {
  7651. int j1 = stream.method426();
  7652. int j2 = stream.method427();
  7653. int icon = stream.readUnsignedByte();
  7654. npc.updateHitData(j2, j1, loopCycle, icon);
  7655. npc.loopCycleStatus = loopCycle + 300;
  7656. npc.currentHealth = stream.method426();
  7657. npc.maxHealth = stream.readUnsignedByte();
  7658. }
  7659. if ((l & 0x80) != 0) {
  7660. npc.anInt1520 = stream.readUnsignedWord();
  7661. int k1 = stream.readDWord();
  7662. npc.anInt1524 = k1 >> 16;
  7663. npc.anInt1523 = loopCycle + (k1 & 0xffff);
  7664. npc.anInt1521 = 0;
  7665. npc.anInt1522 = 0;
  7666. if (npc.anInt1523 > loopCycle)
  7667. npc.anInt1521 = -1;
  7668. if (npc.anInt1520 == 65535)
  7669. npc.anInt1520 = -1;
  7670. }
  7671. if ((l & 0x20) != 0) {
  7672. npc.interactingEntity = stream.readUnsignedWord();
  7673. if (npc.interactingEntity == 65535)
  7674. npc.interactingEntity = -1;
  7675. }
  7676. if ((l & 1) != 0) {
  7677. npc.textSpoken = stream.readString();
  7678. npc.textCycle = 100;
  7679. }
  7680. if ((l & 0x40) != 0) {
  7681. int l1 = stream.method427();
  7682. int k2 = stream.method428();
  7683. int icon = stream.readUnsignedByte();
  7684. npc.updateHitData(k2, l1, loopCycle, icon);
  7685. npc.loopCycleStatus = loopCycle + 300;
  7686. npc.currentHealth = stream.method428();
  7687. npc.maxHealth = stream.method427();
  7688. }
  7689. if ((l & 2) != 0) {
  7690. npc.desc = EntityDef.forID(stream.method436());
  7691. npc.anInt1540 = npc.desc.aByte68;
  7692. npc.anInt1504 = npc.desc.anInt79;
  7693. npc.anInt1554 = npc.desc.walkAnim;
  7694. npc.anInt1555 = npc.desc.anInt58;
  7695. npc.anInt1556 = npc.desc.anInt83;
  7696. npc.anInt1557 = npc.desc.anInt55;
  7697. npc.anInt1511 = npc.desc.standAnim;
  7698. }
  7699. if ((l & 4) != 0) {
  7700. npc.anInt1538 = stream.method434();
  7701. npc.anInt1539 = stream.method434();
  7702. }
  7703. }
  7704. }
  7705.  
  7706. private void buildAtNPCMenu(EntityDef entityDef, int i, int j, int k) {
  7707. if (menuActionRow >= 400)
  7708. return;
  7709. if (entityDef.childrenIDs != null)
  7710. entityDef = entityDef.method161();
  7711. if (entityDef == null)
  7712. return;
  7713. if (!entityDef.aBoolean84)
  7714. return;
  7715. String s = entityDef.name;
  7716. if (entityDef.combatLevel != 0)
  7717. s = s + combatDiffColor(myPlayer.combatLevel, entityDef.combatLevel) + " (level-" + entityDef.combatLevel + ")";
  7718. if (itemSelected == 1) {
  7719. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @yel@" + s;
  7720. menuActionID[menuActionRow] = 582;
  7721. menuActionCmd1[menuActionRow] = i;
  7722. menuActionCmd2[menuActionRow] = k;
  7723. menuActionCmd3[menuActionRow] = j;
  7724. menuActionRow++;
  7725. return;
  7726. }
  7727. if (spellSelected == 1) {
  7728. if ((spellUsableOn & 2) == 2) {
  7729. menuActionName[menuActionRow] = spellTooltip + " @yel@" + s;
  7730. menuActionID[menuActionRow] = 413;
  7731. menuActionCmd1[menuActionRow] = i;
  7732. menuActionCmd2[menuActionRow] = k;
  7733. menuActionCmd3[menuActionRow] = j;
  7734. menuActionRow++;
  7735. }
  7736. } else {
  7737. if (entityDef.actions != null) {
  7738. for (int l = 4; l >= 0; l--)
  7739. if (entityDef.actions[l] != null && !entityDef.actions[l].equalsIgnoreCase("attack")) {
  7740. menuActionName[menuActionRow] = entityDef.actions[l] + " @yel@" + s;
  7741. if (l == 0)
  7742. menuActionID[menuActionRow] = 20;
  7743. if (l == 1)
  7744. menuActionID[menuActionRow] = 412;
  7745. if (l == 2)
  7746. menuActionID[menuActionRow] = 225;
  7747. if (l == 3)
  7748. menuActionID[menuActionRow] = 965;
  7749. if (l == 4)
  7750. menuActionID[menuActionRow] = 478;
  7751. menuActionCmd1[menuActionRow] = i;
  7752. menuActionCmd2[menuActionRow] = k;
  7753. menuActionCmd3[menuActionRow] = j;
  7754. menuActionRow++;
  7755. }
  7756.  
  7757. }
  7758. if (entityDef.actions != null) {
  7759. for (int i1 = 4; i1 >= 0; i1--)
  7760. if (entityDef.actions[i1] != null && entityDef.actions[i1].equalsIgnoreCase("attack")) {
  7761. char c = '\0';
  7762. if (Configuration.entityAttackPriority && entityDef.combatLevel > myPlayer.combatLevel) {
  7763. c = '\u07D0';
  7764. }
  7765. menuActionName[menuActionRow] = entityDef.actions[i1] + " @yel@" + s;
  7766. if (i1 == 0)
  7767. menuActionID[menuActionRow] = 20 + c;
  7768. if (i1 == 1)
  7769. menuActionID[menuActionRow] = 412 + c;
  7770. if (i1 == 2)
  7771. menuActionID[menuActionRow] = 225 + c;
  7772. if (i1 == 3)
  7773. menuActionID[menuActionRow] = 965 + c;
  7774. if (i1 == 4)
  7775. menuActionID[menuActionRow] = 478 + c;
  7776. menuActionCmd1[menuActionRow] = i;
  7777. menuActionCmd2[menuActionRow] = k;
  7778. menuActionCmd3[menuActionRow] = j;
  7779. menuActionRow++;
  7780. }
  7781.  
  7782. }
  7783. if (ClientConstants.DEBUG_MODE) {
  7784. menuActionName[menuActionRow] = "Examine @yel@" + s + "@whi@(ID: @yel@" + entityDef.interfaceType + "@whi@)";
  7785. } else {
  7786. menuActionName[menuActionRow] = "Examine @yel@" + s;
  7787. }
  7788. menuActionID[menuActionRow] = 1025;
  7789. menuActionCmd1[menuActionRow] = i;
  7790. menuActionCmd2[menuActionRow] = k;
  7791. menuActionCmd3[menuActionRow] = j;
  7792. menuActionRow++;
  7793. }
  7794. }
  7795.  
  7796. private void buildAtPlayerMenu(int i, int j, Player player, int k) {
  7797. if (player == myPlayer)
  7798. return;
  7799. if (menuActionRow >= 400)
  7800. return;
  7801. String s;
  7802. String title = player.title.length() > 0 ? (player.titlePrefix ? " " : "") + "<col=" + player.titleColor + ">" + player.title + "</col>" + (player.titlePrefix ? "" : " ") : "";
  7803. if (player.skill == 0) {
  7804. if (!player.titlePrefix) {
  7805. s = title + "<col=ffffff>" + player.name + "</col>" + combatDiffColor(myPlayer.combatLevel, player.combatLevel) + " (level-" + player.combatLevel + ")";
  7806. } else {
  7807. s = "</col>" + player.name + combatDiffColor(myPlayer.combatLevel, player.combatLevel) + title + " (level-" + player.combatLevel + ")";
  7808. }
  7809. } else {
  7810. if (!player.titlePrefix) {
  7811. s = title + player.name + " (skill-" + player.skill + ")";
  7812. } else {
  7813. s = player.name + title + " (skill-" + player.skill + ")";
  7814. }
  7815. }
  7816. if (itemSelected == 1) {
  7817. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @whi@" + s;
  7818. menuActionID[menuActionRow] = 491;
  7819. menuActionCmd1[menuActionRow] = j;
  7820. menuActionCmd2[menuActionRow] = i;
  7821. menuActionCmd3[menuActionRow] = k;
  7822. menuActionRow++;
  7823. } else if (spellSelected == 1) {
  7824. if ((spellUsableOn & 8) == 8) {
  7825. menuActionName[menuActionRow] = spellTooltip + " @whi@" + s;
  7826. menuActionID[menuActionRow] = 365;
  7827. menuActionCmd1[menuActionRow] = j;
  7828. menuActionCmd2[menuActionRow] = i;
  7829. menuActionCmd3[menuActionRow] = k;
  7830. menuActionRow++;
  7831. }
  7832. } else {
  7833. for (int l = 4; l >= 0; l--)
  7834. if (atPlayerActions[l] != null) {
  7835. menuActionName[menuActionRow] = atPlayerActions[l] + " @whi@" + s;
  7836. char c = '\0';
  7837. if (atPlayerActions[l].equalsIgnoreCase("attack")) {
  7838. if (Configuration.entityAttackPriority && player.combatLevel > myPlayer.combatLevel)
  7839. c = '\u07D0';
  7840. if (myPlayer.team != 0 && player.team != 0)
  7841. if (myPlayer.team == player.team)
  7842. c = '\u07D0';
  7843. else
  7844. c = '\0';
  7845. } else if (atPlayerArray[l])
  7846. c = '\u07D0';
  7847. if (l == 0)
  7848. menuActionID[menuActionRow] = 561 + c;
  7849. if (l == 1)
  7850. menuActionID[menuActionRow] = 779 + c;
  7851. if (l == 2)
  7852. menuActionID[menuActionRow] = 27 + c;
  7853. if (l == 3)
  7854. menuActionID[menuActionRow] = 577 + c;
  7855. if (l == 4)
  7856. menuActionID[menuActionRow] = 729 + c;
  7857. menuActionCmd1[menuActionRow] = j;
  7858. menuActionCmd2[menuActionRow] = i;
  7859. menuActionCmd3[menuActionRow] = k;
  7860. menuActionRow++;
  7861. }
  7862.  
  7863. }
  7864. for (int i1 = 0; i1 < menuActionRow; i1++) {
  7865. if (menuActionID[i1] == 519) {
  7866. menuActionName[i1] = "Walk here @whi@" + s;
  7867. return;
  7868. }
  7869. }
  7870. }
  7871.  
  7872. private void method89(Class30_Sub1 class30_sub1) {
  7873. int i = 0;
  7874. int j = -1;
  7875. int k = 0;
  7876. int l = 0;
  7877. if (class30_sub1.anInt1296 == 0)
  7878. i = worldController.method300(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7879. if (class30_sub1.anInt1296 == 1)
  7880. i = worldController.method301(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7881. if (class30_sub1.anInt1296 == 2)
  7882. i = worldController.method302(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7883. if (class30_sub1.anInt1296 == 3)
  7884. i = worldController.method303(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7885. if (i != 0) {
  7886. int i1 = worldController.method304(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298, i);
  7887. j = i >> 14 & 0x7fff;
  7888. k = i1 & 0x1f;
  7889. l = i1 >> 6;
  7890. }
  7891. class30_sub1.anInt1299 = j;
  7892. class30_sub1.anInt1301 = k;
  7893. class30_sub1.anInt1300 = l;
  7894. }
  7895.  
  7896. void startUp() {
  7897. rebuildFrameSize(frameMode, frameWidth, frameHeight);
  7898. //new CacheDownloader(this).run();
  7899.  
  7900. SpriteLoader.loadSprites();
  7901. cacheSprite = SpriteLoader.sprites;
  7902. loginRenderer = new LoginRenderer(this);
  7903. drawSmoothLoading(50, "Starting up");
  7904. if (Signlink.cache_dat != null) {
  7905. for (int i = 0; i < 6; i++)
  7906. decompressors[i] = new Decompressor(Signlink.cache_dat, Signlink.cache_idx[i], i + 1);
  7907. }
  7908. try {
  7909. titleStreamLoader = streamLoaderForName(1, "title screen", "title", expectedCRCs[1], 25);
  7910. smallText = new TextDrawingArea(false, "p11_full", titleStreamLoader);
  7911. regularText = new TextDrawingArea(false, "p12_full", titleStreamLoader);
  7912. boldText = new TextDrawingArea(false, "b12_full", titleStreamLoader);
  7913. newSmallFont = new RSFont(false, "p11_full", titleStreamLoader);
  7914. newRegularFont = new RSFont(false, "p12_full", titleStreamLoader);
  7915. newBoldFont = new RSFont(false, "b12_full", titleStreamLoader);
  7916. newFancyFont = new RSFont(true, "q8_full", titleStreamLoader);
  7917. loadTitleScreen();
  7918. TextDrawingArea aTextDrawingArea_1273 = new TextDrawingArea(true, "q8_full", titleStreamLoader);
  7919. StreamLoader streamLoader = streamLoaderForName(2, "config", "config", expectedCRCs[2], 30);
  7920. StreamLoader streamLoader_1 = streamLoaderForName(3, "interface", "interface", expectedCRCs[3], 35);
  7921. StreamLoader streamLoader_2 = streamLoaderForName(4, "2d graphics", "media", expectedCRCs[4], 40);
  7922. this.mediaStreamLoader = streamLoader_2;
  7923. StreamLoader streamLoader_3 = streamLoaderForName(6, "textures", "textures", expectedCRCs[6], 45);
  7924. StreamLoader streamLoader_4 = streamLoaderForName(7, "chat system", "wordenc", expectedCRCs[7], 50);
  7925. streamLoaderForName(8, "sound effects", "sounds", expectedCRCs[8], 55);
  7926. byteGroundArray = new byte[4][104][104];
  7927. intGroundArray = new int[4][105][105];
  7928. worldController = new WorldController(intGroundArray);
  7929. for (int j = 0; j < 4; j++)
  7930. aClass11Array1230[j] = new Class11();
  7931. minimapImage = new Sprite(512, 512);
  7932. StreamLoader streamLoader_6 = streamLoaderForName(5, "update list", "versionlist", expectedCRCs[5], 60);
  7933. drawSmoothLoading(100, "Connecting to update server");
  7934. onDemandFetcher = new OnDemandFetcher();
  7935. onDemandFetcher.start(streamLoader_6, this);
  7936. SequenceFrame.animationlist = new SequenceFrame[2500][0];
  7937. Model.method459(onDemandFetcher.getModelCount(), onDemandFetcher);
  7938. repackCacheIndex(1);
  7939. drawSmoothLoading(175, "Unpacking media");
  7940. Sprite[] clanIcons = new Sprite[10];
  7941. for (int index = 0; index < newHitMarks.length; index++) {
  7942. newHitMarks[index] = new Sprite(streamLoader_2, "newhitmarks", index);
  7943. }
  7944. for (int index = 0; index < channelButtons.length; index++) {
  7945. channelButtons[index] = new Sprite(streamLoader_2, "cbuttons", index);
  7946. }
  7947. for (int index = 0; index < fixedGameComponents.length; index++) {
  7948. fixedGameComponents[index] = new Sprite(streamLoader_2, "fixed", index);
  7949. }
  7950. for (int index = 0; index < skillIcons.length; index++) {
  7951. skillIcons[index] = new Sprite(streamLoader_2, "skillicons", index);
  7952. }
  7953. for (int index = 0; index < gameComponents.length; index++) {
  7954. gameComponents[index] = new Sprite(streamLoader_2, "fullscreen", index);
  7955. }
  7956. for (int index = 0; index < orbComponents.length; index++) {
  7957. orbComponents[index] = new Sprite(streamLoader_2, "orbs3", index);
  7958. }
  7959. for (int index = 0; index < orbComponents2.length; index++) {
  7960. orbComponents2[index] = new Sprite(streamLoader_2, "orbs4", index);
  7961. }
  7962. for (int index = 0; index < orbComponents3.length; index++) {
  7963. orbComponents3[index] = new Sprite(streamLoader_2, "orbs5", index);
  7964. }
  7965. for (int index = 0; index < redStones.length; index++) {
  7966. redStones[index] = new Sprite(streamLoader_2, "redstone1", index);
  7967. }
  7968. for (int index = 0; index < hpBars.length; index++) {
  7969. hpBars[index] = new Sprite(streamLoader_2, "hpbars", index);
  7970. }
  7971. for (int index = 0; index < clanIcons.length; index++) {
  7972. clanIcons[index] = new Sprite(streamLoader_2, "clanicons", index);
  7973. }
  7974. for (int index = 0; index < currencies; index++) {
  7975. currencyImage[index] = cacheSprite[407 + index];
  7976. }
  7977. newSmallFont.unpackImages(modIcons, clanIcons);
  7978. newRegularFont.unpackImages(modIcons, clanIcons);
  7979. newBoldFont.unpackImages(modIcons, clanIcons);
  7980. newFancyFont.unpackImages(modIcons, clanIcons);
  7981. multiOverlay = new Sprite(streamLoader_2, "overlay_multiway", 0);
  7982. mapBack = new Background(streamLoader_2, "mapback", 0);
  7983. for (int j3 = 0; j3 <= 16; j3++) {
  7984. sideIcons[j3] = new Sprite(streamLoader_2, "sideicons", j3);
  7985. }
  7986.  
  7987. for (int i4 = 475; i4 <= 483; i4++) {
  7988. hitMark[i4 - 475] = cacheSprite[i4];
  7989. }
  7990.  
  7991. for (int i4 = 484; i4 <= 489; i4++) {
  7992. hitIcon[i4 - 484] = cacheSprite[i4];
  7993. }
  7994. compass = new Sprite(streamLoader_2, "compass", 0);
  7995. try {
  7996. for (int k3 = 0; k3 < 100; k3++)
  7997. mapScenes[k3] = new Background(streamLoader_2, "mapscene", k3);
  7998. } catch (Exception _ex) {
  7999. }
  8000. try {
  8001. for (int l3 = 0; l3 < 100; l3++)
  8002. mapFunctions[l3] = new Sprite(streamLoader_2, "mapfunction", l3);
  8003. } catch (Exception _ex) {
  8004. }
  8005. try {
  8006. for (int i4 = 0; i4 < 20; i4++)
  8007. hitMarks[i4] = new Sprite(streamLoader_2, "hitmarks", i4);
  8008. } catch (Exception _ex) {
  8009. }
  8010. try {
  8011. for (int h1 = 0; h1 < 6; h1++)
  8012. headIconsHint[h1] = new Sprite(streamLoader_2, "headicons_hint", h1);
  8013. } catch (Exception _ex) {
  8014. }
  8015. try {
  8016. for (int j4 = 0; j4 < 8; j4++)
  8017. headIcons[j4] = new Sprite(streamLoader_2, "headicons_prayer", j4);
  8018. for (int j45 = 0; j45 < 3; j45++)
  8019. skullIcons[j45] = new Sprite(streamLoader_2, "headicons_pk", j45);
  8020. } catch (Exception _ex) {
  8021. }
  8022. mapFlag = new Sprite(streamLoader_2, "mapmarker", 0);
  8023. mapMarker = new Sprite(streamLoader_2, "mapmarker", 1);
  8024. for (int k4 = 0; k4 < 8; k4++)
  8025. crosses[k4] = new Sprite(streamLoader_2, "cross", k4);
  8026. mapDotItem = new Sprite(streamLoader_2, "mapdots", 0);
  8027. mapDotNPC = new Sprite(streamLoader_2, "mapdots", 1);
  8028. mapDotPlayer = new Sprite(streamLoader_2, "mapdots", 2);
  8029. mapDotFriend = new Sprite(streamLoader_2, "mapdots", 3);
  8030. mapDotTeam = new Sprite(streamLoader_2, "mapdots", 4);
  8031. mapDotClan = new Sprite(streamLoader_2, "mapdots", 5);
  8032. scrollBar1 = new Sprite(streamLoader_2, "scrollbar", 0);
  8033. scrollBar2 = new Sprite(streamLoader_2, "scrollbar", 1);
  8034. try {
  8035. for (int l4 = 0; l4 < ClientConstants.ICON_AMOUNT; l4++) {
  8036. modIcons[l4] = new Sprite(streamLoader_2, "mod_icons", l4);
  8037. }
  8038. } catch (Exception e) {
  8039. }
  8040. Sprite sprite = new Sprite(streamLoader_2, "screenframe", 0);
  8041. leftFrame = new ImageProducer(sprite.myWidth, sprite.myHeight);
  8042. sprite.method346(0, 0);
  8043. sprite = new Sprite(streamLoader_2, "screenframe", 1);
  8044. topFrame = new ImageProducer(sprite.myWidth, sprite.myHeight);
  8045. sprite.method346(0, 0);
  8046. int i5 = (int) (Math.random() * 21D) - 10;
  8047. int j5 = (int) (Math.random() * 21D) - 10;
  8048. int k5 = (int) (Math.random() * 21D) - 10;
  8049. int l5 = (int) (Math.random() * 41D) - 20;
  8050. for (int i6 = 0; i6 < 100; i6++) {
  8051. if (mapFunctions[i6] != null)
  8052. mapFunctions[i6].method344(i5 + l5, j5 + l5, k5 + l5);
  8053. if (mapScenes[i6] != null)
  8054. mapScenes[i6].method360(i5 + l5, j5 + l5, k5 + l5);
  8055. }
  8056. drawSmoothLoading(275, "Unpacking textures");
  8057. Rasterizer.method368(streamLoader_3);
  8058. Rasterizer.method372(0.80000000000000004D);
  8059. Rasterizer.method367();
  8060. drawSmoothLoading(325, "Unpacking config");
  8061. Animation.unpackConfig(streamLoader);
  8062. ObjectDef.unpackConfig(streamLoader);
  8063. Floor.unpackConfig(streamLoader);
  8064. OverlayFloor.unpackConfig(streamLoader);
  8065. ItemDef.unpackConfig(streamLoader);
  8066. EntityDef.unpackConfig(streamLoader);
  8067. IdentityKit.unpackConfig(streamLoader);
  8068. SpotAnim.unpackConfig(streamLoader);
  8069. Varp.unpackConfig(streamLoader);
  8070. VarBit.unpackConfig(streamLoader);
  8071. ItemDef.isMembers = isMembers;
  8072. drawSmoothLoading(450, "Unpacking interfaces");
  8073. TextDrawingArea aclass30_sub2_sub1_sub4s[] = { smallText, regularText, boldText, aTextDrawingArea_1273 };
  8074. RSInterface.unpack(streamLoader_1, aclass30_sub2_sub1_sub4s, streamLoader_2);
  8075. drawSmoothLoading(550, "Preparing game engine");
  8076. for (int j6 = 0; j6 < 33; j6++) {
  8077. int k6 = 999;
  8078. int i7 = 0;
  8079. for (int k7 = 0; k7 < 34; k7++) {
  8080. if (mapBack.aByteArray1450[k7 + j6 * mapBack.anInt1452] == 0) {
  8081. if (k6 == 999)
  8082. k6 = k7;
  8083. continue;
  8084. }
  8085. if (k6 == 999)
  8086. continue;
  8087. i7 = k7;
  8088. break;
  8089. }
  8090. anIntArray968[j6] = k6;
  8091. anIntArray1057[j6] = i7 - k6;
  8092. }
  8093. for (int l6 = 1; l6 < 153; l6++) {
  8094. int j7 = 999;
  8095. int l7 = 0;
  8096. for (int j8 = 24; j8 < 177; j8++) {
  8097. if (mapBack.aByteArray1450[j8 + l6 * mapBack.anInt1452] == 0 && (j8 > 34 || l6 > 34)) {
  8098. if (j7 == 999) {
  8099. j7 = j8;
  8100. }
  8101. continue;
  8102. }
  8103. if (j7 == 999) {
  8104. continue;
  8105. }
  8106. l7 = j8;
  8107. break;
  8108. }
  8109. anIntArray1052[l6 - 1] = j7 - 24;
  8110. anIntArray1229[l6 - 1] = l7 - j7;
  8111. }
  8112. setBounds();
  8113. Censor.loadConfig(streamLoader_4);
  8114. mouseDetection = new MouseDetection(this);
  8115. startRunnable(mouseDetection, 10);
  8116. Animable_Sub5.clientInstance = this;
  8117. ObjectDef.clientInstance = this;
  8118. EntityDef.clientInstance = this;
  8119. AccountManager.loadAccount();
  8120. return;
  8121. } catch (Exception exception) {
  8122. exception.printStackTrace();
  8123. Signlink.reporterror("loaderror " + aString1049 + " " + anInt1079);
  8124. }
  8125. loadingError = true;
  8126. }
  8127.  
  8128. private void method91(Stream stream, int i) {
  8129. while (stream.bitPosition + 10 < i * 8) {
  8130. int j = stream.readBits(11);
  8131. if (j == 2047)
  8132. break;
  8133. if (playerArray[j] == null) {
  8134. playerArray[j] = new Player();
  8135. if (aStreamArray895s[j] != null)
  8136. playerArray[j].updatePlayer(aStreamArray895s[j]);
  8137. }
  8138. playerIndices[playerCount++] = j;
  8139. Player player = playerArray[j];
  8140. player.anInt1537 = loopCycle;
  8141. int k = stream.readBits(1);
  8142. if (k == 1)
  8143. anIntArray894[anInt893++] = j;
  8144. int l = stream.readBits(1);
  8145. int i1 = stream.readBits(5);
  8146. if (i1 > 15)
  8147. i1 -= 32;
  8148. int j1 = stream.readBits(5);
  8149. if (j1 > 15)
  8150. j1 -= 32;
  8151. player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1, l == 1);
  8152. }
  8153. stream.finishBitAccess();
  8154. }
  8155. public String indexLocation(int cacheIndex, int index) {
  8156. return Signlink.findcachedir() + "index" + cacheIndex + "/" + (index != -1 ? index + ".gz" : "");
  8157. }
  8158.  
  8159. public void repackCacheIndex(int cacheIndex) {
  8160. System.out.println("Started repacking index " + cacheIndex + ".");
  8161. int indexLength = new File(indexLocation(cacheIndex, -1)).listFiles().length;
  8162. File[] file = new File(indexLocation(cacheIndex, -1)).listFiles();
  8163. try {
  8164. for (int index = 0; index < indexLength; index++) {
  8165. int fileIndex = Integer.parseInt(getFileNameWithoutExtension(file[index].toString()));
  8166. byte[] data = fileToByteArray(cacheIndex, fileIndex);
  8167. if(data != null && data.length > 0) {
  8168. decompressors[cacheIndex].method234(data.length, data, fileIndex);
  8169. System.out.println("Repacked " + fileIndex + ".");
  8170. } else {
  8171. System.out.println("Unable to locate index " + fileIndex + ".");
  8172. }
  8173. }
  8174. } catch(Exception e) {
  8175. e.printStackTrace();
  8176. System.out.println("Error packing cache index " + cacheIndex + ".");
  8177. }
  8178. System.out.println("Finished repacking " + cacheIndex + ".");
  8179. }
  8180.  
  8181. public byte[] fileToByteArray(int cacheIndex, int index) {
  8182. try {
  8183. if (indexLocation(cacheIndex, index).length() <= 0 || indexLocation(cacheIndex, index) == null) {
  8184. return null;
  8185. }
  8186. File file = new File(indexLocation(cacheIndex, index));
  8187. byte[] fileData = new byte[(int)file.length()];
  8188. FileInputStream fis = new FileInputStream(file);
  8189. fis.read(fileData);
  8190. fis.close();
  8191. return fileData;
  8192. } catch(Exception e) {
  8193. return null;
  8194. }
  8195. }
  8196. public boolean inCircle(int circleX, int circleY, int clickX, int clickY, int radius) {
  8197. return java.lang.Math.pow((circleX + radius - clickX), 2) + java.lang.Math.pow((circleY + radius - clickY), 2) < java.lang.Math.pow(radius, 2);
  8198. }
  8199.  
  8200. private void processMainScreenClick() {
  8201. if (anInt1021 != 0)
  8202. return;
  8203. if (super.clickMode3 == 1) {
  8204. int i = super.saveClickX - 25 - 547;
  8205. int j = super.saveClickY - 5 - 3;
  8206. if (frameMode != ScreenMode.FIXED) {
  8207. i = super.saveClickX - (frameWidth - 182 + 24);
  8208. j = super.saveClickY - 8;
  8209. }
  8210.  
  8211. if (inCircle(0, 0, i, j, 76) && mouseMapPosition() && !runHover) {
  8212. i -= 73;
  8213. j -= 75;
  8214. int k = minimapInt1 + minimapInt2 & 0x7ff;
  8215. int i1 = Rasterizer.anIntArray1470[k];
  8216. int j1 = Rasterizer.anIntArray1471[k];
  8217. i1 = i1 * (minimapInt3 + 256) >> 8;
  8218. j1 = j1 * (minimapInt3 + 256) >> 8;
  8219. int k1 = j * i1 + i * j1 >> 11;
  8220. int l1 = j * j1 - i * i1 >> 11;
  8221. int i2 = myPlayer.x + k1 >> 7;
  8222. int j2 = myPlayer.y - l1 >> 7;
  8223. if ((myPrivilege == 2 || myPrivilege == 3 || myPrivilege == 4) && controlIsDown) {
  8224. teleport(baseX + i2, baseY + j2);
  8225. } else {
  8226. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0, j2, myPlayer.smallX[0], true, i2);
  8227. if (flag1) {
  8228. stream.writeWordBigEndian(i);
  8229. stream.writeWordBigEndian(j);
  8230. stream.writeWord(minimapInt1);
  8231. stream.writeWordBigEndian(57);
  8232. stream.writeWordBigEndian(minimapInt2);
  8233. stream.writeWordBigEndian(minimapInt3);
  8234. stream.writeWordBigEndian(89);
  8235. stream.writeWord(myPlayer.x);
  8236. stream.writeWord(myPlayer.y);
  8237. stream.writeWordBigEndian(anInt1264);
  8238. stream.writeWordBigEndian(63);
  8239. }
  8240. }
  8241. anInt1117++;
  8242. if (anInt1117 > 1151) {
  8243. anInt1117 = 0;
  8244. stream.createFrame(246);
  8245. stream.writeWordBigEndian(0);
  8246. int l = stream.currentOffset;
  8247. if ((int) (Math.random() * 2D) == 0)
  8248. stream.writeWordBigEndian(101);
  8249. stream.writeWordBigEndian(197);
  8250. stream.writeWord((int) (Math.random() * 65536D));
  8251. stream.writeWordBigEndian((int) (Math.random() * 256D));
  8252. stream.writeWordBigEndian(67);
  8253. stream.writeWord(14214);
  8254. if ((int) (Math.random() * 2D) == 0)
  8255. stream.writeWord(29487);
  8256. stream.writeWord((int) (Math.random() * 65536D));
  8257. if ((int) (Math.random() * 2D) == 0)
  8258. stream.writeWordBigEndian(220);
  8259. stream.writeWordBigEndian(180);
  8260. stream.writeBytes(stream.currentOffset - l);
  8261. }
  8262. }
  8263. }
  8264. }
  8265.  
  8266. private String interfaceIntToString(int j) {
  8267. if (j < 0x3b9ac9ff)
  8268. return String.valueOf(j);
  8269. else
  8270. return "*";
  8271. }
  8272.  
  8273. private void showErrorScreen() {
  8274. Graphics g = getGameComponent().getGraphics();
  8275. g.setColor(Color.black);
  8276. g.fillRect(0, 0, 765, 503);
  8277. method4(1);
  8278. if (loadingError) {
  8279. aBoolean831 = false;
  8280. g.setFont(new Font("Helvetica", 1, 16));
  8281. g.setColor(Color.yellow);
  8282. int k = 35;
  8283. g.drawString("Sorry, an error has occured whilst loading " + ClientConstants.CLIENT_NAME, 30, k);
  8284. k += 50;
  8285. g.setColor(Color.white);
  8286. g.drawString("To fix this try the following (in order):", 30, k);
  8287. k += 50;
  8288. g.setColor(Color.white);
  8289. g.setFont(new Font("Helvetica", 1, 12));
  8290. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, k);
  8291. k += 30;
  8292. g.drawString("2: Try clearing your web-browsers cache from tools->internet options", 30, k);
  8293. k += 30;
  8294. g.drawString("3: Try using a different game-world", 30, k);
  8295. k += 30;
  8296. g.drawString("4: Try rebooting your computer", 30, k);
  8297. k += 30;
  8298. g.drawString("5: Try selecting a different version of Java from the play-game menu", 30, k);
  8299. }
  8300. if (genericLoadingError) {
  8301. aBoolean831 = false;
  8302. g.setFont(new Font("Helvetica", 1, 20));
  8303. g.setColor(Color.white);
  8304. g.drawString("Error - unable to load game!", 50, 50);
  8305. g.drawString("To play " + ClientConstants.CLIENT_NAME + " make sure you play from", 50, 100);
  8306. g.drawString("http://www.UrlHere.com", 50, 150);
  8307. }
  8308. if (rsAlreadyLoaded) {
  8309. aBoolean831 = false;
  8310. g.setColor(Color.yellow);
  8311. int l = 35;
  8312. g.drawString("Error a copy of " + ClientConstants.CLIENT_NAME + " already appears to be loaded", 30, l);
  8313. l += 50;
  8314. g.setColor(Color.white);
  8315. g.drawString("To fix this try the following (in order):", 30, l);
  8316. l += 50;
  8317. g.setColor(Color.white);
  8318. g.setFont(new Font("Helvetica", 1, 12));
  8319. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, l);
  8320. l += 30;
  8321. g.drawString("2: Try rebooting your computer, and reloading", 30, l);
  8322. l += 30;
  8323. }
  8324. }
  8325.  
  8326. public URL getCodeBase() {
  8327. try {
  8328. return new URL(server + ":" + (80 + portOff));
  8329. } catch (Exception _ex) {
  8330. }
  8331. return null;
  8332. }
  8333.  
  8334. private void method95() {
  8335. for (int j = 0; j < npcCount; j++) {
  8336. int k = npcIndices[j];
  8337. Npc npc = npcArray[k];
  8338. if (npc != null)
  8339. method96(npc);
  8340. }
  8341. }
  8342.  
  8343. private void method96(Entity entity) {
  8344. if (entity.x < 128 || entity.y < 128 || entity.x >= 13184 || entity.y >= 13184) {
  8345. entity.anim = -1;
  8346. entity.anInt1520 = -1;
  8347. entity.anInt1547 = 0;
  8348. entity.anInt1548 = 0;
  8349. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  8350. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  8351. entity.method446();
  8352. }
  8353. if (entity == myPlayer && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776)) {
  8354. entity.anim = -1;
  8355. entity.anInt1520 = -1;
  8356. entity.anInt1547 = 0;
  8357. entity.anInt1548 = 0;
  8358. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  8359. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  8360. entity.method446();
  8361. }
  8362. if (entity.anInt1547 > loopCycle) {
  8363. method97(entity);
  8364. } else if (entity.anInt1548 >= loopCycle) {
  8365. method98(entity);
  8366. } else {
  8367. method99(entity);
  8368. }
  8369. method100(entity);
  8370. method101(entity);
  8371. }
  8372.  
  8373. private void method97(Entity entity) {
  8374. int i = entity.anInt1547 - loopCycle;
  8375. int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  8376. int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  8377. entity.x += (j - entity.x) / i;
  8378. entity.y += (k - entity.y) / i;
  8379. entity.anInt1503 = 0;
  8380. if (entity.anInt1549 == 0)
  8381. entity.turnDirection = 1024;
  8382. if (entity.anInt1549 == 1)
  8383. entity.turnDirection = 1536;
  8384. if (entity.anInt1549 == 2)
  8385. entity.turnDirection = 0;
  8386. if (entity.anInt1549 == 3)
  8387. entity.turnDirection = 512;
  8388. }
  8389.  
  8390. private void method98(Entity entity) {
  8391. if (entity.anInt1548 == loopCycle || entity.anim == -1 || entity.anInt1529 != 0 || entity.anInt1528 + 1 > Animation.anims[entity.anim].method258(entity.anInt1527)) {
  8392. int i = entity.anInt1548 - entity.anInt1547;
  8393. int j = loopCycle - entity.anInt1547;
  8394. int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  8395. int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  8396. int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
  8397. int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
  8398. entity.x = (k * (i - j) + i1 * j) / i;
  8399. entity.y = (l * (i - j) + j1 * j) / i;
  8400. }
  8401. entity.anInt1503 = 0;
  8402. if (entity.anInt1549 == 0)
  8403. entity.turnDirection = 1024;
  8404. if (entity.anInt1549 == 1)
  8405. entity.turnDirection = 1536;
  8406. if (entity.anInt1549 == 2)
  8407. entity.turnDirection = 0;
  8408. if (entity.anInt1549 == 3)
  8409. entity.turnDirection = 512;
  8410. entity.anInt1552 = entity.turnDirection;
  8411. }
  8412.  
  8413. private void method99(Entity entity) {
  8414. try {
  8415. entity.anInt1517 = entity.anInt1511;
  8416. if (entity.smallXYIndex == 0) {
  8417. entity.anInt1503 = 0;
  8418. return;
  8419. }
  8420. if (entity.anim != -1 && entity.anInt1529 == 0) {
  8421. Animation animation = Animation.anims[entity.anim];
  8422. if (entity.anInt1542 > 0 && animation.anInt363 == 0) {
  8423. entity.anInt1503++;
  8424. return;
  8425. }
  8426. if (entity.anInt1542 <= 0 && animation.anInt364 == 0) {
  8427. entity.anInt1503++;
  8428. return;
  8429. }
  8430. }
  8431. int i = entity.x;
  8432. int j = entity.y;
  8433. int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  8434. int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  8435. if (k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256) {
  8436. entity.x = k;
  8437. entity.y = l;
  8438. return;
  8439. }
  8440. if (i < k) {
  8441. if (j < l)
  8442. entity.turnDirection = 1280;
  8443. else if (j > l)
  8444. entity.turnDirection = 1792;
  8445. else
  8446. entity.turnDirection = 1536;
  8447. } else if (i > k) {
  8448. if (j < l)
  8449. entity.turnDirection = 768;
  8450. else if (j > l)
  8451. entity.turnDirection = 256;
  8452. else
  8453. entity.turnDirection = 512;
  8454. } else if (j < l)
  8455. entity.turnDirection = 1024;
  8456. else
  8457. entity.turnDirection = 0;
  8458. int i1 = entity.turnDirection - entity.anInt1552 & 0x7ff;
  8459. if (i1 > 1024)
  8460. i1 -= 2048;
  8461. int j1 = entity.anInt1555;
  8462. if (i1 >= -256 && i1 <= 256)
  8463. j1 = entity.anInt1554;
  8464. else if (i1 >= 256 && i1 < 768)
  8465. j1 = entity.anInt1557;
  8466. else if (i1 >= -768 && i1 <= -256)
  8467. j1 = entity.anInt1556;
  8468. if (j1 == -1)
  8469. j1 = entity.anInt1554;
  8470. entity.anInt1517 = j1;
  8471. int k1 = 4;
  8472. if (entity.anInt1552 != entity.turnDirection && entity.interactingEntity == -1 && entity.anInt1504 != 0)
  8473. k1 = 2;
  8474. if (entity.smallXYIndex > 2)
  8475. k1 = 6;
  8476. if (entity.smallXYIndex > 3)
  8477. k1 = 8;
  8478. if (entity.anInt1503 > 0 && entity.smallXYIndex > 1) {
  8479. k1 = 8;
  8480. entity.anInt1503--;
  8481. }
  8482. if (entity.aBooleanArray1553[entity.smallXYIndex - 1])
  8483. k1 <<= 1;
  8484. if (k1 >= 8 && entity.anInt1517 == entity.anInt1554 && entity.anInt1505 != -1)
  8485. entity.anInt1517 = entity.anInt1505;
  8486. if (i < k) {
  8487. entity.x += k1;
  8488. if (entity.x > k)
  8489. entity.x = k;
  8490. } else if (i > k) {
  8491. entity.x -= k1;
  8492. if (entity.x < k)
  8493. entity.x = k;
  8494. }
  8495. if (j < l) {
  8496. entity.y += k1;
  8497. if (entity.y > l)
  8498. entity.y = l;
  8499. } else if (j > l) {
  8500. entity.y -= k1;
  8501. if (entity.y < l)
  8502. entity.y = l;
  8503. }
  8504. if (entity.x == k && entity.y == l) {
  8505. entity.smallXYIndex--;
  8506. if (entity.anInt1542 > 0)
  8507. entity.anInt1542--;
  8508. }
  8509. } catch(Exception e) {
  8510.  
  8511. }
  8512. }
  8513.  
  8514. private void method100(Entity entity) {
  8515. if (entity.anInt1504 == 0)
  8516. return;
  8517. if (entity.interactingEntity != -1 && entity.interactingEntity < 32768) {
  8518. Npc npc = npcArray[entity.interactingEntity];
  8519. if (npc != null) {
  8520. int i1 = entity.x - npc.x;
  8521. int k1 = entity.y - npc.y;
  8522. if (i1 != 0 || k1 != 0)
  8523. entity.turnDirection = (int) (Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  8524. }
  8525. }
  8526. if (entity.interactingEntity >= 32768) {
  8527. int j = entity.interactingEntity - 32768;
  8528. if (j == unknownInt10)
  8529. j = myPlayerIndex;
  8530. Player player = playerArray[j];
  8531. if (player != null) {
  8532. int l1 = entity.x - player.x;
  8533. int i2 = entity.y - player.y;
  8534. if (l1 != 0 || i2 != 0)
  8535. entity.turnDirection = (int) (Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  8536. }
  8537. }
  8538. if ((entity.anInt1538 != 0 || entity.anInt1539 != 0) && (entity.smallXYIndex == 0 || entity.anInt1503 > 0)) {
  8539. int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
  8540. int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
  8541. if (k != 0 || j1 != 0)
  8542. entity.turnDirection = (int) (Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  8543. entity.anInt1538 = 0;
  8544. entity.anInt1539 = 0;
  8545. }
  8546. int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
  8547. if (l != 0) {
  8548. if (l < entity.anInt1504 || l > 2048 - entity.anInt1504)
  8549. entity.anInt1552 = entity.turnDirection;
  8550. else if (l > 1024)
  8551. entity.anInt1552 -= entity.anInt1504;
  8552. else
  8553. entity.anInt1552 += entity.anInt1504;
  8554. entity.anInt1552 &= 0x7ff;
  8555. if (entity.anInt1517 == entity.anInt1511 && entity.anInt1552 != entity.turnDirection) {
  8556. if (entity.anInt1512 != -1) {
  8557. entity.anInt1517 = entity.anInt1512;
  8558. return;
  8559. }
  8560. entity.anInt1517 = entity.anInt1554;
  8561. }
  8562. }
  8563. }
  8564.  
  8565. private void method101(Entity entity) {
  8566. try {
  8567. if (entity.anInt1517 > 13798) {
  8568. entity.anInt1517 = -1;
  8569. }
  8570. entity.aBoolean1541 = false;
  8571. if (entity.anInt1517 != -1) {
  8572. Animation animation = Animation.anims[entity.anInt1517];
  8573. entity.anInt1519++;
  8574. if (entity.anInt1518 < animation.anInt352 && entity.anInt1519 > animation.method258(entity.anInt1518)) {
  8575. entity.anInt1519 = 1;
  8576. entity.anInt1518++;
  8577. entity.nextIdleAnimFrame++;
  8578. }
  8579. entity.nextIdleAnimFrame = entity.anInt1518 + 1;
  8580. if (entity.nextIdleAnimFrame >= animation.anInt352) {
  8581. if (entity.nextIdleAnimFrame >= animation.anInt352) {
  8582. entity.nextIdleAnimFrame = 0;
  8583. }
  8584. }
  8585. if (entity.anInt1518 >= animation.anInt352) {
  8586. entity.anInt1519 = 1;
  8587. entity.anInt1518 = 0;
  8588. }
  8589. }
  8590. if (entity.anInt1520 != -1 && loopCycle >= entity.anInt1523) {
  8591. if (entity.anInt1521 < 0)
  8592. entity.anInt1521 = 0;
  8593. Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  8594. for (entity.anInt1522++; entity.anInt1521 < animation_1.anInt352 && entity.anInt1522 > animation_1.method258(entity.anInt1521); entity.anInt1521++)
  8595. entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  8596.  
  8597. if (entity.anInt1521 >= animation_1.anInt352 && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352)) {
  8598. entity.anInt1520 = -1;
  8599. }
  8600. if (Configuration.enableTweening) {
  8601. entity.nextIdleAnimFrame = entity.anInt1518 + 1;
  8602. }
  8603. if (entity.nextSpotAnimFrame >= animation_1.anInt352) {
  8604. entity.nextSpotAnimFrame = -1;
  8605. }
  8606. }
  8607. if (entity.anim != -1 && entity.anInt1529 <= 1) {
  8608. Animation animation_2 = Animation.anims[entity.anim];
  8609. if (animation_2.anInt363 == 1 && entity.anInt1542 > 0 && entity.anInt1547 <= loopCycle && entity.anInt1548 < loopCycle) {
  8610. entity.anInt1529 = 1;
  8611. return;
  8612. }
  8613. }
  8614. if (entity.anim != -1 && entity.anInt1529 == 0) {
  8615. Animation animation_3 = Animation.anims[entity.anim];
  8616. for (entity.anInt1528++; entity.anInt1527 < animation_3.anInt352 && entity.anInt1528 > animation_3.method258(entity.anInt1527); entity.anInt1527++)
  8617. entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  8618.  
  8619. if (entity.anInt1527 >= animation_3.anInt352) {
  8620. entity.anInt1527 -= animation_3.anInt356;
  8621. entity.anInt1530++;
  8622. if (entity.anInt1530 >= animation_3.anInt362)
  8623. entity.anim = -1;
  8624. if (entity.anInt1527 < 0 || entity.anInt1527 >= animation_3.anInt352)
  8625. entity.anim = -1;
  8626. }
  8627. if (Configuration.enableTweening) {
  8628. entity.nextAnimFrame = entity.anInt1527 + 1;
  8629. }
  8630. if (entity.nextAnimFrame >= animation_3.anInt352) {
  8631. entity.nextAnimFrame = -1;
  8632. }
  8633. entity.aBoolean1541 = animation_3.aBoolean358;
  8634. }
  8635. if (entity.anInt1529 > 0)
  8636. entity.anInt1529--;
  8637. } catch (Exception e) {
  8638.  
  8639. }
  8640. }
  8641.  
  8642. private void drawGameScreen() {
  8643. if (fullscreenInterfaceID != -1 && (loadingStage == 2 || super.fullGameScreen != null)) {
  8644. if (loadingStage == 2) {
  8645. method119(anInt945, fullscreenInterfaceID);
  8646. if (openInterfaceID != -1) {
  8647. method119(anInt945, openInterfaceID);
  8648. }
  8649. anInt945 = 0;
  8650. resetAllImageProducers();
  8651. super.fullGameScreen.initDrawingArea();
  8652. Rasterizer.anIntArray1472 = fullScreenTextureArray;
  8653. DrawingArea.setAllPixelsToZero();
  8654. welcomeScreenRaised = true;
  8655. if (openInterfaceID != -1) {
  8656. RSInterface rsInterface_1 = RSInterface.interfaceCache[openInterfaceID];
  8657. if (rsInterface_1.width == 512 && rsInterface_1.height == 334 && rsInterface_1.type == 0) {
  8658. rsInterface_1.width = 765;
  8659. rsInterface_1.height = 503;
  8660. }
  8661. drawInterface(0, 0, rsInterface_1, 8);
  8662. }
  8663. RSInterface rsInterface = RSInterface.interfaceCache[fullscreenInterfaceID];
  8664. if (rsInterface.width == 512 && rsInterface.height == 334 && rsInterface.type == 0) {
  8665. rsInterface.width = 765;
  8666. rsInterface.height = 503;
  8667. }
  8668. drawInterface(0, 0, rsInterface, 8);
  8669. if (!menuOpen) {
  8670. processRightClick();
  8671. drawTooltip();
  8672. } else {
  8673. drawMenu(frameMode == ScreenMode.FIXED ? 4 : 0, frameMode == ScreenMode.FIXED ? 4 : 0);
  8674. }
  8675. }
  8676. drawCount++;
  8677. super.fullGameScreen.drawGraphics(0, super.graphics, 0);
  8678. return;
  8679. } else {
  8680. if (drawCount != 0) {
  8681. resetImageProducers2();
  8682. }
  8683. }
  8684. if (welcomeScreenRaised) {
  8685. welcomeScreenRaised = false;
  8686. if (frameMode == ScreenMode.FIXED) {
  8687. topFrame.drawGraphics(0, super.graphics, 0);
  8688. leftFrame.drawGraphics(4, super.graphics, 0);
  8689. }
  8690. inputTaken = true;
  8691. tabAreaAltered = true;
  8692. if (loadingStage != 2) {
  8693. if (frameMode == ScreenMode.FIXED) {
  8694. aRSImageProducer_1165.drawGraphics(frameMode == ScreenMode.FIXED ? 4 : 0, super.graphics, frameMode == ScreenMode.FIXED ? 4 : 0);
  8695. aRSImageProducer_1164.drawGraphics(0, super.graphics, 516);
  8696. }
  8697. }
  8698. }
  8699. if (invOverlayInterfaceID != -1) {
  8700. method119(anInt945, invOverlayInterfaceID);
  8701. }
  8702. drawTabArea();
  8703. if (backDialogID == -1) {
  8704. aClass9_1059.scrollPosition = anInt1211 - anInt1089 - 110;
  8705. if (super.mouseX >= 496 && super.mouseX <= 511 && super.mouseY > (frameMode == ScreenMode.FIXED ? 345 : frameHeight - 158))
  8706. method65(494, 110, super.mouseX, super.mouseY - (frameMode == ScreenMode.FIXED ? 345 : frameHeight - 158), aClass9_1059, 0, false, anInt1211);
  8707. int i = anInt1211 - 110 - aClass9_1059.scrollPosition;
  8708. if (i < 0) {
  8709. i = 0;
  8710. }
  8711. if (i > anInt1211 - 110) {
  8712. i = anInt1211 - 110;
  8713. }
  8714. if (anInt1089 != i) {
  8715. anInt1089 = i;
  8716. inputTaken = true;
  8717. }
  8718. }
  8719. if (backDialogID != -1) {
  8720. boolean flag2 = method119(anInt945, backDialogID);
  8721. if (flag2)
  8722. inputTaken = true;
  8723. }
  8724. if (atInventoryInterfaceType == 3)
  8725. inputTaken = true;
  8726. if (activeInterfaceType == 3)
  8727. inputTaken = true;
  8728. if (aString844 != null)
  8729. inputTaken = true;
  8730. if (menuOpen && menuScreenArea == 2)
  8731. inputTaken = true;
  8732. extendChatArea();
  8733. if (inputTaken) {
  8734. drawChatArea();
  8735. inputTaken = false;
  8736. }
  8737. if (loadingStage == 2)
  8738. method146();
  8739. if (loadingStage == 2) {
  8740. if (frameMode == ScreenMode.FIXED) {
  8741. drawMinimap();
  8742. aRSImageProducer_1164.drawGraphics(0, super.graphics, 516);
  8743. }
  8744. }
  8745. if (anInt1054 != -1)
  8746. tabAreaAltered = true;
  8747. if (tabAreaAltered) {
  8748. if (anInt1054 != -1 && anInt1054 == tabID) {
  8749. anInt1054 = -1;
  8750. stream.createFrame(120);
  8751. stream.writeWordBigEndian(tabID);
  8752. }
  8753. tabAreaAltered = false;
  8754. aRSImageProducer_1125.initDrawingArea();
  8755. aRSImageProducer_1165.initDrawingArea();
  8756. }
  8757. anInt945 = 0;
  8758. }
  8759.  
  8760. private boolean buildFriendsListMenu(RSInterface class9) {
  8761. int i = class9.contentType;
  8762. if (i >= 1 && i <= 200 || i >= 701 && i <= 900) {
  8763. if (i >= 801)
  8764. i -= 701;
  8765. else if (i >= 701)
  8766. i -= 601;
  8767. else if (i >= 101)
  8768. i -= 101;
  8769. else
  8770. i--;
  8771. menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
  8772. menuActionID[menuActionRow] = 792;
  8773. menuActionRow++;
  8774. menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
  8775. menuActionID[menuActionRow] = 639;
  8776. menuActionRow++;
  8777. return true;
  8778. }
  8779. if (i >= 401 && i <= 500) {
  8780. menuActionName[menuActionRow] = "Remove @whi@" + class9.disabledMessage;
  8781. menuActionID[menuActionRow] = 322;
  8782. menuActionRow++;
  8783. return true;
  8784. } else {
  8785. return false;
  8786. }
  8787. }
  8788.  
  8789. private void method104() {
  8790. Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3) aClass19_1056.reverseGetFirst();
  8791. for (; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3) aClass19_1056.reverseGetNext())
  8792. if (class30_sub2_sub4_sub3.anInt1560 != plane || class30_sub2_sub4_sub3.aBoolean1567)
  8793. class30_sub2_sub4_sub3.unlink();
  8794. else if (loopCycle >= class30_sub2_sub4_sub3.anInt1564) {
  8795. class30_sub2_sub4_sub3.method454(anInt945);
  8796. if (class30_sub2_sub4_sub3.aBoolean1567)
  8797. class30_sub2_sub4_sub3.unlink();
  8798. else
  8799. 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);
  8800. }
  8801.  
  8802. }
  8803.  
  8804. public void drawBlackBox(int xPos, int yPos) {
  8805. DrawingArea.drawPixels(71, yPos - 1, xPos - 2, 0x726451, 1);
  8806. DrawingArea.drawPixels(69, yPos, xPos + 174, 0x726451, 1);
  8807. DrawingArea.drawPixels(1, yPos - 2, xPos - 2, 0x726451, 178);
  8808. DrawingArea.drawPixels(1, yPos + 68, xPos, 0x726451, 174);
  8809. DrawingArea.drawPixels(71, yPos - 1, xPos - 1, 0x2E2B23, 1);
  8810. DrawingArea.drawPixels(71, yPos - 1, xPos + 175, 0x2E2B23, 1);
  8811. DrawingArea.drawPixels(1, yPos - 1, xPos, 0x2E2B23, 175);
  8812. DrawingArea.drawPixels(1, yPos + 69, xPos, 0x2E2B23, 175);
  8813. DrawingArea.method335(0, yPos, 174, 68, 220, xPos);
  8814. }
  8815.  
  8816. public void refreshScreenOptions() {
  8817. int childIds[] = { 36004, 36007, 36010 };
  8818. int enabledIds[] = { 1, 3, 5 };
  8819. int disabledIds[] = { 0, 2, 4 };
  8820. ScreenMode modes[] = { ScreenMode.FIXED, ScreenMode.RESIZABLE, ScreenMode.FULLSCREEN };
  8821. for (int index = 0; index < modes.length; index++) {
  8822. RSInterface.interfaceCache[childIds[index]].setSprite(Client.cacheSprite[frameMode == modes[index] ? enabledIds[index] : disabledIds[index]]);
  8823. }
  8824. }
  8825.  
  8826. @SuppressWarnings("unused")
  8827. private void drawInterface(int j, int k, RSInterface class9, int l) {
  8828. refreshScreenOptions();
  8829. if (class9.parentID == 197 && frameMode != ScreenMode.FIXED) {
  8830. k = frameWidth - 120;
  8831. l = 170;
  8832. }
  8833. if (class9.type != 0 || class9.children == null) {
  8834. return;
  8835. }
  8836. if (class9.isMouseoverTriggered && anInt1026 != class9.id && anInt1048 != class9.id && anInt1039 != class9.id)
  8837. return;
  8838. int i1 = DrawingArea.topX;
  8839. int j1 = DrawingArea.topY;
  8840. int k1 = DrawingArea.bottomX;
  8841. int l1 = DrawingArea.bottomY;
  8842. DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  8843. int i2 = class9.children.length;
  8844. int alpha = class9.transparency;
  8845. for (int j2 = 0; j2 < i2; j2++) {
  8846. int k2 = class9.childX[j2] + k;
  8847. int l2 = (class9.childY[j2] + l) - j;
  8848. RSInterface child = RSInterface.interfaceCache[class9.children[j2]];
  8849. k2 += child.anInt263;
  8850. l2 += child.anInt265;
  8851. if (child.contentType > 0)
  8852. drawFriendsListOrWelcomeScreen(child);
  8853. // here
  8854. 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,
  8855. /* Ancients */
  8856. 12940, 12988, 13036, 12902, 12862, 13046, 12964, 13012, 13054, 12920, 12882, 13062, 12952, 13000, 13070, 12912, 12872, 13080, 12976, 13024, 13088, 12930, 12892, 13096 };
  8857. for (int m5 = 0; m5 < IDs.length; m5++) {
  8858. if (child.id == IDs[m5] + 1) {
  8859. if (m5 > 61)
  8860. drawBlackBox(k2 + 1, l2);
  8861. else
  8862. drawBlackBox(k2, l2 + 1);
  8863. }
  8864. }
  8865. 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,
  8866. 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 };
  8867. for (int r = 0; r < runeChildren.length; r++)
  8868. if (child.id == runeChildren[r])
  8869. child.modelZoom = 775;
  8870. if (child.type == 0) {
  8871. if (child.scrollPosition > child.scrollMax - child.height)
  8872. child.scrollPosition = child.scrollMax - child.height;
  8873. if (child.scrollPosition < 0)
  8874. child.scrollPosition = 0;
  8875. drawInterface(child.scrollPosition, k2, child, l2);
  8876. if (child.id == 18143) {
  8877. int clanMates = 0;
  8878. for (int i = 18155; i < 18244; i++) {
  8879. RSInterface line = RSInterface.interfaceCache[i];
  8880. if (line.disabledMessage.length() > 0) {
  8881. clanMates++;
  8882. }
  8883. }
  8884. child.scrollMax = (clanMates * 14) + child.height + 1;
  8885. }
  8886. if (child.scrollMax > child.height)
  8887. drawScrollbar(child.height, child.scrollPosition, l2, k2 + child.width, child.scrollMax, false);
  8888. } else if (child.type != 1)
  8889. if (child.type == 2) {
  8890. int slot = 0;
  8891. int tabAm = 0;
  8892. int tabSlot = -1;
  8893. int hh = 2;
  8894. if (child.contentType == 206) {
  8895. int tabHeight = 0;
  8896. for (int i = 0; i < tabAmounts.length; i++) {
  8897. if (tabSlot + 1 < tabAmounts.length && tabAmounts[tabSlot + 1] > 0) {
  8898. tabAm += tabAmounts[++tabSlot];
  8899. tabHeight += (tabAmounts[tabSlot] >> 3) + (tabAmounts[tabSlot] % 8 == 0 ? 0 : 1);
  8900. if (tabSlot + 1 < tabAmounts.length && tabAmounts[tabSlot + 1] > 0 && variousSettings[1000] == 0 && variousSettings[1012] == 0) {
  8901. DrawingArea.method339((l2 + tabHeight * (32 + child.invSpritePadY) + hh) - 1, 0x3E3529, ((32 + child.invSpritePadX) << 3) - 10, k2);
  8902. DrawingArea.method339((l2 + tabHeight * (32 + child.invSpritePadY) + hh), 0x3E3529, ((32 + child.invSpritePadX) << 3) - 10, k2);
  8903. }
  8904. hh += 8;
  8905. }
  8906.  
  8907. if (i > 0) {
  8908. int itemSlot = tabAm - tabAmounts[i];
  8909. int xOffset = (frameWidth - 237 - RSInterface.interfaceCache[5292].width) / 2;
  8910. int yOffset = 36 + ((frameHeight - 503) / 2);
  8911. int x = xOffset + 77;
  8912. int y = yOffset + 25;
  8913. try {
  8914. int item = RSInterface.interfaceCache[5382].inv[itemSlot];
  8915. if (tabAmounts[i] > 0 && item > 0) {
  8916. Sprite icon = null;
  8917. if (variousSettings[1011] == 0) {
  8918. icon = ItemDef.getSprite(item - 1, child.invStackSizes[itemSlot], 0);
  8919. }
  8920. if (variousSettings[1011] == 1) {
  8921. icon = cacheSprite[118 + i];
  8922. }
  8923. if (variousSettings[1011] == 2) {
  8924. icon = cacheSprite[127 + i];
  8925. }
  8926. if (icon != null) {
  8927. icon.drawSprite1((frameMode == ScreenMode.FIXED ? 60 : x + 4) + 40 * i, (frameMode == ScreenMode.FIXED ? 41 : y + 2), 255, true);
  8928. }
  8929. RSInterface.interfaceCache[50013 + i * 4].anInt265 = 0;
  8930. RSInterface.interfaceCache[50014 + i * 4].anInt265 = 0;
  8931. RSInterface.interfaceCache[50014 + i * 4].tooltip = "View tab @or2@" + i;
  8932. RSInterface.interfaceCache[50014 + i * 4].disabledSprite = cacheSprite[109];
  8933. } else if (tabAmounts[i - 1] <= 0) {
  8934. RSInterface.interfaceCache[50013 + i * 4].anInt265 = -500;
  8935. if (i > 1) {
  8936. RSInterface.interfaceCache[50014 + i * 4].anInt265 = -500;
  8937. } else {
  8938. cacheSprite[114].drawSprite1((frameMode == ScreenMode.FIXED ? 59 : x) + 40 * i, (frameMode == ScreenMode.FIXED ? 41 : y), 255, true);
  8939. }
  8940. RSInterface.interfaceCache[50014 + i * 4].tooltip = "New tab";
  8941. } else {
  8942. RSInterface.interfaceCache[50013 + i * 4].anInt265 = -500;
  8943. RSInterface.interfaceCache[50014 + i * 4].anInt265 = 0;
  8944. RSInterface.interfaceCache[50014 + i * 4].tooltip = "New tab";
  8945. RSInterface.interfaceCache[50014 + i * 4].disabledSprite = cacheSprite[112];
  8946. cacheSprite[114].drawSprite1((frameMode == ScreenMode.FIXED ? 59 : x) + 40 * i, (frameMode == ScreenMode.FIXED ? 41 : y), 255, true);
  8947. }
  8948. } catch (Exception e) {
  8949. System.out.println("Bank tab icon error: tab [" + i + "], amount [" + tabAm + "], tabAmount [" + tabAmounts[i] + "], itemSlot [" + itemSlot + "]");
  8950. }
  8951. }
  8952. }
  8953. DrawingArea.bottomY += 3;
  8954. }
  8955.  
  8956. tabAm = tabAmounts[0];
  8957. tabSlot = 0;
  8958. hh = 0;
  8959.  
  8960. int dragX = 0, dragY = 0;
  8961. Sprite draggedItem = null;
  8962.  
  8963. int newSlot = 0;
  8964. if (child.contentType == 206 && variousSettings[1000] != 0 && variousSettings[1012] == 0) {
  8965. for (int i = 0; i < tabAmounts.length; i++) {
  8966. if (i == variousSettings[1000]) {
  8967. break;
  8968. }
  8969. newSlot += tabAmounts[i];
  8970. }
  8971. slot = newSlot;
  8972. }
  8973.  
  8974. heightLoop: for (int height = 0; height < child.height; height++) {
  8975. for (int width = 0; width < child.width; width++) {
  8976. int w = k2 + width * (32 + child.invSpritePadX);
  8977. int h = l2 + height * (32 + child.invSpritePadY) + hh;
  8978. if (child.contentType == 206 && variousSettings[1012] == 0) {
  8979. if (variousSettings[1000] == 0) {
  8980. if (slot == tabAm) {
  8981. if (tabSlot + 1 < tabAmounts.length) {
  8982. tabAm += tabAmounts[++tabSlot];
  8983. if (tabSlot > 0 && tabAmounts[tabSlot - 1] % 8 == 0) {
  8984. height--;
  8985. }
  8986. hh += 8;
  8987. }
  8988. break;
  8989. }
  8990. } else if (variousSettings[1000] <= 9) {
  8991. if (slot >= tabAmounts[variousSettings[1000]] + newSlot) {
  8992. break heightLoop;
  8993. }
  8994. }
  8995. }
  8996. if (slot < 20) {
  8997. w += child.spritesX[slot];
  8998. h += child.spritesY[slot];
  8999. }
  9000. int itemId = child.inv[slot] - 1;
  9001. if (variousSettings[1012] == 1 && child.contentType == 206) {
  9002. itemId = bankInvTemp[slot] - 1;
  9003. }
  9004. if (itemId + 1 > 0) {
  9005. if (child.id == 3900) {
  9006. if (stock == null) {
  9007. stock = cacheSprite[76];
  9008. }
  9009. stock.drawSprite(w - 7, h - 4);
  9010. }
  9011. int x = 0;
  9012. int y = 0;
  9013. if (w > DrawingArea.topX - 32 && w < DrawingArea.bottomX && h > DrawingArea.topY - 32 && h < DrawingArea.bottomY || activeInterfaceType != 0 && dragFromSlot == slot) {
  9014. int color = 0;
  9015. if (itemSelected == 1 && anInt1283 == slot && anInt1284 == child.id) {
  9016. color = 0xffffff;
  9017. }
  9018. Sprite itemSprite = ItemDef.getSprite(itemId, variousSettings[1012] == 1 && child.contentType == 206 ? bankStackTemp[slot] : child.invStackSizes[slot], color);
  9019.  
  9020. if (itemSprite != null) {
  9021. if (activeInterfaceType != 0 && dragFromSlot == slot && focusedDragWidget == child.id) {
  9022. draggedItem = itemSprite;
  9023. x = super.mouseX - pressX;
  9024. y = super.mouseY - pressY;
  9025. if (x < 5 && x > -5)
  9026. x = 0;
  9027. if (y < 5 && y > -5)
  9028. y = 0;
  9029. if (dragCycle < 10) {
  9030. x = 0;
  9031. y = 0;
  9032. }
  9033. dragX = w + x;
  9034. dragY = h + y;
  9035. if (h + y < DrawingArea.topY && class9.scrollPosition > 0) {
  9036. int i10 = (anInt945 * (DrawingArea.topY - h - y)) / 3;
  9037. if (i10 > anInt945 * 10)
  9038. i10 = anInt945 * 10;
  9039. if (i10 > class9.scrollPosition)
  9040. i10 = class9.scrollPosition;
  9041. class9.scrollPosition -= i10;
  9042. pressY += i10;
  9043. }
  9044.  
  9045. if (h + y + 32 > DrawingArea.bottomY && class9.scrollPosition < class9.scrollMax - class9.height) {
  9046. int j10 = (anInt945 * ((h + y + 32) - DrawingArea.bottomY)) / 3;
  9047. if (j10 > anInt945 * 10)
  9048. j10 = anInt945 * 10;
  9049. if (j10 > class9.scrollMax - class9.height - class9.scrollPosition)
  9050. j10 = class9.scrollMax - class9.height - class9.scrollPosition;
  9051. class9.scrollPosition += j10;
  9052. pressY -= j10;
  9053. }
  9054. } else if (atInventoryInterfaceType != 0 && atInventoryIndex == slot && atInventoryInterface == child.id) {
  9055. itemSprite.drawSprite1(w, h);
  9056. } else {
  9057. itemSprite.drawSprite(w, h);
  9058. }
  9059. if (child.parentID != 42752) {
  9060. if (itemSprite.cropWidth == 33 || child.invStackSizes[slot] != 1) {
  9061. int amount = child.invStackSizes[slot];
  9062.  
  9063. if (amount == 0) {
  9064. smallText.method385(0, "EMPTY", h + 45 + y, w + 3 + x);
  9065. smallText.method385(0xFFFFFF, "EMPTY", h + 44 + y, w + 2 + x);
  9066. } else if (amount >= 1000000000) {
  9067. smallText.method385(0, intToKOrMil(amount), h + 10 + y, w + x + 1);
  9068. smallText.method385(0x00FF80, intToKOrMil(amount), h + 9 + y, w + x);
  9069. } else if (amount >= 10000000) {
  9070. smallText.method385(0, intToKOrMil(amount), h + 10 + y, w + x + 1);
  9071. smallText.method385(0x00FF80, intToKOrMil(amount), h + 9 + y, w + x);
  9072. } else if (amount >= 100000) {
  9073. smallText.method385(0, intToKOrMil(amount), h + 10 + y, w + x + 1);
  9074. smallText.method385(0xFFFFFF, intToKOrMil(amount), h + 9 + y, w + x);
  9075. } else if (amount >= 1) {
  9076. smallText.method385(0, intToKOrMil(amount), h + 10 + y, w + x + 1);
  9077. smallText.method385(0xFFFF00, intToKOrMil(amount), h + 9 + y, w + x);
  9078. } else {
  9079. smallText.method385(0, intToKOrMil(amount), h + 10 + y, w + 1 + x);
  9080. smallText.method385(0xFFFF00, intToKOrMil(amount), h + 9 + y, w + x);
  9081. }
  9082. }
  9083. }
  9084. }
  9085. }
  9086. } else if (child.sprites != null && slot < 20) {
  9087. Sprite childSprite = child.sprites[slot];
  9088. if (childSprite != null)
  9089. childSprite.drawSprite(w, h);
  9090. }
  9091. slot++;
  9092. }
  9093. }
  9094. if (draggedItem != null) {
  9095. draggedItem.drawSprite1(dragX, dragY, 200 + (int) (50 * Math.sin(loopCycle / 10.0)), child.contentType == 206);
  9096. }
  9097. } else if (child.type == 3) {
  9098. boolean flag = false;
  9099. if (anInt1039 == child.id || anInt1048 == child.id || anInt1026 == child.id)
  9100. flag = true;
  9101. int color;
  9102. if (interfaceIsSelected(child)) {
  9103. color = child.anInt219;
  9104. if (flag && child.anInt239 != 0)
  9105. color = child.anInt239;
  9106. } else {
  9107. color = child.textColor;
  9108. if (flag && child.textHoverColor != 0)
  9109. color = child.textHoverColor;
  9110. }
  9111. if (child.opacity == 0) {
  9112. if (child.aBoolean227)
  9113. DrawingArea.drawPixels(child.height, l2, k2, color, child.width);
  9114. else
  9115. DrawingArea.fillPixels(k2, child.width, child.height, color, l2);
  9116. } else if (child.aBoolean227)
  9117. DrawingArea.method335(color, l2, child.width, child.height, 256 - (child.opacity & 0xff), k2);
  9118. else
  9119. DrawingArea.method338(l2, child.height, 256 - (child.opacity & 0xff), color, child.width, k2);
  9120. } else if (child.type == 4) {
  9121. TextDrawingArea textDrawingArea = child.textDrawingAreas;
  9122. String message = child.disabledMessage;
  9123. boolean hovered = false;
  9124. if (anInt1039 == child.id || anInt1048 == child.id || anInt1026 == child.id)
  9125. hovered = true;
  9126. int color;
  9127. if (interfaceIsSelected(child)) {
  9128. color = child.anInt219;
  9129. if (hovered && child.anInt239 != 0)
  9130. color = child.anInt239;
  9131. if (child.enabledMessage.length() > 0)
  9132. message = child.enabledMessage;
  9133. } else {
  9134. color = child.textColor;
  9135. if (hovered && child.textHoverColor != 0)
  9136. color = child.textHoverColor;
  9137. }
  9138. if (child.atActionType == 6 && aBoolean1149) {
  9139. message = "Please wait...";
  9140. color = child.textColor;
  9141. }
  9142. if (child.id >= 28000 && child.id < 28036) {
  9143. if (RSInterface.interfaceCache[3900].invStackSizes[child.id - 28000] > 0) {
  9144. String[] data = message.split(",");
  9145. int currency = 0;
  9146. if (data.length > 1) {
  9147. currency = Integer.parseInt(data[1]);
  9148. }
  9149. if (currencyImage[currency] == null) {
  9150. currencyImage[currency] = cacheSprite[407 + currency];
  9151. }
  9152. currencyImage[currency].drawSprite(k2 - 5, l2);
  9153. int value = Integer.parseInt(data[0]);
  9154. if (value >= 10_000_000) {
  9155. smallText.drawRightAlignedString((value / 1_000_000) + "M", k2 + 36, l2 + 1 + DrawingArea.height, 0);
  9156. smallText.drawRightAlignedString((value / 1_000_000) + "M", k2 + 35, l2 + DrawingArea.height, 0x00ff80);
  9157. } else if (value >= 1_000_000) {
  9158. smallText.drawRightAlignedString(String.valueOf(String.format("%.1f", (value / 1_000_000.0))).replace(".0", "") + "M", k2 + 36, l2 + 1 + DrawingArea.height, 0);
  9159. smallText.drawRightAlignedString(String.valueOf(String.format("%.1f", (value / 1_000_000.0))).replace(".0", "") + "M", k2 + 35, l2 + DrawingArea.height, 0xFFFFFF);
  9160. } else if (value >= 100_000) {
  9161. smallText.drawRightAlignedString((value / 1_000) + "K", k2 + 36, l2 + 1 + DrawingArea.height, 0);
  9162. smallText.drawRightAlignedString((value / 1_000) + "K", k2 + 35, l2 + DrawingArea.height, 0xFFFFFF);
  9163. } else if (value >= 10_000) {
  9164. smallText.drawRightAlignedString((value / 1_000) + "K", k2 + 36, l2 + 1 + DrawingArea.height, 0);
  9165. smallText.drawRightAlignedString((value / 1_000) + "K", k2 + 35, l2 + DrawingArea.height, 0xffff00);
  9166. } else if (value <= 0) {
  9167. smallText.drawRightAlignedString("FREE", k2 + 34, l2 + 1 + DrawingArea.height, 0);
  9168. smallText.drawRightAlignedString("FREE", k2 + 33, l2 + DrawingArea.height, 0xffff00);
  9169. } else {
  9170. smallText.drawRightAlignedString(value + "", k2 + 36, l2 + 1 + DrawingArea.height, 0);
  9171. smallText.drawRightAlignedString(value + "", k2 + 35, l2 + DrawingArea.height, 0xFFFF00);
  9172. }
  9173. }
  9174. continue;
  9175. }
  9176. if ((backDialogID != -1 || dialogID != -1 || child.disabledMessage.contains("Click here to continue")) && (class9.id == backDialogID || class9.id == dialogID)) {
  9177. if (color == 0xffff00) {
  9178. color = 255;
  9179. }
  9180. if (color == 49152) {
  9181. color = 0xffffff;
  9182. }
  9183. }
  9184. if((child.parentID == 1151) || (child.parentID == 12855)) {
  9185. switch (color) {
  9186. case 16773120:
  9187. color = 0xFE981F;
  9188. break;
  9189. case 7040819:
  9190. color = 0xAF6A1A;
  9191. break;
  9192. }
  9193. }
  9194. for (int l6 = l2 + textDrawingArea.anInt1497; message.length() > 0; l6 += textDrawingArea.anInt1497) {
  9195. if (message.indexOf("%") != -1) {
  9196. do {
  9197. int k7 = message.indexOf("%1");
  9198. if (k7 == -1)
  9199. break;
  9200. if (child.id < 4000 || child.id > 5000 && child.id != 13921 && child.id != 13922 && child.id != 12171 && child.id != 12172)
  9201. message = message.substring(0, k7) + methodR(extractInterfaceValues(child, 0)) + message.substring(k7 + 2);
  9202. else
  9203. message = message.substring(0, k7) + interfaceIntToString(extractInterfaceValues(child, 0)) + message.substring(k7 + 2);
  9204. } while (true);
  9205. do {
  9206. int l7 = message.indexOf("%2");
  9207. if (l7 == -1)
  9208. break;
  9209. message = message.substring(0, l7) + interfaceIntToString(extractInterfaceValues(child, 1)) + message.substring(l7 + 2);
  9210. } while (true);
  9211. do {
  9212. int i8 = message.indexOf("%3");
  9213. if (i8 == -1)
  9214. break;
  9215. message = message.substring(0, i8) + interfaceIntToString(extractInterfaceValues(child, 2)) + message.substring(i8 + 2);
  9216. } while (true);
  9217. do {
  9218. int j8 = message.indexOf("%4");
  9219. if (j8 == -1)
  9220. break;
  9221. message = message.substring(0, j8) + interfaceIntToString(extractInterfaceValues(child, 3)) + message.substring(j8 + 2);
  9222. } while (true);
  9223. do {
  9224. int k8 = message.indexOf("%5");
  9225. if (k8 == -1)
  9226. break;
  9227. message = message.substring(0, k8) + interfaceIntToString(extractInterfaceValues(child, 4)) + message.substring(k8 + 2);
  9228. } while (true);
  9229. }
  9230. int l8 = message.indexOf("\\n");
  9231. String s1;
  9232. if (l8 != -1) {
  9233. s1 = message.substring(0, l8);
  9234. message = message.substring(l8 + 2);
  9235. } else {
  9236. s1 = message;
  9237. message = "";
  9238. }
  9239. RSFont font;
  9240. if (textDrawingArea == smallText) {
  9241. font = newSmallFont;
  9242. } else if (textDrawingArea == regularText) {
  9243. font = newRegularFont;
  9244. } else if (textDrawingArea == boldText) {
  9245. font = newBoldFont;
  9246. } else {
  9247. font = newFancyFont;
  9248. }
  9249.  
  9250. if (child.centerText) {
  9251. font.drawCenteredString(s1, k2 + child.width / 2, l6, color, child.textShadow ? 0 : -1);
  9252. } else {
  9253. font.drawBasicString(s1, k2, l6, color, child.textShadow ? 0 : -1);
  9254. }
  9255. }
  9256. } else if (child.type == 5) {
  9257. Sprite sprite;
  9258. if (interfaceIsSelected(child))
  9259. sprite = child.enabledSprite;
  9260. else
  9261. sprite = child.disabledSprite;
  9262. if (spellSelected == 1 && child.id == spellID && spellID != 0 && sprite != null) {
  9263. sprite.drawSprite(k2, l2, 0xffffff);
  9264. if (child.drawsTransparent) {
  9265. sprite.drawTransparentSprite(k2, l2, 170);
  9266. } else {
  9267. sprite.drawSprite(k2, l2);
  9268. }
  9269. } else {
  9270. if (sprite != null)
  9271. if (child.drawsTransparent) {
  9272. sprite.drawTransparentSprite(k2, l2, 170);
  9273. } else {
  9274. // System.out.println("Hi");
  9275. sprite.drawSprite(k2, l2);
  9276. }
  9277. }
  9278. } else if (child.type == 6) {
  9279. int k3 = Rasterizer.centerX;
  9280. int j4 = Rasterizer.centerY;
  9281. Rasterizer.centerX = k2 + child.width / 2;
  9282. Rasterizer.centerY = l2 + child.height / 2;
  9283. int i5 = Rasterizer.anIntArray1470[child.modelRotation1] * child.modelZoom >> 16;
  9284. int l5 = Rasterizer.anIntArray1471[child.modelRotation1] * child.modelZoom >> 16;
  9285. boolean flag2 = interfaceIsSelected(child);
  9286. int i7;
  9287. if (flag2)
  9288. i7 = child.anInt258;
  9289. else
  9290. i7 = child.anInt257;
  9291. Model model;
  9292. if (i7 == -1) {
  9293. model = child.method209(-1, -1, flag2);
  9294. } else {
  9295. Animation animation = Animation.anims[i7];
  9296. model = child.method209(animation.anIntArray354[child.anInt246], animation.anIntArray353[child.anInt246], flag2);
  9297. }
  9298. if (model != null)
  9299. model.method482(child.modelRotation2, 0, child.modelRotation1, 0, i5, l5);
  9300. Rasterizer.centerX = k3;
  9301. Rasterizer.centerY = j4;
  9302. } else if (child.type == 7) {
  9303. TextDrawingArea textDrawingArea_1 = child.textDrawingAreas;
  9304. int k4 = 0;
  9305. for (int j5 = 0; j5 < child.height; j5++) {
  9306. for (int i6 = 0; i6 < child.width; i6++) {
  9307. if (child.inv[k4] > 0) {
  9308. ItemDef itemDef = ItemDef.forID(child.inv[k4] - 1);
  9309. String s2 = itemDef.name;
  9310. if (itemDef.stackable || child.invStackSizes[k4] != 1)
  9311. s2 = s2 + " x" + intToKOrMilLongName(child.invStackSizes[k4]);
  9312. int i9 = k2 + i6 * (115 + child.invSpritePadX);
  9313. int k9 = l2 + j5 * (12 + child.invSpritePadY);
  9314. if (child.centerText)
  9315. textDrawingArea_1.method382(child.textColor, i9 + child.width / 2, s2, k9, child.textShadow);
  9316. else
  9317. textDrawingArea_1.method389(child.textShadow, i9, child.textColor, s2, k9);
  9318. }
  9319. k4++;
  9320. }
  9321. }
  9322. } else if (child.type == 9) {
  9323. drawTooltip(k2, l2, child.popupString);
  9324. } else if (child.type == 8 && (anInt1500 == child.id || anInt1044 == child.id || anInt1129 == child.id) && anInt1501 == 0 && !menuOpen) {
  9325. int boxWidth = 0;
  9326. int boxHeight = 0;
  9327. String finalMessage = child.disabledMessage;
  9328. TextDrawingArea textDrawingArea_2 = regularText;
  9329.  
  9330. if (child.parentID == 3917 && extractInterfaceValues(child, 1) >= 99) {
  9331. String[] msg = finalMessage.split("\\\\n");
  9332. finalMessage = msg[0].concat("\\n").concat(msg[1]);
  9333. }
  9334.  
  9335. int skillId = child.parentID == 3917 ? finalMessage.split(":")[0].equals("Total level") ? 25 : Skills.getIdByName(finalMessage.split(":")[0]) : 0;
  9336.  
  9337. boolean showGoal = child.parentID == 3917 ? statsSkillGoal[skillId][0] > 0 : false;
  9338.  
  9339. int currentStats = 0;
  9340.  
  9341. if (showGoal) {
  9342. int remainder = 0;
  9343. if (skillId == 25) {
  9344. int exp = 0;
  9345. for (int i = 0; i < Skills.SKILLS_COUNT; i++)
  9346. if (Skills.SKILL_ENABLED[i])
  9347. exp += currentExp[i];
  9348. currentStats = exp;
  9349. remainder = statsSkillGoal[skillId][0] - exp;
  9350. } else {
  9351. currentStats = currentExp[skillId];
  9352. remainder = statsSkillGoal[skillId][1] == 1 ? (statsSkillGoal[skillId][0] - currentExp[skillId]) : (Skills.EXP_FOR_LEVEL[statsSkillGoal[skillId][0] - 2] - currentExp[skillId]);
  9353. }
  9354. if (remainder < 0) {
  9355. remainder = 0;
  9356. }
  9357. finalMessage = finalMessage.concat("\\n");
  9358. finalMessage = finalMessage.concat("Target " + (statsSkillGoal[skillId][1] == 1 ? " XP: " : "level: ") + NumberFormat.getInstance(Locale.US).format(statsSkillGoal[skillId][0]));
  9359. finalMessage = finalMessage.concat("\\n");
  9360. finalMessage = finalMessage.concat("Remainder: " + NumberFormat.getInstance(Locale.US).format(remainder));
  9361. boxHeight += 14;
  9362. }
  9363.  
  9364. for (String s1 = finalMessage; s1.length() > 0;) {
  9365. if (s1.indexOf("%") != -1) {
  9366. do {
  9367. int k7 = s1.indexOf("%1");
  9368. if (k7 == -1)
  9369. break;
  9370. s1 = s1.substring(0, k7) + NumberFormat.getInstance(Locale.US).format(extractInterfaceValues(child, 0)) + s1.substring(k7 + 2);
  9371. } while (true);
  9372. do {
  9373. int l7 = s1.indexOf("%2");
  9374. if (l7 == -1)
  9375. break;
  9376. s1 = s1.substring(0, l7) + NumberFormat.getInstance(Locale.US).format(extractInterfaceValues(child, 1)) + s1.substring(l7 + 2);
  9377. } while (true);
  9378. do {
  9379. int i8 = s1.indexOf("%3");
  9380. if (i8 == -1)
  9381. break;
  9382. s1 = s1.substring(0, i8) + NumberFormat.getInstance(Locale.US).format(extractInterfaceValues(child, 2)) + s1.substring(i8 + 2);
  9383. } while (true);
  9384. do {
  9385. int j8 = s1.indexOf("%4");
  9386. if (j8 == -1)
  9387. break;
  9388. s1 = s1.substring(0, j8) + NumberFormat.getInstance(Locale.US).format(extractInterfaceValues(child, 3)) + s1.substring(j8 + 2);
  9389. } while (true);
  9390. do {
  9391. int k8 = s1.indexOf("%5");
  9392. if (k8 == -1)
  9393. break;
  9394. s1 = s1.substring(0, k8) + NumberFormat.getInstance(Locale.US).format(extractInterfaceValues(child, 4)) + s1.substring(k8 + 2);
  9395. } while (true);
  9396. }
  9397. int l7 = s1.indexOf("\\n");
  9398. String s4;
  9399. if (l7 != -1) {
  9400. s4 = s1.substring(0, l7);
  9401. s1 = s1.substring(l7 + 2);
  9402. } else {
  9403. s4 = s1;
  9404. s1 = "";
  9405. }
  9406. int j10 = textDrawingArea_2.getTextWidth(s4);
  9407. if (j10 > boxWidth) {
  9408. boxWidth = j10;
  9409. }
  9410. boxHeight += textDrawingArea_2.anInt1497 + 2;
  9411. }
  9412. boxWidth += 6;
  9413. boxHeight += 7;
  9414.  
  9415. int xPos = (k2 + child.width) - 5 - boxWidth;
  9416. int yPos = l2 + child.height + 5;
  9417.  
  9418. if (xPos < k2 + 5) {
  9419. xPos = k2 + 5;
  9420. }
  9421.  
  9422. if (xPos + boxWidth > k + class9.width) {
  9423. xPos = (k + class9.width) - boxWidth;
  9424. }
  9425. if (yPos + boxHeight > l + class9.height) {
  9426. yPos = (l2 - boxHeight);
  9427. }
  9428.  
  9429. if (frameMode == ScreenMode.FIXED) {
  9430. if (skillHoverIds(child.id) == child.id && xPos + boxWidth + k + class9.width > 765) {
  9431. xPos = 765 - boxWidth - k - class9.width - 3;
  9432. }
  9433. } else {
  9434. if (skillHoverIds(child.id) == child.id && xPos + boxWidth > frameWidth) {
  9435. xPos = frameWidth - boxWidth - 15;
  9436. }
  9437. }
  9438. if (skillHoverIds(child.id) == child.id && yPos + boxHeight > frameHeight - (frameMode == ScreenMode.FIXED ? yPos + boxHeight - 118 : (frameWidth <= 1000 ? 75 : 35))) {
  9439. yPos -= boxHeight + 35;
  9440. }
  9441.  
  9442. DrawingArea.drawPixels(boxHeight, yPos, xPos, 0xFFFFA0, boxWidth);
  9443. DrawingArea.fillPixels(xPos, boxWidth, boxHeight, 0, yPos);
  9444.  
  9445. if (showGoal) {
  9446. int goal = statsSkillGoal[skillId][1] == 1 ? statsSkillGoal[skillId][0] : Skills.EXP_FOR_LEVEL[statsSkillGoal[skillId][0] - 2];
  9447. int init = statsSkillGoal[skillId][2];
  9448. double percentage = ((currentStats - init) / (double) (goal - init));
  9449. if (percentage > 1) {
  9450. percentage = 1;
  9451. }
  9452.  
  9453. DrawingArea.drawPixels(10, (yPos + boxHeight) - 16, xPos + 5, 0xFF0000, boxWidth - 10);
  9454. DrawingArea.drawPixels(10, (yPos + boxHeight) - 16, xPos + 5, 0x00FF00, (int) ((boxWidth - 10) * percentage));
  9455.  
  9456. DrawingArea.fillPixels(xPos + 4, boxWidth - 8, 12, 0, (yPos + boxHeight) - 17);
  9457.  
  9458. newSmallFont.drawCenteredString((int) (percentage * 100) + "%", xPos + 3 + (boxWidth / 2), (yPos + boxHeight) - 6, 0, -1);
  9459. }
  9460.  
  9461. String s2 = finalMessage;
  9462. for (int j11 = yPos + textDrawingArea_2.anInt1497 + 3; s2.length() > 0; j11 += textDrawingArea_2.anInt1497 + 2) {// anInt1497
  9463. if (s2.indexOf("%") != -1) {
  9464. do {
  9465. int k7 = s2.indexOf("%1");
  9466. if (k7 == -1)
  9467. break;
  9468. s2 = s2.substring(0, k7) + NumberFormat.getInstance(Locale.US).format(extractInterfaceValues(child, 0)) + s2.substring(k7 + 2);
  9469. } while (true);
  9470. do {
  9471. int l7 = s2.indexOf("%2");
  9472. if (l7 == -1)
  9473. break;
  9474. s2 = s2.substring(0, l7) + NumberFormat.getInstance(Locale.US).format(extractInterfaceValues(child, 1)) + s2.substring(l7 + 2);
  9475. } while (true);
  9476. do {
  9477. int i8 = s2.indexOf("%3");
  9478. if (i8 == -1)
  9479. break;
  9480. s2 = s2.substring(0, i8) + NumberFormat.getInstance(Locale.US).format(extractInterfaceValues(child, 2)) + s2.substring(i8 + 2);
  9481. } while (true);
  9482. do {
  9483. int j8 = s2.indexOf("%4");
  9484. if (j8 == -1)
  9485. break;
  9486. s2 = s2.substring(0, j8) + NumberFormat.getInstance(Locale.US).format(extractInterfaceValues(child, 3)) + s2.substring(j8 + 2);
  9487. } while (true);
  9488. do {
  9489. int k8 = s2.indexOf("%5");
  9490. if (k8 == -1)
  9491. break;
  9492. s2 = s2.substring(0, k8) + NumberFormat.getInstance(Locale.US).format(extractInterfaceValues(child, 4)) + s2.substring(k8 + 2);
  9493. } while (true);
  9494. }
  9495. int l11 = s2.indexOf("\\n");
  9496. String s5;
  9497. if (l11 != -1) {
  9498. s5 = s2.substring(0, l11);
  9499. s2 = s2.substring(l11 + 2);
  9500. } else {
  9501. s5 = s2;
  9502. s2 = "";
  9503. }
  9504. if (child.centerText) {
  9505. textDrawingArea_2.method382(yPos, xPos + child.width / 2, s5, j11, false);
  9506. } else {
  9507. if (s5.contains("\\r")) {
  9508. String text = s5.substring(0, s5.indexOf("\\r"));
  9509. String text2 = s5.substring(s5.indexOf("\\r") + 2);
  9510. textDrawingArea_2.method389(false, xPos + 3, 0, text, j11);
  9511. int rightX = boxWidth + xPos - textDrawingArea_2.getTextWidth(text2) - 2;
  9512. textDrawingArea_2.method389(false, rightX, 0, text2, j11);
  9513. System.out.println("Box: " + boxWidth + "");
  9514. } else {
  9515. if (s5.contains(":") && !s5.contains("/") && child.parentID == 3917) {
  9516. String[] result = s5.split(":");
  9517. textDrawingArea_2.method389(false, xPos + 3, 0, result[0] + ":", j11);
  9518. textDrawingArea_2.method389(false, xPos + boxWidth - textDrawingArea_2.getTextWidth(result[1]) - 3, 0, result[1], j11);
  9519. } else {
  9520. textDrawingArea_2.method389(false, xPos + 3, 0, s5, j11);
  9521. }
  9522. }
  9523. }
  9524. }
  9525. } else if (child.type == 16) {
  9526. int x = frameWidth - child.width - k2;
  9527. int y = frameHeight - class9.height + l2;
  9528.  
  9529. boolean hover = false;
  9530.  
  9531. int xx = class9.childX[j2] + (frameMode == ScreenMode.FIXED ? 0 : 0);
  9532. int yy = class9.childY[j2] + (frameMode == ScreenMode.FIXED ? 0 : 0);
  9533.  
  9534. if (tabInterfaceIDs[tabID] == child.parentID) {
  9535. xx = frameWidth - 197;
  9536. yy = frameWidth >= 1000 ? frameHeight - 280 : frameHeight - 262 + yy - j;
  9537. }
  9538.  
  9539. if (super.mouseX >= xx && super.mouseX <= xx + child.width && super.mouseY >= yy && super.mouseY <= yy + child.height) {
  9540. hover = true;
  9541. }
  9542.  
  9543. if (super.saveClickX >= xx && super.saveClickX <= xx + child.width && super.saveClickY >= yy && super.saveClickY <= yy + child.height) {
  9544. if (RSInterface.currentInputField != child) {
  9545. if (super.clickMode2 == 1 && !menuOpen) {
  9546. RSInterface.currentInputField = child;
  9547. }
  9548. }
  9549. }
  9550.  
  9551. int color;
  9552.  
  9553. if (RSInterface.currentInputField == child) {
  9554. color = child.anInt219;
  9555.  
  9556. if (hover) {
  9557. color = child.anInt239;
  9558. }
  9559. } else {
  9560. color = child.textColor;
  9561.  
  9562. if (hover) {
  9563. color = child.textHoverColor;
  9564. }
  9565. }
  9566.  
  9567. DrawingArea.drawPixels(child.height, l2, k2, color, child.width);
  9568. DrawingArea.fillPixels(k2, child.width, child.height, 0, l2);
  9569.  
  9570. x = k2;
  9571. y = l2;
  9572.  
  9573. StringBuilder builder = new StringBuilder();
  9574.  
  9575. String message = child.disabledMessage;
  9576.  
  9577. if (child.enabledMessage != null && RSInterface.currentInputField != child) {
  9578. message = child.enabledMessage;
  9579. }
  9580.  
  9581. if (child.displayAsterisks) {
  9582. 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));
  9583. } else {
  9584. 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));
  9585. }
  9586. }
  9587. }
  9588. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  9589. }
  9590.  
  9591. public int skillHoverIds(int ids) {
  9592. 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 };
  9593. for (int hover = 0; hover < hoverIds.length; hover++) {
  9594. if (hoverIds[hover] == ids) {
  9595. ids = hover;
  9596. return hoverIds[ids];
  9597. }
  9598. }
  9599. return 0;
  9600. }
  9601.  
  9602. private void randomizeBackground(Background background) {
  9603. int j = 256;
  9604. for (int k = 0; k < anIntArray1190.length; k++)
  9605. anIntArray1190[k] = 0;
  9606.  
  9607. for (int l = 0; l < 5000; l++) {
  9608. int i1 = (int) (Math.random() * 128D * (double) j);
  9609. anIntArray1190[i1] = (int) (Math.random() * 256D);
  9610. }
  9611. for (int j1 = 0; j1 < 20; j1++) {
  9612. for (int k1 = 1; k1 < j - 1; k1++) {
  9613. for (int i2 = 1; i2 < 127; i2++) {
  9614. int k2 = i2 + (k1 << 7);
  9615. anIntArray1191[k2] = (anIntArray1190[k2 - 1] + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128] + anIntArray1190[k2 + 128]) / 4;
  9616. }
  9617.  
  9618. }
  9619. int ai[] = anIntArray1190;
  9620. anIntArray1190 = anIntArray1191;
  9621. anIntArray1191 = ai;
  9622. }
  9623. if (background != null) {
  9624. int l1 = 0;
  9625. for (int j2 = 0; j2 < background.anInt1453; j2++) {
  9626. for (int l2 = 0; l2 < background.anInt1452; l2++)
  9627. if (background.aByteArray1450[l1++] != 0) {
  9628. int i3 = l2 + 16 + background.anInt1454;
  9629. int j3 = j2 + 16 + background.anInt1455;
  9630. int k3 = i3 + (j3 << 7);
  9631. anIntArray1190[k3] = 0;
  9632. }
  9633. }
  9634. }
  9635. }
  9636.  
  9637. private void appendPlayerUpdateMask(int i, int j, Stream stream, Player player) {
  9638. if ((i & 0x400) != 0) {
  9639. player.anInt1543 = stream.method428();
  9640. player.anInt1545 = stream.method428();
  9641. player.anInt1544 = stream.method428();
  9642. player.anInt1546 = stream.method428();
  9643. player.anInt1547 = stream.method436() + loopCycle;
  9644. player.anInt1548 = stream.method435() + loopCycle;
  9645. player.anInt1549 = stream.method428();
  9646. player.method446();
  9647. }
  9648. if ((i & 0x100) != 0) {
  9649. player.anInt1520 = stream.method434();
  9650. int k = stream.readDWord();
  9651. player.anInt1524 = k >> 16;
  9652. player.anInt1523 = loopCycle + (k & 0xffff);
  9653. player.anInt1521 = 0;
  9654. player.anInt1522 = 0;
  9655. if (player.anInt1523 > loopCycle)
  9656. player.anInt1521 = -1;
  9657. if (player.anInt1520 == 65535)
  9658. player.anInt1520 = -1;
  9659. }
  9660. if ((i & 8) != 0) {
  9661. int l = stream.method434();
  9662. if (l == 65535)
  9663. l = -1;
  9664. int i2 = stream.method427();
  9665. if (l == player.anim && l != -1) {
  9666. int i3 = Animation.anims[l].anInt365;
  9667. if (i3 == 1) {
  9668. player.anInt1527 = 0;
  9669. player.anInt1528 = 0;
  9670. player.anInt1529 = i2;
  9671. player.anInt1530 = 0;
  9672. }
  9673. if (i3 == 2)
  9674. player.anInt1530 = 0;
  9675. } else if (l == -1 || player.anim == -1 || Animation.anims[l].anInt359 >= Animation.anims[player.anim].anInt359) {
  9676. player.anim = l;
  9677. player.anInt1527 = 0;
  9678. player.anInt1528 = 0;
  9679. player.anInt1529 = i2;
  9680. player.anInt1530 = 0;
  9681. player.anInt1542 = player.smallXYIndex;
  9682. }
  9683. }
  9684. if ((i & 4) != 0) {
  9685. player.textSpoken = stream.readString();
  9686. if (player.textSpoken.charAt(0) == '~') {
  9687. player.textSpoken = player.textSpoken.substring(1);
  9688. pushMessage(player.textSpoken, 2, player.name, player.title, player.titleColor);
  9689. } else if (player == myPlayer)
  9690. pushMessage(player.textSpoken, 2, player.name, player.title, player.titleColor);
  9691. player.anInt1513 = 0;
  9692. player.anInt1531 = 0;
  9693. player.textCycle = 150;
  9694. }
  9695. if ((i & 0x80) != 0) {
  9696. // right fucking here
  9697. int i1 = stream.method434();
  9698. int j2 = stream.readUnsignedByte();
  9699. int j3 = stream.method427();
  9700. int k3 = stream.currentOffset;
  9701. if (player.name != null && player.visible) {
  9702. long l3 = TextClass.longForName(player.name);
  9703. boolean flag = false;
  9704. if (j2 <= 1) {
  9705. for (int i4 = 0; i4 < ignoreCount; i4++) {
  9706. if (ignoreListAsLongs[i4] != l3)
  9707. continue;
  9708. flag = true;
  9709. break;
  9710. }
  9711.  
  9712. }
  9713. if (!flag && anInt1251 == 0)
  9714. try {
  9715. aStream_834.currentOffset = 0;
  9716. stream.method442(j3, 0, aStream_834.buffer);
  9717. aStream_834.currentOffset = 0;
  9718. String s = TextInput.method525(j3, aStream_834);
  9719. // s = Censor.doCensor(s);
  9720. player.textSpoken = s;
  9721. player.anInt1513 = i1 >> 8;
  9722. player.privelage = j2;
  9723. player.anInt1531 = i1 & 0xff;
  9724. player.textCycle = 150;
  9725. if (j2 >= 1)
  9726. pushMessage(s, 1, "@cr" + j2 + "@" + player.name, player.title, player.titleColor);
  9727. else
  9728. pushMessage(s, 2, player.name, player.title, player.titleColor);
  9729. } catch (Exception exception) {
  9730. Signlink.reporterror("cde2");
  9731. exception.printStackTrace();
  9732. }
  9733. }
  9734. stream.currentOffset = k3 + j3;
  9735. }
  9736. if ((i & 1) != 0) {
  9737. player.interactingEntity = stream.method434();
  9738. if (player.interactingEntity == 65535)
  9739. player.interactingEntity = -1;
  9740. }
  9741. if ((i & 0x10) != 0) {
  9742. int j1 = stream.method427();
  9743. byte abyte0[] = new byte[j1];
  9744. Stream stream_1 = new Stream(abyte0);
  9745. stream.readBytes(j1, 0, abyte0);
  9746. aStreamArray895s[j] = stream_1;
  9747. player.updatePlayer(stream_1);
  9748. }
  9749. if ((i & 2) != 0) {
  9750. player.anInt1538 = stream.method436();
  9751. player.anInt1539 = stream.method434();
  9752. }
  9753. if ((i & 0x20) != 0) {
  9754. int k1 = stream.readUnsignedByte();
  9755. int k2 = stream.method426();
  9756. int icon = stream.readUnsignedByte();
  9757. player.updateHitData(k2, k1, loopCycle, icon);
  9758. player.loopCycleStatus = loopCycle + 300;
  9759. player.currentHealth = stream.method427();
  9760. player.maxHealth = stream.readUnsignedByte();
  9761. }
  9762. if ((i & 0x200) != 0) {
  9763. int l1 = stream.readUnsignedByte();
  9764. int l2 = stream.method428();
  9765. int icon = stream.readUnsignedByte();
  9766. player.updateHitData(l2, l1, loopCycle, icon);
  9767. player.loopCycleStatus = loopCycle + 300;
  9768. player.currentHealth = stream.readUnsignedByte();
  9769. player.maxHealth = stream.method427();
  9770. }
  9771. }
  9772.  
  9773. private void method108() {
  9774. try {
  9775. int x = myPlayer.x + anInt1278;
  9776. int y = myPlayer.y + anInt1131;
  9777. double rotSpeed = 2;
  9778. if (!Configuration.enableScreenGliding) {
  9779. screenGliding = 0;
  9780. }
  9781. if (anInt1014 - x < -500 || anInt1014 - x > 500 || anInt1015 - y < -500 || anInt1015 - y > 500) {
  9782. anInt1014 = x;
  9783. anInt1015 = y;
  9784. }
  9785. if (anInt1014 != x) {
  9786. anInt1014 += (x - anInt1014) / 16;
  9787. }
  9788. if (anInt1015 != y) {
  9789. anInt1015 += (y - anInt1015) / 16;
  9790. }
  9791. if (super.keyArray[1] == 1) {
  9792. anInt1186 += (-24 - anInt1186) / rotSpeed;
  9793. screenGliding++;
  9794. } else if (super.keyArray[2] == 1) {
  9795. anInt1186 += (24 - anInt1186) / rotSpeed;
  9796. screenGliding++;
  9797. } else {
  9798. if (screenGliding >= 10) {
  9799. if (anInt1186 > 0) {
  9800. anInt1186--;
  9801. } else if (anInt1186 < 0) {
  9802. anInt1186++;
  9803. }
  9804. } else {
  9805. anInt1186 /= rotSpeed;
  9806. }
  9807. }
  9808. if (super.keyArray[3] == 1) {
  9809. anInt1187 += (12 - anInt1187) / rotSpeed;
  9810. screenGliding++;
  9811. } else if (super.keyArray[4] == 1) {
  9812. anInt1187 += (-12 - anInt1187) / rotSpeed;
  9813. screenGliding++;
  9814. } else {
  9815. if (screenGliding >= 10) {
  9816. if (anInt1187 > 0) {
  9817. anInt1187--;
  9818. } else if (anInt1187 < 0) {
  9819. anInt1187++;
  9820. }
  9821. } else {
  9822. anInt1187 /= rotSpeed;
  9823. }
  9824. }
  9825. minimapInt1 = minimapInt1 + anInt1186 / (int) rotSpeed & 0x7ff;
  9826. anInt1184 += anInt1187 / rotSpeed;
  9827. if (anInt1184 < 128) {
  9828. anInt1184 = 128;
  9829. }
  9830. if (anInt1184 > 383) {
  9831. anInt1184 = 383;
  9832. }
  9833. int l = anInt1014 >> 7;
  9834. int i1 = anInt1015 >> 7;
  9835. int j1 = method42(plane, anInt1015, anInt1014);
  9836. int k1 = 0;
  9837. if (l > 3 && i1 > 3 && l < 100 && i1 < 100) {
  9838. for (int l1 = l - 4; l1 <= l + 4; l1++) {
  9839. for (int k2 = i1 - 4; k2 <= i1 + 4; k2++) {
  9840. int l2 = plane;
  9841. if (l2 < 3 && (byteGroundArray[1][l1][k2] & 2) == 2)
  9842. l2++;
  9843. int i3 = j1 - intGroundArray[l2][l1][k2];
  9844. if (i3 > k1)
  9845. k1 = i3;
  9846. }
  9847.  
  9848. }
  9849.  
  9850. }
  9851. anInt1005++;
  9852. if (anInt1005 > 1512) {
  9853. anInt1005 = 0;
  9854. stream.createFrame(77);
  9855. stream.writeWordBigEndian(0);
  9856. int i2 = stream.currentOffset;
  9857. stream.writeWordBigEndian((int) (Math.random() * 256D));
  9858. stream.writeWordBigEndian(101);
  9859. stream.writeWordBigEndian(233);
  9860. stream.writeWord(45092);
  9861. if ((int) (Math.random() * 2D) == 0)
  9862. stream.writeWord(35784);
  9863. stream.writeWordBigEndian((int) (Math.random() * 256D));
  9864. stream.writeWordBigEndian(64);
  9865. stream.writeWordBigEndian(38);
  9866. stream.writeWord((int) (Math.random() * 65536D));
  9867. stream.writeWord((int) (Math.random() * 65536D));
  9868. stream.writeBytes(stream.currentOffset - i2);
  9869. }
  9870. int j2 = k1 * 192;
  9871. if (j2 > 0x17f00)
  9872. j2 = 0x17f00;
  9873. if (j2 < 32768)
  9874. j2 = 32768;
  9875. if (j2 > anInt984) {
  9876. anInt984 += (j2 - anInt984) / 24;
  9877. return;
  9878. }
  9879. if (j2 < anInt984) {
  9880. anInt984 += (j2 - anInt984) / 80;
  9881. }
  9882. } catch (Exception _ex) {
  9883. Signlink.reporterror("glfc_ex " + myPlayer.x + "," + myPlayer.y + "," + anInt1014 + "," + anInt1015 + "," + anInt1069 + "," + anInt1070 + "," + baseX + "," + baseY);
  9884. throw new RuntimeException("eek");
  9885. }
  9886. }
  9887.  
  9888. public void processDrawing() {
  9889. if (rsAlreadyLoaded || loadingError || genericLoadingError) {
  9890. showErrorScreen();
  9891. return;
  9892. }
  9893. if (!loggedIn)
  9894. loginRenderer.displayLoginScreen();
  9895. else
  9896. drawGameScreen();
  9897. anInt1213 = 0;
  9898. }
  9899.  
  9900. private boolean isFriendOrSelf(String s) {
  9901. if (s == null)
  9902. return false;
  9903. for (int i = 0; i < friendsCount; i++)
  9904. if (s.equalsIgnoreCase(friendsList[i]))
  9905. return true;
  9906. return s.equalsIgnoreCase(myPlayer.name);
  9907. }
  9908.  
  9909. private static String combatDiffColor(int i, int j) {
  9910. int k = i - j;
  9911. if (k < -9)
  9912. return "@red@";
  9913. if (k < -6)
  9914. return "@or3@";
  9915. if (k < -3)
  9916. return "@or2@";
  9917. if (k < 0)
  9918. return "@or1@";
  9919. if (k > 9)
  9920. return "@gre@";
  9921. if (k > 6)
  9922. return "@gr3@";
  9923. if (k > 3)
  9924. return "@gr2@";
  9925. if (k > 0)
  9926. return "@gr1@";
  9927. else
  9928. return "@yel@";
  9929. }
  9930.  
  9931. private void setWaveVolume(int i) {
  9932. Signlink.wavevol = i;
  9933. }
  9934.  
  9935. public static String formatCoins(long amount) {
  9936. if (amount >= 1_000 && amount < 1_000_000) {
  9937. return "" + (amount / 1_000) + "K";
  9938. }
  9939.  
  9940. if (amount >= 1_000_000 && amount < 1_000_000_000) {
  9941. return "" + (amount / 1_000_000) + "M";
  9942. }
  9943.  
  9944. if (amount >= 1_000_000_000 && amount < 1_000_000_000_000L) {
  9945. return "" + (amount / 1_000_000_000) + "B";
  9946. }
  9947.  
  9948. if (amount >= 1_000_000_000_000L && amount < 1_000_000_000_000_000L) {
  9949. return "" + (amount / 1_000_000_000_000L) + "T";
  9950. }
  9951.  
  9952. if (amount >= 1_000_000_000_000_000L && amount < 1_000_000_000_000_000_000L) {
  9953. return "" + (amount / 1_000_000_000_000_000L) + "F";
  9954. }
  9955.  
  9956. if (amount >= 1_000_000_000_000_000_000L) {
  9957. return "" + (amount / 1_000_000_000_000_000_000L) + "A";
  9958. }
  9959. return "" + amount;
  9960. }
  9961.  
  9962. private int getMoneyOrbColor(long amount) {
  9963. if (amount >= 0 && amount <= 99999) {
  9964. return 0xFFFF00;
  9965. } else if (amount >= 100000 && amount <= 9999999) {
  9966. return 0xFFFFFF;
  9967. } else {
  9968. return 0x00FF80;
  9969. }
  9970. }
  9971.  
  9972. private void draw3dScreen() {
  9973. if (counterOn) {
  9974. drawCounterOnScreen();
  9975. }
  9976.  
  9977. if (showChatComponents) {
  9978. drawSplitPrivateChat();
  9979. }
  9980.  
  9981. BannerManager.drawMovingBanner();
  9982.  
  9983. if (crossType == 1) {
  9984. int offSet = frameMode == ScreenMode.FIXED ? 4 : 0;
  9985. crosses[crossIndex / 100].drawSprite(crossX - 8 - offSet, crossY - 8 - offSet);
  9986. anInt1142++;
  9987. if (anInt1142 > 67) {
  9988. anInt1142 = 0;
  9989. stream.createFrame(78);
  9990. }
  9991. }
  9992. if (crossType == 2) {
  9993. int offSet = frameMode == ScreenMode.FIXED ? 4 : 0;
  9994. crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - offSet, crossY - 8 - offSet);
  9995. }
  9996.  
  9997. /** Loading Walkable Interfaces */
  9998. if (inBarrows(baseX + (myPlayer.x - 6 >> 7), baseY + (myPlayer.y - 6 >> 7), plane)) {
  9999. anInt1018 = 59000;
  10000. } else if (inGWD(baseX + (myPlayer.x - 6 >> 7), baseY + (myPlayer.y - 6 >> 7), plane)) {
  10001. anInt1018 = 61750;
  10002. } else if (inWGLobby(baseX + (myPlayer.x - 6 >> 7), baseY + (myPlayer.y - 6 >> 7), plane)) {
  10003. anInt1018 = 41250;
  10004. } else if (inWGGame(baseX + (myPlayer.x - 6 >> 7), baseY + (myPlayer.y - 6 >> 7), plane)) {
  10005. anInt1018 = 41270;
  10006. } else if (inCyclops(baseX + (myPlayer.x - 6 >> 7), baseY + (myPlayer.y - 6 >> 7), plane)) {
  10007. anInt1018 = 51200;
  10008. } else if (inPcBoat(baseX + (myPlayer.x - 6 >> 7), baseY + (myPlayer.y - 6 >> 7), plane)) {
  10009. anInt1018 = 21119;
  10010. } else if (inPcGame(baseX + (myPlayer.x - 6 >> 7), baseY + (myPlayer.y - 6 >> 7), plane)) {
  10011. anInt1018 = 21100;
  10012. } else if (inWilderness(baseX + (myPlayer.x - 6 >> 7), baseY + (myPlayer.y - 6 >> 7), plane) && Configuration.economyWorld) {
  10013. anInt1018 = 23300;
  10014. } else if (inPvP(baseX + (myPlayer.x - 6 >> 7), baseY + (myPlayer.y - 6 >> 7), plane) && !Configuration.economyWorld) {
  10015. anInt1018 = 60250;
  10016. } else if (inSafe(baseX + (myPlayer.x - 6 >> 7), baseY + (myPlayer.y - 6 >> 7), plane) && !Configuration.economyWorld) {
  10017. anInt1018 = 60350;
  10018. } else if (Configuration.snow) {
  10019. anInt1018 = 11877;
  10020. } else {
  10021. anInt1018 = -1;
  10022. }
  10023. /** End */
  10024.  
  10025. if (anInt1018 != -1) {
  10026. RSInterface rsInterface = RSInterface.interfaceCache[anInt1018];
  10027. method119(anInt945, anInt1018);
  10028.  
  10029. if (anInt1018 == 11146 && frameMode != ScreenMode.FIXED) {
  10030. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], -5);
  10031. } else if (anInt1018 == 23300) {
  10032. drawInterface(0, frameWidth - rsInterface.width - 253, rsInterface, 0);
  10033. } else if (anInt1018 == 23300 && frameMode == ScreenMode.RESIZABLE) {
  10034. drawInterface(0, frameWidth / 2 - 780, RSInterface.interfaceCache[anInt1018], 80);
  10035. } else if ((anInt1018 == 2804 || anInt1018 == 11479) && frameMode != ScreenMode.FIXED) {
  10036. drawInterface(0, frameWidth / 2 - 1010, RSInterface.interfaceCache[anInt1018], 80);
  10037. } else if (anInt1018 == 41270 && frameMode != ScreenMode.FIXED) {
  10038. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 8);
  10039. } else if (anInt1018 == 41250 && frameMode != ScreenMode.FIXED) {
  10040. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 8);
  10041. } else if (anInt1018 == 201 && frameMode != ScreenMode.FIXED) {
  10042. drawInterface(0, frameWidth - 520, RSInterface.interfaceCache[anInt1018], -110);
  10043. } else if (anInt1018 == 41270 && frameMode != ScreenMode.FIXED) {
  10044. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 8);
  10045. } else if (anInt1018 == 41250 && frameMode != ScreenMode.FIXED) {
  10046. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 8);
  10047. } else if (anInt1018 == 59000 && frameMode != ScreenMode.FIXED) {
  10048. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], frameHeight - 495);
  10049. } else if (anInt1018 == 21119 && frameMode != ScreenMode.FIXED) {
  10050. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 5);
  10051. } else if (anInt1018 == 21100 && frameMode != ScreenMode.FIXED) {
  10052. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 5);
  10053. } else if (anInt1018 == 51200 && frameMode != ScreenMode.FIXED) {
  10054. drawInterface(0, frameWidth - 770, RSInterface.interfaceCache[anInt1018], 25);
  10055. } else if (anInt1018 == 61750 && frameMode != ScreenMode.FIXED) {
  10056. drawInterface(0, frameWidth - 800, RSInterface.interfaceCache[anInt1018], 5);
  10057. } else if (anInt1018 == 4535 && frameMode != ScreenMode.FIXED) {
  10058. drawInterface(0, -418, RSInterface.interfaceCache[anInt1018], -285);
  10059. } else if ((anInt1018 == 15892 || anInt1018 == 15917 || anInt1018 == 15931 || anInt1018 == 15962) && frameMode != ScreenMode.FIXED) {
  10060. drawInterface(0, (anInt1018 == 15892 ? -325 : -349), RSInterface.interfaceCache[anInt1018], 25);
  10061. } else
  10062. drawInterface(0, frameMode == ScreenMode.FIXED ? 0 : (frameWidth / 2) - -80, RSInterface.interfaceCache[anInt1018], frameMode == ScreenMode.FIXED ? 0 : (frameHeight / 2) - 550);
  10063. }
  10064. if (openInterfaceID == 5292) {
  10065. method119(anInt945, openInterfaceID);
  10066. drawInterface(0, frameMode == ScreenMode.FIXED ? 0 : (frameWidth / 2) - 356, RSInterface.interfaceCache[openInterfaceID], frameMode == ScreenMode.FIXED ? 0 : (frameHeight / 2) - 230);
  10067. } else if (openInterfaceID != -1 && openInterfaceID != 5292) {
  10068. method119(anInt945, openInterfaceID);
  10069. int w = 512, h = 334;
  10070. int x = frameMode == ScreenMode.FIXED ? 0 : (frameWidth / 2) - 256;
  10071. int y = frameMode == ScreenMode.FIXED ? 0 : (frameHeight / 2) - 167;
  10072. int count = !changeTabArea ? 4 : 3;
  10073. if (frameMode != ScreenMode.FIXED) {
  10074. for (int i = 0; i < count; i++) {
  10075. if (x + w > (frameWidth - 225)) {
  10076. x = x - 30;
  10077. if (x < 0) {
  10078. x = 0;
  10079. }
  10080. }
  10081. if (y + h > (frameHeight - 182)) {
  10082. y = y - 30;
  10083. if (y < 0) {
  10084. y = 0;
  10085. }
  10086. }
  10087. }
  10088. }
  10089. drawInterface(0, x, RSInterface.interfaceCache[openInterfaceID], y);
  10090. }
  10091. if (!menuOpen) {
  10092. processRightClick();
  10093. drawTooltip();
  10094. } else if (menuScreenArea == 0) {
  10095. drawMenu(frameMode == ScreenMode.FIXED ? 4 : 0, frameMode == ScreenMode.FIXED ? 4 : 0);
  10096. }
  10097. if (anInt1055 == 1) {
  10098. multiOverlay.drawSprite(frameMode == ScreenMode.FIXED ? 472 : frameWidth - 165, frameMode == ScreenMode.FIXED ? 296 : 160);
  10099. }
  10100. if (fpsOn) {
  10101. int textColour = 0xffff00;
  10102. if (super.fps < 15) {
  10103. textColour = 0xff0000;
  10104. }
  10105. regularText.method385(textColour, "Fps: " + super.fps, 12, 5);
  10106. Runtime runtime = Runtime.getRuntime();
  10107. int memUsage = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  10108. textColour = 0xffff00;
  10109. if (memUsage > 0x2000000 && lowMem) {
  10110. textColour = 0xff0000;
  10111. }
  10112. regularText.method385(textColour, "Mem: " + memUsage + "k", 27, 5);
  10113. }
  10114. int x = baseX + (myPlayer.x - 6 >> 7);
  10115. int y = baseY + (myPlayer.y - 6 >> 7);
  10116. final String screenMode = frameMode == ScreenMode.FIXED ? "Fixed" : "Resizable";
  10117. if (clientData) {
  10118. int textColour = 0xffff00;
  10119. int fpsColour = 0xffff00;
  10120. if (super.fps < 15) {
  10121. fpsColour = 0xff0000;
  10122. }
  10123. smallText.method385(textColour, "Frame Width: " + (mouseX - frameWidth) + ", Frame Height: " + (mouseY - frameHeight), frameHeight - 271, 5);
  10124. smallText.method385(textColour, "Client Zoom: " + cameraZoom, frameHeight - 257, 5);
  10125. smallText.method385(fpsColour, "Fps: " + super.fps, frameHeight - 243, 5);
  10126. Runtime runtime = Runtime.getRuntime();
  10127. int clientMemory = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  10128. smallText.method385(textColour, "Memory Usage: " + NumberFormat.getInstance().format(clientMemory) + "k", frameHeight - 229, 5);
  10129. smallText.method385(textColour, "Mouse X: " + mouseX + ", Mouse Y: " + mouseY, frameHeight - 215, 5);
  10130. smallText.method385(textColour, "Coords: " + x + ", " + y, frameHeight - 201, 5);
  10131. smallText.method385(textColour, "Client Mode: " + screenMode + "", frameHeight - 187, 5);
  10132. smallText.method385(textColour, "Client Resolution: " + frameWidth + "x" + frameHeight, frameHeight - 173, 5);
  10133. }
  10134. if (anInt1104 != 0) {
  10135. int j = anInt1104 / 50;
  10136. int l = j / 60;
  10137. int yOffset = frameMode == ScreenMode.FIXED ? 0 : frameHeight - 498;
  10138. j %= 60;
  10139. if (j < 10)
  10140. smallText.method385(0xffff00, "System update in: " + l + ":0" + j, 329 + yOffset, 4);
  10141. else
  10142. smallText.method385(0xffff00, "System update in: " + l + ":" + j, 329 + yOffset, 4);
  10143. anInt849++;
  10144. if (anInt849 > 75) {
  10145. anInt849 = 0;
  10146. stream.createFrame(148);
  10147. }
  10148. }
  10149. }
  10150.  
  10151. static final class BannerManager {
  10152.  
  10153. static class Banner {
  10154.  
  10155. private final String text;
  10156.  
  10157. private int x;
  10158.  
  10159. private final int color;
  10160.  
  10161. private int opacity = 0;
  10162.  
  10163. private long leasureTime = 0;
  10164.  
  10165. public Banner(String text, int color) {
  10166. this.text = text;
  10167. this.color = color;
  10168. this.x = frameWidth - (frameMode == ScreenMode.FIXED ? 253 : 155);
  10169. }
  10170.  
  10171. public int getColor() {
  10172. return color;
  10173. }
  10174.  
  10175. public String getText() {
  10176. return text;
  10177. }
  10178.  
  10179. public int getX() {
  10180. return x;
  10181. }
  10182.  
  10183. public int getOpacity() {
  10184. return opacity;
  10185. }
  10186.  
  10187. public void update() {
  10188. if (x <= 0) {
  10189. banner = null;
  10190. return;
  10191. }
  10192.  
  10193. int width = frameWidth - (frameMode == ScreenMode.FIXED ? 253 : 155);
  10194. int delta = 4 * (1 << (int) (width / (765.0 - (frameMode == ScreenMode.FIXED ? 253 : 155))));
  10195.  
  10196. if (x < width / 2.0) {
  10197. if (opacity - delta >= 0) {
  10198. opacity -= delta;
  10199. }
  10200. } else {
  10201. if (opacity + delta <= 255) {
  10202. opacity += delta;
  10203. }
  10204. }
  10205.  
  10206. if (System.currentTimeMillis() - leasureTime >= 2500) {
  10207. x -= delta;
  10208. }
  10209.  
  10210. if (leasureTime == 0) {
  10211. int center = (int) ((width + newFancyFont.getTextWidth(text)) / 2.0);
  10212.  
  10213. if (x >= center - delta && x <= center + delta) {
  10214. leasureTime = System.currentTimeMillis();
  10215. }
  10216. }
  10217. }
  10218. }
  10219.  
  10220. public static Client instance;
  10221.  
  10222. private static Banner banner;
  10223.  
  10224. public static void addBanner(String text, int color) {
  10225. System.out.println(text + " _ " + color);
  10226. banner = new Banner(text, color);
  10227. }
  10228.  
  10229. public static void drawMovingBanner() {
  10230.  
  10231. if (banner == null) {
  10232. return;
  10233. }
  10234.  
  10235. DrawingArea.drawAlphaPixels(0, 20, frameWidth, 50, banner.getColor(), banner.getOpacity());
  10236. newFancyFont.drawRAString(banner.getText(), banner.getX(), 52, 0xFFFFFF, 0x0);
  10237.  
  10238. banner.update();
  10239. }
  10240. }
  10241.  
  10242. private final boolean inBarrows(int x, int y, int z) {
  10243. return (x > 3539 && x < 3582 && y >= 9675 && y < 9722) || x > 3532 && x < 3546 && y > 9698 && y < 9709;
  10244. }
  10245.  
  10246. public final boolean inCyclops(int x, int y, int z) {
  10247. return (x >= 2847 && x <= 2876 && y >= 3534 && y <= 3556 && z == 2 || x >= 2838 && x <= 2847 && y >= 3543 && y <= 3556 && z == 2);
  10248. }
  10249.  
  10250. private final boolean inWGGame(int x, int y, int z) {
  10251. return (x > 2136 && x < 2166 && y > 5089 && y < 5108);
  10252. }
  10253.  
  10254. private final boolean inWGLobby(int x, int y, int z) {
  10255. return (x > 1859 && x < 1868 && y > 5316 && y < 5323);
  10256. }
  10257.  
  10258. private final boolean inGWD(int x, int y, int z) {
  10259. return (x > 2816 && x < 2960 && y >= 5243 && y < 5400);
  10260. }
  10261.  
  10262. public boolean inPcBoat(int x, int y, int z) {
  10263. return (x >= 2660 && x <= 2663 && y >= 2638 && y <= 2643);
  10264. }
  10265.  
  10266. public boolean inPcGame(int x, int y, int z) {
  10267. return (x >= 2624 && x <= 2690 && y >= 2550 && y <= 2619);
  10268. }
  10269.  
  10270. public boolean inWilderness(int x, int y, int z) {
  10271. return (x > 2941 && x < 3392 && y > 3521 && y < 3966) || (x > 2941 && x < 3392 && y > 9918 && y < 10366);
  10272. }
  10273.  
  10274. public boolean inMaze(int x, int y, int z) {
  10275. return (x > 1);
  10276. }
  10277.  
  10278. public boolean inSafe(int x, int y, int z) {
  10279. return (x >= 3180 && x <= 3190 && y >= 3433 && y <= 3447) || (x >= 3091 && x <= 3098 && y >= 3488 && y <= 3499);
  10280. }
  10281.  
  10282. public boolean inPvP(int x, int y, int z) {
  10283. return (inSafe(x, y, z) ? false : true);
  10284. }
  10285.  
  10286. private void addIgnore(long l) {
  10287. try {
  10288. if (l == 0L)
  10289. return;
  10290. if (ignoreCount >= 100) {
  10291. pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
  10292. return;
  10293. }
  10294. String s = TextClass.fixName(TextClass.nameForLong(l));
  10295. if (s.equals(myPlayer.name)) {
  10296. pushMessage("You may not ignore yourself!", 0, "");
  10297. return;
  10298. }
  10299. for (int j = 0; j < ignoreCount; j++)
  10300. if (ignoreListAsLongs[j] == l) {
  10301. pushMessage(s + " is already on your ignore list", 0, "");
  10302. return;
  10303. }
  10304. for (int k = 0; k < friendsCount; k++)
  10305. if (friendsListAsLongs[k] == l) {
  10306. pushMessage("Please remove " + s + " from your friend list first", 0, "");
  10307. return;
  10308. }
  10309.  
  10310. ignoreListAsLongs[ignoreCount++] = l;
  10311. stream.createFrame(133);
  10312. stream.writeQWord(l);
  10313. return;
  10314. } catch (RuntimeException runtimeexception) {
  10315. Signlink.reporterror("45688, " + l + ", " + 4 + ", " + runtimeexception.toString());
  10316. }
  10317. throw new RuntimeException();
  10318. }
  10319.  
  10320. private void method114() {
  10321. for (int i = -1; i < playerCount; i++) {
  10322. int j;
  10323. if (i == -1)
  10324. j = myPlayerIndex;
  10325. else
  10326. j = playerIndices[i];
  10327. Player player = playerArray[j];
  10328. if (player != null)
  10329. method96(player);
  10330. }
  10331.  
  10332. }
  10333.  
  10334. private void method115() {
  10335. if (loadingStage == 2) {
  10336. for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179.reverseGetNext()) {
  10337. if (class30_sub1.anInt1294 > 0)
  10338. class30_sub1.anInt1294--;
  10339. if (class30_sub1.anInt1294 == 0) {
  10340. if (class30_sub1.anInt1299 < 0 || ObjectManager.method178(class30_sub1.anInt1299, class30_sub1.anInt1301)) {
  10341. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1300, class30_sub1.anInt1301, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1299);
  10342. class30_sub1.unlink();
  10343. }
  10344. } else {
  10345. if (class30_sub1.anInt1302 > 0)
  10346. class30_sub1.anInt1302--;
  10347. 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))) {
  10348. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1292, class30_sub1.anInt1293, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1291);
  10349. class30_sub1.anInt1302 = -1;
  10350. if (class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1299 == -1)
  10351. class30_sub1.unlink();
  10352. else if (class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1292 == class30_sub1.anInt1300 && class30_sub1.anInt1293 == class30_sub1.anInt1301)
  10353. class30_sub1.unlink();
  10354. }
  10355. }
  10356. }
  10357.  
  10358. }
  10359. }
  10360.  
  10361. private void determineMenuSize() {
  10362. int boxLength = newBoldFont.getTextWidth("Choose option");
  10363. for (int row = 0; row < menuActionRow; row++) {
  10364. int actionLength = newBoldFont.getTextWidth(menuActionName[row]);
  10365. if (actionLength > boxLength) {
  10366. boxLength = actionLength;
  10367. }
  10368. }
  10369. boxLength += 8;
  10370. int offset = 15 * menuActionRow + 21;
  10371. if (super.saveClickX > 0 && super.saveClickY > 0 && super.saveClickX < frameWidth && super.saveClickY < frameHeight) {
  10372. int xClick = super.saveClickX - boxLength / 2;
  10373. if (xClick + boxLength > frameWidth - 4) {
  10374. xClick = frameWidth - 4 - boxLength;
  10375. }
  10376. if (xClick < 0) {
  10377. xClick = 0;
  10378. }
  10379. int yClick = super.saveClickY - 0;
  10380. if (yClick + offset > frameHeight - 6) {
  10381. yClick = frameHeight - 6 - offset;
  10382. }
  10383. if (yClick < 0) {
  10384. yClick = 0;
  10385. }
  10386. menuOpen = true;
  10387. menuOffsetX = xClick;
  10388. menuOffsetY = yClick;
  10389. menuWidth = boxLength;
  10390. menuHeight = 15 * menuActionRow + 22;
  10391. }
  10392. }
  10393.  
  10394. private void method117(Stream stream) {
  10395. stream.initBitAccess();
  10396. int j = stream.readBits(1);
  10397. if (j == 0)
  10398. return;
  10399. int k = stream.readBits(2);
  10400. if (k == 0) {
  10401. anIntArray894[anInt893++] = myPlayerIndex;
  10402. return;
  10403. }
  10404. if (k == 1) {
  10405. int l = stream.readBits(3);
  10406. myPlayer.moveInDir(false, l);
  10407. int k1 = stream.readBits(1);
  10408. if (k1 == 1)
  10409. anIntArray894[anInt893++] = myPlayerIndex;
  10410. return;
  10411. }
  10412. if (k == 2) {
  10413. int i1 = stream.readBits(3);
  10414. myPlayer.moveInDir(true, i1);
  10415. int l1 = stream.readBits(3);
  10416. myPlayer.moveInDir(true, l1);
  10417. int j2 = stream.readBits(1);
  10418. if (j2 == 1)
  10419. anIntArray894[anInt893++] = myPlayerIndex;
  10420. return;
  10421. }
  10422. if (k == 3) {
  10423. plane = stream.readBits(2);
  10424. int j1 = stream.readBits(1);
  10425. int i2 = stream.readBits(1);
  10426. if (i2 == 1)
  10427. anIntArray894[anInt893++] = myPlayerIndex;
  10428. int k2 = stream.readBits(7);
  10429. int l2 = stream.readBits(7);
  10430. myPlayer.setPos(l2, k2, j1 == 1);
  10431. }
  10432. }
  10433.  
  10434. private void nullLoader() {
  10435. aBoolean831 = false;
  10436. while (drawingFlames) {
  10437. aBoolean831 = false;
  10438. try {
  10439. Thread.sleep(50L);
  10440. } catch (Exception _ex) {
  10441. }
  10442. }
  10443. aBackground_966 = null;
  10444. aBackground_967 = null;
  10445. aBackgroundArray1152s = null;
  10446. anIntArray850 = null;
  10447. anIntArray851 = null;
  10448. anIntArray852 = null;
  10449. anIntArray853 = null;
  10450. anIntArray1190 = null;
  10451. anIntArray1191 = null;
  10452. anIntArray828 = null;
  10453. anIntArray829 = null;
  10454. aClass30_Sub2_Sub1_Sub1_1201 = null;
  10455. aClass30_Sub2_Sub1_Sub1_1202 = null;
  10456. }
  10457.  
  10458. private boolean method119(int i, int j) {
  10459. boolean flag1 = false;
  10460. RSInterface class9 = RSInterface.interfaceCache[j];
  10461. if (class9 == null || class9.children == null) {
  10462. return false;
  10463. }
  10464. for (int k = 0; k < class9.children.length; k++) {
  10465. if (class9.children[k] == -1)
  10466. break;
  10467. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
  10468. if (class9_1.type == 1)
  10469. flag1 |= method119(i, class9_1.id);
  10470. if (class9_1.type == 6 && (class9_1.anInt257 != -1 || class9_1.anInt258 != -1)) {
  10471. boolean flag2 = interfaceIsSelected(class9_1);
  10472. int l;
  10473. if (flag2)
  10474. l = class9_1.anInt258;
  10475. else
  10476. l = class9_1.anInt257;
  10477. if (l != -1) {
  10478. Animation animation = Animation.anims[l];
  10479. for (class9_1.anInt208 += i; class9_1.anInt208 > animation.method258(class9_1.anInt246);) {
  10480. class9_1.anInt208 -= animation.method258(class9_1.anInt246) + 1;
  10481. class9_1.anInt246++;
  10482. if (class9_1.anInt246 >= animation.anInt352) {
  10483. class9_1.anInt246 -= animation.anInt356;
  10484. if (class9_1.anInt246 < 0 || class9_1.anInt246 >= animation.anInt352)
  10485. class9_1.anInt246 = 0;
  10486. }
  10487. flag1 = true;
  10488. }
  10489.  
  10490. }
  10491. }
  10492. }
  10493.  
  10494. return flag1;
  10495. }
  10496.  
  10497. private int method120() {
  10498. if (!Configuration.enableRoofs) {
  10499. return plane;
  10500. }
  10501. int j = 3;
  10502. if (yCameraCurve < 310) {
  10503. int k = xCameraPos >> 7;
  10504. int l = yCameraPos >> 7;
  10505. int i1 = myPlayer.x >> 7;
  10506. int j1 = myPlayer.y >> 7;
  10507. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10508. j = plane;
  10509. int k1;
  10510. if (i1 > k)
  10511. k1 = i1 - k;
  10512. else
  10513. k1 = k - i1;
  10514. int l1;
  10515. if (j1 > l)
  10516. l1 = j1 - l;
  10517. else
  10518. l1 = l - j1;
  10519. if (k1 > l1) {
  10520. int i2 = (l1 * 0x10000) / k1;
  10521. int k2 = 32768;
  10522. while (k != i1) {
  10523. if (k < i1)
  10524. k++;
  10525. else if (k > i1)
  10526. k--;
  10527. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10528. j = plane;
  10529. k2 += i2;
  10530. if (k2 >= 0x10000) {
  10531. k2 -= 0x10000;
  10532. if (l < j1)
  10533. l++;
  10534. else if (l > j1)
  10535. l--;
  10536. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10537. j = plane;
  10538. }
  10539. }
  10540. } else {
  10541. int j2 = (k1 * 0x10000) / l1;
  10542. int l2 = 32768;
  10543. while (l != j1) {
  10544. if (l < j1)
  10545. l++;
  10546. else if (l > j1)
  10547. l--;
  10548. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10549. j = plane;
  10550. l2 += j2;
  10551. if (l2 >= 0x10000) {
  10552. l2 -= 0x10000;
  10553. if (k < i1)
  10554. k++;
  10555. else if (k > i1)
  10556. k--;
  10557. if ((byteGroundArray[plane][k][l] & 4) != 0)
  10558. j = plane;
  10559. }
  10560. }
  10561. }
  10562. }
  10563. if ((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
  10564. j = plane;
  10565. return j;
  10566. }
  10567.  
  10568. private int method121() {
  10569. if (!Configuration.enableRoofs) {
  10570. return plane;
  10571. }
  10572. int j = method42(plane, yCameraPos, xCameraPos);
  10573. if (j - zCameraPos < 800 && (byteGroundArray[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
  10574. return plane;
  10575. else
  10576. return 3;
  10577. }
  10578.  
  10579. private void delIgnore(long l) {
  10580. try {
  10581. if (l == 0L)
  10582. return;
  10583. for (int j = 0; j < ignoreCount; j++)
  10584. if (ignoreListAsLongs[j] == l) {
  10585. ignoreCount--;
  10586. System.arraycopy(ignoreListAsLongs, j + 1, ignoreListAsLongs, j, ignoreCount - j);
  10587.  
  10588. stream.createFrame(74);
  10589. stream.writeQWord(l);
  10590. return;
  10591. }
  10592.  
  10593. return;
  10594. } catch (RuntimeException runtimeexception) {
  10595. Signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  10596. }
  10597. throw new RuntimeException();
  10598. }
  10599.  
  10600. public String getParameter(String s) {
  10601. if (Signlink.mainapp != null)
  10602. return Signlink.mainapp.getParameter(s);
  10603. else
  10604. return super.getParameter(s);
  10605. }
  10606.  
  10607. private void adjustVolume(boolean flag, int i) {
  10608. Signlink.midivol = i;
  10609. if (flag)
  10610. Signlink.midi = "voladjust";
  10611. }
  10612.  
  10613. private int extractInterfaceValues(RSInterface class9, int j) {
  10614. if (class9.valueIndexArray == null || j >= class9.valueIndexArray.length)
  10615. return -2;
  10616. try {
  10617. int ai[] = class9.valueIndexArray[j];
  10618. int k = 0;
  10619. int l = 0;
  10620. int i1 = 0;
  10621. do {
  10622. int j1 = ai[l++];
  10623. int k1 = 0;
  10624. byte byte0 = 0;
  10625. if (j1 == 0)
  10626. return k;
  10627. if (j1 == 1)
  10628. k1 = currentStats[ai[l++]];
  10629. if (j1 == 2)
  10630. k1 = maxStats[ai[l++]];
  10631. if (j1 == 3)
  10632. k1 = currentExp[ai[l++]];
  10633. if (j1 == 4) {
  10634. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  10635. int k2 = ai[l++];
  10636. if (k2 >= 0 && k2 < ItemDef.totalItems && (!ItemDef.forID(k2).membersObject || isMembers)) {
  10637. for (int j3 = 0; j3 < class9_1.inv.length; j3++) {
  10638. if (class9_1.inv[j3] == k2 + 1) {
  10639. k1 += class9_1.invStackSizes[j3];
  10640. }
  10641. }
  10642. }
  10643. }
  10644. if (j1 == 5)
  10645. k1 = variousSettings[ai[l++]];
  10646. if (j1 == 6)
  10647. k1 = Skills.EXP_FOR_LEVEL[maxStats[ai[l++]] - 1];
  10648. if (j1 == 7)
  10649. k1 = (variousSettings[ai[l++]] * 100) / 46875;
  10650. if (j1 == 8)
  10651. k1 = myPlayer.combatLevel;
  10652. if (j1 == 9) {
  10653. for (int l1 = 0; l1 < Skills.SKILLS_COUNT; l1++)
  10654. if (Skills.SKILL_ENABLED[l1])
  10655. k1 += maxStats[l1];
  10656.  
  10657. }
  10658. if (j1 == 10) {
  10659. RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
  10660. int l2 = ai[l++] + 1;
  10661. if (l2 >= 0 && l2 < ItemDef.totalItems && isMembers) {
  10662. for (int k3 = 0; k3 < class9_2.inv.length; k3++) {
  10663. if (class9_2.inv[k3] != l2)
  10664. continue;
  10665. k1 = 0x3b9ac9ff;
  10666. break;
  10667. }
  10668.  
  10669. }
  10670. }
  10671. if (j1 == 11)
  10672. k1 = energy;
  10673. if (j1 == 12)
  10674. k1 = weight;
  10675. if (j1 == 13) {
  10676. int i2 = variousSettings[ai[l++]];
  10677. int i3 = ai[l++];
  10678. k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  10679. }
  10680. if (j1 == 14) {
  10681. int j2 = ai[l++];
  10682. VarBit varBit = VarBit.cache[j2];
  10683. int l3 = varBit.anInt648;
  10684. int i4 = varBit.anInt649;
  10685. int j4 = varBit.anInt650;
  10686. int k4 = anIntArray1232[j4 - i4];
  10687. k1 = variousSettings[l3] >> i4 & k4;
  10688. }
  10689. if (j1 == 15)
  10690. byte0 = 1;
  10691. if (j1 == 16)
  10692. byte0 = 2;
  10693. if (j1 == 17)
  10694. byte0 = 3;
  10695. if (j1 == 18)
  10696. k1 = (myPlayer.x >> 7) + baseX;
  10697. if (j1 == 19)
  10698. k1 = (myPlayer.y >> 7) + baseY;
  10699. if (j1 == 20)
  10700. k1 = ai[l++];
  10701. if (j1 == 21)
  10702. k1 = tabAmounts[ai[l++]];
  10703. if (j1 == 22) {
  10704. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  10705. int initAmount = class9_1.inv.length;
  10706. for (int j3 = 0; j3 < class9_1.inv.length; j3++) {
  10707. if (class9_1.inv[j3] <= 0) {
  10708. initAmount--;
  10709. }
  10710. }
  10711. k1 += initAmount;
  10712. }
  10713. if (j1 == 23) {
  10714. for (int l1 = 0; l1 < Skills.SKILLS_COUNT; l1++)
  10715. if (Skills.SKILL_ENABLED[l1])
  10716. k1 += currentExp[l1];
  10717. }
  10718. if (byte0 == 0) {
  10719. if (i1 == 0)
  10720. k += k1;
  10721. if (i1 == 1)
  10722. k -= k1;
  10723. if (i1 == 2 && k1 != 0)
  10724. k /= k1;
  10725. if (i1 == 3)
  10726. k *= k1;
  10727. i1 = 0;
  10728. } else {
  10729. i1 = byte0;
  10730. }
  10731. } while (true);
  10732. } catch (Exception _ex) {
  10733. return -1;
  10734. }
  10735. }
  10736.  
  10737. private void drawTooltip() {
  10738. if (menuActionRow < 2 && itemSelected == 0 && spellSelected == 0) {
  10739. return;
  10740. }
  10741.  
  10742. String s;
  10743.  
  10744. if (itemSelected == 1 && menuActionRow < 2) {
  10745. s = "Use " + selectedItemName + " with...";
  10746. } else if (spellSelected == 1 && menuActionRow < 2) {
  10747. s = spellTooltip + "...";
  10748. } else {
  10749. s = menuActionName[menuActionRow - 1];
  10750. }
  10751.  
  10752. if (menuActionRow > 2 && !Configuration.menuHovers) {
  10753. s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
  10754. } else {
  10755. s = s + "@whi@";
  10756. }
  10757.  
  10758. if (Configuration.menuHovers && !s.contains("Walk here")) {
  10759. DrawingArea.drawAlphaPixels(super.mouseX, super.mouseY - 11, newBoldFont.getTextWidth(s.trim()) + 6, 17, 0, 100);
  10760. newBoldFont.drawBasicString(s, super.mouseX + 2, super.mouseY + 2, 0xFFFFFF, 1);
  10761. }
  10762. newBoldFont.drawBasicString(s, 4, 15, 0xFFFFFF, 1);
  10763. }
  10764.  
  10765. private void markMinimap(Sprite sprite, int x, int y) {
  10766. if (sprite == null) {
  10767. return;
  10768. }
  10769. int k = minimapInt1 + minimapInt2 & 0x7ff;
  10770. int l = x * x + y * y;
  10771. if (l > 6400) {
  10772. return;
  10773. }
  10774. int i1 = Model.modelIntArray1[k];
  10775. int j1 = Model.modelIntArray2[k];
  10776. i1 = (i1 * 256) / (minimapInt3 + 256);
  10777. j1 = (j1 * 256) / (minimapInt3 + 256);
  10778. int k1 = y * i1 + x * j1 >> 16;
  10779. int l1 = y * j1 - x * i1 >> 16;
  10780. if (frameMode == ScreenMode.FIXED) {
  10781. sprite.drawSprite(((94 + k1) - sprite.cropWidth / 2) + 4 + 30, 83 - l1 - sprite.anInt1445 / 2 - 4 + 5);
  10782. } else {
  10783. sprite.drawSprite(((77 + k1) - sprite.cropWidth / 2) + 4 + (frameWidth - 167), 85 - l1 - sprite.anInt1445 / 2 - 4);
  10784. }
  10785. }
  10786.  
  10787. private void drawMinimap() {
  10788. if (frameMode == ScreenMode.FIXED) {
  10789. aRSImageProducer_1164.initDrawingArea();
  10790. }
  10791. if (anInt1021 == 2) {
  10792. if (frameMode == ScreenMode.FIXED) {
  10793. fixedGameComponents[0].drawSprite(0, 0);
  10794. } else {
  10795. gameComponents[0].drawSprite(frameWidth - 181, 0);
  10796. gameComponents[1].drawSprite(frameWidth - 158, 7);
  10797. }
  10798. if (Configuration.enableStatusOrbs) {
  10799. 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) {
  10800. orbComponents3[1].drawSprite(frameMode == ScreenMode.FIXED ? 3 : frameWidth - 210, frameMode == ScreenMode.FIXED ? 27 : 23);
  10801. } else {
  10802. orbComponents3[0].drawSprite(frameMode == ScreenMode.FIXED ? 3 : frameWidth - 210, frameMode == ScreenMode.FIXED ? 27 : 23);
  10803. }
  10804. }
  10805. 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) {
  10806. cacheSprite[348].drawARGBSprite(frameMode == ScreenMode.FIXED ? 226 : frameWidth - 23, 0, 205);
  10807. } else {
  10808. cacheSprite[348].drawSprite(frameMode == ScreenMode.FIXED ? 226 : frameWidth - 23, 0);
  10809. }
  10810. if (tabID == 14) {
  10811. cacheSprite[349].drawSprite(frameMode == ScreenMode.FIXED ? 226 : frameWidth - 23, 0);
  10812. }
  10813. loadAllOrbs(frameMode == ScreenMode.FIXED ? 0 : frameWidth - 217);
  10814. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, (frameMode == ScreenMode.FIXED ? 25 : 24), 4, (frameMode == ScreenMode.FIXED ? 29 : frameWidth - 176), 33, 25);
  10815. if (menuOpen) {
  10816. drawMenu(frameMode == ScreenMode.FIXED ? 516 : 0, 0);
  10817. }
  10818. if (frameMode == ScreenMode.FIXED) {
  10819. aRSImageProducer_1164.initDrawingArea();
  10820. }
  10821. return;
  10822. }
  10823. int i = minimapInt1 + minimapInt2 & 0x7ff;
  10824. int j = 48 + myPlayer.x / 32;
  10825. int l2 = 464 - myPlayer.y / 32;
  10826. minimapImage.method352(151, i, anIntArray1229, 256 + minimapInt3, anIntArray1052, l2, (frameMode == ScreenMode.FIXED ? 9 : 7), (frameMode == ScreenMode.FIXED ? 54 : frameWidth - 158), 146, j);
  10827. for (int j5 = 0; j5 < anInt1071; j5++) {
  10828. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  10829. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  10830. markMinimap(aClass30_Sub2_Sub1_Sub1Array1140[j5], k, i3);
  10831. }
  10832. for (int k5 = 0; k5 < 104; k5++) {
  10833. for (int l5 = 0; l5 < 104; l5++) {
  10834. NodeList class19 = groundArray[plane][k5][l5];
  10835. if (class19 != null) {
  10836. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  10837. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  10838. markMinimap(mapDotItem, l, j3);
  10839. }
  10840. }
  10841. }
  10842. for (int i6 = 0; i6 < npcCount; i6++) {
  10843. Npc npc = npcArray[npcIndices[i6]];
  10844. if (npc != null && npc.isVisible()) {
  10845. EntityDef entityDef = npc.desc;
  10846. if (entityDef.childrenIDs != null) {
  10847. entityDef = entityDef.method161();
  10848. }
  10849. if (entityDef != null && entityDef.aBoolean87 && entityDef.aBoolean84) {
  10850. int i1 = npc.x / 32 - myPlayer.x / 32;
  10851. int k3 = npc.y / 32 - myPlayer.y / 32;
  10852. markMinimap(mapDotNPC, i1, k3);
  10853. }
  10854. }
  10855. }
  10856. for (int j6 = 0; j6 < playerCount; j6++) {
  10857. Player player = playerArray[playerIndices[j6]];
  10858. if (player != null && player.isVisible()) {
  10859. int j1 = player.x / 32 - myPlayer.x / 32;
  10860. int l3 = player.y / 32 - myPlayer.y / 32;
  10861. boolean flag1 = false;
  10862. boolean flag3 = false;
  10863. for (int j3 = 0; j3 < clanList.length; j3++) {
  10864. if (clanList[j3] == null) {
  10865. continue;
  10866. }
  10867. if (!clanList[j3].equalsIgnoreCase(player.name)) {
  10868. continue;
  10869. }
  10870. flag3 = true;
  10871. break;
  10872. }
  10873. long l6 = TextClass.longForName(player.name);
  10874. for (int k6 = 0; k6 < friendsCount; k6++) {
  10875. if (l6 != friendsListAsLongs[k6] || friendsNodeIDs[k6] == 0) {
  10876. continue;
  10877. }
  10878. flag1 = true;
  10879. break;
  10880. }
  10881. boolean flag2 = false;
  10882. if (myPlayer.team != 0 && player.team != 0 && myPlayer.team == player.team) {
  10883. flag2 = true;
  10884. }
  10885. if (flag1) {
  10886. markMinimap(mapDotFriend, j1, l3);
  10887. } else if (flag3) {
  10888. markMinimap(mapDotClan, j1, l3);
  10889. } else if (flag2) {
  10890. markMinimap(mapDotTeam, j1, l3);
  10891. } else {
  10892. markMinimap(mapDotPlayer, j1, l3);
  10893. }
  10894. }
  10895. }
  10896. if (anInt855 != 0 && loopCycle % 20 < 10) {
  10897. if (anInt855 == 1 && anInt1222 >= 0 && anInt1222 < npcArray.length) {
  10898. Npc class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  10899. if (class30_sub2_sub4_sub1_sub1_1 != null) {
  10900. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32 - myPlayer.x / 32;
  10901. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32 - myPlayer.y / 32;
  10902. method81(mapMarker, i4, k1);
  10903. }
  10904. }
  10905. if (anInt855 == 2) {
  10906. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  10907. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  10908. method81(mapMarker, j4, l1);
  10909. }
  10910. if (anInt855 == 10 && anInt933 >= 0 && anInt933 < playerArray.length) {
  10911. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  10912. if (class30_sub2_sub4_sub1_sub2_1 != null) {
  10913. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32 - myPlayer.x / 32;
  10914. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32 - myPlayer.y / 32;
  10915. method81(mapMarker, k4, i2);
  10916. }
  10917. }
  10918. }
  10919. if (destX != 0) {
  10920. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  10921. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  10922. markMinimap(mapFlag, j2, l4);
  10923. }
  10924. DrawingArea.drawPixels(3, (frameMode == ScreenMode.FIXED ? 83 : 80), (frameMode == ScreenMode.FIXED ? 127 : frameWidth - 88), 0xffffff, 3);
  10925. if (frameMode == ScreenMode.FIXED) {
  10926. fixedGameComponents[0].drawSprite(0, 0);
  10927. } else {
  10928. gameComponents[0].drawSprite(frameWidth - 181, 0);
  10929. }
  10930. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, (frameMode == ScreenMode.FIXED ? 25 : 24), 4, (frameMode == ScreenMode.FIXED ? 29 : frameWidth - 176), 33, 25);
  10931. if (Configuration.enableStatusOrbs) {
  10932. 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) {
  10933. orbComponents3[1].drawSprite(frameMode == ScreenMode.FIXED ? 3 : frameWidth - 210, frameMode == ScreenMode.FIXED ? 27 : 23);
  10934. } else {
  10935. orbComponents3[0].drawSprite(frameMode == ScreenMode.FIXED ? 3 : frameWidth - 210, frameMode == ScreenMode.FIXED ? 27 : 23);
  10936. }
  10937. }
  10938. 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) {
  10939. cacheSprite[348].drawARGBSprite(frameMode == ScreenMode.FIXED ? 226 : frameWidth - 23, 0, 205);
  10940. } else {
  10941. cacheSprite[348].drawSprite(frameMode == ScreenMode.FIXED ? 226 : frameWidth - 23, 0);
  10942. }
  10943. if (tabID == 14) {
  10944. cacheSprite[349].drawSprite(frameMode == ScreenMode.FIXED ? 226 : frameWidth - 23, 0);
  10945. }
  10946. loadAllOrbs(frameMode == ScreenMode.FIXED ? 0 : frameWidth - 217);
  10947. if (menuOpen) {
  10948. drawMenu(frameMode == ScreenMode.FIXED ? 516 : 0, 0);
  10949. }
  10950. if (frameMode == ScreenMode.FIXED) {
  10951. aRSImageProducer_1165.initDrawingArea();
  10952. }
  10953. }
  10954.  
  10955. private void npcScreenPos(Entity entity, int i) {
  10956. calcEntityScreenPos(entity.x, i, entity.y);
  10957. }
  10958.  
  10959. private void calcEntityScreenPos(int i, int j, int l) {
  10960. if (i < 128 || l < 128 || i > 13056 || l > 13056) {
  10961. spriteDrawX = -1;
  10962. spriteDrawY = -1;
  10963. return;
  10964. }
  10965. int i1 = method42(plane, l, i) - j;
  10966. i -= xCameraPos;
  10967. i1 -= zCameraPos;
  10968. l -= yCameraPos;
  10969. int j1 = Model.modelIntArray1[yCameraCurve];
  10970. int k1 = Model.modelIntArray2[yCameraCurve];
  10971. int l1 = Model.modelIntArray1[xCameraCurve];
  10972. int i2 = Model.modelIntArray2[xCameraCurve];
  10973. int j2 = l * l1 + i * i2 >> 16;
  10974. l = l * i2 - i * l1 >> 16;
  10975. i = j2;
  10976. j2 = i1 * k1 - l * j1 >> 16;
  10977. l = i1 * j1 + l * k1 >> 16;
  10978. i1 = j2;
  10979. if (l >= 50) {
  10980. spriteDrawX = Rasterizer.centerX + (i << WorldController.viewDistance) / l;
  10981. spriteDrawY = Rasterizer.centerY + (i1 << WorldController.viewDistance) / l;
  10982. } else {
  10983. spriteDrawX = -1;
  10984. spriteDrawY = -1;
  10985. }
  10986. }
  10987.  
  10988. private void buildSplitPrivateChatMenu() {
  10989. if (splitPrivateChat == 0)
  10990. return;
  10991. int i = 0;
  10992. if (anInt1104 != 0)
  10993. i = 1;
  10994. for (int j = 0; j < 100; j++)
  10995. if (chatMessages[j] != null) {
  10996. int k = chatTypes[j];
  10997. String s = chatNames[j];
  10998. if (s != null && s.startsWith("@cr")) {
  10999. if (s.charAt(4) != '@') {
  11000. s = s.substring(6);
  11001. } else {
  11002. s = s.substring(5);
  11003. }
  11004. }
  11005. if ((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  11006. int offSet = frameMode == ScreenMode.FIXED ? 4 : 0;
  11007. int l = 329 - i * 13;
  11008. if (frameMode != ScreenMode.FIXED) {
  11009. l = frameHeight - 170 - i * 13 - extendChatArea;
  11010. }
  11011. if (super.mouseX > 4 && super.mouseY - offSet > l - 10 && super.mouseY - offSet <= l + 3) {
  11012. int i1 = regularText.getTextWidth("From: " + s + chatMessages[j]) + 25;
  11013. if (i1 > 450)
  11014. i1 = 450;
  11015. if (super.mouseX < 4 + i1) {
  11016. if (myPrivilege >= 1) {
  11017. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  11018. menuActionID[menuActionRow] = 2606;
  11019. menuActionRow++;
  11020. }
  11021. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  11022. menuActionID[menuActionRow] = 2042;
  11023. menuActionRow++;
  11024. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  11025. menuActionID[menuActionRow] = 2337;
  11026. menuActionRow++;
  11027. }
  11028. }
  11029. if (++i >= 5)
  11030. return;
  11031. }
  11032. if ((k == 5 || k == 6) && privateChatMode < 2 && ++i >= 5)
  11033. return;
  11034. }
  11035.  
  11036. }
  11037.  
  11038. private void method130(int j, int k, int l, int i1, int j1, int k1, int l1, int i2, int j2) {
  11039. Class30_Sub1 class30_sub1 = null;
  11040. for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179.reverseGetNext()) {
  11041. if (class30_sub1_1.anInt1295 != l1 || class30_sub1_1.anInt1297 != i2 || class30_sub1_1.anInt1298 != j1 || class30_sub1_1.anInt1296 != i1)
  11042. continue;
  11043. class30_sub1 = class30_sub1_1;
  11044. break;
  11045. }
  11046.  
  11047. if (class30_sub1 == null) {
  11048. class30_sub1 = new Class30_Sub1();
  11049. class30_sub1.anInt1295 = l1;
  11050. class30_sub1.anInt1296 = i1;
  11051. class30_sub1.anInt1297 = i2;
  11052. class30_sub1.anInt1298 = j1;
  11053. method89(class30_sub1);
  11054. aClass19_1179.insertHead(class30_sub1);
  11055. }
  11056. class30_sub1.anInt1291 = k;
  11057. class30_sub1.anInt1293 = k1;
  11058. class30_sub1.anInt1292 = l;
  11059. class30_sub1.anInt1302 = j2;
  11060. class30_sub1.anInt1294 = j;
  11061. }
  11062.  
  11063. private boolean interfaceIsSelected(RSInterface class9) {
  11064. if (class9.anIntArray245 == null)
  11065. return false;
  11066. for (int i = 0; i < class9.anIntArray245.length; i++) {
  11067. int j = extractInterfaceValues(class9, i);
  11068. int k = class9.anIntArray212[i];
  11069. if (class9.anIntArray245[i] == 2) {
  11070. if (j >= k)
  11071. return false;
  11072. } else if (class9.anIntArray245[i] == 3) {
  11073. if (j <= k)
  11074. return false;
  11075. } else if (class9.anIntArray245[i] == 4) {
  11076. if (j == k)
  11077. return false;
  11078. } else if (j != k)
  11079. return false;
  11080. }
  11081.  
  11082. return true;
  11083. }
  11084.  
  11085. private DataInputStream openJagGrabInputStream(String s) throws IOException {
  11086. // if(!aBoolean872)
  11087. // if(signlink.mainapp != null)
  11088. // return signlink.openurl(s);
  11089. // else
  11090. // return new DataInputStream((new URL(getCodeBase(), s)).openStream());
  11091. if (aSocket832 != null) {
  11092. try {
  11093. aSocket832.close();
  11094. } catch (Exception _ex) {
  11095. }
  11096. aSocket832 = null;
  11097. }
  11098. aSocket832 = openSocket(43595);
  11099. aSocket832.setSoTimeout(10000);
  11100. java.io.InputStream inputstream = aSocket832.getInputStream();
  11101. OutputStream outputstream = aSocket832.getOutputStream();
  11102. outputstream.write(("JAGGRAB /" + s + "\n\n").getBytes());
  11103. return new DataInputStream(inputstream);
  11104. }
  11105.  
  11106. private void method134(Stream stream) {
  11107. int j = stream.readBits(8);
  11108. if (j < playerCount) {
  11109. for (int k = j; k < playerCount; k++)
  11110. anIntArray840[anInt839++] = playerIndices[k];
  11111.  
  11112. }
  11113. if (j > playerCount) {
  11114. Signlink.reporterror(myUsername + " Too many players");
  11115. throw new RuntimeException("eek");
  11116. }
  11117. playerCount = 0;
  11118. for (int l = 0; l < j; l++) {
  11119. int i1 = playerIndices[l];
  11120. Player player = playerArray[i1];
  11121. int j1 = stream.readBits(1);
  11122. if (j1 == 0) {
  11123. playerIndices[playerCount++] = i1;
  11124. player.anInt1537 = loopCycle;
  11125. } else {
  11126. int k1 = stream.readBits(2);
  11127. if (k1 == 0) {
  11128. playerIndices[playerCount++] = i1;
  11129. player.anInt1537 = loopCycle;
  11130. anIntArray894[anInt893++] = i1;
  11131. } else if (k1 == 1) {
  11132. playerIndices[playerCount++] = i1;
  11133. player.anInt1537 = loopCycle;
  11134. int l1 = stream.readBits(3);
  11135. player.moveInDir(false, l1);
  11136. int j2 = stream.readBits(1);
  11137. if (j2 == 1)
  11138. anIntArray894[anInt893++] = i1;
  11139. } else if (k1 == 2) {
  11140. playerIndices[playerCount++] = i1;
  11141. player.anInt1537 = loopCycle;
  11142. int i2 = stream.readBits(3);
  11143. player.moveInDir(true, i2);
  11144. int k2 = stream.readBits(3);
  11145. player.moveInDir(true, k2);
  11146. int l2 = stream.readBits(1);
  11147. if (l2 == 1)
  11148. anIntArray894[anInt893++] = i1;
  11149. } else if (k1 == 3)
  11150. anIntArray840[anInt839++] = i1;
  11151. }
  11152. }
  11153. }
  11154.  
  11155. private void drawFlames() {
  11156.  
  11157. }
  11158.  
  11159. public void raiseWelcomeScreen() {
  11160. welcomeScreenRaised = true;
  11161. }
  11162.  
  11163. private final String[] chatTitles, chatColors;
  11164.  
  11165. private Npc npcDisplay;
  11166.  
  11167. public void pushMessage(String s, int i, String s1, String title, String color) {
  11168. if (i == 0 && dialogID != -1) {
  11169. aString844 = s;
  11170. super.clickMode3 = 0;
  11171. }
  11172. if (backDialogID == -1)
  11173. inputTaken = true;
  11174. for (int j = 499; j > 0; j--) {
  11175. chatTypes[j] = chatTypes[j - 1];
  11176. chatNames[j] = chatNames[j - 1];
  11177. chatMessages[j] = chatMessages[j - 1];
  11178. chatRights[j] = chatRights[j - 1];
  11179. chatTitles[j] = chatTitles[j - 1];
  11180. chatColors[j] = chatColors[j - 1];
  11181. }
  11182. chatTypes[0] = i;
  11183. chatNames[0] = s1;
  11184. chatMessages[0] = s;
  11185. chatRights[0] = rights;
  11186. chatTitles[0] = title;
  11187. chatColors[0] = color;
  11188. }
  11189.  
  11190. public void pushMessage(String s, int i, String s1) {
  11191. if (i == 0 && dialogID != -1) {
  11192. aString844 = s;
  11193. super.clickMode3 = 0;
  11194. }
  11195. if (backDialogID == -1) {
  11196. inputTaken = true;
  11197. }
  11198. for (int j = 499; j > 0; j--) {
  11199. chatTypes[j] = chatTypes[j - 1];
  11200. chatNames[j] = chatNames[j - 1];
  11201. chatMessages[j] = chatMessages[j - 1];
  11202. chatRights[j] = chatRights[j - 1];
  11203. chatTitles[j] = chatTitles[j - 1];
  11204. chatColors[j] = chatColors[j - 1];
  11205. clanTitles[j] = clanTitles[j - 1];
  11206. }
  11207. chatTypes[0] = i;
  11208. chatNames[0] = s1;
  11209. chatMessages[0] = s;
  11210. chatRights[0] = rights;
  11211. clanTitles[0] = clanTitle;
  11212. }
  11213.  
  11214. private void method137(Stream stream, int j) {
  11215. if (j == 84) {
  11216. int k = stream.readUnsignedByte();
  11217. int j3 = anInt1268 + (k >> 4 & 7);
  11218. int i6 = anInt1269 + (k & 7);
  11219. int l8 = stream.readUnsignedWord();
  11220. int k11 = stream.readUnsignedWord();
  11221. int l13 = stream.readUnsignedWord();
  11222. if (j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104) {
  11223. NodeList class19_1 = groundArray[plane][j3][i6];
  11224. if (class19_1 != null) {
  11225. 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()) {
  11226. if (class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff) || class30_sub2_sub4_sub2_3.anInt1559 != k11)
  11227. continue;
  11228. class30_sub2_sub4_sub2_3.anInt1559 = l13;
  11229. break;
  11230. }
  11231.  
  11232. spawnGroundItem(j3, i6);
  11233. }
  11234. }
  11235. return;
  11236. }
  11237. if (j == 105) {
  11238. int l = stream.readUnsignedByte();
  11239. int k3 = anInt1268 + (l >> 4 & 7);
  11240. int j6 = anInt1269 + (l & 7);
  11241. int i9 = stream.readUnsignedWord();
  11242. int l11 = stream.readUnsignedByte();
  11243. int i14 = l11 >> 4 & 0xf;
  11244. int i16 = l11 & 7;
  11245. 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) {
  11246. anIntArray1207[anInt1062] = i9;
  11247. anIntArray1241[anInt1062] = i16;
  11248. anIntArray1250[anInt1062] = Sounds.anIntArray326[i9];
  11249. anInt1062++;
  11250. }
  11251. }
  11252. if (j == 215) {
  11253. int i1 = stream.method435();
  11254. int l3 = stream.method428();
  11255. int k6 = anInt1268 + (l3 >> 4 & 7);
  11256. int j9 = anInt1269 + (l3 & 7);
  11257. int i12 = stream.method435();
  11258. int j14 = stream.readUnsignedWord();
  11259. if (k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104 && i12 != unknownInt10) {
  11260. Item class30_sub2_sub4_sub2_2 = new Item();
  11261. class30_sub2_sub4_sub2_2.ID = i1;
  11262. class30_sub2_sub4_sub2_2.anInt1559 = j14;
  11263. if (groundArray[plane][k6][j9] == null)
  11264. groundArray[plane][k6][j9] = new NodeList();
  11265. groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
  11266. spawnGroundItem(k6, j9);
  11267. }
  11268. return;
  11269. }
  11270. if (j == 156) {
  11271. int j1 = stream.method426();
  11272. int i4 = anInt1268 + (j1 >> 4 & 7);
  11273. int l6 = anInt1269 + (j1 & 7);
  11274. int k9 = stream.readUnsignedWord();
  11275. if (i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104) {
  11276. NodeList class19 = groundArray[plane][i4][l6];
  11277. if (class19 != null) {
  11278. for (Item item = (Item) class19.reverseGetFirst(); item != null; item = (Item) class19.reverseGetNext()) {
  11279. if (item.ID != (k9 & 0x7fff))
  11280. continue;
  11281. item.unlink();
  11282. break;
  11283. }
  11284.  
  11285. if (class19.reverseGetFirst() == null)
  11286. groundArray[plane][i4][l6] = null;
  11287. spawnGroundItem(i4, l6);
  11288. }
  11289. }
  11290. return;
  11291. }
  11292. if (j == 160) {
  11293. int k1 = stream.method428();
  11294. int j4 = anInt1268 + (k1 >> 4 & 7);
  11295. int i7 = anInt1269 + (k1 & 7);
  11296. int l9 = stream.method428();
  11297. int j12 = l9 >> 2;
  11298. int k14 = l9 & 3;
  11299. int j16 = anIntArray1177[j12];
  11300. int j17 = stream.method435();
  11301. if (j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103) {
  11302. int j18 = intGroundArray[plane][j4][i7];
  11303. int i19 = intGroundArray[plane][j4 + 1][i7];
  11304. int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
  11305. int k20 = intGroundArray[plane][j4][i7 + 1];
  11306. if (j16 == 0) {
  11307. Object1 class10 = worldController.method296(plane, j4, i7);
  11308. if (class10 != null) {
  11309. int k21 = class10.uid >> 14 & 0x7fff;
  11310. if (j12 == 2) {
  11311. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, 4 + k14, 2, i19, l19, j18, k20, j17, false);
  11312. class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(k21, k14 + 1 & 3, 2, i19, l19, j18, k20, j17, false);
  11313. } else {
  11314. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, k14, j12, i19, l19, j18, k20, j17, false);
  11315. }
  11316. }
  11317. }
  11318. if (j16 == 1) {
  11319. Object2 class26 = worldController.method297(j4, i7, plane);
  11320. if (class26 != null)
  11321. class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(class26.uid >> 14 & 0x7fff, 0, 4, i19, l19, j18, k20, j17, false);
  11322. }
  11323. if (j16 == 2) {
  11324. Object5 class28 = worldController.method298(j4, i7, plane);
  11325. if (j12 == 11)
  11326. j12 = 10;
  11327. if (class28 != null)
  11328. class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(class28.uid >> 14 & 0x7fff, k14, j12, i19, l19, j18, k20, j17, false);
  11329. }
  11330. if (j16 == 3) {
  11331. Object3 class49 = worldController.method299(i7, j4, plane);
  11332. if (class49 != null)
  11333. class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(class49.uid >> 14 & 0x7fff, k14, 22, i19, l19, j18, k20, j17, false);
  11334. }
  11335. }
  11336. return;
  11337. }
  11338. if (j == 147) {
  11339. int l1 = stream.method428();
  11340. int k4 = anInt1268 + (l1 >> 4 & 7);
  11341. int j7 = anInt1269 + (l1 & 7);
  11342. int i10 = stream.readUnsignedWord();
  11343. byte byte0 = stream.method430();
  11344. int l14 = stream.method434();
  11345. byte byte1 = stream.method429();
  11346. int k17 = stream.readUnsignedWord();
  11347. int k18 = stream.method428();
  11348. int j19 = k18 >> 2;
  11349. int i20 = k18 & 3;
  11350. int l20 = anIntArray1177[j19];
  11351. byte byte2 = stream.readSignedByte();
  11352. int l21 = stream.readUnsignedWord();
  11353. byte byte3 = stream.method429();
  11354. Player player;
  11355. if (i10 == unknownInt10)
  11356. player = myPlayer;
  11357. else
  11358. player = playerArray[i10];
  11359. if (player != null) {
  11360. ObjectDef class46 = ObjectDef.forID(l21);
  11361. int i22 = intGroundArray[plane][k4][j7];
  11362. int j22 = intGroundArray[plane][k4 + 1][j7];
  11363. int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
  11364. int l22 = intGroundArray[plane][k4][j7 + 1];
  11365. Model model = class46.method578(j19, i20, i22, j22, k22, l22, -1);
  11366. if (model != null) {
  11367. method130(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
  11368. player.anInt1707 = l14 + loopCycle;
  11369. player.anInt1708 = k17 + loopCycle;
  11370. player.aModel_1714 = model;
  11371. int i23 = class46.anInt744;
  11372. int j23 = class46.anInt761;
  11373. if (i20 == 1 || i20 == 3) {
  11374. i23 = class46.anInt761;
  11375. j23 = class46.anInt744;
  11376. }
  11377. player.anInt1711 = k4 * 128 + i23 * 64;
  11378. player.anInt1713 = j7 * 128 + j23 * 64;
  11379. player.anInt1712 = method42(plane, player.anInt1713, player.anInt1711);
  11380. if (byte2 > byte0) {
  11381. byte byte4 = byte2;
  11382. byte2 = byte0;
  11383. byte0 = byte4;
  11384. }
  11385. if (byte3 > byte1) {
  11386. byte byte5 = byte3;
  11387. byte3 = byte1;
  11388. byte1 = byte5;
  11389. }
  11390. player.anInt1719 = k4 + byte2;
  11391. player.anInt1721 = k4 + byte0;
  11392. player.anInt1720 = j7 + byte3;
  11393. player.anInt1722 = j7 + byte1;
  11394. }
  11395. }
  11396. }
  11397. if (j == 151) {
  11398. int i2 = stream.method426();
  11399. int l4 = anInt1268 + (i2 >> 4 & 7);
  11400. int k7 = anInt1269 + (i2 & 7);
  11401. int j10 = stream.method434();
  11402. int k12 = stream.method428();
  11403. int i15 = k12 >> 2;
  11404. int k16 = k12 & 3;
  11405. int l17 = anIntArray1177[i15];
  11406. if (l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104)
  11407. method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
  11408. return;
  11409. }
  11410. if (j == 4) {
  11411. int j2 = stream.readUnsignedByte();
  11412. int i5 = anInt1268 + (j2 >> 4 & 7);
  11413. int l7 = anInt1269 + (j2 & 7);
  11414. int k10 = stream.readUnsignedWord();
  11415. int l12 = stream.readUnsignedByte();
  11416. int j15 = stream.readUnsignedWord();
  11417. if (i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104) {
  11418. i5 = i5 * 128 + 64;
  11419. l7 = l7 * 128 + 64;
  11420. Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane, loopCycle, j15, k10, method42(plane, l7, i5) - l12, l7, i5);
  11421. aClass19_1056.insertHead(class30_sub2_sub4_sub3);
  11422. }
  11423. return;
  11424. }
  11425. if (j == 44) {
  11426. int k2 = stream.method436();
  11427. int j5 = stream.readUnsignedWord();
  11428. int i8 = stream.readUnsignedByte();
  11429. int l10 = anInt1268 + (i8 >> 4 & 7);
  11430. int i13 = anInt1269 + (i8 & 7);
  11431. if (l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104) {
  11432. Item class30_sub2_sub4_sub2_1 = new Item();
  11433. class30_sub2_sub4_sub2_1.ID = k2;
  11434. class30_sub2_sub4_sub2_1.anInt1559 = j5;
  11435. if (groundArray[plane][l10][i13] == null)
  11436. groundArray[plane][l10][i13] = new NodeList();
  11437. groundArray[plane][l10][i13].insertHead(class30_sub2_sub4_sub2_1);
  11438. spawnGroundItem(l10, i13);
  11439. }
  11440. return;
  11441. }
  11442. if (j == 101) {
  11443. int l2 = stream.method427();
  11444. int k5 = l2 >> 2;
  11445. int j8 = l2 & 3;
  11446. int i11 = anIntArray1177[k5];
  11447. int j13 = stream.readUnsignedByte();
  11448. int k15 = anInt1268 + (j13 >> 4 & 7);
  11449. int l16 = anInt1269 + (j13 & 7);
  11450. if (k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
  11451. method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
  11452. return;
  11453. }
  11454. if (j == 117) {
  11455. int i3 = stream.readUnsignedByte();
  11456. int l5 = anInt1268 + (i3 >> 4 & 7);
  11457. int k8 = anInt1269 + (i3 & 7);
  11458. int j11 = l5 + stream.readSignedByte();
  11459. int k13 = k8 + stream.readSignedByte();
  11460. int l15 = stream.readSignedWord();
  11461. int i17 = stream.readUnsignedWord();
  11462. int i18 = stream.readUnsignedByte() * 4;
  11463. int l18 = stream.readUnsignedByte() * 4;
  11464. int k19 = stream.readUnsignedWord();
  11465. int j20 = stream.readUnsignedWord();
  11466. int i21 = stream.readUnsignedByte();
  11467. int j21 = stream.readUnsignedByte();
  11468. if (l5 >= 0 && k8 >= 0 && l5 < 104 && k8 < 104 && j11 >= 0 && k13 >= 0 && j11 < 104 && k13 < 104 && i17 != 65535) {
  11469. l5 = l5 * 128 + 64;
  11470. k8 = k8 * 128 + 64;
  11471. j11 = j11 * 128 + 64;
  11472. k13 = k13 * 128 + 64;
  11473. 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);
  11474. class30_sub2_sub4_sub4.method455(k19 + loopCycle, k13, method42(plane, k13, j11) - l18, j11);
  11475. aClass19_1013.insertHead(class30_sub2_sub4_sub4);
  11476. }
  11477. }
  11478. }
  11479.  
  11480. private void method139(Stream stream) {
  11481. stream.initBitAccess();
  11482. int k = stream.readBits(8);
  11483. if (k < npcCount) {
  11484. for (int l = k; l < npcCount; l++)
  11485. anIntArray840[anInt839++] = npcIndices[l];
  11486.  
  11487. }
  11488. if (k > npcCount) {
  11489. Signlink.reporterror(myUsername + " Too many npcs");
  11490. throw new RuntimeException("eek");
  11491. }
  11492. npcCount = 0;
  11493. for (int i1 = 0; i1 < k; i1++) {
  11494. int j1 = npcIndices[i1];
  11495. Npc npc = npcArray[j1];
  11496. int k1 = stream.readBits(1);
  11497. if (k1 == 0) {
  11498. npcIndices[npcCount++] = j1;
  11499. npc.anInt1537 = loopCycle;
  11500. } else {
  11501. int l1 = stream.readBits(2);
  11502. if (l1 == 0) {
  11503. npcIndices[npcCount++] = j1;
  11504. npc.anInt1537 = loopCycle;
  11505. anIntArray894[anInt893++] = j1;
  11506. } else if (l1 == 1) {
  11507. npcIndices[npcCount++] = j1;
  11508. npc.anInt1537 = loopCycle;
  11509. int i2 = stream.readBits(3);
  11510. npc.moveInDir(false, i2);
  11511. int k2 = stream.readBits(1);
  11512. if (k2 == 1)
  11513. anIntArray894[anInt893++] = j1;
  11514. } else if (l1 == 2) {
  11515. npcIndices[npcCount++] = j1;
  11516. npc.anInt1537 = loopCycle;
  11517. int j2 = stream.readBits(3);
  11518. npc.moveInDir(true, j2);
  11519. int l2 = stream.readBits(3);
  11520. npc.moveInDir(true, l2);
  11521. int i3 = stream.readBits(1);
  11522. if (i3 == 1)
  11523. anIntArray894[anInt893++] = j1;
  11524. } else if (l1 == 3)
  11525. anIntArray840[anInt839++] = j1;
  11526. }
  11527. }
  11528. }
  11529.  
  11530. private void method142(int i, int j, int k, int l, int i1, int j1, int k1) {
  11531. if (i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102) {
  11532. if (lowMem && j != plane)
  11533. return;
  11534. int i2 = 0;
  11535. if (j1 == 0)
  11536. i2 = worldController.method300(j, i1, i);
  11537. if (j1 == 1)
  11538. i2 = worldController.method301(j, i1, i);
  11539. if (j1 == 2)
  11540. i2 = worldController.method302(j, i1, i);
  11541. if (j1 == 3)
  11542. i2 = worldController.method303(j, i1, i);
  11543. if (i2 != 0) {
  11544. int i3 = worldController.method304(j, i1, i, i2);
  11545. int j2 = i2 >> 14 & 0x7fff;
  11546. int k2 = i3 & 0x1f;
  11547. int l2 = i3 >> 6;
  11548. if (j1 == 0) {
  11549. worldController.method291(i1, j, i, (byte) -119);
  11550. ObjectDef class46 = ObjectDef.forID(j2);
  11551. if (class46.aBoolean767)
  11552. aClass11Array1230[j].method215(l2, k2, class46.aBoolean757, i1, i);
  11553. }
  11554. if (j1 == 1)
  11555. worldController.method292(i, j, i1);
  11556. if (j1 == 2) {
  11557. worldController.method293(j, i1, i);
  11558. ObjectDef class46_1 = ObjectDef.forID(j2);
  11559. if (i1 + class46_1.anInt744 > 103 || i + class46_1.anInt744 > 103 || i1 + class46_1.anInt761 > 103 || i + class46_1.anInt761 > 103)
  11560. return;
  11561. if (class46_1.aBoolean767)
  11562. aClass11Array1230[j].method216(l2, class46_1.anInt744, i1, i, class46_1.anInt761, class46_1.aBoolean757);
  11563. }
  11564. if (j1 == 3) {
  11565. worldController.method294(j, i, i1);
  11566. ObjectDef class46_2 = ObjectDef.forID(j2);
  11567. if (class46_2.aBoolean767 && class46_2.hasActions)
  11568. aClass11Array1230[j].method218(i, i1);
  11569. }
  11570. }
  11571. if (k1 >= 0) {
  11572. int j3 = j;
  11573. if (j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
  11574. j3++;
  11575. ObjectManager.method188(worldController, k, i, l, j3, aClass11Array1230[j], intGroundArray, i1, k1, j);
  11576. }
  11577. }
  11578. }
  11579.  
  11580. private void updatePlayers(int i, Stream stream) {
  11581. anInt839 = 0;
  11582. anInt893 = 0;
  11583. method117(stream);
  11584. method134(stream);
  11585. method91(stream, i);
  11586. method49(stream);
  11587. for (int k = 0; k < anInt839; k++) {
  11588. int l = anIntArray840[k];
  11589. if (playerArray[l].anInt1537 != loopCycle)
  11590. playerArray[l] = null;
  11591. }
  11592.  
  11593. if (stream.currentOffset != i) {
  11594. Signlink.reporterror("Error packet size mismatch in getplayer pos:" + stream.currentOffset + " psize:" + i);
  11595. throw new RuntimeException("eek");
  11596. }
  11597. for (int i1 = 0; i1 < playerCount; i1++)
  11598. if (playerArray[playerIndices[i1]] == null) {
  11599. Signlink.reporterror(myUsername + " null entry in pl list - pos:" + i1 + " size:" + playerCount);
  11600. throw new RuntimeException("eek");
  11601. }
  11602.  
  11603. }
  11604.  
  11605. private void setCameraPos(int j, int k, int l, int i1, int j1, int k1) {
  11606. int l1 = 2048 - k & 0x7ff;
  11607. int i2 = 2048 - j1 & 0x7ff;
  11608. int j2 = 0;
  11609. int k2 = 0;
  11610. int l2 = j;
  11611. if (l1 != 0) {
  11612. int i3 = Model.modelIntArray1[l1];
  11613. int k3 = Model.modelIntArray2[l1];
  11614. int i4 = k2 * k3 - l2 * i3 >> 16;
  11615. l2 = k2 * i3 + l2 * k3 >> 16;
  11616. k2 = i4;
  11617. }
  11618. if (i2 != 0) {
  11619. int j3 = Model.modelIntArray1[i2];
  11620. int l3 = Model.modelIntArray2[i2];
  11621. int j4 = l2 * j3 + j2 * l3 >> 16;
  11622. l2 = l2 * l3 - j2 * j3 >> 16;
  11623. j2 = j4;
  11624. }
  11625. xCameraPos = l - j2;
  11626. zCameraPos = i1 - k2;
  11627. yCameraPos = k1 - l2;
  11628. yCameraCurve = k;
  11629. xCameraCurve = j1;
  11630. }
  11631.  
  11632. public static void updateStrings(String str, int i) {
  11633. switch (i) {
  11634. case 1675:
  11635. sendFrame126(str, 17508);
  11636. break;// Stab
  11637. case 1676:
  11638. sendFrame126(str, 17509);
  11639. break;// Slash
  11640. case 1677:
  11641. sendFrame126(str, 17510);
  11642. break;// Cursh
  11643. case 1678:
  11644. sendFrame126(str, 17511);
  11645. break;// Magic
  11646. case 1679:
  11647. sendFrame126(str, 17512);
  11648. break;// Range
  11649. case 1680:
  11650. sendFrame126(str, 17513);
  11651. break;// Stab
  11652. case 1681:
  11653. sendFrame126(str, 17514);
  11654. break;// Slash
  11655. case 1682:
  11656. sendFrame126(str, 17515);
  11657. break;// Crush
  11658. case 1683:
  11659. sendFrame126(str, 17516);
  11660. break;// Magic
  11661. case 1684:
  11662. sendFrame126(str, 17517);
  11663. break;// Range
  11664. case 1686:
  11665. sendFrame126(str, 17518);
  11666. break;// Strength
  11667. case 1687:
  11668. sendFrame126(str, 17519);
  11669. break;// Prayer
  11670. }
  11671. }
  11672.  
  11673. public static void sendFrame126(String str, int i) {
  11674. RSInterface.interfaceCache[i].disabledMessage = str;
  11675. if (RSInterface.interfaceCache[i].parentID == tabInterfaceIDs[tabID]) {
  11676. }
  11677. }
  11678.  
  11679. public void sendPacket185(int button, int toggle, int type) {
  11680. switch (type) {
  11681. case 135:
  11682. RSInterface class9 = RSInterface.interfaceCache[button];
  11683. boolean flag8 = true;
  11684. if (class9.contentType > 0)
  11685. flag8 = promptUserForInput(class9);
  11686. if (flag8) {
  11687. stream.createFrame(185);
  11688. stream.writeWord(button);
  11689. }
  11690. break;
  11691. case 646:
  11692. System.out.println("toggle = " + toggle);
  11693. stream.createFrame(185);
  11694. stream.writeWord(button);
  11695. RSInterface class9_2 = RSInterface.interfaceCache[button];
  11696. if (class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5) {
  11697. if (variousSettings[toggle] != class9_2.anIntArray212[0]) {
  11698. int temp = variousSettings[toggle];
  11699. variousSettings[toggle] = class9_2.anIntArray212[0];
  11700. if (class9_2.parentID == 50000 && !interfaceIsSelected(class9_2)) {
  11701. variousSettings[toggle] = temp;
  11702. }
  11703. updateConfigValues(toggle);
  11704. }
  11705. }
  11706. break;
  11707. case 169:
  11708. stream.createFrame(185);
  11709. stream.writeWord(button);
  11710. RSInterface class9_3 = RSInterface.interfaceCache[button];
  11711. if (class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5) {
  11712. variousSettings[toggle] = 1 - variousSettings[toggle];
  11713. updateConfigValues(toggle);
  11714. }
  11715. switch (button) {
  11716. case 74214:
  11717. System.out.println("toggle = " + toggle);
  11718. if (toggle == 0)
  11719. sendFrame36(173, toggle);
  11720. if (toggle == 1)
  11721. sendPacket185(153, 173, 646);
  11722. break;
  11723. }
  11724. break;
  11725. }
  11726. }
  11727.  
  11728. public void sendFrame36(int id, int state) {
  11729. anIntArray1045[id] = state;
  11730. if (variousSettings[id] != state) {
  11731. variousSettings[id] = state;
  11732. updateConfigValues(id);
  11733. if (dialogID != -1)
  11734. inputTaken = true;
  11735. }
  11736. }
  11737.  
  11738. public void sendFrame219() {
  11739. if (invOverlayInterfaceID != -1) {
  11740. invOverlayInterfaceID = -1;
  11741. tabAreaAltered = true;
  11742. }
  11743. if (backDialogID != -1) {
  11744. backDialogID = -1;
  11745. inputTaken = true;
  11746. }
  11747. if (inputDialogState != 0) {
  11748. inputDialogState = 0;
  11749. inputTaken = true;
  11750. }
  11751. openInterfaceID = -1;
  11752. aBoolean1149 = false;
  11753. }
  11754.  
  11755. public void sendFrame248(int interfaceID, int sideInterfaceID) {
  11756. if (backDialogID != -1) {
  11757. backDialogID = -1;
  11758. inputTaken = true;
  11759. }
  11760. if (inputDialogState != 0) {
  11761. inputDialogState = 0;
  11762. inputTaken = true;
  11763. }
  11764. openInterfaceID = interfaceID;
  11765. invOverlayInterfaceID = sideInterfaceID;
  11766. tabAreaAltered = true;
  11767. aBoolean1149 = false;
  11768. }
  11769.  
  11770. private boolean parsePacket() {
  11771. if (socketStream == null)
  11772. return false;
  11773. try {
  11774. int i = socketStream.available();
  11775. if (i == 0)
  11776. return false;
  11777. if (pktType == -1) {
  11778. socketStream.flushInputStream(inStream.buffer, 1);
  11779. pktType = inStream.buffer[0] & 0xff;
  11780. if (encryption != null)
  11781. pktType = pktType - encryption.getNextKey() & 0xff;
  11782. pktSize = SizeConstants.packetSizes[pktType];
  11783. i--;
  11784. }
  11785. if (pktSize == -1)
  11786. if (i > 0) {
  11787. socketStream.flushInputStream(inStream.buffer, 1);
  11788. pktSize = inStream.buffer[0] & 0xff;
  11789. i--;
  11790. } else {
  11791. return false;
  11792. }
  11793. if (pktSize == -2)
  11794. if (i > 1) {
  11795. socketStream.flushInputStream(inStream.buffer, 2);
  11796. inStream.currentOffset = 0;
  11797. pktSize = inStream.readUnsignedWord();
  11798. i -= 2;
  11799. } else {
  11800. return false;
  11801. }
  11802. if (i < pktSize)
  11803. return false;
  11804. inStream.currentOffset = 0;
  11805. socketStream.flushInputStream(inStream.buffer, pktSize);
  11806. anInt1009 = 0;
  11807. anInt843 = anInt842;
  11808. anInt842 = anInt841;
  11809. anInt841 = pktType;
  11810. switch (pktType) {
  11811. case 81:
  11812. updatePlayers(pktSize, inStream);
  11813. aBoolean1080 = false;
  11814. pktType = -1;
  11815. return true;
  11816.  
  11817. case 176:
  11818. daysSinceRecovChange = inStream.method427();
  11819. unreadMessages = inStream.method435();
  11820. membersInt = inStream.readUnsignedByte();
  11821. anInt1193 = inStream.method440();
  11822. daysSinceLastLogin = inStream.readUnsignedWord();
  11823. if (anInt1193 != 0 && openInterfaceID == -1) {
  11824. Signlink.dnslookup(TextClass.method586(anInt1193));
  11825. clearTopInterfaces();
  11826. char c = '\u028A';
  11827. if (daysSinceRecovChange != 201 || membersInt == 1)
  11828. c = '\u028F';
  11829. reportAbuseInput = "";
  11830. canMute = false;
  11831. for (int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
  11832. if (RSInterface.interfaceCache[k9] == null || RSInterface.interfaceCache[k9].contentType != c)
  11833. continue;
  11834. openInterfaceID = RSInterface.interfaceCache[k9].parentID;
  11835.  
  11836. }
  11837. }
  11838. pktType = -1;
  11839. return true;
  11840.  
  11841. case 64:
  11842. anInt1268 = inStream.method427();
  11843. anInt1269 = inStream.method428();
  11844. for (int j = anInt1268; j < anInt1268 + 8; j++) {
  11845. for (int l9 = anInt1269; l9 < anInt1269 + 8; l9++)
  11846. if (groundArray[plane][j][l9] != null) {
  11847. groundArray[plane][j][l9] = null;
  11848. spawnGroundItem(j, l9);
  11849. }
  11850. }
  11851. for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179.reverseGetNext())
  11852. if (class30_sub1.anInt1297 >= anInt1268 && class30_sub1.anInt1297 < anInt1268 + 8 && class30_sub1.anInt1298 >= anInt1269 && class30_sub1.anInt1298 < anInt1269 + 8 && class30_sub1.anInt1295 == plane)
  11853. class30_sub1.anInt1294 = 0;
  11854. pktType = -1;
  11855. return true;
  11856.  
  11857. case 185:
  11858. int k = inStream.method436();
  11859. RSInterface.interfaceCache[k].anInt233 = 3;
  11860. if (myPlayer.desc == null)
  11861. 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];
  11862. else
  11863. RSInterface.interfaceCache[k].mediaID = (int) (0x12345678L + myPlayer.desc.interfaceType);
  11864. pktType = -1;
  11865. return true;
  11866.  
  11867. /* Clan chat packet */
  11868. case 217:
  11869. try {
  11870. clanUsername = inStream.readString();
  11871. clanMessage = TextInput.processText(inStream.readString());
  11872. clanTitle = inStream.readString();
  11873. channelRights = inStream.readUnsignedWord();
  11874. pushMessage(clanMessage, 16, clanUsername);
  11875. } catch (Exception e) {
  11876. e.printStackTrace();
  11877. }
  11878. pktType = -1;
  11879. return true;
  11880.  
  11881. case 107:
  11882. aBoolean1160 = false;
  11883. for (int l = 0; l < 5; l++)
  11884. aBooleanArray876[l] = false;
  11885. xpCounter = 0;
  11886. pktType = -1;
  11887. return true;
  11888.  
  11889. case 72:
  11890. int i1 = inStream.method434();
  11891. RSInterface class9 = RSInterface.interfaceCache[i1];
  11892. for (int k15 = 0; k15 < class9.inv.length; k15++) {
  11893. class9.inv[k15] = -1;
  11894. class9.inv[k15] = 0;
  11895. }
  11896. pktType = -1;
  11897. return true;
  11898.  
  11899. case 214:
  11900. ignoreCount = pktSize / 8;
  11901. for (int j1 = 0; j1 < ignoreCount; j1++)
  11902. ignoreListAsLongs[j1] = inStream.readQWord();
  11903. pktType = -1;
  11904. return true;
  11905.  
  11906. case 166:
  11907. aBoolean1160 = true;
  11908. anInt1098 = inStream.readUnsignedByte();
  11909. anInt1099 = inStream.readUnsignedByte();
  11910. anInt1100 = inStream.readUnsignedWord();
  11911. anInt1101 = inStream.readUnsignedByte();
  11912. anInt1102 = inStream.readUnsignedByte();
  11913. if (anInt1102 >= 100) {
  11914. xCameraPos = anInt1098 * 128 + 64;
  11915. yCameraPos = anInt1099 * 128 + 64;
  11916. zCameraPos = method42(plane, yCameraPos, xCameraPos) - anInt1100;
  11917. }
  11918. pktType = -1;
  11919. return true;
  11920.  
  11921. case 134:
  11922. int k1 = inStream.readUnsignedByte();
  11923. inStream.readUnsignedByte();
  11924. int i10 = inStream.method439();
  11925. int l15 = inStream.readUnsignedByte();
  11926. currentExp[k1] = i10;
  11927. currentStats[k1] = l15;
  11928. maxStats[k1] = 1;
  11929. for (int k20 = 0; k20 < 98; k20++)
  11930. if (i10 >= Skills.EXP_FOR_LEVEL[k20])
  11931. maxStats[k1] = k20 + 2;
  11932. pktType = -1;
  11933. return true;
  11934.  
  11935. case 71:
  11936. int l1 = inStream.readUnsignedWord();
  11937. int j10 = inStream.method426();
  11938. if (l1 == 65535)
  11939. l1 = -1;
  11940. tabInterfaceIDs[j10] = l1;
  11941. tabAreaAltered = true;
  11942. pktType = -1;
  11943. return true;
  11944.  
  11945. case 74:
  11946. int i2 = inStream.method434();
  11947. if (i2 == 65535)
  11948. i2 = -1;
  11949. if (i2 != currentSong && musicEnabled && !lowMem && prevSong == 0) {
  11950. nextSong = i2;
  11951. songChanging = true;
  11952. onDemandFetcher.method558(2, nextSong);
  11953. }
  11954. currentSong = i2;
  11955. pktType = -1;
  11956. return true;
  11957.  
  11958. case 121:
  11959. int j2 = inStream.method436();
  11960. int k10 = inStream.method435();
  11961. if (musicEnabled && !lowMem) {
  11962. nextSong = j2;
  11963. songChanging = false;
  11964. onDemandFetcher.method558(2, nextSong);
  11965. prevSong = k10;
  11966. }
  11967. pktType = -1;
  11968. return true;
  11969.  
  11970. case 109:
  11971. resetLogout();
  11972. pktType = -1;
  11973. return false;
  11974.  
  11975. case 70:
  11976. int k2 = inStream.readSignedWord();
  11977. int l10 = inStream.method437();
  11978. int i16 = inStream.method434();
  11979. RSInterface class9_5 = RSInterface.interfaceCache[i16];
  11980. class9_5.anInt263 = k2;
  11981. class9_5.anInt265 = l10;
  11982. pktType = -1;
  11983. return true;
  11984.  
  11985. case 73:
  11986. case 241:
  11987. int l2 = anInt1069;
  11988. int i11 = anInt1070;
  11989. if (pktType == 73) {
  11990. l2 = inStream.method435();
  11991. i11 = inStream.readUnsignedWord();
  11992. aBoolean1159 = false;
  11993. }
  11994. if (pktType == 241) {
  11995. i11 = inStream.method435();
  11996. inStream.initBitAccess();
  11997. for (int j16 = 0; j16 < 4; j16++) {
  11998. for (int l20 = 0; l20 < 13; l20++) {
  11999. for (int j23 = 0; j23 < 13; j23++) {
  12000. int i26 = inStream.readBits(1);
  12001. if (i26 == 1)
  12002. anIntArrayArrayArray1129[j16][l20][j23] = inStream.readBits(26);
  12003. else
  12004. anIntArrayArrayArray1129[j16][l20][j23] = -1;
  12005. }
  12006. }
  12007. }
  12008. inStream.finishBitAccess();
  12009. l2 = inStream.readUnsignedWord();
  12010. aBoolean1159 = true;
  12011. }
  12012. if (anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2) {
  12013. pktType = -1;
  12014. return true;
  12015. }
  12016. anInt1069 = l2;
  12017. anInt1070 = i11;
  12018. baseX = (anInt1069 - 6) * 8;
  12019. baseY = (anInt1070 - 6) * 8;
  12020. aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49) && anInt1070 / 8 == 48;
  12021. if (anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
  12022. aBoolean1141 = true;
  12023. loadingStage = 1;
  12024. aLong824 = System.currentTimeMillis();
  12025. aRSImageProducer_1165.initDrawingArea();
  12026. drawLoadingMessages(1, "Loading - please wait.", null);
  12027. aRSImageProducer_1165.drawGraphics(frameMode == ScreenMode.FIXED ? 4 : 0, super.graphics, frameMode == ScreenMode.FIXED ? 4 : 0);
  12028. if (pktType == 73) {
  12029. int k16 = 0;
  12030. for (int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++) {
  12031. for (int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
  12032. k16++;
  12033. }
  12034. aByteArrayArray1183 = new byte[k16][];
  12035. aByteArrayArray1247 = new byte[k16][];
  12036. anIntArray1234 = new int[k16];
  12037. anIntArray1235 = new int[k16];
  12038. anIntArray1236 = new int[k16];
  12039. k16 = 0;
  12040. for (int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++) {
  12041. for (int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++) {
  12042. anIntArray1234[k16] = (l23 << 8) + j26;
  12043. if (aBoolean1141 && (j26 == 49 || j26 == 149 || j26 == 147 || l23 == 50 || l23 == 49 && j26 == 47)) {
  12044. anIntArray1235[k16] = -1;
  12045. anIntArray1236[k16] = -1;
  12046. k16++;
  12047. } else {
  12048. int k28 = anIntArray1235[k16] = onDemandFetcher.method562(0, j26, l23);
  12049. if (k28 != -1)
  12050. onDemandFetcher.method558(3, k28);
  12051. int j30 = anIntArray1236[k16] = onDemandFetcher.method562(1, j26, l23);
  12052. if (j30 != -1)
  12053. onDemandFetcher.method558(3, j30);
  12054. k16++;
  12055. }
  12056. }
  12057. }
  12058. }
  12059. if (pktType == 241) {
  12060. int l16 = 0;
  12061. int ai[] = new int[676];
  12062. for (int i24 = 0; i24 < 4; i24++) {
  12063. for (int k26 = 0; k26 < 13; k26++) {
  12064. for (int l28 = 0; l28 < 13; l28++) {
  12065. int k30 = anIntArrayArrayArray1129[i24][k26][l28];
  12066. if (k30 != -1) {
  12067. int k31 = k30 >> 14 & 0x3ff;
  12068. int i32 = k30 >> 3 & 0x7ff;
  12069. int k32 = (k31 / 8 << 8) + i32 / 8;
  12070. for (int j33 = 0; j33 < l16; j33++) {
  12071. if (ai[j33] != k32)
  12072. continue;
  12073. k32 = -1;
  12074.  
  12075. }
  12076. if (k32 != -1)
  12077. ai[l16++] = k32;
  12078. }
  12079. }
  12080. }
  12081. }
  12082. aByteArrayArray1183 = new byte[l16][];
  12083. aByteArrayArray1247 = new byte[l16][];
  12084. anIntArray1234 = new int[l16];
  12085. anIntArray1235 = new int[l16];
  12086. anIntArray1236 = new int[l16];
  12087. for (int l26 = 0; l26 < l16; l26++) {
  12088. int i29 = anIntArray1234[l26] = ai[l26];
  12089. int l30 = i29 >> 8 & 0xff;
  12090. int l31 = i29 & 0xff;
  12091. int j32 = anIntArray1235[l26] = onDemandFetcher.method562(0, l31, l30);
  12092. if (j32 != -1)
  12093. onDemandFetcher.method558(3, j32);
  12094. int i33 = anIntArray1236[l26] = onDemandFetcher.method562(1, l31, l30);
  12095. if (i33 != -1)
  12096. onDemandFetcher.method558(3, i33);
  12097. }
  12098. }
  12099. int i17 = baseX - anInt1036;
  12100. int j21 = baseY - anInt1037;
  12101. anInt1036 = baseX;
  12102. anInt1037 = baseY;
  12103. for (int j24 = 0; j24 < 16384; j24++) {
  12104. Npc npc = npcArray[j24];
  12105. if (npc != null) {
  12106. for (int j29 = 0; j29 < 10; j29++) {
  12107. npc.smallX[j29] -= i17;
  12108. npc.smallY[j29] -= j21;
  12109. }
  12110. npc.x -= i17 * 128;
  12111. npc.y -= j21 * 128;
  12112. }
  12113. }
  12114. for (int i27 = 0; i27 < maxPlayers; i27++) {
  12115. Player player = playerArray[i27];
  12116. if (player != null) {
  12117. for (int i31 = 0; i31 < 10; i31++) {
  12118. player.smallX[i31] -= i17;
  12119. player.smallY[i31] -= j21;
  12120. }
  12121. player.x -= i17 * 128;
  12122. player.y -= j21 * 128;
  12123. }
  12124. }
  12125. aBoolean1080 = true;
  12126. byte byte1 = 0;
  12127. byte byte2 = 104;
  12128. byte byte3 = 1;
  12129. if (i17 < 0) {
  12130. byte1 = 103;
  12131. byte2 = -1;
  12132. byte3 = -1;
  12133. }
  12134. byte byte4 = 0;
  12135. byte byte5 = 104;
  12136. byte byte6 = 1;
  12137. if (j21 < 0) {
  12138. byte4 = 103;
  12139. byte5 = -1;
  12140. byte6 = -1;
  12141. }
  12142. for (int k33 = byte1; k33 != byte2; k33 += byte3) {
  12143. for (int l33 = byte4; l33 != byte5; l33 += byte6) {
  12144. int i34 = k33 + i17;
  12145. int j34 = l33 + j21;
  12146. for (int k34 = 0; k34 < 4; k34++)
  12147. if (i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
  12148. groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
  12149. else
  12150. groundArray[k34][k33][l33] = null;
  12151. }
  12152. }
  12153. for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179.reverseGetNext()) {
  12154. class30_sub1_1.anInt1297 -= i17;
  12155. class30_sub1_1.anInt1298 -= j21;
  12156. if (class30_sub1_1.anInt1297 < 0 || class30_sub1_1.anInt1298 < 0 || class30_sub1_1.anInt1297 >= 104 || class30_sub1_1.anInt1298 >= 104)
  12157. class30_sub1_1.unlink();
  12158. }
  12159. if (destX != 0) {
  12160. destX -= i17;
  12161. destY -= j21;
  12162. }
  12163. aBoolean1160 = false;
  12164. pktType = -1;
  12165. return true;
  12166.  
  12167. case 208:
  12168. int i3 = inStream.method437();
  12169. if (i3 >= 0) {
  12170. method60(i3);
  12171. walkableInterfaceMode = true;
  12172. } else
  12173. walkableInterfaceMode = false;
  12174. anInt1018 = i3;
  12175. pktType = -1;
  12176. return true;
  12177.  
  12178. case 99:
  12179. anInt1021 = inStream.readUnsignedByte();
  12180. pktType = -1;
  12181. return true;
  12182.  
  12183. case 75:
  12184. int j3 = inStream.method436();
  12185. int j11 = inStream.method436();
  12186. RSInterface.interfaceCache[j11].anInt233 = 2;
  12187. RSInterface.interfaceCache[j11].mediaID = j3;
  12188. pktType = -1;
  12189. return true;
  12190.  
  12191. case 114:
  12192. anInt1104 = inStream.method434() * 30;
  12193. pktType = -1;
  12194. return true;
  12195.  
  12196. case 60:
  12197. anInt1269 = inStream.readUnsignedByte();
  12198. anInt1268 = inStream.method427();
  12199. while (inStream.currentOffset < pktSize) {
  12200. int k3 = inStream.readUnsignedByte();
  12201. method137(inStream, k3);
  12202. }
  12203. pktType = -1;
  12204. return true;
  12205.  
  12206. case 35:
  12207. int l3 = inStream.readUnsignedByte();
  12208. int k11 = inStream.readUnsignedByte();
  12209. int j17 = inStream.readUnsignedByte();
  12210. int k21 = inStream.readUnsignedByte();
  12211. aBooleanArray876[l3] = true;
  12212. anIntArray873[l3] = k11;
  12213. anIntArray1203[l3] = j17;
  12214. anIntArray928[l3] = k21;
  12215. anIntArray1030[l3] = 0;
  12216. pktType = -1;
  12217. return true;
  12218.  
  12219. case 174:
  12220. int i4 = inStream.readUnsignedWord();
  12221. int l11 = inStream.readUnsignedByte();
  12222. int k17 = inStream.readUnsignedWord();
  12223. if (aBoolean848 && !lowMem && anInt1062 < 50) {
  12224. anIntArray1207[anInt1062] = i4;
  12225. anIntArray1241[anInt1062] = l11;
  12226. anIntArray1250[anInt1062] = k17 + Sounds.anIntArray326[i4];
  12227. anInt1062++;
  12228. }
  12229. pktType = -1;
  12230. return true;
  12231.  
  12232. case 104:
  12233. int j4 = inStream.method427();
  12234. int i12 = inStream.method426();
  12235. String s6 = inStream.readString();
  12236. if (j4 >= 1 && j4 <= 5) {
  12237. if (s6.equalsIgnoreCase("null"))
  12238. s6 = null;
  12239. atPlayerActions[j4 - 1] = s6;
  12240. atPlayerArray[j4 - 1] = i12 == 0;
  12241. }
  12242. pktType = -1;
  12243. return true;
  12244.  
  12245. case 78:
  12246. destX = 0;
  12247. pktType = -1;
  12248. return true;
  12249.  
  12250. case 253:
  12251. String s = inStream.readString();
  12252. if (s.endsWith(":tradereq:")) {
  12253. String s3 = s.substring(0, s.indexOf(":"));
  12254. long l17 = TextClass.longForName(s3);
  12255. boolean flag2 = false;
  12256. for (int j27 = 0; j27 < ignoreCount; j27++) {
  12257. if (ignoreListAsLongs[j27] != l17)
  12258. continue;
  12259. flag2 = true;
  12260.  
  12261. }
  12262. if (!flag2 && anInt1251 == 0)
  12263. pushMessage("wishes to trade with you.", 4, s3);
  12264.  
  12265. } else if (s.startsWith(":updateSettings:")) {
  12266. SettingHandler.updateText();
  12267. } else if (s.startsWith(":defaultSettings:")) {
  12268. SettingHandler.defaultSettings();
  12269. } else if (s.startsWith(":saveSettings:")) {
  12270. SettingHandler.save();
  12271. } else if (s.startsWith(":transparentTab:")) {
  12272. if (frameMode != ScreenMode.FIXED) {
  12273. transparentTabArea = !transparentTabArea;
  12274. } else {
  12275. pushMessage("Settings are not applicable in fixed mode!", 0, "");
  12276. }
  12277. } else if (s.startsWith(":transparentChatbox:")) {
  12278. if (frameMode != ScreenMode.FIXED) {
  12279. changeChatArea = !changeChatArea;
  12280. } else {
  12281. pushMessage("Settings are not applicable in fixed mode!", 0, "");
  12282. }
  12283. } else if (s.startsWith(":sideStones:")) {
  12284. if (frameMode != ScreenMode.FIXED) {
  12285. changeTabArea = !changeTabArea;
  12286. } else {
  12287. pushMessage("Settings are not applicable in fixed mode!", 0, "");
  12288. }
  12289. } else if (s.startsWith(":prestigeColorsTrue:")) {
  12290. Configuration.enablePrestigeColors = true;
  12291. SettingHandler.updateText();
  12292. } else if (s.startsWith(":prestigeColorsFalse:")) {
  12293. Configuration.enablePrestigeColors = false;
  12294. SettingHandler.updateText();
  12295.  
  12296. } else if (s.endsWith(":clan:")) {
  12297. String s4 = s.substring(0, s.indexOf(":"));
  12298. TextClass.longForName(s4);
  12299. pushMessage("Clan: ", 8, s4);
  12300. } else if (s.endsWith("#url#")) {
  12301. String link = s.substring(0, s.indexOf("#"));
  12302. pushMessage("Join us at: ", 9, link);
  12303. } else if (s.endsWith(":duelreq:")) {
  12304. String s4 = s.substring(0, s.indexOf(":"));
  12305. long l18 = TextClass.longForName(s4);
  12306. boolean flag3 = false;
  12307. for (int k27 = 0; k27 < ignoreCount; k27++) {
  12308. if (ignoreListAsLongs[k27] != l18)
  12309. continue;
  12310. flag3 = true;
  12311.  
  12312. }
  12313. if (!flag3 && anInt1251 == 0)
  12314. pushMessage("wishes to duel with you.", 8, s4);
  12315. } else if (s.endsWith(":chalreq:")) {
  12316. String s5 = s.substring(0, s.indexOf(":"));
  12317. long l19 = TextClass.longForName(s5);
  12318. boolean flag4 = false;
  12319. for (int l27 = 0; l27 < ignoreCount; l27++) {
  12320. if (ignoreListAsLongs[l27] != l19)
  12321. continue;
  12322. flag4 = true;
  12323.  
  12324. }
  12325. if (!flag4 && anInt1251 == 0) {
  12326. String s8 = s.substring(s.indexOf(":") + 1, s.length() - 9);
  12327. pushMessage(s8, 8, s5);
  12328. }
  12329. } else {
  12330. pushMessage(s, 0, "");
  12331. }
  12332. pktType = -1;
  12333. return true;
  12334.  
  12335. case 1:
  12336. for (int k4 = 0; k4 < playerArray.length; k4++)
  12337. if (playerArray[k4] != null)
  12338. playerArray[k4].anim = -1;
  12339. for (int j12 = 0; j12 < npcArray.length; j12++)
  12340. if (npcArray[j12] != null)
  12341. npcArray[j12].anim = -1;
  12342. pktType = -1;
  12343. return true;
  12344.  
  12345. case 50:
  12346. long l4 = inStream.readQWord();
  12347. int i18 = inStream.readUnsignedByte();
  12348. String s7 = TextClass.fixName(TextClass.nameForLong(l4));
  12349. for (int k24 = 0; k24 < friendsCount; k24++) {
  12350. if (l4 != friendsListAsLongs[k24])
  12351. continue;
  12352. if (friendsNodeIDs[k24] != i18) {
  12353. friendsNodeIDs[k24] = i18;
  12354. if (i18 >= 2) {
  12355. pushMessage(s7 + " has logged in.", 5, "");
  12356. }
  12357. if (i18 <= 1) {
  12358. pushMessage(s7 + " has logged out.", 5, "");
  12359. }
  12360. }
  12361. s7 = null;
  12362.  
  12363. }
  12364. if (s7 != null && friendsCount < 200) {
  12365. friendsListAsLongs[friendsCount] = l4;
  12366. friendsList[friendsCount] = s7;
  12367. friendsNodeIDs[friendsCount] = i18;
  12368. friendsCount++;
  12369. }
  12370. for (boolean flag6 = false; !flag6;) {
  12371. flag6 = true;
  12372. for (int k29 = 0; k29 < friendsCount - 1; k29++)
  12373. if (friendsNodeIDs[k29] != nodeID && friendsNodeIDs[k29 + 1] == nodeID || friendsNodeIDs[k29] == 0 && friendsNodeIDs[k29 + 1] != 0) {
  12374. int j31 = friendsNodeIDs[k29];
  12375. friendsNodeIDs[k29] = friendsNodeIDs[k29 + 1];
  12376. friendsNodeIDs[k29 + 1] = j31;
  12377. String s10 = friendsList[k29];
  12378. friendsList[k29] = friendsList[k29 + 1];
  12379. friendsList[k29 + 1] = s10;
  12380. long l32 = friendsListAsLongs[k29];
  12381. friendsListAsLongs[k29] = friendsListAsLongs[k29 + 1];
  12382. friendsListAsLongs[k29 + 1] = l32;
  12383. flag6 = false;
  12384. }
  12385. }
  12386. pktType = -1;
  12387. return true;
  12388.  
  12389. case 110:
  12390. if (tabID == 12) {
  12391. }
  12392. energy = inStream.readUnsignedByte();
  12393. pktType = -1;
  12394. return true;
  12395.  
  12396. case 254:
  12397. anInt855 = inStream.readUnsignedByte();
  12398. if (anInt855 == 1)
  12399. anInt1222 = inStream.readUnsignedWord();
  12400. if (anInt855 >= 2 && anInt855 <= 6) {
  12401. if (anInt855 == 2) {
  12402. anInt937 = 64;
  12403. anInt938 = 64;
  12404. }
  12405. if (anInt855 == 3) {
  12406. anInt937 = 0;
  12407. anInt938 = 64;
  12408. }
  12409. if (anInt855 == 4) {
  12410. anInt937 = 128;
  12411. anInt938 = 64;
  12412. }
  12413. if (anInt855 == 5) {
  12414. anInt937 = 64;
  12415. anInt938 = 0;
  12416. }
  12417. if (anInt855 == 6) {
  12418. anInt937 = 64;
  12419. anInt938 = 128;
  12420. }
  12421. anInt855 = 2;
  12422. anInt934 = inStream.readUnsignedWord();
  12423. anInt935 = inStream.readUnsignedWord();
  12424. anInt936 = inStream.readUnsignedByte();
  12425. }
  12426. if (anInt855 == 10)
  12427. anInt933 = inStream.readUnsignedWord();
  12428. pktType = -1;
  12429. return true;
  12430.  
  12431. case 248:
  12432. int i5 = inStream.method435();
  12433. int k12 = inStream.readUnsignedWord();
  12434. if (backDialogID != -1) {
  12435. backDialogID = -1;
  12436. inputTaken = true;
  12437. }
  12438. if (inputDialogState != 0) {
  12439. inputDialogState = 0;
  12440. inputTaken = true;
  12441. }
  12442. openInterfaceID = i5;
  12443. invOverlayInterfaceID = k12;
  12444. tabAreaAltered = true;
  12445. aBoolean1149 = false;
  12446. pktType = -1;
  12447. return true;
  12448.  
  12449. case 79:
  12450. int j5 = inStream.method434();
  12451. int l12 = inStream.method435();
  12452. RSInterface class9_3 = RSInterface.interfaceCache[j5];
  12453. if (class9_3 != null && class9_3.type == 0) {
  12454. if (l12 < 0)
  12455. l12 = 0;
  12456. if (l12 > class9_3.scrollMax - class9_3.height)
  12457. l12 = class9_3.scrollMax - class9_3.height;
  12458. class9_3.scrollPosition = l12;
  12459. }
  12460. pktType = -1;
  12461. return true;
  12462.  
  12463. case 68:
  12464. for (int k5 = 0; k5 < variousSettings.length; k5++)
  12465. if (variousSettings[k5] != anIntArray1045[k5]) {
  12466. variousSettings[k5] = anIntArray1045[k5];
  12467. updateConfigValues(k5);
  12468. }
  12469. pktType = -1;
  12470. return true;
  12471.  
  12472. case 173:
  12473. try {
  12474. pushKill(inStream.readString(), inStream.readString(), inStream.readUnsignedWord(), inStream.readUnsignedByte() == 1);
  12475. } catch (Exception e) {
  12476. e.printStackTrace();
  12477. }
  12478. pktType = -1;
  12479. return true;
  12480.  
  12481. case 175:
  12482. try {
  12483. pushFeed(inStream.readString(), inStream.readUnsignedWord(), inStream.readUnsignedWord());
  12484. } catch (Exception e) {
  12485. e.printStackTrace();
  12486. }
  12487. pktType = -1;
  12488. return true;
  12489.  
  12490. case 196:
  12491. final long usernameHash = inStream.readQWord();
  12492. int j18 = inStream.readDWord();
  12493. int rights = inStream.readUnsignedByte();
  12494. boolean flag5 = false;
  12495. if (rights <= 1) {
  12496. for (int l29 = 0; l29 < ignoreCount; l29++) {
  12497. if (ignoreListAsLongs[l29] != usernameHash)
  12498. continue;
  12499. flag5 = true;
  12500.  
  12501. }
  12502. }
  12503. if (!flag5 && anInt1251 == 0)
  12504. try {
  12505. anIntArray1240[anInt1169] = j18;
  12506. anInt1169 = (anInt1169 + 1) % 100;
  12507. String s9 = TextInput.method525(pktSize - 13, inStream);
  12508. if (Configuration.showNotifications) {
  12509. if (gameFrame != null) {
  12510. if (windowFlasher == null) {
  12511. windowFlasher = new WindowFlasher(gameFrame);
  12512. }
  12513. windowFlasher.flashWindow();
  12514. }
  12515. }
  12516. if (rights >= 1) {
  12517. pushMessage(s9, 7, "@cr" + rights + "@" + TextClass.fixName(TextClass.nameForLong(usernameHash)));
  12518. } else {
  12519. pushMessage(s9, 3, TextClass.fixName(TextClass.nameForLong(usernameHash)));
  12520. }
  12521. } catch (Exception exception1) {
  12522. Signlink.reporterror("cde1");
  12523. }
  12524. pktType = -1;
  12525. return true;
  12526.  
  12527. case 85:
  12528. anInt1269 = inStream.method427();
  12529. anInt1268 = inStream.method427();
  12530. pktType = -1;
  12531. return true;
  12532.  
  12533. case 24:
  12534. anInt1054 = inStream.method428();
  12535. if (anInt1054 == tabID) {
  12536. if (anInt1054 == 3)
  12537. tabID = 1;
  12538. else
  12539. tabID = 3;
  12540. }
  12541. pktType = -1;
  12542. return true;
  12543.  
  12544. case 246:
  12545. int i6 = inStream.method434();
  12546. int i13 = inStream.readUnsignedWord();
  12547. int k18 = inStream.readUnsignedWord();
  12548. if (k18 == 65535) {
  12549. RSInterface.interfaceCache[i6].anInt233 = 0;
  12550. pktType = -1;
  12551. return true;
  12552. } else {
  12553. ItemDef itemDef = ItemDef.forID(k18);
  12554. RSInterface.interfaceCache[i6].anInt233 = 4;
  12555. RSInterface.interfaceCache[i6].mediaID = k18;
  12556. RSInterface.interfaceCache[i6].modelRotation1 = itemDef.modelRotationY;
  12557. RSInterface.interfaceCache[i6].modelRotation2 = itemDef.modelRotationX;
  12558. RSInterface.interfaceCache[i6].modelZoom = (itemDef.modelZoom * 100) / i13;
  12559. pktType = -1;
  12560. return true;
  12561. }
  12562.  
  12563. case 171:
  12564. boolean flag1 = inStream.readUnsignedByte() == 1;
  12565. int j13 = inStream.readUnsignedWord();
  12566. RSInterface.interfaceCache[j13].isMouseoverTriggered = flag1;
  12567. pktType = -1;
  12568. return true;
  12569.  
  12570. case 142:
  12571. int j6 = inStream.method434();
  12572. method60(j6);
  12573. if (backDialogID != -1) {
  12574. backDialogID = -1;
  12575. inputTaken = true;
  12576. }
  12577. if (inputDialogState != 0) {
  12578. inputDialogState = 0;
  12579. inputTaken = true;
  12580. }
  12581. invOverlayInterfaceID = j6;
  12582. tabAreaAltered = true;
  12583. openInterfaceID = -1;
  12584. aBoolean1149 = false;
  12585. pktType = -1;
  12586. return true;
  12587.  
  12588. case 126:
  12589. try {
  12590. String text = inStream.readString();
  12591. int frame = inStream.method435();
  12592. if (text.startsWith("www.") || text.startsWith("http://www.")) {
  12593. openURL(text);
  12594. }
  12595. if (text.startsWith(":quicks:"))
  12596. clickedQuickPrayers = text.substring(8).equalsIgnoreCase("on") ? true : false;
  12597. if (text.startsWith(":prayer:"))
  12598. prayerBook = text.substring(8);
  12599. updateStrings(text, frame);
  12600. sendFrame126(text, frame);
  12601. if (frame >= 18144 && frame <= 18244) {
  12602. clanList[frame - 18144] = text;
  12603. }
  12604. if (frame == 8135) {
  12605. RSInterface.interfaceCache[8135].opacity = 108;
  12606. }
  12607. } catch (Exception e) {
  12608. }
  12609. pktType = -1;
  12610. return true;
  12611.  
  12612. case 124:
  12613. try {
  12614. int npc = inStream.readUnsignedByte();
  12615. int size = inStream.readUnsignedByte();
  12616. if (npc <= 0) {
  12617. npcDisplay = null;
  12618. pktType = -1;
  12619. return true;
  12620. }
  12621. npcDisplay = new Npc();
  12622. npcDisplay.desc = EntityDef.forID(npc, false);
  12623. npcDisplay.anInt1540 = npcDisplay.desc.aByte68;
  12624. npcDisplay.anInt1504 = npcDisplay.desc.anInt79;
  12625. npcDisplay.desc.anInt86 = size;
  12626. npcDisplay.desc.anInt91 = size;
  12627. npcDisplay.anInt1511 = npcDisplay.desc.standAnim;
  12628. } catch (Exception e) {
  12629. e.printStackTrace();
  12630. }
  12631. pktType = -1;
  12632. return true;
  12633.  
  12634. case 127:
  12635. try {
  12636. int skill = inStream.readSignedByte();
  12637. int exp = inStream.readDWord();
  12638. xpCounter = inStream.readDWord();
  12639. addXP(skill, exp);
  12640. } catch (Exception e) {
  12641. }
  12642. pktType = -1;
  12643. return true;
  12644.  
  12645. case 125:
  12646. try {
  12647. int skill = inStream.readSignedByte();
  12648. statsSkillGoal[skill][2] = inStream.readDWord();
  12649. statsSkillGoal[skill][0] = inStream.readDWord();
  12650. statsSkillGoal[skill][1] = inStream.readSignedByte();
  12651. } catch (Exception e) {
  12652. }
  12653. pktType = -1;
  12654. return true;
  12655.  
  12656. case 202:
  12657. String msg = inStream.readString();
  12658. int col = inStream.readDWord();
  12659. BannerManager.addBanner(msg, col);
  12660. pktType = -1;
  12661. return true;
  12662.  
  12663. case 201:
  12664. try {
  12665. playerIndex = inStream.readUnsignedWord();
  12666. } catch (Exception e) {
  12667. }
  12668. pktType = -1;
  12669. return true;
  12670.  
  12671. case 206:
  12672. publicChatMode = inStream.readUnsignedByte();
  12673. privateChatMode = inStream.readUnsignedByte();
  12674. tradeMode = inStream.readUnsignedByte();
  12675. inputTaken = true;
  12676. pktType = -1;
  12677. return true;
  12678.  
  12679. case 240:
  12680. if (tabID == 12) {
  12681. }
  12682. weight = inStream.readSignedWord();
  12683. pktType = -1;
  12684. return true;
  12685.  
  12686. case 8:
  12687. int k6 = inStream.method436();
  12688. int l13 = inStream.readUnsignedWord();
  12689. RSInterface.interfaceCache[k6].anInt233 = 1;
  12690. RSInterface.interfaceCache[k6].mediaID = l13;
  12691. pktType = -1;
  12692. return true;
  12693.  
  12694. case 122:
  12695. int intId = inStream.method436();
  12696. int r = inStream.readUnsignedByte();
  12697. int g = inStream.readUnsignedByte();
  12698. int b = inStream.readUnsignedByte();
  12699. if (RSInterface.interfaceCache[intId] != null) {
  12700. RSInterface.interfaceCache[intId].textColor = r << 16 | g << 8 | b;
  12701. }
  12702. pktType = -1;
  12703. return true;
  12704.  
  12705. case 53:
  12706. int i7 = inStream.readUnsignedWord();
  12707. RSInterface class9_1 = RSInterface.interfaceCache[i7];
  12708. int j19 = inStream.readUnsignedWord();
  12709. for (int j22 = 0; j22 < j19; j22++) {
  12710. int i25 = inStream.readUnsignedByte();
  12711. if (i25 == 255)
  12712. i25 = inStream.method440();
  12713. class9_1.inv[j22] = inStream.method436();
  12714. class9_1.invStackSizes[j22] = i25;
  12715. }
  12716. for (int j25 = j19; j25 < class9_1.inv.length; j25++) {
  12717. class9_1.inv[j25] = 0;
  12718. class9_1.invStackSizes[j25] = 0;
  12719. }
  12720. if (class9_1.contentType == 206) {
  12721. for (int tab = 0; tab < 10; tab++) {
  12722. int amount = inStream.readSignedByte() << 8 | inStream.readUnsignedWord();
  12723. tabAmounts[tab] = amount;
  12724. }
  12725.  
  12726. if (variousSettings[1012] == 1) {
  12727. RSInterface bank = RSInterface.interfaceCache[5382];
  12728. Arrays.fill(bankInvTemp, 0);
  12729. Arrays.fill(bankStackTemp, 0);
  12730. for (int slot = 0, bankSlot = 0; slot < bank.inv.length; slot++) {
  12731. if (bank.inv[slot] - 1 > 0) {
  12732. if (ItemDef.forID(bank.inv[slot] - 1).name.toLowerCase().contains(promptInput.toLowerCase())) {
  12733. bankInvTemp[bankSlot] = bank.inv[slot];
  12734. bankStackTemp[bankSlot++] = bank.invStackSizes[slot];
  12735. }
  12736. }
  12737. }
  12738. }
  12739. }
  12740. pktType = -1;
  12741. return true;
  12742.  
  12743. case 230:
  12744. int j7 = inStream.method435();
  12745. int j14 = inStream.readUnsignedWord();
  12746. int k19 = inStream.readUnsignedWord();
  12747. int k22 = inStream.method436();
  12748. RSInterface.interfaceCache[j14].modelRotation1 = k19;
  12749. RSInterface.interfaceCache[j14].modelRotation2 = k22;
  12750. RSInterface.interfaceCache[j14].modelZoom = j7;
  12751. pktType = -1;
  12752. return true;
  12753.  
  12754. case 221:
  12755. anInt900 = inStream.readUnsignedByte();
  12756. pktType = -1;
  12757. return true;
  12758.  
  12759. case 177:
  12760. aBoolean1160 = true;
  12761. anInt995 = inStream.readUnsignedByte();
  12762. anInt996 = inStream.readUnsignedByte();
  12763. anInt997 = inStream.readUnsignedWord();
  12764. anInt998 = inStream.readUnsignedByte();
  12765. anInt999 = inStream.readUnsignedByte();
  12766. if (anInt999 >= 100) {
  12767. int k7 = anInt995 * 128 + 64;
  12768. int k14 = anInt996 * 128 + 64;
  12769. int i20 = method42(plane, k14, k7) - anInt997;
  12770. int l22 = k7 - xCameraPos;
  12771. int k25 = i20 - zCameraPos;
  12772. int j28 = k14 - yCameraPos;
  12773. int i30 = (int) Math.sqrt(l22 * l22 + j28 * j28);
  12774. yCameraCurve = (int) (Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  12775. xCameraCurve = (int) (Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  12776. if (yCameraCurve < 128)
  12777. yCameraCurve = 128;
  12778. if (yCameraCurve > 383)
  12779. yCameraCurve = 383;
  12780. }
  12781. pktType = -1;
  12782. return true;
  12783.  
  12784. case 249:
  12785. anInt1046 = inStream.method426();
  12786. unknownInt10 = inStream.method436();
  12787. pktType = -1;
  12788. return true;
  12789.  
  12790. case 65:
  12791. updateNPCs(inStream, pktSize);
  12792. pktType = -1;
  12793. return true;
  12794.  
  12795. case 27:
  12796. messagePromptRaised = false;
  12797. inputDialogState = 1;
  12798. amountOrNameInput = "";
  12799. inputTaken = true;
  12800. pktType = -1;
  12801. return true;
  12802.  
  12803. case 187:
  12804. messagePromptRaised = false;
  12805. inputDialogState = 2;
  12806. amountOrNameInput = "";
  12807. inputTaken = true;
  12808. pktType = -1;
  12809. return true;
  12810.  
  12811. case 97:
  12812. int l7 = inStream.readUnsignedWord();
  12813. method60(l7);
  12814. if (invOverlayInterfaceID != -1) {
  12815. invOverlayInterfaceID = -1;
  12816. tabAreaAltered = true;
  12817. }
  12818. if (backDialogID != -1) {
  12819. backDialogID = -1;
  12820. inputTaken = true;
  12821. }
  12822. if (inputDialogState != 0) {
  12823. inputDialogState = 0;
  12824. inputTaken = true;
  12825. }
  12826. openInterfaceID = l7;
  12827. aBoolean1149 = false;
  12828. pktType = -1;
  12829. return true;
  12830.  
  12831. case 218:
  12832. int i8 = inStream.method438();
  12833. dialogID = i8;
  12834. inputTaken = true;
  12835. pktType = -1;
  12836. return true;
  12837.  
  12838. case 87:
  12839. int j8 = inStream.method434();
  12840. int l14 = inStream.method439();
  12841. anIntArray1045[j8] = l14;
  12842. if (variousSettings[j8] != l14) {
  12843. variousSettings[j8] = l14;
  12844. updateConfigValues(j8);
  12845. if (dialogID != -1)
  12846. inputTaken = true;
  12847. }
  12848. pktType = -1;
  12849. return true;
  12850.  
  12851. case 36:
  12852. int k8 = inStream.method434();
  12853. byte byte0 = inStream.readSignedByte();
  12854. anIntArray1045[k8] = byte0;
  12855. if (variousSettings[k8] != byte0) {
  12856. variousSettings[k8] = byte0;
  12857. updateConfigValues(k8);
  12858. if (dialogID != -1)
  12859. inputTaken = true;
  12860. }
  12861. pktType = -1;
  12862. return true;
  12863.  
  12864. case 61:
  12865. anInt1055 = inStream.readUnsignedByte();
  12866. pktType = -1;
  12867. return true;
  12868.  
  12869. case 200:
  12870. int l8 = inStream.readUnsignedWord();
  12871. int i15 = inStream.readSignedWord();
  12872. RSInterface class9_4 = RSInterface.interfaceCache[l8];
  12873. class9_4.anInt257 = i15;
  12874. pktType = -1;
  12875. return true;
  12876.  
  12877. case 219:
  12878. if (invOverlayInterfaceID != -1) {
  12879. invOverlayInterfaceID = -1;
  12880. tabAreaAltered = true;
  12881. }
  12882. if (backDialogID != -1) {
  12883. backDialogID = -1;
  12884. inputTaken = true;
  12885. }
  12886. if (inputDialogState != 0) {
  12887. inputDialogState = 0;
  12888. inputTaken = true;
  12889. }
  12890. openInterfaceID = -1;
  12891. aBoolean1149 = false;
  12892. pktType = -1;
  12893. return true;
  12894.  
  12895. case 34:
  12896. int i9 = inStream.readUnsignedWord();
  12897. RSInterface class9_2 = RSInterface.interfaceCache[i9];
  12898. while (inStream.currentOffset < pktSize) {
  12899. int j20 = inStream.method422();
  12900. int i23 = inStream.readUnsignedWord();
  12901. int l25 = inStream.readUnsignedByte();
  12902. if (l25 == 255)
  12903. l25 = inStream.readDWord();
  12904. if (j20 >= 0 && j20 < class9_2.inv.length) {
  12905. class9_2.inv[j20] = i23;
  12906. class9_2.invStackSizes[j20] = l25;
  12907. }
  12908. }
  12909. pktType = -1;
  12910. return true;
  12911.  
  12912. case 4:
  12913. case 44:
  12914. case 84:
  12915. case 101:
  12916. case 105:
  12917. case 117:
  12918. case 147:
  12919. case 151:
  12920. case 156:
  12921. case 160:
  12922. case 215:
  12923. method137(inStream, pktType);
  12924. pktType = -1;
  12925. return true;
  12926.  
  12927. case 106:
  12928. tabID = inStream.method427();
  12929. tabAreaAltered = true;
  12930. pktType = -1;
  12931. return true;
  12932.  
  12933. case 164:
  12934. int j9 = inStream.method434();
  12935. method60(j9);
  12936. if (invOverlayInterfaceID != -1) {
  12937. invOverlayInterfaceID = -1;
  12938. tabAreaAltered = true;
  12939. }
  12940. backDialogID = j9;
  12941. inputTaken = true;
  12942. openInterfaceID = -1;
  12943. aBoolean1149 = false;
  12944. pktType = -1;
  12945. return true;
  12946.  
  12947. }
  12948. Signlink.reporterror("T1 - " + pktType + "," + pktSize + " - " + anInt842 + "," + anInt843);
  12949. // resetLogout();
  12950. } catch (IOException _ex) {
  12951. dropClient();
  12952. } catch (Exception exception) {
  12953. exception.printStackTrace();
  12954. String s2 = "T2 - " + pktType + "," + anInt842 + "," + anInt843 + " - " + pktSize + "," + (baseX + myPlayer.smallX[0]) + "," + (baseY + myPlayer.smallY[0]) + " - ";
  12955. for (int j15 = 0; j15 < pktSize && j15 < 50; j15++)
  12956. s2 = s2 + inStream.buffer[j15] + ",";
  12957. Signlink.reporterror(s2);
  12958. // resetLogout();
  12959. }
  12960. pktType = -1;
  12961. return true;
  12962. }
  12963.  
  12964. public void openURL(String url) {
  12965. try {
  12966. Desktop.getDesktop().browse(new URI(url));
  12967. } catch (Exception e) {
  12968. }
  12969. }
  12970.  
  12971. private void replyToPM() {
  12972. String name = null;
  12973. for (int k = 0; k < 100; k++) {
  12974. if (chatMessages[k] == null) {
  12975. continue;
  12976. }
  12977. int l = chatTypes[k];
  12978. if ((l == 3) || (l == 7)) {
  12979. name = chatNames[k];
  12980. break;
  12981. }
  12982. }
  12983. if (name == null) {
  12984. pushMessage("You haven't received any messages to which you can reply.", 0, "");
  12985. return;
  12986. }
  12987. if (name != null) {
  12988. if (name.indexOf("@") == 0) {
  12989. name = name.substring(5);
  12990. }
  12991. }
  12992. long nameAsLong = TextClass.longForName(name.trim());
  12993. int k3 = -1;
  12994. for (int i4 = 0; i4 < friendsCount; i4++) {
  12995. if (friendsListAsLongs[i4] != nameAsLong) {
  12996. continue;
  12997. }
  12998. k3 = i4;
  12999. break;
  13000. }
  13001. if (k3 != -1) {
  13002. if (friendsNodeIDs[k3] > 0) {
  13003. inputTaken = true;
  13004. inputDialogState = 0;
  13005. messagePromptRaised = true;
  13006. promptInput = "";
  13007. friendsListAction = 3;
  13008. aLong953 = friendsListAsLongs[k3];
  13009. aString1121 = "Enter message to send to " + friendsList[k3];
  13010. } else {
  13011. pushMessage("That player is currently offline.", 0, "");
  13012. }
  13013. }
  13014. }
  13015.  
  13016. private void method146() {
  13017. anInt1265++;
  13018. method47(true);
  13019. method26(true);
  13020. method47(false);
  13021. method26(false);
  13022. method55();
  13023. method104();
  13024. if (!aBoolean1160) {
  13025. int i = anInt1184;
  13026. if (anInt984 / 256 > i) {
  13027. i = anInt984 / 256;
  13028. }
  13029. if (aBooleanArray876[4] && anIntArray1203[4] + 128 > i) {
  13030. i = anIntArray1203[4] + 128;
  13031. }
  13032. int calc = minimapInt1 + anInt896 & 0x7ff;
  13033. 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);
  13034. }
  13035. int j;
  13036. if (!aBoolean1160)
  13037. j = method120();
  13038. else
  13039. j = method121();
  13040. int l = xCameraPos;
  13041. int i1 = zCameraPos;
  13042. int j1 = yCameraPos;
  13043. int k1 = yCameraCurve;
  13044. int l1 = xCameraCurve;
  13045. int k2 = Rasterizer.anInt1481;
  13046. for (int i2 = 0; i2 < 5; i2++)
  13047. if (aBooleanArray876[i2]) {
  13048. 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]);
  13049. if (i2 == 0)
  13050. xCameraPos += j2;
  13051. if (i2 == 1)
  13052. zCameraPos += j2;
  13053. if (i2 == 2)
  13054. yCameraPos += j2;
  13055. if (i2 == 3)
  13056. xCameraCurve = xCameraCurve + j2 & 0x7ff;
  13057. if (i2 == 4) {
  13058. yCameraCurve += j2;
  13059. if (yCameraCurve < 128)
  13060. yCameraCurve = 128;
  13061. if (yCameraCurve > 383)
  13062. yCameraCurve = 383;
  13063. }
  13064. }
  13065. Model.aBoolean1684 = true;
  13066. Model.anInt1687 = 0;
  13067. Model.anInt1685 = super.mouseX - (frameMode == ScreenMode.FIXED ? 4 : 0);
  13068. Model.anInt1686 = super.mouseY - (frameMode == ScreenMode.FIXED ? 4 : 0);
  13069. DrawingArea.setAllPixelsToZero();
  13070. if (Configuration.enableDistanceFog) {
  13071. DrawingArea.drawPixels(frameMode == ScreenMode.FIXED ? 334 : frameHeight, 0, 0, ColorUtility.fadingToColor, frameMode == ScreenMode.FIXED ? 512 : frameWidth);
  13072. }
  13073. worldController.method313(xCameraPos, yCameraPos, xCameraCurve, zCameraPos, j, yCameraCurve);
  13074. worldController.clearObj5Cache();
  13075. if (Configuration.enableDistanceFog) {
  13076. if (!ColorUtility.switchColor) {
  13077. if (fogHandler.fogColor != ColorUtility.fadingToColor) {
  13078. ColorUtility.switchColor = true;
  13079. }
  13080. }
  13081. if (ColorUtility.switchColor) {
  13082. ColorUtility.fadeStep++;
  13083. if (ColorUtility.fadeStep >= 100) {
  13084. ColorUtility.fadeStep = 1;
  13085. ColorUtility.switchColor = false;
  13086. fogHandler.fogColor = ColorUtility.fadingToColor;
  13087. } else {
  13088. fogHandler.fogColor = ColorUtility.fadeColors(new Color(fogHandler.fogColor), new Color(ColorUtility.fadingToColor), ColorUtility.fadeStep);
  13089. }
  13090. }
  13091. fogHandler.renderFog(aRSImageProducer_1165.canvasRaster, aRSImageProducer_1165.depthBuffer);
  13092. }
  13093. if (inMaze(baseX + (myPlayer.x - 6 >> 7), baseY + (myPlayer.y - 6 >> 7), plane) && filterGrayScale) {
  13094. DrawingArea.filterGrayscale(0, 0, frameMode == ScreenMode.FIXED ? 512 : frameWidth, frameMode == ScreenMode.FIXED ? 334 : frameHeight, 1);
  13095. }
  13096. updateEntities();
  13097. drawHeadIcon();
  13098. method37(k2);
  13099.  
  13100. if (Configuration.showKillFeed) {
  13101. displayKillFeed();
  13102. }
  13103. if (frameMode != ScreenMode.FIXED) {
  13104. drawChatArea();
  13105. drawMinimap();
  13106. drawTabArea();
  13107. }
  13108. draw3dScreen();
  13109. if (console.openConsole) {
  13110. console.drawConsole(frameMode == ScreenMode.FIXED ? super.myWidth : frameWidth, 334);
  13111. }
  13112. aRSImageProducer_1165.drawGraphics(frameMode == ScreenMode.FIXED ? 4 : 0, super.graphics, frameMode == ScreenMode.FIXED ? 4 : 0);
  13113. xCameraPos = l;
  13114. zCameraPos = i1;
  13115. yCameraPos = j1;
  13116. yCameraCurve = k1;
  13117. xCameraCurve = l1;
  13118. }
  13119.  
  13120. private void processMinimapActions() {
  13121. final boolean fixed = frameMode == ScreenMode.FIXED;
  13122. 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) {
  13123. menuActionName[1] = "Face North";
  13124. menuActionID[1] = 696;
  13125. menuActionRow = 2;
  13126. }
  13127. if (changeChatArea) {
  13128. if (super.mouseX >= 256 && super.mouseX <= 264 && super.mouseY >= frameHeight - 170 - extendChatArea && super.mouseY <= frameHeight - 160 - extendChatArea) {
  13129. menuActionName[1] = "Drag to Extend Chat";
  13130. menuActionID[1] = 701;
  13131. menuActionRow = 2;
  13132. }
  13133. }
  13134. 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) {
  13135. menuActionName[1] = "Logout";
  13136. menuActionID[1] = 1004;
  13137. menuActionRow = 2;
  13138. }
  13139. if (Configuration.enableStatusOrbs) {
  13140. if (counterHover) {
  13141. menuActionName[3] = counterOn ? "Toggle XP Display" : "Toggle XP Display";
  13142. menuActionID[3] = 474;
  13143. menuActionName[2] = "Reset XP Total";
  13144. menuActionID[2] = 475;
  13145. menuActionName[1] = "XP Settings";
  13146. menuActionID[1] = 476;
  13147. menuActionRow = 4;
  13148. }
  13149. if (worldHover) {
  13150. menuActionName[1] = "Teleports";
  13151. menuActionID[1] = 850;
  13152. menuActionRow = 2;
  13153. }
  13154. if (pouchHover & Configuration.enablePouch) {
  13155. menuActionName[3] = "Withdraw coins";
  13156. menuActionID[3] = 713;
  13157. menuActionName[2] = "Payment plans";
  13158. menuActionID[2] = 715;
  13159. menuActionName[1] = "Examine pouch";
  13160. menuActionID[1] = 714;
  13161. menuActionRow = 4;
  13162. }
  13163. if (prayHover) {
  13164. menuActionName[2] = prayClicked ? "Turn quick-prayers off" : "Turn quick-prayers on";
  13165. menuActionID[2] = 1500;
  13166. menuActionRow = 2;
  13167. menuActionName[1] = "Select quick-prayers";
  13168. menuActionID[1] = 1506;
  13169. menuActionRow = 3;
  13170. }
  13171. if (runHover) {
  13172. menuActionName[1] = variousSettings[173] == 0 ? "Turn run mode on" : "Turn run mode off";
  13173. menuActionID[1] = 1050;
  13174. menuActionRow = 2;
  13175. }
  13176. }
  13177. }
  13178.  
  13179. public int specialAttack;
  13180.  
  13181. public void drawSpecialOrb() {
  13182. if (specialHover) {
  13183. orbComponents2[2].drawSprite(frameMode == ScreenMode.FIXED ? 153 : frameWidth - 63, frameMode == ScreenMode.FIXED ? 131 : 150);
  13184. } else {
  13185. orbComponents2[0].drawSprite(frameMode == ScreenMode.FIXED ? 154 : frameWidth - 62, frameMode == ScreenMode.FIXED ? 132 : 151);
  13186. }
  13187. orbComponents[10].myHeight = (int) (specialAttack * 27 / 100.0);
  13188. orbComponents[10].drawSprite(frameMode == ScreenMode.FIXED ? 157 : frameWidth - 58, frameMode == ScreenMode.FIXED ? 135 : 155);
  13189. orbComponents[6].drawSprite(frameMode == ScreenMode.FIXED ? 157 : frameWidth - 58, frameMode == ScreenMode.FIXED ? 135 : 155);
  13190. orbComponents2[1].drawSprite(frameMode == ScreenMode.FIXED ? 162 : frameWidth - 53, frameMode == ScreenMode.FIXED ? 140 : 160);
  13191. smallText.method382(getOrbTextColor(specialAttack), frameMode == ScreenMode.FIXED ? 198 : frameWidth - 19, Integer.toString(specialAttack), frameMode == ScreenMode.FIXED ? 158 : 177, true);
  13192. }
  13193.  
  13194. public boolean isPoisoned, clickedQuickPrayers;
  13195.  
  13196. private void loadAllOrbs(int xOffset) {
  13197. 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 };
  13198. if (!Configuration.enableStatusOrbs) {
  13199. return;
  13200. }
  13201.  
  13202. if (frameMode != ScreenMode.FIXED) {
  13203. xOffset += 5;
  13204. }
  13205.  
  13206. if (Configuration.enablePouch) {
  13207. DrawingArea.fillCircle((frameMode == ScreenMode.FIXED ? 179 : frameWidth - 49), (frameMode == ScreenMode.FIXED ? 142 : 168), 15, 0x6E6D6D);
  13208. cacheSprite[pouchHover ? 429 : 430].drawSprite((frameMode == ScreenMode.FIXED ? 162 : frameWidth - 65), (frameMode == ScreenMode.FIXED ? 127 : 153));
  13209. String amount = RSInterface.interfaceCache[8135].disabledMessage;
  13210. long getAmount = Long.parseLong(amount);
  13211. smallText.method382(getMoneyOrbColor(getAmount), (frameMode == ScreenMode.FIXED ? 205 : frameWidth - 22), formatCoins(getAmount) + "", (frameMode == ScreenMode.FIXED ? 153 : 178), true);
  13212. cacheSprite[428].drawSprite((frameMode == ScreenMode.FIXED ? 170 : frameWidth - 57), (frameMode == ScreenMode.FIXED ? 134 : 160));
  13213. }
  13214.  
  13215. 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 };
  13216. int currentHP = extractInterfaceValues(RSInterface.interfaceCache[4016], 0);
  13217. int currentEnergy = extractInterfaceValues(RSInterface.interfaceCache[19177], 0);
  13218. for (int i = 0; i < 3; i++) {
  13219. int currentLevel = extractInterfaceValues(RSInterface.interfaceCache[currentInterface[i]], 0), maxLevel = extractInterfaceValues(RSInterface.interfaceCache[maximumInterface[i]], 0), level = (int) ((currentLevel / (double) maxLevel) * 100D);
  13220. orbComponents[spriteID[i]].drawSprite(orbX[i] + xOffset, orbY[i]);
  13221. orbComponents[coloredOrbSprite[i]].drawSprite(coloredOrbX[i] + xOffset, coloredOrbY[i]);
  13222. double percent = (i == 2 ? currentEnergy / 100D : level / 100D);
  13223. int depleteFill = 26 - (int) (26 * percent);
  13224. orbComponents[6].myHeight = depleteFill;
  13225. try {
  13226. orbComponents[6].drawSprite(coloredOrbX[i] + xOffset, coloredOrbY[i]);
  13227. } catch (Exception e) {
  13228. }
  13229. if (level < 25) {
  13230. orbComponents[orbSprite[i]].drawSprite1(orbIconX[i] + xOffset, orbIconY[i], 125 + (int) (125 * Math.sin(loopCycle / 7.0)));
  13231. } else {
  13232. orbComponents[orbSprite[i]].drawSprite(orbIconX[i] + xOffset, orbIconY[i]);
  13233. }
  13234. smallText.method382(getOrbTextColor(i == 2 ? currentEnergy : level), orbTextX[i] + xOffset, "" + (i == 2 ? currentEnergy : i == 0 && Configuration.enable10xDamage ? currentHP * 10 : currentLevel), orbTextY[i], true);
  13235. }
  13236. if (frameMode == ScreenMode.FIXED) {
  13237. orbComponents2[worldHover ? 6 : 5].drawSprite(202, 20);
  13238. } else {
  13239. orbComponents2[worldHover ? 4 : 3].drawSprite(frameWidth - 135, 152);
  13240. }
  13241. }
  13242.  
  13243. public int digits = 0;
  13244.  
  13245. XPGain mainGain = null;
  13246. List<Sprite> gainSprites = new ArrayList<>();
  13247. private boolean walkableInterfaceMode = false;
  13248.  
  13249. private void drawCounterOnScreen() {
  13250. if (!Configuration.enableStatusOrbs) {
  13251. return;
  13252. }
  13253. int x = frameMode == ScreenMode.FIXED ? 500 : frameWidth - 260;
  13254. int y = walkableInterfaceMode ? 46 : 10;
  13255. digits = xpCounter == 0 ? 1 : 1 + (int) Math.floor(Math.log10(xpCounter));
  13256. int i = smallText.getTextWidth(Integer.toString(xpCounter)) - smallText.getTextWidth(Integer.toString(xpCounter)) / 2;
  13257. smallText.method382(0xffffff, x - 38 - i - digits - 12, "Total:", y + 50, true);
  13258. if (xpCounter >= 0) {
  13259. smallText.method382(0xffffff, x + 1 - i, "+" + NumberFormat.getIntegerInstance().format(xpCounter), y + 50, true);
  13260. }
  13261. int currentIndex = 0;
  13262. int offsetY = 0;
  13263. int stop = 40;
  13264. if (!gains.isEmpty()) {
  13265. Iterator<XPGain> gained = gains.iterator();
  13266. if ((gains.size() > 1)) {
  13267. if (mainGain == null) {
  13268. XPGain toGain = null;
  13269. while (gained.hasNext()) {
  13270. XPGain gain = gained.next();
  13271.  
  13272. if (toGain == null) {
  13273. toGain = new XPGain(gain.skill, 0);
  13274. }
  13275.  
  13276. Sprite sprite = cacheSprite[gain.getSkill() + 324];
  13277.  
  13278. if (!gainSprites.contains(sprite)) {
  13279. gainSprites.add(sprite);
  13280. }
  13281.  
  13282. toGain.xp += gain.getXP();
  13283. currentIndex++;
  13284. }
  13285.  
  13286. Collections.reverse(gainSprites);
  13287. mainGain = toGain;
  13288. }
  13289.  
  13290. if (mainGain == null) {
  13291. return;
  13292. }
  13293.  
  13294. if (mainGain.getY() < stop) {
  13295. if (mainGain.getY() <= 10) {
  13296. mainGain.increaseAlpha();
  13297. }
  13298. if (mainGain.getY() >= stop - 10) {
  13299. mainGain.decreaseAlpha();
  13300. }
  13301. mainGain.increaseY();
  13302. } else if (mainGain.getY() >= stop) {
  13303. mainGain = null;
  13304. gains.clear();
  13305. gainSprites.clear();
  13306. }
  13307.  
  13308. if (mainGain == null) {
  13309. return;
  13310. }
  13311.  
  13312. if (mainGain.getY() < stop) {
  13313. if (variousSettings[1030] == 0) {
  13314. for (int ii = 0; ii < gainSprites.size(); ii++) {
  13315. Sprite sprite = gainSprites.get(ii);
  13316. sprite.drawSprite1(x - ii * 25 - 75 - sprite.myWidth / 2, mainGain.getY() - 5 + offsetY + y + 65 - sprite.myHeight / 2, mainGain.getAlpha());
  13317. }
  13318. newSmallFont.drawBasicString("<trans=" + (mainGain.getAlpha()) + ">+" + String.format("%,d", mainGain.getXP()) + "xp", x - 55, mainGain.getY() + offsetY + y + 65, 0xFFFFFF, 0);
  13319. } else if (variousSettings[1030] == 1) {
  13320. for (int ii = 0; ii < gainSprites.size(); ii++) {
  13321. Sprite sprite = gainSprites.get(ii);
  13322. sprite.drawSprite1((-mainGain.getY() + frameWidth - 280) - ii * 25 - (sprite.myWidth / 2), 80 - (sprite.myHeight / 2) + currentIndex * 28, mainGain.getAlpha());
  13323. }
  13324. newSmallFont.drawBasicString("<trans=" + (mainGain.getAlpha()) + ">+" + String.format("%,d", mainGain.getXP()) + "xp", -mainGain.getY() + frameWidth - 260, 85 + (walkableInterfaceMode ? 36 : 0) + currentIndex * 28, 0xFFFFFF, 0);
  13325. } else if (variousSettings[1030] == 2) {
  13326. for (int ii = 0; ii < gainSprites.size(); ii++) {
  13327. Sprite sprite = gainSprites.get(ii);
  13328. sprite.drawSprite1(x - ii * 25 - 75 - sprite.myWidth / 2, mainGain.getY() - 5 + offsetY + y + 65 - sprite.myHeight / 2, mainGain.getAlpha());
  13329. }
  13330. newSmallFont.drawBasicString("<trans=" + (mainGain.getAlpha()) + ">+" + String.format("%,d", mainGain.getXP()) + "xp", -mainGain.getY() + frameWidth - 260, mainGain.getY() + offsetY + y + 65, 0xFFFFFF, 0);
  13331. }
  13332. }
  13333. } else {
  13334. while (gained.hasNext()) {
  13335. XPGain gain = gained.next();
  13336. if (gain.getY() < stop) {
  13337. if (gain.getY() <= 10) {
  13338. gain.increaseAlpha();
  13339. }
  13340. if (gain.getY() >= stop - 10) {
  13341. gain.decreaseAlpha();
  13342. }
  13343. gain.increaseY();
  13344. } else if (gain.getY() >= stop) {
  13345. gained.remove();
  13346. }
  13347. Sprite sprite = cacheSprite[gain.getSkill() + 324];
  13348. if (gain.getY() < stop) {
  13349. if (variousSettings[1030] == 0) {
  13350. sprite.drawSprite1(x - 75 - sprite.myWidth / 2, gain.getY() - 5 + offsetY + y + 65 - sprite.myHeight / 2, gain.getAlpha());
  13351. newSmallFont.drawBasicString("<trans=" + (gain.getAlpha()) + ">+" + String.format("%,d", gain.getXP()) + "xp", x - 55, gain.getY() + offsetY + y + 65, 0xFFFFFF, 0);
  13352. } else if (variousSettings[1030] == 1) {
  13353. sprite.drawSprite1((-gain.getY() + frameWidth - 280) - (sprite.myWidth / 2), 80 - (sprite.myHeight / 2) + currentIndex * 28, gain.getAlpha());
  13354. newSmallFont.drawBasicString("<trans=" + (gain.getAlpha()) + ">+" + String.format("%,d", gain.getXP()) + "xp", -gain.getY() + frameWidth - 260, 85 + (walkableInterfaceMode ? 36 : 0) + currentIndex * 28, 0xFFFFFF, 0);
  13355. } else if (variousSettings[1030] == 2) {
  13356. sprite.drawSprite1(x - 75 - sprite.myWidth / 2, gain.getY() - 5 + offsetY + y + 65 - sprite.myHeight / 2, gain.getAlpha());
  13357. newSmallFont.drawBasicString("<trans=" + (gain.getAlpha()) + ">+" + String.format("%,d", gain.getXP()) + "xp", -gain.getY() + frameWidth - 260, gain.getY() + offsetY + y + 65, 0xFFFFFF, 0);
  13358. }
  13359. }
  13360. currentIndex++;
  13361. }
  13362. }
  13363. }
  13364. }
  13365.  
  13366. public int xpCounter;
  13367.  
  13368. private boolean runHover, prayHover, hpHover, prayClicked, counterOn, sumHover, sumActive, counterHover, specialHover, worldHover, pouchHover;
  13369.  
  13370. public int getOrbTextColor(int statusInt) {
  13371. if (statusInt >= 75 && statusInt <= Integer.MAX_VALUE)
  13372. return 0x00FF00;
  13373. else if (statusInt >= 50 && statusInt <= 74)
  13374. return 0xFFFF00;
  13375. else if (statusInt >= 25 && statusInt <= 49)
  13376. return 0xFF981F;
  13377. else
  13378. return 0xFF0000;
  13379. }
  13380.  
  13381. public int getOrbFill(int statusInt) {
  13382. if (statusInt <= Integer.MAX_VALUE && statusInt >= 97)
  13383. return 0;
  13384. else if (statusInt <= 96 && statusInt >= 93)
  13385. return 1;
  13386. else if (statusInt <= 92 && statusInt >= 89)
  13387. return 2;
  13388. else if (statusInt <= 88 && statusInt >= 85)
  13389. return 3;
  13390. else if (statusInt <= 84 && statusInt >= 81)
  13391. return 4;
  13392. else if (statusInt <= 80 && statusInt >= 77)
  13393. return 5;
  13394. else if (statusInt <= 76 && statusInt >= 73)
  13395. return 6;
  13396. else if (statusInt <= 72 && statusInt >= 69)
  13397. return 7;
  13398. else if (statusInt <= 68 && statusInt >= 65)
  13399. return 8;
  13400. else if (statusInt <= 64 && statusInt >= 61)
  13401. return 9;
  13402. else if (statusInt <= 60 && statusInt >= 57)
  13403. return 10;
  13404. else if (statusInt <= 56 && statusInt >= 53)
  13405. return 11;
  13406. else if (statusInt <= 52 && statusInt >= 49)
  13407. return 12;
  13408. else if (statusInt <= 48 && statusInt >= 45)
  13409. return 13;
  13410. else if (statusInt <= 44 && statusInt >= 41)
  13411. return 14;
  13412. else if (statusInt <= 40 && statusInt >= 37)
  13413. return 15;
  13414. else if (statusInt <= 36 && statusInt >= 33)
  13415. return 16;
  13416. else if (statusInt <= 32 && statusInt >= 29)
  13417. return 17;
  13418. else if (statusInt <= 28 && statusInt >= 25)
  13419. return 18;
  13420. else if (statusInt <= 24 && statusInt >= 21)
  13421. return 19;
  13422. else if (statusInt <= 20 && statusInt >= 17)
  13423. return 20;
  13424. else if (statusInt <= 16 && statusInt >= 13)
  13425. return 21;
  13426. else if (statusInt <= 12 && statusInt >= 9)
  13427. return 22;
  13428. else if (statusInt <= 8 && statusInt >= 7)
  13429. return 23;
  13430. else if (statusInt <= 6 && statusInt >= 5)
  13431. return 24;
  13432. else if (statusInt <= 4 && statusInt >= 3)
  13433. return 25;
  13434. else if (statusInt <= 2 && statusInt >= 1)
  13435. return 26;
  13436. else if (statusInt <= 0)
  13437. return 27;
  13438. return 0;
  13439. }
  13440.  
  13441. public void clearTopInterfaces() {
  13442. stream.createFrame(130);
  13443. if (invOverlayInterfaceID != -1) {
  13444. invOverlayInterfaceID = -1;
  13445. aBoolean1149 = false;
  13446. tabAreaAltered = true;
  13447. }
  13448. if (backDialogID != -1) {
  13449. backDialogID = -1;
  13450. inputTaken = true;
  13451. aBoolean1149 = false;
  13452. }
  13453. openInterfaceID = -1;
  13454. fullscreenInterfaceID = -1;
  13455. }
  13456.  
  13457. public Client() {
  13458. ClientConstants.worldSelected = 1;
  13459. xpCounter = 0;
  13460. fullscreenInterfaceID = -1;
  13461. chatRights = new int[500];
  13462. chatTypeView = 0;
  13463. clanChatMode = 0;
  13464. cButtonHPos = -1;
  13465. cButtonCPos = 0;
  13466. chatRights = new int[500];
  13467. chatColors = new String[500];
  13468. chatTitles = new String[500];
  13469. clanTitles = new String[500];
  13470. server = ClientConstants.SERVER_IPS[ClientConstants.worldSelected - 1];
  13471. anIntArrayArray825 = new int[104][104];
  13472. friendsNodeIDs = new int[200];
  13473. groundArray = new NodeList[4][104][104];
  13474. aBoolean831 = false;
  13475. aStream_834 = new Stream(new byte[5000]);
  13476. npcArray = new Npc[16384];
  13477. npcIndices = new int[16384];
  13478. anIntArray840 = new int[1000];
  13479. aStream_847 = Stream.create();
  13480. aBoolean848 = true;
  13481. openInterfaceID = -1;
  13482. currentExp = new int[Skills.SKILLS_COUNT];
  13483. aBoolean872 = false;
  13484. anIntArray873 = new int[5];
  13485. aBooleanArray876 = new boolean[5];
  13486. drawFlames = false;
  13487. reportAbuseInput = "";
  13488. unknownInt10 = -1;
  13489. menuOpen = false;
  13490. inputString = "";
  13491. maxPlayers = 2048;
  13492. myPlayerIndex = 2047;
  13493. playerArray = new Player[maxPlayers];
  13494. playerIndices = new int[maxPlayers];
  13495. anIntArray894 = new int[maxPlayers];
  13496. aStreamArray895s = new Stream[maxPlayers];
  13497. anInt897 = 1;
  13498. anIntArrayArray901 = new int[104][104];
  13499. aByteArray912 = new byte[16384];
  13500. currentStats = new int[Skills.SKILLS_COUNT];
  13501. ignoreListAsLongs = new long[100];
  13502. loadingError = false;
  13503. anIntArray928 = new int[5];
  13504. anIntArrayArray929 = new int[104][104];
  13505. chatTypes = new int[500];
  13506. chatNames = new String[500];
  13507. chatMessages = new String[500];
  13508. sideIcons = new Sprite[17];
  13509. aBoolean954 = true;
  13510. friendsListAsLongs = new long[200];
  13511. currentSong = -1;
  13512. drawingFlames = false;
  13513. spriteDrawX = -1;
  13514. spriteDrawY = -1;
  13515. anIntArray968 = new int[33];
  13516. anIntArray969 = new int[256];
  13517. decompressors = new Decompressor[6];
  13518. variousSettings = new int[2000];
  13519. aBoolean972 = false;
  13520. anInt975 = 50;
  13521. anIntArray976 = new int[anInt975];
  13522. anIntArray977 = new int[anInt975];
  13523. anIntArray978 = new int[anInt975];
  13524. anIntArray979 = new int[anInt975];
  13525. anIntArray980 = new int[anInt975];
  13526. anIntArray981 = new int[anInt975];
  13527. anIntArray982 = new int[anInt975];
  13528. aStringArray983 = new String[anInt975];
  13529. anInt985 = -1;
  13530. hitMarks = new Sprite[20];
  13531. hitMark = new Sprite[20];
  13532. hitIcon = new Sprite[20];
  13533. anIntArray990 = new int[5];
  13534. aBoolean994 = false;
  13535. amountOrNameInput = "";
  13536. aClass19_1013 = new NodeList();
  13537. aBoolean1017 = false;
  13538. anInt1018 = -1;
  13539. anIntArray1030 = new int[5];
  13540. aBoolean1031 = false;
  13541. mapFunctions = new Sprite[100];
  13542. dialogID = -1;
  13543. maxStats = new int[Skills.SKILLS_COUNT];
  13544. anIntArray1045 = new int[2000];
  13545. aBoolean1047 = true;
  13546. anIntArray1052 = new int[152];
  13547. anIntArray1229 = new int[152];
  13548. anInt1054 = -1;
  13549. aClass19_1056 = new NodeList();
  13550. anIntArray1057 = new int[33];
  13551. aClass9_1059 = new RSInterface();
  13552. mapScenes = new Background[100];
  13553. barFillColor = 0x4d4233;
  13554. anIntArray1065 = new int[7];
  13555. anIntArray1072 = new int[1000];
  13556. anIntArray1073 = new int[1000];
  13557. aBoolean1080 = false;
  13558. friendsList = new String[200];
  13559. inStream = Stream.create();
  13560. expectedCRCs = new int[9];
  13561. menuActionCmd2 = new int[500];
  13562. menuActionCmd3 = new int[500];
  13563. menuActionID = new int[500];
  13564. menuActionCmd1 = new int[500];
  13565. headIcons = new Sprite[20];
  13566. skullIcons = new Sprite[20];
  13567. headIconsHint = new Sprite[20];
  13568. tabAreaAltered = false;
  13569. aString1121 = "";
  13570. atPlayerActions = new String[5];
  13571. atPlayerArray = new boolean[5];
  13572. anIntArrayArrayArray1129 = new int[4][13][13];
  13573. anInt1132 = 2;
  13574. aClass30_Sub2_Sub1_Sub1Array1140 = new Sprite[1000];
  13575. aBoolean1141 = false;
  13576. aBoolean1149 = false;
  13577. crosses = new Sprite[8];
  13578. musicEnabled = true;
  13579. loggedIn = false;
  13580. canMute = false;
  13581. aBoolean1159 = false;
  13582. aBoolean1160 = false;
  13583. anInt1171 = 1;
  13584. myUsername = "";
  13585. myPassword = "";
  13586. genericLoadingError = false;
  13587. reportAbuseInterfaceID = -1;
  13588. aClass19_1179 = new NodeList();
  13589. anInt1184 = 128;
  13590. invOverlayInterfaceID = -1;
  13591. stream = Stream.create();
  13592. menuActionName = new String[500];
  13593. anIntArray1203 = new int[5];
  13594. anIntArray1207 = new int[50];
  13595. anInt1210 = 2;
  13596. anInt1211 = 78;
  13597. promptInput = "";
  13598. modIcons = new Sprite[ClientConstants.ICON_AMOUNT];
  13599. tabID = 3;
  13600. inputTaken = false;
  13601. songChanging = true;
  13602. aClass11Array1230 = new Class11[4];
  13603. anIntArray1240 = new int[100];
  13604. anIntArray1241 = new int[50];
  13605. aBoolean1242 = false;
  13606. anIntArray1250 = new int[50];
  13607. rsAlreadyLoaded = false;
  13608. welcomeScreenRaised = false;
  13609. messagePromptRaised = false;
  13610. loginMessage1 = "Welcome to Vencillo";
  13611. loginMessage2 = "Enter in your account details and begin playing!";
  13612. backDialogID = -1;
  13613. anInt1279 = 2;
  13614. bigX = new int[4000];
  13615. bigY = new int[4000];
  13616. }
  13617.  
  13618. public int rights;
  13619. public String name;
  13620. public String message;
  13621. public String clanname;
  13622. private int[] chatRights;
  13623. public int chatTypeView;
  13624. public int clanChatMode;
  13625. public static Sprite[] cacheSprite;
  13626. private ImageProducer leftFrame;
  13627. private ImageProducer topFrame;
  13628. private int ignoreCount;
  13629. private long aLong824;
  13630. private int[][] anIntArrayArray825;
  13631. private int[] friendsNodeIDs;
  13632. private NodeList[][][] groundArray;
  13633. public int[] anIntArray828;
  13634. public int[] anIntArray829;
  13635. private volatile boolean aBoolean831;
  13636. private Socket aSocket832;
  13637. int loginScreenState;
  13638. private Stream aStream_834;
  13639. private Npc[] npcArray;
  13640. private int npcCount;
  13641. private int[] npcIndices;
  13642. private int anInt839;
  13643. private int[] anIntArray840;
  13644. private int anInt841;
  13645. private int anInt842;
  13646. private int anInt843;
  13647. private String aString844;
  13648. public String prayerBook;
  13649. private int privateChatMode;
  13650. private Stream aStream_847;
  13651. private boolean aBoolean848;
  13652. private static int anInt849;
  13653. public int[] anIntArray850;
  13654. private int[] anIntArray851;
  13655. private int[] anIntArray852;
  13656. private int[] anIntArray853;
  13657. private static int anInt854;
  13658. private int anInt855;
  13659. static int openInterfaceID;
  13660. private int xCameraPos;
  13661. private int zCameraPos;
  13662. private int yCameraPos;
  13663. private int yCameraCurve;
  13664. private int xCameraCurve;
  13665. static int myPrivilege;
  13666. private final int[] currentExp;
  13667. private Sprite mapFlag;
  13668. private Sprite mapMarker;
  13669. private boolean aBoolean872;
  13670. private final int[] anIntArray873;
  13671. private final boolean[] aBooleanArray876;
  13672. private int weight;
  13673. private MouseDetection mouseDetection;
  13674. private volatile boolean drawFlames;
  13675. private String reportAbuseInput;
  13676. private int unknownInt10;
  13677. private boolean menuOpen;
  13678. private int anInt886;
  13679. private String inputString;
  13680. private final int maxPlayers;
  13681. private final int myPlayerIndex;
  13682. private Player[] playerArray;
  13683. private int playerCount;
  13684. private int[] playerIndices;
  13685. private int anInt893;
  13686. private int[] anIntArray894;
  13687. private Stream[] aStreamArray895s;
  13688. private int anInt896;
  13689. public int anInt897;
  13690. private int friendsCount;
  13691. private int anInt900;
  13692. private int[][] anIntArrayArray901;
  13693. private byte[] aByteArray912;
  13694. private int anInt913;
  13695. private int crossX;
  13696. private int crossY;
  13697. private int crossIndex;
  13698. private int crossType;
  13699. private int plane;
  13700. private final int[] currentStats;
  13701. private static int anInt924;
  13702. private final long[] ignoreListAsLongs;
  13703. private boolean loadingError;
  13704. private final int[] anIntArray928;
  13705. private int[][] anIntArrayArray929;
  13706. private Sprite aClass30_Sub2_Sub1_Sub1_931;
  13707. private Sprite aClass30_Sub2_Sub1_Sub1_932;
  13708. private int anInt933;
  13709. private int anInt934;
  13710. private int anInt935;
  13711. private int anInt936;
  13712. private int anInt937;
  13713. private int anInt938;
  13714. private final int[] chatTypes;
  13715. private final String[] chatNames;
  13716. private final String[] chatMessages;
  13717. private int anInt945;
  13718. private WorldController worldController;
  13719. private Sprite[] sideIcons;
  13720. private int menuScreenArea;
  13721. private int menuOffsetX;
  13722. private int menuOffsetY;
  13723. private int menuWidth;
  13724. private int menuHeight;
  13725. private long aLong953;
  13726. private boolean aBoolean954;
  13727. private long[] friendsListAsLongs;
  13728. private String[] clanList = new String[100];
  13729. private int currentSong;
  13730. private static int nodeID = 10;
  13731. static int portOff;
  13732. static boolean clientData;
  13733. private static boolean isMembers = true;
  13734. private static boolean lowMem;
  13735. private volatile boolean drawingFlames;
  13736. private int spriteDrawX;
  13737. private int spriteDrawY;
  13738. private final int[] anIntArray965 = { 0xffff00, 0xff0000, 65280, 65535, 0xff00ff, 0xffffff };
  13739. public Background aBackground_966;
  13740. public Background aBackground_967;
  13741. private final int[] anIntArray968;
  13742. public final int[] anIntArray969;
  13743. final Decompressor[] decompressors;
  13744. public int variousSettings[];
  13745. private boolean aBoolean972;
  13746. private final int anInt975;
  13747. private final int[] anIntArray976;
  13748. private final int[] anIntArray977;
  13749. private final int[] anIntArray978;
  13750. private final int[] anIntArray979;
  13751. private final int[] anIntArray980;
  13752. private final int[] anIntArray981;
  13753. private final int[] anIntArray982;
  13754. private final String[] aStringArray983;
  13755. private int anInt984;
  13756. private int anInt985;
  13757. private static int anInt986;
  13758. private Sprite[] hitMarks;
  13759. private Sprite[] hitMark;
  13760. private Sprite[] hitIcon;
  13761. public int anInt988;
  13762. private int dragCycle;
  13763. private final int[] anIntArray990;
  13764. private final boolean aBoolean994;
  13765. private int anInt995;
  13766. private int anInt996;
  13767. private int anInt997;
  13768. private int anInt998;
  13769. private int anInt999;
  13770. private ISAACRandomGen encryption;
  13771. private Sprite multiOverlay;
  13772. 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 } };
  13773. private String amountOrNameInput;
  13774. private static int anInt1005;
  13775. private int daysSinceLastLogin;
  13776. private int pktSize;
  13777. private int pktType;
  13778. private int anInt1009;
  13779. private int anInt1010;
  13780. private int anInt1011;
  13781. private NodeList aClass19_1013;
  13782. private int anInt1014;
  13783. private int anInt1015;
  13784. private int anInt1016;
  13785. private boolean aBoolean1017;
  13786. private int anInt1018;
  13787. private int anInt1021;
  13788. private int anInt1022;
  13789. public static int loadingStage;
  13790. private Sprite scrollBar1;
  13791. private Sprite scrollBar2;
  13792. private int anInt1026;
  13793. private final int[] anIntArray1030;
  13794. private boolean aBoolean1031;
  13795. private Sprite[] mapFunctions;
  13796. private int baseX;
  13797. private int baseY;
  13798. private int anInt1036;
  13799. private int anInt1037;
  13800. public int loginFailures;
  13801. private int anInt1039;
  13802. public int anInt1040;
  13803. public int anInt1041;
  13804. private int dialogID;
  13805. public Sprite[] skillIcons = new Sprite[22];
  13806. public Sprite[] newHitMarks = new Sprite[4];
  13807. public Sprite[] channelButtons = new Sprite[4];
  13808. public Sprite[] fixedGameComponents = new Sprite[4];
  13809. public Sprite[] gameComponents = new Sprite[5];
  13810. public Sprite[] orbComponents = new Sprite[15];
  13811. public Sprite[] orbComponents2 = new Sprite[7];
  13812. public Sprite[] orbComponents3 = new Sprite[10];
  13813. public Sprite[] redStones = new Sprite[6];
  13814. public Sprite[] hpBars = new Sprite[2];
  13815. private final int[] maxStats;
  13816. private final int[] anIntArray1045;
  13817. private int anInt1046;
  13818. private boolean aBoolean1047;
  13819. private int anInt1048;
  13820. private String aString1049;
  13821. private static int anInt1051;
  13822. private final int[] anIntArray1052;
  13823. private StreamLoader titleStreamLoader;
  13824. private int anInt1054;
  13825. private int anInt1055;
  13826. private NodeList aClass19_1056;
  13827. private final int[] anIntArray1057;
  13828. public final RSInterface aClass9_1059;
  13829. private Background[] mapScenes;
  13830. private int anInt1062;
  13831. private final int barFillColor;
  13832. private int friendsListAction;
  13833. private final int[] anIntArray1065;
  13834. private int mouseInvInterfaceIndex;
  13835. private int lastActiveInvInterface;
  13836. public OnDemandFetcher onDemandFetcher;
  13837. private int anInt1069;
  13838. private int anInt1070;
  13839. private int anInt1071;
  13840. private int[] anIntArray1072;
  13841. private int[] anIntArray1073;
  13842. private Sprite mapDotItem;
  13843. private Sprite mapDotNPC;
  13844. private Sprite mapDotPlayer;
  13845. private Sprite mapDotFriend;
  13846. private Sprite mapDotTeam;
  13847. private Sprite mapDotClan;
  13848. private int anInt1079;
  13849. private boolean aBoolean1080;
  13850. private String[] friendsList;
  13851. private Stream inStream;
  13852. private int focusedDragWidget;
  13853. private int dragFromSlot;
  13854. private int activeInterfaceType;
  13855. private int pressX;
  13856. private int pressY;
  13857. public static int anInt1089;
  13858. public static int spellID = 0;
  13859. public static int totalRead = 0;
  13860. private final int[] expectedCRCs;
  13861. private int[] menuActionCmd2;
  13862. private int[] menuActionCmd3;
  13863. private int[] menuActionID;
  13864. private int[] menuActionCmd1;
  13865. private Sprite[] headIcons;
  13866. private Sprite[] skullIcons;
  13867. private Sprite[] headIconsHint;
  13868. private static int anInt1097;
  13869. private int anInt1098;
  13870. private int anInt1099;
  13871. private int anInt1100;
  13872. private int anInt1101;
  13873. private int anInt1102;
  13874. private static boolean tabAreaAltered;
  13875. private int anInt1104;
  13876. private ImageProducer aRSImageProducer_1107;
  13877. public ImageProducer aRSImageProducer_1108;
  13878. static ImageProducer aRSImageProducer_1109;
  13879. private ImageProducer aRSImageProducer_1110;
  13880. private ImageProducer aRSImageProducer_1111;
  13881. public ImageProducer aRSImageProducer_1112;
  13882. public ImageProducer aRSImageProducer_1113;
  13883. public ImageProducer aRSImageProducer_1114;
  13884. public ImageProducer aRSImageProducer_1115;
  13885. private static int anInt1117;
  13886. private int membersInt;
  13887. private String aString1121;
  13888. private Sprite compass;
  13889. private ImageProducer aRSImageProducer_1125;
  13890. public static Player myPlayer;
  13891. private final String[] atPlayerActions;
  13892. private final boolean[] atPlayerArray;
  13893. private final int[][][] anIntArrayArrayArray1129;
  13894. public static final int[] tabInterfaceIDs = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 };
  13895. private int anInt1131;
  13896. public int anInt1132;
  13897. private int menuActionRow;
  13898. private static int anInt1134;
  13899. private int spellSelected;
  13900. private int anInt1137;
  13901. private int spellUsableOn;
  13902. private String spellTooltip;
  13903. private Sprite[] aClass30_Sub2_Sub1_Sub1Array1140;
  13904. private boolean aBoolean1141;
  13905. private static int anInt1142;
  13906. private int energy;
  13907. private boolean aBoolean1149;
  13908. private Sprite[] crosses;
  13909. private boolean musicEnabled;
  13910. private Background[] aBackgroundArray1152s;
  13911. private int unreadMessages;
  13912. private static int anInt1155;
  13913. private static boolean fpsOn;
  13914. public static boolean loggedIn;
  13915. private boolean canMute;
  13916. private boolean aBoolean1159;
  13917. private boolean aBoolean1160;
  13918. static int loopCycle;
  13919. public static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  13920. private static ImageProducer aRSImageProducer_1163;
  13921. private ImageProducer aRSImageProducer_1164;
  13922. private static ImageProducer aRSImageProducer_1165;
  13923. private static ImageProducer aRSImageProducer_1166;
  13924. private int daysSinceRecovChange;
  13925. private RSSocket socketStream;
  13926. private int anInt1169;
  13927. private int minimapInt3;
  13928. public int anInt1171;
  13929. static int getCombatLevel;
  13930. static String myUsername;
  13931. static String myPassword;
  13932. private static int anInt1175;
  13933. private boolean genericLoadingError;
  13934. 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 };
  13935. private int reportAbuseInterfaceID;
  13936. private NodeList aClass19_1179;
  13937. private static int[] anIntArray1180;
  13938. private static int[] anIntArray1181;
  13939. private static int[] anIntArray1182;
  13940. private byte[][] aByteArrayArray1183;
  13941. private int anInt1184;
  13942. private int minimapInt1;
  13943. private int anInt1186;
  13944. private int anInt1187;
  13945. private static int anInt1188;
  13946. private int invOverlayInterfaceID;
  13947. private int[] anIntArray1190;
  13948. private int[] anIntArray1191;
  13949. public static Stream stream;
  13950. private int anInt1193;
  13951. private int splitPrivateChat;
  13952. private Background mapBack;
  13953. private String[] menuActionName;
  13954. private Sprite aClass30_Sub2_Sub1_Sub1_1201;
  13955. private Sprite aClass30_Sub2_Sub1_Sub1_1202;
  13956. private final int[] anIntArray1203;
  13957. static final int[] anIntArray1204 = { 9104, 10275, 7595, 3610, 7975, 8526, 918, 38802, 24466, 10145, 58654, 5027, 1457, 16565, 34991, 25486 };
  13958. private static boolean flagged;
  13959. private final int[] anIntArray1207;
  13960. private int minimapInt2;
  13961. public int anInt1210;
  13962. static int anInt1211;
  13963. private String promptInput;
  13964. private int anInt1213;
  13965. private int[][][] intGroundArray;
  13966. private long aLong1215;
  13967. int loginScreenCursorPos;
  13968. private final Sprite[] modIcons;
  13969. private long aLong1220;
  13970. static int tabID;
  13971. private int anInt1222;
  13972. public static boolean inputTaken;
  13973. private int inputDialogState;
  13974. private static int anInt1226;
  13975. private int nextSong;
  13976. private boolean songChanging;
  13977. private final int[] anIntArray1229;
  13978. private Class11[] aClass11Array1230;
  13979. public static int anIntArray1232[];
  13980. private int[] anIntArray1234;
  13981. private int[] anIntArray1235;
  13982. private int[] anIntArray1236;
  13983. private int anInt1237;
  13984. private int anInt1238;
  13985. public final int anInt1239 = 100;
  13986. private final int[] anIntArray1240;
  13987. private final int[] anIntArray1241;
  13988. private boolean aBoolean1242;
  13989. private int atInventoryLoopCycle;
  13990. private int atInventoryInterface;
  13991. private int atInventoryIndex;
  13992. private int atInventoryInterfaceType;
  13993. private byte[][] aByteArrayArray1247;
  13994. private int tradeMode;
  13995. private int anInt1249;
  13996. private final int[] anIntArray1250;
  13997. private int anInt1251;
  13998. private final boolean rsAlreadyLoaded;
  13999. private int anInt1253;
  14000. public int anInt1254;
  14001. private boolean welcomeScreenRaised;
  14002. private boolean messagePromptRaised;
  14003. private byte[][][] byteGroundArray;
  14004. private int prevSong;
  14005. private int destX;
  14006. private int destY;
  14007. public static Sprite minimapImage;
  14008. private int anInt1264;
  14009. private int anInt1265;
  14010. String loginMessage1;
  14011. String loginMessage2;
  14012. private int anInt1268;
  14013. private int anInt1269;
  14014. public int drawCount;
  14015. public int fullscreenInterfaceID;
  14016. public int anInt1044;
  14017. public int anInt1129;
  14018. public int anInt1315;
  14019. public int anInt1500;
  14020. public int anInt1501;
  14021. public static int[] fullScreenTextureArray;
  14022. public static TextDrawingArea smallText;
  14023. public static TextDrawingArea regularText;
  14024. public static TextDrawingArea boldText;
  14025. public RSFont newSmallFont;
  14026. public static RSFont newRegularFont;
  14027. public static RSFont newBoldFont;
  14028. public static RSFont newFancyFont;
  14029. public int anInt1275;
  14030. public static int backDialogID;
  14031. private int anInt1278;
  14032. public int anInt1279;
  14033. private int[] bigX;
  14034. private int[] bigY;
  14035. private int itemSelected;
  14036. private int anInt1283;
  14037. private int anInt1284;
  14038. private int anInt1285;
  14039. private String selectedItemName;
  14040. private int publicChatMode;
  14041. private static int anInt1288;
  14042. public static int anInt1290;
  14043. public static String server = "";
  14044. public static boolean rememberMe = false;
  14045. private int modifiableXValue = 0;
  14046.  
  14047. public void resetAllImageProducers() {
  14048. if (super.fullGameScreen != null) {
  14049. return;
  14050. }
  14051. aRSImageProducer_1166 = null;
  14052. aRSImageProducer_1164 = null;
  14053. aRSImageProducer_1163 = null;
  14054. aRSImageProducer_1165 = null;
  14055. aRSImageProducer_1125 = null;
  14056. aRSImageProducer_1107 = null;
  14057. aRSImageProducer_1108 = null;
  14058. aRSImageProducer_1109 = null;
  14059. aRSImageProducer_1110 = null;
  14060. aRSImageProducer_1111 = null;
  14061. aRSImageProducer_1112 = null;
  14062. aRSImageProducer_1113 = null;
  14063. aRSImageProducer_1114 = null;
  14064. aRSImageProducer_1115 = null;
  14065. super.fullGameScreen = new ImageProducer(765, 503);
  14066. welcomeScreenRaised = true;
  14067. }
  14068.  
  14069. public void mouseWheelDragged(int i, int j) {
  14070. if (!mouseWheelDown) {
  14071. return;
  14072. }
  14073. screenGliding = 0;
  14074. this.anInt1186 += i * 3;
  14075. this.anInt1187 += (j << 1);
  14076. }
  14077.  
  14078. public void launchURL(String url) {
  14079. String osName = System.getProperty("os.name");
  14080. try {
  14081. if (osName.startsWith("Mac OS")) {
  14082. Class<?> fileMgr = Class.forName("com.apple.eio.FileManager");
  14083. Method openURL = fileMgr.getDeclaredMethod("openURL", new Class[] { String.class });
  14084. openURL.invoke(null, new Object[] { url });
  14085. } else if (osName.startsWith("Windows"))
  14086. Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
  14087. else { // assume Unix or Linux
  14088. String[] browsers = { "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape", "safari" };
  14089. String browser = null;
  14090. for (int count = 0; count < browsers.length && browser == null; count++)
  14091. if (Runtime.getRuntime().exec(new String[] { "which", browsers[count] }).waitFor() == 0)
  14092. browser = browsers[count];
  14093. if (browser == null) {
  14094. throw new Exception("Could not find web browser");
  14095. } else
  14096. Runtime.getRuntime().exec(new String[] { browser, url });
  14097. }
  14098. } catch (Exception e) {
  14099. pushMessage("Failed to open URL.", 0, "");
  14100. }
  14101. }
  14102.  
  14103. public String entityFeedName;
  14104. public int entityFeedHP;
  14105. public int entityFeedMaxHP;
  14106. public int entityFeedHP2;
  14107. public int entityAlpha;
  14108.  
  14109. public void pushFeed(String entityName, int HP, int maxHP) {
  14110. entityFeedHP2 = entityFeedHP <= 0 ? entityFeedMaxHP : entityFeedHP;
  14111. entityFeedName = entityName;
  14112. entityFeedHP = HP;
  14113. entityFeedMaxHP = maxHP;
  14114. entityAlpha = 255;
  14115. }
  14116.  
  14117. @SuppressWarnings("unused")
  14118. private void displayEntityFeed() {
  14119. if (entityFeedName == null) {
  14120. return;
  14121. }
  14122. double percentage = entityFeedHP / (double) entityFeedMaxHP;
  14123. double percentage2 = (entityFeedHP2 - entityFeedHP) / (double) entityFeedMaxHP;
  14124. int width = (int) (135 * percentage);
  14125. int xOff = 3;
  14126. int yOff = 25;
  14127. DrawingArea.drawAlphaPixels(xOff, yOff, 145, 41, 0x000000, 115);
  14128. newBoldFont.drawCenteredString(entityFeedName, xOff + 72, yOff + 13, 0xFDFDFD, 0);
  14129. DrawingArea.drawAlphaPixels(xOff + 6 + width, yOff + 18, 135 - width, 15, 0xFF0000, 130);
  14130. DrawingArea.drawAlphaPixels(xOff + 6, yOff + 18, width, 15, 0x00DB00, 130);
  14131. if (entityAlpha > 0) {
  14132. entityAlpha -= 5;
  14133. DrawingArea.drawAlphaPixels(xOff + 6 + width, yOff + 18, (int) (135 * percentage2), 15, 0x00DB00, (int) (130 * entityAlpha / 255.0));
  14134. }
  14135. DrawingArea.drawAlphaPixels(xOff + 6, yOff + 18, width, 15, 0x00DB00, 130);
  14136. newBoldFont.drawCenteredString(NumberFormat.getInstance(Locale.US).format(entityFeedHP) + " / " + NumberFormat.getInstance(Locale.US).format(entityFeedMaxHP), xOff + 72, yOff + 31, 0xFDFDFD, 0);
  14137. }
  14138.  
  14139. public String[] feedKiller = new String[5];
  14140. public String[] feedVictim = new String[5];
  14141. public int[] feedWeapon = new int[5];
  14142. public boolean[] feedPoison = new boolean[5];
  14143. public Sprite[] feedImage = new Sprite[5];
  14144. public int[] feedAlpha = new int[5];
  14145. public int[] feedYPos = new int[5];
  14146. public int killsDisplayed = 5;
  14147.  
  14148. public void pushKill(String killer, String victim, int weapon, boolean poison) {
  14149. for (int index = killsDisplayed - 1; index > 0; index--) {
  14150. feedKiller[index] = feedKiller[index - 1];
  14151. feedVictim[index] = feedVictim[index - 1];
  14152. feedWeapon[index] = feedWeapon[index - 1];
  14153. feedPoison[index] = feedPoison[index - 1];
  14154. feedAlpha[index] = feedAlpha[index - 1];
  14155. feedYPos[index] = feedYPos[index - 1];
  14156. }
  14157. feedKiller[0] = killer;
  14158. feedVictim[0] = victim;
  14159. feedWeapon[0] = weapon;
  14160. feedPoison[0] = poison;
  14161. feedAlpha[0] = 0;
  14162. feedYPos[0] = 0;
  14163. }
  14164.  
  14165. public void displayKillFeed() {
  14166. int x = 5;
  14167. for (int index = 0; index < killsDisplayed; index++) {
  14168. if (feedKiller[index] != null && feedVictim[index] != null) {
  14169. if (feedKiller[index].length() > 0) {
  14170. if (feedWeapon[index] == -1) {
  14171. return;
  14172. }
  14173. if (feedKiller[index].equalsIgnoreCase(myUsername)) {
  14174. feedKiller[index] = "You";
  14175. }
  14176. if (feedVictim[index].equalsIgnoreCase(myUsername)) {
  14177. feedVictim[index] = "You";
  14178. }
  14179. if (feedYPos[index] < (index + 1) * 22) {
  14180. feedYPos[index] += 1;
  14181. if (index == 0) {
  14182. feedAlpha[index] += 256 / 22;
  14183. }
  14184. } else if (feedYPos[index] == (index + 1) * 22) {
  14185. if (feedAlpha[index] > 200) {
  14186. feedAlpha[index] -= 1;
  14187. } else if (feedAlpha[index] <= 200 && feedAlpha[index] > 0) {
  14188. feedAlpha[index] -= 5;
  14189. }
  14190. if (feedAlpha[index] < 0) {
  14191. feedAlpha[index] = 0;
  14192. }
  14193. if (feedAlpha[index] == 0) {
  14194. clearKill(index);
  14195. }
  14196. }
  14197. if (feedAlpha[index] != 0) {
  14198. String killerText = "[" + feedKiller[index] + "] ";
  14199. String victimText = " [" + feedVictim[index] + "]";
  14200. String posionText = " <col=00ff00>[poisoned]</col>";
  14201. DrawingArea.drawAlphaGradient(x, feedYPos[index], newSmallFont.getTextWidth(killerText + victimText + (feedPoison[index] ? posionText : "")) + 22, 19, 0, 0, feedAlpha[index]);
  14202. newSmallFont.drawBasicString("<trans=" + feedAlpha[index] + ">" + killerText, x + 3, feedYPos[index] + 14, 0xffffff, 0);
  14203. newSmallFont.drawBasicString("<trans=" + feedAlpha[index] + ">" + victimText + (feedPoison[index] ? posionText : ""), x + 3 + newSmallFont.getTextWidth(killerText) + 16, feedYPos[index] + 14, 0xffffff, 0);
  14204. if (feedWeapon[index] != -1 && feedWeapon[index] != 65535) {
  14205. feedImage[index] = ItemDef.getSprite(feedWeapon[index], 0, 0x000000, 2);
  14206. }
  14207. if (feedImage[index] != null) {
  14208. feedImage[index].drawTransparentSprite(newSmallFont.getTextWidth(killerText) + 0, feedYPos[index] - 6, feedAlpha[index]);
  14209. }
  14210. }
  14211. }
  14212. }
  14213. }
  14214. }
  14215.  
  14216. public void hitmarkDraw(int hitLength, int type, int icon, int damage, int move, int opacity) {
  14217. if (damage > 0) {
  14218. Sprite end1 = null, middle = null, end2 = null;
  14219. int x = 0;
  14220. switch (hitLength) {
  14221. case 1:
  14222. x = 8;
  14223. break;
  14224. case 2:
  14225. x = 4;
  14226. break;
  14227. case 3:
  14228. x = 1;
  14229. break;
  14230. }
  14231. switch (type) {
  14232. case 1:
  14233. end1 = hitMark[0];
  14234. middle = hitMark[1];
  14235. end2 = hitMark[2];
  14236. break;
  14237. case 3:
  14238. end1 = hitMark[3];
  14239. middle = hitMark[4];
  14240. end2 = hitMark[5];
  14241. break;
  14242. case 2:
  14243. end1 = hitMark[6];
  14244. middle = hitMark[7];
  14245. end2 = hitMark[8];
  14246. break;
  14247. }
  14248. if (icon <= 6)
  14249. hitIcon[icon].drawTransparentSprite(spriteDrawX - 34 + x, spriteDrawY - 14 + move, opacity);
  14250. end1.drawTransparentSprite(spriteDrawX - 12 + x, spriteDrawY - 12 + move, opacity);
  14251. x += 4;
  14252. for (int i = 0; i < hitLength * 2; i++) {
  14253. middle.drawTransparentSprite(spriteDrawX - 12 + x, spriteDrawY - 12 + move, opacity);
  14254. x += 4;
  14255. }
  14256. end2.drawTransparentSprite(spriteDrawX - 12 + x, spriteDrawY - 12 + move, opacity);
  14257. if (opacity > 100)
  14258. smallText.drawText(0xffffff, String.valueOf(damage), spriteDrawY + 3 + move, spriteDrawX + 4);
  14259. } else {
  14260. cacheSprite[474].drawTransparentSprite(spriteDrawX - 12, spriteDrawY - 14 + move, opacity);
  14261. }
  14262. }
  14263.  
  14264. public void clearKill(int index) {
  14265. feedKiller[index] = null;
  14266. feedVictim[index] = null;
  14267. feedWeapon[index] = -1;
  14268. feedPoison[index] = false;
  14269. feedAlpha[index] = -1;
  14270. feedYPos[index] = -1;
  14271. }
  14272.  
  14273. static {
  14274. anIntArray1232 = new int[32];
  14275. int i = 2;
  14276. for (int k = 0; k < 32; k++) {
  14277. anIntArray1232[k] = i - 1;
  14278. i += i;
  14279. }
  14280. }
  14281. }
Add Comment
Please, Sign In to add comment